/*! For license information please see main.6f07f748.js.LICENSE.txt */ (()=>{var e={4:(e,t,r)=>{"use strict";var n=r(853),i=r(43),a=r(950);function o(e){var t="https://react.dev/errors/"+e;if(1)":-1--i||l[n]!==c[i]){var u="\n"+l[n].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}}while(1<=n&&0<=i);break}}}finally{z=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?I(r):""}function R(e){switch(e.tag){case 26:case 27:case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return e=O(e.type,!1);case 11:return e=O(e.type.render,!1);case 1:return e=O(e.type,!0);default:return""}}function D(e){try{var t="";do{t+=R(e),e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}function j(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function F(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function B(e){if(j(e)!==e)throw Error(o(188))}function N(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=N(e)))return t;e=e.sibling}return null}var U=Array.isArray,V=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},H=[],G=-1;function W(e){return{current:e}}function $(e){0>G||(e.current=H[G],H[G]=null,G--)}function Z(e,t){G++,H[G]=e.current,e.current=t}var X=W(null),Y=W(null),K=W(null),J=W(null);function Q(e,t){switch(Z(K,t),Z(Y,e),Z(X,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?Yu(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=Ku(e=Yu(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(X),Z(X,t)}function ee(){$(X),$(Y),$(K)}function te(e){null!==e.memoizedState&&Z(J,e);var t=X.current,r=Ku(t,e.type);t!==r&&(Z(Y,e),Z(X,r))}function re(e){Y.current===e&&($(X),$(Y)),J.current===e&&($(J),Dh._currentValue=q)}var ne=Object.prototype.hasOwnProperty,ie=n.unstable_scheduleCallback,ae=n.unstable_cancelCallback,oe=n.unstable_shouldYield,se=n.unstable_requestPaint,le=n.unstable_now,ce=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,he=n.unstable_UserBlockingPriority,pe=n.unstable_NormalPriority,de=n.unstable_LowPriority,fe=n.unstable_IdlePriority,me=n.log,ge=n.unstable_setDisableYieldValue,ye=null,ve=null;function xe(e){if("function"===typeof me&&ge(e),ve&&"function"===typeof ve.setStrictMode)try{ve.setStrictMode(ye,e)}catch(t){}}var be=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(_e(e)/we|0)|0},_e=Math.log,we=Math.LN2;var ke=128,Te=4194304;function Se(e){var t=42&e;if(0!==t)return t;switch(e&-e){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: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 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ae(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=e.warmLanes;e=0!==e.finishedLanes;var s=134217727&r;return 0!==s?0!==(r=s&~i)?n=Se(r):0!==(a&=s)?n=Se(a):e||0!==(o=s&~o)&&(n=Se(o)):0!==(s=r&~i)?n=Se(s):0!==a?n=Se(a):e||0!==(o=r&~o)&&(n=Se(o)),0===n?0:0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(o=t&-t)||32===i&&0!==(4194176&o))?t:n}function Me(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ee(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Ce(){var e=ke;return 0===(4194176&(ke<<=1))&&(ke=128),e}function Pe(){var e=Te;return 0===(62914560&(Te<<=1))&&(Te=4194304),e}function Le(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ze(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-be(t);e.entangledLanes|=t,e.entanglements[n]=1073741824|e.entanglements[n]|4194218&r}function Oe(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-be(r),i=1<=_r),Tr=String.fromCharCode(32),Sr=!1;function Ar(e,t){switch(e){case"keyup":return-1!==xr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mr(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Er=!1;var Cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Cr[e.type]:"textarea"===t}function Lr(e,t,r,n){It?zt?zt.push(n):zt=[n]:It=n,0<(t=Du(t,"onChange")).length&&(r=new Jt("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ir=null,zr=null;function Or(e){Eu(e,0)}function Rr(e){if(pt(Xe(e)))return e}function Dr(e,t){if("change"===e)return t}var jr=!1;if(rt){var Fr;if(rt){var Br="oninput"in document;if(!Br){var Nr=document.createElement("div");Nr.setAttribute("oninput","return;"),Br="function"===typeof Nr.oninput}Fr=Br}else Fr=!1;jr=Fr&&(!document.documentMode||9=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xr(n)}}function Kr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Kr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Jr(e){for(var t=dt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=dt((e=t.contentWindow).document)}return t}function Qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function en(e,t){var r=Jr(t);t=e.focusedElem;var n=e.selectionRange;if(r!==t&&t&&t.ownerDocument&&Kr(t.ownerDocument.documentElement,t)){if(null!==n&&Qr(t))if(e=n.start,void 0===(r=n.end)&&(r=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(r,t.value.length);else if((r=(e=t.ownerDocument||document)&&e.defaultView||window).getSelection){r=r.getSelection();var i=t.textContent.length,a=Math.min(n.start,i);n=void 0===n.end?a:Math.min(n.end,i),!r.extend&&a>n&&(i=n,n=a,a=i),i=Yr(t,a);var o=Yr(t,n);i&&o&&(1!==r.rangeCount||r.anchorNode!==i.node||r.anchorOffset!==i.offset||r.focusNode!==o.node||r.focusOffset!==o.offset)&&((e=e.createRange()).setStart(i.node,i.offset),r.removeAllRanges(),a>n?(r.addRange(e),r.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),r.addRange(e)))}for(e=[],r=t;r=r.parentNode;)1===r.nodeType&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for("function"===typeof t.focus&&t.focus(),t=0;t=document.documentMode,rn=null,nn=null,an=null,on=!1;function sn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;on||null==rn||rn!==dt(n)||("selectionStart"in(n=rn)&&Qr(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},an&&Zr(an,n)||(an=n,0<(n=Du(nn,"onSelect")).length&&(t=new Jt("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=rn)))}function ln(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var cn={animationend:ln("Animation","AnimationEnd"),animationiteration:ln("Animation","AnimationIteration"),animationstart:ln("Animation","AnimationStart"),transitionrun:ln("Transition","TransitionRun"),transitionstart:ln("Transition","TransitionStart"),transitioncancel:ln("Transition","TransitionCancel"),transitionend:ln("Transition","TransitionEnd")},un={},hn={};function pn(e){if(un[e])return un[e];if(!cn[e])return e;var t,r=cn[e];for(t in r)if(r.hasOwnProperty(t)&&t in hn)return un[e]=r[t];return e}rt&&(hn=document.createElement("div").style,"AnimationEvent"in window||(delete cn.animationend.animation,delete cn.animationiteration.animation,delete cn.animationstart.animation),"TransitionEvent"in window||delete cn.transitionend.transition);var dn=pn("animationend"),fn=pn("animationiteration"),mn=pn("animationstart"),gn=pn("transitionrun"),yn=pn("transitionstart"),vn=pn("transitioncancel"),xn=pn("transitionend"),bn=new Map,_n="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function wn(e,t){bn.set(e,t),et(t,[e])}var kn=[],Tn=0,Sn=0;function An(){for(var e=Tn,t=Sn=Tn=0;t>=o,i-=o,Vn=1<<32-be(t)+i|r<p?(d=h,h=null):d=h.sibling;var f=y(i,h,s[p],l);if(null===f){null===h&&(h=d);break}e&&h&&null===f.alternate&&t(i,h),o=a(f,o,p),null===u?c=f:u.sibling=f,u=f,h=d}if(p===s.length)return r(i,h),Yn&&Hn(i,p),c;if(null===h){for(;pd?(f=p,p=null):f=p.sibling;var x=y(i,p,g.value,c);if(null===x){null===p&&(p=f);break}e&&p&&null===x.alternate&&t(i,p),s=a(x,s,d),null===h?u=x:h.sibling=x,h=x,p=f}if(g.done)return r(i,p),Yn&&Hn(i,d),u;if(null===p){for(;!g.done;d++,g=l.next())null!==(g=m(i,g.value,c))&&(s=a(g,s,d),null===h?u=g:h.sibling=g,h=g);return Yn&&Hn(i,d),u}for(p=n(p);!g.done;d++,g=l.next())null!==(g=v(p,i,d,g.value,c))&&(e&&null!==g.alternate&&p.delete(null===g.key?d:g.key),s=a(g,s,d),null===h?u=g:h.sibling=g,h=g);return e&&p.forEach((function(e){return t(i,e)})),Yn&&Hn(i,d),u}(l,p,d=b.call(d),f)}if("function"===typeof d.then)return x(l,p,gi(d),f);if(d.$$typeof===g)return x(l,p,As(l,d),f);vi(l,d)}return"string"===typeof d&&""!==d||"number"===typeof d||"bigint"===typeof d?(d=""+d,null!==p&&6===p.tag?(r(l,p.sibling),(f=i(p,d)).return=l,l=f):(r(l,p),(f=Vl(d,l.mode,f)).return=l,l=f),s(l)):r(l,p)}return function(e,t,r,n){try{mi=0;var i=x(e,t,r,n);return fi=null,i}catch(o){if(o===oi)throw o;var a=Rl(29,o,null,e.mode);return a.lanes=n,a.return=e,a}}}var _i=bi(!0),wi=bi(!1),ki=W(null),Ti=W(0);function Si(e,t){Z(Ti,e=cc),Z(ki,t),cc=e|t.baseLanes}function Ai(){Z(Ti,cc),Z(ki,ki.current)}function Mi(){cc=Ti.current,$(ki),$(Ti)}var Ei=W(null),Ci=null;function Pi(e){var t=e.alternate;Z(Oi,1&Oi.current),Z(Ei,e),null===Ci&&(null===t||null!==ki.current||null!==t.memoizedState)&&(Ci=e)}function Li(e){if(22===e.tag){if(Z(Oi,Oi.current),Z(Ei,e),null===Ci){var t=e.alternate;null!==t&&null!==t.memoizedState&&(Ci=e)}}else Ii()}function Ii(){Z(Oi,Oi.current),Z(Ei,Ei.current)}function zi(e){$(Ei),Ci===e&&(Ci=null),$(Oi)}var Oi=W(0);function Ri(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Di="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach((function(e){return e()}))}},ji=n.unstable_scheduleCallback,Fi=n.unstable_NormalPriority,Bi={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ni(){return{controller:new Di,data:new Map,refCount:0}}function Ui(e){e.refCount--,0===e.refCount&&ji(Fi,(function(){e.controller.abort()}))}var Vi=null,qi=0,Hi=0,Gi=null;function Wi(){if(0===--qi&&null!==Vi){null!==Gi&&(Gi.status="fulfilled");var e=Vi;Vi=null,Hi=0,Gi=null;for(var t=0;ta?a:8;var o=P.T,s={};P.T=s,_o(e,!1,t,r);try{var l=i(),c=P.S;if(null!==c&&c(s,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)bo(e,t,function(e,t){var r=[],n={status:"pending",value:null,reason:null,then:function(e){r.push(e)}};return e.then((function(){n.status="fulfilled",n.value=t;for(var e=0;e title"))),Wu(a,n,r),a[Fe]=e,Ke(a),n=a;break e;case"link":var s=Mh("link","href",i).get(n+(r.href||""));if(s)for(var l=0;l<\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"===typeof n.is?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e="string"===typeof n.is?i.createElement(r,{is:n.is}):i.createElement(r)}}e[Fe]=t,e[Be]=n;e:for(i=t.child;null!==i;){if(5===i.tag||6===i.tag)e.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;null===i.sibling;){if(null===i.return||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(Wu(e,r,n),r){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Hl(t)}}return Zl(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==n&&Hl(t);else{if("string"!==typeof n&&null===t.stateNode)throw Error(o(166));if(e=K.current,ni(t)){if(e=t.stateNode,r=t.memoizedProps,n=null,null!==(i=Zn))switch(i.tag){case 27:case 5:n=i.memoizedProps}e[Fe]=t,(e=!!(e.nodeValue===r||null!==n&&!0===n.suppressHydrationWarning||Vu(e.nodeValue,r)))||ei(t)}else(e=Xu(e).createTextNode(n))[Fe]=t,t.stateNode=e}return Zl(t),null;case 13:if(n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=ni(t),null!==n&&null!==n.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[Fe]=t}else ii(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Zl(t),i=!1}else null!==Kn&&(Oc(Kn),Kn=null),i=!0;if(!i)return 256&t.flags?(zi(t),t):(zi(t),null)}if(zi(t),0!==(128&t.flags))return t.lanes=r,t;if(r=null!==n,e=null!==e&&null!==e.memoizedState,r){i=null,null!==(n=t.child).alternate&&null!==n.alternate.memoizedState&&null!==n.alternate.memoizedState.cachePool&&(i=n.alternate.memoizedState.cachePool.pool);var a=null;null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048)}return r!==e&&r&&(t.child.flags|=8192),Wl(t,t.updateQueue),Zl(t),null;case 4:return ee(),null===e&&Iu(t.stateNode.containerInfo),Zl(t),null;case 10:return xs(t.type),Zl(t),null;case 19:if($(Oi),null===(i=t.memoizedState))return Zl(t),null;if(n=0!==(128&t.flags),null===(a=i.rendering))if(n)$l(i,!1);else{if(0!==uc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=Ri(e))){for(t.flags|=128,$l(i,!1),e=a.updateQueue,t.updateQueue=e,Wl(t,e),t.subtreeFlags=0,e=r,r=t.child;null!==r;)Fl(r,e),r=r.sibling;return Z(Oi,1&Oi.current|2),t.child}e=e.sibling}null!==i.tail&&le()>bc&&(t.flags|=128,n=!0,$l(i,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=Ri(a))){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Wl(t,e),$l(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!Yn)return Zl(t),null}else 2*le()-i.renderingStartTime>bc&&536870912!==r&&(t.flags|=128,n=!0,$l(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,e=Oi.current,Z(Oi,n?1&e|2:1&e),t):(Zl(t),null);case 22:case 23:return zi(t),Mi(),n=null!==t.memoizedState,null!==e?null!==e.memoizedState!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?0!==(536870912&r)&&0===(128&t.flags)&&(Zl(t),6&t.subtreeFlags&&(t.flags|=8192)):Zl(t),null!==(r=t.updateQueue)&&Wl(t,r.retryQueue),r=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(r=e.memoizedState.cachePool.pool),n=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(n=t.memoizedState.cachePool.pool),n!==r&&(t.flags|=2048),null!==e&&$(Zi),null;case 24:return r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xs(Bi),Zl(t),null;case 25:return null}throw Error(o(156,t.tag))}function Yl(e,t){switch($n(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return xs(Bi),ee(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return re(t),null;case 13:if(zi(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));ii()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return $(Oi),null;case 4:return ee(),null;case 10:return xs(t.type),null;case 22:case 23:return zi(t),Mi(),null!==e&&$(Zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return xs(Bi),null;default:return null}}function Kl(e,t){switch($n(t),t.tag){case 3:xs(Bi),ee();break;case 26:case 27:case 5:re(t);break;case 4:ee();break;case 13:zi(t);break;case 19:$(Oi);break;case 10:xs(t.type);break;case 22:case 23:zi(t),Mi(),null!==e&&$(Zi);break;case 24:xs(Bi)}}var Jl={getCacheForType:function(e){var t=Ss(Bi),r=t.data.get(e);return void 0===r&&(r=e(),t.data.set(e,r)),r}},Ql="function"===typeof WeakMap?WeakMap:Map,ec=0,tc=null,rc=null,nc=0,ic=0,ac=null,oc=!1,sc=!1,lc=!1,cc=0,uc=0,hc=0,pc=0,dc=0,fc=0,mc=0,gc=null,yc=null,vc=!1,xc=0,bc=1/0,_c=null,wc=null,kc=!1,Tc=null,Sc=0,Ac=0,Mc=null,Ec=0,Cc=null;function Pc(){if(0!==(2&ec)&&0!==nc)return nc&-nc;if(null!==P.T){return 0!==Hi?Hi:_u()}return De()}function Lc(){0===fc&&(fc=0===(536870912&nc)||Yn?Ce():536870912);var e=Ei.current;return null!==e&&(e.flags|=32),fc}function Ic(e,t,r){(e===tc&&2===ic||null!==e.cancelPendingCommit)&&(Nc(e,0),jc(e,nc,fc,!1)),Ie(e,r),0!==(2&ec)&&e===tc||(e===tc&&(0===(2&ec)&&(pc|=r),4===uc&&jc(e,nc,fc,!1)),mu(e))}function zc(e,t,r){if(0!==(6&ec))throw Error(o(327));for(var n=!r&&0===(60&t)&&0===(t&e.expiredLanes)||Me(e,t),i=n?function(e,t){var r=ec;ec|=2;var n=Vc(),i=qc();tc!==e||nc!==t?(_c=null,bc=le()+500,Nc(e,t)):sc=Me(e,t);e:for(;;)try{if(0!==ic&&null!==rc){t=rc;var a=ac;t:switch(ic){case 1:ic=0,ac=null,Yc(e,t,a,1);break;case 2:if(ci(a)){ic=0,ac=null,Xc(t);break}t=function(){2===ic&&tc===e&&(ic=7),mu(e)},a.then(t,t);break e;case 3:ic=7;break e;case 4:ic=5;break e;case 7:ci(a)?(ic=0,ac=null,Xc(t)):(ic=0,ac=null,Yc(e,t,a,7));break;case 5:var s=null;switch(rc.tag){case 26:s=rc.memoizedState;case 5:case 27:var l=rc;if(!s||Ch(s)){ic=0,ac=null;var c=l.sibling;if(null!==c)rc=c;else{var u=l.return;null!==u?(rc=u,Kc(u)):rc=null}break t}}ic=0,ac=null,Yc(e,t,a,5);break;case 6:ic=0,ac=null,Yc(e,t,a,6);break;case 8:Bc(),uc=6;break e;default:throw Error(o(462))}}$c();break}catch(h){Uc(e,h)}return ys=gs=null,P.H=n,P.A=i,ec=r,null!==rc?0:(tc=null,nc=0,An(),uc)}(e,t):Gc(e,t,!0),a=n;;){if(0===i){sc&&!n&&jc(e,t,0,!1);break}if(6===i)jc(e,t,0,!oc);else{if(r=e.current.alternate,a&&!Dc(r)){i=Gc(e,t,!1),a=!1;continue}if(2===i){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;i=gc;var c=l.current.memoizedState.isDehydrated;if(c&&(Nc(l,s).flags|=256),2!==(s=Gc(l,s,!1))){if(lc&&!c){l.errorRecoveryDisabledLanes|=a,pc|=a,i=4;break e}a=yc,yc=i,null!==a&&Oc(a)}i=s}if(a=!1,2!==i)continue}}if(1===i){Nc(e,0),jc(e,t,0,!0);break}e:{switch(n=e,i){case 0:case 1:throw Error(o(345));case 4:if((4194176&t)===t){jc(n,t,fc,!oc);break e}break;case 2:yc=null;break;case 3:case 5:break;default:throw Error(o(329))}if(n.finishedWork=r,n.finishedLanes=t,(62914560&t)===t&&10<(a=xc+300-le())){if(jc(n,t,fc,!oc),0!==Ae(n,0))break e;n.timeoutHandle=eh(Rc.bind(null,n,r,yc,_c,vc,t,fc,pc,mc,oc,2,-0,0),a)}else Rc(n,r,yc,_c,vc,t,fc,pc,mc,oc,0,-0,0)}}break}mu(e)}function Oc(e){null===yc?yc=e:yc.push.apply(yc,e)}function Rc(e,t,r,n,i,a,s,l,c,u,h,p,d){var f=t.subtreeFlags;if((8192&f||16785408===(16785408&f))&&(Ph={stylesheets:null,count:0,unsuspend:Lh},El(t),null!==(t=function(){if(null===Ph)throw Error(o(475));var e=Ph;return e.stylesheets&&0===e.count&&Oh(e,e.stylesheets),0r?32:r,P.T=null,null===Tc)var a=!1;else{r=Mc,Mc=null;var s=Tc,l=Sc;if(Tc=null,Sc=0,0!==(6&ec))throw Error(o(331));var c=ec;if(ec|=4,Ll(s.current),kl(s,s.current,l,r),ec=c,gu(0,!1),ve&&"function"===typeof ve.onPostCommitFiberRoot)try{ve.onPostCommitFiberRoot(ye,s)}catch(u){}a=!0}return a}finally{V.p=i,P.T=n,eu(e,t)}}return!1}function ru(e,t,r){t=On(r,t),null!==(e=Is(e,t=No(e.stateNode,t,2),2))&&(Ie(e,2),mu(e))}function nu(e,t,r){if(3===e.tag)ru(e,e,r);else for(;null!==t;){if(3===t.tag){ru(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===wc||!wc.has(n))){e=On(r,e),null!==(n=Is(t,r=Uo(2),2))&&(Vo(r,n,t,e),Ie(n,2),mu(n));break}}t=t.return}}function iu(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new Ql;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(lc=!0,i.add(r),e=au.bind(null,e,t,r),t.then(e,e))}function au(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,tc===e&&(nc&r)===r&&(4===uc||3===uc&&(62914560&nc)===nc&&300>le()-xc?0===(2&ec)&&Nc(e,0):dc|=r,mc===nc&&(mc=0)),mu(e)}function ou(e,t){0===t&&(t=Pe()),null!==(e=Cn(e,t))&&(Ie(e,t),mu(e))}function su(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),ou(e,r)}function lu(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==n&&n.delete(t),ou(e,r)}var cu=null,uu=null,hu=!1,pu=!1,du=!1,fu=0;function mu(e){var t;e!==uu&&null===e.next&&(null===uu?cu=uu=e:uu=uu.next=e),pu=!0,hu||(hu=!0,t=yu,nh((function(){0!==(6&ec)?ie(ue,t):t()})))}function gu(e,t){if(!du&&pu){du=!0;do{for(var r=!1,n=cu;null!==n;){if(!t)if(0!==e){var i=n.pendingLanes;if(0===i)var a=0;else{var o=n.suspendedLanes,s=n.pingedLanes;a=(1<<31-be(42|e)+1)-1,a=201326677&(a&=i&~(o&~s))?201326677&a|1:a?2|a:0}0!==a&&(r=!0,bu(n,a))}else a=nc,0===(3&(a=Ae(n,n===tc?a:0)))||Me(n,a)||(r=!0,bu(n,a));n=n.next}}while(r);du=!1}}function yu(){pu=hu=!1;var e=0;0!==fu&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==Qu&&(Qu=e,!0);return Qu=null,!1}()&&(e=fu),fu=0);for(var t=le(),r=null,n=cu;null!==n;){var i=n.next,a=vu(n,t);0===a?(n.next=null,null===r?cu=i:r.next=i,null===i&&(uu=r)):(r=n,(0!==e||0!==(3&a))&&(pu=!0)),n=i}gu(e,!1)}function vu(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=-62914561&e.pendingLanes;0 title"):null)}function Ch(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var Ph=null;function Lh(){}function Ih(){if(this.count--,0===this.count)if(this.stylesheets)Oh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var zh=null;function Oh(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,zh=new Map,t.forEach(Rh,e),zh=null,Ih.call(e))}function Rh(e,t){if(!(4&t.state.loading)){var r=zh.get(e);if(r)var n=r.get(null);else{r=new Map,zh.set(e,r);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a{"use strict";e.exports=r(288)},96:function(e){var t,r;t="undefined"!==typeof self?self:this,r=()=>{"use strict";var e=(()=>{var e=Object.create,t=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,h=(e,t)=>function(){return e&&(t=(0,e[a(e)[0]])(e=0)),t},p=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},d=(e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})},f=(e,r,i,o)=>{if(r&&"object"===typeof r||"function"===typeof r)for(let s of a(r))l.call(e,s)||s===i||t(e,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return e},m=e=>f(t({},"__esModule",{value:!0}),e),g=p({"src/version.js"(e){e.version="3.0.1"}}),y=p({"node_modules/native-promise-only/lib/npo.src.js"(e,t){var r,n,i;r="Promise",n="undefined"!=typeof window?window:e,i=function(){var e,t,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,r,n){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==n})}}catch(g){e=function(e,t,r){return e[t]=r,e}}function a(e,n){r.add(e,n),t||(t=i(r.drain))}function o(e){var t,r=typeof e;return null==e||"object"!=r&&"function"!=r||(t=e.then),"function"==typeof t&&t}function s(){for(var e=0;e0&&a(s,r))}catch(g){u.call(new p(r),g)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function h(e,t,r,n){for(var i=0;it?1:e>=t?0:NaN}function d(e){return null===e?NaN:+e}function f(e){return!isNaN(e)}function m(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}e.ascending=p,e.descending=function(e,t){return te?1:t>=e?0:NaN},e.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++in&&(r=n)}else{for(;++i=n){r=n;break}for(;++in&&(r=n)}return r},e.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i=n){r=n;break}for(;++ir&&(r=n)}else{for(;++i=n){r=n;break}for(;++ir&&(r=n)}return r},e.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a=n){r=i=n;break}for(;++an&&(r=n),i=n){r=i=n;break}for(;++an&&(r=n),i1)return o/(l-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var g=m(p);function y(e){return e.length}e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(1===e.length?function(t,r){return p(e(t),r)}:e)},e.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var v=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}function _(e){return"__proto__"===(e+="")||"\0"===e[0]?"\0"+e:e}function w(e){return"\0"===(e+="")[0]?e.slice(1):e}function k(e){return _(e)in this._}function T(e){return(e=_(e))in this._&&delete this._[e]}function S(){var e=[];for(var t in this._)e.push(w(t));return e}function A(){var e=0;for(var t in this._)++e;return e}function M(){for(var e in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(e){return e}function P(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function L(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=I.length;rt;)i.push(n/a);else for(;(n=e+r*++o)=i.length)return r?r.call(n,a):t?a.sort(t):a;for(var l,c,u,h,p=-1,d=a.length,f=i[s++],m=new b;++p=i.length)return e;var r=[],n=a[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),n?r.sort((function(e,t){return n(e.key,t.key)})):r}return n.map=function(e,t){return o(t,e,0)},n.entries=function(t){return s(o(e.map,t,0),0)},n.key=function(e){return i.push(e),n},n.sortKeys=function(e){return a[i.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new E;if(e)for(var r=0,n=e.length;r=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function U(e){return N(e,G),e}var V=function(e,t){return t.querySelector(e)},q=function(e,t){return t.querySelectorAll(e)},H=function(e,t){var r=e.matches||e[L(e,"matchesSelector")];return(H=function(e,t){return r.call(e,t)})(e,t)};"function"===typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},q=Sizzle,H=Sizzle.matchesSelector),e.selection=function(){return e.select(i.documentElement)};var G=e.selection.prototype=[];function W(e){return"function"===typeof e?e:function(){return V(e,this)}}function $(e){return"function"===typeof e?e:function(){return q(e,this)}}G.select=function(e){var t,r,n,i,a=[];e=W(e);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),X.hasOwnProperty(r)?{space:X[r],local:e}:e}},G.attr=function(t,r){if(arguments.length<2){if("string"===typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(Y(r,t[r]));return this}return this.each(Y(t,r))},G.classed=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node(),n=(e=Q(e)).length,i=-1;if(t=r.classList){for(;++i=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(e){e=le.apply(this,arguments);for(var t=-1,r=this.length;++t0&&(t=t.slice(0,o));var l=de.get(t);function c(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}return l&&(t=l,s=me),o?r?function(){var e=s(r,n(arguments));c.call(this),this.addEventListener(t,this[a]=e,e.$=i),e._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}e.selection.enter=ue,e.selection.enter.prototype=he,he.append=G.append,he.empty=G.empty,he.node=G.node,he.call=G.call,he.size=G.size,he.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s=t&&(t=i+1);!(o=s[t])&&++t1?Me:e<-1?-Me:Math.asin(e)}function Le(e){return((e=Math.exp(e))+1/e)/2}var Ie=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],c=t[2],u=s-i,h=l-a,p=u*u+h*h;if(p0&&(t=t.transition().duration(m)),t.call(w.event)}function M(){c&&c.domain(l.range().map((function(e){return(e-p.x)/p.k})).map(l.invert)),h&&h.domain(u.range().map((function(e){return(e-p.y)/p.k})).map(u.invert))}function E(e){g++||e({type:"zoomstart"})}function C(e){M(),e({type:"zoom",scale:p.k,translate:[p.x,p.y]})}function P(e){--g||(e({type:"zoomend"}),r=null)}function L(){var t=this,r=_.of(t,arguments),n=0,i=e.select(o(t)).on(v,(function(){n=1,S(e.mouse(t),a),C(r)})).on(x,(function(){i.on(v,null).on(x,null),s(n),P(r)})),a=k(e.mouse(t)),s=ve(t);Wi.call(t),E(r)}function I(){var t,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+e.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=e.select(r),d=ve(r);function f(){var n=e.touches(r);return t=p.k,n.forEach((function(e){e.identifier in i&&(i[e.identifier]=k(e))})),n}function m(){var t=e.event.target;e.select(t).on(l,g).on(c,v),u.push(t);for(var n=e.event.changedTouches,o=0,h=n.length;o1){y=d[0];var x=d[1],b=y[0]-x[0],_=y[1]-x[1];a=b*b+_*_}}function g(){var o,l,c,u,h=e.touches(r);Wi.call(r);for(var p=0,d=h.length;p360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new et(a(e+120),a(e),a(e-120))}function Ne(t,r,n){return this instanceof Ne?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ne?new Ne(t.h,t.c,t.l):Ye(t instanceof qe?t.l:(t=st((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ne(t,r,n)}Fe.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new je(this.h,this.s,this.l/e)},Fe.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new je(this.h,this.s,e*this.l)},Fe.rgb=function(){return Be(this.h,this.s,this.l)},e.hcl=Ne;var Ue=Ne.prototype=new De;function Ve(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new qe(r,Math.cos(e*=Ee)*t,Math.sin(e)*t)}function qe(e,t,r){return this instanceof qe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof qe?new qe(e.l,e.a,e.b):e instanceof Ne?Ve(e.h,e.c,e.l):st((e=et(e)).r,e.g,e.b):new qe(e,t,r)}Ue.brighter=function(e){return new Ne(this.h,this.c,Math.min(100,this.l+He*(arguments.length?e:1)))},Ue.darker=function(e){return new Ne(this.h,this.c,Math.max(0,this.l-He*(arguments.length?e:1)))},Ue.rgb=function(){return Ve(this.h,this.c,this.l).rgb()},e.lab=qe;var He=18,Ge=.95047,We=1,$e=1.08883,Ze=qe.prototype=new De;function Xe(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new et(Qe(3.2404542*(i=Ke(i)*Ge)-1.5371385*(n=Ke(n)*We)-.4985314*(a=Ke(a)*$e)),Qe(-.969266*i+1.8760108*n+.041556*a),Qe(.0556434*i-.2040259*n+1.0572252*a))}function Ye(e,t,r){return e>0?new Ne(Math.atan2(r,t)*Ce,Math.sqrt(t*t+r*r),e):new Ne(NaN,NaN,e)}function Ke(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Je(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Qe(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function et(e,t,r){return this instanceof et?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof et?new et(e.r,e.g,e.b):at(""+e,et,Be):new et(e,t,r)}function tt(e){return new et(e>>16,e>>8&255,255&e)}function rt(e){return tt(e)+""}Ze.brighter=function(e){return new qe(Math.min(100,this.l+He*(arguments.length?e:1)),this.a,this.b)},Ze.darker=function(e){return new qe(Math.max(0,this.l-He*(arguments.length?e:1)),this.a,this.b)},Ze.rgb=function(){return Xe(this.l,this.a,this.b)},e.rgb=et;var nt=et.prototype=new De;function it(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function at(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(ct(i[0]),ct(i[1]),ct(i[2]))}return(a=ut.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function ot(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t0&&l<1?0:n),new je(n,i,l)}function st(e,t,r){var n=Je((.4124564*(e=lt(e))+.3575761*(t=lt(t))+.1804375*(r=lt(r)))/Ge),i=Je((.2126729*e+.7151522*t+.072175*r)/We);return qe(116*i-16,500*(n-i),200*(i-Je((.0193339*e+.119192*t+.9503041*r)/$e)))}function lt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ct(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}nt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t=200&&t<300||304===t){try{e=i.call(o,c)}catch(ha){return void s.error.call(o,ha)}s.load.call(o,e)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(t){var r=e.event;e.event=t;try{s.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return i=e,o},["get","post"].forEach((function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}})),o.send=function(e,n,i){if(2===arguments.length&&"function"===typeof n&&(i=n,n=null),c.open(e,t,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(e){i(null,e)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,s,"on"),null==a?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(a))}ut.forEach((function(e,t){ut.set(e,tt(t))})),e.functor=ht,e.xhr=pt(C),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=dt(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i=l)return o;if(i)return i=!1,a;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++24?(isFinite(t)&&(clearTimeout(yt),yt=setTimeout(bt,t)),gt=0):(gt=1,vt(bt))}function _t(){for(var e=Date.now(),t=ft;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function wt(){for(var e,t=ft,r=1/0;t;)t.c?(t.t1&&(t=e[a[o-2]],r=e[a[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function At(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){xt.apply(this,arguments)},e.timer.flush=function(){_t(),wt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=kt,r=Tt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=ht(t),a=ht(r),o=e.length,s=[],l=[];for(n=0;n=0;--n)d.push(e[s[c[n]][2]]);for(n=+h;nwe)s=s.L;else{if(!((i=a-Ht(s,o))>we)){n>-we?(t=s.P,r=s):i>-we?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Bt(e);if(zt.insert(t,l),t||r){if(t===r)return Xt(t),r=Bt(t.site),zt.insert(l,r),l.edge=r.edge=Jt(t.site,l.site),Zt(t),void Zt(r);if(r){Xt(t),Xt(r);var c=t.site,u=c.x,h=c.y,p=e.x-u,d=e.y-h,f=r.site,m=f.x-u,g=f.y-h,y=2*(p*g-d*m),v=p*p+d*d,x=m*m+g*g,b={x:(g*v-d*x)/y+u,y:(p*x-m*v)/y+h};er(r.edge,c,f,b),l.edge=Jt(c,e,null,b),r.edge=Jt(e,f,null,b),Zt(t),Zt(r)}else l.edge=Jt(t.site,l.site)}}function qt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-t;if(!c)return s;var u=s-n,h=1/a-1/c,p=u/c;return h?(-p+Math.sqrt(p*p-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function Ht(e,t){var r=e.N;if(r)return qt(r,t);var n=e.site;return n.y===t?n.x:1/0}function Gt(e){this.site=e,this.edges=[]}function Wt(e,t){return t.angle-e.angle}function $t(){nr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zt(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-ke)){var p=l*l+c*c,d=u*u+g*g,f=(g*p-c*d)/h,m=(l*d-u*p)/h,g=m+s,y=jt.pop()||new $t;y.arc=e,y.site=i,y.x=f+o,y.y=g+Math.sqrt(f*f+m*m),y.cy=g,e.circle=y;for(var v=null,x=Rt._;x;)if(y.y=s)return;if(p>f){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(p>f){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x0)){if(t/=p,p<0){if(t0){if(t>h)return;t>u&&(u=t)}if(t=i-l,p||!(t<0)){if(t/=p,p<0){if(t>h)return;t>u&&(u=t)}else if(p>0){if(t0)){if(t/=d,d<0){if(t0){if(t>h)return;t>u&&(u=t)}if(t=a-c,d||!(t<0)){if(t/=d,d<0){if(t>h)return;t>u&&(u=t)}else if(d>0){if(t0&&(e.a={x:l+u*p,y:c+u*d}),h<1&&(e.b={x:l+h*p,y:c+h*d}),e}}}}}),l=o.length;l--;)(!Yt(t=o[l],e)||!s(t)||v(t.a.x-t.b.x)we||v(i-r)>we)&&(s.splice(o,0,new tr(Qt(a.site,u,v(n-h)we?{x:h,y:v(t-h)we?{x:v(r-f)we?{x:p,y:v(t-p)we?{x:v(r-d)=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/we)*we,y:Math.round(i(e,t)/we)*we,i:t}}))}return o.links=function(e){return sr(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return sr(s(e)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(Wt),u=-1,h=c.length,p=c[h-1].edge,d=p.l===l?p.r:p.l;++ua&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:mr(r,n)})),a=vr.lastIndex;return am&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;hm&&(m=b),_>g&&(g=_),c.push(b),u.push(_)}var w=m-d,k=g-f;function T(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,c=e.y;if(null!=l)if(v(l-r)+v(c-n)<.01)S(e,t,r,n,i,a,o,s);else{var u=e.point;e.x=e.y=e.point=null,S(e,u,l,c,i,a,o,s),S(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else S(e,t,r,n,i,a,o,s)}function S(e,t,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,p=h<<1|u;e.leaf=!1,u?i=l:o=l,h?a=c:s=c,T(e=e.nodes[p]||(e.nodes[p]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}w>k?g=f+w:m=d+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){T(A,e,+y(e,++h),+x(e,h),d,f,m,g)},visit:function(e){pr(e,A,d,f,m,g)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(c,u,h,p,d){if(!(u>a||h>o||p=_)<<1|t>=b,k=w+4;w=0&&!(n=e.interpolators[i](t,r)););return n}function br(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Cr(e){return 1-Math.cos(e*Me)}function Pr(e){return Math.pow(2,10*(e-1))}function Lr(e){return 1-Math.sqrt(1-e*e)}function Ir(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function zr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Or(e){var t,r,n,i=[e.a,e.b],a=[e.c,e.d],o=Dr(i),s=Rr(i,a),l=Dr(((t=a)[0]+=(n=-s)*(r=i)[0],t[1]+=n*r[1],t))||0;i[0]*a[1]=0?e.slice(0,n):e,a=n>=0?e.slice(n+1):"in";return i=wr.get(i)||_r,a=kr.get(a)||C,t=a(i.apply(null,r.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,i=t.c,a=t.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return Ve(n+o*e,i+s*e,a+l*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,i=t.s,a=t.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return Be(n+o*e,i+s*e,a+l*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,i=t.a,a=t.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(e){return Xe(n+o*e,i+s*e,a+l*e)+""}},e.interpolateRound=zr,e.transform=function(t){var r=i.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new Or(t?t.matrix:jr)})(t)},Or.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var jr={a:1,b:0,c:0,d:1,e:0,f:0};function Fr(e){return e.length?e.pop()+",":""}function Br(t,r){var n=[],i=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:mr(e[0],t[0])},{i:i-2,x:mr(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,i),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Fr(r)+"rotate(",null,")")-2,x:mr(e,t)})):t&&r.push(Fr(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,i),function(e,t,r,n){e!==t?n.push({i:r.push(Fr(r)+"skewX(",null,")")-2,x:mr(e,t)}):t&&r.push(Fr(r)+"skewX("+t+")")}(t.skew,r.skew,n,i),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Fr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(e[0],t[0])},{i:i-2,x:mr(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Fr(r)+"scale("+t+")")}(t.scale,r.scale,n,i),t=r=null,function(e){for(var t,r=-1,a=i.length;++r0?n=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:n=0})):e>0&&(l.start({type:"start",alpha:n=e}),t=xt(s.tick)),s):n},s.start=function(){var e,t,r,n=y.length,l=v.length,u=c[0],f=c[1];for(e=0;e=0;)r.push(i[n])}function en(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return en(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Qr(e,(function(e){e.children&&(e.value=0)})),en(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,t,r,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(r=e.value?r/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;ri&&(n=r,i=t);return n}function mn(e){return e.reduce(gn,0)}function gn(e,t){return e+t[1]}function yn(e,t){return vn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function vn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function xn(t){return[e.min(t),e.max(t)]}function bn(e,t){return e.value-t.value}function _n(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function wn(e,t){e._pack_next=t,t._pack_prev=e}function kn(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function Tn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,p=-1/0;if(t.forEach(Sn),(r=t[0]).x=-r.r,r.y=0,x(r),l>1&&((n=t[1]).x=n.r,n.y=0,x(n),l>2))for(En(r,n,i=t[2]),x(i),_n(r,i),r._pack_prev=i,_n(i,n),n=r._pack_next,a=3;a0)for(o=-1;++o=h[0]&&l<=h[1]&&((s=c[e.bisect(p,l,1,f)-1]).y+=m,s.push(a[o]));return c}return a.value=function(e){return arguments.length?(r=e,a):r},a.range=function(e){return arguments.length?(n=ht(e),a):n},a.bins=function(e){return arguments.length?(i="number"===typeof e?function(t){return vn(t,e)}:ht(e),a):i},a.frequency=function(e){return arguments.length?(t=!!e,a):t},a},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(bn),n=0,i=[1,1];function a(e,a){var o=r.call(this,e,a),s=o[0],l=i[0],c=i[1],u=null==t?Math.sqrt:"function"===typeof t?t:function(){return t};if(s.x=s.y=0,en(s,(function(e){e.r=+u(e.value)})),en(s,Tn),n){var h=n*(t?1:Math.max(2*s.r/l,2*s.r/c))/2;en(s,(function(e){e.r+=h})),en(s,Tn),en(s,(function(e){e.r-=h}))}return Mn(s,l/2,c/2,t?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(e){return arguments.length?(i=e,a):i},a.radius=function(e){return arguments.length?(t=null==e||"function"===typeof e?e:+e,a):t},a.padding=function(e){return arguments.length?(n=+e,a):n},Jr(a,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=null;function a(e,a){var c=t.call(this,e,a),u=c[0],h=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;od.x&&(d=e),e.depth>f.depth&&(f=e)}));var m=r(p,d)/2-p.x,g=n[0]/(d.x+r(d,p)/2+m),y=n[1]/(f.depth||1);Qr(u,(function(e){e.x=(e.x+m)*g,e.y=e.depth*y}))}return c}function o(e){var t=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(t.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+r(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+r(e._,i._));e.parent.A=function(e,t,n){if(t){for(var i,a=e,o=e,s=t,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,p=l.m;s=Ln(s),a=Pn(a),s&&a;)l=Pn(l),(o=Ln(o)).a=e,(i=s.z+h-a.z-c+r(s._,a._))>0&&(In(zn(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,p+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!Pn(l)&&(l.t=a,l.m+=c-p,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(i=null==(n=e)?l:null,a):i?null:n},a.nodeSize=function(e){return arguments.length?(i=null==(n=e)?null:l,a):i?n:null},Jr(a,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=!1;function a(a,o){var s,l=t.call(this,a,o),c=l[0],u=0;en(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=s?u+=r(t,s):0,t.y=0,s=t)}));var h=On(c),p=Rn(c),d=h.x-r(h,p)/2,f=p.x+r(p,h)/2;return en(c,i?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-d)/(f-d)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),l}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(i=null==(n=e),a):i?null:n},a.nodeSize=function(e){return arguments.length?(i=null!=(n=e),a):i?n:null},Jr(a,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Dn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,i=-1,a=e.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=d(s,m))<=p?(c.pop(),p=n):(s.area-=s.pop().area,f(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,p=1/0);s.length&&(f(s,m,a,!0),s.length=s.area=0),t.forEach(h)}}function p(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(u(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(f(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(p)}}function d(e,t){for(var r,n=e.area,i=0,a=1/0,o=-1,s=e.length;++oi&&(i=r));return t*=t,(n*=n)?Math.max(t*i*c/n,n/(t*a*c)):1/0}function f(e,t,r,i){var a,o=-1,s=e.length,l=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((i||u>r.dy)&&(u=r.dy);++or.dx)&&(u=r.dx);++o1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Hn:Nn,l=n?Ur:Nr;return i=o(e,t,l,r),a=o(t,e,l,xr),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(zr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return Xn(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return $n(e,t),o()},s.copy=function(){return Gn(e,t,r,n)},o()}function Wn(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function $n(e,t){return Un(e,Vn(Zn(e,t)[2])),Un(e,Vn(Zn(e,t)[2])),e}function Zn(e,t){null==t&&(t=10);var r=Fn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Xn(t,r){return e.range.apply(e,Zn(t,r))}function Yn(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=Un(n.map(i),r?Math:Kn);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Fn(n),o=[],s=e[0],l=e[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=t%1?2:t;if(isFinite(u-c)){if(r){for(;c0;p--)o.push(a(c)*p);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.copy=function(){return Yn(e.copy(),t,r,n)},Wn(o,e)}e.scale.linear=function(){return Gn([0,1],[0,1],xr,!1)},e.scale.log=function(){return Yn(e.scale.linear().domain([0,1]),10,!0,[1,10])};var Kn={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Jn(e,t,r){var n=Qn(t),i=Qn(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return Xn(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain($n(r,e))},a.exponent=function(o){return arguments.length?(n=Qn(t=o),i=Qn(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return Jn(e.copy(),t,r)},Wn(a,e)}function Qn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ei(t,r){var n,i,a;function o(e){return i[((n.get(e)||("range"===r.t?n.set(e,t.push(e)):NaN))-1)%i.length]}function s(r,n){return e.range(t.length).map((function(e){return r+n*e}))}return o.domain=function(e){if(!arguments.length)return t;t=[],n=new b;for(var i,a=-1,s=e.length;++a0?n[e-1]:t[0],eh?0:1;if(c=Ae)return l(c,d)+(s?l(s,1-d):"")+"Z";var f,m,g,y,v,x,b,_,w,k,T,S,A=0,M=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),d||(M*=-1),c&&(M=Pe(g/c*Math.sin(y))),s&&(A=Pe(g/s*Math.sin(y)))),c){v=c*Math.cos(u+M),x=c*Math.sin(u+M),b=c*Math.cos(h-M),_=c*Math.sin(h-M);var C=Math.abs(h-u-2*M)<=Te?0:1;if(M&&gi(v,x,b,_)===d^C){var P=(u+h)/2;v=c*Math.cos(P),x=c*Math.sin(P),b=_=null}}else v=x=0;if(s){w=s*Math.cos(h-A),k=s*Math.sin(h-A),T=s*Math.cos(u+A),S=s*Math.sin(u+A);var L=Math.abs(u-h+2*A)<=Te?0:1;if(A&&gi(w,k,T,S)===1-d^L){var I=(u+h)/2;w=s*Math.cos(I),k=s*Math.sin(I),T=S=null}}else w=k=0;if(p>we&&(f=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function yi(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=e[0]+l,h=e[1]+c,p=t[0]+l,d=t[1]+c,f=(u+p)/2,m=(h+d)/2,g=p-u,y=d-h,v=g*g+y*y,x=r-n,b=u*d-p*h,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-b*b)),w=(b*y-g*_)/v,k=(-b*g-y*_)/v,T=(b*y+g*_)/v,S=(-b*g+y*_)/v,A=w-f,M=k-m,E=T-f,C=S-m;return A*A+M*M>E*E+C*C&&(w=T,k=S),[[w-l,k-c],[w*r/x,k*r/x]]}function vi(){return!0}function xi(e){var t=kt,r=Tt,n=vi,i=_i,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,p=ht(t),d=ht(r);function f(){l.push("M",i(e(c),o))}for(;++u1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ti,basis:Mi,"basis-open":function(e){if(e.length<4)return _i(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Ei(Li,a)+","+Ei(Li,o)),--n;++n9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function _i(e){return e.length>1?e.join("L"):e+"Z"}function wi(e){return e.join("L")+"Z"}function ki(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;cTe)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=ht(e),a):r},a.source=function(t){return arguments.length?(e=ht(t),a):e},a.target=function(e){return arguments.length?(t=ht(e),a):t},a.startAngle=function(e){return arguments.length?(n=ht(e),a):n},a.endAngle=function(e){return arguments.length?(i=ht(e),a):i},a},e.svg.diagonal=function(){var e=Di,t=ji,r=Bi;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=ht(t),n):e},n.target=function(e){return arguments.length?(t=ht(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=Bi,n=t.projection;return t.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Me;return[r*Math.cos(n),r*Math.sin(n)]}}(r=e)):r},t},e.svg.symbol=function(){var e=Ui,t=Ni;function r(r,n){return(qi.get(e.call(this,r,n))||Vi)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ht(t),r):e},r.size=function(e){return arguments.length?(t=ht(e),r):t},r};var qi=e.map({circle:Vi,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Gi)),r=t*Gi;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Hi),r=t*Hi/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Hi),r=t*Hi/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=qi.keys();var Hi=Math.sqrt(3),Gi=Math.tan(30*Ee);G.transition=function(e){for(var t,r,n=Xi||++Ji,i=ta(e),a=[],o=Yi||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--p].call(e,o);if(a>=1)return h.event&&h.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}h||(a=i.time,o=xt((function(e){var t=h.delay;if(o.t=t+a,t<=e)return p(e-t);o.c=p}),0,a),h=u[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++u.count)}Ki.call=G.call,Ki.empty=G.empty,Ki.node=G.node,Ki.size=G.size,e.transition=function(t,r){return t&&t.transition?Xi?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=Ki,Ki.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=W(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",s[1]-s[0])}function m(e){e.select(".extent").attr("y",l[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=e.select(e.event.target),x=n.of(y,arguments),b=e.select(y),_=v.datum(),w=!/^(n|s)$/.test(_)&&i,k=!/^(e|w)$/.test(_)&&a,T=v.classed("extent"),S=ve(y),A=e.mouse(y),M=e.select(o(y)).on("keydown.brush",(function(){32==e.event.keyCode&&(T||(h=null,A[0]-=s[1],A[1]-=l[1],T=2),D())})).on("keyup.brush",(function(){32==e.event.keyCode&&2==T&&(A[0]+=s[1],A[1]+=l[1],T=0,D())}));if(e.event.changedTouches?M.on("touchmove.brush",P).on("touchend.brush",I):M.on("mousemove.brush",P).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),T)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var E=+/w$/.test(_),C=+/^n/.test(_);g=[s[1-E]-A[0],l[1-C]-A[1]],A[0]=s[E],A[1]=l[C]}else e.event.altKey&&(h=A.slice());function P(){var t=e.mouse(y),r=!1;g&&(t[0]+=g[0],t[1]+=g[1]),T||(e.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(t[0]0))return o;do{o.push(a=new Date(+t)),i(t,n),e(t)}while(a=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;i(e,-1),!t(e););else for(;--r>=0;)for(;i(e,1),!t(e););}))},a&&(s.count=function(n,i){return t.setTime(+n),r.setTime(+i),e(t),e(r),Math.floor(a(t,r))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s:null}),s}var i=n((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*o)}),(function(e,t){return(t-e)/o}),(function(e){return e.getUTCSeconds()})),p=h.range,d=n((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o)}),(function(e,t){e.setTime(+e+t*s)}),(function(e,t){return(t-e)/s}),(function(e){return e.getMinutes()})),f=d.range,m=n((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o-e.getMinutes()*s)}),(function(e,t){e.setTime(+e+t*l)}),(function(e,t){return(t-e)/l}),(function(e){return e.getHours()})),g=m.range,y=n((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/c}),(function(e){return e.getDate()-1})),v=y.range;function x(e){return n((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/u}))}var b=x(0),_=x(1),w=x(2),k=x(3),T=x(4),S=x(5),A=x(6),M=b.range,E=_.range,C=w.range,P=k.range,L=T.range,I=S.range,z=A.range,O=n((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),R=O.range,D=n((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));D.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var j=D.range,F=n((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*s)}),(function(e,t){return(t-e)/s}),(function(e){return e.getUTCMinutes()})),B=F.range,N=n((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*l)}),(function(e,t){return(t-e)/l}),(function(e){return e.getUTCHours()})),U=N.range,V=n((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/c}),(function(e){return e.getUTCDate()-1})),q=V.range;function H(e){return n((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/u}))}var G=H(0),W=H(1),$=H(2),Z=H(3),X=H(4),Y=H(5),K=H(6),J=G.range,Q=W.range,ee=$.range,te=Z.range,re=X.range,ne=Y.range,ie=K.range,ae=n((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),oe=ae.range,se=n((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));se.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var le=se.range;e.timeDay=y,e.timeDays=v,e.timeFriday=S,e.timeFridays=I,e.timeHour=m,e.timeHours=g,e.timeInterval=n,e.timeMillisecond=i,e.timeMilliseconds=a,e.timeMinute=d,e.timeMinutes=f,e.timeMonday=_,e.timeMondays=E,e.timeMonth=O,e.timeMonths=R,e.timeSaturday=A,e.timeSaturdays=z,e.timeSecond=h,e.timeSeconds=p,e.timeSunday=b,e.timeSundays=M,e.timeThursday=T,e.timeThursdays=L,e.timeTuesday=w,e.timeTuesdays=C,e.timeWednesday=k,e.timeWednesdays=P,e.timeWeek=b,e.timeWeeks=M,e.timeYear=D,e.timeYears=j,e.utcDay=V,e.utcDays=q,e.utcFriday=Y,e.utcFridays=ne,e.utcHour=N,e.utcHours=U,e.utcMillisecond=i,e.utcMilliseconds=a,e.utcMinute=F,e.utcMinutes=B,e.utcMonday=W,e.utcMondays=Q,e.utcMonth=ae,e.utcMonths=oe,e.utcSaturday=K,e.utcSaturdays=ie,e.utcSecond=h,e.utcSeconds=p,e.utcSunday=G,e.utcSundays=J,e.utcThursday=X,e.utcThursdays=re,e.utcTuesday=$,e.utcTuesdays=ee,e.utcWednesday=Z,e.utcWednesdays=te,e.utcWeek=G,e.utcWeeks=J,e.utcYear=se,e.utcYears=le,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),b=p({"node_modules/d3-time-format/dist/d3-time-format.js"(e,t){var r,n;r=e,n=function(e,t){function r(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function n(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function i(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function a(e){var a=e.dateTime,o=e.date,l=e.time,c=e.periods,u=e.days,h=e.shortDays,p=e.months,ve=e.shortMonths,xe=d(c),be=f(c),_e=d(u),we=f(u),ke=d(h),Te=f(h),Se=d(p),Ae=f(p),Me=d(ve),Ee=f(ve),Ce={a:function(e){return h[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ve[e.getMonth()]},B:function(e){return p[e.getMonth()]},c:null,d:R,e:R,f:N,H:D,I:j,j:F,L:B,m:U,M:V,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ge,s:ye,S:q,u:H,U:G,V:W,w:$,W:Z,x:null,X:null,y:X,Y:Y,Z:K,"%":me},Pe={a:function(e){return h[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ve[e.getUTCMonth()]},B:function(e){return p[e.getUTCMonth()]},c:null,d:J,e:J,f:ne,H:Q,I:ee,j:te,L:re,m:ie,M:ae,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ge,s:ye,S:oe,u:se,U:le,V:ce,w:ue,W:he,x:null,X:null,y:pe,Y:de,Z:fe,"%":me},Le={a:function(e,t,r){var n=ke.exec(t.slice(r));return n?(e.w=Te[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Me.exec(t.slice(r));return n?(e.m=Ee[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Se.exec(t.slice(r));return n?(e.m=Ae[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return Oe(e,a,t,r)},d:S,e:S,f:L,H:M,I:M,j:A,L:P,m:T,M:E,p:function(e,t,r){var n=xe.exec(t.slice(r));return n?(e.p=be[n[0].toLowerCase()],r+n[0].length):-1},q:k,Q:z,s:O,S:C,u:g,U:y,V:v,w:m,W:x,x:function(e,t,r){return Oe(e,o,t,r)},X:function(e,t,r){return Oe(e,l,t,r)},y:_,Y:b,Z:w,"%":I};function Ie(e,t){return function(r){var n,i,a,o=[],l=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++l53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?t.utcMonday.ceil(s):t.utcMonday(s),s=t.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?t.timeMonday.ceil(s):t.timeMonday(s),s=t.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Oe(e,t,r,n){for(var i,a,o=0,l=t.length,c=r.length;o=c)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Le[i in s?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ce.x=Ie(o,Ce),Ce.X=Ie(l,Ce),Ce.c=Ie(a,Ce),Pe.x=Ie(o,Pe),Pe.X=Ie(l,Pe),Pe.c=Ie(a,Pe),{format:function(e){var t=Ie(e+="",Ce);return t.toString=function(){return e},t},parse:function(e){var t=ze(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Ie(e+="",Pe);return t.toString=function(){return e},t},utcParse:function(e){var t=ze(e+="",!0);return t.toString=function(){return e},t}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a68?1900:2e3),r+n[0].length):-1}function w(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function k(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function T(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function S(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function A(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function M(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function E(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function C(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function P(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function L(e,t,r){var n=l.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function z(e,t,r){var n=l.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function O(e,t,r){var n=l.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function R(e,t){return h(e.getDate(),t,2)}function D(e,t){return h(e.getHours(),t,2)}function j(e,t){return h(e.getHours()%12||12,t,2)}function F(e,r){return h(1+t.timeDay.count(t.timeYear(e),e),r,3)}function B(e,t){return h(e.getMilliseconds(),t,3)}function N(e,t){return B(e,t)+"000"}function U(e,t){return h(e.getMonth()+1,t,2)}function V(e,t){return h(e.getMinutes(),t,2)}function q(e,t){return h(e.getSeconds(),t,2)}function H(e){var t=e.getDay();return 0===t?7:t}function G(e,r){return h(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function W(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),h(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function $(e){return e.getDay()}function Z(e,r){return h(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function X(e,t){return h(e.getFullYear()%100,t,2)}function Y(e,t){return h(e.getFullYear()%1e4,t,4)}function K(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+h(t/60|0,"0",2)+h(t%60,"0",2)}function J(e,t){return h(e.getUTCDate(),t,2)}function Q(e,t){return h(e.getUTCHours(),t,2)}function ee(e,t){return h(e.getUTCHours()%12||12,t,2)}function te(e,r){return h(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return h(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ie(e,t){return h(e.getUTCMonth()+1,t,2)}function ae(e,t){return h(e.getUTCMinutes(),t,2)}function oe(e,t){return h(e.getUTCSeconds(),t,2)}function se(e){var t=e.getUTCDay();return 0===t?7:t}function le(e,r){return h(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),h(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function he(e,r){return h(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function pe(e,t){return h(e.getUTCFullYear()%100,t,2)}function de(e,t){return h(e.getUTCFullYear()%1e4,t,4)}function fe(){return"+0000"}function me(){return"%"}function ge(e){return+e}function ye(e){return Math.floor(+e/1e3)}function ve(t){return o=a(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ve({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"]});var xe="%Y-%m-%dT%H:%M:%S.%LZ",be=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat(xe),_e=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse(xe);e.isoFormat=be,e.isoParse=_e,e.timeFormatDefaultLocale=ve,e.timeFormatLocale=a,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,x()):n((r=r||self).d3=r.d3||{},r.d3)}}),_=p({"node_modules/d3-format/dist/d3-format.js"(e,t){var r;r=e,function(e){function t(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function r(e){return(e=t(Math.abs(e)))?e[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){if(!(t=i.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function s(e,r){var n=t(e,r);if(!n)return e+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return s(100*e,t)},r:s,s:function(e,r){var i=t(e,r);if(!i)return e+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+t(e,Math.max(0,r+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,h=Array.prototype.map,p=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(e){var t,i,o=void 0===e.grouping||void 0===e.thousands?c:(t=h.call(e.grouping,Number),i=e.thousands+"",function(e,r){for(var n=e.length,a=[],o=0,s=t[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(e.substring(n-=s,n+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(i)}),s=void 0===e.currency?"":e.currency[0]+"",u=void 0===e.currency?"":e.currency[1]+"",d=void 0===e.decimal?".":e.decimal+"",f=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(h.call(e.numerals,String)),m=void 0===e.percent?"%":e.percent+"",g=void 0===e.minus?"-":e.minus+"",y=void 0===e.nan?"NaN":e.nan+"";function v(e){var t=(e=a(e)).fill,r=e.align,i=e.sign,c=e.symbol,h=e.zero,v=e.width,x=e.comma,b=e.precision,_=e.trim,w=e.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===b&&(b=12),_=!0,w="g"),(h||"0"===t&&"="===r)&&(h=!0,t="0",r="=");var k="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===c?u:/[%p]/.test(w)?m:"",S=l[w],A=/[defgprs%]/.test(w);function M(e){var a,s,l,c=k,u=T;if("c"===w)u=S(e)+u,e="";else{var m=(e=+e)<0||1/e<0;if(e=isNaN(e)?y:S(Math.abs(e),b),_&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),m&&0===+e&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?p[8+n/3]:"")+u+(m&&"("===i?")":""),A)for(a=-1,s=e.length;++a(l=e.charCodeAt(a))||l>57){u=(46===l?d+e.slice(a+1):e.slice(a))+u,e=e.slice(0,a);break}}x&&!h&&(e=o(e,1/0));var M=c.length+e.length+u.length,E=M>1)+c+e+u+E.slice(M);break;default:e=E+c+e+u}return f(e)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),M.toString=function(){return e+""},M}return{format:v,formatPrefix:function(e,t){var n=v(((e=a(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),o=Math.pow(10,-i),s=p[8+i/3];return function(e){return n(o*e)+s}}}}function f(t){return u=d(t),e.format=u.format,e.formatPrefix=u.formatPrefix,u}f({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=o,e.formatDefaultLocale=f,e.formatLocale=d,e.formatSpecifier=a,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r="undefined"!==typeof globalThis?globalThis:r||self).d3=r.d3||{})}}),w=p({"node_modules/is-string-blank/index.js"(e,t){t.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}}}),k=p({"node_modules/fast-isnumeric/index.js"(e,t){var r=w();t.exports=function(e){var t=typeof e;if("string"===t){var n=e;if(0===(e=+e)&&r(n))return!1}else if("number"!==t)return!1;return e-e<1}}}),T=p({"src/constants/numerical.js"(e,t){t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),S=p({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(e,t){var r;r=e,function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"===typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[t.charCodeAt(n)]=n;e.decode=function(e){var t,n,i,a,o,s=.75*e.length,l=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(t=0;t>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},e.encode=function(e){var r,n=new Uint8Array(e),i=n.length,a="";for(r=0;r>2],a+=t[(3&n[r])<<4|n[r+1]>>4],a+=t[(15&n[r+1])<<2|n[r+2]>>6],a+=t[63&n[r+2]];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r="undefined"!==typeof globalThis?globalThis:r||self)["base64-arraybuffer"]={})}}),A=p({"src/lib/is_plain_object.js"(e,t){t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}}}),M=p({"src/lib/array.js"(e){var t=S().decode,r=A(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(e){return i.isView(e)&&!(e instanceof a)}function s(e){return n(e)||o(e)}e.isTypedArray=o,e.isArrayOrTypedArray=s,e.isArray1D=function(e){return!s(e[0])},e.ensureArray=function(e,t){return n(e)||(e=[]),e.length=t,e};var l={u1c:"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"===typeof Int8Array?void 0:Int8Array,u1:"undefined"===typeof Uint8Array?void 0:Uint8Array,i2:"undefined"===typeof Int16Array?void 0:Int16Array,u2:"undefined"===typeof Uint16Array?void 0:Uint16Array,i4:"undefined"===typeof Int32Array?void 0:Int32Array,u4:"undefined"===typeof Uint32Array?void 0:Uint32Array,f4:"undefined"===typeof Float32Array?void 0:Float32Array,f8:"undefined"===typeof Float64Array?void 0:Float64Array};function c(e){return e.constructor===ArrayBuffer}function u(e,t,r){if(s(e)){if(s(e[0])){for(var n=r,i=0;i2)return c[t]=2|c[t],p.set(e,null);if(h){for(o=t;o0)return Math.log(e)/Math.LN10;var n=Math.log(Math.min(t[0],t[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),n}}}),I=p({"src/lib/relink_private.js"(e,t){var r=M().isArrayOrTypedArray,n=A();t.exports=function e(t,i){for(var a in i){var o=i[a],s=t[a];if(s!==o)if("_"===a.charAt(0)||"function"===typeof o){if(a in t)continue;t[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;ct/2?e-Math.round(e/t)*t:e}}}}),O=p({"node_modules/tinycolor2/tinycolor.js"(e,t){!function(e){var r=/^\s+/,n=/\s+$/,i=0,a=e.round,o=e.min,s=e.max,l=e.random;function c(t,l){if(l=l||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,l);var u=function(t){var i,a,l,c={r:0,g:0,b:0},u=1,h=null,p=null,d=null,f=!1,m=!1;return"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,i=!1;if(M[e])e=M[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=j.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=j.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=j.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=j.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=j.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=j.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=j.hex8.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),a:D(t[4]),format:i?"name":"hex8"}:(t=j.hex6.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),format:i?"name":"hex"}:(t=j.hex4.exec(e))?{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),a:D(t[4]+""+t[4]),format:i?"name":"hex8"}:!!(t=j.hex3.exec(e))&&{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),format:i?"name":"hex"}}(t)),"object"==typeof t&&(F(t.r)&&F(t.g)&&F(t.b)?(i=t.r,a=t.g,l=t.b,c={r:255*P(i,255),g:255*P(a,255),b:255*P(l,255)},f=!0,m="%"===String(t.r).substr(-1)?"prgb":"rgb"):F(t.h)&&F(t.s)&&F(t.v)?(h=O(t.s),p=O(t.v),c=function(t,r,n){t=6*P(t,360),r=P(r,100),n=P(n,100);var i=e.floor(t),a=t-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6,u=[n,s,o,o,l,n][c],h=[l,n,n,s,o,o][c],p=[o,o,l,n,n,s][c];return{r:255*u,g:255*h,b:255*p}}(t.h,h,p),f=!0,m="hsv"):F(t.h)&&F(t.s)&&F(t.l)&&(h=O(t.s),d=O(t.l),c=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(t.h,h,d),f=!0,m="hsl"),t.hasOwnProperty("a")&&(u=t.a)),u=C(u),{ok:f,format:t.format||m,r:o(255,s(c.r,0)),g:o(255,s(c.g,0)),b:o(255,s(c.b,0)),a:u}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,i,a=s(e,t,r),l=o(e,t,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case e:n=(t-r)/u+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(c(n));return a}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,i=this.toRgb();return t=i.r/255,r=i.g/255,n=i.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var o=[z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16)),z(R(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*P(this._r,255))+"%",g:a(100*P(this._g,255))+"%",b:a(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*P(this._r,255))+"%, "+a(100*P(this._g,255))+"%, "+a(100*P(this._b,255))+"%)":"rgba("+a(100*P(this._r,255))+"%, "+a(100*P(this._g,255))+"%, "+a(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+d(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=c(e);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:O(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),i=c(t).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(t,r){var n=c(t),i=c(r);return(e.max(n.getLuminance(),i.getLuminance())+.05)/(e.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,i,a=c.readability(e,t);switch(i=!1,(n=function(e){var t,r;return t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=c(t[u]));return c.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var M=c.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"},E=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(M);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,s(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function L(e){return o(1,s(0,e))}function I(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function O(e){return e<=1&&(e=100*e+"%"),e}function R(t){return e.round(255*parseFloat(t)).toString(16)}function D(e){return I(e)/255}var j=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function F(e){return!!j.CSS_UNIT.exec(e)}"undefined"!==typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)}}),R=p({"src/lib/extend.js"(e){var t=A(),r=Array.isArray;function n(e,i,a,o){var s,l,c,u,h,p,d,f=e[0],m=e.length;if(2===m&&r(f)&&r(e[1])&&0===f.length){if(d=function(e,t){var r,n;for(r=0;r=0))return e;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return e}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},a.rgb=function(e){return a.tinyRGB(r(e))},a.opacity=function(e){return e?r(e).getAlpha():0},a.addOpacity=function(e,t){var n=r(e).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+t+")"},a.combine=function(e,t){var n=r(e).toRgb();if(1===n.a)return r(e).toRgbString();var i=r(t||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(e,t,n){var i=r(e).toRgb(),a=r(t).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(e,t,n){var i=r(e);return 1!==i.getAlpha()&&(i=r(a.combine(e,l))),(i.isDark()?t?i.lighten(t):l:n?i.darken(n):s).toString()},a.stroke=function(e,t){var n=r(t);e.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(e,t){var n=r(t);e.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(e){if(e&&"object"===typeof e){var t,r,n,o,s=Object.keys(e);for(t=0;ti.max?r.set(n):r.set(+e)}},integer:{coerceFunction:function(e,r,n,i){-1===(i.extras||[]).indexOf(e)?(p(e)&&(e=d(e)),e%1||!t(e)||void 0!==i.min&&ei.max?r.set(n):r.set(+e)):r.set(e)}},string:{coerceFunction:function(e,t,r,n){if("string"!==typeof e){var i="number"===typeof e;!0!==n.strict&&i?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,n){p(e)&&(e=d(e)),r(e).isValid()?t.set(e):t.set(n)}},colorlist:{coerceFunction:function(e,t,n){Array.isArray(e)&&e.length&&e.every((function(e){return r(e).isValid()}))?t.set(e):t.set(n)}},colorscale:{coerceFunction:function(e,t,r){t.set(a.get(e,r))}},angle:{coerceFunction:function(e,r,n){p(e)&&(e=d(e)),"auto"===e?r.set("auto"):t(e)?r.set(u(+e,360)):r.set(n)}},subplotid:{coerceFunction:function(e,t,r,n){var i=n.regex||c(r);"string"===typeof e&&i.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"===typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"===typeof e){for(var i=e.split("+"),a=0;a/g),l=0;l1){var t=["LOG:"];for(e=0;e1){var i=[];for(e=0;e"),"long")}},i.warn=function(){var e;if(r.logging>0){var t=["WARN:"];for(e=0;e0){var i=[];for(e=0;e"),"stick")}},i.error=function(){var e;if(r.logging>0){var t=["ERROR:"];for(e=0;e0){var i=[];for(e=0;e"),"stick")}}}}),Y=p({"src/lib/noop.js"(e,t){t.exports=function(){}}}),K=p({"src/lib/push_unique.js"(e,t){t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;n0){for(var n=[],i=0;i=t&&n<=r?n:l}if("string"!==typeof n&&"number"!==typeof n)return l;n=String(n);var b=x(i),_=n.charAt(0);!b||"G"!==_&&"g"!==_||(n=n.substr(1),i="");var w=b&&"chinese"===i.substr(0,7),k=n.match(w?y:g);if(!k)return l;var T=k[1],S=k[3]||"1",A=Number(k[5]||1),M=Number(k[7]||0),E=Number(k[9]||0),C=Number(k[11]||0);if(b){if(2===T.length)return l;var P;T=Number(T);try{var L=f.getComponentMethod("calendars","getCal")(i);if(w){var I="i"===S.charAt(S.length-1);S=parseInt(S,10),P=L.newDate(T,L.toMonthIndex(T,S,I),A)}else P=L.newDate(T,Number(S),A)}catch(O){return l}return P?(P.toJD()-d)*c+M*u+E*h+C*p:l}T=2===T.length?(Number(T)+2e3-v)%100+v:Number(T),S-=1;var z=new Date(Date.UTC(2e3,S,A,M,E));return z.setUTCFullYear(T),z.getUTCMonth()!==S||z.getUTCDate()!==A?l:z.getTime()+C*p},t=e.MIN_MS=e.dateTime2ms("-9999"),r=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==l};var w=90*c,S=3*u,A=5*h;function M(e,t,r,n,i){if((t||r||n||i)&&(e+=" "+_(t,2)+":"+_(r,2),(n||i)&&(e+=":"+_(n,2),i))){for(var a=4;i%10===0;)a-=1,i/=10;e+="."+_(i,a)}return e}e.ms2DateTime=function(e,n,i){if("number"!==typeof e||!(e>=t&&e<=r))return l;n||(n=0);var a,s,g,y,v,b,_=Math.floor(10*o(e+.05,1)),k=Math.round(e-_/10);if(x(i)){var T=Math.floor(k/c)+d,E=Math.floor(o(e,c));try{a=f.getComponentMethod("calendars","getCal")(i).fromJD(T).formatDate("yyyy-mm-dd")}catch(C){a=m("G%Y-%m-%d")(new Date(k))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n=t+c&&e<=r-c))return l;var i=Math.floor(10*o(e+.05,1)),a=new Date(Math.round(e-i/10));return M(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},e.cleanDate=function(t,r,n){if(t===l)return r;if(e.isJSDate(t)||"number"===typeof t&&isFinite(t)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return a.error("unrecognized date",t),r;return t};var E=/%\d?f/g,C=/%h/g,P={1:"1",2:"1",3:"2",4:"2"};function L(e,t,r,n){e=e.replace(E,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(t+.05));if(e=e.replace(C,(function(){return P[r("%q")(i)]})),x(n))try{e=f.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(a){return"Invalid"}return r(e)(i)}var I=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(e,t,r,n,a,s){if(a=x(a)&&a,!t)if("y"===r)t=s.year;else if("m"===r)t=s.month;else{if("d"!==r)return function(e,t){var r=o(e+.05,c),n=_(Math.floor(r/u),2)+":"+_(o(Math.floor(r/h),60),2);if("M"!==t){i(t)||(t=0);var a=(100+Math.min(o(e/p,60),I[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+L(s.dayMonthYear,e,n,a);t=s.dayMonth+"\n"+s.year}return L(t,e,n,a)};var O=3*c;e.incrementMonth=function(e,t,r){r=x(r)&&r;var n=o(e,c);if(e=Math.round(e-n),r)try{var i=Math.round(e/c)+d,s=f.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return t%12?s.add(l,t,"m"):s.add(l,t/12,"y"),(l.toJD()-d)*c+n}catch(h){a.error("invalid ms "+e+" in calendar "+r)}var u=new Date(e+O);return u.setUTCMonth(u.getUTCMonth()+t)+n-O},e.findExactDates=function(e,t){for(var r,n,a=0,o=0,s=0,l=0,u=x(t)&&f.getComponentMethod("calendars","getCal")(t),h=0;ht}function c(e,t){return e>=t}e.findBin=function(e,n,i){if(t(n.start))return i?Math.ceil((e-n.start)/n.size-a)-1:Math.floor((e-n.start)/n.size+a);var u,h,p=0,d=n.length,f=0,m=d>1?(n[d-1]-n[0])/(d-1):1;for(h=m>=0?i?o:s:i?c:l,e+=m*a*(i?-1:1)*(m>=0?1:-1);p90&&r.log("Long binary search..."),p-1},e.sorterAsc=function(e,t){return e-t},e.sorterDes=function(e,t){return t-e},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},e.roundUp=function(e,t,r){for(var n,i=0,a=t.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},e.findIndexOfMin=function(e,t){t=t||n;for(var r,i=1/0,a=0;aa.length)&&(o=a.length),t(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;se.length-1)return e[e.length-1];var n=r%1;return n*e[Math.ceil(r)]+(1-n)*e[Math.floor(r)]}}}),Ze=p({"src/lib/angles.js"(e,t){var r=z(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(e){return Math.abs(e[1]-e[0])>o-1e-14}function l(e,t){return i(t-e,o)}function c(e,t){if(s(t))return!0;var r,i;t[0](i=n(i,o))&&(i+=o);var a=n(e,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(e,t,r,n,i,l,c){i=i||0,l=l||0;var u,h,p,d,f,m=s([r,n]);function g(e,t){return[e*Math.cos(t)+i,l-e*Math.sin(t)]}m?(u=0,h=a,p=o):r=i&&e<=a);var i,a},pathArc:function(e,t,r,n,i){return u(null,e,t,r,n,i,0)},pathSector:function(e,t,r,n,i){return u(null,e,t,r,n,i,1)},pathAnnulus:function(e,t,r,n,i,a){return u(e,t,r,n,i,a,1)}}}}),Xe=p({"src/lib/anchor_utils.js"(e){e.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},e.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},e.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},e.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},e.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},e.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}}}),Ye=p({"src/lib/geometry2d.js"(e){var t,r,n,i=z().mod;function a(e,t,r,n,i,a,o,s){var l=r-e,c=i-e,u=o-i,h=n-t,p=a-t,d=s-a,f=l*d-u*h;if(0===f)return null;var m=(c*d-u*p)/f,g=(c*h-l*p)/f;return g<0||g>1||m<0||m>1?null:{x:e+l*m,y:t+h*m}}function o(e,t,r,n,i){var a=n*e+i*t;if(a<0)return n*n+i*i;if(a>r){var o=n-e,s=i-t;return o*o+s*s}var l=n*t-i*e;return l*l/r}e.segmentsIntersect=a,e.segmentDistance=function(e,t,r,n,i,s,l,c){if(a(e,t,r,n,i,s,l,c))return 0;var u=r-e,h=n-t,p=l-i,d=c-s,f=u*u+h*h,m=p*p+d*d,g=Math.min(o(u,h,f,i-e,s-t),o(u,h,f,l-e,c-t),o(p,d,m,e-i,t-s),o(p,d,m,r-i,n-s));return Math.sqrt(g)},e.getTextLocation=function(e,a,o,s){if(e===r&&s===n||(t={},r=e,n=s),t[o])return t[o];var l=e.getPointAtLength(i(o-s/2,a)),c=e.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=e.getPointAtLength(i(o,a)),p={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return t[o]=p,p},e.clearLocationCache=function(){r=null},e.getVisibleSegment=function(e,t,r){var n,i,a=t.left,o=t.right,s=t.top,l=t.bottom,c=0,u=e.getTotalLength(),h=u;function p(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(i=r);var c=r.xo?r.x-o:0,h=r.yl?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var d=p(c);d;){if((c+=d+r)>h)return;d=p(c)}for(d=p(h);d;){if(c>(h-=d+r))return;d=p(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(e,t,r,n){for(var i,a,o,s=(n=n||{}).pathLength||e.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,h=0,p=0,d=s;h0?d=i:p=i,h++}return a}}}),Ke=p({"src/lib/throttle.js"(e){var t={};function r(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}e.throttle=function(e,n,i){var a=t[e],o=Date.now();if(!a){for(var s in t)t[s].tsa.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},e.done=function(e){var r=t[e];return r&&r.timer?new Promise((function(e){var t=r.onDone;r.onDone=function(){t&&t(),e(),r.onDone=null}})):Promise.resolve()},e.clear=function(n){if(n)r(t[n]),delete t[n];else for(var i in t)e.clear(i)}}}),Je=p({"src/lib/clear_responsive.js"(e,t){t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}}}),Qe=p({"node_modules/is-mobile/index.js"(e,t){t.exports=a,t.exports.isMobile=a,t.exports.default=a;var r=/(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,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(e){e||(e={});let t=e.ua;if(t||"undefined"===typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"===typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!==typeof t)return!1;let a=r.test(t)&&!n.test(t)||!!e.tablet&&i.test(t);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(a=!0),a}}}),et=p({"src/lib/preserve_drawing_buffer.js"(e,t){var r=k(),n=Qe();t.exports=function(e){var t;if("string"!==typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;return"undefined"!==typeof navigator&&(e=navigator.userAgent),e&&e.headers&&"string"===typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),e}()))return!0;var i=n({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!i)for(var a=t.split(" "),o=1;o-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(r(c)&&(c=+c),c>=13)return!0}}return i}}}),tt=p({"src/lib/make_trace_groups.js"(e,t){var r=v();t.exports=function(e,t,n){var i=e.selectAll("g."+n.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(e){e[0][a]=r.select(this)})),i}}}),rt=p({"src/lib/localize.js"(e,t){var r=Ve();t.exports=function(e,t){for(var n=e._context.locale,i=0;i<2;i++){for(var a=e._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[t];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return t}}}),nt=p({"src/lib/filter_unique.js"(e,t){t.exports=function(e){for(var t={},r=[],n=0,i=0;i1?(r*e+r*t)/r:e+t,i=String(n).length;if(i>16){var a=String(t).length;if(i>=String(e).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),ot=p({"src/lib/clean_number.js"(e,t){var r=k(),n=T().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return"string"===typeof e&&(e=e.replace(i,"")),r(e)?Number(e):n}}}),st=p({"src/lib/index.js"(e,t){var r=v(),n=b().utcFormat,i=_().format,a=k(),o=T(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=t.exports={};u.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var h={};u.warnBadFormat=function(e){var t=String(e);h[t]||(h[t]=1,u.warn('encountered bad format: "'+t+'"'))},u.noFormat=function(e){return String(e)},u.numberFormat=function(e){var t;try{t=i(u.adjustFormat(e))}catch(r){return u.warnBadFormat(e),u.noFormat}return t},u.nestedProperty=E(),u.keyedContainer=C(),u.relativeAttr=P(),u.isPlainObject=A(),u.toLogRange=L(),u.relinkPrivateKeys=I();var p=M();u.isArrayBuffer=p.isArrayBuffer,u.isTypedArray=p.isTypedArray,u.isArrayOrTypedArray=p.isArrayOrTypedArray,u.isArray1D=p.isArray1D,u.ensureArray=p.ensureArray,u.concat=p.concat,u.maxRowLength=p.maxRowLength,u.minRowLength=p.minRowLength;var d=z();u.mod=d.mod,u.modHalf=d.modHalf;var f=W();u.valObjectMeta=f.valObjectMeta,u.coerce=f.coerce,u.coerce2=f.coerce2,u.coerceFont=f.coerceFont,u.coercePattern=f.coercePattern,u.coerceHoverinfo=f.coerceHoverinfo,u.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,u.validate=f.validate;var m=qe();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Ge();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=We();var y=$e();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var x=Ee();u.init2dArray=x.init2dArray,u.transposeRagged=x.transposeRagged,u.dot=x.dot,u.translationMatrix=x.translationMatrix,u.rotationMatrix=x.rotationMatrix,u.rotationXYMatrix=x.rotationXYMatrix,u.apply3DTransform=x.apply3DTransform,u.apply2DTransform=x.apply2DTransform,u.apply2DTransform2=x.apply2DTransform2,u.convertCssMatrix=x.convertCssMatrix,u.inverseTransformMatrix=x.inverseTransformMatrix;var w=Ze();u.deg2rad=w.deg2rad,u.rad2deg=w.rad2deg,u.angleDelta=w.angleDelta,u.angleDist=w.angleDist,u.isFullCircle=w.isFullCircle,u.isAngleInsideSector=w.isAngleInsideSector,u.isPtInsideSector=w.isPtInsideSector,u.pathArc=w.pathArc,u.pathSector=w.pathSector,u.pathAnnulus=w.pathAnnulus;var S=Xe();u.isLeftAnchor=S.isLeftAnchor,u.isCenterAnchor=S.isCenterAnchor,u.isRightAnchor=S.isRightAnchor,u.isTopAnchor=S.isTopAnchor,u.isMiddleAnchor=S.isMiddleAnchor,u.isBottomAnchor=S.isBottomAnchor;var O=Ye();u.segmentsIntersect=O.segmentsIntersect,u.segmentDistance=O.segmentDistance,u.getTextLocation=O.getTextLocation,u.clearLocationCache=O.clearLocationCache,u.getVisibleSegment=O.getVisibleSegment,u.findPointOnPath=O.findPointOnPath;var D=R();u.extendFlat=D.extendFlat,u.extendDeep=D.extendDeep,u.extendDeepAll=D.extendDeepAll,u.extendDeepNoArrays=D.extendDeepNoArrays;var j=X();u.log=j.log,u.warn=j.warn,u.error=j.error;var F=G();u.counterRegex=F.counter;var B=Ke();u.throttle=B.throttle,u.throttleDone=B.done,u.clearThrottle=B.clear;var N=Ce();function U(e){var t={};for(var r in e)for(var n=e[r],i=0;is||e=t)&&a(e)&&e>=0&&e%1===0},u.noop=Y(),u.identity=He(),u.repeat=function(e,t){for(var r=new Array(t),n=0;nr?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},u.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},u.simpleMap=function(e,t,r,n,i){for(var a=e.length,o=new Array(a),s=0;s=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):e(t,r,n,(i||0)+1):l},u.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},u.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,i,a,o=e.length,s=2*o,l=2*t-1,c=new Array(l),u=new Array(o);for(r=0;r=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=e[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(e,t,r){var n;function i(){return u.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(i);return r&&r(t)},u.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},u.noneOrAll=function(e,t,r){if(e){var n,i,a=!1,o=!0;for(n=0;n0?t:0}))},u.fillArray=function(e,t,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(e))for(var i=0;i1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var ee=/^\w*$/;u.templateString=function(e,t){var r={};return e.replace(u.TEMPLATE_STRING_REGEX,(function(e,n){var i;return ee.test(n)?i=t[n]:(r[n]=r[n]||u.nestedProperty(t,n).get,i=r[n](!0)),void 0!==i?i:""}))};var te={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return oe.apply(te,arguments)};var re={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return oe.apply(re,arguments)};var ne=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,ie={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return oe.apply(ie,arguments)};var ae=/^[:|\|]/;function oe(e,t,r){var i=this,a=arguments;return t||(t={}),e.replace(u.TEMPLATE_STRING_REGEX,(function(e,o,s){var l="_xother"===o||"_yother"===o,c="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,p="xother"===o||"yother"===o||l||h||c,d=o;(l||c)&&(d=d.substring(1)),(h||c)&&(d=d.substring(0,d.length-1));var f,m,g,y=null,v=null;if(i.parseMultDiv){var x=function(e){var t=e.match(ne);return t?{key:t[1],op:t[2],number:Number(t[3])}:{key:e,op:null,number:null}}(d);d=x.key,y=x.op,v=x.number}if(p){if(void 0===(f=t[d]))return""}else for(g=3;g=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var se=2e9;u.seedPseudoRandom=function(){se=2e9},u.pseudoRandom=function(){var e=se;return se=(69069*se+1)%4294967296,Math.abs(se-e)<429496729?u.pseudoRandom():se/4294967296},u.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},i=u.extractOption(e,t,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(e,t,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(e){return e||0===e},u.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(t?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(e,t){e.attr("transform",u.getTextTransform(t)),e.style("display",t.scale?null:"none")},u.ensureUniformFontSize=function(e,t){var r=u.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},u.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},u.bigFont=function(e){return Math.round(1.2*e)};var le=u.getFirefoxVersion(),ce=null!==le&&le<86;u.getPositionFromD3Event=function(){return ce?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),lt=p({"build/plotcss.js"(){var e,t,r=st(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding: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 .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(t in n)e=t.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(e,n[t])}}),ct=p({"node_modules/is-browser/client.js"(e,t){t.exports=!0}}),ut=p({"node_modules/has-hover/index.js"(e,t){var r,n=ct();r="function"===typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,t.exports=r}}),ht=p({"node_modules/events/events.js"(e,t){var r,n="object"===typeof Reflect?Reflect:null,i=n&&"function"===typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"===typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"===typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,a,o,s;if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"===typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"===typeof l)i(l,this,t);else{var c=l.length,u=m(l,c);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),pt=p({"src/lib/events.js"(e,t){var r=ht().EventEmitter,n={init:function(e){if(e._ev instanceof r)return e;var t=new r,n=new r;return e._ev=t,e._internalEv=n,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=n.on.bind(n),e._internalOnce=n.once.bind(n),e._removeInternalListener=n.removeListener.bind(n),e._removeAllInternalListeners=n.removeAllListeners.bind(n),e.emit=function(e,r){t.emit(e,r),n.emit(e,r)},e},triggerHandler:function(e,t,r){var n=e._ev;if(n){var i=n._events[t];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;an.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r=a.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!x(o))return!1;e=a[i][o]}else e=a[i]}else e=a}}return e}function x(e){return e===Math.round(e)&&e>=0}function b(){var e,r,n={};for(e in c(n,i),t.subplotsRegistry)if((r=t.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(e,r){s?t.nestedProperty(l[c],e).set(r):l[c+"."+e]=r}function p(){var e=l;return u(),e}return u(),{modifyBase:function(e,t){l[e]=t},modifyItem:h,getUpdateObj:p,applyUpdate:function(r,n){r&&h(r,n);var i=p();for(var a in i)t.nestedProperty(e,a).set(i[a])}}}}}),yt=p({"src/plots/cartesian/constants.js"(e,t){var r=G().counter;t.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("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"}}}),vt=p({"src/plots/cartesian/axis_ids.js"(e){var t=Ve(),r=yt();function n(e,t){if(t&&t.length)for(var r=0;rn?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},e.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},e.isLinked=function(e,t){return n(t,e._axisMatchGroups)||n(t,e._axisConstraintGroups)}}}),xt=p({"src/components/shapes/handle_outline.js"(e,t){t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearOutline:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._outlining=!1}}}}),bt=p({"src/traces/scatter/layout_attributes.js"(e,t){t.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),_t=p({"src/plots/get_data.js"(e){var t=Ve();yt().SUBPLOT_PATTERN,e.getSubplotCalcData=function(e,r,n){var i=t.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s0?".":"")+a;r.isPlainObject(s)?o(s,t,l,i+1):t(l,a,s)}}))}e.manageCommandObserver=function(t,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=e.hasSimpleAPICommandBindings(t,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(t,c,s.cache),s.check=function(){if(l){var e=n(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h=t.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=t._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){M.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},M.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var n=r.select(e).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=M.graphJson(e,!1,"keepdata"),i.node().submit(),n.remove(),e.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],P=["year","month","dayMonth","dayMonthYear"];function L(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o15&&z.length>15&&0===l.shapes.length&&0===l.images.length,M.linkSubplots(p,l,h,a),M.cleanPlot(p,l,h,a);var B=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));B&&!N?a._bgLayer.remove():N&&!B&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&f({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var p=M.layoutAttributes.width.min,d=M.layoutAttributes.height.min;n1,m=!t.height&&Math.abs(r.height-i)>1;(m||f)&&(f&&(r.width=n),m&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),M.sanitizeMargins(r)},M.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,l=s.componentsRegistry,c=t._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var p in c.length||c.push(h),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),h.finalizeSubplots(e,t)),t._subplots)t._subplots[p].sort(u.subplotSort);for(a=0;a1&&(r.l/=y,r.r/=y)}if(d){var v=(r.t+r.b)/d;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;f[t]={l:{val:x,size:r.l+g},r:{val:b,size:r.r+g},b:{val:w,size:r.b+g},t:{val:_,size:r.t+g}},m[t]=1}else delete f[t],delete m[t];if(!n._replotting)return M.doAutoMargin(e)}},M.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var i=t._size,o=t.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,p=o.r,f=o.t,m=o.b,g=t._pushmargin,y=t._pushmarginIds,v=t.minreducedwidth,x=t.minreducedheight;if(!1!==o.autoexpand){for(var b in g)y[b]||delete g[b];var _=e._fullLayout._reservedMargin;for(var w in _)for(var k in _[w]){var T=_[w][k];l[k]=Math.max(l[k],T)}for(var S in g.base={l:{val:0,size:h},r:{val:1,size:p},t:{val:1,size:f},b:{val:0,size:m}},l){var A=0;for(var E in g)"base"!==E&&a(g[E][S].size)&&(A=g[E][S].size>A?g[E][S].size:A);var C=Math.max(0,o[S]-A);l[S]=Math.max(0,l[S]-C)}for(var P in g){var L=g[P].l||{},I=g[P].b||{},z=L.val,R=L.size,D=I.val,j=I.size,F=r-l.r-l.l,B=n-l.t-l.b;for(var N in g){if(a(R)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(R*U+(V-F)*z)/(U-z),H=(V*(1-z)+(R-F)*(1-U))/(U-z);q+H>h+p&&(h=q,p=H)}}if(a(j)&&g[N].t){var G=g[N].t.val,W=g[N].t.size;if(G>D){var $=(j*G+(W-B)*D)/(G-D),Z=(W*(1-D)+(j-B)*(1-G))/(G-D);$+Z>m+f&&(m=$,f=Z)}}}}}var X=u.constrain(r-o.l-o.r,2,v),Y=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-X),J=Math.max(0,n-Y);if(K){var Q=(h+p)/K;Q>1&&(h/=Q,p/=Q)}if(J){var ee=(m+f)/J;ee>1&&(m/=ee,f/=ee)}if(i.l=Math.round(h)+l.l,i.r=Math.round(p)+l.r,i.t=Math.round(f)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(M.didMarginChange(c,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=d.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return s.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var t;o++,n||o!==a||(t=i,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,e);return a&&a.then||(a=Promise.resolve()),a.then((function(){return e}))}M.didMarginChange=function(e,t){for(var r=0;r1)return!0}return!1},M.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&M.supplyDefaults(e);var s=i?e._fullData:e.data,l=i?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function h(e,t){if("function"===typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof e[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(e[a],t)}else t&&(i[a]="_function")})),i}var a=Array.isArray(e),s=u.isTypedArray(e);if((a||s)&&e.dtype&&e.shape){var l=e.bdata;return h({dtype:e.dtype,shape:e.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},t)}return a?e.map((function(e){return h(e,t)})):s?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var p={data:(s||[]).map((function(e){var r=h(e);return t&&delete r.fit,r}))};if(!t&&(p.layout=h(l),i)){var d=l._size;p.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return c&&(p.frames=h(c)),a&&(p.config=h(e._context,!0)),"object"===n?p:JSON.stringify(p)},M.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,f[t]=o}}for(B(o,c,h),i=0;il||m>c)&&(o.style("overflow","hidden"),d=(p=o.node().getBoundingClientRect()).width,m=p.height);var g=+f.attr("x"),y=+f.attr("y"),v=-(i||f.node().getBoundingClientRect().height)/4;if("y"===I[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-d/2,v-m/2)});else if("l"===I[0])y=v-m/2;else if("a"===I[0]&&0!==I.indexOf("atitle"))g=0,y=v;else{var x=f.attr("text-anchor");g-=d*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y:y}),A&&A.call(f,s),e(s)}))}))):z(),f}function z(){L.empty()||(I=f.attr("class")+"-math",L.select("svg."+I).remove()),f.text("").style("white-space","pre");var n=function(e,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function f(){c++;var r=document.createElementNS(i.svg,"tspan");t.select(r).attr({class:"line",dy:c*a+"em"}),e.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s doesnt match end tag <"+e+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag .",n)}var P=x.test(n);P?f():(o=e,l=[{node:e}]);for(var L=n.split(g),I=0;I|>|>)/g,c=[["$","$"],["\\(","\\)"]],u={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"},h={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},d="\u200b",f=["http:","https:","mailto:","",void 0,":"],m=e.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=//i;e.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&E(n)}var S=/(^|;)\s*color:/;e.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],i=e.split(g),a=[],o="",s=0,l=0;l3?a.push(c.substr(0,d-3)+"..."):a.push(c.substr(0,d));break}o=""}}return a.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(e){return e.replace(M,(function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function C(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var i=r.protocol,a=n.protocol;return-1!==f.indexOf(i)&&-1!==f.indexOf(a)?t:""}function P(e,t,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var e=o()-u.left,t=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}e.convertEntities=E,e.sanitizeHTML=function(e){e=e.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=e.split(g),o=0;o=0;n--,i++){var a=e[n];r[i]=[1-a[0],a[1]]}return r}function d(e,t){t=t||{};for(var a=e.domain,s=e.range,l=s.length,c=new Array(l),u=0;um-d?d=m-(f-m):f-m=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),Wt=p({"src/components/colorscale/index.js"(e,t){var r=U(),n=Mt();t.exports={moduleType:"component",name:"colorscale",attributes:Lt(),layoutAttributes:It(),supplyLayoutDefaults:qt(),handleDefaults:Vt(),crossTraceDefaults:Ht(),calc:Gt(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),$t=p({"src/traces/scatter/subtypes.js"(e,t){var r=st(),n=M().isTypedArraySpec;t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){var t=e.marker;return r.isPlainObject(t)&&(r.isArrayOrTypedArray(t.size)||n(t.size))}}}}),Zt=p({"src/traces/scatter/make_bubble_size_func.js"(e,t){var r=k();t.exports=function(e,t){t||(t=2);var n=e.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(e){return Math.sqrt(e/i)}:function(e){return e/i};return function(e){var n=o(e/t);return r(n)&&n>0?Math.max(n,a):0}}}}),Xt=p({"src/components/fx/helpers.js"(e){var t=st();e.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},e.isTraceInSubplots=function(t,r){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],a=0;a=0&&r.index2&&(t.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),t.push(a);if(a.length=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(a(e))e=+e;else if("string"===typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=S||e>=400?0:Math.floor(Math.max(e,0))};var M=i("~f"),E={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}};function C(e,t,i,a,s,c,u,h,p,d){var f,m=s.length;"linear"===a?f={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:p?"userSpaceOnUse":"objectBoundingBox"},reversed:d}:"radial"===a&&(f={node:"radialGradient",reversed:d});for(var g=new Array(m),y=0;y=0&&void 0===e.i&&(e.i=o.i),t.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(e):void 0===e.mo?s.opacity:e.mo),i.ms2mrc){var u;u="various"===e.ms||"various"===s.size?3:i.ms2mrc(e.ms),e.mrc=u,i.selectedSizeFn&&(u=e.mrc=i.selectedSizeFn(e));var h=x.symbolNumber(e.mx||s.symbol)||0;e.om=h%200>=100;var p=se(e,r),d=Y(e,r);t.attr("d",A(h,u,p,d))}var f,m,g,y=!1;if(e.so)g=c.outlierwidth,m=c.outliercolor,f=s.outliercolor;else{var v=(c||{}).width;g=(e.mlw+1||v+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in e?e.mlcc=i.lineScale(e.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(f=l.defaultLine,y=!0),f="mc"in e?e.mcc=i.markerScale(e.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(f=i.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(g||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:g)+"px");var b=s.gradient,_=e.mgt;_?y=!0:_=b&&b.type,n.isArrayOrTypedArray(_)&&(_=_[0],E[_]||(_=0));var w=s.pattern,k=w&&x.getPatternAttr(w.shape,e.i,"");if(_&&"none"!==_){var T=e.mgc;T?y=!0:T=b.color;var S=r.uid;y&&(S+="-"+e.i),x.gradient(t,a,S,_,[[0,T],[1,f]],"fill")}else if(k){var M=!1,C=w.fgcolor;!C&&o&&o.color&&(C=o.color,M=!0);var P=x.getPatternAttr(C,e.i,o&&o.color||null),L=x.getPatternAttr(w.bgcolor,e.i,null),I=w.fgopacity,z=x.getPatternAttr(w.size,e.i,8),O=x.getPatternAttr(w.solidity,e.i,.3);M=M||e.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var R=r.uid;M&&(R+="-"+e.i),x.pattern(t,"point",a,R,k,z,O,e.mcc,w.fillmode,L,P,I)}else n.isArrayOrTypedArray(f)?l.fill(t,f[e.i]):l.fill(t,f);g&&l.stroke(t,m)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=m.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&n.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,p=void 0!==u,d=void 0!==h;(n.isArrayOrTypedArray(c)||p||d)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?p?u:t:d?h:f*t});var m=a.color,g=o.color,y=l.color;(g||y)&&(t.selectedColorFn=function(e){var t=e.mcc||m;return e.selected?g||t:y||t});var v=a.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,f))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var n=x.makeSelectedPointStyleFns(t),i=t.marker||{},a=[];n.selectedOpacityFn&&a.push((function(e,t){e.style("opacity",n.selectedOpacityFn(t))})),n.selectedColorFn&&a.push((function(e,t){l.fill(e,n.selectedColorFn(t))})),n.selectedSizeFn&&a.push((function(e,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);e.attr("d",A(x.symbolNumber(a),o,se(r,t),Y(r,t))),r.mrc2=o})),a.length&&e.each((function(e){for(var t=r.select(this),n=0;n0?r:0}function D(e,t,r){return r&&(e=V(e)),t?F(e[1]):j(e[0])}function j(e){var t=r.round(e,2);return P=t,t}function F(e){var t=r.round(e,2);return L=t,t}function B(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,p=3*c*(l+c),d=3*l*(l+c);return[[j(t[0]+(p&&u/p)),F(t[1]+(p&&h/p))],[j(t[0]-(d&&u/d)),F(t[1]-(d&&h/d))]]}x.textPointStyle=function(e,t,i){if(e.size()){var a;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);a=o.selectedTextColorFn}var s=t.texttemplate,l=i._fullLayout;e.each((function(e){var o=r.select(this),c=s?n.extractOption(e,t,"txt","texttemplate"):n.extractOption(e,t,"tx","text");if(c||0===c){if(s){var u=t._module.formatLabels,p=u?u(e,t,l):{},d={};y(d,t,e.i);var f=t._meta||{};c=n.texttemplateString(c,p,l._d3locale,d,e,f)}var m=e.tp||t.textposition,g=R(e,t),v=a?a(e):e.tc||t.textfont.color;o.call(x.font,{family:e.tf||t.textfont.family,weight:e.tw||t.textfont.weight,style:e.ty||t.textfont.style,variant:e.tv||t.textfont.variant,textcase:e.tC||t.textfont.textcase,lineposition:e.tE||t.textfont.lineposition,shadow:e.tS||t.textfont.shadow,size:g,color:v}).text(c).call(h.convertToTspans,i).call(z,m,g,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var n=x.makeSelectedTextStyleFns(t);e.each((function(e){var i=r.select(this),a=n.selectedTextColorFn(e),o=e.tp||t.textposition,c=R(e,t);l.fill(i,a);var u=s.traceIs(t,"bar-like");z(i,o,c,e.mrc2||e.mrc,u)}))}},x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],i=[];for(r=1;r=c||w>=h&&w<=c)&&(k<=p&&k>=u||k>=p&&k<=u)&&(e=[w,k])}return e}x.steps=function(e){var t=N[e]||U;return function(e){for(var r="M"+j(e[0][0])+","+F(e[0][1]),n=e.length,i=1;i=1e4&&(x.savedBBoxes={},G=0),i&&(x.savedBBoxes[i]=g),G++,n.extendFlat({},g)},x.setClipUrl=function(e,t,r){e.attr("clip-path",$(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(t,r)).trim(),e[i]("transform",a),a},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+t+","+r+")").trim(),e[i]("transform",a),a};var Z=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(Z,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var X=/translate\([^)]*\)\s*$/;function Y(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,n){e&&e.each((function(){var e,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);e=1===t&&1===n?[]:[u(o,s),"scale("+t+","+n+")",u(-o,-s)],l&&e.push(l),i.attr("transform",e.join(""))}}))},x.getMarkerStandoff=Y;var K,J,Q,ee,te,re,ne=Math.atan2,ie=Math.cos,ae=Math.sin;function oe(e,t){var r=t[0],n=t[1];return[r*ie(e)-n*ae(e),r*ae(e)+n*ie(e)]}function se(e,t){var r,i,o=e.ma;void 0===o&&((o=t.marker.angle)&&!n.isArrayOrTypedArray(o)||(o=0));var s=t.marker.angleref;if("previous"===s||"north"===s){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],i=l[1]}else{var c=t._xA,u=t._yA;if(!c||!u)return 90;r=c.c2p(e.x),i=u.c2p(e.y)}if(t._geo){var h,p=e.lonlat[0],d=e.lonlat[1],f=t._geo.project([p,d+1e-5]),m=t._geo.project([p+1e-5,d]),g=ne(m[1]-i,m[0]-r),y=ne(f[1]-i,f[0]-r);if("north"===s)h=o/180*Math.PI;else if("previous"===s){var v=p/180*Math.PI,x=d/180*Math.PI,b=K/180*Math.PI,_=J/180*Math.PI,w=b-v,k=ie(_)*ae(w),T=ae(_)*ie(x)-ie(_)*ae(x)*ie(w);h=-ne(k,T)-Math.PI,K=p,J=d}var S=oe(g,[ie(h),0]),A=oe(y,[ae(h),0]);o=ne(S[1]+A[1],S[0]+A[0])/Math.PI*180,"previous"!==s||re===t.uid&&e.i===te+1||(o=null)}if("previous"===s&&!t._geo)if(re===t.uid&&e.i===te+1&&a(r)&&a(i)){var M=r-Q,E=i-ee,C=t.line&&t.line.shape||"",P=C.slice(C.length-1);"h"===P&&(E=0),"v"===P&&(M=0),o+=ne(E,M)/Math.PI*180+90}else o=null}return Q=r,ee=i,te=e.i,re=t.uid,o}x.getMarkerAngle=se}}),Qt=p({"src/components/titles/index.js"(e,t){var r=v(),n=k(),i=kt(),a=Ve(),o=st(),s=o.strTranslate,l=Jt(),c=q(),u=At(),h=H(),p=St().OPPOSITE_SIDE,d=/ [XY][0-9]* /;t.exports={draw:function(e,t,f){var m,g=e._fullLayout,y=f.propContainer,v=f.propName,x=f.placeholder,b=f.traceIndex,_=f.avoid||{},w=f.attributes,k=f.transform,T=f.containerGroup,S=1,A=y.title,M=(A&&A.text?A.text:"").trim(),E=!1,C=A&&A.font?A.font:{},P=C.family,L=C.size,I=C.color,z=C.weight,O=C.style,R=C.variant,D=C.textcase,j=C.lineposition,F=C.shadow,B=!!f.subtitlePropName,N=f.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,W=G.family,$=G.size,Z=G.color,X=G.weight,Y=G.style,K=G.variant,J=G.textcase,Q=G.lineposition,ee=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":v.indexOf(!0)&&(m="colorbarTitleText");var te=e._context.edits[m];function re(e,t){return void 0!==e&&void 0!==t&&e.replace(d," % ")===t.replace(d," % ")}""===M?S=0:re(M,x)&&(te||(M=""),S=.2,E=!0),B&&(""===V?H=0:re(V,N)&&(te||(V=""),H=.2,q=!0)),f._meta?M=o.templateString(M,f._meta):g._meta&&(M=o.templateString(M,g._meta));var ne,ie=M||V||te;T||(T=o.ensureSingle(g._infolayer,"g","g-"+t),ne=g._hColorbarMoveTitle);var ae=T.selectAll("text."+t).data(ie?[0]:[]);ae.enter().append("text"),ae.text(M).attr("class",t),ae.exit().remove();var oe=null,se=t+"-subtitle",le=V||te;if(B&&le&&((oe=T.selectAll("text."+se).data(le?[0]:[])).enter().append("text"),oe.text(V).attr("class",se),oe.exit().remove()),!ie)return T;function ce(e,t){o.syncOrAsync([ue,he],{title:e,subtitle:t})}function ue(n){var a,h=n.title,p=n.subtitle;if(!k&&ne&&(k={}),k?(a="",k.rotate&&(a+="rotate("+[k.rotate,w.x,w.y]+")"),(k.offset||ne)&&(a+=s(0,(k.offset||0)-(ne||0)))):a=null,h.attr("transform",a),h.style("opacity",S*c.opacity(I)).call(l.font,{color:c.rgb(I),size:r.round(L,2),family:P,weight:z,style:O,variant:R,textcase:D,shadow:F,lineposition:j}).attr(w).call(u.convertToTspans,e,(function(e){if(e){var t=r.select(e.node().parentNode).select("."+se);if(!t.empty()){var n=e.node().getBBox();if(n.height){var i=n.y+n.height+1.6*$;t.attr("y",i)}}}})),p){var d=T.select("."+t+"-math-group"),f=h.node().getBBox(),m=d.node()?d.node().getBBox():void 0,g=m?m.y+m.height+1.6*$:f.y+f.height+1.6*$,y=o.extendFlat({},w,{y:g});p.attr("transform",a),p.style("opacity",H*c.opacity(Z)).call(l.font,{color:c.rgb(Z),size:r.round($,2),family:W,weight:X,style:Y,variant:K,textcase:J,shadow:ee,lineposition:Q}).attr(y).call(u.convertToTspans,e)}return i.previousPromises(e)}function he(t){var i=t.title,a=r.select(i.node().parentNode);if(_&&_.selection&&_.side&&M){a.attr("transform",null);var c=p[_.side],u="left"===_.side||"top"===_.side?-1:1,h=n(_.pad)?_.pad:2,d=l.bBox(a.node()),f={t:0,b:0,l:0,r:0},m=e._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var b=m[v][x];f[x]=Math.max(f[x],b)}var w={left:f.l,top:f.t,right:g.width-f.r,bottom:g.height-f.b},k=_.maxShift||u*(w[_.side]-d[_.side]),T=0;if(k<0)T=k;else{var S=_.offsetLeft||0,A=_.offsetTop||0;d.left-=S,d.right-=S,d.top-=A,d.bottom-=A,_.selection.each((function(){var e=l.bBox(this);o.bBoxIntersect(d,e,h)&&(T=Math.max(T,u*(e[_.side]-d[c])+h))})),T=Math.min(k,T),y._titleScoot=Math.abs(T)}if(T>0||k<0){var E={left:[-T,0],right:[T,0],top:[0,-T],bottom:[0,T]}[_.side];a.attr("transform",s(E[0],E[1]))}}}function pe(e,t){e.text(t).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(ae.call(ce,oe),te&&(M?ae.on(".opacity",null):(pe(ae,x),E=!0),ae.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==b?a.call("_guiRestyle",e,v,t,b):a.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ce)})).on("input",(function(e){this.text(e||" ").call(u.positionText,w.x,w.y)})),B)){if(B&&!M){var de=ae.node().getBBox(),fe=de.y+de.height+1.6*$;oe.attr("y",fe)}V?oe.on(".opacity",null):(pe(oe,N),q=!0),oe.call(u.makeEditable,{gd:e}).on("edit",(function(t){a.call("_guiRelayout",e,"title.subtitle.text",t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ce)})).on("input",(function(e){this.text(e||" ").call(u.positionText,oe.attr("x"),oe.attr("y"))}))}return ae.classed("js-placeholder",E),oe&&oe.classed("js-placeholder",q),T},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),er=p({"src/plots/cartesian/set_convert.js"(e,t){var r=v(),n=b().utcFormat,i=st(),a=i.numberFormat,o=k(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,p=T(),d=p.FP_SAFE,f=p.BADNUM,m=p.LOG_CLIP,g=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,_=p.ONEMIN,w=p.ONESEC,S=vt(),A=yt(),M=A.HOUR_PATTERN,E=A.WEEKDAY_PATTERN;function C(e){return Math.pow(10,e)}function P(e){return null!==e&&void 0!==e}t.exports=function(e,t){t=t||{};var p=e._id||"x",v=p.charAt(0);function b(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],i=e.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return f}function k(t,r,n,a){if((a||{}).msUTC&&o(t))return+t;var s=c(t,n||e.calendar);if(s===f){if(!o(t))return f;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-l/10);s=c(new Date(u))+l/10}return s}function T(t,r,n){return l(t,r,n||e.calendar)}function L(t){return e._categories[Math.round(t)]}function I(t){if(P(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"===typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return f}function z(t){if(e._categoriesMap)return e._categoriesMap[t]}function O(e){var t=z(e);return void 0!==t?t:o(e)?+e:void 0}function R(e){return o(e)?+e:z(e)}function D(e,t,n){return r.round(n+t*e,2)}function j(e,t,r){return(e-r)/t}var F=function(t){return o(t)?D(t,e._m,e._b):f},B=function(t){return j(t,e._m,e._b)};if(e.rangebreaks){var N="y"===v;F=function(t){if(!o(t))return f;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=N;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,a=i*t,s=0,l=0;lu)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=e._B[s]||0;return isFinite(h)?D(t,e._m2,h):0},B=function(t){var r=e._rangebreaks.length;if(!r)return j(t,e._m,e._b);for(var n=0,i=0;ie._rangebreaks[i].pmax&&(n=i+1);return j(t,e._m2,e._B[n])}}e.c2l="log"===e.type?b:u,e.l2c="log"===e.type?C:u,e.l2p=F,e.p2l=B,e.c2p="log"===e.type?function(e,t){return F(b(e,t))}:F,e.p2c="log"===e.type?function(e){return C(B(e))}:B,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=u,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=B,e.cleanPos=u):"log"===e.type?(e.d2r=e.d2l=function(e,t){return b(s(e),t)},e.r2d=e.r2c=function(e){return C(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=u,e.c2r=b,e.l2d=C,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return C(B(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=B,e.cleanPos=u):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=k,e.c2d=e.c2r=e.l2d=e.l2r=T,e.d2p=e.r2p=function(t,r,n){return e.l2p(k(t,0,n))},e.p2d=e.p2r=function(e,t,r){return T(B(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,f,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=I,e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=u,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(B(e))},e.r2p=e.d2p,e.p2r=B,e.cleanPos=function(e){return"string"===typeof e&&""!==e?e:u(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=z,e.l2r=e.c2r=u,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(B(e))},e.r2p=e.d2p,e.p2r=B,e.cleanPos=function(e){return Array.isArray(e)||"string"===typeof e&&""!==e?e:u(e)},e.setupMultiCategory=function(r){var n,a,o=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var l in s)if(l!==p){var c=t[S.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],d=[];for(n=0;nl[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=e.l2r(r),u=e.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var p=u+1;void 0!==r&&(p=Math.max(p,c)),a[s?0:1]=p}}}},e.cleanRange=function(t,r){e._cleanRange(t,r),e.limitRange(t)},e._cleanRange=function(t,r){r||(r={}),t||(t="range");var n,a,s=i.nestedProperty(e,t).get();if(a=(a="date"===e.type?i.dfltRange(e.calendar):"y"===v?A.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||A.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"!==e.type||e.autorange||(s[0]=i.cleanDate(s[0],f,e.calendar),s[1]=i.cleanDate(s[1],f,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!i.isDateTime(s[n],e.calendar)){e[t]=a;break}if(e.r2l(s[0])===e.r2l(s[1])){var u=i.constrain(e.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=e.l2r(u-1e3),s[1]=e.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){e[t]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-d?s[n]=-d:s[n]>d&&(s[n]=d),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var i=S.getFromId({_fullLayout:t},e.overlaying);e.domain=i.domain}var a=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(a);var s,l,c=e.r2l(e[a][0],o),u=e.r2l(e[a][1],o),h="y"===v;if(h?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(s=0;su&&(p=!p),p&&e._rangebreaks.reverse();var d=p?-1:1;for(e._m2=d*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(h?u:c)),s=0;sa&&(a+=7,oa&&(a+=24,o=n&&o=n&&t=s.min&&(es.max&&(s.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;n2*s}(h,t))return"date";var g="strict"!==n.autotypenumbers;return function(e,t){for(var r=e.length,n=u(r),a=0,o=0,c={},h=0;h2*a}(h,g)?"category":function(e,t){for(var r=e.length,n=0;n0&&((T=P-s(b)-l(_))>L?A/T>I&&(w=b,k=_,I=A/T):A/P>I&&(w={val:b.val,nopad:1},k={val:_.val,nopad:1},I=A/P));if(m===g){var z=m-1,O=m+1;if(E)if(0===m)a=[0,1];else{var R=(m>0?h:u).reduce((function(e,t){return Math.max(e,l(t))}),0),D=m/(1-Math.min(.5,R/P));a=m>0?[0,D]:[D,0]}else a=C?[Math.max(0,z),Math.max(1,O)]:[z,O]}else E?(w.val>=0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):C&&(w.val-I*s(w)<0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),I=(k.val-w.val-p(t,b.val,_.val))/(P-s(w)-l(k)),a=[w.val-I*s(w),k.val+I*l(k)];return a=S(a,t),t.limitRange&&t.limitRange(),v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var i=e.locateBreaks(t,r),a=0;a=r&&(c.extrapad||!o)){s=!1;break}i(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(l,1),l--)}if(s){var u=a&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return n(e)&&Math.abs(e)=t}function w(e,t,r){return void 0===t||void 0===r||(t=e.d2l(t))<(r=e.d2l(r))}function S(e,t){if(!t||!t.autorangeoptions)return e;var r=e[0],n=e[1],a=t.autorangeoptions.include;if(void 0!==a){var o=t.d2l(r),s=t.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.minallowed&&w(t,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(t,r.clipmin,r.clipmax)?Math.max(e,t.d2l(r.clipmin)):e}(r,t),n=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.maxallowed&&w(t,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(t,r.clipmin,r.clipmax)?Math.min(e,t.d2l(r.clipmax)):e}(n,t),[r,n]}t.exports={applyAutorangeOptions:S,getAutoRange:h,makePadFn:d,doAutoRange:function(e,t,r){if(t.setScale(),t.autorange){t.range=r?r.slice():h(e,t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l);var n=t._input,a={};a[t._attr+".range"]=t.range,a[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,a),n.range=t.range.slice(),n.autorange=t.autorange}var s=t._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[t._name];l&&"auto"===l.rangemode&&(l.range=h(e,t)),s._input.rangeslider[t._name]=i.extendFlat({},l)}},findExtremes:function(e,t,r){r||(r={}),e._m||e.setScale();var i,o,s,l,c,u,h,p,d,f=[],y=[],v=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,T=r.vpadLinearized||!1;function S(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=S((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=S((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=S(r.vpadplus||r.vpad),C=S(r.vpadminus||r.vpad);if(!k){if(p=1/0,d=-1/0,w)for(i=0;i0&&(p=o),o>d&&o-a&&(p=o),o>d&&o=I;i--)L(i);return{min:f,max:y,opts:r}},concatExtremes:f}}}),nr=p({"src/plots/cartesian/axes.js"(e,t){var r=v(),n=k(),i=kt(),a=Ve(),o=st(),s=o.strTranslate,l=At(),c=Qt(),u=q(),h=Jt(),p=Ct(),d=Ot(),f=T(),m=f.ONEMAXYEAR,g=f.ONEAVGYEAR,y=f.ONEMINYEAR,x=f.ONEMAXQUARTER,b=f.ONEAVGQUARTER,_=f.ONEMINQUARTER,w=f.ONEMAXMONTH,S=f.ONEAVGMONTH,A=f.ONEMINMONTH,M=f.ONEWEEK,E=f.ONEDAY,C=E/2,P=f.ONEHOUR,L=f.ONEMIN,I=f.ONESEC,z=f.ONEMILLI,O=f.ONEMICROSEC,R=f.MINUS_SIGN,D=f.BADNUM,j={K:"zeroline"},F={K:"gridline",L:"path"},B={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},H=St(),G=H.MID_SHIFT,W=H.CAP_SHIFT,$=H.LINE_SPACING,Z=H.OPPOSITE_SIDE,X=t.exports={};X.setConvert=er();var Y=tr(),K=vt(),J=K.idSort,Q=K.isLinked;X.id2name=K.id2name,X.name2id=K.name2id,X.cleanId=K.cleanId,X.list=K.list,X.listIds=K.listIds,X.getFromId=K.getFromId,X.getFromTrace=K.getFromTrace;var ee=rr();function te(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}X.getAutoRange=ee.getAutoRange,X.findExtremes=ee.findExtremes,X.coerceRef=function(e,t,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"===typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"===typeof a?[a]:a:[]),dflt:i},o.coerce(e,t,u,c)},X.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},X.coercePosition=function(e,t,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=X.getFromId(t,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}e[i]=s(l)},X.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(t,r).cleanPos)(e)},X.redrawComponents=function(e,t){t=t||X.listIds(e);var r=e._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;un&&p2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},X.saveRangeInitial=function(e,t){for(var r=X.list(e,"",!0),n=!1,i=0;i.3*p||u(i)||u(a))){var d=r.dtick/2;e+=e+ds){var l=Number(r.substr(1));a.exactYears>s&&l%12===0?e=X.tickIncrement(e,"M6","reverse")+1.5*E:a.exactMonths>s?e=X.tickIncrement(e,"M1","reverse")+15.5*E:e-=C;var c=X.tickIncrement(e,r);if(c<=n)return c}return e}(v,e,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:t.c2r(v,0,a),end:t.c2r(g,0,a),size:y,_dataSpan:u-c}},X.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var i,a=t.dtick&&n(t._tmin);if(a){var s=X.tickIncrement(t._tmin,t.dtick,!0);i=[t._tmin,.99*s+.01*t._tmin]}else{var l=o.simpleMap(t.range,t.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(e.range=o.simpleMap(i,t.l2r),e._isMinor=!0,X.prepTicks(e,r),a){var c=n(t.dtick),u=n(e.dtick),h=c?t.dtick:+t.dtick.substring(1),p=u?e.dtick:+e.dtick.substring(1);c&&u?ae(h,p)?h===2*M&&p===2*E&&(e.dtick=M):h===2*M&&p===3*E?e.dtick=M:h!==M||(t._input.minor||{}).nticks?oe(h/p,2.5)?e.dtick=h/2:e.dtick=h:e.dtick=E:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ae(h,p)?h>=12&&2===p&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ae(h,p)||(e.dtick=oe(h/p,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},X.prepTicks=function(e,t){var r=o.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var i,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(i=e.tickfont?o.bigFont(e.tickfont.size||12):15,a=e._length/i):(i="y"===e._id.charAt(0)?40:80,a=o.constrain(e._length/i,4,9)+1),"radialaxis"===e._name&&(a*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(a*=100),e._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(n(e.dtick)||"M"!==e.dtick.charAt(0))}var i=r(),a=X.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(t=P,o&&!i&&e.dticke.range[1],d=!e.ticklabelindex||o.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],f=o.simpleMap(e.range,e.r2l,void 0,void 0,t),v=f[1]=(V?0:1);q--){var H=!q;q?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var G=q?e:o.extendFlat({},e,e.minor);if(H?X.prepMinorTicks(G,e,t):X.prepTicks(G,t),"array"!==G.tickmode)if("sync"!==G.tickmode){var W=te(f),$=W[0],Z=W[1],Y=n(G.dtick),K="log"===l&&!(Y||"L"===G.dtick.charAt(0)),J=X.tickFirst(G,t);if(q){if(e._tmin=J,J<$!==v)break;"category"!==l&&"multicategory"!==l||(Z=v?Math.max(-.5,Z):Math.min(e._categories.length-.5,Z))}var Q,ee,re=null,ne=J;q&&(Y?ee=e.dtick:"date"===l?"string"===typeof e.dtick&&"M"===e.dtick.charAt(0)&&(ee=S*e.dtick.substring(1)):ee=e._roughDTick,Q=Math.round((e.r2l(ne)-e.r2l(e.tick0))/ee)-1);var ie=G.dtick;for(G.rangebreaks&&G._tick0Init!==G.tick0&&(ne=Be(ne,e),v||(ne=X.tickIncrement(ne,ie,!v,c))),q&&h&&(ne=X.tickIncrement(ne,ie,!v,c),Q--);v?ne>=Z:ne<=Z;ne=X.tickIncrement(ne,ie,v,c)){if(q&&Q++,G.rangebreaks&&!v){if(ne<$)continue;if(G.maskBreaks(ne)===D&&Be(ne,G)>=T)break}if(B.length>R||ne===re)break;re=ne;var ae={value:ne};q?(K&&ne!==(0|ne)&&(ae.simpleLabel=!0),u>1&&Q%u&&(ae.skipLabel=!0),B.push(ae)):(ae.minor=!0,N.push(ae))}}else B=[],j=ce(e);else q?(B=[],j=ue(e,!H)):(N=[],F=ue(e,!H))}if(!N||N.length<2)d=!1;else{var oe=(N[1].value-N[0].value)*(p?-1:1);r=oe,i=e.tickformat,(/%f/.test(i)?r>=O:/%L/.test(i)?r>=z:/%[SX]/.test(i)?r>=I:/%M/.test(i)?r>=L:/%[HI]/.test(i)?r>=P:/%p/.test(i)?r>=C:/%[Aadejuwx]/.test(i)?r>=E:/%[UVW]/.test(i)?r>=M:/%[Bbm]/.test(i)?r>=A:/%[q]/.test(i)?r>=_:!/%[Yy]/.test(i)||r>=y)||(d=!1)}if(d){var se=B.concat(N);h&&B.length&&(se=se.slice(1)),(se=se.sort((function(e,t){return e.value-t.value})).filter((function(e,t,r){return 0===t||e.value!==r[t-1].value}))).map((function(e,t){return void 0!==e.minor||e.skipLabel?null:t})).filter((function(e){return null!==e})).forEach((function(e){d.map((function(t){var r=e+t;r>=0&&r0?(a=n-1,o=n):(a=n,o=n);var s,l=e[a].value,c=e[o].value,u=Math.abs(c-l),h=r||u,p=0;h>=y?p=u>=y&&u<=m?u:g:r===b&&h>=_?p=u>=_&&u<=x?u:b:h>=A?p=u>=A&&u<=w?u:S:r===M&&h>=M?p=M:h>=E?p=E:r===C&&h>=C?p=C:r===P&&h>=P&&(p=P),p>=u&&(p=u,s=!0);var d=i+p;if(t.rangebreaks&&p>0){for(var f=0,v=0;v<84;v++){var k=(v+.5)/84;t.maskBreaks(i*(1-k)+k*d)!==D&&f++}(p*=f/84)||(e[n].drop=!0),s&&u>M&&(p=u)}(p>0||0===n)&&(e[n].periodX=i+p/2)}}(U,e,e._definedDelta),e.rangebreaks){var ye="y"===e._id.charAt(0),ve=1;"auto"===e.tickmode&&(ve=e.tickfont?e.tickfont.size:12);var xe=NaN;for(a=B.length-1;a>-1;a--)if(B[a].drop)B.splice(a,1);else{B[a].value=Be(B[a].value,e);var be=e.c2p(B[a].value);(ye?xe>be-ve:xeT||nT&&(r.periodX=T),n10||"01-01"!==i.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12===0?"y":"m";else if(t>=E&&a<=10||t>=15*E)e._tickround="d";else if(t>=L&&a<=16||t>=P)e._tickround="M";else if(t>=I&&a<=19||t>=L)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(n(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);n(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(we(e.exponentformat)&&!ke(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function be(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(e,t,r){var i;function a(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=o.dateTick0(e.calendar,0);var s=2*t;if(s>g)t/=g,i=a(10),e.dtick="M"+12*ve(t,i,he);else if(s>S)t/=S,e.dtick="M"+ve(t,1,pe);else if(s>E){if(e.dtick=ve(t,E,e._hasDayOfWeekBreaks?[1,2,7,14]:fe),!r){var l=X.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(l)?e.tick0=o.dateTick0(e.calendar,2):e.tick0=o.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else s>P?e.dtick=ve(t,P,pe):s>L?e.dtick=ve(t,L,de):s>I?e.dtick=ve(t,I,de):(i=a(10),e.dtick=ve(t,i,he))}else if("log"===e.type){e.tick0=0;var u=o.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),e.dtick="L"+ve(t,i,he)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Fe(e)?(e.tick0=0,i=1,e.dtick=ve(t,i,ye)):(e.tick0=0,i=a(10),e.dtick=ve(t,i,he));if(0===e.dtick&&(e.dtick=1),!n(e.dtick)&&"string"!==typeof e.dtick){var p=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(p)}},X.tickIncrement=function(e,t,i,a){var s=i?-1:1;if(n(t))return o.increment(e,s*t);var l=t.charAt(0),c=s*Number(t.substr(1));if("M"===l)return o.incrementMonth(e,c,a);if("L"===l)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===l){var u="D2"===t?ge:me,h=e+.01*s,p=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(t)},X.tickFirst=function(e,t){var i=e.r2l||Number,a=o.simpleMap(e.range,i,void 0,void 0,t),s=a[1]=0&&r<=e._length?t:null};if(l&&o.isArrayOrTypedArray(e.ticktext)){var d=o.simpleMap(e.range,e.r2l),f=(Math.abs(d[1]-d[0])-(e._lBreaks||0))/1e4;for(a=0;a ")}else e._prevDateHead=l,c+="
"+l;t.text=c}(e,s,r,c):"log"===u?function(e,t,r,i,a){var s=e.dtick,l=t.x,c=e.tickformat,u="string"===typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)t.text=Te(Math.pow(10,l),e,a,i);else if(n(s)||"D"===u&&o.mod(l+.01,1)<.1){var h=Math.round(l),p=Math.abs(h),d=e.exponentformat;"power"===d||we(d)&&ke(h)?(t.text=0===h?1:1===h?"10":"10"+(h>1?"":R)+p+"",t.fontSize*=1.25):("e"===d||"E"===d)&&p>2?t.text="1"+d+(h>0?"+":R)+p:(t.text=Te(Math.pow(10,l),e,"","fakehover"),"D1"===s&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);t.text=String(Math.round(Math.pow(10,o.mod(l,1)))),t.fontSize*=.75}if("D1"===e.dtick){var f=String(t.text).charAt(0);"0"!==f&&"1"!==f||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(l<0?.5:.25)))}}(e,s,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,s):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),i=e._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?t.text=o+" - "+a:(t.text=a,t.text2=o)}(e,s,r):Fe(e)?function(e,t,r,n,i){if("radians"!==e.thetaunit||r)t.text=Te(t.x,e,i,n);else{var a=t.x/180;if(0===a)t.text="0";else{var s=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}function r(e,n){return t(n,0)?e:r(n,e%n)}function n(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}var i=n(e),a=e*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(s[1]>=100)t.text=Te(o.deg2rad(t.x),e,i,n);else{var l=t.x<0;1===s[1]?1===s[0]?t.text="\u03c0":t.text=s[0]+"\u03c0":t.text=["",s[0],"","\u2044","",s[1],"","\u03c0"].join(""),l&&(t.text=R+t.text)}}}}(e,s,r,c,g):function(e,t,r,n,i){"never"===i?i="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(i="hide"),t.text=Te(t.x,e,i,n)}(e,s,0,c,g),i||(e.tickprefix&&!m(e.showtickprefix)&&(s.text=e.tickprefix+s.text),e.ticksuffix&&!m(e.showticksuffix)&&(s.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(s.text)){var y=e.labelalias[s.text];"string"===typeof y&&(s.text=y)}return("boundaries"===e.tickson||e.showdividers)&&(s.xbnd=[p(s.x-.5),p(s.x+e.dtick-.5)]),s},X.hoverLabelText=function(e,t,r){r&&(e=o.extendFlat({},e,{hoverformat:r}));var n=o.isArrayOrTypedArray(t)?t[0]:t,i=o.isArrayOrTypedArray(t)?t[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(e,n,r)+" - "+X.hoverLabelText(e,i,r);var a="log"===e.type&&n<=0,s=X.tickText(e,e.c2l(a?-n:n),"hover").text;return a?0===n?"0":R+s:s};var _e=["f","p","n","\u03bc","m","","k","M","G","T"];function we(e){return"SI"===e||"B"===e}function ke(e){return e>14||e<-15}function Te(e,t,r,i){var a=e<0,s=t._tickround,l=r||t.exponentformat||"B",c=t._tickexponent,u=X.getTickFormat(t),h=t.separatethousands;if(i){var p={exponentformat:l,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:n(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};xe(p),s=(Number(p._tickround)||0)+4,c=p._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,R);var d,f=Math.pow(10,-s)/2;if("none"===l&&(c=0),(e=Math.abs(e))"+d+"":"B"===l&&9===c?e+="B":we(l)&&(e+=_e[c/3+5])),a?R+e:e}function Se(e,t){if(e){var r=Object.keys(V).reduce((function(e,r){return-1!==t.indexOf(r)&&V[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function Ae(e,t){for(var r=[],n={},i=0;i1&&r=i.min&&e=n(e))}function s(e,t){var r=null===t[0],n=null===t[1],i=a(e,t[0])>=0,o=a(e,t[1])<=0;return(r||i)&&(n||o)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(t){return function(){if(t){var n=X.getFromId(e,t);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(e,n,r);return n._shiftPusher&&qe(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},X.drawOne=function(e,t,r){var n,s,p,d=(r=r||{}).axShifts||{},f=r.overlayingShiftedAx||[];t.setScale();var m=e._fullLayout,g=t._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[t._mainSubplot];if(x){if(t._shiftPusher=t.autoshift||-1!==f.indexOf(t._id)||-1!==f.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var b=t.linewidth/2||0;"inside"===t.ticks&&(b+=t.ticklen),qe(t,b,d,!0),qe(t,t.shift||0,d,!1)}!0===r.skipTitle&&void 0!==t._shift||(t._shift=function(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}(t,d));var _=x[y+"axislayer"],w=t._mainLinePosition,k=w+=t._shift,T=t._mainMirrorPosition,S=t._vals=X.calcTicks(t),A=[t.mirror,k,T].join("_");for(n=0;n0?r.bottom-u:0,h))));var p=0,d=0;if(t._shiftPusher&&(p=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),t.title.text!==m._dfltTitle[y]&&(d=(t._titleStandoff||0)+(t._titleScoot||0),"l"===l&&(d+=Ce(t))),t._fullDepth=Math.max(p,d)),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1],g="number"===typeof t._shift?t._shift:0;if("x"===y){if("b"===l?n[l]=t._depth:(n[l]=t._depth=Math.max(r.width>0?u-r.top:0,h),f.reverse()),r.width>0){var x=r.right-(t._offset+t._length);x>0&&(n.xr=1,n.r=x);var b=t._offset-r.left;b>0&&(n.xl=0,n.l=b)}}else if("l"===l?(t._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=t._depth-g):(t._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=t._depth+g,f.reverse()),r.height>0){var _=r.bottom-(t._offset+t._length);_>0&&(n.yb=0,n.b=_);var w=t._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===t.anchor?t.position:t._anchorAxis.domain[f[0]],t.title.text!==m._dfltTitle[y]&&(n[l]+=Ce(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(o[c]+=h),!0===t.mirror||"ticks"===t.mirror?o[v]=t._anchorAxis.domain[f[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(o[v]=[t._counterDomainMin,t._counterDomainMax][f[1]]))}he&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"===typeof t.automargin&&(Se(n,t.automargin),Se(o,t.automargin)),i.autoMargin(e,Ie(t),n),i.autoMargin(e,ze(t),o),i.autoMargin(e,Oe(t),s)})),o.syncOrAsync(ce)}}function pe(e){var r=g+(e||"tick");return M[r]||(M[r]=function(e,t,r){var n,i,a,o;if(e._selections[t].size())n=1/0,i=-1/0,a=1/0,o=-1/0,e._selections[t].each((function(){var e=Le(this),t=h.bBox(e.node().parentNode);n=Math.min(n,t.top),i=Math.max(i,t.bottom),a=Math.min(a,t.left),o=Math.max(o,t.right)}));else{var s=X.makeLabelFns(e,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(t,r,k)),M[r]}},X.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],i=e.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)===("x"===r)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},X.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},X.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=e.side,u=l?(e.tickwidth||0)/2:0,h=3,p=e.tickfont?e.tickfont.size:12;return(o||n)&&(u+=p*W,h+=(e.linewidth||0)/2),(i||a)&&(u+=(e.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=p*(1-W)),(i||n)&&(u=-u),"bottom"!==c&&"right"!==c||(h=-h),[l?u:0,s?h:0]}(e),r=e.ticklabelshift||0,n=e.ticklabelstandoff||0,i=t[0],a=t[1],o=e.range[0]>e.range[1],l=e.ticklabelposition&&-1!==e.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=e.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===e._id.charAt(0)?function(t){return s(i+e._offset+e.l2p(Me(t))+r,a+n)}:function(t){return s(a+n,i+e._offset+e.l2p(Me(t))+r)}},X.makeTickPath=function(e,t,r,n){n||(n={});var i=n.minor;if(i&&!e.minor)return"";var a=void 0!==n.len?n.len:i?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),s=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+s*r)+"v"+a*r:"M"+(t+s*r)+",0h"+a*r},X.makeLabelFns=function(e,t,r){var i=e.ticklabelposition||"",a=function(e){return-1!==i.indexOf(e)},s=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||s||c,h=a("inside"),p="inside"===i&&"inside"===e.ticks||!h&&"outside"===e.ticks&&"boundaries"!==e.tickson,d=0,f=0,m=p?e.ticklen:0;if(h?m*=-1:u&&(m=0),p&&(d+=m,r)){var g=o.deg2rad(r);d=m*Math.cos(g)+1,f=m*Math.sin(g)}e.showticklabels&&(p||e.showline)&&(d+=.2*e.tickfont.size);var y,v,x,b,_,w={labelStandoff:d+=(e.linewidth||1)/2*(h?-1:1),labelShift:f},k=0,T=e.side,S=e._id.charAt(0),A=e.tickangle;if("x"===S)b=(_=!h&&"bottom"===T||h&&"top"===T)?1:-1,h&&(b*=-1),y=f*b,v=t+d*b,x=_?1:-.2,90===Math.abs(A)&&(h?x+=G:x=-90===A&&"bottom"===T?W:90===A&&"top"===T?G:.5,k=G/2*(A/90)),w.xFn=function(e){return e.dx+y+k*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(l)return"end";if(c)return"start"}return n(t)&&0!==t&&180!==t?t*b<0!==h?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==h?-n:0};else if("y"===S){if(b=(_=!h&&"left"===T||h&&"right"===T)?1:-1,h&&(b*=-1),y=d,v=f*b,x=0,h||90!==Math.abs(A)||(x=-90===A&&"left"===T||90===A&&"right"===T?W:.5),h){var M=n(A)?+A:0;if(0!==M){var E=o.deg2rad(M);k=Math.abs(Math.sin(E))*W*b,x=0}}w.xFn=function(e){return e.dx+t-(y+e.fontSize*x)*b+k*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*G},w.anchorFn=function(e,t){return n(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},X.drawTicks=function(e,t,n){n=n||{};var i=t._id+"tick",a=[].concat(t.minor&&t.minor.ticks?n.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?n.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Ee);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(e){return u.stroke(r.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ue(t,[N]),o.attr("transform",n.transFn)},X.drawGrid=function(e,t,n){if(n=n||{},"sync"!==t.tickmode){var i=t._id+"grid",a=t.minor&&t.minor.showgrid,o=a?n.vals.filter((function(e){return e.minor})):[],s=t.showgrid?n.vals.filter((function(e){return!e.minor})):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(e,t,l))for(var c="array"===t.tickmode,p=0;p=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Ee);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(e){return u.stroke(r.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return h.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?f:t._gw)+"px"})).style("display",null),"function"===typeof n.path&&x.attr("d",n.path)}}Ue(t,[F,B])}},X.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",i=X.shouldShowZeroLine(e,t,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return J(e.id,t.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ue(t,[j])},X.drawLabels=function(e,t,i){i=i||{};var a=e._fullLayout,c=t._id,u=i.cls||c+"tick",p=i.vals.filter((function(e){return e.text})),d=i.labelFns,f=i.secondary?0:t.tickangle,m=(t._prevTickAngles||{})[u],g=i.layer.selectAll("g."+u).data(t.showticklabels?p:[],Ee),y=[];function v(e,a){e.each((function(e){var o=r.select(this),c=o.select(".text-math-group"),u=d.anchorFn(e,a),p=i.transFn.call(o.node(),e)+(n(a)&&0!==+a?" rotate("+a+","+d.xFn(e)+","+(d.yFn(e)-e.fontSize/2)+")":""),f=l.lineCount(o),m=$*e.fontSize,g=d.heightFn(e,n(a)?+a:0,(f-1)*m);if(g&&(p+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:p,"text-anchor":u}),y.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",p+s(v,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(t){var n=r.select(this),i=e._promises.length;n.call(l.positionText,d.xFn(t),d.yFn(t)).call(h.font,{family:t.font,size:t.fontSize,color:t.fontColor,weight:t.fontWeight,style:t.fontStyle,variant:t.fontVariant,textcase:t.fontTextcase,lineposition:t.fontLineposition,shadow:t.fontShadow}).text(t.text).call(l.convertToTspans,e),e._promises[i]?y.push(e._promises.pop().then((function(){v(n,f)}))):v(n,f)})),Ue(t,[U]),g.exit().remove(),i.repositionOnUpdate&&g.each((function(e){r.select(this).select("text").call(l.positionText,d.xFn(e),d.yFn(e))})),t._adjustTickLabelsOverflow=function(){var n=t.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===t._id.charAt(0),l=0,c=s?e._fullLayout.width:e._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(t.range,t.r2l);l=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var p=Math.min(l,c),d=Math.max(l,c),f=t.side,m=1/0,y=-1/0;for(var v in g.each((function(e){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>d||a.leftd||a.top+(t.tickangle?0:e.fontSize/4)t["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"!==e.K||i||l.style("display",null)}))}))}))}))},v(g,m+1?m:f);var x=null;t._selections&&(t._selections[u]=g);var b=[function(){return y.length&&Promise.all(y)}];t.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,b.push((function(){v(g,m)}))):b.push((function(){if(v(g,f),p.length&&t.autotickangles&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=t.autotickangles[0];var e,r=0,n=[],a=1;g.each((function(e){r=Math.max(r,e.fontSize);var i=t.l2p(e.x),o=Le(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})}));var s=("boundaries"===t.tickson||t.showdividers)&&!i.secondary,c=p.length,u=Math.abs((p[c-1].x-p[0].x)*t._m)/(c-1),d=s?u/2:u,m=s?t.ticklen:1.25*r*a,y=d/Math.sqrt(Math.pow(d,2)+Math.pow(m,2)),b=t.autotickangles.map((function(e){return e*Math.PI/180})),_=b.find((function(e){return Math.abs(Math.cos(e))<=y}));void 0===_&&(_=b.reduce((function(e,t){return Math.abs(Math.cos(e))R*O&&(L=O,E[M]=C[M]=I[M])}var D=Math.abs(L-P);D-T>0?T*=1+T/(D-=T):T=0,"y"!==t._id.charAt(0)&&(T=-T),E[A]=w.p2r(w.r2p(C[A])+S*T),"min"===w.autorange||"max reversed"===w.autorange?(E[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(E[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=E}var V=o.syncOrAsync(b);return V&&V.then&&e._promises.push(V),V},X.getPxPosition=function(e,t){var r,n=e._fullLayout._size,i=t._id.charAt(0),a=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===i?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(t.position||0)*n.w+t._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(e,t,r){var n=o.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===D)&&(Pe(t,0)||!function(e,t,r,n){var i=r._mainAxis;if(i){var a=e._fullLayout,o=t._id.charAt(0),s=X.counterLetter(t._id),l=t._offset+(Math.abs(n[0])1)for(n=1;n4/3-s?o:s}}}),cr=p({"src/components/dragelement/cursor.js"(e,t){var r=st(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,i,a){return e="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*e),0,2),t="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*t),0,2),n[t][e]}}}),ur=p({"src/components/dragelement/unhover.js"(e,t){var r=pt(),n=Ke(),i=Ce().getGraphDiv,a=j(),o=t.exports={};o.wrapped=function(e,t,r){(e=i(e))._fullLayout&&n.clear(e._fullLayout._uid+a.HOVERID),o.raw(e,t,r)},o.raw=function(e,t){var n=e._fullLayout,i=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===r.triggerHandler(e,"plotly_beforehover",t)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&i&&e.emit("plotly_unhover",{event:t,points:i}))}}}),hr=p({"src/components/dragelement/index.js"(e,t){var r=or(),n=ut(),i=sr(),a=st().removeElement,o=yt(),s=t.exports={};s.align=lr(),s.getCursor=cr();var l=ur();function c(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function u(e){return r(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(e){var t,r,l,h,p,d,f,m,g=e.gd,y=1,v=g._context.doubleClickDelay,x=e.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)v&&(y=Math.max(y-1,1)),g._dragged?e.doneFn&&e.doneFn():(d.target===f?r=d:(r={target:f,srcElement:f,toElement:f},Object.keys(d).concat(Object.keys(d.__proto__)).forEach((e=>{var t=d[e];r[e]||"function"===typeof t||(r[e]=t)}))),e.clickFn&&e.clickFn(y,r),m||f.dispatchEvent(new MouseEvent("click",t))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=c}}),pr=p({"src/lib/setcursor.js"(e,t){t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach((function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)})),t&&e.classed("cursor-"+t,!0)}}}),dr=p({"src/lib/override_cursor.js"(e,t){var r=pr(),n="data-savedcursor";t.exports=function(e,t){var i=e.attr(n);if(t){if(!i){for(var a=(e.attr("class")||"").split(" "),o=0;o("legend"===e?1:0));if(!1===A&&(c[e]=void 0),(!1!==A||h.uirevision)&&(d("uirevision",c.uirevision),!1!==A)){d("borderwidth");var M,E,C,P="h"===d("orientation"),L="paper"===d("yref"),I="paper"===d("xref"),z="left";if(P?(M=0,r.getComponentMethod("rangeslider","isVisible")(t.xaxis)?L?(E=1.1,C="bottom"):(E=1,C="top"):L?(E=-.1,C="top"):(E=0,C="bottom")):(E=1,C="auto",I?M=1.02:(M=1,z="right")),n.coerce(h,p,{x:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:M}},"x"),n.coerce(h,p,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:E}},"y"),d("traceorder",_),l.isGrouped(c[e])&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("indentation"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("xanchor",z),d("yanchor",C),d("valign"),n.noneOrAll(h,p,["x","y"]),d("title.text")){d("title.side",P?"left":"top");var O=n.extendFlat({},f,{size:n.bigFont(f.size)});n.coerceFont(d,"title.font",O)}}}}t.exports=function(e,t,r){var i,a=r.slice(),o=t.shapes;if(o)for(i=0;iM&&(A=M)}T[a][0]._groupMinRank=A,T[a][0]._preGroupSort=a}var E=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(T.forEach((function(e,t){e[0]._preGroupSort=t})),T.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),a=0;ar?r:e}t.exports=function(e,t,g){var y=t._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,b=(x+2*p.itemGap)/2,_=a(b,0),w=function(e,t,r,n){var i;if(e+1)i=e;else{if(!(t&&t.width>0))return 0;i=t.width}return v?n:Math.min(i,r)};function k(e,i,a){var c=e[0].trace,u=c.marker||{},h=u.line||{},p=u.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",d=a?c.visible&&c.type===a:n.traceIs(c,"bar"),f=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(d?[e]:[]);f.enter().append("path").classed("legend"+a,!0).attr("d",p).attr("transform",_),f.exit().remove(),f.each((function(e){var n=r.select(this),i=e[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var p=i.mcc;if(!g._inHover&&"mc"in i){var d=l(u),f=d.mid;void 0===f&&(f=(d.max+d.min)/2),p=o.tryColorscale(u,"")(f)}var y=p||i.mc||u.color,v=u.pattern,x=v&&o.getPatternAttr(v.shape,0,"");if(x){var b=o.getPatternAttr(v.bgcolor,0,null),_=o.getPatternAttr(v.fgcolor,0,null),k=v.fgopacity,T=m(v.size,8,10),S=m(v.solidity,.5,1),A="legend-"+c.uid;n.call(o.pattern,"legend",t,A,x,T,S,p,v.fillmode,b,_,k)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function T(e,a,o){var s=e[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),p=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[e]:[]);if(p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.size()){var d=l.marker||{},f=w(h(d.line.width,s.pts),d.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:f}}},m),y=i.minExtend(s,{trace:g},m);u(p,y,g,t)}}e.each((function(e){var t=r.select(this),n=i.ensureSingle(t,"g","layers");n.style("opacity",e[0].trace.opacity);var o=g.indentation,s=g.valign,l=e[0].lineHeight,c=e[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var p=n.selectAll("g.legendsymbols").data([e]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var n,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["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"]],n=!1;break;case"streamtube":c=[["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"]],n=!1;break;case"surface":c=[["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"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,h=r.select(this),p=l(a),f=p.colorscale,m=p.reversescale;if(f){if(!n){var g=f.length;u=0===c?f[m?g-1:0][1]:1===c?f[m?0:g-1][1]:f[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",e[0]),u?h.call(s.fill,u):h.call((function(e){if(e.size()){var r="legendfill-"+a.uid;o.gradient(e,t,r,d(m,"radial"===n),f,"fill")}}))}))})).each((function(e){var t=e[0].trace,n="waterfall"===t.type;if(e[0]._distinct&&n){var i=e[0].trace[e[0].dir].marker;return e[0].mc=i.color,e[0].mlw=i.line.width,e[0].mlc=i.line.color,k(e,this,"waterfall")}var a=[];t.visible&&n&&(a=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var n=r.select(this),i=t[e[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",e[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(e){k(e,this,"funnel")})).each((function(e){k(e,this)})).each((function(e){var a=e[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[e]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),l.exit().remove(),l.each((function(){var e=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);e.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(e,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,t)}}))})).each((function(e){T(e,this,"funnelarea")})).each((function(e){T(e,this,"pie")})).each((function(e){var n,a,s=f(e),u=s.showFill,h=s.showLine,p=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=e[0],b=v.trace,_=l(b),k=_.colorscale,T=_.reversescale,S=c.hasMarkers(b)||!g?"M5,0":y?"M5,-2":"M5,-3",A=r.select(this),M=A.select(".legendfill").selectAll("path").data(u||m?[e]:[]);if(M.enter().append("path").classed("js-fill",!0),M.exit().remove(),M.attr("d",S+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(u)o.fillGroupStyle(e,t,!0);else{var r="legendfill-"+b.uid;o.gradient(e,t,r,d(T),k,"fill")}})),h||p){var E=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(h||p?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",S+(p?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(T),k,"stroke")}})})).each((function(e){var n,a,s=f(e),l=s.anyFill,u=s.anyLine,h=s.showLine,p=s.showMarker,d=e[0],m=d.trace,g=!p&&!u&&!l&&c.hasText(m);function y(e,t,r,n){var a=i.nestedProperty(m,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(or[1])return r[1]}return o}function x(e){return d._distinct&&d.index&&e[d.index]?e[d.index]:e[0]}if(p||g||h){var b={},w={};if(p){b.mc=y("marker.color",x),b.mx=y("marker.symbol",x),b.mo=y("marker.opacity",i.mean,[.2,1]),b.mlc=y("marker.line.color",x),b.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var k=y("marker.size",i.mean,[2,16],12);b.ms=k,w.marker.size=k}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=y("textposition",x),b.ts=10,b.tc=y("textfont.color",x),b.tf=y("textfont.family",x),b.tw=y("textfont.weight",x),b.ty=y("textfont.style",x),b.tv=y("textfont.variant",x),b.tC=y("textfont.textcase",x),b.tE=y("textfont.lineposition",x),b.tS=y("textfont.shadow",x)),n=[i.minExtend(d,b)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var T=r.select(this).select("g.legendpoints"),S=T.selectAll("path.scatterpts").data(p?n:[]);S.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),S.exit().remove(),S.call(o.pointStyle,a,t),p&&(n[0].mrc=3);var A=T.selectAll("g.pointtext").data(g?n:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(e,n){var i=r.select(this),a=t[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(e){var t=e[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(e,n){var i=r.select(this),a=t[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),Tr=p({"src/components/legend/draw.js"(e,t){var r=v(),n=st(),i=kt(),a=Ve(),o=pt(),s=hr(),l=Jt(),c=q(),u=At(),h=yr(),p=vr(),d=St(),f=d.LINE_SPACING,m=d.FROM_TL,g=d.FROM_BR,y=xr(),x=kr(),b=mr(),_=/^legend[0-9]*$/;function w(e,t){var o,h,d=t||{},v=e._fullLayout,_=L(d),w=d._inHover;if(w?(h=d.layer,o="hover"):(h=v._infolayer,o=_),h){var A;if(o+=v._uid,e._legendMouseDownTime||(e._legendMouseDownTime=0),w){if(!d.entries)return;A=y(d.entries,d)}else{for(var I=(e.calcdata||[]).slice(),z=v.shapes,O=0;O1)}var j=v.hiddenlabels||[];if(!w&&(!v.showlegend||!A.length))return h.selectAll("."+_).remove(),v._topdefs.select("#"+o).remove(),i.autoMargin(e,_);var F=n.ensureSingle(h,"g",_,(function(e){w||e.attr("pointer-events","all")})),B=n.ensureSingleById(v._topdefs,"clipPath",o,(function(e){e.append("rect")})),N=n.ensureSingle(F,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));N.call(c.stroke,d.bordercolor).call(c.fill,d.bgcolor).style("stroke-width",d.borderwidth+"px");var U,V=n.ensureSingle(F,"g","scrollbox"),q=d.title;d._titleWidth=0,d._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",_+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),E(U,V,e,d,1)):V.selectAll("."+_+"titletext").remove();var H=n.ensureSingle(F,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)})),G=V.selectAll("g.groups").data(A);G.enter().append("g").attr("class","groups"),G.exit().remove();var W=G.selectAll("g.traces").data(n.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.style("opacity",(function(e){var t=e[0].trace;return a.traceIs(t,"pie-like")?-1!==j.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){r.select(this).call(S,e,d)})).call(x,e,d).each((function(){w||r.select(this).call(M,e,_)})),n.syncOrAsync([i.previousPromises,function(){return function(e,t,n,i){var a=e._fullLayout,o=L(i);i||(i=a[o]);var s=a._size,c=b.isVertical(i),u=b.isGrouped(i),h="fraction"===i.entrywidthmode,d=i.borderwidth,f=2*d,m=p.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(d+m),v=P(i),x=i.y<0||0===i.y&&"top"===v,_=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,T={};i._maxHeight=Math.max(x||_?a.height/2:s.h,30);var S=0;i._width=0,i._height=0;var A=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(i);if(c)n.each((function(e){var t=e[0].height;l.setTranslate(this,d+A[0],d+A[1]+i._height+t/2+m),i._height+=t,i._width=Math.max(i._width,e[0].width)})),S=g+i._width,i._width+=m+g+f,i._height+=y,u&&(t.each((function(e,t){l.setTranslate(this,0,t*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=C(i),E=i.x<0||0===i.x&&"right"===M,I=i.x>1||1===i.x&&"left"===M,z=_||x,O=a.width/2;i._maxWidth=Math.max(E?z&&"left"===M?s.l+s.w:O:I?z&&"right"===M?s.r+s.w:O:s.w,2*g);var R=0,D=0;n.each((function(e){var t=k(e,i,g);R=Math.max(R,t),D+=t})),S=null;var j=0;if(u){var F=0,B=0,N=0;t.each((function(){var e=0,t=0;r.select(this).selectAll("g.traces").each((function(r){var n=k(r,i,g),a=r[0].height;l.setTranslate(this,A[0],A[1]+d+m+a/2+t),t+=a,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var n=e+m;B>0&&n+d+B>i._maxWidth?(j=Math.max(j,B),B=0,N+=F+w,F=t):F=Math.max(F,t),l.setTranslate(this,B,N),B+=n})),i._width=Math.max(j,B)+d,i._height=N+F+y}else{var U=n.size(),V=D+f+(U-1)*m=i._maxWidth&&(j=Math.max(j,W),H=0,G+=q,i._height+=q,q=0),l.setTranslate(this,A[0]+d+H,A[1]+d+G+t/2+m),W=H+r+m,H+=n,q=Math.max(q,t)})),V?(i._width=H+f,i._height=q+y):(i._width=Math.max(j,W)+f,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(d+p.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(d+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var $=e._context.edits,Z=$.legendText||$.legendPosition;n.each((function(e){var t=r.select(this).select("."+o+"toggle"),n=e[0].height,a=e[0].trace.legendgroup,s=k(e,i,g);u&&""!==a&&(s=T[a]);var p=Z?g:S||s;c||h||(p+=m/2),l.setRect(t,0,-n/2,p,n)}))}(e,G,W,d)},function(){var t,c,y,x,b=v._size,k=d.borderwidth,S="paper"===d.xref,A="paper"===d.yref;if(q.text&&function(e,t,r){if("top center"===t.title.side||"top right"===t.title.side){var n=t.title.font.size*f,i=0,a=e.node(),o=l.bBox(a).width;"top center"===t.title.side?i=.5*(t._width-2*r-2*p.titlePad-o):"top right"===t.title.side&&(i=t._width-2*r-2*p.titlePad-o),u.positionText(e,r+p.titlePad+i,r+n)}}(U,d,k),!w){var M,E;M=S?b.l+b.w*d.x-m[C(d)]*d._width:v.width*d.x-m[C(d)]*d._width,E=A?b.t+b.h*(1-d.y)-m[P(d)]*d._effHeight:v.height*(1-d.y)-m[P(d)]*d._effHeight;var L=function(e,t,r,n){var a=e._fullLayout,o=a[t],s=C(o),l=P(o),c="paper"===o.xref,u="paper"===o.yref;e._fullLayout._reservedMargin[t]={};var h=o.y<.5?"b":"t",p=o.x<.5?"l":"r",d={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});c?e._fullLayout._reservedMargin[t][h]=d[h]:u||"v"===o.orientation?e._fullLayout._reservedMargin[t][p]=d[p]:e._fullLayout._reservedMargin[t][h]=d[h]}(e,_,M,E);if(L)return;if(v.margin.autoexpand){var I=M,z=E;M=S?n.constrain(M,0,v.width-d._width):I,E=A?n.constrain(E,0,v.height-d._effHeight):z,M!==I&&n.log("Constrain "+_+".x to make legend fit inside graph"),E!==z&&n.log("Constrain "+_+".y to make legend fit inside graph")}l.setTranslate(F,M,E)}if(H.on(".drag",null),F.on("wheel",null),w||d._height<=d._maxHeight||e._context.staticPlot){var O=d._effHeight;w&&(O=d._height),N.attr({width:d._width-k,height:O-k,x:k/2,y:k/2}),l.setTranslate(V,0,0),B.select("rect").attr({width:d._width-2*k,height:O-2*k,x:k,y:k}),l.setClipUrl(V,o,e),l.setRect(H,0,0,0,0),delete d._scrollY}else{var R,D,j,G=Math.max(p.scrollBarMinHeight,d._effHeight*d._effHeight/d._height),W=d._effHeight-G-2*p.scrollBarMargin,$=d._height-d._effHeight,Z=W/$,X=Math.min(d._scrollY||0,$);N.attr({width:d._width-2*k+p.scrollBarWidth+p.scrollBarMargin,height:d._effHeight-k,x:k/2,y:k/2}),B.select("rect").attr({width:d._width-2*k+p.scrollBarWidth+p.scrollBarMargin,height:d._effHeight-2*k,x:k,y:k+X}),l.setClipUrl(V,o,e),J(X,G,Z),F.on("wheel",(function(){J(X=n.constrain(d._scrollY+r.event.deltaY/W*$,0,$),G,Z),0!==X&&X!==$&&r.event.preventDefault()}));var Y=r.behavior.drag().on("dragstart",(function(){var e=r.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,j=X})).on("drag",(function(){var e=r.event.sourceEvent;2===e.buttons||e.ctrlKey||(D="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,J(X=function(e,t,r){var i=(r-t)/Z+e;return n.constrain(i,0,$)}(j,R,D),G,Z))}));H.call(Y);var K=r.behavior.drag().on("dragstart",(function(){var e=r.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,j=X)})).on("drag",(function(){var e=r.event.sourceEvent;"touchmove"===e.type&&(D=e.changedTouches[0].clientY,J(X=function(e,t,r){var i=(t-r)/Z+e;return n.constrain(i,0,$)}(j,R,D),G,Z))}));V.call(K)}function J(t,r,n){d._scrollY=e._fullLayout[_]._scrollY=t,l.setTranslate(V,0,-t),l.setRect(H,d._width,p.scrollBarMargin+t*n,p.scrollBarWidth,r),B.select("rect").attr("y",k+t)}e._context.edits.legendPosition&&(F.classed("cursor-move",!0),s.init({element:F.node(),gd:e,prepFn:function(e){if(e.target!==H.node()){var t=l.getTranslate(F);y=t.x,x=t.y}},moveFn:function(e,r){if(void 0!==y&&void 0!==x){var n=y+e,i=x+r;l.setTranslate(F,n,i),t=s.align(n,d._width,b.l,b.l+b.w,d.xanchor),c=s.align(i+d._height,-d._height,b.t+b.h,b.t,d.yanchor)}},doneFn:function(){if(void 0!==t&&void 0!==c){var r={};r[_+".x"]=t,r[_+".y"]=c,a.call("_guiRelayout",e,r)}},clickFn:function(t,r){var n=h.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return r.clientX>=e.left&&r.clientX<=e.right&&r.clientY>=e.top&&r.clientY<=e.bottom}));n.size()>0&&T(e,F,n,t,r)}}))}],e)}}function k(e,t,r){var n=e[0],i=n.width,a=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===a?t._maxWidth*o:r+(o||i)}function T(e,t,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var c=o.triggerHandler(e,"plotly_legendclick",l);if(1===n){if(!1===c)return;t._clickTimeout=setTimeout((function(){e._fullLayout&&h(r,e,n)}),e._context.doubleClickDelay)}else 2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==o.triggerHandler(e,"plotly_legenddoubleclick",l)&&!1!==c&&h(r,e,n))}function S(e,t,r){var i,o,s=L(r),c=e.data()[0][0],h=c.trace,d=a.traceIs(h,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!d,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=d?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(e,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(f?A(i,m):i);var y=r.indentation+r.itemwidth+2*p.itemGap;u.positionText(g,y,0),f?g.call(u.makeEditable,{gd:t,text:i}).call(E,e,t,r).on("edit",(function(n){this.text(A(n,m)).call(E,e,t,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",t,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",t,o,h.index)})):E(g,e,t,r)}function A(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t,i){var a,o=t._context.doubleClickDelay,s=1,l=n.ensureSingle(e,"rect",i+"toggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(c.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-t._legendMouseDownTimeo&&(s=Math.max(s-1,1)),T(t,n,e,s,r.event)}})))}function E(e,t,r,n,i){n._inHover&&e.attr("data-notex",!0),u.convertToTspans(e,r,(function(){!function(e,t,r,n){var i=e.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=e.select("g[class*=math-group]"),o=a.node(),s=L(r);r||(r=t._fullLayout[s]);var c,h,d=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*f;if(o){var g=l.bBox(o);c=g.height,h=g.width,1===n?l.setTranslate(a,d,d+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=e.select(y),x=u.lineCount(v),b=v.node();if(c=m*x,h=b?l.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),u.positionText(v,d+p.titlePad,d+m);else{var _=2*p.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(_=p.itemGap,h-=r.indentation+r.itemwidth),u.positionText(v,_,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,16)+3,i.width=h)}else e.remove()}(t,r,n,i)}))}function C(e){return n.isRightAnchor(e)?"right":n.isCenterAnchor(e)?"center":"left"}function P(e){return n.isBottomAnchor(e)?"bottom":n.isMiddleAnchor(e)?"middle":"top"}function L(e){return e._id||"legend"}t.exports=function(e,t){if(t)w(e,t);else{var n=e._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var e=r.select(this),t=e.attr("class").split(" ")[0];t.match(_)&&-1===i.indexOf(t)&&e.remove()}));for(var a=0;aY[0]._length||_e<0||_e>K[0]._length)return d.unhoverRaw(e,n)}else be="xpx"in n?n.xpx:Y[0]._length/2,_e="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=be+Y[0]._offset,n.pointerY=_e+K[0]._offset,ne="xval"in n?y.flat(b,n.xval):y.p2c(Y,be),ie="yval"in n?y.flat(b,n.yval):y.p2c(K,_e),!r(ne[0])||!r(ie[0]))return i.warn("Fx.hover failed",n,e),d.unhoverRaw(e,n)}var Se=1/0;function Ae(t,a){for(oe=0;oeme&&(ge.splice(0,me),Se=ge[0].distance),A&&0!==re&&0===ge.length){fe.distance=re,fe.index=!1;var u=le._module.hoverPoints(fe,pe,de,"closest",{hoverLayer:_._hoverlayer});if(u&&(u=u.filter((function(e){return e.spikeDistance<=re}))),u&&u.length){var h,d=u.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(d.length){var f=d[0];r(f.x0)&&r(f.y0)&&(h=Ee(f),(!ve.vLinePoint||ve.vLinePoint.spikeDistance>h.spikeDistance)&&(ve.vLinePoint=h))}var m=u.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Ee(g),(!ve.hLinePoint||ve.hLinePoint.spikeDistance>h.spikeDistance)&&(ve.hLinePoint=h))}}}}}function Me(e,t,r){for(var n,i=null,a=1/0,o=0;o0&&Math.abs(e.distance)Be-1;Ne--)He(ge[Ne]);ge=Ue,Ie()}var Ge=e._hoverdata,We=[],$e=$(e),Ze=Z(e);for(ae=0;ae1||ge.length>1)||"closest"===M&&xe&&ge.length>1,st=p.combine(_.plot_bgcolor||p.background,_.paper_bgcolor),lt=D(ge,{gd:e,hovermode:M,rotateLabels:ot,bgColor:st,container:_._hoverlayer,outerContainer:_._paper.node(),commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance}),ct=lt.hoverLabels;if(y.isUnifiedHover(M)||(function(e,t,r,n){var i,a,o,s,l,c,u,h=t?"xa":"ya",p=t?"ya":"xa",d=0,f=1,m=e.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,b=n.minY,_=n.maxY,w=function(e){return e*r._invScaleX},k=function(e){return e*r._invScaleY};function T(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,o=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=o;i=!1}if(i){var n=0;for(s=0;st.pmax&&n++;for(s=e.length-1;s>=0&&!(n<=0);s--)(c=e[s]).pos>t.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)e[l].dp-=o;for(s=e.length-1;s>=0&&!(n<=0);s--)(c=e[s]).pos+c.dp+c.size>t.pmax&&(c.del=!0,n--)}}}for(e.each((function(e){var n=e[h],i=e[p],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(f=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,d=B(e,t),m=e.anchor,T="end"===m?-1:1;if("middle"===m)u=(c=e.crossPos+(a?k(d.y-e.by/2):w(e.bx/2+e.tx2width/2)))+(a?k(e.by):w(e.bx));else if(a)u=(c=e.crossPos+k(E+d.y)-k(e.by/2-E))+k(e.by);else{var A=w(T*E+d.x),M=A+w(T*e.bx);c=e.crossPos+Math.min(A,M),u=e.crossPos+Math.max(A,M)}a?void 0!==b&&void 0!==_&&Math.min(u,_)-Math.max(c,b)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?S:1)/2,pmin:s,pmax:l}]})),g.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));!i&&d<=m;){for(d++,i=!0,s=0;s.01){for(l=M.length-1;l>=0;l--)M[l].dp+=a;for(A.push.apply(A,M),g.splice(s+1,1),u=0,l=A.length-1;l>=0;l--)u+=A[l].dp;for(o=u/A.length,l=A.length-1;l>=0;l--)A[l].dp-=o;i=!1}else s++}g.forEach(T)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var I=L[l],z=I.datum;z.offset=I.dp,z.del=I.del}}}(ct,ot,_,lt.commonLabelBoundingBox),N(ct,ot,_._invScaleX,_._invScaleY)),c&&c.tagName){var ut=g.getComponentMethod("annotations","hasClickToShow")(e,We);u(t.select(c),ut?"pointer":"")}c&&!s&&function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=e._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(e,0,Ge)&&(Ge&&e.emit("plotly_unhover",{event:n,points:Ge}),e.emit("plotly_hover",{event:n,points:e._hoverdata,xaxes:Y,yaxes:K,xvals:ne,yvals:ie}))}(e,n,o,s,c)}))},e.loneHover=function(e,r){var n=!0;Array.isArray(e)||(n=!1,e=[e]);var i=r.gd,a=$(i),o=Z(i),s=!1,l=D(e.map((function(e){var t=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(t,n),h=Math.max(t,n),d=Math.min(s,l),f=Math.max(s,l),m=e.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,d+=x,f+=x}c.bbox={x0:u+o,x1:h+o,y0:d+a,y1:f+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontVariant:e.fontVariant,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||p.background,container:t.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,t){var n=e.y0-e.by/2;e.offset=n-5([\s\S]*)<\/extra>/;function D(e,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,d=r.bgColor,f=r.container,m=r.outerContainer,v=r.commonLabelOpts||{};if(0===e.length)return[[]];var k=r.fontFamily||x.HOVERFONT,T=r.fontSize||x.HOVERFONTSIZE,S=r.fontWeight||a.font.weight,A=r.fontStyle||a.font.style,M=r.fontVariant||a.font.variant,P=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,I=r.fontShadow||a.font.shadow,O=e[0],R=O.xa,D=O.ya,j=l.charAt(0),B=j+"Label",N=O[B];if(void 0===N&&"multicategory"===R.type)for(var U=0;Ua.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+_+E+"H"+w+"v"+_+(2*C+b.height)+"H"+-w+"V"+_+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===R.side?(Q.minY=x-(2*C+b.height),Q.maxY=x-C):(Q.minY=x+C,Q.maxY=x+(2*C+b.height))}else{var j,F,B;"right"===D.side?(j="start",F=1,B="",y=R._offset+R._length):(j="end",F=-1,B="-",y=R._offset),x=D._offset+(O.y0+O.y1)/2,s.attr("text-anchor",j),r.attr("d","M0,0L"+B+E+","+E+"V"+(C+b.height/2)+"h"+B+(2*C+b.width)+"V-"+(C+b.height/2)+"H"+B+E+"V-"+E+"Z"),Q.minY=x-(C+b.height/2),Q.maxY=x+(C+b.height/2),"right"===D.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+b.width)):(Q.minX=y-E-(2*C+b.width),Q.maxX=y-E);var U,V=b.height/2,H=q-b.top-V,G="clip"+a._uid+"commonlabel"+D._id;if(y=0?fe:me+ve=0?me:Ae+ve=0?pe:de+xe=0?de:Me+xe=0,"top"!==e.idealAlign&&K||!J?K?(B+=V/2,e.anchor="start"):e.anchor="middle":(B-=V/2,e.anchor="end"),e.crossPos=B;else{if(e.pos=B,K=j+U/2+Q<=H,J=j-U/2-Q>=0,"left"!==e.idealAlign&&K||!J)if(K)j+=U/2,e.anchor="start";else{e.anchor="middle";var ee=Q/2,te=j+ee-H,re=j-ee;te>0&&(j-=te),re<0&&(j+=-re)}else j-=U/2,e.anchor="end";e.crossPos=j}_.attr("text-anchor",e.anchor),O&&z.attr("text-anchor",e.anchor),r.attr("transform",o(j,B)+(u?s(w):""))})),{hoverLabels:Ee,commonLabelBoundingBox:Q}}function F(e,t,r,n,a,o){var s="",l="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=i.templateString(e.name,e.trace._meta)),s=G(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(l+="x: "+e.xLabel+"
"),void 0!==e.yLabel&&(l+="y: "+e.yLabel+"
"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&"choroplethmap"!==e.trace.type&&(l+=(l?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?l=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(l=e.yLabel):l=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(l+=(l?"
":"")+e.text),void 0!==e.extraText&&(l+=(l?"
":"")+e.extraText),o&&""===l&&!e.hovertemplate&&(""===s&&o.remove(),l=s);var h=e.hovertemplate||!1;if(h){var p=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(p[c+"other"]=p[c+"Val"],p[c+"otherLabel"]=p[c+"Label"]),l=(l=i.hovertemplateString(h,p,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(R,(function(t,r){return s=G(r,e.nameLength),""}))}return[l,s]}function B(e,t){var r=0,n=e.offset;return t&&(n*=-M,r=e.offset*A),{x:r,y:n}}function N(e,r,n,i){var a=function(e){return e*n},o=function(e){return e*i};e.each((function(e){var n=t.select(this);if(e.del)return n.remove();var i=n.select("text.nums"),s=e.anchor,l="end"===s?-1:1,u=function(e){var t={start:1,end:-1,middle:0}[e.anchor],r=t*(E+C),n=r+t*(e.txwidth+C);return"middle"===e.anchor&&(r-=e.tx2width/2,n+=e.txwidth/2+C),{alignShift:t,textShiftX:r,text2ShiftX:n}}(e),p=B(e,r),d=p.x,f=p.y,m="middle"===s;n.select("path").attr("d",m?"M-"+a(e.bx/2+e.tx2width/2)+","+o(f-e.by/2)+"h"+a(e.bx)+"v"+o(e.by)+"h-"+a(e.bx)+"Z":"M0,0L"+a(l*E+d)+","+o(E+f)+"v"+o(e.by/2-E)+"h"+a(l*e.bx)+"v-"+o(e.by)+"H"+a(l*E+d)+"V"+o(f-E)+"Z");var g=d+u.textShiftX,y=f+e.ty0-e.by/2+C,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==s?(i.attr("text-anchor","start"),g=m?-e.bx/2-e.tx2width/2+C:-e.bx-C):"right"===v&&"end"!==s&&(i.attr("text-anchor","end"),g=m?e.bx/2-e.tx2width/2-C:e.bx+C)),i.call(c.positionText,a(g),o(y)),e.tx2width&&(n.select("text.name").call(c.positionText,a(u.text2ShiftX+u.alignShift*C+d),o(f+e.ty0-e.by/2+C)),n.select("rect").call(h.setRect,a(u.text2ShiftX+(u.alignShift-1)*e.tx2width/2+d),o(f-e.by/2-1),a(e.tx2width),o(e.by+2)))}))}function U(e,t){var n=e.index,a=e.trace||{},o=e.cd[0],s=e.cd[n]||{};function l(e){return e||r(e)&&0===e}var c=Array.isArray(n)?function(e,t){var r=i.castOption(o,n,e);return l(r)?r:i.extractOption({},a,"",t)}:function(e,t){return i.extractOption(s,a,e,t)};function u(t,r,n){var i=c(r,n);l(i)&&(e[t]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===a.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=i.constrain(e.x0,0,e.xa._length),e.x1=i.constrain(e.x1,0,e.xa._length),e.y0=i.constrain(e.y0,0,e.ya._length),e.y1=i.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:f.hoverLabelText(e.xa,e.xLabelVal,a.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:f.hoverLabelText(e.ya,e.yLabelVal,a.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!isNaN(e.xerr)&&!("log"===e.xa.type&&e.xerr<=0)){var h=f.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+h+" / -"+f.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+h,"x"===t&&(e.distance+=1)}if(!isNaN(e.yerr)&&!("log"===e.ya.type&&e.yerr<=0)){var p=f.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+p+" / -"+f.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+p,"y"===t&&(e.distance+=1)}var d=e.hoverinfo||e.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===d.indexOf("y")&&(e.yLabel=void 0),-1===d.indexOf("z")&&(e.zLabel=void 0),-1===d.indexOf("text")&&(e.text=void 0),-1===d.indexOf("name")&&(e.name=void 0)),e}function V(e,t,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var m=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=t.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,b,_=n.readability(v.color,m)<1.5?p.contrast(m):v.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,S=f.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=S,b=g),-1!==w.indexOf("across")){var A=a._counterDomainMin,M=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),M=Math.max(M,a.position)),x=l.l+A*l.w,b=l.l+M*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":k,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":k+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S+("right"!==a.side?k:-k),cy:y,r:k,fill:T}).classed("spikeline",!0)}if(d){var E,C,P=t.vLinePoint;i=P&&P.xa,a=P&&P.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.pointerY):(E=i._offset+P.x,C=a._offset+P.y);var L,I,z=n.readability(P.color,m)<1.5?p.contrast(m):P.color,O=i.spikemode,R=i.spikethickness,D=i.spikecolor||z,j=f.getPxPosition(e,i);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(L=j,I=C),-1!==O.indexOf("across")){var F=i._counterDomainMin,B=i._counterDomainMax;"free"===i.anchor&&(F=Math.min(F,i.position),B=Math.max(B,i.position)),L=l.t+(1-B)*l.h,I=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:I,"stroke-width":R,stroke:D,"stroke-dasharray":h.dashStyle(i.spikedash,R)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:I,"stroke-width":R+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:j-("top"!==i.side?R:-R),r:R,fill:D}).classed("spikeline",!0)}}}function H(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function G(e,t){return c.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function W(e,t,r){var n=t[e+"a"],i=t[e+"Val"],a=t.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var c=s[e+"End"];void 0===c&&(c=s[e]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function $(e){return e.offsetTop+e.clientTop}function Z(e){return e.offsetLeft+e.clientLeft}function X(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],p=c[1],d=u[0],f=u[1];return{x:h,y:p,width:d-h,height:f-p,top:Math.min(p,f),left:Math.min(h,d),right:Math.max(h,d),bottom:Math.max(p,f)}}}}),Ar=p({"src/components/fx/hoverlabel_defaults.js"(e,t){var r=st(),n=q(),i=Xt().isUnifiedHover;t.exports=function(e,t,a,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Mr=p({"src/components/fx/layout_global_defaults.js"(e,t){var r=st(),n=Ar(),i=F();t.exports=function(e,t){n(e,t,(function(n,a){return r.coerce(e,t,i,n,a)}))}}}),Er=p({"src/components/fx/defaults.js"(e,t){var r=st(),n=B(),i=Ar();t.exports=function(e,t,a,o){var s=r.extendFlat({},o.hoverlabel);t.hovertemplate&&(s.namelength=-1),i(e,t,(function(i,a){return r.coerce(e,t,n,i,a)}),s)}}}),Cr=p({"src/components/fx/hovermode_defaults.js"(e,t){var r=st(),n=F();t.exports=function(e,t){function i(i,a){return void 0!==t[i]?t[i]:r.coerce(e,t,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}}),Pr=p({"src/components/fx/layout_defaults.js"(e,t){var r=st(),n=F(),i=Cr(),a=Ar();t.exports=function(e,t){function o(i,a){return r.coerce(e,t,n,i,a)}i(e,t)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=t._has("mapbox"),l=t._has("map"),c=t._has("geo"),u=t._basePlotModules.length;"zoom"===t.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(t.dragmode="pan"),a(e,t,o),r.coerceFont(o,"hoverlabel.grouptitlefont",t.hoverlabel.font)}}}),Lr=p({"src/components/fx/calc.js"(e,t){var r=st(),n=Ve();function i(e,t,n,i){i=i||r.identity,Array.isArray(e)&&(t[0][n]=i(e))}t.exports=function(e){var t=e.calcdata,a=e._fullLayout;function o(e){return function(t){return r.coerceHoverinfo({hoverinfo:t},{_module:e._module},a)}}for(var s=0;s"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),jr=p({"src/components/shapes/draw_newshape/constants.js"(e,t){t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),Fr=p({"src/components/selections/helpers.js"(e,t){var r=st().strTranslate;function n(e,t){switch(e.type){case"log":return e.p2d(t);case"date":return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}t.exports={p2r:n,r2p:function(e,t){switch(e.type){case"log":return e.d2p(t);case"date":return e.r2p(t,0,e.calendar);default:return e.r2p(t)}},axValue:function(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return n(e,r[t])}},getTransform:function(e){return r(e.xaxis._offset,e.yaxis._offset)}}}}),Br=p({"src/components/shapes/draw_newshape/helpers.js"(e){var t=Yt(),r=jr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=Fr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(e,t){return Math.abs(e-t)<=1e-6}function h(e,t){var r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+n*n)}e.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",n=0;n0&&ud&&(e="X"),e}));return a>d&&(f=f.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+e)),u+f}))}(o,l,u);if("pixel"===o.xsizemode){var S=l(o.xanchor);h=S+o.x0+_,p=S+o.x1+w}else h=l(o.x0)+_,p=l(o.x1)+w;if("pixel"===o.ysizemode){var A=u(o.yanchor);d=A-o.y0+k,f=A-o.y1+T}else d=u(o.y0)+k,f=u(o.y1)+T;if("line"===m)return"M"+h+","+d+"L"+p+","+f;if("rect"===m)return"M"+h+","+d+"H"+p+"V"+f+"H"+h+"Z";var M=(h+p)/2,E=(d+f)/2,C=Math.abs(M-h),P=Math.abs(E-d),L="A"+C+","+P,I=M+C+","+E;return"M"+I+L+" 0 1,1 "+M+","+(E-P)+L+" 0 0,1 "+I+"Z"}}}),Hr=p({"src/components/shapes/display_labels.js"(e,t){var r=st(),n=nr(),i=At(),a=Jt(),o=Br().readPaths,s=qr(),l=s.getPathString,c=Re(),u=St().FROM_TL;t.exports=function(e,t,h,p){if(p.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var d;if(h.label.texttemplate){var f={};if("path"!==h.type){var m=n.getFromId(e,h.xref),g=n.getFromId(e,h.yref);for(var y in c){var v=c[y](h,m,g);void 0!==v&&(f[y]=v)}}d=r.texttemplateStringForShapes(h.label.texttemplate,{},e._fullLayout._d3locale,f)}else d=h.label.text;var x,b,_,w,k={"data-index":t},T=h.label.font,S=p.append("g").attr(k).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(d);if(h.path){var A=l(e,h),M=o(A,e);x=1/0,_=1/0,b=-1/0,w=-1/0;for(var E=0;E=e?t-n:n-t,-180/Math.PI*Math.atan2(i,a)}(x,_,b,w):0),S.call((function(t){return t.call(a.font,T).attr({}),i.convertToTspans(t,e),t}));var G=function(e,t,r,n,i,a,o){var s,l,c,h,p=i.label.textposition,d=i.label.textangle,f=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,b=i.label.yanchor;if("line"===m){"start"===p?(s=e,l=t):"end"===p?(s=r,l=n):(s=(e+r)/2,l=(t+n)/2),"auto"===x&&(x="start"===p?"auto"===d?r>e?"left":re?"right":re?"right":re?"left":r1&&(2!==e.length||"Z"!==e[1][0])&&(0===P&&(e[0][0]="M"),t[C]=e,S(),A())}}()}}function V(e,r){!function(e,r){if(t.length)for(var n=0;nD&&a>j&&!r.shiftKey?d.getCursor(o/i,1-s/a):"move";f(t,l),R=l.split("-")[0]}}function se(r){b(e)||(F&&(w=J(o.xanchor)),B&&(S=Q(o.yanchor)),"path"===o.type?O=o.path:(p=F?o.x0:J(o.x0),v=B?o.y0:Q(o.y0),x=F?o.x1:J(o.x1),_=B?o.y1:Q(o.y1)),p_?(A=v,P="y0",M=_,L="y1"):(A=_,P="y1",M=v,L="y0"),oe(r),pe(c,o),fe(t,o,e),ne.moveFn="move"===R?ue:he,ne.altKey=r.altKey)}function le(){b(e)||(f(t),de(c),k(t,e,o),n.call("_guiRelayout",e,u.getUpdateObj()))}function ce(){b(e)||de(c)}function ue(r,n){if("path"===o.type){var i=function(e){return e},a=i,u=i;F?V("xanchor",o.xanchor=ee(w+r)):(a=function(e){return ee(J(e)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=te(S+n)):(u=function(e){return te(Q(e)+n)},W&&"date"===W.type&&(u=g.encodeDate(u))),V("path",o.path=T(O,a,u))}else F?V("xanchor",o.xanchor=ee(w+r)):(V("x0",o.x0=ee(p+r)),V("x1",o.x1=ee(x+r))),B?V("yanchor",o.yanchor=te(S+n)):(V("y0",o.y0=te(v+n)),V("y1",o.y1=te(_+n)));t.attr("d",y(e,o)),pe(c,o),l(e,s,o,q)}function he(r,n){if(U){var i=function(e){return e},a=i,u=i;F?V("xanchor",o.xanchor=ee(w+r)):(a=function(e){return ee(J(e)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=te(S+n)):(u=function(e){return te(Q(e)+n)},W&&"date"===W.type&&(u=g.encodeDate(u))),V("path",o.path=T(O,a,u))}else if(N){if("resize-over-start-point"===R){var h=p+r,d=B?v-n:v+n;V("x0",o.x0=F?h:ee(h)),V("y0",o.y0=B?d:te(d))}else if("resize-over-end-point"===R){var f=x+r,m=B?_-n:_+n;V("x1",o.x1=F?f:ee(f)),V("y1",o.y1=B?m:te(m))}}else{var b=function(e){return-1!==R.indexOf(e)},k=b("n"),G=b("s"),$=b("w"),Z=b("e"),X=k?A+n:A,Y=G?M+n:M,K=$?E+r:E,re=Z?C+r:C;B&&(k&&(X=A-n),G&&(Y=M-n)),(!B&&Y-X>j||B&&X-Y>j)&&(V(P,o[P]=B?X:te(X)),V(L,o[L]=B?Y:te(Y))),re-K>D&&(V(I,o[I]=F?K:ee(K)),V(z,o[z]=F?re:ee(re)))}t.attr("d",y(e,o)),pe(c,o),l(e,s,o,q)}function pe(e,t){function r(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]),a=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":a}).classed("visual-cue",!0);var o=J(F?t.xanchor:i.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,m.paramIsX))),s=Q(B?t.yanchor:i.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),F&&B){var l="M"+(o-1-a)+","+(s-1-a)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(F){var c="M"+(o-1-a)+","+(s-9-a)+"v18 h2 v-18 Z";n.attr("d",c)}else{var u="M"+(o-9-a)+","+(s-1-a)+"h18 v2 h-18 Z";n.attr("d",u)}}(F||B)&&r()}function de(e){e.selectAll(".visual-cue").remove()}function fe(e,t,r){var n=t.xref,i=t.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(e,l?"clip"+r._fullLayout._uid+l:null,r)}d.init(ne),re.node().onmousemove=oe}(e,j,v,t,c,R):!0===v.editable&&j.style("pointer-events",z||u.opacity(C)*E<=.5?"stroke":"all");j.node().addEventListener("click",(function(){return function(e,t){if(_(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeShapeIndex)return void S(e);e._fullLayout._activeShapeIndex=n,e._fullLayout._deactivateShape=S,x(e)}}}(e,j)}))}v._input&&!0===v.visible&&("above"===v.layer?A(e._fullLayout._shapeUpperLayer):"paper"===v.xref||"paper"===v.yref?A(e._fullLayout._shapeLowerLayer):"between"===v.layer?A(w.shapelayerBetween):w._hadPlotinfo?A((w.mainplotinfo||w).shapelayer):A(e._fullLayout._shapeLowerLayer))}function k(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function T(e,t,r){return e.replace(m.segmentRE,(function(e){var n=0,i=e.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+e.substr(1).replace(m.paramRE,(function(e){return n>=s||(a[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function S(e){_(e)&&e._fullLayout._activeShapeIndex>=0&&(c(e),delete e._fullLayout._activeShapeIndex,x(e))}t.exports={draw:x,drawOne:w,eraseActiveShape:function(e){if(_(e)){c(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t1?(I=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],z=["resetGeo"]):g?(I=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(L=["zoomInMapbox","zoomOutMapbox"],I=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],I=["toggleHover"],z=["resetViewMap"]):v?I=["hoverClosestPie"]:S?(I=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):I=["toggleHover"],m&&I.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(e){for(var t=0;tn?i.substr(n):a.substr(r))+o:i+a+e*t:o}function f(e,t){for(var r=t._size,n=r.h/r.w,i={},a=Object.keys(e),o=0;os*x)||k)for(i=0;iz&&jL&&(L=j);p/=(L-P)/(2*I),P=c.l2r(P),L=c.l2r(L),c.range=c._input.range=M=e[1]||i[1]<=e[0])&&a[0]t[0])return!0}return!1}function k(r){var a,o,c,d,f,m,g=r._fullLayout,y=g._size,v=y.p,x=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),e.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function b(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-v-n:t._offset+t._length+v+n:y.t+y.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+v+n:t._offset-v-n:y.l+y.w*(e.position||0)+n%1}for(a=0;a.5?"t":"b",o=e._fullLayout.margin[a],s=0;return"paper"===t.yref?s=r+t.pad.t+t.pad.b:"container"===t.yref&&(s=function(e,t,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===e?("top"===r&&(a+=i),a+=n-t*n):("bottom"===r&&(a+=i),a+=t*n),a}(a,n,i,e._fullLayout.height,r)+t.pad.t+t.pad.b),s>o?s:0}(e,r,m);if(g>0){!function(e,t,r,a){var o="title.automargin",s=e._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(e,t,r,n,a){var o="paper"===t.yref?e._fullLayout._size.h:e._fullLayout.height,s=i.isTopAnchor(t)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(t)&&"t"===r||i.isBottomAnchor(t)&&"b"===r)&&l=0;T--){var S=i.append("path").attr(g).style("opacity",T?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,T?"solid":_,T?4+b:b);if(d(S,e,p),w){var A=s(e.layout,"selections",p);S.style({cursor:"move"});var M={element:S.node(),plotinfo:m,gd:e,editHelpers:A,isActiveSelection:!0},E=r(l,e);n(E,S,M)}else S.style("pointer-events",T?"all":"none");k[T]=S}var C=k[0];k[1].node().addEventListener("click",(function(){return function(e,t){if(h(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeSelectionIndex)return void f(e);e._fullLayout._activeSelectionIndex=n,e._fullLayout._deactivateSelection=f,u(e)}}}(e,C)}))}(e._fullLayout._selectionLayer)}function d(e,t,r){var n=r.xref+r.yref;o.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function f(e){h(e)&&e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,u(e))}t.exports={draw:u,drawOne:p,activateLastSelection:function(e){if(h(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=f,u(e)}}}}}),an=p({"node_modules/polybooljs/lib/build-log.js"(e,t){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!==typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}}}),on=p({"node_modules/polybooljs/lib/epsilon.js"(e,t){t.exports=function(e){"number"!==typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"===typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])e!=o-i>e&&(a-c)*(i-u)/(o-u)+c-n>e&&(s=!s),a=c,o=u}return s}};return t}}}),sn=p({"node_modules/polybooljs/lib/linked-list.js"(e,t){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,i=e.root.next;null!==i;){if(r(i))return t.prev=i.prev,t.next=i,i.prev.next=t,void(i.prev=t);n=i,i=i.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}}}),ln=p({"node_modules/polybooljs/lib/intersecter.js"(e,t){var r=sn();t.exports=function(e,t,n){function i(e,t,r){return{id:n?n.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=r.create();function o(e,r){a.insertBefore(e,(function(n){return function(e,r,n,i,a,o){var s=t.pointsCompare(r,a);return 0!==s?s:t.pointsSame(n,o)?0:e!==i?e?1:-1:t.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(e.isStart,e.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(e,t){var n=function(e,t){var n=r.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(n,e.end),n}(e,t);return function(e,t,n){var i=r.node({isStart:!1,pt:t.end,seg:t,primary:n,other:e,status:null});e.other=i,o(i,e.pt)}(n,e,t),n}function l(e,t){var r=i(t,e.seg.end,e.seg);return function(e,t){n&&n.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),s(r,e.primary)}function c(i,o){var s=r.create();function c(e){return s.findTransition((function(r){var n=function(e,r){var n=e.seg.start,i=e.seg.end,a=r.seg.start,o=r.seg.end;return t.pointsCollinear(n,a,o)?t.pointsCollinear(i,a,o)||t.pointAboveOrOnLine(i,a,o)?1:-1:t.pointAboveOrOnLine(n,a,o)?1:-1}(e,r.ev);return n>0}))}function u(e,r){var i=e.seg,a=r.seg,o=i.start,s=i.end,c=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=t.linesIntersect(o,s,c,u);if(!1===h){if(!t.pointsCollinear(o,s,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(s,c))return!1;var p=t.pointsSame(o,c),d=t.pointsSame(s,u);if(p&&d)return r;var f=!p&&t.pointBetween(o,c,u),m=!d&&t.pointBetween(s,c,u);if(p)return m?l(r,s):l(e,u),r;f&&(d||(m?l(r,s):l(e,u)),l(r,o))}else 0===h.alongA&&(-1===h.alongB?l(e,c):0===h.alongB?l(e,h.pt):1===h.alongB&&l(e,u)),0===h.alongB&&(-1===h.alongA?l(r,o):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,s));return!1}for(var h=[];!a.isEmpty();){var p=a.getHead();if(n&&n.vert(p.pt[0]),p.isStart){let t=function(){if(f){var e=u(p,f);if(e)return e}return!!m&&u(p,m)};n&&n.segmentNew(p.seg,p.primary);var d=c(p),f=d.before?d.before.ev:null,m=d.after?d.after.ev:null;n&&n.tempStatus(p.seg,!!f&&f.seg,!!m&&m.seg);var g,y,v=t();if(v)e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above):v.seg.otherFill=p.seg.myFill,n&&n.segmentUpdate(v.seg),p.other.remove(),p.remove();if(a.getHead()!==p){n&&n.rewind(p.seg);continue}e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below):null===p.seg.otherFill&&(g=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:i,p.seg.otherFill={above:g,below:g}),n&&n.status(p.seg,!!f&&f.seg,!!m&&m.seg),p.other.status=d.insert(r.node({ev:p}))}else{var x=p.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!p.primary){var b=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=b}h.push(p.seg)}a.getHead().remove()}return n&&n.done(),h}return e?{addRegion:function(e){for(var r,i,a,o=e[e.length-1],l=0;la!==d>a&&i<(p-u)*(a-h)/(d-h)+u&&(o=!o)}return o}}}),fn=p({"src/lib/polygon.js"(e,t){var r=Ee().dot,n=T().BADNUM,i=t.exports={};i.tester=function(e){var t,r=e.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),t=1;ta||c===n||cs)&&(!t||!l(e))}:function(e,t){var l=e[0],c=e[1];if(l===n||la||c===n||cs)return!1;var u,h,p,d,f,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;uMath.max(h,g)||c>Math.max(p,y)))if(cu||Math.abs(r(o,p))>i)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}}}),mn=p({"src/components/selections/constants.js"(e,t){t.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),gn=p({"src/components/selections/select.js"(e,t){var r=pn(),n=dn(),i=Ve(),a=Jt().dashStyle,o=q(),s=zr(),l=Xt().makeEventData,c=Or(),u=c.freeMode,h=c.rectMode,p=c.drawMode,d=c.openMode,f=c.selectMode,m=qr(),g=Vr(),y=Gr(),v=xt().clearOutline,x=Br(),b=x.handleEllipse,_=x.readPaths,w=Nr().newShapes,k=Ur(),T=nn().activateLastSelection,S=st(),A=S.sorterAsc,M=fn(),E=Ke(),C=vt().getFromId,P=Rr(),L=rn().redrawReglTraces,I=mn(),z=I.MINSELECT,O=M.filter,R=M.tester,D=Fr(),j=D.p2r,F=D.axValue,B=D.getTransform;function N(e){return void 0!==e.subplot}function U(e,t,r,n,i,a,o){var s,l,c,u,h,p,f,m,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){W(e,t,a);var _=function(e,t){var r,n,i=e[0],a=-1,o=[];for(n=0;n0?function(e,t){var r,n,i,a=[];for(i=0;i0&&a.push(r);if(1===a.length&&a[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(i=0;i1)return!1;if((n+=t.selectedpoints.length)>1)return!1}return 1===n}(s)&&(p=K(_))){for(o&&o.remove(),g=0;g=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=p(r),l=f(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,e)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(e)&&(u=k(h,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&T(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function Z(e){return e._id}function X(e,t,r,n){if(!e.calcdata)return[];var i,a,o,s=[],l=t.map(Z),c=r.map(Z);for(o=0;o0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(i)>-1}function J(e,t,r){var n,a;for(n=0;n-1&&t;if(!a&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,de=te[0].yref;if(ne&&de){var fe=ce(te);ue([C(e,ne,"x"),C(e,de,"y")])(Q,fe)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&he(e,Q),d._reselect=!1}if(!a&&d._deselect){var me=d._deselect;(function(e,t,r){for(var n=0;n=0)T._fullLayout._deactivateShape(T);else if(!x){var r=A.clickmode;E.done(Ae).then((function(){if(E.clear(Ae),2===e){for(be.remove(),K=0;K-1&&U(t,T,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&he(T,void 0);s.click(T,t,L.id)})).catch(S.error)}},n.doneFn=function(){Te.remove(),E.done(Ae).then((function(){E.clear(Ae),!M&&Y&&n.selectionDefs&&(Y.subtract=xe,n.selectionDefs.push(Y),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(M||x)&&$(n,M),n.doneFnCompleted&&n.doneFnCompleted(Me),_&&he(T,ae)})).catch(S.error)}},clearOutline:v,clearSelectionsCache:$,selectOnClick:U}}}),yn=p({"src/components/annotations/arrow_paths.js"(e,t){t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),vn=p({"src/constants/axis_placeable_objects.js"(e,t){t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}}}),xn=p({"src/components/annotations/attributes.js"(e,t){var r=yn(),n=D(),i=yt(),a=gt().templatedArray;vn(),t.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),bn=p({"src/traces/scatter/constants.js"(e,t){t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),_n=p({"src/traces/scatter/fillcolor_attribute.js"(e,t){t.exports=function(e){return{valType:"color",editType:"style",anim:!0}}}}),wn=p({"src/traces/scatter/attributes.js"(e,t){var r=Et().axisHoverFormat,n=Oe().texttemplateAttrs,i=Oe().hovertemplateAttrs,a=Lt(),o=D(),s=Ie().dash,l=Ie().pattern,c=Jt(),u=bn(),h=R().extendFlat,p=_n();t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:p(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),kn=p({"src/components/selections/attributes.js"(e,t){var r=xn(),n=wn().line,i=Ie().dash,a=R().extendFlat,o=Le().overrideAll,s=gt().templatedArray;vn(),t.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),Tn=p({"src/components/selections/defaults.js"(e,t){var r=st(),n=nr(),i=Ft(),a=kn(),o=qr();function s(e,t,i){function s(n,i){return r.coerce(e,t,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete t.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var p,d,f,m=u[h],g={_fullLayout:i},y=n.coerceRef(e,t,g,m);if((p=n.getFromId(g,y))._selectionIndices.push(t._index),f=o.rangeToShapePosition(p),d=o.shapePositionToRange(p),c){var v=m+"0",x=m+"1",b=e[v],_=e[x];e[v]=d(e[v],!0),e[x]=d(e[x],!0),n.coercePosition(t,g,s,y,v),n.coercePosition(t,g,s,y,x);var w=t[v],k=t[x];void 0!==w&&void 0!==k&&(t[v]=f(w),t[x]=f(k),e[v]=b,e[x]=_)}}c&&r.noneOrAll(e,t,["x0","x1","y0","y1"])}t.exports=function(e,t){i(e,t,{name:"selections",handleItemDefaults:s});for(var r=t.selections,n=0;n=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(e,t,r,n,i){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(t,r)).attr("d","M0,0Z")}function V(e,t,r,n,i,a){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,i,a)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function G(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function W(e){I&&e.data&&e._context.showTips&&(n.notifier(n._(e,"Double-click to zoom back out"),"long"),I=!1)}function $(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,L)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function Z(e,t,r,i,a){for(var o,s,l,c,u=!1,h={},p={},d=(a||{}).xaHash,f=(a||{}).yaHash,m=0;m=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(G(o),2!==n||ye||function(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];ie&&(r=r.concat(H)),ae&&(r=r.concat(K)),ne.xaxes&&(r=r.concat(ne.xaxes)),ne.yaxes&&(r=r.concat(ne.yaxes));var n,i,a={};if("reset+autosize"===t)for(t="autosize",i=0;i-1&&M(a,o,H,K,t.id,Le),l.indexOf("event")>-1&&p.click(o,a,t.id);else if(1===n&&ye){var u=g?z:I,h="s"===g||"w"===v?0:1,d=u._name+".range["+h+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===v&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(be).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(f),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(e){var t=u.d2r(e);void 0!==t&&s.call("_guiRelayout",o,d,t)}))}}}function Oe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,de*t+_e)),i=Math.max(0,Math.min(te,fe*r+we)),a=Math.abs(n-_e),o=Math.abs(i-we);function s(){Me="",ke.r=ke.l,ke.t=ke.b,Ce.attr("d","M0,0Z")}if(ke.l=Math.min(_e,n),ke.r=Math.max(_e,n),ke.t=Math.min(we,i),ke.b=Math.max(we,i),re.isSubplotConstrained)a>L||o>L?(Me="xy",a/ee>o/te?(o=a*te/ee,we>i?ke.t=we-o:ke.b=we+o):(a=o*ee/te,_e>n?ke.l=_e-a:ke.r=_e+a),Ce.attr("d",$(ke))):s();else if(ne.isSubplotConstrained)if(a>L||o>L){Me="xy";var l=Math.min(ke.l/ee,(te-ke.b)/te),c=Math.max(ke.r/ee,(te-ke.t)/te);ke.l=l*ee,ke.r=c*ee,ke.b=(1-l)*te,ke.t=(1-c)*te,Ce.attr("d",$(ke))}else s();else!ae||o0){var u;if(ne.isSubplotConstrained||!ie&&1===ae.length){for(u=0;u1&&(void 0!==a.maxallowed&&se===(a.range[0]1&&(void 0!==o.maxallowed&&le===(o.range[0]1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))t.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;t.set(v)}return!m&&(p(g,y),d(e),!0)}var x,b,_,w,k,T,S,A,M=Object.keys(l).map(Number).sort(i),E=t.get(),C=E||[],P=u(y,h).get(),L=[],I=-1,z=C.length;for(x=0;xC.length-(S?0:1))n.warn("index out of range",h,_);else if(void 0!==T)k.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,_),s(T)?L.push(_):S?("add"===T&&(T={}),C.splice(_,0,T),P&&P.splice(_,0,{})):n.warn("Unrecognized full object edit value",h,_,T),-1===I&&(I=_);else for(b=0;b=0;x--)C.splice(L[x],1),P&&P.splice(L[x],1);if(C.length?E||t.set(C):t.set(null),m)return!1;if(p(g,y),f!==r){var O;if(-1===I)O=M;else{for(z=Math.max(C.length,z),O=[],x=0;x=I);x++)O.push(_);for(x=I;x0&&n.log("Clearing previous rejected promises from queue."),e._promises=[]},e.cleanLayout=function(t){var r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(t));for(r=0;r3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),o.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var a=0;a0)return e.substr(0,t)}e.hasParent=function(e,t){for(var r=g(t);r;){if(r in e)return!0;r=g(r)}return!1};var y=["x","y","z"];e.clearAxisTypes=function(e,t,r){for(var i=0;i=e.data.length||i<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(i,n+1)>-1||i>=0&&t.indexOf(-e.data.length+i)>-1||i<0&&t.indexOf(e.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&z(e,r,"newIndices"),"undefined"!==typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,n,o,s){!function(e,t,r,n){var a=i.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"===typeof r)throw new Error("indices must be an integer or array of integers");for(var o in z(e,r,"indices"),t){if(!Array.isArray(t[o])||t[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==t[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,n,o);for(var l=function(e,t,n,o){var s,l,c,u,h,p=i.isPlainObject(o),d=[];for(var f in Array.isArray(n)||(n=[n]),n=I(n,e.data.length-1),t)for(var m=0;m0&&"string"!==typeof z.parts[R];)R--;var D=z.parts[R],j=z.parts[R-1]+"."+D,N=z.parts.slice(0,R).join("."),U=a(e.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==O){T[I]=O,M[I]="reverse"===D?O:F(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==O)for(var G in H.impliedEdits)E(i.relativeAttr(I,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(I))if(O){E("autosize",null);var $="height"===I?"width":"height";E($,u[$])}else u[I]=e._initialAutoSize[I];else if("autosize"===I)E("width",O?null:u.width),E("height",O?null:u.height);else if(j.match(W))L(j),a(u,N+"._inputRange").set(null);else if(j.match(Z)){L(j),a(u,N+"._inputRange").set(null);var Y=a(u,N).get();Y._inputDomain&&(Y._input.domain=Y._inputDomain.slice())}else j.match(X)&&a(u,N+"._inputDomain").set(null);if("type"===D){C=U;var J="linear"===V.type&&"log"===O,Q="log"===V.type&&"linear"===O;if(J||Q){if(C&&C.range)if(V.autorange)J&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var ee=C.range[0],te=C.range[1];J?(ee<=0&&te<=0&&E(N+".autorange",!0),ee<=0?ee=te/1e6:te<=0&&(te=ee/1e6),E(N+".range[0]",Math.log(ee)/Math.LN10),E(N+".range[1]",Math.log(te)/Math.LN10)):(E(N+".range[0]",Math.pow(10,ee)),E(N+".range[1]",Math.pow(10,te)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(e,V,O,E),l.getComponentMethod("images","convertCoords")(e,V,O,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(D.match(A)){var re=a(u,I).get(),ne=(O||{}).type;ne&&"-"!==ne||(ne="linear"),l.getComponentMethod("annotations","convertCoords")(e,re,ne,E),l.getComponentMethod("images","convertCoords")(e,re,ne,E)}var ie=_.containerArrayMatch(I);if(ie){r=ie.array,n=ie.index;var ae=ie.property,oe=H||{editType:"calc"};""!==n&&""===ae&&(_.isAddVal(O)?M[I]=null:_.isRemoveVal(O)?M[I]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",t)),S.update(k,oe),y[r]||(y[r]={});var se=y[r][n];se||(se=y[r][n]={}),se[ae]=O,delete t[I]}else"reverse"===D?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===I&&(!1===O&&!1!==q||!1!==O&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===I&&("lasso"===O||"select"===O)&&"lasso"!==q&&"select"!==q?k.plot=!0:H?S.update(k,H):k.calc=!0,z.set(O))}}for(r in y)_.applyContainerArrayChanges(e,d(s,r),y[r],k,d)||(k.plot=!0);for(var le in P){var ce=(C=h.getFromId(e,le))&&C._constraintGroup;if(ce)for(var ue in k.calc=!0,ce)P[ue]||(h.getFromId(e,ue)._constraintShrinkable=!0)}(K(e)||t.height||t.width)&&(k.plot=!0);var he=u.shapes;for(n=0;n1;)if(n.pop(),void 0!==(r=a(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ie(e,t){for(var r=0;r=a.length?a[0]:a[e]:a}function l(e){return Array.isArray(o)?e>=o.length?o[0]:o[e]:o}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var p,d,f=0;function m(e){return Array.isArray(a)?f>=a.length?e.transitionOpts=a[f]:e.transitionOpts=a[0]:e.transitionOpts=a,f++,e}var g=[],y=void 0===t||null===t,v=Array.isArray(t);if(y||v||!i.isPlainObject(t)){if(y||-1!==["string","number"].indexOf(typeof t))for(p=0;p0&&__)&&k.push(d);g=k}}g.length>0?function(t){if(0!==t.length){for(var i=0;in._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,u.transition(e,t.frame.data,t.frame.layout,w.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};t()}()}}(g):(e.emit("plotly_animated"),o())}))},e.addFrames=function(e,t,r){if(e=i.getGraphDiv(e),null===t||void 0===t)return Promise.resolve();if(!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,c=e._transitionData._frames,h=e._transitionData._frameHash;if(!Array.isArray(t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+t);var p=c.length+2*t.length,d=[],f={};for(n=t.length-1;n>=0;n--)if(i.isPlainObject(t[n])){var m=t[n].name,g=(h[m]||f[m]||{}).name,y=t[n].name,v=h[g]||f[g];g&&y&&"number"===typeof y&&v&&M<5&&(M++,i.warn('addFrames: overwriting frame "'+(h[g]||f[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&i.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.")),f[m]={name:m},d.push({frame:u.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}d.sort((function(e,t){return e.index>t.index?-1:e.index=0;n--){if("number"===typeof(a=d[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+e._transitionData._counter++];);if(h[a.name]){for(o=0;o=0;r--)n=t[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,p=[e,l],d=[e,o];return s&&s.add(e,c,p,h,d),u.modifyFrames(e,o)},e.addTraces=function t(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=e.deleteTraces,h=t,p=[r,c],d=[r,n];for(function(e,t,r){var n,i;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n=0&&r=0&&r")?"":t.html(e).text()}));return t.remove(),n}(b)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(s,"'")}}}),Dn=p({"src/snapshot/svgtoimg.js"(e,t){var r=st(),n=ht().EventEmitter,i=On();t.exports=function(e){var t=e.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=e.svg,u=e.format||"png",h=e.canvas,p=e.scale||1,d=e.width||300,f=e.height||150,m=p*d,g=p*f,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!e.promise)return t.emit("error",l)}n(r),e.promise||t.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!e.promise)return t.emit("error",r)},v.src=s}));return e.promise?a:t}}}),jn=p({"src/plot_api/to_image.js"(e,t){var r=k(),n=zn(),i=kt(),a=st(),o=On(),s=Rn(),l=Dn(),c=g().version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var h,p,d,f;function m(e){return!(e in t)||a.validate(t[e],u[e])}if(t=t||{},a.isPlainObject(e)?(h=e.data||[],p=e.layout||{},d=e.config||{},f={}):(e=a.getGraphDiv(e),h=a.extendDeep([],e.data),p=a.extendDeep({},e.layout),d=e._context,f=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(e,r){return a.coerce(t,g,u,e,r)}var v=y("format"),x=y("width"),b=y("height"),_=y("scale"),w=y("setBackground"),k=y("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var S=a.extendFlat({},p);x?S.width=x:null===t.width&&r(f.width)&&(S.width=f.width),b?S.height=b:null===t.height&&r(f.height)&&(S.height=f.height);var A=a.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),M=o.getRedrawFunc(T);function E(){return new Promise((function(e){setTimeout(e,o.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,v,_),u=T._fullLayout.width,h=T._fullLayout.height;function p(){n.purge(T),document.body.removeChild(T)}if("full-json"===v){var d=i.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),p(),e(k?d:o.encodeJSON(d))}if(p(),"svg"===v)return e(k?r:o.encodeSVG(r));var f=document.createElement("canvas");f.id=a.randstr(),l({format:v,width:u,height:h,scale:_,canvas:f,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){n.newPlot(T,h,S,A).then(M).then(E).then(C).then((function(t){e(function(e){return k?e.replace(o.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}}}),Fn=p({"src/plot_api/validate.js"(e,t){var r=st(),n=kt(),i=mt(),a=$().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(e,t,n,i,a,u){u=u||[];for(var h=Object.keys(e),m=0;mx.length&&i.push(p("unused",a,y.concat(x.length)));var S,A,M,E,C,P=x.length,L=Array.isArray(T);if(L&&(P=Math.min(P,T.length)),2===b.dimensions)for(A=0;Ax[A].length&&i.push(p("unused",a,y.concat(A,x[A].length)));var I=x[A].length;for(S=0;S<(L?Math.min(I,T[A].length):I);S++)M=L?T[A][S]:T,E=v[A][S],C=x[A][S],r.validate(E,M)?C!==E&&C!==+E&&i.push(p("dynamic",a,y.concat(A,S),E,C)):i.push(p("value",a,y.concat(A,S),E))}else i.push(p("array",a,y.concat(A),v[A]));else for(A=0;A1&&d.push(p("object","layout"))),n.supplyDefaults(f);for(var m=f._fullData,g=l.length,y=0;yk?h.push({code:"unused",traceType:v,templateCount:w,dataCount:k}):k>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:k})}}else h.push({code:"data"});if(function e(t,n){for(var i in t)if("_"!==i.charAt(0)){var a=t[i],o=d(t,i,n);r(a)?(Array.isArray(t)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),e(a,o)):Array.isArray(a)&&f(a)&&e(a,o)}}({data:g,layout:p},""),h.length)return h.map(m)}}}),Vn=p({"src/plot_api/index.js"(e){var t=zn();e._doPlot=t._doPlot,e.newPlot=t.newPlot,e.restyle=t.restyle,e.relayout=t.relayout,e.redraw=t.redraw,e.update=t.update,e._guiRestyle=t._guiRestyle,e._guiRelayout=t._guiRelayout,e._guiUpdate=t._guiUpdate,e._storeDirectGUIEdit=t._storeDirectGUIEdit,e.react=t.react,e.extendTraces=t.extendTraces,e.prependTraces=t.prependTraces,e.addTraces=t.addTraces,e.deleteTraces=t.deleteTraces,e.moveTraces=t.moveTraces,e.purge=t.purge,e.addFrames=t.addFrames,e.deleteFrames=t.deleteFrames,e.animate=t.animate,e.setPlotConfig=t.setPlotConfig;var r=Ce().getGraphDiv,n=Wr().eraseActiveShape;e.deleteActiveShape=function(e){return n(r(e))},e.toImage=jn(),e.validate=Fn(),e.downloadImage=Nn();var i=Un();e.makeTemplate=i.makeTemplate,e.validateTemplate=i.validateTemplate}}),qn=p({"src/traces/scatter/xy_defaults.js"(e,t){var r=st(),n=Ve();t.exports=function(e,t,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return t._length=o,o}}}),Hn=p({"src/traces/scatter/period_defaults.js"(e,t){var r=st().dateTick0,n=T().ONEWEEK;function i(e,t){return r(t,e%n===0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,t.ycalendar)),n("yperiodalignment"))}}}}),Gn=p({"src/traces/scatter/stack_defaults.js"(e,t){var r=["orientation","groupnorm","stackgaps"];t.exports=function(e,t,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=t.xaxis+t.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(t):(c=l[o]={traceIndices:[],traces:[t]},u=!0);for(var h={orientation:t.x&&!t.y?"h":"v"},p=0;p=0;p--){var d=e[p];if("scatter"===d.type&&d.xaxis===u.xaxis&&d.yaxis===u.yaxis){d.opacity=void 0;break}}}}}}}),ei=p({"src/traces/scatter/layout_defaults.js"(e,t){var r=st(),n=bt();t.exports=function(e,t){var i,a,o="group"===t.barmode;"group"===t.scattermode&&(i="scattergap",a=o?t.bargap:.2,r.coerce(e,t,n,i,a))}}}),ti=p({"src/plots/cartesian/align_period.js"(e,t){var r=k(),n=st(),i=n.dateTime2ms,a=n.incrementMonth,o=T().ONEAVGMONTH;t.exports=function(e,t,n,s){if("date"!==t.type)return{vals:s};var l=e[n+"periodalignment"];if(!l)return{vals:s};var c,u=e[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"===typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var p=t.calendar,d="start"===l,f="end"===l,m=e[n+"period0"],g=i(m,p)||0,y=[],v=[],x=[],b=s.length,_=0;_S;)T=a(T,-c,p);for(;T<=S;)T=a(T,c,p);k=a(T,-c,p)}else{for(T=g+(w=Math.round((S-g)/u))*u;T>S;)T-=u;for(;T<=S;)T+=u;k=T-u}y[_]=d?k:f?T:(k+T)/2,v[_]=k,x[_]=T}return{vals:y,starts:v,ends:x}}}}),ri=p({"src/traces/scatter/colorscale_calc.js"(e,t){var r=Mt().hasColorscale,n=Gt(),i=$t();t.exports=function(e,t){i.hasLines(t)&&r(t,"line")&&n(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(t)&&(r(t,"marker")&&n(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r(t,"marker.line")&&n(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ni=p({"src/traces/scatter/arrays_to_calcdata.js"(e,t){var r=st();t.exports=function(e,t){for(var n=0;nf&&P[y].gap;)y--;for(x=P[y].s,g=P.length-1;g>y;g--)P[g].s=x;for(;fh+c||!r(u))}for(var d=0;dM[h]&&h0?o:s)/(P._m*z*(P._m>0?o:s)))),a*=1e3}if(l===i){if(I&&(l=P.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Z(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,c=i*o+a*s;if(c>0&&coe||e[1]le)return[u(e[0],ae,oe),u(e[1],se,le)]}function he(e,t){return e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le)||void 0}function pe(e,t,r){return function(n,i){var a=ue(n),o=ue(i),s=[];if(a&&o&&he(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return c&&((a&&o?c>0===a[e]>o[e]?a:o:a||o)[e]+=c),s}}function de(e){var t=e[0],r=e[1],n=t===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=t===G[W-2][0],o=r===G[W-2][1];n&&(t===ae||t===oe)&&a?o?W--:G[W-1]=e:i&&(r===se||r===le)&&o?a?W--:G[W-1]=e:G[W++]=e}else G[W++]=e}function fe(e){G[W-1][0]!==e[0]&&G[W-1][1]!==e[1]&&de([Q,ee]),de(e),te=null,Q=ee=0}"linear"===B||"spline"===B?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=ce[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,e)oe?oe:0,J=t[1]le?le:0,K||J){if(W)if(te){var r=ne(te,t);r.length>1&&(fe(r[0]),G[W++]=r[1])}else re=ne(G[W-1],t)[0],G[W++]=re;else G[W++]=[K||t[0],J||t[1]];var i=G[W-1];K&&J&&(i[0]!==K||i[1]!==J)?(te&&(Q!==K&&ee!==J?de(Q&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[Q||K,ee||J]):Q&&ee&&de([Q,ee])),de([K,J])):Q-K&&ee-J&&de([K||Q,J||ee]),te=t,Q=K,ee=J}else te&&fe(ne(te,t)[0]),G[W++]=t}for(n=0;nX(m,ye))break;p=m,(w=v[0]*y[0]+v[1]*y[1])>b?(b=w,d=m,g=!1):w<_&&(_=w,f=m,g=!0)}if(g?(ge(d),p!==f&&ge(f)):(f!==a&&ge(f),p!==d&&ge(d)),ge(p),n>=e.length||!m)break;ge(m),a=m}}else ge(d)}te&&de([Q||te[0],ee||te[1]]),V.push(G.slice(0,W))}var ve=B.slice(B.length-1);if(R&&"h"!==ve&&"v"!==ve){for(var xe=!1,be=-1,_e=[],we=0;we=0?l=d:(l=d=p,p++),l=u[0]&&e.x<=u[1]&&e.y>=h[0]&&e.y<=h[1]})),m=Math.ceil(f.length/d),g=0;o.forEach((function(e,r){var n=e[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;function x(e){return v?e.transition():e}var b=u.xaxis,_=u.yaxis,w=p[0].trace,k=w.line,T=r.select(f),S=a(T,"g","errorbars"),A=a(T,"g","lines"),M=a(T,"g","points"),E=a(T,"g","text");if(n.getComponentMethod("errorbars","plot")(e,S,u,m),!0===w.visible){var C,P;x(T).style("opacity",w.opacity);var L,I,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,I=_.c2p(0,!0)):"x"===z&&(L=0,I=b.c2p(0,!0)),p[0][u.isRangePlot?"nodeRangePlot3":"node3"]=T;var O,R,D="",j=[],F=w._prevtrace,B=null,N=null;F&&(D=F._prevRevpath||"",P=F._nextFill,j=F._ownPolygons,B=F._fillsegments,N=F._fillElement);var U,V,q,H,G,W,$="",Z="",X=[];w._polygons=[];var Y=[],K=[],J=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){P&&P.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(k.shape)?(U=s.steps(k.shape),V=s.steps(k.shape.split("").reverse().join(""))):U=V="spline"===k.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),k.smoothing):s.smoothopen(e,k.smoothing)}:function(e){return"M"+e.join("L")},q=function(e){return V(e.reverse())},K=c(p,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(k.width||1,3)/4,shape:k.shape,backoff:k.backoff,simplify:k.simplify,fill:w.fill}),Y=new Array(K.length);var Q=0;for(g=0;g0,g=u(e,t,n);(h=i.selectAll("g.trace").data(g,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(e,t,n){t.each((function(t){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,e);var l=t[0].trace,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(e){l[e]=null})).remove(),u.order().each((function(e){l[e]=a(r.select(this),"path","js-fill")}))}))}(e,h,t),m?(c&&(d=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(e,n,t,r,g,this,l)}))}))):h.each((function(r,n){p(e,n,t,r,g,this,l)})),f&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),pi=p({"src/traces/scatter/marker_colorbar.js"(e,t){t.exports={container:"marker",min:"cmin",max:"cmax"}}}),di=p({"src/traces/scatter/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,t,"x"),s=r.getFromTrace(a,t,"y"),l=e.orig_x;void 0===l&&(l=e.x);var c=e.orig_y;return void 0===c&&(c=e.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),fi=p({"src/traces/scatter/style.js"(e,t){var r=v(),n=Jt(),i=Ve();function a(e,t,r){n.pointStyle(e.selectAll("path.point"),t,r)}function o(e,t,r){n.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=r.select(e).selectAll("g.trace.scatter");t.style("opacity",(function(e){return e[0].trace.opacity})),t.selectAll("g.points").each((function(t){a(r.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.text").each((function(t){o(r.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.trace path.js-line").call(n.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,e,!1),i.getComponentMethod("errorbars","style")(t)},stylePoints:a,styleText:o,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,e),o(r,i,e))}}}}),mi=p({"src/traces/scatter/get_trace_color.js"(e,t){var r=q(),n=$t();t.exports=function(e,t){var i,a;if("lines"===e.mode)return(i=e.line.color)&&r.opacity(i)?i:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var o=t.mcc||(e.marker||{}).color,s=t.mlcc||((e.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(t.mlw||((e.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(e.line||{}).color)&&r.opacity(i)&&n.hasLines(e)&&e.line.width?i:e.fillcolor}}}),gi=p({"src/traces/scatter/hover.js"(e,t){var r=st(),n=zr(),i=Ve(),a=mi(),o=q(),s=r.fillText;t.exports=function(e,t,l,c){var u=e.cd,h=u[0].trace,p=e.xa,d=e.ya,f=p.c2p(t),m=d.c2p(l),g=[f,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,b=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var _=function(e){var t=Math.max(v,e.mrc||0),r=p.c2p(e.x)-f,n=d.c2p(e.y)-m;return Math.max(Math.sqrt(r*r+n*n)-t,1-v/t)},w=n.getDistanceFunction(c,(function(e){if(x){var t=p.c2p(e.xStart),r=p.c2p(e.xEnd);return f>=Math.min(t,r)&&f<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(p.c2p(e.x)-f);return a=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(d.c2p(e.y)-m);return ar!==(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),f=Math.max(f,a)));return{x0:h=Math.max(h,0),x1:f=Math.min(f,p._length),y0:r,y1:r}}(h._polygons);null===I&&(I={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(e,{distance:e.maxHoverDistance,x0:I.x0,x1:I.x1,y0:I.y0,y1:I.y1,color:z,hovertemplate:!1}),delete e.index,h.text&&!r.isArrayOrTypedArray(h.text)?e.text=String(h.text):e.text=h.name,[e]}}}}),yi=p({"src/traces/scatter/select.js"(e,t){var r=$t();t.exports=function(e,t){var n,i,a,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===t)for(n=0;n0&&(i["_"+r+"axes"]||{})[t])return i;if((i[r+"axis"]||r)===t){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(t,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",h=c[u],p={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(p.noMultiCategory=!0),p.autotypenumbers=e.autotypenumbers,a(c,l)){var d=i(c),f=[];for(o=0;o0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),s||"array"!==c||(c=t.categoryorder="trace"),"trace"===c?t._initialCategories=[]:"array"===c?t._initialCategories=l.slice():(l=function(e,t){var r,n,i,a=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;n=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===n.autorange){var p=n.range;if(p[0]p[1])return void(t.enabled=!1)}else if(o[0]>p[0]&&o[1]b[1]-1/4096&&(t.domain=s),n.noneOrAll(e.domain,t.domain,s),"sync"===t.tickmode&&(t.tickmode="auto")}return i("layer"),t}}}),Ti=p({"src/plots/cartesian/layout_defaults.js"(e,t){var r=st(),n=q(),i=Xt().isUnifiedHover,a=Cr(),o=gt(),s=Be(),l=Ct(),c=xi(),u=wi(),h=tn(),p=ki(),d=vt(),f=d.id2name,m=d.name2id,g=yt().AX_ID_PATTERN,y=Ve(),v=y.traceIs,x=y.getComponentMethod;function b(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,y){var _,w,k=t.autotypenumbers,T={},S={},A={},M={},E={},C={},P={},L={},I={},z={};for(_=0;_s.duration?(function(){for(var r={},i=0;i rect").call(a.setTranslate,0,0).call(a.setScale,1,1),e.plot.call(a.setTranslate,t._offset,r._offset).call(a.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,e)}function g(t,r){var n=t.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!t.xr1,p=!!t.yr1,d=[];if(h){var f=i.simpleMap(t.xr0,s.r2l),m=i.simpleMap(t.xr1,s.r2l),g=f[1]-f[0],y=m[1]-m[0];d[0]=(f[0]*(1-r)+r*m[0]-f[0])/(f[1]-f[0])*c,d[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(f[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(f[1]*(1-r)+r*m[1])}else d[0]=0,d[2]=c;if(p){var v=i.simpleMap(t.yr0,l.r2l),x=i.simpleMap(t.yr1,l.r2l),b=v[1]-v[0],_=x[1]-x[0];d[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,d[3]=u*(1-r+r*_/b),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else d[1]=0,d[3]=u;o.drawOne(e,s,{skipTitle:!0}),o.drawOne(e,l,{skipTitle:!0}),o.redrawComponents(e,[s._id,l._id]);var w=h?c/d[2]:1,k=p?u/d[3]:1,T=h?d[0]:0,S=p?d[1]:0,A=h?d[0]/d[2]*c:0,M=p?d[1]/d[3]*u:0,E=s._offset-A,C=l._offset-M;n.clipRect.call(a.setTranslate,T,S).call(a.setScale,1/w,1/k),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,k),a.setPointGroupScale(n.zoomScalePts,1/w,1/k),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}o.redrawComponents(e)}}}),Ai=p({"src/plots/cartesian/index.js"(e){var t=v(),r=Ve(),n=st(),i=kt(),a=Jt(),o=_t().getModuleCalcData,s=vt(),l=yt(),c=Tt(),u=n.ensureSingle;function h(e,t,r){return n.ensureSingle(e,t,r,(function(e){e.datum(r)}))}var p=l.zindexSeparator;function d(e,n,i,s,c){for(var u,h,p,d=l.traceLayerClasses,f=e._fullLayout,m=f._zindices,g=f._modules,y=[],v=[],x=0;x1,m=t.mainplotinfo;if(!t.mainplot||f)if(d)t.xlines=u(n,"path","xlines-above"),t.ylines=u(n,"path","ylines-above"),t.xaxislayer=u(n,"g","xaxislayer-above"),t.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");t.shapelayer=u(g,"g","shapelayer"),t.imagelayer=u(g,"g","imagelayer"),m&&f?(t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer):(t.minorGridlayer=u(n,"g","minor-gridlayer"),t.gridlayer=u(n,"g","gridlayer"),t.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");t.shapelayerBetween=u(y,"g","shapelayer"),t.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),t.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),t.overaxesBelow=u(n,"g","overaxes-below")}t.overplot=u(n,"g","overplot"),t.plot=u(t.overplot,"g",i),a||(t.xlines=u(n,"path","xlines-above"),t.ylines=u(n,"path","ylines-above"),t.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),t.overaxesAbove=u(n,"g","overaxes-above"),t.xlines=n.select(".xlines-"+o),t.ylines=n.select(".ylines-"+c),t.xaxislayer=n.select(".xaxislayer-"+o),t.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",b=i+"-y";t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",b),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",b),t.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",b),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",b),t.xlines=v.select(".overlines-"+o).select("."+x),t.ylines=v.select(".overlines-"+c).select("."+b),t.xaxislayer=v.select(".overaxes-"+o).select("."+x),t.yaxislayer=v.select(".overaxes-"+c).select("."+b)}a||(d||(h(t.minorGridlayer,"g",t.xaxis._id),h(t.minorGridlayer,"g",t.yaxis._id),t.minorGridlayer.selectAll("g").map((function(e){return e[0]})).sort(s.idSort),h(t.gridlayer,"g",t.xaxis._id),h(t.gridlayer,"g",t.yaxis._id),t.gridlayer.selectAll("g").map((function(e){return e[0]})).sort(s.idSort)),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0))}function m(e,r){if(e){var n={};for(var i in e.each((function(e){var i=e[0];t.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o0){var g=m.id;if(-1!==g.indexOf(p))continue;g+=p+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x1&&(w+=p+_),b.push(n+w),r=0;r=0,x=t.indexOf("end")>=0,b=f.backoff*g+a.standoff,_=m.backoff*y+a.startstandoff;if("line"===d.nodeName){c={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=c.x-u.x,k=c.y-u.y;if(p=(h=Math.atan2(k,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+k*k))return void O();if(b){if(b*b>w*w+k*k)return void O();var T=b*Math.cos(h),S=b*Math.sin(h);u.x+=T,u.y+=S,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+k*k)return void O();var A=_*Math.cos(h),M=_*Math.sin(h);c.x-=A,c.y-=M,e.attr({x1:c.x,y1:c.y})}}else if("path"===d.nodeName){var E=d.getTotalLength(),C="";if(E2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var $=!1,Z=["x","y"],X=0;X1)&&(ne===re?((de=ie.r2fraction(t["a"+te]))<0||de>1)&&($=!0):$=!0),Y=ie._offset+ie.r2p(t[te]),Q=.5}else{var fe="domain"===pe;"x"===te?(J=t[te],Y=fe?ie._offset+ie._length*J:Y=k.l+k.w*J):(J=1-t[te],Y=fe?ie._offset+ie._length*J:Y=k.t+k.h*J),Q=t.showarrow?.5:J}if(t.showarrow){he.head=Y;var me=t["a"+te];if(ee=oe*H(.5,t.xanchor)-se*H(.5,t.yanchor),ne===re){var ge=s.getRefType(ne);"domain"===ge?("y"===te&&(me=1-me),he.tail=ie._offset+ie._length*me):"paper"===ge?"y"===te?(me=1-me,he.tail=k.t+k.h*me):he.tail=k.l+k.w*me:he.tail=ie._offset+ie.r2p(me),K=ee}else he.tail=Y+me,K=ee+me;he.text=he.tail+ee;var ye=w["x"===te?"width":"height"];if("paper"===re&&(he.head=a.constrain(he.head,1,ye-1)),"pixel"===ne){var ve=-Math.max(he.tail-3,he.text),xe=Math.min(he.tail+3,he.text)-ye;ve>0?(he.tail+=ve,he.text+=ve):xe>0&&(he.tail-=xe,he.text-=xe)}he.tail+=ue,he.head+=ue}else K=ee=le*H(Q,ce),he.text=Y+ee;he.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=le/2+K,t["_"+te+"padminus"]=le/2-K,t["_"+te+"size"]=le,t["_"+te+"shift"]=ee}if($)D.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(S-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(R-_)*("middle"===t.valign?.5:1)),u)i.select("svg").attr({x:B+be-1,y:B+_e}).call(c.setClipUrl,U?C:null,e);else{var we=B+_e-f.top,ke=B+be-f.left;G.call(h.positionText,ke,we).call(c.setClipUrl,U?C:null,e)}V.select("rect").call(c.setRect,B,B,S,R),N.call(c.setRect,j/2,j/2,F-j,q-j),D.call(c.setTranslate,Math.round(P.x.text-F/2),Math.round(P.y.text-q/2)),z.attr({transform:"rotate("+L+","+P.x.text+","+P.y.text+")"});var Te,Se=function(r,i){I.selectAll(".annotation-arrow-g").remove();var s=P.x.head,u=P.y.head,h=P.x.tail+r,p=P.y.tail+i,f=P.x.text+r,b=P.y.text+i,_=a.rotationXYMatrix(L,f,b),w=a.apply2DTransform(_),S=a.apply2DTransform2(_),C=+N.attr("width"),O=+N.attr("height"),R=f-.5*C,j=R+C,F=b-.5*O,B=F+O,U=[[R,F,R,B],[R,B,j,B],[j,B,j,F],[j,F,R,F]].map(S);if(!U.reduce((function(e,t){return e^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,t[0],t[1],t[2],t[3])}),!1)){U.forEach((function(e){var t=a.segmentsIntersect(h,p,s,u,e[0],e[1],e[2],e[3]);t&&(h=t.x,p=t.y)}));var V=t.arrowwidth,q=t.arrowcolor,H=t.arrowside,G=I.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+h+","+p+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(W,H,t),T.annotationPosition&&W.node().parentNode&&!g){var $=s,Z=u;if(t.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-p,2));$+=t.standoff*(h-s)/X,Z+=t.standoff*(p-u)/X}var Y,K,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-$)+","+(p-Z),transform:o($,Z)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(D);Y=e.x,K=e.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,K),i=n[0]+e,a=n[1]+r;D.call(c.setTranslate,i,a),M("x",y(v,e,"x",k,t)),M("y",y(x,r,"y",k,t)),t.axref===t.xref&&M("ax",y(v,e,"ax",k,t)),t.ayref===t.yref&&M("ay",y(x,r,"ay",k,t)),G.attr("transform",o(e,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&Se(0,0),O&&d.init({element:D.node(),gd:e,prepFn:function(){Te=z.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?M("ax",y(v,e,"ax",k,t)):M("ax",t.ax+e),t.ayref===t.yref?M("ay",y(x,r,"ay",k.w,t)):M("ay",t.ay+r),Se(e,r);else{if(g)return;var i,a;if(v)i=y(v,e,"x",k,t);else{var s=t._xsize/k.w,l=t.x+(t._xshift-t.xshift)/k.w-s/2;i=d.align(l+e/k.w,s,0,1,t.xanchor)}if(x)a=y(x,r,"y",k,t);else{var c=t._ysize/k.h,u=t.y-(t._yshift+t.yshift)/k.h-c/2;a=d.align(u-r/k.h,c,0,1,t.yanchor)}M("x",i),M("y",a),v&&x||(n=d.getCursor(v?.5:i,x?.5:a,t.xanchor,t.yanchor))}z.attr({transform:o(e,r)+Te}),p(D,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",W(n))},doneFn:function(){p(D),n.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r0||r.explicitOff.length>0},onClick:function(e,t){var o,s,l=a(e,t),c=l.on,u=l.off.concat(l.explicitOff),h={},p=e._fullLayout.annotations;if(c.length||u.length){for(o=0;o1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=n(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*a[0],t.yaxis.r2l(l.y)*a[1],t.zaxis.r2l(l.z)*a[2]]),r(e.graphDiv,l,s,e.id,l._xa,l._ya))}}}}),Ui=p({"src/components/annotations3d/index.js"(e,t){var r=Ve(),n=st();t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Di()}}},layoutAttributes:Di(),handleDefaults:ji(),includeBasePlot:function(e,t){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(e),s=0;s0?p+c:c;return{ppad:c,ppadplus:u?f:m,ppadminus:u?m:f}}return{ppad:c}}function c(e,t,r){var n,o,s="x"===e._id.charAt(0)?"x":"y",l="category"===e.type||"multicategory"===e.type,c=0,u=0,h=l?e.r2c:e.d2c;if("scaled"===t[s+"sizemode"]?(n=t[s+"0"],o=t[s+"1"],l&&(c=t[s+"0shift"],u=t[s+"1shift"])):(n=t[s+"anchor"],o=t[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(t.path){var p,d,f,m,g=1/0,y=-1/0,v=t.path.match(i.segmentRE);for("date"===e.type&&(h=a.decodeDate(h)),p=0;py&&(y=m)));return y>=g?[g,y]:void 0}}t.exports=function(e){var t=e._fullLayout,a=r.filterVisible(t.shapes);if(a.length&&e._fullData.length)for(var l=0;l0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(e,t){function n(n,i){return r.coerce(e,t,o,n,i)}n("visible","skip"===e.method||Array.isArray(e.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}t.exports=function(e,t){n(e,t,{name:a,handleItemDefaults:s})}}}),ta=p({"src/components/updatemenus/scrollbox.js"(e,t){t.exports=o;var r=v(),n=q(),i=Jt(),a=st();function o(e,t,r){this.gd=e,this.container=t,this.id=r,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})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(e,t,a){var s=this.gd._fullLayout,l=s.width,c=s.height;this.position=e;var u,h,p,d,f=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,b="left"===v,_="up"===v,w=m,k=y;x||b||"right"===v||_||(this.position.direction="down",x=!0),x||_?(h=(u=f)+w,x?(p=g,k=(d=Math.min(p+k,c))-p):k=(d=g+k)-(p=Math.max(d-k,0))):(d=(p=g)+k,b?w=(h=f+w)-(u=Math.max(h-w,0)):(u=f,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:p,w:w,h:k};var T=m>w,S=o.barLength+2*o.barPad,A=o.barWidth+2*o.barPad,M=f,E=g+y;E+A>c&&(E=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),T?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:M,y:E,width:S,height:A}),this._hbarXMin=M+S/2,this._hbarTranslateMax=w-S):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=y>k,L=o.barWidth+2*o.barPad,I=o.barLength+2*o.barPad,z=f+m,O=g;z+L>l&&(z=l-L);var R=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),P?(this.vbar=R.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:O,width:L,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=k-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var D=this.id,j=u-.5,F=P?h+L+.5:h+.5,B=p-.5,N=T?d+A+.5:d+.5,U=s._topdefs.selectAll("#"+D).data(T||P?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",D).append("rect"),T||P?(this._clipRect=U.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(F)-Math.floor(j),height:Math.ceil(N)-Math.floor(B)}),this.container.call(i.setClipUrl,D,this.gd),this.bg.attr({x:f,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||P){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),P&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.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)},o.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=r.event.dx),this.vbar&&(t-=r.event.dy),this.setTranslate(e,t)},o.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=r.event.deltaY),this.vbar&&(t+=r.event.deltaY),this.setTranslate(e,t)},o.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var n=e+this._hbarXMin,i=n+this._hbarTranslateMax;e=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=t+this._vbarYMin,s=o+this._vbarTranslateMax;t=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(e,t)},o.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=a.constrain(e||0,0,r),t=a.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var o=e/r;this.hbar.call(i.setTranslate,e+o*this._hbarTranslateMax,t)}if(this.vbar){var s=t/n;this.vbar.call(i.setTranslate,e,t+s*this._vbarTranslateMax)}}}}),ra=p({"src/components/updatemenus/draw.js"(e,t){var r=v(),n=kt(),i=q(),a=Jt(),o=st(),s=At(),l=gt().arrayEditor,c=St().LINE_SPACING,u=Ji(),h=ta();function p(e){return e._index}function d(e,t){return+e.attr(u.menuIndexAttrName)===t._index}function f(e,t,r,n,i,a,o,s){t.active=o,l(e.layout,u.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(i.attr(u.menuIndexAttrName,"-1"),m(e,n,i,a,t),s||g(e,n,i,a,t))}function m(e,t,r,n,i){var s=o.ensureSingle(t,"g",u.headerClassName,(function(e){e.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,p={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,e).call(A,i,p,f),o.ensureSingle(t,"text",u.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(M,String(d(r,i)?-1:i._index)),g(e,t,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(k,i)})),a.setTranslate(t,l.lx,l.ly)}function g(e,t,i,a,s){i||(i=t).attr("pointer-events","all");var l=function(e){return-1===+e.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),p=h.enter().append("g").classed(c,!0),d=h.exit();"dropdown"===s.type?(p.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var b={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},T={l:b.x+s.borderwidth,t:b.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,e).call(A,s,b),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(f(e,s,0,t,i,a,-1),n.executeAPICommand(e,o.method,o.args2)):(f(e,s,0,t,i,a,l),n.executeAPICommand(e,o.method,o.args))),e.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,s),h.call(_,s)}))})),h.call(_,s),x?(T.w=Math.max(v.openWidth,v.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(v.openHeight,v.headerHeight)),T.direction=s.direction,a&&(h.size()?function(e,t,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,p=i._dims,d=i.active;if(h)for(s=0,l=0;l0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,p);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),y=0;y0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,t._dims.currentValueTotalHeight))}}function E(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function P(e,t,r){var n=r._dims,s=o.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(S,t,e,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(e,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._context.staticPlot,i=e._fullLayout,o=function(e,t){for(var r=e[u.name],n=[],i=0;i0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),n.autoMargin(e,m(t))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",t?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h0?e.touches[0].clientX:0}function g(e,t,r,n){var i=a.ensureSingle(e,"rect",f.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2===0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(t,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(e,t,r,n){var i=t._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(e){e.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function x(e,t,n,o){var l,c=t.calcdata,p=e.selectAll("g."+f.rangePlotClassName).data(n._subplotsWith,a.identity);p.enter().append("g").attr("class",(function(e){return f.rangePlotClassName+" "+e})).call(s.setClipUrl,o._clipId,t),p.order(),p.exit().remove(),p.each((function(e,a){var s=r.select(this),p=0===a,d=h.getFromId(t,e,"y"),f=d._name,m=o[f],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[f]={type:d.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():d.range.slice(),calendar:d.calendar},d.rangebreaks&&(g.layout[f].rangebreaks=d.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[f];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:e,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};p?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(t,x,function(e,t){for(var r=[],n=0;n=n.max)t=F[r+1];else if(e=n.pmax)t=F[r+1];else if(ei._length||v+_<0)return;u=y+_,p=v+_;break;case l:if(b="col-resize",y+_>i._length)return;u=y+_,p=v;break;case c:if(b="col-resize",v+_<0)return;u=y,p=v+_;break;default:b="ew-resize",u=g,p=g+_}if(p0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),i=0,a=0;a1){p||d||f||"independent"===T("pattern")&&(p=!0),g._hasSubplotGrid=p;var x,b,_="top to bottom"===T("roworder"),w=p?.2:.1,k=p?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),g._domains={x:c("x",T,w,x,v),y:c("y",T,k,b,y,_)}}else delete t.grid}function T(e,t){return r.coerce(n,g,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,i,a,o,s,c,h,p=e.grid||{},d=t._subplots,f=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(f){var x=p.subplots||[];c=r.subplots=new Array(m);var b=1;for(n=0;n0,h=e._context.staticPlot;t.each((function(t){var p,d=t[0].trace,f=d.error_x||{},m=d.error_y||{};d.ids&&(p=function(e){return e.id});var g=a.hasMarkers(d)&&d.marker.maxdisplayed>0;m.visible||f.visible||(t=[]);var y=r.select(this).selectAll("g.errorbar").data(t,p);if(y.exit().remove(),t.length){f.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,e),y.each((function(e){var t=r.select(this),i=function(e,t,r){var i={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(i.yh=r.c2p(e.yh),i.ys=r.c2p(e.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(i.xh=t.c2p(e.xh),i.xs=t.c2p(e.xs),n(i.xs)||(i.noXS=!0,i.xs=t.c2p(e.xs,!0))),i}(e,l,c);if(!g||e.vis){var a,o=t.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var p=m.width;a="M"+(i.x-p)+","+i.yh+"h"+2*p+"m-"+p+",0V"+i.ys,i.noYS||(a+="m-"+p+",0h"+2*p),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var d=t.select("path.xerror");if(f.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(f.copy_ystyle?m:f).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),d.size()?u&&(d=d.transition().duration(s.duration).ease(s.easing)):d=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),d.attr("d",a)}else d.remove()}}))}}))}}}),Pa=p({"src/components/errorbars/style.js"(e,t){var r=v(),n=q();t.exports=function(e){e.each((function(e){var t=e[0].trace,i=t.error_y||{},a=t.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),La=p({"src/components/errorbars/index.js"(e,t){var r=st(),n=Le().overrideAll,i=Sa(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Aa(),calc:Ea(),makeComputeError:Ma(),plot:Ca(),style:Pa(),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}}}),Ia=p({"src/components/colorbar/constants.js"(e,t){t.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"}}}}),za=p({"src/components/colorbar/draw.js"(e,t){var r=v(),n=O(),i=kt(),a=Ve(),o=nr(),s=hr(),l=st(),c=l.strTranslate,u=R().extendFlat,h=pr(),p=Jt(),d=q(),f=Qt(),m=At(),g=Mt().flipScale,y=wi(),x=ki(),b=Ct(),_=St(),w=_.LINE_SPACING,k=_.FROM_TL,T=_.FROM_BR,S=Ia().cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+S.colorbar).data(function(e){var t,r,n,i,a=e._fullLayout,o=e.calcdata,s=[];function l(e){return u(e,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"===typeof i.calc?i.calc(e,n,t):(t._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,t._zrange=[r[i.min],r[i.max]])}for(var h=0;h0?n>=l:n<=l));i++)n>u&&n0?n>=l:n<=l));i++)n>r[0]&&n1){var de=Math.pow(10,Math.floor(Math.log(pe)/Math.LN10));ue*=de*l.roundUp(pe/de,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(le.tick0=0)}le.dtick=ue}le.domain=s?[oe+I/F.h,oe+Q-I/F.h]:[oe+L/F.w,oe+Q-L/F.w],le.setScale(),e.attr("transform",c(Math.round(F.l),Math.round(F.t)));var fe,me=e.select("."+S.cbtitleunshift).attr("transform",c(-Math.round(F.l),-Math.round(F.t))),ge=le.ticklabelposition,ye=le.title.font.size,ve=e.select("."+S.cbaxis),xe=0,be=0;function _e(r,n){var i={propContainer:le,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:j._dfltTitle.colorbar,containerGroup:e.select("."+S.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;e.selectAll("."+o+",."+o+"-math-group").remove(),f.draw(a,r,u(i,n||{}))}function we(){var e,t;(s&&ce||!s&&!ce)&&("top"===V&&(e=L+F.l+ee*z,t=I+F.t+te*(1-oe-Q)+3+.75*ye),"bottom"===V&&(e=L+F.l+ee*z,t=I+F.t+te*(1-oe)-3-.25*ye),"right"===V&&(t=I+F.t+te*O+3+.75*ye,e=L+F.l+ee*oe),_e(le._id+"title",{attributes:{x:e,y:t,"text-anchor":s?"start":"middle"}}))}function ke(){if(s&&!ce||!s&&ce){var e,n,i=le.position||0,o=le._offset+le._length/2;if("right"===V)n=o,e=F.l+ee*i+10+ye*(le.showticklabels?1:.5);else if(e=o,"bottom"===V&&(n=F.t+te*i+10+(-1===ge.indexOf("inside")?le.tickfont.size:0)+("intside"!==le.ticks&&t.ticklen||0)),"top"===V){var l=U.text.split("
").length;n=F.t+te*i+10-Y-w*ye*l}_e((s?"h":"v")+le._id+"title",{avoid:{selection:r.select(a).selectAll("g."+le._id+"tick"),side:V,offsetTop:s?0:F.t,offsetLeft:s?F.l:0,maxShift:s?j.width:j.height},attributes:{x:e,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}}function Te(){if(!s&&!ce||s&&ce){var i,u=e.select("."+S.cbtitle),h=u.select("text"),d=[-A/2,A/2],f=u.select(".h"+le._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),f?(i=p.bBox(f),be=i.width,(xe=i.height)>g&&(d[1]-=(xe-g)/2)):h.node()&&!h.classed(S.jsPlaceholder)&&(i=p.bBox(h.node()),be=i.width,xe=i.height),s){if(xe){if(xe+=5,"top"===V)le.domain[1]-=xe/F.h,d[1]*=-1;else{le.domain[0]+=xe/F.h;var y=m.lineCount(h);d[1]+=(1-y)*g}u.attr("transform",c(d[0],d[1])),le.setScale()}}else be&&("right"===V&&(le.domain[0]+=(be+ye/2)/F.w),u.attr("transform",c(d[0],d[1])),le.setScale())}e.selectAll("."+S.cbfills+",."+S.cblines).attr("transform",s?c(0,Math.round(F.h*(1-le.domain[1]))):c(Math.round(F.w*le.domain[0]),0)),ve.attr("transform",s?c(0,Math.round(-F.t)):c(Math.round(-F.l),0));var v=e.select("."+S.cbfills).selectAll("rect."+S.cbfill).attr("style","").data(Z);v.enter().append("rect").classed(S.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(le.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?q[0]:(Z[i]+Z[i-1])/2,i===Z.length-1?q[1]:(Z[i]+Z[i+1])/2].map(le.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",re).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max(Y,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(t._fillgradient)p.gradient(c,a,t._id,s?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=G(e).replace("e-","");c.attr("fill",n(u).toHexString())}}));var b=e.select("."+S.cblines).selectAll("path."+S.cbline).data(N.color&&N.width?X:[]);b.enter().append("path").classed(S.cbline,!0),b.exit().remove(),b.each((function(e){var t=re,n=Math.round(le.c2p(e))+N.width/2%1;r.select(this).attr("d","M"+(s?t+","+n:n+","+t)+(s?"h":"v")+Y).call(p.lineGroupStyle,N.width,H(e),N.dash)})),ve.selectAll("g."+le._id+"tick,path").remove();var _=re+Y+(A||0)/2-("outside"===t.ticks?1:0),k=o.calcTicks(le),T=o.getTickSigns(le)[2];return o.drawTicks(a,le,{vals:"inside"===le.ticks?o.clipEnds(le,k):k,layer:ve,path:o.makeTickPath(le,_,T),transFn:o.makeTransTickFn(le)}),o.drawLabels(a,le,{vals:k,layer:ve,transFn:o.makeTransTickLabelFn(le),labelFns:o.makeLabelFns(le,_)})}function Se(){var r,o=Y+A/2;-1===ge.indexOf("inside")&&(r=p.bBox(ve.node()),o+=s?r.width:r.height),fe=me.select("text");var l=0,u=s&&"top"===V,f=!s&&"right"===V,m=0;if(fe.node()&&!fe.classed(S.jsPlaceholder)){var y,x=me.select(".h"+le._id+"title-math-group").node();x&&(s&&ce||!s&&!ce)?(l=(r=p.bBox(x)).width,y=r.height):(l=(r=p.bBox(me.node())).right-F.l-(s?re:se),y=r.bottom-F.t-(s?se:re),s||"top"!==V||(o+=r.height,m=r.height)),f&&(fe.attr("transform",c(l/2+ye/2,0)),l*=2),o=Math.max(o,s?l:y)}var b=2*(s?L:I)+o+M+A/2,w=0;!s&&U.text&&"bottom"===P&&O<=0&&(b+=w=b/2,m+=w),j._hColorbarMoveTitle=w,j._hColorbarMoveCBTitle=m;var B=M+A,N=(s?re:se)-B/2-(s?L:0),q=(s?se:re)-(s?J:I+m-w);e.select("."+S.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(b-w,2)).attr(s?"height":"width",Math.max(J+B,2)).call(d.fill,E).call(d.stroke,t.bordercolor).style("stroke-width",M);var H=f?Math.max(l-10,0):0;e.selectAll("."+S.cboutline).attr("x",(s?re:se+L)+H).attr("y",(s?se+I-J:re)+(u?xe:0)).attr(s?"width":"height",Math.max(Y,2)).attr(s?"height":"width",Math.max(J-(s?2*I+xe:2*L+H),2)).call(d.stroke,t.outlinecolor).style({fill:"none","stroke-width":A});var G=s?ne*b:0,W=s?0:(1-ie)*b-m;if(G=D?F.l-G:-G,W=R?F.t-W:-W,e.attr("transform",c(G,W)),!s&&(M||n(E).getAlpha()&&!n.equals(j.paper_bgcolor,E))){var $=ve.selectAll("text"),Z=$[0].length,X=e.select("."+S.cbbg).node(),K=p.bBox(X),Q=p.getTranslate(e),ee=2;$.each((function(e,t){var r=0,n=Z-1;if(t===r||t===n){var i,a=p.bBox(this),o=p.getTranslate(this);if(t===n){var s=a.right+o.x;(i=K.right+Q.x+se-M-ee+z-s)>0&&(i=0)}else if(t===r){var l=a.left+o.x;(i=K.left+Q.x+se+M+ee-l)<0&&(i=0)}i&&(Z<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var te={},ae=k[C],oe=T[C],ue=k[P],he=T[P],pe=b-Y;s?("pixels"===g?(te.y=O,te.t=J*ue,te.b=J*he):(te.t=te.b=0,te.yt=O+h*ue,te.yb=O-h*he),"pixels"===_?(te.x=z,te.l=b*ae,te.r=b*oe):(te.l=pe*ae,te.r=pe*oe,te.xl=z-v*ae,te.xr=z+v*oe)):("pixels"===g?(te.x=z,te.l=J*ae,te.r=J*oe):(te.l=te.r=0,te.xl=z+h*ae,te.xr=z-h*oe),"pixels"===_?(te.y=1-O,te.t=b*ue,te.b=b*he):(te.t=pe*ue,te.b=pe*he,te.yt=O-v*ue,te.yb=O+v*he));var de=t.y<.5?"b":"t",be=t.x<.5?"l":"r";a._fullLayout._reservedMargin[t._id]={};var _e={r:j.width-N-G,l:N+te.r,b:j.height-q-W,t:q+te.b};D&&R?i.autoMargin(a,t._id,te):D?a._fullLayout._reservedMargin[t._id][de]=_e[de]:R||s?a._fullLayout._reservedMargin[t._id][be]=_e[be]:a._fullLayout._reservedMargin[t._id][de]=_e[de]}return l.syncOrAsync([i.previousPromises,we,Te,ke,i.previousPromises,Se],a)}(g,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,i,o,l="v"===t.orientation,u=r._fullLayout,p=u._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),h(e)},moveFn:function(r,a){e.attr("transform",n+c(r,a)),i=s.align((l?t._uFrac:t._vFrac)+r/p.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),o=s.align((l?t._vFrac:1-t._uFrac)-a/p.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var u=s.getCursor(i,o,t.xanchor,t.yanchor);h(e,u)},doneFn:function(){if(h(e),void 0!==i&&void 0!==o){var n={};n[t._propPrefix+"x"]=i,n[t._propPrefix+"y"]=o,void 0!==t._traceIndex?a.call("_guiRestyle",r,n,t._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}}}),Oa=p({"src/components/colorbar/index.js"(e,t){t.exports={moduleType:"component",name:"colorbar",attributes:Pt(),supplyDefaults:Ut(),draw:za().draw,hasColorbar:zt()}}}),Ra=p({"src/components/legend/index.js"(e,t){t.exports={moduleType:"component",name:"legend",layoutAttributes:fr(),supplyLayoutDefaults:gr(),draw:Tr(),style:kr()}}}),Da=p({"src/locale-en.js"(e,t){t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),ja=p({"src/locale-en-us.js"(e,t){t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),Fa=p({"src/snapshot/cloneplot.js"(e,t){var r=Ve(),n=st(),i=n.extendFlat,a=n.extendDeep;function o(e){var t;switch(e){case"themes__thumb":t={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":t={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}t.exports=function(e,t){var n,s,l=e.data,c=e.layout,u=a([],l),h=a({},c,o(t.tileClass)),p=e._context||{};if(t.width&&(h.width=t.width),t.height&&(h.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.tileClass){h.annotations=[];var d=Object.keys(h);for(n=0;n-1&&(h[d[n]].title={text:""});for(n=0;n=0)return e}else if("string"===typeof e&&"%"===(e=e.trim()).slice(-1)&&r(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function d(e,t,r,i,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),p=!(!1===o.moduleHasTextangle),d=!(!1===o.moduleHasInsideanchor),f=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),b=!(e.textfont&&e.textfont.color);if(b&&delete x.color,h(i,"insidetextfont",x),f){var _=n.extendFlat({},v);b&&delete _.color,h(i,"pathbar.textfont",_)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),p&&i("textangle"),i("texttemplate")}g&&d&&i("insidetextanchor")}t.exports={supplyDefaults:function(e,t,r,c){function h(r,i){return n.coerce(e,t,u,r,i)}if(o(e,t,c,h)){s(e,t,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",t.x&&!t.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var p=h("textposition");d(e,0,c,h,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(e,t,h,r,c);var f=(t.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(e,t,f||i.defaultLine,{axis:"y"}),m(e,t,f||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,h)}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function a(e,t){return n.coerce(i._input,i,u,e,t)}for(var o=0;o0&&!p[y]&&(h=!0),p[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:t},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==d&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");t.barcornerradius=o(v)}else delete t.barmode}}}),Xa=p({"src/traces/bar/arrays_to_calcdata.js"(e,t){var r=st();t.exports=function(e,t){for(var n=0;na))return r}return void 0!==n?n:e.dflt},e.coerceColor=function(e,t,n){return r(t).isValid()?t:void 0!==n?n:e.dflt},e.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},e.getValue=function(e,t){var r;return n(e)?t1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){d(r.select(this),t[0].trace,e)})),o.getComponentMethod("errorbars","style")(t)},styleTextPoints:f,styleOnSelect:function(e,t,n){var s=t[0].trace;s.selectedpoints?function(e,t,n){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,n){e.each((function(e){var o,s=r.select(this);if(e.selected){o=a.ensureUniformFontSize(n,m(s,e,t,n));var l=t.selected.textfont&&t.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,n)}(n,s,e):(d(n,s,e),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}}}),eo=p({"src/traces/bar/plot.js"(e,t){var r=v(),n=k(),i=st(),a=At(),o=q(),s=Jt(),l=Ve(),c=nr().tickText,u=Ka(),h=u.recordMinTextSize,p=u.clearMinTextSize,d=Qa(),f=Ja(),m=qa(),g=Ha(),y=g.text,x=g.textposition,b=Xt().appendArrayPointValue,_=m.TEXTPAD;function w(e){return e.id}function T(e){return(e>0)-(e<0)}function S(e,t){return e0}function E(e,t,r,n,i){return!(e<0||t<0)&&(r<=e&&n<=t||r<=t&&n<=e||(i?e>=r*(t/n):t>=n*(e/r)))}function C(e){return"auto"===e?0:e}function P(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function L(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,p=((a.leftToRight||0)+1)/2,d=1-p,f=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(t-e),b=Math.abs(n-r),w=x>2*_&&b>2*_?_:0;x-=2*w,b-=2*w;var k=C(l);"auto"!==l||y<=x&&v<=b||!(y>x||v>b)||(y>b||v>x)&&y_){var E=function(e,t,r,n,i,a,o,s,l){var c,u,h,p,d,f=Math.max(0,Math.abs(t-e)-2*_),m=Math.max(0,Math.abs(n-r)-2*_),g=a-_,y=o?g-Math.sqrt(g*g-(g-o)*(g-o)):g,v=l?2*g:s?g-o:2*y,x=l?2*g:s?2*y:g-o;return i.y/i.x>=m/(f-v)?p=m/i.y:i.y/i.x<=(m-x)/f?p=f/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(f-g)*(f-g)+(m/2-g)*(m/2-g)-g*g,p=(-(u=-2*i.x*(f-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(f/2-g)*(f/2-g)+(m/2-g)*(m/2-g)-g*g,p=(-(u=-i.x*(f/2-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(f/2-g)*(f/2-g)+(m-g)*(m-g)-g*g,p=(-(u=-i.x*(f/2-g)-2*i.y*(m-g))+Math.sqrt(u*u-4*c*h))/(2*c)),p=Math.min(1,p),d=s?Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(m-i.y*p)/2)*(g-(m-i.y*p)/2)))-o):Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(f-i.x*p)/2)*(g-(f-i.x*p)/2)))-o),{scale:p,pad:d}}(e,t,r,n,M,m,g,o,f);T=E.scale,A=E.pad}else T=1,s&&(T=Math.min(1,x/M.x,b/M.y)),A=0;var L=i.left*d+i.right*p,I=(i.top+i.bottom)/2,z=(e+_)*d+(t-_)*p,O=(r+n)/2,R=0,D=0;if(h||u){var j=(o?M.x:M.y)/2;m&&(u||f)&&(w+=A);var F=o?S(e,t):S(r,n);o?h?(z=e+F*w,R=-F*j):(z=t-F*w,R=F*j):h?(O=r+F*w,D=-F*j):(O=n-F*w,D=F*j)}return{textX:L,textY:I,targetX:z,targetY:O,anchorX:R,anchorY:D,scale:T,rotate:k}}t.exports={plot:function(e,t,u,m,g,v){var k=t.xaxis,I=t.yaxis,z=e._fullLayout,O=e._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},p("bar",z));var R=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),p=l[0].trace,m=l[0].t,R="waterfall"===p.type,D="funnel"===p.type,j="histogram"===p.type,F="bar"===p.type,B=F||D,N=0;R&&p.connector.visible&&"between"===p.connector.mode&&(N=p.connector.line.width/2);var U="h"===p.orientation,V=M(g),q=i.ensureSingle(u,"g","points"),H=function(e){if(e.ids)return w}(p),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var M,R,D=r.select(this),q=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),n?[i,a]:[a,i]}(u,k,I,U),H=q[0][0],G=q[0][1],W=q[1][0],$=q[1][1],Z=0===(U?G-H:$-W);if(Z&&B&&f.getLineWidth(p,u)&&(Z=!1),Z||(Z=!n(H)||!n(G)||!n(W)||!n($)),u.isBlank=Z,Z&&(U?G=H:$=W),N&&!Z&&(U?(H-=S(H,G)*N,G+=S(H,G)*N):(W-=S(W,$)*N,$+=S(W,$)*N)),"waterfall"===p.type){if(!Z){var X=p[u.dir].marker;M=X.line.width,R=X.color}}else M=f.getLineWidth(p,u),R=u.mc||p.marker.color;function Y(e){var t=r.round(M/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(e)-t,2):e}var K=o.opacity(R)<1||M>.01?Y:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?Y(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(H=K(H,G,U),G=K(G,H,U),W=K(W,$,!U),$=K($,W,!U));var J,Q=U?k.c2p:I.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var ee,te,re=F||j?function(e,t){if(!e)return 0;var r,n=U?Math.abs($-W):Math.abs(G-H),i=U?Math.abs(G-H):Math.abs($-W),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===t?n*(Math.min(50,e)/100):e,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,ne="M"+H+","+W+"V"+$+"H"+G+"V"+W+"Z",ie=0;if(re&&u.s){var ae=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((ie=K(u.hasB?0:Math.abs(Q(J,!0)-Q(ae,!0))))0?Math.sqrt(ie*(2*re-ie)):0,he=oe>0?Math.max:Math.min;ee="M"+H+","+W+"V"+($-ce*se)+"H"+he(G-(re-ie)*oe,H)+"A "+re+","+re+" 0 0 "+le+" "+G+","+($-re*se-ue)+"V"+(W+re*se+ue)+"A "+re+","+re+" 0 0 "+le+" "+he(G-(re-ie)*oe,H)+","+(W+ce*se)+"Z"}else if(u.hasB)ee="M"+(H+re*oe)+","+W+"A "+re+","+re+" 0 0 "+le+" "+H+","+(W+re*se)+"V"+($-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+$+"H"+(G-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+G+","+($-re*se)+"V"+(W+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(G-re*oe)+","+W+"Z";else{var pe=(te=Math.abs($-W)+ie)0?Math.sqrt(ie*(2*re-ie)):0,fe=se>0?Math.max:Math.min;ee="M"+(H+pe*oe)+","+W+"V"+fe($-(re-ie)*se,W)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe-de)+","+$+"H"+(G-re*oe+de)+"A "+re+","+re+" 0 0 "+le+" "+(G-pe*oe)+","+fe($-(re-ie)*se,W)+"V"+W+"Z"}}else ee=ne}else ee=ne;var me=A(i.ensureSingle(D,"path"),z,g,v);if(me.style("vector-effect",O?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*($-W))||Z&&e._context.staticPlot?"M0,0Z":ee).call(s.setClipUrl,t.layerClipId,e),!z.uniformtext.mode&&V){var ge=s.makePointStyleFns(p);s.singlePointStyle(u,me,p,ge,e)}!function(e,t,r,n,o,l,u,p,m,g,v,w,k){var T,M=t.xaxis,I=t.yaxis,z=e._fullLayout;function O(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+T,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,e)}var R=n[0].trace,D="h"===R.orientation,j=function(e,t,r,n,a){var o,s=t[0].trace,l=s.texttemplate;return o=l?function(e,t,r,n,a){var o=t[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,p,d="histogram"===o.type,f="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(e){return c(u,u.c2l(e),!0).text}function v(e){return c(p,p.c2l(e),!0).text}g?(l="y",u=a,h="x",p=n):(l="x",u=n,h="y",p=a);var x=t[r],_={};_.label=x.p,_.labelLabel=_[l+"Label"]=y(x.p);var w=i.castOption(o,x.i,"text");(0===w||w)&&(_.text=w),_.value=x.s,_.valueLabel=_[h+"Label"]=v(x.s);var k={};b(k,o,x.i),(d||void 0===k.x)&&(k.x=g?_.value:_.label),(d||void 0===k.y)&&(k.y=g?_.label:_.value),(d||void 0===k.xLabel)&&(k.xLabel=g?_.valueLabel:_.labelLabel),(d||void 0===k.yLabel)&&(k.yLabel=g?_.labelLabel:_.valueLabel),f&&(_.delta=+x.rawS||x.s,_.deltaLabel=v(_.delta),_.final=x.v,_.finalLabel=v(_.final),_.initial=_.final-_.delta,_.initialLabel=v(_.initial)),m&&(_.value=x.s,_.valueLabel=v(_.value),_.percentInitial=x.begR,_.percentInitialLabel=i.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=i.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=i.formatPercent(x.sumR));var T=i.castOption(o,x.i,"customdata");return T&&(_.customdata=T),i.texttemplateString(s,_,e._d3locale,k,_,o._meta||{})}(e,t,r,n,a):s.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(e){return c(o?n:r,e,!0).text}function h(e){return c(o?r:n,+e,!0).text}var p,d=a.textinfo,f=e[t],m=d.split("+"),g=[],y=function(e){return-1!==m.indexOf(e)};if(y("label")&&g.push(u(e[t].p)),y("text")&&(0===(p=i.castOption(a,f.i,"text"))||p)&&g.push(p),s){var v=+f.rawS||f.s,x=f.v,b=x-v;y("initial")&&g.push(h(b)),y("delta")&&g.push(h(v)),y("final")&&g.push(h(x))}if(l){y("value")&&g.push(h(f.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(p=i.formatPercent(f.begR),w&&(p+=" of initial"),g.push(p)),y("percent previous")&&(p=i.formatPercent(f.difR),w&&(p+=" of previous"),g.push(p)),y("percent total")&&(p=i.formatPercent(f.sumR),w&&(p+=" of total"),g.push(p))}return g.join("
")}(t,r,n,a):f.getValue(s.text,r),f.coerceString(y,o)}(z,n,o,M,I);T=function(e,t){var r=f.getValue(e.textposition,t);return f.coerceEnumerated(x,r)}(R,o);var F="stack"===w.mode||"relative"===w.mode,B=n[o],N=!F||B._outmost,U=B.hasB,V=g&&g-v>_;if(j&&"none"!==T&&(!B.isBlank&&l!==u&&p!==m||"auto"!==T&&"inside"!==T)){var q=z.font,H=d.getBarColor(n[o],R),G=d.getInsideTextFont(R,o,q,H),W=d.getOutsideTextFont(R,o,q),$=R.insidetextanchor||"end",Z=r.datum();D?"log"===M.type&&Z.s0<=0&&(l=M.range[0]0&&J>0;ie=V?U?E(re-2*g,ne,K,J,D)||E(re,ne-2*g,K,J,D):D?E(re-(g-v),ne,K,J,D)||E(re,ne-2*(g-v),K,J,D):E(re,ne-(g-v),K,J,D)||E(re-2*(g-v),ne,K,J,D):E(re,ne,K,J,D),ae&&ie?T="inside":(T="outside",X.remove(),X=null)}else T="inside";if(!X){var oe=(X=O(r,j,Q=i.ensureUniformFontSize(e,"outside"===T?W:G))).attr("transform");if(X.attr("transform",""),K=(Y=s.bBox(X.node())).width,J=Y.height,X.attr("transform",oe),K<=0||J<=0)return void X.remove()}var se,le=R.textangle;se="outside"===T?function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,p=Math.abs(t-e),d=Math.abs(n-r);o=s?d>2*_?_:0:p>2*_?_:0;var f=1;l&&(f=s?Math.min(1,d/h):Math.min(1,p/u));var m=C(c),g=P(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(e+t)/2,w=(r+n)/2,k=0,T=0,A=s?S(t,e):S(r,n);return s?(b=t-A*o,k=A*y):(w=n+A*o,T=-A*y),{textX:v,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:T,scale:f,rotate:m}}(l,u,p,m,Y,{isHorizontal:D,constrained:"both"===R.constraintext||"outside"===R.constraintext,angle:le}):L(l,u,p,m,Y,{isHorizontal:D,constrained:"both"===R.constraintext||"inside"===R.constraintext,angle:le,anchor:$,hasB:U,r:g,overhead:v}),se.fontSize=Q.size,h("histogram"===R.type?"bar":R.type,se,z),B.transform=se;var ce=A(X,z,w,k);i.setTransormAndDisplay(ce,se)}else r.select("text").remove()}(e,t,D,l,w,H,G,W,$,re,ie,g,v),t.layerClipId&&s.hideOutsideRangePoint(u,D.select("text"),k,I,p.xcalendar,p.ycalendar)}));var W=!1===p.cliponaxis;s.setClipUrl(u,W?null:t.layerClipId,e)}));l.getComponentMethod("errorbars","plot")(e,R,t,g)},toMoveInsideBar:L}}}),to=p({"src/traces/bar/hover.js"(e,t){var r=zr(),n=Ve(),i=q(),a=st().fillText,o=Ja().getLineWidth,s=nr().hoverLabelText,l=T().BADNUM;function c(e,t,n,i,o){var c,u,h,p,d,f,m,g=e.cd,y=g[0].trace,v=g[0].t,x="closest"===i,b="waterfall"===y.type,_=e.maxHoverDistance,w=e.maxSpikeDistance;"h"===y.orientation?(c=n,u=t,h="y",p="x",d=O,f=I):(c=t,u=n,h="x",p="y",f=O,d=I);var k=y[h+"period"],T=x||k;function S(e){return M(e,-1)}function A(e){return M(e,1)}function M(e,t){var r=e.w;return e[h]+t*r/2}function E(e){return e[h+"End"]-e[h+"Start"]}var C=x?S:k?function(e){return e.p-E(e)/2}:function(e){return Math.min(S(e),e.p-v.bardelta/2)},P=x?A:k?function(e){return e.p+E(e)/2}:function(e){return Math.max(A(e),e.p+v.bardelta/2)};function L(e,t,n){return o.finiteRange&&(n=0),r.inbox(e-c,t-c,n+Math.min(1,Math.abs(t-e)/m)-1)}function I(e){return L(C(e),P(e),_)}function z(e){var t=e[p];if(b){var r=Math.abs(e.rawS)||0;u>0?t+=r:u<0&&(t-=r)}return t}function O(e){var t=u,n=e.b,i=z(e);return r.inbox(n-t,i-t,_+(i-t)/(i-n)-1)}var R=e[h+"a"],D=e[p+"a"];m=Math.abs(R.r2c(R.range[1])-R.r2c(R.range[0]));var j=r.getDistanceFunction(i,d,f,(function(e){return(d(e)+f(e))/2}));if(r.getClosest(g,j,e),!1!==e.index&&g[e.index].p!==l){T||(C=function(e){return Math.min(S(e),e.p-v.bargroupwidth/2)},P=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var F=g[e.index],B=y.base?F.b+F.s:F.s;e[p+"0"]=e[p+"1"]=D.c2p(F[p],!0),e[p+"LabelVal"]=B;var N=v.extents[v.extents.round(F.p)];e[h+"0"]=R.c2p(x?C(F):N[0],!0),e[h+"1"]=R.c2p(x?P(F):N[1],!0);var U,V=void 0!==F.orig_p;return e[h+"LabelVal"]=V?F.orig_p:F.p,e.labelLabel=s(R,e[h+"LabelVal"],y[h+"hoverformat"]),e.valueLabel=s(D,e[p+"LabelVal"],y[p+"hoverformat"]),e.baseLabel=s(D,F.b,y[p+"hoverformat"]),e.spikeDistance=(function(e){var t=u,n=e.b,i=z(e);return r.inbox(n-t,i-t,w+(i-t)/(i-n)-1)}(F)+L(S(U=F),A(U),w))/2,e[h+"Spike"]=R.c2p(F.p,!0),a(F,y,e),e.hovertemplate=y.hovertemplate,e}}function u(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=o(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,i,a){var o=c(e,t,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),ro=p({"src/traces/bar/event_data.js"(e,t){t.exports=function(e,t,r){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}}}),no=p({"src/traces/bar/select.js"(e,t){function r(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}t.exports=function(e,t){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===t)for(n=0;n0?(g="v",y=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",y=Math.min(_)):y=0;if(y){t._length=y;var M=i("orientation",g);t._hasPreCompStats?"v"===M&&0===x?(i("x0",0),i("dx",1)):"h"===M&&0===v&&(i("y0",0),i("dy",1)):"v"===M&&0===x?i("x0"):"h"===M&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function u(e,t,n,i){var a=i.prefix,o=r.coerce2(e,t,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";t._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",t.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",t.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete t.marker;var h=n("hoveron");"all"!==h&&-1===h.indexOf("points")||n("hovertemplate"),r.coerceSelectionMarkerOpacity(t,n)}t.exports={supplyDefaults:function(e,t,n,o){function s(n,i){return r.coerce(e,t,l,n,i)}if(c(e,t,s,o),!1!==t.visible){a(e,t,o,s),s("xhoverformat"),s("yhoverformat");var h=t._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(t.line.color,.5));var p=!1;if(h){var d=s("mean"),f=s("sd");d&&d.length&&(p=!0,f&&f.length&&(p="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",p)),s("showwhiskers","quartiles"===g),"sd"!==g&&"sd"!==m||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(e.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(e,t,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(e,t){var n,i;function a(e){return r.coerce(i._input,i,l,e)}for(var s=0;sE.uf};if(t._hasPreCompStats){var U=t[x],V=function(e){return v.d2c((t[e]||[])[l])},q=1/0,H=-1/0;for(l=0;l=E.q1&&E.q3>=E.med){var W=V("lowerfence");E.lf=W!==o&&W<=E.q1?W:p(E,P,L);var $=V("upperfence");E.uf=$!==o&&$>=E.q3?$:d(E,P,L);var Z=V("mean");E.mean=Z!==o?Z:L?a.mean(P,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Z!==o&&X>=0?X:L?a.stdev(P,L,E.mean):E.q3-E.q1,E.lo=f(E),E.uo=m(E);var Y=V("notchspan");Y=Y!==o&&Y>0?Y:g(E,L),E.ln=E.med-Y,E.un=E.med+Y;var K=E.lf,J=E.uf;t.boxpoints&&P.length&&(K=Math.min(K,P[0]),J=Math.max(J,P[L-1])),t.notched&&(K=Math.min(K,E.ln),J=Math.max(J,E.un)),E.min=K,E.max=J}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(N),A.push(E)}}t._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i=0&&ie0){var ue,he;(E={}).pos=E[_]=F[l],C=E.pts=ne[l].sort(u),L=(P=E[x]=C.map(h)).length,E.min=P[0],E.max=P[L-1],E.mean=a.mean(P,L),E.sd=a.stdev(P,L,E.mean)*t.sdmultiple,E.med=a.interp(P,.5),L%2&&(le||ce)?(le?(ue=P.slice(0,L/2),he=P.slice(L/2+1)):ce&&(ue=P.slice(0,L/2+1),he=P.slice(L/2)),E.q1=a.interp(ue,.5),E.q3=a.interp(he,.5)):(E.q1=a.interp(P,.25),E.q3=a.interp(P,.75)),E.lf=p(E,P,L),E.uf=d(E,P,L),E.lo=f(E),E.uo=m(E);var pe=g(E,L);E.ln=E.med-pe,E.un=E.med+pe,ae=Math.min(ae,E.ln),oe=Math.max(oe,E.un),E.pts2=C.filter(N),A.push(E)}t.notched&&a.isTypedArray(ee)&&(ee=Array.from(ee)),t._extremes[v._id]=n.findExtremes(v,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(a.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r0?(A[0].t={num:k[M],dPos:B,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?s(e,"mean \xb1 \u03c3:").replace("\u03c3",1===t.sdmultiple?"\u03c3":t.sdmultiple+"\u03c3"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},k[M]++,A):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in l)a.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(t[n][r[0]])&&(e[l[n]]=t[n][r[0]][r[1]]):e[l[n]]=t[n][r])}function u(e,t){return e.v-t.v}function h(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(a.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function d(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(a.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function f(e){return 4*e.q1-3*e.q3}function m(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}}}),ho=p({"src/traces/box/cross_trace_calc.js"(e,t){var r=nr(),n=st(),i=tn().getAxisGroup,a=["v","h"];function o(e,t,a,o){var s,l,c,u=t.calcdata,h=t._fullLayout,p=o._id,d=p.charAt(0),f=[],m=0;for(s=0;s1,b=1-h[e+"gap"],_=1-h[e+"groupgap"];for(s=0;s0){var H=E.pointpos,G=E.jitter,W=E.marker.size/2,$=0;H+G>=0&&(($=V*(H+G))>A?(q=!0,N=W,F=$):$>D&&(N=W,F=A)),$<=A&&(F=A);var Z=0;H-G<=0&&((Z=-V*(H-G))>M?(q=!0,U=W,B=Z):Z>j&&(U=W,B=M)),Z<=M&&(B=M)}else F=A,B=M;var X=new Array(c.length);for(l=0;le.lo&&(x.so=!0)}return a}));p.enter().append("path").classed("point",!0),p.exit().remove(),p.call(i.translatePoints,o,s)}function s(e,t,i,a){var o,s,l=t.val,c=t.pos,u=!!c.rangebreaks,h=a.bPos,p=a.bPosPxOffset||0,d=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var f=e.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);f.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),f.exit().remove(),f.each((function(e){var t=c.c2l(e.pos+h,!0),n=c.l2p(t-o)+p,a=c.l2p(t+s)+p,f=u?(n+a)/2:c.l2p(t)+p,m=l.c2p(e.mean,!0),g=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===d?"m0,0L"+g+","+f+"L"+m+","+n+"L"+y+","+f+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===d?"m0,0L"+f+","+g+"L"+n+","+m+"L"+f+","+y+"Z":""))}))}t.exports={plot:function(e,t,i,l){var c=e._context.staticPlot,u=t.xaxis,h=t.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(e){var t,n,i=r.select(this),l=e[0],p=l.t,d=l.trace;p.wdPos=p.bdPos*d.whiskerwidth,!0!==d.visible||p.empty?i.remove():("h"===d.orientation?(t=h,n=u):(t=u,n=h),a(i,{pos:t,val:n},d,p,c),o(i,{x:u,y:h},d,p),s(i,{pos:t,val:n},d,p))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),fo=p({"src/traces/box/style.js"(e,t){var r=v(),n=q(),i=Jt();t.exports={style:function(e,t,a){var o=a||r.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var a=r.select(this),o=t[0].trace,s=o.line.width;function l(e,t,r,i){e.style("stroke-width",t+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=r.select(this),n=o[e.dir];l(t,n.line.width,n.line.color,n.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}}}),mo=p({"src/traces/box/hover.js"(e,t){var r=nr(),n=st(),i=zr(),a=q(),o=n.fillText;function s(e,t,o,s){var l,c,u,h,p,d,f,m,g,y,v,x,b,_,w=e.cd,k=e.xa,T=e.ya,S=w[0].trace,A=w[0].t,M="violin"===S.type,E=A.bdPos,C=A.wHover,P=function(e){return u.c2l(e.pos)+A.bPos-u.c2l(d)};M&&"both"!==S.side?("positive"===S.side&&(g=function(e){var t=P(e);return i.inbox(t,t+C,y)},x=E,b=0),"negative"===S.side&&(g=function(e){var t=P(e);return i.inbox(t-C,t,y)},x=0,b=E)):(g=function(e){var t=P(e);return i.inbox(t-C,t+C,y)},x=b=E),_=M?function(e){return i.inbox(e.span[0]-p,e.span[1]-p,y)}:function(e){return i.inbox(e.min-p,e.max-p,y)},"h"===S.orientation?(p=t,d=o,f=_,m=g,l="y",u=T,c="x",h=k):(p=o,d=t,f=g,m=_,l="x",u=k,c="y",h=T);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function I(e){return(f(e)+m(e))/2}y=e.maxHoverDistance-L,v=e.maxSpikeDistance-L;var z=i.getDistanceFunction(s,f,m,I);if(i.getClosest(w,z,e),!1===e.index)return[];var O=w[e.index],R=S.line.color,D=(S.marker||{}).color;a.opacity(R)&&S.line.width?e.color=R:a.opacity(D)&&S.boxpoints?e.color=D:e.color=S.fillcolor,e[l+"0"]=u.c2p(O.pos+A.bPos-b,!0),e[l+"1"]=u.c2p(O.pos+A.bPos+x,!0),e[l+"LabelVal"]=void 0!==O.orig_p?O.orig_p:O.pos;var j=l+"Spike";e.spikeDistance=I(O)*v/y,e[j]=u.c2p(O.pos,!0);var F=S.boxmean||"sd"===S.sizemode||(S.meanline||{}).visible,B=S.boxpoints||S.points,N=B&&F?["max","uf","q3","med","mean","q1","lf","min"]:B&&!F?["max","uf","q3","med","q1","lf","min"]:!B&&F?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]0&&(a=!0);for(var l=0;la){var o=a-n[e];return n[e]=a,o}}return 0},max:function(e,t,n,i){var a=i[t];if(r(a)){if(a=Number(a),!r(n[e]))return n[e]=a,a;if(n[e]l?e>a?e>1.1*n?n:e>1.1*i?i:a:e>o?o:e>s?s:l:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,i,o,s){if(i&&e>a){var l=d(t,o,s),c=d(r,o,s),u=e===n?0:1;return l[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function d(e,t,r){var i=t.c2d(e,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}t.exports=function(e,t,r,i,o){var s,l,h=-1.1*t,p=-.1*t,d=e-p,f=r[0],m=r[1],g=Math.min(u(f+p,f+d,i,o),u(m+p,m+d,i,o)),y=Math.min(u(f+h,f+p,i,o),u(m+h,m+p,i,o));if(g>y&&ya){var v=s===n?1:6,x=s===n?"M12":"M1";return function(t,r){var a=i.c2d(t,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var u=i.d2c(a,0,o);if(uo.r2l(F)&&(N=a.tickIncrement(N,b.size,!0,d)),O.start=o.l2r(N),j||n.nestedProperty(t,y+".start").set(O.start)}var U=b.end,V=o.r2l(z.end),q=void 0!==V;if((b.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,f);O.end=o.l2r(H),q||n.nestedProperty(t,y+".start").set(O.end)}var G="autobin"+s;return!1===t._input[G]&&(t._input[y]=n.extendFlat({},t[y]||{}),delete t._input[G],delete t[G]),[O,f]}t.exports={calc:function(e,t){var i,p,d,f,m=[],g=[],y="h"===t.orientation,v=a.getFromId(e,y?t.yaxis:t.xaxis),x=y?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,k=h(e,t,v,x),T=k[0],S=k[1],A="string"===typeof T.size,M=[],E=A?M:T,C=[],P=[],L=[],I=0,z=t.histnorm,O=t.histfunc,R=-1!==z.indexOf("density");w.enabled&&R&&(z=z.replace(/ ?density$/,""),R=!1);var D,j="max"===O||"min"===O?null:0,F=s.count,B=l[z],N=!1,U=function(e){return v.r2c(e,0,_)};for(n.isArrayOrTypedArray(t[b])&&"count"!==O&&(D=t[b],N="avg"===O,F=s[O]),i=U(T.start),d=U(T.end)+(i-a.tickIncrement(i,T.size,!1,_))/1e6;i=0&&f=0;n--)s(n);else if("increasing"===t){for(n=1;n=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,ee=K-1;for(i=0;i=Q;i--)if(g[i]){ee=i;break}for(i=Q;i<=ee;i++)if(r(m[i])&&r(g[i])){var te={p:m[i],s:g[i],b:0};w.enabled||(te.pts=L[i],W?te.ph0=te.ph1=L[i].length?S[L[i][0]]:m[i]:(t._computePh=!0,te.ph0=H(M[i]),te.ph1=H(M[i+1],!0))),J.push(te)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,T.size,!1,_)-J[0].p),o(J,t),n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(J,t,X),J},calcAllAutoBins:h}}}),Po=p({"src/traces/histogram2d/calc.js"(e,t){var r=st(),n=nr(),i=So(),a=Ao(),o=Mo(),s=Eo(),l=Co().calcAllAutoBins;function c(e,t,r,n){var i,a=new Array(e);if(n)for(i=0;iM&&k.splice(M,k.length-M),A.length>M&&A.splice(M,A.length-M);var E=[],C=[],P=[],L="string"===typeof w.size,I="string"===typeof S.size,z=[],O=[],R=L?z:w,D=I?O:S,j=0,F=[],B=[],N=t.histnorm,U=t.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],W=!1,$=[],Z=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==U&&(W="avg"===U,H=i[U]);var Y=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,Y,!1,y))/1e6;for(s=K;s=0&&d=0&&fm&&(y=Math.max(y,Math.abs(e[a][o]-f)/(g-m))))}return y}t.exports=function(e,t){var n,o=1;for(a(e,t),n=0;n.01;n++)o=a(e,t,i(o));return o>.01&&r.log("interp2d didn't converge quickly",o),e}}}),Oo=p({"src/traces/heatmap/find_empties.js"(e,t){var r=st().maxRowLength;t.exports=function(e){var t,n,i,a,o,s,l,c,u=[],h={},p=[],d=e[0],f=[],m=[0,0,0],g=r(e);for(n=0;n=0;o--)(s=((h[[(n=(a=p[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(e,t){return t[2]-e[2]}))}}}),Ro=p({"src/traces/heatmap/make_bound_array.js"(e,t){var r=Ve(),n=st().isArrayOrTypedArray;t.exports=function(e,t,i,a,o,s){var l,c,u,h=[],p=r.traceIs(e,"contour"),d=r.traceIs(e,"histogram");if(n(t)&&t.length>1&&!d&&"category"!==s.type){var f=t.length;if(!(f<=o))return p?t.slice(0,o):t.slice(0,o+1);if(p)h=Array.from(t).slice(0,o);else if(1===o)h="log"===s.type?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if("log"===s.type){for(h=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],u=1;u1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(T=0;Tr)return!1}return!0}(A.rangebreaks||M.rangebreaks)&&(k=function(e,t,r){for(var n=[],i=-1,a=0;a0;)T=S.c2p(B[P]),P--;for(T0;)C=A.c2p(N[P]),P--;C=S._length||T<=0||E>=A._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void b(z);"fast"===X?(K=W,J=G):(K=Q,J=ee);var te=document.createElement("canvas");te.width=K,te.height=J;var re,ne,ie=te.getContext("2d",{willReadFrequently:!0}),ae=p(R,{noNumericCheck:!0,returnArray:!0});"fast"===X?(re=$?function(e){return W-1-e}:s.identity,ne=Z?function(e){return G-1-e}:s.identity):(re=function(e){return s.constrain(Math.round(S.c2p(B[e])-v),0,Q)},ne=function(e){return s.constrain(Math.round(A.c2p(N[e])-E),0,ee)});var oe,se,le,ce,ue=ne(0),he=[ue,ue],pe=$?0:1,de=Z?0:1,fe=0,me=0,ge=0,ye=0;function ve(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),fe+=t,me+=r[0]*t,ge+=r[1]*t,ye+=r[2]*t,r}return[0,0,0,0]}function xe(e,t,r,n){var i=e[r.bin0];if(void 0===i)return ve(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,ve(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==X){var be,_e=0;try{be=new Uint8Array(K*J*4)}catch(gt){be=new Array(K*J*4)}if("smooth"===X){var we,ke,Te,Se=U||B,Ae=V||N,Me=new Array(Se.length),Ee=new Array(Ae.length),Ce=new Array(Q),Pe=U?w:_,Le=V?w:_;for(P=0;PXe||Xe>A._length))for(L=Ge;LKe||Ke>S._length)){var Je=c({x:Ye,y:Ze},R,e._fullLayout);Je.x=Ye,Je.y=Ze;var Qe=O.z[P][L];void 0===Qe?(Je.z="",Je.zLabel=""):(Je.z=Qe,Je.zLabel=o.tickText(Ue,Qe,"hover").text);var et=O.text&&O.text[P]&&O.text[P][L];void 0!==et&&!1!==et||(et=""),Je.text=et;var tt=s.texttemplateString(Be,Je,e._fullLayout._d3locale,Je,R._meta||{});if(tt){var rt=tt.split("
"),nt=rt.length,it=0;for(I=0;I=_[0].length||d<0||d>_.length)return}else{if(r.inbox(t-x[0],t-x[x.length-1],0)>0||r.inbox(s-b[0],s-b[b.length-1],0)>0)return;if(f){var E;for(A=[2*x[0]-x[1]],E=1;E=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ss=p({"src/traces/contour/attributes.js"(e,t){var r=bo(),n=wn(),i=Et(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Lt(),l=Ie().dash,c=D(),u=R().extendFlat,h=os(),p=h.COMPARISON_OPS2,d=h.INTERVAL_OPS,f=n.line;t.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.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:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(p).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},f.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),ls=p({"src/traces/histogram2dcontour/attributes.js"(e,t){var r=es(),n=ss(),i=Lt(),a=Et().axisHoverFormat,o=R().extendFlat;t.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),cs=p({"src/traces/contour/contours_defaults.js"(e,t){t.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}}}),us=p({"src/traces/contour/label_defaults.js"(e,t){var r=st();t.exports=function(e,t,n,i){if(i||(i={}),e("contours.showlabels")){var a=t.font;r.coerceFont(e,"contours.labelfont",a,{overrideDflt:{color:n}}),e("contours.labelformat")}!1!==i.hasHover&&e("zhoverformat")}}}),hs=p({"src/traces/contour/style_defaults.js"(e,t){var r=Vt(),n=us();t.exports=function(e,t,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,r(e,t,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),ps=p({"src/traces/histogram2dcontour/defaults.js"(e,t){var r=st(),n=ts(),i=cs(),a=hs(),o=wo(),s=ls();t.exports=function(e,t,l,c){function u(n,i){return r.coerce(e,t,s,n,i)}n(e,t,u,c),!1!==t.visible&&(i(e,t,u,(function(n){return r.coerce2(e,t,s,n)})),a(e,t,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),t.contours&&"heatmap"===t.contours.coloring&&o(u,c))}}}),ds=p({"src/traces/contour/set_contours.js"(e,t){var r=nr(),n=st();function i(e,t,n){var i={type:"linear",range:[e,t]};return r.autoTicks(i,(t-e)/(n||15)),i}t.exports=function(e,t){var a=e.contours;if(e.autocontour){var o=e.zmin,s=e.zmax;(e.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,t)),(e.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,t));var l=i(o,s,e.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),e._input.contours||(e._input.contours={}),n.extendFlat(e._input.contours,{start:a.start,end:a.end,size:a.size}),e._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,p=e._input.contours;u>h&&(a.start=p.start=h,h=a.end=p.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,e.ncontours).dtick,p.size=a.size=c)}}}}),fs=p({"src/traces/contour/end_plus.js"(e,t){t.exports=function(e){return e.end+e.size/1e6}}}),ms=p({"src/traces/contour/calc.js"(e,t){var r=Wt(),n=Do(),i=ds(),a=fs();t.exports=function(e,t){var o=n(e,t),s=o[0].z;i(t,s);var l,c=t.contours,u=r.extractOpts(t);if("heatmap"===c.coloring&&u.auto&&!1===t.autocontour){var h=c.start,p=a(c),d=c.size||1,f=Math.floor((p-h)/d)+1;isFinite(d)||(d=1,f=1);var m=h-d/2;l=[m,m+f*d]}else l=s;return r.calc(e,t,{vals:l,cLetter:"z"}),o}}}),gs=p({"src/traces/contour/constants.js"(e,t){t.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}}}}),ys=p({"src/traces/contour/make_crossings.js"(e,t){var r=gs();function n(e,t){var r=(t[0][0]>e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,i,a,o,s,l,c,u,h,p=e[0].z,d=p.length,f=p[0].length,m=2===d||2===f;for(i=0;i20&&t?208===e||1114===e?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(e)?a=1:-1!==n.LEFTSTART.indexOf(e)?i=1:-1!==n.TOPSTART.indexOf(e)?a=-1:i=-1,[i,a]}(p,o,t),f=[s(e,t,[-d[0],-d[1]])],m=e.z.length,g=e.z[0].length,y=t.slice(),v=d.slice();for(u=0;u<1e4;u++){if(p>20?(p=n.CHOOSESADDLE[p][(d[0]||d[1])<0?0:1],e.crossings[h]=n.SADDLEREMAINDER[p]):delete e.crossings[h],!(d=n.NEWDELTA[p])){r.log("Found bad marching index:",p,t,e.level);break}f.push(s(e,t,d)),t[0]+=d[0],t[1]+=d[1],h=t.join(","),i(f[f.length-1],f[f.length-2],l,c)&&f.pop();var x=d[0]&&(t[0]<0||t[0]>g-2)||d[1]&&(t[1]<0||t[1]>m-2);if(t[0]===y[0]&&t[1]===y[1]&&d[0]===v[0]&&d[1]===v[1]||o&&x)break;p=e.crossings[h]}1e4===u&&r.log("Infinite loop in contour?");var b,_,w,k,T,S,A,M,E,C,P,L=i(f[0],f[f.length-1],l,c),I=0,z=.2*e.smoothing,O=[],R=0;for(u=1;u=R;u--)if((b=O[u])=R&&b+O[_]M&&E--,e.edgepaths[E]=P.concat(f,C));break}B||(e.edgepaths[M]=f.concat(C))}for(M=0;M":o(">"),"<":o("<"),"=":o("=")}}}),bs=p({"src/traces/contour/empty_pathinfo.js"(e,t){var r=st(),n=xs(),i=fs();t.exports=function(e,t,a){for(var o="constraint"===e.type?n[e._operation](e.value):e,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y},p=o.start;p1e3){r.warn("Too many contours, clipping at 1000",e);break}return l}}}),_s=p({"src/traces/contour/convert_to_constraints.js"(e,t){var r=st();function n(e){return r.extendFlat({},e,{edgepaths:r.extendDeep([],e.edgepaths),paths:r.extendDeep([],e.paths),starts:r.extendDeep([],e.starts)})}t.exports=function(e,t){var i,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&r.warn("Contour data invalid for the specified inequality operation."),a=e[0],i=0;io.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r":d>c&&(n.prefixBoundary=!0);break;case"<":(dc||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(d[0],d[1]),p=Math.max(d[0],d[1]),hc&&(n.prefixBoundary=!0)}}}}}),ks=p({"src/traces/contour/plot.js"(e){var t=v(),r=st(),n=Jt(),i=Wt(),a=At(),o=nr(),s=er(),l=Bo(),c=ys(),u=vs(),h=bs(),p=_s(),d=ws(),f=gs(),m=f.LABELOPTIMIZER;function g(e,t){var i,a,o,s,l,c,u,h="",p=0,d=e.edgepaths.map((function(e,t){return t})),f=!0;function m(e){return Math.abs(e[1]-t[2][1])<.01}function g(e){return Math.abs(e[0]-t[0][0])<.01}function y(e){return Math.abs(e[0]-t[2][0])<.01}for(;d.length;){for(c=n.smoothopen(e.edgepaths[p],e.smoothing),h+=f?c:c.replace(/^M/,"L"),d.splice(d.indexOf(p),1),i=e.edgepaths[p][e.edgepaths[p].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",p,e);break}for(u=i,Math.abs(u[1]-t[0][1])<.01&&!y(i)?a=t[1]:g(i)?a=t[0]:m(i)?a=t[3]:y(i)&&(a=t[2]),l=0;l=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===e.edgepaths.length){r.log("unclosed perimeter path");break}p=s,(f=-1===d.indexOf(p))&&(p=d[0],h+="Z")}for(p=0;pi.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),d=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(p<1||d<1)return 1/0;var f=m.EDGECOST*(1/(p-1)+1/(d-1));f+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,b=0;b2*m.MAXCOST)break;d&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=m.MAXCOST)return u},e.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,c=e.theta,u=Math.sin(c),h=Math.cos(c),p=function(e,t){return[s+e*h-t*u,l+e*u+t*h]},d=[p(-a/2,-o/2),p(-a/2,o/2),p(a/2,o/2),p(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:c,level:t.level,width:a,height:o}),n.push(d)},e.drawLabels=function(e,n,i,o,s){var l=e.selectAll("text").data(n,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var r=e.x+Math.sin(e.theta)*e.dy,n=e.y-Math.cos(e.theta)*e.dy;t.select(this).text(e.text).attr({x:r,y:n,transform:"rotate("+180*e.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),p=0;py&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(n=parseFloat(t.value[0]),t.value=[n,n+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:r(t.value)&&(n=parseFloat(t.value),t.value=[n,n+1])):(e("contours.value",0),r(t.value)||(l(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(i,g),"="===y?d=g.showlines=!0:(d=i("contours.showlines"),m=i("fillcolor",a((e.line||{}).color||h,.5))),d&&(f=i("line.color",m&&o(m)?a(t.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,f,p)}}}),Ls=p({"src/traces/contour/defaults.js"(e,t){var r=st(),n=_o(),i=Hn(),a=Ps(),o=cs(),s=hs(),l=wo(),c=ss();t.exports=function(e,t,u,h){function p(n,i){return r.coerce(e,t,c,n,i)}if(n(e,t,p,h)){i(e,t,h,p),p("xhoverformat"),p("yhoverformat"),p("text"),p("hovertext"),p("hoverongaps"),p("hovertemplate");var d="constraint"===p("contours.type");p("connectgaps",r.isArray1D(t.z)),d?a(e,t,p,h,u):(o(e,t,p,(function(n){return r.coerce2(e,t,c,n)})),s(e,t,p,h)),t.contours&&"heatmap"===t.contours.coloring&&l(p,h),p("zorder")}else t.visible=!1}}}),Is=p({"src/traces/contour/index.js"(e,t){t.exports={attributes:ss(),supplyDefaults:Ls(),calc:ms(),plot:ks().plot,style:Ss(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"contour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),zs=p({"lib/contour.js"(e,t){t.exports=Is()}}),Os=p({"src/traces/scatterternary/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=wn(),o=N(),s=Lt(),l=Ie().dash,c=R().extendFlat,u=a.marker,h=a.line,p=u.line;t.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:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:p.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Rs=p({"src/traces/scatterternary/defaults.js"(e,t){var r=st(),n=bn(),i=$t(),a=Wn(),o=$n(),s=Zn(),l=Xn(),c=Yn(),u=Os();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}var f,m=d("a"),g=d("b"),y=d("c");if(m?(f=m.length,g?(f=Math.min(f,g.length),y&&(f=Math.min(f,y.length))):f=y?Math.min(f,y.length):0):g&&y&&(f=Math.min(g.length,y.length)),f){t._length=f,d("sum"),d("text"),d("hovertext"),"fills"!==t.hoveron&&d("hovertemplate"),d("mode",f"),o.hovertemplate=p.hovertemplate,a}function x(e,t){y.push(e._hovertitle+": "+t)}}}}),Ns=p({"src/traces/scatterternary/event_data.js"(e,t){t.exports=function(e,t,r,n,i){if(t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),n[i]){var a=n[i];e.a=a.a,e.b=a.b,e.c=a.c}else e.a=t.a,e.b=t.b,e.c=t.c;return e}}}),Us=p({"src/plots/ternary/ternary.js"(e,t){var r=v(),n=O(),i=Ve(),a=st(),o=a.strTranslate,s=a._,l=q(),c=Jt(),u=er(),h=R().extendFlat,p=kt(),d=nr(),f=hr(),m=zr(),g=Or(),y=g.freeMode,x=g.rectMode,b=Qt(),_=Mn().prepSelect,w=Mn().selectOnClick,k=Mn().clearOutline,T=Mn().clearSelectionsCache,S=yt();function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.updateFx(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var M=A.prototype;M.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},M.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;aE*b?i=(a=b)*E:a=(i=x)/E,s=y*i/x,p=v*a/b,r=t.l+t.w*m-i/2,n=t.t+t.h*(1-g)-a/2,d.x0=r,d.y0=n,d.w=i,d.h=a,d.sum=_,d.xaxis={type:"linear",range:[w+2*T-_,_-w-2*k],domain:[m-s/2,m+s/2],_id:"x"},u(d.xaxis,d.graphDiv._fullLayout),d.xaxis.setScale(),d.xaxis.isPtWithinRange=function(e){return e.a>=d.aaxis.range[0]&&e.a<=d.aaxis.range[1]&&e.b>=d.baxis.range[1]&&e.b<=d.baxis.range[0]&&e.c>=d.caxis.range[1]&&e.c<=d.caxis.range[0]},d.yaxis={type:"linear",range:[w,_-k-T],domain:[g-p/2,g+p/2],_id:"y"},u(d.yaxis,d.graphDiv._fullLayout),d.yaxis.setScale(),d.yaxis.isPtWithinRange=function(){return!0};var S=d.yaxis.domain[0],A=d.aaxis=h({},e.aaxis,{range:[w,_-k-T],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[S,S+p*E],anchor:"free",position:0,_id:"y",_length:i});u(A,d.graphDiv._fullLayout),A.setScale();var M=d.baxis=h({},e.baxis,{range:[_-w-T,k],side:"bottom",domain:d.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(M,d.graphDiv._fullLayout),M.setScale();var C=d.caxis=h({},e.caxis,{range:[_-w-k,T],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[S,S+p*E],anchor:"free",position:0,_id:"y",_length:i});u(C,d.graphDiv._fullLayout),C.setScale();var P="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";d.clipDef.select("path").attr("d",P),d.layers.plotbg.select("path").attr("d",P);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";d.clipDefRelative.select("path").attr("d",L);var I=o(r,n);d.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),d.clipDefRelative.select("path").attr("transform",null);var z=o(r-M._offset,n+a);d.layers.baxis.attr("transform",z),d.layers.bgrid.attr("transform",z);var O=o(r+i/2,n)+"rotate(30)"+o(0,-A._offset);d.layers.aaxis.attr("transform",O),d.layers.agrid.attr("transform",O);var R=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);d.layers.caxis.attr("transform",R),d.layers.cgrid.attr("transform",R),d.drawAxes(!0),d.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),d.layers.bline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),d.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),d.graphDiv._context.staticPlot||d.initInteractions(),c.setClipUrl(d.layers.frontplot,d._hasClipOnAxisFalse?null:d.clipId,d.graphDiv)},M.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.substr(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,l=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(l),e){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=b.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=b.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:t.x0-u,y:t.y0+t.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=b.draw(r,"c"+n,{propContainer:l,propName:t.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+u,y:t.y0+t.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},M.drawAx=function(e){var t,r=this,n=r.graphDiv,i=e._name,o=i.charAt(0),s=e._id,l=r.layers[i],c=o+"tickLayout",u=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);r[c]!==u&&(l.selectAll("."+s+"tick").remove(),r[c]=u),e.setScale();var h=d.calcTicks(e),p=d.clipEnds(e,h),f=d.makeTransTickFn(e),m=d.getTickSigns(e)[2],g=a.deg2rad(30),y=m*(e.linewidth||1)/2,v=m*e.ticklen,x=r.w,b=r.h,_="b"===o?"M0,"+y+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+y+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[o];d.drawTicks(n,e,{vals:"inside"===e.ticks?p:h,layer:l,path:_,transFn:f,crisp:!1}),d.drawGrid(n,e,{vals:p,layer:r.layers[o+"grid"],path:w,transFn:f,crisp:!1}),d.drawLabels(n,e,{vals:h,layer:l,transFn:f,labelFns:d.makeLabelFns(e,0,30)})};var C=S.MINZOOM/2+.87,P="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",I="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function D(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}M.clearOutline=function(){T(this.dragOptions),k(this.dragOptions.gd)},M.initInteractions=function(){var e,t,r,u,h,p,d,g,v,b,k,T,A=this,M=A.layers.plotbg.select("path").node(),C=A.graphDiv,O=C._fullLayout._zoomlayer;function R(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function j(e,t){var r=C._fullLayout.clickmode;D(C),2===e&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,C,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&m.click(C,t,A.id)}function F(e,t){return 1-t/A.h}function B(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function N(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function U(n,i){var a=r+n*e,o=u+i*t,s=Math.max(0,Math.min(1,F(0,u),F(0,o))),l=Math.max(0,Math.min(1,B(r,u),B(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),f=(s/2+c)*A.w,m=(1-s/2-l)*A.w,y=(f+m)/2,x=m-f,_=(1-s)*A.h,w=_-x/E;x.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),T.transition().style("opacity",1).duration(200),b=!0),C.emit("plotly_relayouting",R(d))}function V(){D(C),d!==h&&(i.call("_guiRelayout",C,R(d)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long"),z=!1))}function q(e,t){var r=e/A.xaxis._m,n=t/A.yaxis._m,i=[(d={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,d.b,d.c].sort(a.sorterAsc),s=i.indexOf(d.a),l=i.indexOf(d.b),u=i.indexOf(d.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),d={a:i[s],b:i[l],c:i[u]},t=(h.a-d.a)*A.yaxis._m,e=(h.c-d.c-h.b+d.b)*A.xaxis._m);var p=o(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",p);var f=o(-e,-t);A.clipDefRelative.select("path").attr("transform",f),A.aaxis.range=[d.a,A.sum-d.b-d.c],A.baxis.range=[A.sum-d.a-d.c,d.b],A.caxis.range=[A.sum-d.a-d.b,d.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,A),C.emit("plotly_relayouting",R(d))}function H(){i.call("_guiRelayout",C,R(d))}this.dragOptions={element:M,gd:C,plotinfo:{id:A.id,domain:C._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,c){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],e=C._fullLayout._invScaleX,t=C._fullLayout._invScaleY;var f=A.dragOptions.dragmode=C._fullLayout.dragmode;y(f)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===f?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=j,A.dragOptions.doneFn=V,function(e,t,i){var s=M.getBoundingClientRect();r=t-s.left,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,f=a.apply3DTransform(c)(r,u);r=f[0],u=f[1],h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},d=h,p=A.aaxis.range[1]-h.a,g=n(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),v="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,k=O.append("path").attr("class","zoombox").attr("transform",o(A.x0,A.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),T=O.append("path").attr("class","zoombox-corners").attr("transform",o(A.x0,A.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearOutline(C)}(0,s,c)):"pan"===f?(A.dragOptions.moveFn=q,A.dragOptions.clickFn=j,A.dragOptions.doneFn=H,h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},d=h,A.clearOutline(C)):(x(f)||y(f))&&_(i,s,c,A.dragOptions,f)}},M.onmousemove=function(e){m.hover(C,e,A.id),C._fullLayout._lasthover=M,C._fullLayout._hoversubplot=A.id},M.onmouseout=function(e){C._dragging||f.unhover(C,e)},f.init(this.dragOptions)}}}),Vs=p({"src/plots/ternary/layout_attributes.js"(e,t){var r=V(),n=ka().attributes,i=Ct(),a=Le().overrideAll,o=R().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=t.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),qs=p({"src/plots/subplot_defaults.js"(e,t){var r=st(),n=gt(),i=ka().defaults;t.exports=function(e,t,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,p=o.partition||"x",d=t._subplots[c],f=d.length,m=f&&d[0].replace(/\d+$/,"");function g(e,t){return r.coerce(s,l,u,e,t)}for(var y=0;y=u&&(d.min=0,m.min=0,g.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function f(e,t,r,n){var a=h[t._name];function p(r,n){return i.coerce(e,t,a,r,n)}p("uirevision",n.uirevision),t.type="linear";var d=p("color"),f=d!==a.color.dflt?d:r.font.color,m=t._name.charAt(0).toUpperCase(),g="Component "+m,y=p("title.text",g);t._hovertitle=y===g?y:m,i.coerceFont(p,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:f}}),p("min"),c(e,t,p,"linear"),s(e,t,p,"linear"),o(e,t,p,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(e,t,p,{outerTicks:!0}),p("showticklabels")&&(i.coerceFont(p,"tickfont",r.font,{overrideDflt:{color:f}}),p("tickangle"),p("tickformat")),u(e,t,p,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),p("hoverformat"),p("layer")}t.exports=function(e,t,r){a(e,t,r,{type:"ternary",attributes:h,handleDefaults:d,font:t.font,paper_bgcolor:t.paper_bgcolor})}}}),Gs=p({"src/plots/ternary/index.js"(e){var t=Us(),r=_t().getSubplotCalcData,n=st().counterRegex,i="ternary";e.name=i;var a=e.attr="subplot";e.idRoot=i,e.idRegex=e.attrRegex=n(i),(e.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},e.layoutAttributes=Vs(),e.supplyLayoutDefaults=Hs(),e.plot=function(e){for(var n=e._fullLayout,a=e.calcdata,o=n._subplots[i],s=0;s0){var b,_,w,k,T,S=e.xa,A=e.ya;"h"===f.orientation?(T=t,b="y",w=A,_="x",k=S):(T=s,b="x",w=S,_="y",k=A);var M=d[e.index];if(T>=M.span[0]&&T<=M.span[1]){var E=n.extendFlat({},e),C=k.c2p(T,!0),P=o.getKdeValue(M,f,T),L=o.getPositionOnKdePath(M,f,C),I=w._offset,z=w._length;E[b+"0"]=L[0],E[b+"1"]=L[1],E[_+"0"]=E[_+"1"]=C,E[_+"Label"]=_+": "+i.hoverLabelText(k,T,f[_+"hoverformat"])+", "+d[0].t.labels.kde+" "+P.toFixed(3);for(var O=0,R=0;R path").each((function(e){if(!e.isBlank){var t=s.marker;r.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(n.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}})),l(o,s,e),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var e=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}}}),yl=p({"src/traces/funnel/hover.js"(e,t){var r=q().opacity,n=to().hoverOnBars,i=st().formatPercent;t.exports=function(e,t,a,o,s){var l=n(e,t,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,p=c[l.index];l[(h?"x":"y")+"LabelVal"]=p.s,l.percentInitial=p.begR,l.percentInitialLabel=i(p.begR,1),l.percentPrevious=p.difR,l.percentPreviousLabel=i(p.difR,1),l.percentTotal=p.sumR,l.percentTotalLabel=i(p.sumR,1);var d=p.hi||u.hoverinfo,f=[];if(d&&"none"!==d&&"skip"!==d){var m="all"===d,g=d.split("+"),y=function(e){return m||-1!==g.indexOf(e)};y("percent initial")&&f.push(l.percentInitialLabel+" of initial"),y("percent previous")&&f.push(l.percentPreviousLabel+" of previous"),y("percent total")&&f.push(l.percentTotalLabel+" of total")}return l.extraText=f.join("
"),l.color=function(e,t){var n=e.marker,i=t.mc||n.color,a=t.mlc||n.line.color,o=t.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,p),[l]}}}}),vl=p({"src/traces/funnel/event_data.js"(e,t){t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"percentInitial"in t&&(e.percentInitial=t.percentInitial),"percentPrevious"in t&&(e.percentPrevious=t.percentPrevious),"percentTotal"in t&&(e.percentTotal=t.percentTotal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),xl=p({"src/traces/funnel/index.js"(e,t){t.exports={attributes:sl(),layoutAttributes:ll(),supplyDefaults:cl().supplyDefaults,crossTraceDefaults:cl().crossTraceDefaults,supplyLayoutDefaults:ul(),calc:pl(),crossTraceCalc:dl(),plot:fl(),style:ml().style,hoverPoints:yl(),eventData:vl(),selectPoints:no(),moduleType:"trace",name:"funnel",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),bl=p({"lib/funnel.js"(e,t){t.exports=xl()}}),_l=p({"src/traces/waterfall/constants.js"(e,t){t.exports={eventDataKeys:["initial","delta","final"]}}}),wl=p({"src/traces/waterfall/attributes.js"(e,t){var r=Ha(),n=wn().line,i=N(),a=Et().axisHoverFormat,o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=_l(),c=R().extendFlat,u=q();function h(e){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}t.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.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:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),kl=p({"src/traces/waterfall/layout_attributes.js"(e,t){t.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"}}}}),Tl=p({"src/constants/delta.js"(e,t){t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}}}),Sl=p({"src/traces/waterfall/defaults.js"(e,t){var r=st(),n=Jn(),i=$a().handleText,a=qn(),o=Hn(),s=wl(),l=q(),c=Tl(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function p(e,t,r){e(t+".marker.color",r),e(t+".marker.line.color",l.defaultLine),e(t+".marker.line.width")}t.exports={supplyDefaults:function(e,t,n,l){function c(n,i){return r.coerce(e,t,s,n,i)}if(a(e,t,l,c)){o(e,t,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var d=c("textposition");i(e,t,l,c,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&(c("texttemplate"),t.texttemplate||c("textinfo")),p(c,"increasing",u),p(c,"decreasing",h),p(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else t.visible=!1},crossTraceDefaults:function(e,t){var i,a;function o(e){return r.coerce(a._input,a,s,e)}if("group"===t.waterfallmode)for(var l=0;l0&&(g+=p?"M"+h[0]+","+f[1]+"V"+f[0]:"M"+h[1]+","+f[0]+"H"+h[0]),"between"!==d&&(o.isSum||s path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;r.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(n.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}})),l(o,s,e),o.selectAll(".lines").each((function(){var e=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}}}),Ll=p({"src/traces/waterfall/hover.js"(e,t){var r=nr().hoverLabelText,n=q().opacity,i=to().hoverOnBars,a=Tl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;t.exports=function(e,t,a,l,c){var u=i(e,t,a,l,c);if(u){var h=u.cd,p=h[0].trace,d="h"===p.orientation,f=d?"x":"y",m=d?e.xa:e.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=T(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=T(u.final),u.initialLabel=T(u.initial);var x=g.hi||p.hoverinfo,b=[];if(x&&"none"!==x&&"skip"!==x){var _="all"===x,w=x.split("+"),k=function(e){return _||-1!==w.indexOf(e)};g.isSum||(!k("final")||k(d?"x":"y")||b.push(u.finalLabel),k("delta")&&(y<0?b.push(u.deltaLabel+" "+s):b.push(u.deltaLabel+" "+o)),k("initial")&&b.push("Initial: "+u.initialLabel))}return b.length&&(u.extraText=b.join("
")),u.color=function(e,t){var r=e[t.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(p,g),[u]}function T(e){return r(m,e,p[f+"hoverformat"])}}}}),Il=p({"src/traces/waterfall/event_data.js"(e,t){t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"initial"in t&&(e.initial=t.initial),"delta"in t&&(e.delta=t.delta),"final"in t&&(e.final=t.final),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),zl=p({"src/traces/waterfall/index.js"(e,t){t.exports={attributes:wl(),layoutAttributes:kl(),supplyDefaults:Sl().supplyDefaults,crossTraceDefaults:Sl().crossTraceDefaults,supplyLayoutDefaults:Al(),calc:Ml(),crossTraceCalc:El(),plot:Cl(),style:Pl().style,hoverPoints:Ll(),eventData:Il(),selectPoints:no(),moduleType:"trace",name:"waterfall",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Ol=p({"lib/waterfall.js"(e,t){t.exports=zl()}}),Rl=p({"src/traces/image/constants.js"(e,t){t.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(e){return e.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.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(e){return e.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(e){var t=e.slice(0,3);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["\xb0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(e){var t=e.slice(0,4);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["\xb0","%","%",""]}}}}}),Dl=p({"src/traces/image/attributes.js"(e,t){var r,n,i=N(),a=wn().zorder,o=Oe().hovertemplateAttrs,s=R().extendFlat,l=Rl().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n0?s-4:s;for(r=0;r>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},e.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,l=0,c=n-i;lc?c:l+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};var t,r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0;t<64;++t)r[t]=a[t],n[a.charCodeAt(t)]=t;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),Ul=p({"node_modules/ieee754/index.js"(e){e.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},e.write=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m}}}),Vl=p({"node_modules/buffer/index.js"(e){var t=Nl(),r=Ul(),n="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|d(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);const i=function(e){if(o.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||Z(e.length)?a(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),a(e<0?0:0|p(e))}function u(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=t.length;let o;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function k(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128===(192&r)&&(l=(31&t)<<6|63&r,l>127&&(a=l));break;case 3:r=e[i+1],n=e[i+2],128===(192&r)&&128===(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128===(192&r)&&128===(192&n)&&128===(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=d,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(t+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const l=Math.min(a,s),c=this.slice(n,i),u=e.slice(t,r);for(let o=0;o>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return b(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){N(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){N(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,n,i,a){return t=+t,n>>>=0,a||O(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function D(e,t,n,i,a){return t=+t,n>>>=0,a||O(e,0,n,8),r.write(e,t,n,i,52,8),n+8}o.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Y((function(e){U(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Y((function(e){U(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||P(e,4,this.length),r.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),r.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),r.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),r.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Y((function(e){return I(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Y((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Y((function(e){return I(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Y((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){U(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,a)}function U(e,t){if("number"!==typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw U(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=B(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!==e}var X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"===typeof BigInt?K:e}function K(){throw new Error("BigInt not supported")}}}),ql=p({"node_modules/has-symbols/shams.js"(e,t){t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}}}),Hl=p({"node_modules/has-tostringtag/shams.js"(e,t){var r=ql();t.exports=function(){return r()&&!!Symbol.toStringTag}}}),Gl=p({"node_modules/es-errors/index.js"(e,t){t.exports=Error}}),Wl=p({"node_modules/es-errors/eval.js"(e,t){t.exports=EvalError}}),$l=p({"node_modules/es-errors/range.js"(e,t){t.exports=RangeError}}),Zl=p({"node_modules/es-errors/ref.js"(e,t){t.exports=ReferenceError}}),Xl=p({"node_modules/es-errors/syntax.js"(e,t){t.exports=SyntaxError}}),Yl=p({"node_modules/es-errors/type.js"(e,t){t.exports=TypeError}}),Kl=p({"node_modules/es-errors/uri.js"(e,t){t.exports=URIError}}),Jl=p({"node_modules/has-symbols/index.js"(e,t){var r="undefined"!==typeof Symbol&&Symbol,n=ql();t.exports=function(){return"function"===typeof r&&"function"===typeof Symbol&&"symbol"===typeof r("foo")&&"symbol"===typeof Symbol("bar")&&n()}}}),Ql=p({"node_modules/has-proto/index.js"(e,t){var r={foo:{}},n=Object;t.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}}),ec=p({"node_modules/function-bind/implementation.js"(e,t){var r=Object.prototype.toString,n=Math.max,i=function(e,t){for(var r=[],n=0;n1&&"boolean"!==typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=C(e,0,1),r=C(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return E(e,L,(function(e,t,r,i){n[n.length]=r?E(i,I,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=z("%"+n+"%",t),a=i.name,o=i.value,c=!1,u=i.alias;u&&(n=u[0],M(r,A([0,1],u)));for(var h=1,d=!0;h=r.length){var y=p(o,f);o=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[f]}else d=S(o,f),o=o[f];d&&!c&&(_[a]=o)}}return o}}}),ic=p({"node_modules/es-define-property/index.js"(e,t){var r=nc()("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(n){r=!1}t.exports=r}}),ac=p({"node_modules/gopd/index.js"(e,t){var r=nc()("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(n){r=null}t.exports=r}}),oc=p({"node_modules/define-data-property/index.js"(e,t){var r=ic(),n=Xl(),i=Yl(),a=ac();t.exports=function(e,t,o){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new i("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(e,t);if(r)r(e,t,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=o}}}}),sc=p({"node_modules/has-property-descriptors/index.js"(e,t){var r=ic(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},t.exports=n}}),lc=p({"node_modules/set-function-length/index.js"(e,t){var r=nc(),n=oc(),i=sc()(),a=ac(),o=Yl(),s=r("%Math.floor%");t.exports=function(e,t){if("function"!==typeof e)throw new o("`fn` is not a function");if("number"!==typeof t||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(e,"length",t,!0,!0):n(e,"length",t)),e}}}),cc=p({"node_modules/call-bind/index.js"(e,t){var r=tc(),n=nc(),i=lc(),a=Yl(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=ic(),u=n("%Math.max%");t.exports=function(e){if("function"!==typeof e)throw new a("a function is required");var t=l(r,s,arguments);return i(t,1+u(0,e.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h}}),uc=p({"node_modules/call-bind/callBound.js"(e,t){var r=nc(),n=cc(),i=n(r("String.prototype.indexOf"));t.exports=function(e,t){var a=r(e,!!t);return"function"===typeof a&&i(e,".prototype.")>-1?n(a):a}}}),hc=p({"node_modules/is-arguments/index.js"(e,t){var r=Hl()(),n=uc()("Object.prototype.toString"),i=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},a=function(e){return!!i(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"[object Function]"===n(e.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=o?i:a}}),pc=p({"node_modules/is-generator-function/index.js"(e,t){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Hl()(),s=Object.getPrototypeOf;t.exports=function(e){if("function"!==typeof e)return!1;if(a.test(i.call(e)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(e);if(!s)return!1;if("undefined"===typeof r){var t=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&s(t)}return s(e)===r}}}),dc=p({"node_modules/is-callable/index.js"(e,t){var r,n,i=Function.prototype.toString,a="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof a&&"function"===typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(f){f!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(e){try{var t=i.call(e);return s.test(t)}catch(r){return!1}},c=function(e){try{return!l(e)&&(i.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,h="function"===typeof Symbol&&!!Symbol.toStringTag,p=!(0 in[,]),d=function(){return!1};"object"===typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(d=function(e){if((p||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})),t.exports=a?function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{a(e,null,r)}catch(t){if(t!==n)return!1}return!l(e)&&c(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(h)return c(e);if(l(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&c(e)}}}),fc=p({"node_modules/for-each/index.js"(e,t){var r=dc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(e,t,a){if(!r(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(e)?function(e,t,r){for(var n=0,a=e.length;n-1?t:"Object"===t&&function(e){var t=!1;return r(f,(function(r,n){if(!t)try{r(e),t=h(n,1)}catch(i){}})),t}(e)}return o?function(e){var t=!1;return r(f,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(i){}})),t}(e):null}}}),yc=p({"node_modules/is-typed-array/index.js"(e,t){var r=fc(),n=mc(),i=uc(),a=i("Object.prototype.toString"),o=Hl()(),s=ac(),l="undefined"===typeof globalThis?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!s&&function(e){var t=!1;return r(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}}}),vc=p({"node_modules/util/support/types.js"(e){var t=hc(),r=pc(),n=gc(),i=yc();function a(e){return e.call.bind(e)}var o,s,l="undefined"!==typeof BigInt,c="undefined"!==typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),p=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);function f(e,t){if("object"!==typeof e)return!1;try{return t(e),!0}catch(r){return!1}}function m(e){return"[object Map]"===u(e)}function g(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function v(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function b(e){return"undefined"!==typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===u(e)}function w(e){return"undefined"!==typeof DataView&&(_.working?_(e):e instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=i,e.isPromise=function(e){return"undefined"!==typeof Promise&&e instanceof Promise||null!==e&&"object"===typeof e&&"function"===typeof e.then&&"function"===typeof e.catch},e.isArrayBufferView=function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||w(e)},e.isUint8Array=function(e){return"Uint8Array"===n(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===n(e)},e.isUint16Array=function(e){return"Uint16Array"===n(e)},e.isUint32Array=function(e){return"Uint32Array"===n(e)},e.isInt8Array=function(e){return"Int8Array"===n(e)},e.isInt16Array=function(e){return"Int16Array"===n(e)},e.isInt32Array=function(e){return"Int32Array"===n(e)},e.isFloat32Array=function(e){return"Float32Array"===n(e)},e.isFloat64Array=function(e){return"Float64Array"===n(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===n(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===n(e)},m.working="undefined"!==typeof Map&&m(new Map),e.isMap=function(e){return"undefined"!==typeof Map&&(m.working?m(e):e instanceof Map)},g.working="undefined"!==typeof Set&&g(new Set),e.isSet=function(e){return"undefined"!==typeof Set&&(g.working?g(e):e instanceof Set)},y.working="undefined"!==typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(e){return"undefined"!==typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},v.working="undefined"!==typeof WeakSet&&v(new WeakSet),e.isWeakSet=function(e){return v(e)},x.working="undefined"!==typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=b,_.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=w;var k="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(e){return"[object SharedArrayBuffer]"===u(e)}function S(e){return"undefined"!==typeof k&&("undefined"===typeof T.working&&(T.working=T(new k)),T.working?T(e):e instanceof k)}function A(e){return f(e,h)}function M(e){return f(e,p)}function E(e){return f(e,d)}function C(e){return l&&f(e,o)}function P(e){return c&&f(e,s)}e.isSharedArrayBuffer=S,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.isNumberObject=A,e.isStringObject=M,e.isBooleanObject=E,e.isBigIntObject=C,e.isSymbolObject=P,e.isBoxedPrimitive=function(e){return A(e)||M(e)||E(e)||C(e)||P(e)},e.isAnyArrayBuffer=function(e){return"undefined"!==typeof Uint8Array&&(b(e)||S(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))}}),xc=p({"node_modules/util/support/isBufferBrowser.js"(e,t){t.exports=function(e){return e&&"object"===typeof e&&"function"===typeof e.copy&&"function"===typeof e.fill&&"function"===typeof e.readUInt8}}}),bc=p({"(disabled):node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return e}})),l=i[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,t,n.depth)}function s(e,t){var r=o.styles[t];return r?"\x1b["+o.colors[r][0]+"m"+e+"\x1b["+o.colors[r][1]+"m":e}function l(e,t){return e}function c(t,r,n){if(t.customInspect&&r&&w(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=c(t,i,n)),i}var a=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return u(r)}var x,k="",T=!1,S=["{","}"];return p(r)&&(T=!0,S=["[","]"]),w(r)&&(k=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(k=" "+RegExp.prototype.toString.call(r)),b(r)&&(k=" "+Date.prototype.toUTCString.call(r)),_(r)&&(k=" "+u(r)),0!==o.length||T&&0!=r.length?n<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),x=T?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(x,k,S)):S[0]+k+S[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=f(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"===typeof e}function f(e){return null===e}function m(e){return"number"===typeof e}function g(e){return"string"===typeof e}function y(e){return void 0===e}function v(e){return x(e)&&"[object RegExp]"===k(e)}function x(e){return"object"===typeof e&&null!==e}function b(e){return x(e)&&"[object Date]"===k(e)}function _(e){return x(e)&&("[object Error]"===k(e)||e instanceof Error)}function w(e){return"function"===typeof e}function k(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var r=process.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=vc(),e.isArray=p,e.isBoolean=d,e.isNull=f,e.isNullOrUndefined=function(e){return null==e},e.isNumber=m,e.isString=g,e.isSymbol=function(e){return"symbol"===typeof e},e.isUndefined=y,e.isRegExp=v,e.types.isRegExp=v,e.isObject=x,e.isDate=b,e.types.isDate=b,e.isError=_,e.types.isNativeError=_,e.isFunction=w,e.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},e.isBuffer=xc();var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){console.log("%s - %s",function(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}(),e.format.apply(e,arguments))},e.inherits=Fl(),e._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var M="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(M&&e[M]){var r;if("function"!==typeof(r=e[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return o(this,function(e){for(var t=1;t2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(n," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r}}),Tc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(e,t){var r=kc().codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}}}),Sc=p({"node_modules/util-deprecate/browser.js"(e,t){function r(e){try{if(!window.localStorage)return!1}catch(r){return!1}var t=window.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}}),Ac=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(e,t){function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var n;t.exports=k,k.WritableState=w;var i,a={deprecate:Sc()},o=Bl(),s=Vl().Buffer,l=window.Uint8Array||function(){},c=wc(),u=Tc().getHighWaterMark,h=kc().codes,p=h.ERR_INVALID_ARG_TYPE,d=h.ERR_METHOD_NOT_IMPLEMENTED,f=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,b=c.errorOrDestroy;function _(){}function w(e,t,i){n=n||Mc(),e=e||{},"boolean"!==typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=u(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!==typeof i)throw new f;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,b(e,n)):(i(n),e._writableState.errorEmitted=!0,b(e,n),C(e,t))}(e,r,n,t,i);else{var a=M(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||A(e,r),n?process.nextTick(S,e,r,a,i):S(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(e){var t=this instanceof(n=n||Mc());if(!t&&!i.call(k,this))return new k(e);this._writableState=new w(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),o.call(this)}function T(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function S(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function A(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,T(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(T(e,t,!1,t.objectMode?1:c.length,c,u,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function M(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)}))}function C(e,t){var r=M(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(E,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}Fl()(k,o),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===k&&e&&e._writableState instanceof w}})):i=function(e){return e instanceof this},k.prototype.pipe=function(){b(this,new m)},k.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,o=!i.objectMode&&(n=e,s.isBuffer(n)||n instanceof l);return o&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"===typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!==typeof r&&(r=_),i.ending?function(e,t){var r=new v;b(e,r),process.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var i;return null===r?i=new y:"string"===typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(b(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=s.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=t.objectMode?1:n.length;t.length+=l;var c=t.length-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new d("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=c.destroy,k.prototype._undestroy=c.undestroy,k.prototype._destroy=function(e,t){t(e)}}}),Mc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(e,t){var r=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var n,i,a,o=zc(),s=Ac();for(Fl()(l,o),n=r(s.prototype),a=0;a>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(e.lastNeed=a-1),a):--n=0?(a>0&&(e.lastNeed=a-2),a):--n=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}}),Pc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(e,t){var r=kc().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function e(t,i,a){if("function"===typeof i)return e(t,null,i);i||(i={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if("string"===typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),i)c.endEmitted?b(e,new x):S(e,c,t,!0);else if(c.ended)b(e,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?S(e,c,t,!1):P(e,c)):S(e,c,t,!1)}else i||(c.reading=!1,P(e,c));return!c.ended&&(c.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;n("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(n("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,R(e)}function P(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){n("readable nexttick read 0"),e.read(0)}function O(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;n("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(F,t,e))}function F(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):E(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&j(this),null;var i,a=t.needReadable;return n("need readable",a),(0===t.length||t.length-e0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(e){b(this,new v("_read()"))},k.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,t);var o=t&&!1===t.end||e===process.stdout||e===process.stderr?m:l;function s(t,i){n("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,n("cleanup"),e.removeListener("close",d),e.removeListener("finish",f),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),u=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){n("onend"),e.end()}a.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,R(e))}}(r);e.on("drain",c);var u=!1;function h(t){n("ondata");var i=e.write(t);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==B(a.pipes,e))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function p(t){n("onerror",t),m(),e.removeListener("error",p),0===i(e,"error")&&b(e,t)}function d(){e.removeListener("finish",f),m()}function f(){n("onfinish"),e.removeListener("close",d),m()}function m(){n("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",d),e.once("finish",f),e.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?E(this):i.reading||process.nextTick(z,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(I,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(I,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(O,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var a in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),(!r.objectMode||null!==a&&void 0!==a)&&(r.objectMode||a&&a.length)&&(t.push(a)||(i=!0,e.pause()))})),e)void 0===this[a]&&"function"===typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<_.length;o++)e.on(_[o],this.emit.bind(this,_[o]));return this._read=function(t){n("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"===typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=Lc()),u(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=D,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(k.from=function(e,t){return void 0===h&&(h=Ic()),h(k,e,t)})}}),Oc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"(e,t){t.exports=c;var r=kc().codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,s=Mc();function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length0,(function(e){c||(c=e),e&&h.forEach(s),i||(h.forEach(s),u(c))}))}));return t.reduce(l)}}}),jc=p({"node_modules/stream-browserify/index.js"(e,t){t.exports=n;var r=ht().EventEmitter;function n(){r.call(this)}Fl()(n,r),n.Readable=zc(),n.Writable=Ac(),n.Duplex=Mc(),n.Transform=Oc(),n.PassThrough=Rc(),n.finished=Pc(),n.pipeline=Dc(),n.Stream=n,n.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("error",c),e.on("error",c),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e}}}),Fc=p({"node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return e}})),l=i[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,t,n.depth)}function s(e,t){var r=o.styles[t];return r?"\x1b["+o.colors[r][0]+"m"+e+"\x1b["+o.colors[r][1]+"m":e}function l(e,t){return e}function c(t,r,n){if(t.customInspect&&r&&w(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=c(t,i,n)),i}var a=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return u(r)}var x,k="",T=!1,S=["{","}"];return p(r)&&(T=!0,S=["[","]"]),w(r)&&(k=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(k=" "+RegExp.prototype.toString.call(r)),b(r)&&(k=" "+Date.prototype.toUTCString.call(r)),_(r)&&(k=" "+u(r)),0!==o.length||T&&0!=r.length?n<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),x=T?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(x,k,S)):S[0]+k+S[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=f(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"===typeof e}function f(e){return null===e}function m(e){return"number"===typeof e}function g(e){return"string"===typeof e}function y(e){return void 0===e}function v(e){return x(e)&&"[object RegExp]"===k(e)}function x(e){return"object"===typeof e&&null!==e}function b(e){return x(e)&&"[object Date]"===k(e)}function _(e){return x(e)&&("[object Error]"===k(e)||e instanceof Error)}function w(e){return"function"===typeof e}function k(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var r=process.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=vc(),e.isArray=p,e.isBoolean=d,e.isNull=f,e.isNullOrUndefined=function(e){return null==e},e.isNumber=m,e.isString=g,e.isSymbol=function(e){return"symbol"===typeof e},e.isUndefined=y,e.isRegExp=v,e.types.isRegExp=v,e.isObject=x,e.isDate=b,e.types.isDate=b,e.isError=_,e.types.isNativeError=_,e.isFunction=w,e.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},e.isBuffer=xc();var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){console.log("%s - %s",function(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}(),e.format.apply(e,arguments))},e.inherits=Fl(),e._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var M="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(M&&e[M]){var r;if("function"!==typeof(r=e[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}h("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),h("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,a,o,s;if(void 0===l&&(l=ru()),l("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(p(t,"type"));else{var c=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(p(t,"type"))}return s+=". Received type ".concat(r(n))}),TypeError),h("ERR_INVALID_ARG_VALUE",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=Fc());var n=c.inspect(t);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),h("ERR_INVALID_RETURN_VALUE",(function(e,t,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),h("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),r=0;r0,"At least one arg needs to be specified");var n="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:n+="".concat(t[0]," argument");break;case 2:n+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:n+=t.slice(0,i-1).join(", "),n+=", and ".concat(t[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),t.exports.codes=u}}),Nc=p({"node_modules/assert/build/internal/assert/assertion_error.js"(e,t){function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;te.length)&&(r=e.length),e.substring(r-t.length,r)===t}var y="",v="",x="",b="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function T(e,t,r){var n="",i="",a=0,o="",s=!1,l=k(e),c=l.split("\n"),u=k(t).split("\n"),h=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var f=c[0].length+u[0].length;if(f<=10){if(("object"!==d(e)||null===e)&&("object"!==d(t)||null===t)&&(0!==e||0!==t))return"".concat(_[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&f<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][h]===u[0][h];)h++;h>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var m=c[c.length-1],w=u[u.length-1];m===w&&(h++<2?o="\n ".concat(m).concat(o):n=m,c.pop(),u.pop(),0!==c.length&&0!==u.length);)m=c[c.length-1],w=u[u.length-1];var T=Math.max(c.length,u.length);if(0===T){var S=l.split("\n");if(S.length>30)for(S[26]="".concat(y,"...").concat(b);S.length>27;)S.pop();return"".concat(_.notIdentical,"\n\n").concat(S.join("\n"),"\n")}h>3&&(o="\n".concat(y,"...").concat(b).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var A=0,M=_[r]+"\n".concat(v,"+ actual").concat(b," ").concat(x,"- expected").concat(b),E=" ".concat(y,"...").concat(b," Lines skipped");for(h=0;h1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(u[h-2]),A++),i+="\n ".concat(u[h-1]),A++),a=h,n+="\n".concat(x,"-").concat(b," ").concat(u[h]),A++;else if(u.length1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(c[h-2]),A++),i+="\n ".concat(c[h-1]),A++),a=h,i+="\n".concat(v,"+").concat(b," ").concat(c[h]),A++;else{var P=u[h],L=c[h],I=L!==P&&(!g(L,",")||L.slice(0,-1)!==P);I&&g(P,",")&&P.slice(0,-1)===L&&(I=!1,L+=","),I?(C>1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(c[h-2]),A++),i+="\n ".concat(c[h-1]),A++),a=h,i+="\n".concat(v,"+").concat(b," ").concat(L),n+="\n".concat(x,"-").concat(b," ").concat(P),A+=2):(i+=n,n="",1!==C&&0!==h||(i+="\n ".concat(L),A++))}if(A>20&&h30)for(p[26]="".concat(y,"...").concat(b);p.length>27;)p.pop();t=1===p.length?c.call(this,"".concat(h," ").concat(p[0])):c.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var f=k(a),S="",A=_[n];"notDeepEqual"===n||"notEqual"===n?(f="".concat(_[n],"\n\n").concat(f)).length>1024&&(f="".concat(f.slice(0,1021),"...")):(S="".concat(k(l)),f.length>512&&(f="".concat(f.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===n||"equal"===n?f="".concat(A,"\n\n").concat(f,"\n\nshould equal\n\n"):S=" ".concat(n," ").concat(S)),t=c.call(this,"".concat(f).concat(S))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(s(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=l,t.operator=n,Error.captureStackTrace&&Error.captureStackTrace(s(t),i),t.stack,t.name="AssertionError",o(t)}return r=g,(a=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return f(this,n(n({},t),{},{customInspect:!1,depth:0}))}}])&&i(r.prototype,a),l&&i(r,l),Object.defineProperty(r,"prototype",{writable:!1}),g}(l(Error),f.custom);t.exports=S}}),Uc=p({"node_modules/object-keys/isArguments.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}}}),Vc=p({"node_modules/object-keys/implementation.js"(e,t){var r,n,i,a,o,s,l,c,u,h,p,d;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Uc(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(e){var t=e.constructor;return t&&t.prototype===e},h={$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},p=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{u(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(e){if("undefined"===typeof window||!p)return u(e);try{return u(e)}catch(t){return!1}},r=function(e){var t=null!==e&&"object"===typeof e,r="[object Function]"===i.call(e),o=a(e),u=t&&"[object String]"===i.call(e),h=[];if(!t&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(u&&e.length>0&&!n.call(e,0))for(var f=0;f0)for(var m=0;m2?arguments[2]:{},o=r(t);n&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r10)return!0;for(var t=0;t57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function I(e){return Object.keys(e).filter(L).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function z(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&!1===isNaN(e))return t.long?s(l=e,a,"day")||s(l,i,"hour")||s(l,n,"minute")||s(l,r,"second")||l+" ms":function(e){return e>=a?Math.round(e/a)+"d":e>=i?Math.round(e/i)+"h":e>=n?Math.round(e/n)+"m":e>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}),iu=p({"node_modules/stream-parser/node_modules/debug/src/debug.js"(e,t){var r;function n(t){function n(){if(n.enabled){var t=n,i=+new Date,a=i-(r||i);t.diff=a,t.prev=r,t.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(r())}}),ou=p({"node_modules/stream-parser/index.js"(e,t){var r=ru(),n=au()("stream-parser");function i(e){n("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function a(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),n("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),n("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),n("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function l(e,t,r){this._parserInit||i(this),n("write(%o bytes)",e.length),"function"==typeof t&&(r=t),h(this,e,null,r)}function c(e,t,r){this._parserInit||i(this),n("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),h(this,e,t,r)}function u(e,t,r,i){if(e._parserBytesLeft-=t.length,n("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var a=e._parserCallback;if(a&&0===e._parserState&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),a){var o=[];t&&o.push(t),r&&o.push(r);var s=a.length>o.length;s&&o.push(p(i));var l=a.apply(e,o);if(!s||i===l)return i}}t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),e._bytes=a,e._skipBytes=o,t&&(e._passthrough=s),t?e._transform=c:e._write=l};var h=p((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return u(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return u(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function p(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}}),su=p({"node_modules/probe-image-size/lib/common.js"(e){var t=jc().Transform,r=ou();function n(){t.call(this,{readableObjectMode:!0})}function i(e,t,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=e,t&&(this.code=t),r&&(this.statusCode=r)}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,r(n.prototype),e.ParserStream=n,e.sliceEq=function(e,t,r){for(var n=t,i=0;i>4&15,i=15&e[4],a=e[5]>>4&15,s=r(e,6),l=8,c=0;ct.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},i.prototype.scan_ifd=function(e,t,i){var a=this.read_uint16(t);t+=2;for(var o=0;othis.input.length)throw r("unexpected EOF","EBADDATA");for(var f=[],m=p,g=0;g0&&(this.ifds_to_read.push({id:s,offset:f[0]}),d=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:c,entry_offset:t+this.start,data_length:h,data_offset:p+this.start,value:f,is_subifd_link:d}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(r){return-1}}}}),uu=p({"node_modules/probe-image-size/lib/parse_sync/avif.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=lu(),o=cu(),s=r("ftyp");t.exports=function(e){if(n(e,4,s)){var t=a.unbox(e,0);if(t){var r=a.getMimeType(t.data);if(r){for(var l,c=t.end;;){var u=a.unbox(e,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var p={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(p.variants=h.variants),h.orientation&&(p.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=e.length){var d=i(e,h.exif_location.offset),f=e.slice(h.exif_location.offset+d+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(f);m>0&&(p.orientation=m)}return p}}}}}}}}),hu=p({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("BM");t.exports=function(e){if(!(e.length<26)&&n(e,0,a))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),pu=p({"node_modules/probe-image-size/lib/parse_sync/gif.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");t.exports=function(e){if(!(e.length<10)&&(n(e,0,a)||n(e,0,o)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),du=p({"node_modules/probe-image-size/lib/parse_sync/ico.js"(e,t){var r=su().readUInt16LE;t.exports=function(e){var t=r(e,0),n=r(e,2),i=r(e,4);if(0===t&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;so.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),fu=p({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(e,t){var r=su().readUInt16BE,n=su().str2arr,i=su().sliceEq,a=cu(),o=n("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var n,s,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)n=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;n=r(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&n>=10&&i(e,t,o)&&(s=a.get_orientation(e.slice(t+6,t+n))),n>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t0&&(c.orientation=s),c}t+=n}}}}),mu=p({"node_modules/probe-image-size/lib/parse_sync/png.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("\x89PNG\r\n\x1a\n"),o=r("IHDR");t.exports=function(e){if(!(e.length<24)&&n(e,0,a)&&n(e,12,o))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gu=p({"node_modules/probe-image-size/lib/parse_sync/psd.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&n(e,0,a))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),yu=p({"node_modules/probe-image-size/lib/parse_sync/svg.js"(e,t){function r(e){return"number"===typeof e&&isFinite(e)&&e>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(e){return l.test(e)?e.match(l)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<e.length)){for(;t+8=10?r=r||c(e,t+8):"VP8L"===d&&f>=9?r=r||u(e,t+8):"VP8X"===d&&f>=10?r=r||h(e,t+8):"EXIF"===d&&(i=o.get_orientation(e.slice(t+8,t+8+f)),t=1/0),t+=8+f}else t++;if(r)return i>0&&(r.orientation=i),r}}}}}),bu=p({"node_modules/probe-image-size/lib/parsers_sync.js"(e,t){t.exports={avif:uu(),bmp:hu(),gif:pu(),ico:du(),jpeg:fu(),png:mu(),psd:gu(),svg:yu(),tiff:vu(),webp:xu()}}}),_u=p({"node_modules/probe-image-size/sync.js"(e,t){var r=bu();t.exports=function(e){return function(e){for(var t=Object.keys(r),n=0;n0;)g=h.c2p(w+b*A),b--;for(b=0;void 0===v&&b0;)x=p.c2p(k+b*M),b--;gz[0];if(O||R){var D=m+E/2,j=v+C/2;L+="transform:"+i(D+"px",j+"px")+"scale("+(O?-1:1)+","+(R?-1:1)+")"+i(-D+"px",-j+"px")+";"}}P.attr("style",L);var F=new Promise((function(e){if(u._hasZ)e();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===T&&u._canvas.el.height===S&&u._canvas.source===u.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=S;var r=t.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:t,source:u.source},e()},n.setAttribute("src",u.source)}})).then((function(){var e;if(u._hasZ)e=B((function(e,t){var r=_[t][e];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(f)e=u.source;else{var t=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,S).data;e=B((function(e,r){var n=4*(r*T+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}P.attr({"xlink:href":e,height:C,width:E,x:m,y:v})}));e._promises.push(F)}function B(e){var t=document.createElement("canvas");t.width=E,t.height=C;var r,i=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return n.constrain(Math.round(h.c2p(w+e*A)-m),0,E)},s=function(e){return n.constrain(Math.round(p.c2p(k+e*M)-v),0,C)},l=o.colormodel[u.colormodel],d=l.colormodel||u.colormodel,f=l.fmt;for(b=0;b0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,p=Math.floor((t-s.x0)/l.dx),d=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[d][p]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(p,d,1,1).data),h){var f,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(f=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,b=x.length,_=l._scaler(h),w=v.suffix,k=[];(l.hovertemplate||f)&&(k.push("["+[_[0]+w[0],_[1]+w[1],_[2]+w[2]].join(", ")),4===b&&k.push(", "+_[3]+w[3]),k.push("]"),k=k.join(""),e.extraText=x.toUpperCase()+": "+k),i(l.hovertext)&&i(l.hovertext[d])?y=l.hovertext[d][p]:i(l.text)&&i(l.text[d])&&(y=l.text[d][p]);var T=u.c2p(s.y0+(d+.5)*l.dy),S=s.x0+(p+.5)*l.dx,A=s.y0+(d+.5)*l.dy,M="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(e,{index:[d,p],x0:c.c2p(s.x0+p*l.dx),x1:c.c2p(s.x0+(p+1)*l.dx),y0:T,y1:T,color:_,xVal:S,xLabelVal:S,yVal:A,yLabelVal:A,zLabelVal:M,text:y,hovertemplateLabels:{zLabel:M,colorLabel:k,"color[0]Label":_[0]+w[0],"color[1]Label":_[1]+w[1],"color[2]Label":_[2]+w[2],"color[3]Label":_[3]+w[3]}})]}}}}}),Mu=p({"src/traces/image/event_data.js"(e,t){t.exports=function(e,t){return"xVal"in t&&(e.x=t.xVal),"yVal"in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e.color=t.color,e.colormodel=t.trace.colormodel,e.z||(e.z=t.color),e}}}),Eu=p({"src/traces/image/index.js"(e,t){t.exports={attributes:Dl(),supplyDefaults:jl(),calc:ku(),plot:Tu(),style:Su(),hoverPoints:Au(),eventData:Mu(),moduleType:"trace",name:"image",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Cu=p({"lib/image.js"(e,t){t.exports=Eu()}}),Pu=p({"src/traces/pie/attributes.js"(e,t){var r=N(),n=ka().attributes,i=D(),a=V(),o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=R().extendFlat,c=Ie().pattern,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.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:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({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"}}}}),Lu=p({"src/traces/pie/defaults.js"(e,t){var r=k(),n=st(),i=Pu(),a=ka().defaults,o=$a().handleText,s=st().coercePattern;function l(e,t){var i=n.isArrayOrTypedArray(e),a=n.isArrayOrTypedArray(t),o=Math.min(i?e.length:1/0,a?t.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}t.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,s){function u(r,a){return n.coerce(e,t,i,r,a)}var h=l(u("labels"),u("values")),p=h.len;if(t._hasLabels=h.hasLabels,t._hasValues=h.hasValues,!t._hasLabels&&t._hasValues&&(u("label0"),u("dlabel")),p){t._length=p,c(e,t,s,u,!0),u("scalegroup");var d,f=u("text"),m=u("texttemplate");if(m||(d=u("textinfo",n.isArrayOrTypedArray(f)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||d&&"none"!==d){var g=u("textposition");o(e,t,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===d&&u("textposition","none");a(t,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");y||"middle center"!==v||(t.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else t.visible=!1}}}}),Iu=p({"src/traces/pie/layout_attributes.js"(e,t){t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),zu=p({"src/traces/pie/layout_defaults.js"(e,t){var r=st(),n=Iu();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("hiddenlabels"),i("piecolorway",t.colorway),i("extendpiecolors")}}}),Ou=p({"src/traces/pie/calc.js"(e,t){var r=k(),n=O(),i=q(),a={};function o(e){return function(t,r){return!!t&&!!(t=n(t)).isValid()&&(t=i.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function s(e,t){var r,i=JSON.stringify(e),a=t[i];if(!a){for(a=e.slice(),r=0;r=0})),("funnelarea"===t.type?y:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u"),name:h.hovertemplate||-1!==p.indexOf("name")?h.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(h.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,inOut_bbox:k}),e.bbox=k[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,h)],event:r.event})}})),e.on("mouseout",(function(e){var n=t._fullLayout,a=t._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(e.originalEvent=r.event,t.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var n=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===n.hovermode||(t._hoverdata=[g(e,a)],i.click(t,r.event))}))}function b(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var i=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,o=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,s=m.castOption(e.insidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,l=m.castOption(e.insidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,c=m.castOption(e.insidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,u=m.castOption(e.insidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,h=m.castOption(e.insidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,p=m.castOption(e.insidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n||a.contrast(t.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:p}}function _(e,t){for(var r,n,i=0;it&&t>n||r=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||d){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||f||h){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;m.push(a)}(f||d)&&((a=k(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a)),(f||p)&&((a=T(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_=1)break}return m[x]}function k(e,t,r,n,i){t=Math.max(0,t-2*f);var a=e.width/e.height,o=M(a,n,t,r);return{scale:2*o/e.height,rCenter:S(a,o/t),rotate:A(i)}}function T(e,t,r,n,i){t=Math.max(0,t-2*f);var a=e.height/e.width,o=M(a,n,t,r);return{scale:2*o/e.width,rCenter:S(a,o/t),rotate:A(i+Math.PI/2)}}function S(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function E(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function C(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function P(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l,c,u=(l=e.r,c=e.trace.aspectratio,l/(void 0===c?1:c)),h=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(h+=u,o.x-=(1+i)*u,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?h*=2:-1!==a.title.position.indexOf("right")&&(h+=u,o.x+=(1+i)*u,s.tx-=e.titleBox.width/2),r=h/e.titleBox.width,n=L(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function I(e){var t,r=e.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,t=0;tr&&(r=e.pull[t]);return r}function z(e,t){for(var r=[],n=0;n1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n")}if(o){var b=s.castOption(a,t.i,"texttemplate");if(b){var _={label:(n=t).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,t.pts);(y(w)||""===w)&&(_.text=w),t.text=s.texttemplateString(b,_,e._fullLayout._d3locale,_,a._meta||{})}else t.text=""}}function D(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var i=e._context.staticPlot,h=e._fullLayout,f=h._size;d("pie",h),_(t,e),z(t,f);var g=s.makeTraceGroups(h._pielayer,t,"trace").each((function(t){var d=r.select(this),g=t[0],y=g.trace;!function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;ti.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(t),d.attr("stroke-linejoin","round"),d.each((function(){var v=r.select(this).selectAll("g.slice").data(t);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],k=!1;v.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,_[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,d=r.select(this),f=d.selectAll("path.surface").data([n]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),d.call(x,e,t),y.pull){var v=+m.castOption(y.pull,n.pts)||0;v>0&&(l+=v*n.pxmid[0],c+=v*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var T=y.hole;if(n.v===g.vTotal){var S="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";T?f.attr("d","M"+(l+T*n.px0[0])+","+(c+T*n.px0[1])+L(n.px0,n.pxmid,!1,T)+L(n.pxmid,n.px0,!1,T)+"Z"+S):f.attr("d",S)}else{var A=L(n.px0,n.px1,!0,1);if(T){var M=1-T;f.attr("d","M"+(l+T*n.px1[0])+","+(c+T*n.px1[1])+L(n.px1,n.px0,!1,T)+"l"+M*n.px0[0]+","+M*n.px0[1]+A+"Z")}else f.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+A+"Z")}R(e,n,g);var E=m.castOption(y.textposition,n.pts),P=d.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===E?function(e,t,r){var n=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,i=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,a=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,o=m.castOption(e.outsidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,s=m.castOption(e.outsidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,l=m.castOption(e.outsidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,c=m.castOption(e.outsidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,u=m.castOption(e.outsidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,h=m.castOption(e.outsidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:c,lineposition:u,shadow:h}}(y,n,h.font):b(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,d).call(u.convertToTspans,e);var f,v=o.bBox(i.node());if("outside"===E)f=C(v,n);else if(f=w(v,n,g),"auto"===E&&f.scale<1){var x=s.ensureUniformFontSize(e,y.outsidetextfont);i.call(o.font,x),f=C(v=o.bBox(i.node()),n)}var _=f.textPosAngle,T=void 0===_?n.pxmid:O(g.r,_);if(f.targetX=l+T[0]*f.rCenter+(f.x||0),f.targetY=c+T[1]*f.rCenter+(f.y||0),D(f,v),f.outside){var S=f.targetY;n.yLabelMin=S-v.height/2,n.yLabelMid=S,n.yLabelMax=S+v.height/2,n.labelExtraX=0,n.labelExtraY=0,k=!0}f.fontSize=d.size,p(y.type,f,h),t[a].transform=f,s.setTransormAndDisplay(i,f)}))}function L(e,t,r,i){var a=i*(t[0]-e[0]),o=i*(t[1]-e[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,n=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,e),t="middle center"===y.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(g):P(g,f),n.attr("transform",c(t.x,t.y)+l(Math.min(1,t.scale))+c(t.tx,t.ty))})),k&&function(e,t){var r,n,i,a,o,l,c,u,h,p,d,f,g;function y(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function x(e,r){r||(r={});var i,u,h,d,f=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,y=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),x=f-g;if(x*c>0&&(e.labelExtraY=x),s.isArrayOrTypedArray(t.pull))for(u=0;u=(m.castOption(t.pull,h.pts)||0)||((e.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-e.labelExtraY)*c>0&&(e.labelExtraY+=x):(y+e.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-p.indexOf(e)),(d=h.cxFinal+a(h.px0[0],h.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=e[n][r]).sort(i),h=e[1-n][r],p=h.concat(u),f=[],d=0;dMath.abs(h)?l+="l"+h*e.pxmid[0]/e.pxmid[1]+","+h+"H"+(o+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(v,y),k&&y.automargin){var S=o.bBox(d.node()),A=y.domain,M=f.w*(A.x[1]-A.x[0]),E=f.h*(A.y[1]-A.y[0]),L=(.5*M-g.r)/f.w,I=(.5*E-g.r)/f.h;n.autoMargin(e,"pie."+y.uid+".automargin",{xl:A.x[0]-L,xr:A.x[1]+L,yb:A.y[0]-I,yt:A.y[1]+I,l:Math.max(g.cx-g.r-S.left,0),r:Math.max(S.right-(g.cx+g.r),0),b:Math.max(S.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-S.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var e=r.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:R,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:P,prerenderTitles:_,layoutAreas:z,attachFxHandlers:x,computeTransform:D}}}),ju=p({"src/traces/pie/style.js"(e,t){var r=v(),n=wr(),i=Ka().resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(t){var i=t[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(t){r.select(this).call(n,t,i,e)}))}))}}}),Fu=p({"src/traces/pie/base_plot.js"(e){var t=kt();e.name="pie",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Bu=p({"src/traces/pie/index.js"(e,t){t.exports={attributes:Pu(),supplyDefaults:Lu().supplyDefaults,supplyLayoutDefaults:zu(),layoutAttributes:Iu(),calc:Ou().calc,crossTraceCalc:Ou().crossTraceCalc,plot:Du().plot,style:ju(),styleOne:wr(),moduleType:"trace",name:"pie",basePlotModule:Fu(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Nu=p({"lib/pie.js"(e,t){t.exports=Bu()}}),Uu=p({"src/traces/sunburst/base_plot.js"(e){var t=kt();e.name="sunburst",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Vu=p({"src/traces/sunburst/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),qu=p({"src/traces/sunburst/attributes.js"(e,t){var r=N(),n=Oe().hovertemplateAttrs,i=Oe().texttemplateAttrs,a=Lt(),o=ka().attributes,s=Pu(),l=Vu(),c=R().extendFlat,u=Ie().pattern;t.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:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}}),Hu=p({"src/traces/sunburst/layout_attributes.js"(e,t){t.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Gu=p({"src/traces/sunburst/defaults.js"(e,t){var r=st(),n=qu(),i=ka().defaults,a=$a().handleText,o=Lu().handleMarkerDefaults,s=Wt(),l=s.hasColorscale,c=s.handleDefaults;t.exports=function(e,t,s,u){function h(i,a){return r.coerce(e,t,n,i,a)}var p=h("labels"),d=h("parents");if(p&&p.length&&d&&d.length){var f=h("values");f&&f.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(e,t,u,h);var m=t._hasColorscale=l(e,"marker","colors")||(e.marker||{}).coloraxis;m&&c(e,t,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),t.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(e,t,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(t,u,h),t._length=null}else t.visible=!1}}}),Wu=p({"src/traces/sunburst/layout_defaults.js"(e,t){var r=st(),n=Hu();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("sunburstcolorway",t.colorway),i("extendsunburstcolors")}}}),$u=p({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(e,t){var r,n;r=e,n=function(e){function t(e,t){return e.parent===t.parent?1:2}function r(e,t){return e+t.x}function n(e,t){return Math.max(e,t.y)}function i(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function a(e,t){var r,n,i,a,s,u=new c(e),h=+e.value&&(u.value=e.value),p=[u];for(null==t&&(t=o);r=p.pop();)if(h&&(r.value=+r.data.value),(i=t(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)p.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(e){return e.children}function s(e){e.data=e.data.data}function l(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function c(e){this.data=e,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(u.call(e))).length,a=[];n0&&r*r>n*n+i*i}function m(e,t){for(var r=0;r(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function b(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function _(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function w(e){this._=e,this.next=null,this.previous=null}function k(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,c,u,p;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;x(r,t,n=e[2]),t=new w(t),r=new w(r),n=new w(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;sp&&(p=s),g=u*u*m,(d=Math.max(p/g,g/h))>f){u-=s;break}f=d}y.push(o={value:u,dice:l1?t:1)},r}(H),$=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,c,u,h=-1,p=o.length,d=e.value;++h1?t:1)},r}(H);e.cluster=function(){var e=t,i=1,a=1,o=!1;function s(t){var s,l=0;t.eachAfter((function(t){var i=t.children;i?(t.x=function(e){return e.reduce(r,0)/e.length}(i),t.y=function(e){return 1+e.reduce(n,0)}(i)):(t.x=s?l+=e(t,s):0,t.y=0,s=t)}));var c=function(e){for(var t;t=e.children;)e=t[0];return e}(t),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),h=c.x-e(c,u)/2,p=u.x+e(u,c)/2;return t.eachAfter(o?function(e){e.x=(e.x-t.x)*i,e.y=(t.y-e.y)*a}:function(e){e.x=(e.x-h)/(p-h)*i,e.y=(1-(t.y?e.y/t.y:1))*a})}return s.separation=function(t){return arguments.length?(e=t,s):e},s.size=function(e){return arguments.length?(o=!1,i=+e[0],a=+e[1],s):o?null:[i,a]},s.nodeSize=function(e){return arguments.length?(o=!0,i=+e[0],a=+e[1],s):o?[i,a]:null},s},e.hierarchy=a,e.pack=function(){var e=null,t=1,r=1,n=S;function i(i){return i.x=t/2,i.y=r/2,e?i.eachBefore(E(e)).eachAfter(C(n,.5)).eachBefore(P(1)):i.eachBefore(E(M)).eachAfter(C(S,1)).eachAfter(C(n,i.r/Math.min(t,r))).eachBefore(P(Math.min(t,r)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=null==(r=t)?null:T(r),i):e;var r},i.size=function(e){return arguments.length?(t=+e[0],r=+e[1],i):[t,r]},i.padding=function(e){return arguments.length?(n="function"===typeof e?e:A(+e),i):n},i},e.packEnclose=h,e.packSiblings=function(e){return k(e),e},e.partition=function(){var e=1,t=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=e,i.y1=t/a,i.eachBefore(function(e,t){return function(n){n.children&&I(n,n.x0,e*(n.depth+1)/t,n.x1,e*(n.depth+2)/t);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=T(t),r):e},r.parentId=function(e){return arguments.length?(t=T(e),r):t},r},e.tree=function(){var e=j,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new V(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new V(n[i],i)),r.parent=t;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(e){e.xu.x&&(u=e),e.depth>h.depth&&(h=e)}));var p=c===u?1:e(c,u)/2,d=p-c.x,f=t/(u.x+p+d),m=r/(h.depth||1);i.eachBefore((function(e){e.x=(e.x+d)*f,e.y=e.depth*m}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,p=l.m;s=B(s),a=F(a),s&&a;)l=F(l),(o=B(o)).a=t,(i=s.z+h-a.z-c+e(s._,a._))>0&&(N(U(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,p+=l.m,u+=o.m;s&&!B(o)&&(o.t=s,o.m+=h-u),a&&!F(l)&&(l.t=a,l.m+=c-p,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i},e.treemap=function(){var e=W,t=!1,r=1,n=1,i=[0],a=S,o=S,s=S,l=S,c=S;function u(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(h),i=[0],t&&e.eachBefore(L),e}function h(t){var r=i[t.depth],n=t.x0+r,u=t.y0+r,h=t.x1-r,p=t.y1-r;h=r-1){var u=s[t];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[t],p=n/2+h,d=t+1,f=r-1;d>>1;c[m]l-a){var v=(i*y+o*g)/n;e(t,d,g,i,a,v,l),e(d,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;e(t,d,g,i,a,o,x),e(d,r,y,i,x,o,l)}}(0,l,e.value,t,r,n,i)},e.treemapDice=I,e.treemapResquarify=$,e.treemapSlice=q,e.treemapSliceDice=function(e,t,r,n,i){(1&e.depth?q:I)(e,t,r,n,i)},e.treemapSquarify=W,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),Zu=p({"src/traces/sunburst/calc.js"(e){var t=$u(),r=k(),n=st(),i=Wt().makeColorScaleFuncFromTrace,a=Ou().makePullColorFn,o=Ou().generateExtendedColors,s=Wt().calc,l=T().ALMOST_EQUAL,c={},u={},h={};function p(e,t,r){var n=0,i=e.children;if(i){for(var a=i.length,o=0;o=0};v?(c=Math.min(y.length,b.length),u=function(e){return A(y[e])&&M(e)},h=function(e){return String(y[e])}):(c=Math.min(x.length,b.length),u=function(e){return A(x[e])&&M(e)},h=function(e){return String(x[e])}),w&&(c=Math.min(c,_.length));for(var E=0;E1){for(var I=n.randstr(),z=0;z>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?vh(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?vh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=nh.exec(e))?new _h(t[1],t[2],t[3],1):(t=ih.exec(e))?new _h(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ah.exec(e))?vh(t[1],t[2],t[3],t[4]):(t=oh.exec(e))?vh(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=sh.exec(e))?Eh(t[1],t[2]/100,t[3]/100,1):(t=lh.exec(e))?Eh(t[1],t[2]/100,t[3]/100,t[4]):ch.hasOwnProperty(e)?yh(ch[e]):"transparent"===e?new _h(NaN,NaN,NaN,0):null}function yh(e){return new _h(e>>16&255,e>>8&255,255&e,1)}function vh(e,t,r,n){return n<=0&&(e=t=r=NaN),new _h(e,t,r,n)}function xh(e){return e instanceof hh||(e=gh(e)),e?new _h((e=e.rgb()).r,e.g,e.b,e.opacity):new _h}function bh(e,t,r,n){return 1===arguments.length?xh(e):new _h(e,t,r,null==n?1:n)}function _h(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function wh(){return`#${Mh(this.r)}${Mh(this.g)}${Mh(this.b)}`}function kh(){return`#${Mh(this.r)}${Mh(this.g)}${Mh(this.b)}${Mh(255*(isNaN(this.opacity)?1:this.opacity))}`}function Th(){const e=Sh(this.opacity);return`${1===e?"rgb(":"rgba("}${Ah(this.r)}, ${Ah(this.g)}, ${Ah(this.b)}${1===e?")":`, ${e})`}`}function Sh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ah(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mh(e){return((e=Ah(e))<16?"0":"")+e.toString(16)}function Eh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Lh(e,t,r,n)}function Ch(e){if(e instanceof Lh)return new Lh(e.h,e.s,e.l,e.opacity);if(e instanceof hh||(e=gh(e)),!e)return new Lh;if(e instanceof Lh)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=t===a?(r-n)/s+6*(r0&&l<1?0:o,new Lh(o,s,l,e.opacity)}function Ph(e,t,r,n){return 1===arguments.length?Ch(e):new Lh(e,t,r,null==n?1:n)}function Lh(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Ih(e){return(e=(e||0)%360)<0?e+360:e}function zh(e){return Math.max(0,Math.min(1,e||0))}function Oh(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}var Rh,Dh,jh,Fh,Bh,Nh,Uh,Vh,qh,Hh=h({"node_modules/d3-color/src/color.js"(){uh(),Ju=1/(Ku=.7),Qu="\\s*([+-]?\\d+)\\s*",eh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,nh=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),ih=new RegExp(`^rgb\\(${th},${th},${th}\\)$`),ah=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${eh}\\)$`),oh=new RegExp(`^rgba\\(${th},${th},${th},${eh}\\)$`),sh=new RegExp(`^hsl\\(${eh},${th},${th}\\)$`),lh=new RegExp(`^hsla\\(${eh},${th},${th},${eh}\\)$`),ch={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},Xu(hh,gh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ph,formatHex:ph,formatHex8:dh,formatHsl:fh,formatRgb:mh,toString:mh}),Xu(_h,bh,Yu(hh,{brighter(e){return e=null==e?Ju:Math.pow(Ju,e),new _h(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ku:Math.pow(Ku,e),new _h(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _h(Ah(this.r),Ah(this.g),Ah(this.b),Sh(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:wh,formatHex:wh,formatHex8:kh,formatRgb:Th,toString:Th})),Xu(Lh,Ph,Yu(hh,{brighter(e){return e=null==e?Ju:Math.pow(Ju,e),new Lh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ku:Math.pow(Ku,e),new Lh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new _h(Oh(e>=240?e-240:e+120,i,n),Oh(e,i,n),Oh(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Lh(Ih(this.h),zh(this.s),zh(this.l),Sh(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 e=Sh(this.opacity);return`${1===e?"hsl(":"hsla("}${Ih(this.h)}, ${100*zh(this.s)}%, ${100*zh(this.l)}%${1===e?")":`, ${e})`}`}}))}}),Gh=h({"node_modules/d3-color/src/math.js"(){Rh=Math.PI/180,Dh=180/Math.PI}});function Wh(e){if(e instanceof Zh)return new Zh(e.l,e.a,e.b,e.opacity);if(e instanceof ep)return tp(e);e instanceof _h||(e=xh(e));var t,r,n=Jh(e.r),i=Jh(e.g),a=Jh(e.b),o=Xh((.2225045*n+.7168786*i+.0606169*a)/Fh);return n===i&&i===a?t=r=o:(t=Xh((.4360747*n+.3850649*i+.1430804*a)/jh),r=Xh((.0139322*n+.0971045*i+.7141733*a)/Bh)),new Zh(116*o-16,500*(t-o),200*(o-r),e.opacity)}function $h(e,t,r,n){return 1===arguments.length?Wh(e):new Zh(e,t,r,null==n?1:n)}function Zh(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function Xh(e){return e>qh?Math.pow(e,1/3):e/Vh+Nh}function Yh(e){return e>Uh?e*e*e:Vh*(e-Nh)}function Kh(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jh(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qh(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof ep)return new ep(e.h,e.c,e.l,e.opacity);if(e instanceof Zh||(e=Wh(e)),0===e.a&&0===e.b)return new ep(NaN,0=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n()=>e}});function wp(e,t){return function(r){return e+r*t}}function kp(e,t){var r=t-e;return r?wp(e,r>180||r<-180?r-360*Math.round(r/360):r):xp(isNaN(e)?t:e)}function Tp(e){return 1===(e=+e)?Sp:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):xp(isNaN(t)?r:t)}}function Sp(e,t){var r=t-e;return r?wp(e,r):xp(isNaN(e)?t:e)}var Ap,Mp,Ep,Cp=h({"node_modules/d3-interpolate/src/color.js"(){_p()}});function Pp(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;ra&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Np(r,n)})),a=Hp.lastIndex;return a180?t+=360:t-e>180&&(e+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:Np(e,t)})):t&&r.push(i(r)+"rotate("+t+n)}(a.rotate,o.rotate,s,l),function(e,t,r,a){e!==t?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:Np(e,t)}):t&&r.push(i(r)+"skewX("+t+n)}(a.skewX,o.skewX,s,l),function(e,t,r,n,a,o){if(e!==r||t!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Np(e,r)},{i:s-2,x:Np(t,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,r=-1,n=l.length;++rZp,interpolateArray:()=>Rp,interpolateBasis:()=>gp,interpolateBasisClosed:()=>vp,interpolateCubehelix:()=>Ad,interpolateCubehelixLong:()=>Md,interpolateDate:()=>Fp,interpolateDiscrete:()=>Yp,interpolateHcl:()=>wd,interpolateHclLong:()=>kd,interpolateHsl:()=>gd,interpolateHslLong:()=>yd,interpolateHue:()=>Jp,interpolateLab:()=>_d,interpolateNumber:()=>Np,interpolateNumberArray:()=>Ip,interpolateObject:()=>Vp,interpolateRgb:()=>Ap,interpolateRgbBasis:()=>Mp,interpolateRgbBasisClosed:()=>Ep,interpolateRound:()=>ed,interpolateString:()=>Wp,interpolateTransformCss:()=>cd,interpolateTransformSvg:()=>ud,interpolateZoom:()=>dd,piecewise:()=>Ld,quantize:()=>zd});var Dd,jd,Fd,Bd=h({"node_modules/d3-interpolate/src/index.js"(){Xp(),jp(),yp(),bp(),Bp(),Kp(),Qp(),Up(),Op(),Gp(),nd(),$p(),fd(),vd(),Lp(),bd(),Td(),Ed(),Pd(),Id(),Od()}}),Nd=p({"src/traces/sunburst/fill_one.js"(e,t){var r=Jt(),n=q();t.exports=function(e,t,i,a,o){var s=t.data.data,l=s.i,c=o||s.color;if(l>=0){t.i=s.i;var u=i.marker;u.pattern&&u.colors&&u.pattern.shape||(u.color=c,t.color=c),r.pointStyle(e,i,a,t)}else n.fill(e,c)}}}),Ud=p({"src/traces/sunburst/style.js"(e,t){var r=v(),n=q(),i=st(),a=Ka().resizeText,o=Nd();function s(e,t,r,a){var s=t.data.data,l=!t.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");a(e,t,"sunburst"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(s,t,i,e)}))}))},styleOne:s}}}),Vd=p({"src/traces/sunburst/helpers.js"(e){var t=st(),r=q(),n=pr(),i=br();function a(e){return e.data.data.pid}e.findEntryWithLevel=function(t,r){var n;return r&&t.eachAfter((function(t){if(e.getPtId(t)===r)return n=t.copy()})),n||t},e.findEntryWithChild=function(t,r){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a0)},e.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},e.isHeader=function(t,r){return!(e.isLeaf(t)||t.depth===r._maxDepth-1)},e.getParent=function(t,r){return e.findEntryWithLevel(t,a(r))},e.listPath=function(t,r){var n=t.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return e.listPath(n,r).concat(i)},e.getPath=function(t){return e.listPath(t,"label").join("/")+"/"},e.formatValue=i.formatPieValue,e.formatPercent=function(e,r){var n=t.formatPercent(e,0);return"0%"===n&&(n=i.formatPiePercent(e,r)),n}}}),qd=p({"src/traces/sunburst/fx.js"(e,t){var r=v(),n=Ve(),i=Xt().appendArrayPointValue,a=zr(),o=st(),s=pt(),l=Vd(),c=br().formatPieValue;function u(e,t,r){for(var n=e.data.data,a={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o"),name:S||O("name")?v.name:void 0,color:T("hoverlabel.bgcolor")||x.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),fontWeight:T("hoverlabel.font.weight"),fontStyle:T("hoverlabel.font.style"),fontVariant:T("hoverlabel.font.variant"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:S,hovertemplateLabels:L,eventData:h};g&&(j.x0=E-n.rInscribed*n.rpx1,j.x1=E+n.rInscribed*n.rpx1,j.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(j.x=E,j.idealAlign=E<0?"left":"right");var F=[];a.loneHover(j,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:F}),h[0].bbox=F[0],f._hasHoverLabel=!0}if(y){var B=e.select("path.surface");p.styleOne(B,n,v,i,{hovered:!0})}f._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,p.eventDataKeys)],event:r.event})}})),e.on("mouseout",(function(t){var n=i._fullLayout,o=i._fullData[f.index],s=r.select(this).datum();if(f._hasHoverEvent&&(t.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,p.eventDataKeys)],event:r.event}),f._hasHoverEvent=!1),f._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),f._hasHoverLabel=!1),y){var l=e.select("path.surface");p.styleOne(l,s,o,i,{hovered:!1})}})),e.on("click",(function(e){var t=i._fullLayout,o=i._fullData[f.index],c=g&&(l.isHierarchyRoot(e)||l.isLeaf(e)),h=l.getPtId(e),d=l.isEntry(e)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(d),v={points:[u(e,o,p.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+f.type+"click",v);if(!1!==x&&t.hovermode&&(i._hoverdata=[u(e,o,p.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,t._tracePreGUI[o.uid],{level:o.level});var b={data:[{level:y}],traces:[f.index]},_={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(t._hoverlayer.node()),n.call("animate",i,b,_)}}))}}}),Hd=p({"src/traces/sunburst/plot.js"(e){var t=v(),r=$u(),n=(Bd(),m(Rd)).interpolate,i=Jt(),a=st(),o=At(),s=Ka(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=Du(),h=br().getRotationAngle,p=u.computeTransform,d=u.transformInsideText,f=Ud().styleOne,g=Qa().resizeText,y=qd(),x=Vu(),b=Vd();function _(s,c,u,m){var g=s._context.staticPlot,v=s._fullLayout,_=!v.uniformtext.mode&&b.hasTransition(m),k=t.select(u).selectAll("g.slice"),T=c[0],S=T.trace,A=T.hierarchy,M=b.findEntryWithLevel(A,S.level),E=b.getMaxDepth(S),C=v._size,P=S.domain,L=C.w*(P.x[1]-P.x[0]),I=C.h*(P.y[1]-P.y[0]),z=.5*Math.min(L,I),O=T.cx=C.l+C.w*(P.x[1]+P.x[0])/2,R=T.cy=C.t+C.h*(1-P.y[0])-I/2;if(!M)return k.remove();var D=null,j={};_&&k.each((function(e){j[b.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!D&&b.isEntry(e)&&(D=e)}));var F=function(e){return r.partition().size([2*Math.PI,e.height+1])(e)}(M).descendants(),B=M.height+1,N=0,U=E;T.hasMultipleRoots&&b.isHierarchyRoot(M)&&(F=F.slice(1),B-=1,N=1,U+=1),F=F.filter((function(e){return e.y1<=U}));var V=h(S.rotation);V&&F.forEach((function(e){e.x0+=V,e.x1+=V}));var q=Math.min(B,E),H=function(e){return(e-N)/q*z},G=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},W=function(e){return a.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,O,R)},$=function(e){return O+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Z=function(e){return R+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(k=k.data(F,b.getPtId)).enter().append("g").classed("slice",!0),_?k.exit().transition().each((function(){var e=t.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=b.getPtId(e),i=j[r],a=j[b.getPtId(M)];if(a){var o=(e.x1>a.x1?2*Math.PI:0)+V;t=e.rpx1X?2*Math.PI:0)+V;t={x0:o,x1:o}}else t={rpx0:z,rpx1:z},a.extendFlat(t,J(e));else t={rpx0:0,rpx1:0};else t={x0:V,x1:V};return n(t,i)}(e);return function(e){return W(t(e))}})):h.attr("d",W),u.call(y,M,s,c,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(f,r,S,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(e){e.attr("data-notex",1)})),k=a.ensureUniformFontSize(s,b.determineTextFont(S,r,v.font));w.text(e.formatSliceLabel(r,M,S,c,v)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,k).call(o.convertToTspans,s);var A=i.bBox(w.node());r.transform=d(A,r,T),r.transform.targetX=$(r),r.transform.targetY=Z(r);var E=function(e,t){var r=e.transform;return p(r,t),r.fontSize=k.size,l(S.type,r,v),a.getTextTransform(r)};_?w.transition().attrTween("transform",(function(e){var t=function(e){var t,r=j[b.getPtId(e)],i=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},D)if(e.parent)if(X){var o=e.x1>X?2*Math.PI:0;t.x0=t.x1=o}else a.extendFlat(t,J(e));else t.x0=t.x1=V;else t.x0=t.x1=V;var s=n(t.transform.textPosAngle,e.transform.textPosAngle),c=n(t.rpx1,e.rpx1),u=n(t.x0,e.x0),h=n(t.x1,e.x1),p=n(t.transform.scale,i.scale),d=n(t.transform.rotate,i.rotate),f=0===i.rCenter?3:0===t.transform.rCenter?1/3:1,m=n(t.transform.rCenter,i.rCenter),g=function(e){return m(Math.pow(e,f))};return function(e){var t=c(e),r=u(e),n=h(e),a=g(e),o={pxmid:G(t,(r+n)/2),rpx1:t,transform:{textPosAngle:s(e),rCenter:a,x:i.x,y:i.y}};return l(S.type,i,v),{transform:{targetX:$(o),targetY:Z(o),scale:p(e),rotate:d(e),rCenter:a}}}}(e);return function(e){return E(t(e),A)}})):w.attr("transform",E(r,A))}))}function w(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}e.plot=function(e,r,n,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&b.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),t.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){_(e,t,this,n)}))}))):(a.each((function(t){_(e,t,this,n)})),s.uniformtext.mode&&g(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},e.formatSliceLabel=function(e,t,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!o&&(!s||"none"===s))return"";var l=i.separators,c=n[0],u=e.data.data,h=c.hierarchy,p=b.isHierarchyRoot(e),d=b.getParent(h,e),f=b.getValue(e);if(!o){var m,g=s.split("+"),y=function(e){return-1!==g.indexOf(e)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(b.formatValue(u.v,l)),!p){y("current path")&&v.push(b.getPath(e.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var _=x>1;if(x){var w,k=function(e){m=b.formatPercent(w,l),_&&(m+=" of "+e),v.push(m)};y("percent parent")&&!p&&(w=f/b.getValue(d),k("parent")),y("percent entry")&&(w=f/b.getValue(t),k("entry")),y("percent root")&&(w=f/b.getValue(h),k("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("
")}var T=a.castOption(r,u.i,"texttemplate");if(!T)return"";var S={};u.label&&(S.label=u.label),u.hasOwnProperty("v")&&(S.value=u.v,S.valueLabel=b.formatValue(u.v,l)),S.currentPath=b.getPath(e.data),p||(S.percentParent=f/b.getValue(d),S.percentParentLabel=b.formatPercent(S.percentParent,l),S.parent=b.getPtLabel(d)),S.percentEntry=f/b.getValue(t),S.percentEntryLabel=b.formatPercent(S.percentEntry,l),S.entry=b.getPtLabel(t),S.percentRoot=f/b.getValue(h),S.percentRootLabel=b.formatPercent(S.percentRoot,l),S.root=b.getPtLabel(h),u.hasOwnProperty("color")&&(S.color=u.color);var A=a.castOption(r,u.i,"text");return(a.isValidTextValue(A)||""===A)&&(S.text=A),S.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(T,S,i._d3locale,S,r._meta||{})}}}),Gd=p({"src/traces/sunburst/index.js"(e,t){t.exports={moduleType:"trace",name:"sunburst",basePlotModule:Uu(),categories:[],animatable:!0,attributes:qu(),layoutAttributes:Hu(),supplyDefaults:Gu(),supplyLayoutDefaults:Wu(),calc:Zu().calc,crossTraceCalc:Zu().crossTraceCalc,plot:Hd().plot,style:Ud().style,colorbar:pi(),meta:{}}}}),Wd=p({"lib/sunburst.js"(e,t){t.exports=Gd()}}),$d=p({"src/traces/treemap/base_plot.js"(e){var t=kt();e.name="treemap",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Zd=p({"src/traces/treemap/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),Xd=p({"src/traces/treemap/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=Lt(),a=ka().attributes,o=Pu(),s=qu(),l=Zd(),c=R().extendFlat,u=Ie().pattern;t.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.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:c({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:s.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("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:c({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:c({},o.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:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}}),Yd=p({"src/traces/treemap/layout_attributes.js"(e,t){t.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Kd=p({"src/traces/treemap/defaults.js"(e,t){var r=st(),n=Xd(),i=q(),a=ka().defaults,o=$a().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Wt(),u=c.hasColorscale,h=c.handleDefaults;t.exports=function(e,t,c,p){function d(i,a){return r.coerce(e,t,n,i,a)}var f=d("labels"),m=d("parents");if(f&&f.length&&m&&m.length){var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),"squarify"===d("tiling.packing")&&d("tiling.squarifyratio"),d("tiling.flip"),d("tiling.pad");var y=d("text");d("texttemplate"),t.texttemplate||d("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),d("hovertext"),d("hovertemplate");var v=d("pathbar.visible");o(e,t,p,d,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition");var x=-1!==t.textposition.indexOf("bottom");l(e,t,p,d),(t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis)?h(e,t,p,d,{prefix:"marker.",cLetter:"c"}):d("marker.depthfade",!(t.marker.colors||[]).length);var b=2*t.textfont.size;d("marker.pad.t",x?b/4:b),d("marker.pad.l",b/4),d("marker.pad.r",b/4),d("marker.pad.b",x?b:b/4),d("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:i.contrast(p.paper_bgcolor)}}},v&&(d("pathbar.thickness",t.pathbar.textfont.size+2*s),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),a(t,p,d),t._length=null}else t.visible=!1}}}),Jd=p({"src/traces/treemap/layout_defaults.js"(e,t){var r=st(),n=Yd();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("treemapcolorway",t.colorway),i("extendtreemapcolors")}}}),Qd=p({"src/traces/treemap/calc.js"(e){var t=Zu();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("treemap",e)}}}),ef=p({"src/traces/treemap/flip_tree.js"(e,t){t.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o0)for(var _=0;_").join(" ")||"";var m=n.ensureSingle(d,"g","slicetext"),T=n.ensureSingle(m,"text","",(function(e){e.attr("data-notex",1)})),P=n.ensureUniformFontSize(e,c.determineTextFont(L,o,C.font,{onPathbar:!0}));T.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,P).call(a.convertToTspans,e),o.textBB=i.bBox(T.node()),o.transform=_(o,{fontSize:P.size,onPathbar:!0}),o.transform.fontSize=P.size,k?T.transition().attrTween("transform",(function(e){var t=A(e,h,M,[g,y]);return function(e){return w(t(e))}})):T.attr("transform",w(o))}))}}}),af=p({"src/traces/treemap/plot_one.js"(e,t){var r=v(),n=(Bd(),m(Rd)).interpolate,i=Vd(),a=st(),o=qa().TEXTPAD,s=eo().toMoveInsideBar,l=Ka().recordMinTextSize,c=Zd(),u=nf();function h(e){return i.isHierarchyRoot(e)?"":i.getPtId(e)}t.exports=function(e,t,p,d,f){var m=e._fullLayout,g=t[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,b=i.findEntryWithLevel(x,y.level),_=r.select(p),w=_.selectAll("g.pathbar"),k=_.selectAll("g.slice");if(!b)return w.remove(),void k.remove();var T=i.isHierarchyRoot(b),S=!m.uniformtext.mode&&i.hasTransition(d),A=i.getMaxDepth(y),M=m._size,E=y.domain,C=M.w*(E.x[1]-E.x[0]),P=M.h*(E.y[1]-E.y[0]),L=C,I=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,O=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?P+z:-(I+z):0,R={x0:L,x1:L,y0:O,y1:O+I},D=function(e,t,r){var n=y.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},j=null,F={},B={},N=null,U=function(e,t){return t?F[h(e)]:B[h(e)]},V=function(e,t,r,n){if(t)return F[h(x)]||R;var i=B[y.level]||r;return function(e){return e.data.depth-b.data.depth=(n-=(v?te:te.r)-o)){var d=(r+n)/2;r=d,n=d}var f;oe?i<(f=a-(v?te:te.b))&&f"===ee?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===ee?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===ee?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===ee&&(o.x-=a,s.x-=a),Q(l),Q(h),Q(o),Q(c),Q(u),Q(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(h.x,h.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:se,makeUpdateSliceInterpolator:ce,makeUpdateTextInterpolator:ue,handleSlicesExit:he,hasTransition:S,strTransform:pe}):w.remove()}}}),of=p({"src/traces/treemap/draw.js"(e,t){var r=v(),n=Vd(),i=Ka().clearMinTextSize,a=Qa().resizeText,o=af();t.exports=function(e,t,s,l,c){var u,h,p=c.type,d=c.drawDescendants,f=e._fullLayout,m=f["_"+p+"layer"],g=!s;i(p,f),(u=m.selectAll("g.trace."+p).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(p,!0),u.order(),!f.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(t){o(e,t,this,s,d)}))}))):(u.each((function(t){o(e,t,this,s,d)})),f.uniformtext.mode&&a(e,m.selectAll(".trace"),p)),g&&u.exit().remove()}}}),sf=p({"src/traces/treemap/draw_descendants.js"(e,t){var r=v(),n=st(),i=Jt(),a=At(),o=tf(),s=rf().styleOne,l=Zd(),c=Vd(),u=qd(),h=Hd().formatSliceLabel,p=!1;t.exports=function(e,t,d,f,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,k=m.hasTransition,T=m.handleSlicesExit,S=m.makeUpdateSliceInterpolator,A=m.makeUpdateTextInterpolator,M=m.prevEntry,E=e._context.staticPlot,C=e._fullLayout,P=t[0].trace,L=-1!==P.textposition.indexOf("left"),I=-1!==P.textposition.indexOf("right"),z=-1!==P.textposition.indexOf("bottom"),O=!z&&!P.marker.pad.t||z&&!P.marker.pad.b,R=o(d,[g,y],{packing:P.tiling.packing,squarifyratio:P.tiling.squarifyratio,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1,pad:{inner:P.tiling.pad,top:P.marker.pad.t,left:P.marker.pad.l,right:P.marker.pad.r,bottom:P.marker.pad.b}}).descendants(),D=1/0,j=-1/0;R.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(D=Math.min(D,t),j=Math.max(j,t))})),f=f.data(R,c.getPtId),P._maxVisibleLayers=isFinite(j)?j-D+1:0,f.enter().append("g").classed("slice",!0),T(f,p,{},[g,y],b),f.order();var F=null;if(k&&M){var B=c.getPtId(M);f.each((function(e){null===F&&c.getPtId(e)===B&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var N=function(){return F||{x0:0,x1:g,y0:0,y1:y}},U=f;return k&&(U=U.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var f=c.isHeader(o,P);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-P.marker.pad.r),o._hoverY=x(z?o.y1-P.marker.pad.b/2:o.y0+P.marker.pad.t/2);var m=r.select(this),T=n.ensureSingle(m,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));k?T.transition().attrTween("d",(function(e){var t=S(e,p,N(),[g,y]);return function(e){return b(t(e))}})):T.attr("d",b),m.call(u,d,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),T.call(s,o,P,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=f?O?"":c.getPtLabel(o)||"":h(o,d,P,t,C)||"";var M=n.ensureSingle(m,"g","slicetext"),R=n.ensureSingle(M,"text","",(function(e){e.attr("data-notex",1)})),D=n.ensureUniformFontSize(e,c.determineTextFont(P,o,C.font)),j=o._text||" ",F=f&&-1===j.indexOf("
");R.text(j).classed("slicetext",!0).attr("text-anchor",I?"end":L||F?"start":"middle").call(i.font,D).call(a.convertToTspans,e),o.textBB=i.bBox(R.node()),o.transform=_(o,{fontSize:D.size,isHeader:f}),o.transform.fontSize=D.size,k?R.transition().attrTween("transform",(function(e){var t=A(e,p,N(),[g,y]);return function(e){return w(t(e))}})):R.attr("transform",w(o))})),F}}}),lf=p({"src/traces/treemap/plot.js"(e,t){var r=of(),n=sf();t.exports=function(e,t,i,a){return r(e,t,i,a,{type:"treemap",drawDescendants:n})}}}),cf=p({"src/traces/treemap/index.js"(e,t){t.exports={moduleType:"trace",name:"treemap",basePlotModule:$d(),categories:[],animatable:!0,attributes:Xd(),layoutAttributes:Yd(),supplyDefaults:Kd(),supplyLayoutDefaults:Jd(),calc:Qd().calc,crossTraceCalc:Qd().crossTraceCalc,plot:lf(),style:rf().style,colorbar:pi(),meta:{}}}}),uf=p({"lib/treemap.js"(e,t){t.exports=cf()}}),hf=p({"src/traces/icicle/base_plot.js"(e){var t=kt();e.name="icicle",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),pf=p({"src/traces/icicle/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=Lt(),a=ka().attributes,o=Pu(),s=qu(),l=Xd(),c=Zd(),u=R().extendFlat,h=Ie().pattern;t.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.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:u({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}}),df=p({"src/traces/icicle/layout_attributes.js"(e,t){t.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),ff=p({"src/traces/icicle/defaults.js"(e,t){var r=st(),n=pf(),i=q(),a=ka().defaults,o=$a().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Wt(),u=c.hasColorscale,h=c.handleDefaults;t.exports=function(e,t,c,p){function d(i,a){return r.coerce(e,t,n,i,a)}var f=d("labels"),m=d("parents");if(f&&f.length&&m&&m.length){var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),d("tiling.orientation"),d("tiling.flip"),d("tiling.pad");var y=d("text");d("texttemplate"),t.texttemplate||d("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),d("hovertext"),d("hovertemplate");var v=d("pathbar.visible");o(e,t,p,d,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition"),l(e,t,p,d);var x=t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis;x&&h(e,t,p,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",x?1:.7),t._hovered={marker:{line:{width:2,color:i.contrast(p.paper_bgcolor)}}},v&&(d("pathbar.thickness",t.pathbar.textfont.size+2*s),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),a(t,p,d),t._length=null}else t.visible=!1}}}),mf=p({"src/traces/icicle/layout_defaults.js"(e,t){var r=st(),n=df();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("iciclecolorway",t.colorway),i("extendiciclecolors")}}}),gf=p({"src/traces/icicle/calc.js"(e){var t=Zu();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("icicle",e)}}}),yf=p({"src/traces/icicle/partition.js"(e,t){var r=$u(),n=ef();t.exports=function(e,t,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=t[0],u=t[1];l&&(c=(e.height+1)*t[0]/Math.min(e.height+1,l),u=(e.height+1)*t[1]/Math.min(e.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[t[1],c]:[t[0],u])(e);return(s||a||o)&&n(h,t,{swapXY:s,flipX:a,flipY:o}),h}}}),vf=p({"src/traces/icicle/style.js"(e,t){var r=v(),n=q(),i=st(),a=Ka().resizeText,o=Nd();function s(e,t,r,a){var s=t.data.data,l=!t.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");a(e,t,"icicle"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(s,t,i,e)}))}))},styleOne:s}}}),xf=p({"src/traces/icicle/draw_descendants.js"(e,t){var r=v(),n=st(),i=Jt(),a=At(),o=yf(),s=vf().styleOne,l=Zd(),c=Vd(),u=qd(),h=Hd().formatSliceLabel,p=!1;t.exports=function(e,t,d,f,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,k=m.hasTransition,T=m.handleSlicesExit,S=m.makeUpdateSliceInterpolator,A=m.makeUpdateTextInterpolator,M=m.prevEntry,E=e._context.staticPlot,C=e._fullLayout,P=t[0].trace,L=-1!==P.textposition.indexOf("left"),I=-1!==P.textposition.indexOf("right"),z=-1!==P.textposition.indexOf("bottom"),O=o(d,[g,y],{flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1,orientation:P.tiling.orientation,pad:{inner:P.tiling.pad},maxDepth:P._maxDepth}).descendants(),R=1/0,D=-1/0;O.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(R=Math.min(R,t),D=Math.max(D,t))})),f=f.data(O,c.getPtId),P._maxVisibleLayers=isFinite(D)?D-R+1:0,f.enter().append("g").classed("slice",!0),T(f,p,{},[g,y],b),f.order();var j=null;if(k&&M){var F=c.getPtId(M);f.each((function(e){null===j&&c.getPtId(e)===F&&(j={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var B=function(){return j||{x0:0,x1:g,y0:0,y1:y}},N=f;return k&&(N=N.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-P.tiling.pad),o._hoverY=x(z?o.y1-P.tiling.pad/2:o.y0+P.tiling.pad/2);var f=r.select(this),m=n.ensureSingle(f,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));k?m.transition().attrTween("d",(function(e){var t=S(e,p,B(),[g,y],{orientation:P.tiling.orientation,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1});return function(e){return b(t(e))}})):m.attr("d",b),f.call(u,d,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),m.call(s,o,P,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,d,P,t,C)||"";var T=n.ensureSingle(f,"g","slicetext"),M=n.ensureSingle(T,"text","",(function(e){e.attr("data-notex",1)})),O=n.ensureUniformFontSize(e,c.determineTextFont(P,o,C.font));M.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":L?"start":"middle").call(i.font,O).call(a.convertToTspans,e),o.textBB=i.bBox(M.node()),o.transform=_(o,{fontSize:O.size}),o.transform.fontSize=O.size,k?M.transition().attrTween("transform",(function(e){var t=A(e,p,B(),[g,y]);return function(e){return w(t(e))}})):M.attr("transform",w(o))})),j}}}),bf=p({"src/traces/icicle/plot.js"(e,t){var r=of(),n=xf();t.exports=function(e,t,i,a){return r(e,t,i,a,{type:"icicle",drawDescendants:n})}}}),_f=p({"src/traces/icicle/index.js"(e,t){t.exports={moduleType:"trace",name:"icicle",basePlotModule:hf(),categories:[],animatable:!0,attributes:pf(),layoutAttributes:df(),supplyDefaults:ff(),supplyLayoutDefaults:mf(),calc:gf().calc,crossTraceCalc:gf().crossTraceCalc,plot:bf(),style:vf().style,colorbar:pi(),meta:{}}}}),wf=p({"lib/icicle.js"(e,t){t.exports=_f()}}),kf=p({"src/traces/funnelarea/base_plot.js"(e){var t=kt();e.name="funnelarea",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Tf=p({"src/traces/funnelarea/attributes.js"(e,t){var r=Pu(),n=N(),i=ka().attributes,a=Oe().hovertemplateAttrs,o=Oe().texttemplateAttrs,s=R().extendFlat;t.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({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"}}}}),Sf=p({"src/traces/funnelarea/layout_attributes.js"(e,t){var r=Iu().hiddenlabels;t.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Af=p({"src/traces/funnelarea/defaults.js"(e,t){var r=st(),n=Tf(),i=ka().defaults,a=$a().handleText,o=Lu().handleLabelsAndValues,s=Lu().handleMarkerDefaults;t.exports=function(e,t,l,c){function u(i,a){return r.coerce(e,t,n,i,a)}var h=u("labels"),p=u("values"),d=o(h,p),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(u("label0"),u("dlabel")),f){t._length=f,s(e,t,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(e,t,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(t,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else t.visible=!1}}}),Mf=p({"src/traces/funnelarea/layout_defaults.js"(e,t){var r=st(),n=Sf();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",t.colorway),i("extendfunnelareacolors")}}}),Ef=p({"src/traces/funnelarea/calc.js"(e,t){var r=Ou();t.exports={calc:function(e,t){return r.calc(e,t)},crossTraceCalc:function(e){r.crossTraceCalc(e,{type:"funnelarea"})}}}}),Cf=p({"src/traces/funnelarea/plot.js"(e,t){var r=v(),n=Jt(),i=st(),a=i.strScale,o=i.strTranslate,s=At(),l=eo().toMoveInsideBar,c=Ka(),u=c.recordMinTextSize,h=c.clearMinTextSize,p=br(),d=Du(),f=d.attachFxHandlers,m=d.determineInsideTextFont,g=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function w(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}t.exports=function(e,t){var c=e._context.staticPlot,d=e._fullLayout;h("funnelarea",d),y(t,e),g(t,d._size),i.makeTraceGroups(d._funnelarealayer,t,"trace").each((function(t){var h=r.select(this),g=t[0],y=g.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=t.vTotal,u=c,h=c*l/(1-l)/c,p=[];for(p.push(E()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var d=s.v/u;h+=d,p.push(E())}var f=1/0,m=-1/0;for(o=0;o-1;o--)if(!(s=e[o]).hidden){var S=p[T+=1][0],A=p[T][1];s.TL=[-S,A],s.TR=[S,A],s.BL=_,s.BR=k,s.pxmid=w(s.TR,s.BR),_=s.TL,k=s.TR}}function M(){var e=Math.sqrt(h);return{x:e,y:-e}}function E(){var e=M();return[e.x,e.y]}}(t),h.each((function(){var h=r.select(this).selectAll("g.slice").data(t);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),x.call(f,e,t);var k="M"+(h+a.TR[0])+","+(v+a.TR[1])+_(a.TR,a.BR)+_(a.BR,a.BL)+_(a.BL,a.TL)+"Z";w.attr("d",k),b(e,a,g);var T=p.castOption(y.textposition,a.pts),S=x.selectAll("g.slicetext").data(a.text&&"none"!==T?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,m(y,a,d.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,p).call(s.convertToTspans,e);var f,g,x,b=n.bBox(c.node()),_=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(f=l(g,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,u(y.type,f,d),t[o].transform=f,i.setTransormAndDisplay(c,f)}))}}));var v=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var t=i.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),t.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,e);var c=x(g,d._size);t.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Pf=p({"src/traces/funnelarea/style.js"(e,t){var r=v(),n=wr(),i=Ka().resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(t){var i=t[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(t){r.select(this).call(n,t,i,e)}))}))}}}),Lf=p({"src/traces/funnelarea/index.js"(e,t){t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:kf(),categories:["pie-like","funnelarea","showLegend"],attributes:Tf(),layoutAttributes:Sf(),supplyDefaults:Af(),supplyLayoutDefaults:Mf(),calc:Ef().calc,crossTraceCalc:Ef().crossTraceCalc,plot:Cf(),style:Pf(),styleOne:wr(),meta:{}}}}),If=p({"lib/funnelarea.js"(e,t){t.exports=Lf()}}),zf=p({"stackgl_modules/index.js"(e,t){!function(){var e={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){function n(e,t){for(var r=0;rd)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}function m(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return v(e)}return g(e,t,r)}function g(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),n=f(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return b(t.buffer,t.byteOffset,t.byteLength)}return x(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return b(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return b(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return m.from(n,t,r);var i=function(e){if(m.isBuffer(e)){var t=0|_(e.length),r=f(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?f(0):x(e):"Buffer"===e.type&&Array.isArray(e.data)?x(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return m.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e))}function y(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function v(e){return y(e),f(e<0?0:0|_(e))}function x(e){for(var t=e.length<0?0:0|_(e.length),r=f(t),n=0;n=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|e}function w(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:Q(e).length;t=(""+t).toLowerCase(),i=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return z(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function T(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=m.from(t,n)),m.isBuffer(t))return 0===t.length?-1:A(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):A(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function A(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var h=!0,p=0;pi&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(t,r))}function z(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=e[i+1],c=e[i+2],128===(192&l)&&128===(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=e[i+1],c=e[i+2],u=e[i+3],128===(192&l)&&128===(192&c)&&128===(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},m.byteLength=w,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},p&&(m.prototype[p]=m.prototype.inspect),m.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),u=e.slice(t,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return M(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,a){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function V(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,4),h.write(e,t,r,n,23,4),r+4}function G(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,8),h.write(e,t,r,n,52,8),r+8}m.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e],i=1,a=0;++a>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},m.prototype.readUint8=m.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},m.prototype.readBigUInt64LE=ae((function(e){Y(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},m.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},m.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},m.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},m.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},m.prototype.readBigInt64LE=ae((function(e){Y(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<>>=0,t||B(e,4,this.length),h.read(this,e,!0,23,4)},m.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),h.read(this,e,!1,23,4)},m.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),h.read(this,e,!0,52,8)},m.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),h.read(this,e,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},m.prototype.writeUint8=m.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},m.prototype.writeBigUInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeBigUInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},m.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},m.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},m.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},m.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},m.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},m.prototype.writeBigInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeBigInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},m.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},m.prototype.writeDoubleLE=function(e,t,r){return G(this,e,t,!0,r)},m.prototype.writeDoubleBE=function(e,t,r){return G(this,e,t,!1,r)},m.prototype.copy=function(e,t,r,n){if(!m.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function X(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new W.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,i,a)}function Y(e,t){if("number"!==typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw Y(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}$("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),$("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(c(t))}),TypeError),$("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Z(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Z(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Q(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return u.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},9216:function(e){e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(e,t,r){e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],c=e.mode||"turntable",u=n(),h=i(),p=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,t,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,t,r,s),p.setDistanceLimits(l[0],l[1]),p.lookAt(0,t,r,s),new o({turntable:u,orbit:h,matrix:p},c)};var n=r(7261),i=r(9977),a=r(1811);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r0?o-4:o;for(r=0;r>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,c=n-i;sc?c:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318:function(e){e.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]),e[1].mul(t[0]))}},7842:function(e,t,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);e.exports=function e(t,r){if(n(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var c,u,h=0;if(i(t))c=t.clone();else if("string"===typeof t)c=o(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))c=a(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;c=a(t)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"===typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(e,t,r){var n=r(1533);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},5716:function(e,t,r){var n=r(6859);e.exports=function(e){return e.cmp(new n(0))}},1369:function(e,t,r){var n=r(5716);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a20?52:r+32}},1533:function(e,t,r){r(6859),e.exports=function(e){return e&&"object"===typeof e&&Boolean(e.words)}},2651:function(e,t,r){var n=r(6859),i=r(2361);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},869:function(e,t,r){var n=r(2651),i=r(5716);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},6768:function(e,t,r){var n=r(6859);e.exports=function(e){return new n(e)}},6504:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},7721:function(e,t,r){var n=r(5716);e.exports=function(e){return n(e[0])*n(e[1])}},5572:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946:function(e,t,r){var n=r(1369),i=r(4025);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(p=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,p=n(l.ushln(h).divRound(r));return h<1023?c*p*Math.pow(2,-h):c*(p*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(e){function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},8828:function(e,t){function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7790).Buffer}catch(S){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=l(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2===0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","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"],h=[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],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&l,p=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=p;d++){var f=c-d|0;u+=(o=(i=0|e.words[f])*(a=0|t.words[d])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],d=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modn(d).toString(e);r=(f=f.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,c=new e(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,d=0|o[1],f=8191&d,m=d>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,T=w>>>13,S=0|o[5],A=8191&S,M=S>>>13,E=0|o[6],C=8191&E,P=E>>>13,L=0|o[7],I=8191&L,z=L>>>13,O=0|o[8],R=8191&O,D=O>>>13,j=0|o[9],F=8191&j,B=j>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,W=0|s[2],$=8191&W,Z=W>>>13,X=0|s[3],Y=8191&X,K=X>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],he=8191&ue,pe=ue>>>13,de=0|s[9],fe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(p,U)|0))<<13)|0;c=((a=Math.imul(p,V))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(f,U),i=(i=Math.imul(f,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var ye=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(p,H)|0))<<13)|0;c=((a=a+Math.imul(p,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(f,H)|0,i=(i=i+Math.imul(f,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var ve=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(p,$)|0))<<13)|0;c=((a=a+Math.imul(p,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(f,$)|0,i=(i=i+Math.imul(f,Z)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,Z)|0;var xe=(c+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(p,Y)|0))<<13)|0;c=((a=a+Math.imul(p,K)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,V))+Math.imul(T,U)|0,a=Math.imul(T,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,Z)|0,n=n+Math.imul(f,Y)|0,i=(i=i+Math.imul(f,K)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,K)|0;var be=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(p,Q)|0))<<13)|0;c=((a=a+Math.imul(p,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(M,U)|0,a=Math.imul(M,V),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,G)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,K)|0,n=n+Math.imul(f,Q)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var _e=(c+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(p,re)|0))<<13)|0;c=((a=a+Math.imul(p,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(P,U)|0,a=Math.imul(P,V),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,G)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,Z)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0,n=n+Math.imul(f,re)|0,i=(i=i+Math.imul(f,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0;var we=(c+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,oe)|0)+Math.imul(p,ae)|0))<<13)|0;c=((a=a+Math.imul(p,oe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,K)|0)+Math.imul(T,Y)|0,a=a+Math.imul(T,K)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0,n=n+Math.imul(f,ae)|0,i=(i=i+Math.imul(f,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var ke=(c+(n=n+Math.imul(h,le)|0)|0)+((8191&(i=(i=i+Math.imul(h,ce)|0)+Math.imul(p,le)|0))<<13)|0;c=((a=a+Math.imul(p,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,V))+Math.imul(D,U)|0,a=Math.imul(D,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,K)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,n=n+Math.imul(f,le)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,ce)|0;var Te=(c+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;c=((a=a+Math.imul(p,pe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(B,U)|0,a=Math.imul(B,V),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,Z)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(P,Y)|0,a=a+Math.imul(P,K)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,ce)|0,n=n+Math.imul(f,he)|0,i=(i=i+Math.imul(f,pe)|0)+Math.imul(m,he)|0,a=a+Math.imul(m,pe)|0;var Se=(c+(n=n+Math.imul(h,fe)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(p,fe)|0))<<13)|0;c=((a=a+Math.imul(p,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,G))+Math.imul(B,H)|0,a=Math.imul(B,G),n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,ce)|0,n=n+Math.imul(y,he)|0,i=(i=i+Math.imul(y,pe)|0)+Math.imul(v,he)|0,a=a+Math.imul(v,pe)|0;var Ae=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,Z))+Math.imul(B,$)|0,a=Math.imul(B,Z),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(T,le)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(b,he)|0,i=(i=i+Math.imul(b,pe)|0)+Math.imul(_,he)|0,a=a+Math.imul(_,pe)|0;var Me=(c+(n=n+Math.imul(y,fe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((a=a+Math.imul(v,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,K))+Math.imul(B,Y)|0,a=Math.imul(B,K),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(A,le)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,ce)|0,n=n+Math.imul(k,he)|0,i=(i=i+Math.imul(k,pe)|0)+Math.imul(T,he)|0,a=a+Math.imul(T,pe)|0;var Ee=(c+(n=n+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((a=a+Math.imul(_,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(B,Q)|0,a=Math.imul(B,ee),n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,ce)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,pe)|0)+Math.imul(M,he)|0,a=a+Math.imul(M,pe)|0;var Ce=(c+(n=n+Math.imul(k,fe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(T,fe)|0))<<13)|0;c=((a=a+Math.imul(T,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(B,re)|0,a=Math.imul(B,ne),n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,ce)|0,n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,pe)|0)+Math.imul(P,he)|0,a=a+Math.imul(P,pe)|0;var Pe=(c+(n=n+Math.imul(A,fe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,oe))+Math.imul(B,ae)|0,a=Math.imul(B,oe),n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,ce)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,pe)|0)+Math.imul(z,he)|0,a=a+Math.imul(z,pe)|0;var Le=(c+(n=n+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(P,fe)|0))<<13)|0;c=((a=a+Math.imul(P,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(F,le),i=(i=Math.imul(F,ce))+Math.imul(B,le)|0,a=Math.imul(B,ce),n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,pe)|0)+Math.imul(D,he)|0,a=a+Math.imul(D,pe)|0;var Ie=(c+(n=n+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(z,fe)|0))<<13)|0;c=((a=a+Math.imul(z,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,he),i=(i=Math.imul(F,pe))+Math.imul(B,he)|0,a=Math.imul(B,pe);var ze=(c+(n=n+Math.imul(R,fe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((a=a+Math.imul(D,me)|0)+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863;var Oe=(c+(n=Math.imul(F,fe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(B,fe)|0))<<13)|0;return c=((a=Math.imul(B,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l[0]=ge,l[1]=ye,l[2]=ve,l[3]=xe,l[4]=be,l[5]=_e,l[6]=we,l[7]=ke,l[8]=Te,l[9]=Se,l[10]=Ae,l[11]=Me,l[12]=Ee,l[13]=Ce,l[14]=Pe,l[15]=Le,l[16]=Ie,l[17]=ze,l[18]=Oe,0!==c&&(l[19]=c,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=d),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var p=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(i,p,h);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=p)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=t.clone();!t.isZero();){for(var p=0,d=1;0===(t.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var f=0,m=1;0===(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0===(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,p=1;0===(r.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(x,v),x.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),p=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),f=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=t.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new T(e)},i(T,k),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6204:function(e){e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t>>1;if(!(u<=0)){var h,p=i.mallocDouble(2*u*s),d=i.mallocInt32(s);if((s=l(e,u,p,d))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,p,d,0,s,p,d);else{var f=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(t,u,f,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,p,d,0,c,f,m):o(u,r,n,s,p,d,c,f,m),i.free(f),i.free(m))}i.free(p),i.free(d)}return h}}}function u(e,t){n.push([e,t])}},2455:function(e,t){function r(e){return e?function(e,t,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=n,d=h*n;pc-l?n?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=n,d=h*n;p0;){var O=(I-=1)*b,R=w[O],D=w[O+1],j=w[O+2],F=w[O+3],B=w[O+4],N=w[O+5],U=I*_,V=k[U],q=k[U+1],H=1&N,G=!!(16&N),W=u,$=M,Z=C,X=P;if(H&&(W=C,$=P,Z=u,X=M),!(2&N&&D>=(j=g(e,R,D,j,W,$,q)))&&!(4&N&&(D=y(e,R,D,j,W,$,V))>=j)){var Y=j-D,K=B-F;if(G){if(e*Y*(Y+K)=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo>>1,p=2*e,d=h,f=s[p*h+t];c=x?(d=v,f=x):y>=_?(d=g,f=y):(d=b,f=_):x>=_?(d=v,f=x):_>=y?(d=g,f=y):(d=b,f=_);for(var w=p*(u-1),k=p*d,T=0;Tr&&i[h+t]>c;--u,h-=o){for(var p=h,d=h+o,f=0;fp;++p,l+=s)if(i[l+h]===o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lop;++p,l+=s)if(i[l+h]d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=e+t,p=r;n>p;++p,l+=s)if(i[l+h]<=o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=e+t,p=r;n>p;++p,l+=s)if(i[l+h]<=o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lod;++d,l+=s){var f=i[l+h],m=i[l+p];if(fg;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[d];a[d]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,p=e+t,d=r;n>d;++d,l+=s){var f=i[l+h],m=i[l+p];if(f<=o&&o<=m)if(u===d)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[d];a[d]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,c=l*r,u=c,h=r,p=t,d=e+t,f=r;n>f;++f,c+=l){var m=i[c+p],g=i[c+d];if(!(m>=o)&&!(s>=g))if(h===f)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[f];a[f]=a[h],a[h++]=x}}return h}}},4192:function(e){e.exports=function(e,n){n<=4*t?r(0,n-1,e):c(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var c=r[l-2],u=r[l-1];if(cr[t+1])}function l(e,t,r,n){var i=n[e*=2];return i>1,g=m-p,y=m+p,v=d,x=g,b=m,_=y,w=f,k=e+1,T=u-1,S=0;s(v,x,h)&&(S=v,v=x,x=S),s(_,w,h)&&(S=_,_=w,w=S),s(v,b,h)&&(S=v,v=b,b=S),s(x,b,h)&&(S=x,x=b,b=S),s(v,_,h)&&(S=v,v=_,_=S),s(b,_,h)&&(S=b,b=_,_=S),s(x,w,h)&&(S=x,x=w,w=S),s(x,b,h)&&(S=x,x=b,b=S),s(_,w,h)&&(S=_,_=w,w=S);for(var A=h[2*x],M=h[2*x+1],E=h[2*_],C=h[2*_+1],P=2*v,L=2*b,I=2*w,z=2*d,O=2*m,R=2*f,D=0;D<2;++D){var j=h[P+D],F=h[L+D],B=h[I+D];h[z+D]=j,h[O+D]=F,h[R+D]=B}i(g,e,h),i(y,u,h);for(var N=k;N<=T;++N)if(l(N,A,M,h))N!==k&&n(N,k,h),++k;else if(!l(N,E,C,h))for(;;){if(l(T,E,C,h)){l(T,A,M,h)?(a(N,k,T,h),++k,--T):(n(N,T,h),--T);break}if(--T>>1;a(f,M);var E=0,C=0;for(k=0;k=o)m(u,h,C--,P=P-o|0);else if(P>=0)m(l,c,E--,P);else if(P<=-o){P=-P-o|0;for(var L=0;L>>1;a(f,E);var C=0,P=0,L=0;for(T=0;T>1===f[2*T+3]>>1&&(z=2,T+=1),I<0){for(var O=-(I>>1)-1,R=0;R>1)-1,0===z?m(l,c,C--,O):1===z?m(u,h,P--,O):2===z&&m(p,d,L--,O)}},scanBipartite:function(e,t,r,n,i,s,u,h,p,d,y,v){var x=0,b=2*e,_=t,w=t+e,k=1,T=1;n?T=o:k=o;for(var S=i;S>>1;a(f,C);var P=0;for(S=0;S=o?(I=!n,A-=o):(I=!!n,A-=1),I)g(l,c,P++,A);else{var z=v[A],O=b*A,R=y[O+t+1],D=y[O+t+1+e];e:for(var j=0;j>>1;a(f,k);var T=0;for(x=0;x=o)l[T++]=b-o;else{var A=d[b-=1],M=g*b,E=p[M+t+1],C=p[M+t+1+e];e:for(var P=0;P=0;--P)if(l[P]===b){for(O=P+1;O0;){for(var d=r.pop(),f=(u=-1,h=-1,l=o[s=r.pop()],1);f=0||(t.flip(s,d),i(e,t,r,u,s,h),i(e,t,r,s,h,u),i(e,t,r,h,d,u),i(e,t,r,d,u,h))}}},5023:function(e,t,r){var n=r(2478);function i(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var f=0;f<3;++f){var m=p[3*d+f];m>=0&&0===c[m]&&(h[3*d+f]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var y=function(e,t,r){for(var n=0,i=0;i1&&i(r[p[d-2]],r[p[d-1]],a)>0;)e.push([p[d-1],p[d-2],o]),d-=1;p.length=d,p.push(o);var f=h.upperIds;for(d=f.length;d>1&&i(r[f[d-2]],r[f[d-1]],a)<0;)e.push([f[d-2],f[d-1],o]),d-=1;f.length=d,f.push(o)}}function u(e,t){var r;return(r=e.a[0]f[0]&&i.push(new o(f,d,2,l),new o(d,f,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;nt[2]?1:0)}function y(e,t,r){if(0!==e.length){if(t)for(var n=0;n=0;--a){var x=t[u=(M=n[a])[0]],b=x[0],_=x[1],w=e[b],k=e[_];if((w[0]-k[0]||w[1]-k[1])<0){var T=b;b=_,_=T}x[0]=b;var S,A=x[1]=M[1];for(i&&(S=x[2]);a>0&&n[a-1][0]===u;){var M,E=(M=n[--a])[1];i?t.push([A,E,S]):t.push([A,E]),A=E}i?t.push([A,_,S]):t.push([A,_])}return p}(e,t,p,g,r),x=f(e,v);return y(t,x,r),!!x||p.length>0||g.length>0}},3637:function(e,t,r){e.exports=function(e,t,r,n){var a=s(t,e),h=s(n,r),p=u(a,h);if(0===o(p))return null;var d=s(e,r),f=u(h,d),m=i(f,p),g=c(a,m);return l(e,g)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},3642:function(e){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(e,t,r){var n=r(3642),i=r(395);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,c,u,h,p,d,f,m;if(e||(e={}),d=(e.nshades||72)-1,p=e.format||"hex",(h=e.colormap)||(h="jet"),"string"===typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>d+1)throw new Error(h+" map requires nshades to be at least size "+u.length);f=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"===typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=u.map((function(e){return Math.round(e.index*d)})),f[0]=Math.min(Math.max(f[0],0),1),f[1]=Math.min(Math.max(f[1],0),1);var g=u.map((function(e,t){var r=u[t].index,n=u[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=f[0]+(f[1]-f[0])*r),n})),y=[];for(m=0;m0||l(e,t,a)?-1:1:0===s?c>0||l(e,t,r)?1:-1:i(c-s)}var h=n(e,t,r);return h>0?o>0&&n(e,t,a)>0?1:-1:h<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),c=a(r[1],-t[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(e){e.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),c=t(n[0],n[1]);return t(l,e[2])-t(c,n[2])||t(l+e[2],o)-t(c+n[2],s);case 4:var u=e[0],h=e[1],p=e[2],d=e[3],f=n[0],m=n[1],g=n[2],y=n[3];return u+h+p+d-(f+m+g+y)||t(u,h,p,d)-t(f,m,g,y,f)||t(u+h,u+p,u+d,h+p,h+d,p+d)-t(f+m,f+g,f+y,m+g,m+y,g+y)||t(u+h+p,u+h+d,u+p+d,h+p+d)-t(f+m+g,f+m+y,f+g+y,m+g+y);default:for(var v=e.slice().sort(r),x=n.slice().sort(r),b=0;be[r][0]&&(r=n);return tr?[[r],[t]]:[[t]]}},4750:function(e,t,r){e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(e){e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),p=s*o;if(e.length){a||(a=new Array(e.length));for(var d=e.length-1;d>=0;--d)a[d]=c*e[d]+u*t[d]+h*r[d]+p*n[d];return a}return c*e+u*t+h*r+p*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var u=e.length-1;u>=0;--u)a[u]=o*e[u]+s*t[u]+l*r[u]+c*n[u];return a}return o*e+s*t+l*r[u]+c*n}},7642:function(e,t,r){var n=r(8954),i=r(1682);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a=2)return!1;e[r]=n}return!0})):_.filter((function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(u=0;u<_.length;++u)p=(b=_[u])[0],b[0]=b[1],b[1]=p;return _}},2361:function(e){var t=!1;if("undefined"!==typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);if(r[0]=1,t=!0,1072693248===n[1]){let t=function(e,t){return n[0]=e,n[1]=t,r[0]},i=function(e){return r[0]=e,n[0]},a=function(e){return r[0]=e,n[1]};e.exports=function(e){return r[0]=e,[n[0],n[1]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else if(1072693248===n[0]){let t=function(e,t){return n[1]=e,n[0]=t,r[0]},i=function(e){return r[0]=e,n[1]},a=function(e){return r[0]=e,n[0]};e.exports=function(e){return r[0]=e,[n[1],n[0]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else t=!1}if(!t){let t=function(e,t){return i.writeUInt32LE(e,0,!0),i.writeUInt32LE(t,4,!0),i.readDoubleLE(0,!0)},r=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},n=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(4,!0)};var i=new Buffer(8);e.exports=function(e){return i.writeDoubleLE(e,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=t,e.exports.lo=r,e.exports.hi=n}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}},1338:function(e){function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a0)return function(e,t){var r,n;for(r=new Array(e),n=0;n=r-1){p=l.length-1;var f=e-t[r-1];for(d=0;d=r-1)for(var u=s.length-1,h=(t[r-1],0);h=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e1e-6?1/s:0;this._time.push(e);for(var p=r;p>0;--p){var d=a(c[p-1],u[p-1],arguments[p]);n.push(d),i.push((d-n[o++])*h)}}},s.set=function(e){var t=this.dimension;if(!(e0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=e-t,h=u>1e-6?1/u:0;this._time.push(e);for(var p=r;p>0;--p){var d=arguments[p];n.push(a(l[p-1],c[p-1],n[o++]+d)),i.push(d*h)}}},s.idle=function(e){var t=this.lastT();if(!(e=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(e){function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||d,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function c(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);if(o<=0){if(i.left&&(a=c(e,t,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(e,t,r,n,i.right)}function u(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(e,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new t(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new t(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var p=l[h-1];if(s=l[h],1===p._color||1===s._color)break;var d=l[h-2];if(d.left===p)if(p.left===s){if(!(f=d.right)||0!==f._color){d._color=0,d.left=p.right,p._color=1,p.right=d,l[h-2]=p,l[h-1]=s,i(d),i(p),h>=3&&((m=l[h-3]).left===d?m.left=p:m.right=p);break}p._color=1,d.right=n(1,f),d._color=0,h-=1}else{if(!(f=d.right)||0!==f._color){p.right=s.left,d._color=0,d.left=s.right,s._color=1,s.left=p,s.right=d,l[h-2]=s,l[h-1]=p,i(d),i(p),i(s),h>=3&&((m=l[h-3]).left===d?m.left=s:m.right=s);break}p._color=1,d.right=n(1,f),d._color=0,h-=1}else if(p.right===s){if(!(f=d.left)||0!==f._color){d._color=0,d.right=p.left,p._color=1,p.left=d,l[h-2]=p,l[h-1]=s,i(d),i(p),h>=3&&((m=l[h-3]).right===d?m.right=p:m.left=p);break}p._color=1,d.left=n(1,f),d._color=0,h-=1}else{var f;if(!(f=d.left)||0!==f._color){var m;p.left=s.right,d._color=0,d.right=s.left,s._color=1,s.right=p,s.left=d,l[h-2]=s,l[h-1]=p,i(d),i(p),i(s),h>=3&&((m=l[h-3]).right===d?m.right=s:m.left=s);break}p._color=1,d.left=n(1,f),d._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return c(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new u(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new u(this,e)}}),o.at=function(e){if(e<0)return new u(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e=t.right._count)break;t=t.right}return new u(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function p(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function d(e,t){return et?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new t(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=e[l-2]).left===a?c.left=o:c.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((c=e[l-2]).left===a?c.left=s:c.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=e[l-2]).left===a?c.left=o:c.right=o),e[l-1]=o,e[l]=a,l+11&&((c=e[l-2]).right===a?c.right=o:c.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((c=e[l-2]).right===a?c.right=s:c.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=e[l-2]).right===a?c.right=o:c.left=o),e[l-1]=o,e[l]=a,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),h.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),h.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},3837:function(e,t,r){e.exports=function(e,t){var r=new d(e);return r.update(t),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(e){return Array.isArray(e)||function(e){return c.isView(e)&&!(e instanceof u)}(e)}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function d(e){this.gl=e,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.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=a(e)}var f=d.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),c=t.bind(this,!0,(function(e){if(h(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),u=!1,p=!1;if("bounds"in e)for(var d=e.bounds,f=0;f<2;++f)for(var m=0;m<3;++m)d[f][m]!==this.bounds[f][m]&&(p=!0),this.bounds[f][m]=d[f][m];if("ticks"in e)for(r=e.ticks,u=!0,this.autoTicks=!1,f=0;f<3;++f)this.tickSpacing[f]=0;else a("tickSpacing")&&(this.autoTicks=!0,p=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),p=!0,u=!0,this._firstInit=!1),p&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(f=0;f<3;++f)r[f].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{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]}],v=[{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&&(g||u)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,c=n[t],u=0;u<3;++u)if(t!==u){var h=a,p=s,d=o,f=l;c&1<0?(d[u]=-1,f[u]=0):(d[u]=0,f[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(e){};var b=[0,0,0],_=[0,0,0],w=[0,0,0];f.draw=function(e){e=e||x;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,d=n[12],f=n[13],m=n[14],k=n[15],T=(s?2:1)*this.pixelRatio*(i[3]*d+i[7]*f+i[11]*m+i[15]*k)/t.drawingBufferHeight,S=0;S<3;++S)this.lastCubeProps.cubeEdges[S]=u[S],this.lastCubeProps.axis[S]=h[S];var A=g;for(S=0;S<3;++S)y(g[S],S,this.bounds,u,h);t=this.gl;var M,E,C,P=v;for(S=0;S<3;++S)this.backgroundEnable[S]?P[S]=h[S]:P[S]=0;for(this._background.draw(r,n,i,a,P,this.backgroundColor),this._lines.bind(r,n,i,this),S=0;S<3;++S){var L=[0,0,0];h[S]>0?L[S]=a[1][S]:L[S]=a[0][S];for(var I=0;I<2;++I){var z=(S+1+I)%3,O=(S+1+(1^I))%3;this.gridEnable[z]&&this._lines.drawGrid(z,O,this.bounds,L,this.gridColor[z],this.gridWidth[z]*this.pixelRatio)}for(I=0;I<2;++I)z=(S+1+I)%3,O=(S+1+(1^I))%3,this.zeroEnable[O]&&Math.min(a[0][O],a[1][O])<=0&&Math.max(a[0][O],a[1][O])>=0&&this._lines.drawZero(z,O,this.bounds,L,this.zeroLineColor[O],this.zeroLineWidth[O]*this.pixelRatio)}for(S=0;S<3;++S){this.lineEnable[S]&&this._lines.drawAxisLine(S,this.bounds,A[S].primalOffset,this.lineColor[S],this.lineWidth[S]*this.pixelRatio),this.lineMirror[S]&&this._lines.drawAxisLine(S,this.bounds,A[S].mirrorOffset,this.lineColor[S],this.lineWidth[S]*this.pixelRatio);var R=p(b,A[S].primalMinor),D=p(_,A[S].mirrorMinor),j=this.lineTickLength;for(I=0;I<3;++I){var F=T/r[5*I];R[I]*=j[I]*F,D[I]*=j[I]*F}this.lineTickEnable[S]&&this._lines.drawAxisTicks(S,A[S].primalOffset,R,this.lineTickColor[S],this.lineTickWidth[S]*this.pixelRatio),this.lineTickMirror[S]&&this._lines.drawAxisTicks(S,A[S].mirrorOffset,D,this.lineTickColor[S],this.lineTickWidth[S]*this.pixelRatio)}function B(e){(C=[0,0,0])[e]=1}function N(e,t,r){var n=(e+1)%3,i=(e+2)%3,a=t[n],o=t[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?B(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&B(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),S=0;S<3;++S){var U=A[S].primalMinor,V=A[S].mirrorMinor,q=p(w,A[S].primalOffset);for(I=0;I<3;++I)this.lineTickEnable[S]&&(q[I]+=T*U[I]*Math.max(this.lineTickLength[I],0)/r[5*I]);var H=[0,0,0];if(H[S]=1,this.tickEnable[S]){for(-3600===this.tickAngle[S]?(this.tickAngle[S]=0,this.tickAlign[S]="auto"):this.tickAlign[S]=-1,E=1,"auto"===(M=[this.tickAlign[S],.5,E])[0]?M[0]=0:M[0]=parseInt(""+M[0]),C=[0,0,0],N(S,U,V),I=0;I<3;++I)q[I]+=T*U[I]*this.tickPad[I]/r[5*I];this._text.drawTicks(S,this.tickSize[S],this.tickAngle[S],q,this.tickColor[S],H,C,M)}if(this.labelEnable[S]){for(E=0,C=[0,0,0],this.labels[S].length>4&&(B(S),E=1),"auto"===(M=[this.labelAlign[S],.5,E])[0]?M[0]=0:M[0]=parseInt(""+M[0]),I=0;I<3;++I)q[I]+=T*U[I]*this.labelPad[I]/r[5*I];q[S]+=.5*(a[0][S]+a[1][S]),this._text.drawLabel(S,this.labelSize[S],this.labelAngle[S],q,this.labelColor[S],[0,0,0],C,M)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(e,t,r){e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],p=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=d,p[l]=d;for(var f=-1;f<=1;f+=2){h[c]=f;for(var m=-1;m<=1;m+=2)h[u]=m,t.push(h[0],h[1],h[2],p[0],p[1],p[2]),s+=1}var g=c;c=u,u=g}var y=n(e,new Float32Array(t)),v=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),x=i(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],v),b=a(e);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(e,y,x,b)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(e,t,r){e.exports=function(e,t,r,a,d){i(s,t,e),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],p(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var k=l[x][3],T=0;T<3;++T)c[x][T]=l[x][T]/k;d&&(c[x][2]*=-1),k<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(D=x);var j=-1;for(x=0;x<3;++x)(B=D^1<c[F][0]&&(F=B))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(j^D)]=D&j,N[n.log2(D^F)]=D&F;var U=7^F;U===w||U===R?(U=7^j,N[n.log2(F^U)]=U&F):N[n.log2(j^U)]=U&j;var V=g,q=w;for(S=0;S<3;++S)V[S]=q&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.Q=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);t.bg=function(e){return i(e,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){e.exports=function(e,t,r,a,s,l){var u=n(e),h=i(e,[{buffer:u,size:3}]),p=o(e);p.attributes.position.location=0;var d=new c(e,p,u,h);return d.update(t,r,a,s,l),d};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||process.global||{},l=s.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var u=c.prototype,h=[0,0];u.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(e,t,r,n,i){var o=[];function s(e,t,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[t];h||(h=u[t]=function(e,t){try{return a(e,t)}catch(r){return console.warn('error vectorizing text:"'+e+'" error:',r),{cells:[],positions:[]}}}(t,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var p=(n||12)/12,d=h.positions,f=h.cells,m=0,g=f.length;m=0;--v){var x=d[y[v]];o.push(p*x[0],-p*x[1],e)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],p=[0,0,0],d={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},f=0;f<3;++f){h[f]=o.length/3|0,s(.5*(e[0][f]+e[1][f]),t[f],r[f],12,1.25,d),p[f]=(o.length/3|0)-h[f],c[f]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function u(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,e.data,t):this.length=c(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=c(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(e,"uint16"):u(e,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,t<0?h:h.subarray(0,e.length),t),n.free(h)}else if("object"===typeof e&&"number"===typeof e.length)this.length=c(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!==typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},6405:function(e,t,r){var n=r(2931);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,p=-1/0,d=null,f=null,m=[],g=1/0,y=!1,v="raw"===e.coneSizemode,x=0;xo&&(o=n.length(_)),x&&!v){var w=2*n.distance(d,b)/(n.length(f)+n.length(_));w?(g=Math.min(g,w),y=!1):y=!0}y||(d=b,f=_),m.push(_)}var k=[s,c,h],T=[l,u,p];t&&(t[0]=k,t[1]=T),0===o&&(o=1);var S=1/o;isFinite(g)||(g=1),a.vectorScale=g;var A=e.coneSize||(v?1:.5);e.absoluteConeSize&&(A=e.absoluteConeSize*S),a.coneScale=A,x=0;for(var M=0;x=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(e){this.pickId=e},d.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=u({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var p=e.meshColor||[1,1,1,1],d=e.vertexIntensity,f=1/0,m=-1/0;if(d)if(e.vertexIntensityBounds)f=+e.vertexIntensityBounds[0],m=+e.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},d.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||h,n=e.view||h,i=e.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},d.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=t),i},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),u=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),h=o(e,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=e.LINEAR_MIPMAP_LINEAR,h.magFilter=e.LINEAR;var d=i(e),f=i(e),m=i(e),g=i(e),y=i(e),v=new p(e,h,l,u,d,f,y,m,g,a(e,[{buffer:d,type:e.FLOAT,size:4},{buffer:y,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:g,type:e.FLOAT,size:2},{buffer:f,type:e.FLOAT,size:4}]),r.traceType||"cone");return v.update(t),v}},614:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(e,t,r){var n=r(737);e.exports=function(e){return n[e]}},9165:function(e,t,r){e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(t,r,o,l);return c.update(e),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/t.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)t.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&t.drawArrays(t.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function h(e,t,r,n){for(var i=u[n],a=0;a0&&((d=u.slice())[s]+=f[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,d[0],d[1],d[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,d),o+=2+h(i,d,m,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){var n=r(7766);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=e.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>e.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var p=e.UNSIGNED_BYTE,d=e.getExtension("OES_texture_float");if(n.float&&h>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");p=e.FLOAT}else n.preferFloat&&h>0&&d&&(p=e.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new f(e,t,r,p,h,m,g,c)};var i,a,o,s,l=null;function c(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function u(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function h(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function p(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function d(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function f(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var f=0;f1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?f?e.depth=p(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(e.depth=p(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&f?e._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?e._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):f&&(e._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),y=0;yi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=c(n),o=0;o max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return i(e,a,o,null,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},5714:function(e,t,r){e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=h(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=p(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),d=0;d<1024;++d)u.data[d]=255;var f=a(t,u);f.wrap=t.REPEAT;var m=new y(t,r,o,s,l,f);return m.update(e),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,p=u.createPickShader,d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function m(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function g(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function y(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(e){this.pickId=e},v.drawTransparent=v.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||d,view:e.view||d,projection:e.projection||d,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||d,view:e.view||d,projection:e.projection||d,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],p=e.position||e.positions;if(p){var d=e.color||e.colors||[0,0,0,1],m=e.lineWidth||1,g=!1;e:for(t=1;t0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue e}h[0][r]=Math.min(h[0][r],b[r],_[r]),h[1][r]=Math.max(h[1][r],b[r],_[r])}Array.isArray(d[0])?(y=d.length>t-1?d[t-1]:d.length>0?d[d.length-1]:[0,0,0,1],v=d.length>t?d[t]:d.length>0?d[d.length-1]:[0,0,0,1]):y=v=d,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>t-1?m[t-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var k=s;if(s+=f(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(p[p.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in e){var T=e.dashes.slice();for(T.unshift(0),t=1;t1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[p,s(e,g),g]}},840:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:p,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:d,fragment:f,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),p=r(7765),d=r(1888),f=r(840),m=r(7626),g=f.meshShader,y=f.wireShader,v=f.pointShader,x=f.pickShader,b=f.pointPickShader,_=f.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,k,T,S,A,M){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=p,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=f,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=T,this.pointIds=b,this.pointVAO=S,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=M,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=k.prototype;function S(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(e){this.pickId=e},T.highlight=function(e){if(e&&this.contourEnable){for(var t=p(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;aMath.abs(t))c.rotate(a,0,0,-e*r*Math.PI*f.rotateSpeed/window.innerWidth);else if(!f._ortho){var o=-f.zoomSpeed*i*t/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},f.enableMouseListeners(),f};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),p=r(4040),d=r(799),f=r(9216)({tablet:!0,featureDetect:!0});function m(){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 g(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function y(e){return"boolean"!==typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(f=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(n){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:f})),!r)throw new Error("webgl not supported");var v=e.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!f}),_=d(r),w=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,k={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:w},T=e.axes||{},S=i(r,T);S.enable=!T.disable;var A=e.spikes||{},M=o(r,A),E=[],C=[],P=[],L=[],I=!0,z=!0,O=new Array(16),R=new Array(16),D={view:null,projection:O,model:R,_ortho:!1},j=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),F=e.cameraObject||n(t,k),B={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:x,camera:F,axes:S,axesPixels:null,spikes:M,bounds:v,objects:E,shape:j,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:y(e.autoResize),autoBounds:y(e.autoBounds),autoScale:!!e.autoScale,autoCenter:y(e.autoCenter),clipToBounds:y(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:D,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,z=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},N=[r.drawingBufferWidth/B.pixelRatio|0,r.drawingBufferHeight/B.pixelRatio|0];function U(){if(!B._stopped&&B.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*B.pixelRatio),a=0|Math.ceil(n*B.pixelRatio);if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}function V(){for(var e=E.length,t=L.length,n=0;n0&&0===P[t-1];)P.pop(),L.pop().dispose()}function q(){if(B.contextLost)return!0;r.isContextLost()&&(B.contextLost=!0,B.mouseListener.enabled=!1,B.selection.object=null,B.oncontextloss&&B.oncontextloss())}B.autoResize&&U(),window.addEventListener("resize",U),B.update=function(e){B._stopped||(e=e||{},I=!0,z=!0)},B.add=function(e){B._stopped||(e.axes=S,E.push(e),C.push(-1),I=!0,z=!0,V())},B.remove=function(e){if(!B._stopped){var t=E.indexOf(e);t<0||(E.splice(t,1),C.pop(),I=!0,z=!0,V())}},B.dispose=function(){if(!B._stopped&&(B._stopped=!0,window.removeEventListener("resize",U),t.removeEventListener("webglcontextlost",q),B.mouseListener.enabled=!1,!B.contextLost)){S.dispose(),M.dispose();for(var e=0;ex.distance)continue;for(var c=0;c1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*c+l*d,e[1]=s*u+l*f,e[2]=s*h+l*m,e[3]=s*p+l*g,e}},5964:function(e){e.exports=function(e){return e||0===e?e.toString():""}},9366:function(e,t,r){var n=r(4359);e.exports=function(e,t,r){var a=[t.style,t.weight,t.variant,t.family].join("_"),o=i[a];if(o||(o=i[a]={}),e in o)return o[e];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t.family,fontStyle:t.style,fontWeight:t.weight,fontVariant:t.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(e,s);s.triangles=!1;var c,u,h=n(e,s);if(r&&1!==r){for(c=0;c max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},p={vertex:o,fragment:l,attributes:u},d={vertex:s,fragment:l,attributes:u},f={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return y(e,h)},t.createOrtho=function(e){return y(e,p)},t.createProject=function(e){return y(e,d)},t.createPickPerspective=function(e){return y(e,f)},t.createPickOrtho=function(e){return y(e,m)},t.createPickProject=function(e){return y(e,g)}},8418:function(e,t,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p=ArrayBuffer,d=DataView;function f(e){return Array.isArray(e)||function(e){return p.isView(e)&&!(e instanceof d)}(e)}function m(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function g(e,t,r,n){return m(n,n),m(n,n),m(n,n)}function y(e,t){this.index=e,this.dataCoordinate=this.position=t}function v(e){return!0===e||e>1?1:e}function x(e,t,r,n,i,a,o,s,l,c,u,h){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),c=l.createPickOrtho(t),u=l.createPickProject(t),h=i(t),p=i(t),d=i(t),f=i(t),m=a(t,[{buffer:h,size:3,type:t.FLOAT},{buffer:p,size:4,type:t.FLOAT},{buffer:d,size:2,type:t.FLOAT},{buffer:f,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),g=new x(t,r,n,o,h,p,d,f,m,s,c,u);return g.update(e),g};var b=x.prototype;b.pickSlots=1,b.setPickBase=function(e){this.pickId=e},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],w=[0,0,0],k=[0,0,0],T=[0,0,0,1],S=[0,0,0,1],A=h.slice(),M=[0,0,0],E=[[0,0,0],[0,0,0]];function C(e){return e[0]=e[1]=e[2]=0,e}function P(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function L(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function I(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,c=r.model||h,u=r.view||h,p=r.projection||h,d=t.axesBounds,f=function(e){for(var t=E,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],_[0]=2/o.drawingBufferWidth,_[1]=2/o.drawingBufferHeight,e.bind(),l.view=u,l.projection=p,l.screenSize=_,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=f,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=t.projectScale[m],l.opacity=t.projectOpacity[m];for(var y=A,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=d[0][m]:y[12+m]=d[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,b=(m+2)%3,I=C(w),z=C(k);I[x]=1,z[b]=1;var O=g(0,0,0,P(T,I)),R=g(0,0,0,P(S,z));if(Math.abs(O[1])>Math.abs(R[1])){var D=O;O=R,R=D,D=I,I=z,z=D;var j=x;x=b,b=j}O[0]<0&&(I[x]=-1),R[1]>0&&(z[b]=-1);var F=0,B=0;for(v=0;v<4;++v)F+=Math.pow(c[4*x+v],2),B+=Math.pow(c[4*b+v],2);I[x]/=Math.sqrt(F),z[b]/=Math.sqrt(B),l.axes[0]=I,l.axes[1]=z,l.fragClipBounds[0]=L(M,f[0],m,-1e8),l.fragClipBounds[1]=L(M,f[1],m,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var z=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(e,t,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&I(t,r,n,i),a===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,_[0]=2/s.drawingBufferWidth,_[1]=2/s.drawingBufferHeight,l.screenSize=_,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=z,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function R(e,t,r,i){var a;a=f(e)?t=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},b.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},b.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(f(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(f(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){f(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=v(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l={family:e.font||"normal",style:e.fontStyle||"normal",weight:e.fontWeight||"normal",variant:e.fontVariant||"normal"},c=e.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n0){var z=0,O=b,D=[0,0,0,1],j=[0,0,0,1],F=f(d)&&f(d[0]),B=f(y)&&f(y[0]);e:for(n=0;n0?1-M[0][0]:$<0?1+M[1][0]:1,Z*=Z>0?1-M[0][1]:Z<0?1+M[1][1]:1],Y=S.cells||[],K=S.positions||[];for(T=0;Tthis.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;ar)for(e=r;et)for(e=t;e=0){for(var k=0|w.type.charAt(w.type.length-1),T=new Array(k),S=0;S=0;)A+=1;_[v]=A}var M=new Array(r.length);function E(){p.program=o.program(d,p._vref,p._fref,b,_);for(var e=0;e=0){if((f=p.charCodeAt(p.length-1)-48)<2||f>4)throw new n("","Invalid data type for attribute "+h+": "+p);s(e,t,d[0],i,f,a,h)}else{if(!(p.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+p);var f;if((f=p.charCodeAt(p.length-1)-48)<2||f>4)throw new n("","Invalid data type for attribute "+h+": "+p);l(e,t,d,i,f,a,h)}}}return a};var n=r(8866);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var c=o[a],u=new i(e,t,r,n,a,c);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),c(e,n[r],t),t},get:function(){return u},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);e["uniformMatrix"+y+"fv"](s[h],!1,p);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":e["uniform"+y+"iv"](s[h],p);break;case"v":e["uniform"+y+"fv"](s[h],p);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(e,t){if("object"!==typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(e,t,n){if("object"===typeof n){var c=h(n);Object.defineProperty(e,t,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(u=n,function(e,t,r){return e.getUniform(t.program,r[u])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var u}function h(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=0,s=0;s0)for(k=0;k<8;k++){var T=(k+1)%8;c.push(p[k],d[k],d[T],d[T],p[T],p[k]),h.push(v,y,y,y,v,v),f.push(m,g,g,g,m,m);var S=c.length;u.push([S-6,S-5,S-4],[S-3,S-2,S-1])}var A=p;p=d,d=A;var M=v;v=y,y=M;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:f}}(e,r,a,o)})),h=[],p=[],d=[],f=[];for(s=0;st)return r-1}return r},l=function(e,t,r){return er?r:e},c=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;nh-1||v>p-1||x>d-1)return n.create();var b,_,w,k,T,S,A=a[0][f],M=a[0][y],E=a[1][m],C=a[1][v],P=a[2][g],L=(o-A)/(M-A),I=(c-E)/(C-E),z=(u-P)/(a[2][x]-P);switch(isFinite(L)||(L=.5),isFinite(I)||(I=.5),isFinite(z)||(z=.5),r.reversedX&&(f=h-1-f,y=h-1-y),r.reversedY&&(m=p-1-m,v=p-1-v),r.reversedZ&&(g=d-1-g,x=d-1-x),r.filled){case 5:T=g,S=x,w=m*d,k=v*d,b=f*d*p,_=y*d*p;break;case 4:T=g,S=x,b=f*d,_=y*d,w=m*d*h,k=v*d*h;break;case 3:w=m,k=v,T=g*p,S=x*p,b=f*p*d,_=y*p*d;break;case 2:w=m,k=v,b=f*p,_=y*p,T=g*p*h,S=x*p*h;break;case 1:b=f,_=y,T=g*h,S=x*h,w=m*h*d,k=v*h*d;break;default:b=f,_=y,w=m*h,k=v*h,T=g*h*p,S=x*h*p}var O=i[b+w+T],R=i[b+w+S],D=i[b+k+T],j=i[b+k+S],F=i[_+w+T],B=i[_+w+S],N=i[_+k+T],U=i[_+k+S],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,O,F,L),n.lerp(q,R,B,L),n.lerp(H,D,N,L),n.lerp(G,j,U,L);var W=n.create(),$=n.create();n.lerp(W,V,H,I),n.lerp($,q,G,I);var Z=n.create();return n.lerp(Z,W,$,z),Z}(t,e,d)},m=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=f(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=f(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=f(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],y=t[0][0],v=t[0][1],x=t[0][2],b=t[1][0],_=t[1][1],w=t[1][2],k=function(e){var t=e[0],r=e[1],n=e[2];return!(tb||r_||nw)},T=10*n.distance(t[0],t[1])/i,S=T*T,A=1,M=0,E=r.length;E>1&&(A=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,l=0;lM&&(M=j),R.push(j),g.push({points:L,velocities:I,divergences:R});for(var F=0;F<100*i&&L.lengthS&&n.scale(B,B,T/Math.sqrt(N)),n.add(B,B,P),z=f(B),n.squaredDistance(O,B)-S>-1e-4*S&&(L.push(B),O=B,I.push(z),D=m(B,z),j=n.length(D),isFinite(j)&&j>M&&(M=j),R.push(j)),P=B}}var U=o(g,e.colormap,M,A);return h?U.tubeScale=h:(0===M&&(M=1),U.tubeScale=.5*u*A/M),U};var u=r(6740),h=r(6405).createMesh;e.exports.createTubeMesh=function(e,t){return h(e,t,{shaders:u,traceType:"streamtube"})}},990:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);t.createShader=function(e){var t=n(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=n(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},9499:function(e,t,r){e.exports=function(e){var t=e.gl,r=v(t),n=b(t),s=x(t),l=_(t),c=i(t),u=a(t,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(t),p=a(t,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),d=i(t),f=a(t,[{buffer:d,size:2,type:t.FLOAT}]),m=o(t,1,M,t.RGBA,t.UNSIGNED_BYTE);m.minFilter=t.LINEAR,m.magFilter=t.LINEAR;var g=new E(t,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,p,d,f,[0,0,0]),y={levels:[[],[],[]]};for(var k in e)y[k]=e[k];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),p=r(3711),d=r(6760),f=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,b=y.createPickShader,_=y.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],S=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function A(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=S[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var M=256;function E(e,t,r,n,i,a,o,l,c,u,p,d,f,m,g){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=p,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=f,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.genColormap=function(e,t){var r=!1,n=u([l({colormap:e,nshades:M,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;re&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(e){this.pickId=e};var P=[0,0,0],L={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||P,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],d(l,e.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=e.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=k.slice(),R=[1,0,0,0,1,0,0,0,1];function D(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=e.model||k,n.view=e.view||k,n.projection=e.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=f(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=R,n.vertexColor=this.vertexColor;var s=O;for(d(s,n.view,n.model),d(s,n.projection,s),f(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=I(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var p=this._contourVAO;for(p.bind(),i=0;i<3;++i)for(h.uniforms.permutation=S[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,p=0;p<2;++p)for(var d=i+u,f=s+p,g=h*(p?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(d,f)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]Math.abs(_-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();c.assign(e.lo(1,1).hi(r[0],r[1]),t),c.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),c.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),c.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),c.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},C.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=F(e.contourWidth,Number)),"showContour"in e&&(this.showContour=F(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=F(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=N(e.contourColor)),"contourProject"in e&&(this.contourProject=F(e.contourProject,(function(e){return F(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=N(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=F(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=F(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in e||"coords"in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(e.ticks){var u=e.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var d=u[o];if((Array.isArray(d)||d.length)&&(d=h(d)),d.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var f=h(d.data,a);f.stride[o]=d.stride[0],f.stride[1^o]=0,this.padField(this._field[o],f)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xe=0;xe<5;++xe)J.pop();U-=1}continue e}J.push(ne[0],ne[1],oe[0],oe[1],ne[2]),U+=1}}re.push(U)}this._contourOffsets[Q]=te,this._contourCounts[Q]=re}var be=s.mallocFloat(J.length);for(o=0;os||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=f(o,t.stride.slice()),c=0;"float32"===r?c=e.FLOAT:"float64"===r?(c=e.FLOAT,l=!1,r="float32"):"uint8"===r?c=e.UNSIGNED_BYTE:(c=e.UNSIGNED_BYTE,l=!1,r="uint8");var h,d,g=0;if(2===o.length)g=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=e.ALPHA;else if(2===o[2])g=e.LUMINANCE_ALPHA;else if(3===o[2])g=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=e.RGBA}}c!==e.FLOAT||e.getExtension("OES_texture_float")||(c=e.UNSIGNED_BYTE,l=!1);var y=t.size;if(l)h=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var v=[o[2],o[2]*o[0],1];d=a.malloc(y,r);var x=n(d,o,v,0);"float32"!==r&&"float64"!==r||c!==e.UNSIGNED_BYTE?i.assign(x,t):u(x,t),h=d.subarray(0,y)}var b=m(e);return e.texImage2D(e.TEXTURE_2D,0,g,o[0],o[1],0,g,c,h),l||a.free(d),new p(e,b,o[0],o[1],g,c)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var u=function(e,t){i.muls(e,t,255)};function h(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function p(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var d=p.prototype;function f(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function m(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function g(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new p(e,o,t,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return h(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return h(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,h(this,this._shape[0],e),e}}}),d.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},d.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=c(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,c,h){var p=h.dtype,d=h.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=f(d,h.stride.slice());if("float32"===p?m=e.FLOAT:"float64"===p?(m=e.FLOAT,y=!1,p="float32"):"uint8"===p?m=e.UNSIGNED_BYTE:(m=e.UNSIGNED_BYTE,y=!1,p="uint8"),2===d.length)g=e.LUMINANCE,d=[d[0],d[1],1],h=n(h.data,d,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])g=e.ALPHA;else if(2===d[2])g=e.LUMINANCE_ALPHA;else if(3===d[2])g=e.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=e.RGBA}d[2]}if(g!==e.LUMINANCE&&g!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?e.texImage2D(e.TEXTURE_2D,o,s,d[0],d[1],0,s,l,h.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,d[0],d[1],s,l,h.data):x?e.texImage2D(e.TEXTURE_2D,o,s,d[0],d[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,d[0],d[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var b;b=l===e.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var _=n(b,d,[d[2],d[2]*d[0],1]);m===e.FLOAT&&l===e.UNSIGNED_BYTE?u(_,h):i.assign(_,h),x?e.texImage2D(e.TEXTURE_2D,o,s,d[0],d[1],0,s,l,b.subarray(0,v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,d[0],d[1],s,l,b.subarray(0,v)),l===e.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},1433:function(e){e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},3126:function(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},3990:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},244:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681:function(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},5137:function(e,t,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},7636:function(e){e.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},6894:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=t[0],e[1]=i+o*c-s*l,e[2]=a+o*l+s*c,e}},109:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=i+s*l+o*c,e[1]=t[1],e[2]=a+s*c-o*l,e}},8692:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=i+o*c-s*l,e[1]=a+o*l+s*c,e[2]=t[2],e}},2447:function(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},6621:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},8489:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},1463:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},3066:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},492:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},5673:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},264:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,p=c*a+o*i-s*n,d=-o*n-s*i-l*a;return e[0]=u*c+d*-o+h*-l-p*-s,e[1]=h*c+d*-s+p*-o-u*-l,e[2]=p*c+d*-l+u*-s-h*-o,e}},4361:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},2335:function(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},2933:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},7536:function(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},3750:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},6808:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},2573:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},160:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2334:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},3576:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},1498:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},5177:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},9131:function(e,t,r){var n=r(5177),i=r(9288);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},9288:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4844:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},4578:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},7960:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},483:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},6860:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},5352:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},4041:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,p=c*a+o*i-s*n,d=-o*n-s*i-l*a;return e[0]=u*c+d*-o+h*-l-p*-s,e[1]=h*c+d*-s+p*-o-u*-l,e[2]=p*c+d*-l+u*-s-h*-o,e[3]=t[3],e}},1848:function(e,t,r){var n=r(4905),i=r(6468);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r0)continue;r=e.slice(0,1).join("")}return B(r),L+=r.length,(M=M.slice(r.length)).length}}function $(){return/[^a-fA-F0-9]/.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function Z(){return"."===t||/[eE]/.test(t)?(M.push(t),A=m,r=t,T+1):"x"===t&&1===M.length&&"0"===M[0]?(A=_,M.push(t),r=t,T+1):/[^\d]/.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function X(){return"f"===t&&(M.push(t),r=t,T+=1),/[eE]/.test(t)?(M.push(t),r=t,T+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function Y(){if(/[^\d\w_]/.test(t)){var e=M.join("");return A=F[e]?v:j[e]?y:g,B(M.join("")),A=l,T}return M.push(t),r=t,T+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,p=2,d=3,f=4,m=5,g=6,y=7,v=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(e,t,r){var n=r(6852);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(e,t,r){var n=r(620);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var n=r(5874);e.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},3236:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m}},8954:function(e,t,r){e.exports=function(e,t){var r=e.length;if(0===r)throw new Error("Must have at least d+1 points");var i=e[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=e.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),p=h.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var f=l.slice(),m=0;m<=i;++m)m===u&&(f[m]=-1);var g=f[0];f[0]=f[1],f[1]=g;var y=new a(f,new Array(i+1),!0);p[u]=y,d[u]=y}for(d[i+1]=h,u=0;u<=i;++u){f=p[u].vertices;var v=p[u].adjacent;for(m=0;m<=i;++m){var x=f[m];if(x<0)v[m]=h;else for(var b=0;b<=i;++b)p[b].vertices.indexOf(x)<0&&(v[m]=p[b])}}var _=new c(i,o,d),w=!!t;for(u=i+1;u0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var p=u[h];i[h]=p<0?t:a[p]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}return null},u.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var p=a[u];a[u]=e;var d=this.orient();if(a[u]=p,d<0){s=h;continue e}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,c.push(t);for(var p=[];h.length>0;){var d=(t=h.pop()).vertices,f=t.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=f[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)v[b]<0?(x=b,l[b]=e):l[b]=i[v[b]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var _=y.adjacent,w=d.slice(),k=f.slice(),T=new a(w,k,!0);u.push(T);var S=_.indexOf(t);if(!(S<0))for(_[S]=T,k[m]=y,w[g]=-1,k[g]=t,f[g]=T,T.flip(),b=0;b<=n;++b){var A=w[b];if(!(A<0||A===r)){for(var M=new Array(n-1),E=0,C=0;C<=n;++C){var P=w[C];P<0||C===b||(M[E++]=P)}p.push(new o(M,T,b))}}}}}for(p.sort(s),g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&e)){var h=o[0];o[0]=o[1],o[1]=h}t.push(o)}}return t}},3352:function(e,t,r){var n=r(2478);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new y(g(e)):new y(null)};var a=i.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=g(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function c(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function u(e,t,r){for(var n=0;n=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function p(e,t){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(t+1)?l(this,e):this.left.insert(e):this.left=g([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=g([e]);else{var r=n.ge(this.leftPoints,e,f),i=n.ge(this.rightPoints,e,m);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]3*(t-1)?c(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?c(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,f);athis.mid?this.right&&(r=this.right.queryPoint(e,t))?r:h(this.rightPoints,e,t):p(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return ethis.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:tthis.mid?h(this.rightPoints,e,r):p(this.leftPoints,r)};var v=y.prototype;v.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},v.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},v.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},v.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(e){e.exports=!0},7163:function(e){function t(e){return!!e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"===typeof e.readFloatLE&&"function"===typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},5219:function(e){e.exports=function(e){for(var t,r=e.length,n=0;n13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},395:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},2652:function(e,t,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),p=[0,0,0,0],d=[[0,0,0],[0,0,0],[0,0,0]],f=[0,0,0];function m(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,g,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,e))return!1;if(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var v,x,b=u[3],_=u[7],w=u[11],k=u[12],T=u[13],S=u[14],A=u[15];if(0!==b||0!==_||0!==w){if(p[0]=b,p[1]=_,p[2]=w,p[3]=A,!s(h,h))return!1;l(h,h),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(g,p,h)}else g[0]=g[1]=g[2]=0,g[3]=1;if(t[0]=k,t[1]=T,t[2]=S,x=u,(v=d)[0][0]=x[0],v[0][1]=x[1],v[0][2]=x[2],v[1][0]=x[4],v[1][1]=x[5],v[1][2]=x[6],v[2][0]=x[8],v[2][1]=x[9],v[2][2]=x[10],r[0]=c.length(d[0]),c.normalize(d[0],d[0]),i[0]=c.dot(d[0],d[1]),m(d[1],d[1],d[0],1,-i[0]),r[1]=c.length(d[1]),c.normalize(d[1],d[1]),i[0]/=r[1],i[1]=c.dot(d[0],d[2]),m(d[2],d[2],d[0],1,-i[1]),i[2]=c.dot(d[1],d[2]),m(d[2],d[2],d[1],1,-i[2]),r[2]=c.length(d[2]),c.normalize(d[2],d[2]),i[1]/=r[2],i[2]/=r[2],c.cross(f,d[1],d[2]),c.dot(d[0],f)<0)for(var M=0;M<3;M++)r[M]*=-1,d[M][0]*=-1,d[M][1]*=-1,d[M][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(y[0]=-y[0]),d[0][2]>d[2][0]&&(y[1]=-y[1]),d[1][0]>d[0][1]&&(y[2]=-y[2]),!0}},4335:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7442:function(e,t,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:p(),scale:p(1),skew:p(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function p(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,h){if(0===o(t)||0===o(r))return!1;var p=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!p||!d)&&(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}},7182:function(e,t,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},1811:function(e,t,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),p=[0,0,0];function d(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(e){return new d((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var f=d.prototype;f.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=t[r+1]-t[r],p=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)p[c]=s[l++];var f=this.nextMatrix;for(c=0;c<16;++c)f[c]=s[l++],d=d&&p[c]===f[c];if(u<1e-6||d)for(c=0;c<16;++c)o[c]=p[c];else i(o,p,f,(e-t[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*b}},f.idle=function(e){if(!(e1&&n(e[o[u-2]],e[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(e[s[u-2]],e[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,p=(i=0,o.length);i0;--d)r[h++]=s[d];return r};var n=r(3250)[3]},351:function(e,t,r){e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function c(e,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||c!==i||u!==a||l(s))&&(r=0|e,i=c||0,a=u||0,t&&t(r,i,a,o))}function u(e){c(0,e)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function p(e){l(e)&&t&&t(r,i,a,o)}function d(e){0===n.buttons(e)?c(0,e):c(r,e)}function f(e){c(r|n.buttons(e),e)}function m(e){c(r&~n.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",d),e.addEventListener("mousedown",f),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",u),e.addEventListener("mouseenter",u),e.addEventListener("mouseout",u),e.addEventListener("mouseover",u),e.addEventListener("blur",h),e.addEventListener("keyup",p),e.addEventListener("keydown",p),e.addEventListener("keypress",p),e!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}g();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",d),e.removeEventListener("mousedown",f),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseout",u),e.removeEventListener("mouseover",u),e.removeEventListener("blur",h),e.removeEventListener("keyup",p),e.removeEventListener("keydown",p),e.removeEventListener("keypress",p),e!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(e,t){function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<=0)return 1< 0"),"function"!==typeof e.vertex&&t("Must specify vertex creation function"),"function"!==typeof e.cell&&t("Must specify cell creation function"),"function"!==typeof e.phase&&t("Must specify phase function");for(var s=e.getters||[],l=new Array(a),c=0;c=0?l[c]=!0:l[c]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,l)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],p=a.data,d=0|a.offset,f=0|a.stride[0],m=0|a.stride[1],g=d,y=0|-f,v=0,x=0|-m,b=0,_=-f-m|0,w=0,k=0|f,T=m-f*u|0,S=0,A=0,M=0,E=2*u|0,C=n(E),P=n(E),L=0,I=0,z=-1,O=-1,R=0,D=0|-u,j=0|u,F=0,B=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(S=0;S0){if(A=1,C[L++]=r(p[g],o,s,l),g+=k,u>0)for(S=1,c=p[g],I=C[L]=r(c,o,s,l),R=C[L+z],F=C[L+D],U=C[L+B],I===R&&I===F&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,R,F,U,o,s,l),V=P[L]=M++),L+=1,g+=k,S=2;S0)for(S=1,c=p[g],I=C[L]=r(c,o,s,l),R=C[L+z],F=C[L+D],U=C[L+B],I===R&&I===F&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,R,F,U,o,s,l),V=P[L]=M++,U!==F&&t(P[L+D],V,b,w,F,U,o,s,l)),L+=1,g+=k,S=2;S0){if(S=1,C[L++]=r(p[g],o,s,l),g+=k,h>0)for(A=1,c=p[g],I=C[L]=r(c,o,s,l),F=C[L+D],R=C[L+z],U=C[L+B],I===F&&I===R&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,F,R,U,o,s,l),V=P[L]=M++),L+=1,g+=k,A=2;A0)for(A=1,c=p[g],I=C[L]=r(c,o,s,l),F=C[L+D],R=C[L+z],U=C[L+B],I===F&&I===R&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,F,R,U,o,s,l),V=P[L]=M++,U!==F&&t(P[L+D],V,w,v,U,F,o,s,l)),L+=1,g+=k,A=2;A2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"===typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(a=u[t])return a;for(var r=e.length,n=[h,p],i=1;i<=r;++i)n.push(d(i));var a=f.apply(void 0,n);return u[t]=a,a}(r)(e,t)}},4317:function(e){function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|e[1];b>0;){b<64?(c=b,b=0):(c=64,b-=64),n=y+x*h+b*p,o=v+x*f+b*m;var _=0,w=0,k=0,T=d,S=h-u*d,A=p-l*h,M=g,E=f-u*g,C=m-l*f;for(k=0;k0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|e[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=d+m*u+g*c,o=f+m*p+g*h;var y=0,v=0,x=u,b=c-l*u,_=p,w=h-l*p;for(v=0;v0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|e[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|e[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+v*p+x*u+b*h,o=y+v*m+x*d+b*f;var _=0,w=0,k=0,T=p,S=u-c*p,A=h-s*u,M=m,E=d-c*m,C=f-s*d;for(k=0;kr;){y=0,v=m-o;t:for(g=0;gb)break t;v+=h,y+=p}for(y=m,v=m-o,g=0;g>1,H=q-N,G=q+N,W=U,$=H,Z=q,X=G,Y=V,K=i+1,J=a-1,Q=!0,ee=0,te=0,re=0,ne=h,ie=t(ne),ae=t(ne);S=l*W,A=l*$,B=s;e:for(T=0;T0){g=W,W=$,$=g;break e}if(re<0)break e;B+=d}S=l*X,A=l*Y,B=s;e:for(T=0;T0){g=X,X=Y,Y=g;break e}if(re<0)break e;B+=d}S=l*W,A=l*Z,B=s;e:for(T=0;T0){g=W,W=Z,Z=g;break e}if(re<0)break e;B+=d}S=l*$,A=l*Z,B=s;e:for(T=0;T0){g=$,$=Z,Z=g;break e}if(re<0)break e;B+=d}S=l*W,A=l*X,B=s;e:for(T=0;T0){g=W,W=X,X=g;break e}if(re<0)break e;B+=d}S=l*Z,A=l*X,B=s;e:for(T=0;T0){g=Z,Z=X,X=g;break e}if(re<0)break e;B+=d}S=l*$,A=l*Y,B=s;e:for(T=0;T0){g=$,$=Y,Y=g;break e}if(re<0)break e;B+=d}S=l*$,A=l*Z,B=s;e:for(T=0;T0){g=$,$=Z,Z=g;break e}if(re<0)break e;B+=d}S=l*X,A=l*Y,B=s;e:for(T=0;T0){g=X,X=Y,Y=g;break e}if(re<0)break e;B+=d}for(S=l*W,A=l*$,M=l*Z,E=l*X,C=l*Y,P=l*U,L=l*q,I=l*V,F=0,B=s,T=0;T0)){if(re<0){for(S=l*b,A=l*K,M=l*J,B=s,T=0;T0)for(;;){for(_=s+J*l,F=0,T=0;T0)){for(_=s+J*l,F=0,T=0;TV){e:for(;;){for(_=s+K*l,F=0,B=s,T=0;T1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,c)}},446:function(e,t,r){var n=r(7640),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},9618:function(e,t,r){var n=r(7163),i="undefined"!==typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"===typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"===typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"===typeof e&&((l=0|e)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"===typeof t&&((l=0|t)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"===typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"===typeof e&&e>=0&&(i+=c*(a=0|e),o-=a),"number"===typeof t&&t>=0&&(i+=u*(a=0|t),s-=a),"number"===typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,p=Math.ceil;return"number"===typeof e&&((h=0|e)<0?(u+=s*(i-1),i=p(-i/h)):i=p(i/h),s*=h),"number"===typeof t&&((h=0|t)<0?(u+=l*(a-1),a=p(-a/h)):a=p(a/h),l*=h),"number"===typeof r&&((h=0|r)<0?(u+=c*(o-1),o=p(-o/h)):o=p(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"===typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,c){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],p=this.stride[1],d=this.stride[2],f=this.stride[3];return"number"===typeof e&&e>=0&&(a+=h*(o=0|e),s-=o),"number"===typeof t&&t>=0&&(a+=p*(o=0|t),l-=o),"number"===typeof r&&r>=0&&(a+=d*(o=0|r),c-=o),"number"===typeof i&&i>=0&&(a+=f*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,p,d,f,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],p=this.stride[3],d=this.offset,f=0,m=Math.ceil;return"number"===typeof e&&((f=0|e)<0?(d+=c*(a-1),a=m(-a/f)):a=m(a/f),c*=f),"number"===typeof t&&((f=0|t)<0?(d+=u*(o-1),o=m(-o/f)):o=m(o/f),u*=f),"number"===typeof r&&((f=0|r)<0?(d+=h*(s-1),s=m(-s/f)):s=m(s/f),h*=f),"number"===typeof i&&((f=0|i)<0?(d+=p*(l-1),l=m(-l/f)):l=m(l/f),p*=f),new n(this.data,a,o,s,l,c,u,h,p,d)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,c,u,h){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],p=this.shape[4],d=this.stride[0],f=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"===typeof e&&e>=0&&(o+=d*(s=0|e),l-=s),"number"===typeof t&&t>=0&&(o+=f*(s=0|t),c-=s),"number"===typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"===typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"===typeof a&&a>=0&&(o+=y*(s=0|a),p-=s),new n(this.data,l,c,u,h,p,d,f,m,g,y,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],p=this.stride[1],d=this.stride[2],f=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"===typeof e&&((y=0|e)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"===typeof t&&((y=0|t)<0?(g+=p*(s-1),s=v(-s/y)):s=v(s/y),p*=y),"number"===typeof r&&((y=0|r)<0?(g+=d*(l-1),l=v(-l/y)):l=v(l/y),d*=y),"number"===typeof i&&((y=0|i)<0?(g+=f*(c-1),c=v(-c/y)):c=v(c/y),f*=y),"number"===typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,p,d,f,m,g)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,c[e][0]):n(e,c[e],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,c.array[0])([]);"number"===typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===a)for(a=0,s=0;s>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e===e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa){var b=i[c],_=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(y[w]*m[k]-y[k]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa?1/Math.sqrt(d):0,c=0;c<3;++c)p[c]*=d;i[o]=p}return i}},4081:function(e){e.exports=function(e,t,r,n,i,a,o,s,l,c){var u=t+a+c;if(h>0){var h=Math.sqrt(u+1);e[0]=.5*(o-l)/h,e[1]=.5*(s-n)/h,e[2]=.5*(r-a)/h,e[3]=.5*h}else{var p=Math.max(t,a,c);h=Math.sqrt(2*p-u+1),t>=p?(e[0]=.5*h,e[1]=.5*(i+r)/h,e[2]=.5*(s+n)/h,e[3]=.5*(o-l)/h):a>=p?(e[0]=.5*(r+i)/h,e[1]=.5*h,e[2]=.5*(l+o)/h,e[3]=.5*(s-n)/h):(e[0]=.5*(n+s)/h,e[1]=.5*(o+l)/h,e[2]=.5*h,e[3]=.5*(r-i)/h)}return e}},9977:function(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function c(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function u(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=c(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function h(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var p=h.prototype;p.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},p.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;u(t,t);var r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},p.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},p.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},p.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},p.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],p=i[8],d=u*a+h*o+p*s,f=l(u-=a*d,h-=o*d,p-=s*d);u/=f,h/=f,p/=f;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*p,b=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*p);m/=b,g/=b,y/=b;var _=u*t+a*r,w=h*t+o*r,k=p*t+s*r;this.center.move(e,_,w,k);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(e,Math.log(T))},p.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],p=i[9],d=i[2],f=i[6],m=i[10],g=t*a+r*u,y=t*o+r*h,v=t*s+r*p,x=-(f*v-m*y),b=-(m*g-d*v),_=-(d*y-f*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=c(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var T=this.computedRotation,S=T[0],A=T[1],M=T[2],E=T[3],C=S*w+E*x+A*_-M*b,P=A*w+E*b+M*x-S*_,L=M*w+E*_+S*b-A*x,I=E*w-S*x-A*b-M*_;if(n){x=d,b=f,_=m;var z=Math.sin(n)/l(x,b,_);x*=z,b*=z,_*=z,I=I*(w=Math.cos(t))-(C=C*w+I*x+P*_-L*b)*x-(P=P*w+I*b+L*x-C*_)*b-(L=L*w+I*_+C*b-P*x)*_}var O=c(C,P,L,I);O>1e-6?(C/=O,P/=O,L/=O,I/=O):(C=P=L=0,I=1),this.rotation.set(e,C,P,L,I)},p.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-t[c],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},p.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},p.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),u(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(e);var h=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},p.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},p.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},p.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},p.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]}},p.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},1371:function(e,t,r){var n=r(3233);e.exports=function(e,t,r){return n(r="undefined"!==typeof r?r+"":" ",t)+e}},3202:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},3088:function(e,t,r){e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var p=a[h][r],d=0;d0&&(o=f,s=m,l=h)}return i||o&&u(o,l),s}function p(e,r){var i=a[r][e][0],o=[e];u(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],c=e,p=o[1],d=h(l,c,!0);if(n(t[l],t[c],t[p],t[d])<0)break;o.push(e),s=h(l,c)}return o}for(o=0;o0;){a[0][o].length;var m=p(o,d);(l=m)[1]===l[l.length-1]?f.push.apply(f,m):(f.length>0&&c.push(f),f=m)}f.length>0&&c.push(f)}return c};var n=r(3140)},5609:function(e,t,r){e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s0;){i[d=o.pop()]=!1;var c=r[d];for(s=0;s0}))).length,g=new Array(m),y=new Array(m);for(d=0;d0;){var F=D.pop(),B=E[F];l(B,(function(e,t){return e-t}));var N,U=B.length,V=j[F];for(0===V&&(N=[q=f[F]]),d=0;d=0||(j[H]=1^V,D.push(H),0===V&&(R(q=f[H])||(q.reverse(),N.push(q))))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(e,t){for(var r=new Array(e),n=0;n0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?v:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),v)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(e){for(var t={},r=0;r=c?(T=1,v=c+2*p+f):v=p*(T=-p/c)+f):(T=0,d>=0?(S=0,v=f):-d>=h?(S=1,v=h+2*d+f):v=d*(S=-d/h)+f);else if(S<0)S=0,p>=0?(T=0,v=f):-p>=c?(T=1,v=c+2*p+f):v=p*(T=-p/c)+f;else{var A=1/k;v=(T*=A)*(c*T+u*(S*=A)+2*p)+S*(u*T+h*S+2*d)+f}else T<0?(b=h+d)>(x=u+p)?(_=b-x)>=(w=c-2*u+h)?(T=1,S=0,v=c+2*p+f):v=(T=_/w)*(c*T+u*(S=1-T)+2*p)+S*(u*T+h*S+2*d)+f:(T=0,b<=0?(S=1,v=h+2*d+f):d>=0?(S=0,v=f):v=d*(S=-d/h)+f):S<0?(b=c+p)>(x=u+d)?(_=b-x)>=(w=c-2*u+h)?(S=1,T=0,v=h+2*d+f):v=(T=1-(S=_/w))*(c*T+u*S+2*p)+S*(u*T+h*S+2*d)+f:(S=0,b<=0?(T=1,v=c+2*p+f):p>=0?(T=0,v=f):v=p*(T=-p/c)+f):(_=h+d-u-p)<=0?(T=0,S=1,v=h+2*d+f):_>=(w=c-2*u+h)?(T=1,S=0,v=c+2*p+f):v=(T=_/w)*(c*T+u*(S=1-T)+2*p)+S*(u*T+h*S+2*d)+f;var M=1-T-S;for(l=0;l0){var c=e[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},3233:function(e){var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],c=r[1]-n[1],u=e[2]-n[2],h=t[2]-n[2],d=r[2]-n[2],f=a*c,m=o*l,g=o*s,y=i*c,v=i*l,x=a*s,b=u*(f-m)+h*(g-y)+d*(v-x),_=7771561172376103e-31*((Math.abs(f)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(v)+Math.abs(x))*Math.abs(d));return b>_||-b>_?b:p(e,t,r,n)}];function f(e){var t=d[e.length];return t||(t=d[e.length]=u(e.length)),t.apply(void 0,e)}function m(e,t,r,n,i,a,o){return function(t,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(l+=1)=n?(i=h,(l+=1)>1,c=t[2*l+1];if(c===a)return l;a>1,c=t[2*l+1];if(c===a)return l;a>1,c=t[2*l+1];if(c===a)return l;a0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014:function(e,t,r){var n=r(3105),i=r(4623);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),c=i(t[0],t[1]);return(s=i(l,e[2])-i(c,t[2]))||i(l+e[2],a)-i(c+t[2],o);default:var u=e.slice(0);u.sort();var h=t.slice(0);h.sort();for(var p=0;p>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(e,t){for(var r=new Array(e.length),i=0,o=r.length;i=e.length||0!==a(e[g],s)););}return r}function h(e,t){if(t<0)return[];for(var r=[],i=(1<>>u&1&&c.push(i[u]);t.push(c)}return s(t)},t.skeleton=h,t.boundary=function(e){for(var t=[],r=0,n=e.length;r>1:(e>>1)-1}function x(e){for(var t=y(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n0;){var r=v(e);if(!(r>=0&&t0){var e=T[0];return g(0,A-1),A-=1,x(0),e}return-1}function w(e,t){var r=T[e];return c[r]===t?e:(c[r]=-1/0,b(e),_(),c[r]=t,b((A+=1)-1))}function k(e){if(!u[e]){u[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),S[t]>=0&&w(S[t],m(t)),S[r]>=0&&w(S[r],m(r))}}var T=[],S=new Array(a);for(h=0;h>1;h>=0;--h)x(h);for(;;){var M=_();if(M<0||c[M]>r)break;k(M)}var E=[];for(h=0;h=0&&r>=0&&t!==r){var n=S[t],i=S[r];n!==i&&P.push([n,i])}})),i.unique(i.normalize(P)),{positions:E,edges:P}};var n=r(3250),i=r(2014)},1303:function(e,t,r){e.exports=function(e,t){var r,a,o,s;if(t[0][0]t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(e,t){var r,i,a,o;if(t[0][0]t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),c=Math.min(t[0][1],t[1][1]),u=Math.max(t[0][1],t[1][1]);return lu?s-u:l-u}r=t[1],i=t[0]}e[0][1]0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=c(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=c(e.right,t))return l;e=e.left}}return r}function u(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function h(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=c(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var u=c(this.slabs[t-1],e);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[t];if(h.length>0){var p=n.ge(h,e[1],l);if(p=h.length)return i;d=h[p]}}if(d.start)if(s){var f=a(s[0],s[1],[e[0],d.y]);s[0][0]>s[1][0]&&(f=-f),f>0&&(i=d.index)}else i=d.index;else d.y!==e[1]&&(i=d.index)}}}return i}},5202:function(e,t,r){var n=r(1944),i=r(8210);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(e,t,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return function(e,t){var r,n,o,s,l,c,u,h,p,d=1,f=e.length,m="";for(n=0;n=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?p="":(p=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?p+r+l:"0"===c?p+l+r:l+p+r)}return m}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},3711:function(e,t,r){e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;sn|0},vertex:function(e,t,r,n,i,a,o,s,l,c,u,h,p){var d=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==d&&15!==d)switch(d){case 0:case 15:u.push([e-.5,t-.5]);break;case 1:u.push([e-.25-.25*(n+r-2*p)/(r-n),t-.25-.25*(i+r-2*p)/(r-i)]);break;case 2:u.push([e-.75-.25*(-n-r+2*p)/(n-r),t-.25-.25*(a+n-2*p)/(n-a)]);break;case 3:u.push([e-.5,t-.5-.5*(i+r+a+n-4*p)/(r-i+n-a)]);break;case 4:u.push([e-.25-.25*(a+i-2*p)/(i-a),t-.75-.25*(-i-r+2*p)/(i-r)]);break;case 5:u.push([e-.5-.5*(n+r+a+i-4*p)/(r-n+i-a),t-.5]);break;case 6:u.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([e-.75-.25*(a+i-2*p)/(i-a),t-.75-.25*(a+n-2*p)/(n-a)]);break;case 8:u.push([e-.75-.25*(-a-i+2*p)/(a-i),t-.75-.25*(-a-n+2*p)/(a-n)]);break;case 9:u.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([e-.5-.5*(-n-r-a-i+4*p)/(n-r+a-i),t-.5]);break;case 11:u.push([e-.25-.25*(-a-i+2*p)/(a-i),t-.75-.25*(i+r-2*p)/(r-i)]);break;case 12:u.push([e-.5,t-.5-.5*(-i-r-a-n+4*p)/(i-r+a-n)]);break;case 13:u.push([e-.75-.25*(n+r-2*p)/(r-n),t-.25-.25*(-a-n+2*p)/(a-n)]);break;case 14:u.push([e-.25-.25*(-n-r+2*p)/(n-r),t-.25-.25*(-i-r+2*p)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},665:function(e,t,r){var n=r(3202);e.exports=o;var i=96;function a(e,t){var r=n(getComputedStyle(e).getPropertyValue(t));return r[0]*o(r[1],e)}function o(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),t!==window&&t!==document||(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":return function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var n=a(r,"font-size")/128;return t.removeChild(r),n}(e,t);case"em":return a(t,"font-size");case"rem":return a(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}},7261:function(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.up||[0,1,0],n=e.right||h(r),i=e.radius||1,a=e.theta||0,u=e.phi||0;if(t=[].slice.call(t,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in e){var d=e.eye,f=[d[0]-t[0],d[1]-t[1],d[2]-t[2]];o(n,f,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(f[0],f[1],f[2]);var m=l(r,f)/i,g=l(n,f)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new p(e.zoomMin,e.zoomMax,t,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e){return Math.min(1,Math.max(-1,e))}function h(e){var t=Math.abs(e[0]),r=Math.abs(e[1]),n=Math.abs(e[2]),i=[0,0,0];t>Math.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function p(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var d=p.prototype;d.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},d.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},d.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,u+=r[a]*r[a],t[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var p=this.computedToward;o(p,t,r),s(p,p);var d=Math.exp(this.computedRadius[0]),f=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(f),y=Math.sin(f),v=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*v,w=y*v,k=x,T=-g*x,S=-y*x,A=v,M=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=_*r[a]+w*p[a]+k*t[a];E[4*a+1]=T*r[a]+S*p[a]+A*t[a],E[4*a+2]=C,E[4*a+3]=0}var P=E[1],L=E[5],I=E[9],z=E[2],O=E[6],R=E[10],D=L*R-I*O,j=I*z-P*R,F=P*O-L*z,B=c(D,j,F);for(D/=B,j/=B,F/=B,E[0]=D,E[4]=j,E[8]=F,a=0;a<3;++a)M[a]=b[a]+E[2+4*a]*d;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*M[N];E[12+a]=-u}E[15]=1},d.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var f=[0,0,0];d.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;f[0]=i[2],f[1]=i[6],f[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,f),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},d.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],p=i[8],d=u*a+h*o+p*s,f=c(u-=a*d,h-=o*d,p-=s*d),m=(u/=f)*t+a*r,g=(h/=f)*t+o*r,y=(p/=f)*t+s*r;this.center.move(e,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(e,Math.log(v))},d.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},d.setMatrix=function(e,t,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],h=t[a+8];if(n){var p=Math.abs(s),d=Math.abs(l),f=Math.abs(h),m=Math.max(p,d,f);p===m?(s=s<0?-1:1,l=h=0):f===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=t[o],b=t[o+4],_=t[o+8],w=x*s+b*l+_*h,k=c(x-=s*w,b-=l*w,_-=h*w),T=l*(_/=k)-h*(b/=k),S=h*(x/=k)-s*_,A=s*b-l*x,M=c(T,S,A);if(T/=M,S/=M,A/=M,this.center.jump(e,H,G,W),this.radius.idle(e),this.up.jump(e,s,l,h),this.right.jump(e,x,b,_),2===a){var E=t[1],C=t[5],P=t[9],L=E*x+C*b+P*_,I=E*T+C*S+P*A;y=D<0?-Math.PI/2:Math.PI/2,v=Math.atan2(I,L)}else{var z=t[2],O=t[6],R=t[10],D=z*s+O*l+R*h,j=z*x+O*b+R*_,F=z*T+O*S+R*A;y=Math.asin(u(D)),v=Math.atan2(F,j)}this.angle.jump(e,v,y),this.recalcMatrix(e);var B=t[2],N=t[6],U=t[10],V=this.computedMatrix;i(V,t);var q=V[15],H=V[12]/q,G=V[13]/q,W=V[14]/q,$=Math.exp(this.computedRadius[0]);this.center.jump(e,H-B*$,G-N*$,W-U*$)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},d.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},d.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},d.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],h=t[1]-r[1],p=t[2]-r[2],d=c(l,h,p);if(!(d<1e-6)){l/=d,h/=d,p/=d;var f=this.computedRight,m=f[0],g=f[1],y=f[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(x=c(m=a*p-o*h,g=o*l-i*p,y=i*h-a*l))<1e-6)){m/=x,g/=x,y/=x,this.up.set(e,i,a,o),this.right.set(e,m,g,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(d));var b=a*y-o*g,_=o*m-i*y,w=i*g-a*m,k=c(b,_,w),T=i*l+a*h+o*p,S=m*l+g*h+y*p,A=(b/=k)*l+(_/=k)*h+(w/=k)*p,M=Math.asin(u(T)),E=Math.atan2(A,S),C=this.angle._state,P=C[C.length-1],L=C[C.length-2];P%=2*Math.PI;var I=Math.abs(P+2*Math.PI-E),z=Math.abs(P-E),O=Math.abs(P-2*Math.PI-E);I0?r.pop():new ArrayBuffer(e)}function f(e){return new Uint8Array(d(e),0,e)}function m(e){return new Uint16Array(d(2*e),0,e)}function g(e){return new Uint32Array(d(4*e),0,e)}function y(e){return new Int8Array(d(e),0,e)}function v(e){return new Int16Array(d(2*e),0,e)}function x(e){return new Int32Array(d(4*e),0,e)}function b(e){return new Float32Array(d(4*e),0,e)}function _(e){return new Float64Array(d(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(d(e),0,e):f(e)}function k(e){return s?new BigUint64Array(d(8*e),0,e):null}function T(e){return l?new BigInt64Array(d(8*e),0,e):null}function S(e){return new DataView(d(e),0,e)}function A(e){e=n.nextPow2(e);var t=n.log2(e),r=h[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))h[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);u[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){p(e.buffer)},t.freeArrayBuffer=p,t.freeBuffer=function(e){h[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return d(e);switch(t){case"uint8":return f(e);case"uint16":return m(e);case"uint32":return g(e);case"int8":return y(e);case"int16":return v(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return T(e);case"biguint64":return k(e);case"buffer":return A(e);case"data":case"dataview":return S(e);default:return null}return null},t.mallocArrayBuffer=d,t.mallocUint8=f,t.mallocUint16=m,t.mallocUint32=g,t.mallocInt8=y,t.mallocInt16=v,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=k,t.mallocBigInt64=T,t.mallocDataView=S,t.mallocBuffer=A,t.clearCache=function(){for(var e=0;e<32;++e)c.UINT8[e].length=0,c.UINT16[e].length=0,c.UINT32[e].length=0,c.INT8[e].length=0,c.INT16[e].length=0,c.INT32[e].length=0,c.FLOAT[e].length=0,c.DOUBLE[e].length=0,c.BIGUINT64[e].length=0,c.BIGINT64[e].length=0,c.UINT8C[e].length=0,u[e].length=0,h[e].length=0}},1755:function(e){function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",_(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\/g,"\n"):r.replace(/\/g," ");var s="",l=[];for(k=0;k-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(j(),"?px "),A*=Math.pow(.75,l-s),n=n.replace("?px ",j())),S+=.25*C*(l-s)}if(!0===o.superscripts){var c=e.indexOf(f),h=r.indexOf(f),d=c>-1?parseInt(e[1+c]):0,m=h>-1?parseInt(r[1+h]):0;d!==m&&(n=n.replace(j(),"?px "),A*=Math.pow(.75,m-d),n=n.replace("?px ",j())),S-=.25*C*(m-d)}if(!0===o.bolds){var g=e.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=e.indexOf(p)>-1,b=r.indexOf(p)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}t.font=n}for(w=0;w",a="",o=i.length,s=a.length,l=t[0]===f||t[0]===y,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var h=c;h=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var p=n[h].indexOf(t[0]);-1===p?n[h]+=t:l&&(n[h]=n[h].substr(0,p+1)+(1+parseInt(n[h][p+1]))+n[h].substr(p+2))}var d=c+o,m=r.substr(d,u-d).indexOf(i);c=-1!==m?m:u+s}return n}function b(e,t,r,i){var c=function(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(e,i),u=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l=0?t[a]:i}))},has___:{value:x((function(t){var n=v(t);return n?r in n:e.indexOf(t)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=e.indexOf(n))>=0?t[a]=i:(a=e.length,t[a]=i,e[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=e.indexOf(n))<0)&&(a=e.length-1,e[i]=void 0,t[i]=t[a],e[i]=e[a],e.length=a,t.length=a,!0)}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof m||b();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new m),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch(r){i||(i=new m),i.set___(e,t)}else n.set(e,t);return this},Object.create(m.prototype,{get___:{value:x((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:x((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:x(e)},delete___:{value:x((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:x((function(e){if(e!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),e.exports=m)}function g(e){e.permitHostObjects___&&e.permitHostObjects___(g)}function y(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function v(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[c];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,c,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(r){return}}}function x(e){return e.prototype=null,Object.freeze(e)}function b(){d||"undefined"===typeof console||(d=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(e,t,r){var n=r(8284);e.exports=function(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},8284:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},606:function(e,t,r){var n=r(236);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},3349:function(e){var t=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u=0!==d>=0&&i.push(l[0]+.5+.5*(p+d)/(p-d)),n+=h,++l[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=t[s];return l||(t[s]=l=e([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(t.bind(void 0,r));var r}({funcName:"zeroCrossings"})},781:function(e,t,r){e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(3349)},7790:function(){}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var i=n(1964);t.exports=i}()}}),Of=p({"node_modules/color-name/index.js"(e,t){t.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]}}}),Rf=p({"node_modules/color-normalize/node_modules/color-parse/index.js"(e,t){var r=Of();t.exports=function(e){var t,i,a=[],o=1;if("string"===typeof e)if(e=e.toLowerCase(),r[e])a=r[e].slice(),i="rgb";else if("transparent"===e)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===u?parseFloat(e)/100:"rgb"===s?255*parseFloat(e)/100:parseFloat(e);if("h"===s[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==n[e])return n[e]}return parseFloat(e)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(a=[e[0],e[1],e[2]],i="rgb",o=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(i="rgb",a=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",a=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),o=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(o/=100)):(i="rgb",a=[e>>>16,(65280&e)>>>8,255&e]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Df=p({"node_modules/color-normalize/node_modules/color-rgba/index.js"(e,t){var r=Rf();t.exports=function(e){var t;Array.isArray(e)&&e.raw&&(e=String.raw.apply(null,arguments));var n=r(e);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(t=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),t[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),t[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(t=function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c++]=255*a;return i}(t)),t.push(Math.min(Math.max(n.alpha,0),1)),t}}}),jf=p({"node_modules/clamp/index.js"(e,t){t.exports=function(e,t,r){return tr?r:e:et?t:e}}}),Ff=p({"node_modules/dtype/index.js"(e,t){t.exports=function(e){switch(e){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}}}}),Bf=p({"node_modules/color-normalize/index.js"(e,t){var r=Df(),n=jf(),i=Ff();t.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var a=new(i(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!==typeof e||((e=r(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=null!=e[3]?e[3]:255,o&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(o?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=null!=e[3]?e[3]:1):(a[0]=n(Math.floor(255*e[0]),0,255),a[1]=n(Math.floor(255*e[1]),0,255),a[2]=n(Math.floor(255*e[2]),0,255),a[3]=null==e[3]?255:n(Math.floor(255*e[3]),0,255)),a)}}}),Nf=p({"src/lib/str2rgbarray.js"(e,t){var r=Bf();t.exports=function(e){return e?r(e):[0,0,0,1]}}}),Uf=p({"src/lib/gl_format_color.js"(e,t){var r=k(),n=O(),i=Bf(),a=Wt(),o=V().defaultLine,s=M().isArrayOrTypedArray,l=i(o);function c(e,t){var r=e;return r[3]*=t,r}function u(e){if(r(e))return l;var t=i(e);return t.length?t:l}function h(e){return r(e)?e:1}t.exports={formatColor:function(e,t,r){var n=e.color;n&&n._inputArray&&(n=n._inputArray);var o,p,d,f,m,g=s(n),y=s(t),v=a.extractOpts(e),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(e):u,p=g?function(e,t){return void 0===e[t]?l:i(o(e[t]))}:u,d=y?function(e,t){return void 0===e[t]?1:h(e[t])}:h,g||y)for(var b=0;b0){var p=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=p),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,p)}}else o[s]=[-l[0]*n,l[1]*n]}return o}t.exports=function(e,t,r){var i=[n(e.x,e.error_x,t[0],r.xaxis),n(e.y,e.error_y,t[1],r.yaxis),n(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t-1?-1:e.indexOf("right")>-1?1:0}function x(e){return null===e||void 0===e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function b(e,t){return t(4*e)}function _(e){return p[e]}function w(e,t,r,n,i){var a=null;if(s.isArrayOrTypedArray(e)){a=[];for(var o=0;o=0){var m=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n=0&&h("surfacecolor",d||f);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(e,t,d||f||c,{axis:"z"}),v(e,t,d||f||c,{axis:"y",inherit:"z"}),v(e,t,d||f||c,{axis:"x",inherit:"z"})}else t.visible=!1}}}),Zf=p({"src/traces/scatter3d/calc.js"(e,t){var r=ni(),n=ri();t.exports=function(e,t){var i=[{x:!1,y:!1,trace:t,t:{}}];return r(i,t),n(e,t),i}}}),Xf=p({"node_modules/get-canvas-context/index.js"(e,t){t.exports=function(e,t){if("string"!==typeof e)throw new TypeError("must specify type string");if(t=t||{},"undefined"===typeof document&&!t.canvas)return null;var r=t.canvas||document.createElement("canvas");"number"===typeof t.width&&(r.width=t.width),"number"===typeof t.height&&(r.height=t.height);var n,i=t;try{var a=[e];0===e.indexOf("webgl")&&a.push("experimental-"+e);for(var o=0;o/g," "));l[c]=d,u.tickmode=h}}for(t.ticks=l,c=0;c<3;++c)for(a[c]=.5*(e.glplot.bounds[0][c]+e.glplot.bounds[1][c]),f=0;f<2;++f)t.bounds[f][c]=e.glplot.bounds[f][c];e.contourLevels=function(e){for(var t=new Array(3),r=0;r<3;++r){for(var n=e[r],i=new Array(n.length),a=0;ar.deltaY?1.1:1/1.1,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(e)}}),!!l&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=n();e.graphDiv.emit("plotly_relayouting",t)}})),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",(function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})}),!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},k.render=function(){var e,t=this,r=t.graphDiv,n=t.svgContainer,i=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(t),t.glplot.axes.update(t.axesOptions);for(var c=Object.keys(t.traces),h=null,f=t.glplot.selection,m=0;m")):"isosurface"===e.type||"volume"===e.type?(T.valueLabel=p.hoverLabelText(t._mockAxis,t._mockAxis.d2l(f.traceCoordinate[3]),e.valuehoverformat),E.push("value: "+T.valueLabel),f.textLabel&&E.push(f.textLabel),b=E.join("
")):b=f.textLabel;var C={x:f.traceCoordinate[0],y:f.traceCoordinate[1],z:f.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:k};d.appendArrayPointValue(C,w,k),e._module.eventData&&(C=w._module.eventData(C,f,w,{},k));var P={points:[C]};if(t.fullSceneLayout.hovermode){var L=[];d.loneHover({trace:w,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:b,name:h.name,color:d.castHoverOption(w,k,"bgcolor")||h.color,borderColor:d.castHoverOption(w,k,"bordercolor"),fontFamily:d.castHoverOption(w,k,"font.family"),fontSize:d.castHoverOption(w,k,"font.size"),fontColor:d.castHoverOption(w,k,"font.color"),nameLength:d.castHoverOption(w,k,"namelength"),textAlign:d.castHoverOption(w,k,"align"),hovertemplate:u.castOption(w,k,"hovertemplate"),hovertemplateLabels:u.extendFlat({},C,T),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}f.distance<5&&(f.buttons||_)?r.emit("plotly_click",P):r.emit("plotly_hover",P),this.oldEventData=P}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},k.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(t)};var S=["xaxis","yaxis","zaxis"];function A(e,t,r){for(var n=e.fullSceneLayout,i=0;i<3;i++){var a=S[i],o=a.charAt(0),s=n[a],l=t[o],c=t[o+"calendar"],h=t["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var p,d=0;d<(h||l.length);d++)if(u.isArrayOrTypedArray(l[d]))for(var f=0;fy[1][o])y[0][o]=-1,y[1][o]=1;else{var I=y[1][o]-y[0][o];y[0][o]-=I/32,y[1][o]+=I/32}if(_=[y[0][o],y[1][o]],_=b(_,l),y[0][o]=_[0],y[1][o]=_[1],l.isReversed()){var z=y[0][o];y[0][o]=y[1][o],y[1][o]=z}}else _=l.range,y[0][o]=l.r2l(_[0]),y[1][o]=l.r2l(_[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),v[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*d[o],max:l.range[1]*d[o]})}var O=u.aspectmode;if("cube"===O)g=[1,1,1];else if("manual"===O){var R=u.aspectratio;g=[R.x,R.y,R.z]}else{if("auto"!==O&&"data"!==O)throw new Error("scene.js aspectRatio was not one of the enumerated types");var D=[1,1,1];for(o=0;o<3;++o){var j=x[c=(l=u[S[o]]).type];D[o]=Math.pow(j.acc,1/j.count)/d[o]}g="data"===O||Math.max.apply(null,D)/Math.min.apply(null,D)<=4?D:[1,1,1]}u.aspectratio.x=h.aspectratio.x=g[0],u.aspectratio.y=h.aspectratio.y=g[1],u.aspectratio.z=h.aspectratio.z=g[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var F=u.domain||null,B=t._size||null;if(F&&B){var N=n.container.style;N.position="absolute",N.left=B.l+F.x[0]*B.w+"px",N.top=B.t+(1-F.y[1])*B.h+"px",N.width=B.w*(F.x[1]-F.x[0])+"px",N.height=B.h*(F.y[1]-F.y[0])+"px"}n.glplot.redraw()}},k.destroy=function(){var e=this;e.glplot&&(e.camera.mouseListener.enabled=!1,e.container.removeEventListener("wheel",e.camera.wheelListener),e.camera=null,e.glplot.dispose(),e.container.parentNode.removeChild(e.container),e.glplot=null)},k.getCamera=function(){var e,t=this;return t.camera.view.recalcMatrix(t.camera.view.lastT()),{up:{x:(e=t.camera).up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:!0===e._ortho?"orthographic":"perspective"}}},k.setViewport=function(e){var t,r=this,n=e.camera;r.camera.lookAt.apply(this,[[(t=n).eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]),r.glplot.setAspectratio(e.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},k.isCameraChanged=function(e){var t=this.getCamera(),r=u.nestedProperty(e,this.id+".camera").get();function n(e,t,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]]&&e[i[r]][a[n]]===t[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(t,r,a,o)){i=!0;break}(!r.projection||t.projection&&t.projection.type!==r.projection.type)&&(i=!0)}return i},k.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=u.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},k.saveLayout=function(e){var t,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(e),p=s.isAspectChanged(e),d=h||p;if(d){var f={};h&&(t=s.getCamera(),n=(r=u.nestedProperty(e,s.id+".camera")).get(),f[s.id+".camera"]=n),p&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(e,s.id+".aspectratio")).get(),f[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",e,l._preGUI,f),h&&(r.set(t),u.nestedProperty(l,s.id+".camera").set(t)),p&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return d},k.updateFx=function(e,t){var r=this,n=r.camera;if(n)if("orbit"===e)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===e){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var p=r.id+".camera.up",d={x:0,y:0,z:1},f={};f[p]=d;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,f),o.up=d,u.nestedProperty(m,p).set(d)}}else n.keyBindingMode=e;r.fullSceneLayout.hovermode=t},k.toImage=function(e){var t=this;e||(e="png"),t.staticMode&&t.container.appendChild(r),t.glplot.redraw();var n=t.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(e,t,r){for(var n=0,i=r-1;n0)for(var s=255/o,l=0;l<3;++l)e[a+l]=Math.min(s*e[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),e){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return t.staticMode&&t.container.removeChild(r),l},k.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[S[e]];p.setConvert(t,this.fullLayout),t.setScale=u.noop}},k.make4thDimension=function(){var e=this,t=e.graphDiv._fullLayout;e._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(e._mockAxis,t)},t.exports=w}}),rm=p({"src/plots/gl3d/layout/attributes.js"(e,t){t.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),nm=p({"src/plots/gl3d/layout/axis_attributes.js"(e,t){var r=q(),n=Ct(),i=R().extendFlat,a=Le().overrideAll;t.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),im=p({"src/plots/gl3d/layout/layout_attributes.js"(e,t){var r=nm(),n=ka().attributes,i=R().extendFlat,a=st().counterRegex;function o(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}t.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({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:r,yaxis:r,zaxis:r,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"}}}),am=p({"src/plots/gl3d/layout/axis_defaults.js"(e,t){var r=O().mix,n=st(),i=gt(),a=nm(),o=xi(),s=wi(),l=["xaxis","yaxis","zaxis"],c=13600/187;t.exports=function(e,t,u){var h,p;function d(e,t){return n.coerce(h,p,a,e,t)}for(var f=0;f.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}t.exports=function(e,t,n){var i=t._basePlotModules.length>1;a(e,t,n,{type:c,attributes:s,handleDefaults:u,fullLayout:t,font:t.font,fullData:n,getDfltFromLayout:function(t){if(!i)return r.validate(e[t],s[t])?e[t]:void 0},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}}}),sm=p({"src/plots/gl3d/index.js"(e){var t=Le().overrideAll,r=F(),n=tm(),i=_t().getSubplotData,a=st(),o=Tt(),s="gl3d",l="scene";e.name=s,e.attr=l,e.idRoot=l,e.idRegex=e.attrRegex=a.counterRegex("scene"),e.attributes=rm(),e.layoutAttributes=im(),e.baseLayoutAttrOverrides=t({hoverlabel:r.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=om(),e.plot=function(e){for(var t=e._fullLayout,r=e._fullData,a=t._subplots[s],o=0;o0){r=d[n];break}return r}function y(e,t){if(!(e<1||t<1)){for(var r=m(e),n=m(t),i=1,a=0;ab;)r--,r/=g(r),++r1?n:1},p.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,i=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/t,0,0,0,1/r,0,0,0,1],p=0;p0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];ts&&(this.minValues[t]=s),this.maxValues[t]l&&(t.isomin=null,t.isomax=null);var c=o("x"),u=o("y"),h=o("z"),p=o("value");c&&c.length&&u&&u.length&&h&&h.length&&p&&p.length?(n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach((function(e){o(e+"hoverformat");var t="caps."+e;o(t+".show")&&o(t+".fill");var r="slices."+e;o(r+".show")&&(o(r+".fill"),o(r+".locations"))})),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(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(e){o(e)})),a(e,t,i,o,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}t.exports={supplyDefaults:function(e,t,n,a){o(e,t,0,a,(function(n,a){return r.coerce(e,t,i,n,a)}))},supplyIsoDefaults:o}}}),xm=p({"src/traces/streamtube/calc.js"(e,t){var r=st(),n=Gt();function i(e){var t,n,i,o,s,l,c,u,h,p,d,f,m=e._x,g=e._y,y=e._z,v=e._len,x=-1/0,b=1/0,_=-1/0,w=1/0,k=-1/0,T=1/0,S="";for(v&&(c=m[0],h=g[0],d=y[0]),v>1&&(u=m[v-1],p=g[v-1],f=y[v-1]),t=0;tu?"-":"+")+"x")).replace("y",(h>p?"-":"+")+"y")).replace("z",(d>f?"-":"+")+"z");var C=function(){v=0,A=[],M=[],E=[]};(!v||v0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n-1}function D(e,t){return null===e?t:e}function j(t,r,n){P();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i-1?n[d]:C(f,m,y);p[d]=x>-1?x:I(f,m,y,D(t,v))}i=p[0],a=p[1],o=p[2],e._meshI.push(i),e._meshJ.push(a),e._meshK.push(o),++g}}function F(e,t,r,n){var i=e[3];in&&(i=n);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function B(e,t,r){return e>=t&&e<=r}function N(e){var t=.001*(E-M);return e>=M-t&&e<=E+t}function U(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}function V(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(t[0][3],n,i),B(t[1][3],n,i),B(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return N(t[0][3])&&N(t[1][3])&&N(t[2][3])?(j(e,t,r),!0):a<3&&V(e,t,r,M,E,++a)};if(s[0]&&s[1]&&s[2])return l(e,t,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=t[a[0]],h=t[a[1]],p=t[a[2]],d=F(p,u,n,i),f=F(p,h,n,i);o=l(e,[f,d,u],[-1,-1,r[a[0]]])||o,o=l(e,[u,h,f],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=t[a[0]],h=t[a[1]],p=t[a[2]],d=F(h,u,n,i),f=F(p,u,n,i);o=l(e,[f,d,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(e,t,r,n){var i=!1,a=U(t),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!o[0]&&!o[1]&&!o[2]&&!o[3])return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(e,t,r){var n=function(n,i,a){j(e,[t[n],t[i],t[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(e,a,t)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]];if(m)i=j(e,[c,u,h],[t[l[0]],t[l[1]],t[l[2]]])||i;else{var d=F(p,c,r,n),f=F(p,u,r,n),g=F(p,h,r,n);i=j(null,[d,f,g],[-1,-1,-1])||i}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]],d=F(h,c,r,n),f=F(h,u,r,n),g=F(p,u,r,n),y=F(p,c,r,n);m?(i=j(e,[c,y,d],[t[l[0]],-1,-1])||i,i=j(e,[u,f,g],[t[l[1]],-1,-1])||i):i=function(e,t,r){var n=function(n,i,a){j(e,[t[n],t[i],t[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[d,f,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]],d=F(u,c,r,n),f=F(h,c,r,n),g=F(p,c,r,n);m?(i=j(e,[c,d,f],[t[l[0]],-1,-1])||i,i=j(e,[c,f,g],[t[l[0]],-1,-1])||i,i=j(e,[c,g,d],[t[l[0]],-1,-1])||i):i=j(null,[d,f,g],[-1,-1,-1])||i,s=!0}}))),i}function H(e,t,r,n,i,a,o,s,l,c,u){var h=!1;return f&&(R(e,"A")&&(h=q(null,[t,r,n,a],c,u)||h),R(e,"B")&&(h=q(null,[r,n,i,l],c,u)||h),R(e,"C")&&(h=q(null,[r,a,o,l],c,u)||h),R(e,"D")&&(h=q(null,[n,a,s,l],c,u)||h),R(e,"E")&&(h=q(null,[r,n,a,l],c,u)||h)),m&&(h=q(e,[r,n,a,l],c,u)||h),h}function G(e,t,r,n,i,a,o,s){return[!0===s[0]||V(e,U([t,r,n]),[t,r,n],a,o),!0===s[1]||V(e,U([n,i,t]),[n,i,t],a,o)]}function W(e,t,r,n,i,a,o,s,l){return s?G(e,t,r,i,n,a,o,l):G(e,r,i,n,t,a,o,l)}function $(e,t,r,n,i,a,o){var s,l,c,u,h=!1,p=function(){h=V(e,[s,l,c],[-1,-1,-1],i,a)||h,h=V(e,[c,u,s],[-1,-1,-1],i,a)||h},d=o[0],f=o[1],m=o[2];return d&&(s=z(U([T(t,r-0,n-0)])[0],U([T(t-1,r-0,n-0)])[0],d),l=z(U([T(t,r-0,n-1)])[0],U([T(t-1,r-0,n-1)])[0],d),c=z(U([T(t,r-1,n-1)])[0],U([T(t-1,r-1,n-1)])[0],d),u=z(U([T(t,r-1,n-0)])[0],U([T(t-1,r-1,n-0)])[0],d),p()),f&&(s=z(U([T(t-0,r,n-0)])[0],U([T(t-0,r-1,n-0)])[0],f),l=z(U([T(t-0,r,n-1)])[0],U([T(t-0,r-1,n-1)])[0],f),c=z(U([T(t-1,r,n-1)])[0],U([T(t-1,r-1,n-1)])[0],f),u=z(U([T(t-1,r,n-0)])[0],U([T(t-1,r-1,n-0)])[0],f),p()),m&&(s=z(U([T(t-0,r-0,n)])[0],U([T(t-0,r-0,n-1)])[0],m),l=z(U([T(t-0,r-1,n)])[0],U([T(t-0,r-1,n-1)])[0],m),c=z(U([T(t-1,r-1,n)])[0],U([T(t-1,r-1,n-1)])[0],m),u=z(U([T(t-1,r-0,n)])[0],U([T(t-1,r-0,n-1)])[0],m),p()),h}function Z(e,t,r,n,i,a,o,s,l,c,u,h){var p=e;return h?(f&&"even"===e&&(p=null),H(p,t,r,n,i,a,o,s,l,c,u)):(f&&"odd"===e&&(p=null),H(p,l,s,o,a,i,n,r,t,c,u))}function X(e,t,r,n,i){for(var a=[],o=0,s=0;sMath.abs(k-A)?[S,k]:[k,A];Q(r,C[0],C[1])}}var P=[[Math.min(M,A),Math.max(M,A)],[Math.min(S,E),Math.max(S,E)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i0&&(h.push(f.id),"x"===r?p.push([f.distRatio,0,0]):"y"===r?p.push([0,f.distRatio,0]):p.push([0,0,f.distRatio]))}else u=ne(1,"x"===r?b-1:"y"===r?_-1:w-1);h.length>0&&(n[a]="x"===r?ee(t,h,o,s,p,n[a]):"y"===r?te(t,h,o,s,p,n[a]):re(t,h,o,s,p,n[a]),a++),u.length>0&&(n[a]="x"===r?X(t,u,o,s,n[a]):"y"===r?Y(t,u,o,s,n[a]):K(t,u,o,s,n[a]),a++)}var m=e.caps[r];m.show&&m.fill&&(O(m.fill),n[a]="x"===r?X(t,[0,b-1],o,s,n[a]):"y"===r?Y(t,[0,_-1],o,s,n[a]):K(t,[0,w-1],o,s,n[a]),a++)}})),0===g&&L(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=y,e._Ys=v,e._Zs=x}(),e}t.exports={findNearestOnAxis:l,generateIsoMeshes:p,createIsosurfaceTrace:function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new c(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}}),km=p({"src/traces/isosurface/index.js"(e,t){t.exports={attributes:ym(),supplyDefaults:vm().supplyDefaults,calc:bm(),colorbar:{min:"cmin",max:"cmax"},plot:wm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Tm=p({"lib/isosurface.js"(e,t){t.exports=km()}}),Sm=p({"src/traces/volume/attributes.js"(e,t){var r=Lt(),n=ym(),i=um(),a=N(),o=R().extendFlat,s=Le().overrideAll,l=t.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),Am=p({"src/traces/volume/defaults.js"(e,t){var r=st(),n=Sm(),i=vm().supplyIsoDefaults,a=hm().opacityscaleDefaults;t.exports=function(e,t,o,s){function l(i,a){return r.coerce(e,t,n,i,a)}i(e,t,o,s,l),a(e,t,s,l)}}}),Mm=p({"src/traces/volume/convert.js"(e,t){var r=zf().gl_mesh3d,n=Uf().parseColorScale,i=st().isArrayOrTypedArray,a=Nf(),o=Wt().extractOpts,s=_m(),l=wm().findNearestOnAxis,c=wm().generateIsoMeshes;function u(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,p=e.index=h+s*u+s*o*c;e.traceCoordinate=[this.data._meshX[p],this.data._meshY[p],this.data._meshZ[p],this.data._value[p]];var d=this.data.hovertext||this.data.text;return i(d)&&void 0!==d[p]?e.textLabel=d[p]:d&&(e.textLabel=d),!0}},h.update=function(e){var t=this.scene,r=t.fullSceneLayout;function i(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=c(e);var l={positions:s(i(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(r.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,opacityscale:e.opacityscale,contourEnable:e.contour.show,contourColor:a(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},u=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(e),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new u(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),Em=p({"src/traces/volume/index.js"(e,t){t.exports={attributes:Sm(),supplyDefaults:Am(),calc:bm(),colorbar:{min:"cmin",max:"cmax"},plot:Mm(),moduleType:"trace",name:"volume",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Cm=p({"lib/volume.js"(e,t){t.exports=Em()}}),Pm=p({"src/traces/mesh3d/defaults.js"(e,t){var r=Ve(),n=st(),i=Vt(),a=gm();t.exports=function(e,t,o,s){function l(r,i){return n.coerce(e,t,a,r,i)}function c(e){var t=e.map((function(e){var t=l(e);return t&&n.isArrayOrTypedArray(t)?t:null}));return t.every((function(e){return e&&e.length===t[0].length}))&&t}c(["x","y","z"])?(c(["i","j","k"]),(!t.i||t.j&&t.k)&&(!t.j||t.k&&t.i)&&(!t.k||t.i&&t.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],s),["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(e){l(e)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in e?(l("intensity"),l("intensitymode"),i(e,t,s,l,{prefix:"",cLetter:"c"})):(t.showscale=!1,"facecolor"in e?l("facecolor"):"vertexcolor"in e?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),t._length=null):t.visible=!1):t.visible=!1}}}),Lm=p({"src/traces/mesh3d/calc.js"(e,t){var r=Gt();t.exports=function(e,t){t.intensity&&r(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}}}),Im=p({"src/traces/mesh3d/convert.js"(e,t){var r=zf().gl_mesh3d,n=zf().delaunay_triangulate,i=zf().alpha_shape,a=zf().convex_hull,o=Uf().parseColorScale,s=st().isArrayOrTypedArray,l=Nf(),c=Wt().extractOpts,u=_m();function h(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var p=h.prototype;function d(e){for(var t=[],r=e.length,n=0;n=t-.5)return!1;return!0}p.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},p.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var s,h=e.x.length,p=u(f(r.xaxis,e.x,t.dataScale[0],e.xcalendar),f(r.yaxis,e.y,t.dataScale[1],e.ycalendar),f(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!g(e.i,h)||!g(e.j,h)||!g(e.k,h))return;s=u(m(e.i),m(e.j),m(e.k))}else s=0===e.alphahull?a(p):e.alphahull>0?i(e.alphahull,p):function(e,t){for(var r=["x","y","z"].indexOf(e),i=[],a=t.length,o=0;o2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function p(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function d(e,t){var n=e.fullSceneLayout,c=e.dataScale,u=t._len,d={};function f(e,t){var r=n[t],a=c[l[t]];return i.simpleMap(e,(function(e){return r.d2l(e)*a}))}if(d.vectors=s(f(t._u,"xaxis"),f(t._v,"yaxis"),f(t._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=f(t._Xs,"xaxis"),g=f(t._Ys,"yaxis"),y=f(t._Zs,"zaxis");if(d.meshgrid=[m,g,y],d.gridFill=t._gridFill,t._slen)d.startingPositions=s(f(t._startsX,"xaxis"),f(t._startsY,"yaxis"),f(t._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),b=h(y),_=new Array(x.length*b.length),w=0,k=0;ko&&(o=e[0]),e[1]s&&(s=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":l(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(l)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,l=e.length;++ro&&(o=t[0]),t[1]s&&(s=t[1])})),e.objects)c(e.objects[t]);return[i,a,o,s]}function i(e,t){var r=t.id,n=t.bbox,i=null==t.properties?{}:t.properties,o=a(e,t);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(e,t){var n=r(e.transform),i=e.arcs;function a(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],a=0,o=r.length;a1)n=function(e,t,r){var n,i=[],a=[];function o(e){var t=e<0?~e:e;(a[t]||(a[t]=[])).push({i:e,g:n})}function s(e){e.forEach(o)}function l(e){e.forEach(s)}function c(e){e.forEach(l)}function u(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":c(e.arcs)}}return u(t),a.forEach(null==r?function(e){i.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,r);else for(i=0,n=new Array(a=e.arcs.length);i1)for(var a,s,c=1,u=l(i[0]);cu&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(e){return e.length>0}))}}function c(e,t){for(var r=0,n=e.length;r>>1;e[i]=2))throw new Error("n must be \u22652");var r,i=(l=e.bbox||n(e))[0],a=l[1],o=l[2],s=l[3];t={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(t),p=e.objects,d={};function f(e){return h(e)}function m(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(m)};break;case"Point":t={type:"Point",coordinates:f(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(f)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in p)d[c]=m(p[c]);return{type:"Topology",bbox:l,transform:t,objects:d,arcs:e.arcs.map((function(e){var t,r=0,n=1,i=e.length,a=new Array(i);for(a[0]=h(e[0],0);++r0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},e.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},e.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r2&&void 0!==arguments[2]?arguments[2]:{};const n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function a(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!m(e[0])||!m(e[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:e},t,r)}function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(const n of e){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:{};if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:e},t,r)}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function c(e,t){return i({type:"MultiLineString",coordinates:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function u(e,t){return i({type:"MultiPoint",coordinates:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function h(e,t){return i({type:"MultiPolygon",coordinates:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers";const n=r[t];if(!n)throw new Error(t+" units is invalid");return e*n}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers";const n=r[t];if(!n)throw new Error(t+" units is invalid");return e/n}function f(e){return e%(2*Math.PI)*180/Math.PI}function m(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}e.areaFactors=n,e.azimuthToBearing=function(e){return(e%=360)>0?e>180?e-360:e:e<-180?e+360:e},e.bearingToAzimuth=function(e){let t=e%360;return t<0&&(t+=360),t},e.convertArea=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(e>=0))throw new Error("area must be a positive number");const i=n[t];if(!i)throw new Error("invalid original units");const a=n[r];if(!a)throw new Error("invalid final units");return e/i*a},e.convertLength=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(e>=0))throw new Error("length must be a positive number");return p(d(e,t),r)},e.degreesToRadians=function(e){return e%360*Math.PI/180},e.earthRadius=t,e.factors=r,e.feature=i,e.featureCollection=l,e.geometry=function(e,t){switch(e){case"Point":return a(t).geometry;case"LineString":return s(t).geometry;case"Polygon":return o(t).geometry;case"MultiPoint":return u(t).geometry;case"MultiLineString":return c(t).geometry;case"MultiPolygon":return h(t).geometry;default:throw new Error(e+" is invalid")}},e.geometryCollection=function(e,t){return i({type:"GeometryCollection",geometries:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},e.isNumber=m,e.isObject=function(e){return null!==e&&"object"===typeof e&&!Array.isArray(e)},e.lengthToDegrees=function(e,t){return f(d(e,t))},e.lengthToRadians=d,e.lineString=s,e.lineStrings=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e.map((e=>s(e,t))),r)},e.multiLineString=c,e.multiPoint=u,e.multiPolygon=h,e.point=a,e.points=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e.map((e=>a(e,t))),r)},e.polygon=o,e.polygons=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e.map((e=>o(e,t))),r)},e.radiansToDegrees=f,e.radiansToLength=p,e.round=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t&&!(t>=0))throw new Error("precision must be a positive number");const r=Math.pow(10,t||0);return Math.round(e*r)/r},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((e=>{if(!m(e))throw new Error("bbox must only contain numbers")}))},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}}),rg=p({"node_modules/@turf/meta/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=tg();function r(e,t,n){if(null!==e)for(var i,a,o,s,l,c,u,h,p=0,d=0,f=e.type,m="FeatureCollection"===f,g="Feature"===f,y=m?e.features.length:1,v=0;vc||d>u||f>h)return l=r,c=i,u=d,h=f,void(o=0);var m=t.lineString.call(void 0,[l,r],e.properties);if(!1===n(m,i,a,f,o))return!1;o++,l=r}))&&void 0}}}))}function l(e,r){if(!e)throw new Error("geojson is required");o(e,(function(e,n,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===r(e,n,i,0,0))return!1;break;case"Polygon":for(var s=0;se+function(e){let t,r=0;switch(e.type){case"Polygon":return i(e.coordinates);case"MultiPolygon":for(t=0;t0){t+=Math.abs(s(e[0]));for(let r=1;r=t?(n+2)%t:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;e.area=n,e.default=l}}),ig=p({"node_modules/@turf/centroid/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=tg(),r=rg();function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=0,a=0,o=0;return r.coordEach.call(void 0,e,(function(e){i+=e[0],a+=e[1],o++}),!0),t.point.call(void 0,[i/o,a/o],n.properties)}var i=n;e.centroid=n,e.default=i}}),ag=p({"node_modules/@turf/bbox/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=rg();function r(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=e.bbox&&!0!==r.recompute)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return t.coordEach.call(void 0,e,(e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===s||"FJI"===s?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),i=0;it?r[n++]=[e[i][0]+360,e[i][1]]:i===t?(r[n++]=e[i],r[n++]=[e[i][0],-90]):r[n++]=e[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(e){l.push(h.tester(e))},a.type){case"MultiPolygon":for(r=0;r0?h.properties.ct=function(e){var t,r=e.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;so&&(o=c,t=l)}else t=r;return a(t).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=e,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var p=r.features;for(n=0;n100?(clearInterval(a),n("Unexpected error while fetching from "+e)):void i++}),50)}))}for(var o=0;o")}function d(e){return e+"\xb0"}}(c,m,e,l[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}}}),ug=p({"src/traces/scattergeo/event_data.js"(e,t){t.exports=function(e,t,r,n,i){e.lon=t.lon,e.lat=t.lat,e.location=t.loc?t.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e}}}),hg=p({"src/traces/scattergeo/select.js"(e,t){var r=$t(),n=T().BADNUM;t.exports=function(e,t){var i,a,o,s,l,c=e.cd,u=e.xaxis,h=e.yaxis,p=[],d=c[0].trace;if(!r.hasMarkers(d)&&!r.hasText(d))return[];if(!1===t)for(l=0;lt?1:e>=t?0:NaN}function r(e){var r;return 1===e.length&&(r=e,e=function(e,n){return t(r(e),n)}),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}var n=r(t),i=n.right,a=n.left;function o(e,t){return[e,t]}function s(e){return null===e?NaN:+e}function l(e,t){var r,n,i=e.length,a=0,o=-1,l=0,c=0;if(null==t)for(;++o1)return c/(a-1)}function c(e,t){var r=l(e,t);return r?Math.sqrt(r):r}function u(e,t){var r,n,i,a=e.length,o=-1;if(null==t){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function _(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),t=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e);return o+(+r(e[a+1],a+1,e)-o)*(i-a)}}function T(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n}function S(e){if(!(i=e.length))return[];for(var t=-1,r=T(e,A),n=new Array(r);++te?1:t>=e?0:NaN},e.deviation=c,e.extent=u,e.histogram=function(){var e=m,t=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;ah;)p.pop(),--d;var f,m=new Array(d+1);for(a=0;a<=d;++a)(f=m[a]=[]).x0=a>0?p[a-1]:u,f.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},e.mean=function(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r},e.min=T,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r0)return[e];if((n=t0)for(e=Math.ceil(e/o),t=Math.floor(t/o),a=new Array(i=Math.ceil(t-e+1));++s0?1:e<0?-1:0},T=Math.sqrt,S=Math.tan;function A(e){return e>1?0:e<-1?l:Math.acos(e)}function M(e){return e>1?c:e<-1?-c:Math.asin(e)}function E(e){return(e=w(e/2))*e}function C(){}function P(e,t){e&&I.hasOwnProperty(e.type)&&I[e.type](e,t)}var L={Feature:function(e,t){P(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n=0?1:-1,i=n*r,a=y(t=(t*=d)/2+u),o=w(t),s=N*o,l=B*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),F=e,B=a,N=o}function Z(e){return[g(e[1],e[0]),M(e[2])]}function X(e){var t=e[0],r=e[1],n=y(r);return[n*y(t),n*w(t),w(r)]}function Y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function K(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function J(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Q(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ee(e){var t=T(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var te,re,ne,ie,ae,oe,se,le,ce,ue,he,pe,de,fe,me,ge,ye,ve,xe,be,_e,we,ke,Te,Se,Ae,Me=r(),Ee={point:Ce,lineStart:Le,lineEnd:Ie,polygonStart:function(){Ee.point=ze,Ee.lineStart=Oe,Ee.lineEnd=Re,Me.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),Ee.point=Ce,Ee.lineStart=Le,Ee.lineEnd=Ie,U<0?(te=-(ne=180),re=-(ie=90)):Me>o?ie=90:Me<-o&&(re=-90),ue[0]=te,ue[1]=ne},sphere:function(){te=-(ne=180),re=-(ie=90)}};function Ce(e,t){ce.push(ue=[te=e,ne=e]),tie&&(ie=t)}function Pe(e,t){var r=X([e*d,t*d]);if(le){var n=K(le,r),i=K([n[1],-n[0],0],n);ee(i),i=Z(i);var a,o=e-ae,s=o>0?1:-1,l=i[0]*p*s,c=f(o)>180;c^(s*aeie&&(ie=a):c^(s*ae<(l=(l+360)%360-180)&&lie&&(ie=t)),c?eDe(te,ne)&&(ne=e):De(e,ne)>De(te,ne)&&(te=e):ne>=te?(ene&&(ne=e)):e>ae?De(te,e)>De(te,ne)&&(ne=e):De(e,ne)>De(te,ne)&&(te=e)}else ce.push(ue=[te=e,ne=e]);tie&&(ie=t),le=r,ae=e}function Le(){Ee.point=Pe}function Ie(){ue[0]=te,ue[1]=ne,Ee.point=Ce,le=null}function ze(e,t){if(le){var r=e-ae;Me.add(f(r)>180?r+(r>0?360:-360):r)}else oe=e,se=t;q.point(e,t),Pe(e,t)}function Oe(){q.lineStart()}function Re(){ze(oe,se),q.lineEnd(),f(Me)>o&&(te=-(ne=180)),ue[0]=te,ue[1]=ne,le=null}function De(e,t){return(t-=e)<0?t+360:t}function je(e,t){return e[0]-t[0]}function Fe(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tl?e+Math.round(-e/h)*h:e,t]}function Qe(e,t,r){return(e%=h)?t||r?Ke(tt(e),rt(t,r)):tt(e):t||r?rt(t,r):Je}function et(e){return function(t,r){return[(t+=e)>l?t-h:t<-l?t+h:t,r]}}function tt(e){var t=et(e);return t.invert=et(-e),t}function rt(e,t){var r=y(e),n=w(e),i=y(t),a=w(t);function o(e,t){var o=y(t),s=y(e)*o,l=w(e)*o,c=w(t),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),M(u*i+l*a)]}return o.invert=function(e,t){var o=y(t),s=y(e)*o,l=w(e)*o,c=w(t),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),M(u*r-s*n)]},o}function nt(e){function t(t){return(t=e(t[0]*d,t[1]*d))[0]*=p,t[1]*=p,t}return e=Qe(e[0]*d,e[1]*d,e.length>2?e[2]*d:0),t.invert=function(t){return(t=e.invert(t[0]*d,t[1]*d))[0]*=p,t[1]*=p,t},t}function it(e,t,r,n,i,a){if(r){var o=y(t),s=w(t),l=n*r;null==i?(i=t+n*h,a=t-l/2):(i=at(o,i),a=at(o,a),(n>0?ia)&&(i+=n*h));for(var c,u=i;n>0?u>a:u1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function st(e,t){return f(e[0]-t[0])=0;--a)i.point((u=c[a])[0],u[1]);else n(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ut(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n=0?1:-1,O=z*I,R=O>l,D=k*P;if(ht.add(g(D*z*w(O),T*L+D*y(O))),s+=R?I+z*h:I,R^b>=r^E>=r){var j=K(X(x),X(A));ee(j);var F=K(a,j);ee(F);var B=(R^I>=0?-1:1)*M(F[2]);(n>B||n===B&&(j[0]||j[1]))&&(p+=R^I>=0?1:-1)}}return(s<-o||s0){for(p||(a.polygonStart(),p=!0),a.lineStart(),e=0;e1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(mt))}return d}}function mt(e){return e.length>1}function gt(e,t){return((e=e.x)[0]<0?e[1]-c-o:c-e[1])-((t=t.x)[0]<0?t[1]-c-o:c-t[1])}var yt=ft((function(){return!0}),(function(e){var t,r=NaN,n=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(a,s){var u=a>0?l:-l,h=f(a-r);f(h-l)0?c:-c),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(a,n),t=0):i!==u&&h>=l&&(f(r-i)o?m((w(t)*(a=y(n))*w(r)-w(n)*(i=y(t))*w(e))/(i*a*s)):(t+n)/2}(r,n,a,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(u,n),t=0),e.point(r=a,n=s),i=u},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var i;if(null==e)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(f(e[0]-t[0])>o){var a=e[0]0,i=f(t)>o;function a(e,r){return y(e)*y(r)>t}function s(e,r,n){var i=[1,0,0],a=K(X(e),X(r)),s=Y(a,a),c=a[0],u=s-c*c;if(!u)return!n&&e;var h=t*s/u,p=-t*c/u,d=K(i,a),m=Q(i,h);J(m,Q(a,p));var g=d,y=Y(m,g),v=Y(g,g),x=y*y-v*(Y(m,m)-1);if(!(x<0)){var b=T(x),_=Q(g,(-y-b)/v);if(J(_,m),_=Z(_),!n)return _;var w,k=e[0],S=r[0],A=e[1],M=r[1];S0^_[1]<(f(_[0]-k)l^(k<=_[0]&&_[0]<=S)){var P=Q(g,(-y+b)/v);return J(P,m),[_,Z(P)]}}}function c(t,r){var i=n?e:l-e,a=0;return t<-i?a|=1:t>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return ft(a,(function(e){var t,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(p,d){var f,m=[p,d],g=a(p,d),y=n?g?0:c(p,d):g?c(p+(p<0?l:-l),d):0;if(!t&&(u=o=g)&&e.lineStart(),g!==o&&(!(f=s(t,m))||st(t,f)||st(m,f))&&(m[2]=1),g!==o)h=0,g?(e.lineStart(),f=s(m,t),e.point(f[0],f[1])):(f=s(t,m),e.point(f[0],f[1],2),e.lineEnd()),t=f;else if(i&&t&&n^g){var v;y&r||!(v=s(m,t,!0))||(h=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1],3)))}!g||t&&st(t,m)||e.point(m[0],m[1]),t=m,o=g,r=y},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return h|(u&&o)<<1}}}),(function(t,n,i,a){it(a,e,r,i,t,n)}),n?[0,-e]:[-l,e-l])}var xt=1e9,bt=-xt;function _t(e,r,n,i){function a(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function s(t,a,o,s){var c=0,h=0;if(null==t||(c=l(t,o))!==(h=l(a,o))||u(t,a)<0^o>0)do{s.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(t,i){return f(t[0]-e)0?0:3:f(t[0]-n)0?2:1:f(t[1]-r)0?1:0:i>0?3:2}function c(e,t){return u(e.x,t.x)}function u(e,t){var r=l(e,1),n=l(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(o){var l,u,h,p,d,f,m,g,y,v,x,b=o,_=ot(),w={point:k,lineStart:function(){w.point=T,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(T(p,d),f&&y&&_.rejoin(),l.push(_.result())),w.point=k,y&&b.lineEnd()},polygonStart:function(){b=_,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,n=u.length;ri&&(p-a)*(i-o)>(d-o)*(e-a)&&++t:d<=i&&(p-a)*(i-o)<(d-o)*(e-a)&&--t;return t}(),n=x&&r,a=(l=t.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ct(l,c,r,s,o),o.polygonEnd()),b=o,l=u=h=null}};function k(e,t){a(e,t)&&b.point(e,t)}function T(t,o){var s=a(t,o);if(u&&h.push([t,o]),v)p=t,d=o,f=s,v=!1,s&&(b.lineStart(),b.point(t,o));else if(s&&y)b.point(t,o);else{var l=[m=Math.max(bt,Math.min(xt,m)),g=Math.max(bt,Math.min(xt,g))],c=[t=Math.max(bt,Math.min(xt,t)),o=Math.max(bt,Math.min(xt,o))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],c=0,u=1,h=t[0]-s,p=t[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o0)){if(o/=p,p<0){if(o0){if(o>u)return;o>c&&(c=o)}if(o=a-l,p||!(o<0)){if(o/=p,p<0){if(o>u)return;o>c&&(c=o)}else if(p>0){if(o0&&(e[0]=s+c*h,e[1]=l+c*p),u<1&&(t[0]=s+u*h,t[1]=l+u*p),!0}}}}}(l,c,e,r,n,i)?s&&(b.lineStart(),b.point(t,o),x=!1):(y||(b.lineStart(),b.point(l[0],l[1])),b.point(c[0],c[1]),s||b.lineEnd(),x=!1)}m=t,g=o,y=s}return w}}var wt,kt,Tt,St=r(),At={sphere:C,point:C,lineStart:function(){At.point=Et,At.lineEnd=Mt},lineEnd:C,polygonStart:C,polygonEnd:C};function Mt(){At.point=At.lineEnd=C}function Et(e,t){wt=e*=d,kt=w(t*=d),Tt=y(t),At.point=Ct}function Ct(e,t){e*=d;var r=w(t*=d),n=y(t),i=f(e-wt),a=y(i),o=n*w(i),s=Tt*r-kt*n*a,l=kt*r+Tt*n*a;St.add(g(T(o*o+s*s),l)),wt=e,kt=r,Tt=n}function Pt(e){return St.reset(),R(e,At),+St}var Lt=[null,null],It={type:"LineString",coordinates:Lt};function zt(e,t){return Lt[0]=e,Lt[1]=t,Pt(It)}var Ot={Feature:function(e,t){return Dt(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n0&&(i=zt(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))o})).map(u)).concat(t.range(v(s/g)*g,a,g).filter((function(e){return f(e%x)>o})).map(h))}return _.lines=function(){return w().map((function(e){return{type:"LineString",coordinates:e}}))},_.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(d(l).slice(1),p(n).reverse().slice(1),d(c).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],c=+e[0][1],l=+e[1][1],i>n&&(e=i,i=n,n=e),c>l&&(e=c,c=l,l=e),_.precision(b)):[[i,c],[n,l]]},_.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],s=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),s>a&&(t=s,s=a,a=t),_.precision(b)):[[r,s],[e,a]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(y=+e[0],x=+e[1],_):[y,x]},_.stepMinor=function(e){return arguments.length?(m=+e[0],g=+e[1],_):[m,g]},_.precision=function(t){return arguments.length?(b=+t,u=Vt(s,a,90),h=qt(r,e,b),p=Vt(c,l,90),d=qt(i,n,b),_):b},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Gt(e){return e}var Wt,$t,Zt,Xt,Yt=r(),Kt=r(),Jt={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Jt.lineStart=Qt,Jt.lineEnd=rr},polygonEnd:function(){Jt.lineStart=Jt.lineEnd=Jt.point=C,Yt.add(f(Kt)),Kt.reset()},result:function(){var e=Yt/2;return Yt.reset(),e}};function Qt(){Jt.point=er}function er(e,t){Jt.point=tr,Wt=Zt=e,$t=Xt=t}function tr(e,t){Kt.add(Xt*e-Zt*t),Zt=e,Xt=t}function rr(){tr(Wt,$t)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(e,t){ecr&&(cr=e),tur&&(ur=t)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var e=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),e}},pr=0,dr=0,fr=0,mr=0,gr=0,yr=0,vr=0,xr=0,br=0,_r={point:wr,lineStart:kr,lineEnd:Ar,polygonStart:function(){_r.lineStart=Mr,_r.lineEnd=Er},polygonEnd:function(){_r.point=wr,_r.lineStart=kr,_r.lineEnd=Ar},result:function(){var e=br?[vr/br,xr/br]:yr?[mr/yr,gr/yr]:fr?[pr/fr,dr/fr]:[NaN,NaN];return pr=dr=fr=mr=gr=yr=vr=xr=br=0,e}};function wr(e,t){pr+=e,dr+=t,++fr}function kr(){_r.point=Tr}function Tr(e,t){_r.point=Sr,wr(ar=e,or=t)}function Sr(e,t){var r=e-ar,n=t-or,i=T(r*r+n*n);mr+=i*(ar+e)/2,gr+=i*(or+t)/2,yr+=i,wr(ar=e,or=t)}function Ar(){_r.point=wr}function Mr(){_r.point=Cr}function Er(){Pr(nr,ir)}function Cr(e,t){_r.point=Pr,wr(nr=ar=e,ir=or=t)}function Pr(e,t){var r=e-ar,n=t-or,i=T(r*r+n*n);mr+=i*(ar+e)/2,gr+=i*(or+t)/2,yr+=i,vr+=(i=or*e-ar*t)*(ar+e),xr+=i*(or+t),br+=3*i,wr(ar=e,or=t)}function Lr(e){this._context=e}Lr.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,h)}},result:C};var Ir,zr,Or,Rr,Dr,jr=r(),Fr={point:C,lineStart:function(){Fr.point=Br},lineEnd:function(){Ir&&Nr(zr,Or),Fr.point=C},polygonStart:function(){Ir=!0},polygonEnd:function(){Ir=null},result:function(){var e=+jr;return jr.reset(),e}};function Br(e,t){Fr.point=Nr,zr=Rr=e,Or=Dr=t}function Nr(e,t){Rr-=e,Dr-=t,jr.add(T(Rr*Rr+Dr*Dr)),Rr=e,Dr=t}function Ur(){this._string=[]}function Vr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function qr(e){return function(t){var r=new Hr;for(var n in e)r[n]=e[n];return r.stream=t,r}}function Hr(){}function Gr(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),R(r,e.stream(hr)),t(hr.result()),null!=n&&e.clipExtent(n),e}function Wr(e,t,r){return Gr(e,(function(r){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+t[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,s])}),r)}function $r(e,t,r){return Wr(e,[[0,0],t],r)}function Zr(e,t,r){return Gr(e,(function(r){var n=+t,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];e.scale(150*i).translate([a,o])}),r)}function Xr(e,t,r){return Gr(e,(function(r){var n=+t,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}},Hr.prototype={constructor:Hr,point:function(e,t){this.stream.point(e,t)},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()}};var Yr=y(30*d);function Kr(e,t){return+t?function(e,t){function r(n,i,a,s,l,c,u,h,p,d,m,y,v,x){var b=u-n,_=h-i,w=b*b+_*_;if(w>4*t&&v--){var k=s+d,S=l+m,A=c+y,E=T(k*k+S*S+A*A),C=M(A/=E),P=f(f(A)-1)t||f((b*O+_*R)/w-.5)>.3||s*d+l*m+c*y2?e[2]%360*d:0,I()):[v*p,x*p,b*p]},P.angle=function(e){return arguments.length?(_=e%360*d,I()):_*p},P.reflectX=function(e){return arguments.length?(w=e?-1:1,I()):w<0},P.reflectY=function(e){return arguments.length?(k=e?-1:1,I()):k<0},P.precision=function(e){return arguments.length?(o=Kr(s,C=e*e),z()):T(C)},P.fitExtent=function(e,t){return Wr(P,e,t)},P.fitSize=function(e,t){return $r(P,e,t)},P.fitWidth=function(e,t){return Zr(P,e,t)},P.fitHeight=function(e,t){return Xr(P,e,t)},function(){return t=e.apply(this,arguments),P.invert=t.invert&&L,I()}}function nn(e){var t=0,r=l/3,n=rn(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*d,r=e[1]*d):[t*p,r*p]},i}function an(e,t){var r=w(e),n=(r+w(t))/2;if(f(n)0?t<-c+o&&(t=-c+o):t>c-o&&(t=c-o);var r=i/_(fn(t),n);return[r*w(n*e),i-r*y(n*e)]}return a.invert=function(e,t){var r=i-t,a=k(n)*T(e*e+r*r),o=g(e,f(r))*k(r);return r*n<0&&(o-=l*k(e)*k(r)),[o/n,2*m(_(i/a,1/n))-c]},a}function gn(e,t){return[e,t]}function yn(e,t){var r=y(e),n=e===t?w(e):(r-y(t))/(t-e),i=r/n+e;if(f(n)o&&--i>0);return[e/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},An.invert=cn(M),Mn.invert=cn((function(e){return 2*m(e)})),En.invert=function(e,t){return[-t,2*m(x(e))-c]},e.geoAlbers=sn,e.geoAlbersUsa=function(){var e,t,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){a=[e,t]}};function h(e){var t=e[0],o=e[1];return a=null,r.point(t,o),a||(n.point(t,o),a)||(i.point(t,o),a)}function p(){return e=t=null,h}return h.invert=function(e){var t=s.scale(),r=s.translate(),n=(e[0]-r[0])/t,i=(e[1]-r[1])/t;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(e)},h.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++iDe(n[0],n[1])&&(n[1]=i[1]),De(i[0],n[1])>De(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,t=0,n=a[r=a.length-1];t<=r;n=i,++t)i=a[t],(s=De(n[1],i[0]))>o&&(o=s,te=i[0],ne=n[1])}return ce=ue=null,te===1/0||re===1/0?[[NaN,NaN],[NaN,NaN]]:[[te,re],[ne,ie]]},e.geoCentroid=function(e){he=pe=de=fe=me=ge=ye=ve=xe=be=_e=0,R(e,Be);var t=xe,r=be,n=_e,i=t*t+r*r+n*n;return i2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)},e.geoTransverseMercatorRaw=En,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,pg()):n((r=r||self).d3=r.d3||{},r.d3)}}),fg=p({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(e,t){var r,n;r=e,n=function(e,t,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,p=Math.pow,d=Math.round,f=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,b=x/2,_=x/4,w=Math.SQRT1_2,k=P(2),T=P(x),S=2*x,A=180/x,M=x/180;function E(e){return e>1?b:e<-1?-b:Math.asin(e)}function C(e){return e>1?0:e<-1?x:Math.acos(e)}function P(e){return e>0?Math.sqrt(e):0}function L(e){return(s(e)-s(-e))/2}function I(e){return(s(e)+s(-e))/2}function z(e){var t=g(e/2),r=2*c(o(e/2))/(t*t);function i(e,t){var n=o(e),i=o(t),a=m(t),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(e),l*a]}return i.invert=function(t,i){var s,l=P(t*t+i*i),u=-e/2,h=50;if(!l)return[0,0];do{var p=u/2,d=o(p),f=m(p),g=f/d,v=-c(n(d));u-=s=(2/g*v-r*g-l)/(-v/(f*f)+1-r/(2*d*d))*(d<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(t*x,l*o(u)),E(i*x/l)]},i}function O(e,t){var r=o(t),n=function(e){return e?e/Math.sin(e):1}(C(r*o(e/=2)));return[2*r*m(e)*n,m(t)*n]}function R(e){var t=m(e),r=o(e),i=e>=0?1:-1,s=g(i*e),l=(1+t-r)/2;function c(e,n){var c=o(n),u=o(e/=2);return[(1+c)*m(e),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*t*u]}return c.invert=function(e,c){var u=0,h=0,p=50;do{var d=o(u),f=m(u),g=o(h),v=m(h),x=1+g,b=x*f-e,_=l+v*r-x*t*d-c,w=x*d/2,k=-f*v,T=t*x*f/2,S=r*g+t*d*v,A=k*T-S*w,M=(_*k-b*S)/A/2,E=(b*T-_*w)/A;n(E)>2&&(E/=2),u-=M,h-=E}while((n(M)>y||n(E)>y)&&--p>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function D(e,t){var r=g(t/2),n=P(1-r*r),i=1+n*o(e/=2),a=m(e)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}O.invert=function(e,t){if(!(e*e+4*t*t>x*x+y)){var r=e,i=t,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),p=o(i),d=m(2*i),f=h*h,g=p*p,v=c*c,b=1-g*u*u,_=b?C(p*u)*P(s=1/b):s=0,w=2*_*p*c-e,k=_*h-t,T=s*(g*v+_*p*u*f),S=s*(.5*l*d-2*_*h*c),A=.25*s*(d*c-_*h*g*l),M=s*(f*u+_*v*p),E=S*A-M*T;if(!E)break;var L=(k*S-w*M)/E,I=(w*A-k*T)/E;r-=L,i-=I}while((n(L)>y||n(I)>y)&&--a>0);return[r,i]}},D.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&n(t)>1)return null;var r=1+e*e+t*t,i=P((r-P(r*r-4*t*t))/2),s=E(i)/3,l=i?function(e){return c(e+P(e*e-1))}(n(t/i))/3:function(e){return c(e+P(e*e+1))}(n(e))/3,u=o(s),h=I(l),p=h*h-u*u;return[2*f(e)*a(L(l)*u,.25-p),2*f(t)*a(h*m(s),.25+p)]};var j=P(8),F=c(1+k);function B(e,t){var r=n(t);return r<_?[e,c(g(_+t/2))]:[e*o(r)*(2*k-1/m(r)),f(t)*(2*k*(r-_)-c(g(r/2)))]}function N(e){var r=2*x/e;function s(e,i){var s=t.geoAzimuthalEquidistantRaw(e,i);if(n(e)>b){var l=a(s[1],s[0]),c=P(s[0]*s[0]+s[1]*s[1]),u=r*d((l-b)/r)+b,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(e,n){var s=P(e*e+n*n);if(s>b){var l=a(n,e),c=r*d((l-b)/r)+b,u=l>c?-1:1,h=s*o(c-l),p=1/g(u*C((h-x)/P(x*(x-2*h)+s*s)));l=c+2*i((p+u*P(p*p-3))/3),e=s*o(l),n=s*m(l)}return t.geoAzimuthalEquidistantRaw.invert(e,n)},s}function U(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=t.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=e,a}return n.invert=function(n,i){var a=t.geoAzimuthalEqualAreaRaw.invert(n/e,i);return a[0]*=r,a},n}function V(e,t){return[e*o(t)/o(t/=2),2*m(t)]}function q(e,t,r){var i,a,o,s=100;r=void 0===r?0:+r,t=+t;do{(a=e(r))===(o=e(r+y))&&(o=a+y),r-=i=-1e-6*(a-t)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;hl)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=e(o+g,s),x=e(o,s+y),b=(v[0]-p[0])/g,_=(v[1]-p[1])/g,w=(x[0]-p[0])/y,k=(x[1]-p[1])/y,T=k*b-_*w,S=(n(T)<.5?.5:1)/T;if(o+=c=(f*w-d*k)*S,s+=u=(d*_-f*b)*S,n(c)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=H(t),t}function W(e,t){var r,i=e*m(t),a=30;do{t-=r=(t+m(t)-i)/(1+o(t))}while(n(r)>y&&--a>0);return t/2}function $(e,t,r){function n(n,i){return[e*n*o(i=W(r,i)),t*m(i)]}return n.invert=function(n,i){return i=E(i/t),[n/(e*o(i)),E((2*i+m(2*i))/r)]},n}B.invert=function(e,t){if((a=n(t))v&&--u>0);return[e/(o(l)*(j-1/m(l))),f(t)*l]},V.invert=function(e,t){var r=2*E(t/2);return[e*o(r/2)/o(r),r]};var Z=$(k/b,k,x),X=2.00276,Y=1.11072;function K(e,t){var r=W(x,t);return[X*e/(1/o(t)+Y/o(r)),(t+k*m(r))/X]}function J(e){var r=0,n=t.geoProjectionMutator(e),i=n(r);return i.parallel=function(e){return arguments.length?n(r=e*M):r*A},i}function Q(e,t){return[e*o(t),t]}function ee(e){if(!e)return Q;var t=1/g(e);function r(r,n){var i=t+e-n,a=i?r*o(n)/i:i;return[i*m(a),t-i*o(a)]}return r.invert=function(r,n){var i=P(r*r+(n=t-n)*n),s=t+e-i;return[i/o(s)*a(r,n),s]},r}function te(e){function t(t,r){var n=b-r,i=n?t*e*m(n)/n:n;return[n*m(i)/e,b-n*o(i)]}return t.invert=function(t,r){var n=t*e,i=b-r,o=P(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/e,b-o]},t}K.invert=function(e,t){var r,i,a=X*t,s=t<0?-_:_,l=25;do{i=a-k*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*k*o(s))}while(n(r)>y&&--l>0);return i=a-k*m(s),[e*(1/o(i)+Y/o(s))/X,i]},Q.invert=function(e,t){return[e/o(t),t]};var re=$(1,4/x,x);function ne(e,t,r,i,s,l){var c,u=o(l);if(n(e)>1||n(l)>1)c=C(r*s+t*i*u);else{var h=m(e/2),p=m(l/2);c=2*E(P(h*h+t*i*p*p))}return n(c)>y?[c,a(i*m(l),t*s-r*i*u)]:[0,0]}function ie(e,t,r){return C((e*e+t*t-r*r)/(2*e*t))}function ae(e){return e-2*x*l((e+x)/(2*x))}function oe(e,t,r){for(var n,i=[[e[0],e[1],m(e[1]),o(e[1])],[t[0],t[1],m(t[1]),o(t[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=ne(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=ie(i[0].v[0],i[2].v[0],i[1].v[0]),c=ie(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(e,t){var r,n=m(t),a=o(t),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=ne(t-l[1],l[3],l[2],a,n,e-l[0]),!s[r][0])return l.point;s[r][1]=ae(s[r][1]-l.v[1])}var p=h.slice();for(r=0;r<3;++r){var d=2==r?0:r+1,f=ie(i[r].v[0],s[r][0],s[d][0]);s[r][1]<0&&(f=-f),r?1==r?(f=c-f,p[0]-=s[r][0]*o(f),p[1]-=s[r][0]*m(f)):(f=u-f,p[0]+=s[r][0]*o(f),p[1]+=s[r][0]*m(f)):(p[0]+=s[r][0]*o(f),p[1]-=s[r][0]*m(f))}return p[0]/=3,p[1]/=3,p}}function se(e){return e[0]*=M,e[1]*=M,e}function le(e,r,n){var i=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,n]}),a=[-i[0],-i[1]],o=t.geoRotation(a),s=oe(se(o(e)),se(o(r)),se(o(n)));s.invert=H(s);var l=t.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(e){return arguments.length?c(o(e)):o.invert(c())},l.clipAngle(90)}function ce(e,t){var r=P(1-m(t));return[2/T*e*r,T*(1-r)]}function ue(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var n=o(e);return[e,2*a(P(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,E(e?t*g(e)/e:t)]},r}ce.invert=function(e,t){var r=(r=t/T-1)*r;return[r>0?e*P(x/r)/2:0,E(1-r)]};var he=P(3);function pe(e,t){return[he*e*(2*o(2*t/3)-1)/T,he*T*m(t/3)]}function de(e){var t=o(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,E(r*t)]},r}function fe(e){var t=o(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*i(r/(1+t))]},r}function me(e,t){var r=P(8/(3*x));return[r*e*(1-n(t)/x),r*t]}function ge(e,t){var r=P(4-3*m(n(t)));return[2/P(6*x)*e*r,f(t)*P(2*x/3)*(2-r)]}function ye(e,t){var r=P(x*(4+x));return[2/r*e*(1+P(1-4*t*t/(x*x))),4/r*t]}function ve(e,t){var r=(2+b)*m(t);t/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(t);t-=a=(t+m(t)*(s+2)-r)/(2*s*(1+s))}return[2/P(x*(4+x))*e*(1+o(t)),2*P(x/(4+x))*m(t)]}function xe(e,t){return[e*(1+o(t))/P(2+x),2*t/P(2+x)]}function be(e,t){for(var r=(1+b)*m(t),i=0,a=1/0;i<10&&n(a)>y;i++)t-=a=(t+m(t)-r)/(1+o(t));return r=P(2+x),[e*(1+o(t))/r,2*t/r]}pe.invert=function(e,t){var r=3*E(t/(he*T));return[T*e/(he*(2*o(2*r/3)-1)),r]},me.invert=function(e,t){var r=P(8/(3*x)),i=t/r;return[e/(r*(1-n(i)/x)),i]},ge.invert=function(e,t){var r=2-n(t)/P(2*x/3);return[e*P(6*x)/(2*r),f(t)*E((4-r*r)/3)]},ye.invert=function(e,t){var r=P(x*(4+x))/2;return[e*r/(1+P(1-t*t*(4+x)/(4*x))),t*r/2]},ve.invert=function(e,t){var r=t*P((4+x)/x)/2,n=E(r),i=o(n);return[e/(2/P(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+b))]},xe.invert=function(e,t){var r=P(2+x),n=t*r/2;return[r*e/(1+o(n)),n]},be.invert=function(e,t){var r=1+b,n=P(r/2);return[2*e*n/(1+o(t*=n)),E((t+m(t))/r)]};var _e=3+2*k;function we(e,t){var r=m(e/=2),n=o(e),a=P(o(t)),s=o(t/=2),l=m(t)/(s+k*n*a),u=P(2/(1+l*l)),h=P((k*s+(n+r)*a)/(k*s+(n-r)*a));return[_e*(u*(h-1/h)-2*c(h)),_e*(u*l*(h+1/h)-2*i(l))]}we.invert=function(e,t){if(!(r=D.invert(e/1.2,1.065*t)))return null;var r,a=r[0],s=r[1],l=20;e/=_e,t/=_e;do{var p=a/2,d=s/2,f=m(p),g=o(p),v=m(d),x=o(d),_=o(s),T=P(_),S=v/(x+k*g*T),A=S*S,M=P(2/(1+A)),E=(k*x+(g+f)*T)/(k*x+(g-f)*T),C=P(E),L=C-1/C,I=C+1/C,z=M*L-2*c(C)-e,O=M*S*I-2*i(S)-t,R=v&&w*T*f*A/v,j=(k*g*x+T)/(2*(x+k*g*T)*(x+k*g*T)*T),F=-.5*S*M*M*M,B=F*R,N=F*j,U=(U=2*x+k*T*(g-f))*U*C,V=(k*g*x*T+_)/U,q=-k*f*v/(T*U),H=L*B-2*V/C+M*(V+V/E),G=L*N-2*q/C+M*(q+q/E),W=S*I*B-2*R/(1+A)+M*I*R+M*S*(V-V/E),$=S*I*N-2*j/(1+A)+M*I*j+M*S*(q-q/E),Z=G*W-$*H;if(!Z)break;var X=(O*G-z*$)/Z,Y=(z*W-O*H)/Z;a-=X,s=u(-b,h(b,s-Y))}while((n(X)>y||n(Y)>y)&&--l>0);return n(n(s)-b)s){var f=P(p),g=a(h,u),v=i*d(g/i),_=g-v,w=e*o(_),k=(e*m(_)-_*m(w))/(b-w),T=Pe(_,k),S=(x-e)/Le(T,w,x);u=f;var A,M=50;do{u-=A=(e+Le(T,w,u)*S-f)/(T(u)*S)}while(n(A)>y&&--M>0);h=_*m(u),us){var u=P(c),h=a(l,r),p=i*d(h/i),f=h-p;r=u*o(f),l=u*m(f);for(var g=r-b,y=m(r),_=l/y,w=ry||n(d)>y)&&--v>0);return[f,g]},u}Te.invert=function(e,t){var r=t/(1+ke);return[e&&e/(ke*P(1-r*r)),2*i(r)]},Se.invert=function(e,t){var r=i(t/T),n=o(r),a=2*r;return[e*T/2/(o(a)*n*n),a]};var ze=Ie(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Oe=Ie(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Re=Ie(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function De(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}De.invert=function(e,t){var r,i=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(n(r)>y&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var je=Ie(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Fe(e){var t=e(b,0)[0]-e(-b,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*x,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function Be(e,t){var r=f(e),i=f(t),s=o(t),l=o(e)*s,c=m(e)*s,u=m(i*t);e=n(a(c,u)),t=E(l),n(e-b)>y&&(e%=b);var h=function(e,t){if(t===b)return[0,0];var r,i,a=m(t),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,p=E(1/P(c)),d=h+s*c*p,f=(1-a)/d,g=P(f),v=f*c,_=P(v),w=g*h;if(0===e)return[0,-(w+s*_)];var k,T=o(t),S=1/T,A=2*a*T,M=(-3*s+p*u)*A,C=(-d*T-(1-a)*M)/(d*d),L=-S*A,I=-S*(s*c*C+f*u*A),z=-2*S*(h*(.5*C/g)-2*s*g*A),O=4*e/x;if(e>.222*x||t.175*x){if(r=(w+s*P(v*(1+l)-w*w))/(1+l),e>x/4)return[r,r];var R=r,D=.5*r;r=.5*(D+R),i=50;do{var j=r*(z+L*P(v-r*r))+I*E(r/_)-O;if(!j)break;j<0?D=r:R=r,r=.5*(D+R)}while(n(R-D)>y&&--i>0)}else{r=y,i=25;do{var F=r*r,B=P(v-F),N=z+L*B,U=r*N+I*E(r/_)-O;r-=k=B?U/(N+(I-L*F)/B):0}while(n(k)>y&&--i>0)}return[r,-w-s*P(v-r*r)]}(e>x/4?b-e:e,t);return e>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Ne(e,t){var r,a,l,c,u,h;if(t=.999999)return r=(1-t)/4,l=1/(a=I(e)),[(c=((h=s(2*(h=e)))-1)/(h+1))+r*((u=a*L(e))-e)/(a*a),l-r*c*l*(u-e),l+r*c*l*(u+e),2*i(s(e))-b+r*(u-e)/a];var p=[1,0,0,0,0,0,0,0,0],d=[P(t),0,0,0,0,0,0,0,0],f=0;for(a=P(1-t),u=1;n(d[f]/p[f])>y&&f<8;)r=p[f++],d[f]=(r-a)/2,p[f]=(r+a)/2,a=P(r*a),u*=2;l=u*p[f]*e;do{l=(E(c=d[f]*m(a=l)/p[f])+l)/2}while(--f);return[m(l),c=o(l),c/o(l-a),l]}function Ue(e,t){if(!t)return e;if(1===t)return c(g(e/2+_));for(var r=1,a=P(1-t),o=P(t),s=0;n(o)>y;s++){if(e%x){var l=i(a*g(e)/r);l<0&&(l+=x),e+=l+~~(e/x)*x}else e+=e;o=(r+a)/2,a=P(r*a),o=((r=o)-a)/2}return e/(p(2,s)*r)}function Ve(e,t){var r=(k-1)/(k+1),l=P(1-r*r),u=Ue(b,l*l),h=c(g(x/4+n(t)/2)),p=s(-1*h)/P(r),d=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?b:-b)-a(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(p*o(-1*e),p*m(-1*e)),y=function(e,t,r){var a=n(e),o=L(n(t));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+P(c*c-(r-1)*l*4))/2;return[Ue(i(1/P(u)),r)*f(e),Ue(i(P((u/l-1)/r)),1-r)*f(t)]}return[0,Ue(i(o),1-r)*f(t)]}(d[0],d[1],l*l);return[-y[1],(t>=0?1:-1)*(.5*u-y[0])]}function qe(e){var t=m(e),r=o(e),i=He(e);function s(e,a){var s=i(e,a);e=s[0],a=s[1];var l=m(a),c=o(a),u=o(e),h=C(t*l+r*c*u),p=m(h),d=n(p)>y?h/p:1;return[d*r*m(e),(n(e)>b?d:-d)*(t*c-r*l*u)]}return i.invert=He(-e),s.invert=function(e,r){var n=P(e*e+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*t,p=P(c*c+u*u-h*h),d=a(c*h+u*p,u*h-c*p),f=(n>b?-1:1)*a(e*s,n*o(d)*l+r*m(d)*s);return i.invert(f,d)},s}function He(e){var t=m(e),r=o(e);return function(e,n){var i=o(n),s=o(e)*i,l=m(e)*i,c=m(n);return[a(l,s*r-c*t),E(c*r+s*t)]}}Be.invert=function(e,t){n(e)>1&&(e=2*f(e)-e),n(t)>1&&(t=2*f(t)-t);var r=f(e),i=f(t),s=-r*e,l=-i*t,c=l/s<1,u=function(e,t){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=P(a),u=E(1/P(1+l)),h=1-l+a*(1+l)*u,p=(1-c)/h,d=P(p),f=p*(1+l),m=d*(1-l),g=P(f-e*e),y=t+m+a*g;if(n(i-r)0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var b=E(c),_=o(b),w=1/_,k=2*c*_,T=(-h*_-(-3*a+u*(1+3*l))*k*(1-c))/(h*h),S=.5*T/d,A=(1-l)*S-2*a*d*k;return[x/4*(e*(-2*w*A+-w*k*g)+-w*(a*(1+l)*T+p*(1+3*l)*k)*E(e/P(f))),b]}(c?l:s,c?s:l),h=u[0],p=u[1],d=o(p);return c&&(h=-b-h),[r*(a(m(h)*d,-m(p))+x),i*E(o(h)*d)]},Ve.invert=function(e,t){var r=(k-1)/(k+1),n=P(1-r*r),o=function(e,t,r){var n,i,a;return e?(n=Ne(e,r),t?(a=(i=Ne(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Ne(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Ue(b,n*n)-t,-e,n*n),l=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(o[0],o[1]);return[a(l[1],l[0])/-1,2*i(s(-.5*c(r*l[0]*l[0]+r*l[1]*l[1])))-b]};var Ge=E(1-1/3)*A,We=de(0);function $e(e){var t=Ge*M,r=ce(x,t)[0]-ce(-x,t)[0],i=We(0,t)[1],a=ce(0,t)[1],o=T-a,s=S/e,c=4/S,p=i+o*o*4/S;function d(d,f){var m,g=n(f);if(g>t){var y=h(e-1,u(0,l((d+x)/s)));(m=ce(d+=x*(e-1)/e-y*s,g))[0]=m[0]*S/r-S*(e-1)/(2*e)+y*S/e,m[1]=i+4*(m[1]-a)*o/S,f<0&&(m[1]=-m[1])}else m=We(d,f);return m[0]*=c,m[1]/=p,m}return d.invert=function(t,d){t/=c;var f=n(d*=p);if(f>i){var m=h(e-1,u(0,l((t+x)/s)));t=(t+x*(e-1)/e-m*s)*r/S;var g=ce.invert(t,.25*(f-i)*S/o+a);return g[0]-=x*(e-1)/e-m*s,d<0&&(g[1]=-g[1]),g}return We.invert(t,d)},d}function Ze(e,t){return[e,1&t?89.999999:Ge]}function Xe(e,t){return[e,1&t?-89.999999:-Ge]}function Ye(e){return[.999999*e[0],e[1]]}function Ke(e){var t,r=1+e,i=E(m(1/r)),s=2*P(x/(t=x+4*i*r)),l=.5*s*(r+P(e*(2+e))),c=e*e,u=r*r;function h(h,p){var d,f,g=1-m(p);if(g&&g<2){var y,_=b-p,w=25;do{var k=m(_),T=o(_),S=i+a(k,r-T),A=1+u-2*r*T;_-=y=(_-c*i-r*k+A*S-.5*g*t)/(2*r*k*S)}while(n(y)>v&&--w>0);d=s*P(A),f=h*S/x}else d=s*(e+g),f=h*i/x;return[d*m(f),l-d*o(f)]}return h.invert=function(e,n){var o=e*e+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),p=C(h),d=m(p),f=i+a(d,r-h);return[E(e/P(o))*x/f,E(1-2*(p-c*i-r*d+(1+u-2*r*h)*f)/t)]},h}var Je=.7109889596207567,Qe=.0528035274542;function et(e,t){return t>-Je?((e=Z(e,t))[1]+=Qe,e):Q(e,t)}function tt(e,t){return n(t)>Je?((e=Z(e,t))[1]-=t>0?Qe:-Qe,e):Q(e,t)}function rt(e,t,r,n){var i=P(4*x/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),a=P(n*m(r)*P((1+e*o(2*r)+t*o(4*r))/(1+e+t))),s=r*c(1);function l(r){return P(1+e*o(2*r)+t*o(4*r))}function c(n){var i=n*r;return(2*i+(1+e-t/2)*m(2*i)+(e+t)/2*m(4*i)+t/2*m(6*i))/r}function u(e){return l(e)*m(e)}var h=function(e,t){var n=r*q(c,s*m(t)/r,t/x);isNaN(n)&&(n=r*f(t));var u=i*l(n);return[u*a*e/x*o(n),u/a*m(n)]};return h.invert=function(e,t){var n=q(u,t*a/i);return[e*x/(o(n)*i*a*l(n)),E(r*c(n/r)/s)]},0===r&&(i=P(n/x),(h=function(e,t){return[e*i,m(t)/i]}).invert=function(e,t){return[e/i,E(t*i)]}),h}function nt(e,t,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,p,d,f,m,g,y,v,x,b;if(p=e(t+.25*(h=r-t)),d=e(r-.25*h),isNaN(p))u.nanEncountered=!0;else{if(!isNaN(d))return b=((g=(f=h*(n+4*p+i)/12)+(m=h*(i+4*d+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+b):Math.abs(b)e?r=n:t=n,n=t+r>>1}while(n>t);var i=c[n+1]-c[n];return i&&(i=(e-c[n+1])/i),(n+1+i)/s}var d=2*h(1)/x*o/r,g=function(e,t){var r=h(n(m(t))),a=i(r)*e;return r/=d,[a,t>=0?r:-r]};return g.invert=function(e,t){var r;return n(t*=d)<1&&(r=f(t)*E(a(n(t))*o)),[e/i(n(t)),r]},g}function ot(e,t){return n(e[0]-t[0])a[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):e.invert&&(s.invert=function(t,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l=0;--l)n=(t=e[1][l])[0][0],i=t[0][1],a=t[1][1],o=t[2][0],s=t[2][1],c.push(st([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(t),n=t.map((function(e){return e.map((function(e){return[[e[0][0]*M,e[0][1]*M],[e[1][0]*M,e[1][1]*M],[e[2][0]*M,e[2][1]*M]]}))})),o=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(e){return e.map((function(e){return[[e[0][0]*A,e[0][1]*A],[e[1][0]*A,e[1][1]*A],[e[2][0]*A,e[2][1]*A]]}))}))},null!=n&&l.lobes(n),l}et.invert=function(e,t){return t>-Je?Z.invert(e,t-Qe):Q.invert(e,t)},tt.invert=function(e,t){return n(t)>Je?Z.invert(e,t+(t>0?Qe:-Qe)):Q.invert(e,t)};var ct=[[[[-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]]]],ut=[[[[-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]]]],ht=[[[[-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]]]],pt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],dt=[[[[-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]]]],ft=[[[[-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 mt(e,t){return[3/S*e*P(x*x/3-t*t),t]}function gt(e){function t(t,r){if(n(n(r)-b)2)return null;var o=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+o+s);return l=p((1+l)/(1-l),1/e),[a(2*t,1-o-s)/e,E((l-1)/(l+1))]},t}mt.invert=function(e,t){return[S/3*e/P(x*x/3-t*t),t]};var yt=x/k;function vt(e,t){return[e*(1+P(o(t)))/2,t/(o(t/2)*o(e/6))]}function xt(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function bt(e,t){return[m(e)/o(t),g(t)*o(e)]}function _t(e){var t=o(e),r=g(_+e/2);function i(i,a){var o=a-e,s=n(o)=0;)p=(h=e[u])[0]+l*(i=p)-c*d,d=h[1]+l*d+c*i;return[p=l*(i=p)-c*d,d=l*d+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,p=t,d=e[p],f=d[0],g=d[1],y=0,v=0;--p>=0;)y=f+c*(h=y)-u*v,v=g+c*v+u*h,f=(d=e[p])[0]+c*(h=f)-u*g,g=d[1]+c*g+u*h;var x,b,_=(y=f+c*(h=y)-u*v)*y+(v=g+c*v+u*h)*v;c-=x=((f=c*(h=f)-u*g-r)*y+(g=c*g+u*h-s)*v)/_,u-=b=(g*y-f*v)/_}while(n(x)+n(b)>1e-12&&--l>0);if(l){var w=P(c*c+u*u),k=2*i(.5*w),T=m(k);return[a(c*T,w*o(k)),w?E(u*T/w):0]}},r}vt.invert=function(e,t){var r=n(e),i=n(t),a=y,s=b;iy||n(b)>y)&&--a>0);return a&&[r,i]},bt.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?w*P((i-P(i*i-4*r))/r):1/P(n);return[E(e*a),f(t)*C(a)]},wt.invert=function(e,t){return[e,2.5*i(s(.8*t))-.625*x]};var Tt=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],St=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],At=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Mt=[[.9245,0],[0,0],[.01943,0]],Et=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ct(e,r){var n=t.geoProjection(kt(e)).rotate(r).clipAngle(90),i=t.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(e){return arguments.length?a(i(e)):i.invert(a())},n}var Pt=P(6),Lt=P(7);function It(e,t){var r=E(7*m(t)/(3*Pt));return[Pt*e*(2*o(2*r/3)-1)/Lt,9*m(r/3)/Lt]}function zt(e,t){for(var r,i=(1+w)*m(t),a=t,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)v&&--l>0);return[e/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Dt.invert=function(e,t){for(var r=t/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(t/2);t-=a=(t-g(t/2)-r)/(1-.5/(s*s))}return[2*e/(1+o(t)),t]};var jt=[[[[-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 Ft(e,t){var r=m(t),i=o(t),a=f(e);if(0===e||n(t)===b)return[0,t];if(0===t)return[e,0];if(n(e)===b)return[e*i,b*r];var s=x/(2*e)-2*e/x,l=2*t/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,p=1+u/h,d=1+h/u,g=(s*r/c-s/2)/p,y=(h*r/u+c/2)/d,v=y*y-(h*r*r/u+c*r-1)/d;return[b*(g+P(g*g+i*i/p)*a),b*(y+P(v<0?0:v)*f(-t*s)*a)]}Ft.invert=function(e,t){var r=(e/=b)*e,n=r+(t/=b)*t,i=x*x;return[e?(n-1+P((1-n)*(1-n)+4*r))/(2*e)*b:0,q((function(e){return n*(x*m(e)-2*e)*x+4*e*e*(t-m(e))+2*x*e-i*t}),0)]};var Bt=1.0148,Nt=.23185,Ut=-.14499,Vt=.02406,qt=Bt,Ht=5*Nt,Gt=1.790857183;function Wt(e,t){var r=t*t;return[e,t*(Bt+r*r*(Nt+r*(Ut+Vt*r)))]}function $t(e,t){if(n(t)=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=Zt(n.map(r.project),n.map(t.project));t.transform=r.transform?Xt(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;oGt?t=Gt:t<-1.790857183&&(t=-1.790857183);var r,i=t;do{var a=i*i;i-=r=(i*(Bt+a*a*(Nt+a*(Ut+Vt*a)))-t)/(qt+a*a*(Ht+a*(.21654*a-1.01493)))}while(n(r)>y);return[e,i]},$t.invert=function(e,t){if(n(t)y&&--s>0);return l=g(a),[(n(t)n^d>n&&r<(p-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),fr=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function vr(e){var r=e(b,0)[0]-e(-b,0)[0];function i(t,i){var a=n(t)0?t-x:t+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-f(l)*c,u*l-f(s)*c]}return e.invert&&(i.invert=function(t,i){var a=(t+i)*w,o=(i-t)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*t+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var p=e.invert(a,o);return s||(p[0]+=a>0?x:-x),p}),t.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function xr(){return vr(Ve).scale(111.48)}function br(e){var t=m(e);function r(r,n){var a=t?g(r*t/2)/t:r/2;if(!n)return[2*a,-e];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-e]}return r.invert=function(r,a){if(n(a+=e)y&&--u>0);var f=r*(h=g(c)),v=g(n(a)0?b:-b)*(p+o*(f-c)/2+o*o*(f-2*p+c)/2)]}function kr(e,t){var r=function(e){function t(t,r){var n=o(r),i=(e-1)/(e-n*o(t));return[i*n*m(t),i*m(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=P(n),o=(e-P(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[a(t*o,i*P(1-o*o)),i?E(r*o/i):0]},t}(e);if(!t)return r;var n=o(t),i=m(t);function s(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},s}_r.forEach((function(e){e[1]*=1.0144})),wr.invert=function(e,t){var r=t/b,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=_r[o][1],c=_r[o+1][1],p=_r[h(19,o+2)][1],d=p-s,f=p-2*c+s,m=2*(n(r)-c)/d,g=f/d,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(t>=0?5:-5)*(y+a);var x,_=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=_r[o][1],c=_r[o+1][1],p=_r[h(19,o+2)][1],i-=(x=(t>=0?b:-b)*(c+y*(p-s)/2+y*y*(p-2*c+s)/2)-t)*A}while(n(x)>v&&--_>0);break}}while(--o>=0);var w=_r[o][0],k=_r[o+1][0],T=_r[h(19,o+2)][0];return[e/(k+y*(T-w)/2+y*y*(T-2*k+w)/2),i*M]};var Tr=-180,Sr=-179.9999,Ar=179.9999,Mr=-89.9999,Er=89.9999;function Cr(e){return e.length>0}function Pr(e){return-90===e||90===e?[0,e]:[Tr,(t=e,Math.floor(1e4*t)/1e4)];var t}function Lr(e){var t=e[0],r=e[1],n=!1;return t<=Sr?(t=Tr,n=!0):t>=Ar&&(t=180,n=!0),r<=Mr?(r=-90,n=!0):r>=Er&&(r=90,n=!0),n?[t,r]:e}function Ir(e){return e.map(Lr)}function zr(e,t,r){for(var n=0,i=e.length;n=Ar||u<=Mr||u>=Er){a[o]=Lr(l);for(var h=o+1;hSr&&dMr&&f=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(h-1)}),a[0]=Pr(a[0][1]),o=-1,s=a.length}}}}function Or(e){var t,r,n,i,a,o,s=e.length,l={},c={};for(t=0;t0?x-l:l)*A],u=t.geoProjection(e(s)).rotate(c),h=t.geoRotation(c),p=u.center;return delete u.rotate,u.center=function(e){return arguments.length?p(h(e)):h.invert(p())},u.clipAngle(90)}function Br(e){var r=o(e);function n(e,n){var i=t.geoGnomonicRaw(e,n);return i[0]*=r,i}return n.invert=function(e,n){return t.geoGnomonicRaw.invert(e/r,n)},n}function Nr(e,t){return Fr(Br,e,t)}function Ur(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,n=-r,i=e*e,s=g(n),l=.5/m(n);function c(t,a){var s=C(o(a)*o(t-r)),l=C(o(a)*o(t-n));return[((s*=s)-(l*=l))/(2*e),(a<0?-1:1)*P(4*i*l-(i-s+l)*(i-s+l))/(2*e)]}return c.invert=function(e,t){var i,c,u=t*t,h=o(P(u+(i=e+r)*i)),p=o(P(u+(i=e+n)*i));return[a(c=h-p,i=(h+p)*s),(t<0?-1:1)*C(P(i*i+c*c)*l)]},c}function Vr(e,t){return Fr(Ur,e,t)}function qr(e,t){if(n(t)y&&--l>0);return[f(e)*(P(a*a+4)+a)*x/4,b*s]};var Xr=4*x+3*P(3),Yr=2*P(2*x*P(3)/Xr),Kr=$(Yr*P(3)/x,Yr,Xr/6);function Jr(e,t){return[e*P(1-3*t*t/(x*x)),t]}function Qr(e,t){var r=o(t),n=o(e)*r,i=1-n,s=o(e=a(m(e)*r,-m(t))),l=m(e);return[l*(r=P(1-n*n))-s*i,-s*r-l*i]}function en(e,t){var r=O(e,t);return[(r[0]+e/b)/2,(r[1]+t)/2]}Jr.invert=function(e,t){return[e/P(1-3*t*t/(x*x)),t]},Qr.invert=function(e,t){var r=(e*e+t*t)/-2,n=P(-r*(2+r)),i=t*r+e*n,o=e*r-t*n,s=P(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},en.invert=function(e,t){var r=e,i=t,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,p=l*l,d=m(r),f=o(r/2),g=m(r/2),v=g*g,x=1-p*f*f,_=x?C(l*f)*P(s=1/x):s=0,w=.5*(2*_*l*g+r/b)-e,k=.5*(_*c+i)-t,T=.5*s*(p*v+_*l*f*h)+.5/b,S=s*(d*u/4-_*c*g),A=.125*s*(u*g-_*c*p*d),M=.5*s*(h*f+_*v*l)+.5,E=S*A-M*T,L=(k*S-w*M)/E,I=(w*A-k*T)/E;r-=L,i-=I}while((n(L)>y||n(I)>y)&&--a>0);return[r,i]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=b,r=t.geoProjectionMutator(z),n=r(e);return n.radius=function(t){return arguments.length?r(e=t*M):e*A},n.scale(179.976).clipAngle(147)},e.geoAiryRaw=z,e.geoAitoff=function(){return t.geoProjection(O).scale(152.63)},e.geoAitoffRaw=O,e.geoArmadillo=function(){var e=20*M,r=e>=0?1:-1,n=g(r*e),i=t.geoProjectionMutator(R),s=i(e),l=s.stream;return s.parallel=function(t){return arguments.length?(n=g((r=(e=t*M)>=0?1:-1)*e),i(e)):e*A},s.stream=function(t){var i=s.rotate(),c=l(t),u=(s.rotate([0,0]),l(t)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=-180*r;r*t<180;t+=90*r)u.point(t,90*r);if(e)for(;r*(t-=3*r*h)>=-180;)u.point(t,r*-a(o(t*M/2),n)*A);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=R,e.geoAugust=function(){return t.geoProjection(D).scale(66.1603)},e.geoAugustRaw=D,e.geoBaker=function(){return t.geoProjection(B).scale(112.314)},e.geoBakerRaw=B,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(N),n=r(e),i=n.stream,s=.01,l=-o(s*M),c=m(s*M);return n.lobes=function(t){return arguments.length?r(e=+t):e},n.stream=function(t){var r=n.rotate(),u=i(t),h=(n.rotate([0,0]),i(t));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var t=0,r=360/e,n=2*x/e,i=90-180/e,u=b;t=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},n.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=qe,e.geoHealpix=function(){var e=4,n=t.geoProjectionMutator($e),i=n(e),a=i.stream;return i.lobes=function(t){return arguments.length?n(e=+t):e},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){t.geoStream(function(e){var t=[].concat(r.range(-180,180+e/2,e).map(Ze),r.range(180,-180-e/2,-e).map(Xe));return{type:"Polygon",coordinates:[180===e?t.map(Ye):t]}}(180/e),l)},s},i.scale(239.75)},e.geoHealpixRaw=$e,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(Ke),n=r(e);return n.ratio=function(t){return arguments.length?r(e=+t):e},n.scale(167.774).center([0,18.67])},e.geoHillRaw=Ke,e.geoHomolosine=function(){return t.geoProjection(tt).scale(152.63)},e.geoHomolosineRaw=tt,e.geoHufnagel=function(){var e=1,r=0,n=45*M,i=2,a=t.geoProjectionMutator(rt),o=a(e,r,n,i);return o.a=function(t){return arguments.length?a(e=+t,r,n,i):e},o.b=function(t){return arguments.length?a(e,r=+t,n,i):r},o.psiMax=function(t){return arguments.length?a(e,r,n=+t*M,i):n*A},o.ratio=function(t){return arguments.length?a(e,r,n,i=+t):i},o.scale(180.739)},e.geoHufnagelRaw=rt,e.geoHyperelliptical=function(){var e=0,r=2.5,n=1.183136,i=t.geoProjectionMutator(at),a=i(e,r,n);return a.alpha=function(t){return arguments.length?i(e=+t,r,n):e},a.k=function(t){return arguments.length?i(e,r=+t,n):r},a.gamma=function(t){return arguments.length?i(e,r,n=+t):n},a.scale(152.63)},e.geoHyperellipticalRaw=at,e.geoInterrupt=lt,e.geoInterruptedBoggs=function(){return lt(K,ct).scale(160.857)},e.geoInterruptedHomolosine=function(){return lt(tt,ut).scale(152.63)},e.geoInterruptedMollweide=function(){return lt(Z,ht).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return lt(Z,pt).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return lt(et,dt,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return lt(Q,ft).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(mt).scale(158.837)},e.geoKavrayskiy7Raw=mt,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(gt),n=r(e);return n.spacing=function(t){return arguments.length?r(e=+t):e},n.scale(124.75)},e.geoLagrangeRaw=gt,e.geoLarrivee=function(){return t.geoProjection(vt).scale(97.2672)},e.geoLarriveeRaw=vt,e.geoLaskowski=function(){return t.geoProjection(xt).scale(139.98)},e.geoLaskowskiRaw=xt,e.geoLittrow=function(){return t.geoProjection(bt).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=bt,e.geoLoximuthal=function(){return J(_t).parallel(40).scale(158.837)},e.geoLoximuthalRaw=_t,e.geoMiller=function(){return t.geoProjection(wt).scale(108.318)},e.geoMillerRaw=wt,e.geoModifiedStereographic=Ct,e.geoModifiedStereographicRaw=kt,e.geoModifiedStereographicAlaska=function(){return Ct(Tt,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return Ct(St,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return Ct(At,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return Ct(Mt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return Ct(Et,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection(Z).scale(169.529)},e.geoMollweideRaw=Z,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(It).scale(164.859)},e.geoMtFlatPolarParabolicRaw=It,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(zt).scale(188.209)},e.geoMtFlatPolarQuarticRaw=zt,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(Ot).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=Ot,e.geoNaturalEarth2=function(){return t.geoProjection(Rt).scale(175.295)},e.geoNaturalEarth2Raw=Rt,e.geoNellHammer=function(){return t.geoProjection(Dt).scale(152.63)},e.geoNellHammerRaw=Dt,e.geoInterruptedQuarticAuthalic=function(){return lt(U(1/0),jt).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(Ft).scale(127.267)},e.geoNicolosiRaw=Ft,e.geoPatterson=function(){return t.geoProjection(Wt).scale(139.319)},e.geoPattersonRaw=Wt,e.geoPolyconic=function(){return t.geoProjection($t).scale(103.74)},e.geoPolyconicRaw=$t,e.geoPolyhedral=Jt,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Jt(r[0],(function(e,t){return r[e<-x/2?t<0?6:4:e<0?t<0?2:0:e0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Jt(r[0],(function(e,t){return r[e<-x/2?t<0?6:4:e<0?t<0?2:0:e2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(a)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e},e.geoQuincuncial=vr,e.geoRectangularPolyconic=function(){return J(br).scale(131.215)},e.geoRectangularPolyconicRaw=br,e.geoRobinson=function(){return t.geoProjection(wr).scale(152.63)},e.geoRobinsonRaw=wr,e.geoSatellite=function(){var e=2,r=0,n=t.geoProjectionMutator(kr),i=n(e,r);return i.distance=function(t){return arguments.length?n(e=+t,r):e},i.tilt=function(t){return arguments.length?n(e,r=t*M):r*A},i.scale(432.147).clipAngle(C(1/e)*A-1e-6)},e.geoSatelliteRaw=kr,e.geoSinuMollweide=function(){return t.geoProjection(et).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=et,e.geoSinusoidal=function(){return t.geoProjection(Q).scale(152.63)},e.geoSinusoidalRaw=Q,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return Rr(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(Rr)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return Dr(e)}},e.geoTimes=function(){return t.geoProjection(jr).scale(146.153)},e.geoTimesRaw=jr,e.geoTwoPointAzimuthal=Nr,e.geoTwoPointAzimuthalRaw=Br,e.geoTwoPointAzimuthalUsa=function(){return Nr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=Vr,e.geoTwoPointEquidistantRaw=Ur,e.geoTwoPointEquidistantUsa=function(){return Vr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(qr).scale(79.4183)},e.geoVanDerGrintenRaw=qr,e.geoVanDerGrinten2=function(){return t.geoProjection(Hr).scale(79.4183)},e.geoVanDerGrinten2Raw=Hr,e.geoVanDerGrinten3=function(){return t.geoProjection(Gr).scale(79.4183)},e.geoVanDerGrinten3Raw=Gr,e.geoVanDerGrinten4=function(){return t.geoProjection(Wr).scale(127.16)},e.geoVanDerGrinten4Raw=Wr,e.geoWagner=Zr,e.geoWagner7=function(){return Zr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=$r,e.geoWagner4=function(){return t.geoProjection(Kr).scale(176.84)},e.geoWagner4Raw=Kr,e.geoWagner6=function(){return t.geoProjection(Jr).scale(152.63)},e.geoWagner6Raw=Jr,e.geoWiechel=function(){return t.geoProjection(Qr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=Qr,e.geoWinkel3=function(){return t.geoProjection(en).scale(158.837)},e.geoWinkel3Raw=en,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,dg(),pg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),mg=p({"src/plots/geo/zoom.js"(e,t){var r=v(),n=st(),i=Ve(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(e,t){return r.behavior.zoom().translate(t.translate()).scale(t.scale())}function u(e,t,r){var a=e.id,o=e.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},p={};function d(e,t){h[a+"."+e]=n.nestedProperty(l,e).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,e);r.get()!==t&&(r.set(t),n.nestedProperty(l,e).set(t),p[a+"."+e]=t)}r(d),d("projection.scale",t.scale()/e.fitScale),d("fitbounds",!1),o.emit("plotly_relayout",p)}function h(e,t){var n=c(0,t);function i(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){t.scale(r.event.scale).translate(r.event.translate),e.render(!0);var n=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(e,t,i)})),n}function p(e,t){var n,i,a,o,h,p,d,f,m,g=c(0,t);function y(e){return t.invert(e)}function v(r){var n=t.rotate(),i=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=t.rotate(),a=t.translate(),o=i,h=y(n)})).on("zoom",(function(){if(p=r.mouse(this),function(e){var r=y(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(n))return g.scale(t.scale()),void g.translate(t.translate());t.scale(r.event.scale),t.translate([a[0],r.event.translate[1]]),h?y(p)&&(f=y(p),d=[o[0]+(f[0]-h[0]),i[1],i[2]],t.rotate(d),o=d):h=y(n=p),m=!0,e.render(!0);var s=t.rotate(),l=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(e,t,v)})),g}function d(e,t){var n,i={r:t.rotate(),k:t.scale()},h=c(0,t),p=function(e){for(var t=0,n=arguments.length,i=[];++tf?(a=(h>0?90:-90)-d,i=0):(a=Math.asin(h/f)*o-d,i=Math.sqrt(f*f-h*h));var g=180-a-2*d,v=(Math.atan2(p,u)-Math.atan2(c,i))*o,x=(Math.atan2(p,u)-Math.atan2(c,-i))*o,b=m(r[0],r[1],a,v),_=m(r[0],r[1],g,x);return b<=_?[a,v,r[2]]:[g,x,r[2]]}(h,n,u);isFinite(d[0])&&isFinite(d[1])&&isFinite(d[2])||(d=u),t.rotate(d),u=d}}else n=f(t,l=e);p.of(this,arguments)({type:"zoom"})})),e=p.of(this,arguments),d++||e({type:"zoomstart"})})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=p.of(this,arguments),--d||n({type:"zoomend"}),u(e,t,v)})).on("zoom.redraw",(function(){e.render(!0);var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,p,"on")}function f(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*a,r=e[1]*a,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function m(e,t,r,n){var i=g(r-e),a=g(n-t);return Math.sqrt(i*i+a*a)}function g(e){return(e%360+540)%360-180}function y(e,t,r){var n=r*a,i=e.slice(),o=0===t?1:0,s=2===t?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=e[o]*l-e[s]*c,i[s]=e[s]*l+e[o]*c,i}function x(e,t){for(var r=0,n=0,i=e.length;n0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}t.exports=function(e){return new A(e)},M.plot=function(e,t,r,n){var i=this;if(n)return i.update(e,t,!0);i._geoCalcData=e,i._fullLayout=t;var a=t[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u0&&o._module.calcGeoJSON(a,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),d.generalUpdatePerTraceModule(this.graphDiv,this,e,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},M.updateProjection=function(e,t){var r=this.graphDiv,s=t[this.id],c=t._size,u=s.domain,h=s.projection,p=s.lonaxis,d=s.lataxis,f=p._ax,g=d._ax,y=this.projection=function(e){var t=e.projection,r=t.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],p=function(e){return e?c:[]},d=0;du*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(e){return c.getPath().bounds(e)},c.precision(w.precision),e._isSatellite&&c.tilt(t.tilt).distance(t.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},b=h.rotation||{},_=p.range||[],k=d.range||[];if(s.fitbounds){f._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],f.range=m(r,f),g.range=m(r,g);var T=(f.range[0]+f.range[1])/2,S=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:T,lat:S};else if(s._isClipped){x={lon:T,lat:S},b={lon:T,lat:S,roll:b.roll};var A=h.type,M=w.lonaxisSpan[A]/2||180,C=w.lataxisSpan[A]/2||90;_=[T-M,T+M],k=[S-C,S+C]}else x={lon:T,lat:S},b={lon:T,lat:b.lat,roll:b.roll}}y.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(h.parallels);var P=E(_,k);y.fitExtent(v,P);var L=this.bounds=y.getBounds(P),I=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var O=y.getBounds(E(f.range,g.range)),R=Math.min((L[1][0]-L[0][0])/(O[1][0]-O[0][0]),(L[1][1]-L[0][1])/(O[1][1]-O[0][1]));isFinite(R)?y.scale(R*I):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*I);var D=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(D[0]-z[0]),z[1]+(D[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var j=y([x.lon,x.lat]),F=y.translate();y.translate([F[0]-(j[0]-F[0]),F[1]-(j[1]-F[1])])}},M.updateBaseLayers=function(e,t){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var p=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return l(e)||c(e)?t["show"+e]:!s(e)||t[e].showgrid})),d=n.framework.selectAll(".layer").data(p,String);d.exit().each((function(e){delete a[e],delete o[e],r.select(this).remove()})),d.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=a[e]=r.select(this);"bg"===e?n.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),d.order(),d.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(S(i,i.objects[r])):s(r)&&n.datum(function(e,t,r){var n,i,a,o=1e-6,s=2.5,l=t[e],c=w.scopeDefaults[t.scope];"lonaxis"===e?(n=c.lonaxisRange,i=c.lataxisRange,a=function(e,t){return[e,t]}):"lataxis"===e&&(n=c.lataxisRange,i=c.lonaxisRange,a=function(e,t){return[t,e]});var u={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};f.setConvert(u,r);var h=f.calcTicks(u);t.isScoped||"lonaxis"!==e||h.pop();for(var p=h.length,d=new Array(p),m=0;m-1&&b(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&p.click(i,r.event))}))}function h(e){return n.projection.invert([e[0]+n.xaxis._offset,e[1]+n.yaxis._offset])}},M.makeFramework=function(){var e=this,t=e.graphDiv,n=t._fullLayout,i="clip"+n._uid+e.id;e.clipDef=n._clips.append("clipPath").attr("id",i),e.clipRect=e.clipDef.append("rect"),e.framework=r.select(e.container).append("g").attr("class","geo "+e.id).call(h.setClipUrl,i,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(e.mockAxis,n)},M.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,i=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,t)},M.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},M._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?c(r[0],r[1]):null}function i(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",i).attr("transform",n)}}}),yg=p({"src/plots/geo/layout_attributes.js"(e,t){var r=V(),n=ka().attributes,i=Ie().dash,a=Ym(),o=Le().overrideAll,s=We(),l={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:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(t.exports=o({domain:n({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:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.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:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),vg=p({"src/plots/geo/layout_defaults.js"(e,t){var r=st(),n=qs(),i=_t().getSubplotData,a=Ym(),o=yg(),s=a.axesNames;function l(e,t,n,o){var l=i(o.fullData,"geo",o.id).map((function(e){return e.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],p=n("projection.type",h.projType),d=t._isAlbersUsa="albers usa"===p;d&&(u=t.scope="usa");var f=t._isScoped="world"!==u,m=t._isSatellite="satellite"===p,g=t._isConic=-1!==p.indexOf("conic")||"albers"===p,y=t._isClipped=!!a.lonaxisSpan[p];if(!1===e.visible){var v=r.extendDeep({},t._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),t._template=v}for(var x=n("visible"),b=0;b0&&L<0&&(L+=360);var I,z,O,R=(P+L)/2;if(!d){var D=f?h.projRotate:[R,0,0];I=n("projection.rotation.lon",D[0]),n("projection.rotation.lat",D[1]),n("projection.rotation.roll",D[2]),n("showcoastlines",!f&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}d?(z=-96.6,O=38.7):(z=f?R:I,O=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",O),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",f&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),f||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete t.projection.scale,f?(delete t.center.lon,delete t.center.lat):y?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){n(e,t,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),xg=p({"src/plots/geo/index.js"(e,t){var r=_t().getSubplotCalcData,n=st().counterRegex,i=gg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},t.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:yg(),supplyLayoutDefaults:vg(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,o=t._subplots[a],s=0;s")}}(e,h,o),[e]}}}),Eg=p({"src/traces/choropleth/event_data.js"(e,t){t.exports=function(e,t,r,n,i){e.location=t.location,e.z=t.z;var a=n[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e.ct=a.ct,e}}}),Cg=p({"src/traces/choropleth/select.js"(e,t){t.exports=function(e,t){var r,n,i,a,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[];if(!1===t)for(r=0;r=Math.min(I,z)&&w<=Math.max(I,z)?0:1/0}if(h=Math.min(O,R)&&k<=Math.max(O,R)?0:1/0}f=Math.sqrt(h*h+p*p),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[o=i[u]],c=_[o],h=v.c2p(l)-w,p=x.c2p(c)-k,(d=Math.sqrt(h*h+p*p))100},e.isDotSymbol=function(e){return"string"===typeof e?t.DOT_RE.test(e):e>200}}}),Dg=p({"src/traces/scattergl/defaults.js"(e,t){var r=st(),n=Ve(),i=Rg(),a=Og(),o=bn(),s=$t(),l=qn(),c=Hn(),u=Wn(),h=$n(),p=Yn(),d=Xn();t.exports=function(e,t,f,m){function g(n,i){return r.coerce(e,t,a,n,i)}var y=!!e.marker&&i.isOpenSymbol(e.marker.symbol),v=s.isBubble(e),x=l(e,t,m,g);if(x){c(e,t,m,g),g("xhoverformat"),g("yhoverformat");var b=x>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function o(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}t.exports={ge:function(e,t,n,i,a){return s(e,t,n,i,a,r)},gt:function(e,t,r,i,a){return s(e,t,r,i,a,n)},lt:function(e,t,r,n,a){return s(e,t,r,n,a,i)},le:function(e,t,r,n,i){return s(e,t,r,n,i,a)},eq:function(e,t,r,n,i){return s(e,t,r,n,i,o)}}}}),Bg=p({"node_modules/pick-by-alias/index.js"(e,t){t.exports=function(e,t,r){var i,a,o={};if("string"===typeof t&&(t=n(t)),Array.isArray(t)){var s={};for(a=0;a1&&(e=arguments),"string"===typeof e?e=e.split(/\s/).map(parseFloat):"number"===typeof e&&(e=[e]),e.length&&"number"===typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=r(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}}}),Ug=p({"node_modules/array-bounds/index.js"(e,t){t.exports=function(e,t){if(!e||null==e.length)throw Error("Argument should be an array");t=null==t?1:Math.floor(t);for(var r=Array(2*t),n=0;ni&&(i=e[o]),e[o]>>1;t.dtype||(t.dtype="array"),"string"===typeof t.dtype?f=new(u(t.dtype))(g):t.dtype&&(f=t.dtype,Array.isArray(f)&&(f.length=g));for(let r=0;rn||s>1073741824){for(let e=0;er+i||T>l||S=M)return;if(o===s)return;let c=y[a];void 0===s&&(s=c.length);for(let y=o;y=f&&r<=g&&n>=m&&n<=_&&E.push(t)}let u=v[a],h=u[4*o+0],p=u[4*o+1],d=u[4*o+2],x=u[4*o+3],b=function(e,t){let r=null,n=0;for(;null===r;)if(r=e[4*t+n],n++,n>e.length)return null;return r}(u,o+1),w=.5*i,C=a+1;t(r,n,w,C,h,p||d||x||b),t(r,n+w,w,C,p,d||x||b),t(r+w,n,w,C,d,x||b),t(r+w,n+w,w,C,x,b)}(0,0,1,0,0,1),E},f;function w(e,t,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};e.default=function(e){var t=e.px,s=e.py,l=e.cx,c=e.cy,u=e.rx,h=e.ry,p=e.xAxisRotation,d=void 0===p?0:p,f=e.largeArcFlag,m=void 0===f?0:f,g=e.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===h)return[];var x=Math.sin(d*n/360),b=Math.cos(d*n/360),_=b*(t-l)/2+x*(s-c)/2,w=-x*(t-l)/2+b*(s-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var k=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);k>1&&(u*=Math.sqrt(k),h*=Math.sqrt(k));var T=function(e,t,r,i,a,s,l,c,u,h,p,d){var f=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(p,2),y=Math.pow(d,2),v=f*m-f*y-m*g;v<0&&(v=0),v/=f*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*a/s*d,b=v*-s/a*p,_=h*x-u*b+(e+r)/2,w=u*x+h*b+(t+i)/2,k=(p-x)/a,T=(d-b)/s,S=(-p-x)/a,A=(-d-b)/s,M=o(1,0,k,T),E=o(k,T,S,A);return 0===c&&E>0&&(E-=n),1===c&&E<0&&(E+=n),[_,w,M,E]}(t,s,l,c,u,h,m,y,x,b,_,w),S=r(T,4),A=S[0],M=S[1],E=S[2],C=S[3],P=Math.abs(C)/(n/4);Math.abs(1-P)<1e-7&&(P=1);var L=Math.max(Math.ceil(P),1);C/=L;for(var I=0;I4?(o=g[g.length-4],s=g[g.length-3]):(o=p,s=d),a.push(g)}return a};var r=Xg();function n(e,t,r,n){return["C",e,t,r,n,r,n]}function i(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),Kg=p({"node_modules/is-svg-path/index.js"(e,t){t.exports=function(e){return"string"===typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}}}),Jg=p({"node_modules/svg-path-bounds/index.js"(e,t){var r=Yt(),n=Zg(),i=Yg(),a=Kg(),o=ru();t.exports=function(e){if(Array.isArray(e)&&1===e.length&&"string"===typeof e[0]&&(e=e[0]),"string"===typeof e&&(o(a(e),"String is not an SVG path."),e=r(e)),o(Array.isArray(e),"Argument should be a string or an array of path segments."),e=n(e),!(e=i(e)).length)return[0,0,0,0];for(var t=[1/0,1/0,-1/0,-1/0],s=0,l=e.length;st[2]&&(t[2]=c[u+0]),c[u+1]>t[3]&&(t[3]=c[u+1]);return t}}}),Qg=p({"node_modules/normalize-svg-path/index.js"(e,t){var r=Math.PI,n=l(120);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(e,t,i,a,l,c,u,h,p,d){if(d)k=d[0],T=d[1],_=d[2],w=d[3];else{var f=s(e,t,-l);e=f.x,t=f.y;var m=(e-(h=(f=s(h,p,-l)).x))/2,g=(t-(p=f.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,b=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));b==1/0&&(b=1);var _=b*i*g/a+(e+h)/2,w=b*-a*m/i+(t+p)/2,k=Math.asin(((t-w)/a).toFixed(9)),T=Math.asin(((p-w)/a).toFixed(9));(k=e<_?r-k:k)<0&&(k=2*r+k),(T=h<_?r-T:T)<0&&(T=2*r+T),u&&k>T&&(k-=2*r),!u&&T>k&&(T-=2*r)}if(Math.abs(T-k)>n){var S=T,A=h,M=p;T=k+n*(u&&T>k?1:-1);var E=o(h=_+i*Math.cos(T),p=w+a*Math.sin(T),i,a,l,0,u,A,M,[T,S,_,w])}var C=Math.tan((T-k)/4),P=4/3*i*C,L=4/3*a*C,I=[2*e-(e+P*Math.sin(k)),2*t-(t-L*Math.cos(k)),h+P*Math.sin(T),p-L*Math.cos(T),h,p];if(d)return I;E&&(I=I.concat(E));for(var z=0;z7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=d,b=f;"C"!=t&&"S"!=t||(x+=x-n,b+=b-s),y=["C",x,b,y[1],y[2],y[3],y[4]];break;case"T":"Q"==t||"T"==t?(h=2*d-h,p=2*f-p):(h=d,p=f),y=a(d,f,h,p,y[1],y[2]);break;case"Q":h=y[1],p=y[2],y=a(d,f,y[1],y[2],y[3],y[4]);break;case"L":y=i(d,f,y[1],y[2]);break;case"H":y=i(d,f,y[1],f);break;case"V":y=i(d,f,d,y[1]);break;case"Z":y=i(d,f,c,u)}t=v,d=y[y.length-2],f=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=d,s=f),r.push(y)}return r}}}),ey=p({"node_modules/draw-svg-path/index.js"(e,t){var r=Zg(),n=Qg(),i={M:"moveTo",C:"bezierCurveTo"};t.exports=function(e,t){e.beginPath(),n(r(t)).forEach((function(t){var r=t[0],n=t.slice(1);e[i[r]].apply(e,n)})),e.closePath()}}}),ty=p({"node_modules/bitmap-sdf/index.js"(e,t){var r=jf();t.exports=function(e,t){t||(t={});var a,o,s,l,c,u,h,p,d,f,m,g=null==t.cutoff?.25:t.cutoff,y=null==t.radius?8:t.radius,v=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");a=t.width,o=t.height,l=e,u=t.stride?t.stride:Math.floor(e.length/a/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(h=(p=e).getContext("2d"),a=p.width,o=p.height,l=(d=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(h=e,a=(p=e.canvas).width,o=p.height,l=(d=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&e instanceof window.ImageData&&(d=e,a=e.width,o=e.height,l=d.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),f=0,m=c.length;f0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return r=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var n=e.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(e);c.fill(y),d&&c.stroke(y)}else{var v=i(e);a(c,v),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*p})}}}),ny=p({"src/traces/scattergl/convert.js"(e,t){var r=k(),n=ry(),i=Bf(),a=Ve(),o=st(),s=o.isArrayOrTypedArray,l=Jt(),c=vt(),u=Uf().formatColor,h=$t(),p=Zt(),d=Rg(),f=zg(),m=H().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Xt().appendArrayPointValue;function v(e,t){var n,i=e._fullLayout,a=t._length,l=t.textfont,c=t.textposition,u=s(c)?c:[c],h=l.color,p=l.size,d=l.family,f=l.weight,m=l.style,g=l.variant,v={},b=e._context.plotGlPixelRatio,_=t.texttemplate;if(_){v.text=[];var w=i._d3locale,k=Array.isArray(_),T=k?Math.min(_.length,a):a,S=k?function(e){return _[e]}:function(){return _};for(n=0;n500?"bold":"normal":e}function b(e,t){var r,n,a=t._length,o=t.marker,l={},c=s(o.symbol),h=s(o.angle),f=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=d.isOpenSymbol(o.symbol)),c||f||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,b=o.angle,_=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var k=w;for(w=Array(a),r=0;rf.TOO_MANY_POINTS||h.hasMarkers(t)?"rect":"round";if(c&&t.connectgaps){var p=n[0],d=n[1];for(i=0;i1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[f],v=g[m],x=p?p/.8+1:0,b=-v*x-.5*v;o.offset[i]=[y*x/d,b/d]}}return o}}}}),iy=p({"src/traces/scattergl/scene_update.js"(e,t){var r=st();t.exports=function(e,t){var n=t._scene,i={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 t._scene||((n=t._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(e){var t=r.repeat(e,n.count);if(n.fill2d&&n.fill2d.update(t),n.scatter2d&&n.scatter2d.update(t),n.line2d&&n.line2d.update(t),n.error2d&&n.error2d.update(t.concat(t)),n.select2d&&n.select2d.update(t),n.glText)for(var i=0;i=m,w=2*b,k={},T=y.makeCalcdata(t,"x"),S=v.makeCalcdata(t,"y"),A=o(t,y,"x",T),M=o(t,v,"y",S),E=A.vals,C=M.vals;t._x=E,t._y=C,t.xperiodalignment&&(t._origX=T,t._xStarts=A.starts,t._xEnds=A.ends),t.yperiodalignment&&(t._origY=S,t._yStarts=M.starts,t._yEnds=M.ends);var P=new Array(w),L=new Array(b);for(a=0;a1&&n.extendFlat(s.line,p.linePositions(e,r,i)),s.errorX||s.errorY){var l=p.errorBarPositions(e,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},p.textPosition(e,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},p.textPosition(e,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},p.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,P,E,C),O=d(e,x);return u(s,t),_?z.marker&&(I=z.marker.sizeAvg||Math.max(z.marker.size,3)):I=l(t,b),c(e,t,y,v,E,C,I),z.errorX&&g(t,y,z.errorX),z.errorY&&g(t,v,z.errorY),z.fill&&!O.fill2d&&(O.fill2d=!0),z.marker&&!O.scatter2d&&(O.scatter2d=!0),z.line&&!O.line2d&&(O.line2d=!0),!z.errorX&&!z.errorY||O.error2d||(O.error2d=!0),z.text&&!O.glText&&(O.glText=!0),z.marker&&(z.marker.snap=b),O.lineOptions.push(z.line),O.errorXOptions.push(z.errorX),O.errorYOptions.push(z.errorY),O.fillOptions.push(z.fill),O.markerOptions.push(z.marker),O.markerSelectedOptions.push(z.markerSel),O.markerUnselectedOptions.push(z.markerUnsel),O.textOptions.push(z.text),O.textSelectedOptions.push(z.textSel),O.textUnselectedOptions.push(z.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=E,k.y=C,k.positions=P,O.count++,[{x:!1,y:!1,t:k,trace:t}]}}}),oy=p({"src/traces/scattergl/edit_style.js"(e,t){var r=st(),n=q(),i=H().DESELECTDIM;t.exports={styleTextSelection:function(e){var t,a,o=e[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],p=c.unselectBatch[u],d=c.textOptions[u],f=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},d);if(h.length||p.length){var y=f.color,v=m.color,x=d.color,b=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),t=0;t>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),uy=p({"node_modules/object-assign/index.js"(e,t){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var a,o,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(c)}x.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},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;nn)?t.tree=c(e,{bounds:h}):n&&n.length&&(t.tree=n),t.tree){var p={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(p):t.elements=o.elements(p)}var d=g.float32(e);return i({data:d,usage:"dynamic"}),a({data:g.fract32(e,d),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!==typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i80*r){i=s=e[0],o=l=e[1];for(var x=r;xs&&(s=c),p>l&&(l=p);d=0!==(d=Math.max(s-i,l-o))?32767/d:0}return a(y,v,r,i,o,d,0),v}function n(e,t,r,n,i){var a,o;if(i===M(e,t,r,n)>0)for(a=t;a=t;a-=n)o=T(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(S(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function a(e,t,r,n,u,h,p){if(e){!p&&h&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=d(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,u,h);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,h?s(e,n,u,h):o(e))t.push(f.i/r|0),t.push(e.i/r|0),t.push(m.i/r|0),S(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?a(e=l(i(e),t,r),t,r,n,u,h,2):2===p&&c(e,t,r,n,u,h):a(i(e),t,r,n,u,h,1);break}}}function o(e){var t=e.prev,r=e,n=e.next;if(y(t,r,n)>=0)return!1;for(var i=t.x,a=r.x,o=n.x,s=t.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,d=s>l?s>c?s:c:l>c?l:c,f=n.next;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&m(i,s,a,l,o,c,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function s(e,t,r,n){var i=e.prev,a=e,o=e.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,p=o.y,f=sl?s>c?s:c:l>c?l:c,x=u>h?u>p?u:p:h>p?h:p,b=d(f,g,t,r,n),_=d(v,x,t,r,n),w=e.prevZ,k=e.nextZ;w&&w.z>=b&&k&&k.z<=_;){if(w.x>=f&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,p,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,k.x>=f&&k.x<=v&&k.y>=g&&k.y<=x&&k!==i&&k!==o&&m(s,u,l,h,c,p,k.x,k.y)&&y(k.prev,k,k.next)>=0)return!1;k=k.nextZ}for(;w&&w.z>=b;){if(w.x>=f&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,p,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;k&&k.z<=_;){if(k.x>=f&&k.x<=v&&k.y>=g&&k.y<=x&&k!==i&&k!==o&&m(s,u,l,h,c,p,k.x,k.y)&&y(k.prev,k,k.next)>=0)return!1;k=k.nextZ}return!0}function l(e,t,r){var n=e;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(t.push(a.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),S(n),S(n.next),n=e=o),n=n.next}while(n!==e);return i(n)}function c(e,t,r,n,o,s){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=k(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,t,r,n,o,s,0),void a(u,t,r,n,o,s,0)}c=c.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function h(e,t){var r=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x=n.x&&n.x>=u&&i!==n.x&&m(ar.x||n.x===r.x&&p(r,n)))&&(r=n,d=l)),n=n.next}while(n!==c);return r}(e,t);if(!r)return t;var n=k(r,e);return i(n,n.next),i(r,r.next)}function p(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function d(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function f(e){var t=e,r=e;do{(t.x=(e-o)*(a-s)&&(e-o)*(n-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&x(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||v(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,r,n){var i=_(y(e,t,r)),a=_(y(e,t,n)),o=_(y(r,n,e)),s=_(y(r,n,t));return i!==a&&o!==s||!(0!==i||!b(e,r,t))||!(0!==a||!b(e,n,t))||!(0!==o||!b(r,e,n))||!(0!==s||!b(r,t,n))}function b(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function _(e){return e>0?1:e<0?-1:0}function w(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function k(e,t){var r=new A(e.i,e.x,e.y),n=new A(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function T(e,t,r,n){var i=new A(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function S(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,r,n){for(var i=0,a=t,o=r-n;a0&&(n+=e[i-1].length,r.holes.push(n))}return r}}}),yy=p({"node_modules/array-normalize/index.js"(e,t){var r=Ug();t.exports=function(e,t,n){if(!e||null==e.length)throw Error("Argument should be an array");null==t&&(t=1),null==n&&(n=r(e,t));for(var i=0;i-1}}}),qy=p({"node_modules/es5-ext/string/#/contains/index.js"(e,t){t.exports=Uy()()?String.prototype.contains:Vy()}}),Hy=p({"node_modules/d/index.js"(e,t){var r=Cy(),n=zy(),i=By(),a=Ny(),o=qy(),s=t.exports=function(e,t){var n,s,l,c,u;return arguments.length<2||"string"!==typeof e?(c=t,t=e,e=null):c=arguments[2],r(e)?(n=o.call(e,"c"),s=o.call(e,"e"),l=o.call(e,"w")):(n=l=!0,s=!1),u={value:t,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(e,t,s){var l,c,u,h;return"string"!==typeof e?(u=s,s=t,t=e,e=null):u=arguments[3],r(t)?n(t)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=t,t=s=void 0):t=void 0,r(e)?(l=o.call(e,"c"),c=o.call(e,"e")):(l=!0,c=!1),h={get:t,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),Gy=p({"node_modules/es5-ext/function/is-arguments.js"(e,t){var r=Object.prototype.toString,n=r.call(function(){return arguments}());t.exports=function(e){return r.call(e)===n}}}),Wy=p({"node_modules/es5-ext/string/is-string.js"(e,t){var r=Object.prototype.toString,n=r.call("");t.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||r.call(e)===n)||!1}}}),$y=p({"node_modules/ext/global-this/is-implemented.js"(e,t){t.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),Zy=p({"node_modules/ext/global-this/implementation.js"(e,t){var r=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),Xy=p({"node_modules/ext/global-this/index.js"(e,t){t.exports=$y()()?globalThis:Zy()}}),Yy=p({"node_modules/es6-symbol/is-implemented.js"(e,t){var r=Xy(),n={object:!0,symbol:!0};t.exports=function(){var e,t=r.Symbol;if("function"!==typeof t)return!1;e=t("test symbol");try{String(e)}catch(i){return!1}return!!n[typeof t.iterator]&&!!n[typeof t.toPrimitive]&&!!n[typeof t.toStringTag]}}}),Ky=p({"node_modules/es6-symbol/is-symbol.js"(e,t){t.exports=function(e){return!!e&&("symbol"===typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}}}),Jy=p({"node_modules/es6-symbol/validate-symbol.js"(e,t){var r=Ky();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}}}),Qy=p({"node_modules/es6-symbol/lib/private/generate-name.js"(e,t){var r=Hy(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);t.exports=function(e){for(var t,n,s=0;o[e+(s||"")];)++s;return o[e+=s||""]=!0,i(a,t="@@"+e,r.gs(null,(function(e){n||(n=!0,i(this,t,r(e)),n=!1)}))),t}}}),ev=p({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(e,t){var r=Hy(),n=Xy().Symbol;t.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",n&&n.hasInstance||e("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",n&&n.iterator||e("iterator")),match:r("",n&&n.match||e("match")),replace:r("",n&&n.replace||e("replace")),search:r("",n&&n.search||e("search")),species:r("",n&&n.species||e("species")),split:r("",n&&n.split||e("split")),toPrimitive:r("",n&&n.toPrimitive||e("toPrimitive")),toStringTag:r("",n&&n.toStringTag||e("toStringTag")),unscopables:r("",n&&n.unscopables||e("unscopables"))})}}}),tv=p({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(e,t){var r=Hy(),n=Jy(),i=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return i[t]?i[t]:i[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in n(e),i)if(i[t]===e)return t}))})}}}),rv=p({"node_modules/es6-symbol/polyfill.js"(e,t){var r,n,i,a=Hy(),o=Jy(),s=Xy().Symbol,l=Qy(),c=ev(),u=tv(),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"===typeof s)try{String(s()),i=!0}catch(f){}else s=null;n=function(e){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(e)},t.exports=r=function e(t){var r;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?s(t):(r=h(n.prototype),t=void 0===t?"":String(t),p(r,{__description__:a("",t),__name__:a("",l(t))}))},c(r),u(r),p(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),p(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),d(r.prototype,r.toPrimitive,a("",(function(){var e=o(this);return"symbol"===typeof e?e:e.toString()}))),d(r.prototype,r.toStringTag,a("c","Symbol")),d(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),d(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),nv=p({"node_modules/es6-symbol/index.js"(e,t){t.exports=Yy()()?Xy().Symbol:rv()}}),iv=p({"node_modules/es5-ext/array/#/clear.js"(e,t){var r=ky();t.exports=function(){return r(this).length=0,this}}}),av=p({"node_modules/es5-ext/object/valid-callable.js"(e,t){t.exports=function(e){if("function"!==typeof e)throw new TypeError(e+" is not a function");return e}}}),ov=p({"node_modules/type/string/coerce.js"(e,t){var r=Cy(),n=Py(),i=Object.prototype.toString;t.exports=function(e){if(!r(e))return null;if(n(e)){var t=e.toString;if("function"!==typeof t)return null;if(t===i)return null}try{return""+e}catch(a){return null}}}}),sv=p({"node_modules/type/lib/safe-to-string.js"(e,t){t.exports=function(e){try{return e.toString()}catch(t){try{return String(e)}catch(r){return null}}}}}),lv=p({"node_modules/type/lib/to-short-string.js"(e,t){var r=sv(),n=/[\n\r\u2028\u2029]/g;t.exports=function(e){var t=r(e);return null===t?"":(t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(n,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),cv=p({"node_modules/type/lib/resolve-exception.js"(e,t){var r=Cy(),n=Py(),i=ov(),a=lv(),o=function(e,t){return e.replace("%v",a(t))};t.exports=function(e,t,a){if(!n(a))throw new TypeError(o(t,e));if(!r(e)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=t),new TypeError(o(s,e))}}}),uv=p({"node_modules/type/value/ensure.js"(e,t){var r=cv(),n=Cy();t.exports=function(e){return n(e)?e:r(e,"Cannot use %v",arguments[1])}}}),hv=p({"node_modules/type/plain-function/ensure.js"(e,t){var r=cv(),n=zy();t.exports=function(e){return n(e)?e:r(e,"%v is not a plain function",arguments[1])}}}),pv=p({"node_modules/es5-ext/array/from/is-implemented.js"(e,t){t.exports=function(){var e,t,r=Array.from;return"function"===typeof r&&(t=r(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}}}),dv=p({"node_modules/es5-ext/function/is-function.js"(e,t){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(e){return"function"===typeof e&&n(r.call(e))}}}),fv=p({"node_modules/es5-ext/math/sign/is-implemented.js"(e,t){t.exports=function(){var e=Math.sign;return"function"===typeof e&&1===e(10)&&-1===e(-20)}}}),mv=p({"node_modules/es5-ext/math/sign/shim.js"(e,t){t.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}}}),gv=p({"node_modules/es5-ext/math/sign/index.js"(e,t){t.exports=fv()()?Math.sign:mv()}}),yv=p({"node_modules/es5-ext/number/to-integer.js"(e,t){var r=gv(),n=Math.abs,i=Math.floor;t.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(n(e)):e}}}),vv=p({"node_modules/es5-ext/number/to-pos-integer.js"(e,t){var r=yv(),n=Math.max;t.exports=function(e){return n(0,r(e))}}}),xv=p({"node_modules/es5-ext/array/from/shim.js"(e,t){var r=nv().iterator,n=Gy(),i=dv(),a=vv(),o=av(),s=ky(),l=by(),c=Wy(),u=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;t.exports=function(e){var t,f,m,g,y,v,x,b,_,w,k=arguments[1],T=arguments[2];if(e=Object(s(e)),l(k)&&o(k),this&&this!==Array&&i(this))t=this;else{if(!k){if(n(e))return 1!==(y=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(u(e)){for(g=new Array(y=e.length),f=0;f=55296&&v<=56319&&(w+=e[++f]),w=k?h.call(k,T,w,m):w,t?(p.value=w,d(g,m,p)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(e.length),t&&(g=new t(y)),f=0;f=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):u(this,"__redo__",s("c",[e])))})),_onDelete:s((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Mv=p({"node_modules/es6-iterator/array.js"(e,t){var r,n=Ay(),i=qy(),a=Hy(),o=nv(),s=Av(),l=Object.defineProperty;r=t.exports=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,e),t=t?i.call(t,"key+value")?"key+value":i.call(t,"key")?"key":"value":"value",l(this,"__kind__",a("",t))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Ev=p({"node_modules/es6-iterator/string.js"(e,t){var r,n=Ay(),i=Hy(),a=nv(),o=Av(),s=Object.defineProperty;r=t.exports=function(e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e=String(e),o.call(this,e),s(this,"__length__",i("",e.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),Cv=p({"node_modules/es6-iterator/is-iterable.js"(e,t){var r=Gy(),n=by(),i=Wy(),a=nv().iterator,o=Array.isArray;t.exports=function(e){return!!n(e)&&(!!o(e)||!!i(e)||!!r(e)||"function"===typeof e[a])}}}),Pv=p({"node_modules/es6-iterator/valid-iterable.js"(e,t){var r=Cv();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not iterable");return e}}}),Lv=p({"node_modules/es6-iterator/get.js"(e,t){var r=Gy(),n=Wy(),i=Mv(),a=Ev(),o=Pv(),s=nv().iterator;t.exports=function(e){return"function"===typeof o(e)[s]?e[s]():r(e)?new i(e):n(e)?new a(e):new i(e)}}}),Iv=p({"node_modules/es6-iterator/for-of.js"(e,t){var r=Gy(),n=av(),i=Wy(),a=Lv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;t.exports=function(e,t){var c,u,h,p,d,f,m,g,y=arguments[2];if(o(e)||r(e)?c="array":i(e)?c="string":e=a(e),n(t),h=function(){p=!0},"array"!==c)if("string"!==c)for(u=e.next();!u.done;){if(s.call(t,y,u.value,h),p)return;u=e.next()}else for(f=e.length,d=0;d=55296&&g<=56319&&(m+=e[++d]),s.call(t,y,m,h),!p);++d);else l.call(e,(function(e){return s.call(t,y,e,h),p}))}}}),zv=p({"node_modules/es6-weak-map/is-native-implemented.js"(e,t){t.exports="function"===typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),Ov=p({"node_modules/es6-weak-map/polyfill.js"(e,t){var r,n=by(),i=Ay(),a=My(),o=ky(),s=Ey(),l=Hy(),c=Lv(),u=Iv(),h=nv().toStringTag,p=zv(),d=Array.isArray,f=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;t.exports=r=function(){var e,t=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return e=p&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(t)&&(d(t)||(t=c(t))),f(e,"__weakMapData__",l("c","$weakMap$"+s())),t?(u(t,(function(t){o(t),e.set(t[0],t[1])})),e):e},p&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(e){return!!m.call(a(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:l((function(e){if(m.call(a(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:l((function(e){return m.call(a(e),this.__weakMapData__)})),set:l((function(e,t){return f(a(e),this.__weakMapData__,l("c",t)),this})),toString:l((function(){return"[object WeakMap]"}))}),f(r.prototype,h,l("c","WeakMap"))}}),Rv=p({"node_modules/es6-weak-map/index.js"(e,t){t.exports=vy()()?WeakMap:Ov()}}),Dv=p({"node_modules/array-find-index/index.js"(e,t){t.exports=function(e,t,r){if("function"===typeof Array.prototype.findIndex)return e.findIndex(t,r);if("function"!==typeof t)throw new TypeError("predicate must be a function");var n=Object(e),i=n.length;if(0===i)return-1;for(var a=0;a"round"===t.join?2:1,miterLimit:e.prop("miterLimit"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),thickness:e.prop("thickness"),dashTexture:e.prop("dashTexture"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),dashLength:e.prop("dashLength"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight],depth:e.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:(e,t)=>!t.overlay},stencil:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport")},a=e(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{t=e(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(o){t=a}return{fill:e({primitive:"triangle",elements:(e,t)=>t.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:t}},f.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},f.prototype.render=function(){arguments.length&&this.update(...arguments),this.draw()},f.prototype.draw=function(){for(var e=arguments.length,t=new Array(e),r=0;r{if(e&&Array.isArray(e))return this.draw(...e);"number"===typeof e&&(e=this.passes[e]),e&&e.count>1&&e.opacity&&(this.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&this.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>f.precisionThreshold||e.scale[1]*e.viewport.height>f.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=f.maxPoints)?this.shaders.rect(e):this.shaders.miter(e)))})),this},f.prototype.update=function(e){if(!e)return;null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let{regl:t,gl:h}=this;if(e.forEach(((e,m)=>{let g=this.passes[m];if(void 0!==e)if(null!==e){if("number"===typeof e[0]&&(e={positions:e}),e=a(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"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:t.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:t.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:t.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=i({},f.defaults,e)),null!=e.thickness&&(g.thickness=parseFloat(e.thickness)),null!=e.opacity&&(g.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(g.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(g.overlay=!!e.overlay,me-t)),t=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let t=d(e,(e=>e>=a));e=e.slice(0,t),e.push(a)}for(let n=0;nt-a+(e[n]-i))),c=s(o,l);c=c.map((t=>t+i+(t+i{e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy()})),this.passes.length=0,this}}}),Fv=p({"node_modules/regl-error2d/index.js"(e,t){var r=Ug(),n=Bf(),i=py(),a=Bg(),o=uy(),s=qg(),{float32:l,fract32:c}=fy();t.exports=function(e,t){if("function"===typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,p,d,f,m,g,y=e._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return f=e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=e.buffer({usage:"static",type:"float",data:u}),k(t),h=e({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:e.prop("range"),lineWidth:e.prop("lineWidth"),capSize:e.prop("capSize"),opacity:e.prop("opacity"),scale:e.prop("scale"),translate:e.prop("translate"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{color:{buffer:f,offset:(e,t)=>4*t.offset,divisor:1},position:{buffer:p,offset:(e,t)=>8*t.offset,divisor:1},positionFract:{buffer:d,offset:(e,t)=>8*t.offset,divisor:1},error:{buffer:m,offset:(e,t)=>16*t.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,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:e.prop("viewport")},viewport:e.prop("viewport"),stencil:!1,instances:e.prop("count"),count:u.length}),o(b,{update:k,draw:_,destroy:T,regl:e,gl:y,canvas:y.canvas,groups:x}),b;function b(e){e?k(e):null===e&&T(),_()}function _(t){if("number"===typeof t)return w(t);t&&!Array.isArray(t)&&(t=[t]),e._refresh(),x.forEach(((e,r)=>{e&&(t&&(t[r]?e.draw=!0:e.draw=!1),e.draw?w(r):e.draw=!0)}))}function w(e){"number"===typeof e&&(e=x[e]),null!=e&&e&&e.count&&e.color&&e.opacity&&e.positions&&e.positions.length>1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],h(e),e.after&&e.after(e))}function k(e){if(!e)return;null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let t=0,u=0;if(b.groups=x=e.map(((e,l)=>{let h=x[l];return e?("function"===typeof e?e={after:e}:"number"===typeof e[0]&&(e={positions:e}),e=a(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=o({},v,e)),i(h,e,[{lineWidth:e=>.5*+e,capSize:e=>.5*+e,opacity:parseFloat,errors:e=>(e=s(e),u+=e.length,e),positions:(e,n)=>(e=s(e,"float64"),n.count=Math.floor(e.length/2),n.bounds=r(e,2),n.offset=t,t+=n.count,e)},{color:(e,t)=>{let r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"===typeof e[0]){let t=e;e=Array(r);for(let n=0;n{let n=t.bounds;return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=c(t.scale),t.translateFract=c(t.translate),e},viewport:e=>{let t;return Array.isArray(e)?t={x:e[0],y:e[1],width:e[2]-e[0],height:e[3]-e[1]}:e?(t={x:e.x||e.left||0,y:e.y||e.top||0},e.right?t.width=e.right-t.x:t.width=e.w||e.width||0,e.bottom?t.height=e.bottom-t.y:t.height=e.h||e.height||0):t={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},t}}]),h):h})),t||u){let e=x.reduce(((e,t,r)=>e+(t?t.count:0)),0),t=new Float64Array(2*e),r=new Uint8Array(4*e),n=new Float32Array(4*e);x.forEach(((e,i)=>{if(!e)return;let{positions:a,count:o,offset:s,color:l,errors:c}=e;o&&(r.set(l,4*s),n.set(c,4*s),t.set(a,2*s))}));var h=l(t);p(h);var g=c(t,h);d(g),f(r),m(n)}}function T(){p.destroy(),d.destroy(),f.destroy(),m.destroy(),g.destroy()}};var u=[[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]]}}),Bv=p({"node_modules/unquote/index.js"(e,t){var r=/[\'\"]/;t.exports=function(e){return e?(r.test(e.charAt(0))&&(e=e.substr(1)),r.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}}}),Nv=p({"node_modules/css-global-keywords/index.json"(){}}),Uv=p({"node_modules/css-system-font-keywords/index.json"(){}}),Vv=p({"node_modules/css-font-weight-keywords/index.json"(){}}),qv=p({"node_modules/css-font-style-keywords/index.json"(){}}),Hv=p({"node_modules/css-font-stretch-keywords/index.json"(){}}),Gv=p({"node_modules/parenthesis/index.js"(e,t){function r(e,t){if("string"!==typeof e)return[e];var r=[e];"string"===typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function n(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function i(e,t){return Array.isArray(e)?n(e,t):r(e,t)}i.parse=r,i.stringify=n,t.exports=i}}),Wv=p({"node_modules/string-split-by/index.js"(e,t){var r=Gv();t.exports=function(e,t,n){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");n?("string"===typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=r.parse(e,{flat:!0,brackets:n.ignore}),a=i[0].split(t);if(n.escape){for(var o=[],s=0;s1&&t===r&&('"'===t||"'"===t))return['"'+n(e.substr(1,e.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(a)return i(e.substr(0,a.index)).concat(i(a[1])).concat(i(e.substr(a.index+a[0].length)));var o=e.split(".");if(1===o.length)return['"'+n(e)+'"'];for(var s=[],l=0;l65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1}function f(){var e=p(8,(function(){return[]}));function t(t){var r=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),n=e[d(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(t){e[d(t.byteLength)>>2].push(t)}return{alloc:t,free:r,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){r(e.buffer)}}}var m=f();m.zero=f();var g=3553,y=6408,v=5126,x=36160,b=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray};function _(e){return!!e&&"object"===typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"===typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||b(e.data))}var w=function(e){return Object.keys(e).map((function(t){return e[t]}))},k={shape:function(e){for(var t=[],r=e;r.length;r=r[0])t.push(r.length);return t},flatten:function(e,t,r,n){var i=1;if(t.length)for(var a=0;a>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)t[r]=i;else if(a<-14){var s=-14-a;t[r]=i+(o+1024>>s)}else t[r]=a>15?i+31744:i+(a+15<<10)+o}return t}function G(e){return Array.isArray(e)||b(e)}var W=3553,$=34067,Z=34069,X=6408,Y=6406,K=6407,J=6409,Q=6410,ee=32855,te=6402,re=34041,ne=35904,ie=35906,ae=36193,oe=33776,se=33777,le=33778,ce=33779,ue=5121,he=5123,pe=5125,de=5126,fe=33071,me=9728,ge=9984,ye=9987,ve=4352,xe=33984,be=[ge,9986,9985,ye],_e=[0,J,Q,K,X],we={};function ke(e){return"[object "+e+"]"}we[6409]=we[6406]=we[6402]=1,we[34041]=we[6410]=2,we[6407]=we[35904]=3,we[6408]=we[35906]=4;var Te=ke("HTMLCanvasElement"),Se=ke("OffscreenCanvas"),Ae=ke("CanvasRenderingContext2D"),Me=ke("ImageBitmap"),Ee=ke("HTMLImageElement"),Ce=ke("HTMLVideoElement"),Pe=Object.keys(A).concat([Te,Se,Ae,Me,Ee,Ce]),Le=[];Le[5121]=1,Le[5126]=4,Le[36193]=2,Le[5123]=2,Le[5125]=4;var Ie=[];function ze(e){return Array.isArray(e)&&(0===e.length||"number"===typeof e[0])}function Oe(e){return!!Array.isArray(e)&&!(0===e.length||!G(e[0]))}function Re(e){return Object.prototype.toString.call(e)}function De(e){return Re(e)===Te}function je(e){return Re(e)===Se}function Fe(e){if(!e)return!1;var t=Re(e);return Pe.indexOf(t)>=0||ze(e)||Oe(e)||_(e)}function Be(e){return 0|A[Object.prototype.toString.call(e)]}function Ne(e,t){return m.allocType(e.type===ae?de:e.type,t)}function Ue(e,t){e.type===ae?(e.data=H(t),m.freeType(t)):e.data=t}function Ve(e,t,r,n,i,a){var o;if(o="undefined"!==typeof Ie[e]?Ie[e]:we[e]*Le[t],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function qe(t,r,n,i,a,o,s){var l={"don't care":ve,"dont care":ve,nice:4354,fast:4353},c={repeat:10497,clamp:fe,mirror:33648},u={nearest:me,linear:9729},h=e({mipmap:ye,"nearest mipmap nearest":ge,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":ye},u),p={none:0,browser:37444},d={uint8:ue,rgba4:32819,rgb565:33635,"rgb5 a1":32820},f={alpha:Y,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":ee,rgb565:36194},g={};r.ext_srgb&&(f.srgb=ne,f.srgba=ie),r.oes_texture_float&&(d.float32=d.float=de),r.oes_texture_half_float&&(d.float16=d["half float"]=ae),r.webgl_depth_texture&&(e(f,{depth:te,"depth stencil":re}),e(d,{uint16:he,uint32:pe,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":oe,"rgba s3tc dxt1":se,"rgba s3tc dxt3":le,"rgba s3tc dxt5":ce}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(t.getParameter(34467));Object.keys(g).forEach((function(e){var t=g[e];y.indexOf(t)>=0&&(f[e]=t)}));var v=Object.keys(f);n.textureFormats=v;var x=[];Object.keys(f).forEach((function(e){var t=f[e];x[t]=e}));var T=[];Object.keys(d).forEach((function(e){var t=d[e];T[t]=e}));var S=[];Object.keys(u).forEach((function(e){S[u[e]]=e}));var A=[];Object.keys(h).forEach((function(e){var t=h[e];A[t]=e}));var M=[];Object.keys(c).forEach((function(e){M[c[e]]=e}));var E=v.reduce((function(e,t){var n=f[t];return n===J||n===Y||n===J||n===Q||n===te||n===re||r.ext_srgb&&(n===ne||n===ie)?e[n]=n:n===ee||t.indexOf("rgba")>=0?e[n]=X:e[n]=K,e}),{});function C(){this.internalformat=X,this.format=X,this.type=ue,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function P(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function L(e,t){if("object"===typeof t&&t){if("premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=p[t.colorSpace]),"type"in t){var r=t.type;e.type=d[r]}var n=e.width,i=e.height,a=e.channels,o=!1;"shape"in t?(n=t.shape[0],i=t.shape[1],3===t.shape.length&&(a=t.shape[2],o=!0)):("radius"in t&&(n=i=t.radius),"width"in t&&(n=t.width),"height"in t&&(i=t.height),"channels"in t&&(a=t.channels,o=!0)),e.width=0|n,e.height=0|i,e.channels=0|a;var s=!1;if("format"in t){var l=t.format,c=e.internalformat=f[l];e.format=E[c],l in d&&("type"in t||(e.type=d[l])),l in g&&(e.compressed=!0),s=!0}!o&&s?e.channels=we[e.format]:o&&!s&&e.channels!==_e[e.format]&&(e.format=e.internalformat=_e[e.channels])}}function I(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function z(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(e,t){var r=null;if(Fe(t)?r=t:t&&(L(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),Fe(t.data)&&(r=t.data)),t.copy){var n=a.viewportWidth,i=a.viewportHeight;e.width=e.width||n-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(r){if(b(r))e.channels=e.channels||4,e.data=r,"type"in t||e.type!==ue||(e.type=Be(r));else if(ze(r))e.channels=e.channels||4,function(e,t){var r=t.length;switch(e.type){case ue:case he:case pe:case de:var n=m.allocType(e.type,r);n.set(t),e.data=n;break;case ae:e.data=H(t)}}(e,r),e.alignment=1,e.needsFree=!0;else if(_(r)){var o=r.data;Array.isArray(o)||e.type!==ue||(e.type=Be(o));var s,l,c,u,h,p,d=r.shape,f=r.stride;3===d.length?(c=d[2],p=f[2]):(c=1,p=1),s=d[0],l=d[1],u=f[0],h=f[1],e.alignment=1,e.width=s,e.height=l,e.channels=c,e.format=e.internalformat=_e[c],e.needsFree=!0,function(e,t,r,n,i,a){for(var o=e.width,s=e.height,l=e.channels,c=Ne(e,o*s*l),u=0,h=0;h>=i,r.height>>=i,O(r,n[i]),e.mipmask|=1<=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var n=t.mag;e.magFilter=u[n]}var i=e.wrapS,a=e.wrapT;if("wrap"in t){var o=t.wrap;"string"===typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in t){var s=t.wrapS;i=c[s]}if("wrapT"in t){var p=t.wrapT;a=c[p]}}if(e.wrapS=i,e.wrapT=a,"anisotropic"in t&&(t.anisotropic,e.anisotropic=t.anisotropic),"mipmap"in t){var d=!1;switch(typeof t.mipmap){case"string":e.mipmapHint=l[t.mipmap],e.genMipmaps=!0,d=!0;break;case"boolean":d=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,d=!0}d&&!("min"in t)&&(e.minFilter=ge)}}function Ie(e,n){t.texParameteri(n,10241,e.minFilter),t.texParameteri(n,10240,e.magFilter),t.texParameteri(n,10242,e.wrapS),t.texParameteri(n,10243,e.wrapT),r.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,e.anisotropic),e.genMipmaps&&(t.hint(33170,e.mipmapHint),t.generateMipmap(n))}var qe=0,He={},Ge=n.maxTextureUnits,We=Array(Ge).map((function(){return null}));function $e(e){C.call(this),this.mipmask=0,this.internalformat=X,this.id=qe++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Pe,s.profile&&(this.stats={size:0})}function Ze(e){t.activeTexture(xe),t.bindTexture(e.target,e.texture)}function Xe(){var e=We[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(W,null)}function Ye(e){var r=e.texture,n=e.unit,i=e.target;n>=0&&(t.activeTexture(xe+n),t.bindTexture(i,null),We[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete He[e.id],o.textureCount--}return e($e.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}We[n]=e,r=n;break}s.profile&&o.maxTextureUnits>l)-o,c.height=c.height||(n.height>>l)-s,Ze(n),D(c,W,o,s,l),Xe(),B(c),i},i.resize=function(e,r){var a=0|e,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Ze(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;t.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xe(),s.profile&&(n.stats.size=Ve(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(e,r,n,i,a,l){var c=new $e($);He[c.id]=c,o.cubeCount++;var u=new Array(6);function h(e,t,r,n,i,a){var o,l=c.texInfo;for(Pe.call(l),o=0;o<6;++o)u[o]=Te();if("number"!==typeof e&&e){if("object"===typeof e)if(t)V(u[0],e),V(u[1],t),V(u[2],r),V(u[3],n),V(u[4],i),V(u[5],a);else if(Le(l,e),L(c,e),"faces"in e){var p=e.faces;for(o=0;o<6;++o)P(u[o],c),V(u[o],p[o])}else for(o=0;o<6;++o)V(u[o],e)}else{var d=0|e||1;for(o=0;o<6;++o)U(u[o],d,d)}for(P(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Ze(c),o=0;o<6;++o)q(u[o],Z+o);for(Ie(l,$),Xe(),s.profile&&(c.stats.size=Ve(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[c.internalformat],h.type=T[c.type],h.mag=S[l.magFilter],h.min=A[l.minFilter],h.wrapS=M[l.wrapS],h.wrapT=M[l.wrapT],o=0;o<6;++o)Se(u[o]);return h}return h(e,r,n,i,a,l),h.subimage=function(e,t,r,n,i){var a=0|r,o=0|n,s=0|i,l=F();return P(l,c),l.width=0,l.height=0,O(l,t),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Ze(c),D(l,Z+e,a,o,s),Xe(),B(l),h},h.resize=function(e){var r=0|e;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Ze(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)t.texImage2D(Z+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xe(),s.profile&&(c.stats.size=Ve(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(Z+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);Ie(e.texInfo,e.target)}))},refresh:function(){for(var e=0;e>>4&15)+r.charAt(15&t);return n}(function(e){return at(ft(it(e),8*e.length))}(function(e){for(var t,r,n="",i=-1;++i>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}(e)))}function it(e){for(var t=Array(e.length>>2),r=0;r>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}function at(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function ot(e,t){return e>>>t|e<<32-t}function st(e,t){return e>>>t}function lt(e,t,r){return e&t^~e&r}function ct(e,t,r){return e&t^e&r^t&r}function ut(e){return ot(e,2)^ot(e,13)^ot(e,22)}function ht(e){return ot(e,6)^ot(e,11)^ot(e,25)}function pt(e){return ot(e,7)^ot(e,18)^st(e,3)}var dt=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 ft(e,t){var r,n,i,a,o,s,l,c,u,h,p,d,f,m=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),g=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,u=0;u>16)+(t>>16)+(r>>16)<<16|65535&r}function gt(e){return Array.prototype.slice.call(e)}function yt(e){return gt(e).join("")}var vt="xyzw".split(""),xt="dither",bt="blend.enable",_t="blend.color",wt="blend.equation",kt="blend.func",Tt="depth.enable",St="depth.func",At="depth.range",Mt="depth.mask",Et="colorMask",Ct="cull.enable",Pt="cull.face",Lt="frontFace",It="lineWidth",zt="polygonOffset.enable",Ot="polygonOffset.offset",Rt="sample.alpha",Dt="sample.enable",jt="sample.coverage",Ft="stencil.enable",Bt="stencil.mask",Nt="stencil.func",Ut="stencil.opFront",Vt="stencil.opBack",qt="scissor.enable",Ht="scissor.box",Gt="viewport",Wt="profile",$t="framebuffer",Zt="vert",Xt="frag",Yt="elements",Kt="primitive",Jt="count",Qt="offset",er="instances",tr="vao",rr="Width",nr="Height",ir=$t+rr,ar=$t+nr,or=Gt+rr,sr=Gt+nr,lr="drawingBuffer",cr=lr+rr,ur=lr+nr,hr=[kt,wt,Nt,Ut,Vt,jt,Gt,Ht,Ot],pr=34962,dr=34963,fr=35664,mr=35665,gr=35666,yr=35667,vr=35668,xr=35669,br=35671,_r=35672,wr=35673,kr=35674,Tr=35675,Sr=35676,Ar=35678,Mr=35680,Er=1028,Cr=1029,Pr=2305,Lr=7680,Ir={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Or={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Rr={cw:2304,ccw:Pr};function Dr(e){return Array.isArray(e)||b(e)||_(e)}function jr(e){return e.sort((function(e,t){return e===Gt?-1:t===Gt?1:e=1,n>=2,t)}if(4===r){var i=e.data;return new Fr(i.thisDep,i.contextDep,i.propDep,t)}if(5===r)return new Fr(!1,!1,!1,t);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Fr(a,o,s,t)}return new Fr(3===r,2===r,1===r,t)}var Vr=new Fr(!1,!1,!1,(function(){}));function qr(t,r,n,i,a,s,l,c,u,h,d,f,m,g,y,v){var x=h.Record,b={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(b.min=32775,b.max=32776);var _=n.angle_instanced_arrays,w=n.webgl_draw_buffers,k=n.oes_vertex_array_object,T={dirty:!0,profile:v.profile},S={},A=[],E={},C={};function P(e){return e.replace(".","_")}function L(e,t,r){var n=P(e);A.push(e),S[n]=T[n]=!!r,E[n]=t}function I(e,t,r){var n=P(e);A.push(e),Array.isArray(r)?(T[n]=r.slice(),S[n]=r.slice()):T[n]=S[n]=r,C[n]=t}function z(e){return!!isNaN(e)}L(xt,3024),L(bt,3042),I(_t,"blendColor",[0,0,0,0]),I(wt,"blendEquationSeparate",[32774,32774]),I(kt,"blendFuncSeparate",[1,0,1,0]),L(Tt,2929,!0),I(St,"depthFunc",513),I(At,"depthRange",[0,1]),I(Mt,"depthMask",!0),I(Et,Et,[!0,!0,!0,!0]),L(Ct,2884),I(Pt,"cullFace",Cr),I(Lt,Lt,Pr),I(It,It,1),L(zt,32823),I(Ot,"polygonOffset",[0,0]),L(Rt,32926),L(Dt,32928),I(jt,"sampleCoverage",[1,!1]),L(Ft,2960),I(Bt,"stencilMask",-1),I(Nt,"stencilFunc",[519,0,-1]),I(Ut,"stencilOpSeparate",[Er,Lr,Lr,Lr]),I(Vt,"stencilOpSeparate",[Cr,Lr,Lr,Lr]),L(qt,3089),I(Ht,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),I(Gt,Gt,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var O={gl:t,context:m,strings:r,next:S,current:T,draw:f,elements:s,buffer:a,shader:d,attributes:h.state,vao:h,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Dr},R={primTypes:j,compareFuncs:zr,blendFuncs:Ir,blendEquations:b,stencilOps:Or,glTypes:M,orientationType:Rr};w&&(R.backBuffer=[Cr],R.drawBuffer=p(i.maxDrawbuffers,(function(e){return 0===e?[0]:p(e,(function(e){return 36064+e}))})));var D=0;function F(){var t=function(t){var r=t&&t.cache,n=0,i=[],a=[],o=[];function s(){var t=[],r=[];return e((function(){t.push.apply(t,gt(arguments))}),{def:function(){var e="v"+n++;return r.push(e),arguments.length>0&&(t.push(e,"="),t.push.apply(t,gt(arguments)),t.push(";")),e},toString:function(){return yt([r.length>0?"var "+r.join(",")+";":"",yt(t)])}})}function l(){var t=s(),r=s(),n=t.toString,i=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e((function(){t.apply(t,gt(arguments))}),{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(e,t){var r=t&&t.stable;if(!r)for(var s=0;s0)return null;var n=t.static,i=Object.keys(n);if(i.length>0&&"number"===typeof n[i[0]]){for(var a=[],o=0;o0,k={framebuffer:f,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(k.profile=function(e){var t,r=e.static,n=e.dynamic;if(Wt in r){var i=!!r[Wt];(t=Nr((function(e,t){return i}))).enable=i}else if(Wt in n){var a=n[Wt];t=Ur(a,(function(e,t){return e.invoke(t,a)}))}return t}(e),k.uniforms=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r,i=t[e];if("number"===typeof i||"boolean"===typeof i)r=Nr((function(){return i}));else if("function"===typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Nr((function(e){return e.link(i)})):"framebuffer"!==a&&"framebufferCube"!==a||(r=Nr((function(e){return e.link(i.color[0])})))}else G(i)&&(r=Nr((function(e){return e.global.def("[",p(i.length,(function(e){return i[e]})),"]")})));r.value=i,n[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Ur(t,(function(e,r){return e.invoke(r,t)}))})),n}(i),k.drawVAO=k.scopeVAO=g.vao,!k.drawVAO&&v.program&&!u&&n.angle_instanced_arrays&&g.static.elements){var T=!0,S=v.program.attributes.map((function(e){var r=t.static[e];return T=T&&!!r,r}));if(T&&S.length>0){var E=h.getVAO(h.createVAO({attributes:S,elements:g.static.elements}));k.drawVAO=new Fr(null,null,null,(function(e,t){return e.link(E)})),k.useVAO=!0}}return u?k.useVAO=!0:k.attributes=function(e){var t=e.static,n=e.dynamic,i={};return Object.keys(t).forEach((function(e){var n=t[e],o=r.id(e),s=new x;if(Dr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,pr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"===typeof c?s.x=c:vt.forEach((function(e,t){t"+t+"?"+n+".constant["+t+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",pr,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),p("size"),p("offset"),p("stride"),p("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(t),k.context=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=Nr((function(e,t){return"number"===typeof r||"boolean"===typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Ur(t,(function(e,r){return e.invoke(r,t)}))})),n}(o),k}function N(e,t,r){var n=e.shared.context,i=e.scope();Object.keys(r).forEach((function(a){t.save(n,"."+a);var o=r[a].append(e,t);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),t(i)}function U(e,t,r,n){var i,a=e.shared,o=a.gl,s=a.framebuffer;w&&(i=t.def(a.extensions,".webgl_draw_buffers"));var l,c=e.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(e,t):t.def(s,".next"),n||t("if(",l,"!==",s,".cur){"),t("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&t(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),w&&t(i,".drawBuffersWEBGL(",h,");"),t("}",s,".cur=",l,";"),n||t("}")}function V(e,t,r){var n=e.shared,i=n.gl,a=e.current,o=e.next,s=n.current,l=n.next,c=e.cond(s,".dirty");A.forEach((function(t){var n,u,h=P(t);if(!(h in r.state))if(h in o){n=o[h],u=a[h];var d=p(T[h].length,(function(e){return c.def(n,"[",e,"]")}));c(e.cond(d.map((function(e,t){return e+"!=="+u+"["+t+"]"})).join("||")).then(i,".",C[h],"(",d,");",d.map((function(e,t){return u+"["+t+"]="+e})).join(";"),";"))}else{n=c.def(l,".",h);var f=e.cond(n,"!==",s,".",h);c(f),h in E?f(e.cond(n).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",n,";"):f(i,".",C[h],"(",n,");",s,".",h,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),t(c)}function q(e,t,r,n){var i,a=e.shared,o=e.current,s=a.current,l=a.gl;jr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(e,t);if(E[a]){var h=E[a];Br(c)?(i=e.link(u,{stable:!0}),t(e.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",i,";")):(t(e.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",u,";"))}else if(G(u)){var p=o[a];t(l,".",C[a],"(",u,");",u.map((function(e,t){return p+"["+t+"]="+e})).join(";"),";")}else Br(c)?(i=e.link(u,{stable:!0}),t(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):t(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function H(e,t){_&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function W(e,t,r,n,i){var a,o,s,l=e.shared,c=e.stats,u=l.current,h=l.timer,p=r.profile;function d(){return"undefined"===typeof performance?"Date.now()":"performance.now()"}function f(e){e(a=t.def(),"=",d(),";"),"string"===typeof i?e(c,".count+=",i,";"):e(c,".count++;"),g&&(n?e(o=t.def(),"=",h,".getNumPendingQueries();"):e(h,".beginQuery(",c,");"))}function m(e){e(c,".cpuTime+=",d(),"-",a,";"),g&&(n?e(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):e(h,".endQuery();"))}function y(e){var r=t.def(u,".profile");t(u,".profile=",e,";"),t.exit(u,".profile=",r,";")}if(p){if(Br(p))return void(p.enable?(f(t),m(t.exit),y("true")):y("false"));y(s=p.append(e,t))}else s=t.def(u,".profile");var v=e.block();f(v),t("if(",s,"){",v,"}");var x=e.block();m(x),t.exit("if(",s,"){",x,"}")}function $(e,t,r,n,i){var a=e.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(e,t)}else{if(!i(Vr))return;var c=e.scopeAttrib(s);o={},Object.keys(new x).forEach((function(e){o[e]=t.def(c,".",e)}))}!function(r,n,i){var o=a.gl,s=t.def(r,".location"),l=t.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];function d(){t("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?t.def(i.size,"||",n):n,t("if(",l,".type!==",a,"||",l,".size!==",r,"||",p.map((function(e){return l+"."+e+"!=="+i[e]})).join("||"),"){",o,".bindBuffer(",pr,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",p.map((function(e){return l+"."+e+"="+i[e]+";"})).join(""),"}"),_){var c=i.divisor;t("if(",l,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function f(){t("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",vt.map((function(e,t){return l+"."+e+"!=="+h[t]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",vt.map((function(e,t){return l+"."+e+"="+h[t]+";"})).join(""),"}")}1===c?d():2===c?f():(t("if(",c,"===",1,"){"),d(),t("}else{"),f(),t("}"))}(e.link(n),function(e){switch(e){case fr:case yr:case br:return 2;case mr:case vr:case _r:return 3;case gr:case xr:case wr:return 4;default:return 1}}(n.info.type),o)}))}function Z(e,t,n,i,a,o){for(var s,l=e.shared,c=l.gl,u=0;u1){for(var A=[],M=[],E=0;E>1)",u],");")}function t(){r(h,".drawArraysInstancedANGLE(",[p,d,f,u],");")}l&&"null"!==l?g?e():(r("if(",l,"){"),e(),r("}else{"),t(),r("}")):t()}function v(){function e(){r(a+".drawElements("+[p,f,m,d+"<<(("+m+"-5121)>>1)"]+");")}function t(){r(a+".drawArrays("+[p,d,f]+");")}l&&"null"!==l?g?e():(r("if(",l,"){"),e(),r("}else{"),t(),r("}")):t()}_&&("number"!==typeof u||u>=0)?"string"===typeof u?(r("if(",u,">0){"),y(),r("}else if(",u,"<0){"),v(),r("}")):y():v()}function Y(e,t,r,n,i){var a=F(),o=a.proc("body",i);return _&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),e(a,o,r,n),a.compile().body}function K(e,t,r,n){H(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),$(e,t,r,n.attributes,(function(){return!0}))),Z(e,t,r,n.uniforms,(function(){return!0}),!1),X(e,t,t,r)}function J(e,t,r,n){function i(){return!0}e.batchId="a1",H(e,t),$(e,t,r,n.attributes,i),Z(e,t,r,n.uniforms,i,!1),X(e,t,t,r)}function Q(e,t,r,n){H(e,t);var i=r.contextDep,a=t.def(),o=t.def();e.shared.props=o,e.batchId=a;var s=e.scope(),l=e.scope();function c(e){return e.contextDep&&i||e.propDep}function u(e){return!c(e)}if(t(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&N(e,l,r.context),r.needsFramebuffer&&U(e,l,r.framebuffer),q(e,l,r.state,c),r.profile&&c(r.profile)&&W(e,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(e.shared.vao,".setVAO(",r.drawVAO.append(e,l),");"):s(e.shared.vao,".setVAO(",r.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),$(e,s,r,n.attributes,u),$(e,l,r,n.attributes,c)),Z(e,s,r,n.uniforms,u,!1),Z(e,l,r,n.uniforms,c,!0),X(e,s,l,r);else{var h=e.global.def("{}"),p=r.shader.progVar.append(e,l),d=l.def(p,".id"),f=l.def(h,"[",d,"]");l(e.shared.gl,".useProgram(",p,".program);","if(!",f,"){",f,"=",h,"[",d,"]=",e.link((function(e){return Y(J,0,r,e,2)})),"(",p,");}",f,".call(this,a0[",a,"],",a,");")}}function ee(e,t,r){var n=t.static[r];if(n&&function(e){if("object"===typeof e&&!G(e)){for(var t=Object.keys(e),r=0;r0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(s,l),function(e,t){var n=e.proc("scope",3);e.batchId="a2";var i=e.shared,a=i.current;if(N(e,n,t.context),t.framebuffer&&t.framebuffer.append(e,n),jr(Object.keys(t.state)).forEach((function(r){var a=t.state[r],o=a.append(e,n);G(o)?o.forEach((function(t,i){z(t)?n.set(e.next[r],"["+i+"]",t):n.set(e.next[r],"["+i+"]",e.link(t,{stable:!0}))})):Br(a)?n.set(i.next,"."+r,e.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),W(e,n,t,!0,!0),[Yt,Qt,Jt,er,Kt].forEach((function(r){var a=t.draw[r];if(a){var o=a.append(e,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,e.link(o),{stable:!0})}})),Object.keys(t.uniforms).forEach((function(a){var o=t.uniforms[a].append(e,n);Array.isArray(o)&&(o="["+o.map((function(t){return z(t)?t:e.link(t,{stable:!0})}))+"]"),n.set(i.uniforms,"["+e.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(t.attributes).forEach((function(r){var i=t.attributes[r].append(e,n),a=e.scopeAttrib(r);Object.keys(new x).forEach((function(e){n.set(a,"."+e,i[e])}))})),t.scopeVAO){var o=t.scopeVAO.append(e,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",e.link(o,{stable:!0}))}function s(r){var a=t.shader[r];if(a){var o=a.append(e,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,e.link(o,{stable:!0}))}}s(Zt),s(Xt),Object.keys(t.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",e.shared.context,",a0,",e.batchId,");")}(s,l),function(e,t){var r=e.proc("batch",2);e.batchId="0",H(e,r);var n=!1,i=!0;Object.keys(t.context).forEach((function(e){n=n||t.context[e].propDep})),n||(N(e,r,t.context),i=!1);var a=t.framebuffer,o=!1;function s(e){return e.contextDep&&n||e.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(e,r,a)):U(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(n=!0),V(e,r,t),q(e,r,t.state,(function(e){return!s(e)})),t.profile&&s(t.profile)||W(e,r,t,!1,"a1"),t.contextDep=n,t.needsContext=i,t.needsFramebuffer=o;var l=t.shader.progVar;if(l.contextDep&&n||l.propDep)Q(e,r,t,null);else{var c=l.append(e,r);if(r(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)Q(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var u=e.global.def("{}"),h=r.def(c,".id"),p=r.def(u,"[",h,"]");r(e.cond(p).then(p,".call(this,a0,a1);").else(p,"=",u,"[",h,"]=",e.link((function(e){return Y(Q,0,t,e,2)})),"(",c,");",p,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(s,l),e(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var Hr=function(e,t){if(!t.ext_disjoint_timer_query)return null;var r=[];function n(e){r.push(e)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[],s=[];function l(e,t,r){var n=o.pop()||new a;n.startQueryIndex=e,n.endQueryIndex=t,n.sum=0,n.stats=r,s.push(n)}var c=[],u=[];return{beginQuery:function(e){var n=r.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),l(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var e,r,a=i.length;if(0!==a){u.length=Math.max(u.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,u[0]=0;var l,h=0;for(e=0,r=0;r0)if(Array.isArray(t[0])){o=P(t);for(var c=1,u=1;u0)if("number"===typeof e[0]){var i=m.allocType(h.dtype,e.length);R(i,e),d(i,n),m.freeType(i)}else if(Array.isArray(e[0])||b(e[0])){r=P(e);var a=C(e,r,h.dtype);d(a,n),m.freeType(a)}}else if(_(e)){r=e.shape;var o=e.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var f=Array.isArray(e.data)?h.dtype:O(e.data),g=m.allocType(f,s*l);D(g,e.data,s,l,c,u,e.offset),d(g,n),m.freeType(g)}return p},r.profile&&(p.stats=h.stats),p.destroy=function(){u(h)},p},createStream:function(e,t){var r=s.pop();return r||(r=new o(e)),r.bind(),c(r,t,35040,0,1,!1),r},destroyStream:function(e){s.push(e)},clear:function(){w(a).forEach(u),s.forEach(u)},getBuffer:function(e){return e&&e._buffer instanceof o?e._buffer:null},restore:function(){w(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:c}}(n,u,r,(function(e){return W.destroyBuffer(e)})),G=function(e,t,r,n){var i={},a=0,o={uint8:F,uint16:B};function s(e){this.id=a++,i[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}t.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;c||b(i)&&(!_(i)||b(i.data))||(h=t.oes_element_index_uint?N:B),r._initBuffer(n.buffer,i,a,h,3)}else e.bufferData(U,l,a),n.buffer.dtype=u||F,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case F:case 5120:u=F;break;case B:case 5122:u=B;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var p=s;p<0&&(p=n.buffer.byteLength,u===B?p>>=1:u===N&&(p>>=2)),n.vertCount=p;var d=o;if(o<0){d=4;var f=n.buffer.dimension;1===f&&(d=0),2===f&&(d=1),3===f&&(d=4)}n.primType=d}function u(e){n.elementsCount--,delete i[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(e,t){var i=r.create(null,U,!0),a=new s(i._buffer);function l(e){if(e)if("number"===typeof e)i(e),a.primType=4,a.vertCount=0|e,a.type=F;else{var t=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(e)||b(e)||_(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=E[e.usage]),"primitive"in e&&(n=j[e.primitive]),"count"in e&&(s=0|e.count),"type"in e&&(h=o[e.type]),"length"in e?u=0|e.length:(u=s,h===B||5122===h?u*=2:h!==N&&5124!==h||(u*=4))),c(a,t,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=F;return l}return n.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(e,t){return i.subdata(e,t),l},l.destroy=function(){u(a)},l},createStream:function(e){var t=l.pop();return t||(t=new s(r.create(null,U,!0,!1)._buffer)),c(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"===typeof e&&e._elements instanceof s?e._elements:null},clear:function(){w(i).forEach(u)}}}(n,d,H,u),W=function(e,t,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c=d.byteLength?u.subdata(d):(u.destroy(),t.buffers[c]=null)),t.buffers[c]||(u=t.buffers[c]=i.create(h,34962,!1,!0)),p.buffer=i.getBuffer(u),p.size=0|p.buffer.dimension,p.normalized=!1,p.type=p.buffer.dtype,p.offset=0,p.stride=0,p.divisor=0,p.state=1,s[c]=1):i.getBuffer(h)?(p.buffer=i.getBuffer(h),p.size=0|p.buffer.dimension,p.normalized=!1,p.type=p.buffer.dtype,p.offset=0,p.stride=0,p.divisor=0,p.state=1):i.getBuffer(h.buffer)?(p.buffer=i.getBuffer(h.buffer),p.size=0|(+h.size||p.buffer.dimension),p.normalized=!!h.normalized||!1,p.type="type"in h?M[h.type]:p.buffer.dtype,p.offset=0|(h.offset||0),p.stride=0|(h.stride||0),p.divisor=0|(h.divisor||0),p.state=1):"x"in h&&(p.x=+h.x||0,p.y=+h.y||0,p.z=+h.z||0,p.w=+h.w||0,p.state=2)}for(var f=0;f1)for(var y=0;ye&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return h.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var e=t.deleteShader.bind(t);w(a).forEach(e),a={},w(o).forEach(e),o={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var p=c[r];if(p&&(p.refCount++,!l))return p;var m=new d(i,r);return n.shaderCount++,f(m,0,l),p||(c[r]=m),h.push(m),e(m,{destroy:function(){if(m.refCount--,m.refCount<=0){t.deleteProgram(m.program);var e=h.indexOf(m);h.splice(e,1),n.shaderCount--}c[m.vertId].refCount<=0&&(t.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(t.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var e=0;e=0?p=!0:c.indexOf(f)>=0&&(p=!1))),("depthTexture"in A||"depthStencilTexture"in A)&&(T=!(!A.depthTexture&&!A.depthStencilTexture)),"depth"in A&&("boolean"===typeof A.depth?s=A.depth:(b=A.depth,u=!1)),"stencil"in A&&("boolean"===typeof A.stencil?u=A.stencil:(_=A.stencil,s=!1)),"depthStencil"in A&&("boolean"===typeof A.depthStencil?s=u=A.depthStencil:(w=A.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,P=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=A(s)}return e(n,{width:l,height:l,color:o})}return n(t),e(n,{faces:r,resize:function(e){var t,i=0|e;if(i===n.width)return n;var a=n.color;for(t=0;t=0;--e){var t=te[e];t&&t(A,null,0)}n.flush(),f&&f.update()}function se(){!ae&&te.length>0&&(ae=s.next(oe))}function le(){ae&&(s.cancel(oe),ae=null)}function ce(e){e.preventDefault(),le(),re.forEach((function(e){e()}))}function ue(e){n.getError(),a.restore(),$.restore(),H.restore(),Z.restore(),X.restore(),Y.restore(),W.restore(),f&&f.restore(),K.procs.refresh(),se(),ne.forEach((function(e){e()}))}function he(t){function r(e,t){var r={},n={};return Object.keys(e).forEach((function(i){var a=e[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(t&&Array.isArray(a))for(var s=0;s0)return h.call(this,function(e){for(;d.length=0},read:J,destroy:function(){te.length=0,le(),ee&&(ee.removeEventListener(Gr,ce),ee.removeEventListener(Wr,ue)),$.clear(),Y.clear(),X.clear(),W.clear(),Z.clear(),G.clear(),H.clear(),f&&f.clear(),ie.forEach((function(e){e()}))},_gl:n,_refresh:ye,poll:function(){ge(),f&&f.update()},now:ve,stats:u,getCachedCode:function(){return p},preloadCachedCode:function(e){Object.entries(e).forEach((function(e){p[e[0]]=e[1]}))}});return r.onDone(null,xe),xe}},"object"===typeof e&&"undefined"!==typeof t?t.exports=n():r.createREGL=n()}}),Qv=p({"node_modules/gl-util/context.js"(e,t){var r=Bg();function n(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*window.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*window.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function i(e){return"function"===typeof e.getContext&&"width"in e&&"height"in e}function a(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}t.exports=function(e){var t;if(e?"string"===typeof e&&(e={container:e}):e={},(e=i(e)||"string"===typeof(t=e).nodeName&&"function"===typeof t.appendChild&&"function"===typeof t.getBoundingClientRect?{container:e}:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(e)?{gl:e}:r(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=window.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"===typeof e.container){var o=document.querySelector(e.container);if(!o)throw Error("Element "+e.container+" is not found");e.container=o}i(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=a(),e.container.appendChild(e.canvas),n(e))}else if(!e.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=a(),e.container.appendChild(e.canvas),n(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{e.gl=e.canvas.getContext(r,e.attrs)}catch(t){}return e.gl})),e.gl}}}),ex=p({"node_modules/font-atlas/index.js"(e,t){var r=Yv(),n=[32,126];t.exports=function(e){var t=(e=e||{}).shape?e.shape:e.canvas?[e.canvas.width,e.canvas.height]:[512,512],i=e.canvas||document.createElement("canvas"),a=e.font,o="number"===typeof e.step?[e.step,e.step]:e.step||[32,32],s=e.chars||n;if(a&&"string"!==typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"===typeof s[0]&&"number"===typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");t=t.slice(),i.width=t[0],i.height=t[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var p=o[0]/2,d=o[1]/2;for(c=0;ct[0]-o[0]/2&&(p=o[0]/2,d+=o[1]);return i}}}),tx=p({"node_modules/bit-twiddle/twiddle.js"(e){function t(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(e){return(e>0)-(e<0)},e.abs=function(e){var t=e>>31;return(e^t)-t},e.min=function(e,t){return t^(e^t)&-(e65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},e.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},e.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},e.countTrailingZeros=t,e.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},e.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},e.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var r=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<>>8&255]<<16|r[e>>>16&255]<<8|r[e>>>24&255]},e.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},e.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},e.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},e.nextCombination=function(e){var r=e|e-1;return r+1|(~r&-~r)-1>>>t(e)+1}}}),rx=p({"node_modules/dup/dup.js"(e,t){function r(e,t,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a0)return function(e,t){var r,n;for(r=new Array(e),n=0;n0?n.pop():new ArrayBuffer(e)}function p(e){return new Uint8Array(h(e),0,e)}function d(e){return new Uint16Array(h(2*e),0,e)}function f(e){return new Uint32Array(h(4*e),0,e)}function m(e){return new Int8Array(h(e),0,e)}function g(e){return new Int16Array(h(2*e),0,e)}function y(e){return new Int32Array(h(4*e),0,e)}function v(e){return new Float32Array(h(4*e),0,e)}function x(e){return new Float64Array(h(8*e),0,e)}function b(e){return i?new Uint8ClampedArray(h(e),0,e):p(e)}function _(e){return a?new BigUint64Array(h(8*e),0,e):null}function w(e){return o?new BigInt64Array(h(8*e),0,e):null}function k(e){return new DataView(h(e),0,e)}function T(e){e=t.nextPow2(e);var r=t.log2(e),i=c[r];return i.length>0?i.pop():new n(e)}e.free=function(e){if(n.isBuffer(e))c[t.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var r=e.length||e.byteLength,i=0|t.log2(r);l[i].push(e)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(e){u(e.buffer)},e.freeArrayBuffer=u,e.freeBuffer=function(e){c[t.log2(e.length)].push(e)},e.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return h(e);switch(t){case"uint8":return p(e);case"uint16":return d(e);case"uint32":return f(e);case"int8":return m(e);case"int16":return g(e);case"int32":return y(e);case"float":case"float32":return v(e);case"double":case"float64":return x(e);case"uint8_clamped":return b(e);case"bigint64":return w(e);case"biguint64":return _(e);case"buffer":return T(e);case"data":case"dataview":return k(e);default:return null}return null},e.mallocArrayBuffer=h,e.mallocUint8=p,e.mallocUint16=d,e.mallocUint32=f,e.mallocInt8=m,e.mallocInt16=g,e.mallocInt32=y,e.mallocFloat32=e.mallocFloat=v,e.mallocFloat64=e.mallocDouble=x,e.mallocUint8Clamped=b,e.mallocBigUint64=_,e.mallocBigInt64=w,e.mallocDataView=k,e.mallocBuffer=T,e.clearCache=function(){for(var e=0;e<32;++e)s.UINT8[e].length=0,s.UINT16[e].length=0,s.UINT32[e].length=0,s.INT8[e].length=0,s.INT16[e].length=0,s.INT32[e].length=0,s.FLOAT[e].length=0,s.DOUBLE[e].length=0,s.BIGUINT64[e].length=0,s.BIGINT64[e].length=0,s.UINT8C[e].length=0,l[e].length=0,c[e].length=0}}}),ix=p({"node_modules/is-plain-obj/index.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}}}),ax=p({"node_modules/parse-unit/index.js"(e,t){t.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}}}),ox=p({"node_modules/to-px/topx.js"(e,t){var r=ax();function n(e,t){var n=r(getComputedStyle(e).getPropertyValue(t));return n[0]*i(n[1],e)}function i(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),t!==window&&t!==document||(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":return function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var i=n(r,"font-size")/128;return t.removeChild(r),i}(e,t);case"em":return n(t,"font-size");case"rem":return n(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 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}t.exports=i}}),sx=p({"node_modules/detect-kerning/index.js"(e,t){t.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(e,t){Array.isArray(e)&&(e=e.join(", "));var i,o={},s=16,l=.05;t&&(2===t.length&&"number"===typeof t[0]?i=a(t):Array.isArray(t)?i=t:(t.o?i=a(t.o):t.pairs&&(i=t.pairs),t.fontSize&&(s=t.fontSize),null!=t.threshold&&(l=t.threshold))),i||(i=n),r.font=s+"px "+e;for(var c=0;cs*l){var d=(p-h)/s;o[u]=1e3*d}}return o}function a(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}t.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),cx=p({"node_modules/gl-text/dist.js"(e,t){var r,n=Kv(),i=Bg(),a=Jv(),o=Qv(),s=Rv(),l=Bf(),c=ex(),u=nx(),h=Ng(),p=ix(),d=ax(),f=ox(),m=sx(),g=uy(),y=lx(),v=qg(),x=tx().nextPow2,b=new s,_=!1;document.body&&((r=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(r).fontStretch&&(_=!0),document.body.removeChild(r));var w=function(e){!function(e){return"function"===typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(p(e)?e:{})};w.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},w.prototype.update=function(e){var t=this;if("string"===typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=h(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"===typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=v(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=w.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"===typeof e)try{e=n.parse(e)}catch(v){e=n.parse(w.baseFontSize+"px "+e)}else{var i=e.style,s=e.weight,l=e.stretch,c=e.variant;e=n.parse(n.stringify(e)),i&&(e.style=i),s&&(e.weight=s),l&&(e.stretch=l),c&&(e.variant=c)}var u=n.stringify({size:w.baseFontSize,family:e.family,stretch:_?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),h=d(e.size),p=Math.round(h[0]*f(h[1]));if(p!==t.fontSize[r]&&(o=!0,t.fontSize[r]=p),(!t.font[r]||u!=t.font[r].baseString)&&(a=!0,t.font[r]=w.fonts[u],!t.font[r])){var m=e.family.join(", "),g=[e.style];e.style!=e.variant&&g.push(e.variant),e.variant!=e.weight&&g.push(e.weight),_&&e.weight!=e.stretch&&g.push(e.stretch),t.font[r]={baseString:u,family:m,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:y(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:g.join(" ")})},w.fonts[u]=t.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"===typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),p=0;p2){for(var k=!e.position[0].length,T=u.mallocFloat(2*this.count),S=0,A=0;S1?t.align[r]:t.align[0]:t.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof e?e-n.baseline:-n[e],i*=-1}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!==typeof e.color&&isNaN(e.color)){var H;if("number"===typeof e.color[0]&&e.color.length>this.counts.length){var G=e.color.length;H=u.mallocUint8(G);for(var W=(e.color.subarray||e.color.slice).bind(e.color),$=0;$4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var Y=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(Y);for(var K=0;K1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+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=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},t.exports=w}}),ux=p({"src/lib/prepare_regl.js"(e,t){var r=Kf(),n=Jv();t.exports=function(e,t,i){var a=e._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||window.devicePixelRatio,extensions:t||[],cachedCode:i||{}})}catch(s){o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),hx=p({"src/traces/scattergl/plot.js"(e,t){var r=my(),n=jv(),i=Fv(),a=cx(),o=st(),s=Or().selectMode,l=ux(),c=$t(),u=ui(),h=oy().styleTextSelection,p={};function d(e,t,r,n){var i=e._size,a=e.width*n,o=e.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,p=i.h*n;return[s+t.domain[0]*h,l+r.domain[0]*p,a-c-(1-t.domain[1])*h,o-u-(1-r.domain[1])*p]}(t.exports=function(e,t,f){if(f.length){var m,g,y=e._fullLayout,v=t._scene,x=t.xaxis,b=t.yaxis;if(v)if(l(e,["ANGLE_instanced_arrays","OES_element_index_uint"],p)){var _=v.count,w=y._glcanvas.data()[0].regl;if(u(e,t,f),v.dirty){if(!v.line2d&&!v.error2d||v.scatter2d||v.fill2d||v.glText||w.clear({}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(_),m=0;m<_;m++)v.glText[m]=new a(w);if(v.glText){if(_>v.glText.length){var k=_-v.glText.length;for(m=0;mr&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),v.line2d.update(v.lineOptions)),v.error2d){var S=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(S)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,_),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(e,t){var r=f[t];if(e&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[t],c=[];o._ownfill&&c.push(t),o._nexttrace&&c.push(t+1),c.length&&(v.fillOrder[t]=c);var u,h,p=[],d=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;uu&&isNaN(d[h+1]);)h-=2;0!==d[u+1]&&(p=[d[u],0]),p=p.concat(d.slice(u,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===o.fill){for(u=0;uu&&isNaN(d[h]);)h-=2;0!==d[u]&&(p=[0,d[u+1]]),p=p.concat(d.slice(u,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(p=[],n=0,e.splitNull=!0,i=0;i-1;for(m=0;m<_;m++){var C=f[m][0],P=C.trace,L=C.t,I=L.index,z=P._length,O=L.x,R=L.y;if(P.selectedpoints||M||E){if(M||(M=!0),P.selectedpoints){var D=v.selectBatch[I]=o.selIndices2selPoints(P),j={};for(g=0;ga&&l||ih?b.sizeAvg||Math.max(b.size,3):i(t,x),d=0;d2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),p.length>2?(s=p[0],c=p[2],l=p[1],u=p[3]):p.length?(s=l=p[0],c=u=p[1]):(s=p.x,l=p.y,c=p.x+p.width,u=p.y+p.height),[s,i,c,o]}function p(e){if("number"===typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];{let t=s(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}}t.exports=c,c.prototype.render=function(){return arguments.length&&this.update(...arguments),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.prototype.update=function(){if(!arguments.length)return;for(let r=0;re)continue;if(!c.lower&&n{e[a+r]=n}))}this.scatter.draw(...e)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((e=>{e.buffer&&e.buffer.destroy&&e.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),kx=p({"src/traces/splom/plot.js"(e,t){var r=wx(),n=st(),i=vt(),a=Or().selectMode;function o(e,t){var o,s,l,c,u,h=e._fullLayout,p=h._size,d=t.trace,f=t.t,m=h._splomScenes[d.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=d.showupperhalf,g.upper=d.showlowerhalf,g.diagonal=d.diagonal.visible;var b=d._visibleDims,_=y.length,w=m.viewOpts={};for(w.ranges=new Array(_),w.domains=new Array(_),u=0;u-1,L=!0;if(a(x)||d.selectedpoints||P){var I=d._length;if(d.selectedpoints){m.selectBatch=d.selectedpoints;var z=d.selectedpoints,O={};for(l=0;l=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],u=l,p=a;i*pt){p=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(p)?isNaN(h)?p:h:t-c[h][1]e[1]+n||t=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(f,t);m&&(o.interval=l[a],o.intervalPix=f,o.region=m)}}if(e.ordinal&&!o.region){var y=e.unitTickvals,v=e.unitToPaddedPx.invert(t);for(n=0;n=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(e,t){n.event.sourceEvent.stopPropagation();var i=t.height-n.mouse(e)[1]-2*r.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(i)].sort(o),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),b(e.parentNode)}function k(e,t){var i=_(t,t.height-n.mouse(e)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function T(e){e.on("mousemove",(function(e){n.event.preventDefault(),e.parent.inBrushDrag||k(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(e){!function(e,t){n.event.sourceEvent.stopPropagation();var i=t.height-n.mouse(e)[1]-2*r.verticalPadding,a=t.unitToPaddedPx.invert(i),o=t.brush,s=_(t,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(t.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,c.brushStartCallback()}(this,e)})).on("drag",(function(e){w(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,i=r.filter,a=r.svgBrush;a._dragging||(k(e,t),w(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&A(r)):A(r),a.brushCallback(t),b(e.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||A(r),a.brushCallback(t),c?b(e.parentNode,s):(s(),b(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,e)})))}function S(e,t){return e[0]-t[0]}function A(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function M(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}t.exports={makeBrush:function(e,t,r,n,i,a){var s,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(o)})).sort(S)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=M(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(s=i,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t),n=r.slice();t.filter.set(n),s()}),brushEndCallback:a}}},ensureAxisBrush:function(e,t,n){var o=e.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(e,t,n){var i=n._context.staticPlot,o=e.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(d).call(f).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(T).attr("height",(function(e){return e.height-r.verticalPadding}));var l=e.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",t).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(e){return e.height})).call(x);var c=e.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(e){return e.height})).call(x)}(o,t,n)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(o)})),e=t.multiselect?M(e.sort(S)):[e[0]]):e=[e.sort(o)],t.tickvals){var r=t.tickvals.slice().sort(o);if(!(e=e.map((function(e){var t=[p(0,r,e[0],[]),p(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}}}),Dx=p({"src/traces/parcoords/defaults.js"(e,t){var r=st(),n=Mt().hasColorscale,i=Vt(),a=ka().defaults,o=Ft(),s=nr(),l=Ix(),c=Rx(),u=zx().maxDimensionCount,h=mx();function p(e,t,n,i){function a(n,i){return r.coerce(e,t,l.dimensions,n,i)}var o=a("values"),u=a("visible");if(o&&o.length||(u=t.visible=!1),u){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");t._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(t._ax,i.layout),a("multiselect");var p=a("constraintrange");p&&(t.constraintrange=c.cleanRanges(p,t))}}t.exports=function(e,t,s,c){function d(n,i){return r.coerce(e,t,l,n,i)}var f=e.dimensions;Array.isArray(f)&&f.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),f.splice(u));var m=o(e,t,{name:"dimensions",layout:c,handleItemDefaults:p}),g=function(e,t,a,o,s){var l=s("line.color",a);if(n(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,s,c,d);a(t,c,d),Array.isArray(m)&&m.length||(t.visible=!1),h(t,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(d,"labelfont",y),r.coerceFont(d,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(d,"rangefont",y),d("labelangle"),d("labelside"),d("unselected.line.color"),d("unselected.line.opacity")}}}),jx=p({"src/traces/parcoords/calc.js"(e,t){var r=st().isArrayOrTypedArray,n=Wt(),i=Ox().wrap;t.exports=function(e,t){var a,o;return n.hasColorscale(t,"line")&&r(t.line.color)?(a=t.line.color,o=n.extractOpts(t.line).colorscale,n.calc(e,t,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(e){for(var t=new Array(e),r=0;r>>16,(65280&e)>>>8,255&e],alpha:1};if("number"===typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if(e=String(e).toLowerCase(),Dd.default[e])a=Dd.default[e].slice(),i="rgb";else if("transparent"===e)o=0,i="rgb",a=[0,0,0];else if("#"===e[0]){var s=e.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var c=n[1],u="cmyk"===(i=c.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map((function(e,t){if("%"===e[e.length-1])return e=parseFloat(e)/100,3===t?e:"rgb"===i?255*e:"h"===i[0]?100*e:"l"!==i[0]||t?"lab"===i?125*e:"lch"===i?t<2?150*e:360*e:"o"!==i[0]||t?"oklab"===i?.4*e:"oklch"===i?t<2?.4*e:360*e:e:e:100*e;if("h"===i[t]||2===t&&"h"===i[i.length-1]){if(void 0!==Fd[e])return Fd[e];if(e.endsWith("deg"))return parseFloat(e);if(e.endsWith("turn"))return 360*parseFloat(e);if(e.endsWith("grad"))return 360*parseFloat(e)/400;if(e.endsWith("rad"))return 180*parseFloat(e)/Math.PI}return"none"===e?0:parseFloat(e)}))).length>u?a.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=(null==(r=null==(t=e.match(/([a-z])/gi))?void 0:t.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var Bx,Nx,Ux=h({"node_modules/color-parse/index.js"(){var r,n,i;r=Of(),n=1,i=null!=r?e(s(r)):{},Dd=f(!n&&r&&r.__esModule?i:t(i,"default",{value:r,enumerable:!0}),r),jd=Fx,Fd={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Vx=h({"node_modules/color-space/rgb.js"(){Bx={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),qx=h({"node_modules/color-space/hsl.js"(){Vx(),Nx={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c++]=255*a;return i}},Bx.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),Hx={};function Gx(e){var t;Array.isArray(e)&&e.raw&&(e=String.raw(...arguments)),e instanceof Number&&(e=+e);var r=jd(e);if(!r.space)return[];const n="h"===r.space[0]?Nx.min:Bx.min,i="h"===r.space[0]?Nx.max:Bx.max;return(t=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),t[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),t[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(t=Nx.rgb(t)),t.push(Math.min(Math.max(r.alpha,0),1)),t}d(Hx,{default:()=>Gx});var Wx=h({"node_modules/color-rgba/index.js"(){Ux(),Vx(),qx()}}),$x=p({"src/traces/parcoords/helpers.js"(e){var t=st().isTypedArray;e.convertTypedArray=function(e){return t(e)?Array.prototype.slice.call(e):e},e.isOrdinal=function(e){return!!e.tickvals},e.isVisible=function(e){return e.visible||!("visible"in e)}}}),Zx=p({"src/traces/parcoords/lines.js"(e,t){var r=["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("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=zx().maxDimensionCount,a=st(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function p(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:l})}(e),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,t(a),l*n+c>>8*t)%256/255}function m(e,t,r){for(var n=new Array(8*t),i=0,a=0;au&&(u=e[n].dim1.canvasX,a=n);0===o&&h(S,0,0,l.canvasWidth,l.canvasHeight);var d=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&ns._length&&(A=A.slice(0,s._length));var C,L=s.tickvals;function I(e,t){return{val:e,text:C[t]}}function z(e,t){return e.val-t.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),C=s.ticktext,i(C)&&C.length?C.length>L.length?C=C.slice(0,L.length):L.length>C.length&&(L=L.slice(0,C.length)):C=L.map(a(s.tickformat));for(var O=1;O=n||l>=i)return;var c=e.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,p={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:h};h!==C&&(u?a.hover(p):a.unhover&&a.unhover(p),C=h)}})),E.style("opacity",(function(e){return e.pick?0:1})),d.style("background","rgba(255, 255, 255, 0)");var F=d.selectAll("."+b.cn.parcoords).data(M,f);F.exit().remove(),F.enter().append("g").classed(b.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),F.attr("transform",(function(e){return c(e.model.translateX,e.model.translateY)}));var B=F.selectAll("."+b.cn.parcoordsControlView).data(g,f);B.enter().append("g").classed(b.cn.parcoordsControlView,!0),B.attr("transform",(function(e){return c(e.model.pad.l,e.model.pad.t)}));var N=B.selectAll("."+b.cn.yAxis).data((function(e){return e.dimensions}),f);N.enter().append("g").classed(b.cn.yAxis,!0),B.each((function(e){R(N,e,v)})),E.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=w(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),N.attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),N.call(r.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;S.linePickActive(!1),e.x=Math.max(-b.overdrag,Math.min(e.model.width+b.overdrag,r.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,N.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),R(N,t,v),N.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),r.select(this).attr("transform",c(e.x,0)),N.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!P(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,R(N,t,v),r.select(this).attr("transform",(function(e){return c(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!P(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),N.exit().remove();var U=N.selectAll("."+b.cn.axisOverlays).data(g,f);U.enter().append("g").classed(b.cn.axisOverlays,!0),U.selectAll("."+b.cn.axis).remove();var V=U.selectAll("."+b.cn.axis).data(g,f);V.enter().append("g").classed(b.cn.axis,!0),V.each((function(e){var t=e.model.height/e.model.tickDistance,n=e.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return x.isOrdinal(e)?t:D(e.model.dimensions[e.visibleIndex],t)})).scale(n)),h.font(V.selectAll("text"),e.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("cursor","default");var q=U.selectAll("."+b.cn.axisHeading).data(g,f);q.enter().append("g").classed(b.cn.axisHeading,!0);var H=q.selectAll("."+b.cn.axisTitle).data(g,f);H.enter().append("text").classed(b.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var n=r.select(this);h.font(n,t.model.labelFont),u.convertToTspans(n,e)})).attr("transform",(function(e){var t=O(e.model.labelAngle,e.model.labelSide),r=b.axisTitleOffset;return(t.dir>0?"":c(0,2*r+e.model.height))+l(t.degrees)+c(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=O(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var G=U.selectAll("."+b.cn.axisExtent).data(g,f);G.enter().append("g").classed(b.cn.axisExtent,!0);var W=G.selectAll("."+b.cn.axisExtentTop).data(g,f);W.enter().append("g").classed(b.cn.axisExtentTop,!0),W.attr("transform",c(0,-b.axisExtentOffset));var $=W.selectAll("."+b.cn.axisExtentTopText).data(g,f);$.enter().append("text").classed(b.cn.axisExtentTopText,!0).call(z),$.text((function(e){return j(e,!0)})).each((function(e){h.font(r.select(this),e.model.rangeFont)}));var Z=G.selectAll("."+b.cn.axisExtentBottom).data(g,f);Z.enter().append("g").classed(b.cn.axisExtentBottom,!0),Z.attr("transform",(function(e){return c(0,e.model.height+b.axisExtentOffset)}));var X=Z.selectAll("."+b.cn.axisExtentBottomText).data(g,f);X.enter().append("text").classed(b.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),X.text((function(e){return j(e,!1)})).each((function(e){h.font(r.select(this),e.model.rangeFont)})),_.ensureAxisBrush(U,k,e)}}}),Yx=p({"src/traces/parcoords/plot.js"(e,t){var r=Xx(),n=ux(),i=$x().isVisible,a={};function o(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(t.exports=function(e,t){var s=e._fullLayout;if(n(e,[],a)){var l={},c={},u={},h={},p=s._size;t.forEach((function(t,r){var n=t[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=e.data[i].dimensions,c[r]=e.data[i].dimensions.slice()})),r(e,t,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(t,r,n){var i=c[t][r],a=n.map((function(e){return e.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[e._fullData[u[t]]._fullInput.uid];if(void 0===l[o]){var p=i.constraintrange;l[o]=p||null}var d=e._fullData[u[t]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,d.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete d.constraintrange,a=null);var f={};f[o]=a,e.emit("plotly_restyle",[f,[h[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return o(e,t,r)-o(e,t,n)}}(r,c[t].filter(i));l[t].sort(n),c[t].filter((function(e){return!i(e)})).sort((function(e){return c[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(c[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[h[t]]])}})}}).reglPrecompiled=a}}),Kx=p({"src/traces/parcoords/base_plot.js"(e){var t=v(),r=_t().getModuleCalcData,n=Yx(),i=Tt();e.name="parcoords",e.plot=function(e){var t=r(e.calcdata,"parcoords")[0];t.length&&n(e,t)},e.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},e.toSVG=function(e){var r=e._fullLayout._glimages,n=t.select(e).selectAll(".svg-container");n.filter((function(e,t){return t===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,t=e.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){t.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),Jx=p({"src/traces/parcoords/base_index.js"(e,t){t.exports={attributes:Ix(),supplyDefaults:Dx(),calc:jx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Kx(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Qx=p({"src/traces/parcoords/index.js"(e,t){var r=Jx();r.plot=Yx(),t.exports=r}}),eb=p({"lib/parcoords.js"(e,t){t.exports=Qx()}}),tb=p({"src/traces/parcats/attributes.js"(e,t){var r=R().extendFlat,n=N(),i=D(),a=Lt(),o=Oe().hovertemplateAttrs,s=ka().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});t.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),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:i({editType:"calc"}),tickfont:i({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}}}),rb=p({"src/traces/parcats/defaults.js"(e,t){var r=st(),n=Mt().hasColorscale,i=Vt(),a=ka().defaults,o=Ft(),s=tb(),l=mx(),c=M().isTypedArraySpec;function u(e,t){function n(n,i){return r.coerce(e,t,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=t.visible=!1),a){n("label"),n("displayindex",t._index);var o,l=e.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete e.categoryarray,delete e.ticktext),u||"array"!==h||(t.categoryorder="trace")}}t.exports=function(e,t,c,h){function p(n,i){return r.coerce(e,t,s,n,i)}var d=o(e,t,{name:"dimensions",handleItemDefaults:u}),f=function(e,t,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,c,h,p);a(t,h,p),Array.isArray(d)&&d.length||(t.visible=!1),l(t,d,"values",f),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var m=h.font;r.coerceFont(p,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(p,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),nb=p({"src/traces/parcats/calc.js"(e,t){var r=Ox().wrap,n=Mt().hasColorscale,i=Gt(),a=nt(),o=Jt(),s=st(),l=k();function c(e,t,r){e.valueInds.push(t),e.count+=r}function u(e,t,r){e.valueInds.push(t),e.count+=r}t.exports=function(e,t){var h=s.filterVisible(t.dimensions);if(0===h.length)return[];var p,d,f,m=h.map((function(e){var t;if("trace"===e.categoryorder)t=null;else if("array"===e.categoryorder)t=e.categoryarray;else{t=a(e.values);for(var r=!0,n=0;n=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;tt.model.rawColor?1:e.model.rawColor"),C=r.mouse(h)[0];a.loneHover({trace:p,x:v-f.left+m.left,y:_-f.top+m.top,text:E,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C1&&p.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var b=x.join("
");return{trace:d,x:o*(i-t.left),y:s*(f-t.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:v,eventData:[{data:d._input,fullData:d,count:m,category:g,probability:y}]}}function P(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var t,n=e.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,u=this;"color"===l?(function(e){var t=r.select(e).datum(),n=A(t);k(n),n.each((function(){o.raiseToTop(this)})),r.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){o.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),E(u,"plotly_hover",r.event)):(function(e){r.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=A(e);k(t),t.each((function(){o.raiseToTop(this)}))})),r.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),M(u,"plotly_hover",r.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=C(n,s,u):"color"===l?t=function(e,t,n){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,p=h.parcatsViewModel,d=p.model.dimensions[h.model.dimensionInd],f=p.trace,m=l.y+l.height/2;p.dimensions.length>1&&d.displayInd===p.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(e){e.color===u.color&&(v+=e.count)}));var x=h.model.count,b=0;p.pathSelection.each((function(e){e.model.color===u.color&&(b+=e.model.count)}));var _=v/y,w=v/b,k=v/x,T={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},S=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&S.push(["Count:",T.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(S.push("P(color \u2229 "+g+"): "+T.probabilityLabel),S.push("P("+g+" | color): "+w.toFixed(3)),S.push("P(color | "+g+"): "+k.toFixed(3)));var A=S.join("
"),M=c.mostReadable(u.color,["black","white"]);return{trace:f,x:o*(i-t.left),y:s*(m-t.top),text:A,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:M,fontSize:10,idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:T,eventData:[{data:f._input,fullData:f,category:g,count:y,probability:_,categorycount:x,colorcount:b,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(t=function(e,t,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(e,t,this))})),i}(n,s,u)),t&&a.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(e){var t=e.parcatsViewModel;t.dragDimension||(w(t.pathSelection),T(t.dimensionSelection.selectAll("g.category")),S(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(f),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):M(this,"plotly_unhover",r.event))}function I(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.yh.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var p=e.parcatsViewModel.dimensions[n],d=e.parcatsViewModel.dimensions[i];void 0!==p&&a.model.dragXd.x&&(a.model.displayInd=d.model.displayInd,d.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}V(e.parcatsViewModel),U(e.parcatsViewModel),F(e.parcatsViewModel),j(e.parcatsViewModel)}}function R(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var t={},n=D(e.parcatsViewModel),a=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==a[t]}));o&&a.forEach((function(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var c=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),u=c.map((function(e){return e.categoryValue})),h=c.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[u],t["dimensions["+e.model.containerInd+"].ticktext"]=[h],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?E(e.potentialClickBand,"plotly_click",r.event.sourceEvent):M(e.potentialClickBand,"plotly_click",r.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,V(e.parcatsViewModel),U(e.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){F(e.parcatsViewModel,!0),j(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(e.parcatsViewModel.graphDiv,t,[n])}))}}function D(e){for(var t,r=e.graphDiv._fullData,n=0;n=0;s--)u+="C"+c[s]+","+(t[s+1]+i)+" "+l[s]+","+(t[s]+i)+" "+(e[s]+r[s])+","+(t[s]+i),u+="l-"+r[s]+",0 ";return u+="Z"}function U(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),i=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),a=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}c.sort((function(t,r){var n=h(t),i=h(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),ni?1:0}));for(var p=new Array(c.length),d=t[0].model.count,f=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),m=0;m0?f*(y.count/d):0;for(var v,x=new Array(n.length),b=0;b1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=e.model.maxCats,p=t.categories.length,d=t.count,f=e.height-8*(h-1),m=8*(h-p)/2,g=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(g.sort((function(e,t){return e.displayInd-t.displayInd})),c=0;c0?o.count/d*f:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:e},m=m+a+8,u.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:u,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}t.exports=function(e,t,r,n){h(r,e,n,t)}}}),ab=p({"src/traces/parcats/plot.js"(e,t){var r=ib();t.exports=function(e,t,n,i){var a=e._fullLayout,o=a._paper,s=a._size;r(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),ob=p({"src/traces/parcats/base_plot.js"(e){var t=_t().getModuleCalcData,r=ab(),n="parcats";e.name=n,e.plot=function(e,i,a,o){var s=t(e.calcdata,n);if(s.length){var l=s[0];r(e,l,a,o)}},e.clean=function(e,t,r,n){var i=n._has&&n._has("parcats"),a=t._has&&t._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),sb=p({"src/traces/parcats/index.js"(e,t){t.exports={attributes:tb(),supplyDefaults:rb(),calc:nb(),plot:ab(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:ob(),categories:["noOpacity"],meta:{}}}}),lb=p({"lib/parcats.js"(e,t){t.exports=sb()}}),cb=p({"src/plots/mapbox/constants.js"(e,t){var r=We(),n="1.13.4",i='\xa9 OpenStreetMap contributors',a=['\xa9 Carto',i].join(" "),o=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,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:a,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:a,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:o,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:o,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:['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),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=r(s);t.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,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@"+n+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}}),ub=p({"src/plots/mapbox/layout_attributes.js"(e,t){var r=st(),n=q().defaultLine,i=ka().attributes,a=D(),o=wn().textposition,s=Le().overrideAll,l=gt().templatedArray,c=cb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.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:l("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:n},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:n}},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:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),hb=p({"src/traces/scattermapbox/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=Wm(),o=wn(),s=ub(),l=N(),c=Lt(),u=R().extendFlat,h=Le().overrideAll,p=ub(),d=a.line,f=a.marker;t.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},p.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:u({},f.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:d.color,width:d.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),pb=p({"src/traces/scattermapbox/constants.js"(e,t){var r=["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"];t.exports={isSupportedFont:function(e){return-1!==r.indexOf(e)}}}}),db=p({"src/traces/scattermapbox/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Xn(),s=Yn(),l=hb(),c=pb().isSupportedFont;t.exports=function(e,t,u,h){function p(n,i){return r.coerce(e,t,l,n,i)}function d(n,i){return r.coerce2(e,t,l,n,i)}var f=function(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}(0,t,p);if(f){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),n.hasMarkers(t)){i(e,t,u,h,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var m=t.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(t)&&(a(e,t,u,h,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),y=d("cluster.step"),v=d("cluster.color",t.marker&&t.marker.color||u),x=d("cluster.size"),b=d("cluster.opacity");if(p("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==b)||n.hasText(t)){var _=h.font.family;o(e,t,h,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(_)?_:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}p("fill"),"none"!==t.fill&&s(e,t,u,p),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),fb=p({"src/traces/scattermapbox/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),mb=p({"src/plots/mapbox/convert_text_opts.js"(e,t){var r=st();t.exports=function(e,t){var n=e.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),gb=p({"src/traces/scattermapbox/convert.js"(e,t){var r=k(),n=st(),i=T().BADNUM,a=Qm(),o=Wt(),s=Jt(),l=Zt(),c=$t(),u=pb().isSupportedFont,h=mb(),p=Xt().appendArrayPointValue,d=At().NEWLINES,f=At().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return n.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}function x(e,t){var r;if(n.isArrayOrTypedArray(e)&&n.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}t.exports=function(e,t){var i,u=t[0].trace,_=!0===u.visible&&0!==u._length,w="none"!==u.fill,k=c.hasLines(u),T=c.hasMarkers(u),S=c.hasText(u),A=T&&"circle"===u.marker.symbol,M=T&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),P=m("line"),L=m("circle"),I=m("symbol"),z={fill:C,line:P,circle:L,symbol:I};if(!_)return z;if((w||k)&&(i=a.calcTraceToLineCoords(t)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),k&&(P.geojson=a.makeLine(i),P.layout.visibility="visible",n.extendFlat(P.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),A){var O=function(e){var t,i,a,c,u=e[0].trace,h=u.marker,p=u.selectedpoints,d=n.isArrayOrTypedArray(h.color),f=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(e){return u.opacity*e}function y(e){return e/2}d&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),f&&(a=l(u)),m&&(c=function(e){return g(r(e)?+n.constrain(e,0,1):0)});var x,b=[];for(t=0;t=0;r--){var n=t[r];i.removeLayer(u.layerIds[n])}e||i.removeSource(u.sourceIds.circle)}(e):function(e){for(var t=a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n]),e||i.removeSource(u.sourceIds[n])}}(e)}function p(e){l?function(e){e||u.addSource("circle",o.circle,t.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},t.exports=function(e,t){var r,i,s,l=t[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(e,l.uid,c,u),p=n(e.gd,t),d=h.below=e.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",p.circle,l.cluster),r=0;r")}function u(e){return e+"\xb0"}}t.exports={hoverPoints:function(e,t,a){var c=e.cd,u=c[0].trace,h=e.xa,p=e.ya,d=e.subplot,f=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=d.map.queryRenderedFeatures(null,{layers:[m]});f=y.map((function(e){return e.id}))}var v=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-v;if(r.getClosest(c,(function(e){var t=e.lonlat;if(t[0]===o)return 1/0;if(g&&-1===f.indexOf(e.i+1))return 1/0;var r=n.modHalf(t[0],360),i=t[1],s=d.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-p.c2p([r,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),e),!1!==e.index){var b=c[e.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],k=h.c2p(w),T=p.c2p(w),S=b.mrc||1;e.x0=k-S,e.x1=k+S,e.y0=T-S,e.y1=T+S;var A={};A[u.subplot]={_subplot:d};var M=u._module.formatLabels(b,u,A);return e.lonLabel=M.lonLabel,e.latLabel=M.latLabel,e.color=i(u,b),e.extraText=l(u,b,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}},getExtraText:l}}}),xb=p({"src/traces/scattermapbox/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),bb=p({"src/traces/scattermapbox/select.js"(e,t){var r=st(),n=$t(),i=T().BADNUM;t.exports=function(e,t){var a,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===t)for(a=0;a(n=1))return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var s="undefined"!==typeof self?self:{},l=Math.pow(2,53)-1;function c(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}var u=c(.25,.1,.25,1);function h(e,t,r){return Math.min(r,Math.max(t,e))}function p(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function d(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function y(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function v(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function x(e,t){return-1!==e.indexOf(t,e.length-t.length)}function b(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function _(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function w(e){return Array.isArray(e)?e.map(w):"object"===typeof e&&e?b(e,w):e}var k={};function T(e){k[e]||("undefined"!==typeof console&&console.warn(e),k[e]=!0)}function S(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function A(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,r,n,i){var a=n||i;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var C=null;function P(e){if(null==C){var t=e.navigator?e.navigator.userAgent:null;C=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return C}function L(e){try{var t=s[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}var I,z,O,R,D=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,F=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,B={now:D,frame:function(e){var t=j(e);return{cancel:function(){return F(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return I||(I=s.document.createElement("a")),I.href=e,I.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(e){!V&&R&&(q?H(e):O=e)}},V=!1,q=!1;function H(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,R),e.isContextLost())return;U.supported=!0}catch(r){}e.deleteTexture(t),V=!0}s.document&&((R=s.document.createElement("img")).onload=function(){O&&H(O),O=null,q=!0},R.onerror=function(){V=!0,O=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",W=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function $(e){return 0===e.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var e=function(){for(var e="",t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},W.prototype.normalizeStyleURL=function(e,t){if(!$(e))return e;var r=K(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeGlyphsURL=function(e,t){if(!$(e))return e;var r=K(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeSourceURL=function(e,t){if(!$(e))return e;var r=K(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeSpriteURL=function(e,t,r,n){var i=K(e);return $(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,J(i))},W.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!$(e))return e;var r=K(e),n=B.devicePixelRatio>=2||512===t?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(e){for(var t=0,r=e;t=0&&e.params.splice(i,1)}if("/"!==n.path&&(e.path=""+n.path+e.path),!N.REQUIRE_ACCESS_TOKEN)return J(e);if(!(t=t||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),J(e)};var Z=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(e){return Z.test(e)}var Y=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(e){var t=e.match(Y);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function J(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}var Q="mapbox.eventData";function ee(e){if(!e)return null;var t,r=e.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((t=r[1],decodeURIComponent(s.atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(n){return null}}var te=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};te.prototype.getStorageKey=function(e){var t,r=ee(N.ACCESS_TOKEN),n="";return r&&r.u?(t=r.u,n=s.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))):n=N.ACCESS_TOKEN||"",e?Q+"."+e+":"+n:Q+":"+n},te.prototype.fetchEventData=function(){var e=L("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var n=s.localStorage.getItem(t);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(a){T("Unable to read from LocalStorage")}},te.prototype.saveEventData=function(){var e=L("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){T("Unable to write to LocalStorage")}},te.prototype.processRequests=function(e){},te.prototype.postEvent=function(e,t,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=t?d(s,t):s,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Se(c,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},te.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var re,ne,ie=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return $(e)||X(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(te),ae=new(function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return $(e)||X(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=ee(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=n)}),e)}},t}(te)),oe=ae.postTurnstileEvent.bind(ae),se=new ie,le=se.postMapLoadEvent.bind(se),ce="mapbox-tiles",ue=500,he=50;function pe(){s.caches&&!re&&(re=s.caches.open(ce))}function de(e,t,r){if(pe(),re){var n={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=E(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(e,t){if(void 0===ne)try{new Response(new ReadableStream),ne=!0}catch(r){ne=!1}ne?t(e.body):e.blob().then(t)}(t,(function(t){var r=new s.Response(t,n);pe(),re&&re.then((function(t){return t.put(fe(e.url),r)})).catch((function(e){return T(e.message)}))})))}}function fe(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function me(e,t){if(pe(),!re)return t(null);var r=fe(e.url);re.then((function(e){e.match(r).then((function(n){var i=function(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),r=E(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(n);e.delete(r),i&&e.put(r,n.clone()),t(null,n,i)})).catch(t)})).catch(t)}var ge,ye=1/0;function ve(){return null==ge&&(ge=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"===typeof s.createImageBitmap),ge}var xe={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(xe);var be=function(e){function t(t,r,n){401===r&&X(n)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,t),this.status=r,this.url=n,this.name=this.constructor.name,this.message=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),_e=M()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function we(e,t){var r,n=new s.AbortController,i=new s.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:_e(),signal:n.signal}),a=!1,o=!1,l=(r=i.url).indexOf("sku=")>0&&X(r);"json"===e.type&&i.headers.set("Accept","application/json");var c=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&T(r),n&&a)return u(n);var c=Date.now();s.fetch(i).then((function(r){if(r.ok){var n=l?r.clone():null;return u(r,n,c)}return t(new be(r.statusText,r.status,e.url))})).catch((function(e){20!==e.code&&t(new Error(e.message))}))}},u=function(r,n,s){("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((function(e){o||(n&&s&&de(i,n,s),a=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(e){o||t(new Error(e.message))}))};return l?me(i,c):c(null,null),{cancel:function(){o=!0,a||n.abort()}}}var ke=function(e,t){if(r=e.url,!(/^file:/.test(r)||/^file:/.test(_e())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return we(e,t);if(M()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){var r=new s.XMLHttpRequest;for(var n in r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer"),e.headers)r.setRequestHeader(n,e.headers[n]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new be(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}(e,t)},Te=function(e,t){return ke(d(e,{type:"arrayBuffer"}),t)},Se=function(e,t){return ke(d(e,{method:"POST"}),t)};function Ae(e){var t=s.document.createElement("a");return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var Me,Ee,Ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Me=[],Ee=0;var Pe=function(e,t){if(U.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Ee>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return Me.push(r),r}Ee++;var n=!1,i=function(){if(!n)for(n=!0,Ee--;Me.length&&Ee0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},Re.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var De={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},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:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},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"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},je=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function Fe(e){var t=e.key,r=e.value;return r?[new je(t,r,"constants have been deprecated as of v8")]:[]}function Be(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var rt=[He,Ge,We,$e,Ze,Je,Xe,et(Ye),Qe];function nt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!nt(e.itemType,t.itemType))&&("number"!==typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=rt;r255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{t.parseCSSColor=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),p=1;switch(u){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),m=o(h[2]),g=m<=.5?m*(f+1):m+f-m*f,y=2*m-g;return[n(255*s(y,g,d+1/3)),n(255*s(y,g,d)),n(255*s(y,g,d-1/3)),p];default:return null}}return null}}catch(l){}})).parseCSSColor,st=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};st.parse=function(e){if(e){if(e instanceof st)return e;if("string"===typeof e){var t=ot(e);if(t)return new st(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},st.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},st.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},st.black=new st(0,0,0,1),st.white=new st(1,1,1,1),st.transparent=new st(0,0,0,0),st.red=new st(1,0,0,1);var lt=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};lt.prototype.compare=function(e,t){return this.collator.compare(e,t)},lt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ct=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},ut=function(e){this.sections=e};ut.fromString=function(e){return new ut([new ct(e,null,null,null,null)])},ut.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},ut.factory=function(e){return e instanceof ut?e:ut.fromString(e)},ut.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},ut.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function dt(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof st)return!0;if(e instanceof lt)return!0;if(e instanceof ut)return!0;if(e instanceof ht)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!==typeof s||!(s in vt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=vt[s],n++}else a=Ye;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=et(a,o)}else r=vt[i];for(var l=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var bt=function(e){this.type=Je,this.sections=e};bt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,Ge)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,et(We))))return null;var c=null;if(o["text-color"]&&!(c=t.parse(o["text-color"],1,Ze)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=t.parse(e[a],1,Ye);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new bt(n)},bt.prototype.evaluate=function(e){return new ut(this.sections.map((function(t){var r=t.content.evaluate(e);return ft(r)===Qe?new ct("",r,null,null,null):new ct(mt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},bt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},_t.prototype.eachChild=function(e){e(this.input)},_t.prototype.outputDefined=function(){return!1},_t.prototype.serialize=function(){return["image",this.input.serialize()]};var wt={"to-boolean":$e,"to-color":Ze,"to-number":Ge,"to-string":We},kt=function(e,t){this.type=e,this.args=t};kt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=wt[r],i=[],a=1;a4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":pt(t[0],t[1],t[2],t[3])))return new st(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new yt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function Lt(e,t){var r,n=(180+e[0])/360,i=(r=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,t.z);return[Math.round(n*a*Et),Math.round(i*a*Et)]}function It(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function zt(e,t){for(var r,n,i,a=!1,o=0,s=t.length;or[1]!==i[1]>r[1]&&r[0]<(i[0]-n[0])*(r[1]-n[1])/(i[1]-n[1])+n[0]&&(a=!a)}return a}function Ot(e,t){for(var r=0;r0&&h<0||u<0&&h>0}function Dt(e,t,r,n){var i,a,o=[t[0]-e[0],t[1]-e[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!==(i=s)[0]*(a=o)[1]-i[1]*a[0]&&!(!Rt(e,t,r,n)||!Rt(r,n,e,t))}function jt(e,t,r){for(var n=0,i=r;nr[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}Ct(t,e)}function qt(e,t,r,n){for(var i=Math.pow(2,n.z)*Et,a=[n.x*Et,n.y*Et],o=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Zt(e,t)&&(r=!1)})),r}Gt.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(dt(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new yt("Input is not a number.");o=s-1}return 0}Yt.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Yt.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new xt(t,[e]):"coerce"===r?new kt(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof gt)&&"resolvedImage"!==a.type.kind&&Kt(a)){var l=new St;try{a=new gt(a.type,a.evaluate(l))}catch(c){return this.error(c.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?this.error("'undefined' value invalid. Use null instead."):"object"===typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Yt.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Yt(this.registry,n,t||null,i,this.errors)},Yt.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new Ve(n,e))},Yt.prototype.checkSubtype=function(e,t){var r=nt(e,t);return r&&this.error(r),r};var Qt=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=t.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Qt(i,r,n)},Qt.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Jt(t,n)].evaluate(e)},Qt.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var tr=Object.freeze({__proto__:null,number:er,color:function(e,t,r){return new st(er(e.r,t.r,r),er(e.g,t.g,r),er(e.b,t.b,r),er(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return er(e,t[n],r)}))}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,cr=180/Math.PI;function ur(e){return e>sr?Math.pow(e,1/3):e/or+ir}function hr(e){return e>ar?e*e*e:or*(e-ir)}function pr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function dr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function fr(e){var t=dr(e.r),r=dr(e.g),n=dr(e.b),i=ur((.4124564*t+.3575761*r+.1804375*n)/rr),a=ur((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-ur((.0193339*t+.119192*r+.9503041*n)/nr)),alpha:e.a}}function mr(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*hr(t),r=rr*hr(r),n=nr*hr(n),new st(pr(3.2404542*r-1.5371385*t-.4985314*n),pr(-.969266*r+1.8760108*t+.041556*n),pr(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function gr(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:fr,reverse:mr,interpolate:function(e,t,r){return{l:er(e.l,t.l,r),a:er(e.a,t.a,r),b:er(e.b,t.b,r),alpha:er(e.alpha,t.alpha,r)}}},vr={forward:function(e){var t=fr(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*cr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}},reverse:function(e){var t=e.h*lr,r=e.c;return mr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:gr(e.h,t.h,r),c:er(e.c,t.c,r),l:er(e.l,t.l,r),alpha:er(e.alpha,t.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:vr}),br=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,Ge)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ze:t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var u=0;u=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=t.parse(p,f,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"===typeof c.N?new br(c,r,n,i,l):t.error("Type "+tt(c)+" is not interpolatable.")},br.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Jt(t,n),o=t[a],s=t[a+1],l=br.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(e),u=r[a+1].evaluate(e);return"interpolate"===this.operator?tr[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?vr.reverse(vr.interpolate(vr.forward(c),vr.forward(u),l)):yr.reverse(yr.interpolate(yr.forward(c),yr.forward(u),l))},br.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new yt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new yt("Array index must be an integer, but found "+t+" instead.");return r[t]},Tr.prototype.eachChild=function(e){e(this.index),e(this.input)},Tr.prototype.outputDefined=function(){return!1},Tr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Sr=function(e,t){this.type=$e,this.needle=e,this.haystack=t};Sr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ye),n=t.parse(e[2],2,Ye);return r&&n?it(r.type,[$e,We,Ge,He,Ye])?new Sr(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+tt(r.type)+" instead"):null},Sr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!at(t,["boolean","string","number","null"]))throw new yt("Expected first argument to be of type boolean, string, number or null, but found "+tt(ft(t))+" instead.");if(!at(r,["string","array"]))throw new yt("Expected second argument to be of type array or string, but found "+tt(ft(r))+" instead.");return r.indexOf(t)>=0},Sr.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Sr.prototype.outputDefined=function(){return!0},Sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ar=function(e,t,r){this.type=Ge,this.needle=e,this.haystack=t,this.fromIndex=r};Ar.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ye),n=t.parse(e[2],2,Ye);if(!r||!n)return null;if(!it(r.type,[$e,We,Ge,He,Ye]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+tt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,Ge);return i?new Ar(r,n,i):null}return new Ar(r,n)},Ar.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!at(t,["boolean","string","number","null"]))throw new yt("Expected first argument to be of type boolean, string, number or null, but found "+tt(ft(t))+" instead.");if(!at(r,["string","array"]))throw new yt("Expected second argument to be of type array or string, but found "+tt(ft(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},Ar.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Mr.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;oNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ft(p)))return null}else r=ft(p);if("undefined"!==typeof i[String(p)])return c.error("Branch labels must be unique.");i[String(p)]=a.length}var d=t.parse(l,o,n);if(!d)return null;n=n||d.type,a.push(d)}var f=t.parse(e[1],1,Ye);if(!f)return null;var m=t.parse(e[e.length-1],e.length-1,n);return m?"value"!==f.type.kind&&t.concat(1).checkSubtype(r,f.type)?null:new Mr(r,n,f,i,a,m):null},Mr.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ft(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Mr.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Mr.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},Mr.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ye),n=t.parse(e[2],2,Ge);if(!r||!n)return null;if(!it(r.type,[et(Ye),We,Ye]))return t.error("Expected first argument to be of type array or string, but found "+tt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,Ge);return i?new Cr(r.type,r,n,i):null}return new Cr(r.type,r,n)},Cr.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!at(t,["string","array"]))throw new yt("Expected first argument to be of type array or string, but found "+tt(ft(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Cr.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Cr.prototype.outputDefined=function(){return!1},Cr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zr=Ir("==",(function(e,t,r){return t===r}),Lr),Or=Ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Lr(0,t,r,n)})),Rr=Ir("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),jr=Ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Fr=Ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),Br=function(e,t,r,n,i){this.type=We,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Br.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ge);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,We)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,We)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,Ge)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,Ge))?null:new Br(r,i,a,o,s)},Br.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Br.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Br.prototype.outputDefined=function(){return!1},Br.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Nr=function(e){this.type=Ge,this.input=e};Nr.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+tt(r.type)+" instead."):new Nr(r):null},Nr.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"===typeof t)return t.length;if(Array.isArray(t))return t.length;throw new yt("Expected value to be of type string or array, but found "+tt(ft(t))+" instead.")},Nr.prototype.eachChild=function(e){e(this.input)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Ur={"==":zr,"!=":Or,">":Dr,"<":Rr,">=":Fr,"<=":jr,array:xt,at:Tr,boolean:xt,case:Er,coalesce:wr,collator:Mt,format:bt,image:_t,in:Sr,"index-of":Ar,interpolate:br,"interpolate-hcl":br,"interpolate-lab":br,length:Nr,let:kr,literal:gt,match:Mr,number:xt,"number-format":Br,object:xt,slice:Cr,step:Qt,string:xt,"to-boolean":kt,"to-color":kt,"to-number":kt,"to-string":kt,var:Xt,within:Gt};function Vr(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=pt(r,n,i,o);if(s)throw new yt(s);return new st(r/255*o,n/255*o,i/255*o,o)}function qr(e,t){return e in t}function Hr(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Gr(e){return{type:e}}function Wr(e){return{result:"success",value:e}}function $r(e){return{result:"error",value:e}}function Zr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Xr(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Yr(e){return!!e.expression&&e.expression.interpolated}function Kr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Jr(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function Qr(e){return e}function en(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"===typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,c=e.type||(Yr(t)?"exponential":"interval");if(a&&((e=Be({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],st.parse(e[1])]}))),e.default?e.default=st.parse(e.default):e.default=st.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!xr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)r=an;else if("interval"===c)r=nn;else if("categorical"===c){r=rn,n=Object.create(null);for(var u=0,h=e.stops;u=e.stops[n-1][0])return e.stops[n-1][1];var i=Jt(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function an(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Kr(r))return tn(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Jt(e.stops.map((function(e){return e[0]})),r),o=function(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=tr[t.type]||Qr;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=xr[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function on(e,t,r){return"color"===t.type?r=st.parse(r):"formatted"===t.type?r=ut.fromString(r.toString()):"resolvedImage"===t.type?r=ht.fromString(r.toString()):Kr(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),tn(r,e.default,t.default)}At.register(Ur,{error:[{kind:"error"},[We],function(e,t){var r=t[0];throw new yt(r.evaluate(e))}],typeof:[We,[Ye],function(e,t){return tt(ft(t[0].evaluate(e)))}],"to-rgba":[et(Ge,4),[Ze],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ze,[Ge,Ge,Ge],Vr],rgba:[Ze,[Ge,Ge,Ge,Ge],Vr],has:{type:$e,overloads:[[[We],function(e,t){return qr(t[0].evaluate(e),e.properties())}],[[We,Xe],function(e,t){var r=t[0],n=t[1];return qr(r.evaluate(e),n.evaluate(e))}]]},get:{type:Ye,overloads:[[[We],function(e,t){return Hr(t[0].evaluate(e),e.properties())}],[[We,Xe],function(e,t){var r=t[0],n=t[1];return Hr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[Ye,[We],function(e,t){return Hr(t[0].evaluate(e),e.featureState||{})}],properties:[Xe,[],function(e){return e.properties()}],"geometry-type":[We,[],function(e){return e.geometryType()}],id:[Ye,[],function(e){return e.id()}],zoom:[Ge,[],function(e){return e.globals.zoom}],"heatmap-density":[Ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[Ye,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[Ge,Gr(Ge),function(e,t){for(var r=0,n=0,i=t;n":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[$e,[Ye],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[$e,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[$e,[et(We)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[$e,[et(Ye)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[$e,[We,et(Ye)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[$e,[We,et(Ye)],function(e,t){var r=t[0],n=t[1];return function(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:$e,overloads:[[[$e,$e],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Gr($e),function(e,t){for(var r=0,n=t;r0&&"string"===typeof e[0]&&e[0]in Ur}function cn(e,t){var r=new Yt(Ur,[],t?function(e){var t={color:Ze,string:We,number:Ge,enum:We,boolean:$e,formatted:Je,resolvedImage:Qe};return"array"===e.type?et(t[e.value]||Ye,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Wr(new sn(n,t)):$r(r.errors)}sn.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},sn.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new yt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var un=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!$t(t.expression)};un.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},un.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var hn=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!$t(t.expression),this.interpolationType=n};function pn(e,t){if("error"===(e=cn(e,t)).result)return e;var r=e.value.expression,n=Wt(r);if(!n&&!Zr(t))return $r([new Ve("","data expressions not supported")]);var i=Zt(r,["zoom"]);if(!i&&!Xr(t))return $r([new Ve("","zoom expressions not supported")]);var a=fn(r);if(!a&&!i)return $r([new Ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ve)return $r([a]);if(a instanceof br&&!Yr(t))return $r([new Ve("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Wr(new un(n?"constant":"source",e.value));var o=a instanceof br?a.interpolation:void 0;return Wr(new hn(n?"camera":"composite",e.value,a.labels,o))}hn.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},hn.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},hn.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?br.interpolationFactor(this.interpolationType,e,t,r):0};var dn=function(e,t){this._parameters=e,this._specification=t,Be(this,en(this._parameters,this._specification))};function fn(e){var t=null;if(e instanceof kr)t=fn(e.result);else if(e instanceof wr)for(var r=0,n=e.args;rn.maximum?[new je(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function vn(e){var t,r,n,i=e.valueSpec,a=Ne(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,c="array"===Kr(e.value.stops)&&"array"===Kr(e.value.stops[0])&&"object"===Kr(e.value.stops[0][0]),u=mn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new je(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(gn({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===Kr(r)&&0===r.length&&t.push(new je(e.key,r,"array must have at least one stop")),t},default:function(e){return Vn({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&u.push(new je(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||u.push(new je(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Yr(e.valueSpec)&&u.push(new je(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Zr(e.valueSpec)?u.push(new je(e.key,e.value,"property functions not supported")):s&&!Xr(e.valueSpec)&&u.push(new je(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==e.value.property||u.push(new je(e.key,e.value,'"property" property is required')),u;function h(e){var t=[],a=e.value,s=e.key;if("array"!==Kr(a))return[new je(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new je(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Kr(a[0]))return[new je(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new je(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new je(s,a,"object stop key must have value")];if(n&&n>Ne(a[0].zoom))return[new je(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ne(a[0].zoom)!==n&&(n=Ne(a[0].zoom),r=void 0,o={}),t=t.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:yn,value:p}}))}else t=t.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return ln(Ue(a[1]))?t.concat([new je(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function p(e,n){var s=Kr(e.value),l=Ne(e.value),c=null!==e.value?e.value:n;if(t){if(s!==t)return[new je(e.key,c,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new je(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Zr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new je(e.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!==typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);tt?1:0}function Sn(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===r||"<="===r||">="===r?Mn(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(An))):"all"===r?["all"].concat(e.slice(1).map(An)):"none"===r?["all"].concat(e.slice(1).map(An).map(Pn)):"in"===r?En(e[1],e.slice(2)):"!in"===r?Pn(En(e[1],e.slice(2))):"has"===r?Cn(e[1]):"!has"===r?Pn(Cn(e[1])):"within"!==r||e}function Mn(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function En(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Tn)]]:["filter-in-small",e,["literal",t]]}}function Cn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Pn(e){return["!",e]}function Ln(e){return _n(Ue(e.value))?xn(Be({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):In(e)}function In(e){var t=e.value,r=e.key;if("array"!==Kr(t))return[new je(r,t,"array expected, "+Kr(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new je(r,t,"filter array must have at least 1 element")];switch(a=a.concat(bn({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ne(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Ne(t[1])&&a.push(new je(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new je(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=Kr(t[1]))&&a.push(new je(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o=u[d+0]&&n>=u[d+1])?(o[p]=!0,a.push(c[p])):o[p]=!1}}},ei.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=l;p<=u;p++)for(var d=c;d<=h;d++){var f=this.d*d+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&i.call(this,e,t,r,n,f,a,o,s))return}},ei.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ei.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ei.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=Qn+this.cells.length+1+1,r=0,n=0;n=0)){var h=e[u];c[u]=ni[l].shallow.indexOf(u)>=0?h:li(h,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function ci(e){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||oi(e)||si(e)||ArrayBuffer.isView(e)||e instanceof ti)return e;if(Array.isArray(e))return e.map(ci);if("object"===typeof e){var t=e.$name||"Object",r=ni[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i=0?s:ci(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var ui=function(){this.first=!0};ui.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function pi(e){for(var t=0,r=e;t=65097&&e<=65103)||!!hi["CJK Compatibility Ideographs"](e)||!!hi["CJK Compatibility"](e)||!!hi["CJK Radicals Supplement"](e)||!!hi["CJK Strokes"](e)||!(!hi["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!hi["CJK Unified Ideographs Extension A"](e)||!!hi["CJK Unified Ideographs"](e)||!!hi["Enclosed CJK Letters and Months"](e)||!!hi["Hangul Compatibility Jamo"](e)||!!hi["Hangul Jamo Extended-A"](e)||!!hi["Hangul Jamo Extended-B"](e)||!!hi["Hangul Jamo"](e)||!!hi["Hangul Syllables"](e)||!!hi.Hiragana(e)||!!hi["Ideographic Description Characters"](e)||!!hi.Kanbun(e)||!!hi["Kangxi Radicals"](e)||!!hi["Katakana Phonetic Extensions"](e)||!(!hi.Katakana(e)||12540===e)||!(!hi["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!hi["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!hi["Unified Canadian Aboriginal Syllabics"](e)||!!hi["Unified Canadian Aboriginal Syllabics Extended"](e)||!!hi["Vertical Forms"](e)||!!hi["Yijing Hexagram Symbols"](e)||!!hi["Yi Syllables"](e)||!!hi["Yi Radicals"](e))}function mi(e){return!(fi(e)||function(e){return!(!hi["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!hi["General Punctuation"](e)||8214!==e&&8224!==e&&8225!==e&&8240!==e&&8241!==e&&8251!==e&&8252!==e&&8258!==e&&8263!==e&&8264!==e&&8265!==e&&8273!==e)||!!hi["Letterlike Symbols"](e)||!!hi["Number Forms"](e)||!(!hi["Miscellaneous Technical"](e)||!(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215))||!(!hi["Control Pictures"](e)||9251===e)||!!hi["Optical Character Recognition"](e)||!!hi["Enclosed Alphanumerics"](e)||!!hi["Geometric Shapes"](e)||!(!hi["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!hi["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!hi["CJK Symbols and Punctuation"](e)||!!hi.Katakana(e)||!!hi["Private Use Area"](e)||!!hi["CJK Compatibility Forms"](e)||!!hi["Small Form Variants"](e)||!!hi["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}(e))}function gi(e){return hi.Arabic(e)||hi["Arabic Supplement"](e)||hi["Arabic Extended-A"](e)||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e)}function yi(e){return e>=1424&&e<=2303||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e)}function vi(e,t){return!(!t&&yi(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||hi.Khmer(e))}function xi(e){for(var t=0,r=e;t-1&&(Si=ki),Ti&&Ti(e)};function Ei(){Ci.fire(new ze("pluginStateChange",{pluginStatus:Si,pluginURL:Ai}))}var Ci=new Re,Pi=function(){return Si},Li=function(){if(Si!==bi||!Ai)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Si=_i,Ei(),Ai&&Te({url:Ai},(function(e){e?Mi(e):(Si=wi,Ei())}))},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Si===wi||null!=Ii.applyArabicShaping},isLoading:function(){return Si===_i},setState:function(e){Si=e.pluginStatus,Ai=e.pluginURL},isParsed:function(){return null!=Ii.applyArabicShaping&&null!=Ii.processBidirectionalText&&null!=Ii.processStyledBidirectionalText},getPluginURL:function(){return Ai}},zi=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ui,this.transition={})};zi.prototype.isSupportedScript=function(e){return function(e,t){for(var r=0,n=e;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Oi=function(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Jr(e))return new dn(e,t);if(ln(e)){var r=pn(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=st.parse(e)),{kind:"constant",evaluate:function(){return n}}}(void 0===t?e.specification.default:t,e.specification)};Oi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Oi.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Ri=function(e){this.property=e,this.value=new Oi(e,void 0)};Ri.prototype.transitioned=function(e,t){return new ji(this.property,this.value,t,d({},e.transition,this.transition),e.now)},Ri.prototype.untransitioned=function(){return new ji(this.property,this.value,null,{},0)};var Di=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Di.prototype.getValue=function(e){return w(this._values[e].value.value)},Di.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ri(this._values[e].property)),this._values[e].value=new Oi(this._values[e].property,null===t?void 0:w(t))},Di.prototype.getTransition=function(e){return w(this._values[e].transition)},Di.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ri(this._values[e].property)),this._values[e].transition=w(t)||void 0},Di.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}return i};var Fi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Fi.prototype.possiblyEvaluate=function(e,t,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(qi),Gi=function(e){this.specification=e};Gi.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new zi(Math.floor(t.zoom-1),t)),e.expression.evaluate(new zi(Math.floor(t.zoom),t)),e.expression.evaluate(new zi(Math.floor(t.zoom+1),t)),t)}},Gi.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Gi.prototype.interpolate=function(e){return e};var Wi=function(e){this.specification=e};Wi.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},Wi.prototype.interpolate=function(){return!1};var $i=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Oi(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new Ri(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",qi),ii("DataConstantProperty",Vi),ii("CrossFadedDataDrivenProperty",Hi),ii("CrossFadedProperty",Gi),ii("ColorRampProperty",Wi);var Zi="-transition",Xi=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new Bi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Di(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ui(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(Yn,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return x(e,Zi)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(Xn,n,e,t,r))return!1}if(x(e,Zi))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),_(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Kn(this,e.call($n,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:De,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof Ni&&Zr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(Re),Yi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ki=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ji=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Qi(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i,a=(i=e.type,Yi[i].BYTES_PER_ELEMENT),o=r=ea(r,Math.max(t,a)),s=e.components||1;return n=Math.max(n,a),r+=a*s,{name:e.name,type:e.type,components:s,offset:o}})),size:ea(r,Math.max(n,t)),alignment:t}}function ea(e,t){return Math.ceil(e/t)*t}Ji.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Ji.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Ji.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ji.prototype.clear=function(){this.length=0},Ji.prototype.resize=function(e){this.reserve(e),this.length=e},Ji.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ta=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(Ji);ta.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ta);var ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(Ji);ra.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ra);var na=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ji);na.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",na);var ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(Ji);ia.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",ia);var aa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(Ji);aa.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",aa);var oa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l,c)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u){var h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e},t}(Ji);oa.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",oa);var sa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c,u,h){var p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,i,a,o,s,l,c,u,h)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,p){var d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,e},t}(Ji);sa.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",sa);var la=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(Ji);la.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",la);var ca=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(Ji);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);var ua=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c){var u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e},t}(Ji);ua.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",ua);var ha=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ji);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",ha);var pa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(Ji);pa.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",pa);var da=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(Ji);da.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",da);var fa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(Ji);fa.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",fa);var ma=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y){var v=24*e,x=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e},t}(Ji);ma.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ma);var ga=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M){var E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E){var C=34*e,P=17*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=k,this.uint32[P+12]=T,this.float32[P+13]=S,this.float32[P+14]=A,this.float32[P+15]=M,this.float32[P+16]=E,e},t}(Ji);ga.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",ga);var ya=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(Ji);ya.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",ya);var va=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(Ji);va.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",va);var xa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(Ji);xa.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",xa);var ba=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(Ji);ba.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",ba);var _a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(Ji);_a.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",_a);var wa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(Ji);wa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",wa);var ka=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(Ki);ka.prototype.size=20;var Ta=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new ka(this,e)},t}(ua);ii("CollisionBoxArray",Ta);var Sa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(Ki);Sa.prototype.size=48;var Aa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Sa(this,e)},t}(ma);ii("PlacedSymbolArray",Aa);var Ma=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(Ki);Ma.prototype.size=68;var Ea=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ma(this,e)},t}(ga);ii("SymbolInstanceArray",Ea);var Ca=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(ya);ii("GlyphOffsetArray",Ca);var Pa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(va);ii("SymbolLineVertexArray",Pa);var La=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(Ki);La.prototype.size=8;var Ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new La(this,e)},t}(xa);ii("FeatureIndexArray",Ia);var za=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,Oa=function(e){void 0===e&&(e=[]),this.segments=e};function Ra(e,t){return 256*(e=h(Math.floor(e),0,255))+(t=h(Math.floor(t),0,255))}Oa.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>Oa.MAX_VERTEX_ARRAY_LENGTH&&T("Max vertices per segment is "+Oa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>Oa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Oa.prototype.get=function(){return this.segments},Oa.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Fa=t((function(e){e.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),Ba=ja,Na=ja,Ua=Fa;Ba.murmur3=Na,Ba.murmur2=Ua;var Va=function(){this.ids=[],this.positions=[],this.indexed=!1};Va.prototype.add=function(e,t,r,n){this.ids.push(Ha(e)),this.positions.push(t,r,n)},Va.prototype.getPositions=function(e){for(var t=Ha(e),r=0,n=this.ids.length-1;r>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Va.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Ga(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},Va.deserialize=function(e){var t=new Va;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var qa=Math.pow(2,53)-1;function Ha(e){var t=+e;return!isNaN(t)&&t<=qa?t:Ba(String(e))}function Ga(e,t,r,n){for(;r>1],a=r-1,o=n+1;;){do{a++}while(e[a]i);if(a>=o)break;Wa(e,a,o),Wa(t,3*a,3*o),Wa(t,3*a+1,3*o+1),Wa(t,3*a+2,3*o+2)}o-ro.x+1||lo.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function yo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?go(e):[]}}function vo(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var xo=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ta,this.indexArray=new fa,this.segments=new Oa,this.programConfigurations=new co(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function bo(e,t){for(var r=0;r1){if(To(e,t))return!0;for(var n=0;n1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Eo(e,t){for(var r,n,i,a=!1,o=0;ot.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Co(e,t){for(var r=!1,n=0,i=e.length-1;nt.y!==o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Po(e,t,r){var n=r[0],i=r[2];if(e.xi.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var a=S(e,t,r[0]);return a!==S(e,t,r[1])||a!==S(e,t,r[2])||a!==S(e,t,r[3])}function Lo(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Io(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function zo(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l=po||u<0||u>=po)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=h.vertexLength;vo(this.layoutVertexArray,c,u,-1,-1),vo(this.layoutVertexArray,c,u,1,-1),vo(this.layoutVertexArray,c,u,1,1),vo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},ii("CircleBucket",xo,{omit:["layers"]});var Oo=new $i({"circle-sort-key":new qi(De.layout_circle["circle-sort-key"])}),Ro={paint:new $i({"circle-radius":new qi(De.paint_circle["circle-radius"]),"circle-color":new qi(De.paint_circle["circle-color"]),"circle-blur":new qi(De.paint_circle["circle-blur"]),"circle-opacity":new qi(De.paint_circle["circle-opacity"]),"circle-translate":new Vi(De.paint_circle["circle-translate"]),"circle-translate-anchor":new Vi(De.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vi(De.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vi(De.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qi(De.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qi(De.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qi(De.paint_circle["circle-stroke-opacity"])}),layout:Oo},Do="undefined"!==typeof Float32Array?Float32Array:Array;function jo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Fo(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*h+w*m,e[1]=x*i+b*l+_*p+w*g,e[2]=x*a+b*c+_*d+w*y,e[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*h+w*m,e[5]=x*i+b*l+_*p+w*g,e[6]=x*a+b*c+_*d+w*y,e[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*h+w*m,e[9]=x*i+b*l+_*p+w*g,e[10]=x*a+b*c+_*d+w*y,e[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*h+w*m,e[13]=x*i+b*l+_*p+w*g,e[14]=x*a+b*c+_*d+w*y,e[15]=x*o+b*u+_*f+w*v,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Bo=Fo,No=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e};function Uo(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}!function(){var e=new Do(3);Do!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0)}(),function(){var e=new Do(4);Do!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var Vo=function(e){var t=e[0],r=e[1];return t*t+r*r},qo=(function(){var e=new Do(2);Do!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(t){e.call(this,t,Ro)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new xo(e)},t.prototype.queryRadius=function(e){var t=e;return Lo("circle-radius",this,t)+Lo("circle-stroke-width",this,t)+Io(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=zo(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(e,t){return e.map((function(e){return Ho(e,t)}))}(l,s),p=u?c*o:c,d=0,f=n;de.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l80*r){n=a=e[0],i=o=e[1];for(var f=r;fa&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ls(p,d,r,n,i,c),d}function os(e,t,r,n,i){var a,o;if(i===Ps(e,t,r,n)>0)for(a=t;a=t;a-=n)o=Ms(a,e[a],e[a+1],o);return o&&_s(o,o.next)&&(Es(o),o=o.next),o}function ss(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==bs(n.prev,n,n.next))n=n.next;else{if(Es(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ls(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=gs(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?us(e,n,i,a):cs(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Es(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?ls(e=hs(ss(e),t,r),t,r,n,i,a,2):2===o&&ps(e,t,r,n,i,a):ls(ss(e),t,r,n,i,a,1);break}}}function cs(e){var t=e.prev,r=e,n=e.next;if(bs(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(vs(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&bs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function us(e,t,r,n){var i=e.prev,a=e,o=e.next;if(bs(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=gs(s,l,t,r,n),p=gs(c,u,t,r,n),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&bs(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&bs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&bs(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&bs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function hs(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!_s(i,a)&&ws(i,n,n.next,a)&&Ss(i,a)&&Ss(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Es(n),Es(n.next),n=e=a),n=n.next}while(n!==e);return ss(n)}function ps(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&xs(o,s)){var l=As(o,s);return o=ss(o,o.next),l=ss(l,l.next),ls(o,t,r,n,i,a),void ls(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function ds(e,t){return e.x-t.x}function fs(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&vs(ar.x||n.x===r.x&&ms(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(e,t),t){var r=As(t,e);ss(t,t.next),ss(r,r.next)}}function ms(e,t){return bs(e.prev,e,t.prev)<0&&bs(t.next,e,e.next)<0}function gs(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ys(e){var t=e,r=e;do{(t.x=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function xs(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&ws(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Ss(e,t)&&Ss(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(bs(e.prev,e,t.prev)||bs(e,t.prev,t))||_s(e,t)&&bs(e.prev,e,e.next)>0&&bs(t.prev,t,t.next)>0)}function bs(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function _s(e,t){return e.x===t.x&&e.y===t.y}function ws(e,t,r,n){var i=Ts(bs(e,t,r)),a=Ts(bs(e,t,n)),o=Ts(bs(r,n,e)),s=Ts(bs(r,n,t));return i!==a&&o!==s||!(0!==i||!ks(e,r,t))||!(0!==a||!ks(e,n,t))||!(0!==o||!ks(r,e,n))||!(0!==s||!ks(r,t,n))}function ks(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ts(e){return e>0?1:e<0?-1:0}function Ss(e,t){return bs(e.prev,e,e.next)<0?bs(e,t,e.next)>=0&&bs(e,e.prev,t)>=0:bs(e,t,e.prev)<0||bs(e,e.next,t)<0}function As(e,t){var r=new Cs(e.i,e.x,e.y),n=new Cs(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(e,t,r,n){var i=new Cs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Es(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Cs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ps(e,t,r,n){for(var i=0,a=t,o=r-n;ar;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Is(e,t,Math.max(r,Math.floor(t-o*l/a+c)),Math.min(n,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],h=r,p=n;for(zs(e,r,t),i(e[n],u)>0&&zs(e,r,n);h0;)p--}0===i(e[r],u)?zs(e,r,p):zs(e,++p,n),p<=t&&(r=p+1),t<=p&&(n=p-1)}}function zs(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Os(e,t){return et?1:0}function Rs(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o1)for(var l=0;l0&&(n+=e[i-1].length,r.holes.push(n))}return r},ns.default=is;var Bs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ta,this.indexArray=new fa,this.indexArray2=new ba,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Oa,this.segments2=new Oa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Bs.prototype.populate=function(e,t,r){this.hasPattern=js("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Gs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Gs.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Gs.types[this.type];function u(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}function Ks(e,t,r){if(3===e){var n=new Zs(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}Xs.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Hs(this._pbf,t,this.extent,this._keys,this._values)};var Js={VectorTile:function(e,t){this.layers=e.readFields(Ks,{},t)},VectorTileFeature:Hs,VectorTileLayer:Zs},Qs=Js.VectorTileFeature.types,el=Math.pow(2,13);function tl(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*el)+o,i*el*2,a*el*2,Math.round(s))}var rl=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new fa,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Oa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function nl(e,t){return e.x===t.x&&(e.x<0||e.x>po)||e.y===t.y&&(e.y<0||e.y>po)}function il(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>po}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>po}))}rl.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=js("fill-extrusion",this.layers,t);for(var n=0,i=e;n=1){var v=f[g-1];if(!nl(y,v)){h.vertexLength+4>Oa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),b=v.dist(y);m+b>32768&&(m=0),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=b,tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var _=h.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Oa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Qs[e.type]){for(var w=[],k=[],T=h.vertexLength,S=0,A=s;S=2&&e[l-1].equals(e[l-2]);)l--;for(var c=0;c0;if(k&&y>c){var S=u.dist(d);if(S>2*h){var A=u.sub(u.sub(d)._mult(h/S)._round());this.updateDistance(d,A),this.addCurrentVertex(A,m,0,0,p),d=A}}var M=d&&f,E=M?r:s?"butt":n;if(M&&"round"===E&&(_i&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_100)v=g.mult(-1);else{var C=_*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(T?-1:1))}this.addCurrentVertex(u,v,0,0,p),this.addCurrentVertex(u,v.mult(-1),0,0,p)}else if("bevel"===E||"fakeround"===E){var P=-Math.sqrt(_*_-1),L=T?P:0,I=T?0:P;if(d&&this.addCurrentVertex(u,m,L,I,p),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),O=1;O2*h){var N=u.add(f.sub(u)._mult(h/B)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,p),u=N}}}}},fl.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,c=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,c,a,!0,-n,i),this.distance>dl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},fl.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,c=.5*(this.lineClips?this.scaledDistance*(dl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},fl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},fl.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},ii("LineBucket",fl,{omit:["layers","patternFeatures"]});var ml=new $i({"line-cap":new Vi(De.layout_line["line-cap"]),"line-join":new qi(De.layout_line["line-join"]),"line-miter-limit":new Vi(De.layout_line["line-miter-limit"]),"line-round-limit":new Vi(De.layout_line["line-round-limit"]),"line-sort-key":new qi(De.layout_line["line-sort-key"])}),gl={paint:new $i({"line-opacity":new qi(De.paint_line["line-opacity"]),"line-color":new qi(De.paint_line["line-color"]),"line-translate":new Vi(De.paint_line["line-translate"]),"line-translate-anchor":new Vi(De.paint_line["line-translate-anchor"]),"line-width":new qi(De.paint_line["line-width"]),"line-gap-width":new qi(De.paint_line["line-gap-width"]),"line-offset":new qi(De.paint_line["line-offset"]),"line-blur":new qi(De.paint_line["line-blur"]),"line-dasharray":new Gi(De.paint_line["line-dasharray"]),"line-pattern":new Hi(De.paint_line["line-pattern"]),"line-gradient":new Wi(De.paint_line["line-gradient"])}),layout:ml},yl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new zi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=d({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(qi),vl=new yl(gl.paint.properties["line-width"].specification);vl.useIntegerZoom=!0;var xl=function(e){function t(t){e.call(this,t,gl),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){if("line-gradient"===e){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression.expression instanceof Qt,this.gradientVersion=(this.gradientVersion+1)%l}},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=vl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new fl(e)},t.prototype.queryRadius=function(e){var t=e,r=bl(Lo("line-width",this,t),Lo("line-gap-width",this,t)),n=Lo("line-offset",this,t);return r/2+Math.abs(n)+Io(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s){var l=zo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*bl(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=function(e,t){for(var r=[],n=new a(0,0),i=0;i=3)for(var a=0;a0?t+2*e:e}var _l=Qi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),wl=Qi([{name:"a_projected_pos",components:3,type:"Float32"}],4),kl=(Qi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Qi([{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"}]),Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Sl=Qi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Al(e,t,r){return e.sections.forEach((function(e){e.text=function(e,t,r){var n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),Ii.applyArabicShaping&&(e=Ii.applyArabicShaping(e)),e}(e.text,t,r)})),e}Qi([{name:"triangle",components:3,type:"Uint16"}]),Qi([{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"}]),Qi([{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",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qi([{type:"Float32",name:"offsetX"}]),Qi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},El=24,Cl=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},Pl=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m},Ll=Il;function Il(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Il.Varint=0,Il.Fixed64=1,Il.Bytes=2,Il.Fixed32=5;var zl=4294967296,Ol=1/zl,Rl="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function Dl(e){return e.type===Il.Bytes?e.readVarint()+e.pos:e.pos+1}function jl(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Fl(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Bl(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Yl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Kl(e,t,r){1===e&&r.readMessage(Jl,t)}function Jl(e,t,r){if(3===e){var n=r.readMessage(Ql,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;t.push({id:i,bitmap:new Xo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ql(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function ec(e){for(var t=0,r=0,n=0,i=e;n=0;p--){var d=o[p];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var f=o.pop();p>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Zl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Yl(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Zl(this.buf,this.pos)+Zl(this.buf,this.pos+4)*zl;return this.pos+=8,e},readSFixed64:function(){var e=Zl(this.buf,this.pos)+Yl(this.buf,this.pos+4)*zl;return this.pos+=8,e},readFloat:function(){var e=Cl(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Cl(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return jl(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Rl?function(e,t,r){return Rl.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128===(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Il.Bytes)return e.push(this.readVarint(t));var r=Dl(this);for(e=e||[];this.pos127;);else if(t===Il.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Il.Fixed32)this.pos+=4;else{if(t!==Il.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Fl(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Pl(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Pl(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&Fl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Il.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Bl,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Nl,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ql,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Ul,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Vl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Hl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Gl,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Wl,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,$l,t)},writeBytesField:function(e,t){this.writeTag(e,Il.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Il.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Il.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Il.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Il.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Il.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Il.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Il.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Il.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Il.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var tc=function(e,t){var r=t.pixelRatio,n=t.version,i=t.stretchX,a=t.stretchY,o=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},rc={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};rc.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},rc.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},rc.tlbr.get=function(){return this.tl.concat(this.br)},rc.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(tc.prototype,rc);var nc=function(e,t){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(e,r,i),this.addImages(t,n,i);var a=ec(i),o=a.w,s=a.h,l=new Yo({width:o||1,height:s||1});for(var c in e){var u=e[c],h=r[c].paddedRect;Yo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var p in t){var d=t[p],f=n[p].paddedRect,m=f.x+1,g=f.y+1,y=d.data.width,v=d.data.height;Yo.copy(d.data,l,{x:0,y:0},{x:m,y:g},d.data),Yo.copy(d.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Yo.copy(d.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Yo.copy(d.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Yo.copy(d.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};nc.prototype.addImages=function(e,t,r){for(var n in e){var i=e[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),t[n]=new tc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},nc.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},nc.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var n=e.tl,i=n[0],a=n[1];r.update(t.data,void 0,{x:i,y:a})}},ii("ImagePosition",tc),ii("ImageAtlas",nc);var ic={horizontal:1,vertical:2,horizontalOnly:3},ac=-17,oc=function(){this.scale=1,this.fontStack="",this.imageName=null};oc.forText=function(e,t){var r=new oc;return r.scale=e||1,r.fontStack=t,r},oc.forImage=function(e){var t=new oc;return t.imageName=e,t};var sc=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function lc(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m){var g,y=sc.fromFeature(e,i);h===ic.vertical&&y.verticalizePunctuation();var v=Ii.processBidirectionalText,x=Ii.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var b=0,_=v(y.toString(),gc(y,c,a,t,n,d,f));b<_.length;b+=1){var w=_[b],k=new sc;k.text=w,k.sections=y.sections;for(var T=0;T0&&F>S&&(S=F)}else{var B=r[M.fontStack],N=B&&B[C];if(N&&N.rect)I=N.rect,L=N.metrics;else{var U=t[M.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}P=(_-M.scale)*El}R?(e.verticalizable=!0,T.push({glyph:C,imageName:z,x:p,y:d+P,vertical:R,scale:M.scale,fontStack:M.fontStack,sectionIndex:E,metrics:L,rect:I}),p+=O*M.scale+c):(T.push({glyph:C,imageName:z,x:p,y:d+P,vertical:R,scale:M.scale,fontStack:M.fontStack,sectionIndex:E,metrics:L,rect:I}),p+=L.advance*M.scale+c)}if(0!==T.length){var q=p-c;f=Math.max(q,f),vc(T,0,T.length-1,g,S)}p=0;var H=a*_+S;k.lineOffset=Math.max(S,w),d+=H,m=Math.max(H,m),++y}else d+=a,++y}var G=d-ac,W=yc(o),$=W.horizontalAlign,Z=W.verticalAlign;(function(e,t,r,n,i,a,o,s,l){var c=(t-r)*i,u=0;u=a!==o?-s*n-ac:(-n*l+.5)*o;for(var h=0,p=e;h=0&&n>=e&&cc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},sc.prototype.substring=function(e,t){var r=new sc;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},sc.prototype.toString=function(){return this.text},sc.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},sc.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(oc.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var cc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},uc={};function hc(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*El/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function pc(e,t,r,n){var i=Math.pow(e-t,2);return n?e=0,h=0,p=0;p-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(p)}return!0}function Mc(e){for(var t=0,r=0;rc){var f=(c-l)/d,m=er(h.x,p.x,f),g=er(h.y,p.y,f),y=new bc(m,g,p.angleTo(h),u);return y._round(),!o||Ac(e,y,s,o,t)?y:void 0}l+=d}}function Lc(e,t,r,n,i,a,o,s,l){var c=Ec(n,a,o),u=Cc(n,i),h=u*o,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h=0&&b=0&&_=0&&p+c<=u){var w=new bc(b,_,v,f);w._round(),n&&!Ac(e,w,a,n,i)||d.push(w)}}h+=y}return s||d.length||o||(d=Ic(e,h/2,r,n,i,a,o,!0,l)),d}function zc(e,t,r,n,i){for(var o=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new a(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round():p.x>=n&&(p=new a(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round()),h.y>=i&&p.y>=i||(h.y>=i?h=new a(h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round():p.y>=i&&(p=new a(h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(p)))))}return o}function Oc(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=e.right-e.left,h=e.bottom-e.top,p=o.stretchX||[[0,l]],d=o.stretchY||[[0,c]],f=function(e,t){return e+t[1]-t[0]},m=p.reduce(f,0),g=d.reduce(f,0),y=l-m,v=c-g,x=0,b=m,_=0,w=g,k=0,T=y,S=0,A=v;if(o.content&&n){var M=o.content;x=Rc(p,0,M[0]),_=Rc(d,0,M[1]),b=Rc(p,M[0],M[2]),w=Rc(d,M[1],M[3]),k=M[0]-x,S=M[1]-_,T=M[2]-M[0]-b,A=M[3]-M[1]-w}var E=function(n,i,l,c){var p=jc(n.stretch-x,b,u,e.left),d=Fc(n.fixed-k,T,n.stretch,m),f=jc(i.stretch-_,w,h,e.top),y=Fc(i.fixed-S,A,i.stretch,g),v=jc(l.stretch-x,b,u,e.left),M=Fc(l.fixed-k,T,l.stretch,m),E=jc(c.stretch-_,w,h,e.top),C=Fc(c.fixed-S,A,c.stretch,g),P=new a(p,f),L=new a(v,f),I=new a(v,E),z=new a(p,E),O=new a(d/s,y/s),R=new a(M/s,C/s),D=t*Math.PI/180;if(D){var j=Math.sin(D),F=Math.cos(D),B=[F,-j,j,F];P._matMult(B),L._matMult(B),z._matMult(B),I._matMult(B)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:P,tr:L,bl:z,br:I,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/s/u,minFontScaleY:A/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Dc(p,y,m),P=Dc(d,v,g),L=0;L0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var b=new a(y,m),_=new a(v,m),w=new a(y,g),k=new a(v,g),T=u*Math.PI/180;b._rotate(T),_._rotate(T),w._rotate(T),k._rotate(T),y=Math.min(b.x,_.x,w.x,k.x),v=Math.max(b.x,_.x,w.x,k.x),m=Math.min(b.y,_.y,w.y,k.y),g=Math.max(b.y,_.y,w.y,k.y)}e.emplaceBack(t.x,t.y,y,m,v,g,r,n,i)}this.boxEndIndex=e.length},Nc=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Uc),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Uc(e,t){return et?1:0}function Vc(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],c=0;co)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,p=s-i,d=Math.min(h,p),f=d/2,m=new Nc([],qc);if(0===d)return new a(n,i);for(var g=n;gv.d||!v.d)&&(v=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-v.d<=t||(f=b.h/2,m.push(new Hc(b.p.x-f,b.p.y-f,f,e)),m.push(new Hc(b.p.x+f,b.p.y-f,f,e)),m.push(new Hc(b.p.x-f,b.p.y+f,f,e)),m.push(new Hc(b.p.x+f,b.p.y+f,f,e)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function qc(e,t){return t.max-e.max}function Hc(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=function(e,t){for(var r=!1,n=1/0,i=0;ie.y!==u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Mo(e,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Nc.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Nc.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Nc.prototype.peek=function(){return this.data[0]},Nc.prototype._up=function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n},Nc.prototype._down=function(e){for(var t=this.data,r=this.compare,n=this.length>>1,i=t[e];e=0)break;t[e]=o,e=a}t[e]=i};var Gc=Number.POSITIVE_INFINITY;function Wc(e,t){return t[1]!==Gc?function(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1]):function(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function $c(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Zc=255,Xc=Zc*_c;function Yc(e,t,r,n,i,o,s,l,c,u,h,p,d,f,m){var g=function(e,t,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,p=t.positionedLines;hXc&&T(e.layerIds[0]+': Value for "text-size" is >= '+Zc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[_c*f.compositeTextSizes[0].evaluate(s,{},m),_c*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>Xc||v[1]>Xc)&&T(e.layerIds[0]+': Value for "text-size" is >= '+Zc+'. Reduce your "text-size".'),e.addSymbols(e.text,g,v,l,o,s,u,t,c.lineStartIndex,c.lineLength,d,m);for(var x=0,b=h;x=0;o--)if(n.dist(a[o])0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=t.iconDependencies,p=t.glyphDependencies,d=t.availableImages,f=new zi(this.zoom),m=0,g=e;m=0;for(var z=0,O=T.sections;z=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0},ou.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ou.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ou.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ou.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ou.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ii("SymbolBucket",ou,{omit:["layers","collisionBoxArray","features","compareText"]}),ou.MAX_GLYPHS=65535,ou.addDynamicAttributes=ru;var su=new $i({"symbol-placement":new Vi(De.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(De.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(De.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qi(De.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(De.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(De.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Vi(De.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(De.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(De.layout_symbol["icon-rotation-alignment"]),"icon-size":new qi(De.layout_symbol["icon-size"]),"icon-text-fit":new Vi(De.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(De.layout_symbol["icon-text-fit-padding"]),"icon-image":new qi(De.layout_symbol["icon-image"]),"icon-rotate":new qi(De.layout_symbol["icon-rotate"]),"icon-padding":new Vi(De.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(De.layout_symbol["icon-keep-upright"]),"icon-offset":new qi(De.layout_symbol["icon-offset"]),"icon-anchor":new qi(De.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(De.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(De.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(De.layout_symbol["text-rotation-alignment"]),"text-field":new qi(De.layout_symbol["text-field"]),"text-font":new qi(De.layout_symbol["text-font"]),"text-size":new qi(De.layout_symbol["text-size"]),"text-max-width":new qi(De.layout_symbol["text-max-width"]),"text-line-height":new Vi(De.layout_symbol["text-line-height"]),"text-letter-spacing":new qi(De.layout_symbol["text-letter-spacing"]),"text-justify":new qi(De.layout_symbol["text-justify"]),"text-radial-offset":new qi(De.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(De.layout_symbol["text-variable-anchor"]),"text-anchor":new qi(De.layout_symbol["text-anchor"]),"text-max-angle":new Vi(De.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(De.layout_symbol["text-writing-mode"]),"text-rotate":new qi(De.layout_symbol["text-rotate"]),"text-padding":new Vi(De.layout_symbol["text-padding"]),"text-keep-upright":new Vi(De.layout_symbol["text-keep-upright"]),"text-transform":new qi(De.layout_symbol["text-transform"]),"text-offset":new qi(De.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(De.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Vi(De.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(De.layout_symbol["text-optional"])}),lu={paint:new $i({"icon-opacity":new qi(De.paint_symbol["icon-opacity"]),"icon-color":new qi(De.paint_symbol["icon-color"]),"icon-halo-color":new qi(De.paint_symbol["icon-halo-color"]),"icon-halo-width":new qi(De.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qi(De.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(De.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(De.paint_symbol["icon-translate-anchor"]),"text-opacity":new qi(De.paint_symbol["text-opacity"]),"text-color":new qi(De.paint_symbol["text-color"],{runtimeType:Ze,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new qi(De.paint_symbol["text-halo-color"]),"text-halo-width":new qi(De.paint_symbol["text-halo-width"]),"text-halo-blur":new qi(De.paint_symbol["text-halo-blur"]),"text-translate":new Vi(De.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(De.paint_symbol["text-translate-anchor"])}),layout:su},cu=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:He,this.defaultValue=e};cu.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},cu.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},cu.prototype.outputDefined=function(){return!1},cu.prototype.serialize=function(){return null},ii("FormatSectionOverride",cu,{omit:["defaultValue"]});var uu=function(e){function t(t){e.call(this,t,lu)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else M()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Tu.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Tu.prototype.processTask=function(e,t){var r=this;if(""===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(ci(t.error)):n(null,ci(t.data)))}else{var i=!1,a=P(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"",sourceMapId:r.mapId,error:t?li(t):null,data:li(n,a)},a)}:function(e){i=!0},s=null,l=ci(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Au.prototype.setNorthEast=function(e){return this._ne=e instanceof Eu?new Eu(e.lng,e.lat):Eu.convert(e),this},Au.prototype.setSouthWest=function(e){return this._sw=e instanceof Eu?new Eu(e.lng,e.lat):Eu.convert(e),this},Au.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof Eu)t=e,r=e;else{if(!(e instanceof Au)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(Au.convert(a))}var o=e;return this.extend(Eu.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Eu(t.lng,t.lat),this._ne=new Eu(r.lng,r.lat)),this},Au.prototype.getCenter=function(){return new Eu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Au.prototype.getSouthWest=function(){return this._sw},Au.prototype.getNorthEast=function(){return this._ne},Au.prototype.getNorthWest=function(){return new Eu(this.getWest(),this.getNorth())},Au.prototype.getSouthEast=function(){return new Eu(this.getEast(),this.getSouth())},Au.prototype.getWest=function(){return this._sw.lng},Au.prototype.getSouth=function(){return this._sw.lat},Au.prototype.getEast=function(){return this._ne.lng},Au.prototype.getNorth=function(){return this._ne.lat},Au.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Au.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Au.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Au.prototype.contains=function(e){var t=Eu.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Au.convert=function(e){return!e||e instanceof Au?e:new Au(e)};var Mu=6371008.8,Eu=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Eu.prototype.wrap=function(){return new Eu(p(this.lng,-180,180),this.lat)},Eu.prototype.toArray=function(){return[this.lng,this.lat]},Eu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Eu.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Mu*Math.acos(Math.min(i,1))},Eu.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Au(new Eu(this.lng-r,this.lat-t),new Eu(this.lng+r,this.lat+t))},Eu.convert=function(e){if(e instanceof Eu)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Eu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===typeof e&&null!==e)return new Eu(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Cu=2*Math.PI*Mu;function Pu(e){return Cu*Math.cos(e*Math.PI/180)}function Lu(e){return(180+e)/360}function Iu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function zu(e,t){return e/Pu(t)}function Ou(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}var Ru=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ru.fromLngLat=function(e,t){void 0===t&&(t=0);var r=Eu.convert(e);return new Ru(Lu(r.lng),Iu(r.lat),zu(t,r.lat))},Ru.prototype.toLngLat=function(){return new Eu(360*this.x-180,Ou(this.y))},Ru.prototype.toAltitude=function(){return e=this.z,t=this.y,e*Pu(Ou(t));var e,t},Ru.prototype.meterInMercatorCoordinateUnits=function(){return 1/Cu*(e=Ou(this.y),1/Math.cos(e*Math.PI/180));var e};var Du=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Bu(0,e,e,t,r)};Du.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Du.prototype.url=function(e,t){var r=function(e,t,r){var n=Su(256*e,256*(t=Math.pow(2,r)-t-1),r),i=Su(256*(e+1),256*(t+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(e,t,r){for(var n,i="",a=e;a>0;a--)i+=(t&(n=1<this.canonical.z?new Fu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Fu.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Bu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Bu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Fu.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t},Fu.prototype.children=function(e){if(this.overscaledZ>=e)return[new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Fu(t,this.wrap,t,r,n),new Fu(t,this.wrap,t,r+1,n),new Fu(t,this.wrap,t,r,n+1),new Fu(t,this.wrap,t,r+1,n+1)]},Fu.prototype.isLessThan=function(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Nu.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Nu.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Nu.prototype.getPixels=function(){return new Yo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Nu.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,c=a;c=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Gu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Js.VectorTile(new Ll(this.rawTileData)).layers,this.sourceLayerCoder=new Uu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Gu.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var o=e.params||{},s=po/e.tileSize/e.scale,l=kn(o.filter),c=e.queryGeometry,u=e.queryPadding*s,h=$u(c),p=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),d=$u(e.cameraQueryGeometry),f=this.grid3D.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u,(function(t,r,n,i){return function(e,t,r,n,i){for(var o=0,s=e;o=l.x&&i>=l.y)return!0}var c=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var u=0,h=c;u=0)return!0;return!1}(a,h)){var p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(n);if(i.needGeometry){var m=yo(f,!0);if(!i.filter(new zi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new zi(this.tileID.overscaledZ),f))return;for(var g=this.getId(f,p),y=0;yn)i=!1;else if(t)if(this.expirationTimehe&&(e.getActor().send("enforceCacheSizeLimit",ue),ye=0)},e.clamp=h,e.clearTileCache=function(e){var t=s.caches.delete(ce);e&&t.catch(e).then((function(){return e()}))},e.clipLine=zc,e.clone=function(e){var t=new Do(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=w,e.clone$2=function(e){var t=new Do(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=Sl,e.config=N,e.create=function(){var e=new Do(16);return Do!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=function(){var e=new Do(9);return Do!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},e.create$2=function(){var e=new Do(4);return Do!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.createCommonjsModule=t,e.createExpression=cn,e.createLayout=Qi,e.createStyleLayer=function(e){return"custom"===e.type?new mu(e):new gu[e.type](e)},e.cross=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e},e.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e},e.number=er,e.offscreenCanvasSupported=ve,e.ortho=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e},e.parseGlyphPBF=function(e){return new Ll(e).readFields(Kl,[])},e.pbf=Ll,e.performSymbolLayout=function(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=po/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.kind){var h=e.textSizeData,p=h.minZoom,d=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new zi(p),o),c["text-size"].possiblyEvaluate(new zi(d),o)]}if("composite"===e.iconSizeData.kind){var f=e.iconSizeData,m=f.minZoom,g=f.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new zi(m),o),c["icon-size"].possiblyEvaluate(new zi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new zi(e.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new zi(e.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*El,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var a=k[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=b.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),p=u.layoutIconSize.evaluate(a,{},o),d={horizontal:{},vertical:void 0},f=a.text,m=[0,0];if(f){var g=f.toString(),_=l.get("text-letter-spacing").evaluate(a,{},o)*El,S=function(e){for(var t=0,r=e;t=po||h.y<0||h.y>=po||function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,S){var A,M,E,C,P,L=e.addToLineVertexArray(t,r),I=0,z=0,O=0,R=0,D=-1,j=-1,F={},B=Ba(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(A=s.layout.get("text-offset").evaluate(b,{},k).map((function(e){return e*El})))[0],U=A[1]):(N=s.layout.get("text-radial-offset").evaluate(b,{},k)*El,U=Gc),e.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},k)+90,q=n.vertical;C=new Bc(l,t,c,u,h,q,p,d,f,V),o&&(P=new Bc(l,t,c,u,h,o,g,y,f,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),W=Oc(i,H,w,G),$=o?Oc(o,H,w,G):void 0;E=new Bc(l,t,c,u,h,i,g,y,!1,H),I=4*W.length;var Z=e.iconSizeData,X=null;"source"===Z.kind?(X=[_c*s.layout.get("icon-size").evaluate(b,{})])[0]>Xc&&T(e.layerIds[0]+': Value for "icon-size" is >= '+Zc+'. Reduce your "icon-size".'):"composite"===Z.kind&&((X=[_c*_.compositeIconSizes[0].evaluate(b,{},k),_c*_.compositeIconSizes[1].evaluate(b,{},k)])[0]>Xc||X[1]>Xc)&&T(e.layerIds[0]+': Value for "icon-size" is >= '+Zc+'. Reduce your "icon-size".'),e.addSymbols(e.icon,W,X,x,v,b,!1,t,L.lineStartIndex,L.lineLength,-1,k),D=e.icon.placedSymbolArray.length-1,$&&(z=4*$.length,e.addSymbols(e.icon,$,X,x,v,b,ic.vertical,t,L.lineStartIndex,L.lineLength,-1,k),j=e.icon.placedSymbolArray.length-1)}for(var Y in n.horizontal){var K=n.horizontal[Y];if(!M){B=Ba(K.text);var J=s.layout.get("text-rotate").evaluate(b,{},k);M=new Bc(l,t,c,u,h,K,p,d,f,J)}var Q=1===K.positionedLines.length;if(O+=Yc(e,t,K,a,s,f,b,m,L,n.vertical?ic.horizontal:ic.horizontalOnly,Q?Object.keys(n.horizontal):[Y],F,D,_,k),Q)break}n.vertical&&(R+=Yc(e,t,n.vertical,a,s,f,b,m,L,ic.vertical,["vertical"],F,j,_,k));var ee=M?M.boxStartIndex:e.collisionBoxArray.length,te=M?M.boxEndIndex:e.collisionBoxArray.length,re=C?C.boxStartIndex:e.collisionBoxArray.length,ne=C?C.boxEndIndex:e.collisionBoxArray.length,ie=E?E.boxStartIndex:e.collisionBoxArray.length,ae=E?E.boxEndIndex:e.collisionBoxArray.length,oe=P?P.boxStartIndex:e.collisionBoxArray.length,se=P?P.boxEndIndex:e.collisionBoxArray.length,le=-1,ce=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ce(M,le),le=ce(C,le),le=ce(E,le);var ue=(le=ce(P,le))>-1?1:0;ue&&(le*=S/El),e.glyphOffsetArray.length>=ou.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,D,j,B,ee,te,re,ne,ie,ae,oe,se,c,O,R,I,z,ue,0,p,N,U,le)}(e,h,s,r,n,i,p,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,v,w,A,l,b,k,M,f,t,a,c,u,o)};if("line"===E)for(var I=0,z=zc(t.geometry,0,0,po,po);I1){var U=Pc(N,S,r.vertical||m,n,g,x);U&&L(N,U)}}else if("Polygon"===t.type)for(var V=0,q=Rs(t.geometry,0);V=E.maxzoom||"none"!==E.visibility&&(o(M,this.zoom,n),(m[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:M,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,g,this.tileID.canonical),u.bucketLayerIDs.push(M.map((function(e){return e.id}))))}}}var C=e.mapObject(g.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},(function(e,t){h||(h=e,p=t,I.call(l))})):p={};var P=Object.keys(g.iconDependencies);P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){h||(h=e,d=t,I.call(l))})):d={};var L=Object.keys(g.patternDependencies);function I(){if(h)return s(h);if(p&&d&&f){var t=new i(p),r=new e.ImageAtlas(d,f);for(var a in m){var l=m[a];l instanceof e.SymbolBucket?(o(l.layers,this.zoom,n),e.performSymbolLayout(l,p,t.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:e.values(m).filter((function(e){return!e.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?t.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){h||(h=e,f=t,I.call(l))})):f={},I.call(this)};var l=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[i]=new a(t);s.abort=this.loadVectorData(t,(function(t,a){if(delete n.loading[i],t||!a)return s.status="done",n.loaded[i]=s,r(t);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},l.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var c=e.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var h=function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n=0!==!!t&&e.reverse()}var f=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r>31}function L(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s>1;O(e,t,o,n,i,a%2),z(e,t,r,n,o-1,a+1),z(e,t,r,o+1,i,a+1)}}function O(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);O(e,t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=t[2*r+a],p=n,d=i;for(R(e,t,n,r),t[2*i+a]>h&&R(e,t,n,i);ph;)d--}t[2*n+a]===h?R(e,t,n,d):R(e,t,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}function R(e,t,r,n){D(e,r,n),D(t,2*r,2*n),D(t,2*r+1,2*n+1)}function D(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function j(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=k,_.GeoJSONWrapper=T;var F=function(e){return e[0]},B=function(e){return e[1]},N=function(e,t,r,n,i){void 0===t&&(t=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l=r&&s<=i&&l>=n&&l<=a&&u.push(e[f]);else{var m=Math.floor((d+p)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(e[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(p),c.push(g))}}return u}(this.ids,this.coords,e,t,r,n,this.nodeSize)},N.prototype.within=function(e,t,r){return function(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var p=h;p<=u;p++)j(t[2*p],t[2*p+1],r,n)<=l&&s.push(e[p]);else{var d=Math.floor((h+u)/2),f=t[2*d],m=t[2*d+1];j(f,m,r,n)<=l&&s.push(e[d]);var g=(c+1)%2;(0===c?r-i<=f:n-i<=m)&&(o.push(h),o.push(d-1),o.push(g)),(0===c?r+i>=f:n+i>=m)&&(o.push(d+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},V=function(e){this.options=Y(Object.create(U),e),this.trees=new Array(this.options.maxZoom+1)};function q(e,t,r,n,i){return{x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function H(e,t){var r=e.geometry.coordinates,n=r[0],i=r[1];return{x:$(n),y:Z(i),zoom:1/0,index:t,parentId:-1}}function G(e){return{type:"Feature",id:e.id,properties:W(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),X(e.y)]}};var t}function W(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return Y(Y({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function $(e){return e/360+.5}function Z(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function X(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function Y(e,t){for(var r in t)e[r]=t[r];return e}function K(e){return e.x}function J(e){return e.y}function Q(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],c=e[t+1],u=e[r],h=e[r+1],p=t+3;pa)i=p,a=d;else if(d===a){var f=Math.abs(p-o);fn&&(i-t>3&&Q(e,t,i,n),e[i+2]=a,r-i>3&&Q(e,i,r,n))}function ee(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function te(e,t,r,n){var i={id:"undefined"===typeof e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)re(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=t.length-3;t[2]=1,Q(t,0,u,r),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function oe(e,t,r,n){for(var i=0;i1?1:r}function ce(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o=n)return null;for(var l=[],c=0;c=r&&f=n)){var m=[];if("Point"===p||"MultiPoint"===p)ue(h,m,r,n,i);else if("LineString"===p)he(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)de(h,m,r,n,i,!1);else if("Polygon"===p)de(h,m,r,n,i,!0);else if("MultiPolygon"===p)for(var g=0;g=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function he(e,t,r,n,i,a,o){for(var s,l,c=pe(e),u=0===i?me:ge,h=e.start,p=0;pr&&(l=u(c,d,f,g,y,r),o&&(c.start=h+s*l)):v>n?x=r&&(l=u(c,d,f,g,y,r),b=!0),x>n&&v<=n&&(l=u(c,d,f,g,y,n),b=!0),!a&&b&&(o&&(c.end=h+s*l),t.push(c),c=pe(e)),o&&(h+=s)}var _=e.length-3;d=e[_],f=e[_+1],m=e[_+2],(v=0===i?d:f)>=r&&v<=n&&fe(c,d,f,m),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&fe(c,c[0],c[1],c[2]),c.length&&t.push(c)}function pe(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function de(e,t,r,n,i,a){for(var o=0;oo.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function we(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;lo)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&function(e,t){for(var r=0,n=0,i=e.length,a=i-2;n0===t)for(n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,K,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],c=[],u=0,h=l.range($(r),Z(a),$(i),Z(n));ut&&(f+=v.numPoints||1)}if(f>=s){for(var x=u.x*d,b=u.y*d,_=o&&d>1?this._map(u,!0):null,w=(c<<5)+(t+1)+this.points.length,k=0,T=p;k1)for(var E=0,C=p;E>5},V.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},V.prototype._map=function(e,t){if(e.numPoints)return t?Y({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?Y({},n):n},Te.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Te.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var u=1<1&&console.time("creation"),p=this.tiles[h]=_e(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=e,i){if(t===l.maxZoom||t===i)continue;var f=1<1&&console.time("clipping");var m,g,y,v,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,T=1+_;m=g=y=v=null,x=ce(e,u,r-_,r+k,0,p.minX,p.maxX,l),b=ce(e,u,r+w,r+T,0,p.minX,p.maxX,l),e=null,x&&(m=ce(x,u,n-_,n+k,1,p.minY,p.maxY,l),g=ce(x,u,n+w,n+T,1,p.minY,p.maxY,l),x=null),b&&(y=ce(b,u,n-_,n+k,1,p.minY,p.maxY,l),v=ce(b,u,n+w,n+T,1,p.minY,p.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*r,2*n),s.push(g||[],t+1,2*r,2*n+1),s.push(y||[],t+1,2*r+1,2*n),s.push(v||[],t+1,2*r+1,2*n+1)}}},Te.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,c=e,u=t,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[Se(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?xe(this.tiles[s],i):null):null};var Me=function(t){function r(e,r,n,i){t.call(this,e,r,n,Ae),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!==typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=e.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(e){return e.key+": "+e.message})).join(", "));var l=o.features.filter((function(e){return s.value.evaluate({zoom:0},e)}));o={type:"FeatureCollection",features:l}}t._geoJSONIndex=n.cluster?new V(function(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var p=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t=0?1.2:1))}function y(e,t,r,n,i,a,o){for(var s=0;s65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i1&&(l=e[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),p=Math.min(u,h),d=void 0,f=i/r*(n+1);if(l.isDash){var m=n-Math.abs(f);d=Math.sqrt(p*p+m*m)}else d=n-Math.sqrt(p*p+f*f);this.data[o+c]=Math.max(0,Math.min(255,d+128))}},T.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],c=0;c1&&(l=e[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),p=Math.min(u,h),d=l.isDash?p:-p;this.data[o+c]=Math.max(0,Math.min(255,d+128))}},T.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o=n&&t.x=i&&t.y0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),I=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;or.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),R=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!==typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];ethis.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(e){return e.wrapped().key in this.data},N.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},N.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},N.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},N.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},N.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},N.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=Math.floor(5*t),n="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Oe(this._source.type)){for(var c={},u={},h=0,p=Object.keys(l);hthis._source.maxzoom){var g=f.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=f.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),b=f.overscaledZ-1;b>=a;--b){var _=f.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(m=this.getTile(_))&&x&&(m=this._addTile(_)),m&&(n[_.key]=_,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),c=s.map((function(e){return o.pointCoordinate(e)})),u=this.getIds(),h=1/0,p=1/0,d=-1/0,f=-1/0,m=0,g=c;m=0&&y[1].y+g>=0){var v=l.map((function(e){return s.getTilePoint(e)})),x=c.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function ze(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Oe(e){return"raster"===e||"image"===e||"video"===e}function Re(){return new e.window.Worker(aa.workerUrl)}Ie.maxOverzooming=10,Ie.maxUnderzooming=3;var De="mapboxgl_preloaded_worker_pool",je=function(){this.active={}};je.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qe=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function at(t,r,n,i,a,o,s,l){var c=i?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;p.clear();for(var d=t.lineVertexArray,f=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function lt(t,r,n,i,a,o,s,l,c,u,h,p,d,f){var m,g=r/24,y=t.lineOffsetX*g,v=t.lineOffsetY*g;if(t.numGlyphs>1){var x=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,_=t.lineStartIndex+t.lineLength,w=ot(g,l,y,v,n,h,p,t,c,o,d);if(!w)return{notEnoughRoom:!0};var k=rt(w.first.point,s).point,T=rt(w.last.point,s).point;if(i&&!n){var S=st(t.writingMode,k,T,f);if(S)return S}m=[w.first];for(var A=t.glyphStartIndex+1;A0?P.point:ct(p,C,M,1,a),I=st(t.writingMode,M,L,f);if(I)return I}var z=ut(g*l.getoffsetX(t.glyphStartIndex),y,v,n,h,p,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,c,o,d);if(!z)return{notEnoughRoom:!0};m=[z]}for(var O=0,R=m;O0?1:-1,m=0;i&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,y=a,v=a,x=0,b=0,_=Math.abs(d),w=[];x+b<=_;){if((g+=f)=c)return null;if(v=y,w.push(y),void 0===(y=p[g])){var k=new e.Point(u.getx(g),u.gety(g)),T=rt(k,h);if(T.signedDistanceFromCamera>0)y=p[g]=T.point;else{var S=g-f;y=ct(0===x?o:new e.Point(u.getx(S),u.gety(S)),k,v,_-x+1,h)}}x+=b,b=v.dist(y)}var A=(_-x)/b,M=y.sub(v),E=M.mult(A)._add(v);E._add(M._unit()._perp()._mult(n*f));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Qe.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qe.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qe.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},Qe.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},Qe.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},Qe.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:o},Qe.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Qe.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},Qe.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},Qe.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},Qe.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,p=c;h=u[f+0]&&n>=u[f+1]&&(!s||s(this.boxKeys[d]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[d],x1:u[f],y1:u[f+1],x2:u[f+2],y2:u[f+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;yo*o+s*s},Qe.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,p=u-c;return h*h+p*p<=r*r};var ht=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pt(e,t){for(var r=0;r=1;L--)P.push(E.path[L]);for(var I=1;I0){for(var D=P[0].clone(),j=P[0].clone(),F=1;F=S.x&&j.x<=A.x&&D.y>=S.y&&j.y<=A.y?[P]:j.xA.x||j.yA.y?[]:e.clipLine([P],S.x,S.y,A.x,A.y)}for(var B=0,N=R;B=this.screenRightBoundary||nthis.screenBottomBoundary},mt.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e=0&&t0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:m},this.markUsedJustification(p,e,h,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,h),this.placedOrientations[h.crossTileID]=d),{shift:y,placedGlyphBoxes:v}):void 0},St.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,p=a.holdingForFade,d=a.collisionBoxArray,f=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),k="viewport-y"===s.get("symbol-z-order"),T=v&&(x||!o.hasIconData()||y),S=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&d&&o.deserializeCollisionBoxes(d);var A=function(t,a){if(!r[t.crossTileID])if(p)i.placements[t.crossTileID]=new xt(!1,!1,!1);else{var d,k=!1,A=!1,M=!0,E=null,C={box:null,offscreen:null},P={box:null,offscreen:null},L=null,I=null,z=0,O=0,R=0;a.textFeatureIndex?z=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(z=t.featureIndex),a.verticalTextFeatureIndex&&(O=a.verticalTextFeatureIndex);var D=a.textBox;if(D){var j=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},F=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i0&&(B=B.filter((function(e){return e!==N.anchor}))).unshift(N.anchor)}var U=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,c=t.textBoxScale,u=w&&!x?r:null,p={box:[],offscreen:!1},d=v?2*B.length:B.length,f=0;f=B.length,T=i.attemptAnchorPlacement(g,e,a,s,c,b,_,h,l,m,y,t,o,n,u);if(T&&(p=T.placedGlyphBoxes)&&p.box&&p.box.length){k=!0,E=T.shift;break}}return p};F((function(){return U(D,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),C&&(k=C.box,M=C.offscreen);var V=j(C&&C.box);if(!k&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[t.crossTileID];q&&(i.variableOffsets[t.crossTileID]=q,i.markUsedJustification(o,q.anchor,t,V))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};F((function(){return H(D,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),j(C&&C.box&&C.box.length)}}if(k=(d=C)&&d.box&&d.box.length>0,M=d&&d.offscreen,t.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),W=e.evaluateSizeForFeature(o.textSizeData,f,G),$=s.get("text-padding"),Z=t.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,W,l,c,u,n,_,m.predicate,Z,$),k=v||L.circles.length>0&&!L.collisionDetected,M=M&&L.offscreen}if(a.iconFeatureIndex&&(R=a.iconFeatureIndex),a.iconBox){var X=function(e){var t=w&&E?Tt(e,E.x,E.y,b,_,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,x,h,l,m.predicate)};A=P&&P.box&&P.box.length&&a.verticalIconBox?(I=X(a.verticalIconBox)).box.length>0:(I=X(a.iconBox)).box.length>0,M=M&&I.offscreen}var Y=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;if(Y||K?K?Y||(A=A&&k):k=A&&k:A=k=A&&k,k&&d&&d.box&&(P&&P.box&&O?i.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,m.ID):i.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),A&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,R,m.ID),L&&(k&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new bt);for(var ee=0;ee=0;--E){var C=M[E];A(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var P=t.symbolInstanceStart;P=0&&(t.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},St.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===e.WritingMode.vertical,w=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(v){var k=Ot(y.text),T=_?Rt:k;f(t.text,s,T);var S=w?Rt:k;f(t.text,l,S);var A=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=A||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var M=i.variableOffsets[a.crossTileID];M&&i.markUsedJustification(t,M.anchor,a,b);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(t,"left",a,E),i.markUsedOrientation(t,E,a))}if(x){var C=Ot(y.icon),P=!(p&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var L=P?C:Rt;f(t.icon,a.numIconVertices,L),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=P?Rt:C;f(t.icon,a.numVerticalIconVertices,I),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var z=t.collisionArrays[n];if(z){var O=new e.Point(0,0);if(z.textBox||z.verticalTextBox){var R=!0;if(c){var D=i.variableOffsets[m];D?(O=kt(D.anchor,D.width,D.height,D.textOffset,D.textBoxScale),u&&O._rotate(h?i.transform.angle:-i.transform.angle)):R=!1}z.textBox&&At(t.textCollisionBox.collisionVertexArray,y.text.placed,!R||_,O.x,O.y),z.verticalTextBox&&At(t.textCollisionBox.collisionVertexArray,y.text.placed,!R||w,O.x,O.y)}var j=Boolean(!w&&z.verticalIconBox);z.iconBox&&At(t.iconCollisionBox.collisionVertexArray,y.icon.placed,j,p?O.x:0,p?O.y:0),z.verticalIconBox&&At(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!j,p?O.x:0,p?O.y:0)}}},g=0;ge},St.prototype.setStale=function(){this.stale=!0};var Mt=Math.pow(2,25),Et=Math.pow(2,24),Ct=Math.pow(2,17),Pt=Math.pow(2,16),Lt=Math.pow(2,9),It=Math.pow(2,8),zt=Math.pow(2,1);function Ot(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Mt+t*Et+r*Ct+t*Pt+r*Lt+t*It+r*zt+t}var Rt=0,Dt=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Dt.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Dt(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},jt.prototype.commit=function(e){return this.placement.commit(e),this.placement};var Ft=512/e.EXTENT/2,Bt=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;ne.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var c=o[e.scaledTo(Number(a)).key];c&&c.findMatches(t.symbolInstances,e,i)}}for(var u=0;u1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,u())})),c=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){c=null,o||(o=e,a=t,u())}));function u(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,p=l.y,d=l.sdf,f=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new e.RGBAImage({width:c,height:u});e.RGBAImage.copy(t,v,{x:h,y:p},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:f,sdf:d,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(function(t,n){if(r._spriteRequest=null,t)r.fire(new e.ErrorEvent(t));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new e.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(t){var r=this.sourceCaches[t.source];if(r){var n=t.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+t.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(e){for(var t=[],r=0,n=e;r0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._afterImageUpdated(t)},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},r.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(e.validateStyle.source,"sources."+t,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Ie(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(qt(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"===typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof t.id&&"number"!==typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s=0;f--){var m=this._order[f];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id] 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_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),nr=_r("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);}"),ir=_r("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,0,1);}"),ar=_r("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=_r("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=_r("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),lr=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),cr=_r("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ur=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hr=_r("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),pr=_r("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),dr=_r("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=_r("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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);}"),mr=_r("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),gr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),yr=_r("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),vr=_r("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),xr=_r("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),br=_r("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function _r(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(r,(function(e,t,r,n,i){return s[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var wr=Object.freeze({__proto__:null,prelude:Xt,background:Yt,backgroundPattern:Kt,circle:Jt,clippingMask:Qt,heatmap:er,heatmapTexture:tr,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:cr,fillExtrusionPattern:ur,hillshadePrepare:hr,hillshade:pr,line:dr,lineGradient:fr,linePattern:mr,lineSDF:gr,raster:yr,symbolIcon:vr,symbolSDF:xr,symbolTextAndIcon:br}),kr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Tr(e){for(var t=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Sr.prototype.draw=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m){var g,y=e.gl;if(!this.failedToCreate){for(var v in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);d&&d.setUniforms(e,this.binderUniforms,h,{zoom:p});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[t],b=0,_=u.get();b<_.length;b+=1){var w=_[b],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new kr)).bind(e,this,l,d?d.getPaintVertexBuffers():[],c,w.vertexOffset,f,m),y.drawElements(t,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Mr=function(t,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===a.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},Er=function(t,r,n,i,a,o,s){return e.extend(Mr(t,r,n,i),Ar(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Cr=function(e){return{u_matrix:e}},Pr=function(t,r,n,i){return e.extend(Cr(t),Ar(n,r,i))},Lr=function(e,t){return{u_matrix:e,u_world:t}},Ir=function(t,r,n,i,a){return e.extend(Pr(t,r,n,i),{u_world:a})},zr=function(t,r,n,i){var a,o,s=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=gt(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:o}},Or=function(e,t,r){var n=gt(r,1,t.zoom),i=Math.pow(2,t.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*i),t.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Rr=function(e,t,r){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Dr=function(e,t,r){return void 0===r&&(r=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}},jr=function(e){return{u_matrix:e}},Fr=function(e,t,r,n){return{u_matrix:e,u_extrude_scale:gt(t,1,r),u_intensity:n}};function Br(t,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.MercatorCoordinate(0,i/n).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Nr=function(t,r,n){var i=t.transform;return{u_matrix:Gr(t,r,n),u_ratio:1/gt(r,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Ur=function(t,r,n,i){return e.extend(Nr(t,r,n),{u_image:0,u_image_height:i})},Vr=function(t,r,n,i){var a=t.transform,o=Hr(r,a);return{u_matrix:Gr(t,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/gt(r,1,a.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},qr=function(t,r,n,i,a){var o=t.transform,s=t.lineAtlas,l=Hr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),p=u.width*a.fromScale,d=h.width*a.toScale;return e.extend(Nr(t,r,n),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/d,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,d)*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Hr(e,t){return 1/gt(e,1,t.tileZoom)}function Gr(e,t,r){return e.translatePosMatrix(t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Wr=function(e,t,r,n,i){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:$r(i.paint.get("raster-hue-rotate"))};var a,o};function $r(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}var Zr,Xr=function(e,t,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Yr=function(t,r,n,i,a,o,s,l,c,u,h){var p=a.transform;return e.extend(Xr(t,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(t,r,n,i,a,o,s,l,c,u){return e.extend(Yr(t,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Qr=function(t,r,n,i,a,o){return e.extend(function(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),p=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/gt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,o,n,a),{u_matrix:t,u_opacity:r})},en={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function tn(t,r,n,i,a,o,s){for(var l=t.context,c=l.gl,u=t.useProgram("collisionBox"),h=[],p=0,d=0,f=0;f0){var _=e.create(),w=v;e.mul(_,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(_,_,y.placementViewportMatrix),h.push({circleArray:b,circleOffset:d,transform:w,invTransform:_}),d=p+=b.length/4}x&&u.draw(l,c.LINES,Ae.disabled,Ee.disabled,t.colorModeForRenderPass(),Pe.disabled,Or(v,t.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,t.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var k=t.useProgram("collisionCircle"),T=new e.StructArrayLayout2f1f2i16;T.resize(4*p),T._trim();for(var S=0,A=0,M=h;A=0&&(m[y.associatedIconIndex]={shiftedAnchor:M,angle:E})}else pt(y.numGlyphs,d)}if(h){f.clear();for(var P=t.icon.placedSymbolArray,L=0;L0){var s=e.browser.now(),l=(s-t.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),d=p&&t.refreshedUponExpiration?1:e.clamp(p?l:1-c,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var fn=new e.Color(1,0,0,1),mn=new e.Color(0,1,0,1),gn=new e.Color(0,0,1,1),yn=new e.Color(1,0,1,1),vn=new e.Color(0,1,1,1);function xn(e){var t=e.transform.padding;bn(e,e.transform.height-(t.top||0),3,fn),bn(e,t.bottom||0,3,mn),_n(e,t.left||0,3,gn),_n(e,e.transform.width-(t.right||0),3,yn);var r=e.transform.centerPoint;!function(e,t,r,n){var i=20,a=2;wn(e,t-a/2,r-i/2,a,i,n),wn(e,t-i/2,r-a/2,i,a,n)}(e,r.x,e.transform.height-r.y,vn)}function bn(e,t,r,n){wn(e,0,t+r/2,e.transform.width,r,n)}function _n(e,t,r,n){wn(e,t-r/2,0,r,e.transform.height,n)}function wn(t,r,n,i,a,o){var s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.browser.devicePixelRatio,n*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function kn(t,r,n){var i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Ae.disabled,c=Ee.disabled,u=t.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Pe.disabled,Dr(o,e.Color.red),h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,d=p&&p.byteLength||0,f=Math.floor(d/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,y+" "+f+"kb"),s.draw(i,a.TRIANGLES,l,c,Ce.alphaBlended,Pe.disabled,Dr(o,e.Color.transparent,g),h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var Tn={symbol:function(t,r,n,i,a){if("translucent"===t.renderPass){var o=Ee.disabled,s=t.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(t,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,p=t;h256&&this.clearStencil(),r.setColorMode(Ce.disabled),r.setDepthMode(Ae.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Ee({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},Sn.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Ee({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},Sn.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],k=a[w.source],T=u[w.source];this._renderTileClippingMasks(w,T),this.renderLayer(this,k,w,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?t.pop():null},Sn.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},Sn.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Sr(this.context,e,wr[e],t,en[e],this._showOverdrawInspector)),this.cache[r]},Sn.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()},Sn.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},Sn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},Sn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var An=function(e,t){this.points=e,this.planes=t};An.fromInvProjectionMatrix=function(t,r,n){var i=Math.pow(2,n),a=[[-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((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],a[t[0]],a[t[1]]),n=e.sub([],a[t[2]],a[t[1]]),i=e.normalize([],e.cross([],r,n)),o=-e.dot(i,a[t[1]]);return i.concat(o)}));return new An(a,o)};var Mn=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Mn.prototype.quadrant=function(t){for(var r=[t%2===0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;hthis.max[l]-this.min[l])return 0}return 1};var En=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};En.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},En.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},En.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},En.prototype.clone=function(){return new En(this.top,this.bottom,this.left,this.right)},En.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cn=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new En,this._posMatrixCache={},this._alignedPosMatrixCache={}},Pn={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}};Cn.prototype.clone=function(){var e=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},Pn.minZoom.get=function(){return this._minZoom},Pn.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Pn.maxZoom.get=function(){return this._maxZoom},Pn.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Pn.minPitch.get=function(){return this._minPitch},Pn.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Pn.maxPitch.get=function(){return this._maxPitch},Pn.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Pn.renderWorldCopies.get=function(){return this._renderWorldCopies},Pn.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},Pn.worldSize.get=function(){return this.tileSize*this.scale},Pn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Pn.size.get=function(){return new e.Point(this.width,this.height)},Pn.bearing.get=function(){return-this.angle/Math.PI*180},Pn.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Pn.pitch.get=function(){return this._pitch/Math.PI*180},Pn.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Pn.fov.get=function(){return this._fov/Math.PI*180},Pn.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},Pn.zoom.get=function(){return this._zoom},Pn.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},Pn.center.get=function(){return this._center},Pn.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Pn.padding.get=function(){return this._edgeInsets.toJSON()},Pn.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Pn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cn.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},Cn.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},Cn.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},Cn.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},Cn.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&rt.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=An.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(e){return{aabb:new Mn([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],h=[],p=r,d=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)u.push(c(-f)),u.push(c(f));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var b=m.aabb.distanceX(o),_=m.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),k=3+(1<k&&m.zoom>=l)h.push({tileID:new e.OverscaledTileID(m.zoom===p?d:m.zoom,m.wrap,m.zoom,g,y),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var T=0;T<4;T++){var S=(g<<1)+T%2,A=(y<<1)+(T>>1);u.push({aabb:m.aabb.quadrant(T),zoom:m.zoom+1,x:S,y:A,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},Cn.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Pn.unmodified.get=function(){return this._unmodified},Cn.prototype.zoomScale=function(e){return Math.pow(2,e)},Cn.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},Cn.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},Cn.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Pn.point.get=function(){return this.project(this.center)},Cn.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Cn.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},Cn.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},Cn.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},Cn.prototype.coordinateLocation=function(e){return e.toLngLat()},Cn.prototype.pointCoordinate=function(t){var r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.transformMat4(r,r,this.pixelMatrixInverse),e.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,p=u===h?0:(0-u)/(h-u);return new e.MercatorCoordinate(e.number(o,s,p)/this.worldSize,e.number(l,c,p)/this.worldSize)},Cn.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},Cn.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Cn.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Cn.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=e.mercatorYfromLat(h[1])*this.worldSize,t=(o=e.mercatorYfromLat(h[0])*this.worldSize)-ao&&(i=o-g)}if(this.lngRange){var y=d.x,v=c.x/2;y-vl&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==n?n:d.x,void 0!==i?i:d.y))),this._unmodified=u,this._constraining=!1}},Cn.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);e.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,e.scale(h,h,[1,-1,1]),e.translate(h,h,[0,0,-this.cameraToCenterDistance]),e.rotateX(h,h,this._pitch),e.rotateZ(h,h,this.angle),e.translate(h,h,[-s,-l,0]),this.mercatorMatrix=e.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),e.scale(h,h,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=e.invert([],this.projMatrix);var p=this.width%2/2,d=this.height%2/2,f=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+f*p+m*d,y=l-Math.round(l)+f*d+m*p,v=new Float64Array(h);if(e.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=e.create(),e.scale(h,h,[this.width/2,-this.height/2,1]),e.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=e.create(),e.scale(h,h,[1,-1,1]),e.translate(h,h,[-1,-1,0]),e.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Cn.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},Cn.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Ln.prototype._updateHashUnthrottled=function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,t)}catch(r){}};var In={linearity:.3,easing:e.bezier(0,0,.3,1)},zn=e.extend({deceleration:2500,maxSpeed:1400},In),On=e.extend({deceleration:20,maxSpeed:1400},In),Rn=e.extend({deceleration:1e3,maxSpeed:360},In),Dn=e.extend({deceleration:1e3,maxSpeed:90},In),jn=function(e){this._map=e,this.clear()};function Fn(e,t){(!e.duration||e.duration0&&r-t[0].time>160;)t.shift()},jn.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.dblclick=function(e){return this._firePreventable(new Nn(e.type,this._map,e))},qn.prototype.mouseover=function(e){this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.mouseout=function(e){this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.touchstart=function(e){return this._firePreventable(new Un(e.type,this._map,e))},qn.prototype.touchmove=function(e){this._map.fire(new Un(e.type,this._map,e))},qn.prototype.touchend=function(e){this._map.fire(new Un(e.type,this._map,e))},qn.prototype.touchcancel=function(e){this._map.fire(new Un(e.type,this._map,e))},qn.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(e){this._map=e};Hn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Hn.prototype.mousemove=function(e){this._map.fire(new Nn(e.type,this._map,e))},Hn.prototype.mousedown=function(){this._delayContextMenu=!0},Hn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Hn.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Nn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Hn.prototype.isEnabled=function(){return!0},Hn.prototype.isActive=function(){return!1},Hn.prototype.enable=function(){},Hn.prototype.disable=function(){};var Gn=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Wn(e,t){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){for(var r=new e.Point(0,0),n=0,i=t;n30)&&(this.aborted=!0)}}},$n.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Zn=function(e){this.singleTap=new $n(e),this.numTaps=e.numTaps,this.reset()};Zn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zn.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},Zn.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},Zn.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Xn=function(){this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()};Xn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Xn.prototype.touchstart=function(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)},Xn.prototype.touchmove=function(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)},Xn.prototype.touchend=function(e,t,r){var n=this,i=this._zoomIn.touchend(e,t,r),a=this._zoomOut.touchend(e,t,r);return i?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}}):a?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}):void 0},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var Yn={0:1,2:2},Kn=function(e){this.reset(),this._clickTolerance=e.clickTolerance||1};Kn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Kn.prototype._correctButton=function(e,t){return!1},Kn.prototype._move=function(e,t){return{}},Kn.prototype.mousedown=function(e,t){if(!this._lastPoint){var n=r.mouseButton(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}},Kn.prototype.mousemoveWindow=function(e,t){var r=this._lastPoint;if(r)if(e.preventDefault(),function(e,t){var r=Yn[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(r)0&&(this._active=!0);var i=Wn(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(sMath.abs(e.x)}var ci=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,li(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=e.mag()>=2,i=t.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=e.y>0===t.y>0;return li(e)&&li(t)&&a}},t}(ri),ui={panStep:100,bearingStep:15,pitchStep:10},hi=function(){var e=ui;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};function pi(e){return e*(2-e)}hi.prototype.reset=function(){this._active=!1},hi.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:pi,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active},hi.prototype.disableRotation=function(){this._rotationDisabled=!0},hi.prototype.enableRotation=function(){this._rotationDisabled=!1};var di=4.000244140625,fi=1/450,mi=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=fi,e.bindAll(["_onTimeout"],this)};mi.prototype.setZoomRate=function(e){this._defaultZoomRate=e},mi.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},mi.prototype.isEnabled=function(){return!!this._enabled},mi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mi.prototype.isZooming=function(){return!!this._zooming},mi.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},mi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mi.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%di===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},mi.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},mi.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mi.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>di?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),p=c(h);o=e.number(l,s,p),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mi.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},mi.prototype.reset=function(){this._active=!1};var gi=function(e,t){this._clickZoom=e,this._tapZoom=t};gi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},gi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},gi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},gi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var yi=function(){this.reset()};yi.prototype.reset=function(){this._active=!1},yi.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()};vi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},vi.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},vi.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},vi.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var xi=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};xi.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var bi=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};bi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},bi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},bi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},bi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _i=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_i.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_i.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_i.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_i.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_i.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_i.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wi=function(e){return e.zoom||e.drag||e.pitch||e.rotate},ki=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function Ti(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var Si=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new jn(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(var a=0,o=this._listeners;aa?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-t),k=i.unproject(x.add(b.mult(t*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?k.wrap():k,f)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,h="bearing"in t?this._normalizeBearing(t.bearing,s):s,p="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:a.padding,f=a.zoomScale(u-o),m=e.Point.convert(t.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=e.LngLat.convert(t.center||y);this._normalizeCenter(v);var x=a.project(y),b=a.project(v).sub(x),_=t.curve,w=Math.max(a.width,a.height),k=w/f,T=b.mag();if("minZoom"in t){var S=e.clamp(Math.min(t.minZoom,o,u),a.minZoom,a.maxZoom),A=w/a.zoomScale(S-o);_=Math.sqrt(A/T*2)}var M=_*_;function E(e){var t=(k*k-w*w+(e?-1:1)*M*M*T*T)/(2*(e?k:w)*M*T);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function P(e){return(Math.exp(e)+Math.exp(-e))/2}var L=E(0),I=function(e){return P(L)/P(L+_*e)},z=function(e){return w*((P(L)*(C(t=L+_*e)/P(t))-C(L))/M)/T;var t},O=(E(1)-L)/_;if(Math.abs(T)<1e-6||!isFinite(O)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);var R=kt.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==l,this._padding=!a.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(t){var i=t*O,f=1/I(i);a.zoom=1===t?u:o+a.scaleZoom(f),n._rotating&&(a.bearing=e.number(s,h,t)),n._pitching&&(a.pitch=e.number(l,p,t)),n._padding&&(a.interpolatePadding(c,d,t),g=a.centerPoint.add(m));var y=1===t?v:a.unproject(x.add(b.mult(z(i))).mult(f));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)180?-360:r<-180?360:0}},r}(e.Evented),Mi=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mi.prototype.getDefaultPosition=function(){return"bottom-right"},Mi.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mi.prototype._setElementTitle=function(e,t){var r=this._map._getUIString("AttributionControl."+t);e.title=r,e.setAttribute("aria-label",r)},Mi.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"))},Mi.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ei=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ei.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ei.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ei.prototype.getDefaultPosition=function(){return"bottom-left"},Ei.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Ei.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Ei.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var Ci=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ci.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},Ci.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;rt.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>Oi)throw new Error("maxPitch must be less than or equal to 60");var i=new Cn(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Pi,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"===typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Si(this,t);var a="string"===typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new Ln(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Mi({customAttribution:t.customAttribution})),this.addControl(new Ei,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null===e||void 0===e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=null===e||void 0===e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()Oi)throw new Error("maxPitch must be less than or equal to 60");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new Nn(e,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var o=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Nn(e,i,n.originalEvent)))},mouseout:function(t){o&&(o=!1,r.call(i,new Nn(e,i,t.originalEvent)))}}}}return{layer:t,listener:r,delegates:(n={},n[e]=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)},n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;return void 0===r?n.prototype.off.call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(n){for(var a=n[e],o=0;o180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Ni.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Ni.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ni.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Ni.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Ni.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Ni.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Ni.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Ni.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Ni.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Ni.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},n.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),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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))},n.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(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},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(e.Evented),Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},$i=0,Zi=!1,Xi=function(t){function n(r){t.call(this),this.options=e.extend({},Wi,r),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(t){var n;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Hi?n(Hi):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){Hi="denied"!==e.state,n(Hi)})):(Hi=!!e.window.navigator.geolocation,n(Hi)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(e.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,$i=0,Zi=!1},n.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitudet.getEast()||r.latitudet.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Zi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Gi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$i--,Zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++$i>1?(t={maximumAge:6e5,timeout:0},Zi=!0):(t=this.options.positionOptions,Zi=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),Yi={maxWidth:100,unit:"metric"},Ki=function(t){this.options=e.extend({},Yi,t),e.bindAll(["_onMove","setUnit"],this)};function Ji(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Qi(t,n,l/5280,e._getUIString("ScaleControl.Miles")):Qi(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Qi(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Qi(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Qi(t,n,s,e._getUIString("ScaleControl.Meters"))}function Qi(e,t,r,n){var i=function(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+" "+n}Ki.prototype.getDefaultPosition=function(){return"bottom-left"},Ki.prototype._onMove=function(){Ji(this._map,this._container,this.options)},Ki.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ki.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ki.prototype.setUnit=function(e){this.options.unit=e,Ji(this._map,this._container,this.options)};var ea=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};ea.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ea.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ea.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},ea.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ea.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},ea.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ea.prototype._isFullscreen=function(){return this._fullscreen},ea.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ea.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ta={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ra=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(ta),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._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 e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ui(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=ia(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Vi[a]+" translate("+u.x+"px,"+u.y+"px)"),qi(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(ra);e&&e.focus()}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function ia(t){if(t){if("number"===typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}}return ia(new e.Point(0,0))}var aa={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Di,NavigationControl:Bi,GeolocateControl:Xi,AttributionControl:Mi,ScaleControl:Ki,FullscreenControl:ea,Popup:na,Marker:Gi,Style:$t,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){Ne().acquire(De)},clearPrewarmedResources:function(){var e=Fe;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(De),Fe=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()"))},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return je.workerCount},set workerCount(e){je.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return aa})),r},"object"===typeof e&&"undefined"!==typeof t?t.exports=n():(r=r||self).mapboxgl=n()}}),wb=p({"src/plots/mapbox/layers.js"(e,t){var r=st(),n=At().sanitizeHTML,i=mb(),a=cb();function o(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var n=0;n0}function c(e){var t={},n={};switch(e.type){case"circle":r.extendFlat(n,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(n,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var a=e.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(t,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:n}}s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,l(e)){var r=function(e){var t,r=e.sourcetype,i=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof i?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=i,e.sourceattribution&&(a.attribution=n(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&l.click(n,t.originalEvent)}}},x.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(c)};var l=t.dragOptions;t.dragOptions=n.extendDeep(l||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){p(e,r,n,t.dragOptions,o)},s.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},x.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},x.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t1&&r.warn(p.multipleTokensErrorMsg),a[0]):(o.length&&r.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,o);t.accessToken=s;for(var l=0;lw/2){var k=v.split("|").join("
");b.text(k).attr("data-unformatted",k).call(c.convertToTspans,e),_=l.bBox(b.node())}b.attr("transform",n(-3,8-_.height)),x.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;_.width+6>w&&(T=w/(_.width+6));var S=[a.l+a.w*f.x[1],a.t+a.h*(1-f.y[0])];x.attr("transform",n(S[0],S[1])+i(T))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[h],n=0;n=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,i=new a(e,n.uid),o=i.sourceId,s=r(t),l=i.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}}}),Ib=p({"src/traces/choroplethmapbox/index.js"(e,t){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),t.exports={attributes:Eb(),supplyDefaults:Cb(),colorbar:No(),calc:Tg(),plot:Lb(),hoverPoints:Mg(),eventData:Eg(),selectPoints:Cg(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+d[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(t),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":f?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),Fb=p({"src/traces/densitymapbox/plot.js"(e,t){var r=jb(),n=cb().traceLayerPrefix;function i(e,t){this.type="densitymapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",n+t+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,n=this.layerList,i=r(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,a=new i(e,n.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),Bb=p({"src/traces/densitymapbox/hover.js"(e,t){var r=nr(),n=vb().hoverPoints,i=vb().getExtraText;t.exports=function(e,t,a){var o=n(e,t,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),Nb=p({"src/traces/densitymapbox/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),Ub=p({"src/traces/densitymapbox/index.js"(e,t){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),t.exports={attributes:Ob(),supplyDefaults:Rb(),colorbar:No(),formatLabels:fb(),calc:Db(),plot:Fb(),hoverPoints:Bb(),eventData:Nb(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;nESRI"},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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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}\n{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"}}}),Hb=p({"src/plots/map/styles/arcgis-sat.js"(e,t){t.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"}}]}}}),Gb=p({"src/plots/map/constants.js"(e,t){var r=We(),n=qb(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:Hb(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'\xa9 OpenStreetMap contributors',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":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);t.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),Wb=p({"src/plots/map/layout_attributes.js"(e,t){var r=st(),n=q().defaultLine,i=ka().attributes,a=D(),o=wn().textposition,s=Le().overrideAll,l=gt().templatedArray,c=Gb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.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:l("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:n},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:n}},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:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),$b=p({"src/traces/scattermap/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=Wm(),o=wn(),s=Wb(),l=N(),c=Lt(),u=R().extendFlat,h=Le().overrideAll,p=Wb(),d=a.line,f=a.marker;t.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},p.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:u({},f.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:d.color,width:d.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),Zb=p({"src/traces/scattermap/constants.js"(e,t){var r=["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"];t.exports={isSupportedFont:function(e){return-1!==r.indexOf(e)}}}}),Xb=p({"src/traces/scattermap/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Xn(),s=Yn(),l=$b(),c=Zb().isSupportedFont;t.exports=function(e,t,u,h){function p(n,i){return r.coerce(e,t,l,n,i)}function d(n,i){return r.coerce2(e,t,l,n,i)}var f=function(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}(0,t,p);if(f){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),n.hasMarkers(t)){i(e,t,u,h,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var m=t.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(t)&&(a(e,t,u,h,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),y=d("cluster.step"),v=d("cluster.color",t.marker&&t.marker.color||u),x=d("cluster.size"),b=d("cluster.opacity");if(p("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==b)||n.hasText(t)){var _=h.font.family;o(e,t,h,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(_)?_:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}p("fill"),"none"!==t.fill&&s(e,t,u,p),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),Yb=p({"src/traces/scattermap/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),Kb=p({"src/plots/map/convert_text_opts.js"(e,t){var r=st();t.exports=function(e,t){var n=e.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),Jb=p({"src/traces/scattermap/convert.js"(e,t){var r=k(),n=st(),i=T().BADNUM,a=Qm(),o=Wt(),s=Jt(),l=Zt(),c=$t(),u=Zb().isSupportedFont,h=Kb(),p=Xt().appendArrayPointValue,d=At().NEWLINES,f=At().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return n.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}function x(e,t){var r;if(n.isArrayOrTypedArray(e)&&n.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var i=1;i850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}t.exports=function(e,t){var i,u=t[0].trace,_=!0===u.visible&&0!==u._length,w="none"!==u.fill,k=c.hasLines(u),T=c.hasMarkers(u),S=c.hasText(u),A=T&&"circle"===u.marker.symbol,M=T&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),P=m("line"),L=m("circle"),I=m("symbol"),z={fill:C,line:P,circle:L,symbol:I};if(!_)return z;if((w||k)&&(i=a.calcTraceToLineCoords(t)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),k&&(P.geojson=a.makeLine(i),P.layout.visibility="visible",n.extendFlat(P.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),A){var O=function(e){var t,i,a,c,u=e[0].trace,h=u.marker,p=u.selectedpoints,d=n.isArrayOrTypedArray(h.color),f=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(e){return u.opacity*e}function y(e){return e/2}d&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),f&&(a=l(u)),m&&(c=function(e){return g(r(e)?+n.constrain(e,0,1):0)});var x,b=[];for(t=0;t=0;r--){var n=t[r];i.removeLayer(u.layerIds[n])}e||i.removeSource(u.sourceIds.circle)}(e):function(e){for(var t=a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n]),e||i.removeSource(u.sourceIds[n])}}(e)}function p(e){l?function(e){e||u.addSource("circle",o.circle,t.cluster);for(var r=a.cluster,n=0;n=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},t.exports=function(e,t){var r,i,s,l=t[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(e,l.uid,c,u),p=n(e.gd,t),d=h.below=e.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",p.circle,l.cluster),r=0;r")}function u(e){return e+"\xb0"}}t.exports={hoverPoints:function(e,t,a){var c=e.cd,u=c[0].trace,h=e.xa,p=e.ya,d=e.subplot,f=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=d.map.queryRenderedFeatures(null,{layers:[m]});f=y.map((function(e){return e.id}))}var v=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-v;if(r.getClosest(c,(function(e){var t=e.lonlat;if(t[0]===o)return 1/0;if(g&&-1===f.indexOf(e.i+1))return 1/0;var r=n.modHalf(t[0],360),i=t[1],s=d.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-p.c2p([r,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),e),!1!==e.index){var b=c[e.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],k=h.c2p(w),T=p.c2p(w),S=b.mrc||1;e.x0=k-S,e.x1=k+S,e.y0=T-S,e.y1=T+S;var A={};A[u.subplot]={_subplot:d};var M=u._module.formatLabels(b,u,A);return e.lonLabel=M.lonLabel,e.latLabel=M.latLabel,e.color=i(u,b),e.extraText=l(u,b,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}},getExtraText:l}}}),t_=p({"src/traces/scattermap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),r_=p({"src/traces/scattermap/select.js"(e,t){var r=st(),n=$t(),i=T().BADNUM;t.exports=function(e,t){var a,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===t)for(a=0;a1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var f=n(p);let m,g;function y(){return null==m&&(m="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){const e=5,t=new OffscreenCanvas(e,e).getContext("2d",{willReadFrequently:!0});if(t){for(let n=0;ni.solve(e)}const b=x(.25,.1,.25,1);function _(e,t,r){return Math.min(r,Math.max(t,e))}function w(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function k(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n(t.y-e.y)*(r.x-e.x)}function L(e){return"undefined"!=typeof WorkerGlobalScope&&void 0!==e&&e instanceof WorkerGlobalScope}let I=null;function z(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}const O="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function R(e,r,n,i,a){return t(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const t=new VideoFrame(e,{timestamp:0});try{const o=null==t?void 0:t.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);const s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield t.copyTo(l,function(e,t,r,n,i){const a=4*Math.max(-t,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,t),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(e.width,t+n)-l,height:Math.min(e.height,r+i)-c},layout:[{offset:o,stride:s}]}}(e,r,n,i,a)),s)for(let e=0;eL(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,G=function(e,r){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){const t=U(e.url);if(t)return t(e,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:V},r)}if(!(/^file:/.test(n=e.url)||/^file:/.test(H())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(e,r){return t(this,void 0,void 0,(function*(){const t=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:H(),signal:r.signal});"json"!==e.type||t.headers.has("Accept")||t.headers.set("Accept","application/json");const n=yield fetch(t);if(!n.ok){const t=yield n.blob();throw new q(n.status,n.statusText,e.url,t)}let i;i="arrayBuffer"===e.type||"image"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text();const a=yield i;if(r.signal.aborted)throw B();return{data:a,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}))}(e,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:V},r)}var n,i,a;return i=e,a=r,new Promise(((e,t)=>{var r;const n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(const a in i.headers)n.setRequestHeader(a,i.headers[a]);"json"===i.type&&(n.responseType="text",(null===(r=i.headers)||void 0===r?void 0:r.Accept)||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{t(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let a=n.response;if("json"===i.type)try{a=JSON.parse(n.response)}catch(r){return void t(r)}e({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{const e=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});t(new q(n.status,n.statusText,i.url,e))}},a.signal.addEventListener("abort",(()=>{n.abort(),t(B())})),n.send(i.body)}))};function W(e){if(!e||e.indexOf("://")<=0||0===e.indexOf("data:image/")||0===e.indexOf("blob:"))return!0;const t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function $(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Z(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class X{constructor(e){k(this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.type=e}}class Y extends X{constructor(e){super("error",k({error:e},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}class K{on(e,t){return this._listeners=this._listeners||{},$(e,t,this._listeners),this}off(e,t){return Z(e,t,this._listeners),Z(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},$(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new X(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const a of n)Z(r,a,this._oneTimeListeners),a.call(this,e);const i=this._eventedParent;i&&(k(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof Y&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var J={$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 Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ee(e,t){const r={};for(const n in e)"ref"!==n&&(r[n]=e[n]);return Q.forEach((e=>{e in t&&(r[e]=t[e])})),r}function te(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:[];this.parent=e,this.bindings={};for(const[r,n]of t)this.bindings[r]=n}concat(e){return new de(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const fe={kind:"null"},me={kind:"number"},ge={kind:"string"},ye={kind:"boolean"},ve={kind:"color"},xe={kind:"object"},be={kind:"value"},_e={kind:"collator"},we={kind:"formatted"},ke={kind:"padding"},Te={kind:"resolvedImage"},Se={kind:"variableAnchorOffsetCollection"};function Ae(e,t){return{kind:"array",itemType:e,N:t}}function Me(e){if("array"===e.kind){const t=Me(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ee=[fe,me,ge,ye,ve,we,xe,Ae(be),ke,Te,Se];function Ce(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ce(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ee)if(!Ce(e,t))return null}return`Expected ${Me(e)} but found ${Me(t)} instead.`}function Pe(e,t){return t.some((t=>t.kind===e.kind))}function Le(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Ie(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const ze=.96422,Oe=.82521,Re=4/29,De=6/29,je=3*De*De,Fe=De*De*De,Be=Math.PI/180,Ne=180/Math.PI;function Ue(e){return(e%=360)<0&&(e+=360),e}function Ve(e){let t,r,[n,i,a,o]=e;const s=He((.2225045*(n=qe(n))+.7168786*(i=qe(i))+.0606169*(a=qe(a)))/1);n===i&&i===a?t=r=s:(t=He((.4360747*n+.3850649*i+.1430804*a)/ze),r=He((.0139322*n+.0971045*i+.7141733*a)/Oe));const l=116*s-16;return[l<0?0:l,500*(t-s),200*(s-r),o]}function qe(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function He(e){return e>Fe?Math.pow(e,1/3):e/je+Re}function Ge(e){let[t,r,n,i]=e,a=(t+16)/116,o=isNaN(r)?a:a+r/500,s=isNaN(n)?a:a-n/200;return a=1*$e(a),o=ze*$e(o),s=Oe*$e(s),[We(3.1338561*o-1.6168667*a-.4906146*s),We(-.9787684*o+1.9161415*a+.033454*s),We(.0719453*o-.2289914*a+1.4052427*s),i]}function We(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function $e(e){return e>De?e*e*e:je*(e-Re)}function Ze(e){return parseInt(e.padEnd(2,e),16)/255}function Xe(e,t){return Ye(t?e/100:e,0,1)}function Ye(e,t,r){return Math.min(Math.max(t,e),r)}function Ke(e){return!e.some(Number.isNaN)}const Je={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 Qe{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Qe)return e;if("string"!=typeof e)return;const t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=Je[e];if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Ze(e.slice(r,r+=t)),Ze(e.slice(r,r+=t)),Ze(e.slice(r,r+=t)),Ze(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){const t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){const[e,r,n,i,a,o,s,l,c,u,h,p]=t,d=[i||" ",s||" ",u].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,o,c].join(""),t="%%%"===e?100:""===e?255:0;if(t){const e=[Ye(+r/t,0,1),Ye(+a/t,0,1),Ye(+l/t,0,1),h?Xe(+h,p):1];if(Ke(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const e=[+t,Ye(+i,0,100),Ye(+o,0,100),l?Xe(+l,c):1];if(Ke(e))return function(e){let[t,r,n,i]=e;function a(e){const i=(e+t/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=Ue(t),r/=100,n/=100,[a(0),a(8),a(4),i]}(e)}}}(e);return t?new Qe(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,i]=Ve(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ue(Math.atan2(n,r)*Ne):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ve(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${n})`}}Qe.black=new Qe(0,0,0,1),Qe.white=new Qe(1,1,1,1),Qe.transparent=new Qe(0,0,0,0),Qe.red=new Qe(1,0,0,1);class et{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tt{constructor(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class rt{constructor(e){this.sections=e}static fromString(e){return new rt([new tt(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof rt?e:rt.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class nt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof nt)return e;if("number"==typeof e)return new nt([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new nt(e)}}toString(){return JSON.stringify(this.values)}}const it=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class at{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof at)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function lt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Qe||e instanceof et||e instanceof rt||e instanceof nt||e instanceof at||e instanceof ot)return!0;if(Array.isArray(e)){for(const t of e)if(!lt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!lt(e[t]))return!1;return!0}return!1}function ct(e){if(null===e)return fe;if("string"==typeof e)return ge;if("boolean"==typeof e)return ye;if("number"==typeof e)return me;if(e instanceof Qe)return ve;if(e instanceof et)return _e;if(e instanceof rt)return we;if(e instanceof nt)return ke;if(e instanceof at)return Se;if(e instanceof ot)return Te;if(Array.isArray(e)){const t=e.length;let r;for(const n of e){const e=ct(n);if(r){if(r===e)continue;r=be;break}r=e}return Ae(r||be,t)}return xe}function ut(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Qe||e instanceof rt||e instanceof nt||e instanceof at||e instanceof ot?e.toString():JSON.stringify(e)}class ht{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!lt(e[1]))return t.error("invalid value");const r=e[1];let n=ct(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ht(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class pt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const dt={string:ge,number:me,boolean:ye,object:xe};class ft{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in dt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=dt[r],n++}else i=be;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=Ae(i,a)}else{if(!dt[i])throw new Error(`Types doesn't contain name = ${i}`);r=dt[i]}const a=[];for(;ne.outputDefined()))}}const mt={"to-boolean":ye,"to-color":ve,"to-number":me,"to-string":ge};class gt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!mt[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=mt[r],i=[];for(let a=1;a4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:st(t[0],t[1],t[2],t[3]),!r))return new Qe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new pt(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=nt.parse(t);if(n)return n}throw new pt(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=at.parse(t);if(n)return n}throw new pt(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new pt(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return rt.fromString(ut(this.args[0].evaluate(e)));case"resolvedImage":return ot.fromString(ut(this.args[0].evaluate(e)));default:return ut(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const yt=["Unknown","Point","LineString","Polygon"];class vt{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?"number"==typeof this.feature.type?yt[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(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Qe.parse(e)),t}}class xt{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new de,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];this.registry=e,this.path=r,this.key=r.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new ft(t,[e]):"coerce"===r?new gt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const a=this.registry[i];if(a){let i=a.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==e.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof ht)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){const e=new vt;try{i=new ht(i.type,i.evaluate(e))}catch(n){return this.error(n.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new xt(this.registry,this._isConstant,n,t||null,i,this.errors)}error(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n`[${e}]`)).join("")}`;this.errors.push(new pe(i,e))}checkSubtype(e,t){const r=Ce(e,t);return r&&this.error(r),r}}class bt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let i=1;i=r.length)throw new pt(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new pt(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class kt{constructor(e,t){this.type=ye,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,be),n=t.parse(e[2],2,be);return r&&n?Pe(r.type,[ye,ge,me,fe,be])?new kt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Me(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Le(t,["boolean","string","number","null"]))throw new pt(`Expected first argument to be of type boolean, string, number or null, but found ${Me(ct(t))} instead.`);if(!Le(r,["string","array"]))throw new pt(`Expected second argument to be of type array or string, but found ${Me(ct(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Tt{constructor(e,t,r){this.type=me,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,be),n=t.parse(e[2],2,be);if(!r||!n)return null;if(!Pe(r.type,[ye,ge,me,fe,be]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Me(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,me);return i?new Tt(r,n,i):null}return new Tt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Le(t,["boolean","string","number","null"]))throw new pt(`Expected first argument to be of type boolean, string, number or null, but found ${Me(ct(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Le(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(Le(r,["array"]))return r.indexOf(t,n);throw new pt(`Expected second argument to be of type array or string, but found ${Me(ct(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class St{constructor(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},a=[];for(let l=2;lNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ct(e)))return null}else r=ct(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=a.length}const u=t.parse(s,l,n);if(!u)return null;n=n||u.type,a.push(u)}const o=t.parse(e[1],1,be);if(!o)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==o.type.kind&&t.concat(1).checkSubtype(r,o.type)?null:new St(r,n,o,i,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(ct(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class At{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let a=1;a{let[t,r]=e;return r.outputDefined()}))&&this.otherwise.outputDefined()}}class Mt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,be),n=t.parse(e[2],2,me);if(!r||!n)return null;if(!Pe(r.type,[Ae(be),ge,be]))return t.error(`Expected first argument to be of type array or string, but found ${Me(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,me);return i?new Mt(r.type,r,n,i):null}return new Mt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Le(t,["string"]))return[...t].slice(r,n).join("");if(Le(t,["array"]))return t.slice(r,n);throw new pt(`Expected first argument to be of type array or string, but found ${Me(ct(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Et(e,t){const r=e.length-1;let n,i,a=0,o=r,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),n=e[s],i=e[s+1],n<=t){if(s===r||tt))throw new pt("Input is not a number.");o=s-1}return 0}class Ct{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[n,i]of r)this.labels.push(n),this.outputs.push(i)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,me);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let a=1;a=r)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([r,c])}return new Ct(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Et(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}var Pt=Lt;function Lt(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}Lt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var It,zt=(It=Pt)&&It.__esModule&&Object.prototype.hasOwnProperty.call(It,"default")?It.default:It;function Ot(e,t,r){return e+r*(t-e)}function Rt(e,t,r){return e.map(((e,n)=>Ot(e,t[n],r)))}const Dt={number:Ot,color:function(e,t,r){switch(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb"){case"rgb":{const[n,i,a,o]=Rt(e.rgb,t.rgb,r);return new Qe(n,i,a,o,!1)}case"hcl":{const[n,i,a,o]=e.hcl,[s,l,c,u]=t.hcl;let h,p;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?h=NaN:(h=s,1!==a&&0!==a||(p=l)):(h=n,1!==c&&0!==c||(p=i));else{let e=s-n;s>n&&e>180?e-=360:s180&&(e+=360),h=n+r*e}const[d,f,m,g]=function(e){let[t,r,n,i]=e;return t=isNaN(t)?0:t*Be,Ge([n,Math.cos(t)*r,Math.sin(t)*r,i])}([h,null!=p?p:Ot(i,l,r),Ot(a,c,r),Ot(o,u,r)]);return new Qe(d,f,m,g,!1)}case"lab":{const[n,i,a,o]=Ge(Rt(e.lab,t.lab,r));return new Qe(n,i,a,o,!1)}}},array:Rt,padding:function(e,t,r){return new nt(Rt(e.values,t.values,r))},variableAnchorOffsetCollection:function(e,t,r){const n=e.values,i=t.values;if(n.length!==i.length)throw new pt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let o=0;o"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,me),!i)return null;const o=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=ve:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let l=0;l=e)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(r,i,s);if(!c)return null;s=s||c.type,o.push([e,c])}return Ie(s,me)||Ie(s,ve)||Ie(s,ke)||Ie(s,Se)||Ie(s,Ae(me))?new jt(s,r,n,i,o):t.error(`Type ${Me(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const a=Et(t,n),o=jt.interpolationFactor(this.interpolation,n,t[a],t[a+1]),s=r[a].evaluate(e),l=r[a+1].evaluate(e);switch(this.operator){case"interpolate":return Dt[this.type.kind](s,l,o);case"interpolate-hcl":return Dt.color(s,l,o,"hcl");case"interpolate-lab":return Dt.color(s,l,o,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Ft(e,t,r,n){const i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}class Bt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const o of e.slice(1)){const e=t.parse(o,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}if(!r)throw new Error("No output type");const a=n&&i.some((e=>Ce(n,e.type)));return new Bt(a?be:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(e),r&&r instanceof ot&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Nt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Ut(e,t,r,n){return 0===n.compare(t,r)}function Vt(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=ye,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,be);if(!a)return null;if(!Nt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${Me(a.type)}'.`);let o=t.parse(e[2],2,be);if(!o)return null;if(!Nt(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${Me(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${Me(a.type)}' and '${Me(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ft(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ft(a.type,[o])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,_e),!s)return null}return new i(a,o,s)}evaluate(i){const a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=ct(a),r=ct(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new pt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=ct(a),r=ct(o);if("string"!==e.kind||"string"!==r.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const qt=Vt("==",(function(e,t,r){return t===r}),Ut),Ht=Vt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Ut(0,t,r,n)})),Gt=Vt("<",(function(e,t,r){return t",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),$t=Vt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Zt=Vt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Xt{constructor(e,t,r){this.type=_e,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ye);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ye);if(!i)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,ge),!a)?null:new Xt(n,i,a)}evaluate(e){return new et(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Yt{constructor(e,t,r,n,i){this.type=ge,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,me);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,ge),!i))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,ge),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=t.parse(n["min-fraction-digits"],1,me),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=t.parse(n["max-fraction-digits"],1,me),!s)?null:new Yt(r,i,a,o,s)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Kt{constructor(e){this.type=we,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let a=1;a<=e.length-1;++a){const r=e[a];if(i&&"object"==typeof r&&!Array.isArray(r)){i=!1;let e=null;if(r["font-scale"]&&(e=t.parse(r["font-scale"],1,me),!e))return null;let a=null;if(r["text-font"]&&(a=t.parse(r["text-font"],1,Ae(ge)),!a))return null;let o=null;if(r["text-color"]&&(o=t.parse(r["text-color"],1,ve),!o))return null;const s=n[n.length-1];s.scale=e,s.font=a,s.textColor=o}else{const r=t.parse(e[a],1,be);if(!r)return null;const o=r.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:r,scale:null,font:null,textColor:null})}}return new Kt(n)}evaluate(e){return new rt(this.sections.map((t=>{const r=t.content.evaluate(e);return ct(r)===Te?new tt("",r,null,null,null):new tt(ut(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class Jt{constructor(e){this.type=Te,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ge);return r?new Jt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=ot.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Qt{constructor(e){this.type=me,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${Me(r.type)} instead.`):new Qt(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new pt(`Expected value to be of type string or array, but found ${Me(ct(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const er=8192;function tr(e,t){const r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*er),Math.round(n*i*er)]}function rr(e,t){const r=Math.pow(2,t.z);return[(i=(e[0]/er+t.x)/r,360*i-180),(n=(e[1]/er+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function ir(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function ar(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(e,t,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*a[0]&&!(!pr(e,t,r,n)||!pr(r,n,e,t));var i,a}function sr(e,t,r){for(const n of r)for(let r=0;r2&&void 0!==arguments[2]&&arguments[2],n=!1;for(const s of t)for(let t=0;t(i=e)[1]!=(o=s[t+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function cr(e,t){for(const r of t)if(lr(e,r))return!0;return!1}function ur(e,t){for(const r of e)if(!lr(r,t))return!1;for(let r=0;r0&&s<0||o<0&&s>0}function dr(e,t,r){const n=[];for(let i=0;ir[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}nr(t,e)}function gr(e,t,r,n){const i=Math.pow(2,n.z)*er,a=[n.x*er,n.y*er],o=[];for(const s of e)for(const e of s){const n=[e.x+a[0],e.y+a[1]];mr(n,t,r,i),o.push(n)}return o}function yr(e,t,r,n){const i=Math.pow(2,n.z)*er,a=[n.x*er,n.y*er],o=[];for(const l of e){const e=[];for(const r of l){const n=[r.x+a[0],r.y+a[1]];nr(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of o)for(const n of e)mr(n,t,r,i)}var s;return o}class vr{constructor(e,t){this.type=ye,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(lt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length)return new vr(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new vr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new vr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const a=dr(t.coordinates,n,i),o=gr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!lr(e,a))return!1}if("MultiPolygon"===t.type){const a=fr(t.coordinates,n,i),o=gr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!cr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const a=dr(t.coordinates,n,i),o=yr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!ur(e,a))return!1}if("MultiPolygon"===t.type){const a=fr(t.coordinates,n,i),o=yr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!hr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t)=>et?1:0;if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e=0)break;t[e]=t[n],e=n}t[e]=i}};function br(e,t,r,n,i){_r(e,t,r,n||e.length-1,i||kr)}function _r(e,t,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);_r(e,t,Math.max(r,Math.floor(t-o*l/a+c)),Math.min(n,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],h=r,p=n;for(wr(e,r,t),i(e[n],u)>0&&wr(e,r,n);h0;)p--}0===i(e[r],u)?wr(e,r,p):wr(e,++p,n),p<=t&&(r=p+1),t<=p&&(n=p-1)}}function wr(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function kr(e,t){return et?1:0}function Tr(e,t){if(e.length<=1)return[e];const r=[];let n,i;for(const a of e){const e=Ar(a);0!==e&&(a.area=Math.abs(e),void 0===i&&(i=e<0),i===e<0?(n&&r.push(n),n=[a]):n.push(a))}if(n&&r.push(n),t>1)for(let a=0;a1?(l=e[s+1][0],c=e[s+1][1]):p>0&&(l+=u/this.kx*p,c+=h/this.ky*p)),u=this.wrap(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;const d=u*u+h*h;d180;)e-=360;return e}}function Lr(e,t){return t[0]-e[0]}function Ir(e){return e[1]-e[0]+1}function zr(e,t){return e[1]>=e[0]&&e[1]e[1])return[null,null];const r=Ir(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Rr(e,t){if(!zr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)nr(r,e[n]);return r}function Dr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)nr(t,e);return t}function jr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Fr(e,t,r){if(!jr(e)||!jr(t))return NaN;let n=0,i=0;return e[2]t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]3&&void 0!==arguments[3]?arguments[3]:1/0;const i=Dr(e),a=Dr(t);if(n!==1/0&&Fr(i,a,r)>=n)return n;if(ir(i,a)){if(Gr(e,t))return 0}else if(Gr(t,e))return 0;let o=1/0;for(const s of e)for(let e=0,n=s.length,i=n-1;e4&&void 0!==arguments[4]?arguments[4]:1/0,a=Math.min(n.distance(e[0],r[0][0]),i);if(0===a)return a;const o=new xr([[0,[0,e.length-1],[0,0]]],Lr),s=Dr(r);for(;o.length>0;){const i=o.pop();if(i[0]>=a)continue;const l=i[1],c=t?50:100;if(Ir(l)<=c){if(!zr(l,e.length))return NaN;if(t){const t=Hr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const i=qr(e[t],r,n);if(a=Math.min(a,i),0===a)return 0}}else{const r=Or(l,t);$r(o,a,n,e,s,r[0]),$r(o,a,n,e,s,r[1])}}return a}function Yr(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,o=Math.min(a,i.distance(e[0],r[0]));if(0===o)return o;const s=new xr([[0,[0,e.length-1],[0,r.length-1]]],Lr);for(;s.length>0;){const a=s.pop();if(a[0]>=o)continue;const l=a[1],c=a[2],u=t?50:100,h=n?50:100;if(Ir(l)<=u&&Ir(c)<=h){if(!zr(l,e.length)&&zr(c,r.length))return NaN;let a;if(t&&n)a=Ur(e,l,r,c,i),o=Math.min(o,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=c[0];e<=c[1];++e)if(a=Br(r[e],t,i),o=Math.min(o,a),0===o)return o}else if(!t&&n){const t=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Br(e[r],t,i),o=Math.min(o,a),0===o)return o}else a=Vr(e,l,r,c,i),o=Math.min(o,a)}else{const a=Or(l,t),u=Or(c,n);Zr(s,o,i,e,r,a[0],u[0]),Zr(s,o,i,e,r,a[0],u[1]),Zr(s,o,i,e,r,a[1],u[0]),Zr(s,o,i,e,r,a[1],u[1])}}return o}function Kr(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Jr{constructor(e,t){this.type=me,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(lt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Jr(t,t.features.map((e=>Kr(e.geometry))).flat());if("Feature"===t.type)return new Jr(t,Kr(t.geometry));if("type"in t&&"coordinates"in t)return new Jr(t,Kr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>rr([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new Pr(n[0][1]);let a=1/0;for(const o of t){switch(o.type){case"Point":a=Math.min(a,Yr(n,!1,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Yr(n,!1,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!1,o.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>rr([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new Pr(n[0][1]);let a=1/0;for(const o of t){switch(o.type){case"Point":a=Math.min(a,Yr(n,!0,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Yr(n,!0,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!0,o.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=Tr(r,0).map((t=>t.map((t=>t.map((t=>rr([t.x,t.y],e.canonical))))))),i=new Pr(n[0][0][0][1]);let a=1/0;for(const o of t)for(const e of n){switch(o.type){case"Point":a=Math.min(a,Xr([o.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Xr(o.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Wr(e,o.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Qr={"==":qt,"!=":Ht,">":Wt,"<":Gt,">=":Zt,"<=":$t,array:ft,at:wt,boolean:ft,case:At,coalesce:Bt,collator:Xt,format:Kt,image:Jt,in:kt,"index-of":Tt,interpolate:jt,"interpolate-hcl":jt,"interpolate-lab":jt,length:Qt,let:bt,literal:ht,match:St,number:ft,"number-format":Yt,object:ft,slice:Mt,step:Ct,string:ft,"to-boolean":gt,"to-color":gt,"to-number":gt,"to-string":gt,var:_t,within:vr,distance:Jr};class en{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=en.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((t=>{let[r]=t;return!Array.isArray(r)||r.length===e.length-1}));let s=null;for(const[l,c]of o){s=new xt(t.registry,on,t.path,null,t.scope);const n=[];let a=!1;for(let t=1;t{let[t]=e;return r=t,Array.isArray(r)?`(${r.map(Me).join(", ")})`:`(${Me(r.type)}...)`;var r})).join(" | "),n=[];for(let i=1;i{r=t?r&&on(e):r&&e instanceof ht})),!!r&&sn(e)&&cn(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(e){if(e instanceof en){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof vr)return!1;if(e instanceof Jr)return!1;let t=!0;return e.eachChild((e=>{t&&!sn(e)&&(t=!1)})),t}function ln(e){if(e instanceof en&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!ln(e)&&(t=!1)})),t}function cn(e,t){if(e instanceof en&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!cn(e,t)&&(r=!1)})),r}function un(e){return{result:"success",value:e}}function hn(e){return{result:"error",value:e}}function pn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function dn(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function fn(e){return!!e.expression&&e.expression.interpolated}function mn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function gn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function yn(e){return e}function vn(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),a=e.type||(fn(t)?"exponential":"interval");if(r||"padding"===t.type){const n=r?Qe.parse:nt.parse;(e=he({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],n(e[1])]))),e.default=n(e.default?e.default:t.default)}if(e.colorSpace&&"rgb"!==(o=e.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${e.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=wn;else if("interval"===a)s=_n;else if("categorical"===a){s=bn,l=Object.create(null);for(const t of e.stops)l[t[0]]=t[1];c=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=kn}if(n){const r={},n=[];for(let t=0;te[0])),evaluate:(r,n)=>{let{zoom:a}=r;return wn({stops:i,base:e.base},t,a).evaluate(a,n)}}}if(i){const r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:jt.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:r=>{let{zoom:n}=r;return s(e,t,n,l,c)}}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?xn(e.default,t.default):s(e,t,i,l,c)}}}function xn(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function bn(e,t,r,n,i){return xn(typeof r===i?n[r]:void 0,e.default,t.default)}function _n(e,t,r){if("number"!==mn(r))return xn(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Et(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function wn(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==mn(r))return xn(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const a=Et(e.stops.map((e=>e[0])),r),o=function(e,t,r,n){const i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=Dt[t.type]||yn;return"function"==typeof s.evaluate?{evaluate(){for(var t=arguments.length,r=new Array(t),n=0;n{let[r]=t;throw new pt(r.evaluate(e))}],typeof:[ge,[be],(e,t)=>{let[r]=t;return Me(ct(r.evaluate(e)))}],"to-rgba":[Ae(me,4),[ve],(e,t)=>{let[r]=t;const[n,i,a,o]=r.evaluate(e).rgb;return[255*n,255*i,255*a,o]}],rgb:[ve,[me,me,me],tn],rgba:[ve,[me,me,me,me],tn],has:{type:ye,overloads:[[[ge],(e,t)=>{let[r]=t;return rn(r.evaluate(e),e.properties())}],[[ge,xe],(e,t)=>{let[r,n]=t;return rn(r.evaluate(e),n.evaluate(e))}]]},get:{type:be,overloads:[[[ge],(e,t)=>{let[r]=t;return nn(r.evaluate(e),e.properties())}],[[ge,xe],(e,t)=>{let[r,n]=t;return nn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[be,[ge],(e,t)=>{let[r]=t;return nn(r.evaluate(e),e.featureState||{})}],properties:[xe,[],e=>e.properties()],"geometry-type":[ge,[],e=>e.geometryType()],id:[be,[],e=>e.id()],zoom:[me,[],e=>e.globals.zoom],"heatmap-density":[me,[],e=>e.globals.heatmapDensity||0],"line-progress":[me,[],e=>e.globals.lineProgress||0],accumulated:[be,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[me,an(me),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[me,an(me),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:me,overloads:[[[me,me],(e,t)=>{let[r,n]=t;return r.evaluate(e)-n.evaluate(e)}],[[me],(e,t)=>{let[r]=t;return-r.evaluate(e)}]]},"/":[me,[me,me],(e,t)=>{let[r,n]=t;return r.evaluate(e)/n.evaluate(e)}],"%":[me,[me,me],(e,t)=>{let[r,n]=t;return r.evaluate(e)%n.evaluate(e)}],ln2:[me,[],()=>Math.LN2],pi:[me,[],()=>Math.PI],e:[me,[],()=>Math.E],"^":[me,[me,me],(e,t)=>{let[r,n]=t;return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[me,[me],(e,t)=>{let[r]=t;return Math.sqrt(r.evaluate(e))}],log10:[me,[me],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))/Math.LN10}],ln:[me,[me],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))}],log2:[me,[me],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))/Math.LN2}],sin:[me,[me],(e,t)=>{let[r]=t;return Math.sin(r.evaluate(e))}],cos:[me,[me],(e,t)=>{let[r]=t;return Math.cos(r.evaluate(e))}],tan:[me,[me],(e,t)=>{let[r]=t;return Math.tan(r.evaluate(e))}],asin:[me,[me],(e,t)=>{let[r]=t;return Math.asin(r.evaluate(e))}],acos:[me,[me],(e,t)=>{let[r]=t;return Math.acos(r.evaluate(e))}],atan:[me,[me],(e,t)=>{let[r]=t;return Math.atan(r.evaluate(e))}],min:[me,an(me),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[me,an(me),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[me,[me],(e,t)=>{let[r]=t;return Math.abs(r.evaluate(e))}],round:[me,[me],(e,t)=>{let[r]=t;const n=r.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[me,[me],(e,t)=>{let[r]=t;return Math.floor(r.evaluate(e))}],ceil:[me,[me],(e,t)=>{let[r]=t;return Math.ceil(r.evaluate(e))}],"filter-==":[ye,[ge,be],(e,t)=>{let[r,n]=t;return e.properties()[r.value]===n.value}],"filter-id-==":[ye,[be],(e,t)=>{let[r]=t;return e.id()===r.value}],"filter-type-==":[ye,[ge],(e,t)=>{let[r]=t;return e.geometryType()===r.value}],"filter-<":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[ye,[be],(e,t)=>{let[r]=t;return r.value in e.properties()}],"filter-has-id":[ye,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ye,[Ae(ge)],(e,t)=>{let[r]=t;return r.value.indexOf(e.geometryType())>=0}],"filter-id-in":[ye,[Ae(be)],(e,t)=>{let[r]=t;return r.value.indexOf(e.id())>=0}],"filter-in-small":[ye,[ge,Ae(be)],(e,t)=>{let[r,n]=t;return n.value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[ye,[ge,Ae(be)],(e,t)=>{let[r,n]=t;return function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:ye,overloads:[[[ye,ye],(e,t)=>{let[r,n]=t;return r.evaluate(e)&&n.evaluate(e)}],[an(ye),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:ye,overloads:[[[ye,ye],(e,t)=>{let[r,n]=t;return r.evaluate(e)||n.evaluate(e)}],[an(ye),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[ye,[ye],(e,t)=>{let[r]=t;return!r.evaluate(e)}],"is-supported-script":[ye,[ge],(e,t)=>{let[r]=t;const n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[ge,[ge],(e,t)=>{let[r]=t;return r.evaluate(e).toUpperCase()}],downcase:[ge,[ge],(e,t)=>{let[r]=t;return r.evaluate(e).toLowerCase()}],concat:[ge,an(be),(e,t)=>t.map((t=>ut(t.evaluate(e)))).join("")],"resolved-locale":[ge,[_e],(e,t)=>{let[r]=t;return r.evaluate(e).resolvedLocale()}]});class Tn{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new vt,this._defaultValue=t?"color"===(r=t).type&&gn(r.default)?new Qe(0,0,0,0):"color"===r.type?Qe.parse(r.default)||null:"padding"===r.type?nt.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?at.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new pt(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(o){return this._warningHistory[o.message]||(this._warningHistory[o.message]=!0,"undefined"!=typeof console&&console.warn(o.message)),this._defaultValue}}}function Sn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Qr}function An(e,t){const r=new xt(Qr,on,[],t?function(e){const t={color:ve,string:ge,number:me,enum:ge,boolean:ye,formatted:we,padding:ke,resolvedImage:Te,variableAnchorOffsetCollection:Se};return"array"===e.type?Ae(t[e.value]||be,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?un(new Tn(n,t)):hn(r.errors)}class Mn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!ln(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}}class En{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!ln(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}interpolationFactor(e,t,r){return this.interpolationType?jt.interpolationFactor(this.interpolationType,e,t,r):0}}function Cn(e,t){const r=An(e,t);if("error"===r.result)return r;const n=r.value.expression,i=sn(n);if(!i&&!pn(t))return hn([new pe("","data expressions not supported")]);const a=cn(n,["zoom"]);if(!a&&!dn(t))return hn([new pe("","zoom expressions not supported")]);const o=Ln(n);return o||a?o instanceof pe?hn([o]):o instanceof jt&&!fn(t)?hn([new pe("",'"interpolate" expressions cannot be used with this property')]):un(o?new En(i?"camera":"composite",r.value,o.labels,o instanceof jt?o.interpolation:void 0):new Mn(i?"constant":"source",r.value)):hn([new pe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Pn{constructor(e,t){this._parameters=e,this._specification=t,he(this,vn(this._parameters,this._specification))}static deserialize(e){return new Pn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ln(e){let t=null;if(e instanceof bt)t=Ln(e.result);else if(e instanceof Bt){for(const r of e.args)if(t=Ln(r),t)break}else(e instanceof Ct||e instanceof jt)&&e.input instanceof en&&"zoom"===e.input.name&&(t=e);return t instanceof pe||e.eachChild((e=>{const r=Ln(e);r instanceof pe?t=r:!t&&r?t=new pe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new pe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function In(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!In(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function On(e){if(null==e)return{filter:()=>!0,needGeometry:!1};In(e)||(e=jn(e));const t=An(e,zn);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,n)=>t.value.evaluate(e,r,{},n),needGeometry:Dn(e)}}function Rn(e,t){return et?1:0}function Dn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?Fn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(jn))):"all"===t?["all"].concat(e.slice(1).map(jn)):"none"===t?["all"].concat(e.slice(1).map(jn).map(Un)):"in"===t?Bn(e[1],e.slice(2)):"!in"===t?Un(Bn(e[1],e.slice(2))):"has"===t?Nn(e[1]):"!has"!==t||Un(Nn(e[1]));var r}function Fn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function Bn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Rn)]]:["filter-in-small",e,["literal",t]]}}function Nn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Un(e){return["!",e]}function Vn(e){const t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const r of e)t+=`${Vn(r)},`;return`${t}]`}const r=Object.keys(e).sort();let n="{";for(let i=0;in.maximum?[new ue(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Yn(e){const t=e.valueSpec,r=Gn(e.value.type);let n,i,a,o={};const s="categorical"!==r&&void 0===e.value.property,l=!s,c="array"===mn(e.value.stops)&&"array"===mn(e.value.stops[0])&&"object"===mn(e.value.stops[0][0]),u=$n({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new ue(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const n=e.value;return t=t.concat(Zn({key:e.key,value:n,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===mn(n)&&0===n.length&&t.push(new ue(e.key,n,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&s&&u.push(new ue(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new ue(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!fn(e.valueSpec)&&u.push(new ue(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!pn(e.valueSpec)?u.push(new ue(e.key,e.value,"property functions not supported")):s&&!dn(e.valueSpec)&&u.push(new ue(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==e.value.property||u.push(new ue(e.key,e.value,'"property" property is required')),u;function h(e){let r=[];const n=e.value,s=e.key;if("array"!==mn(n))return[new ue(s,n,`array expected, ${mn(n)} found`)];if(2!==n.length)return[new ue(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==mn(n[0]))return[new ue(s,n,`object expected, ${mn(n[0])} found`)];if(void 0===n[0].zoom)return[new ue(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ue(s,n,"object stop key must have value")];if(a&&a>Gn(n[0].zoom))return[new ue(s,n[0].zoom,"stop zoom values must appear in ascending order")];Gn(n[0].zoom)!==a&&(a=Gn(n[0].zoom),i=void 0,o={}),r=r.concat($n({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Xn,value:p}}))}else r=r.concat(p({key:`${s}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return Sn(Wn(n[1]))?r.concat([new ue(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${s}[1]`,value:n[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,a){const s=mn(e.value),l=Gn(e.value),c=null!==e.value?e.value:a;if(n){if(s!==n)return[new ue(e.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ue(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let n=`number expected, ${s} found`;return pn(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ue(e.key,c,n)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==i&&lnew ue(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new ue(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!ln(r))return[new ue(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!ln(r))return[new ue(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ue(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!sn(r))return[new ue(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(e){const t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gn(r))&&i.push(new ue(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ue(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(e){return In(Wn(e.value))?Kn(he({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ei(e)}function ei(e){const t=e.value,r=e.key;if("array"!==mn(t))return[new ue(r,t,`array expected, ${mn(t)} found`)];const n=e.styleSpec;let i,a=[];if(t.length<1)return[new ue(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Jn({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Gn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Gn(t[1])&&a.push(new ue(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&a.push(new ue(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(i=mn(t[1]),"string"!==i&&a.push(new ue(`${r}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o{e in r&&t.push(new ue(n,r[e],`"${e}" is prohibited for ref layers`))})),i.layers.forEach((t=>{Gn(t.id)===s&&(e=t)})),e?e.ref?t.push(new ue(n,r.ref,"ref cannot reference another ref layer")):o=Gn(e.type):t.push(new ue(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){const e=i.sources&&i.sources[r.source],a=e&&Gn(e.type);e?"vector"===a&&"raster"===o?t.push(new ue(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?t.push(new ue(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?t.push(new ue(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?t.push(new ue(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&e.lineMetrics||t.push(new ue(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ue(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ue(n,r.source,`source "${r.source}" not found`))}else t.push(new ue(n,r,'missing required property "source"'));return t=t.concat($n({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:e=>$n({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>ni(he({layerType:o},e))}}),paint:e=>$n({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>ri(he({layerType:o},e))}})}})),t}function ai(e){const t=e.value,r=e.key,n=mn(t);return"string"!==n?[new ue(r,t,`string expected, ${n} found`)]:[]}const oi={promoteId:function(e){let{key:t,value:r}=e;if("string"===mn(r))return ai({key:t,value:r});{const e=[];for(const n in r)e.push(...ai({key:`${t}.${n}`,value:r[n]}));return e}}};function si(e){const t=e.value,r=e.key,n=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new ue(r,t,'"type" is required')];const o=Gn(t.type);let s;switch(o){case"vector":case"raster":return s=$n({key:r,value:t,valueSpec:n[`source_${o.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),s;case"raster-dem":return s=function(e){var t;const r=null!==(t=e.sourceName)&&void 0!==t?t:"",n=e.value,i=e.styleSpec,a=i.source_raster_dem,o=e.style;let s=[];const l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ue("source_raster_dem",n,`object expected, ${l} found`)),s;const c="custom"===Gn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(const p in n)!c&&u.includes(p)?s.push(new ue(p,n[p],`In "${r}": "${p}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[p]?s=s.concat(e.validateSpec({key:p,value:n[p],valueSpec:a[p],validateSpec:e.validateSpec,style:o,styleSpec:i})):s.push(new ue(p,n[p],`unknown property "${p}"`));return s}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:a}),s;case"geojson":if(s=$n({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),t.cluster)for(const e in t.clusterProperties){const[n,i]=t.clusterProperties[e],o="string"==typeof n?[n,["accumulated"],["get",e]]:n;s.push(...Kn({key:`${r}.${e}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Kn({key:`${r}.${e}.reduce`,value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return $n({key:r,value:t,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return $n({key:r,value:t,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ue(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function li(e){const t=e.value,r=e.styleSpec,n=r.light,i=e.style;let a=[];const o=mn(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new ue("light",t,`object expected, ${o} found`)]),a;for(const s in t){const o=s.match(/^(.*)-transition$/);a=a.concat(o&&n[o[1]]&&n[o[1]].transition?e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r}):n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)])}return a}function ci(e){const t=e.value,r=e.styleSpec,n=r.sky,i=e.style,a=mn(t);if(void 0===t)return[];if("object"!==a)return[new ue("sky",t,`object expected, ${a} found`)];let o=[];for(const s in t)o=o.concat(n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)]);return o}function ui(e){const t=e.value,r=e.styleSpec,n=r.terrain,i=e.style;let a=[];const o=mn(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new ue("terrain",t,`object expected, ${o} found`)]),a;for(const s in t)a=a.concat(n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)]);return a}function hi(e){let t=[];const r=e.value,n=e.key;if(Array.isArray(r)){const i=[],a=[];for(const o in r)r[o].id&&i.includes(r[o].id)&&t.push(new ue(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&t.push(new ue(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),t=t.concat($n({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return ai({key:n,value:r})}const pi={"*":()=>[],array:Zn,boolean:function(e){const t=e.value,r=e.key,n=mn(t);return"boolean"!==n?[new ue(r,t,`boolean expected, ${n} found`)]:[]},number:Xn,color:function(e){const t=e.key,r=e.value,n=mn(r);return"string"!==n?[new ue(t,r,`color expected, ${n} found`)]:Qe.parse(String(r))?[]:[new ue(t,r,`color expected, "${r}" found`)]},constants:Hn,enum:Jn,filter:Qn,function:Yn,layer:ii,object:$n,source:si,light:li,sky:ci,terrain:ui,projection:function(e){const t=e.value,r=e.styleSpec,n=r.projection,i=e.style,a=mn(t);if(void 0===t)return[];if("object"!==a)return[new ue("projection",t,`object expected, ${a} found`)];let o=[];for(const s in t)o=o.concat(n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)]);return o},string:ai,formatted:function(e){return 0===ai(e).length?[]:Kn(e)},resolvedImage:function(e){return 0===ai(e).length?[]:Kn(e)},padding:function(e){const t=e.key,r=e.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ue(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let i=[];for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:J,r=[];return r=r.concat(di({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:di,objectElementValidators:{glyphs:fi,"*":()=>[]}})),e.constants&&(r=r.concat(Hn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:di}))),yi(r)}function gi(e){return function(t){return e(((e,t)=>r(e,i(t)))(((e,t)=>{for(var r in t||(t={}))l.call(t,r)&&u(e,r,t[r]);if(o)for(var r of o(t))c.call(t,r)&&u(e,r,t[r]);return e})({},t),{validateSpec:di}))}}function yi(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function vi(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(e,t,r,n,i,a,o,s){const l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++){const c=this.d*l+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&i.call(this,e,t,r,n,c,a,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,t=3+this.cells.length+1+1;let r=0;for(let a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if(Ai[e])throw new Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Ai[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}Mi("Object",Object),Mi("TransferableGridIndex",Si),Mi("Color",Qe),Mi("Error",Error),Mi("AJAXError",q),Mi("ResolvedImage",ot),Mi("StylePropertyFunction",Pn),Mi("StyleExpression",Tn,{omit:["_evaluator"]}),Mi("ZoomDependentExpression",En),Mi("ZoomConstantExpression",Mn),Mi("CompoundExpression",en,{omit:["_evaluate"]});for(const r in Qr)Qr[r]._classRegistryKey||Mi(`Expression_${r}`,Qr[r]);function Ei(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ci(e){return e.$name||e.constructor._classRegistryKey}function Pi(e){return!function(e){if(null===e||"object"!=typeof e)return!1;const t=Ci(e);return!(!t||"Object"===t)}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||Ei(e)||z(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function Li(e,t){if(Pi(e))return(Ei(e)||z(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(Li(n,t));return r}if("object"!=typeof e)throw new Error("can't serialize object of type "+typeof e);const r=Ci(e);if(!r)throw new Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!Ai[r])throw new Error(`${r} is not registered.`);const{klass:n}=Ai[r],i=n.serialize?n.serialize(e,t):{};if(n.serialize){if(t&&i===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const n in e){if(!e.hasOwnProperty(n))continue;if(Ai[r].omit.indexOf(n)>=0)continue;const a=e[n];i[n]=Ai[r].shallow.indexOf(n)>=0?a:Li(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Ii(e){if(Pi(e))return e;if(Array.isArray(e))return e.map(Ii);if("object"!=typeof e)throw new Error("can't deserialize object of type "+typeof e);const t=Ci(e)||"Object";if(!Ai[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Ai[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const n=Object.create(r.prototype);for(const i of Object.keys(e)){if("$name"===i)continue;const r=e[i];n[i]=Ai[t].shallow.indexOf(i)>=0?r:Ii(r)}return n}class zi{constructor(){this.first=!0}update(e,t){const r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoome>=128&&e<=255,Ri=e=>e>=6016&&e<=6143,Di=e=>e>=8192&&e<=8303,ji=e=>e>=8448&&e<=8527,Fi=e=>e>=8528&&e<=8591,Bi=e=>e>=8960&&e<=9215,Ni=e=>e>=9216&&e<=9279,Ui=e=>e>=9280&&e<=9311,Vi=e=>e>=9312&&e<=9471,qi=e=>e>=9632&&e<=9727,Hi=e=>e>=9728&&e<=9983,Gi=e=>e>=11008&&e<=11263,Wi=e=>e>=12272&&e<=12287,$i=e=>e>=12288&&e<=12351,Zi=e=>e>=12448&&e<=12543,Xi=e=>e>=12688&&e<=12703,Yi=e=>e>=12736&&e<=12783,Ki=e=>e>=12800&&e<=13055,Ji=e=>e>=13056&&e<=13311,Qi=e=>e>=19904&&e<=19967,ea=e=>e>=57344&&e<=63743,ta=e=>e>=65040&&e<=65055,ra=e=>e>=65072&&e<=65103,na=e=>e>=65104&&e<=65135,ia=e=>e>=65280&&e<=65519;function aa(e){for(const t of e)if(ha(t.charCodeAt(0)))return!0;return!1}function oa(e){for(const t of e)if(!ca(t.charCodeAt(0)))return!1;return!0}function sa(e){const t=e.map((e=>{try{return new RegExp(`\\p{sc=${e}}`,"u").source}catch(t){return null}})).filter((e=>e));return new RegExp(t.join("|"),"u")}const la=sa(["Arab","Dupl","Mong","Ougr","Syrc"]);function ca(e){return!la.test(String.fromCodePoint(e))}const ua=sa(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ha(e){return!(746!==e&&747!==e&&(e<4352||!(ra(e)&&!(e>=65097&&e<=65103)||Ji(e)||Yi(e)||!(!$i(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Ki(e)||Wi(e)||Xi(e)||Zi(e)&&12540!==e||!(!ia(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!na(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ta(e)||Qi(e)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(e))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(e))||ua.test(String.fromCodePoint(e)))))}function pa(e){return!(ha(e)||(t=e,Oi(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Di(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||ji(t)||Fi(t)||Bi(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Ni(t)&&9251!==t||Ui(t)||Vi(t)||qi(t)||Hi(t)&&!(t>=9754&&t<=9759)||Gi(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||$i(t)||Zi(t)||ea(t)||ra(t)||na(t)||ia(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t));var t}const da=sa(["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 fa(e){return da.test(String.fromCodePoint(e))}function ma(e,t){return!(!t&&fa(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ri(e))}function ga(e){for(const t of e)if(fa(t.charCodeAt(0)))return!0;return!1}const ya=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class va{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(e){return function(e,t){for(const r of e)if(!ma(r.charCodeAt(0),t))return!1;return!0}(e,"loaded"===ya.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}class xa{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(gn(e))return new Pn(e,t);if(Sn(e)){const r=Cn(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=Qe.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(r=at.parse(e)):r=nt.parse(e),{kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class ba{constructor(e){this.property=e,this.value=new xa(e,void 0)}transitioned(e,t){return new wa(this.property,this.value,t,k({},e.transition,this.transition),e.now)}untransitioned(){return new wa(this.property,this.value,null,{},0)}}class _a{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return M(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ba(this._values[e].property)),this._values[e].value=new xa(this._values[e].property,null===t?void 0:M(t))}getTransition(e){return M(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ba(this._values[e].property)),this._values[e].transition=M(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const r=new ka(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){const e=new ka(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class wa{constructor(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}}return i}}class ka{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new Aa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ta{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return void 0!==this._values[e].value}getValue(e){return M(this._values[e].value)}setValue(e,t){this._values[e]=new xa(this._values[e].property,null===t?void 0:M(t))}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const n=new Aa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class Sa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}}class Aa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ma{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){const n=Dt[this.specification.type];return n?n(e,t,r):e}}class Ea{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new Sa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Sa(this,{kind:"constant",value:void 0},e.parameters);const n=Dt[this.specification.type];if(n){const i=n(e.value.value,t.value.value,r);return new Sa(this,{kind:"constant",value:i},e.parameters)}return e}evaluate(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)}}class Ca extends Ea{possiblyEvaluate(e,t,r,n){if(void 0===e.value)return new Sa(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){const i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,t);return new Sa(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){const r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Sa(this,{kind:"constant",value:r},t)}return new Sa(this,e.expression,t)}evaluate(e,t,r,n,i,a){if("source"===e.kind){const o=e.evaluate(t,r,n,i,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class Pa{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){const i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new va(Math.floor(t.zoom-1),t)),e.expression.evaluate(new va(Math.floor(t.zoom),t)),e.expression.evaluate(new va(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class La{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class Ia{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const t in e){const r=e[t];r.specification.overridable&&this.overridableProperties.push(t);const n=this.defaultPropertyValues[t]=new xa(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new ba(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}}}Mi("DataDrivenProperty",Ea),Mi("DataConstantProperty",Ma),Mi("CrossFadedDataDrivenProperty",Ca),Mi("CrossFadedProperty",Pa),Mi("ColorRampProperty",La);const za="-transition";class Oa extends K{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Ta(t.layout)),t.paint)){this._transitionablePaint=new _a(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Aa(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!=t&&this._validate(ki,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return e.endsWith(za)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t&&this._validate(wi,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith(za))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{const r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const o=this._transitionablePaint._values[e].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),A(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!i||!1!==i.validate)&&Ti(this,e.call(xi,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:J,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Sa&&pn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}const Ra={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Da{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ja{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Fa(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0,n=0;return{members:e.map((e=>{const i=Ra[e.type].BYTES_PER_ELEMENT,a=r=Ba(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:Ba(r,Math.max(n,t)),alignment:t}}function Ba(e,t){return Math.ceil(e/t)*t}class Na extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}Na.prototype.bytesPerElement=4,Mi("StructArrayLayout2i4",Na);class Ua extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}Ua.prototype.bytesPerElement=6,Mi("StructArrayLayout3i6",Ua);class Va extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e}}Va.prototype.bytesPerElement=8,Mi("StructArrayLayout4i8",Va);class qa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}qa.prototype.bytesPerElement=12,Mi("StructArrayLayout2i4i12",qa);class Ha extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e}}Ha.prototype.bytesPerElement=8,Mi("StructArrayLayout2i4ub8",Ha);class Ga extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}Ga.prototype.bytesPerElement=8,Mi("StructArrayLayout2f8",Ga);class Wa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l,c)}emplace(e,t,r,n,i,a,o,s,l,c,u){const h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e}}Wa.prototype.bytesPerElement=20,Mi("StructArrayLayout10ui20",Wa);class $a extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c,u,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,i,a,o,s,l,c,u,h)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,p){const d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,e}}$a.prototype.bytesPerElement=24,Mi("StructArrayLayout4i4ui4i24",$a);class Za extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}Za.prototype.bytesPerElement=12,Mi("StructArrayLayout3f12",Za);class Xa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Xa.prototype.bytesPerElement=4,Mi("StructArrayLayout1ul4",Xa);class Ya extends ja{_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(e,t,r,n,i,a,o,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l)}emplace(e,t,r,n,i,a,o,s,l,c){const u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e}}Ya.prototype.bytesPerElement=20,Mi("StructArrayLayout6i1ul2ui20",Ya);class Ka extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}Ka.prototype.bytesPerElement=12,Mi("StructArrayLayout2i2i2i12",Ka);class Ja extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)}emplace(e,t,r,n,i,a){const o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e}}Ja.prototype.bytesPerElement=16,Mi("StructArrayLayout2f1f2i16",Ja);class Qa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=16*e,l=4*e,c=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,e}}Qa.prototype.bytesPerElement=16,Mi("StructArrayLayout2ub2f2i16",Qa);class eo extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}eo.prototype.bytesPerElement=6,Mi("StructArrayLayout3ui6",eo);class to extends ja{_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(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y){const v=24*e,x=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e}}to.prototype.bytesPerElement=48,Mi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",to);class ro extends ja{_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(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M){const E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E){const C=32*e,P=16*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=k,this.uint32[P+12]=T,this.float32[P+13]=S,this.float32[P+14]=A,this.uint16[C+30]=M,this.uint16[C+31]=E,e}}ro.prototype.bytesPerElement=64,Mi("StructArrayLayout8i15ui1ul2f2ui64",ro);class no extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}no.prototype.bytesPerElement=4,Mi("StructArrayLayout1f4",no);class io extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[6*e+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}io.prototype.bytesPerElement=12,Mi("StructArrayLayout1ui2f12",io);class ao extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=r,this.uint16[i+3]=n,e}}ao.prototype.bytesPerElement=8,Mi("StructArrayLayout1ul2ui8",ao);class oo extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}oo.prototype.bytesPerElement=4,Mi("StructArrayLayout2ui4",oo);class so extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}so.prototype.bytesPerElement=2,Mi("StructArrayLayout1ui2",so);class lo extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e}}lo.prototype.bytesPerElement=16,Mi("StructArrayLayout4f16",lo);class co extends Da{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 h(this.anchorPointX,this.anchorPointY)}}co.prototype.size=20;class uo extends Ya{get(e){return new co(this,e)}}Mi("CollisionBoxArray",uo);class ho extends Da{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ho.prototype.size=48;class po extends to{get(e){return new ho(this,e)}}Mi("PlacedSymbolArray",po);class fo extends Da{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(e){this._structArray.uint32[this._pos4+12]=e}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]}}fo.prototype.size=64;class mo extends ro{get(e){return new fo(this,e)}}Mi("SymbolInstanceArray",mo);class go extends no{getoffsetX(e){return this.float32[1*e+0]}}Mi("GlyphOffsetArray",go);class yo extends Ua{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Mi("SymbolLineVertexArray",yo);class vo extends Da{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]}}vo.prototype.size=12;class xo extends io{get(e){return new vo(this,e)}}Mi("TextAnchorOffsetArray",xo);class bo extends Da{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]}}bo.prototype.size=8;class _o extends ao{get(e){return new bo(this,e)}}Mi("FeatureIndexArray",_o);class wo extends Na{}class ko extends Na{}class To extends Na{}class So extends qa{}class Ao extends Ha{}class Mo extends Ga{}class Eo extends Wa{}class Co extends $a{}class Po extends Za{}class Lo extends Xa{}class Io extends Ka{}class zo extends Qa{}class Oo extends eo{}class Ro extends oo{}const Do=Fa([{name:"a_pos",components:2,type:"Int16"}],4),{members:jo}=Do;class Fo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=e}prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>Fo.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${Fo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>Fo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,n){return new Fo([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function Bo(e,t){return 256*(e=_(Math.floor(e),0,255))+_(Math.floor(t),0,255)}Fo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Mi("SegmentVector",Fo);const No=Fa([{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 Uo={exports:{}},Vo={exports:{}};Vo.exports=function(e,t){var r,n,i,a,o,s,l,c;for(n=e.length-(r=3&e.length),i=t,o=3432918353,s=461845907,c=0;c>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var qo=Vo.exports,Ho={exports:{}};Ho.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Go=qo,Wo=Ho.exports;Uo.exports=Go,Uo.exports.murmur3=Go,Uo.exports.murmur2=Wo;var $o=n(Uo.exports);class Zo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(Xo(e)),this.positions.push(t,r,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const t=Xo(e);let r=0,n=this.ids.length-1;for(;r>1;this.ids[e]>=t?n=e:r=e+1}const i=[];for(;this.ids[r]===t;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Yo(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(e){const t=new Zo;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function Xo(e){const t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:$o(String(e))}function Yo(e,t,r,n){for(;r>1];let a=r-1,o=n+1;for(;;){do{a++}while(e[a]i);if(a>=o)break;Ko(e,a,o),Ko(t,3*a,3*o),Ko(t,3*a+1,3*o+1),Ko(t,3*a+2,3*o+2)}o-r`u_${e}`)),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new ts(e,t):new Qo(e,t)}}class as{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&e.set(i)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new es(e,t):new Qo(e,t)}}class os{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i){const a=this.paintVertexArray.length,o=this.expression.evaluate(new va(0),t,{},n,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)}updatePaintArray(e,t,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,i)}_setPaintValue(e,t,r){if("color"===this.type){const n=ns(r);for(let r=e;r`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r,n,i){const a=this.expression.evaluate(new va(this.zoom),t,{},n,[],i),o=this.expression.evaluate(new va(this.zoom+1),t,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)}updatePaintArray(e,t,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,i,a)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=ns(r),a=ns(n);for(let r=e;r`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof os||r instanceof ss)for(let t=0;t2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new cs(n,t,r);this.needsUpload=!1,this._featureMap=new Zo,this._bufferOffset=0}populatePaintArrays(e,t,r,n,i,a){for(const o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,n,i,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,n)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function hs(e,t){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"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function ps(e,t,r){const n={color:{source:Ga,composite:lo},number:{source:no,composite:Ga}},i={"line-pattern":{source:Eo,composite:Eo},"fill-pattern":{source:Eo,composite:Eo},"fill-extrusion-pattern":{source:Eo,composite:Eo}}[e];return i&&i[r]||n[t][r]}Mi("ConstantBinder",is),Mi("CrossFadedConstantBinder",as),Mi("SourceExpressionBinder",os),Mi("CrossFadedCompositeBinder",ls),Mi("CompositeExpressionBinder",ss),Mi("ProgramConfiguration",cs,{omit:["_buffers"]}),Mi("ProgramConfigurationSet",us);const ds=8192,fs=Math.pow(2,14)-1,ms=-fs-1;function gs(e){const t=ds/e.extent,r=e.loadGeometry();for(let n=0;nn.x+1||an.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ys(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?gs(e):[]}}function vs(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}class xs{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ko,this.indexArray=new Oo,this.segments=new Fo,this.programConfigurations=new us(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){const n=this.layers[0],i=[];let a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(const{feature:s,id:l,index:c,sourceLayerIndex:u}of e){const e=this.layers[0]._featureFilter.needGeometry,t=ys(s,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),t,r))continue;const n=o?a.evaluate(t,{},r):void 0,h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:u,index:c,geometry:e?t.geometry:gs(s),patterns:{},sortKey:n};i.push(h)}o&&i.sort(((e,t)=>e.sortKey-t.sortKey));for(const s of i){const{geometry:n,index:i,sourceLayerIndex:a}=s,o=e[i].feature;this.addFeature(s,n,i,r),t.featureIndex.insert(o,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,jo),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n){for(const i of t)for(const t of i){const r=t.x,n=t.y;if(r<0||r>=ds||n<0||n>=ds)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=i.vertexLength;vs(this.layoutVertexArray,r,n,-1,-1),vs(this.layoutVertexArray,r,n,1,-1),vs(this.layoutVertexArray,r,n,1,1),vs(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)}}function bs(e,t){for(let r=0;r1){if(Ts(e,t))return!0;for(let n=0;n1?r:r.sub(t)._mult(i)._add(t))}function Es(e,t){let r,n,i,a=!1;for(let o=0;ot.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Cs(e,t){let r=!1;for(let n=0,i=e.length-1;nt.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Ps(e,t,r){const n=r[0],i=r[2];if(e.xi.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;const a=P(e,t,r[0]);return a!==P(e,t,r[1])||a!==P(e,t,r[2])||a!==P(e,t,r[3])}function Ls(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Is(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function zs(e,t,r,n,i){if(!t[0]&&!t[1])return e;const a=h.convert(t)._mult(i);"viewport"===r&&a._rotate(-n);const o=[];for(let s=0;sGs(e,d)))),p=u?c*o:c;var d;for(const f of n)for(const e of f){const t=u?e:Gs(e,s);let r=p;const n=qs([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),_s(h,t,r))return!0}return!1}}function Gs(e,t){const r=qs([],[e.x,e.y,0,1],t);return new h(r[0]/r[3],r[1]/r[3])}class Ws extends xs{}let $s;Mi("HeatmapBucket",Ws,{omit:["layers"]});var Zs={get paint(){return $s=$s||new Ia({"heatmap-radius":new Ea(J.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ea(J.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ma(J.paint_heatmap["heatmap-intensity"]),"heatmap-color":new La(J.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ma(J.paint_heatmap["heatmap-opacity"])})}};function Xs(e,t,r,n){let{width:i,height:a}=t;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${i*a*r}`)}else n=new Uint8Array(i*a*r);return e.width=i,e.height=a,e.data=n,e}function Ys(e,t,r){let{width:n,height:i}=t;if(n===e.width&&i===e.height)return;const a=Xs({},{width:n,height:i},r);Ks(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=a.data}function Ks(e,t,r,n,i,a){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=e.data,s=t.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l{t[e.evaluationKey]=a;const o=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(e.clips)for(let o=0,s=0;o2&&void 0!==arguments[2]?arguments[2]:2;const n=t&&t.length,i=n?t[0]*r:e.length;let a=cl(e,0,i,r,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c;if(n&&(a=function(e,t,r,n){const i=[];for(let a=0,o=t.length;a80*r){s=1/0,l=1/0;let t=-1/0,n=-1/0;for(let a=r;at&&(t=r),i>n&&(n=i)}c=Math.max(t-s,n-l),c=0!==c?32767/c:0}return hl(a,o,r,s,l,c,0),o}function cl(e,t,r,n,i){let a;if(i===function(e,t,r,n){let i=0;for(let a=t,o=r-n;a0)for(let o=t;o=t;o-=n)a=Pl(o/n|0,e[o],e[o+1],a);return a&&Tl(a,a.next)&&(Ll(a),a=a.next),a}function ul(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Tl(n,n.next)&&0!==kl(n.prev,n,n.next))n=n.next;else{if(Ll(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function hl(e,t,r,n,i,a,o){if(!e)return;!o&&a&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=xl(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r=1;do{let n,i=e;e=null;let a=null;for(t=0;i;){t++;let o=i,s=0;for(let e=0;e0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,a);let s=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(a?dl(e,n,i,a):pl(e))t.push(l.i,e.i,c.i),Ll(e),e=c.next,s=c.next;else if((e=c)===s){o?1===o?hl(e=fl(ul(e),t),t,r,n,i,a,2):2===o&&ml(e,t,r,n,i,a):hl(ul(e),t,r,n,i,a,1);break}}}function pl(e){const t=e.prev,r=e,n=e.next;if(kl(t,r,n)>=0)return!1;const i=t.x,a=r.x,o=n.x,s=t.y,l=r.y,c=n.y,u=ia?i>o?i:o:a>o?a:o,d=s>l?s>c?s:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&_l(i,s,a,l,o,c,f.x,f.y)&&kl(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function dl(e,t,r,n){const i=e.prev,a=e,o=e.next;if(kl(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,p=o.y,d=sl?s>c?s:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,y=xl(d,f,t,r,n),v=xl(m,g,t,r,n);let x=e.prevZ,b=e.nextZ;for(;x&&x.z>=y&&b&&b.z<=v;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,p,x.x,x.y)&&kl(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,b.x>=d&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&_l(s,u,l,h,c,p,b.x,b.y)&&kl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;x&&x.z>=y;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,p,x.x,x.y)&&kl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=v;){if(b.x>=d&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&_l(s,u,l,h,c,p,b.x,b.y)&&kl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function fl(e,t){let r=e;do{const n=r.prev,i=r.next.next;!Tl(n,i)&&Sl(n,r,r.next,i)&&El(n,i)&&El(i,n)&&(t.push(n.i,r.i,i.i),Ll(r),Ll(r.next),r=e=i),r=r.next}while(r!==e);return ul(r)}function ml(e,t,r,n,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&wl(o,e)){let s=Cl(o,e);return o=ul(o,o.next),s=ul(s,s.next),hl(o,t,r,n,i,a,0),void hl(s,t,r,n,i,a,0)}e=e.next}o=o.next}while(o!==e)}function gl(e,t){return e.x-t.x}function yl(e,t){const r=function(e,t){let r=t;const n=e.x,i=e.y;let a,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=n&&e>o&&(o=e,a=r.x=r.x&&r.x>=l&&n!==r.x&&_l(ia.x||r.x===a.x&&vl(a,r)))&&(a=r,u=t)}r=r.next}while(r!==s);return a}(e,t);if(!r)return t;const n=Cl(r,e);return ul(n,n.next),ul(r,r.next)}function vl(e,t){return kl(e.prev,e,t.prev)<0&&kl(t.next,e,e.next)<0}function xl(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function bl(e){let t=e,r=e;do{(t.x=(e-o)*(a-s)&&(e-o)*(n-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function wl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Sl(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(El(e,t)&&El(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(kl(e.prev,e,t.prev)||kl(e,t.prev,t))||Tl(e,t)&&kl(e.prev,e,e.next)>0&&kl(t.prev,t,t.next)>0)}function kl(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Tl(e,t){return e.x===t.x&&e.y===t.y}function Sl(e,t,r,n){const i=Ml(kl(e,t,r)),a=Ml(kl(e,t,n)),o=Ml(kl(r,n,e)),s=Ml(kl(r,n,t));return i!==a&&o!==s||!(0!==i||!Al(e,r,t))||!(0!==a||!Al(e,n,t))||!(0!==o||!Al(r,e,n))||!(0!==s||!Al(r,t,n))}function Al(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ml(e){return e>0?1:e<0?-1:0}function El(e,t){return kl(e.prev,e,e.next)<0?kl(e,t,e.next)>=0&&kl(e,e.prev,t)>=0:kl(e,t,e.prev)<0||kl(e,e.next,t)<0}function Cl(e,t){const r=Il(e.i,e.x,e.y),n=Il(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Pl(e,t,r,n){const i=Il(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ll(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Il(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zl(e,t,r){const n=r.patternDependencies;let i=!1;for(const a of t){const t=a.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const r=t.constantOr(null);r&&(i=!0,n[r.to]=!0,n[r.from]=!0)}return i}function Ol(e,t,r,n,i){const a=i.patternDependencies;for(const o of t){const t=o.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n-1},r,{},i.availableImages),s=t.evaluate({zoom:n},r,{},i.availableImages),l=t.evaluate({zoom:n+1},r,{},i.availableImages);e=e&&e.name?e.name:e,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[e]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:e,mid:s,max:l}}}return r}class Rl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new To,this.indexArray=new Oo,this.indexArray2=new Ro,this.programConfigurations=new us(e.layers,e.zoom),this.segments=new Fo,this.segments2=new Fo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=zl("fill",this.layers,t);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=ys(o,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;const h=i?n.evaluate(u,{},r,t.availableImages):void 0,p={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:gs(o),patterns:{},sortKey:h};a.push(p)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(const o of a){const{geometry:n,index:i,sourceLayerIndex:a}=o;if(this.hasPattern){const e=Ol("fill",this.layers,o,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(o,n,i,r,{});t.featureIndex.insert(e[i].feature,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sl),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,t,r,n,i){for(const a of Tr(t,500)){let e=0;for(const s of a)e+=s.length;const t=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),r=t.vertexLength,n=[],i=[];for(const s of a){if(0===s.length)continue;s!==a[0]&&i.push(n.length/2);const e=this.segments2.prepareSegment(s.length,this.layoutVertexArray,this.indexArray2),t=e.vertexLength;this.layoutVertexArray.emplaceBack(s[0].x,s[0].y),this.indexArray2.emplaceBack(t+s.length-1,t),n.push(s[0].x),n.push(s[0].y);for(let r=1;r>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t.push(new Hl(a,o));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Wl.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(a+=e.readSVarint())c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Wl.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Wl.types[this.type];function u(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}Kl.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Xl(this._pbf,t,this.extent,this._keys,this._values)};var Ql=Yl;function ec(e,t,r){if(3===e){var n=new Ql(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}ql.VectorTile=function(e,t){this.layers=e.readFields(ec,{},t)},ql.VectorTileFeature=Gl,ql.VectorTileLayer=Yl;const tc=ql.VectorTileFeature.types,rc=Math.pow(2,13);function nc(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*rc)+o,i*rc*2,a*rc*2,Math.round(s))}class ic{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new So,this.centroidVertexArray=new wo,this.indexArray=new Oo,this.programConfigurations=new us(e.layers,e.zoom),this.segments=new Fo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=zl("fill-extrusion",this.layers,t);for(const{feature:n,id:i,index:a,sourceLayerIndex:o}of e){const e=this.layers[0]._featureFilter.needGeometry,s=ys(n,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),s,r))continue;const l={id:i,sourceLayerIndex:o,index:a,geometry:e?s.geometry:gs(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(Ol("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,a,r,{}),t.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(e,t,r){for(const n of this.features){const{geometry:e}=n;this.addFeature(n,e,n.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vl),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ul.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,n,i){for(const a of Tr(t,500)){const t={x:0,y:0,vertexCount:0};let r=0;for(const e of a)r+=e.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const e of a){if(0===e.length)continue;if(oc(e))continue;let r=0;for(let i=0;i=1){const o=e[i-1];if(!ac(a,o)){n.vertexLength+4>Fo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const e=a.sub(o)._perp()._unit(),i=o.dist(a);r+i>32768&&(r=0),nc(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,0,r),nc(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,1,r),t.x+=2*a.x,t.y+=2*a.y,t.vertexCount+=2,r+=i,nc(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,0,r),nc(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,1,r),t.x+=2*o.x,t.y+=2*o.y,t.vertexCount+=2;const s=n.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+r>Fo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray)),"Polygon"!==tc[e.type])continue;const i=[],o=[],s=n.vertexLength;for(const e of a)if(0!==e.length){e!==a[0]&&o.push(i.length/2);for(let r=0;rds)||e.y===t.y&&(e.y<0||e.y>ds)}function oc(e){return e.every((e=>e.x<0))||e.every((e=>e.x>ds))||e.every((e=>e.y<0))||e.every((e=>e.y>ds))}let sc;Mi("FillExtrusionBucket",ic,{omit:["layers","features"]});var lc={get paint(){return sc=sc||new Ia({"fill-extrusion-opacity":new Ma(J["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ea(J["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ma(J["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ma(J["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ca(J["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ea(J["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ea(J["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ma(J["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class cc extends Oa{constructor(e){super(e,lc)}createBucket(e){return new ic(e)}queryRadius(){return Is(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,n,i,a,o,s){const l=zs(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),c=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),p=function(e,t){const r=[];for(const n of e){const e=[n.x,n.y,0,1];qs(e,e,t),r.push(new h(e[0]/e[3],e[1]/e[3]))}return r}(l,s),d=function(e,t,r,n){const i=[],a=[],o=n[8]*t,s=n[9]*t,l=n[10]*t,c=n[11]*t,u=n[8]*r,p=n[9]*r,d=n[10]*r,f=n[11]*r;for(const m of e){const e=[],t=[];for(const r of m){const i=r.x,a=r.y,m=n[0]*i+n[4]*a+n[12],g=n[1]*i+n[5]*a+n[13],y=n[2]*i+n[6]*a+n[14],v=n[3]*i+n[7]*a+n[15],x=y+l,b=v+c,_=m+u,w=g+p,k=y+d,T=v+f,S=new h((m+o)/b,(g+s)/b);S.z=x/b,e.push(S);const A=new h(_/T,w/T);A.z=k/T,t.push(A)}i.push(e),a.push(t)}return[i,a]}(n,u,c,s);return function(e,t,r){let n=1/0;ws(r,t)&&(n=hc(r,t[0]));for(let i=0;ie.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Ao,this.layoutVertexArray2=new Mo,this.indexArray=new Oo,this.programConfigurations=new us(e.layers,e.zoom),this.segments=new Fo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=zl("line",this.layers,t);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,t=ys(o,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),t,r))continue;const u=i?n.evaluate(t,{},r):void 0,h={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?t.geometry:gs(o),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(const o of a){const{geometry:n,index:i,sourceLayerIndex:a}=o;if(this.hasPattern){const e=Ol("line",this.layers,o,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(o,n,i,r,{});t.featureIndex.insert(e[i].feature,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,mc)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,dc),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,n,i){const a=this.layers[0].layout,o=a.get("line-join").evaluate(e,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const u of t)this.addLine(u,e,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}addLine(e,t,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l0;if(_&&g>l){const e=h.dist(p);if(e>2*c){const t=h.sub(h.sub(p)._mult(c/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,f,0,0,u),p=t}}const k=p&&d;let T=k?r:o?"butt":n;if(k&&"round"===T&&(xi&&(T="bevel"),"bevel"===T&&(x>2&&(T="flipbevel"),x100)t=m.mult(-1);else{const e=x*f.add(m).mag()/f.sub(m).mag();t._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(h,t,0,0,u),this.addCurrentVertex(h,t.mult(-1),0,0,u)}else if("bevel"===T||"fakeround"===T){const e=-Math.sqrt(x*x-1),t=w?e:0,r=w?0:e;if(p&&this.addCurrentVertex(h,f,t,r,u),"fakeround"===T){const e=Math.round(180*b/Math.PI/20);for(let t=1;t2*c){const t=h.add(d.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,m,0,0,u),h=t}}}}addCurrentVertex(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=t.y*n-t.x,s=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,a,!1,r,i),this.addHalfVertex(e,o,s,a,!0,-n,i),this.distance>vc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,n,i,a))}addHalfVertex(e,t,r,n,i,a,o){let{x:s,y:l}=e;const c=.5*(this.lineClips?this.scaledDistance*(vc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}let bc,_c;Mi("LineBucket",xc,{omit:["layers","patternFeatures"]});var wc={get paint(){return _c=_c||new Ia({"line-opacity":new Ea(J.paint_line["line-opacity"]),"line-color":new Ea(J.paint_line["line-color"]),"line-translate":new Ma(J.paint_line["line-translate"]),"line-translate-anchor":new Ma(J.paint_line["line-translate-anchor"]),"line-width":new Ea(J.paint_line["line-width"]),"line-gap-width":new Ea(J.paint_line["line-gap-width"]),"line-offset":new Ea(J.paint_line["line-offset"]),"line-blur":new Ea(J.paint_line["line-blur"]),"line-dasharray":new Pa(J.paint_line["line-dasharray"]),"line-pattern":new Ca(J.paint_line["line-pattern"]),"line-gradient":new La(J.paint_line["line-gradient"])})},get layout(){return bc=bc||new Ia({"line-cap":new Ma(J.layout_line["line-cap"]),"line-join":new Ea(J.layout_line["line-join"]),"line-miter-limit":new Ma(J.layout_line["line-miter-limit"]),"line-round-limit":new Ma(J.layout_line["line-round-limit"]),"line-sort-key":new Ea(J.layout_line["line-sort-key"])})}};class kc extends Ea{possiblyEvaluate(e,t){return t=new va(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=k({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}let Tc;class Sc extends Oa{constructor(e){super(e,wc),this.gradientVersion=0,Tc||(Tc=new kc(wc.paint.properties["line-width"].specification),Tc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this.gradientExpression();this.stepInterpolant=!(void 0===e._styleExpression)&&e._styleExpression.expression instanceof Ct,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Tc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new xc(e)}queryRadius(e){const t=e,r=Ac(Ls("line-width",this,t),Ls("line-gap-width",this,t)),n=Ls("line-offset",this,t);return r/2+Math.abs(n)+Is(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,a,o){const s=zs(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Ac(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),c=this.paint.get("line-offset").evaluate(t,r);return c&&(n=function(e,t){const r=[];for(let n=0;n=3)for(let t=0;t0?t+2*e:e}const Mc=Fa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ec=Fa([{name:"a_projected_pos",components:3,type:"Float32"}],4);Fa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Cc=Fa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Fa([{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 Pc=Fa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Lc=Fa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ic(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),ya.applyArabicShaping&&(e=ya.applyArabicShaping(e)),e}(e.text,t,r)})),e}Fa([{name:"triangle",components:3,type:"Uint16"}]),Fa([{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"}]),Fa([{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"}]),Fa([{type:"Float32",name:"offsetX"}]),Fa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Fa([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const zc={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var Oc=24,Rc=Fc,Dc=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},jc=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m};function Fc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Fc.Varint=0,Fc.Fixed64=1,Fc.Bytes=2,Fc.Fixed32=5;var Bc=4294967296,Nc=1/Bc,Uc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Vc(e){return e.type===Fc.Bytes?e.readVarint()+e.pos:e.pos+1}function qc(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Hc(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Gc(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function ru(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Fc.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=eu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ru(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=eu(this.buf,this.pos)+eu(this.buf,this.pos+4)*Bc;return this.pos+=8,e},readSFixed64:function(){var e=eu(this.buf,this.pos)+ru(this.buf,this.pos+4)*Bc;return this.pos+=8,e},readFloat:function(){var e=Dc(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Dc(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return qc(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return qc(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e,t,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Uc?(e=this.buf,t=i,r=n,Uc.decode(e.subarray(t,r))):function(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+2],s=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Fc.Bytes)return e.push(this.readVarint(t));var r=Vc(this);for(e=e||[];this.pos127;);else if(t===Fc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Fc.Fixed32)this.pos+=4;else{if(t!==Fc.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var r,n,i,a;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),i=r,(a=t).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Hc(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),jc(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),jc(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&Hc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Fc.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Gc,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Wc,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Xc,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,$c,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Zc,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Yc,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Kc,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Jc,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Qc,t)},writeBytesField:function(e,t){this.writeTag(e,Fc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Fc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Fc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Fc.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Fc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Fc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Fc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Fc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Fc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Fc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var nu,iu=n(Rc);function au(e,t,r){1===e&&r.readMessage(ou,t)}function ou(e,t,r){if(3===e){const{id:e,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(su,{});t.push({id:e,bitmap:new Js({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function su(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function lu(e){let t=0,r=0;for(const o of e)t+=o.w*o.h,r=Math.max(r,o.w);e.sort(((e,t)=>t.h-e.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let i=0,a=0;for(const o of e)for(let e=n.length-1;e>=0;e--){const t=n[e];if(!(o.w>t.w||o.h>t.h)){if(o.x=t.x,o.y=t.y,a=Math.max(a,o.y+o.h),i=Math.max(i,o.x+o.w),o.w===t.w&&o.h===t.h){const t=n.pop();e=0&&r>=e&&mu[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new du;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(pu.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function fu(t,r,n,i,a,o,s,l,c,u,h,p,d,f,m){const g=du.fromFeature(t,a);let y;p===e.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:x}=ya;if(v&&1===g.sections.length){y=[];const e=v(g.toString(),ku(g,u,o,r,i,f));for(const t of e){const e=new du;e.text=t,e.sections=g.sections;for(let r=0;r0&&n>_&&(_=n)}else{const e=n[l.fontStack],t=e&&e[g];if(t&&t.rect)w=t.rect,v=t.metrics;else{const e=r[l.fontStack],t=e&&e[g];if(!t)continue;v=t.metrics}y=(a-l.scale)*Oc}A?(t.verticalizable=!0,b.push({glyph:g,imageName:T,x:d,y:f+y,vertical:A,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:w}),d+=S*l.scale+u):(b.push({glyph:g,imageName:T,x:d,y:f+y,vertical:A,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:w}),d+=v.advance*l.scale+u)}0!==b.length&&(m=Math.max(d-u,m),Su(b,0,b.length-1,y,_)),d=0;const w=o*a+_;l.lineOffset=Math.max(_,s),f+=w,g=Math.max(w,g),++v}var x;const b=f-hu,{horizontalAlign:_,verticalAlign:w}=Tu(s);(function(e,t,r,n,i,a,o,s,l){const c=(t-r)*i;let u=0;u=a!==o?-s*n-hu:(-n*l+.5)*o;for(const h of e)for(const e of h.positionedGlyphs)e.x+=c,e.y+=u})(t.positionedLines,y,_,w,m,g,o,b,a.length),t.top+=-w*b,t.bottom=t.top+b,t.left+=-_*m,t.right=t.left+m}(_,r,n,i,y,s,l,c,p,u,d,m),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(b)&&_}const mu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},gu={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},yu={40:!0};function vu(e,t,r,n,i,a){if(t.imageName){const e=n[t.imageName];return e?e.displaySize[0]*t.scale*Oc/a+i:0}{const n=r[t.fontStack],a=n&&n[e];return a?a.metrics.advance*t.scale+i:0}}function xu(e,t,r,n){const i=Math.pow(e-t,2);return n?e=0;let c=0;for(let h=0;hc){const e=Math.ceil(a/c);i*=e/o,o=e}return{x1:n,y1:i,x2:n+a,y2:i+o}}function Eu(e,t,r,n,i,a){const o=e.image;let s;if(o.content){const e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}const l=t.left*a,c=t.right*a;let u,h,p,d;"width"===r||"both"===r?(d=i[0]+l-n[3],h=i[0]+c+n[1]):(d=i[0]+(l+c-o.displaySize[0])/2,h=d+o.displaySize[0]);const f=t.top*a,m=t.bottom*a;return"height"===r||"both"===r?(u=i[1]+f-n[0],p=i[1]+m+n[2]):(u=i[1]+(f+m-o.displaySize[1])/2,p=u+o.displaySize[1]),{image:o,top:u,right:h,bottom:p,left:d,collisionPadding:s}}const Cu=128,Pu=32640;function Lu(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new va(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:n}=r;let i=0;for(;ie.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Bs([]),this.placementViewportMatrix=Bs([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Lu(this.zoom,r["text-size"]),this.iconSizeData=Lu(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==Iu(n,"text-overlap","text-allow-overlap")||"never"!==Iu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((t=>e.ah[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Fu(new us(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new Fu(new us(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new go,this.lineVertexArray=new yo,this.symbolInstances=new mo,this.textAnchorOffsets=new xo}calculateGlyphDependencies(e,t,r,n,i){for(let a=0;a0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const p=r.iconDependencies,d=r.glyphDependencies,f=r.availableImages,m=new va(this.zoom);for(const{feature:g,id:y,index:v,sourceLayerIndex:x}of t){const t=i._featureFilter.needGeometry,r=ys(g,t);if(!i._featureFilter.filter(m,r,n))continue;let s,l;if(t||(r.geometry=gs(g)),c){const e=i.getValueAndResolveTokens("text-field",r,n,f),t=rt.factory(e),a=this.hasRTLText=this.hasRTLText||ju(t);(!a||"unavailable"===ya.getRTLTextPluginStatus()||a&&ya.isParsed())&&(s=Ic(t,i,r))}if(u){const e=i.getValueAndResolveTokens("icon-image",r,n,f);l=e instanceof ot?e:ot.fromString(e)}if(!s&&!l)continue;const b=this.sortFeaturesByKey?h.evaluate(r,{},n):void 0;if(this.features.push({id:y,text:s,icon:l,index:v,sourceLayerIndex:x,geometry:r.geometry,properties:g.properties,type:zu[g.type],sortKey:b}),l&&(p[l.name]=!0),s){const t=o.evaluate(r,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const e of s.sections)if(e.image)p[e.image.name]=!0;else{const r=aa(s.toString()),n=e.fontStack||t,a=d[n]=d[n]||{};this.calculateGlyphDependencies(e.text,a,i,this.allowVerticalPlacement,r)}}}"line"===a.get("symbol-placement")&&(this.features=function(e){const t={},r={},n=[];let i=0;function a(t){n.push(e[t]),i++}function o(e,t,i){const a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(e,r,i){const a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(e,t,r){const n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;ce.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,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(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]);const i={};for(let a=e.segment+1;a=0;a--)i[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:n},a>0&&(n+=t[a-1].dist(t[a]));for(let e=0;e0}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(e,t){const r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let i=r.vertexStartIndex;in[e]-n[t]||i[t]-i[e])),a}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Uu,Vu;Mi("SymbolBucket",Nu,{omit:["layers","collisionBoxArray","features","compareText"]}),Nu.MAX_GLYPHS=65535,Nu.addDynamicAttributes=Du;var qu={get paint(){return Vu=Vu||new Ia({"icon-opacity":new Ea(J.paint_symbol["icon-opacity"]),"icon-color":new Ea(J.paint_symbol["icon-color"]),"icon-halo-color":new Ea(J.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ea(J.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ea(J.paint_symbol["icon-halo-blur"]),"icon-translate":new Ma(J.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ma(J.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ea(J.paint_symbol["text-opacity"]),"text-color":new Ea(J.paint_symbol["text-color"],{runtimeType:ve,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Ea(J.paint_symbol["text-halo-color"]),"text-halo-width":new Ea(J.paint_symbol["text-halo-width"]),"text-halo-blur":new Ea(J.paint_symbol["text-halo-blur"]),"text-translate":new Ma(J.paint_symbol["text-translate"]),"text-translate-anchor":new Ma(J.paint_symbol["text-translate-anchor"])})},get layout(){return Uu=Uu||new Ia({"symbol-placement":new Ma(J.layout_symbol["symbol-placement"]),"symbol-spacing":new Ma(J.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ma(J.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ea(J.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ma(J.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ma(J.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ma(J.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ma(J.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ma(J.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ma(J.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ea(J.layout_symbol["icon-size"]),"icon-text-fit":new Ma(J.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ma(J.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ea(J.layout_symbol["icon-image"]),"icon-rotate":new Ea(J.layout_symbol["icon-rotate"]),"icon-padding":new Ea(J.layout_symbol["icon-padding"]),"icon-keep-upright":new Ma(J.layout_symbol["icon-keep-upright"]),"icon-offset":new Ea(J.layout_symbol["icon-offset"]),"icon-anchor":new Ea(J.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ma(J.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ma(J.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ma(J.layout_symbol["text-rotation-alignment"]),"text-field":new Ea(J.layout_symbol["text-field"]),"text-font":new Ea(J.layout_symbol["text-font"]),"text-size":new Ea(J.layout_symbol["text-size"]),"text-max-width":new Ea(J.layout_symbol["text-max-width"]),"text-line-height":new Ma(J.layout_symbol["text-line-height"]),"text-letter-spacing":new Ea(J.layout_symbol["text-letter-spacing"]),"text-justify":new Ea(J.layout_symbol["text-justify"]),"text-radial-offset":new Ea(J.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ma(J.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ea(J.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ea(J.layout_symbol["text-anchor"]),"text-max-angle":new Ma(J.layout_symbol["text-max-angle"]),"text-writing-mode":new Ma(J.layout_symbol["text-writing-mode"]),"text-rotate":new Ea(J.layout_symbol["text-rotate"]),"text-padding":new Ma(J.layout_symbol["text-padding"]),"text-keep-upright":new Ma(J.layout_symbol["text-keep-upright"]),"text-transform":new Ea(J.layout_symbol["text-transform"]),"text-offset":new Ea(J.layout_symbol["text-offset"]),"text-allow-overlap":new Ma(J.layout_symbol["text-allow-overlap"]),"text-overlap":new Ma(J.layout_symbol["text-overlap"]),"text-ignore-placement":new Ma(J.layout_symbol["text-ignore-placement"]),"text-optional":new Ma(J.layout_symbol["text-optional"])})}};class Hu{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:fe,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Mi("FormatSectionOverride",Hu,{omit:["defaultValue"]});class Gu extends Oa{constructor(e){super(e,qu)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const e=this.layout.get("text-writing-mode");if(e){const t=[];for(const r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,n){const i=this.layout.get(e).evaluate(t,{},r,n),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||Sn(a.value)||!i?i:(o=t.properties,i.replace(/{([^{}]+)}/g,((e,t)=>o&&t in o?String(o[t]):"")));var o}createBucket(e){return new Nu(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of qu.paint.overridableProperties){if(!Gu.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new Hu(t),n=new Tn(r,t.property.specification);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new Mn("source",n):new En("composite",n,t.value.zoomStops),this.paint._values[e]=new Sa(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&Gu.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),n=qu.paint.properties[t];let i=!1;const a=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof rt)a(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{i||(t instanceof ht&&ct(t.value)===we?a(t.value.sections):t instanceof Kt?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}}let Wu;var $u={get paint(){return Wu=Wu||new Ia({"background-color":new Ma(J.paint_background["background-color"]),"background-pattern":new Pa(J.paint_background["background-pattern"]),"background-opacity":new Ma(J.paint_background["background-opacity"])})}};class Zu extends Oa{constructor(e){super(e,$u)}}let Xu;var Yu={get paint(){return Xu=Xu||new Ia({"raster-opacity":new Ma(J.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ma(J.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ma(J.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ma(J.paint_raster["raster-brightness-max"]),"raster-saturation":new Ma(J.paint_raster["raster-saturation"]),"raster-contrast":new Ma(J.paint_raster["raster-contrast"]),"raster-resampling":new Ma(J.paint_raster["raster-resampling"]),"raster-fade-duration":new Ma(J.paint_raster["raster-fade-duration"])})}};class Ku extends Oa{constructor(e){super(e,Yu)}}class Ju extends Oa{constructor(e){super(e,{}),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Qu{constructor(e){this._methodToThrottle=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(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 eh=6371008.8;class th{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new th(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return eh*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof th)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new th(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new th(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const rh=2*Math.PI*eh;function nh(e){return rh*Math.cos(e*Math.PI/180)}function ih(e){return(180+e)/360}function ah(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function oh(e,t){return e/nh(t)}function sh(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class lh{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=th.convert(e);return new lh(ih(r.lng),ah(r.lat),oh(t,r.lat))}toLngLat(){return new th(360*this.x-180,sh(this.y))}toAltitude(){return this.z*nh(sh(this.y))}meterInMercatorCoordinateUnits(){return 1/rh*(e=sh(this.y),1/Math.cos(e*Math.PI/180));var e}}function ch(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}class uh{constructor(e,t,r){if(i=t,a=r,(n=e)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);var n,i,a;this.z=e,this.x=t,this.y=r,this.key=dh(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){const n=(a=this.y,o=this.z,s=ch(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=ch(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;const c=function(e,t,r){let n,i="";for(let a=e;a>0;a--)n=1<1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(e){const t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){const t=Math.pow(2,this.z);return new h((e.x*t-this.x)*ds,(e.y*t-this.y)*ds)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hh{constructor(e,t){this.wrap=e,this.canonical=t,this.key=dh(e,t.z,t.z,t.x,t.y)}}class ph{constructor(e,t,r,n,i){if(e= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new uh(r,+n,+i),this.key=dh(t,e,r,n,i)}clone(){return new ph(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const t=this.canonical.z-e;return e>this.canonical.z?new ph(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ph(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?dh(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):dh(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new ph(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new ph(t,this.wrap,t,r,n),new ph(t,this.wrap,t,r+1,n),new ph(t,this.wrap,t,r,n+1),new ph(t,this.wrap,t,r+1,n+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void C(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;const s=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=i,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let l=0;lthis.max&&(this.max=t),t=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Qs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}const s=-t*this.dim,l=-r*this.dim;for(let c=a;c=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class gh{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class yh{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Si(ds,16,0),this.grid3D=new Si(ds,16,0),this.featureIndexArray=new _o,this.promoteId=t}insert(e,t,r,n,i,a){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const s=a?this.grid3D:this.grid;for(let l=0;l=0&&r[3]>=0&&s.insert(o,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ql.VectorTile(new iu(this.rawTileData)).layers,this.sourceLayerCoder=new mh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,n){this.loadVTLayers();const i=e.params||{},a=ds/e.tileSize/e.scale,o=On(i.filter),s=e.queryGeometry,l=e.queryPadding*a,c=xh(s),u=this.grid.query(c.minX-l,c.minY-l,c.maxX+l,c.maxY+l),p=xh(e.cameraQueryGeometry),d=this.grid3D.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l,((t,r,n,i)=>function(e,t,r,n,i){for(const o of e)if(t<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const a=[new h(t,r),new h(t,i),new h(n,i),new h(n,r)];if(e.length>2)for(const o of a)if(Cs(e,o))return!0;for(let o=0;o(p||(p=gs(t)),r.queryIntersectsFeature(s,t,n,p,this.z,e.transform,a,e.pixelPosMatrix))))}return f}loadMatchingFeature(e,t,r,n,i,a,o,s,l,c,u){const h=this.bucketLayerIDs[t];if(a&&!function(e,t){for(let r=0;r=0)return!0;return!1}(a,h))return;const p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(n);if(i.needGeometry){const e=ys(d,!0);if(!i.filter(new va(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new va(this.tileID.overscaledZ),d))return;const f=this.getId(d,p);for(let m=0;m{const o=t instanceof Aa?t.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function xh(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:t,minY:r,maxX:n,maxY:i}}function bh(e,t){return t-e}function _h(e,t,r,n,i){const a=[];for(let o=0;o=n&&c.x>=n||(o.x>=n?o=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x>=n&&(c=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y>=i&&c.y>=i||(o.y>=i?o=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round():c.y>=i&&(c=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round()),l&&o.equals(l[l.length-1])||(l=[o],a.push(l)),l.push(c)))))}}return a}Mi("FeatureIndex",yh,{omit:["rawTileData","sourceLayerCoder"]});class wh extends h{constructor(e,t,r,n){super(e,t),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new wh(this.x,this.y,this.angle,this.segment)}}function kh(e,t,r,n,i){if(void 0===t.segment||0===r)return!0;let a=t,o=t.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;const l=[];let c=0;for(;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=t.dist(r)}return!0}function Th(e){let t=0;for(let r=0;rc){const a=(c-l)/i,h=Dt.number(r.x,n.x,a),p=Dt.number(r.y,n.y,a),d=new wh(h,p,n.angleTo(r),u);return d._round(),!o||kh(e,d,s,o,t)?d:void 0}l+=i}}function Eh(e,t,r,n,i,a,o,s,l){const c=Sh(n,a,o),u=Ah(n,i),h=u*o,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h=0&&y=0&&v=0&&p+c<=u){const t=new wh(y,v,m,f);t._round(),n&&!kh(e,t,a,n,i)||d.push(t)}}h+=s}return s||d.length||o||(d=Ch(e,h/2,r,n,i,a,o,!0,l)),d}function Ph(e,t,r,n){const i=[],a=e.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2;let c={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom};const u=a.stretchX||[[0,s]],p=a.stretchY||[[0,l]],d=(e,t)=>e+t[1]-t[0],f=u.reduce(d,0),m=p.reduce(d,0),g=s-f,y=l-m;let v=0,x=f,b=0,_=m,w=0,k=g,T=0,S=y;if(a.content&&n){const t=a.content,r=t[2]-t[0],n=t[3]-t[1];(a.textFitWidth||a.textFitHeight)&&(c=Mu(e)),v=Lh(u,0,t[0]),b=Lh(p,0,t[1]),x=Lh(u,t[0],t[2]),_=Lh(p,t[1],t[3]),w=t[0]-v,T=t[1]-b,k=r-x,S=n-_}const A=c.x1,M=c.y1,E=c.x2-A,C=c.y2-M,P=(e,n,i,s)=>{const l=zh(e.stretch-v,x,E,A),c=Oh(e.fixed-w,k,e.stretch,f),u=zh(n.stretch-b,_,C,M),p=Oh(n.fixed-T,S,n.stretch,m),d=zh(i.stretch-v,x,E,A),g=Oh(i.fixed-w,k,i.stretch,f),y=zh(s.stretch-b,_,C,M),P=Oh(s.fixed-T,S,s.stretch,m),L=new h(l,u),I=new h(d,u),z=new h(d,y),O=new h(l,y),R=new h(c/o,p/o),D=new h(g/o,P/o),j=t*Math.PI/180;if(j){const e=Math.sin(j),t=Math.cos(j),r=[t,-e,e,t];L._matMult(r),I._matMult(r),O._matMult(r),z._matMult(r)}const F=e.stretch+e.fixed,B=n.stretch+n.fixed;return{tl:L,tr:I,bl:O,br:z,tex:{x:a.paddedRect.x+1+F,y:a.paddedRect.y+1+B,w:i.stretch+i.fixed-F,h:s.stretch+s.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:k/o/E,minFontScaleY:S/o/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const e=Ih(u,g,f),t=Ih(p,y,m);for(let r=0;r0&&(n=Math.max(10,n),this.circleDiameter=n)}else{const l=(null===(u=a.image)||void 0===u?void 0:u.content)&&(a.image.textFitWidth||a.image.textFitHeight)?Mu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];const p=a.collisionPadding;if(p&&(l.x1-=p[0]*o,l.y1-=p[1]*o,l.x2+=p[2]*o,l.y2+=p[3]*o),c){const e=new h(l.x1,l.y1),t=new h(l.x2,l.y1),r=new h(l.x1,l.y2),n=new h(l.x2,l.y2),i=c*Math.PI/180;e._rotate(i),t._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(e.x,t.x,r.x,n.x),l.x2=Math.max(e.x,t.x,r.x,n.x),l.y1=Math.min(e.y,t.y,r.y,n.y),l.y2=Math.max(e.y,t.y,r.y,n.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=e.length}}class Dh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t)=>et?1:0;if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e=0)break;t[e]=t[n],e=n}t[e]=i}}function jh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=1/0,i=1/0,a=-1/0,o=-1/0;const s=e[0];for(let h=0;ha)&&(a=e.x),(!h||e.y>o)&&(o=e.y)}const l=Math.min(a-n,o-i);let c=l/2;const u=new Dh([],Fh);if(0===l)return new h(n,i);for(let h=n;hp.d||!p.d)&&(p=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-p.d<=t||(c=n.h/2,u.push(new Bh(n.p.x-c,n.p.y-c,c,e)),u.push(new Bh(n.p.x+c,n.p.y-c,c,e)),u.push(new Bh(n.p.x-c,n.p.y+c,c,e)),u.push(new Bh(n.p.x+c,n.p.y+c,c,e)),d+=4)}return r&&(console.log(`num probes: ${d}`),console.log(`best distance: ${p.d}`)),p.p}function Fh(e,t){return t.max-e.max}function Bh(e,t,r,n){this.p=new h(e,t),this.h=r,this.d=function(e,t){let r=!1,n=1/0;for(let i=0;ie.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,Ms(e,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Nh;e.aq=void 0,(Nh=e.aq||(e.aq={}))[Nh.center=1]="center",Nh[Nh.left=2]="left",Nh[Nh.right=3]="right",Nh[Nh.top=4]="top",Nh[Nh.bottom=5]="bottom",Nh[Nh["top-left"]=6]="top-left",Nh[Nh["top-right"]=7]="top-right",Nh[Nh["bottom-left"]=8]="bottom-left",Nh[Nh["bottom-right"]=9]="bottom-right";const Uh=Number.POSITIVE_INFINITY;function Vh(e,t){return t[1]!==Uh?function(e,t,r){let n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1]):function(e,t){let r=0,n=0;t<0&&(t=0);const i=t/Math.SQRT2;switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function qh(e,t,r){var n;const i=e.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(t,{},r);if(a){const e=a.values,t=[];for(let r=0;re*Oc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),t[r+1]=i}return new at(t)}const o=i.get("text-variable-anchor");if(o){let n;n=void 0!==e._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(t,{},r)*Oc,Uh]:i.get("text-offset").evaluate(t,{},r).map((e=>e*Oc));const a=[];for(const e of o)a.push(e,Vh(e,n));return new at(a)}return null}function Hh(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Gh(t,r,n,i,a,o,s,l,c,u,h){let p=o.textMaxSize.evaluate(r,{});void 0===p&&(p=s);const d=t.layers[0].layout,f=d.get("icon-offset").evaluate(r,{},h),m=$h(n.horizontal),g=s/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*p/24,x=t.tilePixelRatio*l,b=t.tilePixelRatio*d.get("symbol-spacing"),_=d.get("text-padding")*t.tilePixelRatio,w=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=e.get("icon-padding").evaluate(t,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(d,r,h,t.tilePixelRatio),k=d.get("text-max-angle")/180*Math.PI,T="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),S="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),A=d.get("symbol-placement"),M=b/2,E=d.get("icon-text-fit");let P;i&&"none"!==E&&(t.allowVerticalPlacement&&n.vertical&&(P=Eu(i,n.vertical,E,d.get("icon-text-fit-padding"),f,g)),m&&(i=Eu(i,m,E,d.get("icon-text-fit-padding"),f,g)));const L=(l,p)=>{p.x<0||p.x>=ds||p.y<0||p.y>=ds||function(t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S){const A=t.addToLineVertexArray(r,n);let M,E,P,L,I=0,z=0,O=0,R=0,D=-1,j=-1;const F={};let B=$o("");if(t.allowVerticalPlacement&&i.vertical){const e=l.layout.get("text-rotate").evaluate(_,{},T)+90;P=new Rh(c,r,u,h,p,i.vertical,d,f,m,e),s&&(L=new Rh(c,r,u,h,p,s,y,v,m,e))}if(a){const n=l.layout.get("icon-rotate").evaluate(_,{}),i="none"!==l.layout.get("icon-text-fit"),o=Ph(a,n,k,i),d=s?Ph(s,n,k,i):void 0;E=new Rh(c,r,u,h,p,a,y,v,!1,n),I=4*o.length;const f=t.iconSizeData;let m=null;"source"===f.kind?(m=[Cu*l.layout.get("icon-size").evaluate(_,{})],m[0]>Pu&&C(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[Cu*w.compositeIconSizes[0].evaluate(_,{},T),Cu*w.compositeIconSizes[1].evaluate(_,{},T)],(m[0]>Pu||m[1]>Pu)&&C(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,o,m,b,x,_,e.ah.none,r,A.lineStartIndex,A.lineLength,-1,T),D=t.icon.placedSymbolArray.length-1,d&&(z=4*d.length,t.addSymbols(t.icon,d,m,b,x,_,e.ah.vertical,r,A.lineStartIndex,A.lineLength,-1,T),j=t.icon.placedSymbolArray.length-1)}const N=Object.keys(i.horizontal);for(const C of N){const n=i.horizontal[C];if(!M){B=$o(n.text);const e=l.layout.get("text-rotate").evaluate(_,{},T);M=new Rh(c,r,u,h,p,n,d,f,m,e)}const a=1===n.positionedLines.length;if(O+=Wh(t,r,n,o,l,m,_,g,A,i.vertical?e.ah.horizontal:e.ah.horizontalOnly,a?N:[C],F,D,w,T),a)break}i.vertical&&(R+=Wh(t,r,i.vertical,o,l,m,_,g,A,e.ah.vertical,["vertical"],F,j,w,T));const U=M?M.boxStartIndex:t.collisionBoxArray.length,V=M?M.boxEndIndex:t.collisionBoxArray.length,q=P?P.boxStartIndex:t.collisionBoxArray.length,H=P?P.boxEndIndex:t.collisionBoxArray.length,G=E?E.boxStartIndex:t.collisionBoxArray.length,W=E?E.boxEndIndex:t.collisionBoxArray.length,$=L?L.boxStartIndex:t.collisionBoxArray.length,Z=L?L.boxEndIndex:t.collisionBoxArray.length;let X=-1;const Y=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;X=Y(M,X),X=Y(P,X),X=Y(E,X),X=Y(L,X);const K=X>-1?1:0;K&&(X*=S/Oc),t.glyphOffsetArray.length>=Nu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey);const J=qh(l,_,T),[Q,ee]=function(t,r){const n=t.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let a=0;a=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,D,j,B,U,V,q,H,G,W,$,Z,u,O,R,I,z,K,0,d,X,Q,ee)}(t,p,l,n,i,a,P,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,y,[_,_,_,_],T,c,x,w,S,f,r,o,u,h,s)};if("line"===A)for(const e of _h(r.geometry,0,0,ds,ds)){const r=Eh(e,b,k,n.vertical||m,i,24,v,t.overscaling,ds);for(const n of r)m&&Zh(t,m.text,M,n)||L(e,n)}else if("line-center"===A){for(const e of r.geometry)if(e.length>1){const t=Mh(e,k,n.vertical||m,i,24,v);t&&L(e,t)}}else if("Polygon"===r.type)for(const e of Tr(r.geometry,0)){const t=jh(e,16);L(e[0],new wh(t.x,t.y,0))}else if("LineString"===r.type)for(const e of r.geometry)L(e,new wh(e[0].x,e[0].y,0));else if("Point"===r.type)for(const e of r.geometry)for(const t of e)L([t],new wh(t.x,t.y,0))}function Wh(e,t,r,n,i,a,o,s,l,c,u,p,d,f,m){const g=function(e,t,r,n,i,a,o,s){const l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[];for(const u of t.positionedLines)for(const e of u.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let a=4,p=!0,d=1,f=0;const m=(i||s)&&e.vertical,g=e.metrics.advance*e.scale/2;if(s&&t.verticalizable&&(f=u.lineOffset/2-(e.imageName?-(Oc-e.metrics.width*e.scale)/2:(e.scale-1)*Oc)),e.imageName){const t=o[e.imageName];p=t.sdf,d=t.pixelRatio,a=1/d}const y=i?[e.x+g,e.y]:[0,0];let v=i?[0,0]:[e.x+g+r[0],e.y+r[1]-f],x=[0,0];m&&(x=v,v=[0,0]);const b=e.metrics.isDoubleResolution?2:1,_=(e.metrics.left-a)*e.scale-g+v[0],w=(-e.metrics.top-a)*e.scale+v[1],k=_+n.w/b*e.scale/d,T=w+n.h/b*e.scale/d,S=new h(_,w),A=new h(k,w),M=new h(_,T),E=new h(k,T);if(m){const t=new h(-g,g-hu),r=-Math.PI/2,n=12-g,i=new h(22-n,-(e.imageName?n:0)),a=new h(...x);S._rotateAround(r,t)._add(i)._add(a),A._rotateAround(r,t)._add(i)._add(a),M._rotateAround(r,t)._add(i)._add(a),E._rotateAround(r,t)._add(i)._add(a)}if(l){const e=Math.sin(l),t=Math.cos(l),r=[t,-e,e,t];S._matMult(r),A._matMult(r),M._matMult(r),E._matMult(r)}const C=new h(0,0),P=new h(0,0);c.push({tl:S,tr:A,bl:M,br:E,tex:n,writingMode:t.writingMode,glyphOffset:y,sectionIndex:e.sectionIndex,isSDF:p,pixelOffsetTL:C,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}return c}(0,r,s,i,a,o,n,e.allowVerticalPlacement),y=e.textSizeData;let v=null;"source"===y.kind?(v=[Cu*i.layout.get("text-size").evaluate(o,{})],v[0]>Pu&&C(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Cu*f.compositeTextSizes[0].evaluate(o,{},m),Cu*f.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>Pu||v[1]>Pu)&&C(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,g,v,s,a,o,c,t,l.lineStartIndex,l.lineLength,d,m);for(const h of u)p[h]=e.text.placedSymbolArray.length-1;return 4*g.length}function $h(e){for(const t in e)return e[t];return null}function Zh(e,t,r,n){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=Xh[15&r];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Yh(o,a,i,e)}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,n=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=Xh.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Kh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){const s=a[2*o],c=a[2*o+1];s>=e&&s<=r&&c>=t&&c<=n&&l.push(i[o])}continue}const p=h+u>>1,d=a[2*p],f=a[2*p+1];d>=e&&d<=r&&f>=t&&f<=n&&l.push(i[p]),(0===c?e<=d:t<=f)&&(s.push(h),s.push(p-1),s.push(1-c)),(0===c?r>=d:n>=f)&&(s.push(p+1),s.push(u),s.push(1-c))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){const c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)tp(i[2*r],i[2*r+1],e,t)<=l&&s.push(n[r]);continue}const p=h+u>>1,d=i[2*p],f=i[2*p+1];tp(d,f,e,t)<=l&&s.push(n[p]),(0===c?e-r<=d:t-r<=f)&&(o.push(h),o.push(p-1),o.push(1-c)),(0===c?e+r>=d:t+r>=f)&&(o.push(p+1),o.push(u),o.push(1-c))}return s}}function Kh(e,t,r,n,i,a){if(i-n<=r)return;const o=n+i>>1;Jh(e,t,o,n,i,a),Kh(e,t,r,n,o-1,1-a),Kh(e,t,r,o+1,i,1-a)}function Jh(e,t,r,n,i,a){for(;i>n;){if(i-n>600){const o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);Jh(e,t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}const o=t[2*r+a];let s=n,l=i;for(Qh(e,t,n,r),t[2*i+a]>o&&Qh(e,t,n,i);so;)l--}t[2*n+a]===o?Qh(e,t,n,l):(l++,Qh(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Qh(e,t,r,n){ep(e,r,n),ep(t,2*r,2*n),ep(t,2*r+1,2*n+1)}function ep(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function tp(e,t,r,n){const i=e-r,a=t-n;return i*i+a*a}var rp;e.bg=void 0,(rp=e.bg||(e.bg={})).create="create",rp.load="load",rp.fullLoad="fullLoad";let np=null,ip=[];const ap=1e3/60,op="loadTime",sp="fullLoadTime",lp={mark(e){performance.mark(e)},frame(e){const t=e;null!=np&&ip.push(t-np),np=t},clearMetrics(){np=null,ip=[],performance.clearMeasures(op),performance.clearMeasures(sp);for(const t in e.bg)performance.clearMarks(e.bg[t])},getPerformanceMetrics(){performance.measure(op,e.bg.create,e.bg.load),performance.measure(sp,e.bg.create,e.bg.fullLoad);const t=performance.getEntriesByName(op)[0].duration,r=performance.getEntriesByName(sp)[0].duration,n=ip.length,i=1/(ip.reduce(((e,t)=>e+t),0)/n/1e3),a=ip.filter((e=>e>ap)).reduce(((e,t)=>e+(t-ap)/ap),0);return{loadTime:t,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};e.$=class extends Va{},e.A=Fs,e.B=_i,e.C=function(e){if(null==I){const t=e.navigator?e.navigator.userAgent:null;I=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return I},e.D=Ma,e.E=K,e.F=class{constructor(e,t){var r,n,i;this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Qu((()=>this.process())),this.subscription=(r=this.target,n="message",i=e=>this.receive(e),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=L(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise(((r,n)=>{const i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},t&&t.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];const t={id:i,type:"",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(t)}),{once:!0});const a=[],o=Object.assign(Object.assign({},e),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Li(e.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(e){const t=e.data,r=t.id;if(!("file://"!==t.origin&&"file://"!==location.origin&&"resource://android"!==t.origin&&"resource://android"!==location.origin&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(""===t.type){delete this.tasks[r];const e=this.abortControllers[r];return delete this.abortControllers[r],void(e&&e.abort())}if(L(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;const e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,r){return t(this,void 0,void 0,(function*(){if(""===r.type){const t=this.resolveRejects[e];if(delete this.resolveRejects[e],!t)return;return void(r.error?t.reject(Ii(r.error)):t.resolve(Ii(r.data)))}if(!this.messageHandlers[r.type])return void this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const t=Ii(r.data),n=new AbortController;this.abortControllers[e]=n;try{const i=yield this.messageHandlers[r.type](r.sourceMapId,t,n);this.completeTask(e,null,i)}catch(i){this.completeTask(e,i)}}))}completeTask(e,t,r){const n=[];delete this.abortControllers[e];const i={id:e,type:"",sourceMapId:this.mapId,origin:location.origin,error:t?Li(t):null,data:Li(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=V,e.H=function(){var e=new Fs(16);return Fs!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.I=cu,e.J=function(e,t,r){var n,i,a,o,s,l,c,u,h,p,d,f,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=n=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+p*y+t[13],e[14]=a*m+c*g+d*y+t[14],e[15]=o*m+u*g+f*y+t[15]),e},e.K=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.L=Ns,e.M=function(e,t){const r={};for(let n=0;n{const t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(const n of e){const e=window.document.createElement("source");W(n)||(t.crossOrigin="Anonymous"),e.src=n,t.appendChild(e)}}))},e.a4=function(){return T++},e.a5=uo,e.a6=Nu,e.a7=On,e.a8=ys,e.a9=gh,e.aA=function(e){if("custom"===e.type)return new Ju(e);switch(e.type){case"background":return new Zu(e);case"circle":return new Hs(e);case"fill":return new Bl(e);case"fill-extrusion":return new cc(e);case"heatmap":return new rl(e);case"hillshade":return new al(e);case"line":return new Sc(e);case"raster":return new Ku(e);case"symbol":return new Gu(e)}},e.aB=M,e.aC=function(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!te(e.version,t.version))return[{command:"setStyle",args:[t]}];te(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),te(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),te(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),te(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),te(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),te(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),te(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),te(e.light,t.light)||r.push({command:"setLight",args:[t.light]}),te(e.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),te(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),te(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const n={},i=[];!function(e,t,r,n){let i;for(i in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||ie(i,r,n));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?te(e[i],t[i])||("geojson"===e[i].type&&"geojson"===t[i].type&&oe(e,t,i)?re(r,{command:"setGeoJSONSourceData",args:[i,t[i].data]}):ae(i,t,r,n)):ne(i,t,r))}(e.sources,t.sources,i,n);const a=[];e.layers&&e.layers.forEach((e=>{"source"in e&&n[e.source]?r.push({command:"removeLayer",args:[e.id]}):a.push(e)})),r=r.concat(i),function(e,t,r){t=t||[];const n=(e=e||[]).map(le),i=t.map(le),a=e.reduce(ce,{}),o=t.reduce(ce,{}),s=n.slice(),l=Object.create(null);let c,u,h,p,d;for(let f=0,m=0;f@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const a=n||i;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t},e.ab=function(e,t){const r=[];for(const n in e)n in t||r.push(n);return r},e.ac=_,e.ad=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+p*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=p*i-l*n,e},e.ae=function(e){var t=new Fs(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.af=qs,e.ag=function(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:a,maxZoom:o}=e,s=i?_(jt.interpolationFactor(i,t,a,o),0,1):0;"camera"===e.kind?n=Dt.number(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}},e.ai=function(e,t,r){let{uSize:n,uSizeT:i}=t,{lowerSize:a,upperSize:o}=r;return"source"===e.kind?a/Cu:"composite"===e.kind?Dt.number(a/Cu,o/Cu,i):n},e.aj=Du,e.ak=function(e,t,r,n){const i=t.y-e.y,a=t.x-e.x,o=n.y-r.y,s=n.x-r.x,l=o*a-s*i;if(0===l)return null;const c=(s*(e.y-r.y)-o*(e.x-r.x))/l;return new h(e.x+c*a,e.y+c*i)},e.al=_h,e.am=bs,e.an=Bs,e.ao=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[t,r,n,i]},e.ap=Oc,e.ar=Iu,e.as=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-p*f,A=u*y-d*f,M=h*g-p*m,E=h*y-d*m,C=p*y-d*g,P=v*C-x*E+b*M+_*A-w*S+k*T;return P?(e[0]=(s*C-l*E+c*M)*(P=1/P),e[1]=(i*E-n*C-a*M)*P,e[2]=(m*k-g*w+y*_)*P,e[3]=(p*w-h*k-d*_)*P,e[4]=(l*A-o*C-c*S)*P,e[5]=(r*C-i*A+a*S)*P,e[6]=(g*b-f*k-y*x)*P,e[7]=(u*k-p*b+d*x)*P,e[8]=(o*E-s*A+c*T)*P,e[9]=(n*A-r*E-a*T)*P,e[10]=(f*w-m*b+y*v)*P,e[11]=(h*b-u*w-d*v)*P,e[12]=(s*S-o*M-l*T)*P,e[13]=(r*M-n*S+i*T)*P,e[14]=(m*x-f*_-g*v)*P,e[15]=(u*_-h*x+p*v)*P,e):null},e.at=Hh,e.au=Tu,e.av=Yh,e.aw=function(){const e={},t=J.$version;for(const r in J.$root){const n=J.$root[r];if(n.required){let i=null;i="version"===r?t:"array"===n.type?[]:{},null!=i&&(e[r]=i)}}return e},e.ax=zi,e.ay=H,e.az=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r25||n<0||n>=1||r<0||r>=1)},e.bc=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.bd=class extends Ua{},e.be=eh,e.bf=lp,e.bh=q,e.bi=function(e,t){N.REGISTERED_PROTOCOLS[e]=t},e.bj=function(e){delete N.REGISTERED_PROTOCOLS[e]},e.bk=function(e,t){const r={};for(let i=0;ie*Oc))}let x=s?"center":n.get("text-justify").evaluate(u,{},t.canonical);const b="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(u,{},t.canonical)*Oc:1/0,_=()=>{t.bucket.allowVerticalPlacement&&aa(a)&&(f.vertical=fu(m,t.glyphMap,t.glyphPositions,t.imagePositions,i,b,o,g,"left",d,y,e.ah.vertical,!0,p,h))};if(!s&&v){const r=new Set;if("auto"===x)for(let e=0;et(void 0,void 0,void 0,(function*(){if(0===e.byteLength)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),e.e=k,e.f=e=>new Promise(((t,r)=>{const n=new Image;n.onload=()=>{t(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=O}))},n.onerror=()=>r(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 i=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?URL.createObjectURL(i):O})),e.g=U,e.h=(e,t)=>G(k(e,{type:"json"}),t),e.i=L,e.j=Y,e.k=X,e.l=(e,t)=>G(k(e,{type:"arrayBuffer"}),t),e.m=G,e.n=function(e){return new iu(e).readFields(au,[])},e.o=Js,e.p=lu,e.q=Ia,e.r=bi,e.s=W,e.t=Ti,e.u=xi,e.v=J,e.w=C,e.x=function(e){let[t,r,n]=e;return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(n),y:t*Math.sin(r)*Math.sin(n),z:t*Math.cos(n)}},e.y=Dt,e.z=va})),n("worker",0,(function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,r){for(const i of t){this._layerConfigs[i.id]=i;const t=this._layers[i.id]=e.aA(i);t._featureFilter=e.a7(t.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const n=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const e of n){const t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const a=r.sourceLayer||"_geojsonTileLayer";let o=i[a];o||(o=i[a]=[]),o.push(t)}}}class r{constructor(t){const r={},n=[];for(const e in t){const i=t[e],a=r[e]={};for(const e in i){const t=i[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}const{w:i,h:a}=e.p(n),o=new e.o({width:i||1,height:a||1});for(const s in t){const n=t[s];for(const t in n){const i=n[+t];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=r[s][t].rect;e.o.copy(i.bitmap,o,{x:0,y:0},{x:a.x+1,y:a.y+1},i.bitmap)}}this.image=o,this.positions=r}}e.bl("GlyphAtlas",r);class n{constructor(t){this.tileID=new e.S(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,n,a,o){return e._(this,void 0,void 0,(function*(){this.status="parsing",this.data=t,this.collisionBoxArray=new e.a5;const s=new e.bm(Object.keys(t.layers).sort()),l=new e.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(const r in h){const n=t.layers[r];if(!n)continue;1===n.version&&e.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=s.encode(r),p=[];for(let e=0;e=r.maxzoom||"none"!==r.visibility&&(i(t,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(p,u,this.tileID.canonical),l.bucketLayerIDs.push(t.map((e=>e.id))))}}const p=e.aF(u.glyphDependencies,(e=>Object.keys(e).map(Number)));this.inFlightDependencies.forEach((e=>null==e?void 0:e.abort())),this.inFlightDependencies=[];let d=Promise.resolve({});if(Object.keys(p).length){const e=new AbortController;this.inFlightDependencies.push(e),d=o.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},e)}const f=Object.keys(u.iconDependencies);let m=Promise.resolve({});if(f.length){const e=new AbortController;this.inFlightDependencies.push(e),m=o.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},e)}const g=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(g.length){const e=new AbortController;this.inFlightDependencies.push(e),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},e)}const[v,x,b]=yield Promise.all([d,m,y]),_=new r(v),w=new e.bo(x,b);for(const t in c){const r=c[t];r instanceof e.a6?(i(r.layers,this.zoom,a),e.bp({bucket:r,glyphMap:v,glyphPositions:_.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof e.bq||r instanceof e.br||r instanceof e.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((e=>!e.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?_.positions:null}}))}}function i(t,r,n){const i=new e.z(r);for(const e of t)e.recalculate(i,n)}class a{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){const n=yield e.l(t.request,r);try{return{vectorTile:new e.bt.VectorTile(new e.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){const e=new Uint8Array(n.data);let r=`Unable to parse the tile at ${t.request.url}, `;throw r+=31===e[0]&&139===e[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${i.message}`,new Error(r)}}))}loadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.uid,i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request),a=new n(t);this.loading[r]=a;const o=new AbortController;a.abort=o;try{const n=yield this.loadVectorTile(t,o);if(delete this.loading[r],!n)return null;const s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(i){const e=i.finish();e&&(c.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=n.vectorTile;const u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{const t=yield u;return e.e({rawTileData:s.slice(0)},t,l,c)}finally{delete this.fetching[r]}}catch(s){throw delete this.loading[r],a.status="done",this.loaded[r]=a,s}}))}reloadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const n=this.loaded[r];if(n.showCollisionBoxes=t.showCollisionBoxes,"parsing"===n.status){const t=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);let i;if(this.fetching[r]){const{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],i=e.e({rawTileData:n.slice(0)},t,a,o)}else i=t;return i}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){const e=this.loading,r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort.abort(),delete e[r])}))}removeTile(t){return e._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[t.uid]&&delete this.loaded[t.uid]}))}}class o{constructor(){this.loaded={}}loadTile(t){return e._(this,void 0,void 0,(function*(){const{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=t,c=i.width+2,u=i.height+2,h=e.b(i)?new e.R({width:c,height:u},yield e.bw(i,-1,-1,c,u)):i,p=new e.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=p,p}))}removeTile(e){const t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}function s(e,t){if(0!==e.length){l(e[0],t);for(var r=1;r=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var c=e.by((function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n>31}function S(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;se},C=Math.fround||(P=new Float32Array(1),e=>(P[0]=+e,P[0]));var P;class L{constructor(e){this.options=Object.assign(Object.create(E),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:n}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const a=[];for(let s=0;s=r;s--){const e=+Date.now();o=this.trees[s]=this._createTree(this._cluster(o,s)),t&&console.log("z%d: %d clusters in %dms",s,o.numItems,+Date.now()-e)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){const e=this.getClusters([r,n,180,a],t),o=this.getClusters([-180,n,i,a],t);return e.concat(o)}const o=this.trees[this._limitZoom(t)],s=o.range(O(r),R(a),O(i),R(n)),l=o.data,c=[];for(const u of s){const e=this.stride*u;c.push(l[e+5]>1?I(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const a=i.data;if(t*this.stride>=a.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[t*this.stride],a[t*this.stride+1],o),l=[];for(const c of s){const t=c*this.stride;a[t+4]===e&&l.push(a[t+5]>1?I(a,t,this.clusterProps):this.points[a[t+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,r){const n=[];return this._appendLeaves(n,e,t=t||10,r=r||0,0),n}getTile(e,t,r){const n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.data,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,n,i){const a=this.getChildren(t);for(const o of a){const t=o.properties;if(t&&t.cluster?i+t.point_count<=n?i+=t.point_count:i=this._appendLeaves(e,t.cluster_id,r,n,i):i1;let l,c,u;if(s)l=z(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const r=this.points[t[e+3]];l=r.properties;const[n,i]=r.geometry.coordinates;c=O(n),u=R(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let p;p=s||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==p&&(h.id=p),a.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let u=0;ut&&(d+=s[r+5])}if(d>p&&d>=a){let e,a=r*p,o=n*p,f=-1;const m=(u/c<<5)+(t+1)+this.points.length;for(const r of h){const n=r*c;if(s[n+2]<=t)continue;s[n+2]=t;const l=s[n+5];a+=s[n]*l,o+=s[n+1]*l,s[n+4]=m,i&&(e||(e=this._map(s,u,!0),f=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,n)))}s[u+4]=m,l.push(a/d,o/d,1/0,m,-1,d),i&&l.push(f)}else{for(let e=0;e1)for(const e of h){const r=e*c;if(!(s[r+2]<=t)){s[r+2]=t;for(let e=0;e>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return r?Object.assign({},n):n}const n=this.points[e[t+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function I(e,t,r){return{type:"Feature",id:e[t+3],properties:z(e,t,r),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),D(e[t+1])]}};var n}function z(e,t,r){const n=e[t+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=e[t+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:i})}function O(e){return e/360+.5}function R(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function D(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function j(e,t,r,n){let i=n;const a=t+(r-t>>1);let o,s=r-t;const l=e[t],c=e[t+1],u=e[r],h=e[r+1];for(let p=t+3;pi)o=p,i=t;else if(t===i){const e=Math.abs(p-a);en&&(o-t>3&&j(e,t,o,n),e[o+2]=i,r-o>3&&j(e,o,r,n))}function F(e,t,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){const l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=e-r,s=t-n,o*o+s*s}function B(e,t,r,n){const i={id:null==e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)N(i,r);else if("Polygon"===t)N(i,r[0]);else if("MultiLineString"===t)for(const a of r)N(i,a);else if("MultiPolygon"===t)for(const a of r)N(i,a[0]);return i}function N(e,t){for(let r=0;r0&&(o+=n?(i*s-r*a)/2:Math.sqrt(Math.pow(r-i,2)+Math.pow(s-a,2))),i=r,a=s}const s=t.length-3;t[2]=1,j(t,0,s,r),t[s+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function H(e,t,r,n){for(let i=0;i1?1:r}function $(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o=n)return null;const l=[];for(const c of e){const e=c.geometry;let t=c.type;const a=0===i?c.minX:c.minY,o=0===i?c.maxX:c.maxY;if(a>=r&&o=n)continue;let u=[];if("Point"===t||"MultiPoint"===t)Z(e,u,r,n,i);else if("LineString"===t)X(e,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===t)K(e,u,r,n,i,!1);else if("Polygon"===t)K(e,u,r,n,i,!0);else if("MultiPolygon"===t)for(const s of e){const e=[];K(s,e,r,n,i,!0),e.length&&u.push(e)}if(u.length){if(s.lineMetrics&&"LineString"===t){for(const e of u)l.push(B(c.id,t,e,c.tags));continue}"LineString"!==t&&"MultiLineString"!==t||(1===u.length?(t="LineString",u=u[0]):t="MultiLineString"),"Point"!==t&&"MultiPoint"!==t||(t=3===u.length?"Point":"MultiPoint"),l.push(B(c.id,t,u,c.tags))}}return l.length?l:null}function Z(e,t,r,n,i){for(let a=0;a=r&&o<=n&&J(t,e[a],e[a+1],e[a+2])}}function X(e,t,r,n,i,a,o){let s=Y(e);const l=0===i?Q:ee;let c,u,h=e.start;for(let g=0;gr&&(u=l(s,p,d,m,y,r),o&&(s.start=h+c*u)):v>n?x=r&&(u=l(s,p,d,m,y,r),b=!0),x>n&&v<=n&&(u=l(s,p,d,m,y,n),b=!0),!a&&b&&(o&&(s.end=h+c*u),t.push(s),s=Y(e)),o&&(h+=c)}let p=e.length-3;const d=e[p],f=e[p+1],m=0===i?d:f;m>=r&&m<=n&&J(s,d,f,e[p+2]),p=s.length-3,a&&p>=3&&(s[p]!==s[0]||s[p+1]!==s[1])&&J(s,s[0],s[1],s[2]),s.length&&t.push(s)}function Y(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function K(e,t,r,n,i,a){for(const o of e)X(o,t,r,n,i,a,!1)}function J(e,t,r,n){e.push(t,r,n)}function Q(e,t,r,n,i,a){const o=(a-t)/(n-t);return J(e,a,r+(i-r)*o,1),o}function ee(e,t,r,n,i,a){const o=(a-r)/(i-r);return J(e,t+(n-t)*o,a,1),o}function te(e,t){const r=[];for(let n=0;n0&&t.size<(i?o:n))return void(r.numPoints+=t.length/3);const s=[];for(let l=0;lo)&&(r.numSimplified++,s.push(t[l],t[l+1])),r.numPoints++;i&&function(e,t){let r=0;for(let n=0,i=e.length,a=i-2;n0===t)for(let n=0,i=e.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){const r=[];if("FeatureCollection"===e.type)for(let n=0;n1&&console.time("creation"),p=this.tiles[h]=ae(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(p.source=e,null==i){if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===i)continue;if(null!=i){const e=i-t;if(r!==a>>e||n!==o>>e)continue}}if(p.source=null,0===e.length)continue;c>1&&console.time("clipping");const d=.5*l.buffer/l.extent,f=.5-d,m=.5+d,g=1+d;let y=null,v=null,x=null,b=null,_=$(e,u,r-d,r+m,0,p.minX,p.maxX,l),w=$(e,u,r+f,r+g,0,p.minX,p.maxX,l);e=null,_&&(y=$(_,u,n-d,n+m,1,p.minY,p.maxY,l),v=$(_,u,n+f,n+g,1,p.minY,p.maxY,l),_=null),w&&(x=$(w,u,n-d,n+m,1,p.minY,p.maxY,l),b=$(w,u,n+f,n+g,1,p.minY,p.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],t+1,2*r,2*n),s.push(v||[],t+1,2*r,2*n+1),s.push(x||[],t+1,2*r+1,2*n),s.push(b||[],t+1,2*r+1,2*n+1)}}getTile(e,t,r){e=+e,t=+t,r=+r;const n=this.options,{extent:i,debug:a}=n;if(e<0||e>24)return null;const o=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);let l,c=e,u=t,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ue(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ne(this.tiles[s],i):null):null}}function ue(e,t,r){return 32*((1<{s.properties=e;const t={};for(const r of l)t[r]=i[r].evaluate(o,s);return t},r.reduce=(e,t)=>{s.properties=t;for(const r of l)o.accumulated=e[r],e[r]=a[r].evaluate(o,s)},r}(t)).load((yield this._pendingData).features):(i=yield this._pendingData,new ce(i,t.geojsonVtOptions)),this.loaded={};const r={};if(n){const e=n.finish();e&&(r.resourceTiming={},r.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}return r}catch(a){if(delete this._pendingRequest,e.bB(a))return{abandoned:!0};throw a}var i}))}getData(){return e._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(e){const t=this.loaded;return t&&t[e.uid]?super.reloadTile(e):this.loadTile(e)}loadAndProcessGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(t,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(c(n,!0),t.filter){const r=e.bC(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const i=n.features.filter((e=>r.value.evaluate({zoom:0},e)));n={type:"FeatureCollection",features:i}}return n}))}loadGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){const{promoteId:n}=t;if(t.request){const i=yield e.h(t.request,r);return this._dataUpdateable=pe(i.data,n)?de(i.data,n):void 0,i.data}if("string"==typeof t.data)try{const e=JSON.parse(t.data);return this._dataUpdateable=pe(e,n)?de(e,n):void 0,e}catch(i){throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}if(!t.dataDiff)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${t.source}`);return function(e,t,r){var n,i,a,o;if(t.removeAll&&e.clear(),t.remove)for(const s of t.remove)e.delete(s);if(t.add)for(const s of t.add){const t=he(s,r);null!=t&&e.set(t,s)}if(t.update)for(const s of t.update){let t=e.get(s.id);if(null==t)continue;const r=!s.removeAllProperties&&((null===(n=s.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=s.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((s.newGeometry||s.removeAllProperties||r)&&(t=Object.assign({},t),e.set(s.id,t),r&&(t.properties=Object.assign({},t.properties))),s.newGeometry&&(t.geometry=s.newGeometry),s.removeAllProperties)t.properties={};else if((null===(a=s.removeProperties)||void 0===a?void 0:a.length)>0)for(const e of s.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null===(o=s.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(const{key:e,value:n}of s.addOrUpdateProperties)t.properties[e]=n}}(this._dataUpdateable,t.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(t){return e._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset)}}class me{constructor(t){this.self=t,this.actor=new e.F(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=t=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(t)},this.actor.registerMessageHandler("LDT",((e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t))),this.actor.registerMessageHandler("RDT",((t,r)=>e._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(t,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t))),this.actor.registerMessageHandler("GD",((e,t)=>this._getWorkerSource(e,t.type,t.source).getData())),this.actor.registerMessageHandler("LT",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t))),this.actor.registerMessageHandler("RT",((e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t))),this.actor.registerMessageHandler("AT",((e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t))),this.actor.registerMessageHandler("RMT",((e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t))),this.actor.registerMessageHandler("RS",((t,r)=>e._(this,void 0,void 0,(function*(){if(!this.workerSources[t]||!this.workerSources[t][r.type]||!this.workerSources[t][r.type][r.source])return;const e=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],void 0!==e.removeSource&&e.removeSource(r)})))),this.actor.registerMessageHandler("RM",(t=>e._(this,void 0,void 0,(function*(){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t]})))),this.actor.registerMessageHandler("SR",((t,r)=>e._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((e,t)=>this._syncRTLPluginState(e,t))),this.actor.registerMessageHandler("IS",((t,r)=>e._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((e,t)=>this._setImages(e,t))),this.actor.registerMessageHandler("UL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).replace(r)}))))}_setImages(t,r){return e._(this,void 0,void 0,(function*(){this.availableImages[t]=r;for(const e in this.workerSources[t]){const n=this.workerSources[t][e];for(const e in n)n[e].availableImages=r}}))}_syncRTLPluginState(t,r){return e._(this,void 0,void 0,(function*(){if(e.bD.isParsed())return e.bD.getState();if("loading"!==r.pluginStatus)return e.bD.setState(r),r;const t=r.pluginURL;if(this.self.importScripts(t),e.bD.isParsed()){const r={pluginStatus:"loaded",pluginURL:t};return e.bD.setState(r),r}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${t}`)}))}_getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new t),r}_getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){const n={sendAsync:(t,r)=>(t.targetMapId=e,this.actor.sendAsync(t,r))};switch(t){case"vector":this.workerSources[e][t][r]=new a(n,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new fe(n,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](n,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new o),this.demWorkerSources[e][t]}}return e.i(self)&&(self.worker=new me(self)),me})),n("index",0,(function(e,t){var r="4.7.1";let n,i;const a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:e=>new Promise(((r,n)=>{const i=requestAnimationFrame(r);e.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(t.c())}))})),getImageData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){const t=window.document.createElement("canvas"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height),r},resolveURL:e=>(n||(n=document.createElement("a")),n.href=e,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(e){if(!o.docStyle)return e[0];for(let t=0;t3&&void 0!==arguments[3]?arguments[3]:{};e.addEventListener(t,r,"passive"in n?n:n.capture)}static removeEventListener(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.removeEventListener(t,r,"passive"in n?n:n.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(e){const t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,r,n){const i=r.boundingClientRect;return new t.P((n.clientX-i.left)/r.x-e.clientLeft,(n.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,t){const r=o.getScale(e);return o.getPoint(e,r,t)}static touchPos(e,t){const r=[],n=o.getScale(e);for(let i=0;i{l&&p(l),l=null,h=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(e){let r,n,i,a;e.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},e.addThrottleControl=e=>{const t=i++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],l()},e.getImage=function(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise(((a,o)=>{s.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),t.e(e,{type:"image"}),r.push({abortController:n,requestParameters:e,supportImageRefresh:i,state:"queued",onError:e=>{o(e)},onSuccess:e=>{a(e)}}),l()}))};const o=e=>t._(this,void 0,void 0,(function*(){e.state="running";const{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:s}=e,u=!1===i&&!t.i(self)&&!t.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((e,t)=>e&&"accept"===t),!0));n++;const h=u?c(r,s):t.m(r,s);try{const r=yield h;delete e.abortController,e.state="completed",r.data instanceof HTMLImageElement||t.b(r.data)?o(r):r.data&&o({data:yield(p=r.data,"function"==typeof createImageBitmap?t.d(p):t.f(p)),cacheControl:r.cacheControl,expires:r.expires})}catch(d){delete e.abortController,a(d)}finally{n--,l()}var p})),l=()=>{const e=(()=>{for(const e of Object.keys(a))if(a[e]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let t=n;t0;t++){const e=r.shift();e.abortController.signal.aborted?t--:o(e)}},c=(e,r)=>new Promise(((n,i)=>{const a=new Image,o=e.url,s=e.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!t.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(t.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(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."))},a.src=o}))}(d||(d={})),d.resetRequestQueue();class f{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function m(e){var r=new t.A(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}var g,y=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e};g=new t.A(3),t.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v=function(e){var t=e[0],r=e[1];return t*t+r*r};function x(e){const t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&e.length>0){const r=[];for(const{id:n,url:i}of e){const e=`${n}${i}`;-1===r.indexOf(e)&&(r.push(e),t.push({id:n,url:i}))}}return t}function b(e,t,r){const n=e.split("?");return n[0]+=`${t}${r}`,n.join("?")}!function(){var e=new t.A(2);t.A!=Float32Array&&(e[0]=0,e[1]=0)}();class _{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,r,n){const{width:i,height:a}=e,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,e.data);else{const{x:r,y:o}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,t,r){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function w(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class k extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){const r=this.images[e];if(r&&!r.data&&r.spriteData){const e=r.spriteData;r.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),r.spriteData=null}return r}addImage(e,t){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,r){let n=!0;const i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let r=0;for(const n of e){if(n[0]2&&void 0!==arguments[2])||arguments[2];const n=this.getImage(e);if(r&&(n.data.width!==t.data.width||n.data.height!==t.data.height))throw new Error(`size mismatch between old image (${n.data.width}x${n.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=n.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((t,r)=>{let n=!0;if(!this.isLoaded())for(const i of e)this.images[i]||(n=!1);this.isLoaded()||n?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})}))}_getImagesForIds(e){const r={};for(const n of e){let e=this.getImage(n);e||(this.fire(new t.k("styleimagemissing",{id:n})),e=this.getImage(n)),e?r[n]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:Boolean(e.userImage&&e.userImage.render)}:t.w(`Image "${n}" 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 r}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){const r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new t.I(r,n);this.patterns[e]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new _(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const t in this.patterns)e.push(this.patterns[t].bin);const{w:r,h:n}=t.p(e),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const a in this.patterns){const{bin:e}=this.patterns[a],r=e.x+1,n=e.y+1,o=this.getImage(a).data,s=o.width,l=o.height;t.R.copy(o,i,{x:0,y:0},{x:r,y:n},{width:s,height:l}),t.R.copy(o,i,{x:0,y:l-1},{x:r,y:n-1},{width:s,height:1}),t.R.copy(o,i,{x:0,y:0},{x:r,y:n+l},{width:s,height:1}),t.R.copy(o,i,{x:s-1,y:0},{x:r-1,y:n},{width:1,height:l}),t.R.copy(o,i,{x:0,y:0},{x:r+s,y:n},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const e=this.getImage(r);e||t.w(`Image with ID: "${r}" was not found`),w(e)&&this.updateImage(r,e)}}}const T=1e20;function S(e,t,r,n,i,a,o,s,l){for(let c=t;c-1);l++,a[l]=s,o[l]=c,o[l+1]=T}for(let s=0,l=0;s65535)throw new Error("glyphs > 65535 not supported");if(t.ranges[i])return{stack:e,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!t.requests[i]){const r=M.loadGlyphRange(e,i,this.url,this.requestManager);t.requests[i]=r}const a=yield t.requests[i];for(const e in a)this._doesCharSupportLocalGlyph(+e)||(t.glyphs[+e]=a[+e]);return t.ranges[i]=!0,{stack:e,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,r,n){const i=this.localIdeographFontFamily;if(!i)return;if(!this._doesCharSupportLocalGlyph(n))return;let a=e.tinySDF;if(!a){let t="400";/bold/i.test(r)?t="900":/medium/i.test(r)?t="500":/light/i.test(r)&&(t="200"),a=e.tinySDF=new M.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:t})}const o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new t.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}M.loadGlyphRange=function(e,r,n,i){return t._(this,void 0,void 0,(function*(){const a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",e).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield t.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);const c={};for(const e of t.n(l.data))c[e.id]=e;return c}))},M.TinySDF=class{constructor(){let{fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=t,this.cutoff=n,this.radius=r;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),p=new Uint8ClampedArray(h),d={data:p,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return d;const{ctx:f,buffer:m,gridInner:g,gridOuter:y}=this;f.clearRect(m,m,s,l),f.fillText(e,m,m+o);const v=f.getImageData(m,m,s,l);y.fill(T,0,h),g.fill(0,0,h);for(let x=0;x0?e*e:0,g[r]=e<0?e*e:0}}S(y,0,0,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let x=0;x1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(t.r,e,r))for(const t in e){const r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,n){return(!n||!1!==n.validate)&&t.t(this,e.call(t.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}const L=new t.q({"sky-color":new t.D(t.v.sky["sky-color"]),"horizon-color":new t.D(t.v.sky["horizon-color"]),"fog-color":new t.D(t.v.sky["fog-color"]),"fog-ground-blend":new t.D(t.v.sky["fog-ground-blend"]),"horizon-fog-blend":new t.D(t.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new t.D(t.v.sky["sky-horizon-blend"]),"atmosphere-blend":new t.D(t.v.sky["atmosphere-blend"])});class I extends t.E{constructor(e){super(),this._transitionable=new t.T(L),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(t.B,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const t in e){const r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!1!==(null==n?void 0:n.validate)&&t.t(this,e.call(t.u,t.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class z{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){const r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===e[0]});let s=e[0];for(let l=1;l1&&(o=e[++a]);const l=Math.abs(s-o.left),c=Math.abs(s-o.right),u=Math.min(l,c);let h;const p=i/r*(n+1);if(o.isDash){const e=n-Math.abs(p);h=Math.sqrt(u*u+e*e)}else h=n-Math.sqrt(u*u+p*p);this.data[t+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e){for(let o=e.length-1;o>=0;--o){const t=e[o],r=e[o+1];t.zeroLength?e.splice(o,1):r&&r.isDash===t.isDash&&(r.left=t.left,e.splice(o,1))}const t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);const n=this.width*this.nextRow;let i=0,a=e[i];for(let o=0;o1&&(a=e[++i]);const t=Math.abs(o-a.left),r=Math.abs(o-a.right),s=Math.min(t,r);this.data[n+o]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(e,r){const n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.w("LineAtlas out of space"),null;let a=0;for(let t=0;t{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}const D=Math.floor(a.hardwareConcurrency/2);let j,F;function B(){return j||(j=new R),j}R.workerCount=t.C(globalThis)?Math.max(Math.min(D,3),1):1;class N{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;const n=this.workerPool.acquire(r);for(let i=0;i0&&void 0!==arguments[0])||arguments[0];this.actors.forEach((e=>{e.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){for(const r of this.actors)r.registerMessageHandler(e,t)}}function U(){return F||(F=new N(B(),t.G),F.registerMessageHandler("GR",((e,r,n)=>t.m(r,n)))),F}function V(e,r){const n=t.H();return t.J(n,n,[1,1,0]),t.K(n,n,[.5*e.width,.5*e.height,1]),t.L(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function q(e,t,r,n,i,a){const o=function(e,t,r){if(e)for(const n of e){const e=t[n];if(e&&e.source===r&&"fill-extrusion"===e.type)return!0}else for(const n in t){const e=t[n];if(e.source===r&&"fill-extrusion"===e.type)return!0}return!1}(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),l=e.tilesIn(n,s,o);l.sort(H);const c=[];for(const h of l)c.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(t,r,e._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,i,a,s,V(e.transform,h.tileID))});const u=function(e){const t={},r={};for(const n of e){const e=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(const r in e){const n=e[r],i=a[r]=a[r]||{},o=t[r]=t[r]||[];for(const e of n)i[e.featureIndex]||(i[e.featureIndex]=!0,o.push(e))}}return t}(c);for(const h in u)u[h].forEach((t=>{const r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function H(e,t){const r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function G(e,r,n){return t._(this,void 0,void 0,(function*(){let i=e;if(e.url?i=(yield t.h(r.transformRequest(e.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;const o=t.M(t.e(i,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map((e=>e.id))),o}))}class W{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}extend(e){const r=this._sw,n=this._ne;let i,a;if(e instanceof t.N)i=e,a=e;else{if(!(e instanceof W))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(W.convert(e)):this.extend(t.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(t.N.convert(e)):this;if(i=e._sw,a=e._ne,!i||!a)return this}return r||n?(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(a.lng,n.lng),n.lat=Math.max(a.lat,n.lat)):(this._sw=new t.N(i.lng,i.lat),this._ne=new t.N(a.lng,a.lat)),this}getCenter(){return new t.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 t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.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(e){const{lng:r,lat:n}=t.N.convert(e);let i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(e){return e instanceof W?e:e?new W(e):e}static fromLngLat(e){const r=360*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)/40075017,n=r/Math.cos(Math.PI/180*e.lat);return new W(new t.N(e.lng-n,e.lat-r),new t.N(e.lng+n,e.lat+r))}adjustAntiMeridian(){const e=new t.N(this._sw.lng,this._sw.lat),r=new t.N(this._ne.lng,this._ne.lat);return new W(e,e.lng>r.lng?new t.N(r.lng+360,r.lat):r)}}class ${constructor(e,t,r){this.bounds=W.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const r=Math.pow(2,e.z),n=Math.floor(t.O(this.bounds.getWest())*r),i=Math.floor(t.Q(this.bounds.getNorth())*r),a=Math.ceil(t.O(this.bounds.getEast())*r),o=Math.ceil(t.Q(this.bounds.getSouth())*r);return e.x>=n&&e.x=i&&e.y{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise(((t,r)=>{e.reloadPromise={resolve:t,reject:r}}))}else e.actor=this.dispatcher.getActor(),n="LT";e.abortController=new AbortController;try{const t=yield e.actor.sendAsync({type:n,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t)}catch(i){if(delete e.abortController,e.aborted)return;if(i&&404!==i.status)throw i;this._afterTileLoadWorkerResponse(e,null)}}))}_afterTileLoadWorkerResponse(e,t){if(t&&t.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.loadVectorData(t,this.map.painter),e.reloadPromise){const t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class X extends t.E{constructor(e,r,n,i){super(),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},r),t.e(this,t.M(r,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(t.e(this,e),e.bounds&&(this.tileBounds=new $(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return t.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const r=yield d.getImage(this.map._requestManager.transformRequest(t,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const t=this.map.painter.context,n=t.gl,i=r.data;e.texture=this.map.painter.getTileTexture(i.width),e.texture?e.texture.update(i,{useMipmap:!0}):(e.texture=new _(t,i,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(r){if(delete e.abortController,e.aborted)e.state="unloaded";else if(r)throw e.state="errored",r}}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class Y extends X{constructor(e,r,n,i){super(e,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const r=yield d.getImage(n,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){const n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=t.b(n)&&t.U()?n:yield this.readImageNow(n),a={type:this.type,uid:e.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||"expired"===e.state){e.actor=this.dispatcher.getActor();const t=yield e.actor.sendAsync({type:"LDT",data:a});e.dem=t,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(i){if(delete e.abortController,e.aborted)e.state="unloaded";else if(i)throw e.state="errored",i}}))}readImageNow(e){return t._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&t.V()){const n=e.width+2,i=e.height+2;try{return new t.R({width:n,height:i},yield t.W(e,-1,-1,n,i))}catch(r){}}return a.getImageData(e,1)}))}_getNeighboringTiles(e){const r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.S(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+10&&t.e(i,{resourceTiming:n}),this.fire(new t.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(n){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(n))}}))}loaded(){return 0===this._pendingLoads}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.actor?"RT":"LT";e.actor=this.actor;const r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const n=yield this.actor.sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(n,this.map.painter,"RT"===t)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.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 t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var J=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Q extends t.E{constructor(e,t,r,n){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=t}load(e){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const t=yield d.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,t&&t.data&&(this.image=t.data,e&&(this.coordinates=e),this._finishLoading())}catch(r){this._request=null,this._loaded=!0,this.fire(new t.j(r))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const r=e.map(t.Z.fromLngLat);this.tileID=function(e){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(const t of e)r=Math.min(r,t.x),n=Math.min(n,t.y),i=Math.max(i,t.x),a=Math.max(a,t.y);const o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new t.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const n=r.map((e=>this.tileID.getTilePoint(e)._round()));return this._boundsArray=new t.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new _(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return t._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ee extends Q{constructor(e,t,r,n){super(e,t,r,n),this.roundZoom=!0,this.type="video",this.options=t}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const t of e.urls)this.urls.push(this.map._requestManager.transformRequest(t,"Source").url);try{const e=yield t.a3(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new t.j(r))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const r=this.video.seekable;er.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new _(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new t.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 te extends Q{constructor(e,r,n,i){super(e,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new t.j(new t.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.j(new t.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${e}`,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.j(new t.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return t._(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 t.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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const re={},ne=e=>{switch(e){case"geojson":return K;case"image":return Q;case"raster":return X;case"raster-dem":return Y;case"vector":return Z;case"video":return ee;case"canvas":return te}return re[e]},ie="RTLPluginLoaded";class ae extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=U()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((e=>{throw this.status="error",e}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return t._(this,arguments,void 0,(function(e){var t=this;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){if(t.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(t.url=a.resolveURL(e),!t.url)throw new Error(`requested url ${e} is invalid`);if("unavailable"===t.status){if(!r)return t._requestImport();t.status="deferred",t._syncState(t.status)}else if("requested"===t.status)return t._requestImport()}()}))}_requestImport(){return t._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(ie))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let oe=null;function se(){return oe||(oe=new ae),oe}class le{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=t.a4(),this.uses=0,this.tileSize=r,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(e){const t=e+this.timeAdded;tt.getLayer(e))).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)r[t.id]=n}}return r}(e.buckets,r.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const r=this.buckets[e];if(r instanceof t.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const r=this.buckets[e];if(r instanceof t.a6&&r.hasRTLText){this.hasRTLText=!0,se().lazyLoad();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(e).queryRadius(t))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].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(e){return this.buckets[e.id]}upload(e){for(const r in this.buckets){const t=this.buckets[r];t.uploadPending()&&t.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new _(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new _(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}}querySourceFeatures(e,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;const s=t.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let p=0;pe)t=!1;else if(r)if(this.expirationTime{this.remove(e,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const r in this.data)for(const n of this.data[r])e(n.value)||t.push(n);for(const r of t)this.remove(r.value.tileID,r)}}class ue{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,n){const i=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},t.e(this.stateChanges[e][i],n),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][i]){this.deletedStates[e][i]={};for(const t in this.state[e][i])n[t]||(this.deletedStates[e][i][t]=null)}else for(const t in n)this.deletedStates[e]&&this.deletedStates[e][i]&&null===this.deletedStates[e][i][t]&&delete this.deletedStates[e][i][t]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,r){const n=String(r),i=t.e({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const t=this.deletedStates[e][r];if(null===t)return{};for(const e in t)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,r){const n={};for(const i in this.stateChanges){this.state[i]=this.state[i]||{};const e={};for(const r in this.stateChanges[i])this.state[i][r]||(this.state[i][r]={}),t.e(this.state[i][r],this.stateChanges[i][r]),e[r]=this.state[i][r];n[i]=e}for(const i in this.deletedStates){this.state[i]=this.state[i]||{};const e={};if(null===this.deletedStates[i])for(const t in this.state[i])e[t]={},this.state[i][t]={};else for(const t in this.deletedStates[i]){if(null===this.deletedStates[i][t])this.state[i][t]={};else for(const e of Object.keys(this.deletedStates[i][t]))delete this.state[i][t][e];e[t]=this.state[i][t]}n[i]=n[i]||{},t.e(n[i],e)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const t in e)e[t].setFeatureState(n,r)}}class he extends t.E{constructor(e,t,r){super(),this.id=e,this.dispatcher=r,this.on("data",(e=>this._dataHandler(e))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,r,n)=>{const i=new(ne(t.type))(e,t,r,n);if(i.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${i.id}`);return i})(e,t,r,this),this._tiles={},this._cache=new ce(0,(e=>this._unloadTile(e))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ue,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,n){return t._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,n)}catch(i){e.state="errored",404!==i.status?this._source.fire(new t.j(i,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new t.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(pe).map((e=>e.key))}getRenderableIds(e){const r=[];for(const t in this._tiles)this._isIdRenderable(t,e)&&r.push(this._tiles[t]);return e?r.sort(((e,r)=>{const n=e.tileID,i=r.tileID,a=new t.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new t.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(pe).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(e,r){return t._(this,void 0,void 0,(function*(){const t=this._tiles[e];t&&("loading"!==t.state&&(t.state=r),yield this._loadTile(t,e,r))}))}_tileLoaded(e,r,n){e.timeAdded=a.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,r,n){for(const i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>t+1;){const e=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[e.key],a&&a.hasData()&&(o=e)}let s=o;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){n[o.key]=o;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){const t=e.scaledTo(r),n=this._getLoadedTile(t);if(n)return n}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const r=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(e,t,r,n,i,o){const s={},l={},c=Object.keys(e),u=a.now();for(const a of c){const r=e[a],n=this._tiles[a];if(!n||0!==n.fadeEndTime&&n.fadeEndTime<=u)continue;const i=this.findLoadedParent(r,t),o=this.findLoadedSibling(r),c=i||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[a]=r}this._retainLoadedChildren(l,n,r,e);for(const a in s)e[a]||(this._coveredTiles[a]=!0,e[a]=s[a]);if(o){const t={},r={};for(const e of i)this._tiles[e.key].hasData()?t[e.key]=e:r[e.key]=e;for(const n in r){const i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(t[i[0].key]=e[i[0].key]=i[0],t[i[1].key]=e[i[1].key]=i[1],t[i[2].key]=e[i[2].key]=i[2],t[i[3].key]=e[i[3].key]=i[3],delete r[n])}for(const n in r){const i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){t[s.tileID.key]=e[s.tileID.key]=s.tileID;for(const e in t)t[e].isChildOf(s.tileID)&&delete t[e]}}for(const e in this._tiles)t[e]||(this._coveredTiles[e]=!0)}}update(e,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.S(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(n=e.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:r}),this._source.hasTile&&(n=n.filter((e=>this._source.hasTile(e))))):n=[];const i=e.coveringZoomLevel(this._source),a=Math.max(i-he.maxOverzooming,this._source.minzoom),o=Math.max(i+he.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const e={};for(const t of n)if(t.canonical.z>this._source.minzoom){const r=t.scaledTo(t.canonical.z-1);e[r.key]=r;const n=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));e[n.key]=n}n=n.concat(Object.values(e))}const s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(n,i);de(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(const t in l)this._tiles[t].clearFadeHold();const c=t.ab(this._tiles,l);for(const t of c){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var r;const n={},i={},a=Math.max(t-he.maxOverzooming,this._source.minzoom),o=Math.max(t+he.maxUnderzooming,this._source.minzoom),s={};for(const l of e){const e=this._addTile(l);n[l.key]=l,e.hasData()||tthis._source.maxzoom){const e=l.children(this._source.maxzoom)[0],t=this.getTile(e);if(t&&t.hasData()){n[e.key]=e;continue}}else{const e=l.children(this._source.maxzoom);if(n[e[0].key]&&n[e[1].key]&&n[e[2].key]&&n[e[3].key])continue}let o=e.wasRequested();for(let t=l.overscaledZ-1;t>=a;--t){const a=l.scaledTo(t);if(i[a.key])break;if(i[a.key]=!0,e=this.getTile(a),!e&&o&&(e=this._addTile(a)),e){const t=e.hasData();if((t||!(null===(r=this.map)||void 0===r?void 0:r.cancelPendingTileRequestsWhileZooming)||o)&&(n[a.key]=a),o=e.wasRequested(),t)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let r,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(e),r)break;n=e}for(const e of t)this._loadedParentTiles[e]=r}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const t=this._tiles[e].tileID,r=this._getLoadedTile(t);this._loadedSiblingTiles[t.key]=r}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));const n=r;return r||(r=new le(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){const t=e.sourceDataType;"source"===e.dataType&&"metadata"===t&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===t&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,n){const i=[],a=this.transform;if(!a)return i;const o=n?a.getCameraQueryGeometry(e):e,s=e.map((e=>a.pointCoordinate(e,this.terrain))),l=o.map((e=>a.pointCoordinate(e,this.terrain))),c=this.getIds();let u=1/0,h=1/0,p=-1/0,d=-1/0;for(const t of l)u=Math.min(u,t.x),h=Math.min(h,t.y),p=Math.max(p,t.x),d=Math.max(d,t.y);for(let f=0;f=0&&g[1].y+m>=0){const t=s.map((e=>n.getTilePoint(e))),r=l.map((e=>n.getTilePoint(e)));i.push({tile:e,tileID:n,queryGeometry:t,cameraQueryGeometry:r,scale:o})}}return i}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const r of t)r.posMatrix=this.transform.calculatePosMatrix(r.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(de(this._source.type)){const e=a.now();for(const t in this._tiles)if(this._tiles[t].fadeEndTime>=e)return!0}return!1}setFeatureState(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,r){const n=this._tiles[e];n&&n.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(const r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}}function pe(e,t){const r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function de(e){return"raster"===e||"image"===e||"video"===e}he.maxOverzooming=10,he.maxUnderzooming=3;class fe{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let r=1;r0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function me(e,t){let r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}class ge{constructor(e,t,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let a=0;athis.width||n<0||t>this.height)return[];const s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:e,y1:t,x2:r,y2:n}];for(let e=0;e0}hitTestCircle(e,t,r,n,i){const a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(e,t,r,n,i,a,o,s){const{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const i=this.bboxes;for(const o of h)if(!l.box[o]){l.box[o]=!0;const h=4*o,p=this.boxKeys[o];if(e<=i[h+2]&&t<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(p))&&(!c||!me(u,p.overlapMode))&&(a.push({key:p,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}const p=this.circleCells[i];if(null!==p){const i=this.circles;for(const o of p)if(!l.circle[o]){l.circle[o]=!0;const h=3*o,p=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],e,t,r,n)&&(!s||s(p))&&(!c||!me(u,p.overlapMode))){const e=i[h],t=i[h+1],r=i[h+2];if(a.push({key:p,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),c)return!0}}}return!1}_queryCellCircle(e,t,r,n,i,a,o,s){const{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const e=this.bboxes;for(const t of h)if(!c.box[t]){c.box[t]=!0;const r=4*t,n=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(n))&&!me(u,n.overlapMode))return a.push(!0),!0}}const p=this.circleCells[i];if(null!==p){const e=this.circles;for(const t of p)if(!c.circle[t]){c.circle[t]=!0;const r=3*t,n=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!me(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,n,i,a,o,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++)if(i.call(this,e,t,r,n,this.xCellCount*l+p,a,o,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,n,i,a){const o=n-e,s=i-t,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(e,t,r,n,i,a,o){const s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;const c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const h=l-s,p=u-c;return h*h+p*p<=r*r}}function ye(e,r,n,i,a){const o=t.H();return r?(t.K(o,o,[1/a,1/a,1]),n||t.ad(o,o,i.angle)):t.L(o,i.labelPlaneMatrix,e),o}function ve(e,r,n,i,a){if(r){const r=t.ae(e);return t.K(r,r,[a,a,1]),n||t.ad(r,r,-i.angle),r}return i.glCoordMatrix}function xe(e,r,n,i){let a;i?(a=[e,r,i(e,r),1],t.af(a,a,n)):(a=[e,r,0,1],Oe(a,a,n));const o=a[3];return{point:new t.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function be(e,t){return.5+e/t*.5}function _e(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function we(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m){const g=i?e.textSizeData:e.iconSizeData,y=t.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;x.clear();const b=e.lineVertexArray,_=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,w=n.transform.width/n.transform.height;let k=!1;for(let T=0;T<_.length;T++){const i=_.get(T);if(i.hidden||i.writingMode===t.ah.vertical&&!k){ze(i.numGlyphs,x);continue}k=!1;const S=xe(i.anchorX,i.anchorY,r,m);if(!_e(S.point,v)){ze(i.numGlyphs,x);continue}const A=be(n.transform.cameraToCenterDistance,S.signedDistanceFromCamera),M=t.ai(g,y,i),E=s?M/A:M*A,C={getElevation:m,labelPlaneMatrix:a,lineVertexArray:b,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new t.P(i.anchorX,i.anchorY),unwrappedTileID:h,width:p,height:d,translation:f},P=Se(C,i,E,!1,l,r,o,e.glyphOffsetArray,x,w,c);k=P.useVertical,(P.notEnoughRoom||k||P.needsFlipping&&Se(C,i,E,!0,l,r,o,e.glyphOffsetArray,x,w,c).notEnoughRoom)&&ze(i.numGlyphs,x)}i?e.text.dynamicLayoutVertexBuffer.updateData(x):e.icon.dynamicLayoutVertexBuffer.updateData(x)}function ke(e,t,r,n,i,a,o,s){const l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,h=t.getoffsetX(a.glyphStartIndex),p=t.getoffsetX(l-1),d=Le(e*h,r,n,i,a.segment,c,u,s,o);if(!d)return null;const f=Le(e*p,r,n,i,a.segment,c,u,s,o);return f?s.projectionCache.anyProjectionOccluded?null:{first:d,last:f}:null}function Te(e,r,n,i){return e===t.ah.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.ah.vertical?r.yn.x)?{needsFlipping:!0}:null}function Se(e,r,n,i,a,o,s,l,c,u,h){const p=n/24,d=r.lineOffsetX*p,f=r.lineOffsetY*p;let m;if(r.numGlyphs>1){const t=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=ke(p,l,d,f,i,r,h,e);if(!c)return{notEnoughRoom:!0};const g=xe(c.first.point.x,c.first.point.y,s,e.getElevation).point,y=xe(c.last.point.x,c.last.point.y,s,e.getElevation).point;if(a&&!i){const e=Te(r.writingMode,g,y,u);if(e)return e}m=[c.first];for(let a=r.glyphStartIndex+1;a0?s.point:Ae(e.tileAnchorPoint,a,n,1,o,e),c=Te(r.writingMode,n,l,u);if(c)return c}const n=Le(p*l.getoffsetX(r.glyphStartIndex),d,f,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,e,h);if(!n||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[n]}for(const g of m)t.aj(c,g.point,g.angle);return{}}function Ae(e,t,r,n,i,a){const o=e.add(e.sub(t)._unit()),s=void 0!==i?xe(o.x,o.y,i,a.getElevation).point:Ee(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Me(e,r,n){const i=r.projectionCache;if(i.projections[e])return i.projections[e];const a=new t.P(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),o=Ee(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;const s=e-n.direction;return l=0===n.distanceFromAnchor?r.tileAnchorPoint:new t.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),c=a,u=n.previousVertex,h=n.absOffsetX-n.distanceFromAnchor+1,Ae(l,c,u,h,void 0,r);var l,c,u,h}function Ee(e,t,r){const n=e+r.translation[0],i=t+r.translation[1];let a;return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(a=r.projection.projectTileCoordinates(n,i,r.unwrappedTileID,r.getElevation),a.point.x=(.5*a.point.x+.5)*r.width,a.point.y=(.5*-a.point.y+.5)*r.height):(a=xe(n,i,r.labelPlaneMatrix,r.getElevation),a.isOccluded=!1),a}function Ce(e,t,r){return e._unit()._perp()._mult(t*r)}function Pe(e,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];const u=n.add(r);if(e+c.direction=a)return l.projectionCache.offsets[e]=u,u;const h=Me(e+c.direction,l,c),p=Ce(h.sub(n),s,c.direction),d=n.add(p),f=h.add(p);return l.projectionCache.offsets[e]=t.ak(o,u,d,f)||u,l.projectionCache.offsets[e]}function Le(e,t,r,n,i,a,o,s,l){const c=n?e-t:e+t;let u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let p,d=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?p=s.projectionCache.cachedAnchorPoint:(p=Ee(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=p);let f,m,g=p,y=p,v=0,x=0;const b=Math.abs(c),_=[];let w;for(;v+x<=b;){if(d+=u,d=o)return null;v+=x,y=g,m=f;const e={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:y};if(g=Me(d,s,e),0===r)_.push(y),w=g.sub(y);else{let t;const n=g.sub(y);t=0===n.mag()?Ce(Me(d+u,s,e).sub(g),r,u):Ce(n,r,u),m||(m=y.add(t)),f=Pe(d,t,g,a,o,m,r,s,e),_.push(m),w=f.sub(m)}x=w.mag()}const k=w._mult((b-v)/x)._add(m||y),T=h+Math.atan2(g.y-y.y,g.x-y.x);return _.push(k),{point:k,angle:l?T:0,path:_}}const Ie=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ze(e,t){for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:new ge(e.width+200,e.height+200,25),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ge(e.width+200,e.height+200,25);this.transform=e,this.mapProjection=t,this.grid=r,this.ignoredGrid=n,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Re,this.screenBottomBoundary=e.height+Re,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,n,i,a,o,s,l,c,u){const h=e.anchorPointX+s[0],p=e.anchorPointY+s[1],d=this.projectAndGetPerspectiveRatio(n,h,p,i,c),f=r*d.perspectiveRatio;let m;if(a||o)m=this._projectCollisionBox(e,f,n,i,a,o,s,d,c,u);else{const t=d.point.x+(u?u.x*f:0),r=d.point.y+(u?u.y*f:0);m={allPointsOccluded:!1,box:[t+e.x1*f,r+e.y1*f,t+e.x2*f,r+e.y2*f]}}const[g,y,v,x]=m.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?m.allPointsOccluded:this.mapProjection.isOccluded(h,p,i))||d.perspectiveRatio=1;e--)l.push(o.path[e]);for(let e=1;ee.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let m=[];if(l.length>0){const e=l[0].clone(),r=l[0].clone();for(let t=1;t=n.x&&r.x<=i.x&&e.y>=n.y&&r.y<=i.y?[l]:r.xi.x||r.yi.y?[]:t.al([l],n.x,n.y,i.x,i.y)}for(const t of m){a.reset(t,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let t=0;txe(e.x,e.y,r,t.getElevation)))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,a=-1/0,o=-1/0;for(const u of e){const e=new t.P(u.x+Re,u.y+Re);n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y),r.push(e)}const s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(const u of s){const e=u.key;if(void 0===l[e.bucketInstanceId]&&(l[e.bucketInstanceId]={}),l[e.bucketInstanceId][e.featureIndex])continue;const n=[new t.P(u.x1,u.y1),new t.P(u.x2,u.y1),new t.P(u.x2,u.y2),new t.P(u.x1,u.y2)];t.am(r,n)&&(l[e.bucketInstanceId][e.featureIndex]=!0,void 0===c[e.bucketInstanceId]&&(c[e.bucketInstanceId]=[]),c[e.bucketInstanceId].push(e.featureIndex))}return c}insertCollisionBox(e,t,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,n,i,a){const o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t};for(let l=0;l=this.screenRightBoundary||nthis.screenBottomBoundary}isInsideGrid(e,t,r,n){return r>=0&&e=0&&tthis.projectAndGetPerspectiveRatio(n,e.x,e.y,i,c)));T=e.some((e=>!e.isOccluded)),k=e.map((e=>e.point))}else T=!0;return{box:t.ao(k),allPointsOccluded:!T}}}function je(e,r,n){return r*(t.X/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}class Fe{constructor(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Be{constructor(e,t,r,n,i){this.text=new Fe(e?e.text:null,t,r,i),this.icon=new Fe(e?e.icon:null,t,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ne{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}}class Ue{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class Ve{constructor(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class qe{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function He(e,r,n,i,a){const{horizontalAlign:o,verticalAlign:s}=t.au(e);return new t.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Ge{constructor(e,t,r,n,i,a){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new De(this.transform,t),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new qe(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const t=this.terrain;return t?(r,n)=>t.getElevation(e,r,n):null}getBucketParts(e,r,n,i){const a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;const s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/t.X,p=n.tileID.toUnwrapped(),d=this.transform.calculatePosMatrix(p),f="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=je(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=ye(d,f,m,this.transform,g);let b=null;if(f){const e=ve(d,f,m,this.transform,g);b=t.L([],this.transform.labelPlaneMatrix,e)}this.retainedQueryData[a.bucketInstanceId]=new Ve(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);const _={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:d,unwrappedTileID:p,textLabelPlaneMatrix:x,labelToScreenMatrix:b,scale:u,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(const t of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=t;e.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:_})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:_})}attemptAnchorPlacement(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x){const b=t.aq[e.textAnchor],_=[e.textOffset0,e.textOffset1],w=He(b,n,i,_,a),k=this.collisionIndex.placeCollisionBox(r,p,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,p,l,c,u,s,o,y,h.predicate,x,w).placeable)&&k.placeable){let e;if(this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(e=this.prevPlacement.variableOffsets[d.crossTileID].anchor),0===d.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:_,width:n,height:i,anchor:b,textBoxScale:a,prevAnchor:e},this.markUsedJustification(f,b,d,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,d),this.placedOrientations[d.crossTileID]=m),{shift:w,placedGlyphBoxes:k}}}placeLayerBucketPart(e,r,n){const{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:p,holdingForFade:d,collisionBoxArray:f,partiallyEvaluatedTextSize:m,collisionGroup:g}=e.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=t.ar(a,"text-overlap","text-allow-overlap"),b="always"===x,_=t.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===_,k="map"===a.get("text-rotation-alignment"),T="map"===a.get("text-pitch-alignment"),S="none"!==a.get("icon-text-fit"),A="viewport-y"===a.get("symbol-z-order"),M=b&&(w||!i.hasIconData()||v),E=w&&(b||!i.hasTextData()||y);!i.collisionArrays&&f&&i.deserializeCollisionBoxes(f);const C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),P=(e,f,w)=>{var A,P;if(r[e.crossTileID])return;if(d)return void(this.placements[e.crossTileID]=new Ne(!1,!1,!1));let L=!1,I=!1,z=!0,O=null,R={box:null,placeable:!1,offscreen:null},D={box:null,placeable:!1,offscreen:null},j=null,F=null,B=null,N=0,U=0,V=0;f.textFeatureIndex?N=f.textFeatureIndex:e.useRuntimeCollisionCircles&&(N=e.featureIndex),f.verticalTextFeatureIndex&&(U=f.verticalTextFeatureIndex);const q=f.textBox;if(q){const r=r=>{let n=t.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(i,n,e))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&f.verticalTextBox){for(const e of i.writingModes)if(e===t.ah.vertical?(R=n(),D=R):R=r(),R&&R.placeable)break}else R=r()},u=e.textAnchorOffsetStartIndex,h=e.textAnchorOffsetEndIndex;if(h===u){const n=(t,r)=>{const n=this.collisionIndex.placeCollisionBox(t,x,p,l,c,T,k,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,e),this.placedOrientations[e.crossTileID]=r),n};a((()=>n(q,t.ah.horizontal)),(()=>{const r=f.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?n(r,t.ah.vertical):{box:null,offscreen:null}})),r(R&&R.placeable)}else{let d=t.aq[null===(P=null===(A=this.prevPlacement)||void 0===A?void 0:A.variableOffsets[e.crossTileID])||void 0===P?void 0:P.anchor];const m=(r,a,f)=>{const m=r.x2-r.x1,y=r.y2-r.y1,v=e.textBoxScale,b=S&&"never"===_?a:null;let w=null,A="never"===x?1:2,M="never";d&&A++;for(let t=0;tm(q,f.iconBox,t.ah.horizontal)),(()=>{const r=f.verticalTextBox;return i.allowVerticalPlacement&&(!R||!R.placeable)&&e.numVerticalGlyphVertices>0&&r?m(r,f.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}})),R&&(L=R.placeable,z=R.offscreen);const y=r(R&&R.placeable);if(!L&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,y))}}}if(j=R,L=j&&j.placeable,z=j&&j.offscreen,e.useRuntimeCollisionCircles){const r=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),s=t.ai(i.textSizeData,m,r),p=a.get("text-padding");F=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,T,g.predicate,e.collisionCircleDiameter,p,o,C),F.circles.length&&F.collisionDetected&&!n&&t.w("Collisions detected, but collision boxes are not shown"),L=b||F.circles.length>0&&!F.collisionDetected,z=z&&F.offscreen}if(f.iconFeatureIndex&&(V=f.iconFeatureIndex),f.iconBox){const e=e=>this.collisionIndex.placeCollisionBox(e,_,p,l,c,T,k,s,g.predicate,C,S&&O?O:void 0);D&&D.placeable&&f.verticalIconBox?(B=e(f.verticalIconBox),I=B.placeable):(B=e(f.iconBox),I=B.placeable),z=z&&B.offscreen}const H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,G=v||0===e.numIconVertices;H||G?G?H||(I=I&&L):L=I&&L:I=L=I&&L;const W=I&&B.placeable;if(L&&j.placeable&&this.collisionIndex.insertCollisionBox(j.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,D&&D.placeable&&U?U:N,g.ID),W&&this.collisionIndex.insertCollisionBox(B.box,_,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),F&&L&&this.collisionIndex.insertCollisionCircles(F.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,f,j,B,F),0===e.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[e.crossTileID]=new Ne(L||M,I||E,z||i.justReloaded),r[e.crossTileID]=!0};if(A){if(0!==e.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const t=i.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const r=t[e];P(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let t=e.symbolInstanceStart;t=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:n.crossTileID)}markUsedOrientation(e,r,n){const i=r===t.ah.horizontal||r===t.ah.horizontalOnly?r:0,a=r===t.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const t of o)e.text.placedSymbolArray.get(t).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(const s in this.placements){const e=this.placements[s],t=i[s];t?(this.opacities[s]=new Be(t,n,e.text,e.icon),r=r||e.text!==t.text.placed||e.icon!==t.icon.placed):(this.opacities[s]=new Be(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(const s in i){const e=i[s];if(!this.opacities[s]){const t=new Be(e,n,!1,!1);t.isHidden()||(this.opacities[s]=t,r=r||e.text.placed||e.icon.placed)}}for(const s in a)this.variableOffsets[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.variableOffsets[s]=a[s]);for(const s in o)this.placedOrientations[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.placedOrientations[s]=o[s]);if(t&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const r={};for(const n of t){const t=n.getBucket(e);t&&n.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(e,r,n,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const a=e.layers[0],o=a.layout,s=new Be(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),d="none"!==o.get("icon-text-fit"),f=new Be(null,0,l&&(c||!e.hasIconData()||o.get("icon-optional")),c&&(l||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);const m=(e,t,r)=>{for(let n=0;n0,v=this.placedOrientations[r.crossTileID],x=v===t.ah.vertical,b=v===t.ah.horizontal||v===t.ah.horizontalOnly;if(i>0||a>0){const t=et(l.text);m(e.text,i,x?tt:t),m(e.text,a,b?tt:t);const n=l.text.isHidden();[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=n||x?1:0)})),r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=n||b?1:0);const o=this.variableOffsets[r.crossTileID];o&&this.markUsedJustification(e,o.anchor,r,v);const s=this.placedOrientations[r.crossTileID];s&&(this.markUsedJustification(e,"left",r,s),this.markUsedOrientation(e,s,r))}if(c){const t=et(l.icon),n=!(d&&r.verticalPlacedIconSymbolIndex&&x);r.placedIconSymbolIndex>=0&&(m(e.icon,r.numIconVertices,n?t:tt),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=l.icon.isHidden()),r.verticalPlacedIconSymbolIndex>=0&&(m(e.icon,r.numVerticalIconVertices,n?tt:t),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}const _=g&&g.has(y)?g.get(y):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const r=e.collisionArrays[y];if(r){let n=new t.P(0,0);if(r.textBox||r.verticalTextBox){let t=!0;if(u){const e=this.variableOffsets[o];e?(n=He(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),h&&n._rotate(p?this.transform.angle:-this.transform.angle)):t=!1}if(r.textBox||r.verticalTextBox){let i;r.textBox&&(i=x),r.verticalTextBox&&(i=b),We(e.textCollisionBox.collisionVertexArray,l.text.placed,!t||i,_.text,n.x,n.y)}}if(r.iconBox||r.verticalIconBox){const t=Boolean(!b&&r.verticalIconBox);let i;r.iconBox&&(i=t),r.verticalIconBox&&(i=!t),We(e.iconCollisionBox.collisionVertexArray,l.icon.placed,i,_.icon,d?n.x:0,d?n.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTimee}setStale(){this.stale=!0}}function We(e,t,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);const o=n[0]-Re,s=n[1]-Re,l=n[2]-Re,c=n[3]-Re;e.emplaceBack(t?1:0,r?1:0,i||0,a||0,o,s),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,s),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,c),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,o,c)}const $e=Math.pow(2,25),Ze=Math.pow(2,24),Xe=Math.pow(2,17),Ye=Math.pow(2,16),Ke=Math.pow(2,9),Je=Math.pow(2,8),Qe=Math.pow(2,1);function et(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*$e+t*Ze+r*Xe+t*Ye+r*Ke+t*Je+r*Qe+t}const tt=0;function rt(){return{isOccluded:(e,t,r)=>!1,getPitchedTextCorrection:(e,t,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(e,t,r,n){throw new Error("Not implemented.")},translatePosition:(e,t,r,n)=>function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!r[0]&&!r[1])return[0,0];const a=i?"map"===n?e.angle:0:"viewport"===n?-e.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[i?r[0]:je(t,r[0],e.zoom),i?r[1]:je(t,r[1],e.zoom)]}(e,t,r,n),getCircleRadiusCorrection:e=>1}}class nt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,n,i){const a=this._bucketParts;for(;this._currentTileIndexe.sortKey-t.sortKey)));this._currentPartIndex!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){const n=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new nt(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const at=512/t.X/2;class ot{constructor(e,r,n){this.tileID=e,this.bucketInstanceId=n,this._symbolsByKey={};const i=new Map;for(let t=0;t({x:Math.floor(e.anchorX*at),y:Math.floor(e.anchorY*at)}))),crossTileIDs:o.map((e=>e.crossTileID))};if(e.positions.length>128){const r=new t.av(e.positions.length,16,Uint16Array);for(const{x:t,y:n}of e.positions)r.add(t,n);r.finish(),delete e.positions,e.index=r}this._symbolsByKey[a]=e}}getScaledCoordinates(e,r){const{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=at/Math.pow(2,l-a),u=(s*t.X+e.anchorY)*c,h=i*t.X*at;return{x:Math.floor((o*t.X+e.anchorX)*c-n*t.X*at),y:Math.floor(u-h)}}findMatches(e,t,r){const n=this.tileID.canonical.z{let{crossTileIDs:t}=e;return t}))}}class st{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class lt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const r in this.indexes){const e=this.indexes[r],n={};for(const r in e){const i=e[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}this.indexes[r]=n}this.lng=e}addBucket(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let i=0;ie.overscaledZ)for(const i in r){const a=r[i];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,n)}else{const a=r[e.scaledTo(Number(i)).key];a&&a.findMatches(t.symbolInstances,e,n)}}for(let i=0;i{t[e]=!0}));for(const r in this.layerIndexes)t[r]||delete this.layerIndexes[r]}}const ut=(e,r)=>t.t(e,r&&r.filter((e=>"source.canvas"!==e.identifier))),ht=t.aw();class pt extends t.E{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this._rtlPluginLoaded=()=>{for(const e in this.sourceCaches){const t=this.sourceCaches[e].getSource().type;"vector"!==t&&"geojson"!==t||this.sourceCaches[e].reload()}},this.map=e,this.dispatcher=new N(B(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((e,t)=>this.getGlyphs(e,t))),this.dispatcher.registerMessageHandler("GI",((e,t)=>this.getImages(e,t))),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new M(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new z(256,512),this.crossTileSymbolIndex=new ct,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),se().on(ie,this._rtlPluginLoaded),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.sourceCaches[e.sourceId];if(!t)return;const r=t.getSource();if(r&&r.vectorLayerIds)for(const n in this._layers){const e=this._layers[n];e.source===r.id&&this._validateLayer(e)}}))}loadURL(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new t.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;const i=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const a=this._loadStyleRequest;t.h(i,this._loadStyleRequest).then((e=>{this._loadStyleRequest=null,this._load(e.data,r,n)})).catch((e=>{this._loadStyleRequest=null,e&&!a.signal.aborted&&this.fire(new t.j(e))}))}loadJSON(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(e,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(ht,{validate:!1})}_load(e,r,n){var i;const a=r.transformStyle?r.transformStyle(n,e):e;if(!r.validate||!ut(this,t.u(a))){this._loaded=!0,this.stylesheet=a;for(const e in a.sources)this.addSource(e,a.sources[e],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new P(this.stylesheet.light),this.sky=new I(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const e=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(const r of e){const e=t.aA(r);e.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=e}}_loadSprite(e){let r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(e,r,n,i){return t._(this,void 0,void 0,(function*(){const o=x(e),s=n>1?"@2x":"",l={},c={};for(const{id:e,url:n}of o){const a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[e]=t.h(a,i);const o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[e]=d.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(e,r){return t._(this,void 0,void 0,(function*(){const t={};for(const n in e){t[n]={};const i=a.getImageCanvasContext((yield r[n]).data),o=(yield e[n]).data;for(const e in o){const{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:p,content:d,textFitWidth:f,textFitHeight:m}=o[e];t[n][e]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:p,content:d,textFitWidth:f,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return t}))}(l,c)}))}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((e=>{if(this._spriteRequest=null,e)for(const t in e){this._spritesImagesIds[t]=[];const r=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter((t=>!(t in e))):[];for(const e of r)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(const i in e[t]){const r="default"===t?i:`${t}:${i}`;this._spritesImagesIds[t].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,e[t][i],!1):this.imageManager.addImage(r,e[t][i]),n&&(this._changedImages[r]=!0)}}})).catch((e=>{this._spriteRequest=null,r=e,this.fire(new t.j(r))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),i&&i(r)}))}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(e){const r=this.sourceCaches[e.source];if(!r)return;const n=e.sourceLayer;if(!n)return;const i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._serializedAllLayers();if(!e||0===e.length)return Object.values(r?t.aB(n):n);const i=[];for(const a of e)if(n[a]){const e=r?t.aB(n[a]):n[a];i.push(e)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const t=Object.keys(this._layers);for(const r of t){const t=this._layers[r];"custom"!==t.type&&(e[r]=t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const r=this._changed;if(r){const t=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(t.length||r.length)&&this._updateWorkerLayers(t,r);for(const e in this._updatedSources){const t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw new Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const n in this._updatedPaintProps)this._layers[n].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const n={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(const t of this._order){const r=this._layers[t];r.recalculate(e,this._availableImages),!r.isHidden(e.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const i in n){const e=this.sourceCaches[i];!!n[i]!=!!e.used&&e.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:i}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,r&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;this._checkLoaded();const i=this.serialize();if(e=r.transformStyle?r.transformStyle(i,e):e,(null===(n=r.validate)||void 0===n||n)&&ut(this,t.u(e)))return!1;(e=t.aB(e)).layers=t.az(e.layers);const a=t.aC(i,e),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(const t of o.operations)t();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const t=[],r=[];for(const n of e)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":t.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":t.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":t.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":t.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":t.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":t.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":t.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":t.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":t.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":t.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":t.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":t.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":t.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":t.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":t.push((()=>{}));break;default:r.push(n.command)}return{operations:t,unimplemented:r}}addImage(e,r){if(this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.u.source,`sources.${e}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=this.sourceCaches[e]=new he(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:e}))),i.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===e)return this.fire(new t.j(new Error(`Source "${e}" cannot be removed while layer "${n}" is using it.`)));const r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);const r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=e.id;if(this.getLayer(i))return void this.fire(new t.j(new Error(`Layer "${i}" already exists on this map.`)));let a;if("custom"===e.type){if(ut(this,t.aD(e)))return;a=t.aA(e)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(i,e.source),e=t.aB(e),e=t.e(e,{source:i})),this._validate(t.u.layer,`layers.${i}`,e,{arrayIndex:-1},n))return;a=t.aA(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}const o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.j(new Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){const e=this._removedLayers[i];delete this._removedLayers[i],e.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;const n=this._order.indexOf(e);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.j(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const r=this._layers[e];if(!r)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,n){this._checkLoaded();const i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=this.getLayer(e);if(i){if(!t.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=t.aB(r),this._updateLayer(i)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.aB(this.getLayer(e).filter)}setLayoutProperty(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(e);a?t.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){const n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(e);a?t.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,r){this._checkLoaded();const n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));const o=a.getSource().type;"geojson"===o&&i?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();const n=e.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));const a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=t.aF(this.sourceCaches,(e=>e.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return t.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:e,layers:r,terrain:n},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,r={},n=[];for(let a=this._order.length-1;a>=0;a--){const i=this._order[a];if(t(i)){r[i]=a;for(const t of e){const e=t[i];if(e)for(const t of e)n.push(t)}}}n.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const i=[];for(let a=this._order.length-1;a>=0;a--){const o=this._order[a];if(t(o))for(let e=n.length-1;e>=0;e--){const t=n[e].feature;if(r[t.layer.id]{const r=u.featureSortOrder;if(r){const n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));for(const e of n)t.push(e)}}for(const u in s)s[u].forEach((t=>{const n=t.feature,i=r[e[u].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=i}));return s}(this._layers,o,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r&&r.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",r.filter,null,r);const n=this.sourceCaches[e];return n?function(e,t){const r=e.getRenderableIds().map((t=>e.getTileByID(t))),n=[],i={};for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();const n=this.light.getLight();let i=!1;for(const a in e)if(!t.aE(e[a],n[a])){i=!0;break}if(!i)return;const o={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}getSky(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.sky}setSky(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getSky();let i=!1;if(!e&&!n)return;if(e&&!n)i=!0;else if(!e&&n)i=!0;else for(const a in e)if(!t.aE(e[a],n[a])){i=!0;break}if(!i)return;const o={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(o)}_validate(e,r,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!a||!1!==a.validate)&&ut(this,e.call(t.u,t.e({key:r,style:this.serialize(),value:n,styleSpec:t.v},i)))}_remove(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),se().off(ie,this._rtlPluginLoaded);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches){const e=this.sourceCaches[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const t in this.sourceCaches)this.sourceCaches[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=!1,s=!1;const l={};for(const a of this._order){const t=this._layers[a];if("symbol"!==t.type)continue;if(!l[t.source]){const e=this.sourceCaches[t.source];l[t.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const r=this.crossTileSymbolIndex.addLayer(t,l[t.source],e.center.lng);o=o||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),e.zoom))&&(this.pauseablePlacement=new it(e,this.map.terrain,this._order,i,t,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(const a of this._order){const e=this._layers[a];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return t._(this,void 0,void 0,(function*(){const e=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,r.icons),e}))}getGlyphs(e,r){return t._(this,void 0,void 0,(function*(){const e=yield this.glyphManager.getGlyphs(r.stacks),t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,[""]),e}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded(),e&&this._validate(t.u.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;this._checkLoaded();const a=[{id:e,url:r}],o=[...x(this.stylesheet.sprite),...a];this._validate(t.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();const r=x(this.stylesheet.sprite);if(r.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(const t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;r.splice(r.findIndex((t=>t.id===e)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return x(this.stylesheet.sprite)}setSprite(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this._checkLoaded(),e&&this._validate(t.u.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,n):(this._unloadSprite(),n&&n(null)))}}var dt=t.Y([{name:"a_pos",type:"Int16",components:2}]);const ft={prelude:mt("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform 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;\n#endif\nconst 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) {\n#ifdef TERRAIN3D\nhighp 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));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 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;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 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;\n#else\nreturn 0.0;\n#endif\n}"),background:mt("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:mt("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:mt("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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:mt("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:mt("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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:mt("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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:mt("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:mt("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:mt("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:mt("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:mt("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:mt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:mt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:mt("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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:mt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=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\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:mt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:mt("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:mt("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:mt("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:mt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:mt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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:mt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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:mt("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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:mt("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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:mt("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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:mt("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:mt("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:mt("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:mt("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 mt(e,t){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(r,((e,t,r,n,i)=>(s[i]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:t=t.replace(r,((e,t,r,n,i)=>{const a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class gt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,n,i,a,o,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==n.length;for(let u=0;!c&&u({u_matrix:e,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function vt(e){const t=[];for(let r=0;r>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const _t=(e,r,n,i)=>{const a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=function(){var e=new t.A(9);return t.A!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();"viewport"===a.properties.get("anchor")&&function(e,t){var r=Math.sin(t),n=Math.cos(t);e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1}(l,-r.transform.angle),function(e,t,r){var n=t[0],i=t[1],a=t[2];e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);const c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},wt=(e,r,n,i,a,o,s)=>t.e(_t(e,r,n,i),bt(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),kt=e=>({u_matrix:e}),Tt=(e,r,n,i)=>t.e(kt(e),bt(n,r,i)),St=(e,t)=>({u_matrix:e,u_world:t}),At=(e,r,n,i,a)=>t.e(Tt(e,r,n,i),{u_world:a}),Mt=(e,t,r,n)=>{const i=e.transform;let a,o;if("map"===n.paint.get("circle-pitch-alignment")){const e=je(r,1,i.zoom);a=!0,o=[e,e]}else a=!1,o=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o}},Et=(e,t,r)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ct=function(e,t){return{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1}},Pt=e=>({u_matrix:e}),Lt=(e,t,r,n)=>({u_matrix:e,u_extrude_scale:je(t,1,r),u_intensity:n}),It=(e,r,n,i)=>{const a=t.H();t.aP(a,0,e.width,e.height,0,0,1);const o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function zt(e,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.Z(0,i/n).toLngLat().lat,new t.Z(0,(i+1)/n).toLngLat().lat]}const Ot=(e,t,r,n)=>{const i=e.transform;return{u_matrix:Bt(e,t,r,n),u_ratio:1/je(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Rt=(e,r,n,i,a)=>t.e(Ot(e,r,n,a),{u_image:0,u_image_height:i}),Dt=(e,t,r,n,i)=>{const a=e.transform,o=Ft(t,a);return{u_matrix:Bt(e,t,r,i),u_texsize:t.imageAtlasTexture.size,u_ratio:1/je(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},jt=(e,r,n,i,a,o)=>{const s=e.lineAtlas,l=Ft(r,e.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),p=u.width*a.fromScale,d=h.width*a.toScale;return t.e(Ot(e,r,n,o),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/d,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,d)*e.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Ft(e,t){return 1/je(e,1,t.tileZoom)}function Bt(e,t,r,n){return e.translatePosMatrix(n?n.posMatrix:t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Nt=(e,t,r,n,i)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ut(i.paint.get("raster-hue-rotate"))};var a,o};function Ut(e){e*=Math.PI/180;const t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}const Vt=(e,t,r,n,i,a,o,s,l,c,u,h,p,d)=>{const f=o.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:f.width/f.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:p,u_texture:0,u_translation:u,u_pitched_scale:d}},qt=(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m)=>{const g=s.transform;return t.e(Vt(e,r,n,i,a,o,s,l,c,u,h,p,d,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+f})},Ht=(e,r,n,i,a,o,s,l,c,u,h,p,d,f)=>t.e(qt(e,r,n,i,a,o,s,l,c,u,h,!0,p,!0,f),{u_texsize_icon:d,u_texture_icon:1}),Gt=(e,t,r)=>({u_matrix:e,u_opacity:t,u_color:r}),Wt=(e,r,n,i,a,o)=>t.e(function(e,t,r,n){const i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/je(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r}),$t={fillExtrusion:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_opacity:new t.aI(e,r.u_opacity)}),fillExtrusionPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_height_factor:new t.aI(e,r.u_height_factor),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade),u_opacity:new t.aI(e,r.u_opacity)}),fill:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),fillPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),fillOutline:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world)}),fillOutlinePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),circle:(e,r)=>({u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_scale_with_map:new t.aH(e,r.u_scale_with_map),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_extrude_scale:new t.aO(e,r.u_extrude_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_matrix:new t.aJ(e,r.u_matrix)}),collisionBox:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_pixel_extrude_scale:new t.aO(e,r.u_pixel_extrude_scale)}),collisionCircle:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_inv_matrix:new t.aJ(e,r.u_inv_matrix),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_viewport_size:new t.aO(e,r.u_viewport_size)}),debug:(e,r)=>({u_color:new t.aL(e,r.u_color),u_matrix:new t.aJ(e,r.u_matrix),u_overlay:new t.aH(e,r.u_overlay),u_overlay_scale:new t.aI(e,r.u_overlay_scale)}),clippingMask:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),heatmap:(e,r)=>({u_extrude_scale:new t.aI(e,r.u_extrude_scale),u_intensity:new t.aI(e,r.u_intensity),u_matrix:new t.aJ(e,r.u_matrix)}),heatmapTexture:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_color_ramp:new t.aH(e,r.u_color_ramp),u_opacity:new t.aI(e,r.u_opacity)}),hillshade:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_latrange:new t.aO(e,r.u_latrange),u_light:new t.aO(e,r.u_light),u_shadow:new t.aL(e,r.u_shadow),u_highlight:new t.aL(e,r.u_highlight),u_accent:new t.aL(e,r.u_accent)}),hillshadePrepare:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_dimension:new t.aO(e,r.u_dimension),u_zoom:new t.aI(e,r.u_zoom),u_unpack:new t.aK(e,r.u_unpack)}),line:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels)}),lineGradient:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_image:new t.aH(e,r.u_image),u_image_height:new t.aI(e,r.u_image_height)}),linePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texsize:new t.aO(e,r.u_texsize),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_image:new t.aH(e,r.u_image),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),lineSDF:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_patternscale_a:new t.aO(e,r.u_patternscale_a),u_patternscale_b:new t.aO(e,r.u_patternscale_b),u_sdfgamma:new t.aI(e,r.u_sdfgamma),u_image:new t.aH(e,r.u_image),u_tex_y_a:new t.aI(e,r.u_tex_y_a),u_tex_y_b:new t.aI(e,r.u_tex_y_b),u_mix:new t.aI(e,r.u_mix)}),raster:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_tl_parent:new t.aO(e,r.u_tl_parent),u_scale_parent:new t.aI(e,r.u_scale_parent),u_buffer_scale:new t.aI(e,r.u_buffer_scale),u_fade_t:new t.aI(e,r.u_fade_t),u_opacity:new t.aI(e,r.u_opacity),u_image0:new t.aH(e,r.u_image0),u_image1:new t.aH(e,r.u_image1),u_brightness_low:new t.aI(e,r.u_brightness_low),u_brightness_high:new t.aI(e,r.u_brightness_high),u_saturation_factor:new t.aI(e,r.u_saturation_factor),u_contrast_factor:new t.aI(e,r.u_contrast_factor),u_spin_weights:new t.aN(e,r.u_spin_weights)}),symbolIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolSDF:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolTextAndIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texsize_icon:new t.aO(e,r.u_texsize_icon),u_texture:new t.aH(e,r.u_texture),u_texture_icon:new t.aH(e,r.u_texture_icon),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),background:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_color:new t.aL(e,r.u_color)}),backgroundPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_image:new t.aH(e,r.u_image),u_pattern_tl_a:new t.aO(e,r.u_pattern_tl_a),u_pattern_br_a:new t.aO(e,r.u_pattern_br_a),u_pattern_tl_b:new t.aO(e,r.u_pattern_tl_b),u_pattern_br_b:new t.aO(e,r.u_pattern_br_b),u_texsize:new t.aO(e,r.u_texsize),u_mix:new t.aI(e,r.u_mix),u_pattern_size_a:new t.aO(e,r.u_pattern_size_a),u_pattern_size_b:new t.aO(e,r.u_pattern_size_b),u_scale_a:new t.aI(e,r.u_scale_a),u_scale_b:new t.aI(e,r.u_scale_b),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(e,r.u_tile_units_to_pixels)}),terrain:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_ele_delta:new t.aI(e,r.u_ele_delta),u_fog_matrix:new t.aJ(e,r.u_fog_matrix),u_fog_color:new t.aL(e,r.u_fog_color),u_fog_ground_blend:new t.aI(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(e,r.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon_fog_blend:new t.aI(e,r.u_horizon_fog_blend)}),terrainDepth:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ele_delta:new t.aI(e,r.u_ele_delta)}),terrainCoords:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_terrain_coords_id:new t.aI(e,r.u_terrain_coords_id),u_ele_delta:new t.aI(e,r.u_ele_delta)}),sky:(e,r)=>({u_sky_color:new t.aL(e,r.u_sky_color),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon:new t.aI(e,r.u_horizon),u_sky_horizon_blend:new t.aI(e,r.u_sky_horizon_blend)})};class Zt{constructor(e,t,r){this.context=e;const n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Xt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Yt{constructor(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;r0){const r=t.H();t.aQ(r,f.placementInvProjMatrix,e.transform.glCoordMatrix),t.aQ(r,r,f.placementViewportMatrix),c.push({circleArray:g,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=g.length/4,h=u}m&&l.draw(o,s.LINES,Fr.disabled,Nr.disabled,e.colorModeForRenderPass(),Ur.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(p=e.transform).width,1/p.height]},e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,e.transform.zoom,null,null,m.collisionVertexBuffer)}var p;if(!a||!c.length)return;const d=e.useProgram("collisionCircle"),f=new t.aR;f.resize(4*u),f._trim();let m=0;for(const t of c)for(let e=0;e=0&&(v[y.associatedIconIndex]={shiftedAnchor:P,angle:L})}else ze(y.numGlyphs,g)}if(u){y.clear();const r=e.icon.placedSymbolArray;for(let e=0;ee.style.map.terrain.getElevation(E,t,r):null,r="map"===n.layout.get("text-rotation-alignment");we(l,E.posMatrix,e,a,N,V,v,u,r,g,E.toUnwrapped(),m.width,m.height,q,t)}const W=E.posMatrix,$=a&&S||G,Z=x||$?Hr:N,X=U,Y=p&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let K;K=p?l.iconsInText?Ht(d.kind,P,b,v,x,$,e,W,Z,X,q,I,D,M):qt(d.kind,P,b,v,x,$,e,W,Z,X,q,a,I,!0,M):Vt(d.kind,P,b,v,x,$,e,W,Z,X,q,a,I,M);const J={program:C,buffers:c,uniformValues:K,atlasTexture:z,atlasTextureIcon:j,atlasInterpolation:O,atlasInterpolationIcon:R,isSDF:p,hasHalo:Y};if(w&&l.canOverlap){k=!0;const e=c.segments.get();for(const r of e)A.push({segments:new t.a0([r]),sortKey:r.sortKey,state:J,terrainData:L})}else A.push({segments:c.segments,sortKey:0,state:J,terrainData:L})}k&&A.sort(((e,t)=>e.sortKey-t.sortKey));for(const t of A){const r=t.state;if(d.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Yr(r.buffers,t.segments,n,e,r.program,T,h,p,i,t.terrainData)),i.u_is_halo=0}Yr(r.buffers,t.segments,n,e,r.program,T,h,p,r.uniformValues,t.terrainData)}}function Yr(e,t,r,n,i,a,o,s,l,c){const u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Ur.disabled,l,c,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Kr(e,r,n,i){const a=e.context,o=a.gl,s=Nr.disabled,l=new Dr([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;const u=i.key;let h=n.heatmapFbos.get(u);h||(h=Qr(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:t.aM.transparent});const p=c.programConfigurations.get(n.id),d=e.useProgram("heatmap",p),f=e.style.map.terrain.getTerrainData(i);d.draw(a,o.TRIANGLES,Fr.disabled,s,l,Ur.disabled,Lt(i.posMatrix,r,e.transform.zoom,n.paint.get("heatmap-intensity")),f,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,e.transform.zoom,p)}function Jr(e,t,r){const n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());const a=en(n,t),o=r.key,s=t.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Fr.disabled,Nr.disabled,e.colorModeForRenderPass(),Ur.disabled,It(e,t,0,1),null,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,e.transform.zoom),s.destroy(),t.heatmapFbos.delete(o))}function Qr(e,t,r){var n,i;const a=e.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const s=null!==(n=e.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=e.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t,r,0,a.RGBA,s,null);const c=e.createFramebuffer(t,r,!1,!1);return c.colorAttachment.set(o),c}function en(e,t){return t.colorRampTexture||(t.colorRampTexture=new _(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function tn(e,t,r,n,i){if(!r||!n||!n.imageAtlas)return;const a=n.imageAtlas.patternPositions;let o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){const e=i.getPaintProperty(t);o=a[e],s=a[e]}o&&s&&e.setConstantPatternPositions(o,s)}function rn(e,t,r,n,i,a,o){const s=e.context.gl,l="fill-pattern",c=r.paint.get(l),u=c&&c.constantOr(1),h=r.getCrossfadeParameters();let p,d,f,m,g;o?(d=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",p=s.LINES):(d=u?"fillPattern":"fill",p=s.TRIANGLES);const y=c.constantOr(null);for(const v of n){const n=t.getTile(v);if(u&&!n.patternsLoaded())continue;const c=n.getBucket(r);if(!c)continue;const x=c.programConfigurations.get(r.id),b=e.useProgram(d,x),_=e.style.map.terrain&&e.style.map.terrain.getTerrainData(v);u&&(e.context.activeTexture.set(s.TEXTURE0),n.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),x.updatePaintBuffers(h)),tn(x,l,y,n,r);const w=_?v:null,k=e.translatePosMatrix(w?w.posMatrix:v.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){m=c.indexBuffer2,g=c.segments2;const t=[s.drawingBufferWidth,s.drawingBufferHeight];f="fillOutlinePattern"===d&&u?At(k,e,h,n,t):St(k,t)}else m=c.indexBuffer,g=c.segments,f=u?Tt(k,e,h,n):kt(k);b.draw(e.context,p,i,e.stencilModeForClipping(v),a,Ur.disabled,f,_,r.id,c.layoutVertexBuffer,m,g,r.paint,e.transform.zoom,x)}}function nn(e,t,r,n,i,a,o){const s=e.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),p=r.getCrossfadeParameters(),d=r.paint.get("fill-extrusion-opacity"),f=u.constantOr(null);for(const m of n){const n=t.getTile(m),u=n.getBucket(r);if(!u)continue;const g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(m),y=u.programConfigurations.get(r.id),v=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(e.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(p)),tn(y,c,f,n,r);const x=e.translatePosMatrix(m.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),b=r.paint.get("fill-extrusion-vertical-gradient"),_=h?wt(x,e,b,d,m,p,n):_t(x,e,b,d);v.draw(s,s.gl.TRIANGLES,i,a,o,Ur.backCCW,_,g,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,e.transform.zoom,y,e.style.map.terrain&&u.centroidVertexBuffer)}}function an(e,t,r,n,i,a,o){const s=e.context,l=s.gl,c=r.fbo;if(!c)return;const u=e.useProgram("hillshade"),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,Ur.disabled,((e,t,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);const l=!e.options.moving;return{u_matrix:n?n.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:zt(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(e,r,n,h?t:null),h,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function on(e,r,n,i,a,o){const s=e.context,l=s.gl,c=r.dem;if(c&&c.data){const u=c.dim,h=c.stride,p=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){const e=r.demTexture;e.update(p,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new _(s,p,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let d=r.fbo;if(!d){const e=new _(s,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),d=r.fbo=s.createFramebuffer(u,u,!0,!1),d.colorAttachment.set(e.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Ur.disabled,((e,r)=>{const n=r.stride,i=t.H();return t.aP(i,0,t.X,-t.X,0,0,1),t.J(i,i,[0,-t.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function sn(e,r,n,i,o,s){const l=i.paint.get("raster-fade-duration");if(!s&&l>0){const i=a.now(),s=(i-e.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.ac(p?s:1-c,0,1);return e.refreshedUponExpiration&&s>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}const ln=new t.aM(1,0,0,1),cn=new t.aM(0,1,0,1),un=new t.aM(0,0,1,1),hn=new t.aM(1,0,1,1),pn=new t.aM(0,1,1,1);function dn(e,t,r,n){mn(e,0,t+r/2,e.transform.width,r,n)}function fn(e,t,r,n){mn(e,t-r/2,0,r,e.transform.height,n)}function mn(e,t,r,n,i,a){const o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,r*e.pixelRatio,n*e.pixelRatio,i*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function gn(e,r,n){const i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Fr.disabled,c=Nr.disabled,u=e.colorModeForRenderPass(),h="$debug",p=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);const d=r.getTileByID(n.key).latestRawTileData,f=Math.floor((d&&d.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5;let y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();const r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,`${y} ${f}kB`),s.draw(i,a.TRIANGLES,l,c,Dr.alphaBlended,Ur.disabled,Ct(o,t.aM.transparent,g),null,h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,Ur.disabled,Ct(o,t.aM.red),p,h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function yn(e,t,r){const n=e.context,i=n.gl,a=e.colorModeForRenderPass(),o=new Fr(i.LEQUAL,Fr.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height]);for(const c of r){const r=e.renderToTexture.getTexture(c),u=t.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);const h=e.transform.calculatePosMatrix(c.tileID.toUnwrapped()),p=t.getMeshFrameDelta(e.transform.zoom),d=e.transform.calculateFogMatrix(c.tileID.toUnwrapped()),f=yt(h,p,d,e.style.sky,e.transform.pitch);s.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,f,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class vn{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class xn{constructor(e,r){this.context=new jr(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=he.maxUnderzooming+he.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ct}resize(e,t,r){if(this.width=Math.floor(e*r),this.height=Math.floor(t*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const n of this.style._order)this.style._layers[n].resize()}setup(){const e=this.context,r=new t.aX;r.emplaceBack(0,0),r.emplaceBack(t.X,0),r.emplaceBack(0,t.X),r.emplaceBack(t.X,t.X),this.tileExtentBuffer=e.createVertexBuffer(r,dt.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const n=new t.aX;n.emplaceBack(0,0),n.emplaceBack(t.X,0),n.emplaceBack(0,t.X),n.emplaceBack(t.X,t.X),this.debugBuffer=e.createVertexBuffer(n,dt.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const i=new t.$;i.emplaceBack(0,0,0,0),i.emplaceBack(t.X,0,t.X,0),i.emplaceBack(0,t.X,0,t.X),i.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=e.createVertexBuffer(i,J.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const a=new t.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,dt.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const o=new t.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);const s=new t.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);const l=this.context.gl;this.stencilClearMode=new Nr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=t.H();t.aP(n,0,this.width,this.height,0,0,1),t.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Fr.disabled,this.stencilClearMode,Dr.disabled,Ur.disabled,Pt(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;const r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Dr.disabled),r.setDepthMode(Fr.disabled);const i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const a of t){const e=this._tileClippingMaskIDs[a.key]=this.nextStencilID++,t=this.style.map.terrain&&this.style.map.terrain.getTerrainData(a);i.draw(r,n.TRIANGLES,Fr.disabled,new Nr({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),Dr.disabled,Ur.disabled,Pt(a.posMatrix),t,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Nr({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){const t=this.context.gl;return new Nr({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,r=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const e={};for(let r=0;r=0;this.currentLayer--){const e=this.style._layers[n[this.currentLayer]],t=i[e.source],r=o[e.source];this._renderTileClippingMasks(e,r),this.renderLayer(this,t,e,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerr.source&&!r.isHidden(t)?[e.sourceCaches[r.source]]:[])),i=n.filter((e=>"vector"===e.getSource().type)),a=n.filter((e=>"vector"!==e.getSource().type)),o=e=>{(!r||r.getSource().maxzoomo(e))),r||a.forEach((e=>o(e))),r}(this.style,this.transform.zoom);e&&function(e,t,r){for(let n=0;n0),i&&(t.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,r){const n=e.context,i=n.gl,a=Dr.unblended,o=new Fr(i.LEQUAL,Fr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=e.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1});for(const t of l){const l=r.getTerrainData(t.tileID),u={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};c.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,r){const n=e.context,i=n.gl,a=Dr.unblended,o=new Fr(i.LEQUAL,Fr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=e.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1}),r.coordsIndex=[];for(const t of c){const c=r.getTerrainData(t.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);const h={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};u.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(t.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(e,r,n,i,a){if("translucent"!==e.renderPass)return;const o=Nr.disabled,s=e.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,r,n,i,a,o,s,l,c){const u=r.transform,h=rt(),p="map"===a,d="map"===o;for(const f of e){const e=i.getTile(f),a=e.getBucket(n);if(!a||!a.text||!a.text.segments.get().length)continue;const o=t.ag(a.textSizeData,u.zoom),m=je(e,1,r.transform.zoom),g=ye(f.posMatrix,d,p,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&a.hasIconData();if(o){const t=Math.pow(2,u.zoom-e.tileID.overscaledZ),n=r.style.map.terrain?(e,t)=>r.style.map.terrain.getElevation(f,e,t):null,i=h.translatePosition(u,e,s,l);$r(a,p,d,c,u,g,f.posMatrix,t,o,y,h,i,f.toUnwrapped(),n)}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&Xr(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&Xr(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(qr(e,r,n,i,!0),qr(e,r,n,i,!1))}(e,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(e,r,n,i){if("translucent"!==e.renderPass)return;const a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;const c=e.context,u=c.gl,h=e.depthModeForSublayer(0,Fr.ReadOnly),p=Nr.disabled,d=e.colorModeForRenderPass(),f=[];for(let m=0;me.sortKey-t.sortKey));for(const t of f){const{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=t.state;i.draw(c,u.TRIANGLES,h,p,d,Ur.disabled,s,l,n.id,a,o,t.segments,n.paint,e.transform.zoom,r)}}(e,r,n,i);break;case"heatmap":!function(e,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;const a=e.context;if(e.style.map.terrain){for(const t of i){const i=r.getTile(t);r.hasRenderableParent(t)||("offscreen"===e.renderPass?Kr(e,i,n,t):"translucent"===e.renderPass&&Jr(e,n,t))}a.viewport.set([0,0,e.width,e.height])}else"offscreen"===e.renderPass?function(e,r,n,i){const a=e.context,o=a.gl,s=Nr.disabled,l=new Dr([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(e,r,n){const i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(t.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=Qr(e,r.width/4,r.height/4),n.heatmapFbos.set(t.aU,a))})(a,e,n),a.clear({color:t.aM.transparent});for(let t=0;t20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);const b=e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),_=b?d:null,w=_?_.posMatrix:e.transform.calculatePosMatrix(d.toUnwrapped(),p),k=Nt(w,v||[0,0],y||1,g,r);o instanceof Q?s.draw(i,a.TRIANGLES,n,Nr.disabled,l,Ur.disabled,k,b,r.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,n,c[d.overscaledZ],l,Ur.disabled,k,b,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}(e,r,n,i);break;case"background":!function(e,t,r,n){const i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const o=e.context,s=o.gl,l=e.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(e.isPatternMissing(u))return;const h=!u&&1===i.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==h)return;const p=Nr.disabled,d=e.depthModeForSublayer(0,"opaque"===h?Fr.ReadWrite:Fr.ReadOnly),f=e.colorModeForRenderPass(),m=e.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));const y=r.getCrossfadeParameters();for(const v of g){const t=n?v.posMatrix:e.transform.calculatePosMatrix(v.toUnwrapped()),l=u?Wt(t,a,e,u,{tileID:v,tileSize:c},y):Gt(t,a,i),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(v);m.draw(o,s.TRIANGLES,d,p,f,Ur.disabled,l,h,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}(e,0,n,i);break;case"custom":!function(e,t,r){const n=e.context,i=r.implementation;if("offscreen"===e.renderPass){const t=i.prerender;t&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),t.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Nr.disabled);const t="3d"===i.renderingMode?new Fr(e.context.gl.LEQUAL,Fr.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Fr.ReadOnly);n.setDepthMode(t),i.render(n.gl,e.transform.customLayerMatrix(),{farZ:e.transform.farZ,nearZ:e.transform.nearZ,fov:e.transform._fov,modelViewProjectionMatrix:e.transform.modelViewProjectionMatrix,projectionMatrix:e.transform.projectionMatrix}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}(e,0,n)}}translatePosMatrix(e,r,n,i,a){if(!n[0]&&!n[1])return e;const o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){const e=Math.sin(o),t=Math.cos(o);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const s=[a?n[0]:je(r,n[0],this.transform.zoom),a?n[1]:je(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.J(l,e,s),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}useProgram(e,t){this.cache=this.cache||{};const r=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new xt(this.context,ft[e],t,$t[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}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 e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new _(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}class bn{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,r,n){const i=Math.pow(2,n),a=[[-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((n=>{const a=1/(n=t.af([],n,e))[3]/r*i;return t.b1(n,n,[a,a,1/n[3],a])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}([],function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}([],y([],a[e[0]],a[e[1]]),y([],a[e[2]],a[e[1]]))),r=-((n=t)[0]*(i=a[e[1]])[0]+n[1]*i[1]+n[2]*i[2]);var n,i;return t.concat(r)}));return new bn(a,o)}}class _n{constructor(e,t){var r,n,i;this.min=e,this.max=t,this.center=function(e,t){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(e){const t=[e%2==0,e<2],r=m(this.min),n=m(this.max);for(let i=0;i=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;ithis.max[t]-this.min[t])return 0}return 1}}class wn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n}interpolate(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.y.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.y.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.y.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.y.number(e.right,r.right,n)),this}getCenter(e,r){const n=t.ac((this.left+e-this.right)/2,0,e),i=t.ac((this.top+r-this.bottom)/2,0,r);return new t.P(n,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new wn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const kn=85.051129;class Tn{constructor(e,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new Tn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const r=-t.b3(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=function(){var e=new t.A(4);return t.A!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}(),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const r=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(e){const r=[new t.b4(0,e)];if(this._renderWorldCopies){const n=this.pointCoordinate(new t.P(0,0)),i=this.pointCoordinate(new t.P(this.width,0)),a=this.pointCoordinate(new t.P(this.width,this.height)),o=this.pointCoordinate(new t.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let u=s-c;u<=l+c;u++)0!==u&&r.push(new t.b4(u,e))}return r}coveringTiles(e){var r,n;let i=this.coveringZoomLevel(e);const a=i;if(void 0!==e.minzoom&&ie.maxzoom&&(i=e.maxzoom);const o=this.pointCoordinate(this.getCameraPoint()),s=t.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i);let p=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(p=i);const d=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,f=e=>({aabb:new _n([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),m=[],g=[],y=i,x=e.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(f(-t)),m.push(f(t));for(m.push(f(0));m.length>0;){const i=m.pop(),a=i.x,o=i.y;let s=i.fullyVisible;if(!s){const e=i.aabb.intersects(h);if(0===e)continue;s=2===e}const l=e.terrain?c:u,f=i.aabb.distanceX(l),b=i.aabb.distanceY(l),_=Math.max(Math.abs(f),Math.abs(b));if(i.zoom===y||_>d+(1<=p){const e=y-i.zoom,r=c[0]-.5-(a<>1),h=i.zoom+1;let p=i.aabb.quadrant(c);if(e.terrain){const a=new t.S(h,i.wrap,h,l,u),o=e.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,c=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;p=new _n([p.min[0],p.min[1],s],[p.max[0],p.max[1],c])}m.push({aabb:p,zoom:h,x:l,y:u,wrap:i.wrap,fullyVisible:s})}}return g.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const r=t.ac(e.lat,-85.051129,kn);return new t.P(t.O(e.lng)*this.worldSize,t.Q(r)*this.worldSize)}unproject(e){return new t.Z(e.x/this.worldSize,e.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(e){const r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,e),a=e.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;const o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/t.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(e,r){const n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return t.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,r){if(r){const t=r.pointCoordinate(e);if(null!=t)return t}const n=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.af(n,n,this.pixelMatrixInverse),t.af(i,i,this.pixelMatrixInverse);const a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new t.Z(t.y.number(n[0]/a,i[0]/o,h)/this.worldSize,t.y.number(s,l,h)/this.worldSize)}coordinatePoint(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.pixelMatrix;const i=[e.x*this.worldSize,e.y*this.worldSize,r,1];return t.af(i,i,n),new t.P(i[0]/i[3],i[1]/i[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new t.P(0,e))).extend(this.pointLocation(new t.P(this.width,e))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([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(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,kn])}calculateTileMatrix(e){const r=e.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*e.wrap,a=t.an(new Float64Array(16));return t.J(a,a,[i*n,r.y*n,0]),t.K(a,a,[n/t.X,n/t.X,1]),a}calculatePosMatrix(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];const a=this.calculateTileMatrix(e);return t.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(e){const r=e.key,n=this._fogMatrixCache;if(n[r])return n[r];const i=this.calculateTileMatrix(e);return t.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,r){r=t.ac(+r,this.minZoom,this.maxZoom);const n={center:new t.N(e.lng,e.lat),zoom:r};let i=this.lngRange;if(!this._renderWorldCopies&&null===i){const e=180-1e-10;i=[-e,e]}const a=this.tileSize*this.zoomScale(n.zoom);let o=0,s=a,l=0,c=a,u=0,h=0;const{x:p,y:d}=this.size;if(this.latRange){const e=this.latRange;o=t.Q(e[1])*a,s=t.Q(e[0])*a,s-os&&(y=s-e)}if(i){const e=(l+c)/2;let r=f;this._renderWorldCopies&&(r=t.b3(f,e-a/2,e+a/2));const n=p/2;r-nc&&(g=c-n)}if(void 0!==g||void 0!==y){const e=new t.P(null!=g?g:f,null!=y?y:m);n.center=this.unproject.call({worldSize:a},e).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:t,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=r,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let i=t.an(new Float64Array(16));t.K(i,i,[this.width/2,-this.height/2,1]),t.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=t.an(new Float64Array(16)),t.K(i,i,[1,-1,1]),t.J(i,i,[-1,-1,0]),t.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+e.y/this.height),h=Math.sin(u)*l/Math.sin(t.ac(Math.PI-c-u,.01,Math.PI-.01)),p=this.getHorizon(),d=2*Math.atan(p/this.cameraToCenterDistance)*(.5+e.y/(2*p)),f=Math.sin(d)*l/Math.sin(t.ac(Math.PI-c-d,.01,Math.PI-.01)),m=Math.min(h,f);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),t.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-e.x/this.width,i[9]=2*e.y/this.height,this.projectionMatrix=t.ae(i),t.K(i,i,[1,-1,1]),t.J(i,i,[0,0,-this.cameraToCenterDistance]),t.b7(i,i,this._pitch),t.ad(i,i,this.angle),t.J(i,i,[-r,-n,0]),this.mercatorMatrix=t.K([],i,[this.worldSize,this.worldSize,this.worldSize]),t.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,i),t.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=t.as([],i),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,i);const g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),b=r-Math.round(r)+v*g+x*y,_=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(t.J(w,w,[b>.5?b-1:b,_>.5?_-1:_,0]),this.alignedModelViewProjectionMatrix=w,i=t.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new t.P(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,e))}getCameraQueryGeometry(e){const r=this.getCameraPoint();if(1===e.length)return[e[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(const t of e)n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y);return[new t.P(n,i),new t.P(a,i),new t.P(a,o),new t.P(n,o),new t.P(n,i)]}}lngLatToCameraDepth(e,r){const n=this.locationCoordinate(e),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return t.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Sn(e,t){var r=this;let n,i=!1,a=null,o=null;const s=()=>{a=null,i&&(e.apply(o,n),a=setTimeout(s,t),i=!1)};return function(){for(var e=arguments.length,t=new Array(e),l=0;l{const e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")},this._onHashChange=()=>{const e=this._getCurrentHash();if(e.length>=3&&!e.some((e=>isNaN(e)))){const t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{const e=this._getCurrentHash();if(0===e.length)return;const t=e.join("/");let r=t;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${t}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Sn(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,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(e){const t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(t.lng*i)/i,o=Math.round(t.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const e=this._hashName;let t=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===e?(t=!0,`${n}=${c}`):r})).filter((e=>e));return t||r.push(`${e}=${c}`),`#${r.join("&")}`}return`#${c}`}}const Mn={linearity:.3,easing:t.b8(0,0,.3,1)},En=t.e({deceleration:2500,maxSpeed:1400},Mn),Cn=t.e({deceleration:20,maxSpeed:1400},Mn),Pn=t.e({deceleration:1e3,maxSpeed:360},Mn),Ln=t.e({deceleration:1e3,maxSpeed:90},Mn);class In{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,t=a.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const a=On(r.pan.mag(),n,t.e({},En,e||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,zn(i,a)}if(r.zoom){const e=On(r.zoom,n,Cn);i.zoom=this._map.transform.zoom+e.amount,zn(i,e)}if(r.bearing){const e=On(r.bearing,n,Pn);i.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),zn(i,e)}if(r.pitch){const e=On(r.pitch,n,Ln);i.pitch=this._map.transform.pitch+e.amount,zn(i,e)}if(i.zoom||i.bearing){const e=void 0===r.pinchAround?r.around:r.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(i,{noMoveStart:!0})}}function zn(e,t){(!e.duration||e.duration3&&void 0!==arguments[3]?arguments[3]:{};const a=o.mousePos(r.getCanvas(),n),s=r.unproject(a);super(e,t.e({point:a,lngLat:s,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class Dn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n){const i="touchend"===e?n.changedTouches:n.touches,a=o.touchPos(r.getCanvasContainer(),i),s=a.map((e=>r.unproject(e))),l=a.reduce(((e,t,r,n)=>e.add(t.div(n.length))),new t.P(0,0));super(e,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class jn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}}class Fn{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new jn(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Rn(e.type,this._map,e))}mouseup(e){this._map.fire(new Rn(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Rn(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Rn(e.type,this._map,e))}mouseover(e){this._map.fire(new Rn(e.type,this._map,e))}mouseout(e){this._map.fire(new Rn(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Dn(e.type,this._map,e))}touchmove(e){this._map.fire(new Dn(e.type,this._map,e))}touchend(e){this._map.fire(new Dn(e.type,this._map,e))}touchcancel(e){this._map.fire(new Dn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bn{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Rn(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Rn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(e){this._map=e}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(e){return this.transform.pointLocation(t.P.convert(e),this._map.terrain)}}class Un{constructor(e,t){this._map=e,this._tr=new Nn(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(o.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)e.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}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(e,r){return this._map.fire(new t.k(e,{originalEvent:r}))}}function Vn(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);const r={};for(let n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const r=new t.P(0,0);for(const t of e)r._add(t);return r.div(e.length)}(r),this.touches=Vn(n,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;const n=Vn(r,t);for(const i in this.touches){const e=n[i];(!e||e.dist(this.touches[i])>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Hn{constructor(e){this.singleTap=new qn(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){const n=this.singleTap.touchend(e,t,r);if(n){const t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Gn{constructor(e){this._tr=new Nn(e),this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){const n=this._zoomIn.touchend(e,t,r),i=this._zoomOut.touchend(e,t,r),a=this._tr;return n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wn{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(){const e=this._moveFunction(...arguments);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;const r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const n=t.length?t[0]:t;return!this._moved&&n.dist(r){e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},Kn=e=>{let{enable:t,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=e;const i=new Zn({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new Wn({clickTolerance:r,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:i,enable:t,assignEvents:Yn})},Jn=e=>{let{enable:t,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=e;const i=new Zn({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new Wn({clickTolerance:r,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:i,enable:t,assignEvents:Yn})};class Qn{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active){if(!this._shouldBePrevented(r.length))return e.preventDefault(),this._calculateTransform(e,t,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,n){n.length>0&&(this._active=!0);const i=Vn(n,r),a=new t.P(0,0),o=new t.P(0,0);let s=0;for(const t in i){const e=i[t],r=this._touches[t];r&&(a._add(e),o._add(e.sub(r)),s++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;const l=o.div(s);return this._sum._add(l),this._sum.mag()Math.abs(e.x)}class si extends ei{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,oi(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,i=t.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const a=e.y>0==t.y>0;return oi(e)&&oi(t)&&a}}const li={panStep:100,bearingStep:15,pitchStep:10};class ci{constructor(e){this._tr=new Nn(e);const t=li;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,n=0,i=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{const s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:ui,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}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 ui(e){return e*(2-e)}const hi=4.000244140625;class pi{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new Nn(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==t&&t%hi==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){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 r=o.mousePos(this._map.getCanvas(),e),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?t.N.convert(this._aroundCenter?n.center:n.unproject(r)):t.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const e=this._tr.transform;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>hi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==r&&(r=1/r);const n="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:e.zoom,n=this._startZoom,i=this._easing;let o,s=!1;const l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&n&&i&&l){const e=Math.min(l/200,1),a=i(e);o=t.y.number(n,r,a),e<1?this._frameId||(this._frameId=!0):s=!0}else o=r,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=t.b9;if(this._prevEase){const e=this._prevEase,n=(a.now()-e.start)/e.duration,i=e.easing(n+.01)-e.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 fi{constructor(e){this._tr=new Nn(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class mi{constructor(){this._tap=new Hn({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(e,t,r){if(!this._swipePoint)if(this._tapTime){const n=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(e,t,r)}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{const n=this._tap.touchend(e,t,r);n&&(this._tapTime=e.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},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 yi{constructor(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r}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 vi{constructor(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),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 xi{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=t,this._container.appendChild(n);const i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),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(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const bi=e=>e.zoom||e.drag||e.pitch||e.rotate;class _i extends t.k{}function wi(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class ki{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===e.type?void 0:e,n={needsRenderFrame:!1},i={},a={},s=e.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),e);for(const{handlerName:o,handler:p,allowed:d}of this._handlers){if(!p.isEnabled())continue;let s;this._blockedByActive(a,d,o)?p.reset():p[t||e.type]&&(s=p[t||e.type](e,c,l),this.mergeHandlerResult(n,i,s,o,r),s&&s.needsRenderFrame&&this._triggerRenderFrame()),(s||p.isActive())&&(a[o]=p)}const u={};for(const o in this._previousActiveHandlers)a[o]||(u[o]=r);this._previousActiveHandlers=a,(Object.keys(u).length||wi(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||wi(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new In(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[n,i,a]of this._listeners)o.addEventListener(n,i,n===document?this.handleWindowEvent:this.handleEvent,a)}destroy(){for(const[e,t,r]of this._listeners)o.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){const t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Fn(t,e));const n=t.boxZoom=new Un(t,e);this._add("boxZoom",n),e.interactive&&e.boxZoom&&n.enable();const i=t.cooperativeGestures=new xi(t,e.cooperativeGestures);this._add("cooperativeGestures",i),e.cooperativeGestures&&i.enable();const a=new Gn(t),s=new fi(t);t.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();const l=new mi;this._add("tapDragZoom",l);const c=t.touchPitch=new si(t);this._add("touchPitch",c),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);const u=Kn(e),h=Jn(e);t.dragRotate=new yi(e,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();const p=(e=>{let{enable:t,clickTolerance:r}=e;const n=new Zn({checkCorrectEvent:e=>0===o.mouseButton(e)&&!e.ctrlKey});return new Wn({clickTolerance:r,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:n,enable:t,assignEvents:Yn})})(e),d=new Qn(e,t);t.dragPan=new gi(r,p,d),this._add("mousePan",p),this._add("touchPan",d,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);const f=new ai,m=new ni;t.touchZoomRotate=new vi(r,m,f,l),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);const g=t.scrollZoom=new pi(t,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);const y=t.keyboard=new ci(t);this._add("keyboard",y),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new Bn(t))}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(bi(this._eventsInProgress))||this.isZooming()}_blockedByActive(e,t,r){for(const n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1}_getMapTouches(e){const t=[];for(const r of e)this._el.contains(r.target)&&t.push(r);return t}mergeHandlerResult(e,r,n,i,a){if(!n)return;t.e(e,n);const o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){const e={},r={},n={};for(const[i,a,o]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(e.around=i.around),void 0!==i.pinchAround&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),t.e(r,a),t.e(n,o);this._updateMapTransform(e,r,n),this._changes=[]}_updateMapTransform(e,t,r){const n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(wi(e)||a&&this._terrainMovement))return this._fireEvents(t,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=e;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;const p=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),a?this._terrainMovement||!t.drag&&!t.zoom?t.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(p,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(p,u)):i.setLocationAtPoint(p,u),n._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)}_fireEvents(e,r,n){const i=bi(this._eventsInProgress),o=bi(e),s={};for(const t in e){const{originalEvent:r}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=r),this._eventsInProgress[t]=e[t]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(const t in e){const{originalEvent:r}=e[t];this._fireEvent(t,r)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=r[e]||n,l[`${t}end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const e=this._map._getTransformForUpdate();e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(e)}if(n&&h){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap{delete this._frameId,this.handleEvent(new _i("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ti extends t.E{constructor(e,t){super(),this._renderFrameCallback=()=>{const e=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,r,n){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},r),n)}panTo(e,r,n){return this.easeTo(t.e({center:e},r),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,r,n){return this.easeTo(t.e({zoom:e},r),n)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,r,n){return this.easeTo(t.e({bearing:e},r),n)}resetNorth(e,r){return this.rotateTo(0,t.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),r),this}snapToNorth(e,t){return Math.abs(this.getBearing())3&&void 0!==arguments[3]?arguments[3]:0;const a=t.Z.fromLngLat(e,r),o=t.Z.fromLngLat(n,i),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,u=Math.hypot(s,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");const h=Math.hypot(s,l),p=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),d=180*Math.atan2(s,-l)/Math.PI;let f=180*Math.acos(h/u)/Math.PI;return f=c<0?90-f:90+f,{center:o.toLngLat(),zoom:p,pitch:f,bearing:d}}easeTo(e,r){var n;this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.b9},e)).animate||!e.essential&&a.prefersReducedMotion)&&(e.duration=0);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:i.padding,d=t.P.convert(e.offset);let f=i.centerPoint.add(d);const m=i.pointLocation(f),{center:g,zoom:y}=i.getConstrained(t.N.convert(e.center||m),null!==(n=e.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.project(m),x=i.project(g).sub(v),b=i.zoomScale(y-o);let _,w;e.around&&(_=t.N.convert(e.around),w=i.locationPoint(_));const k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==l,this._padding=!i.isPaddingEqual(p),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,k),this.terrain&&this._prepareElevation(g),this._ease((n=>{if(this._zooming&&(i.zoom=t.y.number(o,y,n)),this._rotating&&(i.bearing=t.y.number(s,u,n)),this._pitching&&(i.pitch=t.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,p,n),f=i.centerPoint.add(d)),this.terrain&&!e.freezeElevation&&this._updateElevation(n),_)i.setLocationAtPoint(_,w);else{const e=i.zoomScale(i.zoom-o),t=y>o?Math.min(2,b):Math.max(.5,b),r=Math.pow(t,1-n),a=i.unproject(v.add(x.mult(n*r)).mult(e));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,f)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,t)}),e),this}_prepareEase(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,r||n.moving||this.fire(new t.k("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.k("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.k("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(r-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,e)}_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(e){const t=e.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(t.lngLat,e.zoom);if(t.altitudethis._elevateCameraIfInsideTerrain(e))),this.transformCameraUpdate&&t.push((e=>this.transformCameraUpdate(e))),!t.length)return;const r=e.clone();for(const n of t){const e=r.clone(),{center:t,zoom:i,pitch:a,bearing:o,elevation:s}=n(e);t&&(e.center=t),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==o&&(e.bearing=o),void 0!==s&&(e.elevation=s),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(e){this.fire(new t.k("move",e)),this._zooming&&this.fire(new t.k("zoom",e)),this._rotating&&this.fire(new t.k("rotate",e)),this._pitching&&this.fire(new t.k("pitch",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.k("zoomend",e)),i&&this.fire(new t.k("rotateend",e)),a&&this.fire(new t.k("pitchend",e)),this.fire(new t.k("moveend",e))}flyTo(e,r){var n;if(!e.essential&&a.prefersReducedMotion){const n=t.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},e);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:i.padding,d=t.P.convert(e.offset);let f=i.centerPoint.add(d);const m=i.pointLocation(f),{center:g,zoom:y}=i.getConstrained(t.N.convert(e.center||m),null!==(n=e.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.zoomScale(y-o),x=i.project(m),b=i.project(g).sub(x);let _=e.curve;const w=Math.max(i.width,i.height),k=w/v,T=b.mag();if("minZoom"in e){const r=t.ac(Math.min(e.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);_=Math.sqrt(n/T*2)}const S=_*_;function A(e){const t=(k*k-w*w+(e?-1:1)*S*S*T*T)/(2*(e?k:w)*S*T);return Math.log(Math.sqrt(t*t+1)-t)}function M(e){return(Math.exp(e)-Math.exp(-e))/2}function E(e){return(Math.exp(e)+Math.exp(-e))/2}const C=A(!1);let P=function(e){return E(C)/E(C+_*e)},L=function(e){return w*((E(C)*(M(t=C+_*e)/E(t))-M(C))/S)/T;var t},I=(A(!0)-C)/_;if(Math.abs(T)<1e-6||!isFinite(I)){if(Math.abs(w-k)<1e-6)return this.easeTo(e,r);const t=k0,P=e=>Math.exp(t*_*e)}return e.duration="duration"in e?+e.duration:1e3*I/("screenSpeed"in e?+e.screenSpeed/_:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(p),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{const a=n*I,m=1/P(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=t.y.number(s,u,n)),this._pitching&&(i.pitch=t.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,p,n),f=i.centerPoint.add(d)),this.terrain&&!e.freezeElevation&&this._updateElevation(n);const v=1===n?g:i.unproject(x.add(b.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,f),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(e,t,r){!1===r.animate||0===r.duration?(e(1),t()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=t.b3(e,-180,180);const n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const Si={compact:!0,customAttribution:'MapLibre'};class Ai{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si;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=e=>{!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,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(e,t){const r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((e=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style.sourceCaches;for(const n in t){const r=t[n];if(r.used||r.usedForTerrain){const t=r.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,r)=>{for(let n=r+1;n=0)return!1;return!0}));const r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Mi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._updateCompact=()=>{const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");const t=o.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),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 Ei{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(const n of r)if(n.id===e)return void(n.cancelled=!0)}run(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const t=this._currentlyRunning=this._queue;this._queue=[];for(const r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ci=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Pi extends t.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const n={};for(const i of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),this._tiles[i.key]=new le(i,this.tileSize));for(const t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(e){for(const t in this._tiles){const r=this._tiles[t];(!e||r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const r={};for(const n of this._renderableTilesKeys){const i=this._tiles[n].tileID;if(i.canonical.equals(e.canonical)){const i=e.clone();i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),r[n]=i}else if(i.canonical.isChildOf(e.canonical)){const a=e.clone();a.posMatrix=new Float64Array(16);const o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<>o<>o;t.aP(a.posMatrix,0,c,0,c,0,1),t.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=a}else if(e.canonical.isChildOf(i.canonical)){const a=e.clone();a.posMatrix=new Float64Array(16);const o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<>o<>o;t.aP(a.posMatrix,0,t.X,0,t.X,0,1),t.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),t.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(e,t){const r=this.sourceCache._source;let n=e.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(e.scaledTo(n--).key);return i}tilesAfterTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return Object.values(this._tiles).filter((t=>t.timeAdded>=e))}}class Li{constructor(e,t,r){this.painter=e,this.sourceCache=new Pi(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.X;var a;if(!(r>=0&&r=0&&n3&&void 0!==arguments[3]?arguments[3]:t.X;return this.getDEMElevation(e,r,n,i)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const e=this.painter.context,r=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new _(e,r,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new _(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const e=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new _(e,r.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),r.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const n=r&&r+r.tileID.key+e.key;if(n&&!this._demMatrixCache[n]){const n=this.sourceCache.sourceCache._source.maxzoom;let i=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=n?i=e.canonical.z-n:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=e.canonical.x-(e.canonical.x>>i<>i<>8<<4|t>>8,r[a+3]=0;const n=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new _(e,n,e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;const p=this._coordsTextureSize,d=(1<e.id!==t)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length!e.inUse))}}const zi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Ii(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((r=>!e._layers[r].isHidden(t))),this._coordsDescendingInv={};for(const r in e.sourceCaches){this._coordsDescendingInv[r]={};const t=e.sourceCaches[r].getVisibleCoordinates();for(const e of t){const t=this.terrain.sourceCache.getTerrainCoords(e);for(const e in t)this._coordsDescendingInv[r][e]||(this._coordsDescendingInv[r][e]=[]),this._coordsDescendingInv[r][e].push(t[e])}}this._coordsDescendingInvStr={};for(const r of e._order){const t=e._layers[r],n=t.source;if(zi[t.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(const e in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][e]=this._coordsDescendingInv[n][e].map((e=>e.key)).sort().join()}}for(const r of this._renderableTiles)for(const e in this._coordsDescendingInvStr){const t=this._coordsDescendingInvStr[e][r.tileID.key];t&&t!==r.rttCoords[e]&&(r.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const r=e.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(zi[r]&&(this._prevType&&zi[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!i))return!0;if(zi[this._prevType]||zi[r]&&i){this._prevType=r;const e=this._stacks.length-1,i=this._stacks[e]||[];for(const r of this._renderableTiles){if(this.pool.isFull()&&(yn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[e]){const t=this.pool.getObjectForId(r.rtt[e].id);if(t.stamp===r.rtt[e].stamp){this.pool.useObject(t);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[e]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:t.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let e=0;e{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},Bi={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ni{constructor(e,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mousedown=e=>{this.startMouse(t.e({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),o.mousePos(this.element,e)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.moveMouse(e,o.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.targetTouches.length&&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 i=e.dragRotate._mouseRotate.getClickTolerance(),a=e.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Kn({clickTolerance:i,enable:!0}),this.touchRotate=(e=>{let{enable:t,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=e;const i=new Xn;return new Wn({clickTolerance:r,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:i,enable:t,assignEvents:Fi})})({clickTolerance:i,enable:!0}),this.map=e,n&&(this.mousePitch=Jn({clickTolerance:a,enable:!0}),this.touchPitch=(e=>{let{enable:t,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=e;const i=new Xn;return new Wn({clickTolerance:r,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:i,enable:t,assignEvents:Fi})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),o.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),o.disableDrag()}moveMouse(e,t){const r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){const{pitchDelta:n}=this.mousePitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(e,t){const r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){const{pitchDelta:n}=this.touchPitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}off(){const e=this.element;o.removeEventListener(e,"mousedown",this.mousedown),o.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(e,"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 Ui;function Vi(e,r,n){const i=new t.N(e.lng,e.lat);if(e=new t.N(e.lng,e.lat),r){const i=new t.N(e.lng-360,e.lat),a=new t.N(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)180;){const t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e.lng!==i.lng&&n.locationPoint(e).y>n.height/2-n.getHorizon()?e:i}const qi={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 Hi(e,t,r){const n=e.classList;for(const i in qi)n.remove(`maplibregl-${r}-anchor-${i}`);n.add(`maplibregl-${r}-anchor-${t}`)}class Gi extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{const t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=e=>{const t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},this._update=e=>{var t;if(!this._map)return;const r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==e?void 0:e.type)||"render"===(null==e?void 0:e.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Vi(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.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 n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${qi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(e&&"moveend"===e.type)})).catch((()=>{}))},this._onMove=e=>{if(!this._isDragging){const t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.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),"active"===this._state&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==e?void 0:e.opacity,null==e?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{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 e of c){const t=o.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),l.appendChild(t)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.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"),u.appendChild(h);const p=o.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");const d=o.createNS("http://www.w3.org/2000/svg","path");d.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"),p.appendChild(d);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(p),s.appendChild(f),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),Hi(this._element,this._anchor,"marker"),e&&e.className)for(const t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.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(e){return this._lngLat=t.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,r=13.5,n=Math.abs(r)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[n,-1*(t-r+n)],"bottom-right":[-n,-1*(t-r+n)],left:[r,-1*(t-r)],right:[-r,-1*(t-r)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var r,n;if(!(null===(r=this._map)||void 0===r?void 0:r.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);const s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null===(n=this._popup)||void 0===n?void 0:n.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return void 0===e&&void 0===t&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}const Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let $i=0,Zi=!1;const Xi={maxWidth:100,unit:"metric"};function Yi(e,t,r){const n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){const r=3.2808*s;r>5280?Ki(t,n,r/5280,e._getUIString("ScaleControl.Miles")):Ki(t,n,r,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Ki(t,n,s,e._getUIString("ScaleControl.Meters"))}function Ki(e,t,r,n){const i=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r);e.style.width=t*(i/r)+"px",e.innerHTML=`${i} ${n}`}const Ji={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(e){if(e){if("number"==typeof e){const r=Math.round(Math.abs(e)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,e),"top-left":new t.P(r,r),"top-right":new t.P(-r,r),bottom:new t.P(0,-e),"bottom-left":new t.P(r,-r),"bottom-right":new t.P(-r,-r),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){const r=t.P.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.P.convert(e.center||[0,0]),top:t.P.convert(e.top||[0,0]),"top-left":t.P.convert(e["top-left"]||[0,0]),"top-right":t.P.convert(e["top-right"]||[0,0]),bottom:t.P.convert(e.bottom||[0,0]),"bottom-left":t.P.convert(e["bottom-left"]||[0,0]),"bottom-right":t.P.convert(e["bottom-right"]||[0,0]),left:t.P.convert(e.left||[0,0]),right:t.P.convert(e.right||[0,0])}}return ea(new t.P(0,0))}const ta=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Ai,e.BoxZoomHandler=Un,e.CanvasSource=te,e.CooperativeGesturesHandler=xi,e.DoubleClickZoomHandler=di,e.DragPanHandler=gi,e.DragRotateHandler=yi,e.EdgeInsets=wn,e.FullscreenControl=class extends t.E{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.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(e){return this._map=e,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 e=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_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 t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.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()}},e.GeoJSONSource=K,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,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&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new t.N(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.e({bearing:i},this.options.fitBoundsOptions),o=W.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new t.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.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=e=>{if(this._map){if(this.options.trackUserLocation)if(1===e.code){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 e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Zi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.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=e=>{if(this._map){if(!1===e){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}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 Gi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gi({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",(e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))}))}},this.options=t.e({},Wi,e)}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){if(void 0!==Ui&&!e)return Ui;if(void 0===window.navigator.permissions)return Ui=!!window.navigator.geolocation,Ui;try{const e=yield window.navigator.permissions.query({name:"geolocation"});Ui="denied"!==e.state}catch(t){Ui=!!window.navigator.geolocation}return Ui}()}))}().then((e=>this._finishSetupUI(e))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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,$i=0,Zi=!1}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitudet.getEast()||r.latitudet.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 e=this._map.getBounds(),t=e.getSouthEast(),r=e.getNorthEast(),n=t.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return t.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 t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$i--,Zi=!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 t.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 t.k("trackuserlocationstart")),this.fire(new t.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("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),$i++,$i>1?(e={maximumAge:6e5,timeout:0},Zi=!0):(e=this.options.positionOptions,Zi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}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)}},e.Hash=An,e.ImageSource=Q,e.KeyboardHandler=ci,e.LngLatBounds=W,e.LogoControl=Mi,e.Map=class extends Ti{constructor(e){t.bf.mark(t.bg.create);const r=Object.assign(Object.assign({},ji),e);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Tn(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ei,this._controls=[],this._mapId=t.a4(),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Ri),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=d.addThrottleControl((()=>this.isMoving())),this._requestManager=new f(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.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})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let e=!1;const t=Sn((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{e?t(r):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new An("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,t.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Ai("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Mi,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.k(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.k(`${e.dataType}dataloading`,e))})),this.on("dataabort",(e=>{this.fire(new t.k("sourcedataabort",e))}))}_getMapId(){return this._mapId}addControl(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=e.onAdd(this);this._controls.push(e);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,r,n)}resize(e){var r;const n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){const e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];const t=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,t),this.painter.resize(i,a,t)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);const s=!this._moving;return s&&(this.stop(),this.fire(new t.k("movestart",e)).fire(new t.k("move",e))),this.fire(new t.k("resize",e)),s&&this.fire(new t.k("moveend",e)),this}_getClampedPixelRatio(e,t){const{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,o=t*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var e;return null!==(e=this._overridePixelRatio)&&void 0!==e?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(W.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(e){return this.transform.locationPoint(t.N.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.pointLocation(t.P.convert(e),this.terrain)}isMoving(){var e;return this._moving||(null===(e=this.handlers)||void 0===e?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null===(e=this.handlers)||void 0===e?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null===(e=this.handlers)||void 0===e?void 0:e.isRotating())}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let n=!1;const i=i=>{const a=t.filter((e=>this.getLayer(e))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(e,this,i.originalEvent,{features:o}))):n=!1};return{layers:t,listener:r,delegates:{mousemove:i,mouseout:()=>{n=!1}}}}if("mouseleave"===e||"mouseout"===e){let n=!1;const i=i=>{const a=t.filter((e=>this.getLayer(e)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(e,this,i.originalEvent)))},a=t=>{n&&(n=!1,r.call(this,new Rn(e,this,t.originalEvent)))};return{layers:t,listener:r,delegates:{mousemove:i,mouseout:a}}}{const n=e=>{const n=t.filter((e=>this.getLayer(e))),i=0!==n.length?this.queryRenderedFeatures(e.point,{layers:n}):[];i.length&&(e.features=i,r.call(this,e),delete e.features)};return{layers:t,listener:r,delegates:{[e]:n}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners||!this._delegatedListeners[e])return;const n=this._delegatedListeners[e];for(let i=0;it.includes(e)))){for(const t in e.delegates)this.off(t,e.delegates[t]);return void n.splice(i,1)}}}on(e,t,r){if(void 0===r)return super.on(e,t);const n=this._createDelegatedListener(e,"string"==typeof t?[t]:t,r);this._saveDelegatedListener(e,n);for(const i in n.delegates)this.on(i,n.delegates[i]);return this}once(e,t,r){var n=this;if(void 0===r)return super.once(e,t);const i="string"==typeof t?[t]:t,a=this._createDelegatedListener(e,i,r);for(const o in a.delegates){const t=a.delegates[o];a.delegates[o]=function(){n._removeDelegatedListener(e,i,r),t(...arguments)}}this._saveDelegatedListener(e,a);for(const o in a.delegates)this.once(o,a.delegates[o]);return this}off(e,t,r){return void 0===r?super.off(e,t):(this._removeDelegatedListener(e,"string"==typeof t?[t]:t,r),this)}queryRenderedFeatures(e,r){if(!this.style)return[];let n;const i=e instanceof t.P||Array.isArray(e),a=i?e:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:e)||{},a instanceof t.P||"number"==typeof a[0])n=[t.P.convert(a)];else{const e=t.P.convert(a[0]),r=t.P.convert(a[1]);n=[e,new t.P(r.x,e.y),r,new t.P(e.x,r.y),e]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,r){return!1!==(r=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(e,t)));const r=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new pt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){if("string"==typeof e){const n=this._requestManager.transformRequest(e,"Style");t.h(n,new AbortController).then((e=>{this._updateDiff(e.data,r)})).catch((e=>{e&&this.fire(new t.j(e))}))}else"object"==typeof e&&this._updateDiff(e,r)}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(n){t.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){const r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.j(new Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){const r=this.style.sourceCaches[e.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);null===this.terrain&&r.reload();for(const n in this.style._layers){const r=this.style._layers[n];"hillshade"===r.type&&r.source===e.source&&t.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 Li(this.painter,r,e),this.painter.renderToTexture=new Oi(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=t=>{"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&t.tile&&(t.sourceId!==e.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(t.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 t.k("terrain",{terrain:e})),this}getTerrain(){var e,t;return null!==(t=null===(e=this.terrain)||void 0===e?void 0:e.options)&&void 0!==t?t:null}areTilesLoaded(){const e=this.style&&this.style.sourceCaches;for(const t in e){const r=e[t]._tiles;for(const e in r){const t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||t.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new t.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:n,height:a,data:p}=r,d=r;return this.style.addImage(e,{data:new t.R({width:n,height:a},new Uint8Array(p)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:d}),d.onAdd&&d.onAdd(this,e),this}}{const{width:n,height:p,data:d}=a.getImageData(r);this.style.addImage(e,{data:new t.R({width:n,height:p},d),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(e,r){const n=this.style.getImage(e);if(!n)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof HTMLImageElement||t.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new t.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(o!==n.data.width||s!==n.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(r instanceof HTMLImageElement||t.b(r));return n.data.replace(l,c),this.style.updateImage(e,n),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return d.getImage(this._requestManager.transformRequest(e,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(e,t,r,n),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(e,t,r,n),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,(e=>{e||this._update(!0)})),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,(e=>{e||this._update(!0)})),this}setLight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e){return this._lazyInitEmptyStyle(),this.style.setSky(e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){const e=this._container;e.classList.add("maplibregl-map");const t=this._canvasContainer=o.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",t),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 r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);const i=this._controlContainer=o.create("div","maplibregl-control-container",e),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{a[e]=o.create("div",`maplibregl-ctrl-${e} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,r){this._canvas.width=Math.floor(r*e),this._canvas.height=Math.floor(r*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{t={requestedAttributes:e},r&&(t.statusMessage=r.statusMessage,t.type=r.type)}),{once:!0});const r=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!r){const e="Failed to initialize WebGL";throw t?(t.message=e,new Error(JSON.stringify(t))):new Error(e)}this.painter=new xn(r,this.transform),s.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const e=this.transform.zoom,i=a.now();this.style.zoomHistory.update(e,i);const o=new t.z(e,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}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,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var e;this._hash&&this._hash.remove();for(const t of this._controls)t.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),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),d.removeThrottleControl(this._imageQueueHandle),null===(e=this._resizeObserver)||void 0===e||e.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.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"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((e=>{t.bf.frame(e),this._frameRequest=null,this._render(e)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return Di}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Rn,e.MapTouchEvent=Dn,e.MapWheelEvent=jn,e.Marker=Gi,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{const e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{const e=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=e},this._setButtonTitle=(e,t)=>{const r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)},this.options=t.e({},Bi,e),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,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 Ni(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(e,t){const r=o.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},e.Popup=class extends t.E{constructor(e){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 t.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var t;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 e of this.options.className.split(" "))this._container.classList.add(e);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?Vi(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._trackPointer&&!e)return;const r=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor;const i=ea(this.options.offset);if(!n){const e=this._container.offsetWidth,t=this._container.offsetHeight;let a;a=r.y+i.bottom.ythis._map.transform.height-t?["bottom"]:[],r.xthis._map.transform.width-e/2&&a.push("right"),n=0===a.length?"bottom":a.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${qi[n]} translate(${a.x}px,${a.y}px)`),Hi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(Ji),e)}addTo(e){return this._map&&this.remove(),this._map=e,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 t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),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(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),r=document.createElement("body");let n;for(r.innerHTML=e;n=r.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){var e;return null===(e=this._container)||void 0===e?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){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(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_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 e=this._container.querySelector(Qi);e&&e.focus()}},e.RasterDEMTileSource=Y,e.RasterTileSource=X,e.ScaleControl=class{constructor(e){this._onMove=()=>{Yi(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,Yi(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Xi),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.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}},e.ScrollZoomHandler=pi,e.Style=pt,e.TerrainControl=class{constructor(e){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=e}onAdd(e){return this._map=e,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}},e.TwoFingersTouchPitchHandler=si,e.TwoFingersTouchRotateHandler=ai,e.TwoFingersTouchZoomHandler=ni,e.TwoFingersTouchZoomRotateHandler=vi,e.VectorTileSource=Z,e.VideoSource=ee,e.addSourceType=(e,r)=>t._(void 0,void 0,void 0,(function*(){if(ne(e))throw new Error(`A source type called "${e}" already exists.`);var t;t=r,re[e]=t})),e.clearPrewarmedResources=function(){const e=j;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(O),j=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()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return se().getRTLTextPluginStatus()},e.getVersion=function(){return ta},e.getWorkerCount=function(){return R.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return U().broadcast("IS",e)},e.prewarm=function(){B().acquire(O)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return se().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){R.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}})),e},"object"===typeof e&&"undefined"!==typeof t?t.exports=a():(n="undefined"!==typeof globalThis?globalThis:n||self).maplibregl=a()}}),i_=p({"src/plots/map/layers.js"(e,t){var r=st(),n=At().sanitizeHTML,i=Kb(),a=Gb();function o(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var n=0;n0}function c(e){var t={},n={};switch(e.type){case"circle":r.extendFlat(n,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(n,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var a=e.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(t,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:n}}s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,l(e)){var r=function(e){var t,r=e.sourcetype,i=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof i?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=i,e.sourceattribution&&(a.attribution=n(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r1)for(r=0;r-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&l.click(n,t.originalEvent)}}},x.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(c)};var l=t.dragOptions;t.dragOptions=n.extendDeep(l||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){p(e,r,n,t.dragOptions,o)},s.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},x.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},x.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;tx/2){var b=m.split("|").join("
");y.text(b).attr("data-unformatted",b).call(l.convertToTspans,e),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.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 _=1;v.width+6>x&&(_=x/(v.width+6));var w=[c.l+c.w*d.x[1],c.t+c.h*(1-d.y[0])];g.attr("transform",r(w[0],w[1])+n(_))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[u],n=0;n=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,i=new a(e,n.uid),o=i.sourceId,s=r(t),l=i.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}}}),f_=p({"src/traces/choroplethmap/index.js"(e,t){t.exports={attributes:u_(),supplyDefaults:h_(),colorbar:No(),calc:Tg(),plot:d_(),hoverPoints:Mg(),eventData:Eg(),selectPoints:Cg(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a0?+d[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(t),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":f?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),b_=p({"src/traces/densitymap/plot.js"(e,t){var r=x_(),n=Gb().traceLayerPrefix;function i(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",n+t+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,n=this.layerList,i=r(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,a=new i(e,n.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),__=p({"src/traces/densitymap/hover.js"(e,t){var r=nr(),n=e_().hoverPoints,i=e_().getExtraText;t.exports=function(e,t,a){var o=n(e,t,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),w_=p({"src/traces/densitymap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),k_=p({"src/traces/densitymap/index.js"(e,t){t.exports={attributes:g_(),supplyDefaults:y_(),colorbar:No(),formatLabels:Yb(),calc:v_(),plot:b_(),hoverPoints:__(),eventData:w_(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n0;){t=c[c.length-1];var d=e[t];if(a[t]=0&&s[t].push(o[m])}a[t]=f}else{if(n[t]===r[t]){var g=[],y=[],v=0;for(f=l.length-1;f>=0;--f){var x=l[f];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===t){l.length=f;break}}h.push(g);var b=new Array(v);for(f=0;fx&&(x=l.source[t]),l.target[t]>x&&(x=l.target[t]);var b,_=x+1;e.node._count=_;var w=e.node.groups,k={};for(t=0;t0&&o(C,_)&&o(P,_)&&(!k.hasOwnProperty(C)||!k.hasOwnProperty(P)||k[C]!==k[P])){k.hasOwnProperty(P)&&(P=k[P]),k.hasOwnProperty(C)&&(C=k[C]),P=+P,d[C=+C]=d[P]=!0;var L="";l.label&&l.label[t]&&(L=l.label[t]);var I=null;L&&f.hasOwnProperty(L)&&(I=f[L]),c.push({pointNumber:t,label:L,color:u?l.color[t]:l.color,hovercolor:h?l.hovercolor[t]:l.hovercolor,customdata:p?l.customdata[t]:l.customdata,concentrationscale:I,source:C,target:P,value:+E}),M.source.push(C),M.target.push(P)}}var z=_+w.length,O=a(i.color),R=a(i.customdata),D=[];for(t=0;t_-1,childrenNodes:[],pointNumber:t,label:j,color:O?i.color[t]:i.color,customdata:R?i.customdata[t]:i.customdata})}var F=!1;return function(e,t,i){for(var a=n.init2dArray(e,0),o=0;o1}))}(z,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:w,groupLookup:k}}t.exports=function(e,t){var r=l(t);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}}}),C_=p({"node_modules/d3-quadtree/dist/d3-quadtree.js"(e,t){var r,n;r=e,n=function(e){function t(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,a,o,s,l,c,u,h,p,d=e._root,f={data:n},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!d)return e._root=f,e;for(;d.length;)if((c=t>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=d,!(d=d[h=u<<1|c]))return i[h]=f,e;if(s=+e._x.call(null,d.data),l=+e._y.call(null,d.data),t===s&&r===l)return f.next=d,i?i[h]=f:e._root=f,e;do{i=i?i[h]=new Array(4):e._root=new Array(4),(c=t>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)===(p=(l>=o)<<1|s>=a));return i[p]=d,i[h]=f,e}function r(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function n(e){return e[0]}function i(e){return e[1]}function a(e,t,r){var a=new o(null==t?n:t,null==r?i:r,NaN,NaN,NaN,NaN);return null==e?a:a.addAll(e)}function o(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var l=a.prototype=o.prototype;l.copy=function(){var e,t,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=s(t));return r},l.add=function(e){var r=+this._x.call(null,e),n=+this._y.call(null,e);return t(this.cover(r,n),r,n,e)},l.addAll=function(e){var r,n,i,a,o=e.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,p=-1/0;for(n=0;nh&&(h=i),ap&&(p=a));if(c>h||u>p)return this;for(this.cover(c,u).cover(h,p),n=0;ne||e>=i||n>t||t>=a;)switch(s=(td||(o=c.y0)>f||(s=c.x1)=v)<<1|e>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(f+g)/2))?f=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,t=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,p=h)}for(;d.data!==e;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):t?(i?t[h]=i:delete t[h],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(r?r[p]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(e){for(var t=0,r=e.length;t=l.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var s,c,h,p=-1,d=r.length,f=l[i++],m=n(),g=a();++pl.length)return e;var n,i=c[r-1];return null!=t&&r>=l.length?n=e.entries():(n=[],e.each((function(e,t){n.push({key:t,values:h(e,r)})}))),null!=i?n.sort((function(e,t){return i(e.key,t.key)})):n}return r={object:function(e){return u(e,0,i,a)},map:function(e){return u(e,0,o,s)},entries:function(e){return h(u(e,0,o,s),0)},key:function(e){return l.push(e),r},sortKeys:function(e){return c[l.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}},e.set=u,e.map=n,e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:r.d3=r.d3||{})}}),L_=p({"node_modules/d3-dispatch/dist/d3-dispatch.js"(e,t){var r,n;r=e,n=function(e){var t={value:function(){}};function r(){for(var e,t=0,r=arguments.length,i={};t=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++l0)for(var r,n,i=new Array(r),a=0;a=0&&r._call.call(null,e),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var e,n,i=t,a=1/0;i;)i._call?(a>i._time&&(a=i._time),e=i,i=i._next):(n=i._next,i._next=null,i=e?e._next=n:t=n);r=e,v(a)}(),s=0}}function y(){var e=c.now(),t=e-o;t>1e3&&(l-=t,o=e)}function v(e){n||(i&&(i=clearTimeout(i)),e-s>24?(e<1/0&&(i=setTimeout(g,e-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}d.prototype=f.prototype={constructor:d,restart:function(e,n,i){if("function"!==typeof e)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:t=this,r=this),this._call=e,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},e.interval=function(e,t,r){var n=new d,i=t;return null==t?(n.restart(e,t,r),n):(t=+t,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=t,r),e(o)}),t,r),n)},e.now=h,e.timeout=function(e,t,r){var n=new d;return t=null==t?0:+t,n.restart((function(r){n.stop(),e(r+t)}),t,r),n},e.timer=f,e.timerFlush=m,Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),z_=p({"node_modules/d3-force/dist/d3-force.js"(e,t){var r,n;r=e,n=function(e,t,r,n,i){function a(e){return function(){return e}}function o(){return 1e-6*(Math.random()-.5)}function s(e){return e.x+e.vx}function l(e){return e.y+e.vy}function c(e){return e.index}function u(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function h(e){return e.x}function p(e){return e.y}var d=Math.PI*(3-Math.sqrt(5));e.forceCenter=function(e,t){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;np+c||nd+c||au.index){var h=p-s.x-s.vx,g=d-s.y-s.vy,y=h*h+g*g;ye.r&&(e.r=e[t].r)}function p(){if(r){var t,i,a=r.length;for(n=new Array(a),t=0;t=c)){(e.data!==r||e.next)&&(0===h&&(f+=(h=o())*h),0===p&&(f+=(p=o())*p),f1?(null==r?u.remove(e):u.set(e,y(r)),t):u.get(e)},find:function(t,r,n){var i,a,o,s,l,c=0,u=e.length;for(null==n?n=1/0:n*=n,c=0;c1?(p.on(e,r),t):p.on(e)}}},e.forceX=function(e){var t,r,n,i=a(.1);function o(e){for(var i,a=0,o=t.length;an)if(Math.abs(p*c-u*h)>n&&o){var f=i-s,m=a-l,g=c*c+u*u,y=f*f+m*m,v=Math.sqrt(g),x=Math.sqrt(d),b=o*Math.tan((t-Math.acos((g+d-y)/(2*v*x)))/2),_=b/x,w=b/v;Math.abs(_-1)>n&&(this._+="L"+(e+_*h)+","+(r+_*p)),this._+="A"+o+","+o+",0,0,"+ +(p*f>h*m)+","+(this._x1=e+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=r)},arc:function(e,a,o,s,l,c){e=+e,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),p=e+u,d=a+h,f=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+p+","+d:(Math.abs(this._x1-p)>n||Math.abs(this._y1-d)>n)&&(this._+="L"+p+","+d),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+f+","+(e-u)+","+(a-h)+"A"+o+","+o+",0,1,"+f+","+(this._x1=p)+","+(this._y1=d):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=t)+","+f+","+(this._x1=e+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},e.path=o,Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),R_=p({"node_modules/d3-shape/dist/d3-shape.js"(e,t){var r,n;r=e,n=function(e,t){function r(e){return function(){return e}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,p=h/2,d=2*h;function f(e){return e>=1?p:e<=-1?-p:Math.asin(e)}function m(e){return e.innerRadius}function g(e){return e.outerRadius}function y(e){return e.startAngle}function v(e){return e.endAngle}function x(e){return e&&e.padAngle}function b(e,t,r,n,i,a,s){var l=e-r,u=t-n,h=(s?a:-a)/c(l*l+u*u),p=h*u,d=-h*l,f=e+p,m=t+d,g=r+p,y=n+d,v=(f+g)/2,x=(m+y)/2,b=g-f,_=y-m,w=b*b+_*_,k=i-a,T=f*y-g*m,S=(_<0?-1:1)*c(o(0,k*k*w-T*T)),A=(T*_-b*S)/w,M=(-T*b-_*S)/w,E=(T*_+b*S)/w,C=(-T*b+_*S)/w,P=A-v,L=M-x,I=E-v,z=C-x;return P*P+L*L>I*I+z*z&&(A=E,M=C),{cx:A,cy:M,x01:-p,y01:-d,x11:A*(i/k-1),y11:M*(i/k-1)}}function _(e){this._context=e}function w(e){return new _(e)}function k(e){return e[0]}function T(e){return e[1]}function S(){var e=k,n=T,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,p=!1;for(null==a&&(s=o(u=t.path())),l=0;l<=h;++l)!(l=h;--p)c.point(y[p],v[p]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+e(d,u,r),v[u]=+i(d,u,r),c.point(n?+n(d,u,r):y[u],a?+a(d,u,r):v[u]))}if(f)return c=null,f+""||null}function h(){return S().defined(o).curve(l).context(s)}return u.x=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),n=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),u):e},u.x1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:r(+e),u):n},u.y=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),a=null,u):i},u.y0=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),u):i},u.y1=function(e){return arguments.length?(a=null==e?null:"function"===typeof e?e:r(+e),u):a},u.lineX0=u.lineY0=function(){return h().x(e).y(i)},u.lineY1=function(){return h().x(e).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(e){return arguments.length?(o="function"===typeof e?e:r(!!e),u):o},u.curve=function(e){return arguments.length?(l=e,null!=s&&(c=l(s)),u):l},u.context=function(e){return arguments.length?(null==e?s=c=null:c=l(s=e),u):s},u}function M(e,t){return te?1:t>=e?0:NaN}function E(e){return e}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var C=L(w);function P(e){this._curve=e}function L(e){function t(t){return new P(e(t))}return t._curve=e,t}function I(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(L(e)):t()._curve},e}function z(){return I(S().curve(C))}function O(){var e=A().curve(C),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return I(r())},delete e.lineX0,e.lineEndAngle=function(){return I(n())},delete e.lineX1,e.lineInnerRadius=function(){return I(i())},delete e.lineY0,e.lineOuterRadius=function(){return I(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t(L(e)):t()._curve},e}function R(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};var D=Array.prototype.slice;function j(e){return e.source}function F(e){return e.target}function B(e){var n=j,i=F,a=k,o=T,s=null;function l(){var r,l=D.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=t.path()),e(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(e){return arguments.length?(n=e,l):n},l.target=function(e){return arguments.length?(i=e,l):i},l.x=function(e){return arguments.length?(a="function"===typeof e?e:r(+e),l):a},l.y=function(e){return arguments.length?(o="function"===typeof e?e:r(+e),l):o},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function N(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function U(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t,r=(r+i)/2,n,r,n,i)}function V(e,t,r,n,i){var a=R(t,r),o=R(t,r=(r+i)/2),s=R(n,r),l=R(n,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(e,t){var r=Math.sqrt(t/h);e.moveTo(r,0),e.arc(0,0,r,0,d)}},H={draw:function(e,t){var r=Math.sqrt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},G=Math.sqrt(1/3),W=2*G,$={draw:function(e,t){var r=Math.sqrt(t/W),n=r*G;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Z=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(d/10)*Z,Y=-Math.cos(d/10)*Z,K={draw:function(e,t){var r=Math.sqrt(.8908130915292852*t),n=X*r,i=Y*r;e.moveTo(0,-r),e.lineTo(n,i);for(var a=1;a<5;++a){var o=d*a/5,s=Math.cos(o),l=Math.sin(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},J={draw:function(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},Q=Math.sqrt(3),ee={draw:function(e,t){var r=-Math.sqrt(t/(3*Q));e.moveTo(0,2*r),e.lineTo(-Q*r,-r),e.lineTo(Q*r,-r),e.closePath()}},te=-.5,re=Math.sqrt(3)/2,ne=1/Math.sqrt(12),ie=3*(ne/2+1),ae={draw:function(e,t){var r=Math.sqrt(t/ie),n=r/2,i=r*ne,a=n,o=r*ne+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(te*n-re*i,re*n+te*i),e.lineTo(te*a-re*o,re*a+te*o),e.lineTo(te*s-re*l,re*s+te*l),e.lineTo(te*n+re*i,te*i-re*n),e.lineTo(te*a+re*o,te*o-re*a),e.lineTo(te*s+re*l,te*l-re*s),e.closePath()}},oe=[q,H,$,J,K,ee,ae];function se(){}function le(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function ce(e){this._context=e}function ue(e){this._context=e}function he(e){this._context=e}function pe(e,t){this._basis=new ce(e),this._beta=t}ce.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:le(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ue.prototype={areaStart:se,areaEnd:se,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)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},he.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},pe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,i=e[0],a=t[0],o=e[r]-i,s=t[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+n*o),this._beta*t[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var de=function e(t){function r(e){return 1===t?new ce(e):new pe(e,t)}return r.beta=function(t){return e(+t)},r}(.85);function fe(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function me(e,t){this._context=e,this._k=(1-t)/6}me.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:fe(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ge=function e(t){function r(e){return new me(e,t)}return r.tension=function(t){return e(+t)},r}(0);function ye(e,t){this._context=e,this._k=(1-t)/6}ye.prototype={areaStart:se,areaEnd:se,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)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ve=function e(t){function r(e){return new ye(e,t)}return r.tension=function(t){return e(+t)},r}(0);function xe(e,t){this._context=e,this._k=(1-t)/6}xe.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var be=function e(t){function r(e){return new xe(e,t)}return r.tension=function(t){return e(+t)},r}(0);function _e(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>u){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>u){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/h,o=(o*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function we(e,t){this._context=e,this._alpha=t}we.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)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:_e(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ke=function e(t){function r(e){return t?new we(e,t):new me(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Te(e,t){this._context=e,this._alpha=t}Te.prototype={areaStart:se,areaEnd:se,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)}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:_e(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Se=function e(t){function r(e){return t?new Te(e,t):new ye(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Ae(e,t){this._context=e,this._alpha=t}Ae.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:_e(this,e,t)}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Me=function e(t){function r(e){return t?new Ae(e,t):new xe(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Ee(e){this._context=e}function Ce(e){return e<0?-1:1}function Pe(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ce(a)+Ce(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Le(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ie(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function ze(e){this._context=e}function Oe(e){this._context=new Re(e)}function Re(e){this._context=e}function De(e){this._context=e}function je(e){var t,r,n=e.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t1)for(var r,n,i,a=1,o=e[t[0]],s=o.length;a=0;)r[t]=t;return r}function Ue(e,t){return e[t]}function Ve(e){var t=e.map(qe);return Ne(e).sort((function(e,r){return t[e]-t[r]}))}function qe(e){for(var t,r=-1,n=0,i=e.length,a=-1/0;++ra&&(a=t,n=r);return n}function He(e){var t=e.map(Ge);return Ne(e).sort((function(e,r){return t[e]-t[r]}))}function Ge(e){for(var t,r=0,n=-1,i=e.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}},e.arc=function(){var e=m,o=g,_=r(0),w=null,k=y,T=v,S=x,A=null;function M(){var r,m,g,y=+e.apply(this,arguments),v=+o.apply(this,arguments),x=k.apply(this,arguments)-p,M=T.apply(this,arguments)-p,E=n(M-x),C=M>x;if(A||(A=r=t.path()),vu)if(E>d-u)A.moveTo(v*a(x),v*l(x)),A.arc(0,0,v,x,M,!C),y>u&&(A.moveTo(y*a(M),y*l(M)),A.arc(0,0,y,M,x,C));else{var P,L,I=x,z=M,O=x,R=M,D=E,j=E,F=S.apply(this,arguments)/2,B=F>u&&(w?+w.apply(this,arguments):c(y*y+v*v)),N=s(n(v-y)/2,+_.apply(this,arguments)),U=N,V=N;if(B>u){var q=f(B/y*l(F)),H=f(B/v*l(F));(D-=2*q)>u?(O+=q*=C?1:-1,R-=q):(D=0,O=R=(x+M)/2),(j-=2*H)>u?(I+=H*=C?1:-1,z-=H):(j=0,I=z=(x+M)/2)}var G=v*a(I),W=v*l(I),$=y*a(R),Z=y*l(R);if(N>u){var X,Y=v*a(z),K=v*l(z),J=y*a(O),Q=y*l(O);if(E1?0:g<-1?h:Math.acos(g))/2),ae=c(X[0]*X[0]+X[1]*X[1]);U=s(N,(y-ae)/(ie-1)),V=s(N,(v-ae)/(ie+1))}}j>u?V>u?(P=b(J,Q,G,W,v,V,C),L=b(Y,K,$,Z,v,V,C),A.moveTo(P.cx+P.x01,P.cy+P.y01),Vu&&D>u?U>u?(P=b($,Z,Y,K,y,-U,C),L=b(G,W,J,Q,y,-U,C),A.lineTo(P.cx+P.x01,P.cy+P.y01),U0&&(f+=h);for(null!=t?m.sort((function(e,r){return t(g[e],g[r])})):null!=n&&m.sort((function(e,t){return n(r[e],r[t])})),s=0,c=f?(v-p*b)/f:0;s0?h*c:0)+b,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),s):i},s.endAngle=function(e){return arguments.length?(a="function"===typeof e?e:r(+e),s):a},s.padAngle=function(e){return arguments.length?(o="function"===typeof e?e:r(+e),s):o},s},e.pointRadial=R,e.radialArea=O,e.radialLine=z,e.stack=function(){var e=r([]),t=Ne,n=Be,i=Ue;function a(r){var a,o,s=e.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a0)for(var r,n,i,a,o,s,l=0,c=e[t[0]].length;l0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},e.stackOffsetExpand=function(e,t){if((n=e.length)>0){for(var r,n,i,a=0,o=e[0].length;a0){for(var r,n=0,i=e[t[0]],a=i.length;n0&&(n=(r=e[t[0]]).length)>0){for(var r,n,i,a=0,o=1;o0;--o)f(a*=.99),m(),l(a),m();function s(){var r=t.max(i,(function(e){return e.length})),a=A*(v-n)/(r-1);b>a&&(b=a);var o=t.min(i,(function(e){return(v-n-(e.length-1)*b)/t.sum(e,u)}));i.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*o}))})),e.links.forEach((function(e){e.width=e.value*o}))}function l(e){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(t.sum(r.targetLinks,p)/t.sum(r.targetLinks,u)-h(r))*e;r.y0+=n,r.y1+=n}}))}))}function f(e){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(t.sum(r.sourceLinks,d)/t.sum(r.sourceLinks,u)-h(r))*e;r.y0+=n,r.y1+=n}}))}))}function m(){i.forEach((function(e){var t,r,i,a=n,o=e.length;for(e.sort(c),i=0;i0&&(t.y0+=r,t.y1+=r),a=t.y1+b;if((r=a-b-v)>0)for(a=t.y0-=r,t.y1-=r,i=o-2;i>=0;--i)(r=(t=e[i]).y1+b-a)>0&&(t.y0-=r,t.y1-=r),a=t.y0}))}}(a),E(a),a}function E(e){e.nodes.forEach((function(e){e.sourceLinks.sort(l),e.targetLinks.sort(s)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return M.update=function(e){return E(e),e},M.nodeId=function(e){return arguments.length?(_="function"===typeof e?e:o(e),M):_},M.nodeAlign=function(e){return arguments.length?(w="function"===typeof e?e:o(e),M):w},M.nodeWidth=function(e){return arguments.length?(x=+e,M):x},M.nodePadding=function(e){return arguments.length?(b=+e,M):b},M.nodes=function(e){return arguments.length?(k="function"===typeof e?e:o(e),M):k},M.links=function(e){return arguments.length?(T="function"===typeof e?e:o(e),M):T},M.size=function(t){return arguments.length?(e=n=0,i=+t[0],v=+t[1],M):[i-e,v-n]},M.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],n=+t[0][1],v=+t[1][1],M):[[e,n],[i,v]]},M.iterations=function(e){return arguments.length?(S=+e,M):S},M},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,i)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=a,e.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,pg(),P_(),R_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),j_=p({"node_modules/elementary-circuits-directed-graph/johnson.js"(e,t){var r=M_();t.exports=function(e,t){var n,i=[],a=[],o=[],s={},l=[];function c(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&c(t)}))}function u(e){var t,r,i=!1;for(a.push(e),o[e]=!0,t=0;t=t}))}(t);for(var n,i=r(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o1||i>1)}function M(e,t,r){return e.sort(C),e.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&A(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;lo.source.column)){var c=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function E(e,r,i,a){var o=t.min(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),M(e.links.filter((function(e){return"top"==e.circularLinkType})),r,a),M(e.links.filter((function(e){return"bottom"==e.circularLinkType})),r,a),e.links.forEach((function(t){if(t.circular){if(t.circularPathData.arcRadius=t.width+w,t.circularPathData.leftNodeBuffer=5,t.circularPathData.rightNodeBuffer=5,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,H(t,a)&&A(t))t.circularPathData.leftSmallArcRadius=w+t.width/2,t.circularPathData.leftLargeArcRadius=w+t.width/2,t.circularPathData.rightSmallArcRadius=w+t.width/2,t.circularPathData.rightLargeArcRadius=w+t.width/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+_+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-_-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius);else{var s=t.source.column,l=t.circularLinkType,c=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==t.circularLinkType?c.sort(L):c.sort(P);var u=0;c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.leftSmallArcRadius=w+t.width/2+u,t.circularPathData.leftLargeArcRadius=w+t.width/2+n*r+u),u+=e.width})),s=t.target.column,c=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==t.circularLinkType?c.sort(z):c.sort(I),u=0,c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.rightSmallArcRadius=w+t.width/2+u,t.circularPathData.rightLargeArcRadius=w+t.width/2+n*r+u),u+=e.width})),"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(i,t.source.y1,t.target.y1)+_+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=o-_-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius)}t.circularPathData.leftInnerExtent=t.circularPathData.sourceX+t.circularPathData.leftNodeBuffer,t.circularPathData.rightInnerExtent=t.circularPathData.targetX-t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.sourceX+t.circularPathData.leftLargeArcRadius+t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.targetX-t.circularPathData.rightLargeArcRadius-t.circularPathData.rightNodeBuffer}if(t.circular)t.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(t);else{var h=n.linkHorizontal().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));t.path=h(t)}}))}function C(e,t){return O(e)==O(t)?"bottom"==e.circularLinkType?L(e,t):P(e,t):O(t)-O(e)}function P(e,t){return e.y0-t.y0}function L(e,t){return t.y0-e.y0}function I(e,t){return e.y1-t.y1}function z(e,t){return t.y1-e.y1}function O(e){return e.target.column-e.source.column}function R(e){return e.target.x0-e.source.x1}function D(e,t){var r=T(e),n=R(t)/Math.tan(r);return"up"==q(e)?e.y1+n:e.y1-n}function j(e,t){var r=T(e),n=R(t)/Math.tan(r);return"up"==q(e)?e.y1-n:e.y1+n}function F(e,t,r,n){e.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),p=3*u*Math.pow(1-u,2),d=3*Math.pow(u,2)*(1-u),f=Math.pow(u,3),m=h*i.y0+p*i.y0+d*i.y1+f*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&ga.y0&&i.y0a.y0&&i.y1a.y1)&&B(e,c,t,r)}))):(y>o.y0&&yo.y1)&&(c=y-o.y0+10,o=B(o,c,t,r),e.nodes.forEach((function(e){b(e,n)!=b(o,n)&&e.column==o.column&&e.y0o.y1&&B(e,c,t,r)})))}}))}}))}function B(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function N(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return b(e.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!V(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=j(t,e);return e.y1-r}if(t.target.column>e.target.column)return j(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!V(e,t))return e.y0-t.y0;if(t.source.column0?"up":"down"}function H(e,t){return b(e.source,t)==b(e.target,t)}e.sankeyCircular=function(){var e,n,a=0,b=0,T=1,A=1,M=24,C=g,P=o,L=y,I=v,z=32,O=2,R=null;function D(){var o={nodes:L.apply(null,arguments),links:I.apply(null,arguments)};!function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,C);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==("undefined"===typeof n?"undefined":l(n))&&(n=e.source=x(t,n)),"object"!==("undefined"===typeof i?"undefined":l(i))&&(i=e.target=x(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(o),function(e,t,r){var n=0;if(null===r){for(var a=[],o=0;o0;--u)y(c*=.99,s),v();function g(r){if(n){var o=1/0;l.forEach((function(e){var t=A*n/(e.length+1);o=t0?r+_+w:r,bottom:n=n>0?n+_+w:n,left:a=a>0?a+_+w:a,right:i=i>0?i+_+w:i}}(i),u=function(e,r){var n=t.max(e.nodes,(function(e){return e.column})),i=T-a,o=A-b,s=i+r.right+r.left,l=o+r.top+r.bottom,c=i/s,u=o/l;return a=a*c+r.left,T=0==r.right?T:T*c,b=b*u+r.top,A*=u,e.nodes.forEach((function(e){e.x0=a+e.column*((T-a-M)/n),e.x1=e.x0+M})),u}(i,c);s*=u,i.links.forEach((function(e){e.width=e.value*s})),l.forEach((function(e){var t=e.length;e.forEach((function(e,n){e.depth==l.length-1&&1==t||0==e.depth&&1==t?(e.y0=A/2-e.value*s,e.y1=e.y0+e.value*s):e.partOfCycle?0==S(e,r)?(e.y0=A/2+n,e.y1=e.y0+e.value*s):"top"==e.circularLinkType?(e.y0=b+n,e.y1=e.y0+e.value*s):(e.y0=A-e.value*s-n,e.y1=e.y0+e.value*s):0==c.top||0==c.bottom?(e.y0=(A-b)/t*n,e.y1=e.y0+e.value*s):(e.y0=(A-b)/2-t/2+n,e.y1=e.y0+e.value*s)}))}))}function y(e,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&S(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else{var l=t.mean(i.sourceLinks,m),c=t.mean(i.targetLinks,f),u=((l&&c?(l+c)/2:l||c)-d(i))*e;i.y0+=u,i.y1+=u}}))}))}function v(){l.forEach((function(t){var r,n,i,a=b,o=t.length;for(t.sort(h),i=0;i0&&(r.y0+=n,r.y1+=n),a=r.y1+e;if((n=a-e-A)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=t[i]).y1+e-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,C),j(o);for(var s=0;s<4;s++)N(o,A,C),U(o,0,C),F(o,b,A,C),N(o,A,C),U(o,0,C);return function(e,r,n){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=t.min(i,(function(e){return e.y0})),c=(n-r)/(t.max(i,(function(e){return e.y1}))-l);i.forEach((function(e){var t=(e.y1-e.y0)*c;e.y0=(e.y0-l)*c,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*c,e.y1=(e.y1-l)*c,e.width=e.width*c}))}}(o,b,A),E(o,O,A,C),o}function j(e){e.nodes.forEach((function(e){e.sourceLinks.sort(u),e.targetLinks.sort(c)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return D.nodeId=function(e){return arguments.length?(C="function"===typeof e?e:s(e),D):C},D.nodeAlign=function(e){return arguments.length?(P="function"===typeof e?e:s(e),D):P},D.nodeWidth=function(e){return arguments.length?(M=+e,D):M},D.nodePadding=function(t){return arguments.length?(e=+t,D):e},D.nodes=function(e){return arguments.length?(L="function"===typeof e?e:s(e),D):L},D.links=function(e){return arguments.length?(I="function"===typeof e?e:s(e),D):I},D.size=function(e){return arguments.length?(a=b=0,T=+e[0],A=+e[1],D):[T-a,A-b]},D.extent=function(e){return arguments.length?(a=+e[0][0],T=+e[1][0],b=+e[0][1],A=+e[1][1],D):[[a,b],[T,A]]},D.iterations=function(e){return arguments.length?(z=+e,D):z},D.circularLinkGap=function(e){return arguments.length?(O=+e,D):O},D.nodePaddingRatio=function(e){return arguments.length?(n=+e,D):n},D.sortNodes=function(e){return arguments.length?(R=e,D):R},D.update=function(e){return k(e,C),j(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y1o+f&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i}(v=S.nodes);I.forEach((function(e){var t,r,n,i=0,a=e.length;for(e.sort((function(e,t){return e.y0-t.y0})),n=0;n=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+d}))}n.update(S)}return{circular:_,key:r,trace:c,guid:h.randstr(),horizontal:p,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*e.width+e.margin.l,translateY:e.height-u.y[1]*e.height+e.margin.t,dragParallel:p?y:g,dragPerpendicular:p?g:y,arrangement:c.arrangement,sankey:n,graph:S,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(e,t,r){var n=l(t.color),i=l(t.hovercolor),a=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:M,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function M(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r="",n=e.width/2,i=e.circularPathData,a=i.sourceX+i.verticalBuffer0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-t)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-t)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-t-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-t+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-t-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+" L "+(i.targetX-t)+" "+(i.targetY+n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var i=e.link.source.x1,a=e.link.target.x0-t,o=n(i,a),s=o(.5),l=o(.5),c=e.link.y0-e.link.width/2,u=e.link.y0+e.link.width/2,h=e.link.y1-e.link.width/2,p=e.link.y1+e.link.width/2,d="M"+i+","+c,f="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+p+" "+s+","+u+" "+i+","+u,g=t>0?"L"+(a+t)+","+(h+e.link.width/2):"";return d+f+(g+="L"+a+","+p)+m+"Z"}}function E(e,t){var r=l(t.color),n=s.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),u="node_"+t.pointNumber;return t.group&&(u=h.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:u,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,u].join("_"),interactionState:e.interactionState,figure:e}}function C(e){e.attr("transform",(function(e){return p(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function P(e){e.call(C)}function L(e,t){e.call(P),t.attr("d",M())}function I(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function z(e){return e.link.width>1||e.linkLineWidth>0}function R(e){return p(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function D(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function j(e,t,n,a){var o=i.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(e){a._fullLayout._dragCover=e})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,B(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(e,t,n){!function(e){for(var t=0;t0&&n.forceLayouts[t].alpha(0)}}(0,t,i,n)).stop()}(0,o,i),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,F(r,i)}}))}(e,t,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),B(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(e.filter(N(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;t"),color:_(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:_(l,"bordercolor"),fontFamily:_(l,"font.family"),fontSize:_(l,"font.size"),fontColor:_(l,"font.color"),fontWeight:_(l,"font.weight"),fontStyle:_(l,"font.style"),fontVariant:_(l,"font.variant"),fontTextcase:_(l,"font.textcase"),fontLineposition:_(l,"font.lineposition"),fontShadow:_(l,"font.shadow"),nameLength:_(l,"namelength"),textAlign:_(l,"align"),idealAlign:r.event.x"),color:_(s,"bgcolor")||a.tinyColorHue,borderColor:_(s,"bordercolor"),fontFamily:_(s,"font.family"),fontSize:_(s,"font.size"),fontColor:_(s,"font.color"),fontWeight:_(s,"font.weight"),fontStyle:_(s,"font.style"),fontVariant:_(s,"font.variant"),fontTextcase:_(s,"font.textcase"),fontLineposition:_(s,"font.lineposition"),fontShadow:_(s,"font.shadow"),nameLength:_(s,"namelength"),textAlign:_(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e});p(w,.85),d(w)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(r.select(t).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(t,n,i){var a=n.node;a.originalEvent=r.event,e._hoverdata=[a],r.select(t).call(y,n,i),o.click(e,{target:!0})}}})}}}),V_=p({"src/traces/sankey/base_plot.js"(e){var t=Le().overrideAll,r=_t().getModuleCalcData,n=U_(),i=F(),a=pr(),o=hr(),s=Mn().prepSelect,l=st(),c=Ve(),u="sankey";function h(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var p={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},d={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},f={gd:e,element:h.node(),plotinfo:{id:t,xaxis:p,yaxis:d,fillRangeItems:l.noop},subplot:t,xaxes:[p],yaxes:[d],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;r0}function T(e){e.each((function(e){x.stroke(r.select(this),e.line.color)})).each((function(e){x.fill(r.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function S(e,t,r){var n=e._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(e,t){return a.coerce(i,o,y,e,t)}return f(i,o,l,s,n),g(i,o,l,s),o}function A(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function M(e,t,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",e).call(p.convertToTspans,i).call(u.font,t),u.bBox(o.node())}function E(e,t,r,n,i,o){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=a.aggNums(o,null,[e[s].value,n],2);return e[s].value=l,l}t.exports=function(e,t,f,m){var g,y=e._fullLayout;k(f)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,t,"trace").each((function(t){var m,v,C,P,L,I=t[0].trace,z=r.select(this),O=I._hasGauge,R=I._isAngular,D=I._isBullet,j=I.domain,F={w:y._size.w*(j.x[1]-j.x[0]),h:y._size.h*(j.y[1]-j.y[0]),l:y._size.l+y._size.w*j.x[0],r:y._size.r+y._size.w*(1-j.x[1]),t:y._size.t+y._size.h*(1-j.y[1]),b:y._size.b+y._size.h*j.y[0]},B=F.l+F.w/2,N=F.t+F.h/2,U=Math.min(F.w/2,F.h),V=h.innerRadius*U,q=I.align||"center";if(v=N,O){if(R&&(m=B,v=N+U/2,C=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}(e,.9*V)}),D){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=F.l+(G+(1-G)*_[q])*F.w,C=function(e){return A(e,(h.bulletNumberDomainSize-H)*F.w,F.h)}}}else m=F.l+_[q]*F.w,C=function(e){return A(e,F.w,F.h)};!function(e,t,n,l){var c,h,f,m=n[0].trace,g=l.numbersX,y=l.numbersY,v=m.align||"center",T=b[v],A=l.transitionOpts,C=l.onComplete,P=a.ensureSingle(t,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var I=P.selectAll("text").data(L);function z(t,r,n,i){if(!t.match("s")||n>=0===i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=S(e,{tickformat:a});return function(e){return Math.abs(e)<1?d.tickText(o,e).text:r(e)}}function O(){var t=S(e,{tickformat:m.number.valueformat},m._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},o=m.number.suffix,s=m.number.prefix,l=P.select("text.number");function h(){var t="number"===typeof n[0].y?s+a(n[0].y)+o:"-";l.text(t).call(u.font,m.number.font).call(p.convertToTspans,e)}return k(A)?l.transition().duration(A.duration).ease(A.easing).each("end",(function(){h(),C&&C()})).each("interrupt",(function(){h(),C&&C()})).attrTween("text",(function(){var e=r.select(this),t=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){e.text(s+l(t(r))+o)}})):h(),c=M(s+a(n[0].y)+o,m.number.font,T,e),l}function R(){var t=S(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},o=m.delta.suffix,s=m.delta.prefix,l=function(e){return m.delta.relative?e.relativeDelta:e.delta},c=function(e,t){return 0===e||"number"!==typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+t(e)+o},f=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=P.select("text.delta");function y(){g.text(c(l(n[0]),a)).call(x.fill,f(n[0])).call(p.convertToTspans,e)}return g.call(u.font,m.delta.font).call(x.fill,f({delta:m._deltaLastValue})),k(A)?g.transition().duration(A.duration).ease(A.easing).tween("text",(function(){var e=r.select(this),t=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,t),u=i(o,t);return m._deltaLastValue=t,function(t){e.text(c(u(t),s)),e.call(x.fill,f({delta:u(t)}))}})).each("end",(function(){y(),C&&C()})).each("interrupt",(function(){y(),C&&C()})):y(),h=M(c(l(n[0]),a),m.delta.font,T,e),g}I.enter().append("text"),I.attr("text-anchor",(function(){return T})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var D,j=m.mode+m.align;if(m._hasDelta&&(D=R(),j+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,j+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=h),m._hasNumber&&(O(),j+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c),m._hasDelta&&m._hasNumber){var F,B,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],U=[(h.left+h.right)/2,(h.top+h.bottom)/2],V=.75*m.delta.font.size;"left"===m.delta.position&&(F=E(m,"deltaPos",0,-1*(c.width*_[m.align]+h.width*(1-_[m.align])+V),j,Math.min),B=N[1]-U[1],f={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:h.left+F,right:c.right,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"right"===m.delta.position&&(F=E(m,"deltaPos",0,c.width*(1-_[m.align])+h.width*_[m.align]+V,j,Math.max),B=N[1]-U[1],f={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:c.left,right:h.right+F,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"bottom"===m.delta.position&&(F=null,B=h.height,f={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(F=null,B=c.top,f={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),D.attr({dx:F,dy:B})}(m._hasNumber||m._hasDelta)&&P.attr("transform",(function(){var e=l.numbersScaler(f);j+=e[2];var t,r=E(m,"numbersScale",1,e[0],j,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?y-r*f.bottom:y-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+t;var n=f[v];"center"===v&&(n=(f.left+f.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,j,Math.max),s(i,t)+o(r)}))}(e,z,t,{numbersX:m,numbersY:v,numbersScaler:C,transitionOpts:f,onComplete:g}),O&&(P={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},L={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var W=z.selectAll("g.angular").data(R?t:[]);W.exit().remove();var $=z.selectAll("g.angularaxis").data(R?t:[]);$.exit().remove(),R&&function(e,t,i,a){var o,u,h,p,f=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,w=a.layer,A=a.transitionOpts,M=a.onComplete,E=Math.PI/2;function C(e){var t=f.gauge.axis.range[0],r=(e-t)/(f.gauge.axis.range[1]-t)*Math.PI-E;return r<-E?-E:r>E?E:r}function P(e){return r.svg.arc().innerRadius((y+g)/2-e/2*(g-y)).outerRadius((y+g)/2+e/2*(g-y)).startAngle(-E)}function L(e){e.attr("d",(function(e){return P(e.thickness).startAngle(C(e.range[0])).endAngle(C(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=S(e,f.gauge.axis)).type="linear",o.range=f.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},O=d.makeLabelFns(o,0).labelStandoff;z.xFn=function(e){var t=I(e);return Math.cos(t)*O},z.yFn=function(e){var t=I(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(O+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},z.anchorFn=function(e){var t=I(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(e,t,r){var n=I(e);return-.5*(1+Math.sin(n))*r};var R=function(e){return s(b[0]+g*Math.cos(e),b[1]-g*Math.sin(e))};h=function(e){return R(I(e))};var D=function(e){var t=I(e);return R(t)+"rotate("+-l(t)+")"};if(u=d.calcTicks(o),p=d.getTickSigns(o)[2],o.visible){p="inside"===o.ticks?-1:1;var j=(o.linewidth||1)/2;d.drawTicks(e,o,{vals:u,layer:w,path:"M"+p*j+",0h"+p*o.ticklen,transFn:D}),d.drawLabels(e,o,{vals:u,layer:w,transFn:h,labelFns:z})}var F=[v].concat(f.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(T),B.exit().remove();var N=P(f.gauge.bar.thickness),U=_.selectAll("g.value-arc").data([f.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var V,q,H,G=U.select("path");k(A)?(G.transition().duration(A.duration).ease(A.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attrTween("d",(V=N,q=C(i[0].lastY),H=C(i[0].y),function(){var e=n(q,H);return function(t){return V.endAngle(e(t))()}})),f._lastValue=i[0].y):G.attr("d","number"===typeof i[0].y?N.endAngle(C(i[0].y)):"M0,0Z"),G.call(T),U.exit().remove(),F=[];var W=f.gauge.threshold.value;(W||0===W)&&F.push({range:[W,W],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var $=_.selectAll("g.threshold-arc").data(F);$.enter().append("g").classed("threshold-arc",!0).append("path"),$.select("path").call(L).call(T),$.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(L).call(T),Z.exit().remove()}(e,0,t,{radius:U,innerRadius:V,gauge:W,layer:$,size:F,gaugeBg:P,gaugeOutline:L,transitionOpts:f,onComplete:g});var Z=z.selectAll("g.bullet").data(D?t:[]);Z.exit().remove();var X=z.selectAll("g.bulletaxis").data(D?t:[]);X.exit().remove(),D&&function(e,t,r,n){var i,a,o,l,c,u=r[0].trace,p=n.gauge,f=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,v=u.domain,b=n.transitionOpts,_=n.onComplete;p.enter().append("g").classed("bullet",!0),p.attr("transform",s(y.l,y.t)),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,A=u.gauge.bar.thickness*w,M=v.x[0],E=v.x[0]+(v.x[1]-v.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function C(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*w})).attr("height",(function(e){return e.thickness*w}))}(i=S(e,u.gauge.axis))._id="xbulletaxis",i.domain=[M,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),l=d.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(d.drawTicks(e,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:f,path:d.makeTickPath(i,c,l),transFn:o}),d.drawLabels(e,i,{vals:a,layer:f,transFn:o,labelFns:d.makeLabelFns(i,c)}));var P=[m].concat(u.gauge.steps),L=p.selectAll("g.bg-bullet").data(P);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(T),L.exit().remove();var I=p.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",A).attr("y",(w-A)/2).call(T),k(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),I.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),O=p.selectAll("g.threshold-bullet").data(z);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(x.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),O.exit().remove();var R=p.selectAll("g.gauge-outline").data([g]);R.enter().append("g").classed("gauge-outline",!0).append("rect"),R.select("rect").call(C).call(T),R.exit().remove()}(e,0,t,{gauge:Z,layer:X,size:F,gaugeBg:P,gaugeOutline:L,transitionOpts:f,onComplete:g});var Y=z.selectAll("text.title").data(t);Y.exit().remove(),Y.enter().append("text").classed("title",!0),Y.attr("text-anchor",(function(){return D?b.right:b[I.title.align]})).text(I.title.text).call(u.font,I.title.font).call(p.convertToTspans,e),Y.attr("transform",(function(){var e,t=F.l+F.w*_[I.title.align],r=h.titlePadding,n=u.bBox(Y.node());return O?(R&&(e=I.gauge.axis.visible?u.bBox($.node()).top-r-n.bottom:F.t+F.h/2-U/2-n.bottom-r),D&&(e=v-(n.top+n.bottom)/2,t=F.l-h.bulletPadding*F.w)):e=I._numbersTop-r-n.bottom,s(t,e)}))}))}}}),J_=p({"src/traces/indicator/index.js"(e,t){t.exports={moduleType:"trace",name:"indicator",basePlotModule:W_(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:$_(),supplyDefaults:X_().supplyDefaults,calc:Y_().calc,plot:K_(),meta:{}}}}),Q_=p({"lib/indicator.js"(e,t){t.exports=J_()}}),ew=p({"src/traces/table/attributes.js"(e,t){var r=xn(),n=R().extendFlat,i=Le().overrideAll,a=D(),o=ka().attributes,s=Et().descriptionOnlyNumbers;t.exports=i({domain:o({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:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.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:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.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:n({},a({arrayOk:!0}))}},"calc","from-root")}}),tw=p({"src/traces/table/defaults.js"(e,t){var r=st(),n=ew(),i=ka().defaults;t.exports=function(e,t,a,o){function s(i,a){return r.coerce(e,t,n,i,a)}i(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s",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"}}}}),iw=p({"src/traces/table/data_preparation_helper.js"(e,t){var r=nw(),n=R().extendFlat,i=k(),a=M().isTypedArray,o=M().isArrayOrTypedArray;function s(e){if(o(e)){for(var t=0,r=0;r=t||c===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}t.exports=function(e,t){var a=c(t.cells.values),f=function(e){return e.slice(t.header.values.length,e.length)},m=c(t.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(f(a).map((function(){return u((m[0]||[""]).length)}))),y=t.domain,v=Math.floor(e._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(e._fullLayout._size.h*(y.y[1]-y.y[0])),b=t.header.values.length?g[0].map((function(){return t.header.height})):[r.emptyHeaderHeight],_=a.length?a[0].map((function(){return t.cells.height})):[],w=b.reduce(l,0),k=d(_,x-w+r.uplift),T=p(d(b,w),[]),S=p(k,T),A={},M=t._fullInput.columnorder;o(M)&&(M=Array.from(M)),M=M.concat(f(a.map((function(e,t){return t}))));var E=g.map((function(e,r){var n=o(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return i(n)?Number(n):1})),C=E.reduce(l,0);E=E.map((function(e){return e/C*v}));var P=Math.max(s(t.header.line.width),s(t.cells.line.width)),L={key:t.uid+e._context.staticPlot,translateX:y.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-y.y[1]),size:e._fullLayout._size,width:v,maxLineWidth:P,height:x,columnOrder:M,groupHeight:x,rowBlocks:S,headerRowBlocks:T,scrollY:0,cells:n({},t.cells,{values:a}),headerCells:n({},t.header,{values:g}),gdColumns:g.map((function(e){return e[0]})),gdColumnsOriginalOrder:g.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(e,t){var r=A[e];return A[e]=(r||0)+1,{key:e+"__"+A[e],label:e,specIndex:t,xIndex:M[t],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[t]}}))};return L.columns.forEach((function(e){e.calcdata=L,e.x=h(e)})),L}}}),aw=p({"src/traces/table/data_split_helpers.js"(e){var t=R().extendFlat;e.splitToPanels=function(e){var r=[0,0],n=t({},e,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:t({},e.calcdata,{cells:e.calcdata.headerCells})});return[t({},e,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),t({},e,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n]},e.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}}}),ow=p({"src/traces/table/plot.js"(e,t){var r=nw(),n=v(),i=st(),a=i.numberFormat,o=Ox(),s=Jt(),l=At(),c=st().raiseToTop,u=st().strTranslate,h=st().cancelTransition,p=iw(),d=aw(),f=q();function m(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function g(e,t){return"clip"+e._fullLayout._uid+"_scrollAreaBottomClip_"+t.key}function y(e,t){return"clip"+e._fullLayout._uid+"_columnBoundaryClippath_"+t.calcdata.key+"_"+t.specIndex}function x(e){return[].concat.apply([],e.map((function(e){return e}))).map((function(e){return e.__data__}))}function b(e,t,i){var a=e.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(e){var t=e.scrollbarState;t.totalHeight=function(e){var t=e.rowBlocks;return D(t,t.length-1)+(t.length?j(t[t.length-1],1/0):1)}(e),t.scrollableAreaHeight=e.groupHeight-E(e),t.currentlyVisibleHeight=Math.min(t.totalHeight,t.scrollableAreaHeight),t.ratio=t.currentlyVisibleHeight/t.totalHeight,t.barLength=Math.max(t.ratio*t.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),t.barWiggleRoom=t.currentlyVisibleHeight-t.barLength,t.wiggleRoom=Math.max(0,t.totalHeight-t.scrollableAreaHeight),t.topY=0===t.barWiggleRoom?0:e.scrollY/t.wiggleRoom*t.barWiggleRoom,t.bottomY=t.topY+t.barLength,t.dragMultiplier=t.wiggleRoom/t.barWiggleRoom})).attr("transform",(function(e){var t=e.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(t,E(e))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(e){return u(0,e.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(e){return e.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(e){return e.columnDragInProgress||!e.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||P(t,e,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(e){return n.event.stopPropagation(),e.scrollbarState.scrollbarScrollInProgress=!0,e})).on("drag",P(t,e)).on("dragend",(function(){}))),h.attr("y2",(function(e){return e.scrollbarState.scrollableAreaHeight})),t._context.staticPlot&&(c.remove(),h.remove())}function _(e,t,i,a){var l=function(e){var t=e.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return t.enter().append("g").classed(r.cn.columnCells,!0),t.exit().remove(),t}(i),c=function(e){var t=e.selectAll("."+r.cn.columnCell).data(d.splitToCells,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(r.cn.columnCell,!0),t.exit().remove(),t}(l);!function(e){e.each((function(e,t){var r=e.calcdata.cells.font,n=e.column.specIndex,i={size:T(r.size,n,t),color:T(r.color,n,t),family:T(r.family,n,t),weight:T(r.weight,n,t),style:T(r.style,n,t),variant:T(r.variant,n,t),textcase:T(r.textcase,n,t),lineposition:T(r.lineposition,n,t),shadow:T(r.shadow,n,t)};e.rowNumber=e.key,e.align=T(e.calcdata.cells.align,n,t),e.cellBorderWidth=T(e.calcdata.cells.line.width,n,t),e.font=i}))}(c);var u=function(e){var t=e.selectAll("."+r.cn.cellRect).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("rect").classed(r.cn.cellRect,!0),t}(c);!function(e){e.attr("width",(function(e){return e.column.columnWidth})).attr("stroke-width",(function(e){return e.cellBorderWidth})).each((function(e){var t=n.select(this);f.stroke(t,T(e.calcdata.cells.line.color,e.column.specIndex,e.rowNumber)),f.fill(t,T(e.calcdata.cells.fill.color,e.column.specIndex,e.rowNumber))}))}(u);var h=function(e){var t=e.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),t}(c),p=function(e){var t=e.selectAll("."+r.cn.cellText).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),t}(h);!function(e){e.each((function(e){s.font(n.select(this),e.font)}))}(p),w(p,t,a,e),R(c)}function w(e,t,i,o){e.text((function(e){var t=e.column.specIndex,n=e.rowNumber,i=e.value,o="string"===typeof i,s=o&&i.match(/
/i),l=!o||s;e.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"===typeof(c=i)&&c.match(r.latexCheck);e.latex=u;var h,p,d=u?"":T(e.calcdata.cells.prefix,t,n)||"",f=u?"":T(e.calcdata.cells.suffix,t,n)||"",m=u?null:T(e.calcdata.cells.format,t,n)||null,g=d+(m?a(m)(e.value):e.value)+f;if(e.wrappingNeeded=!e.wrapped&&!l&&!u&&(h=k(g)),e.cellHeightMayIncrease=s||u||e.mayHaveMarkup||(void 0===h?k(g):h),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var y=(" "===r.wrapSplitCharacter?g.replace(/i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),t.each((function(e,t){e.page=c[t],e.scrollY=l})),t.attr("transform",(function(e){var t=D(e.rowBlocks,e.page)-e.scrollY;return u(0,t)})),e&&(L(e,r,t,c,n.prevPages,n,0),L(e,r,t,c,n.prevPages,n,1),b(r,e))}}function P(e,t,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(A);return C(e,h,l),s.scrollY===u}}function L(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));_(e,t,a,r),i[o]=n[o]})))}function I(e,t,i,a){return function(){var o=n.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var n,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],c=0,u=e.column.columnWidth-2*r.cellPad;for(e.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(e.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(e.value+=l.join(r.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,e,a),n.select(t.parentNode.parentNode).call(R)}}function z(e,t,i,a,o){return function(){if(!o.settledY){var s=n.select(t.parentNode),l=B(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,p=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*r.cellPad:h,d=Math.max(p,h);d-l.rows[c].rowHeight&&(l.rows[c].rowHeight=d,e.selectAll("."+r.cn.columnCell).call(R),C(null,e.filter(A),0),b(i,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),i=n.select(e.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=i.top-t.top+(a?a.matrix.f:r.cellPad);return u(O(o,n.select(e.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function O(e,t){switch(e.align){case"left":default:return r.cellPad;case"right":return e.column.columnWidth-(t||0)-r.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function R(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+j(t,1/0)}),0),r=j(B(e),e.key);return u(0,r+t)})).selectAll("."+r.cn.cellRect).attr("height",(function(e){return(t=B(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function D(e,t){for(var r=0,n=t-1;n>=0;n--)r+=F(e[n]);return r}function j(e,t){for(var r=0,n=0;nt.length&&(e=e.slice(0,t.length)):e=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:e.c2p(n,t,r),offsetMultplier:c}}}}),xw=p({"src/traces/carpet/plot.js"(e,t){var r=v(),n=Jt(),i=gw(),a=yw(),o=vw(),s=At(),l=st(),c=l.strRotate,u=l.strTranslate,h=St();function p(e,t,o,s,l,c,u){var h="const-"+l+"-lines",p=o.selectAll("."+h).data(c);p.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),p.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,e.c2p),h=i([],c,t.c2p),p="M"+a(u,h,s.smoothing);r.select(this).attr("d",p).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),p.exit().remove()}function d(e,t,i,a,l,h,p,d){var f=h.selectAll("text."+d).data(p);f.enter().append("text").classed(d,!0);var m=0,g={};return f.each((function(l,h){var p;if("auto"===l.axis.tickangle)p=o(a,t,i,l.xy,l.dxy);else{var d=(l.axis.tickangle+180)*Math.PI/180;p=o(a,t,i,l.xy,[Math.cos(d),Math.sin(d)])}h||(g={angle:p.angle,flip:p.flip});var f=(l.endAnchor?-1:1)*p.flip,y=r.select(this).attr({"text-anchor":f>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,e),v=n.bBox(this);y.attr("transform",u(p.p[0],p.p[1])+c(p.angle)+u(l.axis.labelpadding*f,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),f.exit().remove(),g.maxExtent=m,g}t.exports=function(e,t,n,s){var c=e._context.staticPlot,u=t.xaxis,h=t.yaxis,f=e._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(t){var n=r.select(this),s=t[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),b=l.ensureSingle(n,"g","majorlayer"),_=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),p(u,h,b,0,"a",y._gridlines,!0),p(u,h,b,0,"b",v._gridlines,!0),p(u,h,x,0,"a",y._minorgridlines,!0),p(u,h,x,0,"b",v._minorgridlines,!0),p(u,h,_,0,"a-boundary",y._boundarylines,c),p(u,h,_,0,"b-boundary",v._boundarylines,c);var k=d(e,u,h,m,0,w,y._labels,"a-label"),T=d(e,u,h,m,0,w,v._labels,"b-label");!function(e,t,r,n,i,a,s,c){var u,h,p,d,f=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(f+m),h=y,p=r.ab2xy(u,h,!0),d=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,p,r.dxydb_rough(u,h))),g(e,t,r,0,p,d,r.aaxis,i,a,s,"a-title"),u=f,h=.5*(y+v),p=r.ab2xy(u,h,!0),d=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,p,r.dxyda_rough(u,h))),g(e,t,r,0,p,d,r.baxis,i,a,c,"b-title")}(e,w,m,0,u,h,k,T),function(e,t,r,n,o){var s,c,u,h,p=r.select("#"+e._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var d=l.ensureSingle(p,"path","carpetboundary"),f=t.clipsegments,m=[];for(h=0;h90&&v<270,b=r.select(this);b.text(p.title.text).call(s.convertToTspans,e),x&&(_=(-s.lineCount(b)+m)*f*a-_),b.attr("transform",u(t.p[0],t.p[1])+c(t.angle)+u(0,_)).attr("text-anchor","middle").call(n.font,p.title.font)})),b.exit().remove()}}}),bw=p({"src/traces/carpet/cheater_basis.js"(e,t){var r=st().isArrayOrTypedArray;t.exports=function(e,t,n){var i,a,o,s,l,c,u=[],h=r(e)?e.length:e,p=r(t)?t.length:t,d=r(e)?e:null,f=r(t)?t:null;d&&(o=(d.length-1)/(d[d.length-1]-d[0])/(h-1)),f&&(s=(f.length-1)/(f[f.length-1]-f[0])/(p-1));var m=1/0,g=-1/0;for(a=0;a=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s0&&(d=e.dxydi([],n-1,o,0,s),y.push(l[0]+d[0]/3),v.push(l[1]+d[1]/3),f=e.dxydi([],n-1,o,1,s),y.push(h[0]-f[0]/3),v.push(h[1]-f[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=e.a2i(r),c=Math.floor(Math.max(0,Math.min(P-2,n))),u=n-c,x.length=P,x.crossLength=L,x.xy=function(t){return e.evalxy([],n,t)},x.dxy=function(t,r){return e.dxydj([],c,t,u,r)},a=0;a0&&(m=e.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=e.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=t,x.axis=b,x.crossAxis=S,x.value=r,x.constvar=i,x.index=p,x.x=y,x.y=v,x.smoothing=S.smoothing,x}function O(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=T.length,"b"===t)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(t){return e.evalxy([],t,r)},h.dxy=function(t,r){return e.dxydi([],t,o,r,l)},n=0;nx.length-1||_.push(n(O(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(p=u;px.length-1)&&!(m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;ax[x.length-1]||w.push(n(z(f),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(n(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(n(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(e,t){return e-t})))[0],h=c[1],p=u;p<=h;p++)d=b.tick0+b.dtick*p,_.push(n(z(d),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(p=u-1;px[x.length-1]||w.push(n(z(f),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(n(z(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(n(z(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}}}),kw=p({"src/traces/carpet/calc_labels.js"(e,t){var r=nr(),n=R().extendFlat;t.exports=function(e,t){var i,a,o,s=t._labels=[],l=t._gridlines;for(i=0;i=0;i--)a[u-i]=e[h][i],o[u-i]=t[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=e[i][0],o[h-i]=t[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),Sw=p({"src/traces/carpet/smooth_fill_2d_array.js"(e,t){var r=st();t.exports=function(e,t,n){var i,a,o,s=[],l=[],c=e[0].length,u=e.length;function h(t,r){var n,i=0,a=0;return t>0&&void 0!==(n=e[r][t-1])&&(a++,i+=n),t0&&void 0!==(n=e[r-1][t])&&(a++,i+=n),r0&&a0&&i1e-5);return r.log("Smoother converged to",T,"after",S,"iterations"),e}}}),Aw=p({"src/traces/carpet/constants.js"(e,t){t.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Mw=p({"src/traces/carpet/catmull_rom.js"(e,t){t.exports=function(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,p=c*(l+c)*3,d=l*(l+c)*3;return[[t[0]+(p&&u/p),t[1]+(p&&h/p)],[t[0]-(d&&u/d),t[1]-(d&&h/d)]]}}}),Ew=p({"src/traces/carpet/compute_control_points.js"(e,t){var r=Mw(),n=st().ensureArray;function i(e,t,r){var n=-.5*r[0]+1.5*t[0],i=-.5*r[1]+1.5*t[1];return[(2*n+e[0])/3,(2*i+e[1])/3]}t.exports=function(e,t,a,o,s,l){var c,u,h,p,d,f,m,g,y,v,x=a[0].length,b=a.length,_=s?3*x-2:x,w=l?3*b-2:b;for(e=n(e,w),t=n(t,w),h=0;hd&&em&&tf||tg},e.setScale=function(){var t=e._x,r=e._y,n=i(e._xctrl,e._yctrl,t,r,h.smoothing,p.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=a([e._xctrl,e._yctrl],c,u,h.smoothing,p.smoothing),e.dxydi=o([e._xctrl,e._yctrl],h.smoothing,p.smoothing),e.dxydj=s([e._xctrl,e._yctrl],h.smoothing,p.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),c-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),c-2),r=e[1]-t;return(1-r)*l[t]+r*l[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(n(e,t),c-2)),i=t[r],a=t[r+1];return Math.max(0,Math.min(c-1,r+(e-i)/(a-i)))},e.b2j=function(e){var t=Math.max(0,Math.min(n(e,l),u-2)),r=l[t],i=l[t+1];return Math.max(0,Math.min(u-1,t+(e-r)/(i-r)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(r,n,i){if(!i&&(rt[c-1]|nl[u-1]))return[!1,!1];var a=e.a2i(r),o=e.b2j(n),s=e.evalxy([],a,o);if(i){var h,p,d,f,m=0,g=0,y=[];rt[c-1]?(h=c-2,p=1,m=(r-t[c-1])/(t[c-1]-t[c-2])):p=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),nl[u-1]?(d=u-2,f=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):f=o-(d=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(e.dxydi(y,h,d,p,f),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(e.dxydj(y,h,d,p,f),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(l.length-2,e));return l[t+1]-l[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=v*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}}}),zw=p({"src/traces/carpet/calc.js"(e,t){var r=nr(),n=st().isArray1D,i=bw(),a=_w(),o=ww(),s=kw(),l=Tw(),c=Io(),u=Sw(),h=Lo(),p=Iw();t.exports=function(e,t){var d=r.getFromId(e,t.xaxis),f=r.getFromId(e,t.yaxis),m=t.aaxis,g=t.baxis,y=t.x,v=t.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(t,m,g,"a","b",x);var b=t._a=t._a||t.a,_=t._b=t._b||t.b;y=t._x||t.x,v=t._y||t.y;var w={};if(t._cheater){var k="index"===m.cheatertype?b.length:b,T="index"===g.cheatertype?_.length:_;y=i(k,T,t.cheaterslope)}t._x=y=c(y),t._y=v=c(v),u(y,b,_),u(v,b,_),p(t),t.setScale();var S=a(y),A=a(v),M=.5*(S[1]-S[0]),E=.5*(S[1]+S[0]),C=.5*(A[1]-A[0]),P=.5*(A[1]+A[0]),L=1.3;return S=[E-M*L,E+M*L],A=[P-C*L,P+C*L],t._extremes[d._id]=r.findExtremes(d,S,{padded:!0}),t._extremes[f._id]=r.findExtremes(f,A,{padded:!0}),o(t,"a","b"),o(t,"b","a"),s(t,m),s(t,g),w.clipsegments=l(t._xctrl,t._yctrl,m,g),w.x=y,w.y=v,w.a=b,w.b=_,[w]}}}),Ow=p({"src/traces/carpet/index.js"(e,t){t.exports={attributes:hw(),supplyDefaults:mw(),plot:xw(),calc:zw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Rw=p({"lib/carpet.js"(e,t){t.exports=Ow()}}),Dw=p({"src/traces/scattercarpet/attributes.js"(e,t){var r=_n(),n=wn(),i=N(),a=Oe().hovertemplateAttrs,o=Oe().texttemplateAttrs,s=Lt(),l=R().extendFlat,c=n.marker,u=n.line,h=c.line;t.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}}),jw=p({"src/traces/scattercarpet/defaults.js"(e,t){var r=st(),n=bn(),i=$t(),a=Wn(),o=$n(),s=Zn(),l=Xn(),c=Yn(),u=Dw();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}d("carpet"),t.xaxis="x",t.yaxis="y";var f=d("a"),m=d("b"),g=Math.min(f.length,m.length);if(g){t._length=g,d("text"),d("texttemplate"),d("hovertext"),d("mode",g")}return o}function v(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,g.push(r+": "+t.toFixed(3)+e.labelsuffix)}}}}),qw=p({"src/traces/scattercarpet/event_data.js"(e,t){t.exports=function(e,t,r,n,i){var a=n[i];return e.a=a.a,e.b=a.b,e.y=a.y,e}}}),Hw=p({"src/traces/scattercarpet/index.js"(e,t){t.exports={attributes:Dw(),supplyDefaults:jw(),colorbar:pi(),formatLabels:Fw(),calc:Nw(),plot:Uw(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Vw(),selectPoints:yi(),eventData:qw(),moduleType:"trace",name:"scattercarpet",basePlotModule:Ai(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Gw=p({"lib/scattercarpet.js"(e,t){t.exports=Hw()}}),Ww=p({"src/traces/contourcarpet/attributes.js"(e,t){var r=bo(),n=ss(),i=Lt(),a=R().extendFlat,o=n.contours;t.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),$w=p({"src/traces/contourcarpet/defaults.js"(e,t){var r=st(),n=_o(),i=Ww(),a=Ps(),o=cs(),s=hs();t.exports=function(e,t,l,c){function u(n,a){return r.coerce(e,t,i,n,a)}if(u("carpet"),e.a&&e.b){if(!n(e,t,u,c,"a","b"))return void(t.visible=!1);u("text"),"constraint"===u("contours.type")?a(e,t,u,c,l,{hasHover:!1}):(o(e,t,u,(function(n){return r.coerce2(e,t,i,n)})),s(e,t,u,c,{hasHover:!1}))}else t._defaultColor=l,t._length=null;u("zorder")}}}),Zw=p({"src/traces/contourcarpet/calc.js"(e,t){var r=Gt(),n=st(),i=Lo(),a=Io(),o=zo(),s=Oo(),l=Ro(),c=$w(),u=Bw(),h=ds();t.exports=function(e,t){var p=t._carpetTrace=u(e,t);if(p&&p.visible&&"legendonly"!==p.visible){if(!t.a||!t.b){var d=e.data[p.index],f=e.data[t.index];f.a||(f.a=d.a),f.b||(f.b=d.b),c(f,t,t._defaultColor,e._fullLayout)}var m=function(e,t){var c,u,h,p,d,f,m,g=t._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(t.z)&&i(t,y,v,"a","b",["z"]),c=t._a=t._a||t.a,p=t._b=t._b||t.b,c=c?y.makeCalcdata(t,"_a"):[],p=p?v.makeCalcdata(t,"_b"):[],u=t.a0||0,h=t.da||1,d=t.b0||0,f=t.db||1,m=t._z=a(t._z||t.z,t.transpose),t._emptypoints=s(m),o(m,t._emptypoints);var x=n.maxRowLength(m),b="scaled"===t.xtype?"":c,_=l(t,b,u,h,x,y),w="scaled"===t.ytype?"":p,k=l(t,w,d,f,m.length,v),T={a:_,b:k,z:m};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&r(e,t,{vals:m,containerStr:"",cLetter:"z"}),[T]}(e,t);return h(t,t._z),m}}}}),Xw=p({"src/traces/carpet/axis_aligned_line.js"(e,t){var r=st().isArrayOrTypedArray;t.exports=function(e,t,n,i){var a,o,s,l,c,u,h,p,d,f,m,g,y,v=r(n)?"a":"b",x=("a"===v?e.aaxis:e.baxis).smoothing,b="a"===v?e.a2i:e.b2j,_="a"===v?n:i,w="a"===v?i:n,k="a"===v?t.a.length:t.b.length,T="a"===v?t.b.length:t.a.length,S=Math.floor("a"===v?e.b2j(w):e.a2i(w)),A="a"===v?function(t){return e.evalxy([],t,S)}:function(t){return e.evalxy([],S,t)};x&&(s=Math.max(0,Math.min(T-2,S)),l=S-s,o="a"===v?function(t,r){return e.dxydi([],t,s,r,l)}:function(t,r){return e.dxydj([],s,t,l,r)});var M=b(_[0]),E=b(_[1]),C=M0?Math.floor:Math.ceil,I=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,O=C>0?Math.max:Math.min,R=L(M+P),D=I(E-P),j=[[h=A(M)]];for(a=R;a*C=0;N--)j=A.clipsegments[N],F=n([],j.x,_.c2p),B=n([],j.y,w.c2p),F.reverse(),B.reverse(),V.push(i(F,B,j.bicubic));var q="M"+V.join("L")+"Z";!function(e,t,r,a,s,l){var c,u,h,p,d=o.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);d.enter().append("path"),d.exit().remove();var f=[];for(p=0;p=0&&(p=C,f=g):Math.abs(h[1]-p[1])=0&&(p=C,f=g):o.log("endpt to newendpt is not vert. or horz.",h,p,C)}if(f>=0)break;v+=M(h,p),h=p}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}u=f,(b=-1===x.indexOf(u))&&(u=x[0],v+=M(h,p)+"Z",h=null)}for(u=0;um&&(n.max=m),n.len=n.max-n.min}function v(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)y):g=S>w,y=S;var A=c(w,k,T,S);A.pos=_,A.yc=(w+S)/2,A.i=b,A.dir=g?"increasing":"decreasing",A.x=A.pos,A.y=[T,k],v&&(A.orig_p=a[b]),f&&(A.tx=t.text[b]),m&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[l._id]=i.findExtremes(l,r.concat(p,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(e,"open:")+" ",high:n(e,"high:")+" ",low:n(e,"low:")+" ",close:n(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var n=i.getFromId(e,t.xaxis),o=i.getFromId(e,t.yaxis),c=function(e,t,n){var i=n._minDiff;if(!i){var o,s=e._fullData,l=[];for(i=1/0,o=0;o"+u.labels[x]+r.hoverLabelText(s,b,l.yhoverformat):((v=n.extendFlat({},p)).y0=v.y1=_,v.yLabelVal=b,v.yLabel=u.labels[x]+r.hoverLabelText(s,b,l.yhoverformat),v.name="",h.push(v),g[b]=v)}return h}function h(e,t,n,i){var a=e.cd,s=e.ya,u=a[0].trace,h=a[0].t,p=c(e,t,n,i);if(!p)return[];var d=a[p.index],f=p.index=d.i,m=d.dir;function g(e){return h.labels[e]+r.hoverLabelText(s,u[e][f],u.yhoverformat)}var y=d.hi||u.hoverinfo,v=y.split("+"),x="all"===y,b=x||-1!==v.indexOf("y"),_=x||-1!==v.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return _&&o(d,u,w),p.extraText=w.join("
"),p.y0=p.y1=s.c2p(d.yc,!0),[p]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?u(e,t,r,n):h(e,t,r,n)},hoverSplit:u,hoverOnPoints:h}}}),ok=p({"src/traces/ohlc/select.js"(e,t){t.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;rn?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var n=e.type;if("linear"===n){var o=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?i(e):e}(o(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?a(e):e}(e,t))}}e.makeCalcdata=function(t,r){var n,i,a=t[r],o=t._length,s=function(r){return e.d2c(r,t.thetaunit)};if(a)for(n=new Array(o),i=0;i1e-10?e:0}function h(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a0?r:1/0})),a=r.mod(n+1,t.length);return[t[n],t[a]]},findIntersectionXY:l,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,t*c+i+n],[u,t*u+i+n]]},clampTiny:u,pathPolygon:function(e,t,r,n,i,a){return"M"+h(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e0?1:0}function n(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function i(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function a(e,t){return t*e.radius}t.exports={smith:n,reactanceArc:function(e,t,r,o){var s=i(e,n([r,t])),l=s[0],c=s[1],u=i(e,n([o,t])),h=u[0],p=u[1];if(0===t)return["M"+l+","+c,"L"+h+","+p].join(" ");var d=a(e,1/Math.abs(t));return["M"+l+","+c,"A"+d+","+d+" 0 0,"+(t<0?1:0)+" "+h+","+p].join(" ")},resistanceArc:function(e,t,o,s){var l=a(e,1/(t+1)),c=i(e,n([t,o])),u=c[0],h=c[1],p=i(e,n([t,s])),d=p[0],f=p[1];if(r(o)!==r(s)){var m=i(e,n([t,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0=90||l>90&&c>=450?1:h<=0&&d<=0?0:Math.max(h,d),t=l<=180&&c>=180||l>180&&c>=540?-1:u>=0&&p>=0?0:Math.min(u,p),r=l<=270&&c>=270||l>270&&c>=630?-1:h>=0&&d>=0?0:Math.min(h,d),n=c>=360?1:u<=0&&p<=0?0:Math.max(u,p),[t,r,n,i]}(f),_=b[2]-b[0],w=b[3]-b[1],k=d/p,T=Math.abs(w/_);k>T?(m=p,x=(d-(g=p*T))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=d,x=(p-(m=d/T))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var S,A=r.xOffset2=i.l+i.w*y[0],M=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/_,C=r.innerRadius=r.getHole(t)*E,P=r.cx=A-E*b[0],L=r.cy=M+E*b[3],I=r.cxx=P-A,z=r.cyy=L-M,O=a.side;"counterclockwise"===O?(S=O,O="top"):"clockwise"===O&&(S=O,O="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:O,_trueSide:S,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:v});var R=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",R).attr("transform",s(I,z)),n.frontplot.attr("transform",s(A,M)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",R).attr("transform",s(P,L)).call(l.fill,t.bgcolor)},N.mockAxis=function(e,t,r,n){var i=a.extendFlat({},r,n);return d(i,t,e),i},N.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);p(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*a,e[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},N.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);f(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]90&&m<=270&&(g.tickangle=180);var x=v?function(e){var t=z(r,P([e.x,0]));return s(t[0]-p,t[1]-d)}:function(e){return s(g.l2p(e.x)+u,0)},b=v?function(e){return I(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(g.r2p(e.x)+u)},_=U(f);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,k=v?(g.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return h.tickText(g,e,!0,!1)})):h.calcTicks(g),T=v?k:h.clipEnds(g,k),S=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(S=-S),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:k,layer:i["radial-axis"],path:h.makeTickPath(g,0,S),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:T,layer:i["radial-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:k,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var A=r.radialAxisAngle=r.vangles?F(V(j(f.angle),r.vangles)):f.angle,M=s(p,d),E=M+o(-A);H(i["radial-axis"],y&&(f.showticklabels||f.ticks),{transform:E}),H(i["radial-grid"],y&&f.showgrid,{transform:v?"":M}),H(i["radial-line"].select("line"),y&&f.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",f.linewidth).call(l.stroke,f.linecolor)},N.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),u=n.id+"title",h=0;if(l.title){var p=c.bBox(n.layers["radial-axis"].node()).height,d=l.title.font.size,f=l.side;h="top"===f?d:"counterclockwise"===f?-(p+.4*d):p+.8*d}var m=void 0!==r?r:n.radialAxisAngle,g=j(m),y=Math.cos(g),v=Math.sin(g),b=o+a/2*y+h*v,_=s-a/2*v+h*y;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:R(i,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,p=r.cx,d=r.cy,f=r.getAngular(t),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",f.rotation),m.setGeometry(),m.setScale());var y=g?function(e){var t=z(r,P([0,e.x]));return Math.atan2(t[0]-p,t[1]-d)-Math.PI/2}:function(e){return m.t2g(e.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var v=function(e){return s(p+c*Math.cos(e),d-c*Math.sin(e))},x=g?function(e){var t=z(r,P([0,e.x]));return s(t[0],t[1])}:function(e){return v(y(e))},b=g?function(e){var t=z(r,P([0,e.x])),n=Math.atan2(t[0]-p,t[1]-d)-Math.PI/2;return s(t[0],t[1])+o(-F(n))}:function(e){var t=y(e);return v(t)+o(-F(t))},_=g?function(e){return L(r,e.x,0,1/0)}:function(e){var t=y(e),r=Math.cos(t),n=Math.sin(t);return"M"+[p+u*r,d-u*n]+"L"+[p+c*r,d-c*n]},w=h.makeLabelFns(m,0).labelStandoff,k={xFn:function(e){var t=y(e);return Math.cos(t)*w},yFn:function(e){var t=y(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(w+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*A)},anchorFn:function(e){var t=y(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=y(e);return-.5*(1+Math.sin(n))*r}},T=U(f);r.angularTickLayout!==T&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=T);var S,M=g?[1/0].concat(m.tickvals||[]).map((function(e){return h.tickText(m,e,!0,!1)})):h.calcTicks(m);if(g&&(M[0].text="\u221e",M[0].fontSize*=1.75),"linear"===t.gridshape?(S=M.map(y),a.angleDelta(S[0],S[1])<0&&(S=S.slice().reverse())):S=null,r.vangles=S,"category"===m.type&&(M=M.filter((function(e){return a.isAngleInsideSector(y(e),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:M,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:b,crisp:!1}),h.drawGrid(n,m,{vals:M,layer:i["angular-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:M,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:k})}H(i["angular-line"].select("path"),f.showline,{d:r.pathSubplot(),transform:s(p,d)}).attr("stroke-width",f.linewidth).call(l.stroke,f.linecolor)},N.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},N.updateHoverAndMainDrag=function(e){var t,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,p=e._zoomlayer,d=M.MINZOOM,f=M.OFFEDGE,v=l.radius,x=l.innerRadius,k=l.cx,T=l.cy,S=l.cxx,A=l.cyy,C=l.sectorInRad,P=l.vangles,L=l.radialAxis,I=E.clampTiny,z=E.findXYatLength,O=E.findEnclosingVertexAngles,R=M.cornerHalfWidth,D=M.cornerLen/2,j=m.makeDragger(h,"path","maindrag",!1===e.dragmode?"none":"crosshair");r.select(j).attr("d",l.pathSubplot()).attr("transform",s(k,T)),j.onmousemove=function(e){y.hover(u,e,l.id),u._fullLayout._lasthover=j,u._fullLayout._hoversubplot=l.id},j.onmouseout=function(e){u._dragging||g.unhover(u,e)};var F,B,N,U,V,q,H,G,W,$={element:j,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Z(e,t){return Math.sqrt(e*e+t*t)}function X(e,t){return Z(e-S,t-A)}function Y(e,t){return Math.atan2(A-t,e-S)}function K(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function J(e,t){if(0===e)return l.pathSector(2*R);var r=D/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,v)),o=a-R,s=a+R;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(e,t,r){if(0===e)return l.pathSector(2*R);var n,i,a=K(e,t),o=K(e,r),s=I((a[0]+o[0])/2),c=I((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,p=z(R,u,s,c);n=z(D,h,p[0][0],p[0][1]),i=z(D,h,p[1][0],p[1][1])}else{var d,f;c?(d=D,f=R):(d=R,f=D),n=[[s-d,c-f],[s+d,c-f]],i=[[s-d,c+f],[s+d,c+f]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,v),x),ed?(e-1&&1===e&&_(t,u,[l.xaxis],[l.yaxis],l.id,$),r.indexOf("event")>-1&&y.click(u,t,l.id)}$.prepFn=function(e,r,i){var s=u._fullLayout.dragmode,h=j.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var d=u._fullLayout._invTransform;t=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var f=a.apply3DTransform(d)(r-h.left,i-h.top);if(F=f[0],B=f[1],P){var g=E.findPolygonOffset(v,C[0],C[1],P);F+=S+g[0],B+=A+g[1]}switch(s){case"zoom":$.clickFn=se,c||($.moveFn=P?ie:re,$.doneFn=ae,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var e=u._fullLayout[l.id];H=n(e.bgcolor).getLuminance(),(G=m.makeZoombox(p,H,k,T,V)).attr("fill-rule","evenodd"),W=m.makeCorners(p,k,T),w(u)}());break;case"select":case"lasso":b(e,r,i,$,s)}},g.init($)},N.updateRadialDrag=function(e,t,n){var l=this,c=l.gd,u=l.layers,h=l.radius,p=l.innerRadius,d=l.cx,f=l.cy,y=l.radialAxis,v=M.radialDragBoxSize,x=v/2;if(y.visible){var b,_,k,A=j(l.radialAxisAngle),E=y._rl,C=E[0],P=E[1],L=E[n],I=.75*(E[1]-E[0])/(1-l.getHole(t))/h;n?(b=d+(h+x)*Math.cos(A),_=f-(h+x)*Math.sin(A),k="radialdrag"):(b=d+(p-x)*Math.cos(A),_=f-(p-x)*Math.sin(A),k="radialdrag-inner");var z,O,R,D=m.makeRectDragger(u,k,"crosshair",-x,-x,v,v),B={element:D,gd:c};!1===e.dragmode&&(B.dragmode=!1),H(r.select(D),y.visible&&p0===(n?R>C:R")}}t.exports={hoverPoints:function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),Ek=p({"src/traces/scatterpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_k(),categories:["polar","symbols","showLegend","scatter-like"],attributes:wk(),supplyDefaults:kk().supplyDefaults,colorbar:pi(),formatLabels:Tk(),calc:Sk(),plot:Ak(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Mk().hoverPoints,selectPoints:yi(),meta:{}}}}),Ck=p({"lib/scatterpolar.js"(e,t){t.exports=Ek()}}),Pk=p({"src/traces/scatterpolargl/attributes.js"(e,t){var r=wk(),n=Og(),i=Oe().texttemplateAttrs;t.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}}),Lk=p({"src/traces/scatterpolargl/defaults.js"(e,t){var r=st(),n=$t(),i=kk().handleRThetaDefaults,a=Wn(),o=$n(),s=Xn(),l=Yn(),c=bn().PTS_LINESONLY,u=Pk();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}var f=i(e,t,p,d);f?(d("thetaunit"),d("mode",f=l&&(v.marker.cluster=f.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&s.extendFlat(v.line,o.linePositions(e,d,_)),v.text&&(s.extendFlat(v.text,{positions:_},o.textPosition(e,d,v.text,v.marker)),s.extendFlat(v.textSel,{positions:_},o.textPosition(e,d,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:_},o.textPosition(e,d,v.text,v.markerUnsel))),v.fill&&!p.fill2d&&(p.fill2d=!0),v.marker&&!p.scatter2d&&(p.scatter2d=!0),v.line&&!p.line2d&&(p.line2d=!0),v.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(v.line),p.fillOptions.push(v.fill),p.markerOptions.push(v.marker),p.markerSelectedOptions.push(v.markerSel),p.markerUnselectedOptions.push(v.markerUnsel),p.textOptions.push(v.text),p.textSelectedOptions.push(v.textSel),p.textUnselectedOptions.push(v.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),f.x=w,f.y=k,f.rawx=w,f.rawy=k,f.r=g,f.theta=y,f.positions=_,f._scene=p,f.index=p.count,p.count++}})),i(e,t,c)}},t.exports.reglPrecompiled={}}}),jk=p({"src/traces/scatterpolargl/index.js"(e,t){var r=Rk();r.plot=Dk(),t.exports=r}}),Fk=p({"lib/scatterpolargl.js"(e,t){t.exports=jk()}}),Bk=p({"src/traces/barpolar/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=R().extendFlat,i=wk(),a=Ha();t.exports={r:i.r,theta:i.theta,r0:i.r0,dr:i.dr,theta0:i.theta0,dtheta:i.dtheta,thetaunit:i.thetaunit,base:n({},a.base,{}),offset:n({},a.offset,{}),width:n({},a.width,{}),text:n({},a.text,{}),hovertext:n({},a.hovertext,{}),marker:function(){var e=n({},a.marker);return delete e.cornerradius,e}(),hoverinfo:i.hoverinfo,hovertemplate:r(),selected:a.selected,unselected:a.unselected}}}),Nk=p({"src/traces/barpolar/layout_attributes.js"(e,t){t.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),Uk=p({"src/traces/barpolar/defaults.js"(e,t){var r=st(),n=kk().handleRThetaDefaults,i=Wa(),a=Bk();t.exports=function(e,t,o,s){function l(n,i){return r.coerce(e,t,a,n,i)}n(e,t,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(e,t,l,o,s),r.coerceSelectionMarkerOpacity(t,l)):t.visible=!1}}}),Vk=p({"src/traces/barpolar/layout_defaults.js"(e,t){var r=st(),n=Nk();t.exports=function(e,t,i){var a,o={};function s(i,o){return r.coerce(e[a]||{},t[a],n,i,o)}for(var l=0;l0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,e.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,e.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,t,r)}:function(e,n,a,o){return i.pathAnnulus(e,n,a,o,t,r)}}(t),f=t.layers.frontplot.select("g.barlayer");i.makeTraceGroups(f,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,a=r.select(this),o=e.rp0=h.c2p(e.s0),s=e.rp1=h.c2p(e.s1),l=e.thetag0=p.c2g(e.p0),f=e.thetag1=p.c2g(e.p1);if(n(o)&&n(s)&&n(l)&&n(f)&&o!==s&&l!==f){var m=h.c2g(e.s1),g=(l+f)/2;e.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],t=d(o,s,l,f)}else t="M0,0Z";i.ensureSingle(a,"path").attr("d",t)})),a.setClipUrl(o,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}}}),Gk=p({"src/traces/barpolar/hover.js"(e,t){var r=zr(),n=st(),i=to().getTraceColor,a=n.fillText,o=Mk().makeHoverPointText,s=gk().isPtInsidePolygon;t.exports=function(e,t,l){var c=e.cd,u=c[0].trace,h=e.subplot,p=h.radialAxis,d=h.angularAxis,f=h.vangles,m=f?s:n.isPtInsideSector,g=e.maxHoverDistance,y=d._period||2*Math.PI,v=Math.abs(p.g2p(Math.sqrt(t*t+l*l))),x=Math.atan2(l,t);if(p.range[0]>p.range[1]&&(x+=Math.PI),r.getClosest(c,(function(e){return m(v,x,[e.rp0,e.rp1],[e.thetag0,e.thetag1],f)?g+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-v)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var b=c[e.index];e.x0=e.x1=b.ct[0],e.y0=e.y1=b.ct[1];var _=n.extendFlat({},b,{r:b.s,theta:b.p});return a(b,u,e),o(_,u,h,e),e.hovertemplate=u.hovertemplate,e.color=i(u,b),e.xLabelVal=e.yLabelVal=void 0,b.s<0&&(e.idealAlign="left"),[e]}}}}),Wk=p({"src/traces/barpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"barpolar",basePlotModule:_k(),categories:["polar","bar","showLegend"],attributes:Bk(),layoutAttributes:Nk(),supplyDefaults:Uk(),supplyLayoutDefaults:Vk(),calc:qk().calc,crossTraceCalc:qk().crossTraceCalc,plot:Hk(),colorbar:pi(),formatLabels:Tk(),style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:Gk(),selectPoints:no(),meta:{}}}}),$k=p({"lib/barpolar.js"(e,t){t.exports=Wk()}}),Zk=p({"src/plots/smith/constants.js"(e,t){t.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),Xk=p({"src/plots/smith/layout_attributes.js"(e,t){var r=V(),n=Ct(),i=ka().attributes,a=st().extendFlat,o=Le().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);t.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),Yk=p({"src/plots/smith/layout_defaults.js"(e,t){var r=st(),n=q(),i=gt(),a=qs(),o=_t().getSubplotData,s=Nt(),l=Bt(),c=_i(),u=er(),h=Xk(),p=Zk(),d=p.axisNames,f=function(e,t){var r={};return function(n){var i=t?t(n):n;if(i in r)return r[i];var a=e(n);return r[i]=a,a}}((function(e){return r.isTypedArray(e)&&(e=Array.from(e)),e.slice().reverse().map((function(e){return-e})).concat([0]).concat(e)}),String);function m(e,t,a,m){var g=a("bgcolor");m.bgColor=n.combine(g,m.paper_bgcolor);var y,v=o(m.fullData,p.name,m.id),x=m.layoutOut;function b(e,t){return a(y+"."+e,t)}for(var _=0;_")}}t.exports={hoverPoints:function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),iT=p({"src/traces/scattersmith/index.js"(e,t){t.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Kk(),categories:["smith","symbols","showLegend","scatter-like"],attributes:Jk(),supplyDefaults:Qk(),colorbar:pi(),formatLabels:eT(),calc:tT(),plot:rT(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:nT().hoverPoints,selectPoints:yi(),meta:{}}}}),aT=p({"lib/scattersmith.js"(e,t){t.exports=iT()}}),oT=p({"node_modules/world-calendars/dist/main.js"(e,t){var r=uy();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function o(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}r(n.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),r(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+a(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;ot-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===t[0]||e.year()>0!==t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth=this.minDay&&r-this.minDay13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var l=t.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),sT=p({"node_modules/world-calendars/dist/plus.js"(){var e=uy(),t=oT();e(t.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"}),t.local=t.regionalOptions[""],e(t.cdate.prototype,{formatDate:function(e,t){return"string"!==typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),e(t.baseCalendar.prototype,{UNIX_EPOCH:t.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:t.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,r,n){if("string"!==typeof e&&(n=r,r=e,e=""),!r)return"";if(r.calendar()!==this)throw t.local.invalidFormat||t.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var i,a=(n=n||{}).dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.monthNumbers||this.local.monthNumbers,l=n.monthNamesShort||this.local.monthNamesShort,c=n.monthNames||this.local.monthNames,u=(n.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;x+n1}),h=function(e,t,r,n){var i=""+t;if(u(e,n))for(;i.length1},x=function(e,n){var i=v(e,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(S).match(o);if(!s)throw(t.local.missingNumberAt||t.regionalOptions[""].missingNumberAt).replace(/\{0\}/,S);return S+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"===typeof l){v("m");var e=l.call(b,r.substring(S));return S+=e.length,e}return x("m")},w=function(e,n,i,a){for(var o=v(e,a)?i:n,s=0;s-1){d=1,f=m;for(var E=this.daysInMonth(p,d);f>E;E=this.daysInMonth(p,d))d++,f-=E}return h>-1?this.fromJD(h):this.newDate(p,d,f)},determineDate:function(e,t,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"===typeof e?function(e){try{return a.parseDate(n,e,i)}catch(l){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"===typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})}}),lT=p({"node_modules/world-calendars/dist/calendars/chinese.js"(){var e=oT(),t=uy(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"===typeof e){var r=e.match(a);return r?r[0]:""}var n=this._validateYear(e),i=e.month(),o=""+this.toChineseMonth(n,i);return t&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(e){if("string"===typeof e){var t=e.match(o);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(e){if("string"===typeof e){var t=e.match(s);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var i=t[t.length-1];r="i"===i||"I"===i}return this.toMonthIndex(e,n,r)},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(e,t){if(e.year&&(e=e.year()),"number"!==typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(t,r,n){var i=this.intercalaryMonth(t);if(n&&r!==i||r<1||r>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(t,r){t.year&&(r=(t=t.year()).month());var n=this.intercalaryMonth(t);if(r<0||r>(n?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(t,n,i){var a,o=this._validateYear(t,e.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,n,i)-a.toJD();return 1+Math.floor(p/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(t,r){t.year&&(r=t.month(),t=t.year()),t=this._validateYear(t);var n=l[t-l[0]];if(r>(n>>13?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,s,i,e.local.invalidDate);t=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(t,n),s=this.toChineseMonth(t,n),u=function(e,t,r,n,i){var a,o,s;if("object"===typeof e)o=e,a=t||{};else{var u;if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:u}}s=o.day-1;var h,p=l[o.year-l[0]],d=p>>13;h=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var f=0;f>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(e){var t=r.fromJD(e),n=function(e,t,r,n){var i,a;if("object"===typeof e)i=e,a=t||{};else{if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var o=c[i.year-c[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=c[a.year-c[0]];var u,h=new Date(o>>9&4095,(o>>5&15)-1,31&o),p=new Date(i.year,i.month-1,i.day);u=Math.round((p-h)/864e5);var d,f=l[a.year-l[0]];for(d=0;d<13;d++){var m=f&1<<12-d?30:29;if(u>13;return!g||d=2&&n<=6},extraInfo:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};e.calendars.discworld=r}}),hT=p({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()+(r.year()<0?1:0))%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),e.calendars.ethiopian=r}}),pT=p({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}r.prototype=new e.baseCalendar,t(r.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(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(e){return n(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),12===r&&this.leapYear(t)||8===r&&5===n(this.daysInYear(t),10)?30:9===r&&3===n(this.daysInYear(t),10)?29:this.daysPerMonth[r-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);t=i.year(),r=i.month(),n=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=ethis.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),e.calendars.hebrew=r}}),dT=p({"node_modules/world-calendars/dist/calendars/islamic.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year(),r=i.month(),t=t<=0?t+1:t,(n=i.day())+Math.ceil(29.5*(r-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),e.calendars.islamic=r}}),fT=p({"node_modules/world-calendars/dist/calendars/julian.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()<0?r.year()+1:r.year())%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year(),r=i.month(),n=i.day(),t<0&&t++,r<=2&&(t--,r+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),e.calendars.julian=r}}),mT=p({"node_modules/world-calendars/dist/calendars/mayan.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}function i(e,t){return n(e-1,t)+1}r.prototype=new e.baseCalendar,t(r.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(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year();var r=Math.floor(t/400);return t%=400,t+=t<0?400:0,r+"."+Math.floor(t/20)+"."+t%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(t,r){return this._validate(t,r,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate).day()},weekDay:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate),!0},extraInfo:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=n(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,n(t,20)]},_toTzolkin:function(e){return[i(20+(e-=this.jdEpoch),20),i(e+4,13)]},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),e.calendars.mayan=r}}),gT=p({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar;var n=e.instance("gregorian");t(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidMonth);(t=a.year())<0&&t++;for(var o=a.day(),s=1;s=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),e.calendars.nanakshahi=r}}),yT=p({"node_modules/world-calendars/dist/calendars/nepali.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[t][n];return r},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[t][r]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);t=i.year(),r=i.month(),n=i.day();var a=e.instance(),o=0,s=r,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var r=e.instance().fromJD(t),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate);t=a.year(),r=a.month(),i=a.day();var o=t-(t>=0?474:473),s=474+n(o,2820);return i+(r<=7?31*(r-1):30*(r-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),i=n(t,1029983),a=2820;if(1029982!==i){var o=Math.floor(i/366),s=n(i,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=e-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=e-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),e.calendars.persian=r,e.calendars.jalali=r}}),xT=p({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var e=oT(),t=uy(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(n.year()),r.leapYear(t)},weekOfYear:function(t,n,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(a.year()),r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return t=this._t2gYear(a.year()),r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),n=this._g2tYear(t.year());return this.newDate(n,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),e.calendars.taiwan=n}}),bT=p({"node_modules/world-calendars/dist/calendars/thai.js"(){var e=oT(),t=uy(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(n.year()),r.leapYear(t)},weekOfYear:function(t,n,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(a.year()),r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return t=this._t2gYear(a.year()),r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),n=this._g2tYear(t.year());return this.newDate(n,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),e.calendars.thai=n}}),_T=p({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(t,r){for(var i=this._validate(t,r,this.minDay,e.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;oi)return n[a]-n[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,i=0;it);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=t-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,r,n){var i=e.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,r,n,i){var a=e.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),e.calendars.ummalqura=r;var n=[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]}}),wT=p({"src/components/calendars/calendars.js"(e,t){t.exports=oT(),sT(),lT(),cT(),uT(),hT(),pT(),dT(),fT(),mT(),gT(),yT(),vT(),xT(),bT(),_T()}}),kT=p({"src/components/calendars/index.js"(e,t){var r=wT(),n=st(),i=T(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(e,t,r,i){var a={};return a[r]=s,n.coerce(e,t,a,r,i)},c="##",u={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"}},h={};function p(e){var t=h[e];return t||(t=h[e]=r.instance(e))}function d(e){return n.extendFlat({},s,{description:e})}function f(e){return"Sets the calendar system to use with `"+e+"` date data."}var m={xcalendar:d(f("x"))},g=n.extendFlat({},m,{ycalendar:d(f("y"))}),y=n.extendFlat({},g,{zcalendar:d(f("z"))}),v=d(["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(" "));t.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:d(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(e,t,r,n){for(var i=0;i{e.exports=r(497)()},191:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler");Symbol.for("react.provider");var s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case o:case a:case u:case h:case f:return e;default:switch(e=e&&e.$$typeof){case l:case c:case d:case p:case s:return e;default:return t}}case n:return t}}}t.Hy=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===o||e===a||e===u||e===h||"object"===typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===m||void 0!==e.getModuleId)}},218:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},219:(e,t,r)=>{"use strict";var n=r(763),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?o:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(f){var i=d(r);i&&i!==f&&e(t,i,n)}var o=u(r);h&&(o=o.concat(h(r)));for(var s=l(t),m=l(r),g=0;g{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||f}function v(){}function x(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||f}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=x.prototype=new v;b.constructor=x,m(b,y.prototype),b.isPureReactComponent=!0;var _=Array.isArray,w={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function T(e,t,n,i,a,o){return n=o.ref,{$$typeof:r,type:e,key:t,ref:void 0!==n?n:null,props:o}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===r}var A=/\/+/g;function M(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function E(){}function C(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l,c,u=!1;if(null===e)u=!0;else switch(s){case"bigint":case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case r:case n:u=!0;break;case p:return C((u=e._init)(e._payload),t,i,a,o)}}if(u)return o=o(e),u=""===a?"."+M(e,0):a,_(o)?(i="",null!=u&&(i=u.replace(A,"$&/")+"/"),C(o,t,i,"",(function(e){return e}))):null!=o&&(S(o)&&(l=o,c=i+(null==o.key||e&&e.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+u,o=T(l.type,c,void 0,0,0,l.props)),t.push(o)),1;u=0;var h,f=""===a?".":a+":";if(_(e))for(var m=0;m{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(4)},408:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";var n=r(218);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return r.PropTypes=r,r}},537:(e,t,r)=>{"use strict";t.A=void 0;var n=a(r(805)),i=a(r(96));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)(i.default);t.A=o},579:(e,t,r)=>{"use strict";e.exports=r(799)},672:(e,t,r)=>{"use strict";var n=r(43);function i(e){var t="https://react.dev/errors/"+e;if(1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAnimation=void 0;t.createAnimation=function(e,t,r){var n="react-spinners-".concat(e,"-").concat(r);if("undefined"==typeof window||!window.document)return n;var i=document.createElement("style");document.head.appendChild(i);var a=i.sheet,o="\n @keyframes ".concat(n," {\n ").concat(t,"\n }\n ");return a&&a.insertRule(o,0),n}},763:(e,t,r)=>{"use strict";e.exports=r(983)},799:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(e,t,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:i,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=i,t.jsxs=i},805:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=function(t){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(i,t);var r=function(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=h(e);if(t){var a=h(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}(this,r)}}(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,e)).p=Promise.resolve(),t.resizeHandler=null,t.handlers={},t.syncWindowResize=t.syncWindowResize.bind(u(t)),t.syncEventHandlers=t.syncEventHandlers.bind(u(t)),t.attachUpdateEvents=t.attachUpdateEvents.bind(u(t)),t.getRef=t.getRef.bind(u(t)),t.handleUpdate=t.handleUpdate.bind(u(t)),t.figureCallback=t.figureCallback.bind(u(t)),t.updatePlotly=t.updatePlotly.bind(u(t)),t}return function(e,t,r){t&&l(e.prototype,t);r&&l(e,r);Object.defineProperty(e,"prototype",{writable:!1})}(i,[{key:"updatePlotly",value:function(t,r,n){var i=this;this.p=this.p.then((function(){if(!i.unmounting){if(!i.el)throw new Error("Missing element reference");return e.react(i.el,{data:i.props.data,layout:i.props.layout,config:i.props.config,frames:i.props.frames})}})).then((function(){i.unmounting||(i.syncWindowResize(t),i.syncEventHandlers(),i.figureCallback(r),n&&i.attachUpdateEvents())})).catch((function(e){i.props.onError&&i.props.onError(e)}))}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(e){this.unmounting=!1;var t=e.frames&&e.frames.length?e.frames.length:0,r=this.props.frames&&this.props.frames.length?this.props.frames.length:0,n=!(e.layout===this.props.layout&&e.data===this.props.data&&e.config===this.props.config&&r===t),i=void 0!==e.revision,a=e.revision!==this.props.revision;(n||i&&(!i||a))&&this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&f&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),e.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var e=this;this.el&&this.el.removeListener&&d.forEach((function(t){e.el.on(t,e.handleUpdate)}))}},{key:"removeUpdateEvents",value:function(){var e=this;this.el&&this.el.removeListener&&d.forEach((function(t){e.el.removeListener(t,e.handleUpdate)}))}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(e){if("function"===typeof e){var t=this.el;e({data:t.data,layout:t.layout,frames:this.el._transitionData?this.el._transitionData._frames:null},this.el)}}},{key:"syncWindowResize",value:function(t){var r=this;f&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return e.Plots.resize(r.el)},window.addEventListener("resize",this.resizeHandler),t&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(e){this.el=e,this.props.debug&&f&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var e=this;p.forEach((function(t){var r=e.props["on"+t],n=e.handlers[t],i=Boolean(n);r&&!i?e.addEventHandler(t,r):!r&&i?e.removeEventHandler(t):r&&i&&r!==n&&(e.removeEventHandler(t),e.addEventHandler(t,r))}))}},{key:"addEventHandler",value:function(e,t){this.handlers[e]=t,this.el.on(this.getPlotlyEventName(e),this.handlers[e])}},{key:"removeEventHandler",value:function(e){this.el.removeListener(this.getPlotlyEventName(e),this.handlers[e]),delete this.handlers[e]}},{key:"getPlotlyEventName",value:function(e){return"plotly_"+e.toLowerCase()}},{key:"render",value:function(){return a.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),i}(a.Component);return t.propTypes={data:o.default.arrayOf(o.default.object),config:o.default.object,layout:o.default.object,frames:o.default.arrayOf(o.default.object),revision:o.default.number,onInitialized:o.default.func,onPurge:o.default.func,onError:o.default.func,onUpdate:o.default.func,debug:o.default.bool,style:o.default.object,className:o.default.string,useResizeHandler:o.default.bool,divId:o.default.string},p.forEach((function(e){t.propTypes["on"+e]=o.default.func})),t.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},t};var i,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!==typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(i,o,l):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(r(43)),o=(i=r(173))&&i.__esModule?i:{default:i};function s(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function l(e,t){for(var r=0;r{"use strict";e.exports=r(896)},880:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseLengthAndUnit=n,t.cssValue=function(e){var t=n(e);return"".concat(t.value).concat(t.unit)};var r={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function n(e){if("number"===typeof e)return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();t=n.includes(".")?parseFloat(n):parseInt(n,10);var i=(e.match(/[^0-9]*$/)||"").toString();return r[i]?{value:t,unit:i}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}},896:(e,t)=>{"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0>>1,i=e[n];if(!(0>>1;na(l,r))ca(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[s]=r,n=s);else{if(!(ca(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],h=1,p=null,d=3,f=!1,m=!1,g=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,x="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=n(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function _(e){if(g=!1,b(e),!m)if(null!==n(c))m=!0,L();else{var t=n(u);null!==t&&I(_,t.startTime-e)}}var w,k=!1,T=-1,S=5,A=-1;function M(){return!(t.unstable_now()-Ae&&M());){var o=p.callback;if("function"===typeof o){p.callback=null,d=p.priorityLevel;var s=o(p.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof s){p.callback=s,b(e),r=!0;break t}p===n(c)&&i(c),b(e)}else i(c);p=n(c)}if(null!==p)r=!0;else{var l=n(u);null!==l&&I(_,l.startTime-e),r=!1}}break e}finally{p=null,d=a,f=!1}r=void 0}}finally{r?w():k=!1}}}if("function"===typeof x)w=function(){x(E)};else if("undefined"!==typeof MessageChannel){var C=new MessageChannel,P=C.port2;C.port1.onmessage=E,w=function(){P.postMessage(null)}}else w=function(){y(E,0)};function L(){k||(k=!0,w())}function I(e,r){T=y((function(){e(t.unstable_now())}),r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,L())},t.unstable_forceFrameRate=function(e){0>e||125o?(e.sortIndex=a,r(u,e),null===n(c)&&e===n(u)&&(g?(v(T),T=-1):g=!0,I(_,a-o))):(e.sortIndex=s,r(c,e),m||f||(m=!0,L())),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=d;return function(){var r=d;d=t;try{return e.apply(this,arguments)}finally{d=r}}}},950:(e,t,r)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(672)},983:(e,t)=>{"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function _(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case h:case a:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case l:return e;default:return t}}case i:return t}}}function w(e){return _(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=p,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return w(e)||_(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===p},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===g},t.isMemo=function(e){return _(e)===m},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===h||e===s||e===o||e===d||e===f||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===x||e.$$typeof===b||e.$$typeof===y)},t.typeOf=_}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"===typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>o[e]=()=>n[e]));return o.default=()=>n,r.d(a,o),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"static/js/"+e+".ec6f47ad.chunk.js",r.miniCssF=e=>{},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="backstory:";r.l=(n,i,a,o)=>{if(e[n])e[n].push(i);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(d);var i=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",(()=>{var e={792:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var a=new Promise(((r,n)=>i=e[t]=[r,n]));n.push(i[2]=a);var o=r.p+r.u(t),s=new Error;r.l(o,(n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,a,o=n[0],s=n[1],l=n[2],c=0;if(o.some((t=>0!==e[t]))){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(l)l(r)}for(t&&t(n);c{"use strict";var e=r(43),t=r.t(e,2),n=r(391);const i=e.createContext(null);function a(){return e.useContext(i)}const o="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var s=r(579);const l=function(t){const{children:r,theme:n}=t,l=a(),c=e.useMemo((()=>{const e=null===l?{...n}:function(e,t){if("function"===typeof t)return t(e);return{...e,...t}}(l,n);return null!=e&&(e[o]=null!==l),e}),[n,l]);return(0,s.jsx)(i.Provider,{value:c,children:r})};var c=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t2||z(S)>3?"":" "}function F(e,t){for(;--t&&C()&&!(S<48||S>102||S>57&&S<65||S>70&&S<97););return I(e,L()+(t<6&&32==P()&&32==C()))}function B(e){for(;C();)switch(S){case e:return T;case 34:case 39:34!==e&&39!==e&&B(S);break;case 40:41===e&&B(e);break;case 92:C()}return T}function N(e,t){for(;C()&&e+S!==57&&(e+S!==84||47!==P()););return"/*"+I(t,T-1)+"*"+h(47===e?e:C())}function U(e){for(;!z(P());)C();return I(e,T)}var V="-ms-",q="-moz-",H="-webkit-",G="comm",W="rule",$="decl",Z="@keyframes";function X(e,t){for(var r="",n=x(e),i=0;i0&&v(V)-p&&b(y>32?te(V+";",n,r,p-1):te(f(V," ","")+";",n,r,p-2),l);break;case 59:V+=";";default:if(b(B=Q(V,t,r,c,u,i,s,z,O=[],R=[],p),a),123===I)if(0===u)J(V,t,B,B,O,a,p,s,R);else switch(99===d&&110===g(V,3)?100:d){case 100:case 108:case 109:case 115:J(e,B,B,n&&b(Q(e,B,B,0,0,i,s,z,i,O=[],p),R),i,R,p,s,n?O:R);break;default:J(V,B,B,B,[""],R,0,s,R)}}c=u=y=0,k=E=1,z=V="",p=o;break;case 58:p=1+v(V),y=x;default:if(k<1)if(123==I)--k;else if(125==I&&0==k++&&125==(S=T>0?g(A,--T):0,w--,10===S&&(w=1,_--),S))continue;switch(V+=h(I),I*k){case 38:E=u>0?1:(V+="\f",-1);break;case 44:s[c++]=(v(V)-1)*E,E=1;break;case 64:45===P()&&(V+=D(C())),d=P(),u=p=v(z=V+=U(L())),I++;break;case 45:45===x&&2==v(V)&&(k=0)}}return a}function Q(e,t,r,n,i,a,o,s,l,c,h){for(var p=i-1,m=0===i?a:[""],g=x(m),v=0,b=0,_=0;v0?m[w]+" "+k:f(k,/&\f/g,m[w])))&&(l[_++]=T);return M(e,t,r,0===i?W:s,l,c,h)}function ee(e,t,r){return M(e,t,r,G,h(S),y(e,2,-2),0)}function te(e,t,r,n){return M(e,t,r,$,y(e,0,n),y(e,n+1,-1),n)}var re=function(e,t,r){for(var n=0,i=0;n=i,i=P(),38===n&&12===i&&(t[r]=1),!z(i);)C();return I(e,T)},ne=function(e,t){return R(function(e,t){var r=-1,n=44;do{switch(z(n)){case 0:38===n&&12===P()&&(t[r]=1),e[r]+=re(T-1,t,r);break;case 2:e[r]+=D(n);break;case 4:if(44===n){e[++r]=58===P()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=h(n)}}while(n=C());return e}(O(e),t))},ie=new WeakMap,ae=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ie.get(r))&&!n){ie.set(e,!0);for(var i=[],a=ne(t,i),o=r.props,s=0,l=0;s6)switch(g(e,t+1)){case 109:if(45!==g(e,t+4))break;case 102:return f(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+q+(108==g(e,t+3)?"$3":"$2-$3"))+e;case 115:return~m(e,"stretch")?se(f(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==g(e,t+1))break;case 6444:switch(g(e,v(e)-3-(~m(e,"!important")&&10))){case 107:return f(e,":",":"+H)+e;case 101:return f(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H+(45===g(e,14)?"inline-":"")+"box$3$1"+H+"$2$3$1"+V+"$2box$3")+e}break;case 5936:switch(g(e,t+11)){case 114:return H+e+V+f(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+V+f(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+V+f(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return H+e+V+e+e}return e}var le=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case $:e.return=se(e.value,e.length);break;case Z:return X([E(e,{value:f(e.value,"@","@"+H)})],n);case W:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return X([E(e,{props:[f(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return X([E(e,{props:[f(t,/:(plac\w+)/,":"+H+"input-$1")]}),E(e,{props:[f(t,/:(plac\w+)/,":-moz-$1")]}),E(e,{props:[f(t,/:(plac\w+)/,V+"input-$1")]})],n)}return""}))}}],ce=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n,i,a=e.stylisPlugins||le,o={},s=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:we}}var Se=!!t.useInsertionEffect&&t.useInsertionEffect,Ae=Se||function(e){return e()},Me=Se||e.useLayoutEffect,Ee=e.createContext("undefined"!==typeof HTMLElement?ce({key:"css"}):null),Ce=(Ee.Provider,function(t){return(0,e.forwardRef)((function(r,n){var i=(0,e.useContext)(Ee);return t(r,i,n)}))}),Pe=e.createContext({});var Le={}.hasOwnProperty,Ie="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",ze=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return he(t,r,n),Ae((function(){return pe(t,r,n)})),null},Oe=Ce((function(t,r,n){var i=t.css;"string"===typeof i&&void 0!==r.registered[i]&&(i=r.registered[i]);var a=t[Ie],o=[i],s="";"string"===typeof t.className?s=ue(r.registered,o,t.className):null!=t.className&&(s=t.className+" ");var l=Te(o,void 0,e.useContext(Pe));s+=r.key+"-"+l.name;var c={};for(var u in t)Le.call(t,u)&&"css"!==u&&u!==Ie&&(c[u]=t[u]);return c.className=s,n&&(c.ref=n),e.createElement(e.Fragment,null,e.createElement(ze,{cache:r,serialized:l,isStringTag:"string"===typeof a}),e.createElement(a,c))}));const Re=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const r=e.useContext(Pe);return r&&(n=r,0!==Object.keys(n).length)?r:t;var n},De=e.createContext();const je=()=>e.useContext(De)??!1,Fe=function(e){let{value:t,...r}=e;return(0,s.jsx)(De.Provider,{value:t??!0,...r})};function Be(e,t){const r={...t};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const i=n;if("components"===i||"slots"===i)r[i]={...e[i],...r[i]};else if("componentsProps"===i||"slotProps"===i){const n=e[i],a=t[i];if(a)if(n){r[i]={...a};for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const t=e;r[i][t]=Be(n[t],a[t])}}else r[i]=a;else r[i]=n||{}}else void 0===r[i]&&(r[i]=e[i])}return r}const Ne=e.createContext(void 0);function Ue(t){let{props:r,name:n}=t;return function(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const i=t.components[r];return i.defaultProps?Be(i.defaultProps,n):i.styleOverrides||i.variants?n:Be(i,n)}({props:r,name:n,theme:{components:e.useContext(Ne)}})}const Ve=function(e){let{value:t,children:r}=e;return(0,s.jsx)(Ne.Provider,{value:t,children:r})},qe={};function He(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.useMemo((()=>{const e=t&&r[t]||r;if("function"===typeof n){const a=n(e),o=t?{...r,[t]:a}:a;return i?()=>o:o}return t?{...r,[t]:n}:{...r,...n}}),[t,r,n,i])}const Ge=function(e){const{children:t,theme:r,themeId:n}=e,i=Re(qe),o=a()||qe,c=He(n,i,r),u=He(n,o,r,!0),h="rtl"===(n?c[n]:c).direction;return(0,s.jsx)(l,{theme:u,children:(0,s.jsx)(Pe.Provider,{value:c,children:(0,s.jsx)(Fe,{value:h,children:(0,s.jsx)(Ve,{value:n?c[n].components:c.components,children:t})})})})},We="$$material";function $e(e){let{theme:t,...r}=e;const n=We in t?t[We]:void 0;return(0,s.jsx)(Ge,{...r,themeId:n?We:void 0,theme:n||t})}function Ze(e){const t=new URL(`https://mui.com/production-error/?code=${e}`);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;it.searchParams.append("args[]",e))),`Minified MUI error #${e}; visit ${t} for the full message.`}function Xe(e){if("string"!==typeof e)throw new Error(Ze(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Ye=r(191);function Ke(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Je(t){if(e.isValidElement(t)||(0,Ye.Hy)(t)||!Ke(t))return t;const r={};return Object.keys(t).forEach((e=>{r[e]=Je(t[e])})),r}function Qe(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const i=n.clone?{...t}:t;return Ke(t)&&Ke(r)&&Object.keys(r).forEach((a=>{e.isValidElement(r[a])||(0,Ye.Hy)(r[a])?i[a]=r[a]:Ke(r[a])&&Object.prototype.hasOwnProperty.call(t,a)&&Ke(t[a])?i[a]=Qe(t[a],r[a],n):n.clone?i[a]=Ke(r[a])?Je(r[a]):r[a]:i[a]=r[a]})),i}const et=function(e,t){return t?Qe(e,t,{clone:!1}):e};const tt={xs:0,sm:600,md:900,lg:1200,xl:1536},rt={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${tt[e]}px)`},nt={containerQueries:e=>({up:t=>{let r="number"===typeof t?t:tt[t]||t;return"number"===typeof r&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function it(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||rt;return t.reduce(((n,i,a)=>(n[e.up(e.keys[a])]=r(t[a]),n)),{})}if("object"===typeof t){const e=n.breakpoints||rt;return Object.keys(t).reduce(((i,a)=>{if(o=e.keys,"@"===(s=a)||s.startsWith("@")&&(o.some((e=>s.startsWith(`@${e}`)))||s.match(/^@\d/))){const e=function(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,i]=r,a=Number.isNaN(+n)?n||0:+n;return e.containerQueries(i).up(a)}(n.containerQueries?n:nt,a);e&&(i[e]=r(t[a],a))}else if(Object.keys(e.values||tt).includes(a)){i[e.up(a)]=r(t[a],a)}else{const e=a;i[e]=t[e]}var o,s;return i}),{})}return r(t)}function at(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.keys?.reduce(((t,r)=>(t[e.up(r)]={},t)),{});return t||{}}function ot(e,t){return e.reduce(((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e}),t)}function st(e){let{values:t,breakpoints:r,base:n}=e;const i=n||function(e,t){if("object"!==typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach(((t,n)=>{n{null!=e[t]&&(r[t]=!0)})),r}(t,r),a=Object.keys(i);if(0===a.length)return t;let o;return a.reduce(((e,r,n)=>(Array.isArray(t)?(e[r]=null!=t[n]?t[n]:t[o],o=n):"object"===typeof t?(e[r]=null!=t[r]?t[r]:t[o],o=r):e[r]=t,e)),{})}function lt(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){const r=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=r)return r}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function ct(e,t,r){let n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||i:lt(e,r)||i,t&&(n=t(n,i,e)),n}const ut=function(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:i}=e,a=e=>{if(null==e[t])return null;const a=e[t],o=lt(e.theme,n)||{};return it(e,a,(e=>{let n=ct(o,i,e);return e===n&&"string"===typeof e&&(n=ct(o,i,`${t}${"default"===e?"":Xe(e)}`,e)),!1===r?n:{[r]:n}}))};return a.propTypes={},a.filterProps=[t],a};const ht={m:"margin",p:"padding"},pt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},dt={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ft=function(e){const t={};return r=>(void 0===t[r]&&(t[r]=e(r)),t[r])}((e=>{if(e.length>2){if(!dt[e])return[e];e=dt[e]}const[t,r]=e.split(""),n=ht[t],i=pt[r]||"";return Array.isArray(i)?i.map((e=>n+e)):[n+i]})),mt=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],gt=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],yt=[...mt,...gt];function vt(e,t,r,n){const i=lt(e,t,!0)??r;return"number"===typeof i||"string"===typeof i?e=>"string"===typeof e?e:"string"===typeof i?i.startsWith("var(")&&0===e?0:i.startsWith("var(")&&1===e?i:`calc(${e} * ${i})`:i*e:Array.isArray(i)?e=>{if("string"===typeof e)return e;const t=Math.abs(e);const r=i[t];return e>=0?r:"number"===typeof r?-r:"string"===typeof r&&r.startsWith("var(")?`calc(-1 * ${r})`:`-${r}`}:"function"===typeof i?i:()=>{}}function xt(e){return vt(e,"spacing",8)}function bt(e,t){return"string"===typeof t||null==t?t:e(t)}function _t(e,t,r,n){if(!t.includes(r))return null;const i=function(e,t){return r=>e.reduce(((e,n)=>(e[n]=bt(t,r),e)),{})}(ft(r),n);return it(e,e[r],i)}function wt(e,t){const r=xt(e.theme);return Object.keys(e).map((n=>_t(e,t,n,r))).reduce(et,{})}function kt(e){return wt(e,mt)}function Tt(e){return wt(e,gt)}function St(e){return wt(e,yt)}kt.propTypes={},kt.filterProps=mt,Tt.propTypes={},Tt.filterProps=gt,St.propTypes={},St.filterProps=yt;const At=function(){for(var e=arguments.length,t=new Array(e),r=0;r(t.filterProps.forEach((r=>{e[r]=t})),e)),{}),i=e=>Object.keys(e).reduce(((t,r)=>n[r]?et(t,n[r](e)):t),{});return i.propTypes={},i.filterProps=t.reduce(((e,t)=>e.concat(t.filterProps)),[]),i};function Mt(e){return"number"!==typeof e?e:`${e}px solid`}function Et(e,t){return ut({prop:e,themeKey:"borders",transform:t})}const Ct=Et("border",Mt),Pt=Et("borderTop",Mt),Lt=Et("borderRight",Mt),It=Et("borderBottom",Mt),zt=Et("borderLeft",Mt),Ot=Et("borderColor"),Rt=Et("borderTopColor"),Dt=Et("borderRightColor"),jt=Et("borderBottomColor"),Ft=Et("borderLeftColor"),Bt=Et("outline",Mt),Nt=Et("outlineColor"),Ut=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=vt(e.theme,"shape.borderRadius",4),r=e=>({borderRadius:bt(t,e)});return it(e,e.borderRadius,r)}return null};Ut.propTypes={},Ut.filterProps=["borderRadius"];At(Ct,Pt,Lt,It,zt,Ot,Rt,Dt,jt,Ft,Ut,Bt,Nt);const Vt=e=>{if(void 0!==e.gap&&null!==e.gap){const t=vt(e.theme,"spacing",8),r=e=>({gap:bt(t,e)});return it(e,e.gap,r)}return null};Vt.propTypes={},Vt.filterProps=["gap"];const qt=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=vt(e.theme,"spacing",8),r=e=>({columnGap:bt(t,e)});return it(e,e.columnGap,r)}return null};qt.propTypes={},qt.filterProps=["columnGap"];const Ht=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=vt(e.theme,"spacing",8),r=e=>({rowGap:bt(t,e)});return it(e,e.rowGap,r)}return null};Ht.propTypes={},Ht.filterProps=["rowGap"];At(Vt,qt,Ht,ut({prop:"gridColumn"}),ut({prop:"gridRow"}),ut({prop:"gridAutoFlow"}),ut({prop:"gridAutoColumns"}),ut({prop:"gridAutoRows"}),ut({prop:"gridTemplateColumns"}),ut({prop:"gridTemplateRows"}),ut({prop:"gridTemplateAreas"}),ut({prop:"gridArea"}));function Gt(e,t){return"grey"===t?t:e}At(ut({prop:"color",themeKey:"palette",transform:Gt}),ut({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Gt}),ut({prop:"backgroundColor",themeKey:"palette",transform:Gt}));function Wt(e){return e<=1&&0!==e?100*e+"%":e}const $t=ut({prop:"width",transform:Wt}),Zt=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{const r=e.theme?.breakpoints?.values?.[t]||tt[t];return r?"px"!==e.theme?.breakpoints?.unit?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Wt(t)}};return it(e,e.maxWidth,t)}return null};Zt.filterProps=["maxWidth"];const Xt=ut({prop:"minWidth",transform:Wt}),Yt=ut({prop:"height",transform:Wt}),Kt=ut({prop:"maxHeight",transform:Wt}),Jt=ut({prop:"minHeight",transform:Wt}),Qt=(ut({prop:"size",cssProperty:"width",transform:Wt}),ut({prop:"size",cssProperty:"height",transform:Wt}),At($t,Zt,Xt,Yt,Kt,Jt,ut({prop:"boxSizing"})),{border:{themeKey:"borders",transform:Mt},borderTop:{themeKey:"borders",transform:Mt},borderRight:{themeKey:"borders",transform:Mt},borderBottom:{themeKey:"borders",transform:Mt},borderLeft:{themeKey:"borders",transform:Mt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Mt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ut},color:{themeKey:"palette",transform:Gt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Gt},backgroundColor:{themeKey:"palette",transform:Gt},p:{style:Tt},pt:{style:Tt},pr:{style:Tt},pb:{style:Tt},pl:{style:Tt},px:{style:Tt},py:{style:Tt},padding:{style:Tt},paddingTop:{style:Tt},paddingRight:{style:Tt},paddingBottom:{style:Tt},paddingLeft:{style:Tt},paddingX:{style:Tt},paddingY:{style:Tt},paddingInline:{style:Tt},paddingInlineStart:{style:Tt},paddingInlineEnd:{style:Tt},paddingBlock:{style:Tt},paddingBlockStart:{style:Tt},paddingBlockEnd:{style:Tt},m:{style:kt},mt:{style:kt},mr:{style:kt},mb:{style:kt},ml:{style:kt},mx:{style:kt},my:{style:kt},margin:{style:kt},marginTop:{style:kt},marginRight:{style:kt},marginBottom:{style:kt},marginLeft:{style:kt},marginX:{style:kt},marginY:{style:kt},marginInline:{style:kt},marginInlineStart:{style:kt},marginInlineEnd:{style:kt},marginBlock:{style:kt},marginBlockStart:{style:kt},marginBlockEnd:{style:kt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Vt},rowGap:{style:Ht},columnGap:{style:qt},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Wt},maxWidth:{style:Zt},minWidth:{transform:Wt},height:{transform:Wt},maxHeight:{transform:Wt},minHeight:{transform:Wt},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}});const er=function(){function e(e,t,r,n){const i={[e]:t,theme:r},a=n[e];if(!a)return{[e]:t};const{cssProperty:o=e,themeKey:s,transform:l,style:c}=a;if(null==t)return null;if("typography"===s&&"inherit"===t)return{[e]:t};const u=lt(r,s)||{};if(c)return c(i);return it(i,t,(t=>{let r=ct(u,l,t);return t===r&&"string"===typeof t&&(r=ct(u,l,`${e}${"default"===t?"":Xe(t)}`,t)),!1===o?r:{[o]:r}}))}return function t(r){const{sx:n,theme:i={}}=r||{};if(!n)return null;const a=i.unstable_sxConfig??Qt;function o(r){let n=r;if("function"===typeof r)n=r(i);else if("object"!==typeof r)return r;if(!n)return null;const o=at(i.breakpoints),s=Object.keys(o);let l=o;return Object.keys(n).forEach((r=>{const o=(s=n[r],c=i,"function"===typeof s?s(c):s);var s,c;if(null!==o&&void 0!==o)if("object"===typeof o)if(a[r])l=et(l,e(r,o,i,a));else{const e=it({theme:i},o,(e=>({[r]:e})));!function(){for(var e=arguments.length,t=new Array(e),r=0;re.concat(Object.keys(t))),[]),i=new Set(n);return t.every((e=>i.size===Object.keys(e).length))}(e,o)?l=et(l,e):l[r]=t({sx:o,theme:i})}else l=et(l,e(r,o,i,a))})),function(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter((e=>e.startsWith("@container"))).sort(((e,t)=>{const r=/min-width:\s*([0-9.]+)/;return+(e.match(r)?.[1]||0)-+(t.match(r)?.[1]||0)}));return r.length?r.reduce(((e,r)=>{const n=t[r];return delete e[r],e[r]=n,e}),{...t}):t}(i,ot(s,l))}return Array.isArray(n)?n.map(o):o(n)}}();er.filterProps=["sx"];const tr=er;r(219);var rr=function(t,r){var n=arguments;if(null==r||!Le.call(r,"css"))return e.createElement.apply(void 0,n);var i=n.length,a=new Array(i);a[0]=Oe,a[1]=function(e,t){var r={};for(var n in t)Le.call(t,n)&&(r[n]=t[n]);return r[Ie]=e,r}(t,r);for(var o=2;o{return t(void 0===(n=e)||null===n||0===Object.keys(n).length?r:e);var n}:t;return(0,s.jsx)(nr,{styles:n})}const sr="undefined"!==typeof window?e.useLayoutEffect:e.useEffect,lr="mode",cr="color-scheme",ur="data-color-scheme";function hr(){}const pr=e=>{let{key:t,storageWindow:r}=e;return r||"undefined"===typeof window||(r=window),{get(e){if("undefined"===typeof window)return;if(!r)return e;let n;try{n=r.localStorage.getItem(t)}catch{}return n||e},set:e=>{if(r)try{r.localStorage.setItem(t,e)}catch{}},subscribe:e=>{if(!r)return hr;const n=r=>{const n=r.newValue;r.key===t&&e(n)};return r.addEventListener("storage",n),()=>{r.removeEventListener("storage",n)}}}};function dr(){}function fr(e){if("undefined"!==typeof window&&"function"===typeof window.matchMedia&&"system"===e){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}function mr(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function gr(t){const{defaultMode:r="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:a=[],modeStorageKey:o=lr,colorSchemeStorageKey:s=cr,storageWindow:l=("undefined"===typeof window?void 0:window),storageManager:c=pr,noSsr:u=!1}=t,h=a.join(","),p=a.length>1,d=e.useMemo((()=>c?.({key:o,storageWindow:l})),[c,o,l]),f=e.useMemo((()=>c?.({key:`${s}-light`,storageWindow:l})),[c,s,l]),m=e.useMemo((()=>c?.({key:`${s}-dark`,storageWindow:l})),[c,s,l]),[g,y]=e.useState((()=>{const e=d?.get(r)||r,t=f?.get(n)||n,a=m?.get(i)||i;return{mode:e,systemMode:fr(e),lightColorScheme:t,darkColorScheme:a}})),[v,x]=e.useState(u||!p);e.useEffect((()=>{x(!0)}),[]);const b=function(e){return mr(e,(t=>"light"===t?e.lightColorScheme:"dark"===t?e.darkColorScheme:void 0))}(g),_=e.useCallback((e=>{y((t=>{if(e===t.mode)return t;const n=e??r;return d?.set(n),{...t,mode:n,systemMode:fr(n)}}))}),[d,r]),w=e.useCallback((e=>{e?"string"===typeof e?e&&!h.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):y((t=>{const r={...t};return mr(t,(t=>{"light"===t&&(f?.set(e),r.lightColorScheme=e),"dark"===t&&(m?.set(e),r.darkColorScheme=e)})),r})):y((t=>{const r={...t},a=null===e.light?n:e.light,o=null===e.dark?i:e.dark;return a&&(h.includes(a)?(r.lightColorScheme=a,f?.set(a)):console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)),o&&(h.includes(o)?(r.darkColorScheme=o,m?.set(o)):console.error(`\`${o}\` does not exist in \`theme.colorSchemes\`.`)),r})):y((e=>(f?.set(n),m?.set(i),{...e,lightColorScheme:n,darkColorScheme:i})))}),[h,f,m,n,i]),k=e.useCallback((e=>{"system"===g.mode&&y((t=>{const r=e?.matches?"dark":"light";return t.systemMode===r?t:{...t,systemMode:r}}))}),[g.mode]),T=e.useRef(k);return T.current=k,e.useEffect((()=>{if("function"!==typeof window.matchMedia||!p)return;const e=function(){return T.current(...arguments)},t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>{t.removeListener(e)}}),[p]),e.useEffect((()=>{if(p){const e=d?.subscribe((e=>{e&&!["light","dark","system"].includes(e)||_(e||r)}))||dr,t=f?.subscribe((e=>{e&&!h.match(e)||w({light:e})}))||dr,n=m?.subscribe((e=>{e&&!h.match(e)||w({dark:e})}))||dr;return()=>{e(),t(),n()}}}),[w,_,h,r,l,p,d,f,m]),{...g,mode:v?g.mode:void 0,systemMode:v?g.systemMode:void 0,colorScheme:v?b:void 0,setMode:_,setColorScheme:w}}const yr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,r))};function vr(e){return yr(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function xr(e){if(e.type)return e;if("#"===e.charAt(0))return xr(function(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map((e=>e+e))),r?`rgb${4===r.length?"a":""}(${r.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(Ze(9,e));let n,i=e.substring(t+1,e.length-1);if("color"===r){if(i=i.split(" "),n=i.shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(n))throw new Error(Ze(10,n))}else i=i.split(",");return i=i.map((e=>parseFloat(e))),{type:r,values:i,colorSpace:n}}const br=(e,t)=>{try{return(e=>{const t=xr(e);return t.values.slice(0,3).map(((e,r)=>t.type.includes("hsl")&&0!==r?`${e}%`:e)).join(" ")})(e)}catch(r){return e}};function _r(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map(((e,t)=>t<3?parseInt(e,10):e)):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),n=t.includes("color")?`${r} ${n.join(" ")}`:`${n.join(", ")}`,`${t}(${n})`}function wr(e){e=xr(e);const{values:t}=e,r=t[0],n=t[1]/100,i=t[2]/100,a=n*Math.min(i,1-i),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-a*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const l=[Math.round(255*o(0)),Math.round(255*o(8)),Math.round(255*o(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),_r({type:s,values:l})}function kr(e){let t="hsl"===(e=xr(e)).type||"hsla"===e.type?xr(wr(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Tr(e,t){return e=xr(e),t=vr(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,_r(e)}function Sr(e,t,r){try{return Tr(e,t)}catch(n){return e}}function Ar(e,t){if(e=xr(e),t=vr(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return _r(e)}function Mr(e,t,r){try{return Ar(e,t)}catch(n){return e}}function Er(e,t){if(e=xr(e),t=vr(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return _r(e)}function Cr(e,t,r){try{return Er(e,t)}catch(n){return e}}function Pr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return kr(e)>.5?Ar(e,t):Er(e,t)}function Lr(e,t,r){try{return Pr(e,t)}catch(n){return e}}const Ir={black:"#000",white:"#fff"},zr={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Or={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Rr={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Dr={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},jr={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Fr={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Br={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function Nr(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ir.white,default:Ir.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Ur=Nr();function Vr(){return{text:{primary:Ir.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ir.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const qr=Vr();function Hr(e,t,r,n){const i=n.light||n,a=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=Er(e.main,i):"dark"===t&&(e.dark=Ar(e.main,a)))}function Gr(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,...i}=e,a=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:jr[200],light:jr[50],dark:jr[400]}:{main:jr[700],light:jr[400],dark:jr[800]}}(t),o=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Or[200],light:Or[50],dark:Or[400]}:{main:Or[500],light:Or[300],dark:Or[700]}}(t),s=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Rr[500],light:Rr[300],dark:Rr[700]}:{main:Rr[700],light:Rr[400],dark:Rr[800]}}(t),l=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Fr[400],light:Fr[300],dark:Fr[700]}:{main:Fr[700],light:Fr[500],dark:Fr[900]}}(t),c=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Br[400],light:Br[300],dark:Br[700]}:{main:Br[800],light:Br[500],dark:Br[900]}}(t),u=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Dr[400],light:Dr[300],dark:Dr[700]}:{main:"#ed6c02",light:Dr[500],dark:Dr[900]}}(t);function h(e){const t=function(e,t){const r=kr(e),n=kr(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(e,qr.text.primary)>=r?qr.text.primary:Ur.text.primary;return t}const p=e=>{let{color:t,name:r,mainShade:i=500,lightShade:a=300,darkShade:o=700}=e;if(t={...t},!t.main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw new Error(Ze(11,r?` (${r})`:"",i));if("string"!==typeof t.main)throw new Error(Ze(12,r?` (${r})`:"",JSON.stringify(t.main)));return Hr(t,"light",a,n),Hr(t,"dark",o,n),t.contrastText||(t.contrastText=h(t.main)),t};let d;"light"===t?d=Nr():"dark"===t&&(d=Vr());return Qe({common:{...Ir},mode:t,primary:p({color:a,name:"primary"}),secondary:p({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:s,name:"error"}),warning:p({color:u,name:"warning"}),info:p({color:l,name:"info"}),success:p({color:c,name:"success"}),grey:zr,contrastThreshold:r,getContrastText:h,augmentColor:p,tonalOffset:n,...d},i)}function Wr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";function t(){for(var r=arguments.length,n=new Array(r),i=0;i1?n-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xt({spacing:e});if(e.mui)return e;const r=function(){for(var e=arguments.length,r=new Array(e),n=0;n{const r=t(e);return"number"===typeof r?`${r}px`:r})).join(" ")};return r.mui=!0,r}function Zr(e){const t={};return Object.entries(e).forEach((e=>{const[r,n]=e;"object"===typeof n&&(t[r]=`${n.fontStyle?`${n.fontStyle} `:""}${n.fontVariant?`${n.fontVariant} `:""}${n.fontWeight?`${n.fontWeight} `:""}${n.fontStretch?`${n.fontStretch} `:""}${n.fontSize||""}${n.lineHeight?`/${n.lineHeight} `:""}${n.fontFamily||""}`)})),t}const Xr=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=e;t.forEach(((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=r:i&&"object"===typeof i&&(i[e]=r):i&&"object"===typeof i&&(i[e]||(i[e]=n.includes(e)?[]:{}),i=i[e])}))};function Yr(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},i={},a={},o={};var s,l;return s=(e,t,s)=>{if(("string"===typeof t||"number"===typeof t)&&(!n||!n(e,t))){const n=`--${r?`${r}-`:""}${e.join("-")}`,l=((e,t)=>"number"===typeof t?["lineHeight","fontWeight","opacity","zIndex"].some((t=>e.includes(t)))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t)(e,t);Object.assign(i,{[n]:l}),Xr(a,e,`var(${n})`,s),Xr(o,e,`var(${n}, ${l})`,s)}},l=e=>"vars"===e[0],function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Object.entries(t).forEach((t=>{let[i,a]=t;(!l||l&&!l([...r,i]))&&void 0!==a&&null!==a&&("object"===typeof a&&Object.keys(a).length>0?e(a,[...r,i],Array.isArray(a)?[...n,i]:n):s([...r,i],a,n))}))}(e),{css:i,vars:a,varsWithDefaults:o}}const Kr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{getSelector:r=g,disableCssColorScheme:n,colorSchemeSelector:i}=t,{colorSchemes:a={},components:o,defaultColorScheme:s="light",...l}=e,{vars:c,css:u,varsWithDefaults:h}=Yr(l,t);let p=h;const d={},{[s]:f,...m}=a;if(Object.entries(m||{}).forEach((e=>{let[r,n]=e;const{vars:i,css:a,varsWithDefaults:o}=Yr(n,t);p=Qe(p,o),d[r]={css:a,vars:i}})),f){const{css:e,vars:r,varsWithDefaults:n}=Yr(f,t);p=Qe(p,n),d[s]={css:e,vars:r}}function g(t,r){let n=i;if("class"===i&&(n=".%s"),"data"===i&&(n="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(n=`[${i}="%s"]`),t){if("media"===n){if(e.defaultColorScheme===t)return":root";const n=a[t]?.palette?.mode||t;return{[`@media (prefers-color-scheme: ${n})`]:{":root":r}}}if(n)return e.defaultColorScheme===t?`:root, ${n.replace("%s",String(t))}`:n.replace("%s",String(t))}return":root"}return{vars:p,generateThemeVars:()=>{let e={...c};return Object.entries(d).forEach((t=>{let[,{vars:r}]=t;e=Qe(e,r)})),e},generateStyleSheets:()=>{const t=[],i=e.defaultColorScheme||"light";function o(e,r){Object.keys(r).length&&t.push("string"===typeof e?{[e]:{...r}}:e)}o(r(void 0,{...u}),u);const{[i]:s,...l}=d;if(s){const{css:e}=s,t=a[i]?.palette?.mode,l=!n&&t?{colorScheme:t,...e}:{...e};o(r(i,{...l}),l)}return Object.entries(l).forEach((e=>{let[t,{css:i}]=e;const s=a[t]?.palette?.mode,l=!n&&s?{colorScheme:s,...i}:{...i};o(r(t,{...l}),l)})),t}}};function Jr(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...i}=e,a=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>({...e,[t.key]:t.val})),{})})(t),o=Object.keys(a);function s(e){return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${r})`}function l(e){return`@media (max-width:${("number"===typeof t[e]?t[e]:e)-n/100}${r})`}function c(e,i){const a=o.indexOf(i);return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==a&&"number"===typeof t[o[a]]?t[o[a]]:i)-n/100}${r})`}return{keys:o,values:a,up:s,down:l,between:c,only:function(e){return o.indexOf(e)+10&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:r={},spacing:n,shape:i={},...a}=e;let o=Qe({breakpoints:Jr(t),direction:"ltr",components:{},palette:{mode:"light",...r},spacing:$r(n),shape:{...Qr,...i}},a);o=function(e){const t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function r(r,n){r.up=function(){return t(e.breakpoints.up(...arguments),n)},r.down=function(){return t(e.breakpoints.down(...arguments),n)},r.between=function(){return t(e.breakpoints.between(...arguments),n)},r.only=function(){return t(e.breakpoints.only(...arguments),n)},r.not=function(){const r=t(e.breakpoints.not(...arguments),n);return r.includes("not all and")?r.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):r}}const n={},i=e=>(r(n,e),n);return r(i),{...e,containerQueries:i}}(o),o.applyStyles=en;for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;cQe(e,t)),o),o.unstable_sxConfig={...Qt,...a?.unstable_sxConfig},o.unstable_sx=function(e){return tr({sx:e,theme:this})},o};const rn={textTransform:"uppercase"},nn='"Roboto", "Helvetica", "Arial", sans-serif';function an(e,t){const{fontFamily:r=nn,fontSize:n=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...h}="function"===typeof t?t(e):t;const p=n/14,d=u||(e=>e/l*p+"rem"),f=(e,t,n,i,a)=>{return{fontFamily:r,fontWeight:e,fontSize:d(t),lineHeight:n,...r===nn?{letterSpacing:(o=i/t,Math.round(1e5*o)/1e5)+"em"}:{},...a,...c};var o},m={h1:f(i,96,1.167,-1.5),h2:f(i,60,1.2,-.5),h3:f(a,48,1.167,0),h4:f(a,34,1.235,.25),h5:f(a,24,1.334,0),h6:f(o,20,1.6,.15),subtitle1:f(a,16,1.75,.15),subtitle2:f(o,14,1.57,.1),body1:f(a,16,1.5,.15),body2:f(a,14,1.43,.15),button:f(o,14,1.75,.4,rn),caption:f(a,12,1.66,.4),overline:f(a,12,2.66,1,rn),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Qe({htmlFontSize:l,pxToRem:d,fontFamily:r,fontSize:n,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,...m},h,{clone:!1})}function on(){return[`${arguments.length<=0?void 0:arguments[0]}px ${arguments.length<=1?void 0:arguments[1]}px ${arguments.length<=2?void 0:arguments[2]}px ${arguments.length<=3?void 0:arguments[3]}px rgba(0,0,0,0.2)`,`${arguments.length<=4?void 0:arguments[4]}px ${arguments.length<=5?void 0:arguments[5]}px ${arguments.length<=6?void 0:arguments[6]}px ${arguments.length<=7?void 0:arguments[7]}px rgba(0,0,0,0.14)`,`${arguments.length<=8?void 0:arguments[8]}px ${arguments.length<=9?void 0:arguments[9]}px ${arguments.length<=10?void 0:arguments[10]}px ${arguments.length<=11?void 0:arguments[11]}px rgba(0,0,0,0.12)`].join(",")}const sn=["none",on(0,2,1,-1,0,1,1,0,0,1,3,0),on(0,3,1,-2,0,2,2,0,0,1,5,0),on(0,3,3,-2,0,3,4,0,0,1,8,0),on(0,2,4,-1,0,4,5,0,0,1,10,0),on(0,3,5,-1,0,5,8,0,0,1,14,0),on(0,3,5,-1,0,6,10,0,0,1,18,0),on(0,4,5,-2,0,7,10,1,0,2,16,1),on(0,5,5,-3,0,8,10,1,0,3,14,2),on(0,5,6,-3,0,9,12,1,0,3,16,2),on(0,6,6,-3,0,10,14,1,0,4,18,3),on(0,6,7,-4,0,11,15,1,0,4,20,3),on(0,7,8,-4,0,12,17,2,0,5,22,4),on(0,7,8,-4,0,13,19,2,0,5,24,4),on(0,7,9,-4,0,14,21,2,0,5,26,4),on(0,8,9,-5,0,15,22,2,0,6,28,5),on(0,8,10,-5,0,16,24,2,0,6,30,5),on(0,8,11,-5,0,17,26,2,0,6,32,5),on(0,9,11,-5,0,18,28,2,0,7,34,6),on(0,9,12,-6,0,19,29,2,0,7,36,6),on(0,10,13,-6,0,20,31,3,0,8,38,7),on(0,10,13,-6,0,21,33,3,0,8,40,7),on(0,10,14,-6,0,22,35,3,0,8,42,7),on(0,11,14,-7,0,23,36,3,0,9,44,8),on(0,11,15,-7,0,24,38,3,0,9,46,8)],ln={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},cn={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function un(e){return`${Math.round(e)}ms`}function hn(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function pn(e){const t={...ln,...e.easing},r={...cn,...e.duration};return{getAutoHeightDuration:hn,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:i=r.standard,easing:a=t.easeInOut,delay:o=0,...s}=n;return(Array.isArray(e)?e:[e]).map((e=>`${e} ${"string"===typeof i?i:un(i)} ${a} ${"string"===typeof o?o:un(o)}`)).join(",")},...e,easing:t,duration:r}}const dn={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function fn(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return function e(t){const r=Object.entries(t);for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t,mixins:r={},spacing:n,palette:i={},transitions:a={},typography:o={},shape:s,...l}=e;if(e.vars&&void 0===e.generateThemeVars)throw new Error(Ze(20));const c=Gr(i),u=tn(e);let h=Qe(u,{mixins:(p=u.breakpoints,d=r,{toolbar:{minHeight:56,[p.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[p.up("sm")]:{minHeight:64}},...d}),palette:c,shadows:sn.slice(),typography:an(c,o),transitions:pn(a),zIndex:{...dn}});var p,d;h=Qe(h,l);for(var f=arguments.length,m=new Array(f>1?f-1:0),g=1;gQe(e,t)),h),h.unstable_sxConfig={...Qt,...l?.unstable_sxConfig},h.unstable_sx=function(e){return tr({sx:e,theme:this})},h.toRuntimeSource=fn,h};function gn(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(10*t)/1e3}const yn=[...Array(25)].map(((e,t)=>{if(0===t)return"none";const r=gn(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`}));function vn(e){return{inputPlaceholder:"dark"===e?.5:.42,inputUnderline:"dark"===e?.7:.42,switchTrackDisabled:"dark"===e?.2:.12,switchTrack:"dark"===e?.3:.38}}function xn(e){return"dark"===e?yn:[]}function bn(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const _n=e=>[...[...Array(25)].map(((t,r)=>`--${e?`${e}-`:""}overlays-${r}`)),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],wn=e=>(t,r)=>{const n=e.rootSelector||":root",i=e.colorSchemeSelector;let a=i;if("class"===i&&(a=".%s"),"data"===i&&(a="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if("dark"===t){const i={};return _n(e.cssVarPrefix).forEach((e=>{i[e]=r[e],delete r[e]})),"media"===a?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:i}}:a?{[a.replace("%s",t)]:i,[`${n}, ${a.replace("%s",t)}`]:r}:{[n]:{...r,...i}}}if(a&&"media"!==a)return`${n}, ${a.replace("%s",String(t))}`}else if(t){if("media"===a)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(a)return a.replace("%s",String(t))}return n};function kn(e,t,r){!e[t]&&r&&(e[t]=r)}function Tn(e){return"string"===typeof e&&e.startsWith("hsl")?wr(e):e}function Sn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=br(Tn(e[t])))}const An=e=>{try{return e()}catch(t){}};function Mn(e,t,r,n){if(!t)return;t=!0===t?{}:t;const i="dark"===n?"dark":"light";if(!r)return void(e[n]=function(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...i}=e,a=Gr(t);return{palette:a,opacity:{...vn(a.mode),...r},overlays:n||xn(a.mode),...i}}({...t,palette:{mode:i,...t?.palette}}));const{palette:a,...o}=mn({...r,palette:{mode:i,...t?.palette}});return e[n]={...t,palette:a,opacity:{...vn(i),...t?.opacity},overlays:t?.overlays||xn(i)},o}function En(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{colorSchemes:t={light:!0},defaultColorScheme:r,disableCssColorScheme:n=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:a=bn,colorSchemeSelector:o=(t.light&&t.dark?"media":void 0),rootSelector:s=":root",...l}=e,c=Object.keys(t)[0],u=r||(t.light&&"light"!==c?"light":c),h=function(){return Wr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mui")}(i),{[u]:p,light:d,dark:f,...m}=t,g={...m};let y=p;if(("dark"===u&&!("dark"in t)||"light"===u&&!("light"in t))&&(y=!0),!y)throw new Error(Ze(21,u));const v=Mn(g,y,l,u);d&&!g.light&&Mn(g,d,void 0,"light"),f&&!g.dark&&Mn(g,f,void 0,"dark");let x={defaultColorScheme:u,...v,cssVarPrefix:i,colorSchemeSelector:o,rootSelector:s,getCssVar:h,colorSchemes:g,font:{...Zr(v.typography),...v.font},spacing:(b=l.spacing,"number"===typeof b?`${b}px`:"string"===typeof b||"function"===typeof b||Array.isArray(b)?b:"8px")};var b;Object.keys(x.colorSchemes).forEach((e=>{const t=x.colorSchemes[e].palette,r=e=>{const r=e.split("-"),n=r[1],i=r[2];return h(e,t[n][i])};var n;if("light"===t.mode&&(kn(t.common,"background","#fff"),kn(t.common,"onBackground","#000")),"dark"===t.mode&&(kn(t.common,"background","#000"),kn(t.common,"onBackground","#fff")),n=t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach((e=>{n[e]||(n[e]={})})),"light"===t.mode){kn(t.Alert,"errorColor",Mr(t.error.light,.6)),kn(t.Alert,"infoColor",Mr(t.info.light,.6)),kn(t.Alert,"successColor",Mr(t.success.light,.6)),kn(t.Alert,"warningColor",Mr(t.warning.light,.6)),kn(t.Alert,"errorFilledBg",r("palette-error-main")),kn(t.Alert,"infoFilledBg",r("palette-info-main")),kn(t.Alert,"successFilledBg",r("palette-success-main")),kn(t.Alert,"warningFilledBg",r("palette-warning-main")),kn(t.Alert,"errorFilledColor",An((()=>t.getContrastText(t.error.main)))),kn(t.Alert,"infoFilledColor",An((()=>t.getContrastText(t.info.main)))),kn(t.Alert,"successFilledColor",An((()=>t.getContrastText(t.success.main)))),kn(t.Alert,"warningFilledColor",An((()=>t.getContrastText(t.warning.main)))),kn(t.Alert,"errorStandardBg",Cr(t.error.light,.9)),kn(t.Alert,"infoStandardBg",Cr(t.info.light,.9)),kn(t.Alert,"successStandardBg",Cr(t.success.light,.9)),kn(t.Alert,"warningStandardBg",Cr(t.warning.light,.9)),kn(t.Alert,"errorIconColor",r("palette-error-main")),kn(t.Alert,"infoIconColor",r("palette-info-main")),kn(t.Alert,"successIconColor",r("palette-success-main")),kn(t.Alert,"warningIconColor",r("palette-warning-main")),kn(t.AppBar,"defaultBg",r("palette-grey-100")),kn(t.Avatar,"defaultBg",r("palette-grey-400")),kn(t.Button,"inheritContainedBg",r("palette-grey-300")),kn(t.Button,"inheritContainedHoverBg",r("palette-grey-A100")),kn(t.Chip,"defaultBorder",r("palette-grey-400")),kn(t.Chip,"defaultAvatarColor",r("palette-grey-700")),kn(t.Chip,"defaultIconColor",r("palette-grey-700")),kn(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),kn(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),kn(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),kn(t.LinearProgress,"primaryBg",Cr(t.primary.main,.62)),kn(t.LinearProgress,"secondaryBg",Cr(t.secondary.main,.62)),kn(t.LinearProgress,"errorBg",Cr(t.error.main,.62)),kn(t.LinearProgress,"infoBg",Cr(t.info.main,.62)),kn(t.LinearProgress,"successBg",Cr(t.success.main,.62)),kn(t.LinearProgress,"warningBg",Cr(t.warning.main,.62)),kn(t.Skeleton,"bg",`rgba(${r("palette-text-primaryChannel")} / 0.11)`),kn(t.Slider,"primaryTrack",Cr(t.primary.main,.62)),kn(t.Slider,"secondaryTrack",Cr(t.secondary.main,.62)),kn(t.Slider,"errorTrack",Cr(t.error.main,.62)),kn(t.Slider,"infoTrack",Cr(t.info.main,.62)),kn(t.Slider,"successTrack",Cr(t.success.main,.62)),kn(t.Slider,"warningTrack",Cr(t.warning.main,.62));const e=Lr(t.background.default,.8);kn(t.SnackbarContent,"bg",e),kn(t.SnackbarContent,"color",An((()=>t.getContrastText(e)))),kn(t.SpeedDialAction,"fabHoverBg",Lr(t.background.paper,.15)),kn(t.StepConnector,"border",r("palette-grey-400")),kn(t.StepContent,"border",r("palette-grey-400")),kn(t.Switch,"defaultColor",r("palette-common-white")),kn(t.Switch,"defaultDisabledColor",r("palette-grey-100")),kn(t.Switch,"primaryDisabledColor",Cr(t.primary.main,.62)),kn(t.Switch,"secondaryDisabledColor",Cr(t.secondary.main,.62)),kn(t.Switch,"errorDisabledColor",Cr(t.error.main,.62)),kn(t.Switch,"infoDisabledColor",Cr(t.info.main,.62)),kn(t.Switch,"successDisabledColor",Cr(t.success.main,.62)),kn(t.Switch,"warningDisabledColor",Cr(t.warning.main,.62)),kn(t.TableCell,"border",Cr(Sr(t.divider,1),.88)),kn(t.Tooltip,"bg",Sr(t.grey[700],.92))}if("dark"===t.mode){kn(t.Alert,"errorColor",Cr(t.error.light,.6)),kn(t.Alert,"infoColor",Cr(t.info.light,.6)),kn(t.Alert,"successColor",Cr(t.success.light,.6)),kn(t.Alert,"warningColor",Cr(t.warning.light,.6)),kn(t.Alert,"errorFilledBg",r("palette-error-dark")),kn(t.Alert,"infoFilledBg",r("palette-info-dark")),kn(t.Alert,"successFilledBg",r("palette-success-dark")),kn(t.Alert,"warningFilledBg",r("palette-warning-dark")),kn(t.Alert,"errorFilledColor",An((()=>t.getContrastText(t.error.dark)))),kn(t.Alert,"infoFilledColor",An((()=>t.getContrastText(t.info.dark)))),kn(t.Alert,"successFilledColor",An((()=>t.getContrastText(t.success.dark)))),kn(t.Alert,"warningFilledColor",An((()=>t.getContrastText(t.warning.dark)))),kn(t.Alert,"errorStandardBg",Mr(t.error.light,.9)),kn(t.Alert,"infoStandardBg",Mr(t.info.light,.9)),kn(t.Alert,"successStandardBg",Mr(t.success.light,.9)),kn(t.Alert,"warningStandardBg",Mr(t.warning.light,.9)),kn(t.Alert,"errorIconColor",r("palette-error-main")),kn(t.Alert,"infoIconColor",r("palette-info-main")),kn(t.Alert,"successIconColor",r("palette-success-main")),kn(t.Alert,"warningIconColor",r("palette-warning-main")),kn(t.AppBar,"defaultBg",r("palette-grey-900")),kn(t.AppBar,"darkBg",r("palette-background-paper")),kn(t.AppBar,"darkColor",r("palette-text-primary")),kn(t.Avatar,"defaultBg",r("palette-grey-600")),kn(t.Button,"inheritContainedBg",r("palette-grey-800")),kn(t.Button,"inheritContainedHoverBg",r("palette-grey-700")),kn(t.Chip,"defaultBorder",r("palette-grey-700")),kn(t.Chip,"defaultAvatarColor",r("palette-grey-300")),kn(t.Chip,"defaultIconColor",r("palette-grey-300")),kn(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),kn(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),kn(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),kn(t.LinearProgress,"primaryBg",Mr(t.primary.main,.5)),kn(t.LinearProgress,"secondaryBg",Mr(t.secondary.main,.5)),kn(t.LinearProgress,"errorBg",Mr(t.error.main,.5)),kn(t.LinearProgress,"infoBg",Mr(t.info.main,.5)),kn(t.LinearProgress,"successBg",Mr(t.success.main,.5)),kn(t.LinearProgress,"warningBg",Mr(t.warning.main,.5)),kn(t.Skeleton,"bg",`rgba(${r("palette-text-primaryChannel")} / 0.13)`),kn(t.Slider,"primaryTrack",Mr(t.primary.main,.5)),kn(t.Slider,"secondaryTrack",Mr(t.secondary.main,.5)),kn(t.Slider,"errorTrack",Mr(t.error.main,.5)),kn(t.Slider,"infoTrack",Mr(t.info.main,.5)),kn(t.Slider,"successTrack",Mr(t.success.main,.5)),kn(t.Slider,"warningTrack",Mr(t.warning.main,.5));const e=Lr(t.background.default,.98);kn(t.SnackbarContent,"bg",e),kn(t.SnackbarContent,"color",An((()=>t.getContrastText(e)))),kn(t.SpeedDialAction,"fabHoverBg",Lr(t.background.paper,.15)),kn(t.StepConnector,"border",r("palette-grey-600")),kn(t.StepContent,"border",r("palette-grey-600")),kn(t.Switch,"defaultColor",r("palette-grey-300")),kn(t.Switch,"defaultDisabledColor",r("palette-grey-600")),kn(t.Switch,"primaryDisabledColor",Mr(t.primary.main,.55)),kn(t.Switch,"secondaryDisabledColor",Mr(t.secondary.main,.55)),kn(t.Switch,"errorDisabledColor",Mr(t.error.main,.55)),kn(t.Switch,"infoDisabledColor",Mr(t.info.main,.55)),kn(t.Switch,"successDisabledColor",Mr(t.success.main,.55)),kn(t.Switch,"warningDisabledColor",Mr(t.warning.main,.55)),kn(t.TableCell,"border",Mr(Sr(t.divider,1),.68)),kn(t.Tooltip,"bg",Sr(t.grey[700],.92))}Sn(t.background,"default"),Sn(t.background,"paper"),Sn(t.common,"background"),Sn(t.common,"onBackground"),Sn(t,"divider"),Object.keys(t).forEach((e=>{const r=t[e];"tonalOffset"!==e&&r&&"object"===typeof r&&(r.main&&kn(t[e],"mainChannel",br(Tn(r.main))),r.light&&kn(t[e],"lightChannel",br(Tn(r.light))),r.dark&&kn(t[e],"darkChannel",br(Tn(r.dark))),r.contrastText&&kn(t[e],"contrastTextChannel",br(Tn(r.contrastText))),"text"===e&&(Sn(t[e],"primary"),Sn(t[e],"secondary")),"action"===e&&(r.active&&Sn(t[e],"active"),r.selected&&Sn(t[e],"selected")))}))}));for(var _=arguments.length,w=new Array(_>1?_-1:0),k=1;k<_;k++)w[k-1]=arguments[k];x=w.reduce(((e,t)=>Qe(e,t)),x);const T={prefix:i,disableCssColorScheme:n,shouldSkipGeneratingVar:a,getSelector:wn(x)},{vars:S,generateThemeVars:A,generateStyleSheets:M}=Kr(x,T);return x.vars=S,Object.entries(x.colorSchemes[x.defaultColorScheme]).forEach((e=>{let[t,r]=e;x[t]=r})),x.generateThemeVars=A,x.generateStyleSheets=M,x.generateSpacing=function(){return $r(l.spacing,xt(this))},x.getColorSchemeSelector=function(e){return function(t){return"media"===e?`@media (prefers-color-scheme: ${t})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${t}"] &`:"class"===e?`.${t} &`:"data"===e?`[data-${t}] &`:`${e.replace("%s",t)} &`:"&"}}(o),x.spacing=x.generateSpacing(),x.shouldSkipGeneratingVar=a,x.unstable_sxConfig={...Qt,...l?.unstable_sxConfig},x.unstable_sx=function(e){return tr({sx:e,theme:this})},x.toRuntimeSource=fn,x}function Cn(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...!0!==r&&r,palette:Gr({...!0===r?{}:r.palette,mode:t})})}function Pn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{palette:t,cssVariables:r=!1,colorSchemes:n=(t?void 0:{light:!0}),defaultColorScheme:i=t?.mode,...a}=e,o=i||"light",s=n?.[o],l={...n,...t?{[o]:{..."boolean"!==typeof s&&s,palette:t}}:void 0};for(var c=arguments.length,u=new Array(c>1?c-1:0),h=1;h{},setMode:()=>{},systemMode:void 0},p=e.createContext(void 0),d={},f={},m="string"===typeof c?c:c.light,g="string"===typeof c?c:c.dark;return{CssVarsProvider:function(t){const{children:h,theme:m,modeStorageKey:g=i,colorSchemeStorageKey:y=o,disableTransitionOnChange:v=l,storageManager:x,storageWindow:b=("undefined"===typeof window?void 0:window),documentNode:_=("undefined"===typeof document?void 0:document),colorSchemeNode:w=("undefined"===typeof document?void 0:document.documentElement),disableNestedContext:k=!1,disableStyleSheetGeneration:T=!1,defaultMode:S="system",forceThemeRerender:A=!1,noSsr:M}=t,E=e.useRef(!1),C=a(),P=e.useContext(p),L=!!P&&!k,I=e.useMemo((()=>m||("function"===typeof n?n():n)),[m]),z=I[r],O=z||I,{colorSchemes:R=d,components:D=f,cssVarPrefix:j}=O,F=Object.keys(R).filter((e=>!!R[e])).join(","),B=e.useMemo((()=>F.split(",")),[F]),N="string"===typeof c?c:c.light,U="string"===typeof c?c:c.dark,V=R[N]&&R[U]?S:R[O.defaultColorScheme]?.palette?.mode||O.palette?.mode,{mode:q,setMode:H,systemMode:G,lightColorScheme:W,darkColorScheme:$,colorScheme:Z,setColorScheme:X}=gr({supportedColorSchemes:B,defaultLightColorScheme:N,defaultDarkColorScheme:U,modeStorageKey:g,colorSchemeStorageKey:y,defaultMode:V,storageManager:x,storageWindow:b,noSsr:M});let Y=q,K=Z;L&&(Y=P.mode,K=P.colorScheme);let J=K||O.defaultColorScheme;O.vars&&!A&&(J=O.defaultColorScheme);const Q=e.useMemo((()=>{const e=O.generateThemeVars?.()||O.vars,t={...O,components:D,colorSchemes:R,cssVarPrefix:j,vars:e};if("function"===typeof t.generateSpacing&&(t.spacing=t.generateSpacing()),J){const e=R[J];e&&"object"===typeof e&&Object.keys(e).forEach((r=>{e[r]&&"object"===typeof e[r]?t[r]={...t[r],...e[r]}:t[r]=e[r]}))}return u?u(t):t}),[O,J,D,R,j]),ee=O.colorSchemeSelector;sr((()=>{if(K&&w&&ee&&"media"!==ee){const e=ee;let t=ee;if("class"===e&&(t=".%s"),"data"===e&&(t="[data-%s]"),e?.startsWith("data-")&&!e.includes("%s")&&(t=`[${e}="%s"]`),t.startsWith("."))w.classList.remove(...B.map((e=>t.substring(1).replace("%s",e)))),w.classList.add(t.substring(1).replace("%s",K));else{const e=t.replace("%s",K).match(/\[([^\]]+)\]/);if(e){const[t,r]=e[1].split("=");r||B.forEach((e=>{w.removeAttribute(t.replace(K,e))})),w.setAttribute(t,r?r.replace(/"|'/g,""):"")}else w.setAttribute(t,K)}}}),[K,ee,w,B]),e.useEffect((()=>{let e;if(v&&E.current&&_){const t=_.createElement("style");t.appendChild(_.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),_.head.appendChild(t),window.getComputedStyle(_.body),e=setTimeout((()=>{_.head.removeChild(t)}),1)}return()=>{clearTimeout(e)}}),[K,v,_]),e.useEffect((()=>(E.current=!0,()=>{E.current=!1})),[]);const te=e.useMemo((()=>({allColorSchemes:B,colorScheme:K,darkColorScheme:$,lightColorScheme:W,mode:Y,setColorScheme:X,setMode:H,systemMode:G})),[B,K,$,W,Y,X,H,G,Q.colorSchemeSelector]);let re=!0;(T||!1===O.cssVariables||L&&C?.cssVarPrefix===j)&&(re=!1);const ne=(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(Ge,{themeId:z?r:void 0,theme:Q,children:h}),re&&(0,s.jsx)(or,{styles:Q.generateStyleSheets?.()||[]})]});return L?ne:(0,s.jsx)(p.Provider,{value:te,children:ne})},useColorScheme:()=>e.useContext(p)||h,getInitColorSchemeScript:e=>function(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:i=lr,colorSchemeStorageKey:a=cr,attribute:o=ur,colorSchemeNode:l="document.documentElement",nonce:c}=e||{};let u="",h=o;if("class"===o&&(h=".%s"),"data"===o&&(h="[data-%s]"),h.startsWith(".")){const e=h.substring(1);u+=`${l}.classList.remove('${e}'.replace('%s', light), '${e}'.replace('%s', dark));\n ${l}.classList.add('${e}'.replace('%s', colorScheme));`}const p=h.match(/\[([^\]]+)\]/);if(p){const[e,t]=p[1].split("=");t||(u+=`${l}.removeAttribute('${e}'.replace('%s', light));\n ${l}.removeAttribute('${e}'.replace('%s', dark));`),u+=`\n ${l}.setAttribute('${e}'.replace('%s', colorScheme), ${t?`${t}.replace('%s', colorScheme)`:'""'});`}else u+=`${l}.setAttribute('${h}', colorScheme);`;return(0,s.jsx)("script",{suppressHydrationWarning:!0,nonce:"undefined"===typeof window?c:"",dangerouslySetInnerHTML:{__html:`(function() {\ntry {\n let colorScheme = '';\n const mode = localStorage.getItem('${i}') || '${t}';\n const dark = localStorage.getItem('${a}-dark') || '${n}';\n const light = localStorage.getItem('${a}-light') || '${r}';\n if (mode === 'system') {\n // handle system mode\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = dark\n } else {\n colorScheme = light\n }\n }\n if (mode === 'light') {\n colorScheme = light;\n }\n if (mode === 'dark') {\n colorScheme = dark;\n }\n if (colorScheme) {\n ${u}\n }\n} catch(e){}})();`}},"mui-color-scheme-init")}({colorSchemeStorageKey:o,defaultLightColorScheme:m,defaultDarkColorScheme:g,modeStorageKey:i,...e})}}({themeId:We,theme:()=>Pn({cssVariables:!0}),colorSchemeStorageKey:Ln.colorSchemeStorageKey,modeStorageKey:Ln.modeStorageKey,defaultColorScheme:{light:Ln.defaultLightColorScheme,dark:Ln.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:an(e.palette,e.typography)};return t.unstable_sx=function(e){return tr({sx:e,theme:this})},t}});const Rn=In;function Dn(e){let{theme:t,...r}=e;if("function"===typeof t)return(0,s.jsx)($e,{theme:t,...r});const n=We in t?t[We]:t;return"colorSchemes"in n?(0,s.jsx)(Rn,{theme:t,...r}):"vars"in n?(0,s.jsx)($e,{theme:t,...r}):(0,s.jsx)($e,{theme:{...t,vars:null},...r})}const jn=Pn({palette:{primary:{main:"#1A2536",contrastText:"#D3CDBF"},secondary:{main:"#4A7A7D",contrastText:"#FFFFFF"},text:{primary:"#2E2E2E",secondary:"#1A2536"},background:{default:"#D3CDBF",paper:"#FFFFFF"},action:{active:"#D4A017",hover:"rgba(212, 160, 23, 0.1)"},custom:{highlight:"#D4A017",contrast:"#2E2E2E"}},typography:{fontFamily:"'Roboto', sans-serif",h1:{fontSize:"2rem",fontWeight:500,color:"#2E2E2E"},body1:{fontSize:"1rem",color:"#2E2E2E"}},components:{MuiLink:{styleOverrides:{root:{color:"#4A7A7D",textDecoration:"none","&:hover":{color:"#D4A017",textDecoration:"underline"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none","&:hover":{backgroundColor:"rgba(212, 160, 23, 0.2)"}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"#1A2536"}}}}});function Fn(e){const{theme:t,name:r,props:n}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?Be(t.components[r].defaultProps,n):n}function Bn(t,r,n,i,a){const[o,s]=e.useState((()=>a&&n?n(t).matches:i?i(t).matches:r));return sr((()=>{if(!n)return;const e=n(t),r=()=>{s(e.matches)};return r(),e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}}),[t,n]),o}const Nn={...t}.useSyncExternalStore;function Un(t,r,n,i,a){const o=e.useCallback((()=>r),[r]),s=e.useMemo((()=>{if(a&&n)return()=>n(t).matches;if(null!==i){const{matches:e}=i(t);return()=>e}return o}),[o,t,i,a,n]),[l,c]=e.useMemo((()=>{if(null===n)return[o,()=>()=>{}];const e=n(t);return[()=>e.matches,t=>(e.addEventListener("change",t),()=>{e.removeEventListener("change",t)})]}),[o,n,t]);return Nn(c,l,s)}function Vn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t}=e;return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Re();n&&t&&(n=n[t]||n);const i="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:a=!1,matchMedia:o=(i?window.matchMedia:null),ssrMatchMedia:s=null,noSsr:l=!1}=Fn({name:"MuiUseMediaQuery",props:r,theme:n});let c="function"===typeof e?e(n):e;c=c.replace(/^@media( ?)/m,"");return(void 0!==Nn?Un:Bn)(c,a,o,s,l)}}Vn();const qn=Vn({themeId:We});function Hn(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t2&&void 0!==arguments[2]?arguments[2]:void 0;const n={};for(const i in e){const a=e[i];let o="",s=!0;for(let e=0;e96?Xn:Yn},Jn=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},Qn=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return he(t,r,n),Ae((function(){return pe(t,r,n)})),null},ei=function t(r,n){var i,a,o=r.__emotion_real===r,s=o&&r.__emotion_base||r;void 0!==n&&(i=n.label,a=n.target);var l=Jn(r,n,o),c=l||Kn(s),u=!c("as");return function(){var h=arguments,p=o&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==i&&p.push("label:"+i+";"),null==h[0]||void 0===h[0].raw)p.push.apply(p,h);else{var d=h[0];p.push(d[0]);for(var f=h.length,m=1;m{"function"!==typeof e.style&&(e.style=ni(e.style))})),n}const ai=tn();function oi(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function si(e){return e?(t,r)=>r[e]:null}function li(e,t){const r="function"===typeof t?t(e):t;if(Array.isArray(r))return r.flatMap((t=>li(e,t)));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=r.style;else{const{variants:e,...n}=r;t=n}return ci(e,r.variants,[t])}return r?.isProcessed?r.style:r}function ci(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e:for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:r=ai,rootShouldForwardProp:n=oi,slotShouldForwardProp:i=oi}=e;function a(e){!function(e,t,r){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?r:e.theme[t]||e.theme}(e,t,r)}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}(e,(e=>e.filter((e=>e!==tr))));const{name:r,slot:o,skipVariantsResolver:s,skipSx:l,overridesResolver:c=si(pi(o)),...u}=t,h=void 0!==s?s:o&&"Root"!==o&&"root"!==o||!1,p=l||!1;let d=oi;"Root"===o||"root"===o?d=n:o?d=i:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(d=void 0);const f=ti(e,{shouldForwardProp:d,label:hi(r,o),...u}),m=e=>{if("function"===typeof e&&e.__emotion_real!==e)return function(t){return li(t,e)};if(Ke(e)){const t=ii(e);return t.variants?function(e){return li(e,t)}:t.style}return e},g=function(){const t=[];for(var n=arguments.length,i=new Array(n),o=0;ofi(e)&&"classes"!==e,gi=ui({themeId:We,defaultTheme:di,rootShouldForwardProp:mi});function yi(e){return Ue(e)}const vi=tn();const xi=function(){return Re(arguments.length>0&&void 0!==arguments[0]?arguments[0]:vi)};function bi(){const e=xi(di);return e[We]||e}const _i={theme:void 0};const wi=function(e){let t,r;return function(n){let i=t;return void 0!==i&&n.theme===r||(_i.theme=n.theme,i=ii(e(_i)),t=i,r=n.theme),i}},ki=e=>e,Ti=(()=>{let e=ki;return{configure(t){e=t},generate:t=>e(t),reset(){e=ki}}})(),Si={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ai(e,t){const r=Si[t];return r?`${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui"}-${r}`:`${Ti.generate(e)}-${t}`}function Mi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const n={};return t.forEach((t=>{n[t]=Ai(e,t,r)})),n}function Ei(e){return Ai("MuiPaper",e)}Mi("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Ci=gi("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,"elevation"===r.variant&&t[`elevation${r.elevation}`]]}})(wi((e=>{let{theme:t}=e;return{backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:e=>{let{ownerState:t}=e;return!t.square},style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}}))),Pi=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiPaper"}),n=bi(),{className:i,component:a="div",elevation:o=1,square:l=!1,variant:c="elevation",...u}=r,h={...r,component:a,elevation:o,square:l,variant:c},p=(e=>{const{square:t,elevation:r,variant:n,classes:i}=e;return Wn({root:["root",n,!t&&"rounded","elevation"===n&&`elevation${r}`]},Ei,i)})(h);return(0,s.jsx)(Ci,{as:a,ownerState:h,className:Gn(p.root,i),ref:t,...u,style:{..."elevation"===c&&{"--Paper-shadow":(n.vars||n).shadows[o],...n.vars&&{"--Paper-overlay":n.vars.overlays?.[o]},...!n.vars&&"dark"===n.palette.mode&&{"--Paper-overlay":`linear-gradient(${Tr("#fff",gn(o))}, ${Tr("#fff",gn(o))})`}},...u.style}})}));function Li(e){return Ai("MuiCard",e)}Mi("MuiCard",["root"]);const Ii=gi(Pi,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})({overflow:"hidden"}),zi=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCard"}),{className:n,raised:i=!1,...a}=r,o={...r,raised:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},Li,t)})(o);return(0,s.jsx)(Ii,{className:Gn(l.root,n),elevation:i?8:void 0,ref:t,ownerState:o,...a})})),Oi=Xe;function Ri(e){return Ai("MuiSvgIcon",e)}Mi("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Di=gi("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${Oi(r.color)}`],t[`fontSize${Oi(r.fontSize)}`]]}})(wi((e=>{let{theme:t}=e;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:t.transitions?.create?.("fill",{duration:(t.vars??t).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:t.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:t.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter((e=>{let[,t]=e;return t&&t.main})).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars??t).palette?.[r]?.main}}})),{props:{color:"action"},style:{color:(t.vars??t).palette?.action?.active}},{props:{color:"disabled"},style:{color:(t.vars??t).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}}))),ji=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiSvgIcon"}),{children:i,className:a,color:o="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:h=!1,titleAccess:p,viewBox:d="0 0 24 24",...f}=n,m=e.isValidElement(i)&&"svg"===i.type,g={...n,color:o,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:d,hasSvgAsChild:m},y={};h||(y.viewBox=d);const v=(e=>{const{color:t,fontSize:r,classes:n}=e;return Wn({root:["root","inherit"!==t&&`color${Oi(t)}`,`fontSize${Oi(r)}`]},Ri,n)})(g);return(0,s.jsxs)(Di,{as:l,className:Gn(v.root,a),focusable:"false",color:u,"aria-hidden":!p||void 0,role:p?"img":void 0,ref:r,...y,...f,...m&&i.props,ownerState:g,children:[m?i.props.children:i,p?(0,s.jsx)("title",{children:p}):null]})}));ji.muiName="SvgIcon";const Fi=ji;function Bi(t,r){function n(e,r){return(0,s.jsx)(Fi,{"data-testid":void 0,ref:r,...e,children:t})}return n.muiName=Fi.muiName,e.memo(e.forwardRef(n))}const Ni=Bi((0,s.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));function Ui(e){return Ai("MuiAvatar",e)}Mi("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);function Vi(e,t){"function"===typeof e?e(t):e&&(e.current=t)}function qi(){for(var t=arguments.length,r=new Array(t),n=0;nr.every((e=>null==e))?null:e=>{r.forEach((t=>{Vi(t,e)}))}),r)}const Hi=function(e){return"string"===typeof e};const Gi=function(e,t,r){return void 0===e||Hi(e)?t:{...t,ownerState:{...t.ownerState,...r}}};const Wi=function(e,t,r){return"function"===typeof e?e(t,r):e};const $i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};const r={};return Object.keys(e).filter((r=>r.match(/^on[A-Z]/)&&"function"===typeof e[r]&&!t.includes(r))).forEach((t=>{r[t]=e[t]})),r};const Zi=function(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"===typeof e[t]))).forEach((r=>{t[r]=e[r]})),t};const Xi=function(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:i,className:a}=e;if(!t){const e=Gn(r?.className,a,i?.className,n?.className),t={...r?.style,...i?.style,...n?.style},o={...r,...i,...n};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}const o=$i({...i,...n}),s=Zi(n),l=Zi(i),c=t(o),u=Gn(c?.className,r?.className,a,i?.className,n?.className),h={...c?.style,...r?.style,...i?.style,...n?.style},p={...c,...r,...l,...s};return u.length>0&&(p.className=u),Object.keys(h).length>0&&(p.style=h),{props:p,internalRef:c.ref}};function Yi(e,t){const{className:r,elementType:n,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:h={[e]:void 0},...p}=a,d=u[e]||n,f=Wi(h[e],i),{props:{component:m,...g},internalRef:y}=Xi({className:r,...l,externalForwardedProps:"root"===e?p:void 0,externalSlotProps:f}),v=qi(y,f?.ref,t.ref),x="root"===e?m||c:m;return[d,Gi(d,{..."root"===e&&!c&&!u[e]&&o,..."root"!==e&&!u[e]&&o,...g,...x&&!s&&{as:x},...x&&s&&{component:x},ref:v},i)]}const Ki=gi("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],r.colorDefault&&t.colorDefault]}})(wi((e=>{let{theme:t}=e;return{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}}))),Ji=gi("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Qi=gi(Ni,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});const ea=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiAvatar"}),{alt:i,children:a,className:o,component:l="div",slots:c={},slotProps:u={},imgProps:h,sizes:p,src:d,srcSet:f,variant:m="circular",...g}=n;let y=null;const v={...n,component:l,variant:m},x=function(t){let{crossOrigin:r,referrerPolicy:n,src:i,srcSet:a}=t;const[o,s]=e.useState(!1);return e.useEffect((()=>{if(!i&&!a)return;s(!1);let e=!0;const t=new Image;return t.onload=()=>{e&&s("loaded")},t.onerror=()=>{e&&s("error")},t.crossOrigin=r,t.referrerPolicy=n,t.src=i,a&&(t.srcset=a),()=>{e=!1}}),[r,n,i,a]),o}({...h,..."function"===typeof u.img?u.img(v):u.img,src:d,srcSet:f}),b=d||f,_=b&&"error"!==x;v.colorDefault=!_,delete v.ownerState;const w=(e=>{const{classes:t,variant:r,colorDefault:n}=e;return Wn({root:["root",r,n&&"colorDefault"],img:["img"],fallback:["fallback"]},Ui,t)})(v),[k,T]=Yi("img",{className:w.img,elementType:Ji,externalForwardedProps:{slots:c,slotProps:{img:{...h,...u.img}}},additionalProps:{alt:i,src:d,srcSet:f,sizes:p},ownerState:v});return y=_?(0,s.jsx)(k,{...T}):a||0===a?a:b&&i?i[0]:(0,s.jsx)(Qi,{ownerState:v,className:w.fallback}),(0,s.jsx)(Ki,{as:l,className:Gn(w.root,o),ref:r,...g,ownerState:v,children:y})}));const ta=function(e){const{elementType:t,externalSlotProps:r,ownerState:n,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:Wi(r,n),{props:s,internalRef:l}=Xi({...a,externalSlotProps:o}),c=qi(l,o?.ref,e.additionalProps?.ref);return Gi(t,{...s,ref:c},n)};function ra(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,i=new Array(n),a=0;a{e.apply(this,i)}),r)}return n.clear=()=>{clearTimeout(t)},n}const na=ra;function ia(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}const aa=sr;function oa(e){return e&&e.ownerDocument||document}function sa(e){return oa(e).defaultView||window}const la=sa,ca={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};const ua=Bi((0,s.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),ha=Bi((0,s.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function pa(e){try{return e.matches(":focus-visible")}catch(t){0}return!1}const da=qi;const fa=function(t){const r=e.useRef(t);return sr((()=>{r.current=t})),e.useRef((function(){return(0,r.current)(...arguments)})).current},ma=fa,ga={};function ya(t,r){const n=e.useRef(ga);return n.current===ga&&(n.current=t(r)),n}class va{static create(){return new va}static use(){const t=ya(va.create).current,[r,n]=e.useState(!1);return t.shouldMount=r,t.setShouldMount=n,e.useEffect(t.mountEffect,[r]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n}));return r.resolve=e,r.reject=t,r}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(){for(var e=arguments.length,t=new Array(e),r=0;rthis.ref.current?.start(...t)))}stop(){for(var e=arguments.length,t=new Array(e),r=0;rthis.ref.current?.stop(...t)))}pulsate(){for(var e=arguments.length,t=new Array(e),r=0;rthis.ref.current?.pulsate(...t)))}}function xa(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}function ba(e,t){return ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ba(e,t)}function _a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ba(e,t)}const wa=e.createContext(null);function ka(t,r){var n=Object.create(null);return t&&e.Children.map(t,(function(e){return e})).forEach((function(t){n[t.key]=function(t){return r&&(0,e.isValidElement)(t)?r(t):t}(t)})),n}function Ta(e,t,r){return null!=r[t]?r[t]:e.props[t]}function Sa(t,r,n){var i=ka(t.children),a=function(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var n,i=Object.create(null),a=[];for(var o in e)o in t?a.length&&(i[o]=a,a=[]):a.push(o);var s={};for(var l in t){if(i[l])for(n=0;n{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function La(){const t=ya(Pa.create).current;var r;return r=t.disposeEffect,e.useEffect(r,Ca),t}const Ia=function(t){const{className:r,classes:n,pulsate:i=!1,rippleX:a,rippleY:o,rippleSize:l,in:c,onExited:u,timeout:h}=t,[p,d]=e.useState(!1),f=Gn(r,n.ripple,n.rippleVisible,i&&n.ripplePulsate),m={width:l,height:l,top:-l/2+o,left:-l/2+a},g=Gn(n.child,p&&n.childLeaving,i&&n.childPulsate);return c||p||d(!0),e.useEffect((()=>{if(!c&&null!=u){const e=setTimeout(u,h);return()=>{clearTimeout(e)}}}),[u,c,h]),(0,s.jsx)("span",{className:f,style:m,children:(0,s.jsx)("span",{className:g})})};const za=Mi("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Oa=ar` 0% { transform: scale(0); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } `,Ra=ar` 0% { opacity: 1; } 100% { opacity: 0; } `,Da=ar` 0% { transform: scale(1); } 50% { transform: scale(0.92); } 100% { transform: scale(1); } `,ja=gi("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Fa=gi(Ia,{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; &.${za.rippleVisible} { opacity: 0.3; transform: scale(1); animation-name: ${Oa}; animation-duration: ${550}ms; animation-timing-function: ${e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}}; } &.${za.ripplePulsate} { animation-duration: ${e=>{let{theme:t}=e;return t.transitions.duration.shorter}}ms; } & .${za.child} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${za.childLeaving} { opacity: 0; animation-name: ${Ra}; animation-duration: ${550}ms; animation-timing-function: ${e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}}; } & .${za.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${Da}; animation-duration: 2500ms; animation-timing-function: ${e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}}; animation-iteration-count: infinite; animation-delay: 200ms; } `,Ba=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:a={},className:o,...l}=n,[c,u]=e.useState([]),h=e.useRef(0),p=e.useRef(null);e.useEffect((()=>{p.current&&(p.current(),p.current=null)}),[c]);const d=e.useRef(!1),f=La(),m=e.useRef(null),g=e.useRef(null),y=e.useCallback((e=>{const{pulsate:t,rippleX:r,rippleY:n,rippleSize:i,cb:o}=e;u((e=>[...e,(0,s.jsx)(Fa,{classes:{ripple:Gn(a.ripple,za.ripple),rippleVisible:Gn(a.rippleVisible,za.rippleVisible),ripplePulsate:Gn(a.ripplePulsate,za.ripplePulsate),child:Gn(a.child,za.child),childLeaving:Gn(a.childLeaving,za.childLeaving),childPulsate:Gn(a.childPulsate,za.childPulsate)},timeout:550,pulsate:t,rippleX:r,rippleY:n,rippleSize:i},h.current)])),h.current+=1,p.current=o}),[a]),v=e.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:n=!1,center:a=i||t.pulsate,fakeElement:o=!1}=t;if("mousedown"===e?.type&&d.current)return void(d.current=!1);"touchstart"===e?.type&&(d.current=!0);const s=o?null:g.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,h;if(a||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:r}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(r-l.top)}if(a)h=Math.sqrt((2*l.width**2+l.height**2)/3),h%2===0&&(h+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;h=Math.sqrt(e**2+t**2)}e?.touches?null===m.current&&(m.current=()=>{y({pulsate:n,rippleX:c,rippleY:u,rippleSize:h,cb:r})},f.start(80,(()=>{m.current&&(m.current(),m.current=null)}))):y({pulsate:n,rippleX:c,rippleY:u,rippleSize:h,cb:r})}),[i,y,f]),x=e.useCallback((()=>{v({},{pulsate:!0})}),[v]),b=e.useCallback(((e,t)=>{if(f.clear(),"touchend"===e?.type&&m.current)return m.current(),m.current=null,void f.start(0,(()=>{b(e,t)}));m.current=null,u((e=>e.length>0?e.slice(1):e)),p.current=t}),[f]);return e.useImperativeHandle(r,(()=>({pulsate:x,start:v,stop:b})),[x,v,b]),(0,s.jsx)(ja,{className:Gn(za.root,a.root,o),ref:g,...l,children:(0,s.jsx)(Ea,{component:null,exit:!0,children:c})})}));function Na(e){return Ai("MuiButtonBase",e)}const Ua=Mi("MuiButtonBase",["root","disabled","focusVisible"]),Va=gi("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Ua.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}});function qa(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return ma((i=>(r&&r(i),n||e[t](i),!0)))}const Ha=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:a=!1,children:o,className:l,component:c="button",disabled:u=!1,disableRipple:h=!1,disableTouchRipple:p=!1,focusRipple:d=!1,focusVisibleClassName:f,LinkComponent:m="a",onBlur:g,onClick:y,onContextMenu:v,onDragLeave:x,onFocus:b,onFocusVisible:_,onKeyDown:w,onKeyUp:k,onMouseDown:T,onMouseLeave:S,onMouseUp:A,onTouchEnd:M,onTouchMove:E,onTouchStart:C,tabIndex:P=0,TouchRippleProps:L,touchRippleRef:I,type:z,...O}=n,R=e.useRef(null),D=va.use(),j=da(D.ref,I),[F,B]=e.useState(!1);u&&F&&B(!1),e.useImperativeHandle(i,(()=>({focusVisible:()=>{B(!0),R.current.focus()}})),[]);const N=D.shouldMount&&!h&&!u;e.useEffect((()=>{F&&d&&!h&&D.pulsate()}),[h,d,F,D]);const U=qa(D,"start",T,p),V=qa(D,"stop",v,p),q=qa(D,"stop",x,p),H=qa(D,"stop",A,p),G=qa(D,"stop",(e=>{F&&e.preventDefault(),S&&S(e)}),p),W=qa(D,"start",C,p),$=qa(D,"stop",M,p),Z=qa(D,"stop",E,p),X=qa(D,"stop",(e=>{pa(e.target)||B(!1),g&&g(e)}),!1),Y=ma((e=>{R.current||(R.current=e.currentTarget),pa(e.target)&&(B(!0),_&&_(e)),b&&b(e)})),K=()=>{const e=R.current;return c&&"button"!==c&&!("A"===e.tagName&&e.href)},J=ma((e=>{d&&!e.repeat&&F&&" "===e.key&&D.stop(e,(()=>{D.start(e)})),e.target===e.currentTarget&&K()&&" "===e.key&&e.preventDefault(),w&&w(e),e.target===e.currentTarget&&K()&&"Enter"===e.key&&!u&&(e.preventDefault(),y&&y(e))})),Q=ma((e=>{d&&" "===e.key&&F&&!e.defaultPrevented&&D.stop(e,(()=>{D.pulsate(e)})),k&&k(e),y&&e.target===e.currentTarget&&K()&&" "===e.key&&!e.defaultPrevented&&y(e)}));let ee=c;"button"===ee&&(O.href||O.to)&&(ee=m);const te={};"button"===ee?(te.type=void 0===z?"button":z,te.disabled=u):(O.href||O.to||(te.role="button"),u&&(te["aria-disabled"]=u));const re=da(r,R),ne={...n,centerRipple:a,component:c,disabled:u,disableRipple:h,disableTouchRipple:p,focusRipple:d,tabIndex:P,focusVisible:F},ie=(e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:i}=e,a=Wn({root:["root",t&&"disabled",r&&"focusVisible"]},Na,i);return r&&n&&(a.root+=` ${n}`),a})(ne);return(0,s.jsxs)(Va,{as:ee,className:Gn(ie.root,l),ownerState:ne,onBlur:X,onClick:y,onContextMenu:V,onFocus:Y,onKeyDown:J,onKeyUp:Q,onMouseDown:U,onMouseLeave:G,onMouseUp:H,onDragLeave:q,onTouchEnd:$,onTouchMove:Z,onTouchStart:W,ref:re,tabIndex:u?-1:P,type:z,...te,...O,children:[o,N?(0,s.jsx)(Ba,{ref:j,center:a,...L}):null]})}));function Ga(e){return Ai("MuiTabScrollButton",e)}const Wa=Mi("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),$a=gi(Ha,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.orientation&&t[r.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Wa.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Za=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTabScrollButton"}),{className:n,slots:i={},slotProps:a={},direction:o,orientation:l,disabled:c,...u}=r,h=je(),p={isRtl:h,...r},d=(e=>{const{classes:t,orientation:r,disabled:n}=e;return Wn({root:["root",r,n&&"disabled"]},Ga,t)})(p),f=i.StartScrollButtonIcon??ua,m=i.EndScrollButtonIcon??ha,g=ta({elementType:f,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p}),y=ta({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p});return(0,s.jsx)($a,{component:"div",className:Gn(d.root,n),ref:t,role:null,ownerState:p,tabIndex:null,...u,style:{...u.style,..."vertical"===l&&{"--TabScrollButton-svgRotate":`rotate(${h?-90:90}deg)`}},children:"left"===o?(0,s.jsx)(f,{...g}):(0,s.jsx)(m,{...y})})}));function Xa(e){return Ai("MuiTabs",e)}const Ya=Mi("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ka=oa,Ja=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Qa=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,eo=(e,t,r)=>{let n=!1,i=r(e,t);for(;i;){if(i===e.firstChild){if(n)return;n=!0}const t=i.disabled||"true"===i.getAttribute("aria-disabled");if(i.hasAttribute("tabindex")&&!t)return void i.focus();i=r(e,i)}},to=gi("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Ya.scrollButtons}`]:t.scrollButtons},{[`& .${Ya.scrollButtons}`]:r.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,r.vertical&&t.vertical]}})(wi((e=>{let{theme:t}=e;return{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:e=>{let{ownerState:t}=e;return t.vertical},style:{flexDirection:"column"}},{props:e=>{let{ownerState:t}=e;return t.scrollButtonsHideMobile},style:{[`& .${Ya.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}}))),ro=gi("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.scroller,r.fixed&&t.fixed,r.hideScrollbar&&t.hideScrollbar,r.scrollableX&&t.scrollableX,r.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:e=>{let{ownerState:t}=e;return t.fixed},style:{overflowX:"hidden",width:"100%"}},{props:e=>{let{ownerState:t}=e;return t.hideScrollbar},style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:e=>{let{ownerState:t}=e;return t.scrollableX},style:{overflowX:"auto",overflowY:"hidden"}},{props:e=>{let{ownerState:t}=e;return t.scrollableY},style:{overflowY:"auto",overflowX:"hidden"}}]}),no=gi("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.list,t.flexContainer,r.vertical&&t.flexContainerVertical,r.centered&&t.centered]}})({display:"flex",variants:[{props:e=>{let{ownerState:t}=e;return t.vertical},style:{flexDirection:"column"}},{props:e=>{let{ownerState:t}=e;return t.centered},style:{justifyContent:"center"}}]}),io=gi("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(wi((e=>{let{theme:t}=e;return{position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:e=>{let{ownerState:t}=e;return t.vertical},style:{height:"100%",width:2,right:0}}]}}))),ao=gi((function(t){const{onChange:r,...n}=t,i=e.useRef(),a=e.useRef(null),o=()=>{i.current=a.current.offsetHeight-a.current.clientHeight};return aa((()=>{const e=na((()=>{const e=i.current;o(),e!==i.current&&r(i.current)})),t=la(a.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[r]),e.useEffect((()=>{o(),r(i.current)}),[r]),(0,s.jsx)("div",{style:ca,...n,ref:a})}))({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),oo={};const so=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTabs"}),i=bi(),a=je(),{"aria-label":o,"aria-labelledby":l,action:c,centered:u=!1,children:h,className:p,component:d="div",allowScrollButtonsMobile:f=!1,indicatorColor:m="primary",onChange:g,orientation:y="horizontal",ScrollButtonComponent:v,scrollButtons:x="auto",selectionFollowsFocus:b,slots:_={},slotProps:w={},TabIndicatorProps:k={},TabScrollButtonProps:T={},textColor:S="primary",value:A,variant:M="standard",visibleScrollbar:E=!1,...C}=n,P="scrollable"===M,L="vertical"===y,I=L?"scrollTop":"scrollLeft",z=L?"top":"left",O=L?"bottom":"right",R=L?"clientHeight":"clientWidth",D=L?"height":"width",j={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:m,orientation:y,vertical:L,scrollButtons:x,textColor:S,variant:M,visibleScrollbar:E,fixed:!P,hideScrollbar:P&&!E,scrollableX:P&&!L,scrollableY:P&&L,centered:u&&!P,scrollButtonsHideMobile:!f},F=(e=>{const{vertical:t,fixed:r,hideScrollbar:n,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:l}=e;return Wn({root:["root",t&&"vertical"],scroller:["scroller",r&&"fixed",n&&"hideScrollbar",i&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",o&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[n&&"hideScrollbar"]},Xa,l)})(j),B=ta({elementType:_.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:j}),N=ta({elementType:_.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:j});const[U,V]=e.useState(!1),[q,H]=e.useState(oo),[G,W]=e.useState(!1),[$,Z]=e.useState(!1),[X,Y]=e.useState(!1),[K,J]=e.useState({overflow:"hidden",scrollbarWidth:0}),Q=new Map,ee=e.useRef(null),te=e.useRef(null),re={slots:_,slotProps:{indicator:k,scrollButton:T,...w}},ne=()=>{const e=ee.current;let t,r;if(e){const r=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(e&&!1!==A){const e=te.current.children;if(e.length>0){const t=e[Q.get(A)];0,r=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:r}},ie=ma((()=>{const{tabsMeta:e,tabMeta:t}=ne();let r,n=0;L?(r="top",t&&e&&(n=t.top-e.top+e.scrollTop)):(r=a?"right":"left",t&&e&&(n=(a?-1:1)*(t[r]-e[r]+e.scrollLeft)));const i={[r]:n,[D]:t?t[D]:0};if("number"!==typeof q[r]||"number"!==typeof q[D])H(i);else{const e=Math.abs(q[r]-i[r]),t=Math.abs(q[D]-i[D]);(e>=1||t>=1)&&H(i)}})),ae=function(e){let{animation:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t?function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{};const{ease:a=ia,duration:o=300}=n;let s=null;const l=t[e];let c=!1;const u=()=>{c=!0},h=n=>{if(c)return void i(new Error("Animation cancelled"));null===s&&(s=n);const u=Math.min(1,(n-s)/o);t[e]=a(u)*(r-l)+l,u>=1?requestAnimationFrame((()=>{i(null)})):requestAnimationFrame(h)};l===r?i(new Error("Element already at target position")):requestAnimationFrame(h)}(I,ee.current,e,{duration:i.transitions.duration.standard}):ee.current[I]=e},oe=e=>{let t=ee.current[I];t+=L?e:e*(a?-1:1),ae(t)},se=()=>{const e=ee.current[R];let t=0;const r=Array.from(te.current.children);for(let n=0;ne){0===n&&(t=e);break}t+=i[R]}return t},le=()=>{oe(-1*se())},ce=()=>{oe(se())},[ue,{onChange:he,...pe}]=Yi("scrollbar",{className:Gn(F.scrollableX,F.hideScrollbar),elementType:ao,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:j}),de=e.useCallback((e=>{he?.(e),J({overflow:null,scrollbarWidth:e})}),[he]),[fe,me]=Yi("scrollButtons",{className:Gn(F.scrollButtons,T.className),elementType:Za,externalForwardedProps:re,ownerState:j,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:_.startScrollButtonIcon||_.StartScrollButtonIcon,EndScrollButtonIcon:_.endScrollButtonIcon||_.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:B,endScrollButtonIcon:N}}}),ge=ma((e=>{const{tabsMeta:t,tabMeta:r}=ne();if(r&&t)if(r[z]t[O]){const n=t[I]+(r[O]-t[O]);ae(n,{animation:e})}})),ye=ma((()=>{P&&!1!==x&&Y(!X)}));e.useEffect((()=>{const e=na((()=>{ee.current&&ie()}));let t;const r=r=>{r.forEach((e=>{e.removedNodes.forEach((e=>{t?.unobserve(e)})),e.addedNodes.forEach((e=>{t?.observe(e)}))})),e(),ye()},n=la(ee.current);let i;return n.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(te.current.children).forEach((e=>{t.observe(e)}))),"undefined"!==typeof MutationObserver&&(i=new MutationObserver(r),i.observe(te.current,{childList:!0})),()=>{e.clear(),n.removeEventListener("resize",e),i?.disconnect(),t?.disconnect()}}),[ie,ye]),e.useEffect((()=>{const e=Array.from(te.current.children),t=e.length;if("undefined"!==typeof IntersectionObserver&&t>0&&P&&!1!==x){const r=e[0],n=e[t-1],i={root:ee.current,threshold:.99},a=new IntersectionObserver((e=>{W(!e[0].isIntersecting)}),i);a.observe(r);const o=new IntersectionObserver((e=>{Z(!e[0].isIntersecting)}),i);return o.observe(n),()=>{a.disconnect(),o.disconnect()}}}),[P,x,X,h?.length]),e.useEffect((()=>{V(!0)}),[]),e.useEffect((()=>{ie()})),e.useEffect((()=>{ge(oo!==q)}),[ge,q]),e.useImperativeHandle(c,(()=>({updateIndicator:ie,updateScrollButtons:ye})),[ie,ye]);const[ve,xe]=Yi("indicator",{className:Gn(F.indicator,k.className),elementType:io,externalForwardedProps:re,ownerState:j,additionalProps:{style:q}}),be=(0,s.jsx)(ve,{...xe});let _e=0;const we=e.Children.map(h,(t=>{if(!e.isValidElement(t))return null;const r=void 0===t.props.value?_e:t.props.value;Q.set(r,_e);const n=r===A;return _e+=1,e.cloneElement(t,{fullWidth:"fullWidth"===M,indicator:n&&!U&&be,selected:n,selectionFollowsFocus:b,onChange:g,textColor:S,value:r,...1!==_e||!1!==A||t.props.tabIndex?{}:{tabIndex:0}})})),ke=(()=>{const e={};e.scrollbarSizeListener=P?(0,s.jsx)(ue,{...pe,onChange:de}):null;const t=P&&("auto"===x&&(G||$)||!0===x);return e.scrollButtonStart=t?(0,s.jsx)(fe,{direction:a?"right":"left",onClick:le,disabled:!G,...me}):null,e.scrollButtonEnd=t?(0,s.jsx)(fe,{direction:a?"left":"right",onClick:ce,disabled:!$,...me}):null,e})(),[Te,Se]=Yi("root",{ref:r,className:Gn(F.root,p),elementType:to,externalForwardedProps:{...re,...C,component:d},ownerState:j}),[Ae,Me]=Yi("scroller",{ref:ee,className:F.scroller,elementType:ro,externalForwardedProps:re,ownerState:j,additionalProps:{style:{overflow:K.overflow,[L?"margin"+(a?"Left":"Right"):"marginBottom"]:E?void 0:-K.scrollbarWidth}}}),[Ee,Ce]=Yi("list",{ref:te,className:Gn(F.list,F.flexContainer),elementType:no,externalForwardedProps:re,ownerState:j,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const t=te.current,r=Ka(t).activeElement;if("tab"!==r.getAttribute("role"))return;let n="horizontal"===y?"ArrowLeft":"ArrowUp",i="horizontal"===y?"ArrowRight":"ArrowDown";switch("horizontal"===y&&a&&(n="ArrowRight",i="ArrowLeft"),e.key){case n:e.preventDefault(),eo(t,r,Qa);break;case i:e.preventDefault(),eo(t,r,Ja);break;case"Home":e.preventDefault(),eo(t,null,Ja);break;case"End":e.preventDefault(),eo(t,null,Qa)}})(t),e.onKeyDown?.(t)}})});return(0,s.jsxs)(Te,{...Se,children:[ke.scrollButtonStart,ke.scrollbarSizeListener,(0,s.jsxs)(Ae,{...Me,children:[(0,s.jsx)(Ee,{"aria-label":o,"aria-labelledby":l,"aria-orientation":"vertical"===y?"vertical":null,role:"tablist",...Ce,children:we}),U&&be]}),ke.scrollButtonEnd]})}));function lo(e){return Ai("MuiTab",e)}const co=Mi("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),uo=gi(Ha,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.label&&r.icon&&t.labelIcon,t[`textColor${Oi(r.textColor)}`],r.fullWidth&&t.fullWidth,r.wrapped&&t.wrapped,{[`& .${co.iconWrapper}`]:t.iconWrapper},{[`& .${co.icon}`]:t.icon}]}})(wi((e=>{let{theme:t}=e;return{...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:e=>{let{ownerState:t}=e;return t.label&&("top"===t.iconPosition||"bottom"===t.iconPosition)},style:{flexDirection:"column"}},{props:e=>{let{ownerState:t}=e;return t.label&&"top"!==t.iconPosition&&"bottom"!==t.iconPosition},style:{flexDirection:"row"}},{props:e=>{let{ownerState:t}=e;return t.icon&&t.label},style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"top"===r},style:{[`& > .${co.icon}`]:{marginBottom:6}}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"bottom"===r},style:{[`& > .${co.icon}`]:{marginTop:6}}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"start"===r},style:{[`& > .${co.icon}`]:{marginRight:t.spacing(1)}}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"end"===r},style:{[`& > .${co.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${co.selected}`]:{opacity:1},[`&.${co.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${co.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${co.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${co.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${co.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:e=>{let{ownerState:t}=e;return t.wrapped},style:{fontSize:t.typography.pxToRem(12)}}]}}))),ho=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTab"}),{className:i,disabled:a=!1,disableFocusRipple:o=!1,fullWidth:l,icon:c,iconPosition:u="top",indicator:h,label:p,onChange:d,onClick:f,onFocus:m,selected:g,selectionFollowsFocus:y,textColor:v="inherit",value:x,wrapped:b=!1,..._}=n,w={...n,disabled:a,disableFocusRipple:o,selected:g,icon:!!c,iconPosition:u,label:!!p,fullWidth:l,textColor:v,wrapped:b},k=(e=>{const{classes:t,textColor:r,fullWidth:n,wrapped:i,icon:a,label:o,selected:s,disabled:l}=e;return Wn({root:["root",a&&o&&"labelIcon",`textColor${Oi(r)}`,n&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]},lo,t)})(w),T=c&&p&&e.isValidElement(c)?e.cloneElement(c,{className:Gn(k.icon,c.props.className)}):c;return(0,s.jsxs)(uo,{focusRipple:!o,className:Gn(k.root,i),ref:r,role:"tab","aria-selected":g,disabled:a,onClick:e=>{!g&&d&&d(e,x),f&&f(e)},onFocus:e=>{y&&!g&&d&&d(e,x),m&&m(e)},ownerState:w,tabIndex:g?0:-1,..._,children:["top"===u||"start"===u?(0,s.jsxs)(e.Fragment,{children:[T,p]}):(0,s.jsxs)(e.Fragment,{children:[p,T]}),h]})}));function po(t){return parseInt(e.version,10)>=19?t?.props?.ref||null:t?.ref||null}var fo=r(950);const mo=!1;var go="unmounted",yo="exited",vo="entering",xo="entered",bo="exiting",_o=function(t){function r(e,r){var n;n=t.call(this,e,r)||this;var i,a=r&&!r.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?a?(i=yo,n.appearStatus=vo):i=xo:i=e.unmountOnExit||e.mountOnEnter?go:yo,n.state={status:i},n.nextCallback=null,n}_a(r,t),r.getDerivedStateFromProps=function(e,t){return e.in&&t.status===go?{status:yo}:null};var n=r.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==vo&&r!==xo&&(t=vo):r!==vo&&r!==xo||(t=bo)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!==typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===vo){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:fo.findDOMNode(this);r&&function(e){e.scrollTop}(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yo&&this.setState({status:go})},n.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[fo.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),l=n?s.appear:s.enter;!e&&!r||mo?this.safeSetState({status:xo},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:vo},(function(){t.props.onEntering(a,o),t.onTransitionEnd(l,(function(){t.safeSetState({status:xo},(function(){t.props.onEntered(a,o)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:fo.findDOMNode(this);t&&!mo?(this.props.onExit(n),this.safeSetState({status:bo},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:yo},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:yo},(function(){e.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:fo.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===go)return null;var r=this.props,n=r.children,i=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,xa(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return e.createElement(wa.Provider,{value:null},"function"===typeof n?n(t,i):e.cloneElement(e.Children.only(n),i))},r}(e.Component);function wo(){}_o.contextType=wa,_o.propTypes={},_o.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:wo,onEntering:wo,onEntered:wo,onExit:wo,onExiting:wo,onExited:wo},_o.UNMOUNTED=go,_o.EXITED=yo,_o.ENTERING=vo,_o.ENTERED=xo,_o.EXITING=bo;const ko=_o,To=e=>e.scrollTop;function So(e,t){const{timeout:r,easing:n,style:i={}}=e;return{duration:i.transitionDuration??("number"===typeof r?r:r[t.mode]||0),easing:i.transitionTimingFunction??("object"===typeof n?n[t.mode]:n),delay:i.transitionDelay}}function Ao(e){return`scale(${e}, ${e**2})`}const Mo={entering:{opacity:1,transform:Ao(1)},entered:{opacity:1,transform:"none"}},Eo="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Co=e.forwardRef((function(t,r){const{addEndListener:n,appear:i=!0,children:a,easing:o,in:l,onEnter:c,onEntered:u,onEntering:h,onExit:p,onExited:d,onExiting:f,style:m,timeout:g="auto",TransitionComponent:y=ko,...v}=t,x=La(),b=e.useRef(),_=bi(),w=e.useRef(null),k=da(w,po(a),r),T=e=>t=>{if(e){const r=w.current;void 0===t?e(r):e(r,t)}},S=T(h),A=T(((e,t)=>{To(e);const{duration:r,delay:n,easing:i}=So({style:m,timeout:g,easing:o},{mode:"enter"});let a;"auto"===g?(a=_.transitions.getAutoHeightDuration(e.clientHeight),b.current=a):a=r,e.style.transition=[_.transitions.create("opacity",{duration:a,delay:n}),_.transitions.create("transform",{duration:Eo?a:.666*a,delay:n,easing:i})].join(","),c&&c(e,t)})),M=T(u),E=T(f),C=T((e=>{const{duration:t,delay:r,easing:n}=So({style:m,timeout:g,easing:o},{mode:"exit"});let i;"auto"===g?(i=_.transitions.getAutoHeightDuration(e.clientHeight),b.current=i):i=t,e.style.transition=[_.transitions.create("opacity",{duration:i,delay:r}),_.transitions.create("transform",{duration:Eo?i:.666*i,delay:Eo?r:r||.333*i,easing:n})].join(","),e.style.opacity=0,e.style.transform=Ao(.75),p&&p(e)})),P=T(d);return(0,s.jsx)(y,{appear:i,in:l,nodeRef:w,onEnter:A,onEntered:M,onEntering:S,onExit:C,onExited:P,onExiting:E,addEndListener:e=>{"auto"===g&&x.start(b.current||0,e),n&&n(w.current,e)},timeout:"auto"===g?null:g,...v,children:(t,r)=>{let{ownerState:n,...i}=r;return e.cloneElement(a,{style:{opacity:0,transform:Ao(.75),visibility:"exited"!==t||l?void 0:"hidden",...Mo[t],...m,...a.props.style},ref:k,...i})}})}));Co&&(Co.muiSupportAuto=!0);const Po=Co;function Lo(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Io(e){return e instanceof Lo(e).Element||e instanceof Element}function zo(e){return e instanceof Lo(e).HTMLElement||e instanceof HTMLElement}function Oo(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Lo(e).ShadowRoot||e instanceof ShadowRoot)}var Ro=Math.max,Do=Math.min,jo=Math.round;function Fo(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Bo(){return!/^((?!chrome|android).)*safari/i.test(Fo())}function No(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),i=1,a=1;t&&zo(e)&&(i=e.offsetWidth>0&&jo(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&jo(n.height)/e.offsetHeight||1);var o=(Io(e)?Lo(e):window).visualViewport,s=!Bo()&&r,l=(n.left+(s&&o?o.offsetLeft:0))/i,c=(n.top+(s&&o?o.offsetTop:0))/a,u=n.width/i,h=n.height/a;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function Uo(e){var t=Lo(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Vo(e){return e?(e.nodeName||"").toLowerCase():null}function qo(e){return((Io(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ho(e){return No(qo(e)).left+Uo(e).scrollLeft}function Go(e){return Lo(e).getComputedStyle(e)}function Wo(e){var t=Go(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function $o(e,t,r){void 0===r&&(r=!1);var n=zo(t),i=zo(t)&&function(e){var t=e.getBoundingClientRect(),r=jo(t.width)/e.offsetWidth||1,n=jo(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),a=qo(t),o=No(e,i,r),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&(("body"!==Vo(t)||Wo(a))&&(s=function(e){return e!==Lo(e)&&zo(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:Uo(e);var t}(t)),zo(t)?((l=No(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=Ho(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function Zo(e){var t=No(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Xo(e){return"html"===Vo(e)?e:e.assignedSlot||e.parentNode||(Oo(e)?e.host:null)||qo(e)}function Yo(e){return["html","body","#document"].indexOf(Vo(e))>=0?e.ownerDocument.body:zo(e)&&Wo(e)?e:Yo(Xo(e))}function Ko(e,t){var r;void 0===t&&(t=[]);var n=Yo(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),a=Lo(n),o=i?[a].concat(a.visualViewport||[],Wo(n)?n:[]):n,s=t.concat(o);return i?s:s.concat(Ko(Xo(o)))}function Jo(e){return["table","td","th"].indexOf(Vo(e))>=0}function Qo(e){return zo(e)&&"fixed"!==Go(e).position?e.offsetParent:null}function es(e){for(var t=Lo(e),r=Qo(e);r&&Jo(r)&&"static"===Go(r).position;)r=Qo(r);return r&&("html"===Vo(r)||"body"===Vo(r)&&"static"===Go(r).position)?t:r||function(e){var t=/firefox/i.test(Fo());if(/Trident/i.test(Fo())&&zo(e)&&"fixed"===Go(e).position)return null;var r=Xo(e);for(Oo(r)&&(r=r.host);zo(r)&&["html","body"].indexOf(Vo(r))<0;){var n=Go(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var ts="top",rs="bottom",ns="right",is="left",as="auto",os=[ts,rs,ns,is],ss="start",ls="end",cs="viewport",us="popper",hs=os.reduce((function(e,t){return e.concat([t+"-"+ss,t+"-"+ls])}),[]),ps=[].concat(os,[as]).reduce((function(e,t){return e.concat([t,t+"-"+ss,t+"-"+ls])}),[]),ds=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function fs(e){var t=new Map,r=new Set,n=[];function i(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!r.has(e)){var n=t.get(e);n&&i(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){r.has(e.name)||i(e)})),n}function ms(e){var t;return function(){return t||(t=new Promise((function(r){Promise.resolve().then((function(){t=void 0,r(e())}))}))),t}}var gs={placement:"bottom",modifiers:[],strategy:"absolute"};function ys(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function ks(e){var t,r=e.reference,n=e.element,i=e.placement,a=i?bs(i):null,o=i?_s(i):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case ts:t={x:s,y:r.y-n.height};break;case rs:t={x:s,y:r.y+r.height};break;case ns:t={x:r.x+r.width,y:l};break;case is:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?ws(a):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case ss:t[c]=t[c]-(r[u]/2-n[u]/2);break;case ls:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Ts={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ss(e){var t,r=e.popper,n=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,h=e.isFixed,p=o.x,d=void 0===p?0:p,f=o.y,m=void 0===f?0:f,g="function"===typeof u?u({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),x=is,b=ts,_=window;if(c){var w=es(r),k="clientHeight",T="clientWidth";if(w===Lo(r)&&"static"!==Go(w=qo(r)).position&&"absolute"===s&&(k="scrollHeight",T="scrollWidth"),i===ts||(i===is||i===ns)&&a===ls)b=rs,m-=(h&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,m*=l?1:-1;if(i===is||(i===ts||i===rs)&&a===ls)x=ns,d-=(h&&w===_&&_.visualViewport?_.visualViewport.width:w[T])-n.width,d*=l?1:-1}var S,A=Object.assign({position:s},c&&Ts),M=!0===u?function(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:jo(r*i)/i||0,y:jo(n*i)/i||0}}({x:d,y:m},Lo(r)):{x:d,y:m};return d=M.x,m=M.y,l?Object.assign({},A,((S={})[b]=v?"0":"",S[x]=y?"0":"",S.transform=(_.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",S)):Object.assign({},A,((t={})[b]=v?m+"px":"",t[x]=y?d+"px":"",t.transform="",t))}var As={left:"right",right:"left",bottom:"top",top:"bottom"};function Ms(e){return e.replace(/left|right|bottom|top/g,(function(e){return As[e]}))}var Es={start:"end",end:"start"};function Cs(e){return e.replace(/start|end/g,(function(e){return Es[e]}))}function Ps(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Oo(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ls(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Is(e,t,r){return t===cs?Ls(function(e,t){var r=Lo(e),n=qo(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var c=Bo();(c||!c&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+Ho(e),y:l}}(e,r)):Io(t)?function(e,t){var r=No(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):Ls(function(e){var t,r=qo(e),n=Uo(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=Ro(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Ro(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+Ho(e),l=-n.scrollTop;return"rtl"===Go(i||r).direction&&(s+=Ro(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(qo(e)))}function zs(e,t,r,n){var i="clippingParents"===t?function(e){var t=Ko(Xo(e)),r=["absolute","fixed"].indexOf(Go(e).position)>=0&&zo(e)?es(e):e;return Io(r)?t.filter((function(e){return Io(e)&&Ps(e,r)&&"body"!==Vo(e)})):[]}(e):[].concat(t),a=[].concat(i,[r]),o=a[0],s=a.reduce((function(t,r){var i=Is(e,r,n);return t.top=Ro(i.top,t.top),t.right=Do(i.right,t.right),t.bottom=Do(i.bottom,t.bottom),t.left=Ro(i.left,t.left),t}),Is(e,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Os(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Rs(e,t){return t.reduce((function(t,r){return t[r]=e,t}),{})}function Ds(e,t){void 0===t&&(t={});var r=t,n=r.placement,i=void 0===n?e.placement:n,a=r.strategy,o=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?cs:c,h=r.elementContext,p=void 0===h?us:h,d=r.altBoundary,f=void 0!==d&&d,m=r.padding,g=void 0===m?0:m,y=Os("number"!==typeof g?g:Rs(g,os)),v=p===us?"reference":us,x=e.rects.popper,b=e.elements[f?v:p],_=zs(Io(b)?b:b.contextElement||qo(e.elements.popper),l,u,o),w=No(e.elements.reference),k=ks({reference:w,element:x,strategy:"absolute",placement:i}),T=Ls(Object.assign({},x,k)),S=p===us?T:w,A={top:_.top-S.top+y.top,bottom:S.bottom-_.bottom+y.bottom,left:_.left-S.left+y.left,right:S.right-_.right+y.right},M=e.modifiersData.offset;if(p===us&&M){var E=M[i];Object.keys(A).forEach((function(e){var t=[ns,rs].indexOf(e)>=0?1:-1,r=[ts,rs].indexOf(e)>=0?"y":"x";A[e]+=E[r]*t}))}return A}function js(e,t,r){return Ro(e,Do(t,r))}function Fs(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Bs(e){return[ts,ns,rs,is].some((function(t){return e[t]>=0}))}var Ns=vs({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,a=void 0===i||i,o=n.resize,s=void 0===o||o,l=Lo(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach((function(e){e.addEventListener("scroll",r.update,xs)})),s&&l.addEventListener("resize",r.update,xs),function(){a&&c.forEach((function(e){e.removeEventListener("scroll",r.update,xs)})),s&&l.removeEventListener("resize",r.update,xs)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=ks({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=void 0===n||n,a=r.adaptive,o=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:bs(t.placement),variation:_s(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ss(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ss(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},i=t.elements[e];zo(i)&&Vo(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(e){var t=n[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce((function(e,t){return e[t]="",e}),{});zo(n)&&Vo(n)&&(Object.assign(n.style,a),Object.keys(i).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.offset,a=void 0===i?[0,0]:i,o=ps.reduce((function(e,r){return e[r]=function(e,t,r){var n=bs(e),i=[is,ts].indexOf(n)>=0?-1:1,a="function"===typeof r?r(Object.assign({},t,{placement:e})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[is,ns].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}(r,t.rects,a),e}),{}),s=o[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0===o||o,l=r.fallbackPlacements,c=r.padding,u=r.boundary,h=r.rootBoundary,p=r.altBoundary,d=r.flipVariations,f=void 0===d||d,m=r.allowedAutoPlacements,g=t.options.placement,y=bs(g),v=l||(y===g||!f?[Ms(g)]:function(e){if(bs(e)===as)return[];var t=Ms(e);return[Cs(e),t,Cs(t)]}(g)),x=[g].concat(v).reduce((function(e,r){return e.concat(bs(r)===as?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?ps:l,u=_s(n),h=u?s?hs:hs.filter((function(e){return _s(e)===u})):os,p=h.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=h);var d=p.reduce((function(t,r){return t[r]=Ds(e,{placement:r,boundary:i,rootBoundary:a,padding:o})[bs(r)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:r,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):r)}),[]),b=t.rects.reference,_=t.rects.popper,w=new Map,k=!0,T=x[0],S=0;S=0,P=C?"width":"height",L=Ds(t,{placement:A,boundary:u,rootBoundary:h,altBoundary:p,padding:c}),I=C?E?ns:is:E?rs:ts;b[P]>_[P]&&(I=Ms(I));var z=Ms(I),O=[];if(a&&O.push(L[M]<=0),s&&O.push(L[I]<=0,L[z]<=0),O.every((function(e){return e}))){T=A,k=!1;break}w.set(A,O)}if(k)for(var R=function(e){var t=x.find((function(t){var r=w.get(t);if(r)return r.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},D=f?3:1;D>0;D--){if("break"===R(D))break}t.placement!==T&&(t.modifiersData[n]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0!==o&&o,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,h=r.padding,p=r.tether,d=void 0===p||p,f=r.tetherOffset,m=void 0===f?0:f,g=Ds(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),y=bs(t.placement),v=_s(t.placement),x=!v,b=ws(y),_="x"===b?"y":"x",w=t.modifiersData.popperOffsets,k=t.rects.reference,T=t.rects.popper,S="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,A="number"===typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(w){if(a){var C,P="y"===b?ts:is,L="y"===b?rs:ns,I="y"===b?"height":"width",z=w[b],O=z+g[P],R=z-g[L],D=d?-T[I]/2:0,j=v===ss?k[I]:T[I],F=v===ss?-T[I]:-k[I],B=t.elements.arrow,N=d&&B?Zo(B):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=U[P],q=U[L],H=js(0,k[I],N[I]),G=x?k[I]/2-D-H-V-A.mainAxis:j-H-V-A.mainAxis,W=x?-k[I]/2+D+H+q+A.mainAxis:F+H+q+A.mainAxis,$=t.elements.arrow&&es(t.elements.arrow),Z=$?"y"===b?$.clientTop||0:$.clientLeft||0:0,X=null!=(C=null==M?void 0:M[b])?C:0,Y=z+W-X,K=js(d?Do(O,z+G-X-Z):O,z,d?Ro(R,Y):R);w[b]=K,E[b]=K-z}if(s){var J,Q="x"===b?ts:is,ee="x"===b?rs:ns,te=w[_],re="y"===_?"height":"width",ne=te+g[Q],ie=te-g[ee],ae=-1!==[ts,is].indexOf(y),oe=null!=(J=null==M?void 0:M[_])?J:0,se=ae?ne:te-k[re]-T[re]-oe+A.altAxis,le=ae?te+k[re]+T[re]-oe-A.altAxis:ie,ce=d&&ae?function(e,t,r){var n=js(e,t,r);return n>r?r:n}(se,te,le):js(d?se:ne,te,d?le:ie);w[_]=ce,E[_]=ce-te}t.modifiersData[n]=E}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,i=e.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=bs(r.placement),l=ws(s),c=[is,ns].indexOf(s)>=0?"height":"width";if(a&&o){var u=function(e,t){return Os("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Rs(e,os))}(i.padding,r),h=Zo(a),p="y"===l?ts:is,d="y"===l?rs:ns,f=r.rects.reference[c]+r.rects.reference[l]-o[l]-r.rects.popper[c],m=o[l]-r.rects.reference[l],g=es(a),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,x=u[p],b=y-h[c]-u[d],_=y/2-h[c]/2+v,w=js(x,_,b),k=l;r.modifiersData[n]=((t={})[k]=w,t.centerOffset=w-_,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!==typeof n||(n=t.elements.popper.querySelector(n)))&&Ps(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Ds(t,{elementContext:"reference"}),s=Ds(t,{altBoundary:!0}),l=Fs(o,n),c=Fs(s,i,a),u=Bs(l),h=Bs(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}}]});const Us=e.forwardRef((function(t,r){const{children:n,container:i,disablePortal:a=!1}=t,[o,s]=e.useState(null),l=qi(e.isValidElement(n)?po(n):null,r);if(sr((()=>{a||s(function(e){return"function"===typeof e?e():e}(i)||document.body)}),[i,a]),sr((()=>{if(o&&!a)return Vi(r,o),()=>{Vi(r,null)}}),[r,o,a]),a){if(e.isValidElement(n)){const t={ref:l};return e.cloneElement(n,t)}return n}return o?fo.createPortal(n,o):o}));function Vs(e){return Ai("MuiPopper",e)}Mi("MuiPopper",["root"]);function qs(e){return"function"===typeof e?e():e}function Hs(e){return void 0!==e.nodeType}const Gs={},Ws=e.forwardRef((function(t,r){const{anchorEl:n,children:i,direction:a,disablePortal:o,modifiers:l,open:c,placement:u,popperOptions:h,popperRef:p,slotProps:d={},slots:f={},TransitionProps:m,ownerState:g,...y}=t,v=e.useRef(null),x=qi(v,r),b=e.useRef(null),_=qi(b,p),w=e.useRef(_);sr((()=>{w.current=_}),[_]),e.useImperativeHandle(p,(()=>b.current),[]);const k=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(u,a),[T,S]=e.useState(k),[A,M]=e.useState(qs(n));e.useEffect((()=>{b.current&&b.current.forceUpdate()})),e.useEffect((()=>{n&&M(qs(n))}),[n]),sr((()=>{if(!A||!c)return;let e=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:e=>{let{state:t}=e;S(t.placement)}}];null!=l&&(e=e.concat(l)),h&&null!=h.modifiers&&(e=e.concat(h.modifiers));const t=Ns(A,v.current,{placement:k,...h,modifiers:e});return w.current(t),()=>{t.destroy(),w.current(null)}}),[A,o,l,c,h,k]);const E={placement:T};null!==m&&(E.TransitionProps=m);const C=(e=>{const{classes:t}=e;return Wn({root:["root"]},Vs,t)})(t),P=f.root??"div",L=ta({elementType:P,externalSlotProps:d.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:x},ownerState:t,className:C.root});return(0,s.jsx)(P,{...L,children:"function"===typeof i?i(E):i})})),$s=gi(e.forwardRef((function(t,r){const{anchorEl:n,children:i,container:a,direction:o="ltr",disablePortal:l=!1,keepMounted:c=!1,modifiers:u,open:h,placement:p="bottom",popperOptions:d=Gs,popperRef:f,style:m,transition:g=!1,slotProps:y={},slots:v={},...x}=t,[b,_]=e.useState(!0);if(!c&&!h&&(!g||b))return null;let w;if(a)w=a;else if(n){const e=qs(n);w=e&&Hs(e)?oa(e).body:oa(null).body}const k=h||!c||g&&!b?void 0:"none",T=g?{in:h,onEnter:()=>{_(!1)},onExited:()=>{_(!0)}}:void 0;return(0,s.jsx)(Us,{disablePortal:l,container:w,children:(0,s.jsx)(Ws,{anchorEl:n,direction:o,disablePortal:l,modifiers:u,ref:r,open:g?!b:h,placement:p,popperOptions:d,popperRef:f,slotProps:y,slots:v,...x,style:{position:"fixed",top:0,left:0,display:k,...m},TransitionProps:T,children:i})})})),{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Zs=e.forwardRef((function(e,t){const r=je(),n=yi({props:e,name:"MuiPopper"}),{anchorEl:i,component:a,components:o,componentsProps:l,container:c,disablePortal:u,keepMounted:h,modifiers:p,open:d,placement:f,popperOptions:m,popperRef:g,transition:y,slots:v,slotProps:x,...b}=n,_=v?.root??o?.Root,w={anchorEl:i,container:c,disablePortal:u,keepMounted:h,modifiers:p,open:d,placement:f,popperOptions:m,popperRef:g,transition:y,...b};return(0,s.jsx)($s,{as:a,direction:r?"rtl":"ltr",slots:{root:_},slotProps:x??l,...w,ref:t})}));let Xs=0;const Ys={...t}.useId;function Ks(t){if(void 0!==Ys){const e=Ys();return t??e}return function(t){const[r,n]=e.useState(t),i=t||r;return e.useEffect((()=>{null==r&&(Xs+=1,n(`mui-${Xs}`))}),[r]),i}(t)}const Js=Ks;function Qs(t){let{controlled:r,default:n,name:i,state:a="value"}=t;const{current:o}=e.useRef(void 0!==r),[s,l]=e.useState(n);return[o?r:s,e.useCallback((e=>{o||l(e)}),[])]}const el=Qs;function tl(e){return Ai("MuiTooltip",e)}const rl=Mi("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);const nl=gi(Zs,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(wi((e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableInteractive},style:{pointerEvents:"auto"}},{props:e=>{let{open:t}=e;return!t},style:{pointerEvents:"none"}},{props:e=>{let{ownerState:t}=e;return t.arrow},style:{[`&[data-popper-placement*="bottom"] .${rl.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${rl.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${rl.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${rl.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!t.isRtl},style:{[`&[data-popper-placement*="right"] .${rl.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!!t.isRtl},style:{[`&[data-popper-placement*="right"] .${rl.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!t.isRtl},style:{[`&[data-popper-placement*="left"] .${rl.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!!t.isRtl},style:{[`&[data-popper-placement*="left"] .${rl.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}}))),il=gi("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Oi(r.placement.split("-")[0])}`]]}})(wi((e=>{let{theme:t}=e;return{backgroundColor:t.vars?t.vars.palette.Tooltip.bg:Tr(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium,[`.${rl.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${rl.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${rl.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:e=>{let{ownerState:t}=e;return t.arrow},style:{position:"relative",margin:0}},{props:e=>{let{ownerState:t}=e;return t.touch},style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:(r=16/14,Math.round(1e5*r)/1e5)+"em",fontWeight:t.typography.fontWeightRegular}},{props:e=>{let{ownerState:t}=e;return!t.isRtl},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:e=>{let{ownerState:t}=e;return!t.isRtl&&t.touch},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:e=>{let{ownerState:t}=e;return!!t.isRtl},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:e=>{let{ownerState:t}=e;return!!t.isRtl&&t.touch},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:e=>{let{ownerState:t}=e;return t.touch},style:{[`.${rl.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:e=>{let{ownerState:t}=e;return t.touch},style:{[`.${rl.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]};var r}))),al=gi("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(wi((e=>{let{theme:t}=e;return{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:Tr(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}})));let ol=!1;const sl=new Pa;let ll={x:0,y:0};function cl(e,t){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a{void 0!==K.current&&(document.body.style.WebkitUserSelect=K.current,K.current=void 0),W.clear()}));e.useEffect((()=>J),[J]);const Q=e=>{sl.clear(),ol=!0,Z(!0),k&&!X&&k(e)},ee=ma((e=>{sl.start(800+b,(()=>{ol=!1})),Z(!1),w&&X&&w(e),q.start(R.transitions.duration.shortest,(()=>{U.current=!1}))})),te=e=>{U.current&&"touchstart"!==e.type||(j&&j.removeAttribute("title"),H.clear(),G.clear(),m||ol&&g?H.start(ol?g:m,(()=>{Q(e)})):Q(e))},re=e=>{H.clear(),G.start(b,(()=>{ee(e)}))},[,ne]=e.useState(!1),ie=e=>{pa(e.target)||(ne(!1),re(e))},ae=e=>{j||F(e.currentTarget),pa(e.target)&&(ne(!0),te(e))},oe=e=>{U.current=!0;const t=O.props;t.onTouchStart&&t.onTouchStart(e)},se=e=>{oe(e),G.clear(),q.clear(),J(),K.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",W.start(y,(()=>{document.body.style.WebkitUserSelect=K.current,te(e)}))},le=e=>{O.props.onTouchEnd&&O.props.onTouchEnd(e),J(),G.start(_,(()=>{ee(e)}))};e.useEffect((()=>{if(X)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&ee(e)}}),[ee,X]);const ce=da(po(O),F,r);P||0===P||(X=!1);const ue=e.useRef(),he={},pe="string"===typeof P;u?(he.title=X||!pe||p?null:P,he["aria-describedby"]=X?Y:null):(he["aria-label"]=pe?P:null,he["aria-labelledby"]=X&&!pe?Y:null);const de={...he,...z,...O.props,className:Gn(z.className,O.props.className),onTouchStart:oe,ref:ce,...v?{onMouseMove:e=>{const t=O.props;t.onMouseMove&&t.onMouseMove(e),ll={x:e.clientX,y:e.clientY},ue.current&&ue.current.update()}}:{}};const fe={};f||(de.onTouchStart=se,de.onTouchEnd=le),p||(de.onMouseOver=cl(te,de.onMouseOver),de.onMouseLeave=cl(re,de.onMouseLeave),V||(fe.onMouseOver=te,fe.onMouseLeave=re)),h||(de.onFocus=cl(ae,de.onFocus),de.onBlur=cl(ie,de.onBlur),V||(fe.onFocus=ae,fe.onBlur=ie));const me={...n,isRtl:D,arrow:i,disableInteractive:V,placement:S,PopperComponentProp:A,touch:U.current},ge="function"===typeof E.popper?E.popper(me):E.popper,ye=e.useMemo((()=>{let e=[{name:"arrow",enabled:Boolean(B),options:{element:B,padding:4}}];return M.popperOptions?.modifiers&&(e=e.concat(M.popperOptions.modifiers)),ge?.popperOptions?.modifiers&&(e=e.concat(ge.popperOptions.modifiers)),{...M.popperOptions,...ge?.popperOptions,modifiers:e}}),[B,M.popperOptions,ge?.popperOptions]),ve=(e=>{const{classes:t,disableInteractive:r,arrow:n,touch:i,placement:a}=e;return Wn({popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",i&&"touch",`tooltipPlacement${Oi(a.split("-")[0])}`],arrow:["arrow"]},tl,t)})(me),xe="function"===typeof E.transition?E.transition(me):E.transition,be={slots:{popper:l.Popper,transition:l.Transition??L,tooltip:l.Tooltip,arrow:l.Arrow,...C},slotProps:{arrow:E.arrow??c.arrow,popper:{...M,...ge??c.popper},tooltip:E.tooltip??c.tooltip,transition:{...I,...xe??c.transition}}},[_e,we]=Yi("popper",{elementType:nl,externalForwardedProps:be,ownerState:me,className:Gn(ve.popper,M?.className)}),[ke,Te]=Yi("transition",{elementType:Po,externalForwardedProps:be,ownerState:me}),[Se,Ae]=Yi("tooltip",{elementType:il,className:ve.tooltip,externalForwardedProps:be,ownerState:me}),[Me,Ee]=Yi("arrow",{elementType:al,className:ve.arrow,externalForwardedProps:be,ownerState:me,ref:N});return(0,s.jsxs)(e.Fragment,{children:[e.cloneElement(O,de),(0,s.jsx)(_e,{as:A??Zs,placement:S,anchorEl:v?{getBoundingClientRect:()=>({top:ll.y,left:ll.x,right:ll.x,bottom:ll.y,width:0,height:0})}:j,popperRef:ue,open:!!j&&X,id:Y,transition:!0,...fe,...we,popperOptions:ye,children:e=>{let{TransitionProps:t}=e;return(0,s.jsx)(ke,{timeout:R.transitions.duration.shorter,...t,...Te,children:(0,s.jsxs)(Se,{...Ae,children:[P,i?(0,s.jsx)(Me,{...Ee}):null]})})}})]})}));function hl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=>{let[,r]=t;return r&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!function(e){return"string"===typeof e.main}(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||"string"!==typeof e[r])return!1;return!0}(r,e)}}function pl(e){return Ai("MuiAppBar",e)}Mi("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const dl=(e,t)=>e?`${e?.replace(")","")}, ${t})`:t,fl=gi(Pi,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`position${Oi(r.position)}`],t[`color${Oi(r.color)}`]]}})(wi((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(hl(["contrastText"])).map((e=>{let[r]=e;return{props:{color:r},style:{"--AppBar-background":(t.vars??t).palette[r].main,"--AppBar-color":(t.vars??t).palette[r].contrastText}}})),{props:e=>!0===e.enableColorOnDark&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>!1===e.enableColorOnDark&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?dl(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?dl(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}}))),ml=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAppBar"}),{className:n,color:i="primary",enableColorOnDark:a=!1,position:o="fixed",...l}=r,c={...r,color:i,position:o,enableColorOnDark:a},u=(e=>{const{color:t,position:r,classes:n}=e;return Wn({root:["root",`color${Oi(t)}`,`position${Oi(r)}`]},pl,n)})(c);return(0,s.jsx)(fl,{square:!0,component:"header",ownerState:c,elevation:4,className:Gn(u.root,n,"fixed"===o&&"mui-fixed"),ref:t,...l})})),gl=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function yl(e){const t=[],r=[];return Array.from(e.querySelectorAll(gl)).forEach(((e,n)=>{const i=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==i&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}(e))}(e)&&(0===i?t.push(e):r.push({documentOrder:n,tabIndex:i,node:e}))})),r.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function vl(){return!0}const xl=function(t){const{children:r,disableAutoFocus:n=!1,disableEnforceFocus:i=!1,disableRestoreFocus:a=!1,getTabbable:o=yl,isEnabled:l=vl,open:c}=t,u=e.useRef(!1),h=e.useRef(null),p=e.useRef(null),d=e.useRef(null),f=e.useRef(null),m=e.useRef(!1),g=e.useRef(null),y=qi(po(r),g),v=e.useRef(null);e.useEffect((()=>{c&&g.current&&(m.current=!n)}),[n,c]),e.useEffect((()=>{if(!c||!g.current)return;const e=oa(g.current);return g.current.contains(e.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex","-1"),m.current&&g.current.focus()),()=>{a||(d.current&&d.current.focus&&(u.current=!0,d.current.focus()),d.current=null)}}),[c]),e.useEffect((()=>{if(!c||!g.current)return;const e=oa(g.current),t=t=>{v.current=t,!i&&l()&&"Tab"===t.key&&e.activeElement===g.current&&t.shiftKey&&(u.current=!0,p.current&&p.current.focus())},r=()=>{const t=g.current;if(null===t)return;if(!e.hasFocus()||!l()||u.current)return void(u.current=!1);if(t.contains(e.activeElement))return;if(i&&e.activeElement!==h.current&&e.activeElement!==p.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!m.current)return;let r=[];if(e.activeElement!==h.current&&e.activeElement!==p.current||(r=o(g.current)),r.length>0){const e=Boolean(v.current?.shiftKey&&"Tab"===v.current?.key),t=r[0],n=r[r.length-1];"string"!==typeof t&&"string"!==typeof n&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener("focusin",r),e.addEventListener("keydown",t,!0);const n=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&r()}),50);return()=>{clearInterval(n),e.removeEventListener("focusin",r),e.removeEventListener("keydown",t,!0)}}),[n,i,a,l,c,o]);const x=e=>{null===d.current&&(d.current=e.relatedTarget),m.current=!0};return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)("div",{tabIndex:c?0:-1,onFocus:x,ref:h,"data-testid":"sentinelStart"}),e.cloneElement(r,{ref:y,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),m.current=!0,f.current=e.target;const t=r.props.onFocus;t&&t(e)}}),(0,s.jsx)("div",{tabIndex:c?0:-1,onFocus:x,ref:p,"data-testid":"sentinelEnd"})]})},bl={entering:{opacity:1},entered:{opacity:1}},_l=e.forwardRef((function(t,r){const n=bi(),i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:o=!0,children:l,easing:c,in:u,onEnter:h,onEntered:p,onEntering:d,onExit:f,onExited:m,onExiting:g,style:y,timeout:v=i,TransitionComponent:x=ko,...b}=t,_=e.useRef(null),w=da(_,po(l),r),k=e=>t=>{if(e){const r=_.current;void 0===t?e(r):e(r,t)}},T=k(d),S=k(((e,t)=>{To(e);const r=So({style:y,timeout:v,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),h&&h(e,t)})),A=k(p),M=k(g),E=k((e=>{const t=So({style:y,timeout:v,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)})),C=k(m);return(0,s.jsx)(x,{appear:o,in:u,nodeRef:_,onEnter:S,onEntered:A,onEntering:T,onExit:E,onExited:C,onExiting:M,addEndListener:e=>{a&&a(_.current,e)},timeout:v,...b,children:(t,r)=>{let{ownerState:n,...i}=r;return e.cloneElement(l,{style:{opacity:0,visibility:"exited"!==t||u?void 0:"hidden",...bl[t],...y,...l.props.style},ref:w,...i})}})}));function wl(e){return Ai("MuiBackdrop",e)}Mi("MuiBackdrop",["root","invisible"]);const kl=gi("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Tl=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiBackdrop"}),{children:n,className:i,component:a="div",invisible:o=!1,open:l,components:c={},componentsProps:u={},slotProps:h={},slots:p={},TransitionComponent:d,transitionDuration:f,...m}=r,g={...r,component:a,invisible:o},y=(e=>{const{classes:t,invisible:r}=e;return Wn({root:["root",r&&"invisible"]},wl,t)})(g),v={slots:{transition:d,root:c.Root,...p},slotProps:{...u,...h}},[x,b]=Yi("root",{elementType:kl,externalForwardedProps:v,className:Gn(y.root,i),ownerState:g}),[_,w]=Yi("transition",{elementType:_l,externalForwardedProps:v,ownerState:g});return(0,s.jsx)(_,{in:l,timeout:f,...m,...w,children:(0,s.jsx)(x,{"aria-hidden":!0,...b,classes:y,ref:t,children:n})})}));function Sl(){for(var e=arguments.length,t=new Array(e),r=0;rnull==t?e:function(){for(var r=arguments.length,n=new Array(r),i=0;i{}))}function Al(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function Ml(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function El(e){return parseInt(sa(e).getComputedStyle(e).paddingRight,10)||0}function Cl(e,t,r,n,i){const a=[t,r,...n];[].forEach.call(e.children,(e=>{const t=!a.includes(e),r=!function(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||r}(e);t&&r&&Ml(e,i)}))}function Pl(e,t){let r=-1;return e.some(((e,n)=>!!t(e)&&(r=n,!0))),r}function Ll(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(function(e){const t=oa(e);return t.body===e?sa(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(n)){const e=Al(sa(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${El(n)+e}px`;const t=oa(n).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{r.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${El(t)+e}px`}))}let e;if(n.parentNode instanceof DocumentFragment)e=oa(n).body;else{const t=n.parentElement,r=sa(n);e="HTML"===t?.nodeName&&"scroll"===r.getComputedStyle(t).overflowY?t:n}r.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{r.forEach((e=>{let{value:t,el:r,property:n}=e;t?r.style.setProperty(n,t):r.style.removeProperty(n)}))}}const Il=()=>{},zl=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Ml(e.modalRef,!1);const n=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);Cl(t,e.mount,e.modalRef,n,!0);const i=Pl(this.containers,(e=>e.container===t));return-1!==i?(this.containers[i].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:n}),r)}mount(e,t){const r=Pl(this.containers,(t=>t.modals.includes(e))),n=this.containers[r];n.restore||(n.restore=Ll(n,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.modals.indexOf(e);if(-1===r)return r;const n=Pl(this.containers,(t=>t.modals.includes(e))),i=this.containers[n];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(r,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&Ml(e.modalRef,t),Cl(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(n,1);else{const e=i.modals[i.modals.length-1];e.modalRef&&Ml(e.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};const Ol=function(t){const{container:r,disableEscapeKeyDown:n=!1,disableScrollLock:i=!1,closeAfterTransition:a=!1,onTransitionEnter:o,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:h}=t,p=e.useRef({}),d=e.useRef(null),f=e.useRef(null),m=qi(f,h),[g,y]=e.useState(!u),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let x=!0;"false"!==t["aria-hidden"]&&!1!==t["aria-hidden"]||(x=!1);const b=()=>(p.current.modalRef=f.current,p.current.mount=d.current,p.current),_=()=>{zl.mount(b(),{disableScrollLock:i}),f.current&&(f.current.scrollTop=0)},w=fa((()=>{const e=function(e){return"function"===typeof e?e():e}(r)||oa(d.current).body;zl.add(b(),e),f.current&&_()})),k=()=>zl.isTopModal(b()),T=fa((e=>{d.current=e,e&&(u&&k()?_():f.current&&Ml(f.current,x))})),S=e.useCallback((()=>{zl.remove(b(),x)}),[x]);e.useEffect((()=>()=>{S()}),[S]),e.useEffect((()=>{u?w():v&&a||S()}),[u,S,v,a,w]);const A=e=>t=>{e.onKeyDown?.(t),"Escape"===t.key&&229!==t.which&&k()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},M=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=$i(t);delete r.onTransitionEnter,delete r.onTransitionExited;const n={...r,...e};return{role:"presentation",...n,onKeyDown:A(n),ref:m}},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{"aria-hidden":!0,...e,onClick:M(e),open:u}},getTransitionProps:()=>({onEnter:Sl((()=>{y(!1),o&&o()}),l?.props.onEnter??Il),onExited:Sl((()=>{y(!0),s&&s(),a&&S()}),l?.props.onExited??Il)}),rootRef:m,portalRef:T,isTopModal:k,exited:g,hasTransition:v}};function Rl(e){return Ai("MuiModal",e)}Mi("MuiModal",["root","hidden","backdrop"]);const Dl=gi("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(wi((e=>{let{theme:t}=e;return{position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:e=>{let{ownerState:t}=e;return!t.open&&t.exited},style:{visibility:"hidden"}}]}}))),jl=gi(Tl,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Fl=e.forwardRef((function(t,r){const n=yi({name:"MuiModal",props:t}),{BackdropComponent:i=jl,BackdropProps:a,classes:o,className:l,closeAfterTransition:c=!1,children:u,container:h,component:p,components:d={},componentsProps:f={},disableAutoFocus:m=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:y=!1,disablePortal:v=!1,disableRestoreFocus:x=!1,disableScrollLock:b=!1,hideBackdrop:_=!1,keepMounted:w=!1,onClose:k,onTransitionEnter:T,onTransitionExited:S,open:A,slotProps:M={},slots:E={},theme:C,...P}=n,L={...n,closeAfterTransition:c,disableAutoFocus:m,disableEnforceFocus:g,disableEscapeKeyDown:y,disablePortal:v,disableRestoreFocus:x,disableScrollLock:b,hideBackdrop:_,keepMounted:w},{getRootProps:I,getBackdropProps:z,getTransitionProps:O,portalRef:R,isTopModal:D,exited:j,hasTransition:F}=Ol({...L,rootRef:r}),B={...L,exited:j},N=(e=>{const{open:t,exited:r,classes:n}=e;return Wn({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},Rl,n)})(B),U={};if(void 0===u.props.tabIndex&&(U.tabIndex="-1"),F){const{onEnter:e,onExited:t}=O();U.onEnter=e,U.onExited=t}const V={slots:{root:d.Root,backdrop:d.Backdrop,...E},slotProps:{...f,...M}},[q,H]=Yi("root",{ref:r,elementType:Dl,externalForwardedProps:{...V,...P,component:p},getSlotProps:I,ownerState:B,className:Gn(l,N?.root,!B.open&&B.exited&&N?.hidden)}),[G,W]=Yi("backdrop",{ref:a?.ref,elementType:i,externalForwardedProps:V,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:e=>z({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:Gn(a?.className,N?.backdrop),ownerState:B});return w||A||F&&!j?(0,s.jsx)(Us,{ref:R,container:h,disablePortal:v,children:(0,s.jsxs)(q,{...H,children:[!_&&i?(0,s.jsx)(G,{...W}):null,(0,s.jsx)(xl,{disableEnforceFocus:g,disableAutoFocus:m,disableRestoreFocus:x,isEnabled:D,open:A,children:e.cloneElement(u,U)})]})}):null}));function Bl(e,t,r){var n;const i=function(e,t,r){const n=t.getBoundingClientRect(),i=r&&r.getBoundingClientRect(),a=la(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const e=a.getComputedStyle(t);o=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,l=0;if(o&&"none"!==o&&"string"===typeof o){const e=o.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?i?`translateX(${i.right+s-n.left}px)`:`translateX(${a.innerWidth+s-n.left}px)`:"right"===e?i?`translateX(-${n.right-i.left-s}px)`:`translateX(-${n.left+n.width-s}px)`:"up"===e?i?`translateY(${i.bottom+l-n.top}px)`:`translateY(${a.innerHeight+l-n.top}px)`:i?`translateY(-${n.top-i.top+n.height-l}px)`:`translateY(-${n.top+n.height-l}px)`}(e,t,"function"===typeof(n=r)?n():n);i&&(t.style.webkitTransform=i,t.style.transform=i)}const Nl=e.forwardRef((function(t,r){const n=bi(),i={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:l=!0,children:c,container:u,direction:h="down",easing:p=i,in:d,onEnter:f,onEntered:m,onEntering:g,onExit:y,onExited:v,onExiting:x,style:b,timeout:_=a,TransitionComponent:w=ko,...k}=t,T=e.useRef(null),S=da(po(c),T,r),A=e=>t=>{e&&(void 0===t?e(T.current):e(T.current,t))},M=A(((e,t)=>{Bl(h,e,u),To(e),f&&f(e,t)})),E=A(((e,t)=>{const r=So({timeout:_,style:b,easing:p},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...r}),e.style.transition=n.transitions.create("transform",{...r}),e.style.webkitTransform="none",e.style.transform="none",g&&g(e,t)})),C=A(m),P=A(x),L=A((e=>{const t=So({timeout:_,style:b,easing:p},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),Bl(h,e,u),y&&y(e)})),I=A((e=>{e.style.webkitTransition="",e.style.transition="",v&&v(e)})),z=e.useCallback((()=>{T.current&&Bl(h,T.current,u)}),[h,u]);return e.useEffect((()=>{if(d||"down"===h||"right"===h)return;const e=na((()=>{T.current&&Bl(h,T.current,u)})),t=la(T.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[h,d,u]),e.useEffect((()=>{d||z()}),[d,z]),(0,s.jsx)(w,{nodeRef:T,onEnter:M,onEntered:C,onEntering:E,onExit:L,onExited:I,onExiting:P,addEndListener:e=>{o&&o(T.current,e)},appear:l,in:d,timeout:_,...k,children:(t,r)=>{let{ownerState:n,...i}=r;return e.cloneElement(c,{ref:S,style:{visibility:"exited"!==t||d?void 0:"hidden",...b,...c.props.style},...i})}})}));function Ul(e){return Ai("MuiDrawer",e)}Mi("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);function Vl(e,t){if(!e)return t;function r(e,t){const r={};return Object.keys(t).forEach((n=>{(function(e,t){const r=e.charCodeAt(2);return"o"===e[0]&&"n"===e[1]&&r>=65&&r<=90&&"function"===typeof t})(n,t[n])&&"function"===typeof e[n]&&(r[n]=function(){e[n](...arguments),t[n](...arguments)})})),r}if("function"===typeof e||"function"===typeof t)return n=>{const i="function"===typeof t?t(n):t,a="function"===typeof e?e({...n,...i}):e,o=Gn(n?.className,i?.className,a?.className),s=r(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};const n=t,i=r(e,n),a=Gn(n?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...n?.style&&e?.style&&{style:{...n.style,...e.style}},...n?.sx&&e?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const ql=(e,t)=>{const{ownerState:r}=e;return[t.root,("permanent"===r.variant||"persistent"===r.variant)&&t.docked,t.modal]},Hl=gi(Fl,{name:"MuiDrawer",slot:"Root",overridesResolver:ql})(wi((e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.drawer}}))),Gl=gi("div",{shouldForwardProp:mi,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:ql})({flex:"0 0 auto"}),Wl=gi(Pi,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`paperAnchor${Oi(r.anchor)}`],"temporary"!==r.variant&&t[`paperAnchorDocked${Oi(r.anchor)}`]]}})(wi((e=>{let{theme:t}=e;return{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:e=>{let{ownerState:t}=e;return"left"===t.anchor&&"temporary"!==t.variant},style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return"top"===t.anchor&&"temporary"!==t.variant},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return"right"===t.anchor&&"temporary"!==t.variant},style:{borderLeft:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return"bottom"===t.anchor&&"temporary"!==t.variant},style:{borderTop:`1px solid ${(t.vars||t).palette.divider}`}}]}}))),$l={left:"right",right:"left",top:"down",bottom:"up"};const Zl=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiDrawer"}),i=bi(),a=je(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:l="left",BackdropProps:c,children:u,className:h,elevation:p=16,hideBackdrop:d=!1,ModalProps:{BackdropProps:f,...m}={},onClose:g,open:y=!1,PaperProps:v={},SlideProps:x,TransitionComponent:b,transitionDuration:_=o,variant:w="temporary",slots:k={},slotProps:T={},...S}=n,A=e.useRef(!1);e.useEffect((()=>{A.current=!0}),[]);const M=function(e,t){let{direction:r}=e;return"rtl"===r&&function(e){return["left","right"].includes(e)}(t)?$l[t]:t}({direction:a?"rtl":"ltr"},l),E=l,C={...n,anchor:E,elevation:p,open:y,variant:w,...S},P=(e=>{const{classes:t,anchor:r,variant:n}=e;return Wn({root:["root",`anchor${Oi(r)}`],docked:[("permanent"===n||"persistent"===n)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Oi(r)}`,"temporary"!==n&&`paperAnchorDocked${Oi(r)}`]},Ul,t)})(C),L={slots:{transition:b,...k},slotProps:{paper:v,transition:x,...T,backdrop:Vl(T.backdrop||{...c,...f},{transitionDuration:_})}},[I,z]=Yi("root",{ref:r,elementType:Hl,className:Gn(P.root,P.modal,h),shouldForwardComponentProp:!0,ownerState:C,externalForwardedProps:{...L,...S,...m},additionalProps:{open:y,onClose:g,hideBackdrop:d,slots:{backdrop:L.slots.backdrop},slotProps:{backdrop:L.slotProps.backdrop}}}),[O,R]=Yi("paper",{elementType:Wl,shouldForwardComponentProp:!0,className:Gn(P.paper,v.className),ownerState:C,externalForwardedProps:L,additionalProps:{elevation:"temporary"===w?p:0,square:!0}}),[D,j]=Yi("docked",{elementType:Gl,ref:r,className:Gn(P.root,P.docked,h),ownerState:C,externalForwardedProps:L,additionalProps:S}),[F,B]=Yi("transition",{elementType:Nl,ownerState:C,externalForwardedProps:L,additionalProps:{in:y,direction:$l[M],timeout:_,appear:A.current}}),N=(0,s.jsx)(O,{...R,children:u});if("permanent"===w)return(0,s.jsx)(D,{...j,children:N});const U=(0,s.jsx)(F,{...B,children:N});return"persistent"===w?(0,s.jsx)(D,{...j,children:U}):(0,s.jsx)(I,{...z,children:U})}));function Xl(e){return Ai("MuiToolbar",e)}Mi("MuiToolbar",["root","gutters","regular","dense"]);const Yl=gi("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableGutters&&t.gutters,t[r.variant]]}})(wi((e=>{let{theme:t}=e;return{position:"relative",display:"flex",alignItems:"center",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableGutters},style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}}))),Kl=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiToolbar"}),{className:n,component:i="div",disableGutters:a=!1,variant:o="regular",...l}=r,c={...r,component:i,disableGutters:a,variant:o},u=(e=>{const{classes:t,disableGutters:r,variant:n}=e;return Wn({root:["root",!r&&"gutters",n]},Xl,t)})(c);return(0,s.jsx)(Yl,{as:i,className:Gn(u.root,n),ref:t,ownerState:c,...l})})),Jl=Bi((0,s.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}));function Ql(e){return Ai("MuiCircularProgress",e)}Mi("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const ec=44,tc=ar` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,rc=ar` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; } 50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; } 100% { stroke-dasharray: 1px, 200px; stroke-dashoffset: -126px; } `,nc="string"!==typeof tc?ir` animation: ${tc} 1.4s linear infinite; `:null,ic="string"!==typeof rc?ir` animation: ${rc} 1.4s ease-in-out infinite; `:null,ac=gi("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${Oi(r.color)}`]]}})(wi((e=>{let{theme:t}=e;return{display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:nc||{animation:`${tc} 1.4s linear infinite`}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}}))]}}))),oc=gi("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),sc=gi("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${Oi(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(wi((e=>{let{theme:t}=e;return{stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink},style:ic||{animation:`${rc} 1.4s ease-in-out infinite`}}]}}))),lc=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCircularProgress"}),{className:n,color:i="primary",disableShrink:a=!1,size:o=40,style:l,thickness:c=3.6,value:u=0,variant:h="indeterminate",...p}=r,d={...r,color:i,disableShrink:a,size:o,thickness:c,value:u,variant:h},f=(e=>{const{classes:t,variant:r,color:n,disableShrink:i}=e;return Wn({root:["root",r,`color${Oi(n)}`],svg:["svg"],circle:["circle",`circle${Oi(r)}`,i&&"circleDisableShrink"]},Ql,t)})(d),m={},g={},y={};if("determinate"===h){const e=2*Math.PI*((ec-c)/2);m.strokeDasharray=e.toFixed(3),y["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform="rotate(-90deg)"}return(0,s.jsx)(ac,{className:Gn(f.root,n),style:{width:o,height:o,...g,...l},ownerState:d,ref:t,role:"progressbar",...y,...p,children:(0,s.jsx)(oc,{className:f.svg,ownerState:d,viewBox:"22 22 44 44",children:(0,s.jsx)(sc,{className:f.circle,style:m,ownerState:d,cx:ec,cy:ec,r:(ec-c)/2,fill:"none",strokeWidth:c})})})}));function cc(e){return Ai("MuiIconButton",e)}const uc=Mi("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),hc=gi(Ha,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,"default"!==r.color&&t[`color${Oi(r.color)}`],r.edge&&t[`edge${Oi(r.edge)}`],t[`size${Oi(r.size)}`]]}})(wi((e=>{let{theme:t}=e;return{textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]}})),wi((e=>{let{theme:t}=e;return{variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr((t.vars||t).palette[r].main,t.palette.action.hoverOpacity)}}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${uc.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${uc.loading}`]:{color:"transparent"}}}))),pc=gi("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]}})),dc=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiIconButton"}),{edge:n=!1,children:i,className:a,color:o="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:h,loading:p=null,loadingIndicator:d,...f}=r,m=Js(h),g=d??(0,s.jsx)(lc,{"aria-labelledby":m,color:"inherit",size:16}),y={...r,edge:n,color:o,disabled:l,disableFocusRipple:c,loading:p,loadingIndicator:g,size:u},v=(e=>{const{classes:t,disabled:r,color:n,edge:i,size:a,loading:o}=e;return Wn({root:["root",o&&"loading",r&&"disabled","default"!==n&&`color${Oi(n)}`,i&&`edge${Oi(i)}`,`size${Oi(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},cc,t)})(y);return(0,s.jsxs)(hc,{id:p?m:h,className:Gn(v.root,a),centerRipple:!0,focusRipple:!c,disabled:l||p,ref:t,...f,ownerState:y,children:["boolean"===typeof p&&(0,s.jsx)("span",{className:v.loadingWrapper,style:{display:"contents"},children:(0,s.jsx)(pc,{className:v.loadingIndicator,ownerState:y,children:p&&g})}),i]})}));function fc(e){const{sx:t,...r}=e,{systemProps:n,otherProps:i}=(e=>{const t={systemProps:{},otherProps:{}},r=e?.theme?.unstable_sxConfig??Qt;return Object.keys(e).forEach((n=>{r[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]})),t})(r);let a;return a=Array.isArray(t)?[n,...t]:"function"===typeof t?function(){const e=t(...arguments);return Ke(e)?{...n,...e}:n}:{...n,...t},{...i,sx:a}}const mc=Mi("MuiBox",["root"]),gc=Pn(),yc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:r,defaultTheme:n,defaultClassName:i="MuiBox-root",generateClassName:a}=t,o=ti("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(tr);return e.forwardRef((function(e,t){const l=xi(n),{className:c,component:u="div",...h}=fc(e);return(0,s.jsx)(o,{as:u,ref:t,className:Gn(c,a?a(i):i),theme:r&&l[r]||l,...h})}))}({themeId:We,defaultTheme:gc,defaultClassName:mc.root,generateClassName:Ti.generate});const vc=function(e){let{styles:t,themeId:r,defaultTheme:n={}}=e;const i=xi(n),a="function"===typeof t?t(r&&i[r]||i):t;return(0,s.jsx)(or,{styles:a})};const xc=function(e){return(0,s.jsx)(vc,{...e,defaultTheme:di,themeId:We})};function bc(e){return function(t){return(0,s.jsx)(xc,{styles:"function"===typeof e?r=>e({theme:r,...t}):e})}}const _c="function"===typeof bc({}),wc=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),kc=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),Tc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r={};t&&e.colorSchemes&&"function"===typeof e.getColorSchemeSelector&&Object.entries(e.colorSchemes).forEach((t=>{let[n,i]=t;const a=e.getColorSchemeSelector(n);a.startsWith("@")?r[a]={":root":{colorScheme:i.palette?.mode}}:r[a.replace(/\s*&/,"")]={colorScheme:i.palette?.mode}}));let n={html:wc(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...kc(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...r};const i=e.components?.MuiCssBaseline?.styleOverrides;return i&&(n=[n,i]),n},Sc="mui-ecs",Ac=bc(_c?e=>{let{theme:t,enableColorScheme:r}=e;return Tc(t,r)}:e=>{let{theme:t}=e;return(e=>{const t=Tc(e,!1),r=Array.isArray(t)?t[0]:t;return!e.vars&&r&&(r.html[`:root:has(${Sc})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach((t=>{let[n,i]=t;const a=e.getColorSchemeSelector(n);a.startsWith("@")?r[a]={[`:root:not(:has(.${Sc}))`]:{colorScheme:i.palette?.mode}}:r[a.replace(/\s*&/,"")]={[`&:not(:has(.${Sc}))`]:{colorScheme:i.palette?.mode}}})),t})(t)});const Mc=function(t){const r=yi({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:i=!1}=r;return(0,s.jsxs)(e.Fragment,{children:[_c&&(0,s.jsx)(Ac,{enableColorScheme:i}),!_c&&!i&&(0,s.jsx)("span",{className:Sc,style:{display:"none"}}),n]})},Ec=Bi((0,s.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}));function Cc(e){return Ai("MuiDivider",e)}Mi("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const Pc=gi("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(wi((e=>{let{theme:t}=e;return{margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Tr(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:e=>{let{ownerState:t}=e;return!!t.children},style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:e=>{let{ownerState:t}=e;return t.children&&"vertical"!==t.orientation},style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"vertical"===t.orientation&&t.children},style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"right"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:e=>{let{ownerState:t}=e;return"left"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}}))),Lc=gi("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(wi((e=>{let{theme:t}=e;return{display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}}))),Ic=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDivider"}),{absolute:n=!1,children:i,className:a,orientation:o="horizontal",component:l=(i||"vertical"===o?"div":"hr"),flexItem:c=!1,light:u=!1,role:h=("hr"!==l?"separator":void 0),textAlign:p="center",variant:d="fullWidth",...f}=r,m={...r,absolute:n,component:l,flexItem:c,light:u,orientation:o,role:h,textAlign:p,variant:d},g=(e=>{const{absolute:t,children:r,classes:n,flexItem:i,light:a,orientation:o,textAlign:s,variant:l}=e;return Wn({root:["root",t&&"absolute",l,a&&"light","vertical"===o&&"vertical",i&&"flexItem",r&&"withChildren",r&&"vertical"===o&&"withChildrenVertical","right"===s&&"vertical"!==o&&"textAlignRight","left"===s&&"vertical"!==o&&"textAlignLeft"],wrapper:["wrapper","vertical"===o&&"wrapperVertical"]},Cc,n)})(m);return(0,s.jsx)(Pc,{as:l,className:Gn(g.root,a),role:h,ref:t,ownerState:m,"aria-orientation":"separator"!==h||"hr"===l&&"vertical"!==o?void 0:o,...f,children:i?(0,s.jsx)(Lc,{className:g.wrapper,ownerState:m,children:i}):null})}));Ic&&(Ic.muiSkipListHighlight=!0);const zc=Ic,Oc=ui();const Rc=tn(),Dc=Oc("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function jc(e){return function(e){let{props:t,name:r,defaultTheme:n,themeId:i}=e,a=xi(n);return i&&(a=a[i]||a),Fn({theme:a,name:r,props:t})}({props:e,name:"MuiStack",defaultTheme:Rc})}function Fc(t,r){const n=e.Children.toArray(t).filter(Boolean);return n.reduce(((t,i,a)=>(t.push(i),a{let{ownerState:t,theme:r}=e,n={display:"flex",flexDirection:"column",...it({theme:r},st({values:t.direction,breakpoints:r.breakpoints.values}),(e=>({flexDirection:e})))};if(t.spacing){const e=xt(r),i=Object.keys(r.breakpoints.values).reduce(((e,r)=>(("object"===typeof t.spacing&&null!=t.spacing[r]||"object"===typeof t.direction&&null!=t.direction[r])&&(e[r]=!0),e)),{}),a=st({values:t.direction,base:i}),o=st({values:t.spacing,base:i});"object"===typeof a&&Object.keys(a).forEach(((e,t,r)=>{if(!a[e]){const n=t>0?a[r[t-1]]:"column";a[e]=n}}));n=Qe(n,it({theme:r},o,((r,n)=>{return t.useFlexGap?{gap:bt(e,r)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${i=n?a[n]:t.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[i]}`]:bt(e,r)}};var i})))}return n=function(e){const t=at(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;iQe(e,t)),{});return ot(Object.keys(t),a)}(r.breakpoints,n),n};const Nc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createStyledComponent:r=Dc,useThemeProps:n=jc,componentName:i="MuiStack"}=t,a=r(Bc);return e.forwardRef((function(e,t){const r=fc(n(e)),{component:o="div",direction:l="column",spacing:c=0,divider:u,children:h,className:p,useFlexGap:d=!1,...f}=r,m={direction:l,spacing:c,useFlexGap:d},g=Wn({root:["root"]},(e=>Ai(i,e)),{});return(0,s.jsx)(a,{as:o,ownerState:m,ref:t,className:Gn(g.root,p),...f,children:u?Fc(h,u):h})}))}({createStyledComponent:gi("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>yi({props:e,name:"MuiStack"})}),Uc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const Vc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;return e.length===t.length&&e.every(((e,n)=>r(e,t[n])))};function qc(e,t,r,n,i){return 1===r?Math.min(e+t,i):Math.max(e-t,n)}function Hc(e,t){return e-t}function Gc(e,t){const{index:r}=e.reduce(((e,r,n)=>{const i=Math.abs(t-r);return null===e||i({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},Qc=e=>e;let eu;function tu(){return void 0===eu&&(eu="undefined"===typeof CSS||"function"!==typeof CSS.supports||CSS.supports("touch-action","none")),eu}const ru=function(e){return"string"===typeof e},nu=e=>!e||!ru(e);function iu(e){return Ai("MuiSlider",e)}const au=Mi("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]);function ou(e){return e}const su=gi("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Oi(r.color)}`],"medium"!==r.size&&t[`size${Oi(r.size)}`],r.marked&&t.marked,"vertical"===r.orientation&&t.vertical,"inverted"===r.track&&t.trackInverted,!1===r.track&&t.trackFalse]}})(wi((e=>{let{theme:t}=e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${au.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${au.dragging}`]:{[`& .${au.thumb}, & .${au.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}))),lu=gi("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),cu=gi("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(wi((e=>{let{theme:t}=e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${r}Track`],borderColor:t.vars.palette.Slider[`${r}Track`]}:{backgroundColor:Er(t.palette[r].main,.62),borderColor:Er(t.palette[r].main,.62),...t.applyStyles("dark",{backgroundColor:Ar(t.palette[r].main,.5)}),...t.applyStyles("dark",{borderColor:Ar(t.palette[r].main,.5)})}}}}))]}}))),uu=gi("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Oi(r.color)}`],"medium"!==r.size&&t[`thumbSize${Oi(r.size)}`]]}})(wi((e=>{let{theme:t}=e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${au.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&:hover, &.${au.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[r].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Tr(t.palette[r].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${au.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[r].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${Tr(t.palette[r].main,.16)}`}}}}}))]}}))),hu=gi((function(t){const{children:r,className:n,value:i}=t,a=(e=>{const{open:t}=e;return{offset:Gn(t&&au.valueLabelOpen),circle:au.valueLabelCircle,label:au.valueLabelLabel}})(t);return r?e.cloneElement(r,{className:Gn(r.props.className)},(0,s.jsxs)(e.Fragment,{children:[r.props.children,(0,s.jsx)("span",{className:Gn(a.offset,n),"aria-hidden":!0,children:(0,s.jsx)("span",{className:a.circle,children:(0,s.jsx)("span",{className:a.label,children:i})})})]})):null}),{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(wi((e=>{let{theme:t}=e;return{zIndex:1,whiteSpace:"nowrap",...t.typography.body2,fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${au.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${au.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}}))),pu=gi("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>fi(e)&&"markActive"!==e,overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(wi((e=>{let{theme:t}=e;return{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]}}))),du=gi("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>fi(e)&&"markLabelActive"!==e,overridesResolver:(e,t)=>t.markLabel})(wi((e=>{let{theme:t}=e;return{...t.typography.body2,color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]}}))),fu=e=>{let{children:t}=e;return t},mu=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiSlider"}),i=je(),{"aria-label":a,"aria-valuetext":o,"aria-labelledby":l,component:c="span",components:u={},componentsProps:h={},color:p="primary",classes:d,className:f,disableSwap:m=!1,disabled:g=!1,getAriaLabel:y,getAriaValueText:v,marks:x=!1,max:b=100,min:_=0,name:w,onChange:k,onChangeCommitted:T,orientation:S="horizontal",shiftStep:A=10,size:M="medium",step:E=1,scale:C=ou,slotProps:P,slots:L,tabIndex:I,track:z="normal",value:O,valueLabelDisplay:R="off",valueLabelFormat:D=ou,...j}=n,F={...n,isRtl:i,max:b,min:_,classes:d,disabled:g,disableSwap:m,orientation:S,marks:x,color:p,size:M,step:E,shiftStep:A,scale:C,track:z,valueLabelDisplay:R,valueLabelFormat:D},{axisProps:B,getRootProps:N,getHiddenInputProps:U,getThumbProps:V,open:q,active:H,axis:G,focusedThumbIndex:W,range:$,dragging:Z,marks:X,values:Y,trackOffset:K,trackLeap:J,getThumbStyle:Q}=function(t){const{"aria-labelledby":r,defaultValue:n,disabled:i=!1,disableSwap:a=!1,isRtl:o=!1,marks:s=!1,max:l=100,min:c=0,name:u,onChange:h,onChangeCommitted:p,orientation:d="horizontal",rootRef:f,scale:m=Qc,step:g=1,shiftStep:y=10,tabIndex:v,value:x}=t,b=e.useRef(void 0),[_,w]=e.useState(-1),[k,T]=e.useState(-1),[S,A]=e.useState(!1),M=e.useRef(0),E=e.useRef(null),[C,P]=Qs({controlled:x,default:n??c,name:"Slider"}),L=h&&((e,t,r)=>{const n=e.nativeEvent||e,i=new n.constructor(n.type,n);Object.defineProperty(i,"target",{writable:!0,value:{value:t,name:u}}),E.current=t,h(i,t,r)}),I=Array.isArray(C);let z=I?C.slice().sort(Hc):[C];z=z.map((e=>null==e?c:yr(e,c,l)));const O=!0===s&&null!==g?[...Array(Math.floor((l-c)/g)+1)].map(((e,t)=>({value:c+g*t}))):s||[],R=O.map((e=>e.value)),[D,j]=e.useState(-1),F=e.useRef(null),B=qi(f,F),N=e=>t=>{const r=Number(t.currentTarget.getAttribute("data-index"));pa(t.target)&&j(r),T(r),e?.onFocus?.(t)},U=e=>t=>{pa(t.target)||j(-1),T(-1),e?.onBlur?.(t)},V=(e,t)=>{const r=Number(e.currentTarget.getAttribute("data-index")),n=z[r],i=R.indexOf(n);let o=t;if(O&&null==g){const e=R[R.length-1];o=o>=e?e:o<=R[0]?R[0]:ot=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const e=Number(t.currentTarget.getAttribute("data-index")),r=z[e];let n=null;if(null!=g){const e=t.shiftKey?y:g;switch(t.key){case"ArrowUp":n=qc(r,e,1,c,l);break;case"ArrowRight":n=qc(r,e,o?-1:1,c,l);break;case"ArrowDown":n=qc(r,e,-1,c,l);break;case"ArrowLeft":n=qc(r,e,o?1:-1,c,l);break;case"PageUp":n=qc(r,y,1,c,l);break;case"PageDown":n=qc(r,y,-1,c,l);break;case"Home":n=c;break;case"End":n=l}}else if(O){const e=R[R.length-1],i=R.indexOf(r),a=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"].includes(t.key)?n=0===i?R[0]:R[i-1]:a.includes(t.key)&&(n=i===R.length-1?e:R[i+1])}null!=n&&V(t,n)}e?.onKeyDown?.(t)};sr((()=>{i&&F.current.contains(document.activeElement)&&document.activeElement?.blur()}),[i]),i&&-1!==_&&w(-1),i&&-1!==D&&j(-1);const H=e.useRef(void 0);let G=d;o&&"horizontal"===d&&(G+="-reverse");const W=e=>{let{finger:t,move:r=!1}=e;const{current:n}=F,{width:i,height:o,bottom:s,left:u}=n.getBoundingClientRect();let h,p;if(h=G.startsWith("vertical")?(s-t.y)/o:(t.x-u)/i,G.includes("-reverse")&&(h=1-h),p=function(e,t,r){return(r-t)*e+t}(h,c,l),g)p=Zc(p,g,c);else{const e=Gc(R,p);p=R[e]}p=yr(p,c,l);let d=0;if(I){d=r?H.current:Gc(z,p),a&&(p=yr(p,z[d-1]||-1/0,z[d+1]||1/0));const e=p;p=Xc({values:z,newValue:p,index:d}),a&&r||(d=p.indexOf(e),H.current=d)}return{newValue:p,activeIndex:d}},$=fa((e=>{const t=Wc(e,b);if(!t)return;if(M.current+=1,"mousemove"===e.type&&0===e.buttons)return void Z(e);const{newValue:r,activeIndex:n}=W({finger:t,move:!0});Yc({sliderRef:F,activeIndex:n,setActive:w}),P(r),!S&&M.current>2&&A(!0),L&&!Kc(r,C)&&L(e,r,n)})),Z=fa((e=>{const t=Wc(e,b);if(A(!1),!t)return;const{newValue:r}=W({finger:t,move:!0});w(-1),"touchend"===e.type&&T(-1),p&&p(e,E.current??r),b.current=void 0,Y()})),X=fa((e=>{if(i)return;tu()||e.preventDefault();const t=e.changedTouches[0];null!=t&&(b.current=t.identifier);const r=Wc(e,b);if(!1!==r){const{newValue:t,activeIndex:n}=W({finger:r});Yc({sliderRef:F,activeIndex:n,setActive:w}),P(t),L&&!Kc(t,C)&&L(e,t,n)}M.current=0;const n=oa(F.current);n.addEventListener("touchmove",$,{passive:!0}),n.addEventListener("touchend",Z,{passive:!0})})),Y=e.useCallback((()=>{const e=oa(F.current);e.removeEventListener("mousemove",$),e.removeEventListener("mouseup",Z),e.removeEventListener("touchmove",$),e.removeEventListener("touchend",Z)}),[Z,$]);e.useEffect((()=>{const{current:e}=F;return e.addEventListener("touchstart",X,{passive:tu()}),()=>{e.removeEventListener("touchstart",X),Y()}}),[Y,X]),e.useEffect((()=>{i&&Y()}),[i,Y]);const K=$c(I?z[0]:c,c,l),J=$c(z[z.length-1],c,l)-K,Q=e=>t=>{e.onMouseLeave?.(t),T(-1)};let ee;return"vertical"===d&&(ee=o?"vertical-rl":"vertical-lr"),{active:_,axis:G,axisProps:Jc,dragging:S,focusedThumbIndex:D,getHiddenInputProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=$i(e),a={onChange:(s=n||{},e=>{s.onChange?.(e),V(e,e.target.valueAsNumber)}),onFocus:N(n||{}),onBlur:U(n||{}),onKeyDown:q(n||{})};var s;const h={...n,...a};return{tabIndex:v,"aria-labelledby":r,"aria-orientation":d,"aria-valuemax":m(l),"aria-valuemin":m(c),name:u,type:"range",min:t.min,max:t.max,step:null===t.step&&t.marks?"any":t.step??void 0,disabled:i,...e,...h,style:{...Uc,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:ee}}},getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=$i(e),r={onMouseDown:(n=t||{},e=>{if(n.onMouseDown?.(e),i)return;if(e.defaultPrevented)return;if(0!==e.button)return;e.preventDefault();const t=Wc(e,b);if(!1!==t){const{newValue:r,activeIndex:n}=W({finger:t});Yc({sliderRef:F,activeIndex:n,setActive:w}),P(r),L&&!Kc(r,C)&&L(e,r,n)}M.current=0;const r=oa(F.current);r.addEventListener("mousemove",$,{passive:!0}),r.addEventListener("mouseup",Z)})};var n;const a={...t,...r};return{...e,ref:B,...a}},getThumbProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=$i(e),r={onMouseOver:(n=t||{},e=>{n.onMouseOver?.(e);const t=Number(e.currentTarget.getAttribute("data-index"));T(t)}),onMouseLeave:Q(t||{})};var n;return{...e,...t,...r}},marks:O,open:k,range:I,rootRef:B,trackLeap:J,trackOffset:K,values:z,getThumbStyle:e=>({pointerEvents:-1!==_&&_!==e?"none":void 0})}}({...F,rootRef:r});F.marked=X.length>0&&X.some((e=>e.label)),F.dragging=Z,F.focusedThumbIndex=W;const ee=(e=>{const{disabled:t,dragging:r,marked:n,orientation:i,track:a,classes:o,color:s,size:l}=e;return Wn({root:["root",t&&"disabled",r&&"dragging",n&&"marked","vertical"===i&&"vertical","inverted"===a&&"trackInverted",!1===a&&"trackFalse",s&&`color${Oi(s)}`,l&&`size${Oi(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Oi(l)}`,s&&`thumbColor${Oi(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]},iu,o)})(F),te=L?.root??u.Root??su,re=L?.rail??u.Rail??lu,ne=L?.track??u.Track??cu,ie=L?.thumb??u.Thumb??uu,ae=L?.valueLabel??u.ValueLabel??hu,oe=L?.mark??u.Mark??pu,se=L?.markLabel??u.MarkLabel??du,le=L?.input??u.Input??"input",ce=P?.root??h.root,ue=P?.rail??h.rail,he=P?.track??h.track,pe=P?.thumb??h.thumb,de=P?.valueLabel??h.valueLabel,fe=P?.mark??h.mark,me=P?.markLabel??h.markLabel,ge=P?.input??h.input,ye=ta({elementType:te,getSlotProps:N,externalSlotProps:ce,externalForwardedProps:j,additionalProps:{...nu(te)&&{as:c}},ownerState:{...F,...ce?.ownerState},className:[ee.root,f]}),ve=ta({elementType:re,externalSlotProps:ue,ownerState:F,className:ee.rail}),xe=ta({elementType:ne,externalSlotProps:he,additionalProps:{style:{...B[G].offset(K),...B[G].leap(J)}},ownerState:{...F,...he?.ownerState},className:ee.track}),be=ta({elementType:ie,getSlotProps:V,externalSlotProps:pe,ownerState:{...F,...pe?.ownerState},className:ee.thumb}),_e=ta({elementType:ae,externalSlotProps:de,ownerState:{...F,...de?.ownerState},className:ee.valueLabel}),we=ta({elementType:oe,externalSlotProps:fe,ownerState:F,className:ee.mark}),ke=ta({elementType:se,externalSlotProps:me,ownerState:F,className:ee.markLabel}),Te=ta({elementType:le,getSlotProps:U,externalSlotProps:ge,ownerState:F});return(0,s.jsxs)(te,{...ye,children:[(0,s.jsx)(re,{...ve}),(0,s.jsx)(ne,{...xe}),X.filter((e=>e.value>=_&&e.value<=b)).map(((t,r)=>{const n=$c(t.value,_,b),i=B[G].offset(n);let a;return a=!1===z?Y.includes(t.value):"normal"===z&&($?t.value>=Y[0]&&t.value<=Y[Y.length-1]:t.value<=Y[0])||"inverted"===z&&($?t.value<=Y[0]||t.value>=Y[Y.length-1]:t.value>=Y[0]),(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(oe,{"data-index":r,...we,...!ru(oe)&&{markActive:a},style:{...i,...we.style},className:Gn(we.className,a&&ee.markActive)}),null!=t.label?(0,s.jsx)(se,{"aria-hidden":!0,"data-index":r,...ke,...!ru(se)&&{markLabelActive:a},style:{...i,...ke.style},className:Gn(ee.markLabel,ke.className,a&&ee.markLabelActive),children:t.label}):null]},r)})),Y.map(((e,t)=>{const r=$c(e,_,b),n=B[G].offset(r),i="off"===R?fu:ae;return(0,s.jsx)(i,{...!ru(i)&&{valueLabelFormat:D,valueLabelDisplay:R,value:"function"===typeof D?D(C(e),t):D,index:t,open:q===t||H===t||"on"===R,disabled:g},..._e,children:(0,s.jsx)(ie,{"data-index":t,...be,className:Gn(ee.thumb,be.className,H===t&&ee.active,W===t&&ee.focusVisible),style:{...n,...Q(t),...be.style},children:(0,s.jsx)(le,{"data-index":t,"aria-label":y?y(t):a,"aria-valuenow":C(e),"aria-labelledby":l,"aria-valuetext":v?v(C(e),t):o,value:Y[t],...Te})})},t)}))]})})),gu=Bi((0,s.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),yu=Bi((0,s.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),vu=Bi((0,s.jsx)("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"}));function xu(e){return Ai("MuiButton",e)}const bu=Mi("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const _u=e.createContext({});const wu=e.createContext(void 0),ku=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Tu=gi(Ha,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${Oi(r.color)}`],t[`size${Oi(r.size)}`],t[`${r.variant}Size${Oi(r.size)}`],"inherit"===r.color&&t.colorInherit,r.disableElevation&&t.disableElevation,r.fullWidth&&t.fullWidth,r.loading&&t.loading]}})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?t.palette.grey[300]:t.palette.grey[800],n="light"===t.palette.mode?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${bu.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${bu.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${bu.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${bu.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:Tr(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette[r].main,t.palette.action.hoverOpacity)}}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:r,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${bu.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${bu.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${bu.loading}`]:{color:"transparent"}}}]}}))),Su=gi("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.startIcon,r.loading&&t.startIconLoadingStart,t[`iconSize${Oi(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...ku]}})),Au=gi("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.endIcon,r.loading&&t.endIconLoadingEnd,t[`iconSize${Oi(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...ku]}})),Mu=gi("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}})),Eu=gi("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Cu=e.forwardRef((function(t,r){const n=e.useContext(_u),i=e.useContext(wu),a=yi({props:Be(n,t),name:"MuiButton"}),{children:o,color:l="primary",component:c="button",className:u,disabled:h=!1,disableElevation:p=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:m,fullWidth:g=!1,id:y,loading:v=null,loadingIndicator:x,loadingPosition:b="center",size:_="medium",startIcon:w,type:k,variant:T="text",...S}=a,A=Js(y),M=x??(0,s.jsx)(lc,{"aria-labelledby":A,color:"inherit",size:16}),E={...a,color:l,component:c,disabled:h,disableElevation:p,disableFocusRipple:d,fullWidth:g,loading:v,loadingIndicator:M,loadingPosition:b,size:_,type:k,variant:T},C=(e=>{const{color:t,disableElevation:r,fullWidth:n,size:i,variant:a,loading:o,loadingPosition:s,classes:l}=e,c=Wn({root:["root",o&&"loading",a,`${a}${Oi(t)}`,`size${Oi(i)}`,`${a}Size${Oi(i)}`,`color${Oi(t)}`,r&&"disableElevation",n&&"fullWidth",o&&`loadingPosition${Oi(s)}`],startIcon:["icon","startIcon",`iconSize${Oi(i)}`],endIcon:["icon","endIcon",`iconSize${Oi(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},xu,l);return{...l,...c}})(E),P=(w||v&&"start"===b)&&(0,s.jsx)(Su,{className:C.startIcon,ownerState:E,children:w||(0,s.jsx)(Eu,{className:C.loadingIconPlaceholder,ownerState:E})}),L=(f||v&&"end"===b)&&(0,s.jsx)(Au,{className:C.endIcon,ownerState:E,children:f||(0,s.jsx)(Eu,{className:C.loadingIconPlaceholder,ownerState:E})}),I=i||"",z="boolean"===typeof v?(0,s.jsx)("span",{className:C.loadingWrapper,style:{display:"contents"},children:v&&(0,s.jsx)(Mu,{className:C.loadingIndicator,ownerState:E,children:M})}):null;return(0,s.jsxs)(Tu,{ownerState:E,className:Gn(n.className,C.root,u,I),component:c,disabled:h||v,focusRipple:!d,focusVisibleClassName:Gn(C.focusVisible,m),ref:r,type:k,id:v?A:y,...S,classes:C,children:[P,"end"!==b&&z,o,"end"===b&&z,L]})})),Pu=e=>{const{prompt:t,submitQuery:r}=e;let n=e.tunables;return"string"===typeof n&&(n=JSON.parse(n)),console.log(n),void 0===r?(0,s.jsx)(yc,{children:t}):(0,s.jsx)(Cu,{variant:"outlined",sx:{color:e=>e.palette.custom.highlight,borderColor:e=>e.palette.custom.highlight,m:1},size:"small",onClick:e=>{r(t,n)},children:t})};function Lu(e){return parseInt(e,10)||0}const Iu={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function zu(e){return function(e){for(const t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}const Ou=e.forwardRef((function(t,r){const{onChange:n,maxRows:i,minRows:a=1,style:o,value:l,...c}=t,{current:u}=e.useRef(null!=l),h=e.useRef(null),p=qi(r,h),d=e.useRef(null),f=e.useRef(null),m=e.useCallback((()=>{const e=h.current,r=f.current;if(!e||!r)return;const n=sa(e).getComputedStyle(e);if("0px"===n.width)return{outerHeightStyle:0,overflowing:!1};r.style.width=n.width,r.value=e.value||t.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");const o=n.boxSizing,s=Lu(n.paddingBottom)+Lu(n.paddingTop),l=Lu(n.borderBottomWidth)+Lu(n.borderTopWidth),c=r.scrollHeight;r.value="x";const u=r.scrollHeight;let p=c;a&&(p=Math.max(Number(a)*u,p)),i&&(p=Math.min(Number(i)*u,p)),p=Math.max(p,u);return{outerHeightStyle:p+("border-box"===o?s+l:0),overflowing:Math.abs(p-c)<=1}}),[i,a,t.placeholder]),g=fa((()=>{const e=h.current,t=m();if(!e||!t||zu(t))return!1;const r=t.outerHeightStyle;return null!=d.current&&d.current!==r})),y=e.useCallback((()=>{const e=h.current,t=m();if(!e||!t||zu(t))return;const r=t.outerHeightStyle;d.current!==r&&(d.current=r,e.style.height=`${r}px`),e.style.overflow=t.overflowing?"hidden":""}),[m]),v=e.useRef(-1);sr((()=>{const e=ra(y),t=h?.current;if(!t)return;const r=sa(t);let n;return r.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(n=new ResizeObserver((()=>{g()&&(n.unobserve(t),cancelAnimationFrame(v.current),y(),v.current=requestAnimationFrame((()=>{n.observe(t)})))})),n.observe(t)),()=>{e.clear(),cancelAnimationFrame(v.current),r.removeEventListener("resize",e),n&&n.disconnect()}}),[m,y,g]),sr((()=>{y()}));return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)("textarea",{value:l,onChange:e=>{u||y(),n&&n(e)},ref:p,rows:a,style:o,...c}),(0,s.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:f,tabIndex:-1,style:{...Iu,...o,paddingTop:0,paddingBottom:0}})]})}));function Ru(e){let{props:t,states:r,muiFormControl:n}=e;return r.reduce(((e,r)=>(e[r]=t[r],n&&"undefined"===typeof t[r]&&(e[r]=n[r]),e)),{})}const Du=e.createContext(void 0);function ju(){return e.useContext(Du)}function Fu(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Bu(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(Fu(e.value)&&""!==e.value||t&&Fu(e.defaultValue)&&""!==e.defaultValue)}function Nu(e){return Ai("MuiInputBase",e)}const Uu=Mi("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Vu;const qu=(e,t)=>{const{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${Oi(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},Hu=(e,t)=>{const{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},Gu=gi("div",{name:"MuiInputBase",slot:"Root",overridesResolver:qu})(wi((e=>{let{theme:t}=e;return{...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Uu.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"4px 0 5px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"100%"}}]}}))),Wu=gi("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Hu})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},i={opacity:"0 !important"},a=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Uu.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${Uu.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableInjectingGlobalStyles},style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}}))),$u=bc({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Zu=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:a,autoFocus:o,className:l,color:c,components:u={},componentsProps:h={},defaultValue:p,disabled:d,disableInjectingGlobalStyles:f,endAdornment:m,error:g,fullWidth:y=!1,id:v,inputComponent:x="input",inputProps:b={},inputRef:_,margin:w,maxRows:k,minRows:T,multiline:S=!1,name:A,onBlur:M,onChange:E,onClick:C,onFocus:P,onKeyDown:L,onKeyUp:I,placeholder:z,readOnly:O,renderSuffix:R,rows:D,size:j,slotProps:F={},slots:B={},startAdornment:N,type:U="text",value:V,...q}=n,H=null!=b.value?b.value:V,{current:G}=e.useRef(null!=H),W=e.useRef(),$=e.useCallback((e=>{0}),[]),Z=da(W,_,b.ref,$),[X,Y]=e.useState(!1),K=ju();const J=Ru({props:n,muiFormControl:K,states:["color","disabled","error","hiddenLabel","size","required","filled"]});J.focused=K?K.focused:X,e.useEffect((()=>{!K&&d&&X&&(Y(!1),M&&M())}),[K,d,X,M]);const Q=K&&K.onFilled,ee=K&&K.onEmpty,te=e.useCallback((e=>{Bu(e)?Q&&Q():ee&&ee()}),[Q,ee]);aa((()=>{G&&te({value:H})}),[H,te,G]);e.useEffect((()=>{te(W.current)}),[]);let re=x,ne=b;S&&"input"===re&&(ne=D?{type:void 0,minRows:D,maxRows:D,...ne}:{type:void 0,maxRows:k,minRows:T,...ne},re=Ou);e.useEffect((()=>{K&&K.setAdornedStart(Boolean(N))}),[K,N]);const ie={...n,color:J.color||"primary",disabled:J.disabled,endAdornment:m,error:J.error,focused:J.focused,formControl:K,fullWidth:y,hiddenLabel:J.hiddenLabel,multiline:S,size:J.size,startAdornment:N,type:U},ae=(e=>{const{classes:t,color:r,disabled:n,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:h,size:p,startAdornment:d,type:f}=e;return Wn({root:["root",`color${Oi(r)}`,n&&"disabled",i&&"error",l&&"fullWidth",o&&"focused",s&&"formControl",p&&"medium"!==p&&`size${Oi(p)}`,u&&"multiline",d&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",h&&"readOnly"],input:["input",n&&"disabled","search"===f&&"inputTypeSearch",u&&"inputMultiline","small"===p&&"inputSizeSmall",c&&"inputHiddenLabel",d&&"inputAdornedStart",a&&"inputAdornedEnd",h&&"readOnly"]},Nu,t)})(ie),oe=B.root||u.Root||Gu,se=F.root||h.root||{},le=B.input||u.Input||Wu;return ne={...ne,...F.input??h.input},(0,s.jsxs)(e.Fragment,{children:[!f&&"function"===typeof $u&&(Vu||(Vu=(0,s.jsx)($u,{}))),(0,s.jsxs)(oe,{...se,ref:r,onClick:e=>{W.current&&e.currentTarget===e.target&&W.current.focus(),C&&C(e)},...q,...!ru(oe)&&{ownerState:{...ie,...se.ownerState}},className:Gn(ae.root,se.className,l,O&&"MuiInputBase-readOnly"),children:[N,(0,s.jsx)(Du.Provider,{value:null,children:(0,s.jsx)(le,{"aria-invalid":J.error,"aria-describedby":i,autoComplete:a,autoFocus:o,defaultValue:p,disabled:J.disabled,id:v,onAnimationStart:e=>{te("mui-auto-fill-cancel"===e.animationName?W.current:{value:"x"})},name:A,placeholder:z,readOnly:O,required:J.required,rows:D,value:H,onKeyDown:L,onKeyUp:I,type:U,...ne,...!ru(le)&&{as:re,ownerState:{...ie,...ne.ownerState}},ref:Z,className:Gn(ae.input,ne.className,O&&"MuiInputBase-readOnly"),onBlur:e=>{M&&M(e),b.onBlur&&b.onBlur(e),K&&K.onBlur?K.onBlur(e):Y(!1)},onChange:function(e){if(!G){const t=e.target||W.current;if(null==t)throw new Error(Ze(1));te({value:t.value})}for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{P&&P(e),b.onFocus&&b.onFocus(e),K&&K.onFocus?K.onFocus(e):Y(!0)}})}),m,R?R({...J,startAdornment:N}):null]})]})}));function Xu(e){return Ai("MuiInput",e)}const Yu={...Uu,...Mi("MuiInput",["root","underline","input"])},Ku=gi(Gu,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...qu(e,t),!r.disableUnderline&&t.underline]}})(wi((e=>{let{theme:t}=e;let r="light"===t.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{"label + &":{marginTop:16}}},{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Yu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Yu.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Yu.disabled}, .${Yu.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Yu.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}}))]}}))),Ju=gi(Wu,{name:"MuiInput",slot:"Input",overridesResolver:Hu})({}),Qu=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiInput"}),{disableUnderline:n=!1,components:i={},componentsProps:a,fullWidth:o=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:h={},type:p="text",...d}=r,f=(e=>{const{classes:t,disableUnderline:r}=e,n=Wn({root:["root",!r&&"underline"],input:["input"]},Xu,t);return{...t,...n}})(r),m={root:{ownerState:{disableUnderline:n}}},g=u??a?Qe(u??a,m):m,y=h.root??i.Root??Ku,v=h.input??i.Input??Ju;return(0,s.jsx)(Zu,{slots:{root:y,input:v},slotProps:g,fullWidth:o,inputComponent:l,multiline:c,ref:t,type:p,...d,classes:f})}));Qu.muiName="Input";const eh=Qu;function th(e){return Ai("MuiFilledInput",e)}const rh={...Uu,...Mi("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},nh=gi(Gu,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...qu(e,t),!r.disableUnderline&&t.underline]}})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i}},[`&.${rh.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i},[`&.${rh.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rh.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rh.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rh.disabled}, .${rh.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${rh.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{disableUnderline:!1,color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r]?.main}`}}}})),{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:12}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:12}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"25px 12px 8px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}}]}}))),ih=gi(Wu,{name:"MuiFilledInput",slot:"Input",overridesResolver:Hu})(wi((e=>{let{theme:t}=e;return{paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}}))),ah=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiFilledInput"}),{disableUnderline:n=!1,components:i={},componentsProps:a,fullWidth:o=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:h,slots:p={},type:d="text",...f}=r,m={...r,disableUnderline:n,fullWidth:o,inputComponent:c,multiline:u,type:d},g=(e=>{const{classes:t,disableUnderline:r,startAdornment:n,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,l=Wn({root:["root",!r&&"underline",n&&"adornedStart",i&&"adornedEnd","small"===a&&`size${Oi(a)}`,o&&"hiddenLabel",s&&"multiline"],input:["input"]},th,t);return{...t,...l}})(r),y={root:{ownerState:m},input:{ownerState:m}},v=h??a?Qe(y,h??a):y,x=p.root??i.Root??nh,b=p.input??i.Input??ih;return(0,s.jsx)(Zu,{slots:{root:x,input:b},slotProps:v,fullWidth:o,inputComponent:c,multiline:u,ref:t,type:d,...f,classes:g})}));ah.muiName="Input";const oh=ah;var sh;const lh=gi("fieldset",{shouldForwardProp:mi})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),ch=gi("legend",{shouldForwardProp:mi})(wi((e=>{let{theme:t}=e;return{float:"unset",width:"auto",overflow:"hidden",variants:[{props:e=>{let{ownerState:t}=e;return!t.withLabel},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:e=>{let{ownerState:t}=e;return t.withLabel},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:e=>{let{ownerState:t}=e;return t.withLabel&&t.notched},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}})));function uh(e){return Ai("MuiOutlinedInput",e)}const hh={...Uu,...Mi("MuiOutlinedInput",["root","notchedOutline","input"])},ph=gi(Gu,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:qu})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${hh.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${hh.focused} .${hh.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${hh.focused} .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${hh.error} .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${hh.disabled} .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:14}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:14}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"16.5px 14px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{padding:"8.5px 14px"}}]}}))),dh=gi((function(e){const{children:t,classes:r,className:n,label:i,notched:a,...o}=e,l=null!=i&&""!==i,c={...e,notched:a,withLabel:l};return(0,s.jsx)(lh,{"aria-hidden":!0,className:n,ownerState:c,...o,children:(0,s.jsx)(ch,{ownerState:c,children:l?(0,s.jsx)("span",{children:i}):sh||(sh=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"}))})})}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}}))),fh=gi(Wu,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Hu})(wi((e=>{let{theme:t}=e;return{padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:0}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}}]}}))),mh=e.forwardRef((function(t,r){var n;const i=yi({props:t,name:"MuiOutlinedInput"}),{components:a={},fullWidth:o=!1,inputComponent:l="input",label:c,multiline:u=!1,notched:h,slots:p={},type:d="text",...f}=i,m=(e=>{const{classes:t}=e,r=Wn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},uh,t);return{...t,...r}})(i),g=ju(),y=Ru({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:g,fullWidth:o,hiddenLabel:y.hiddenLabel,multiline:u,size:y.size,type:d},x=p.root??a.Root??ph,b=p.input??a.Input??fh;return(0,s.jsx)(Zu,{slots:{root:x,input:b},renderSuffix:t=>(0,s.jsx)(dh,{ownerState:v,className:m.notchedOutline,label:null!=c&&""!==c&&y.required?n||(n=(0,s.jsxs)(e.Fragment,{children:[c,"\u2009","*"]})):c,notched:"undefined"!==typeof h?h:Boolean(t.startAdornment||t.filled||t.focused)}),fullWidth:o,inputComponent:l,multiline:u,ref:r,type:d,...f,classes:{...m,notchedOutline:null}})}));mh.muiName="Input";const gh=mh;function yh(e){return Ai("MuiFormLabel",e)}const vh=Mi("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),xh=gi("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"secondary"===r.color&&t.colorSecondary,r.filled&&t.filled]}})(wi((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${vh.focused}`]:{color:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${vh.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${vh.error}`]:{color:(t.vars||t).palette.error.main}}}]}}))),bh=gi("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(wi((e=>{let{theme:t}=e;return{[`&.${vh.error}`]:{color:(t.vars||t).palette.error.main}}}))),_h=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiFormLabel"}),{children:n,className:i,color:a,component:o="label",disabled:l,error:c,filled:u,focused:h,required:p,...d}=r,f=Ru({props:r,muiFormControl:ju(),states:["color","required","focused","disabled","error","filled"]}),m={...r,color:f.color||"primary",component:o,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required},g=(e=>{const{classes:t,color:r,focused:n,disabled:i,error:a,filled:o,required:s}=e;return Wn({root:["root",`color${Oi(r)}`,i&&"disabled",a&&"error",o&&"filled",n&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]},yh,t)})(m);return(0,s.jsxs)(xh,{as:o,ownerState:m,className:Gn(g.root,i),ref:t,...d,children:[n,f.required&&(0,s.jsxs)(bh,{ownerState:m,"aria-hidden":!0,className:g.asterisk,children:["\u2009","*"]})]})}));function wh(e){return Ai("MuiInputLabel",e)}Mi("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const kh=gi(_h,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${vh.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,"small"===r.size&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,r.focused&&t.focused,t[r.variant]]}})(wi((e=>{let{theme:t}=e;return{display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:e=>{let{ownerState:t}=e;return t.shrink},style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:e=>{let{ownerState:t}=e;return!t.disableAnimation},style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"filled"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:e=>{let{variant:t,ownerState:r,size:n}=e;return"filled"===t&&r.shrink&&"small"===n},style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"outlined"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}}))),Th=e.forwardRef((function(e,t){const r=yi({name:"MuiInputLabel",props:e}),{disableAnimation:n=!1,margin:i,shrink:a,variant:o,className:l,...c}=r,u=ju();let h=a;"undefined"===typeof h&&u&&(h=u.filled||u.focused||u.adornedStart);const p=Ru({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),d={...r,disableAnimation:n,formControl:u,shrink:h,size:p.size,variant:p.variant,required:p.required,focused:p.focused},f=(e=>{const{classes:t,formControl:r,size:n,shrink:i,disableAnimation:a,variant:o,required:s}=e,l=Wn({root:["root",r&&"formControl",!a&&"animated",i&&"shrink",n&&"medium"!==n&&`size${Oi(n)}`,o],asterisk:[s&&"asterisk"]},wh,t);return{...t,...l}})(d);return(0,s.jsx)(kh,{"data-shrink":h,ref:t,className:Gn(f.root,l),...c,ownerState:d,classes:f})}));const Sh=function(t,r){return e.isValidElement(t)&&-1!==r.indexOf(t.type.muiName??t.type?._payload?.value?.muiName)};function Ah(e){return Ai("MuiFormControl",e)}Mi("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Mh=gi("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`margin${Oi(r.margin)}`],r.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Eh=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiFormControl"}),{children:i,className:a,color:o="primary",component:l="div",disabled:c=!1,error:u=!1,focused:h,fullWidth:p=!1,hiddenLabel:d=!1,margin:f="none",required:m=!1,size:g="medium",variant:y="outlined",...v}=n,x={...n,color:o,component:l,disabled:c,error:u,fullWidth:p,hiddenLabel:d,margin:f,required:m,size:g,variant:y},b=(e=>{const{classes:t,margin:r,fullWidth:n}=e;return Wn({root:["root","none"!==r&&`margin${Oi(r)}`,n&&"fullWidth"]},Ah,t)})(x),[_,w]=e.useState((()=>{let t=!1;return i&&e.Children.forEach(i,(e=>{if(!Sh(e,["Input","Select"]))return;const r=Sh(e,["Select"])?e.props.input:e;r&&r.props.startAdornment&&(t=!0)})),t})),[k,T]=e.useState((()=>{let t=!1;return i&&e.Children.forEach(i,(e=>{Sh(e,["Input","Select"])&&(Bu(e.props,!0)||Bu(e.props.inputProps,!0))&&(t=!0)})),t})),[S,A]=e.useState(!1);c&&S&&A(!1);const M=void 0===h||c?S:h;let E;e.useRef(!1);const C=e.useCallback((()=>{T(!0)}),[]),P=e.useCallback((()=>{T(!1)}),[]),L=e.useMemo((()=>({adornedStart:_,setAdornedStart:w,color:o,disabled:c,error:u,filled:k,focused:M,fullWidth:p,hiddenLabel:d,size:g,onBlur:()=>{A(!1)},onFocus:()=>{A(!0)},onEmpty:P,onFilled:C,registerEffect:E,required:m,variant:y})),[_,o,c,u,k,M,p,d,E,P,C,m,g,y]);return(0,s.jsx)(Du.Provider,{value:L,children:(0,s.jsx)(Mh,{as:l,ownerState:x,className:Gn(b.root,a),ref:r,...v,children:i})})}));function Ch(e){return Ai("MuiFormHelperText",e)}const Ph=Mi("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Lh;const Ih=gi("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size&&t[`size${Oi(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(wi((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ph.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ph.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:e=>{let{ownerState:t}=e;return t.contained},style:{marginLeft:14,marginRight:14}}]}}))),zh=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiFormHelperText"}),{children:n,className:i,component:a="p",disabled:o,error:l,filled:c,focused:u,margin:h,required:p,variant:d,...f}=r,m=Ru({props:r,muiFormControl:ju(),states:["variant","size","disabled","error","filled","focused","required"]}),g={...r,component:a,contained:"filled"===m.variant||"outlined"===m.variant,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete g.ownerState;const y=(e=>{const{classes:t,contained:r,size:n,disabled:i,error:a,filled:o,focused:s,required:l}=e;return Wn({root:["root",i&&"disabled",a&&"error",n&&`size${Oi(n)}`,r&&"contained",s&&"focused",o&&"filled",l&&"required"]},Ch,t)})(g);return(0,s.jsx)(Ih,{as:a,className:Gn(y.root,i),ref:t,...f,ownerState:g,children:" "===n?Lh||(Lh=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):n})}));const Oh=e.createContext({});function Rh(e){return Ai("MuiList",e)}Mi("MuiList",["root","padding","dense","subheader"]);const Dh=gi("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return!t.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:e=>{let{ownerState:t}=e;return t.subheader},style:{paddingTop:0}}]}),jh=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiList"}),{children:i,className:a,component:o="ul",dense:l=!1,disablePadding:c=!1,subheader:u,...h}=n,p=e.useMemo((()=>({dense:l})),[l]),d={...n,component:o,dense:l,disablePadding:c},f=(e=>{const{classes:t,disablePadding:r,dense:n,subheader:i}=e;return Wn({root:["root",!r&&"padding",n&&"dense",i&&"subheader"]},Rh,t)})(d);return(0,s.jsx)(Oh.Provider,{value:p,children:(0,s.jsxs)(Dh,{as:o,className:Gn(f.root,a),ref:r,ownerState:d,...h,children:[u,i]})})})),Fh=Al;function Bh(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function Nh(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function Uh(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function Vh(e,t,r,n,i,a){let o=!1,s=i(e,t,!!t&&r);for(;s;){if(s===e.firstChild){if(o)return!1;o=!0}const t=!n&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Uh(s,a)&&!t)return s.focus(),!0;s=i(e,s,r)}return!1}const qh=e.forwardRef((function(t,r){const{actions:n,autoFocus:i=!1,autoFocusItem:a=!1,children:o,className:l,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:h,variant:p="selectedMenu",...d}=t,f=e.useRef(null),m=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});aa((()=>{i&&f.current.focus()}),[i]),e.useImperativeHandle(n,(()=>({adjustStyleForScrollbar:(e,t)=>{let{direction:r}=t;const n=!f.current.style.width;if(e.clientHeight{e.isValidElement(t)?(t.props.disabled||("selectedMenu"===p&&t.props.selected||-1===y)&&(y=r),y===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(y+=1,y>=o.length&&(y=-1))):y===r&&(y+=1,y>=o.length&&(y=-1))}));const v=e.Children.map(o,((t,r)=>{if(r===y){const r={};return a&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===p&&(r.tabIndex=0),e.cloneElement(t,r)}return t}));return(0,s.jsx)(jh,{role:"menu",ref:g,className:l,onKeyDown:e=>{const t=f.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(h&&h(e));const n=Ka(t).activeElement;if("ArrowDown"===r)e.preventDefault(),Vh(t,n,u,c,Bh);else if("ArrowUp"===r)e.preventDefault(),Vh(t,n,u,c,Nh);else if("Home"===r)e.preventDefault(),Vh(t,null,u,c,Bh);else if("End"===r)e.preventDefault(),Vh(t,null,u,c,Nh);else if(1===r.length){const i=m.current,a=r.toLowerCase(),o=performance.now();i.keys.length>0&&(o-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&a!==i.keys[0]&&(i.repeating=!1)),i.lastTime=o,i.keys.push(a);const s=n&&!i.repeating&&Uh(n,i);i.previousKeyMatched&&(s||Vh(t,n,!1,c,Bh,i))?e.preventDefault():i.previousKeyMatched=!1}h&&h(e)},tabIndex:i?0:-1,...d,children:v})}));function Hh(e){return Ai("MuiPopover",e)}Mi("MuiPopover",["root","paper"]);function Gh(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.height/2:"bottom"===t&&(r=e.height),r}function Wh(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.width/2:"right"===t&&(r=e.width),r}function $h(e){return[e.horizontal,e.vertical].map((e=>"number"===typeof e?`${e}px`:e)).join(" ")}function Zh(e){return"function"===typeof e?e():e}const Xh=gi(Fl,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Yh=gi(Pi,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Kh=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiPopover"}),{action:i,anchorEl:a,anchorOrigin:o={vertical:"top",horizontal:"left"},anchorPosition:l,anchorReference:c="anchorEl",children:u,className:h,container:p,elevation:d=8,marginThreshold:f=16,open:m,PaperProps:g={},slots:y={},slotProps:v={},transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:_="auto",TransitionProps:w={},disableScrollLock:k=!1,...T}=n,S=e.useRef(),A={...n,anchorOrigin:o,anchorReference:c,elevation:d,marginThreshold:f,transformOrigin:x,TransitionComponent:b,transitionDuration:_,TransitionProps:w},M=(e=>{const{classes:t}=e;return Wn({root:["root"],paper:["paper"]},Hh,t)})(A),E=e.useCallback((()=>{if("anchorPosition"===c)return l;const e=Zh(a),t=(e&&1===e.nodeType?e:Ka(S.current).body).getBoundingClientRect();return{top:t.top+Gh(t,o.vertical),left:t.left+Wh(t,o.horizontal)}}),[a,o.horizontal,o.vertical,l,c]),C=e.useCallback((e=>({vertical:Gh(e,x.vertical),horizontal:Wh(e,x.horizontal)})),[x.horizontal,x.vertical]),P=e.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},r=C(t);if("none"===c)return{top:null,left:null,transformOrigin:$h(r)};const n=E();let i=n.top-r.vertical,o=n.left-r.horizontal;const s=i+t.height,l=o+t.width,u=la(Zh(a)),h=u.innerHeight-f,p=u.innerWidth-f;if(null!==f&&ih){const e=s-h;i-=e,r.vertical+=e}if(null!==f&&op){const e=l-p;o-=e,r.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:$h(r)}}),[a,c,E,C,f]),[L,I]=e.useState(m),z=e.useCallback((()=>{const e=S.current;if(!e)return;const t=P(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,I(!0)}),[P]);e.useEffect((()=>(k&&window.addEventListener("scroll",z),()=>window.removeEventListener("scroll",z))),[a,k,z]);e.useEffect((()=>{m&&z()})),e.useImperativeHandle(i,(()=>m?{updatePosition:()=>{z()}}:null),[m,z]),e.useEffect((()=>{if(!m)return;const e=na((()=>{z()})),t=la(Zh(a));return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[a,m,z]);let O=_;const R={slots:{transition:b,...y},slotProps:{transition:w,paper:g,...v}},[D,j]=Yi("transition",{elementType:Po,externalForwardedProps:R,ownerState:A,getSlotProps:e=>({...e,onEntering:(t,r)=>{e.onEntering?.(t,r),z()},onExited:t=>{e.onExited?.(t),I(!1)}}),additionalProps:{appear:!0,in:m}});"auto"!==_||D.muiSupportAuto||(O=void 0);const F=p||(a?Ka(Zh(a)).body:void 0),[B,{slots:N,slotProps:U,...V}]=Yi("root",{ref:r,elementType:Xh,externalForwardedProps:{...R,...T},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:Vl("function"===typeof v.backdrop?v.backdrop(A):v.backdrop,{invisible:!0})},container:F,open:m},ownerState:A,className:Gn(M.root,h)}),[q,H]=Yi("paper",{ref:S,className:M.paper,elementType:Yh,externalForwardedProps:R,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:L?void 0:{opacity:0}},ownerState:A});return(0,s.jsx)(B,{...V,...!ru(B)&&{slots:N,slotProps:U,disableScrollLock:k},children:(0,s.jsx)(D,{...j,timeout:O,children:(0,s.jsx)(q,{...H,children:u})})})}));function Jh(e){return Ai("MuiMenu",e)}Mi("MuiMenu",["root","paper","list"]);const Qh={vertical:"top",horizontal:"right"},ep={vertical:"top",horizontal:"left"},tp=gi(Kh,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),rp=gi(Yh,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),np=gi(qh,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),ip=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiMenu"}),{autoFocus:i=!0,children:a,className:o,disableAutoFocusItem:l=!1,MenuListProps:c={},onClose:u,open:h,PaperProps:p={},PopoverClasses:d,transitionDuration:f="auto",TransitionProps:{onEntering:m,...g}={},variant:y="selectedMenu",slots:v={},slotProps:x={},...b}=n,_=je(),w={...n,autoFocus:i,disableAutoFocusItem:l,MenuListProps:c,onEntering:m,PaperProps:p,transitionDuration:f,TransitionProps:g,variant:y},k=(e=>{const{classes:t}=e;return Wn({root:["root"],paper:["paper"],list:["list"]},Jh,t)})(w),T=i&&!l&&h,S=e.useRef(null);let A=-1;e.Children.map(a,((t,r)=>{e.isValidElement(t)&&(t.props.disabled||("selectedMenu"===y&&t.props.selected||-1===A)&&(A=r))}));const M={slots:v,slotProps:{list:c,transition:g,paper:p,...x}},E=ta({elementType:v.root,externalSlotProps:x.root,ownerState:w,className:[k.root,o]}),[C,P]=Yi("paper",{className:k.paper,elementType:rp,externalForwardedProps:M,shouldForwardComponentProp:!0,ownerState:w}),[L,I]=Yi("list",{className:Gn(k.list,c.className),elementType:np,shouldForwardComponentProp:!0,externalForwardedProps:M,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{"Tab"===e.key&&(e.preventDefault(),u&&u(e,"tabKeyDown"))})(t),e.onKeyDown?.(t)}}),ownerState:w}),z="function"===typeof M.slotProps.transition?M.slotProps.transition(w):M.slotProps.transition;return(0,s.jsx)(tp,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:_?"right":"left"},transformOrigin:_?Qh:ep,slots:{root:v.root,paper:C,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:E,paper:P,backdrop:"function"===typeof x.backdrop?x.backdrop(w):x.backdrop,transition:{...z,onEntering:function(){for(var e=arguments.length,t=new Array(e),r=0;r{S.current&&S.current.adjustStyleForScrollbar(e,{direction:_?"rtl":"ltr"}),m&&m(e,t)})(...t),z?.onEntering?.(...t)}}},open:h,ref:r,transitionDuration:f,ownerState:w,...b,classes:d,children:(0,s.jsx)(L,{actions:S,autoFocus:i&&(-1===A||l),autoFocusItem:T,variant:y,...I,children:a})})}));function ap(e){return Ai("MuiNativeSelect",e)}const op=Mi("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),sp=gi("select")((e=>{let{theme:t}=e;return{MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${op.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:e=>{let{ownerState:t}=e;return"filled"!==t.variant&&"outlined"!==t.variant},style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]}})),lp=gi(sp,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:mi,overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${op.multiple}`]:t.multiple}]}})({}),cp=gi("svg")((e=>{let{theme:t}=e;return{position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${op.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:e=>{let{ownerState:t}=e;return t.open},style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]}})),up=gi(cp,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${Oi(r.variant)}`],r.open&&t.iconOpen]}})({}),hp=e.forwardRef((function(t,r){const{className:n,disabled:i,error:a,IconComponent:o,inputRef:l,variant:c="standard",...u}=t,h={...t,disabled:i,variant:c,error:a},p=(e=>{const{classes:t,variant:r,disabled:n,multiple:i,open:a,error:o}=e;return Wn({select:["select",r,n&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${Oi(r)}`,a&&"iconOpen",n&&"disabled"]},ap,t)})(h);return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(lp,{ownerState:h,className:Gn(p.select,n),disabled:i,ref:l||r,...u}),t.multiple?null:(0,s.jsx)(up,{as:o,ownerState:h,className:p.icon})]})}));function pp(e){return Ai("MuiSelect",e)}const dp=Mi("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var fp;const mp=gi(sp,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`&.${dp.select}`]:t.select},{[`&.${dp.select}`]:t[r.variant]},{[`&.${dp.error}`]:t.error},{[`&.${dp.multiple}`]:t.multiple}]}})({[`&.${dp.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),gp=gi(cp,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${Oi(r.variant)}`],r.open&&t.iconOpen]}})({}),yp=gi("input",{shouldForwardProp:e=>fi(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function vp(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function xp(e){return null==e||"string"===typeof e&&!e.trim()}const bp=e.forwardRef((function(t,r){const{"aria-describedby":n,"aria-label":i,autoFocus:a,autoWidth:o,children:l,className:c,defaultOpen:u,defaultValue:h,disabled:p,displayEmpty:d,error:f=!1,IconComponent:m,inputRef:g,labelId:y,MenuProps:v={},multiple:x,name:b,onBlur:_,onChange:w,onClose:k,onFocus:T,onOpen:S,open:A,readOnly:M,renderValue:E,required:C,SelectDisplayProps:P={},tabIndex:L,type:I,value:z,variant:O="standard",...R}=t,[D,j]=el({controlled:z,default:h,name:"Select"}),[F,B]=el({controlled:A,default:u,name:"Select"}),N=e.useRef(null),U=e.useRef(null),[V,q]=e.useState(null),{current:H}=e.useRef(null!=A),[G,W]=e.useState(),$=da(r,g),Z=e.useCallback((e=>{U.current=e,e&&q(e)}),[]),X=V?.parentNode;e.useImperativeHandle($,(()=>({focus:()=>{U.current.focus()},node:N.current,value:D})),[D]),e.useEffect((()=>{u&&F&&V&&!H&&(W(o?null:X.clientWidth),U.current.focus())}),[V,o]),e.useEffect((()=>{a&&U.current.focus()}),[a]),e.useEffect((()=>{if(!y)return;const e=Ka(U.current).getElementById(y);if(e){const t=()=>{getSelection().isCollapsed&&U.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[y]);const Y=(e,t)=>{e?S&&S(t):k&&k(t),H||(W(o?null:X.clientWidth),B(e))},K=e.Children.toArray(l),J=e=>t=>{let r;if(t.currentTarget.hasAttribute("tabindex")){if(x){r=Array.isArray(D)?D.slice():[];const t=D.indexOf(e.props.value);-1===t?r.push(e.props.value):r.splice(t,1)}else r=e.props.value;if(e.props.onClick&&e.props.onClick(t),D!==r&&(j(r),w)){const n=t.nativeEvent||t,i=new n.constructor(n.type,n);Object.defineProperty(i,"target",{writable:!0,value:{value:r,name:b}}),w(i,e)}x||Y(!1,t)}},Q=null!==V&&F;let ee,te;delete R["aria-invalid"];const re=[];let ne=!1,ie=!1;(Bu({value:D})||d)&&(E?ee=E(D):ne=!0);const ae=K.map((t=>{if(!e.isValidElement(t))return null;let r;if(x){if(!Array.isArray(D))throw new Error(Ze(2));r=D.some((e=>vp(e,t.props.value))),r&&ne&&re.push(t.props.children)}else r=vp(D,t.props.value),r&&ne&&(te=t.props.children);return r&&(ie=!0),e.cloneElement(t,{"aria-selected":r?"true":"false",onClick:J(t),onKeyUp:e=>{" "===e.key&&e.preventDefault(),t.props.onKeyUp&&t.props.onKeyUp(e)},role:"option",selected:r,value:void 0,"data-value":t.props.value})}));ne&&(ee=x?0===re.length?null:re.reduce(((e,t,r)=>(e.push(t),r{const{classes:t,variant:r,disabled:n,multiple:i,open:a,error:o}=e;return Wn({select:["select",r,n&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${Oi(r)}`,a&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]},pp,t)})(ce),he={...v.PaperProps,...v.slotProps?.paper},pe=Ks();return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(mp,{as:"div",ref:Z,tabIndex:oe,role:"combobox","aria-controls":Q?pe:void 0,"aria-disabled":p?"true":void 0,"aria-expanded":Q?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[y,le].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":C?"true":void 0,"aria-invalid":f?"true":void 0,onKeyDown:e=>{if(!M){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),Y(!0,e))}},onMouseDown:p||M?null:e=>{0===e.button&&(e.preventDefault(),U.current.focus(),Y(!0,e))},onBlur:e=>{!Q&&_&&(Object.defineProperty(e,"target",{writable:!0,value:{value:D,name:b}}),_(e))},onFocus:T,...P,ownerState:ce,className:Gn(P.className,ue.select,c),id:le,children:xp(ee)?fp||(fp=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):ee}),(0,s.jsx)(yp,{"aria-invalid":f,value:Array.isArray(D)?D.join(","):D,name:b,ref:N,"aria-hidden":!0,onChange:e=>{const t=K.find((t=>t.props.value===e.target.value));void 0!==t&&(j(t.props.value),w&&w(e,t))},tabIndex:-1,disabled:p,className:ue.nativeInput,autoFocus:a,required:C,...R,ownerState:ce}),(0,s.jsx)(gp,{as:m,className:ue.icon,ownerState:ce}),(0,s.jsx)(ip,{id:`menu-${b||""}`,anchorEl:X,open:Q,onClose:e=>{Y(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...v,slotProps:{...v.slotProps,list:{"aria-labelledby":y,role:"listbox","aria-multiselectable":x?"true":void 0,disableListWrap:!0,id:pe,...v.MenuListProps},paper:{...he,style:{minWidth:se,...null!=he?he.style:null}}},children:ae})]})})),_p=Bi((0,s.jsx)("path",{d:"M7 10l5 5 5-5z"})),wp={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>mi(e)&&"variant"!==e,slot:"Root"},kp=gi(eh,wp)(""),Tp=gi(gh,wp)(""),Sp=gi(oh,wp)(""),Ap=e.forwardRef((function(t,r){const n=yi({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:a,classes:o={},className:l,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:h=_p,id:p,input:d,inputProps:f,label:m,labelId:g,MenuProps:y,multiple:v=!1,native:x=!1,onClose:b,onOpen:_,open:w,renderValue:k,SelectDisplayProps:T,variant:S="outlined",...A}=n,M=x?hp:bp,E=Ru({props:n,muiFormControl:ju(),states:["variant","error"]}),C=E.variant||S,P={...n,variant:C,classes:o},L=(e=>{const{classes:t}=e,r=Wn({root:["root"]},pp,t);return{...t,...r}})(P),{root:I,...z}=L,O=d||{standard:(0,s.jsx)(kp,{ownerState:P}),outlined:(0,s.jsx)(Tp,{label:m,ownerState:P}),filled:(0,s.jsx)(Sp,{ownerState:P})}[C],R=da(r,po(O));return(0,s.jsx)(e.Fragment,{children:e.cloneElement(O,{inputComponent:M,inputProps:{children:a,error:E.error,IconComponent:h,variant:C,type:void 0,multiple:v,...x?{id:p}:{autoWidth:i,defaultOpen:c,displayEmpty:u,labelId:g,MenuProps:y,onClose:b,onOpen:_,open:w,renderValue:k,SelectDisplayProps:{id:p,...T}},...f,classes:f?Qe(z,f.classes):z,...d?d.props.inputProps:{}},...(v&&x||u)&&"outlined"===C?{notched:!0}:{},ref:R,className:Gn(O.props.className,l,L.root),...!d&&{variant:C},...A})})}));Ap.muiName="Select";const Mp=Ap;function Ep(e){return Ai("MuiTextField",e)}Mi("MuiTextField",["root"]);const Cp={standard:eh,filled:oh,outlined:gh},Pp=gi(Eh,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Lp=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTextField"}),{autoComplete:n,autoFocus:i=!1,children:a,className:o,color:l="primary",defaultValue:c,disabled:u=!1,error:h=!1,FormHelperTextProps:p,fullWidth:d=!1,helperText:f,id:m,InputLabelProps:g,inputProps:y,InputProps:v,inputRef:x,label:b,maxRows:_,minRows:w,multiline:k=!1,name:T,onBlur:S,onChange:A,onFocus:M,placeholder:E,required:C=!1,rows:P,select:L=!1,SelectProps:I,slots:z={},slotProps:O={},type:R,value:D,variant:j="outlined",...F}=r,B={...r,autoFocus:i,color:l,disabled:u,error:h,fullWidth:d,multiline:k,required:C,select:L,variant:j},N=(e=>{const{classes:t}=e;return Wn({root:["root"]},Ep,t)})(B);const U=Ks(m),V=f&&U?`${U}-helper-text`:void 0,q=b&&U?`${U}-label`:void 0,H=Cp[j],G={slots:z,slotProps:{input:v,inputLabel:g,htmlInput:y,formHelperText:p,select:I,...O}},W={},$=G.slotProps.inputLabel;"outlined"===j&&($&&"undefined"!==typeof $.shrink&&(W.notched=$.shrink),W.label=b),L&&(I&&I.native||(W.id=void 0),W["aria-describedby"]=void 0);const[Z,X]=Yi("root",{elementType:Pp,shouldForwardComponentProp:!0,externalForwardedProps:{...G,...F},ownerState:B,className:Gn(N.root,o),ref:t,additionalProps:{disabled:u,error:h,fullWidth:d,required:C,color:l,variant:j}}),[Y,K]=Yi("input",{elementType:H,externalForwardedProps:G,additionalProps:W,ownerState:B}),[J,Q]=Yi("inputLabel",{elementType:Th,externalForwardedProps:G,ownerState:B}),[ee,te]=Yi("htmlInput",{elementType:"input",externalForwardedProps:G,ownerState:B}),[re,ne]=Yi("formHelperText",{elementType:zh,externalForwardedProps:G,ownerState:B}),[ie,ae]=Yi("select",{elementType:Mp,externalForwardedProps:G,ownerState:B}),oe=(0,s.jsx)(Y,{"aria-describedby":V,autoComplete:n,autoFocus:i,defaultValue:c,fullWidth:d,multiline:k,name:T,rows:P,maxRows:_,minRows:w,type:R,value:D,id:U,inputRef:x,onBlur:S,onChange:A,onFocus:M,placeholder:E,inputProps:te,slots:{input:z.htmlInput?ee:void 0},...K});return(0,s.jsxs)(Z,{...X,children:[null!=b&&""!==b&&(0,s.jsx)(J,{htmlFor:U,id:q,...Q,children:b}),L?(0,s.jsx)(ie,{"aria-describedby":V,id:U,labelId:q,value:D,input:oe,...ae,children:a}):oe,f&&(0,s.jsx)(re,{id:V,...ne,children:f})]})}));function Ip(e){return Ai("MuiTypography",e)}Mi("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const zp={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Op=fc,Rp=gi("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${Oi(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(wi((e=>{let{theme:t}=e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter((e=>{let[t,r]=e;return"inherit"!==t&&r&&"object"===typeof r})).map((e=>{let[t,r]=e;return{props:{variant:t},style:r}})),...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette?.text||{}).filter((e=>{let[,t]=e;return"string"===typeof t})).map((e=>{let[r]=e;return{props:{color:`text${Oi(r)}`},style:{color:(t.vars||t).palette.text[r]}}})),{props:e=>{let{ownerState:t}=e;return"inherit"!==t.align},style:{textAlign:"var(--Typography-textAlign)"}},{props:e=>{let{ownerState:t}=e;return t.noWrap},style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:e=>{let{ownerState:t}=e;return t.gutterBottom},style:{marginBottom:"0.35em"}},{props:e=>{let{ownerState:t}=e;return t.paragraph},style:{marginBottom:16}}]}}))),Dp={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},jp=e.forwardRef((function(e,t){const{color:r,...n}=yi({props:e,name:"MuiTypography"}),i=Op({...n,...!zp[r]&&{color:r}}),{align:a="inherit",className:o,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:h=!1,variant:p="body1",variantMapping:d=Dp,...f}=i,m={...i,align:a,color:r,className:o,component:l,gutterBottom:c,noWrap:u,paragraph:h,variant:p,variantMapping:d},g=l||(h?"p":d[p]||Dp[p])||"span",y=(e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:i,variant:a,classes:o}=e;return Wn({root:["root",a,"inherit"!==e.align&&`align${Oi(t)}`,r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]},Ip,o)})(m);return(0,s.jsx)(Rp,{as:g,ref:t,className:Gn(y.root,o),...f,ownerState:m,style:{..."inherit"!==a&&{"--Typography-textAlign":a},...f.style}})})),Fp=Bi((0,s.jsx)("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}));var Bp=r(408),Np=r.n(Bp);function Up(e){return Ai("MuiCollapse",e)}Mi("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Vp=gi("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation],"entered"===r.state&&t.entered,"exited"===r.state&&!r.in&&"0px"===r.collapsedSize&&t.hidden]}})(wi((e=>{let{theme:t}=e;return{height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:e=>{let{ownerState:t}=e;return"exited"===t.state&&!t.in&&"0px"===t.collapsedSize},style:{visibility:"hidden"}}]}}))),qp=gi("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Hp=gi("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Gp=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiCollapse"}),{addEndListener:i,children:a,className:o,collapsedSize:l="0px",component:c,easing:u,in:h,onEnter:p,onEntered:d,onEntering:f,onExit:m,onExited:g,onExiting:y,orientation:v="vertical",style:x,timeout:b=cn.standard,TransitionComponent:_=ko,...w}=n,k={...n,orientation:v,collapsedSize:l},T=(e=>{const{orientation:t,classes:r}=e;return Wn({root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]},Up,r)})(k),S=bi(),A=La(),M=e.useRef(null),E=e.useRef(),C="number"===typeof l?`${l}px`:l,P="horizontal"===v,L=P?"width":"height",I=e.useRef(null),z=da(r,I),O=e=>t=>{if(e){const r=I.current;void 0===t?e(r):e(r,t)}},R=()=>M.current?M.current[P?"clientWidth":"clientHeight"]:0,D=O(((e,t)=>{M.current&&P&&(M.current.style.position="absolute"),e.style[L]=C,p&&p(e,t)})),j=O(((e,t)=>{const r=R();M.current&&P&&(M.current.style.position="");const{duration:n,easing:i}=So({style:x,timeout:b,easing:u},{mode:"enter"});if("auto"===b){const t=S.transitions.getAutoHeightDuration(r);e.style.transitionDuration=`${t}ms`,E.current=t}else e.style.transitionDuration="string"===typeof n?n:`${n}ms`;e.style[L]=`${r}px`,e.style.transitionTimingFunction=i,f&&f(e,t)})),F=O(((e,t)=>{e.style[L]="auto",d&&d(e,t)})),B=O((e=>{e.style[L]=`${R()}px`,m&&m(e)})),N=O(g),U=O((e=>{const t=R(),{duration:r,easing:n}=So({style:x,timeout:b,easing:u},{mode:"exit"});if("auto"===b){const r=S.transitions.getAutoHeightDuration(t);e.style.transitionDuration=`${r}ms`,E.current=r}else e.style.transitionDuration="string"===typeof r?r:`${r}ms`;e.style[L]=C,e.style.transitionTimingFunction=n,y&&y(e)}));return(0,s.jsx)(_,{in:h,onEnter:D,onEntered:F,onEntering:j,onExit:B,onExited:N,onExiting:U,addEndListener:e=>{"auto"===b&&A.start(E.current||0,e),i&&i(I.current,e)},nodeRef:I,timeout:"auto"===b?null:b,...w,children:(e,t)=>{let{ownerState:r,...n}=t;return(0,s.jsx)(Vp,{as:c,className:Gn(T.root,o,{entered:T.entered,exited:!h&&"0px"===C&&T.hidden}[e]),style:{[P?"minWidth":"minHeight"]:C,...x},ref:z,ownerState:{...k,state:e},...n,children:(0,s.jsx)(qp,{ownerState:{...k,state:e},className:T.wrapper,ref:M,children:(0,s.jsx)(Hp,{ownerState:{...k,state:e},className:T.wrapperInner,children:a})})})}})}));Gp&&(Gp.muiSupportAuto=!0);const Wp=Gp;const $p=e.createContext({});function Zp(e){return Ai("MuiAccordion",e)}const Xp=Mi("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Yp=gi(Pi,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Xp.region}`]:t.region},t.root,!r.square&&t.rounded,!r.disableGutters&&t.gutters]}})(wi((e=>{let{theme:t}=e;const r={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],r),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],r)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Xp.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Xp.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}})),wi((e=>{let{theme:t}=e;return{variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${Xp.expanded}`]:{margin:"16px 0"}}}]}}))),Kp=gi("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),Jp=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiAccordion"}),{children:i,className:a,defaultExpanded:o=!1,disabled:l=!1,disableGutters:c=!1,expanded:u,onChange:h,square:p=!1,slots:d={},slotProps:f={},TransitionComponent:m,TransitionProps:g,...y}=n,[v,x]=el({controlled:u,default:o,name:"Accordion",state:"expanded"}),b=e.useCallback((e=>{x(!v),h&&h(e,!v)}),[v,h,x]),[_,...w]=e.Children.toArray(i),k=e.useMemo((()=>({expanded:v,disabled:l,disableGutters:c,toggle:b})),[v,l,c,b]),T={...n,square:p,disabled:l,disableGutters:c,expanded:v},S=(e=>{const{classes:t,square:r,expanded:n,disabled:i,disableGutters:a}=e;return Wn({root:["root",!r&&"rounded",n&&"expanded",i&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},Zp,t)})(T),A={slots:{transition:m,...d},slotProps:{transition:g,...f}},[M,E]=Yi("root",{elementType:Yp,externalForwardedProps:{...A,...y},className:Gn(S.root,a),shouldForwardComponentProp:!0,ownerState:T,ref:r,additionalProps:{square:p}}),[C,P]=Yi("heading",{elementType:Kp,externalForwardedProps:A,className:S.heading,ownerState:T}),[L,I]=Yi("transition",{elementType:Wp,externalForwardedProps:A,ownerState:T});return(0,s.jsxs)(M,{...E,children:[(0,s.jsx)(C,{...P,children:(0,s.jsx)($p.Provider,{value:k,children:_})}),(0,s.jsx)(L,{in:v,timeout:"auto",...I,children:(0,s.jsx)("div",{"aria-labelledby":_.props.id,id:_.props["aria-controls"],role:"region",className:S.region,children:w})})]})}));function Qp(e){return Ai("MuiAccordionSummary",e)}const ed=Mi("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),td=gi(Ha,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(wi((e=>{let{theme:t}=e;const r={duration:t.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],r),[`&.${ed.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${ed.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${ed.disabled})`]:{cursor:"pointer"},variants:[{props:e=>!e.disableGutters,style:{[`&.${ed.expanded}`]:{minHeight:64}}}]}}))),rd=gi("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(wi((e=>{let{theme:t}=e;return{display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${ed.expanded}`]:{margin:"20px 0"}}}]}}))),nd=gi("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(wi((e=>{let{theme:t}=e;return{display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${ed.expanded}`]:{transform:"rotate(180deg)"}}}))),id=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiAccordionSummary"}),{children:i,className:a,expandIcon:o,focusVisibleClassName:l,onClick:c,slots:u,slotProps:h,...p}=n,{disabled:d=!1,disableGutters:f,expanded:m,toggle:g}=e.useContext($p),y={...n,expanded:m,disabled:d,disableGutters:f},v=(e=>{const{classes:t,expanded:r,disabled:n,disableGutters:i}=e;return Wn({root:["root",r&&"expanded",n&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",r&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",r&&"expanded"]},Qp,t)})(y),x={slots:u,slotProps:h},[b,_]=Yi("root",{ref:r,shouldForwardComponentProp:!0,className:Gn(v.root,a),elementType:td,externalForwardedProps:{...x,...p},ownerState:y,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:d,"aria-expanded":m,focusVisibleClassName:Gn(v.focusVisible,l)},getSlotProps:e=>({...e,onClick:t=>{e.onClick?.(t),(e=>{g&&g(e),c&&c(e)})(t)}})}),[w,k]=Yi("content",{className:v.content,elementType:rd,externalForwardedProps:x,ownerState:y}),[T,S]=Yi("expandIconWrapper",{className:v.expandIconWrapper,elementType:nd,externalForwardedProps:x,ownerState:y});return(0,s.jsxs)(b,{..._,children:[(0,s.jsx)(w,{...k,children:i}),o&&(0,s.jsx)(T,{...S,children:o})]})}));function ad(e){return Ai("MuiAccordionDetails",e)}Mi("MuiAccordionDetails",["root"]);const od=gi("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(wi((e=>{let{theme:t}=e;return{padding:t.spacing(1,2,2)}}))),sd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAccordionDetails"}),{className:n,...i}=r,a=r,o=(e=>{const{classes:t}=e;return Wn({root:["root"]},ad,t)})(a);return(0,s.jsx)(od,{className:Gn(o.root,n),ref:t,ownerState:a,...i})}));const ld=e.createContext();function cd(e){return Ai("MuiTable",e)}Mi("MuiTable",["root","stickyHeader"]);const ud=gi("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.stickyHeader&&t.stickyHeader]}})(wi((e=>{let{theme:t}=e;return{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:e=>{let{ownerState:t}=e;return t.stickyHeader},style:{borderCollapse:"separate"}}]}}))),hd="table",pd=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTable"}),{className:i,component:a=hd,padding:o="normal",size:l="medium",stickyHeader:c=!1,...u}=n,h={...n,component:a,padding:o,size:l,stickyHeader:c},p=(e=>{const{classes:t,stickyHeader:r}=e;return Wn({root:["root",r&&"stickyHeader"]},cd,t)})(h),d=e.useMemo((()=>({padding:o,size:l,stickyHeader:c})),[o,l,c]);return(0,s.jsx)(ld.Provider,{value:d,children:(0,s.jsx)(ud,{as:a,role:a===hd?null:"table",ref:r,className:Gn(p.root,i),ownerState:h,...u})})}));const dd=e.createContext();function fd(e){return Ai("MuiTableBody",e)}Mi("MuiTableBody",["root"]);const md=gi("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),gd={variant:"body"},yd="tbody",vd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableBody"}),{className:n,component:i=yd,...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},fd,t)})(o);return(0,s.jsx)(dd.Provider,{value:gd,children:(0,s.jsx)(md,{className:Gn(l.root,n),as:i,ref:t,role:i===yd?null:"rowgroup",ownerState:o,...a})})}));function xd(e){return Ai("MuiTableCell",e)}const bd=Mi("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),_d=gi("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`size${Oi(r.size)}`],"normal"!==r.padding&&t[`padding${Oi(r.padding)}`],"inherit"!==r.align&&t[`align${Oi(r.align)}`],r.stickyHeader&&t.stickyHeader]}})(wi((e=>{let{theme:t}=e;return{...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid\n ${"light"===t.palette.mode?Er(Tr(t.palette.divider,1),.88):Ar(Tr(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${bd.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:e=>{let{ownerState:t}=e;return t.stickyHeader},style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}}))),wd=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTableCell"}),{align:i="inherit",className:a,component:o,padding:l,scope:c,size:u,sortDirection:h,variant:p,...d}=n,f=e.useContext(ld),m=e.useContext(dd),g=m&&"head"===m.variant;let y;y=o||(g?"th":"td");let v=c;"td"===y?v=void 0:!v&&g&&(v="col");const x=p||m&&m.variant,b={...n,align:i,component:y,padding:l||(f&&f.padding?f.padding:"normal"),size:u||(f&&f.size?f.size:"medium"),sortDirection:h,stickyHeader:"head"===x&&f&&f.stickyHeader,variant:x},_=(e=>{const{classes:t,variant:r,align:n,padding:i,size:a,stickyHeader:o}=e;return Wn({root:["root",r,o&&"stickyHeader","inherit"!==n&&`align${Oi(n)}`,"normal"!==i&&`padding${Oi(i)}`,`size${Oi(a)}`]},xd,t)})(b);let w=null;return h&&(w="asc"===h?"ascending":"descending"),(0,s.jsx)(_d,{as:y,ref:r,className:Gn(_.root,a),"aria-sort":w,scope:v,ownerState:b,...d})}));function kd(e){return Ai("MuiTableContainer",e)}Mi("MuiTableContainer",["root"]);const Td=gi("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),Sd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableContainer"}),{className:n,component:i="div",...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},kd,t)})(o);return(0,s.jsx)(Td,{ref:t,as:i,className:Gn(l.root,n),ownerState:o,...a})}));function Ad(e){return Ai("MuiTableHead",e)}Mi("MuiTableHead",["root"]);const Md=gi("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),Ed={variant:"head"},Cd="thead",Pd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableHead"}),{className:n,component:i=Cd,...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},Ad,t)})(o);return(0,s.jsx)(dd.Provider,{value:Ed,children:(0,s.jsx)(Md,{as:i,className:Gn(l.root,n),ref:t,role:i===Cd?null:"rowgroup",ownerState:o,...a})})}));function Ld(e){return Ai("MuiTableRow",e)}const Id=Mi("MuiTableRow",["root","selected","hover","head","footer"]),zd=gi("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.head&&t.head,r.footer&&t.footer]}})(wi((e=>{let{theme:t}=e;return{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Id.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Id.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tr(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tr(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}}))),Od="tr",Rd=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTableRow"}),{className:i,component:a=Od,hover:o=!1,selected:l=!1,...c}=n,u=e.useContext(dd),h={...n,component:a,hover:o,selected:l,head:u&&"head"===u.variant,footer:u&&"footer"===u.variant},p=(e=>{const{classes:t,selected:r,hover:n,head:i,footer:a}=e;return Wn({root:["root",r&&"selected",n&&"hover",i&&"head",a&&"footer"]},Ld,t)})(h);return(0,s.jsx)(zd,{as:a,ref:r,className:Gn(p.root,i),role:a===Od?null:"row",ownerState:h,...c})}));function Dd(e){return Ai("MuiCardContent",e)}Mi("MuiCardContent",["root"]);const jd=gi("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:16,"&:last-child":{paddingBottom:24}}),Fd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCardContent"}),{className:n,component:i="div",...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},Dd,t)})(o);return(0,s.jsx)(jd,{as:i,className:Gn(l.root,n),ownerState:o,ref:t,...a})}));function Bd(e){return Ai("MuiCardActions",e)}Mi("MuiCardActions",["root","spacing"]);const Nd=gi("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Ud=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCardActions"}),{disableSpacing:n=!1,className:i,...a}=r,o={...r,disableSpacing:n},l=(e=>{const{classes:t,disableSpacing:r}=e;return Wn({root:["root",!r&&"spacing"]},Bd,t)})(o);return(0,s.jsx)(Nd,{className:Gn(l.root,i),ownerState:o,ref:t,...a})})),Vd=Bi((0,s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),qd=gi((e=>{const{expand:t,...r}=e;return(0,s.jsx)(dc,{...r})}))((e=>{let{theme:t}=e;return{marginLeft:"auto",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),variants:[{props:e=>{let{expand:t}=e;return!t},style:{transform:"rotate(0deg)"}},{props:e=>{let{expand:t}=e;return!!t},style:{transform:"rotate(180deg)"}}]}}));var Hd={},Gd=(0,e.createContext)(Hd),Wd=(e,t)=>$n({},e,t),$d=(0,e.createContext)((()=>{}));function Zd(){return(0,e.useContext)($d)}$d.displayName="JVR.DispatchShowTools";var Xd=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(Gd.Provider,{value:t,children:(0,s.jsx)($d.Provider,{value:r,children:n})})};Xd.displayName="JVR.ShowTools";var Yd={},Kd=(0,e.createContext)(Yd),Jd=(e,t)=>$n({},e,t),Qd=()=>(0,e.useContext)(Kd),ef=(0,e.createContext)((()=>{}));ef.displayName="JVR.DispatchExpands";var tf=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(Kd.Provider,{value:t,children:(0,s.jsx)(ef.Provider,{value:r,children:n})})};tf.displayName="JVR.Expands";var rf={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},nf=(0,e.createContext)(rf),af=(e,t)=>$n({},e,t),of=()=>(0,e.useContext)(nf),sf=(0,e.createContext)((()=>{}));function lf(e){var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(nf.Provider,{value:t,children:(0,s.jsx)(sf.Provider,{value:r,children:n})})}sf.displayName="JVR.DispatchTypes",lf.displayName="JVR.Types";var cf=["style"];function uf(e){var{style:t}=e,r=xa(e,cf),n=$n({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},t);return(0,s.jsx)("svg",$n({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:n},r,{children:(0,s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}uf.displayName="JVR.TriangleArrow";var hf={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:(0,s.jsx)(uf,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},pf=(0,e.createContext)(hf),df=(e,t)=>$n({},e,t),ff=()=>(0,e.useContext)(pf),mf=(0,e.createContext)((()=>{}));mf.displayName="JVR.DispatchSymbols";var gf=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(pf.Provider,{value:t,children:(0,s.jsx)(mf.Provider,{value:r,children:n})})};gf.displayName="JVR.Symbols";var yf={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},vf=(0,e.createContext)(yf),xf=(e,t)=>$n({},e,t),bf=()=>(0,e.useContext)(vf),_f=(0,e.createContext)((()=>{}));_f.displayName="JVR.DispatchSection";var wf=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(vf.Provider,{value:t,children:(0,s.jsx)(_f.Provider,{value:r,children:n})})};wf.displayName="JVR.Section";var kf={objectSortKeys:!1,indentWidth:15},Tf=(0,e.createContext)(kf);Tf.displayName="JVR.Context";var Sf=(0,e.createContext)((()=>{}));function Af(e,t){return $n({},e,t)}Sf.displayName="JVR.DispatchContext";var Mf=()=>(0,e.useContext)(Tf),Ef=t=>{var{children:r,initialState:n,initialTypes:i}=t,[a,o]=(0,e.useReducer)(Af,Object.assign({},kf,n)),[l,c]=(0,e.useReducer)(Wd,Hd),[u,h]=(0,e.useReducer)(Jd,Yd),[p,d]=(0,e.useReducer)(af,rf),[f,m]=(0,e.useReducer)(df,hf),[g,y]=(0,e.useReducer)(xf,yf);return(0,e.useEffect)((()=>o($n({},n))),[n]),(0,s.jsx)(Tf.Provider,{value:a,children:(0,s.jsx)(Sf.Provider,{value:o,children:(0,s.jsx)(Xd,{initial:l,dispatch:c,children:(0,s.jsx)(tf,{initial:u,dispatch:h,children:(0,s.jsx)(lf,{initial:$n({},p,i),dispatch:d,children:(0,s.jsx)(gf,{initial:f,dispatch:m,children:(0,s.jsx)(wf,{initial:g,dispatch:y,children:r})})})})})})})};Ef.displayName="JVR.Provider";var Cf=["isNumber","value","parentValue","keyName","keys"],Pf=["as","render"],Lf=["as","render"],If=["as","render"],zf=["as","style","render"],Of=["as","render"],Rf=["as","render"],Df=["as","render"],jf=["as","render"],Ff=e=>{var{Quote:t={}}=ff(),{isNumber:r,value:n,parentValue:i,keyName:a,keys:o}=e,l=xa(e,Cf);if(r)return null;var{as:c,render:u}=t,h=c||"span",p=$n({},l,xa(t,Pf)),d=u&&"function"===typeof u&&u(p,{value:n,parentValue:i,keyName:a,keys:o||(a?[a]:[])});return d||(0,s.jsx)(h,$n({},p))};Ff.displayName="JVR.Quote";var Bf=e=>{var{ValueQuote:t={}}=ff(),r=$n({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e)),{as:n,render:i}=t,a=n||"span",o=$n({},r,xa(t,Lf)),l=i&&"function"===typeof i&&i(o,{});return l||(0,s.jsx)(a,$n({},o))};Bf.displayName="JVR.ValueQuote";var Nf=e=>{var{value:t,parentValue:r,keyName:n,keys:i}=e,{Colon:a={}}=ff(),{as:o,render:l}=a,c=xa(a,If),u=o||"span",h=l&&"function"===typeof l&&l(c,{value:t,parentValue:r,keyName:n,keys:i||(n?[n]:[])});return h||(0,s.jsx)(u,$n({},c))};Nf.displayName="JVR.Colon";var Uf=e=>{var{Arrow:t={}}=ff(),r=Qd(),{expandKey:n,style:i,value:a,parentValue:o,keyName:l,keys:c}=e,u=!!r[n],{as:h,style:p,render:d}=t,f=xa(t,zf),m=h||"span",g=d&&"function"===typeof d,y=$n({},f,{"data-expanded":u,style:$n({},p,i)}),v=g&&d(y,{value:a,parentValue:o,keyName:l,keys:c||(l?[l]:[])});return v||(0,s.jsx)(m,$n({},f,{style:$n({},p,i)}))};Uf.displayName="JVR.Arrow";var Vf=e=>{var{isBrackets:t,value:r,parentValue:n,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:l={}}=ff(),c={value:r,parentValue:n,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:u,render:h}=o,p=xa(o,Of),d=u||"span",f=h&&"function"===typeof h&&h(p,c);return f||(0,s.jsx)(d,$n({},p))}var{as:m,render:g}=l,y=xa(l,Rf),v=m||"span",x=g&&"function"===typeof g&&g(y,c);return x||(0,s.jsx)(v,$n({},y))};Vf.displayName="JVR.BracketsOpen";var qf=e=>{var{isBrackets:t,isVisiable:r,value:n,parentValue:i,keyName:a,keys:o}=e,l={value:n,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!r)return null;var{BracketsRight:c={},BraceRight:u={}}=ff();if(t){var{as:h,render:p}=c,d=xa(c,Df),f=h||"span",m=p&&"function"===typeof p&&p(d,l);return m||(0,s.jsx)(f,$n({},d))}var{as:g,render:y}=u,v=xa(u,jf),x=g||"span",b=y&&"function"===typeof y&&y(v,l);return b||(0,s.jsx)(x,$n({},v))};qf.displayName="JVR.BracketsClose";var Hf=e=>{var t,{value:r,expandKey:n,level:i,keys:a=[]}=e,o=Qd(),l=Array.isArray(r),{collapsed:c,shouldExpandNodeInitially:u}=Mf(),h=r instanceof Set,p="boolean"===typeof c?c:"number"===typeof c&&i>c,d=null!=(t=o[n])?t:p,f=Object.keys(r).length;if(void 0===o[n]&&u&&u(d,{value:r,keys:a,level:i}))return null;if(d||0===f)return null;return(0,s.jsx)("div",{style:{paddingLeft:4},children:(0,s.jsx)(qf,{isBrackets:l||h,isVisiable:!0})})};Hf.displayName="JVR.NestedClose";var Gf=["as","render"],Wf=["as","render"],$f=["as","render"],Zf=["as","render"],Xf=["as","render"],Yf=["as","render"],Kf=["as","render"],Jf=["as","render"],Qf=["as","render"],em=["as","render"],tm=["as","render"],rm=["as","render"],nm=["as","render"],im=e=>{if(void 0===e)return"0n";if("string"===typeof e)try{e=BigInt(e)}catch(hy){return"0n"}return e?e.toString()+"n":"0n"},am=e=>{var{value:t,keyName:r}=e,{Set:n={},displayDataTypes:i}=of();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=n,l=xa(n,Gf),c=o&&"function"===typeof o&&o(l,{type:"type",value:t,keyName:r});if(c)return c;var u=a||"span";return(0,s.jsx)(u,$n({},l))};am.displayName="JVR.SetComp";var om=e=>{var{value:t,keyName:r}=e,{Map:n={},displayDataTypes:i}=of();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=n,l=xa(n,Wf),c=o&&"function"===typeof o&&o(l,{type:"type",value:t,keyName:r});if(c)return c;var u=a||"span";return(0,s.jsx)(u,$n({},l))};om.displayName="JVR.MapComp";var sm={opacity:.75,paddingRight:4},lm=t=>{var{children:r="",keyName:n}=t,{Str:i={},displayDataTypes:a}=of(),{shortenTextAfterLength:o=30,stringEllipsis:l="..."}=Mf(),{as:c,render:u}=i,h=xa(i,$f),p=r,[d,f]=(0,e.useState)(o&&p.length>o);(0,e.useEffect)((()=>f(o&&p.length>o)),[o]);var m=c||"span",g=$n({},sm,i.style||{});o>0&&(h.style=$n({},h.style,{cursor:p.length<=o?"initial":"pointer"}),p.length>o&&(h.onClick=()=>{f(!d)}));var y=d?""+p.slice(0,o)+l:p,v=u&&"function"===typeof u,x=v&&u($n({},h,{style:g}),{type:"type",value:r,keyName:n}),b=d?"w-rjv-value w-rjv-value-short":"w-rjv-value",_=v&&u($n({},h,{children:y,className:b}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(x||(0,s.jsx)(m,$n({},h,{style:g}))),_||(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(Bf,{}),(0,s.jsx)(m,$n({},h,{className:b,children:y})),(0,s.jsx)(Bf,{})]})]})};lm.displayName="JVR.TypeString";var cm=t=>{var{children:r,keyName:n}=t,{True:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Zf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};cm.displayName="JVR.TypeTrue";var um=t=>{var{children:r,keyName:n}=t,{False:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Xf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};um.displayName="JVR.TypeFalse";var hm=t=>{var{children:r,keyName:n}=t,{Float:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Yf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};hm.displayName="JVR.TypeFloat";var pm=t=>{var{children:r,keyName:n}=t,{Int:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Kf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};pm.displayName="JVR.TypeInt";var dm=t=>{var{children:r,keyName:n}=t,{Bigint:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Jf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:im(null==r?void 0:r.toString())}))]})};dm.displayName="JVR.TypeFloat";var fm=t=>{var{children:r,keyName:n}=t,{Url:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Qf),u=o||"span",h=$n({},sm,i.style),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:null==r?void 0:r.href,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsxs)("a",$n({href:null==r?void 0:r.href,target:"_blank"},c,{className:"w-rjv-value",children:[(0,s.jsx)(Bf,{}),null==r?void 0:r.href,(0,s.jsx)(Bf,{})]}))]})};fm.displayName="JVR.TypeUrl";var mm=t=>{var{children:r,keyName:n}=t,{Date:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,em),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=r instanceof Date?r.toLocaleString():r,m=p&&l($n({},c,{children:f,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),m||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:f}))]})};mm.displayName="JVR.TypeDate";var gm=t=>{var{children:r,keyName:n}=t,{Undefined:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,tm),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f]})};gm.displayName="JVR.TypeUndefined";var ym=t=>{var{children:r,keyName:n}=t,{Null:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,rm),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f]})};ym.displayName="JVR.TypeNull";var vm=t=>{var{children:r,keyName:n}=t,{Nan:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,nm),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:null==r?void 0:r.toString(),className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f]})};vm.displayName="JVR.TypeNan";var xm=e=>{var t,{value:r,keyName:n}=e,i={keyName:n};return r instanceof URL?(0,s.jsx)(fm,$n({},i,{children:r})):"string"===typeof r?(0,s.jsx)(lm,$n({},i,{children:r})):!0===r?(0,s.jsx)(cm,$n({},i,{children:r})):!1===r?(0,s.jsx)(um,$n({},i,{children:r})):null===r?(0,s.jsx)(ym,$n({},i,{children:r})):void 0===r?(0,s.jsx)(gm,$n({},i,{children:r})):r instanceof Date?(0,s.jsx)(mm,$n({},i,{children:r})):"number"===typeof r&&isNaN(r)?(0,s.jsx)(vm,$n({},i,{children:r})):"number"===typeof r&&(t=r,Number(t)===t&&t%1!==0||isNaN(t))?(0,s.jsx)(hm,$n({},i,{children:r})):"bigint"===typeof r?(0,s.jsx)(dm,$n({},i,{children:r})):"number"===typeof r?(0,s.jsx)(pm,$n({},i,{children:r})):null};function bm(t,r,n){var i=(0,e.useContext)(mf),a=[t.className,r.className].filter(Boolean).join(" "),o=$n({},t,r,{className:a,style:$n({},t.style,r.style),children:r.children||t.children});(0,e.useEffect)((()=>i({[n]:o})),[r])}function _m(t,r,n){var i=(0,e.useContext)(sf),a=[t.className,r.className].filter(Boolean).join(" "),o=$n({},t,r,{className:a,style:$n({},t.style,r.style),children:r.children||t.children});(0,e.useEffect)((()=>i({[n]:o})),[r])}function wm(t,r,n){var i=(0,e.useContext)(_f),a=[t.className,r.className].filter(Boolean).join(" "),o=$n({},t,r,{className:a,style:$n({},t.style,r.style),children:r.children||t.children});(0,e.useEffect)((()=>i({[n]:o})),[r])}xm.displayName="JVR.Value";var km=["as","render"],Tm=e=>{var{KeyName:t={}}=bf();return wm(t,e,"KeyName"),null};Tm.displayName="JVR.KeyName";var Sm=e=>{var{children:t,value:r,parentValue:n,keyName:i,keys:a}=e,o={color:"number"===typeof t?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},{KeyName:l={}}=bf(),{as:c,render:u}=l,h=xa(l,km);h.style=$n({},h.style,o);var p=c||"span",d=u&&"function"===typeof u&&u($n({},h,{children:t}),{value:r,parentValue:n,keyName:i,keys:a||(i?[i]:[])});return d||(0,s.jsx)(p,$n({},h,{children:t}))};Sm.displayName="JVR.KeyNameComp";var Am=["children","value","parentValue","keyName","keys"],Mm=["as","render","children"],Em=e=>{var{Row:t={}}=bf();return wm(t,e,"Row"),null};Em.displayName="JVR.Row";var Cm=e=>{var{children:t,value:r,parentValue:n,keyName:i,keys:a}=e,o=xa(e,Am),{Row:l={}}=bf(),{as:c,render:u}=l,h=xa(l,Mm),p=c||"div",d=u&&"function"===typeof u&&u($n({},o,h,{children:t}),{value:r,keyName:i,parentValue:n,keys:a});return d||(0,s.jsx)(p,$n({},o,h,{children:t}))};function Pm(t){var{value:r,highlightUpdates:n,highlightContainer:i}=t,a=function(t){var r=(0,e.useRef)();return(0,e.useEffect)((()=>{r.current=t})),r.current}(r),o=(0,e.useMemo)((()=>!(!n||void 0===a)&&(typeof r!==typeof a||("number"===typeof r?(!isNaN(r)||!isNaN(a))&&r!==a:Array.isArray(r)!==Array.isArray(a)||"object"!==typeof r&&"function"!==typeof r&&(r!==a||void 0)))),[n,r]);(0,e.useEffect)((()=>{i&&i.current&&o&&"animate"in i.current&&i.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})}),[o,r,i])}Cm.displayName="JVR.RowComp";var Lm=["keyName","value","parentValue","expandKey","keys"],Im=["as","render"],zm=t=>{var{keyName:r,value:n,parentValue:i,expandKey:a,keys:o}=t,l=xa(t,Lm),{onCopied:c,enableClipboard:u}=Mf(),h=(0,e.useContext)(Gd)[a],[p,d]=(0,e.useState)(!1),{Copied:f={}}=bf();if(!1===u||!h)return null;var m={style:{display:"inline-flex"},fill:p?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:e=>{e.stopPropagation();var t="";t="number"===typeof n&&n===1/0?"Infinity":"number"===typeof n&&isNaN(n)?"NaN":"bigint"===typeof n?im(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,((e,t)=>"bigint"===typeof t?im(t):t),2),c&&c(t,n),d(!0),(navigator.clipboard||{writeText:e=>new Promise(((t,r)=>{var n=document.createElement("textarea");n.style.position="absolute",n.style.opacity="0",n.style.left="-99999999px",n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy")?t():r(),n.remove()}))}).writeText(t).then((()=>{var e=setTimeout((()=>{d(!1),clearTimeout(e)}),3e3)})).catch((e=>{}))}},{render:g}=f,y=xa(f,Im),v=$n({},y,l,m,{style:$n({},y.style,l.style,m.style)}),x=g&&"function"===typeof g&&g($n({},v,{"data-copied":p}),{value:n,keyName:r,keys:o,parentValue:i});return x||(p?(0,s.jsx)("svg",$n({viewBox:"0 0 32 36"},v,{children:(0,s.jsx)("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})):(0,s.jsx)("svg",$n({viewBox:"0 0 32 36"},v,{children:(0,s.jsx)("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})))};function Om(){var t=(0,e.useRef)(null);return null===t.current&&(t.current="custom-id-"+Math.random().toString(36).substr(2,9)),t.current}zm.displayName="JVR.Copied";var Rm=e=>{var t,{value:r,expandKey:n="",level:i,keys:a=[]}=e,o=Qd(),{objectSortKeys:l,indentWidth:c,collapsed:u,shouldExpandNodeInitially:h}=Mf(),p=Array.isArray(r),d="boolean"===typeof u?u:"number"===typeof u&&i>u,f=null!=(t=o[n])?t:d;if(void 0===o[n]&&h&&h(f,{value:r,keys:a,level:i}))return null;if(f)return null;var m=p?Object.entries(r).map((e=>[Number(e[0]),e[1]])):Object.entries(r);l&&(m=!0===l?m.sort(((e,t)=>{var[r]=e,[n]=t;return"string"===typeof r&&"string"===typeof n?r.localeCompare(n):0})):m.sort(((e,t)=>{var[r,n]=e,[i,a]=t;return"string"===typeof r&&"string"===typeof i?l(r,i,n,a):0})));var g={borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:c,marginLeft:6};return(0,s.jsx)("div",{className:"w-rjv-wrap",style:g,children:m.map(((e,t)=>{var[n,o]=e;return(0,s.jsx)(jm,{parentValue:r,keyName:n,keys:[...a,n],value:o,level:i},t)}))})};Rm.displayName="JVR.KeyValues";var Dm=t=>{var{keyName:r,parentValue:n,keys:i,value:a}=t,{highlightUpdates:o}=Mf(),l="number"===typeof r,c=(0,e.useRef)(null);Pm({value:a,highlightUpdates:o,highlightContainer:c});var u={keyName:r,value:a,keys:i,parentValue:n};return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsxs)("span",{ref:c,children:[(0,s.jsx)(Ff,$n({isNumber:l,"data-placement":"left"},u)),(0,s.jsx)(Sm,$n({},u,{children:r})),(0,s.jsx)(Ff,$n({isNumber:l,"data-placement":"right"},u))]}),(0,s.jsx)(Nf,$n({},u))]})};Dm.displayName="JVR.KayName";var jm=e=>{var{keyName:t,value:r,parentValue:n,level:i=0,keys:a=[]}=e,o=Zd(),l=Om(),c=Array.isArray(r),u=r instanceof Set,h=r instanceof Map,p=r instanceof Date,d=r instanceof URL;if(r&&"object"===typeof r&&!c&&!u&&!h&&!p&&!d||c||u||h){var f=u?Array.from(r):h?Object.fromEntries(r):r;return(0,s.jsx)(Km,{keyName:t,value:f,parentValue:n,initialValue:r,keys:a,level:i+1})}var m={onMouseEnter:()=>o({[l]:!0}),onMouseLeave:()=>o({[l]:!1})};return(0,s.jsxs)(Cm,$n({className:"w-rjv-line",value:r,keyName:t,keys:a,parentValue:n},m,{children:[(0,s.jsx)(Dm,{keyName:t,value:r,keys:a,parentValue:n}),(0,s.jsx)(xm,{keyName:t,value:r}),(0,s.jsx)(zm,{keyName:t,value:r,keys:a,parentValue:n,expandKey:l})]}))};jm.displayName="JVR.KeyValuesItem";var Fm=["value","keyName"],Bm=["as","render"],Nm=e=>{var{CountInfoExtra:t={}}=bf();return wm(t,e,"CountInfoExtra"),null};Nm.displayName="JVR.CountInfoExtra";var Um=e=>{var{value:t={},keyName:r}=e,n=xa(e,Fm),{CountInfoExtra:i={}}=bf(),{as:a,render:o}=i,l=xa(i,Bm);if(!o&&!l.children)return null;var c=a||"span",u=o&&"function"===typeof o,h=$n({},l,n),p=u&&o(h,{value:t,keyName:r});return p||(0,s.jsx)(c,$n({},h))};Um.displayName="JVR.CountInfoExtraComps";var Vm=["value","keyName"],qm=["as","render"],Hm=e=>{var{CountInfo:t={}}=bf();return wm(t,e,"CountInfo"),null};Hm.displayName="JVR.CountInfo";var Gm=e=>{var{value:t={},keyName:r}=e,n=xa(e,Vm),{displayObjectSize:i}=Mf(),{CountInfo:a={}}=bf();if(!i)return null;var{as:o,render:l}=a,c=xa(a,qm),u=o||"span";c.style=$n({},c.style,e.style);var h=Object.keys(t).length;c.children||(c.children=h+" item"+(1===h?"":"s"));var p=$n({},c,n),d=l&&"function"===typeof l&&l($n({},p,{"data-length":h}),{value:t,keyName:r});return d||(0,s.jsx)(u,$n({},p))};Gm.displayName="JVR.CountInfoComp";var Wm=["as","render"],$m=e=>{var{Ellipsis:t={}}=bf();return wm(t,e,"Ellipsis"),null};$m.displayName="JVR.Ellipsis";var Zm=e=>{var{isExpanded:t,value:r,keyName:n}=e,{Ellipsis:i={}}=bf(),{as:a,render:o}=i,l=xa(i,Wm),c=a||"span",u=o&&"function"===typeof o&&o($n({},l,{"data-expanded":t}),{value:r,keyName:n});return u||(!t||"object"===typeof r&&0==Object.keys(r).length?null:(0,s.jsx)(c,$n({},l)))};Zm.displayName="JVR.EllipsisComp";var Xm=t=>{var r,{keyName:n,expandKey:i,keys:a=[],initialValue:o,value:l,parentValue:c,level:u}=t,h=Qd(),p=(0,e.useContext)(ef),{onExpand:d,collapsed:f,shouldExpandNodeInitially:m}=Mf(),g=Array.isArray(l),y=l instanceof Set,v="boolean"===typeof f?f:"number"===typeof f&&u>f,x="object"===typeof l,b=null!=(r=h[i])?r:v,_=m&&m(b,{value:l,keys:a,level:u});void 0===h[i]&&void 0!==_&&(b=_);var w={transform:"rotate("+(b?"-90":"0")+"deg)",transition:"all 0.3s"},k=0!==Object.keys(l).length&&(g||y||x),T={style:{display:"inline-flex",alignItems:"center"}};k&&(T.onClick=()=>{var e={expand:!b,value:l,keyid:i,keyName:n};d&&d(e),p({[i]:e.expand})});var S={keyName:n,value:l,keys:a,parentValue:c};return(0,s.jsxs)("span",$n({},T,{children:[k&&(0,s.jsx)(Uf,$n({style:w,expandKey:i},S)),(n||"number"===typeof n)&&(0,s.jsx)(Dm,$n({},S)),(0,s.jsx)(am,{value:o,keyName:n}),(0,s.jsx)(om,{value:o,keyName:n}),(0,s.jsx)(Vf,$n({isBrackets:g||y},S)),(0,s.jsx)(Zm,{keyName:n,value:l,isExpanded:b}),(0,s.jsx)(qf,$n({isVisiable:b||!k,isBrackets:g||y},S)),(0,s.jsx)(Gm,{value:l,keyName:n}),(0,s.jsx)(Um,{value:l,keyName:n}),(0,s.jsx)(zm,{keyName:n,value:l,expandKey:i,parentValue:c,keys:a})]}))};Xm.displayName="JVR.NestedOpen";var Ym=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],Km=(0,e.forwardRef)(((e,t)=>{var{className:r="",parentValue:n,level:i=1,value:a,initialValue:o,keys:l,keyName:c}=e,u=xa(e,Ym),h=Zd(),p=Om(),d=[r,"w-rjv-inner"].filter(Boolean).join(" "),f={onMouseEnter:()=>h({[p]:!0}),onMouseLeave:()=>h({[p]:!1})};return(0,s.jsxs)("div",$n({className:d,ref:t},u,f,{children:[(0,s.jsx)(Xm,{expandKey:p,value:a,level:i,keys:l,parentValue:n,keyName:c,initialValue:o}),(0,s.jsx)(Rm,{expandKey:p,value:a,level:i,keys:l,parentValue:n,keyName:c}),(0,s.jsx)(Hf,{expandKey:p,value:a,level:i,keys:l})]}))}));Km.displayName="JVR.Container";var Jm=e=>{var{BraceLeft:t={}}=ff();return bm(t,e,"BraceLeft"),null};Jm.displayName="JVR.BraceLeft";var Qm=e=>{var{BraceRight:t={}}=ff();return bm(t,e,"BraceRight"),null};Qm.displayName="JVR.BraceRight";var eg=e=>{var{BracketsLeft:t={}}=ff();return bm(t,e,"BracketsLeft"),null};eg.displayName="JVR.BracketsLeft";var tg=e=>{var{BracketsRight:t={}}=ff();return bm(t,e,"BracketsRight"),null};tg.displayName="JVR.BracketsRight";var rg=e=>{var{Arrow:t={}}=ff();return bm(t,e,"Arrow"),null};rg.displayName="JVR.Arrow";var ng=e=>{var{Colon:t={}}=ff();return bm(t,e,"Colon"),null};ng.displayName="JVR.Colon";var ig=e=>{var{Quote:t={}}=ff();return bm(t,e,"Quote"),null};ig.displayName="JVR.Quote";var ag=e=>{var{ValueQuote:t={}}=ff();return bm(t,e,"ValueQuote"),null};ag.displayName="JVR.ValueQuote";var og=e=>{var{Bigint:t={}}=of();return _m(t,e,"Bigint"),null};og.displayName="JVR.Bigint";var sg=e=>{var{Date:t={}}=of();return _m(t,e,"Date"),null};sg.displayName="JVR.Date";var lg=e=>{var{False:t={}}=of();return _m(t,e,"False"),null};lg.displayName="JVR.False";var cg=e=>{var{Float:t={}}=of();return _m(t,e,"Float"),null};cg.displayName="JVR.Float";var ug=e=>{var{Int:t={}}=of();return _m(t,e,"Int"),null};ug.displayName="JVR.Int";var hg=e=>{var{Map:t={}}=of();return _m(t,e,"Map"),null};hg.displayName="JVR.Map";var pg=e=>{var{Nan:t={}}=of();return _m(t,e,"Nan"),null};pg.displayName="JVR.Nan";var dg=e=>{var{Null:t={}}=of();return _m(t,e,"Null"),null};dg.displayName="JVR.Null";var fg=e=>{var{Set:t={}}=of();return _m(t,e,"Set"),null};fg.displayName="JVR.Set";var mg=e=>{var{Str:t={}}=of();return _m(t,e,"Str"),null};mg.displayName="JVR.StringText";var gg=e=>{var{True:t={}}=of();return _m(t,e,"True"),null};gg.displayName="JVR.True";var yg=e=>{var{Undefined:t={}}=of();return _m(t,e,"Undefined"),null};yg.displayName="JVR.Undefined";var vg=e=>{var{Url:t={}}=of();return _m(t,e,"Url"),null};vg.displayName="JVR.Url";var xg=e=>{var{Copied:t={}}=bf();return wm(t,e,"Copied"),null};xg.displayName="JVR.Copied";var bg=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied"],_g=(0,e.forwardRef)(((e,t)=>{var{className:r="",style:n,value:i,children:a,collapsed:o,shouldExpandNodeInitially:l,indentWidth:c=15,displayObjectSize:u=!0,shortenTextAfterLength:h=30,stringEllipsis:p,highlightUpdates:d=!0,enableClipboard:f=!0,displayDataTypes:m=!0,objectSortKeys:g=!1,onExpand:y,onCopied:v}=e,x=xa(e,bg),b=$n({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},n),_=["w-json-view-container","w-rjv",r].filter(Boolean).join(" ");return(0,s.jsxs)(Ef,{initialState:{value:i,objectSortKeys:g,indentWidth:c,shouldExpandNodeInitially:l,displayObjectSize:u,collapsed:o,enableClipboard:f,shortenTextAfterLength:h,stringEllipsis:p,highlightUpdates:d,onCopied:v,onExpand:y},initialTypes:{displayDataTypes:m},children:[(0,s.jsx)(Km,$n({value:i},x,{ref:t,className:_,style:b})),a]})}));_g.Bigint=og,_g.Date=sg,_g.False=lg,_g.Float=cg,_g.Int=ug,_g.Map=hg,_g.Nan=pg,_g.Null=dg,_g.Set=fg,_g.String=mg,_g.True=gg,_g.Undefined=yg,_g.Url=vg,_g.ValueQuote=ag,_g.Arrow=rg,_g.Colon=ng,_g.Quote=ig,_g.Ellipsis=$m,_g.BraceLeft=Jm,_g.BraceRight=Qm,_g.BracketsLeft=eg,_g.BracketsRight=tg,_g.Copied=xg,_g.CountInfo=Hm,_g.CountInfoExtra=Nm,_g.KeyName=Tm,_g.Row=Em,_g.displayName="JVR.JsonView";const wg=_g,kg=Bi((0,s.jsx)("path",{d:"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"})),Tg=Bi((0,s.jsx)("path",{d:"M15 9H9v6h6zm-2 4h-2v-2h2zm8-2V9h-2V7c0-1.1-.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 .9-2 2v2H3v2h2v2H3v2h2v2c0 1.1.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-.9 2-2v-2h2v-2h-2v-2zm-4 6H7V7h10z"})),Sg=Bi([(0,s.jsx)("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),(0,s.jsx)("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")]),Ag=Bi((0,s.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),Mg=Bi((0,s.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function Eg(e){const{role:t,isFullWidth:r,children:n,sx:i,className:a,title:o}=e,l=bi(),c="16px",u={padding:l.spacing(1,2),fontSize:"0.875rem",alignSelf:"flex-start",maxWidth:"100%",minWidth:"80%","& > *":{color:"inherit",overflow:"hidden",m:0},"& > :last-child":{mb:0,m:0,p:0}},h={user:{...u,backgroundColor:l.palette.background.default,border:`1px solid ${l.palette.custom.highlight}`,borderRadius:`${c} ${c} 0 ${c}`,alignSelf:"flex-end",color:l.palette.primary.main},assistant:{...u,backgroundColor:l.palette.primary.main,border:`1px solid ${l.palette.secondary.main}`,borderRadius:`${c} ${c} ${c} 0`,color:l.palette.primary.contrastText},system:{...u,backgroundColor:"#EDEAE0",border:`1px dashed ${l.palette.custom.highlight}`,borderRadius:c,maxWidth:r?"100%":"90%",alignSelf:"center",color:l.palette.text.primary,fontStyle:"italic"},info:{...u,backgroundColor:"#BFD8D8",border:`1px solid ${l.palette.secondary.main}`,borderRadius:c,color:l.palette.text.primary,opacity:.95},status:{...u,backgroundColor:"rgba(74, 122, 125, 0.15)",border:`1px solid ${l.palette.secondary.light}`,borderRadius:"4px",maxWidth:r?"100%":"75%",alignSelf:"center",color:l.palette.secondary.dark,fontWeight:500,fontSize:"0.95rem",padding:"8px 12px",opacity:.9,transition:"opacity 0.3s ease-in-out"},error:{...u,backgroundColor:"#F8E7E7",border:"1px solid #D83A3A",borderRadius:c,maxWidth:r?"100%":"90%",alignSelf:"center",color:"#8B2525",padding:"10px 16px",boxShadow:"0 1px 3px rgba(216, 58, 58, 0.15)"},content:{...u,backgroundColor:"#F5F2EA",border:`1px solid ${l.palette.custom.highlight}`,borderRadius:0,maxWidth:"100%",alignSelf:"center",color:l.palette.text.primary,padding:"8px 8px",marginBottom:"0px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)",fontSize:"0.9rem",lineHeight:"1.3",fontFamily:l.typography.fontFamily},thinking:{...u},streaming:{...u},processing:{...u}};h.thinking=h.status,h.streaming=h.assistant,h.processing=h.status;const p={searching:(0,s.jsx)(Tg,{}),thinking:(0,s.jsx)(Sg,{}),tooling:(0,s.jsx)(kg,{}),processing:(0,s.jsx)(kg,{}),error:(0,s.jsx)(Ag,{color:"error"}),info:(0,s.jsx)(Mg,{color:"info"})};return"content"===t&&o?(0,s.jsxs)(Jp,{defaultExpanded:!0,className:a,sx:{...h[t],...i},children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),slotProps:{content:{sx:{fontWeight:"bold",fontSize:"1.1rem",m:0,p:0,display:"flex",justifyItems:"center"}}},children:o}),(0,s.jsx)(sd,{sx:{mt:0,mb:0,p:0,pl:2,pr:2},children:n})]}):(0,s.jsxs)(yc,{className:a,sx:{...void 0!==h[t]?h[t]:h.status,gap:1,display:"flex",...i,flexDirection:"row"},children:[void 0!==p[t]&&p[t],(0,s.jsx)(yc,{sx:{p:0,m:0,gap:0,display:"flex",flexGrow:1,flexDirection:"column"},children:n})]})}function Cg(){return Cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t(e[t.toLowerCase()]=t,e)),{class:"className",for:"htmlFor"}),dy={amp:"&",apos:"'",gt:">",lt:"<",nbsp:"\xa0",quot:"\u201c"},fy=["style","script"],my=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,gy=/mailto:/i,yy=/\n{2,}$/,vy=/^(\s*>[\s\S]*?)(?=\n\n|$)/,xy=/^ *> ?/gm,by=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,_y=/^ {2,}\n/,wy=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,ky=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,Ty=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Sy=/^(`+)((?:\\`|[^`])+)\1/,Ay=/^(?:\n *)*\n/,My=/\r\n?/g,Ey=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Cy=/^\[\^([^\]]+)]/,Py=/\f/g,Ly=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Iy=/^\s*?\[(x|\s)\]/,zy=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Oy=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Ry=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,Dy=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,jy=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,Fy=/^)/,By=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,Ny=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Uy=/^\{.*\}$/,Vy=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,qy=/^<([^ >]+@[^ >]+)>/,Hy=/^<([^ >]+:\/[^ >]+)>/,Gy=/-([a-z])?/gi,Wy=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,$y=/^\[([^\]]*)\]:\s+]+)>?\s*("([^"]*)")?/,Zy=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Xy=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Yy=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Ky=/\t/g,Jy=/(^ *\||\| *$)/g,Qy=/^ *:-+: *$/,ev=/^ *:-+ *$/,tv=/^ *-+: *$/,rv="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",nv=new RegExp(`^([*_])\\1${rv}\\1\\1(?!\\1)`),iv=new RegExp(`^([*_])${rv}\\1(?!\\1)`),av=new RegExp(`^(==)${rv}\\1`),ov=new RegExp(`^(~~)${rv}\\1`),sv=/^\\([^0-9A-Za-z\s])/,lv=/\\([^0-9A-Za-z\s])/g,cv=/^([\s\S](?:(?! |[0-9]\.)[^*_~\-\n<`\\\[!])*)/,uv=/^\n+/,hv=/^([ \t]*)/,pv=/\\([^\\])/g,dv=/(?:^|\n)( *)$/,fv="(?:\\d+\\.)",mv="(?:[*+-])";function gv(e){return"( *)("+(1===e?fv:mv)+") +"}const yv=gv(1),vv=gv(2);function xv(e){return new RegExp("^"+(1===e?yv:vv))}const bv=xv(1),_v=xv(2);function wv(e){return new RegExp("^"+(1===e?yv:vv)+"[^\\n]*(?:\\n(?!\\1"+(1===e?fv:mv)+" )[^\\n]*)*(\\n|$)","gm")}const kv=wv(1),Tv=wv(2);function Sv(e){const t=1===e?fv:mv;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Av=Sv(1),Mv=Sv(2);function Ev(e,t){const r=1===t,n=r?Av:Mv,i=r?kv:Tv,a=r?bv:_v;return{match:Bv((function(e,t){const r=dv.exec(t.prevCapture);return r&&(t.list||!t.inline&&!t.simple)?n.exec(e=r[1]+e):null})),order:1,parse(e,t,n){const o=r?+e[2]:void 0,s=e[0].replace(yy,"\n").match(i);let l=!1;return{items:s.map((function(e,r){const i=a.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),c=e.replace(o,"").replace(a,""),u=r===s.length-1,h=-1!==c.indexOf("\n\n")||u&&l;l=h;const p=n.inline,d=n.list;let f;n.list=!0,h?(n.inline=!1,f=zv(c)+"\n\n"):(n.inline=!0,f=zv(c));const m=t(f,n);return n.inline=p,n.list=d,m})),ordered:r,start:o}},render:(t,r,n)=>e(t.ordered?"ol":"ul",{key:n.key,start:t.type===Kg?t.start:void 0},t.items.map((function(t,i){return e("li",{key:i},r(t,n))})))}}const Cv=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),Pv=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Lv=[vy,ky,Ty,zy,Ry,Oy,Wy,Av,Mv],Iv=[...Lv,/^[^\n]+(?: \n|\n{2,})/,Dy,Fy,Ny];function zv(e){let t=e.length;for(;t>0&&e[t-1]<=" ";)t--;return e.slice(0,t)}function Ov(e){return e.replace(/[\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xc6]/g,"a").replace(/[\xe7\xc7]/g,"c").replace(/[\xf0\xd0]/g,"d").replace(/[\xc8\xc9\xca\xcb\xe9\xe8\xea\xeb]/g,"e").replace(/[\xcf\xef\xce\xee\xcd\xed\xcc\xec]/g,"i").replace(/[\xd1\xf1]/g,"n").replace(/[\xf8\xd8\u0153\u0152\xd5\xf5\xd4\xf4\xd3\xf3\xd2\xf2]/g,"o").replace(/[\xdc\xfc\xdb\xfb\xda\xfa\xd9\xf9]/g,"u").replace(/[\u0178\xff\xdd\xfd]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Rv(e){return tv.test(e)?"right":Qy.test(e)?"center":ev.test(e)?"left":null}function Dv(e,t,r,n){const i=r.inTable;r.inTable=!0;let a=[[]],o="";function s(){if(!o)return;const e=a[a.length-1];e.push.apply(e,t(o,r)),o=""}return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach(((e,t,r)=>{"|"===e.trim()&&(s(),n)?0!==t&&t!==r.length-1&&a.push([]):o+=e})),s(),r.inTable=i,a}function jv(e,t,r){r.inline=!0;const n=e[2]?e[2].replace(Jy,"").split("|").map(Rv):[],i=e[3]?function(e,t,r){return e.trim().split("\n").map((function(e){return Dv(e,t,r,!0)}))}(e[3],t,r):[],a=Dv(e[1],t,r,!!i.length);return r.inline=!1,i.length?{align:n,cells:i,header:a,type:ry}:{children:a,type:Jg}}function Fv(e,t){return null==e.align[t]?{}:{textAlign:e.align[t]}}function Bv(e){return e.inline=1,e}function Nv(e){return Bv((function(t,r){return r.inline?e.exec(t):null}))}function Uv(e){return Bv((function(t,r){return r.inline||r.simple?e.exec(t):null}))}function Vv(e){return function(t,r){return r.inline||r.simple?null:e.exec(t)}}function qv(e){return Bv((function(t){return e.exec(t)}))}function Hv(e,t){if(t.inline||t.simple)return null;let r="";e.split("\n").every((e=>(e+="\n",!Lv.some((t=>t.test(e)))&&(r+=e,!!e.trim()))));const n=zv(r);return""==n?null:[r,,n]}function Gv(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return null}catch(e){return null}return e}function Wv(e){return e.replace(pv,"$1")}function $v(e,t,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!0,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=i,a}function Zv(e,t,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!1,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=i,a}function Xv(e,t,r){const n=r.inline||!1;r.inline=!1;const i=e(t,r);return r.inline=n,i}const Yv=(e,t,r)=>({children:$v(t,e[2],r)});function Kv(){return{}}function Jv(){return null}function Qv(){for(var e=arguments.length,t=new Array(e),r=0;r{let{children:r="",options:n}=t,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(t,Pg);return e.cloneElement(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function n(e,t){const n=ex(r.overrides,`${e}.props`,{});for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o1||r.forceWrapper)o=i;else{if(1===i.length)return o=i[0],"string"==typeof o?n("span",{key:"outer"},o):o;o=null}return r.createElement(a,{key:"outer"},o)}function a(e,t){const n=t.match(my);return n?n.reduce((function(t,n){const a=n.indexOf("=");if(-1!==a){const o=function(e){return-1!==e.indexOf("-")&&null===e.match(By)&&(e=e.replace(Gy,(function(e,t){return t.toUpperCase()}))),e}(n.slice(0,a)).trim(),s=function(e){const t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e}(n.slice(a+1).trim()),l=py[o]||o;if("ref"===l)return t;const c=t[l]=function(e,t,r,n){return"style"===t?r.split(/;\s?/).reduce((function(e,t){const r=t.slice(0,t.indexOf(":"));return e[r.trim().replace(/(-[a-z])/g,(e=>e[1].toUpperCase()))]=t.slice(r.length+1).trim(),e}),{}):"href"===t||"src"===t?n(r,e,t):(r.match(Uy)&&(r=r.slice(1,r.length-1)),"true"===r||"false"!==r&&r)}(e,o,s,r.sanitizer);"string"==typeof c&&(Dy.test(c)||Ny.test(c))&&(t[l]=i(c.trim()))}else"style"!==n&&(t[py[n]||n]=!0);return t}),{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||Gv,r.slugify=r.slugify||Ov,r.namedCodesToUnicode=r.namedCodesToUnicode?Cg({},dy,r.namedCodesToUnicode):dy,r.createElement=r.createElement||e.createElement;const o=[],s={},l={[Lg]:{match:Vv(vy),order:1,parse(e,t,r){const[,n,i]=e[0].replace(xy,"").match(by);return{alert:n,children:t(i,r)}},render(e,t,i){const a={key:i.key};return e.alert&&(a.className="markdown-alert-"+r.slugify(e.alert.toLowerCase(),Ov),e.children.unshift({attrs:{},children:[{type:ny,text:e.alert}],noInnerParse:!0,type:Vg,tag:"header"})),n("blockquote",a,t(e.children,i))}},[Ig]:{match:qv(_y),order:1,parse:Kv,render:(e,t,r)=>n("br",{key:r.key})},[zg]:{match:Vv(wy),order:1,parse:Kv,render:(e,t,r)=>n("hr",{key:r.key})},[Og]:{match:Vv(Ty),order:0,parse:e=>({lang:void 0,text:zv(e[0].replace(/^ {4}/gm,"")).replace(lv,"$1")}),render:(e,t,r)=>n("pre",{key:r.key},n("code",Cg({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},[Rg]:{match:Vv(ky),order:0,parse:e=>({attrs:a("code",e[3]||""),lang:e[2]||void 0,text:e[4].replace(lv,"$1"),type:Og})},[Dg]:{match:Uv(Sy),order:3,parse:e=>({text:e[2].replace(lv,"$1")}),render:(e,t,r)=>n("code",{key:r.key},e.text)},[jg]:{match:Vv(Ey),order:0,parse:e=>(o.push({footnote:e[2],identifier:e[1]}),{}),render:Jv},[Fg]:{match:Nv(Cy),order:1,parse:e=>({target:`#${r.slugify(e[1],Ov)}`,text:e[1]}),render:(e,t,i)=>n("a",{key:i.key,href:r.sanitizer(e.target,"a","href")},n("sup",{key:i.key},e.text))},[Bg]:{match:Nv(Iy),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,t,r)=>n("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})},[Ng]:{match:Vv(r.enforceAtxHeadings?Oy:zy),order:1,parse:(e,t,n)=>({children:$v(t,e[2],n),id:r.slugify(e[2],Ov),level:e[1].length}),render:(e,t,r)=>n(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r))},[Ug]:{match:Vv(Ry),order:0,parse:(e,t,r)=>({children:$v(t,e[1],r),level:"="===e[2]?1:2,type:Ng})},[Vg]:{match:qv(Dy),order:1,parse(e,t,r){const[,n]=e[3].match(hv),i=new RegExp(`^${n}`,"gm"),o=e[3].replace(i,""),s=(l=o,Iv.some((e=>e.test(l)))?Xv:$v);var l;const c=e[1].toLowerCase(),u=-1!==fy.indexOf(c),h=(u?c:e[1]).trim(),p={attrs:a(h,e[2]),noInnerParse:u,tag:h};return r.inAnchor=r.inAnchor||"a"===c,u?p.text=e[3]:p.children=s(t,o,r),r.inAnchor=!1,p},render:(e,t,r)=>n(e.tag,Cg({key:r.key},e.attrs),e.text||(e.children?t(e.children,r):""))},[Hg]:{match:qv(Ny),order:1,parse(e){const t=e[1].trim();return{attrs:a(t,e[2]||""),tag:t}},render:(e,t,r)=>n(e.tag,Cg({},e.attrs,{key:r.key}))},[qg]:{match:qv(Fy),order:1,parse:()=>({}),render:Jv},[Gg]:{match:Uv(Pv),order:1,parse:e=>({alt:e[1],target:Wv(e[2]),title:e[3]}),render:(e,t,i)=>n("img",{key:i.key,alt:e.alt||void 0,title:e.title||void 0,src:r.sanitizer(e.target,"img","src")})},[Wg]:{match:Nv(Cv),order:3,parse:(e,t,r)=>({children:Zv(t,e[1],r),target:Wv(e[2]),title:e[3]}),render:(e,t,i)=>n("a",{key:i.key,href:r.sanitizer(e.target,"a","href"),title:e.title},t(e.children,i))},[$g]:{match:Nv(Hy),order:0,parse:e=>({children:[{text:e[1],type:ny}],target:e[1],type:Wg})},[Zg]:{match:Bv(((e,t)=>t.inAnchor||r.disableAutoLink?null:Nv(Vy)(e,t))),order:0,parse:e=>({children:[{text:e[1],type:ny}],target:e[1],title:void 0,type:Wg})},[Xg]:{match:Nv(qy),order:0,parse(e){let t=e[1],r=e[1];return gy.test(r)||(r="mailto:"+r),{children:[{text:t.replace("mailto:",""),type:ny}],target:r,type:Wg}}},[Kg]:Ev(n,1),[cy]:Ev(n,2),[Yg]:{match:Vv(Ay),order:3,parse:Kv,render:()=>"\n"},[Jg]:{match:Bv(Hv),order:3,parse:Yv,render:(e,t,r)=>n("p",{key:r.key},t(e.children,r))},[Qg]:{match:Nv($y),order:0,parse:e=>(s[e[1]]={target:e[2],title:e[4]},{}),render:Jv},[ey]:{match:Uv(Zy),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,t,i)=>s[e.ref]?n("img",{key:i.key,alt:e.alt,src:r.sanitizer(s[e.ref].target,"img","src"),title:s[e.ref].title}):null},[ty]:{match:Nv(Xy),order:0,parse:(e,t,r)=>({children:t(e[1],r),fallbackChildren:e[0],ref:e[2]}),render:(e,t,i)=>s[e.ref]?n("a",{key:i.key,href:r.sanitizer(s[e.ref].target,"a","href"),title:s[e.ref].title},t(e.children,i)):n("span",{key:i.key},e.fallbackChildren)},[ry]:{match:Vv(Wy),order:1,parse:jv,render(e,t,r){const i=e;return n("table",{key:r.key},n("thead",null,n("tr",null,i.header.map((function(e,a){return n("th",{key:a,style:Fv(i,a)},t(e,r))})))),n("tbody",null,i.cells.map((function(e,a){return n("tr",{key:a},e.map((function(e,a){return n("td",{key:a,style:Fv(i,a)},t(e,r))})))}))))}},[ny]:{match:qv(cv),order:4,parse:e=>({text:e[0].replace(jy,((e,t)=>r.namedCodesToUnicode[t]?r.namedCodesToUnicode[t]:e))}),render:e=>e.text},[iy]:{match:Uv(nv),order:2,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>n("strong",{key:r.key},t(e.children,r))},[ay]:{match:Uv(iv),order:3,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>n("em",{key:r.key},t(e.children,r))},[oy]:{match:Uv(sv),order:1,parse:e=>({text:e[1],type:ny})},[sy]:{match:Uv(av),order:3,parse:Yv,render:(e,t,r)=>n("mark",{key:r.key},t(e.children,r))},[ly]:{match:Uv(ov),order:3,parse:Yv,render:(e,t,r)=>n("del",{key:r.key},t(e.children,r))}};!0===r.disableParsingRawHTML&&(delete l[Vg],delete l[Hg]);const c=function(e){let t=Object.keys(e);function r(n,i){let a,o,s=[],l="",c="";for(i.prevCapture=i.prevCapture||"";n;){let u=0;for(;ua(r,n,i)),r,n,i):a(r,n,i)}}(l,r.renderRule),function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(t)){const n=r.key,i=[];let a=!1;for(let o=0;o{let{theme:t,ownerState:r}=e;const n=r.color,i=lt(t,`palette.${n}.main`,!1)||lt(t,`palette.${n}`,!1)||r.color,a=lt(t,`palette.${n}.mainChannel`)||lt(t,`palette.${n}Channel`);return"vars"in t&&a?`rgba(${a} / 0.4)`:Tr(i,.4)},ax={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},ox=gi(jp,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`underline${Oi(r.underline)}`],"button"===r.component&&t.button]}})(wi((e=>{let{theme:t}=e;return{variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:e=>{let{underline:t,ownerState:r}=e;return"always"===t&&"inherit"!==r.color},style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{underline:"always",color:r},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.4)`:Tr(t.palette[r].main,.4)}}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Tr(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:Tr(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nx.focusVisible}`]:{outline:"auto"}}}]}}))),sx=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiLink"}),i=bi(),{className:a,color:o="primary",component:l="a",onBlur:c,onFocus:u,TypographyClasses:h,underline:p="always",variant:d="inherit",sx:f,...m}=n,[g,y]=e.useState(!1),v={...n,color:o,component:l,focusVisible:g,underline:p,variant:d},x=(e=>{const{classes:t,component:r,focusVisible:n,underline:i}=e;return Wn({root:["root",`underline${Oi(i)}`,"button"===r&&"button",n&&"focusVisible"]},rx,t)})(v);return(0,s.jsx)(ox,{color:o,className:Gn(x.root,a),classes:h,component:l,onBlur:e=>{pa(e.target)||y(!1),c&&c(e)},onFocus:e=>{pa(e.target)&&y(!0),u&&u(e)},ref:r,ownerState:v,variant:d,...m,sx:[...void 0===ax[o]?[{color:o}]:[],...Array.isArray(f)?f:[f]],style:{...m.style,..."always"===p&&"inherit"!==o&&!ax[o]&&{"--Link-underlineColor":ix({theme:i,ownerState:v})}}})}));function lx(e){return Ai("MuiTableFooter",e)}Mi("MuiTableFooter",["root"]);const cx=gi("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),ux={variant:"footer"},hx="tfoot",px=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableFooter"}),{className:n,component:i=hx,...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},lx,t)})(o);return(0,s.jsx)(dd.Provider,{value:ux,children:(0,s.jsx)(cx,{as:i,className:Gn(l.root,n),ref:t,role:i===hx?null:"rowgroup",ownerState:o,...a})})}));var dx=function(){return dx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{let{className:t,content:r,submitQuery:n,...i}=e;const a=bi();let o={overrides:{a:{component:sx,props:{sx:{wordBreak:"break-all",color:a.palette.secondary.main,textDecoration:"none","&:hover":{color:a.palette.custom.highlight,textDecoration:"underline"}}}},ChatQuery:void 0}};return n&&(o.overrides.ChatQuery={component:Pu,props:{submitQuery:n}}),(0,s.jsx)(Vx,{className:t,...o,children:r,...i})};var Hx=r(537);function Gx(e){return Ai("MuiFormControlLabel",e)}const Wx=Mi("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),$x=gi("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Wx.label}`]:t.label},t.root,t[`labelPlacement${Oi(r.labelPlacement)}`]]}})(wi((e=>{let{theme:t}=e;return{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Wx.disabled}`]:{cursor:"default"},[`& .${Wx.label}`]:{[`&.${Wx.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:e=>{let{labelPlacement:t}=e;return"start"===t||"top"===t||"bottom"===t},style:{marginLeft:16}}]}}))),Zx=gi("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(wi((e=>{let{theme:t}=e;return{[`&.${Wx.error}`]:{color:(t.vars||t).palette.error.main}}}))),Xx=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiFormControlLabel"}),{checked:i,className:a,componentsProps:o={},control:l,disabled:c,disableTypography:u,inputRef:h,label:p,labelPlacement:d="end",name:f,onChange:m,required:g,slots:y={},slotProps:v={},value:x,...b}=n,_=ju(),w=c??l.props.disabled??_?.disabled,k=g??l.props.required,T={disabled:w,required:k};["checked","name","onChange","value","inputRef"].forEach((e=>{"undefined"===typeof l.props[e]&&"undefined"!==typeof n[e]&&(T[e]=n[e])}));const S=Ru({props:n,muiFormControl:_,states:["error"]}),A={...n,disabled:w,labelPlacement:d,required:k,error:S.error},M=(e=>{const{classes:t,disabled:r,labelPlacement:n,error:i,required:a}=e;return Wn({root:["root",r&&"disabled",`labelPlacement${Oi(n)}`,i&&"error",a&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",i&&"error"]},Gx,t)})(A),E={slots:y,slotProps:{...o,...v}},[C,P]=Yi("typography",{elementType:jp,externalForwardedProps:E,ownerState:A});let L=p;return null==L||L.type===jp||u||(L=(0,s.jsx)(C,{component:"span",...P,className:Gn(M.label,P?.className),children:L})),(0,s.jsxs)($x,{className:Gn(M.root,a),ownerState:A,ref:r,...b,children:[e.cloneElement(l,T),k?(0,s.jsxs)("div",{children:[L,(0,s.jsxs)(Zx,{ownerState:A,"aria-hidden":!0,className:M.asterisk,children:["\u2009","*"]})]}):L]})}));function Yx(e){return Ai("PrivateSwitchBase",e)}Mi("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Kx=gi(Ha)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"start"===t&&"small"!==r.size},style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"end"===t&&"small"!==r.size},style:{marginRight:-12}}]}),Jx=gi("input",{shouldForwardProp:mi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Qx=e.forwardRef((function(e,t){const{autoFocus:r,checked:n,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:h,inputProps:p,inputRef:d,name:f,onBlur:m,onChange:g,onFocus:y,readOnly:v,required:x=!1,tabIndex:b,type:_,value:w,slots:k={},slotProps:T={},...S}=e,[A,M]=el({controlled:n,default:Boolean(a),name:"SwitchBase",state:"checked"}),E=ju();let C=o;E&&"undefined"===typeof C&&(C=E.disabled);const P="checkbox"===_||"radio"===_,L={...e,checked:A,disabled:C,disableFocusRipple:l,edge:c},I=(e=>{const{classes:t,checked:r,disabled:n,edge:i}=e;return Wn({root:["root",r&&"checked",n&&"disabled",i&&`edge${Oi(i)}`],input:["input"]},Yx,t)})(L),z={slots:k,slotProps:{input:p,...T}},[O,R]=Yi("root",{ref:t,elementType:Kx,className:I.root,shouldForwardComponentProp:!0,externalForwardedProps:{...z,component:"span",...S},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{y&&y(e),E&&E.onFocus&&E.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{m&&m(e),E&&E.onBlur&&E.onBlur(e)})(t)}}),ownerState:L,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:C,role:void 0,tabIndex:null}}),[D,j]=Yi("input",{ref:d,elementType:Jx,className:I.input,externalForwardedProps:z,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;M(t),g&&g(e,t)})(t)}}),ownerState:L,additionalProps:{autoFocus:r,checked:n,defaultChecked:a,disabled:C,id:P?h:void 0,name:f,readOnly:v,required:x,tabIndex:b,type:_,..."checkbox"===_&&void 0===w?{}:{value:w}}});return(0,s.jsxs)(O,{...R,children:[(0,s.jsx)(D,{...j}),A?i:u]})}));function eb(e){return Ai("MuiSwitch",e)}const tb=Mi("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),rb=gi("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.edge&&t[`edge${Oi(r.edge)}`],t[`size${Oi(r.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${tb.thumb}`]:{width:16,height:16},[`& .${tb.switchBase}`]:{padding:4,[`&.${tb.checked}`]:{transform:"translateX(16px)"}}}}]}),nb=gi(Qx,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.switchBase,{[`& .${tb.input}`]:t.input},"default"!==r.color&&t[`color${Oi(r.color)}`]]}})(wi((e=>{let{theme:t}=e;return{position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${"light"===t.palette.mode?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${tb.checked}`]:{transform:"translateX(20px)"},[`&.${tb.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${"light"===t.palette.mode?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${tb.checked} + .${tb.track}`]:{opacity:.5},[`&.${tb.disabled} + .${tb.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:""+("light"===t.palette.mode?.12:.2)},[`& .${tb.input}`]:{left:"-100%",width:"300%"}}})),wi((e=>{let{theme:t}=e;return{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(hl(["light"])).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${tb.checked}`]:{color:(t.vars||t).palette[r].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette[r].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${tb.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${r}DisabledColor`]:`${"light"===t.palette.mode?Er(t.palette[r].main,.62):Ar(t.palette[r].main,.55)}`}},[`&.${tb.checked} + .${tb.track}`]:{backgroundColor:(t.vars||t).palette[r].main}}}}))]}}))),ib=gi("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(wi((e=>{let{theme:t}=e;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${"light"===t.palette.mode?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:""+("light"===t.palette.mode?.38:.3)}}))),ab=gi("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(wi((e=>{let{theme:t}=e;return{boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}}))),ob=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiSwitch"}),{className:n,color:i="primary",edge:a=!1,size:o="medium",sx:l,slots:c={},slotProps:u={},...h}=r,p={...r,color:i,edge:a,size:o},d=(e=>{const{classes:t,edge:r,size:n,color:i,checked:a,disabled:o}=e,s=Wn({root:["root",r&&`edge${Oi(r)}`,`size${Oi(n)}`],switchBase:["switchBase",`color${Oi(i)}`,a&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},eb,t);return{...t,...s}})(p),f={slots:c,slotProps:u},[m,g]=Yi("root",{className:Gn(d.root,n),elementType:rb,externalForwardedProps:f,ownerState:p,additionalProps:{sx:l}}),[y,v]=Yi("thumb",{className:d.thumb,elementType:ab,externalForwardedProps:f,ownerState:p}),x=(0,s.jsx)(y,{...v}),[b,_]=Yi("track",{className:d.track,elementType:ib,externalForwardedProps:f,ownerState:p});return(0,s.jsxs)(m,{...g,children:[(0,s.jsx)(nb,{type:"checkbox",icon:x,checkedIcon:x,ref:t,ownerState:p,...h,classes:{...d,root:d.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...u.switchBase&&{root:"function"===typeof u.switchBase?u.switchBase(p):u.switchBase},...u.input&&{input:"function"===typeof u.input?u.input(p):u.input}}}),(0,s.jsx)(b,{..._})]})})),sb=e=>{const t=Math.min(...e),r=Math.max(...e)-t;return 0===r?e.map((()=>.5)):e.map((e=>(e-t)/r))},lb={query:"\ud83d\udd0d",resume:"\ud83d\udcc4",projects:"\ud83d\udcc1",jobs:"\ud83d\udcc1","performance-reviews":"\ud83d\udcc4",news:"\ud83d\udcf0"},cb={query:"#D4A017",resume:"#4A7A7D",projects:"#1A2536",news:"#D3CDBF","performance-reviews":"#FFD0D0",jobs:"#F3aD8F"},ub={query:10},hb={query:"circle"},pb=t=>{const{setSnack:r,rag:n,inline:i,connectionBase:a,sessionId:o,sx:l}=t,[c,u]=(0,e.useState)(null),[h,p]=(0,e.useState)(""),[d,f]=(0,e.useState)(void 0),[m,g]=(0,e.useState)(void 0),[y,v]=(0,e.useState)(!0),x=(0,e.useRef)(null),[b,_]=(0,e.useState)(null);if((0,e.useEffect)((()=>{if(void 0!==m&&m.dimensions!==(y?3:2)||void 0===o)return;(async()=>{try{const e=await fetch(a+`/api/umap/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dimensions:y?2:3})}),t=await e.json();t.dimensions=y?2:3,g(t)}catch(e){console.error("Error obtaining collection information:",e),r("Unable to obtain collection information.","error")}})()}),[m,g,a,r,o,y]),(0,e.useEffect)((()=>{window.dispatchEvent(new Event("resize")),x.current&&Hx.A.Plots.resize(x.current)}),[]),(0,e.useEffect)((()=>{if(!m||!m.embeddings)return;if(0===m.embeddings.length)return;const e=[...m.embeddings],t=[...m.documents||[]],r=[...m.metadatas||[]],i=[...m.ids||[]];let a=e.every((e=>2===e.length)),o=e.every((e=>3===e.length));if(y&&!a||!y&&!o)return;if(y&&n&&n.umap_embedding_2d&&(r.unshift({doc_type:"query"}),t.unshift("Query"),e.unshift(n.umap_embedding_2d)),!y&&n&&n.umap_embedding_3d&&(r.unshift({doc_type:"query"}),t.unshift("Query"),e.unshift(n.umap_embedding_3d)),void 0!==d&&(r.unshift({doc_type:"query"}),t.unshift(d.query||""),y&&d.umap_embedding_2d&&e.unshift(d.umap_embedding_2d),!y&&d.umap_embedding_3d&&e.unshift(d.umap_embedding_3d)),a=e.every((e=>2===e.length)),o=e.every((e=>3===e.length)),!a&&!o)return void console.warn("Modified vectors are neither 2D nor 3D");const s=r.map((e=>e.doc_type||"unknown")),l=s.map(((e,t)=>(ub[e]||(ub[e]=5),n&&n.ids.includes(i[t])||d&&d.ids&&d.ids.includes(i[t])?ub[e]+5:ub[e]))),c=s.map((e=>(hb[e]||(hb[e]="circle"),hb[e]))),h=s.map((e=>(cb[e]||(cb[e]="#ff0000"),cb[e]))),p=r.map(((e,r)=>({doc:t[r],type:e.doc_type||"unknown"}))),f=sb(e.map((e=>e[0]))),g=sb(e.map((e=>e[1]))),v=o?sb(e.map((e=>e[2]))):void 0,x={x:f,y:g,mode:"markers",marker:{size:l,symbol:c,color:h,opacity:.8},customdata:p,type:null!==v&&void 0!==v&&v.length?"scatter3d":"scatter"};o&&(x.z=v),u({data:x,layout:{autosize:!0,paper_bgcolor:"#FFFFFF",plot_bgcolor:"#FFFFFF",font:{family:"Roboto, sans-serif",color:"#2E2E2E"},hovermode:"closest",scene:{bgcolor:"#FFFFFF",zaxis:{title:"Z",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"}},xaxis:{title:"X",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"},yaxis:{title:"Y",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"},margin:{r:0,b:0,l:0,t:0}}})}),[m,d,n,y,u,r]),void 0===r)return console.error("setSnack function is undefined"),null;const w=async e=>{if(e.trim()){p("");try{const t=await fetch(`${a}/api/similarity/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,dimensions:y?2:3})}),r=await t.json();f(r)}catch(t){console.error("Error obtaining query similarity information:",t),r("Unable to obtain query similarity information.","error")}}};return c&&void 0!==o?(0,s.jsxs)(yc,{className:"VectorVisualizer",sx:{display:"flex",position:"relative",flexDirection:"column",flexGrow:1,...l},children:[!i&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",flexGrow:1,minHeight:"2.5rem",justifyContent:"center",alignItems:"center",m:0,p:0,mb:1},children:(0,s.jsx)(jp,{variant:"h6",sx:{p:1,pt:0},children:"RAG Vector Visualization"})}),(0,s.jsx)(Xx,{sx:{display:"flex",position:"relative",width:"fit-content",ml:1,mb:"-2.5rem",zIndex:100,flexBasis:0,flexGrow:0},control:(0,s.jsx)(ob,{checked:!y}),onChange:()=>v(!y),label:"3D"}),(0,s.jsx)(Hx.A,{ref:x,onClick:e=>{const t=e.points[0];console.log("Point:",t);const r=t.customdata.type,n=t.customdata.doc,i=lb[r]||"\u2753";var a;_({visible:!0,background:t["marker.color"],color:(a=t["marker.color"],.299*parseInt(a.slice(1,3),16)+.587*parseInt(a.slice(3,5),16)+.114*parseInt(a.slice(5,7),16)>186?"#2E2E2E":"#FFFFFF"),content:`${i} ${r.toUpperCase()}\n${n}`})},data:[c.data],useResizeHandler:!0,config:{responsive:!0,displaylogo:!1,showSendToCloud:!1,staticPlot:!1},style:{display:"flex",flexGrow:1,minHeight:"240px",padding:0,margin:0,width:"100%",height:"100%"},layout:c.layout}),!i&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",flexGrow:1,mt:1,p:.5,color:(null===b||void 0===b?void 0:b.color)||"#2E2E2E",background:(null===b||void 0===b?void 0:b.background)||"#FFFFFF",whiteSpace:"pre-line",zIndex:1e3,overflow:"auto",maxHeight:"20vh",minHeight:"20vh",overflowWrap:"break-all",wordBreak:"break-all"},children:(0,s.jsx)(jp,{variant:"body2",sx:{p:1,pt:0},children:null===b||void 0===b?void 0:b.content})}),!i&&void 0!==d&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",mt:1,pb:0},children:(0,s.jsxs)(jp,{variant:"h6",sx:{p:1,pt:0,maxHeight:"5rem",overflow:"auto"},children:["Query: ",d.query]})}),!i&&(0,s.jsxs)(yc,{className:"Query",sx:{display:"flex",flexDirection:"row",p:1},children:[(0,s.jsx)(Lp,{variant:"outlined",fullWidth:!0,type:"text",value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"===e.key&&w(h)},placeholder:"Enter query to find related documents...",id:"QueryInput"}),(0,s.jsx)(ul,{title:"Send",children:(0,s.jsx)(Cu,{sx:{m:1},variant:"contained",onClick:()=>{w(h)},children:(0,s.jsx)(Fp,{})})})]})]}):(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1,justifyContent:"center",alignItems:"center"},children:(0,s.jsx)("div",{children:"Loading visualization..."})})},db=Bi((0,s.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),fb=Bi((0,s.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),mb=t=>{let{content:r,sx:n}=t;const[i,a]=(0,e.useState)(!1);return(0,s.jsx)(ul,{title:"Copy to clipboard",placement:"top",arrow:!0,children:(0,s.jsx)(dc,{onClick:()=>{void 0!==r&&navigator.clipboard.writeText(r.trim()).then((()=>{a(!0),setTimeout((()=>a(!1)),2e3)}))},sx:{width:24,height:24,opacity:.75,bgcolor:"background.paper","&:hover":{bgcolor:"action.hover",opacity:1},...n},size:"small",color:i?"success":"default",children:i?(0,s.jsx)(fb,{sx:{width:16,height:16}}):(0,s.jsx)(db,{sx:{width:16,height:16}})})})},gb=e=>{const{rag:t,tools:r,eval_count:n,eval_duration:i,prompt_eval_count:a,prompt_eval_duration:o}=e.metadata||{},l=e.messageProps.message;return(0,s.jsxs)(s.Fragment,{children:[0!==o&&0!==i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(yc,{sx:{fontSize:"0.8rem",mb:1},children:"Below is the LLM performance of this query. Note that if tools are called, the entire context is processed for each separate tool request by the LLM. This can dramatically increase the total time for a response."}),(0,s.jsx)(Sd,{component:zi,className:"PromptStats",sx:{mb:1},children:(0,s.jsxs)(pd,{"aria-label":"prompt stats",size:"small",children:[(0,s.jsx)(Pd,{children:(0,s.jsxs)(Rd,{children:[(0,s.jsx)(wd,{}),(0,s.jsx)(wd,{align:"right",children:"Tokens"}),(0,s.jsx)(wd,{align:"right",children:"Time (s)"}),(0,s.jsx)(wd,{align:"right",children:"TPS"})]})}),(0,s.jsxs)(vd,{children:[(0,s.jsxs)(Rd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(wd,{component:"th",scope:"row",children:"Prompt"}),(0,s.jsx)(wd,{align:"right",children:a}),(0,s.jsx)(wd,{align:"right",children:Math.round(o/10**7)/100}),(0,s.jsx)(wd,{align:"right",children:Math.round(a*10**9/o)})]},"prompt"),(0,s.jsxs)(Rd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(wd,{component:"th",scope:"row",children:"Response"}),(0,s.jsx)(wd,{align:"right",children:n}),(0,s.jsx)(wd,{align:"right",children:Math.round(i/10**7)/100}),(0,s.jsx)(wd,{align:"right",children:Math.round(n*10**9/i)})]},"response"),(0,s.jsxs)(Rd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(wd,{component:"th",scope:"row",children:"Total"}),(0,s.jsx)(wd,{align:"right",children:a+n}),(0,s.jsx)(wd,{align:"right",children:Math.round((o+i)/10**7)/100}),(0,s.jsx)(wd,{align:"right",children:Math.round((a+n)*10**9/(o+i))})]},"total")]})]})})]}),void 0!==r&&r.tool_calls&&0!==r.tool_calls.length&&(0,s.jsxs)(Jp,{sx:{boxSizing:"border-box"},children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsx)(yc,{sx:{fontSize:"0.8rem"},children:"Tools queried"})}),(0,s.jsx)(sd,{children:r.tool_calls.map(((e,t)=>(0,s.jsxs)(yc,{sx:{m:0,p:1,pt:0,display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"},children:[0!==t&&(0,s.jsx)(zc,{}),(0,s.jsx)(yc,{sx:{fontSize:"0.75rem",display:"flex",flexDirection:"column",mt:1,mb:1,fontWeight:"bold"},children:e.name}),(0,s.jsx)(wg,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:JSON.parse(e.content),style:{fontSize:"0.8rem",maxHeight:"20rem",overflow:"auto"},children:(0,s.jsx)(wg.String,{render:e=>{let{children:t,...r}=e;if("string"===typeof t&&t.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"flex",border:"none",...r.style},children:t})}})})]},t)))})]}),t.map((t=>(0,s.jsxs)(Jp,{children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsxs)(yc,{sx:{fontSize:"0.8rem"},children:["Top RAG ",t.ids.length," matches from '",t.name,"' collection against embedding vector of ",t.query_embedding.length," dimensions"]})}),(0,s.jsxs)(sd,{children:[(0,s.jsxs)(yc,{sx:{fontSize:"0.8rem"},children:["UMAP Vector Visualization of '",t.name,"' RAG"]}),(0,s.jsx)(pb,{inline:!0,...e.messageProps,...e.metadata,rag:t}),t.ids.map(((e,r)=>(0,s.jsxs)(yc,{children:[(0,s.jsx)(zc,{}),(0,s.jsxs)(yc,{sx:{whiteSpace:"nowrap",fontSize:"0.75rem",p:0,m:0,pt:.5},children:["Doc ID: ",t.ids[r]]}),(0,s.jsxs)(yc,{sx:{fontSize:"0.75rem",display:"flex",flexDirection:"row",mb:.5,mt:.5},children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",paddingRight:"1rem",minWidth:"10rem"},children:[(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Distance: ",Math.round(100*t.distances[r])/100]}),(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Type: ",t.metadatas[r].doc_type]}),(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Chunk Len: ",t.documents[r].length]})]}),(0,s.jsx)("div",{style:{display:"flex",padding:"3px",flexGrow:1,border:"1px solid #E0E0E0",maxHeight:"5rem",overflow:"auto"},children:t.documents[r]})]})]},r)))]})]},t.name))),(0,s.jsxs)(Jp,{children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsx)(yc,{sx:{fontSize:"0.8rem"},children:"Full Response Details"})}),(0,s.jsx)(sd,{children:(0,s.jsx)(wg,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:l,style:{fontSize:"0.8rem",maxHeight:"20rem",overflow:"auto"},children:(0,s.jsx)(wg.String,{render:e=>{let{children:t,...r}=e;if("string"===typeof t&&t.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"inline",border:"none",...r.style},children:t.trim()})}})})})]})]})},yb=t=>{const{message:r,submitQuery:n,isFullWidth:i,sx:a,className:o}=t,[l,c]=(0,e.useState)(!1),u=(0,e.useRef)(null),h=()=>{c(!l)};if(void 0===r)return(0,s.jsx)(s.Fragment,{});if(void 0===r.content)return console.info("Message content is undefined"),(0,s.jsx)(s.Fragment,{});const p=r.content.trim();return(0,s.jsxs)(Eg,{className:o||"Message",isFullWidth:i,role:r.role,title:r.title,sx:{display:"flex",flexDirection:"column",pb:r.metadata?0:"8px",m:0,mt:1,marginBottom:"0px !important",...a},children:[(0,s.jsx)(Fd,{ref:u,sx:{position:"relative",display:"flex",flexDirection:"column",overflowX:"auto",m:0,p:0,paddingBottom:"0px !important"},children:"user"!==r.role?(0,s.jsx)(qx,{className:"MessageContent",sx:{display:"flex",color:"text.secondary"},content:p,submitQuery:n}):(0,s.jsx)(jp,{className:"MessageContent",ref:u,variant:"body2",sx:{display:"flex",color:"text.secondary"},children:r.content})}),(0,s.jsxs)(Ud,{disableSpacing:!0,sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",p:0,m:0},children:[void 0===r.disableCopy&&["assistant","content"].includes(r.role)&&(0,s.jsx)(mb,{content:r.content}),r.metadata&&(0,s.jsxs)(yc,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(Cu,{variant:"text",onClick:h,sx:{color:"darkgrey",p:0},children:"LLM information for this query"}),(0,s.jsx)(qd,{expand:l,onClick:h,"aria-expanded":l,"aria-label":"show more",children:(0,s.jsx)(Vd,{})})]})]}),r.metadata&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(Wp,{in:l,timeout:"auto",unmountOnExit:!0,children:(0,s.jsx)(Fd,{children:(0,s.jsx)(gb,{messageProps:t,metadata:r.metadata})})})})]})},vb=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.33,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=(0,e.useRef)(null),i=(0,e.useRef)(0),a=(0,e.useRef)(null);return(0,e.useEffect)((()=>{const e=n.current;if(!e)return;const o=e.scrollHeight;var s=!1;const l=n=>{if(!e)return;(void 0!==n?n:e.scrollHeight)-e.scrollTop-e.clientHeight<=e.clientHeight*t&&!s&&e.scrollTo({top:e.scrollHeight,behavior:r?"smooth":"auto"})},c=new ResizeObserver((()=>{n.current&&l(o)}));c.observe(e),Array.from(e.children).forEach((e=>{c.observe(e)}));const u=()=>{if(!e)return;a.current&&clearTimeout(a.current);const t=e.scrollTop;s=t{}),500)};return e.addEventListener("scroll",u),l(),()=>{c&&c.disconnect(),e&&e.removeEventListener("scroll",u),a.current&&clearTimeout(a.current)}}),[r,t]),n},xb=e=>{const{sx:t,children:r,autoscroll:n}=e,i=vb();return(0,s.jsx)(yc,{sx:{display:"flex",margin:"0 auto",flexGrow:1,overflow:"auto",backgroundColor:"#F5F5F5",...t},ref:void 0!==n&&!1!==n?i:void 0,children:r})};function bb(e){return Ai("MuiDialog",e)}const _b=Mi("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);const wb=e.createContext({}),kb=gi(Tl,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),Tb=gi(Fl,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),Sb=gi("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.container,t[`scroll${Oi(r.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Ab=gi(Pi,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`scrollPaper${Oi(r.scroll)}`],t[`paperWidth${Oi(String(r.maxWidth))}`],r.fullWidth&&t.paperFullWidth,r.fullScreen&&t.paperFullScreen]}})(wi((e=>{let{theme:t}=e;return{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:e=>{let{ownerState:t}=e;return!t.maxWidth},style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===t.breakpoints.unit?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${_b.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter((e=>"xs"!==e)).map((e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${_b.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+64)]:{maxWidth:"calc(100% - 64px)"}}}}))),{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"calc(100% - 64px)"}},{props:e=>{let{ownerState:t}=e;return t.fullScreen},style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${_b.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}}))),Mb=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiDialog"}),i=bi(),a={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":o,"aria-labelledby":l,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:h,children:p,className:d,disableEscapeKeyDown:f=!1,fullScreen:m=!1,fullWidth:g=!1,maxWidth:y="sm",onClick:v,onClose:x,open:b,PaperComponent:_=Pi,PaperProps:w={},scroll:k="paper",slots:T={},slotProps:S={},TransitionComponent:A=_l,transitionDuration:M=a,TransitionProps:E,...C}=n,P={...n,disableEscapeKeyDown:f,fullScreen:m,fullWidth:g,maxWidth:y,scroll:k},L=(e=>{const{classes:t,scroll:r,maxWidth:n,fullWidth:i,fullScreen:a}=e;return Wn({root:["root"],container:["container",`scroll${Oi(r)}`],paper:["paper",`paperScroll${Oi(r)}`,`paperWidth${Oi(String(n))}`,i&&"paperFullWidth",a&&"paperFullScreen"]},bb,t)})(P),I=e.useRef(),z=Ks(l),O=e.useMemo((()=>({titleId:z})),[z]),R={slots:{transition:A,...T},slotProps:{transition:E,paper:w,backdrop:h,...S}},[D,j]=Yi("root",{elementType:Tb,shouldForwardComponentProp:!0,externalForwardedProps:R,ownerState:P,className:Gn(L.root,d),ref:r}),[F,B]=Yi("backdrop",{elementType:kb,shouldForwardComponentProp:!0,externalForwardedProps:R,ownerState:P}),[N,U]=Yi("paper",{elementType:Ab,shouldForwardComponentProp:!0,externalForwardedProps:R,ownerState:P,className:Gn(L.paper,w.className)}),[V,q]=Yi("container",{elementType:Sb,externalForwardedProps:R,ownerState:P,className:Gn(L.container)}),[H,G]=Yi("transition",{elementType:_l,externalForwardedProps:R,ownerState:P,additionalProps:{appear:!0,in:b,timeout:M,role:"presentation"}});return(0,s.jsx)(D,{closeAfterTransition:!0,slots:{backdrop:F},slotProps:{backdrop:{transitionDuration:M,as:u,...B}},disableEscapeKeyDown:f,onClose:x,open:b,onClick:e=>{v&&v(e),I.current&&(I.current=null,x&&x(e,"backdropClick"))},...j,...C,children:(0,s.jsx)(H,{...G,children:(0,s.jsx)(V,{onMouseDown:e=>{I.current=e.target===e.currentTarget},...q,children:(0,s.jsx)(N,{as:_,elevation:24,role:"dialog","aria-describedby":o,"aria-labelledby":z,"aria-modal":c,...U,children:(0,s.jsx)(wb.Provider,{value:O,children:p})})})})})}));function Eb(e){return Ai("MuiDialogTitle",e)}const Cb=Mi("MuiDialogTitle",["root"]),Pb=gi(jp,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),Lb=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiDialogTitle"}),{className:i,id:a,...o}=n,l=n,c=(e=>{const{classes:t}=e;return Wn({root:["root"]},Eb,t)})(l),{titleId:u=a}=e.useContext(wb);return(0,s.jsx)(Pb,{component:"h2",className:Gn(c.root,i),ownerState:l,ref:r,variant:"h6",id:a??u,...o})}));function Ib(e){return Ai("MuiDialogContent",e)}Mi("MuiDialogContent",["root","dividers"]);const zb=gi("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dividers&&t.dividers]}})(wi((e=>{let{theme:t}=e;return{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:e=>{let{ownerState:t}=e;return t.dividers},style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return!t.dividers},style:{[`.${Cb.root} + &`]:{paddingTop:0}}}]}}))),Ob=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDialogContent"}),{className:n,dividers:i=!1,...a}=r,o={...r,dividers:i},l=(e=>{const{classes:t,dividers:r}=e;return Wn({root:["root",r&&"dividers"]},Ib,t)})(o);return(0,s.jsx)(zb,{className:Gn(l.root,n),ownerState:o,ref:t,...a})}));function Rb(e){return Ai("MuiDialogContentText",e)}Mi("MuiDialogContentText",["root"]);const Db=gi(jp,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),jb=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDialogContentText"}),{children:n,className:i,...a}=r,o=(e=>{const{classes:t}=e,r=Wn({root:["root"]},Rb,t);return{...t,...r}})(a);return(0,s.jsx)(Db,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:a,className:Gn(o.root,i),...r,classes:o})}));function Fb(e){return Ai("MuiDialogActions",e)}Mi("MuiDialogActions",["root","spacing"]);const Bb=gi("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableSpacing},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Nb=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDialogActions"}),{className:n,disableSpacing:i=!1,...a}=r,o={...r,disableSpacing:i},l=(e=>{const{classes:t,disableSpacing:r}=e;return Wn({root:["root",!r&&"spacing"]},Fb,t)})(o);return(0,s.jsx)(Bb,{className:Gn(l.root,n),ownerState:o,ref:t,...a})})),Ub=Bi((0,s.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"})),Vb=t=>{const{onDelete:r,disabled:n,label:i,color:a}=t,[o,l]=(0,e.useState)(!1),c=bi(),u=qn(c.breakpoints.down("md")),h=()=>{l(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ul,{title:i?`Reset ${i}`:"Reset",children:(0,s.jsxs)("span",{style:{display:"flex"},children:[" ",(0,s.jsx)(dc,{"aria-label":"reset",onClick:()=>{l(!0)},color:a||"inherit",sx:{display:"flex",margin:"auto 0px"},size:"large",edge:"start",disabled:n,children:(0,s.jsx)(Ub,{})})]})}),(0,s.jsxs)(Mb,{fullScreen:u,open:o,onClose:h,"aria-labelledby":"responsive-dialog-title",children:[(0,s.jsx)(Lb,{id:"responsive-dialog-title",children:"Confirm Reset"}),(0,s.jsx)(Ob,{children:(0,s.jsxs)(jb,{children:["This action will permanently reset ",i?i.toLocaleLowerCase():"all data"," without the ability to recover it. Are you sure you want to continue?"]})}),(0,s.jsxs)(Nb,{children:[(0,s.jsx)(Cu,{autoFocus:!0,onClick:h,children:"Cancel"}),(0,s.jsxs)(Cu,{onClick:()=>{r(),l(!1)},color:"error",variant:"contained",children:["Reset ",i||"Everything"]})]})]})]})},qb={role:"status",content:"Establishing connection with server..."},Hb=(0,e.forwardRef)(((t,r)=>{let{className:n,type:i,prompt:a,emptyPrompt:o,actionLabel:l,resetAction:c,multiline:u,resetLabel:h,connectionBase:p,sessionId:d,setSnack:f,defaultPrompts:m,hideDefaultPrompts:g,defaultQuery:y,preamble:v,hidePreamble:x,messageFilter:b,messages:_,sx:w,onResponse:k}=t;const[T,S]=(0,e.useState)(""),[A,M]=(0,e.useState)(0),[E,C]=(0,e.useState)(!1),[P,L]=(0,e.useState)(0),[I,z]=(0,e.useState)([]),[O,R]=(0,e.useState)([]),[D,j]=(0,e.useState)(void 0),F=(0,e.useRef)(null),[B,N]=(0,e.useState)(35),[U,V]=(0,e.useState)(430),[q,H]=(0,e.useState)({context_used:0,max_context:0}),[G,W]=(0,e.useState)(!1),[$,Z]=(0,e.useState)(!0),X=(0,e.useRef)([]),Y=vb();(0,e.useEffect)((()=>{X.current=I}),[I]);const K=(0,e.useCallback)((()=>{(async()=>{try{const e=await fetch(p+`/api/context-status/${d}/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Server responded with ${e.status}: ${e.statusText}`);const t=await e.json();H(t)}catch(e){console.error("Error getting context status:",e),f("Unable to obtain context status.","error")}})()}),[H,p,f,d,i]);(0,e.useEffect)((()=>{let e=[];e=void 0===b?I:b(I),0===e.length?R([...v||[],..._||[]]):R([...x?[]:v||[],..._||[],...e])}),[I,R,b,v,_,x]),(0,e.useEffect)((()=>{if(void 0===d)return void j(qb);(async()=>{try{const e=await fetch(p+`/api/history/${d}/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Server responded with ${e.status}: ${e.statusText}`);const{messages:t}=await e.json();if(void 0===t||0===t.length)console.log(`History returned for ${i} from server with 0 entries`),z([]),Z(!0);else{console.log(`History returned for ${i} from server with ${t.length} entries:`,t);z(t.flatMap((e=>[{role:"user",content:e.prompt||""},{...e,role:"assistant",content:e.response||""}]))),Z(!1)}j(void 0),K()}catch(e){console.error("Error generating session ID:",e),j({role:"error",content:"Unable to obtain history from server."}),setTimeout((()=>{j(void 0)}),5e3),f("Unable to obtain chat history.","error")}})()}),[z,R,K,p,f,i,d]);const J=()=>{F.current&&(clearInterval(F.current),F.current=null,L(0))};(0,e.useImperativeHandle)(r,(()=>({submitQuery:(e,t)=>{Q(e,t)}}))),(0,e.useEffect)((()=>{const e=Math.round(100*q.context_used/q.max_context);e>=90&&!G&&(f(`${e}% of context used. You may wish to start a new chat.`,"warning"),W(!0)),e<90&&G&&W(!1),M(e)}),[q,W,G,M,f]);const Q=async(e,t)=>{if((e=e.trim())||!y||a||(e=y.trim()),e){Z(!1),z([...X.current,{role:"user",origin:i,content:e,disableCopy:!0}]),await new Promise((e=>setTimeout(e,0))),S("");try{C(!0);const n=Date.now().toString();let a;j({role:"status",content:"Submitting request...",id:n,isProcessing:!0}),await new Promise((e=>setTimeout(e,0))),a=t?{options:t,prompt:e.trim()}:{prompt:e.trim()};const o=await fetch(p+`/api/chat/${d}/${i}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)}),s=500,l=Math.round(s/B+q.context_used/U);if(f(`Query sent. Response estimated in ${l}s.`,"info"),r=Math.round(l),F.current&&clearInterval(F.current),L(r),F.current=setInterval((()=>{L((e=>e<=1?(clearInterval(F.current),F.current=null,0):e-1))}),1e3),!o.ok)throw new Error(`Server responded with ${o.status}: ${o.statusText}`);if(!o.body)throw new Error("Response body is null");const c=o.body.getReader(),u=new TextDecoder;let h="";const m=async e=>{let t=JSON.parse(e);switch(t.status){case"done":console.log("Done processing:",t),k&&(t=k(t)),j(void 0);const e=t;z([...X.current,{...e,role:"assistant",origin:i,content:e.response||""}]),await new Promise((e=>setTimeout(e,0)));const r=t.metadata;if(r){const e=r.eval_count*10**9/r.eval_duration,t=r.prompt_eval_count*10**9/r.prompt_eval_duration;N(e||35),V(t||35),K()}break;case"error":j({role:"error",content:t.response}),setTimeout((()=>{j(void 0)}),5e3),await new Promise((e=>setTimeout(e,0)));break;default:j({role:t.status,content:t.response}),await new Promise((e=>setTimeout(e,0)))}};for(;;){const{done:e,value:t}=await c.read();if(e)break;h+=u.decode(t,{stream:!0});let r=h.split("\n");h=r.pop()||"";for(const n of r)if(n.trim())try{await m(n)}catch(hy){f("Error processing query","error"),console.error(hy)}}if(h.trim())try{await m(h)}catch(hy){f("Error processing query","error"),console.error(hy)}J(),C(!1)}catch(n){console.error("Fetch error:",n),f("Unable to process query","error"),j({role:"error",content:"Unable to process query"}),setTimeout((()=>{j(void 0)}),5e3),C(!1),J(),await new Promise((e=>setTimeout(e,0)))}var r}};return(0,s.jsxs)(yc,{className:n||"Conversation",ref:Y,sx:{p:1,mt:0,...w},children:[O.map(((e,t)=>(0,s.jsx)(yb,{sendQuery:Q,message:e,connectionBase:p,sessionId:d,setSnack:f},t))),void 0!==D&&(0,s.jsx)(yb,{sendQuery:Q,connectionBase:p,sessionId:d,setSnack:f,message:D}),(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",m:1},children:[(0,s.jsx)(Np(),{size:"10px",loading:E,"aria-label":"Loading Spinner","data-testid":"loader"}),!0===E&&P>0&&(0,s.jsxs)(yc,{sx:{pt:1,fontSize:"0.7rem",color:"darkgrey"},children:["Estimated response time: ",P,"s"]})]}),(0,s.jsxs)(yc,{className:"Query",sx:{display:"flex",flexDirection:"column",p:1},children:[a&&(0,s.jsx)(Lp,{variant:"outlined",disabled:E,fullWidth:!0,multiline:!!u,type:"text",value:T,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||Q(T)},placeholder:a,id:"QueryInput"}),(0,s.jsxs)(yc,{sx:{display:"flex",justifyContent:"center",flexDirection:"row"},children:[(0,s.jsx)(Vb,{label:h||"all data",disabled:void 0===d||void 0!==D||$,onDelete:()=>{(async()=>{try{const e=await fetch(p+`/api/reset/${d}/${i}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({reset:["history"]})});if(!e.ok)throw new Error(`Server responded with ${e.status}: ${e.statusText}`);if(!e.body)throw new Error("Response body is null");z([]),Z(!0)}catch(hy){f("Error resetting history","error"),console.error("Error resetting history:",hy)}})(),c&&c()}}),(0,s.jsx)(ul,{title:l||"Send",children:(0,s.jsx)("span",{style:{display:"flex",flexGrow:1},children:(0,s.jsxs)(Cu,{sx:{m:1,gap:1,flexGrow:1},variant:"contained",disabled:void 0===d||void 0!==D,onClick:()=>{Q(T)},children:[l,(0,s.jsx)(Fp,{})]})})})]},"jobActions")]}),($||!g)&&void 0!==m&&m.length&&(0,s.jsx)(yc,{sx:{display:"flex",flexDirection:"column"},children:m.map(((e,t)=>(0,s.jsx)(yc,{children:e},t)))}),(0,s.jsxs)(yc,{sx:{ml:"0.25rem",fontSize:"0.6rem",color:"darkgrey",display:"flex",flexShrink:1,flexDirection:"row",gap:1,mb:"auto",mt:1},children:["Context used: ",A,"% ",q.context_used,"/",q.max_context,A>=90?(0,s.jsx)(jp,{sx:{fontSize:"0.6rem",color:"red"},children:"WARNING: Context almost exhausted. You should start a new chat."}):A>=50?(0,s.jsx)(jp,{sx:{fontSize:"0.6rem",color:"orange"},children:"NOTE: Context is getting long. Queries will be slower, and the LLM may stop issuing tool calls."}):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1}})]})})),Gb=t=>{let{sx:r,connectionBase:n,sessionId:i,setSnack:a}=t;const[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(!1),[h,p]=(0,e.useState)(!1),d=bi(),f=qn(d.breakpoints.down("md")),m=(0,e.useRef)(null),g=(0,e.useRef)(null),y=(0,e.useRef)(null),[v,x]=(0,e.useState)(0),[b,_]=(0,e.useState)(100),w=(e,t)=>{x(t)},k=(e,t)=>{_(t)},T=()=>{_(50)},S=e=>{var t;console.log(`handleJobQuery: ${e} -- `,m.current?" sending":"no handler"),null===(t=m.current)||void 0===t||t.submitQuery(e)},A=e=>{var t;console.log(`handleResumeQuery: ${e} -- `,g.current?" sending":"no handler"),null===(t=g.current)||void 0===t||t.submitQuery(e)},M=e=>{var t;console.log(`handleFactsQuery: ${e} -- `,y.current?" sending":"no handler"),null===(t=y.current)||void 0===t||t.submitQuery(e)},E=(0,e.useCallback)((e=>void 0===e||0===e.length?[]:(console.log("filterJobDescriptionMessages disabled"),e.length>1&&u(!0),e)),[l,u,c]),C=(0,e.useCallback)((e=>void 0===e||0===e.length?[]:(console.log("filterResumeMessages disabled"),e.length>3&&p(!0),e)),[u,h,p]),P=(0,e.useCallback)((e=>void 0===e||0===e.length?[]:(console.log("filterFactsMessages disabled"),e)),[p]),L=(0,e.useCallback)((e=>(console.log("onJobResponse",e),u(!0),e)),[]),I=(0,e.useCallback)((e=>(console.log("onResumeResponse",e),p(!0),e)),[p]),z=(0,e.useCallback)((e=>(console.log("onFactsResponse",e),e)),[]),O=(0,e.useCallback)((()=>{l(!1),u(!1),p(!1)}),[l,u,p]),R=(0,e.useCallback)((()=>{u(!1),p(!1)}),[u,p]),D=(0,e.useCallback)((()=>{p(!1)}),[p]),j=(0,e.useCallback)((e=>{console.log("renderJobDescriptionView");const t=[(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:e?"column":"row"},children:[(0,s.jsx)(Pu,{prompt:"What are the key skills necessary for this position?",tunables:{enable_tools:!1},submitQuery:S}),(0,s.jsx)(Pu,{prompt:"How much should this position pay (accounting for inflation)?",tunables:{enable_tools:!1},submitQuery:S})]})];return o?(0,s.jsx)(Hb,{ref:m,type:"job_description",actionLabel:"Send",prompt:"Ask a question about this job description...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:E,defaultPrompts:t,resetAction:O,onResponse:L,sessionId:i,connectionBase:n,setSnack:a}):(0,s.jsx)(Hb,{ref:m,type:"job_description",actionLabel:"Generate Resume",prompt:"Paste a job description, then click Generate...",multiline:!0,resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:E,resetAction:O,onResponse:L,sessionId:i,connectionBase:n,setSnack:a})}),[n,E,o,i,a,L,O,h,c]),F=(0,e.useCallback)((e=>{const t=[(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:e?"column":"row"},children:[(0,s.jsx)(Pu,{prompt:"Is this resume a good fit for the provided job description?",tunables:{enable_tools:!1},submitQuery:A}),(0,s.jsx)(Pu,{prompt:"Provide a more concise resume.",tunables:{enable_tools:!1},submitQuery:A})]})];return h?(0,s.jsx)(Hb,{ref:g,type:"resume",actionLabel:"Send",prompt:"Ask a question about this job resume...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:C,onResponse:I,resetAction:R,sessionId:i,connectionBase:n,setSnack:a,defaultPrompts:t}):(0,s.jsx)(Hb,{ref:g,type:"resume",actionLabel:"Fact Check",defaultQuery:"Fact check the resume.",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:C,onResponse:I,resetAction:R,sessionId:i,connectionBase:n,setSnack:a})}),[n,C,h,i,a,I,R,c]),B=(0,e.useCallback)((e=>{const t=[(0,s.jsx)(yc,{sx:{display:"flex",flexDirection:e?"column":"row"},children:(0,s.jsx)(Pu,{prompt:"Rewrite the resume to address any discrepancies.",tunables:{enable_tools:!1},submitQuery:M})})];return(0,s.jsx)(Hb,{ref:y,type:"fact_check",actionLabel:"Send",prompt:"Ask a question about any discrepencies...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:P,defaultPrompts:t,resetAction:D,onResponse:z,sessionId:i,connectionBase:n,setSnack:a})}),[n,i,a,z,P,D,c,h]),N=(0,e.useCallback)((()=>{const e=c||h,t=c?(75+25*b/100)/(h?3:2):100,r=100-t*(h?2:1),n=[];n.push((0,s.jsx)(yc,{className:"ChatBox",sx:{display:"flex",flexDirection:"column",minWidth:`${t}%`,width:`${t}%`,maxWidth:`${t}%`,p:0,flexGrow:1},children:j(!1)},"JobDescription")),c&&n.push((0,s.jsxs)(yc,{className:"ChatBox",sx:{display:"flex",flexDirection:"column",minWidth:`${r}%`,width:`${r}%`,maxWidth:`${r}%`,p:0,flexGrow:1},children:[(0,s.jsx)(zc,{orientation:"vertical",flexItem:!0}),F(!1)]},"ResumeView")),h&&n.push((0,s.jsxs)(yc,{className:"ChatBox",sx:{display:"flex",flexDirection:"column",minWidth:`${t}%`,width:`${t}%`,maxWidth:`${t}%`,p:0,flexGrow:1},children:[(0,s.jsx)(zc,{orientation:"vertical",flexItem:!0}),B(!1)]},"FactCheckView"));let i=(0,s.jsx)(yc,{},"slider");return e&&(i=(0,s.jsx)(Pi,{sx:{p:2,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)(Nc,{direction:"row",spacing:2,alignItems:"center",sx:{width:"60%"},children:[(0,s.jsx)(dc,{onClick:()=>_((e=>Math.max(0,e-10))),children:(0,s.jsx)(gu,{})}),(0,s.jsx)(mu,{value:b,onChange:k,"aria-label":"Split ratio",min:0,max:100}),(0,s.jsx)(dc,{onClick:()=>_((e=>Math.min(100,e+10))),children:(0,s.jsx)(yu,{})}),(0,s.jsx)(dc,{onClick:T,children:(0,s.jsx)(vu,{})})]})},"slider")),(0,s.jsxs)(yc,{sx:{p:0,m:0,display:"flex",flexGrow:1,flexDirection:"column"},children:[(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"row",overflow:"hidden",p:0,m:0,margin:"0 auto",maxWidth:e?"100%":"1024px",width:e?"100%":"1024px",height:`calc(100vh - ${e?144:72}px)`,backgroundColor:"#F5F5F5"},children:n}),i]})}),[B,j,F,b,h,c]);return f?(0,s.jsxs)(yc,{sx:{p:0,m:0,display:"flex",flexGrow:1,margin:"0 auto",overflow:"hidden",height:"calc(100vh - 72px)",backgroundColor:"#F5F5F5",flexDirection:"column"},children:[(0,s.jsxs)(so,{value:v,onChange:w,variant:"fullWidth",sx:{bgcolor:"background.paper"},children:[(0,s.jsx)(ho,{value:0,label:"Job Description"}),c&&(0,s.jsx)(ho,{value:1,label:"Resume"}),h&&(0,s.jsx)(ho,{value:2,label:"Fact Check"})]}),(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:"column",flexGrow:1,p:0,width:"100%",...r},children:[(0,s.jsx)(yc,{sx:{display:0===v?"flex":"none"},children:j(!0)}),(0,s.jsx)(yc,{sx:{display:1===v?"flex":"none"},children:F(!0)}),(0,s.jsx)(yc,{sx:{display:2===v?"flex":"none"},children:B(!0)})]})]}):N()};const Wb=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoHideDuration:r=null,disableWindowBlurListener:n=!1,onClose:i,open:a,resumeHideDuration:o}=t,s=La();e.useEffect((()=>{if(a)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&i?.(e,"escapeKeyDown")}}),[a,i]);const l=fa(((e,t)=>{i?.(e,t)})),c=fa((e=>{i&&null!=e&&s.start(e,(()=>{l(null,"timeout")}))}));e.useEffect((()=>(a&&c(r),s.clear)),[a,r,c,s]);const u=s.clear,h=e.useCallback((()=>{null!=r&&c(null!=o?o:.5*r)}),[r,o,c]),p=e=>t=>{const r=e.onFocus;r?.(t),u()},d=e=>t=>{const r=e.onMouseEnter;r?.(t),u()},f=e=>t=>{const r=e.onMouseLeave;r?.(t),h()};return e.useEffect((()=>{if(!n&&a)return window.addEventListener("focus",h),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",u)}}),[n,a,h,u]),{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={...$i(t),...$i(e)};return{role:"presentation",...e,...r,onBlur:(n=r,e=>{const t=n.onBlur;t?.(e),h()}),onFocus:p(r),onMouseEnter:d(r),onMouseLeave:f(r)};var n},onClickAway:e=>{i?.(e,"clickaway")}}};function $b(e){return e.substring(2).toLowerCase()}function Zb(t){const{children:r,disableReactTree:n=!1,mouseEvent:i="onClick",onClickAway:a,touchEvent:o="onTouchEnd"}=t,s=e.useRef(!1),l=e.useRef(null),c=e.useRef(!1),u=e.useRef(!1);e.useEffect((()=>(setTimeout((()=>{c.current=!0}),0),()=>{c.current=!1})),[]);const h=qi(po(r),l),p=fa((e=>{const t=u.current;u.current=!1;const r=oa(l.current);if(!c.current||!l.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidtht=>{u.current=!0;const n=r.props[e];n&&n(t)},f={ref:h};return!1!==o&&(f[o]=d(o)),e.useEffect((()=>{if(!1!==o){const e=$b(o),t=oa(l.current),r=()=>{s.current=!0};return t.addEventListener(e,p),t.addEventListener("touchmove",r),()=>{t.removeEventListener(e,p),t.removeEventListener("touchmove",r)}}}),[p,o]),!1!==i&&(f[i]=d(i)),e.useEffect((()=>{if(!1!==i){const e=$b(i),t=oa(l.current);return t.addEventListener(e,p),()=>{t.removeEventListener(e,p)}}}),[p,i]),e.cloneElement(r,f)}function Xb(e){return Ai("MuiSnackbarContent",e)}Mi("MuiSnackbarContent",["root","message","action"]);const Yb=gi(Pi,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?.8:.98,n=Pr(t.palette.background.default,r);return{...t.typography.body2,color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}}))),Kb=gi("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),Jb=gi("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),Qb=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiSnackbarContent"}),{action:n,className:i,message:a,role:o="alert",...l}=r,c=r,u=(e=>{const{classes:t}=e;return Wn({root:["root"],action:["action"],message:["message"]},Xb,t)})(c);return(0,s.jsxs)(Yb,{role:o,square:!0,elevation:6,className:Gn(u.root,i),ownerState:c,ref:t,...l,children:[(0,s.jsx)(Kb,{className:u.message,ownerState:c,children:a}),n?(0,s.jsx)(Jb,{className:u.action,ownerState:c,children:n}):null]})}));function e_(e){return Ai("MuiSnackbar",e)}Mi("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const t_=gi("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`anchorOrigin${Oi(r.anchorOrigin.vertical)}${Oi(r.anchorOrigin.horizontal)}`]]}})(wi((e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:e=>{let{ownerState:t}=e;return"top"===t.anchorOrigin.vertical},style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:e=>{let{ownerState:t}=e;return"top"!==t.anchorOrigin.vertical},style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:e=>{let{ownerState:t}=e;return"left"===t.anchorOrigin.horizontal},style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:e=>{let{ownerState:t}=e;return"right"===t.anchorOrigin.horizontal},style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:e=>{let{ownerState:t}=e;return"center"===t.anchorOrigin.horizontal},style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}}))),r_=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiSnackbar"}),i=bi(),a={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:o,anchorOrigin:{vertical:l,horizontal:c}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:h,className:p,ClickAwayListenerProps:d,ContentProps:f,disableWindowBlurListener:m=!1,message:g,onBlur:y,onClose:v,onFocus:x,onMouseEnter:b,onMouseLeave:_,open:w,resumeHideDuration:k,slots:T={},slotProps:S={},TransitionComponent:A,transitionDuration:M=a,TransitionProps:{onEnter:E,onExited:C,...P}={},...L}=n,I={...n,anchorOrigin:{vertical:l,horizontal:c},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:A,transitionDuration:M},z=(e=>{const{classes:t,anchorOrigin:r}=e;return Wn({root:["root",`anchorOrigin${Oi(r.vertical)}${Oi(r.horizontal)}`]},e_,t)})(I),{getRootProps:O,onClickAway:R}=Wb({...I}),[D,j]=e.useState(!0),F={slots:{transition:A,...T},slotProps:{content:f,clickAwayListener:d,transition:P,...S}},[B,N]=Yi("root",{ref:r,className:[z.root,p],elementType:t_,getSlotProps:O,externalForwardedProps:{...F,...L},ownerState:I}),[U,{ownerState:V,...q}]=Yi("clickAwayListener",{elementType:Zb,externalForwardedProps:F,getSlotProps:e=>({onClickAway:function(){for(var t=arguments.length,r=new Array(t),n=0;n({onEnter:function(){for(var t=arguments.length,r=new Array(t),n=0;n{j(!1),E&&E(e,t)})(...r)},onExited:function(){for(var t=arguments.length,r=new Array(t),n=0;n{j(!0),C&&C(e)})(...r)}}),additionalProps:{appear:!0,in:w,timeout:M,direction:"top"===l?"down":"up"},ownerState:I});return!w&&D?null:(0,s.jsx)(U,{...q,...T.clickAwayListener&&{ownerState:V},children:(0,s.jsx)(B,{...N,children:(0,s.jsx)(W,{...$,children:h||(0,s.jsx)(H,{...G})})})})}));function n_(e){return Ai("MuiAlert",e)}const i_=Mi("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),a_=Bi((0,s.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),o_=Bi((0,s.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),s_=Bi((0,s.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),l_=Bi((0,s.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),c_=Bi((0,s.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),u_=gi(Pi,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${Oi(r.color||r.severity)}`]]}})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?Ar:Er,n="light"===t.palette.mode?Er:Ar;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(hl(["light"])).map((e=>{let[i]=e;return{props:{colorSeverity:i,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${i}Color`]:r(t.palette[i].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${i}StandardBg`]:n(t.palette[i].light,.9),[`& .${i_.icon}`]:t.vars?{color:t.vars.palette.Alert[`${i}IconColor`]}:{color:t.palette[i].main}}}})),...Object.entries(t.palette).filter(hl(["light"])).map((e=>{let[n]=e;return{props:{colorSeverity:n,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${n}Color`]:r(t.palette[n].light,.6),border:`1px solid ${(t.vars||t).palette[n].light}`,[`& .${i_.icon}`]:t.vars?{color:t.vars.palette.Alert[`${n}IconColor`]}:{color:t.palette[n].main}}}})),...Object.entries(t.palette).filter(hl(["dark"])).map((e=>{let[r]=e;return{props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:"dark"===t.palette.mode?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}}))]}}))),h_=gi("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),p_=gi("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),d_=gi("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),f_={success:(0,s.jsx)(a_,{fontSize:"inherit"}),warning:(0,s.jsx)(o_,{fontSize:"inherit"}),error:(0,s.jsx)(s_,{fontSize:"inherit"}),info:(0,s.jsx)(l_,{fontSize:"inherit"})},m_=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAlert"}),{action:n,children:i,className:a,closeText:o="Close",color:l,components:c={},componentsProps:u={},icon:h,iconMapping:p=f_,onClose:d,role:f="alert",severity:m="success",slotProps:g={},slots:y={},variant:v="standard",...x}=r,b={...r,color:l,severity:m,variant:v,colorSeverity:l||m},_=(e=>{const{variant:t,color:r,severity:n,classes:i}=e;return Wn({root:["root",`color${Oi(r||n)}`,`${t}${Oi(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},n_,i)})(b),w={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...y},slotProps:{...u,...g}},[k,T]=Yi("root",{ref:t,shouldForwardComponentProp:!0,className:Gn(_.root,a),elementType:u_,externalForwardedProps:{...w,...x},ownerState:b,additionalProps:{role:f,elevation:0}}),[S,A]=Yi("icon",{className:_.icon,elementType:h_,externalForwardedProps:w,ownerState:b}),[M,E]=Yi("message",{className:_.message,elementType:p_,externalForwardedProps:w,ownerState:b}),[C,P]=Yi("action",{className:_.action,elementType:d_,externalForwardedProps:w,ownerState:b}),[L,I]=Yi("closeButton",{elementType:dc,externalForwardedProps:w,ownerState:b}),[z,O]=Yi("closeIcon",{elementType:c_,externalForwardedProps:w,ownerState:b});return(0,s.jsxs)(k,{...T,children:[!1!==h?(0,s.jsx)(S,{...A,children:h||p[m]||f_[m]}):null,(0,s.jsx)(M,{...E,children:i}),null!=n?(0,s.jsx)(C,{...P,children:n}):null,null==n&&d?(0,s.jsx)(C,{...P,children:(0,s.jsx)(L,{size:"small","aria-label":o,title:o,color:"inherit",onClick:d,...I,children:(0,s.jsx)(z,{fontSize:"small",...O})})}):null]})})),g_=(0,e.forwardRef)(((t,r)=>{let{className:n,sx:i}=t;const[a,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(""),[u,h]=(0,e.useState)("success"),p=(0,e.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success";setTimeout((()=>{c(e),h(t),o(!0)}))}),[c,h,o]);(0,e.useImperativeHandle)(r,(()=>({setSnack:(e,t)=>{p(e,t)}})));const d=(e,t)=>{"clickaway"!==t&&o(!1)};return(0,s.jsx)(r_,{className:n||"Snack",sx:{...i},open:a,autoHideDuration:"success"===u||"info"===u?1500:6e3,onClose:d,children:(0,s.jsx)(m_,{onClose:d,severity:u,variant:"filled",sx:{width:"100%"},children:l})})}));function y_(e){return Ai("MuiAccordionActions",e)}Mi("MuiAccordionActions",["root","spacing"]);const v_=gi("div",{name:"MuiAccordionActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",variants:[{props:e=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),x_=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAccordionActions"}),{className:n,disableSpacing:i=!1,...a}=r,o={...r,disableSpacing:i},l=(e=>{const{classes:t,disableSpacing:r}=e;return Wn({root:["root",!r&&"spacing"]},y_,t)})(o);return(0,s.jsx)(v_,{className:Gn(l.root,n),ref:t,ownerState:o,...a})})),b_=t=>{let{systemInfo:r}=t;const[n,i]=(0,e.useState)([]),a=e=>e.replace(/\(R\)/g,"\xae").replace(/\(C\)/g,"\xa9").replace(/\(TM\)/g,"\u2122");return(0,e.useEffect)((()=>{if(void 0===r)return;const e=Object.entries(r).flatMap((e=>{let[t,r]=e;return Array.isArray(r)?r.map(((e,r)=>(0,s.jsxs)("div",{className:"SystemInfoItem",children:[(0,s.jsxs)("div",{children:[a(t)," ",r]}),(0,s.jsxs)("div",{children:[a(e.name)," ",e.discrete?`w/ ${Math.round(e.memory/1073741824)}GB RAM`:"(integrated)"]})]},r))):(0,s.jsxs)("div",{className:"SystemInfoItem",children:[(0,s.jsx)("div",{children:a(t)}),(0,s.jsx)("div",{children:a(String(r))})]},t)}));i(e)}),[r]),(0,s.jsx)("div",{className:"SystemInfo",children:n})},__=t=>{let{sessionId:r,setSnack:n,connectionBase:i}=t;const[a,o]=(0,e.useState)(""),[l,c]=(0,e.useState)(void 0),[u,h]=(0,e.useState)([]),[p,d]=(0,e.useState)([]),[f,m]=(0,e.useState)(""),[g,y]=(0,e.useState)(5),[v,x]=(0,e.useState)(void 0);(0,e.useEffect)((()=>{if(void 0===v||f===v.system_prompt||!f.trim()||void 0===r)return;(async e=>{try{const t=await fetch(i+`/api/tunables/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({system_prompt:e})}),a=await t.json();v.system_prompt=a.system_prompt,m(a.system_prompt),n("System prompt updated","success")}catch(t){console.error("Fetch error:",t),n("System prompt update failed","error")}})(f)}),[f,i,r,n,v]),(0,e.useEffect)((()=>{if(void 0===v||g===v.message_history_length||!g||void 0===r)return;(async e=>{try{const t=await fetch(i+`/api/tunables/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({message_history_length:e})}),a=(await t.json()).message_history_length;a!==g&&(y(a),n("Message history length updated","success"))}catch(t){console.error("Fetch error:",t),n("Message history length update failed","error")}})(g)}),[g,y,i,r,n,v]);(0,e.useEffect)((()=>{void 0===l&&void 0!==r&&fetch(i+`/api/system-info/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{c(e)})).catch((e=>{console.error("Error obtaining system information:",e),n("Unable to obtain system information.","error")}))}),[l,c,i,n,r]),(0,e.useEffect)((()=>{o(f.trim())}),[f,o]);(0,e.useEffect)((()=>{if(void 0!==v||void 0===r)return;(async()=>{const e=await fetch(i+`/api/tunables/${r}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}),t=await e.json();console.log("Server tunables: ",t),x(t),m(t.system_prompt),y(t.message_history_length),h(t.tools),d(t.rags)})()}),[r,i,x,m,y,v,h,d]);return(0,s.jsx)("div",{className:"Controls",children:(0,s.jsxs)(Jp,{children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsx)(jp,{component:"span",children:"System Information"})}),(0,s.jsx)(sd,{children:"The server is running on the following hardware:"}),(0,s.jsx)(x_,{children:(0,s.jsx)(b_,{systemInfo:l})})]})})};function w_(e){const{className:t,active:r,children:n,sx:i,...a}=e;return(0,s.jsx)(yc,{className:t||"BackstoryTab",sx:{display:r?"flex":"none",...i},...a,children:n})}const k_=()=>{const[t,r]=(0,e.useState)(void 0),[n]=(0,e.useState)((i=window.location).host.match(/.*battle-linux.*/)?i.protocol+"//battle-linux.ketrenos.com:8912":i.protocol+"//"+i.host);var i;const[a,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!1),[u,h]=(0,e.useState)(0),[p,d]=(0,e.useState)(""),f=qn("(min-width:650px)"),m=(0,e.useRef)(f),g=(0,e.useRef)(null),y=bi(),v=qn(y.breakpoints.down("md")),x=(0,e.useRef)(null);(0,e.useEffect)((()=>{m.current!==f&&(a&&o(!1),m.current=f)}),[f,o,a]);const b=(0,e.useCallback)(((e,t)=>{var r;null===(r=x.current)||void 0===r||r.setSnack(e,t)}),[x]);(0,e.useEffect)((()=>{if(""!==p)return;(async()=>{try{const e=await fetch("/docs/about.md",{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("/docs/about.md not found");const t=await e.text();d(t)}catch(e){console.error("Error obtaining About content information:",e),d("No information provided.")}})()}),[p,d]);const _=(e,t)=>{var r;console.log(`handleSubmitChatQuery: ${e} ${t||{}} -- `,g.current?" sending":"no handler"),null===(r=g.current)||void 0===r||r.submitQuery(e,t),h(0)},w=(0,e.useMemo)((()=>{const e=[{role:"content",title:"Welcome to Backstory",disableCopy:!0,content:"\n Backstory is a RAG enabled expert system with access to real-time data running self-hosted\n (no cloud) versions of industry leading Large and Small Language Models (LLM/SLMs).\n It was written by James Ketrenos in order to provide answers to\n questions potential employers may have about his work history.\n \n What would you like to know about James?\n "}],r=[(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:v?"column":"row"},children:[(0,s.jsx)(Pu,{prompt:"What is James Ketrenos' work history?",tunables:{enable_tools:!1},submitQuery:_}),(0,s.jsx)(Pu,{prompt:"What programming languages has James used?",tunables:{enable_tools:!1},submitQuery:_}),(0,s.jsx)(Pu,{prompt:"What are James' professional strengths?",tunables:{enable_tools:!1},submitQuery:_}),(0,s.jsx)(Pu,{prompt:"What are today's headlines on CNBC.com?",tunables:{enable_tools:!0,enable_rag:!1,enable_context:!1},submitQuery:_})]}),(0,s.jsx)(yc,{sx:{p:1},children:(0,s.jsx)(Vx,{children:"As with all LLM interactions, the results may not be 100% accurate. If you have questions about my career, I'd love to hear from you. You can send me an email at **james_backstory@ketrenos.com**."})})];return[{label:"",path:"",tabProps:{label:"Backstory",sx:{flexGrow:1,fontSize:"1rem"},icon:(0,s.jsx)(ea,{sx:{width:24,height:24},variant:"rounded",alt:"Backstory logo",src:"/logo192.png"}),iconPosition:"start"},children:(0,s.jsx)(xb,{sx:{maxWidth:"1024px",height:"calc(100vh - 72px)"},children:(0,s.jsx)(Hb,{ref:g,type:"chat",prompt:"What would you like to know about James?",resetLabel:"chat",sessionId:t,connectionBase:n,setSnack:b,preamble:e,defaultPrompts:r})})},{label:"Resume Builder",path:"resume-builder",children:(0,s.jsx)(Gb,{sx:{margin:"0 auto",height:"calc(100vh - 72px)",overflow:"auto",backgroundColor:"#F5F5F5",display:"flex",flexGrow:1},setSnack:b,connectionBase:n,sessionId:t})},{label:"Context Visualizer",path:"context-visualizer",children:(0,s.jsx)(xb,{sx:{maxWidth:"1024px",height:"calc(100vh - 72px)"},children:(0,s.jsx)(pb,{sx:{p:1},connectionBase:n,sessionId:t,setSnack:b})})},{label:"About",path:"about",children:(0,s.jsxs)(xb,{autoscroll:!1,sx:{maxWidth:"1024px",height:"calc(100vh - 72px)",flexDirection:"column",margin:"0 auto",p:1},children:[(0,s.jsx)(yb,{sx:{display:"flex",flexDirection:"column",p:1,m:0,flexGrow:0},message:{role:"content",title:"About Backstory",content:p},submitQuery:_,connectionBase:n,sessionId:t,setSnack:b}),(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1,p:0,m:0}})]})},{path:"settings",tabProps:{sx:{flexShrink:1,flexGrow:0,fontSize:"1rem"},icon:(0,s.jsx)(Jl,{})},children:(0,s.jsx)(xb,{autoscroll:!1,sx:{maxWidth:"1024px",height:"calc(100vh - 72px)",flexDirection:"column",margin:"0 auto",p:1},children:void 0!==t&&(0,s.jsx)(__,{sessionId:t,setSnack:b,connectionBase:n})})}]}),[p,n,t,b,v]);(0,e.useEffect)((()=>{const e=new URL(window.location.href).pathname.split("/").filter(Boolean);if(e.length<1)console.log("No session id or path -- creating new session"),(async()=>{try{const e=await fetch(n+"/api/context",{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("Server is temporarily down.");const t=await e.json();console.log(`Session created: ${t.id}`),r(t.id);const i=`/${t.id}`;window.history.replaceState({},"",i)}catch(e){console.error(e),b("Server is temporarily down","error")}})();else{const t=e.length<2?"":e[0],n=e.length<2?e[0]:e[1];let i=w.findIndex((e=>e.path===t));-1===i&&(console.log(`Invalid path "${t}" -- redirecting to default`),i=0),r(n),h(i)}}),[r,n,b,w]);const k=()=>{c(!0),o(!1)},T=(e,r)=>{if(r>w.length)return;h(r);const n=w[r].path;n?window.history.pushState({},"",`/${n}/${t}`):window.history.pushState({},"",`/${t}`),k()};(0,e.useEffect)((()=>{const e=()=>{const e=new URL(window.location.href).pathname.split("/").filter(Boolean),t=e.length<2?"":e[0],n=e.length<2?e[0]:e[1];let i=w.findIndex((e=>e.path===t));-1===i&&(console.log(`Invalid path "${t}" -- redirecting to default`),i=0),r(n),h(i)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}),[r,w]);const S=gi("div")((()=>({minHeight:"72px",height:"72px"})));return(0,s.jsxs)(yc,{className:"App",sx:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)(Mc,{}),(0,s.jsx)(ml,{position:"fixed",sx:{zIndex:e=>e.zIndex.drawer+1,maxWidth:"100vw"},children:(0,s.jsx)(Kl,{children:(0,s.jsxs)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"row"},children:[!f&&(0,s.jsxs)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"row"},children:[(0,s.jsx)(dc,{sx:{display:"flex",margin:"auto 0px"},size:"large",edge:"start",color:"inherit",onClick:()=>{l||o(!a)},children:(0,s.jsx)(ul,{title:"Navigation",children:(0,s.jsx)(Ec,{})})}),(0,s.jsx)(ul,{title:"Backstory",children:(0,s.jsxs)(yc,{sx:{m:1,gap:1,display:"flex",flexDirection:"row",alignItems:"center",fontWeight:"bold",fontSize:"1.0rem",cursor:"pointer"},onClick:()=>{h(0),o(!1)},children:[(0,s.jsx)(ea,{sx:{width:24,height:24},variant:"rounded",alt:"Backstory logo",src:"/logo192.png"}),"BACKSTORY"]})})]}),!1===a&&f&&(0,s.jsx)(so,{sx:{display:"flex",flexGrow:1},value:u,indicatorColor:"secondary",textColor:"inherit",variant:"fullWidth",allowScrollButtonsMobile:!0,onChange:T,"aria-label":"Backstory navigation",children:w.map(((e,t)=>(0,s.jsx)(ho,{value:t,label:e.label,...e.tabProps},t)))})]})})}),(0,s.jsx)(S,{}),(0,s.jsxs)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"column"},children:[(0,s.jsx)(yc,{component:"nav","aria-label":"mailbox folders",children:(0,s.jsxs)(Zl,{container:window.document.body,variant:"temporary",open:a,onTransitionEnd:()=>{c(!1)},onClose:k,sx:{display:"block","& .MuiDrawer-paper":{boxSizing:"border-box"}},slotProps:{root:{keepMounted:!0}},children:[(0,s.jsx)(Kl,{}),(0,s.jsx)(zi,{className:"MenuCard",children:(0,s.jsx)(so,{sx:{display:"flex",flexGrow:1},orientation:"vertical",value:u,indicatorColor:"secondary",textColor:"inherit",variant:"scrollable",allowScrollButtonsMobile:!0,onChange:T,"aria-label":"Backstory navigation",children:w.map(((e,t)=>(0,s.jsx)(ho,{value:t,label:e.label,...e.tabProps},t)))})})]})}),w.map(((e,t)=>(0,s.jsx)(w_,{active:t===u,children:e.children},t)))]}),(0,s.jsx)(g_,{ref:x})]})},T_=e=>{e&&e instanceof Function&&r.e(453).then(r.bind(r,453)).then((t=>{let{getCLS:r,getFID:n,getFCP:i,getLCP:a,getTTFB:o}=t;r(e),n(e),i(e),a(e),o(e)}))};n.createRoot(document.getElementById("root")).render((0,s.jsx)(e.StrictMode,{children:(0,s.jsx)(Dn,{theme:jn,children:(0,s.jsx)(k_,{})})})),T_()})()})(); //# sourceMappingURL=main.6f07f748.js.map