diff --git a/frontend-components/plotly/src/components/Chart.tsx b/frontend-components/plotly/src/components/Chart.tsx index 45de023275e..5c2fabb724a 100644 --- a/frontend-components/plotly/src/components/Chart.tsx +++ b/frontend-components/plotly/src/components/Chart.tsx @@ -632,28 +632,6 @@ function Chart({ if (theme !== "dark") { setChangeTheme(true); } - - const traceTypes = originalData.data.map( - (trace) => trace.type === "candlestick", - ); - if ( - (originalData.data[0]?.x !== undefined && - originalData.data[0]?.x.length <= 1000) || - !traceTypes.includes(true) - ) - return; - setModal({ - name: "alertDialog", - data: { - title: "Warning", - content: `Data has been truncated to 1000 points for performance reasons. - Please use the zoom tool to see more data.`, - }, - }); - const new_figure = CreateDataXrange(originalData); - setPlotData(new_figure); - setDateSliced(true); - setAutoScaling(true); } }, [plotLoaded]); diff --git a/openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly.html b/openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly.html index c12b8415a60..17723cf0b83 100644 --- a/openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly.html +++ b/openbb_platform/obbject_extensions/charting/openbb_charting/core/plotly.html @@ -41,7 +41,7 @@ function Y4(O,z){for(var W=0;WB)||I&&!v());){var V=w.callback;if(typeof V=="function"){w.callback=null,y=w.priorityLevel;var j=V(w.expirationTime<=B);B=O.unstable_now(),typeof j=="function"?w.callback=j:w===W(b)&&ce(b),s(B)}else ce(b);w=W(b)}if(w!==null)var $=!0;else{var ee=W(d);ee!==null&&E(c,ee.startTime-B),$=!1}return $}finally{w=null,y=N,_=!1}}var x=!1,m=null,g=-1,k=5,A=-1;function v(){return!(O.unstable_now()-AI||125V?(I.sortIndex=N,z(d,I),W(b)===null&&I===W(d)&&(r?(l(g),g=-1):r=!0,E(c,N-V))):(I.sortIndex=j,z(b,I),u||_||(u=!0,f(h))),I},O.unstable_shouldYield=v,O.unstable_wrapCallback=function(I){var B=y;return function(){var N=y;y=B;try{return I.apply(this,arguments)}finally{y=N}}}})(u6);l6.exports=u6;var RA=l6.exports;/** + */(function(O){function z(I,B){var N=I.length;I.push(B);e:for(;0>>1,j=I[V];if(0>>1;V<$;){var ee=2*(V+1)-1,H=I[ee],J=ee+1,Q=I[J];if(0>Te(H,N))JTe(Q,H)?(I[V]=Q,I[J]=N,V=J):(I[V]=H,I[ee]=N,V=ee);else if(JTe(Q,N))I[V]=Q,I[J]=N,V=J;else break e}}return B}function Te(I,B){var N=I.sortIndex-B.sortIndex;return N!==0?N:I.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var D=performance;O.unstable_now=function(){return D.now()}}else{var L=Date,t=L.now();O.unstable_now=function(){return L.now()-t}}var b=[],d=[],e=1,w=null,y=3,_=!1,u=!1,r=!1,n=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function s(I){for(var B=W(d);B!==null;){if(B.callback===null)ce(d);else if(B.startTime<=I)ce(d),B.sortIndex=B.expirationTime,z(b,B);else break;B=W(d)}}function c(I){if(r=!1,s(I),!u)if(W(b)!==null)u=!0,f(h);else{var B=W(d);B!==null&&E(c,B.startTime-I)}}function h(I,B){u=!1,r&&(r=!1,l(g),g=-1),_=!0;var N=y;try{for(s(B),w=W(b);w!==null&&(!(w.expirationTime>B)||I&&!v());){var V=w.callback;if(typeof V=="function"){w.callback=null,y=w.priorityLevel;var j=V(w.expirationTime<=B);B=O.unstable_now(),typeof j=="function"?w.callback=j:w===W(b)&&ce(b),s(B)}else ce(b);w=W(b)}if(w!==null)var $=!0;else{var ee=W(d);ee!==null&&E(c,ee.startTime-B),$=!1}return $}finally{w=null,y=N,_=!1}}var x=!1,m=null,g=-1,k=5,A=-1;function v(){return!(O.unstable_now()-AI||125V?(I.sortIndex=N,z(d,I),W(b)===null&&I===W(d)&&(r?(l(g),g=-1):r=!0,E(c,N-V))):(I.sortIndex=j,z(b,I),u||_||(u=!0,f(h))),I},O.unstable_shouldYield=v,O.unstable_wrapCallback=function(I){var B=y;return function(){var N=y;y=B;try{return I.apply(this,arguments)}finally{y=N}}}})(u6);l6.exports=u6;var DA=l6.exports;/** * @license React * react-dom.production.min.js * @@ -65,25 +65,25 @@ function Y4(O,z){for(var W=0;W"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),A2=Object.prototype.hasOwnProperty,BA=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g3={},m3={};function NA(O){return A2.call(m3,O)?!0:A2.call(g3,O)?!1:BA.test(O)?m3[O]=!0:(g3[O]=!0,!1)}function jA(O,z,W,ce){if(W!==null&&W.type===0)return!1;switch(typeof z){case"function":case"symbol":return!0;case"boolean":return ce?!1:W!==null?!W.acceptsBooleans:(O=O.toLowerCase().slice(0,5),O!=="data-"&&O!=="aria-");default:return!1}}function UA(O,z,W,ce){if(z===null||typeof z>"u"||jA(O,z,W,ce))return!0;if(ce)return!1;if(W!==null)switch(W.type){case 3:return!z;case 4:return z===!1;case 5:return isNaN(z);case 6:return isNaN(z)||1>z}return!1}function dh(O,z,W,ce,Te,D,L){this.acceptsBooleans=z===2||z===3||z===4,this.attributeName=ce,this.attributeNamespace=Te,this.mustUseProperty=W,this.propertyName=O,this.type=z,this.sanitizeURL=D,this.removeEmptyString=L}var Rc={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(O){Rc[O]=new dh(O,0,!1,O,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(O){var z=O[0];Rc[z]=new dh(z,1,!1,O[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(O){Rc[O]=new dh(O,2,!1,O.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(O){Rc[O]=new dh(O,2,!1,O,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(O){Rc[O]=new dh(O,3,!1,O.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(O){Rc[O]=new dh(O,3,!0,O,null,!1,!1)});["capture","download"].forEach(function(O){Rc[O]=new dh(O,4,!1,O,null,!1,!1)});["cols","rows","size","span"].forEach(function(O){Rc[O]=new dh(O,6,!1,O,null,!1,!1)});["rowSpan","start"].forEach(function(O){Rc[O]=new dh(O,5,!1,O.toLowerCase(),null,!1,!1)});var iw=/[\-:]([a-z])/g;function aw(O){return O[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(O){var z=O.replace(iw,aw);Rc[z]=new dh(z,1,!1,O,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(O){var z=O.replace(iw,aw);Rc[z]=new dh(z,1,!1,O,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(O){var z=O.replace(iw,aw);Rc[z]=new dh(z,1,!1,O,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(O){Rc[O]=new dh(O,1,!1,O.toLowerCase(),null,!1,!1)});Rc.xlinkHref=new dh("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(O){Rc[O]=new dh(O,1,!1,O.toLowerCase(),null,!0,!0)});function ow(O,z,W,ce){var Te=Rc.hasOwnProperty(z)?Rc[z]:null;(Te!==null?Te.type!==0:ce||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),A2=Object.prototype.hasOwnProperty,FA=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g3={},m3={};function BA(O){return A2.call(m3,O)?!0:A2.call(g3,O)?!1:FA.test(O)?m3[O]=!0:(g3[O]=!0,!1)}function NA(O,z,W,ce){if(W!==null&&W.type===0)return!1;switch(typeof z){case"function":case"symbol":return!0;case"boolean":return ce?!1:W!==null?!W.acceptsBooleans:(O=O.toLowerCase().slice(0,5),O!=="data-"&&O!=="aria-");default:return!1}}function jA(O,z,W,ce){if(z===null||typeof z>"u"||NA(O,z,W,ce))return!0;if(ce)return!1;if(W!==null)switch(W.type){case 3:return!z;case 4:return z===!1;case 5:return isNaN(z);case 6:return isNaN(z)||1>z}return!1}function dh(O,z,W,ce,Te,D,L){this.acceptsBooleans=z===2||z===3||z===4,this.attributeName=ce,this.attributeNamespace=Te,this.mustUseProperty=W,this.propertyName=O,this.type=z,this.sanitizeURL=D,this.removeEmptyString=L}var Rc={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(O){Rc[O]=new dh(O,0,!1,O,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(O){var z=O[0];Rc[z]=new dh(z,1,!1,O[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(O){Rc[O]=new dh(O,2,!1,O.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(O){Rc[O]=new dh(O,2,!1,O,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(O){Rc[O]=new dh(O,3,!1,O.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(O){Rc[O]=new dh(O,3,!0,O,null,!1,!1)});["capture","download"].forEach(function(O){Rc[O]=new dh(O,4,!1,O,null,!1,!1)});["cols","rows","size","span"].forEach(function(O){Rc[O]=new dh(O,6,!1,O,null,!1,!1)});["rowSpan","start"].forEach(function(O){Rc[O]=new dh(O,5,!1,O.toLowerCase(),null,!1,!1)});var iw=/[\-:]([a-z])/g;function aw(O){return O[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(O){var z=O.replace(iw,aw);Rc[z]=new dh(z,1,!1,O,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(O){var z=O.replace(iw,aw);Rc[z]=new dh(z,1,!1,O,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(O){var z=O.replace(iw,aw);Rc[z]=new dh(z,1,!1,O,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(O){Rc[O]=new dh(O,1,!1,O.toLowerCase(),null,!1,!1)});Rc.xlinkHref=new dh("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(O){Rc[O]=new dh(O,1,!1,O.toLowerCase(),null,!0,!0)});function ow(O,z,W,ce){var Te=Rc.hasOwnProperty(z)?Rc[z]:null;(Te!==null?Te.type!==0:ce||!(2t||Te[L]!==D[t]){var b=` -`+Te[L].replace(" at new "," at ");return O.displayName&&b.includes("")&&(b=b.replace("",O.displayName)),b}while(1<=L&&0<=t);break}}}finally{L_=!1,Error.prepareStackTrace=W}return(O=O?O.displayName||O.name:"")?Qv(O):""}function VA(O){switch(O.tag){case 5:return Qv(O.type);case 16:return Qv("Lazy");case 13:return Qv("Suspense");case 19:return Qv("SuspenseList");case 0:case 2:case 15:return O=z_(O.type,!1),O;case 11:return O=z_(O.type.render,!1),O;case 1:return O=z_(O.type,!0),O;default:return""}}function C2(O){if(O==null)return null;if(typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case zm:return"Fragment";case Lm:return"Portal";case S2:return"Profiler";case sw:return"StrictMode";case M2:return"Suspense";case E2:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case f6:return(O.displayName||"Context")+".Consumer";case h6:return(O._context.displayName||"Context")+".Provider";case lw:var z=O.render;return O=O.displayName,O||(O=z.displayName||z.name||"",O=O!==""?"ForwardRef("+O+")":"ForwardRef"),O;case uw:return z=O.displayName||null,z!==null?z:C2(O.type)||"Memo";case Kd:z=O._payload,O=O._init;try{return C2(O(z))}catch{}}return null}function qA(O){var z=O.type;switch(O.tag){case 24:return"Cache";case 9:return(z.displayName||"Context")+".Consumer";case 10:return(z._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return O=z.render,O=O.displayName||O.name||"",z.displayName||(O!==""?"ForwardRef("+O+")":"ForwardRef");case 7:return"Fragment";case 5:return z;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C2(z);case 8:return z===sw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z}return null}function _0(O){switch(typeof O){case"boolean":case"number":case"string":case"undefined":return O;case"object":return O;default:return""}}function d6(O){var z=O.type;return(O=O.nodeName)&&O.toLowerCase()==="input"&&(z==="checkbox"||z==="radio")}function HA(O){var z=d6(O)?"checked":"value",W=Object.getOwnPropertyDescriptor(O.constructor.prototype,z),ce=""+O[z];if(!O.hasOwnProperty(z)&&typeof W<"u"&&typeof W.get=="function"&&typeof W.set=="function"){var Te=W.get,D=W.set;return Object.defineProperty(O,z,{configurable:!0,get:function(){return Te.call(this)},set:function(L){ce=""+L,D.call(this,L)}}),Object.defineProperty(O,z,{enumerable:W.enumerable}),{getValue:function(){return ce},setValue:function(L){ce=""+L},stopTracking:function(){O._valueTracker=null,delete O[z]}}}}function gy(O){O._valueTracker||(O._valueTracker=HA(O))}function g6(O){if(!O)return!1;var z=O._valueTracker;if(!z)return!0;var W=z.getValue(),ce="";return O&&(ce=d6(O)?O.checked?"true":"false":O.value),O=ce,O!==W?(z.setValue(O),!0):!1}function ux(O){if(O=O||(typeof document<"u"?document:void 0),typeof O>"u")return null;try{return O.activeElement||O.body}catch{return O.body}}function I2(O,z){var W=z.checked;return gu({},z,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:W??O._wrapperState.initialChecked})}function y3(O,z){var W=z.defaultValue==null?"":z.defaultValue,ce=z.checked!=null?z.checked:z.defaultChecked;W=_0(z.value!=null?z.value:W),O._wrapperState={initialChecked:ce,initialValue:W,controlled:z.type==="checkbox"||z.type==="radio"?z.checked!=null:z.value!=null}}function m6(O,z){z=z.checked,z!=null&&ow(O,"checked",z,!1)}function P2(O,z){m6(O,z);var W=_0(z.value),ce=z.type;if(W!=null)ce==="number"?(W===0&&O.value===""||O.value!=W)&&(O.value=""+W):O.value!==""+W&&(O.value=""+W);else if(ce==="submit"||ce==="reset"){O.removeAttribute("value");return}z.hasOwnProperty("value")?L2(O,z.type,W):z.hasOwnProperty("defaultValue")&&L2(O,z.type,_0(z.defaultValue)),z.checked==null&&z.defaultChecked!=null&&(O.defaultChecked=!!z.defaultChecked)}function x3(O,z,W){if(z.hasOwnProperty("value")||z.hasOwnProperty("defaultValue")){var ce=z.type;if(!(ce!=="submit"&&ce!=="reset"||z.value!==void 0&&z.value!==null))return;z=""+O._wrapperState.initialValue,W||z===O.value||(O.value=z),O.defaultValue=z}W=O.name,W!==""&&(O.name=""),O.defaultChecked=!!O._wrapperState.initialChecked,W!==""&&(O.name=W)}function L2(O,z,W){(z!=="number"||ux(O.ownerDocument)!==O)&&(W==null?O.defaultValue=""+O._wrapperState.initialValue:O.defaultValue!==""+W&&(O.defaultValue=""+W))}var e1=Array.isArray;function Zm(O,z,W,ce){if(O=O.options,z){z={};for(var Te=0;Te"+z.valueOf().toString()+"",z=my.firstChild;O.firstChild;)O.removeChild(O.firstChild);for(;z.firstChild;)O.appendChild(z.firstChild)}});function k1(O,z){if(z){var W=O.firstChild;if(W&&W===O.lastChild&&W.nodeType===3){W.nodeValue=z;return}}O.textContent=z}var h1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},GA=["Webkit","ms","Moz","O"];Object.keys(h1).forEach(function(O){GA.forEach(function(z){z=z+O.charAt(0).toUpperCase()+O.substring(1),h1[z]=h1[O]})});function _6(O,z,W){return z==null||typeof z=="boolean"||z===""?"":W||typeof z!="number"||z===0||h1.hasOwnProperty(O)&&h1[O]?(""+z).trim():z+"px"}function b6(O,z){O=O.style;for(var W in z)if(z.hasOwnProperty(W)){var ce=W.indexOf("--")===0,Te=_6(W,z[W],ce);W==="float"&&(W="cssFloat"),ce?O.setProperty(W,Te):O[W]=Te}}var WA=gu({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function D2(O,z){if(z){if(WA[O]&&(z.children!=null||z.dangerouslySetInnerHTML!=null))throw Error(wi(137,O));if(z.dangerouslySetInnerHTML!=null){if(z.children!=null)throw Error(wi(60));if(typeof z.dangerouslySetInnerHTML!="object"||!("__html"in z.dangerouslySetInnerHTML))throw Error(wi(61))}if(z.style!=null&&typeof z.style!="object")throw Error(wi(62))}}function R2(O,z){if(O.indexOf("-")===-1)return typeof z.is=="string";switch(O){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var F2=null;function cw(O){return O=O.target||O.srcElement||window,O.correspondingUseElement&&(O=O.correspondingUseElement),O.nodeType===3?O.parentNode:O}var B2=null,$m=null,Ym=null;function w3(O){if(O=X1(O)){if(typeof B2!="function")throw Error(wi(280));var z=O.stateNode;z&&(z=r_(z),B2(O.stateNode,O.type,z))}}function w6(O){$m?Ym?Ym.push(O):Ym=[O]:$m=O}function T6(){if($m){var O=$m,z=Ym;if(Ym=$m=null,w3(O),z)for(O=0;O>>=0,O===0?32:31-(rS(O)/iS|0)|0}var vy=64,yy=4194304;function t1(O){switch(O&-O){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return O&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return O&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return O}}function px(O,z){var W=O.pendingLanes;if(W===0)return 0;var ce=0,Te=O.suspendedLanes,D=O.pingedLanes,L=W&268435455;if(L!==0){var t=L&~Te;t!==0?ce=t1(t):(D&=L,D!==0&&(ce=t1(D)))}else L=W&~Te,L!==0?ce=t1(L):D!==0&&(ce=t1(D));if(ce===0)return 0;if(z!==0&&z!==ce&&!(z&Te)&&(Te=ce&-ce,D=z&-z,Te>=D||Te===16&&(D&4194240)!==0))return z;if(ce&4&&(ce|=W&16),z=O.entangledLanes,z!==0)for(O=O.entanglements,z&=ce;0W;W++)z.push(O);return z}function $1(O,z,W){O.pendingLanes|=z,z!==536870912&&(O.suspendedLanes=0,O.pingedLanes=0),O=O.eventTimes,z=31-Kf(z),O[z]=W}function lS(O,z){var W=O.pendingLanes&~z;O.pendingLanes=z,O.suspendedLanes=0,O.pingedLanes=0,O.expiredLanes&=z,O.mutableReadLanes&=z,O.entangledLanes&=z,z=O.entanglements;var ce=O.eventTimes;for(O=O.expirationTimes;0=p1),P3=String.fromCharCode(32),L3=!1;function q6(O,z){switch(O){case"keyup":return RS.indexOf(z.keyCode)!==-1;case"keydown":return z.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H6(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var Om=!1;function BS(O,z){switch(O){case"compositionend":return H6(z);case"keypress":return z.which!==32?null:(L3=!0,P3);case"textInput":return O=z.data,O===P3&&L3?null:O;default:return null}}function NS(O,z){if(Om)return O==="compositionend"||!yw&&q6(O,z)?(O=U6(),$y=gw=n0=null,Om=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(z.ctrlKey||z.altKey||z.metaKey)||z.ctrlKey&&z.altKey){if(z.char&&1=z)return{node:W,offset:z-O};O=ce}e:{for(;W;){if(W.nextSibling){W=W.nextSibling;break e}W=W.parentNode}W=void 0}W=R3(W)}}function $6(O,z){return O&&z?O===z?!0:O&&O.nodeType===3?!1:z&&z.nodeType===3?$6(O,z.parentNode):"contains"in O?O.contains(z):O.compareDocumentPosition?!!(O.compareDocumentPosition(z)&16):!1:!1}function Y6(){for(var O=window,z=ux();z instanceof O.HTMLIFrameElement;){try{var W=typeof z.contentWindow.location.href=="string"}catch{W=!1}if(W)O=z.contentWindow;else break;z=ux(O.document)}return z}function xw(O){var z=O&&O.nodeName&&O.nodeName.toLowerCase();return z&&(z==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||z==="textarea"||O.contentEditable==="true")}function $S(O){var z=Y6(),W=O.focusedElem,ce=O.selectionRange;if(z!==W&&W&&W.ownerDocument&&$6(W.ownerDocument.documentElement,W)){if(ce!==null&&xw(W)){if(z=ce.start,O=ce.end,O===void 0&&(O=z),"selectionStart"in W)W.selectionStart=z,W.selectionEnd=Math.min(O,W.value.length);else if(O=(z=W.ownerDocument||document)&&z.defaultView||window,O.getSelection){O=O.getSelection();var Te=W.textContent.length,D=Math.min(ce.start,Te);ce=ce.end===void 0?D:Math.min(ce.end,Te),!O.extend&&D>ce&&(Te=ce,ce=D,D=Te),Te=F3(W,D);var L=F3(W,ce);Te&&L&&(O.rangeCount!==1||O.anchorNode!==Te.node||O.anchorOffset!==Te.offset||O.focusNode!==L.node||O.focusOffset!==L.offset)&&(z=z.createRange(),z.setStart(Te.node,Te.offset),O.removeAllRanges(),D>ce?(O.addRange(z),O.extend(L.node,L.offset)):(z.setEnd(L.node,L.offset),O.addRange(z)))}}for(z=[],O=W;O=O.parentNode;)O.nodeType===1&&z.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W=document.documentMode,Dm=null,H2=null,g1=null,G2=!1;function B3(O,z,W){var ce=W.window===W?W.document:W.nodeType===9?W:W.ownerDocument;G2||Dm==null||Dm!==ux(ce)||(ce=Dm,"selectionStart"in ce&&xw(ce)?ce={start:ce.selectionStart,end:ce.selectionEnd}:(ce=(ce.ownerDocument&&ce.ownerDocument.defaultView||window).getSelection(),ce={anchorNode:ce.anchorNode,anchorOffset:ce.anchorOffset,focusNode:ce.focusNode,focusOffset:ce.focusOffset}),g1&&I1(g1,ce)||(g1=ce,ce=mx(H2,"onSelect"),0Bm||(O.current=K2[Bm],K2[Bm]=null,Bm--)}function ml(O,z){Bm++,K2[Bm]=O.current,O.current=z}var b0={},Kc=T0(b0),Sh=T0(!1),Ig=b0;function iv(O,z){var W=O.type.contextTypes;if(!W)return b0;var ce=O.stateNode;if(ce&&ce.__reactInternalMemoizedUnmaskedChildContext===z)return ce.__reactInternalMemoizedMaskedChildContext;var Te={},D;for(D in W)Te[D]=z[D];return ce&&(O=O.stateNode,O.__reactInternalMemoizedUnmaskedChildContext=z,O.__reactInternalMemoizedMaskedChildContext=Te),Te}function Mh(O){return O=O.childContextTypes,O!=null}function yx(){Fl(Sh),Fl(Kc)}function G3(O,z,W){if(Kc.current!==b0)throw Error(wi(168));ml(Kc,z),ml(Sh,W)}function iT(O,z,W){var ce=O.stateNode;if(z=z.childContextTypes,typeof ce.getChildContext!="function")return W;ce=ce.getChildContext();for(var Te in ce)if(!(Te in z))throw Error(wi(108,qA(O)||"Unknown",Te));return gu({},W,ce)}function xx(O){return O=(O=O.stateNode)&&O.__reactInternalMemoizedMergedChildContext||b0,Ig=Kc.current,ml(Kc,O),ml(Sh,Sh.current),!0}function W3(O,z,W){var ce=O.stateNode;if(!ce)throw Error(wi(169));W?(O=iT(O,z,Ig),ce.__reactInternalMemoizedMergedChildContext=O,Fl(Sh),Fl(Kc),ml(Kc,O)):Fl(Sh),ml(Sh,W)}var rd=null,i_=!1,Z_=!1;function aT(O){rd===null?rd=[O]:rd.push(O)}function oM(O){i_=!0,aT(O)}function k0(){if(!Z_&&rd!==null){Z_=!0;var O=0,z=zs;try{var W=rd;for(zs=1;O>=L,Te-=L,od=1<<32-Kf(z)+Te|W<g?(k=m,m=null):k=m.sibling;var A=y(l,m,s[g],c);if(A===null){m===null&&(m=k);break}O&&m&&A.alternate===null&&z(l,m),o=D(A,o,g),x===null?h=A:x.sibling=A,x=A,m=k}if(g===s.length)return W(l,m),Jl&&yg(l,g),h;if(m===null){for(;gg?(k=m,m=null):k=m.sibling;var v=y(l,m,A.value,c);if(v===null){m===null&&(m=k);break}O&&m&&v.alternate===null&&z(l,m),o=D(v,o,g),x===null?h=v:x.sibling=v,x=v,m=k}if(A.done)return W(l,m),Jl&&yg(l,g),h;if(m===null){for(;!A.done;g++,A=s.next())A=w(l,A.value,c),A!==null&&(o=D(A,o,g),x===null?h=A:x.sibling=A,x=A);return Jl&&yg(l,g),h}for(m=ce(l,m);!A.done;g++,A=s.next())A=_(m,l,g,A.value,c),A!==null&&(O&&A.alternate!==null&&m.delete(A.key===null?g:A.key),o=D(A,o,g),x===null?h=A:x.sibling=A,x=A);return O&&m.forEach(function(S){return z(l,S)}),Jl&&yg(l,g),h}function n(l,o,s,c){if(typeof s=="object"&&s!==null&&s.type===zm&&s.key===null&&(s=s.props.children),typeof s=="object"&&s!==null){switch(s.$$typeof){case dy:e:{for(var h=s.key,x=o;x!==null;){if(x.key===h){if(h=s.type,h===zm){if(x.tag===7){W(l,x.sibling),o=Te(x,s.props.children),o.return=l,l=o;break e}}else if(x.elementType===h||typeof h=="object"&&h!==null&&h.$$typeof===Kd&&Y3(h)===x.type){W(l,x.sibling),o=Te(x,s.props),o.ref=Zv(l,x,s),o.return=l,l=o;break e}W(l,x);break}else z(l,x);x=x.sibling}s.type===zm?(o=Cg(s.props.children,l.mode,c,s.key),o.return=l,l=o):(c=nx(s.type,s.key,s.props,null,l.mode,c),c.ref=Zv(l,o,s),c.return=l,l=c)}return L(l);case Lm:e:{for(x=s.key;o!==null;){if(o.key===x)if(o.tag===4&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){W(l,o.sibling),o=Te(o,s.children||[]),o.return=l,l=o;break e}else{W(l,o);break}else z(l,o);o=o.sibling}o=t2(s,l.mode,c),o.return=l,l=o}return L(l);case Kd:return x=s._init,n(l,o,x(s._payload),c)}if(e1(s))return u(l,o,s,c);if(Vv(s))return r(l,o,s,c);Ay(l,s)}return typeof s=="string"&&s!==""||typeof s=="number"?(s=""+s,o!==null&&o.tag===6?(W(l,o.sibling),o=Te(o,s),o.return=l,l=o):(W(l,o),o=e2(s,l.mode,c),o.return=l,l=o),L(l)):W(l,o)}return n}var ov=uT(!0),cT=uT(!1),wx=T0(null),Tx=null,Um=null,Tw=null;function kw(){Tw=Um=Tx=null}function Aw(O){var z=wx.current;Fl(wx),O._currentValue=z}function eb(O,z,W){for(;O!==null;){var ce=O.alternate;if((O.childLanes&z)!==z?(O.childLanes|=z,ce!==null&&(ce.childLanes|=z)):ce!==null&&(ce.childLanes&z)!==z&&(ce.childLanes|=z),O===W)break;O=O.return}}function Km(O,z){Tx=O,Tw=Um=null,O=O.dependencies,O!==null&&O.firstContext!==null&&(O.lanes&z&&(kh=!0),O.firstContext=null)}function Sf(O){var z=O._currentValue;if(Tw!==O)if(O={context:O,memoizedValue:z,next:null},Um===null){if(Tx===null)throw Error(wi(308));Um=O,Tx.dependencies={lanes:0,firstContext:O}}else Um=Um.next=O;return z}var kg=null;function Sw(O){kg===null?kg=[O]:kg.push(O)}function hT(O,z,W,ce){var Te=z.interleaved;return Te===null?(W.next=W,Sw(z)):(W.next=Te.next,Te.next=W),z.interleaved=W,fd(O,ce)}function fd(O,z){O.lanes|=z;var W=O.alternate;for(W!==null&&(W.lanes|=z),W=O,O=O.return;O!==null;)O.childLanes|=z,W=O.alternate,W!==null&&(W.childLanes|=z),W=O,O=O.return;return W.tag===3?W.stateNode:null}var Jd=!1;function Mw(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fT(O,z){O=O.updateQueue,z.updateQueue===O&&(z.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,effects:O.effects})}function ld(O,z){return{eventTime:O,lane:z,tag:0,payload:null,callback:null,next:null}}function f0(O,z,W){var ce=O.updateQueue;if(ce===null)return null;if(ce=ce.shared,$o&2){var Te=ce.pending;return Te===null?z.next=z:(z.next=Te.next,Te.next=z),ce.pending=z,fd(O,W)}return Te=ce.interleaved,Te===null?(z.next=z,Sw(ce)):(z.next=Te.next,Te.next=z),ce.interleaved=z,fd(O,W)}function Xy(O,z,W){if(z=z.updateQueue,z!==null&&(z=z.shared,(W&4194240)!==0)){var ce=z.lanes;ce&=O.pendingLanes,W|=ce,z.lanes=W,fw(O,W)}}function X3(O,z){var W=O.updateQueue,ce=O.alternate;if(ce!==null&&(ce=ce.updateQueue,W===ce)){var Te=null,D=null;if(W=W.firstBaseUpdate,W!==null){do{var L={eventTime:W.eventTime,lane:W.lane,tag:W.tag,payload:W.payload,callback:W.callback,next:null};D===null?Te=D=L:D=D.next=L,W=W.next}while(W!==null);D===null?Te=D=z:D=D.next=z}else Te=D=z;W={baseState:ce.baseState,firstBaseUpdate:Te,lastBaseUpdate:D,shared:ce.shared,effects:ce.effects},O.updateQueue=W;return}O=W.lastBaseUpdate,O===null?W.firstBaseUpdate=z:O.next=z,W.lastBaseUpdate=z}function kx(O,z,W,ce){var Te=O.updateQueue;Jd=!1;var D=Te.firstBaseUpdate,L=Te.lastBaseUpdate,t=Te.shared.pending;if(t!==null){Te.shared.pending=null;var b=t,d=b.next;b.next=null,L===null?D=d:L.next=d,L=b;var e=O.alternate;e!==null&&(e=e.updateQueue,t=e.lastBaseUpdate,t!==L&&(t===null?e.firstBaseUpdate=d:t.next=d,e.lastBaseUpdate=b))}if(D!==null){var w=Te.baseState;L=0,e=d=b=null,t=D;do{var y=t.lane,_=t.eventTime;if((ce&y)===y){e!==null&&(e=e.next={eventTime:_,lane:0,tag:t.tag,payload:t.payload,callback:t.callback,next:null});e:{var u=O,r=t;switch(y=z,_=W,r.tag){case 1:if(u=r.payload,typeof u=="function"){w=u.call(_,w,y);break e}w=u;break e;case 3:u.flags=u.flags&-65537|128;case 0:if(u=r.payload,y=typeof u=="function"?u.call(_,w,y):u,y==null)break e;w=gu({},w,y);break e;case 2:Jd=!0}}t.callback!==null&&t.lane!==0&&(O.flags|=64,y=Te.effects,y===null?Te.effects=[t]:y.push(t))}else _={eventTime:_,lane:y,tag:t.tag,payload:t.payload,callback:t.callback,next:null},e===null?(d=e=_,b=w):e=e.next=_,L|=y;if(t=t.next,t===null){if(t=Te.shared.pending,t===null)break;y=t,t=y.next,y.next=null,Te.lastBaseUpdate=y,Te.shared.pending=null}}while(1);if(e===null&&(b=w),Te.baseState=b,Te.firstBaseUpdate=d,Te.lastBaseUpdate=e,z=Te.shared.interleaved,z!==null){Te=z;do L|=Te.lane,Te=Te.next;while(Te!==z)}else D===null&&(Te.shared.lanes=0);zg|=L,O.lanes=L,O.memoizedState=w}}function K3(O,z,W){if(O=z.effects,z.effects=null,O!==null)for(z=0;zW?W:4,O(!0);var ce=Y_.transition;Y_.transition={};try{O(!1),z()}finally{zs=W,Y_.transition=ce}}function CT(){return Mf().memoizedState}function cM(O,z,W){var ce=d0(O);if(W={lane:ce,action:W,hasEagerState:!1,eagerState:null,next:null},IT(O))PT(z,W);else if(W=hT(O,z,W,ce),W!==null){var Te=fh();Jf(W,O,ce,Te),LT(W,z,ce)}}function hM(O,z,W){var ce=d0(O),Te={lane:ce,action:W,hasEagerState:!1,eagerState:null,next:null};if(IT(O))PT(z,Te);else{var D=O.alternate;if(O.lanes===0&&(D===null||D.lanes===0)&&(D=z.lastRenderedReducer,D!==null))try{var L=z.lastRenderedState,t=D(L,W);if(Te.hasEagerState=!0,Te.eagerState=t,Qf(t,L)){var b=z.interleaved;b===null?(Te.next=Te,Sw(z)):(Te.next=b.next,b.next=Te),z.interleaved=Te;return}}catch{}finally{}W=hT(O,z,Te,ce),W!==null&&(Te=fh(),Jf(W,O,ce,Te),LT(W,z,ce))}}function IT(O){var z=O.alternate;return O===du||z!==null&&z===du}function PT(O,z){m1=Sx=!0;var W=O.pending;W===null?z.next=z:(z.next=W.next,W.next=z),O.pending=z}function LT(O,z,W){if(W&4194240){var ce=z.lanes;ce&=O.pendingLanes,W|=ce,z.lanes=W,fw(O,W)}}var Mx={readContext:Sf,useCallback:Gc,useContext:Gc,useEffect:Gc,useImperativeHandle:Gc,useInsertionEffect:Gc,useLayoutEffect:Gc,useMemo:Gc,useReducer:Gc,useRef:Gc,useState:Gc,useDebugValue:Gc,useDeferredValue:Gc,useTransition:Gc,useMutableSource:Gc,useSyncExternalStore:Gc,useId:Gc,unstable_isNewReconciler:!1},fM={readContext:Sf,useCallback:function(O,z){return mp().memoizedState=[O,z===void 0?null:z],O},useContext:Sf,useEffect:Q3,useImperativeHandle:function(O,z,W){return W=W!=null?W.concat([O]):null,Jy(4194308,4,kT.bind(null,z,O),W)},useLayoutEffect:function(O,z){return Jy(4194308,4,O,z)},useInsertionEffect:function(O,z){return Jy(4,2,O,z)},useMemo:function(O,z){var W=mp();return z=z===void 0?null:z,O=O(),W.memoizedState=[O,z],O},useReducer:function(O,z,W){var ce=mp();return z=W!==void 0?W(z):z,ce.memoizedState=ce.baseState=z,O={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:z},ce.queue=O,O=O.dispatch=cM.bind(null,du,O),[ce.memoizedState,O]},useRef:function(O){var z=mp();return O={current:O},z.memoizedState=O},useState:J3,useDebugValue:Dw,useDeferredValue:function(O){return mp().memoizedState=O},useTransition:function(){var O=J3(!1),z=O[0];return O=uM.bind(null,O[1]),mp().memoizedState=O,[z,O]},useMutableSource:function(){},useSyncExternalStore:function(O,z,W){var ce=du,Te=mp();if(Jl){if(W===void 0)throw Error(wi(407));W=W()}else{if(W=z(),kc===null)throw Error(wi(349));Lg&30||mT(ce,z,W)}Te.memoizedState=W;var D={value:W,getSnapshot:z};return Te.queue=D,Q3(yT.bind(null,ce,D,O),[O]),ce.flags|=2048,B1(9,vT.bind(null,ce,D,W,z),void 0,null),W},useId:function(){var O=mp(),z=kc.identifierPrefix;if(Jl){var W=sd,ce=od;W=(ce&~(1<<32-Kf(ce)-1)).toString(32)+W,z=":"+z+"R"+W,W=R1++,0")&&(b=b.replace("",O.displayName)),b}while(1<=L&&0<=t);break}}}finally{L_=!1,Error.prepareStackTrace=W}return(O=O?O.displayName||O.name:"")?Qv(O):""}function UA(O){switch(O.tag){case 5:return Qv(O.type);case 16:return Qv("Lazy");case 13:return Qv("Suspense");case 19:return Qv("SuspenseList");case 0:case 2:case 15:return O=z_(O.type,!1),O;case 11:return O=z_(O.type.render,!1),O;case 1:return O=z_(O.type,!0),O;default:return""}}function C2(O){if(O==null)return null;if(typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case zm:return"Fragment";case Lm:return"Portal";case S2:return"Profiler";case sw:return"StrictMode";case M2:return"Suspense";case E2:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case f6:return(O.displayName||"Context")+".Consumer";case h6:return(O._context.displayName||"Context")+".Provider";case lw:var z=O.render;return O=O.displayName,O||(O=z.displayName||z.name||"",O=O!==""?"ForwardRef("+O+")":"ForwardRef"),O;case uw:return z=O.displayName||null,z!==null?z:C2(O.type)||"Memo";case Kd:z=O._payload,O=O._init;try{return C2(O(z))}catch{}}return null}function VA(O){var z=O.type;switch(O.tag){case 24:return"Cache";case 9:return(z.displayName||"Context")+".Consumer";case 10:return(z._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return O=z.render,O=O.displayName||O.name||"",z.displayName||(O!==""?"ForwardRef("+O+")":"ForwardRef");case 7:return"Fragment";case 5:return z;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return C2(z);case 8:return z===sw?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof z=="function")return z.displayName||z.name||null;if(typeof z=="string")return z}return null}function _0(O){switch(typeof O){case"boolean":case"number":case"string":case"undefined":return O;case"object":return O;default:return""}}function d6(O){var z=O.type;return(O=O.nodeName)&&O.toLowerCase()==="input"&&(z==="checkbox"||z==="radio")}function qA(O){var z=d6(O)?"checked":"value",W=Object.getOwnPropertyDescriptor(O.constructor.prototype,z),ce=""+O[z];if(!O.hasOwnProperty(z)&&typeof W<"u"&&typeof W.get=="function"&&typeof W.set=="function"){var Te=W.get,D=W.set;return Object.defineProperty(O,z,{configurable:!0,get:function(){return Te.call(this)},set:function(L){ce=""+L,D.call(this,L)}}),Object.defineProperty(O,z,{enumerable:W.enumerable}),{getValue:function(){return ce},setValue:function(L){ce=""+L},stopTracking:function(){O._valueTracker=null,delete O[z]}}}}function gy(O){O._valueTracker||(O._valueTracker=qA(O))}function g6(O){if(!O)return!1;var z=O._valueTracker;if(!z)return!0;var W=z.getValue(),ce="";return O&&(ce=d6(O)?O.checked?"true":"false":O.value),O=ce,O!==W?(z.setValue(O),!0):!1}function ux(O){if(O=O||(typeof document<"u"?document:void 0),typeof O>"u")return null;try{return O.activeElement||O.body}catch{return O.body}}function I2(O,z){var W=z.checked;return gu({},z,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:W??O._wrapperState.initialChecked})}function y3(O,z){var W=z.defaultValue==null?"":z.defaultValue,ce=z.checked!=null?z.checked:z.defaultChecked;W=_0(z.value!=null?z.value:W),O._wrapperState={initialChecked:ce,initialValue:W,controlled:z.type==="checkbox"||z.type==="radio"?z.checked!=null:z.value!=null}}function m6(O,z){z=z.checked,z!=null&&ow(O,"checked",z,!1)}function P2(O,z){m6(O,z);var W=_0(z.value),ce=z.type;if(W!=null)ce==="number"?(W===0&&O.value===""||O.value!=W)&&(O.value=""+W):O.value!==""+W&&(O.value=""+W);else if(ce==="submit"||ce==="reset"){O.removeAttribute("value");return}z.hasOwnProperty("value")?L2(O,z.type,W):z.hasOwnProperty("defaultValue")&&L2(O,z.type,_0(z.defaultValue)),z.checked==null&&z.defaultChecked!=null&&(O.defaultChecked=!!z.defaultChecked)}function x3(O,z,W){if(z.hasOwnProperty("value")||z.hasOwnProperty("defaultValue")){var ce=z.type;if(!(ce!=="submit"&&ce!=="reset"||z.value!==void 0&&z.value!==null))return;z=""+O._wrapperState.initialValue,W||z===O.value||(O.value=z),O.defaultValue=z}W=O.name,W!==""&&(O.name=""),O.defaultChecked=!!O._wrapperState.initialChecked,W!==""&&(O.name=W)}function L2(O,z,W){(z!=="number"||ux(O.ownerDocument)!==O)&&(W==null?O.defaultValue=""+O._wrapperState.initialValue:O.defaultValue!==""+W&&(O.defaultValue=""+W))}var e1=Array.isArray;function Zm(O,z,W,ce){if(O=O.options,z){z={};for(var Te=0;Te"+z.valueOf().toString()+"",z=my.firstChild;O.firstChild;)O.removeChild(O.firstChild);for(;z.firstChild;)O.appendChild(z.firstChild)}});function k1(O,z){if(z){var W=O.firstChild;if(W&&W===O.lastChild&&W.nodeType===3){W.nodeValue=z;return}}O.textContent=z}var h1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},HA=["Webkit","ms","Moz","O"];Object.keys(h1).forEach(function(O){HA.forEach(function(z){z=z+O.charAt(0).toUpperCase()+O.substring(1),h1[z]=h1[O]})});function _6(O,z,W){return z==null||typeof z=="boolean"||z===""?"":W||typeof z!="number"||z===0||h1.hasOwnProperty(O)&&h1[O]?(""+z).trim():z+"px"}function b6(O,z){O=O.style;for(var W in z)if(z.hasOwnProperty(W)){var ce=W.indexOf("--")===0,Te=_6(W,z[W],ce);W==="float"&&(W="cssFloat"),ce?O.setProperty(W,Te):O[W]=Te}}var GA=gu({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function D2(O,z){if(z){if(GA[O]&&(z.children!=null||z.dangerouslySetInnerHTML!=null))throw Error(wi(137,O));if(z.dangerouslySetInnerHTML!=null){if(z.children!=null)throw Error(wi(60));if(typeof z.dangerouslySetInnerHTML!="object"||!("__html"in z.dangerouslySetInnerHTML))throw Error(wi(61))}if(z.style!=null&&typeof z.style!="object")throw Error(wi(62))}}function R2(O,z){if(O.indexOf("-")===-1)return typeof z.is=="string";switch(O){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var F2=null;function cw(O){return O=O.target||O.srcElement||window,O.correspondingUseElement&&(O=O.correspondingUseElement),O.nodeType===3?O.parentNode:O}var B2=null,$m=null,Ym=null;function w3(O){if(O=X1(O)){if(typeof B2!="function")throw Error(wi(280));var z=O.stateNode;z&&(z=r_(z),B2(O.stateNode,O.type,z))}}function w6(O){$m?Ym?Ym.push(O):Ym=[O]:$m=O}function T6(){if($m){var O=$m,z=Ym;if(Ym=$m=null,w3(O),z)for(O=0;O>>=0,O===0?32:31-(nS(O)/rS|0)|0}var vy=64,yy=4194304;function t1(O){switch(O&-O){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return O&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return O&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return O}}function px(O,z){var W=O.pendingLanes;if(W===0)return 0;var ce=0,Te=O.suspendedLanes,D=O.pingedLanes,L=W&268435455;if(L!==0){var t=L&~Te;t!==0?ce=t1(t):(D&=L,D!==0&&(ce=t1(D)))}else L=W&~Te,L!==0?ce=t1(L):D!==0&&(ce=t1(D));if(ce===0)return 0;if(z!==0&&z!==ce&&!(z&Te)&&(Te=ce&-ce,D=z&-z,Te>=D||Te===16&&(D&4194240)!==0))return z;if(ce&4&&(ce|=W&16),z=O.entangledLanes,z!==0)for(O=O.entanglements,z&=ce;0W;W++)z.push(O);return z}function $1(O,z,W){O.pendingLanes|=z,z!==536870912&&(O.suspendedLanes=0,O.pingedLanes=0),O=O.eventTimes,z=31-Kf(z),O[z]=W}function sS(O,z){var W=O.pendingLanes&~z;O.pendingLanes=z,O.suspendedLanes=0,O.pingedLanes=0,O.expiredLanes&=z,O.mutableReadLanes&=z,O.entangledLanes&=z,z=O.entanglements;var ce=O.eventTimes;for(O=O.expirationTimes;0=p1),P3=String.fromCharCode(32),L3=!1;function q6(O,z){switch(O){case"keyup":return DS.indexOf(z.keyCode)!==-1;case"keydown":return z.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function H6(O){return O=O.detail,typeof O=="object"&&"data"in O?O.data:null}var Om=!1;function FS(O,z){switch(O){case"compositionend":return H6(z);case"keypress":return z.which!==32?null:(L3=!0,P3);case"textInput":return O=z.data,O===P3&&L3?null:O;default:return null}}function BS(O,z){if(Om)return O==="compositionend"||!yw&&q6(O,z)?(O=U6(),$y=gw=n0=null,Om=!1,O):null;switch(O){case"paste":return null;case"keypress":if(!(z.ctrlKey||z.altKey||z.metaKey)||z.ctrlKey&&z.altKey){if(z.char&&1=z)return{node:W,offset:z-O};O=ce}e:{for(;W;){if(W.nextSibling){W=W.nextSibling;break e}W=W.parentNode}W=void 0}W=R3(W)}}function $6(O,z){return O&&z?O===z?!0:O&&O.nodeType===3?!1:z&&z.nodeType===3?$6(O,z.parentNode):"contains"in O?O.contains(z):O.compareDocumentPosition?!!(O.compareDocumentPosition(z)&16):!1:!1}function Y6(){for(var O=window,z=ux();z instanceof O.HTMLIFrameElement;){try{var W=typeof z.contentWindow.location.href=="string"}catch{W=!1}if(W)O=z.contentWindow;else break;z=ux(O.document)}return z}function xw(O){var z=O&&O.nodeName&&O.nodeName.toLowerCase();return z&&(z==="input"&&(O.type==="text"||O.type==="search"||O.type==="tel"||O.type==="url"||O.type==="password")||z==="textarea"||O.contentEditable==="true")}function ZS(O){var z=Y6(),W=O.focusedElem,ce=O.selectionRange;if(z!==W&&W&&W.ownerDocument&&$6(W.ownerDocument.documentElement,W)){if(ce!==null&&xw(W)){if(z=ce.start,O=ce.end,O===void 0&&(O=z),"selectionStart"in W)W.selectionStart=z,W.selectionEnd=Math.min(O,W.value.length);else if(O=(z=W.ownerDocument||document)&&z.defaultView||window,O.getSelection){O=O.getSelection();var Te=W.textContent.length,D=Math.min(ce.start,Te);ce=ce.end===void 0?D:Math.min(ce.end,Te),!O.extend&&D>ce&&(Te=ce,ce=D,D=Te),Te=F3(W,D);var L=F3(W,ce);Te&&L&&(O.rangeCount!==1||O.anchorNode!==Te.node||O.anchorOffset!==Te.offset||O.focusNode!==L.node||O.focusOffset!==L.offset)&&(z=z.createRange(),z.setStart(Te.node,Te.offset),O.removeAllRanges(),D>ce?(O.addRange(z),O.extend(L.node,L.offset)):(z.setEnd(L.node,L.offset),O.addRange(z)))}}for(z=[],O=W;O=O.parentNode;)O.nodeType===1&&z.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W=document.documentMode,Dm=null,H2=null,g1=null,G2=!1;function B3(O,z,W){var ce=W.window===W?W.document:W.nodeType===9?W:W.ownerDocument;G2||Dm==null||Dm!==ux(ce)||(ce=Dm,"selectionStart"in ce&&xw(ce)?ce={start:ce.selectionStart,end:ce.selectionEnd}:(ce=(ce.ownerDocument&&ce.ownerDocument.defaultView||window).getSelection(),ce={anchorNode:ce.anchorNode,anchorOffset:ce.anchorOffset,focusNode:ce.focusNode,focusOffset:ce.focusOffset}),g1&&I1(g1,ce)||(g1=ce,ce=mx(H2,"onSelect"),0Bm||(O.current=K2[Bm],K2[Bm]=null,Bm--)}function ml(O,z){Bm++,K2[Bm]=O.current,O.current=z}var b0={},Kc=T0(b0),Sh=T0(!1),Ig=b0;function iv(O,z){var W=O.type.contextTypes;if(!W)return b0;var ce=O.stateNode;if(ce&&ce.__reactInternalMemoizedUnmaskedChildContext===z)return ce.__reactInternalMemoizedMaskedChildContext;var Te={},D;for(D in W)Te[D]=z[D];return ce&&(O=O.stateNode,O.__reactInternalMemoizedUnmaskedChildContext=z,O.__reactInternalMemoizedMaskedChildContext=Te),Te}function Mh(O){return O=O.childContextTypes,O!=null}function yx(){Fl(Sh),Fl(Kc)}function G3(O,z,W){if(Kc.current!==b0)throw Error(wi(168));ml(Kc,z),ml(Sh,W)}function iT(O,z,W){var ce=O.stateNode;if(z=z.childContextTypes,typeof ce.getChildContext!="function")return W;ce=ce.getChildContext();for(var Te in ce)if(!(Te in z))throw Error(wi(108,VA(O)||"Unknown",Te));return gu({},W,ce)}function xx(O){return O=(O=O.stateNode)&&O.__reactInternalMemoizedMergedChildContext||b0,Ig=Kc.current,ml(Kc,O),ml(Sh,Sh.current),!0}function W3(O,z,W){var ce=O.stateNode;if(!ce)throw Error(wi(169));W?(O=iT(O,z,Ig),ce.__reactInternalMemoizedMergedChildContext=O,Fl(Sh),Fl(Kc),ml(Kc,O)):Fl(Sh),ml(Sh,W)}var rd=null,i_=!1,Z_=!1;function aT(O){rd===null?rd=[O]:rd.push(O)}function aM(O){i_=!0,aT(O)}function k0(){if(!Z_&&rd!==null){Z_=!0;var O=0,z=zs;try{var W=rd;for(zs=1;O>=L,Te-=L,od=1<<32-Kf(z)+Te|W<g?(k=m,m=null):k=m.sibling;var A=y(l,m,s[g],c);if(A===null){m===null&&(m=k);break}O&&m&&A.alternate===null&&z(l,m),o=D(A,o,g),x===null?h=A:x.sibling=A,x=A,m=k}if(g===s.length)return W(l,m),Jl&&yg(l,g),h;if(m===null){for(;gg?(k=m,m=null):k=m.sibling;var v=y(l,m,A.value,c);if(v===null){m===null&&(m=k);break}O&&m&&v.alternate===null&&z(l,m),o=D(v,o,g),x===null?h=v:x.sibling=v,x=v,m=k}if(A.done)return W(l,m),Jl&&yg(l,g),h;if(m===null){for(;!A.done;g++,A=s.next())A=w(l,A.value,c),A!==null&&(o=D(A,o,g),x===null?h=A:x.sibling=A,x=A);return Jl&&yg(l,g),h}for(m=ce(l,m);!A.done;g++,A=s.next())A=_(m,l,g,A.value,c),A!==null&&(O&&A.alternate!==null&&m.delete(A.key===null?g:A.key),o=D(A,o,g),x===null?h=A:x.sibling=A,x=A);return O&&m.forEach(function(S){return z(l,S)}),Jl&&yg(l,g),h}function n(l,o,s,c){if(typeof s=="object"&&s!==null&&s.type===zm&&s.key===null&&(s=s.props.children),typeof s=="object"&&s!==null){switch(s.$$typeof){case dy:e:{for(var h=s.key,x=o;x!==null;){if(x.key===h){if(h=s.type,h===zm){if(x.tag===7){W(l,x.sibling),o=Te(x,s.props.children),o.return=l,l=o;break e}}else if(x.elementType===h||typeof h=="object"&&h!==null&&h.$$typeof===Kd&&Y3(h)===x.type){W(l,x.sibling),o=Te(x,s.props),o.ref=Zv(l,x,s),o.return=l,l=o;break e}W(l,x);break}else z(l,x);x=x.sibling}s.type===zm?(o=Cg(s.props.children,l.mode,c,s.key),o.return=l,l=o):(c=nx(s.type,s.key,s.props,null,l.mode,c),c.ref=Zv(l,o,s),c.return=l,l=c)}return L(l);case Lm:e:{for(x=s.key;o!==null;){if(o.key===x)if(o.tag===4&&o.stateNode.containerInfo===s.containerInfo&&o.stateNode.implementation===s.implementation){W(l,o.sibling),o=Te(o,s.children||[]),o.return=l,l=o;break e}else{W(l,o);break}else z(l,o);o=o.sibling}o=t2(s,l.mode,c),o.return=l,l=o}return L(l);case Kd:return x=s._init,n(l,o,x(s._payload),c)}if(e1(s))return u(l,o,s,c);if(Vv(s))return r(l,o,s,c);Ay(l,s)}return typeof s=="string"&&s!==""||typeof s=="number"?(s=""+s,o!==null&&o.tag===6?(W(l,o.sibling),o=Te(o,s),o.return=l,l=o):(W(l,o),o=e2(s,l.mode,c),o.return=l,l=o),L(l)):W(l,o)}return n}var ov=uT(!0),cT=uT(!1),wx=T0(null),Tx=null,Um=null,Tw=null;function kw(){Tw=Um=Tx=null}function Aw(O){var z=wx.current;Fl(wx),O._currentValue=z}function eb(O,z,W){for(;O!==null;){var ce=O.alternate;if((O.childLanes&z)!==z?(O.childLanes|=z,ce!==null&&(ce.childLanes|=z)):ce!==null&&(ce.childLanes&z)!==z&&(ce.childLanes|=z),O===W)break;O=O.return}}function Km(O,z){Tx=O,Tw=Um=null,O=O.dependencies,O!==null&&O.firstContext!==null&&(O.lanes&z&&(kh=!0),O.firstContext=null)}function Sf(O){var z=O._currentValue;if(Tw!==O)if(O={context:O,memoizedValue:z,next:null},Um===null){if(Tx===null)throw Error(wi(308));Um=O,Tx.dependencies={lanes:0,firstContext:O}}else Um=Um.next=O;return z}var kg=null;function Sw(O){kg===null?kg=[O]:kg.push(O)}function hT(O,z,W,ce){var Te=z.interleaved;return Te===null?(W.next=W,Sw(z)):(W.next=Te.next,Te.next=W),z.interleaved=W,fd(O,ce)}function fd(O,z){O.lanes|=z;var W=O.alternate;for(W!==null&&(W.lanes|=z),W=O,O=O.return;O!==null;)O.childLanes|=z,W=O.alternate,W!==null&&(W.childLanes|=z),W=O,O=O.return;return W.tag===3?W.stateNode:null}var Jd=!1;function Mw(O){O.updateQueue={baseState:O.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fT(O,z){O=O.updateQueue,z.updateQueue===O&&(z.updateQueue={baseState:O.baseState,firstBaseUpdate:O.firstBaseUpdate,lastBaseUpdate:O.lastBaseUpdate,shared:O.shared,effects:O.effects})}function ld(O,z){return{eventTime:O,lane:z,tag:0,payload:null,callback:null,next:null}}function f0(O,z,W){var ce=O.updateQueue;if(ce===null)return null;if(ce=ce.shared,$o&2){var Te=ce.pending;return Te===null?z.next=z:(z.next=Te.next,Te.next=z),ce.pending=z,fd(O,W)}return Te=ce.interleaved,Te===null?(z.next=z,Sw(ce)):(z.next=Te.next,Te.next=z),ce.interleaved=z,fd(O,W)}function Xy(O,z,W){if(z=z.updateQueue,z!==null&&(z=z.shared,(W&4194240)!==0)){var ce=z.lanes;ce&=O.pendingLanes,W|=ce,z.lanes=W,fw(O,W)}}function X3(O,z){var W=O.updateQueue,ce=O.alternate;if(ce!==null&&(ce=ce.updateQueue,W===ce)){var Te=null,D=null;if(W=W.firstBaseUpdate,W!==null){do{var L={eventTime:W.eventTime,lane:W.lane,tag:W.tag,payload:W.payload,callback:W.callback,next:null};D===null?Te=D=L:D=D.next=L,W=W.next}while(W!==null);D===null?Te=D=z:D=D.next=z}else Te=D=z;W={baseState:ce.baseState,firstBaseUpdate:Te,lastBaseUpdate:D,shared:ce.shared,effects:ce.effects},O.updateQueue=W;return}O=W.lastBaseUpdate,O===null?W.firstBaseUpdate=z:O.next=z,W.lastBaseUpdate=z}function kx(O,z,W,ce){var Te=O.updateQueue;Jd=!1;var D=Te.firstBaseUpdate,L=Te.lastBaseUpdate,t=Te.shared.pending;if(t!==null){Te.shared.pending=null;var b=t,d=b.next;b.next=null,L===null?D=d:L.next=d,L=b;var e=O.alternate;e!==null&&(e=e.updateQueue,t=e.lastBaseUpdate,t!==L&&(t===null?e.firstBaseUpdate=d:t.next=d,e.lastBaseUpdate=b))}if(D!==null){var w=Te.baseState;L=0,e=d=b=null,t=D;do{var y=t.lane,_=t.eventTime;if((ce&y)===y){e!==null&&(e=e.next={eventTime:_,lane:0,tag:t.tag,payload:t.payload,callback:t.callback,next:null});e:{var u=O,r=t;switch(y=z,_=W,r.tag){case 1:if(u=r.payload,typeof u=="function"){w=u.call(_,w,y);break e}w=u;break e;case 3:u.flags=u.flags&-65537|128;case 0:if(u=r.payload,y=typeof u=="function"?u.call(_,w,y):u,y==null)break e;w=gu({},w,y);break e;case 2:Jd=!0}}t.callback!==null&&t.lane!==0&&(O.flags|=64,y=Te.effects,y===null?Te.effects=[t]:y.push(t))}else _={eventTime:_,lane:y,tag:t.tag,payload:t.payload,callback:t.callback,next:null},e===null?(d=e=_,b=w):e=e.next=_,L|=y;if(t=t.next,t===null){if(t=Te.shared.pending,t===null)break;y=t,t=y.next,y.next=null,Te.lastBaseUpdate=y,Te.shared.pending=null}}while(1);if(e===null&&(b=w),Te.baseState=b,Te.firstBaseUpdate=d,Te.lastBaseUpdate=e,z=Te.shared.interleaved,z!==null){Te=z;do L|=Te.lane,Te=Te.next;while(Te!==z)}else D===null&&(Te.shared.lanes=0);zg|=L,O.lanes=L,O.memoizedState=w}}function K3(O,z,W){if(O=z.effects,z.effects=null,O!==null)for(z=0;zW?W:4,O(!0);var ce=Y_.transition;Y_.transition={};try{O(!1),z()}finally{zs=W,Y_.transition=ce}}function CT(){return Mf().memoizedState}function uM(O,z,W){var ce=d0(O);if(W={lane:ce,action:W,hasEagerState:!1,eagerState:null,next:null},IT(O))PT(z,W);else if(W=hT(O,z,W,ce),W!==null){var Te=fh();Jf(W,O,ce,Te),LT(W,z,ce)}}function cM(O,z,W){var ce=d0(O),Te={lane:ce,action:W,hasEagerState:!1,eagerState:null,next:null};if(IT(O))PT(z,Te);else{var D=O.alternate;if(O.lanes===0&&(D===null||D.lanes===0)&&(D=z.lastRenderedReducer,D!==null))try{var L=z.lastRenderedState,t=D(L,W);if(Te.hasEagerState=!0,Te.eagerState=t,Qf(t,L)){var b=z.interleaved;b===null?(Te.next=Te,Sw(z)):(Te.next=b.next,b.next=Te),z.interleaved=Te;return}}catch{}finally{}W=hT(O,z,Te,ce),W!==null&&(Te=fh(),Jf(W,O,ce,Te),LT(W,z,ce))}}function IT(O){var z=O.alternate;return O===du||z!==null&&z===du}function PT(O,z){m1=Sx=!0;var W=O.pending;W===null?z.next=z:(z.next=W.next,W.next=z),O.pending=z}function LT(O,z,W){if(W&4194240){var ce=z.lanes;ce&=O.pendingLanes,W|=ce,z.lanes=W,fw(O,W)}}var Mx={readContext:Sf,useCallback:Gc,useContext:Gc,useEffect:Gc,useImperativeHandle:Gc,useInsertionEffect:Gc,useLayoutEffect:Gc,useMemo:Gc,useReducer:Gc,useRef:Gc,useState:Gc,useDebugValue:Gc,useDeferredValue:Gc,useTransition:Gc,useMutableSource:Gc,useSyncExternalStore:Gc,useId:Gc,unstable_isNewReconciler:!1},hM={readContext:Sf,useCallback:function(O,z){return mp().memoizedState=[O,z===void 0?null:z],O},useContext:Sf,useEffect:Q3,useImperativeHandle:function(O,z,W){return W=W!=null?W.concat([O]):null,Jy(4194308,4,kT.bind(null,z,O),W)},useLayoutEffect:function(O,z){return Jy(4194308,4,O,z)},useInsertionEffect:function(O,z){return Jy(4,2,O,z)},useMemo:function(O,z){var W=mp();return z=z===void 0?null:z,O=O(),W.memoizedState=[O,z],O},useReducer:function(O,z,W){var ce=mp();return z=W!==void 0?W(z):z,ce.memoizedState=ce.baseState=z,O={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:O,lastRenderedState:z},ce.queue=O,O=O.dispatch=uM.bind(null,du,O),[ce.memoizedState,O]},useRef:function(O){var z=mp();return O={current:O},z.memoizedState=O},useState:J3,useDebugValue:Dw,useDeferredValue:function(O){return mp().memoizedState=O},useTransition:function(){var O=J3(!1),z=O[0];return O=lM.bind(null,O[1]),mp().memoizedState=O,[z,O]},useMutableSource:function(){},useSyncExternalStore:function(O,z,W){var ce=du,Te=mp();if(Jl){if(W===void 0)throw Error(wi(407));W=W()}else{if(W=z(),kc===null)throw Error(wi(349));Lg&30||mT(ce,z,W)}Te.memoizedState=W;var D={value:W,getSnapshot:z};return Te.queue=D,Q3(yT.bind(null,ce,D,O),[O]),ce.flags|=2048,B1(9,vT.bind(null,ce,D,W,z),void 0,null),W},useId:function(){var O=mp(),z=kc.identifierPrefix;if(Jl){var W=sd,ce=od;W=(ce&~(1<<32-Kf(ce)-1)).toString(32)+W,z=":"+z+"R"+W,W=R1++,0<\/script>",O=O.removeChild(O.firstChild)):typeof ce.is=="string"?O=L.createElement(W,{is:ce.is}):(O=L.createElement(W),W==="select"&&(L=O,ce.multiple?L.multiple=!0:ce.size&&(L.size=ce.size))):O=L.createElementNS(O,W),O[vp]=z,O[z1]=ce,VT(O,z,!1,!1),z.stateNode=O;e:{switch(L=R2(W,ce),W){case"dialog":Dl("cancel",O),Dl("close",O),Te=ce;break;case"iframe":case"object":case"embed":Dl("load",O),Te=ce;break;case"video":case"audio":for(Te=0;Teuv&&(z.flags|=128,ce=!0,$v(D,!1),z.lanes=4194304)}else{if(!ce)if(O=Ax(L),O!==null){if(z.flags|=128,ce=!0,W=O.updateQueue,W!==null&&(z.updateQueue=W,z.flags|=4),$v(D,!0),D.tail===null&&D.tailMode==="hidden"&&!L.alternate&&!Jl)return Wc(z),null}else 2*Fu()-D.renderingStartTime>uv&&W!==1073741824&&(z.flags|=128,ce=!0,$v(D,!1),z.lanes=4194304);D.isBackwards?(L.sibling=z.child,z.child=L):(W=D.last,W!==null?W.sibling=L:z.child=L,D.last=L)}return D.tail!==null?(z=D.tail,D.rendering=z,D.tail=z.sibling,D.renderingStartTime=Fu(),z.sibling=null,W=pu.current,ml(pu,ce?W&1|2:W&1),z):(Wc(z),null);case 22:case 23:return Uw(),ce=z.memoizedState!==null,O!==null&&O.memoizedState!==null!==ce&&(z.flags|=8192),ce&&z.mode&1?Wh&1073741824&&(Wc(z),z.subtreeFlags&6&&(z.flags|=8192)):Wc(z),null;case 24:return null;case 25:return null}throw Error(wi(156,z.tag))}function _M(O,z){switch(bw(z),z.tag){case 1:return Mh(z.type)&&yx(),O=z.flags,O&65536?(z.flags=O&-65537|128,z):null;case 3:return sv(),Fl(Sh),Fl(Kc),Iw(),O=z.flags,O&65536&&!(O&128)?(z.flags=O&-65537|128,z):null;case 5:return Cw(z),null;case 13:if(Fl(pu),O=z.memoizedState,O!==null&&O.dehydrated!==null){if(z.alternate===null)throw Error(wi(340));av()}return O=z.flags,O&65536?(z.flags=O&-65537|128,z):null;case 19:return Fl(pu),null;case 4:return sv(),null;case 10:return Aw(z.type._context),null;case 22:case 23:return Uw(),null;case 24:return null;default:return null}}var My=!1,Yc=!1,bM=typeof WeakSet=="function"?WeakSet:Set,$i=null;function Vm(O,z){var W=O.ref;if(W!==null)if(typeof W=="function")try{W(null)}catch(ce){ku(O,z,ce)}else W.current=null}function ub(O,z,W){try{W()}catch(ce){ku(O,z,ce)}}var c5=!1;function wM(O,z){if(W2=dx,O=Y6(),xw(O)){if("selectionStart"in O)var W={start:O.selectionStart,end:O.selectionEnd};else e:{W=(W=O.ownerDocument)&&W.defaultView||window;var ce=W.getSelection&&W.getSelection();if(ce&&ce.rangeCount!==0){W=ce.anchorNode;var Te=ce.anchorOffset,D=ce.focusNode;ce=ce.focusOffset;try{W.nodeType,D.nodeType}catch{W=null;break e}var L=0,t=-1,b=-1,d=0,e=0,w=O,y=null;t:for(;;){for(var _;w!==W||Te!==0&&w.nodeType!==3||(t=L+Te),w!==D||ce!==0&&w.nodeType!==3||(b=L+ce),w.nodeType===3&&(L+=w.nodeValue.length),(_=w.firstChild)!==null;)y=w,w=_;for(;;){if(w===O)break t;if(y===W&&++d===Te&&(t=L),y===D&&++e===ce&&(b=L),(_=w.nextSibling)!==null)break;w=y,y=w.parentNode}w=_}W=t===-1||b===-1?null:{start:t,end:b}}else W=null}W=W||{start:0,end:0}}else W=null;for(Z2={focusedElem:O,selectionRange:W},dx=!1,$i=z;$i!==null;)if(z=$i,O=z.child,(z.subtreeFlags&1028)!==0&&O!==null)O.return=z,$i=O;else for(;$i!==null;){z=$i;try{var u=z.alternate;if(z.flags&1024)switch(z.tag){case 0:case 11:case 15:break;case 1:if(u!==null){var r=u.memoizedProps,n=u.memoizedState,l=z.stateNode,o=l.getSnapshotBeforeUpdate(z.elementType===z.type?r:Zf(z.type,r),n);l.__reactInternalSnapshotBeforeUpdate=o}break;case 3:var s=z.stateNode.containerInfo;s.nodeType===1?s.textContent="":s.nodeType===9&&s.documentElement&&s.removeChild(s.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(wi(163))}}catch(c){ku(z,z.return,c)}if(O=z.sibling,O!==null){O.return=z.return,$i=O;break}$i=z.return}return u=c5,c5=!1,u}function v1(O,z,W){var ce=z.updateQueue;if(ce=ce!==null?ce.lastEffect:null,ce!==null){var Te=ce=ce.next;do{if((Te.tag&O)===O){var D=Te.destroy;Te.destroy=void 0,D!==void 0&&ub(z,W,D)}Te=Te.next}while(Te!==ce)}}function s_(O,z){if(z=z.updateQueue,z=z!==null?z.lastEffect:null,z!==null){var W=z=z.next;do{if((W.tag&O)===O){var ce=W.create;W.destroy=ce()}W=W.next}while(W!==z)}}function cb(O){var z=O.ref;if(z!==null){var W=O.stateNode;switch(O.tag){case 5:O=W;break;default:O=W}typeof z=="function"?z(O):z.current=O}}function GT(O){var z=O.alternate;z!==null&&(O.alternate=null,GT(z)),O.child=null,O.deletions=null,O.sibling=null,O.tag===5&&(z=O.stateNode,z!==null&&(delete z[vp],delete z[z1],delete z[X2],delete z[iM],delete z[aM])),O.stateNode=null,O.return=null,O.dependencies=null,O.memoizedProps=null,O.memoizedState=null,O.pendingProps=null,O.stateNode=null,O.updateQueue=null}function WT(O){return O.tag===5||O.tag===3||O.tag===4}function h5(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||WT(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function hb(O,z,W){var ce=O.tag;if(ce===5||ce===6)O=O.stateNode,z?W.nodeType===8?W.parentNode.insertBefore(O,z):W.insertBefore(O,z):(W.nodeType===8?(z=W.parentNode,z.insertBefore(O,W)):(z=W,z.appendChild(O)),W=W._reactRootContainer,W!=null||z.onclick!==null||(z.onclick=vx));else if(ce!==4&&(O=O.child,O!==null))for(hb(O,z,W),O=O.sibling;O!==null;)hb(O,z,W),O=O.sibling}function fb(O,z,W){var ce=O.tag;if(ce===5||ce===6)O=O.stateNode,z?W.insertBefore(O,z):W.appendChild(O);else if(ce!==4&&(O=O.child,O!==null))for(fb(O,z,W),O=O.sibling;O!==null;)fb(O,z,W),O=O.sibling}var Lc=null,Yf=!1;function $d(O,z,W){for(W=W.child;W!==null;)ZT(O,z,W),W=W.sibling}function ZT(O,z,W){if(wp&&typeof wp.onCommitFiberUnmount=="function")try{wp.onCommitFiberUnmount(Qx,W)}catch{}switch(W.tag){case 5:Yc||Vm(W,z);case 6:var ce=Lc,Te=Yf;Lc=null,$d(O,z,W),Lc=ce,Yf=Te,Lc!==null&&(Yf?(O=Lc,W=W.stateNode,O.nodeType===8?O.parentNode.removeChild(W):O.removeChild(W)):Lc.removeChild(W.stateNode));break;case 18:Lc!==null&&(Yf?(O=Lc,W=W.stateNode,O.nodeType===8?W_(O.parentNode,W):O.nodeType===1&&W_(O,W),E1(O)):W_(Lc,W.stateNode));break;case 4:ce=Lc,Te=Yf,Lc=W.stateNode.containerInfo,Yf=!0,$d(O,z,W),Lc=ce,Yf=Te;break;case 0:case 11:case 14:case 15:if(!Yc&&(ce=W.updateQueue,ce!==null&&(ce=ce.lastEffect,ce!==null))){Te=ce=ce.next;do{var D=Te,L=D.destroy;D=D.tag,L!==void 0&&(D&2||D&4)&&ub(W,z,L),Te=Te.next}while(Te!==ce)}$d(O,z,W);break;case 1:if(!Yc&&(Vm(W,z),ce=W.stateNode,typeof ce.componentWillUnmount=="function"))try{ce.props=W.memoizedProps,ce.state=W.memoizedState,ce.componentWillUnmount()}catch(t){ku(W,z,t)}$d(O,z,W);break;case 21:$d(O,z,W);break;case 22:W.mode&1?(Yc=(ce=Yc)||W.memoizedState!==null,$d(O,z,W),Yc=ce):$d(O,z,W);break;default:$d(O,z,W)}}function f5(O){var z=O.updateQueue;if(z!==null){O.updateQueue=null;var W=O.stateNode;W===null&&(W=O.stateNode=new bM),z.forEach(function(ce){var Te=PM.bind(null,O,ce);W.has(ce)||(W.add(ce),ce.then(Te,Te))})}}function Gf(O,z){var W=z.deletions;if(W!==null)for(var ce=0;ceTe&&(Te=L),ce&=~D}if(ce=Te,ce=Fu()-ce,ce=(120>ce?120:480>ce?480:1080>ce?1080:1920>ce?1920:3e3>ce?3e3:4320>ce?4320:1960*kM(ce/1960))-ce,10O?16:O,r0===null)var ce=!1;else{if(O=r0,r0=null,Ix=0,$o&6)throw Error(wi(331));var Te=$o;for($o|=4,$i=O.current;$i!==null;){var D=$i,L=D.child;if($i.flags&16){var t=D.deletions;if(t!==null){for(var b=0;bFu()-Nw?Eg(O,0):Bw|=W),Eh(O,z)}function tk(O,z){z===0&&(O.mode&1?(z=yy,yy<<=1,!(yy&130023424)&&(yy=4194304)):z=1);var W=fh();O=fd(O,z),O!==null&&($1(O,z,W),Eh(O,W))}function IM(O){var z=O.memoizedState,W=0;z!==null&&(W=z.retryLane),tk(O,W)}function PM(O,z){var W=0;switch(O.tag){case 13:var ce=O.stateNode,Te=O.memoizedState;Te!==null&&(W=Te.retryLane);break;case 19:ce=O.stateNode;break;default:throw Error(wi(314))}ce!==null&&ce.delete(z),tk(O,W)}var nk;nk=function(O,z,W){if(O!==null)if(O.memoizedProps!==z.pendingProps||Sh.current)kh=!0;else{if(!(O.lanes&W)&&!(z.flags&128))return kh=!1,yM(O,z,W);kh=!!(O.flags&131072)}else kh=!1,Jl&&z.flags&1048576&&oT(z,bx,z.index);switch(z.lanes=0,z.tag){case 2:var ce=z.type;Qy(O,z),O=z.pendingProps;var Te=iv(z,Kc.current);Km(z,W),Te=Lw(null,z,ce,O,Te,W);var D=zw();return z.flags|=1,typeof Te=="object"&&Te!==null&&typeof Te.render=="function"&&Te.$$typeof===void 0?(z.tag=1,z.memoizedState=null,z.updateQueue=null,Mh(ce)?(D=!0,xx(z)):D=!1,z.memoizedState=Te.state!==null&&Te.state!==void 0?Te.state:null,Mw(z),Te.updater=o_,z.stateNode=Te,Te._reactInternals=z,nb(z,ce,O,W),z=ab(null,z,ce,!0,D,W)):(z.tag=0,Jl&&D&&_w(z),uh(null,z,Te,W),z=z.child),z;case 16:ce=z.elementType;e:{switch(Qy(O,z),O=z.pendingProps,Te=ce._init,ce=Te(ce._payload),z.type=ce,Te=z.tag=zM(ce),O=Zf(ce,O),Te){case 0:z=ib(null,z,ce,O,W);break e;case 1:z=s5(null,z,ce,O,W);break e;case 11:z=a5(null,z,ce,O,W);break e;case 14:z=o5(null,z,ce,Zf(ce.type,O),W);break e}throw Error(wi(306,ce,""))}return z;case 0:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),ib(O,z,ce,Te,W);case 1:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),s5(O,z,ce,Te,W);case 3:e:{if(NT(z),O===null)throw Error(wi(387));ce=z.pendingProps,D=z.memoizedState,Te=D.element,fT(O,z),kx(z,ce,null,W);var L=z.memoizedState;if(ce=L.element,D.isDehydrated)if(D={element:ce,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},z.updateQueue.baseState=D,z.memoizedState=D,z.flags&256){Te=lv(Error(wi(423)),z),z=l5(O,z,ce,W,Te);break e}else if(ce!==Te){Te=lv(Error(wi(424)),z),z=l5(O,z,ce,W,Te);break e}else for(Zh=h0(z.stateNode.containerInfo.firstChild),Xh=z,Jl=!0,Xf=null,W=cT(z,null,ce,W),z.child=W;W;)W.flags=W.flags&-3|4096,W=W.sibling;else{if(av(),ce===Te){z=pd(O,z,W);break e}uh(O,z,ce,W)}z=z.child}return z;case 5:return pT(z),O===null&&Q2(z),ce=z.type,Te=z.pendingProps,D=O!==null?O.memoizedProps:null,L=Te.children,$2(ce,Te)?L=null:D!==null&&$2(ce,D)&&(z.flags|=32),BT(O,z),uh(O,z,L,W),z.child;case 6:return O===null&&Q2(z),null;case 13:return jT(O,z,W);case 4:return Ew(z,z.stateNode.containerInfo),ce=z.pendingProps,O===null?z.child=ov(z,null,ce,W):uh(O,z,ce,W),z.child;case 11:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),a5(O,z,ce,Te,W);case 7:return uh(O,z,z.pendingProps,W),z.child;case 8:return uh(O,z,z.pendingProps.children,W),z.child;case 12:return uh(O,z,z.pendingProps.children,W),z.child;case 10:e:{if(ce=z.type._context,Te=z.pendingProps,D=z.memoizedProps,L=Te.value,ml(wx,ce._currentValue),ce._currentValue=L,D!==null)if(Qf(D.value,L)){if(D.children===Te.children&&!Sh.current){z=pd(O,z,W);break e}}else for(D=z.child,D!==null&&(D.return=z);D!==null;){var t=D.dependencies;if(t!==null){L=D.child;for(var b=t.firstContext;b!==null;){if(b.context===ce){if(D.tag===1){b=ld(-1,W&-W),b.tag=2;var d=D.updateQueue;if(d!==null){d=d.shared;var e=d.pending;e===null?b.next=b:(b.next=e.next,e.next=b),d.pending=b}}D.lanes|=W,b=D.alternate,b!==null&&(b.lanes|=W),eb(D.return,W,z),t.lanes|=W;break}b=b.next}}else if(D.tag===10)L=D.type===z.type?null:D.child;else if(D.tag===18){if(L=D.return,L===null)throw Error(wi(341));L.lanes|=W,t=L.alternate,t!==null&&(t.lanes|=W),eb(L,W,z),L=D.sibling}else L=D.child;if(L!==null)L.return=D;else for(L=D;L!==null;){if(L===z){L=null;break}if(D=L.sibling,D!==null){D.return=L.return,L=D;break}L=L.return}D=L}uh(O,z,Te.children,W),z=z.child}return z;case 9:return Te=z.type,ce=z.pendingProps.children,Km(z,W),Te=Sf(Te),ce=ce(Te),z.flags|=1,uh(O,z,ce,W),z.child;case 14:return ce=z.type,Te=Zf(ce,z.pendingProps),Te=Zf(ce.type,Te),o5(O,z,ce,Te,W);case 15:return RT(O,z,z.type,z.pendingProps,W);case 17:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),Qy(O,z),z.tag=1,Mh(ce)?(O=!0,xx(z)):O=!1,Km(z,W),zT(z,ce,Te),nb(z,ce,Te,W),ab(null,z,ce,!0,O,W);case 19:return UT(O,z,W);case 22:return FT(O,z,W)}throw Error(wi(156,z.tag))};function rk(O,z){return I6(O,z)}function LM(O,z,W,ce){this.tag=O,this.key=W,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=z,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ce,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wf(O,z,W,ce){return new LM(O,z,W,ce)}function qw(O){return O=O.prototype,!(!O||!O.isReactComponent)}function zM(O){if(typeof O=="function")return qw(O)?1:0;if(O!=null){if(O=O.$$typeof,O===lw)return 11;if(O===uw)return 14}return 2}function g0(O,z){var W=O.alternate;return W===null?(W=wf(O.tag,z,O.key,O.mode),W.elementType=O.elementType,W.type=O.type,W.stateNode=O.stateNode,W.alternate=O,O.alternate=W):(W.pendingProps=z,W.type=O.type,W.flags=0,W.subtreeFlags=0,W.deletions=null),W.flags=O.flags&14680064,W.childLanes=O.childLanes,W.lanes=O.lanes,W.child=O.child,W.memoizedProps=O.memoizedProps,W.memoizedState=O.memoizedState,W.updateQueue=O.updateQueue,z=O.dependencies,W.dependencies=z===null?null:{lanes:z.lanes,firstContext:z.firstContext},W.sibling=O.sibling,W.index=O.index,W.ref=O.ref,W}function nx(O,z,W,ce,Te,D){var L=2;if(ce=O,typeof O=="function")qw(O)&&(L=1);else if(typeof O=="string")L=5;else e:switch(O){case zm:return Cg(W.children,Te,D,z);case sw:L=8,Te|=8;break;case S2:return O=wf(12,W,z,Te|2),O.elementType=S2,O.lanes=D,O;case M2:return O=wf(13,W,z,Te),O.elementType=M2,O.lanes=D,O;case E2:return O=wf(19,W,z,Te),O.elementType=E2,O.lanes=D,O;case p6:return u_(W,Te,D,z);default:if(typeof O=="object"&&O!==null)switch(O.$$typeof){case h6:L=10;break e;case f6:L=9;break e;case lw:L=11;break e;case uw:L=14;break e;case Kd:L=16,ce=null;break e}throw Error(wi(130,O==null?O:typeof O,""))}return z=wf(L,W,z,Te),z.elementType=O,z.type=ce,z.lanes=D,z}function Cg(O,z,W,ce){return O=wf(7,O,ce,z),O.lanes=W,O}function u_(O,z,W,ce){return O=wf(22,O,ce,z),O.elementType=p6,O.lanes=W,O.stateNode={isHidden:!1},O}function e2(O,z,W){return O=wf(6,O,null,z),O.lanes=W,O}function t2(O,z,W){return z=wf(4,O.children!==null?O.children:[],O.key,z),z.lanes=W,z.stateNode={containerInfo:O.containerInfo,pendingChildren:null,implementation:O.implementation},z}function OM(O,z,W,ce,Te){this.tag=z,this.containerInfo=O,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=D_(0),this.expirationTimes=D_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D_(0),this.identifierPrefix=ce,this.onRecoverableError=Te,this.mutableSourceEagerHydrationData=null}function Hw(O,z,W,ce,Te,D,L,t,b){return O=new OM(O,z,W,t,b),z===1?(z=1,D===!0&&(z|=8)):z=0,D=wf(3,null,null,z),O.current=D,D.stateNode=O,D.memoizedState={element:ce,isDehydrated:W,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mw(D),O}function DM(O,z,W){var ce=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sk)}catch(O){console.error(O)}}sk(),s6.exports=Jh;var lk=s6.exports,uk,_5=lk;uk=_5.createRoot,_5.hydrateRoot;var yp,Hr=typeof window<"u"?window:void 0,Ah=typeof globalThis<"u"?globalThis:Hr,ck=Array.prototype,b5=ck.forEach,w5=ck.indexOf,$h=Ah==null?void 0:Ah.navigator,Xi=Ah==null?void 0:Ah.document,wh=Ah==null?void 0:Ah.location,vb=Ah==null?void 0:Ah.fetch,yb=Ah!=null&&Ah.XMLHttpRequest&&"withCredentials"in new Ah.XMLHttpRequest?Ah.XMLHttpRequest:void 0,T5=Ah==null?void 0:Ah.AbortController,wc=$h==null?void 0:$h.userAgent,Wa=Hr??{},id={DEBUG:!1,LIB_VERSION:"1.207.5"},n2="$copy_autocapture",jM=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(O){O.GZipJS="gzip-js",O.Base64="base64"})(yp||(yp={}));function bo(O,z){return O.indexOf(z)!==-1}var d_=function(O){return O.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},xb=function(O){return O.replace(/^\$/,"")},UM=Array.isArray,hk=Object.prototype,fk=hk.hasOwnProperty,g_=hk.toString,Bu=UM||function(O){return g_.call(O)==="[object Array]"},Yh=O=>typeof O=="function",Nu=O=>O===Object(O)&&!Bu(O),Hm=O=>{if(Nu(O)){for(var z in O)if(fk.call(O,z))return!1;return!0}return!1},pa=O=>O===void 0,Oc=O=>g_.call(O)=="[object String]",k5=O=>Oc(O)&&O.trim().length===0,A0=O=>O===null,nl=O=>pa(O)||A0(O),ch=O=>g_.call(O)=="[object Number]",Sg=O=>g_.call(O)==="[object Boolean]",VM=O=>O instanceof FormData,qM=O=>bo(jM,O),pk=O=>{var z={_log:function(W){if(Hr&&(id.DEBUG||Wa.POSTHOG_DEBUG)&&!pa(Hr.console)&&Hr.console){for(var ce=("__rrweb_original__"in Hr.console[W])?Hr.console[W].__rrweb_original__:Hr.console[W],Te=arguments.length,D=new Array(Te>1?Te-1:0),L=1;L{z.error("You must initialize PostHog before calling ".concat(W))},createLogger:W=>pk("".concat(O," ").concat(W))};return z},ha=pk("[PostHog.js]"),Jc=ha.createLogger,HM=Jc("[ExternalScriptsLoader]"),A5=(O,z,W)=>{if(O.config.disable_external_dependency_loading)return HM.warn("".concat(z," was requested but loading of external scripts is disabled.")),W("Loading of external scripts is disabled");var ce=()=>{if(!Xi)return W("document not found");var Te=Xi.createElement("script");if(Te.type="text/javascript",Te.crossOrigin="anonymous",Te.src=z,Te.onload=t=>W(void 0,t),Te.onerror=t=>W(t),O.config.prepare_external_dependency_script&&(Te=O.config.prepare_external_dependency_script(Te)),!Te)return W("prepare_external_dependency_script returned null");var D,L=Xi.querySelectorAll("body > script");L.length>0?(D=L[0].parentNode)===null||D===void 0||D.insertBefore(Te,L[0]):Xi.body.appendChild(Te)};Xi!=null&&Xi.body?ce():Xi==null||Xi.addEventListener("DOMContentLoaded",ce)};function S5(O,z){var W=Object.keys(O);if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(O);z&&(ce=ce.filter(function(Te){return Object.getOwnPropertyDescriptor(O,Te).enumerable})),W.push.apply(W,ce)}return W}function bi(O){for(var z=1;z=0||(e[b]=L[b]);return e}(O,z);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(O);for(ce=0;ce=0||Object.prototype.propertyIsEnumerable.call(O,W)&&(Te[W]=O[W])}return Te}Wa.__PosthogExtensions__=Wa.__PosthogExtensions__||{},Wa.__PosthogExtensions__.loadExternalDependency=(O,z,W)=>{var ce="/static/".concat(z,".js")+"?v=".concat(O.version);if(z==="remote-config"&&(ce="/array/".concat(O.config.token,"/config.js")),z==="toolbar"){var Te=3e5,D=Math.floor(Date.now()/Te)*Te;ce="".concat(ce,"&t=").concat(D)}var L=O.requestRouter.endpointFor("assets",ce);A5(O,L,W)},Wa.__PosthogExtensions__.loadSiteApp=(O,z,W)=>{var ce=O.requestRouter.endpointFor("api",z);A5(O,ce,W)};var zx={};function m0(O,z,W){if(Bu(O)){if(b5&&O.forEach===b5)O.forEach(z,W);else if("length"in O&&O.length===+O.length){for(var ce=0,Te=O.length;ce1?z-1:0),ce=1;ce1?z-1:0),ce=1;ce0&&(z[ce]=W)}),z};function WM(O,z){return W=O,ce=D=>Oc(D)&&!A0(z)?D.slice(0,z):D,Te=new Set,function D(L,t){return L!==Object(L)?ce?ce(L,t):L:Te.has(L)?void 0:(Te.add(L),Bu(L)?(b=[],m0(L,d=>{b.push(D(d))})):(b={},tl(L,(d,e)=>{Te.has(d)||(b[e]=D(d,e))})),b);var b}(W);var W,ce,Te}var ad=function(){function O(z){return z&&(z.preventDefault=O.preventDefault,z.stopPropagation=O.stopPropagation),z}return O.preventDefault=function(){this.returnValue=!1},O.stopPropagation=function(){this.cancelBubble=!0},function(z,W,ce,Te,D){if(z)if(z.addEventListener&&!Te)z.addEventListener(W,ce,!!D);else{var L="on"+W,t=z[L];z[L]=function(b,d,e){return function(w){if(w=w||O(Hr==null?void 0:Hr.event)){var y,_=!0;Yh(e)&&(y=e(w));var u=d.call(b,w);return y!==!1&&u!==!1||(_=!1),_}}}(z,ce,t)}else ha.error("No valid element provided to register_event")}}();function gk(O,z){for(var W=0;W{var z={};for(var[W,ce]of rx(O||{}))ce&&(z[W]=ce);return z};class $M{constructor(z){Ri(this,"_override_warning",!1),Ri(this,"_hasLoadedFlags",!1),Ri(this,"_requestInFlight",!1),Ri(this,"_reloadingDisabled",!1),Ri(this,"_additionalReloadRequested",!1),Ri(this,"_decideCalled",!1),Ri(this,"_flagsLoadedFromRemote",!1),this.instance=z,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var z=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:z})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var z=this.instance.get_property(Gm),W=this.instance.get_property(Ly);if(!W)return z||{};for(var ce=Xc({},z),Te=Object.keys(W),D=0;D{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(z){this.$anon_distinct_id=z}setReloadingPaused(z){this._reloadingDisabled=z}_callDecideEndpoint(z){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var W={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(o1),group_properties:this.instance.get_property(_g)};(z!=null&&z.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(W.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:W,compression:this.instance.config.disable_compression?void 0:yp.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:ce=>{var Te,D,L=!0;ce.statusCode===200&&(this.$anon_distinct_id=void 0,L=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((D=ce.json)!==null&&D!==void 0?D:{})),W.disable_flags||(this._flagsLoadedFromRemote=!L,this.receivedFeatureFlags((Te=ce.json)!==null&&Te!==void 0?Te:{},L),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var ce,Te,D,L,t,b=this.getFlagVariants()[z],d="".concat(b),e=this.instance.get_property(Rx)||{};return(W.send_event||!("send_event"in W))&&(!(z in e)||!e[z].includes(d))&&(Bu(e[z])?e[z].push(d):e[z]=[d],(ce=this.instance.persistence)===null||ce===void 0||ce.register({[Rx]:e}),this.instance.capture("$feature_flag_called",{$feature_flag:z,$feature_flag_response:b,$feature_flag_payload:this.getFeatureFlagPayload(z)||null,$feature_flag_bootstrapped_response:((Te=this.instance.config.bootstrap)===null||Te===void 0||(D=Te.featureFlags)===null||D===void 0?void 0:D[z])||null,$feature_flag_bootstrapped_payload:((L=this.instance.config.bootstrap)===null||L===void 0||(t=L.featureFlagPayloads)===null||t===void 0?void 0:t[z])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),b}Py.warn('getFeatureFlag for key "'+z+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(z){return this.getFlagPayloads()[z]}isFeatureEnabled(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(z,W);Py.warn('isFeatureEnabled for key "'+z+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(z){this.featureFlagEventHandlers.push(z)}removeFeatureFlagsHandler(z){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(W=>W!==z)}receivedFeatureFlags(z,W){if(this.instance.persistence){this._hasLoadedFlags=!0;var ce=this.getFlagVariants(),Te=this.getFlagPayloads();(function(D,L){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=D.featureFlags,e=D.featureFlagPayloads;if(d)if(Bu(d)){var w={};if(d)for(var y=0;y1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return Py.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=W,z===!1)this.instance.persistence.unregister(Ly);else if(Bu(z)){for(var ce={},Te=0;Tethis.removeFeatureFlagsHandler(z)}updateEarlyAccessFeatureEnrollment(z,W){var ce,Te=(this.instance.get_property(ix)||[]).find(b=>b.flagKey===z),D={["$feature_enrollment/".concat(z)]:W},L={$feature_flag:z,$feature_enrollment:W,$set:D};Te&&(L.$early_access_feature_name=Te.name),this.instance.capture("$feature_enrollment_update",L),this.setPersonPropertiesForFlags(D,!1);var t=bi(bi({},this.getFlagVariants()),{},{[z]:W});(ce=this.instance.persistence)===null||ce===void 0||ce.register({[a2]:Object.keys(j5(t)),[Gm]:t}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1],ce=this.instance.get_property(ix);if(ce&&!W)return z(ce);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:Te=>{var D;if(Te.json){var L=Te.json.earlyAccessFeatures;return(D=this.instance.persistence)===null||D===void 0||D.register({[ix]:L}),z(L)}}})}_prepareFeatureFlagsForCallbacks(){var z=this.getFlags(),W=this.getFlagVariants();return{flags:z.filter(ce=>W[ce]),flagVariants:Object.keys(W).filter(ce=>W[ce]).reduce((ce,Te)=>(ce[Te]=W[Te],ce),{})}}_fireFeatureFlagsCallbacks(z){var{flags:W,flagVariants:ce}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(Te=>Te(W,ce,{errorsLoading:z}))}setPersonPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],ce=this.instance.get_property(o1)||{};this.instance.register({[o1]:bi(bi({},ce),z)}),W&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(o1)}setGroupPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],ce=this.instance.get_property(_g)||{};Object.keys(ce).length!==0&&Object.keys(ce).forEach(Te=>{ce[Te]=bi(bi({},ce[Te]),z[Te]),delete z[Te]}),this.instance.register({[_g]:bi(bi({},ce),z)}),W&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(z){if(z){var W=this.instance.get_property(_g)||{};this.instance.register({[_g]:bi(bi({},W),{},{[z]:{}})})}else this.instance.unregister(_g)}}Math.trunc||(Math.trunc=function(O){return O<0?Math.ceil(O):Math.floor(O)}),Number.isInteger||(Number.isInteger=function(O){return ch(O)&&isFinite(O)&&Math.floor(O)===O});var U5="0123456789abcdef";class Bx{constructor(z){if(this.bytes=z,z.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(z,W,ce,Te){if(!Number.isInteger(z)||!Number.isInteger(W)||!Number.isInteger(ce)||!Number.isInteger(Te)||z<0||W<0||ce<0||Te<0||z>0xffffffffffff||W>4095||ce>1073741823||Te>4294967295)throw new RangeError("invalid field value");var D=new Uint8Array(16);return D[0]=z/Math.pow(2,40),D[1]=z/Math.pow(2,32),D[2]=z/Math.pow(2,24),D[3]=z/Math.pow(2,16),D[4]=z/Math.pow(2,8),D[5]=z,D[6]=112|W>>>8,D[7]=W,D[8]=128|ce>>>24,D[9]=ce>>>16,D[10]=ce>>>8,D[11]=ce,D[12]=Te>>>24,D[13]=Te>>>16,D[14]=Te>>>8,D[15]=Te,new Bx(D)}toString(){for(var z="",W=0;W>>4)+U5.charAt(15&this.bytes[W]),W!==3&&W!==5&&W!==7&&W!==9||(z+="-");if(z.length!==36)throw new Error("Invalid UUIDv7 was generated");return z}clone(){return new Bx(this.bytes.slice(0))}equals(z){return this.compareTo(z)===0}compareTo(z){for(var W=0;W<16;W++){var ce=this.bytes[W]-z.bytes[W];if(ce!==0)return Math.sign(ce)}return 0}}class YM{constructor(){Ri(this,"timestamp",0),Ri(this,"counter",0),Ri(this,"random",new XM)}generate(){var z=this.generateOrAbort();if(pa(z)){this.timestamp=0;var W=this.generateOrAbort();if(pa(W))throw new Error("Could not generate UUID after timestamp reset");return W}return z}generateOrAbort(){var z=Date.now();if(z>this.timestamp)this.timestamp=z,this.resetCounter();else{if(!(z+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Bx.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var V5,xk=O=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var z=0;zcrypto.getRandomValues(O));class XM{constructor(){Ri(this,"buffer",new Uint32Array(8)),Ri(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(xk(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var i0=()=>KM().toString(),KM=()=>(V5||(V5=new YM)).generate(),JM="Thu, 01 Jan 1970 00:00:00 GMT",Xv="",QM=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function e7(O,z){if(z){var W=function(Te){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xi;if(Xv)return Xv;if(!D||["localhost","127.0.0.1"].includes(Te))return"";for(var L=Te.split("."),t=Math.min(L.length,8),b="dmn_chk_"+i0(),d=new RegExp("(^|;)\\s*"+b+"=1");!Xv&&t--;){var e=L.slice(t).join("."),w=b+"=1;domain=."+e;D.cookie=w,d.test(D.cookie)&&(D.cookie=w+";expires="+JM,Xv=e)}return Xv}(O);if(!W){var ce=(Te=>{var D=Te.match(QM);return D?D[0]:""})(O);ce!==W&&ha.info("Warning: cookie subdomain discovery mismatch",ce,W),W=ce}return W?"; domain=."+W:""}return""}var ud={is_supported:()=>!!Xi,error:function(O){ha.error("cookieStore error: "+O)},get:function(O){if(Xi){try{for(var z=O+"=",W=Xi.cookie.split(";").filter(D=>D.length),ce=0;ce3686.4&&ha.warn("cookieStore warning: large cookie, len="+d.length),Xi.cookie=d,d}catch{return}},remove:function(O,z){try{ud.set(O,"",-1,z)}catch{return}}},o2=null,hc={is_supported:function(){if(!A0(o2))return o2;var O=!0;if(pa(Hr))O=!1;else try{var z="__mplssupport__";hc.set(z,"xyz"),hc.get(z)!=='"xyz"'&&(O=!1),hc.remove(z)}catch{O=!1}return O||ha.error("localStorage unsupported; falling back to cookie store"),o2=O,O},error:function(O){ha.error("localStorage error: "+O)},get:function(O){try{return Hr==null?void 0:Hr.localStorage.getItem(O)}catch(z){hc.error(z)}return null},parse:function(O){try{return JSON.parse(hc.get(O))||{}}catch{}return null},set:function(O,z){try{Hr==null||Hr.localStorage.setItem(O,JSON.stringify(z))}catch(W){hc.error(W)}},remove:function(O){try{Hr==null||Hr.localStorage.removeItem(O)}catch(z){hc.error(z)}}},t7=["distinct_id",Dx,a1,Fx,Eb],zy=bi(bi({},hc),{},{parse:function(O){try{var z={};try{z=ud.parse(O)||{}}catch{}var W=Xc(z,JSON.parse(hc.get(O)||"{}"));return hc.set(O,W),W}catch{}return null},set:function(O,z,W,ce,Te,D){try{hc.set(O,z,void 0,void 0,D);var L={};t7.forEach(t=>{z[t]&&(L[t]=z[t])}),Object.keys(L).length&&ud.set(O,L,W,ce,Te,D)}catch(t){hc.error(t)}},remove:function(O,z){try{Hr==null||Hr.localStorage.removeItem(O),ud.remove(O,z)}catch(W){hc.error(W)}}}),Oy={},n7={is_supported:function(){return!0},error:function(O){ha.error("memoryStorage error: "+O)},get:function(O){return Oy[O]||null},parse:function(O){return Oy[O]||null},set:function(O,z){Oy[O]=z},remove:function(O){delete Oy[O]}},fg=null,zc={is_supported:function(){if(!A0(fg))return fg;if(fg=!0,pa(Hr))fg=!1;else try{var O="__support__";zc.set(O,"xyz"),zc.get(O)!=='"xyz"'&&(fg=!1),zc.remove(O)}catch{fg=!1}return fg},error:function(O){ha.error("sessionStorage error: ",O)},get:function(O){try{return Hr==null?void 0:Hr.sessionStorage.getItem(O)}catch(z){zc.error(z)}return null},parse:function(O){try{return JSON.parse(zc.get(O))||null}catch{}return null},set:function(O,z){try{Hr==null||Hr.sessionStorage.setItem(O,JSON.stringify(z))}catch(W){zc.error(W)}},remove:function(O){try{Hr==null||Hr.sessionStorage.removeItem(O)}catch(z){zc.error(z)}}},r7=["localhost","127.0.0.1"],Qm=O=>{var z=Xi==null?void 0:Xi.createElement("a");return pa(z)?null:(z.href=O,z)},cv=function(O,z){return!!function(W){try{new RegExp(W)}catch{return!1}return!0}(z)&&new RegExp(z).test(O)},i7=function(O){var z,W,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",Te=[];return tl(O,function(D,L){pa(D)||pa(L)||L==="undefined"||(z=encodeURIComponent((t=>t instanceof File)(D)?D.name:D.toString()),W=encodeURIComponent(L),Te[Te.length]=W+"="+z)}),Te.join(ce)},Nx=function(O,z){for(var W,ce=((O.split("#")[0]||"").split("?")[1]||"").split("&"),Te=0;Tez&&bo(z,wk)||function(W){return bo(W,U1)&&!bo(W,Dg)&&!bo(W,_p)}(O),G5=function(O,z){return z=z||"",bo(O," OPR/")&&bo(O,"Mini")?o7:bo(O," OPR/")?Yw:Kw.test(O)?hv:bo(O,"IE"+kf)||bo(O,"WPDesktop")?Ek:bo(O,Ak)?Sk:bo(O,Xw)||bo(O,"Edg/")?Ck:bo(O,"FBIOS")?"Facebook "+kf:bo(O,"UCWEB")||bo(O,"UCBrowser")?"UC Browser":bo(O,"CriOS")?Mk:bo(O,"CrMo")||bo(O,Dg)?Dg:bo(O,_p)&&bo(O,U1)?Pk:bo(O,"FxiOS")?Ik:bo(O.toLowerCase(),Pb.toLowerCase())?Pb:f7(O,z)?bo(O,kf)?Lk:U1:bo(O,ev)?ev:bo(O,"MSIE")||bo(O,"Trident/")?$w:bo(O,"Gecko")?ev:""},p7={[Ek]:[new RegExp("rv:"+lh)],[Ck]:[new RegExp(Xw+"?\\/"+lh)],[Dg]:[new RegExp("("+Dg+"|CrMo)\\/"+lh)],[Mk]:[new RegExp("CriOS\\/"+lh)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+lh)],[U1]:[s2],[Lk]:[s2],[Yw]:[new RegExp("(Opera|OPR)\\/"+lh)],[ev]:[new RegExp(ev+"\\/"+lh)],[Ik]:[new RegExp("FxiOS\\/"+lh)],[Pb]:[new RegExp("Konqueror[:/]?"+lh,"i")],[hv]:[new RegExp(hv+" "+lh),s2],[Pk]:[new RegExp("android\\s"+lh,"i")],[Sk]:[new RegExp(Ak+"\\/"+lh)],[$w]:[new RegExp("(rv:|MSIE )"+lh)],Mozilla:[new RegExp("rv:"+lh)]},W5=[[new RegExp(tv+"; "+tv+" (.*?)[);]","i"),O=>[tv,O&&O[1]||""]],[new RegExp(V1,"i"),[V1,""]],[new RegExp(q1,"i"),[q1,""]],[Kw,[hv,""]],[new RegExp(s1,"i"),(O,z)=>{if(/Phone/.test(z)||/WPDesktop/.test(z))return[Cb,""];if(new RegExp(kf).test(z)&&!/IEMobile\b/.test(z))return[s1+" "+kf,""];var W=/Windows NT ([0-9.]+)/i.exec(z);if(W&&W[1]){var ce=W[1],Te=h7[ce]||"";return/arm/i.test(z)&&(Te="RT"),[s1,Te]}return[s1,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,O=>{if(O&&O[3]){var z=[O[3],O[4],O[5]||"0"];return[Ux,z.join(".")]}return[Ux,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,O=>{var z="";return O&&O.length>=3&&(z=pa(O[2])?O[3]:O[2]),["watchOS",z]}],[new RegExp("("+_p+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_p+")","i"),O=>{if(O&&O[2]){var z=[O[2],O[3],O[4]||"0"];return[_p,z.join(".")]}return[_p,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,O=>{var z=["Mac OS X",""];if(O&&O[1]){var W=[O[1],O[2],O[3]||"0"];z[1]=W.join(".")}return z}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[a7,""]],[/Linux|debian/i,["Linux",""]]],Z5=function(O){return c7.test(O)?V1:u7.test(O)?q1:l7.test(O)?tv:new RegExp(Ib,"i").test(O)?Ib:new RegExp("("+Cb+"|WPDesktop)","i").test(O)?Cb:/iPad/.test(O)?bk:/iPod/.test(O)?"iPod Touch":/iPhone/.test(O)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(O)?Tk:Kw.test(O)?hv:/(kobo)\s(ereader|touch)/i.test(O)?"Kobo":new RegExp(H5,"i").test(O)?H5:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(O)||/(kf[a-z]+)( bui|\)).+silk\//i.test(O)?"Kindle Fire":/(Android|ZTE)/i.test(O)?!new RegExp(kf).test(O)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(O)?/pixel[\daxl ]{1,6}/i.test(O)&&!/pixel c/i.test(O)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(O)||/lmy47v/i.test(O)&&!/QTAQZ3/i.test(O)?_p:_k:_p:new RegExp("(pda|"+kf+")","i").test(O)?s7:new RegExp(j1,"i").test(O)&&!new RegExp(j1+" pc","i").test(O)?Ok:""},Dy="https?://(.*)",Lb=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],d7=_b(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Lb),$5="",Tu={campaignParams:function(){var{customTrackedParams:O,maskPersonalDataProperties:z,customPersonalDataProperties:W}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Xi)return{};var ce=z?_b([],Lb,W||[]):[];return this._campaignParamsFromUrl(q5(Xi.URL,ce,$5),O)},_campaignParamsFromUrl:function(O,z){var W=d7.concat(z||[]),ce={};return tl(W,function(Te){var D=Nx(O,Te);ce[Te]=D||null}),ce},_searchEngine:function(O){return O?O.search(Dy+"google.([^/?]*)")===0?"google":O.search(Dy+"bing.com")===0?"bing":O.search(Dy+"yahoo.com")===0?"yahoo":O.search(Dy+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(O){var z=Tu._searchEngine(O),W=z!="yahoo"?"q":"p",ce={};if(!A0(z)){ce.$search_engine=z;var Te=Xi?Nx(Xi.referrer,W):"";Te.length&&(ce.ph_keyword=Te)}return ce},searchInfo:function(){var O=Xi==null?void 0:Xi.referrer;return O?this._searchInfoFromReferrer(O):{}},browser:G5,browserVersion:function(O,z){var W=G5(O,z),ce=p7[W];if(pa(ce))return null;for(var Te=0;Te0&&arguments[0]!==void 0?arguments[0]:{};if(!wc)return{};var W=O?_b([],Lb,z||[]):[],[ce,Te]=Tu.os(wc);return Xc(Ox({$os:ce,$os_version:Te,$browser:Tu.browser(wc,navigator.vendor),$device:Tu.device(wc),$device_type:Tu.deviceType(wc),$timezone:Tu.timezone(),$timezone_offset:Tu.timezoneOffset()}),{$current_url:q5(wh==null?void 0:wh.href,W,$5),$host:wh==null?void 0:wh.host,$pathname:wh==null?void 0:wh.pathname,$raw_user_agent:wc.length>1e3?wc.substring(0,997)+"...":wc,$browser_version:Tu.browserVersion(wc,navigator.vendor),$browser_language:Tu.browserLanguage(),$browser_language_prefix:Tu.browserLanguagePrefix(),$screen_height:Hr==null?void 0:Hr.screen.height,$screen_width:Hr==null?void 0:Hr.screen.width,$viewport_height:Hr==null?void 0:Hr.innerHeight,$viewport_width:Hr==null?void 0:Hr.innerWidth,$lib:"web",$lib_version:id.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!wc)return{};var[O,z]=Tu.os(wc);return Xc(Ox({$os:O,$os_version:z,$browser:Tu.browser(wc,navigator.vendor)}),{$browser_version:Tu.browserVersion(wc,navigator.vendor)})}},g7=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class l2{constructor(z){this.config=z,this.props={},this.campaign_params_saved=!1,this.name=(W=>{var ce="";return W.token&&(ce=W.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),W.persistence_name?"ph_"+W.persistence_name:"ph_"+ce+"_posthog"})(z),this.storage=this.buildStorage(z),this.load(),z.debug&&ha.info("Persistence loaded",z.persistence,bi({},this.props)),this.update_config(z,z),this.save()}buildStorage(z){g7.indexOf(z.persistence.toLowerCase())===-1&&(ha.critical("Unknown persistence type "+z.persistence+"; falling back to localStorage+cookie"),z.persistence="localStorage+cookie");var W=z.persistence.toLowerCase();return W==="localstorage"&&hc.is_supported()?hc:W==="localstorage+cookie"&&zy.is_supported()?zy:W==="sessionstorage"&&zc.is_supported()?zc:W==="memory"?n7:W==="cookie"?ud:zy.is_supported()?zy:ud}properties(){var z={};return tl(this.props,function(W,ce){if(ce===Gm&&Nu(W))for(var Te=Object.keys(W),D=0;D{this.props.hasOwnProperty(L)&&this.props[L]!==W||(this.props[L]=D,Te=!0)}),Te)return this.save(),!0}return!1}register(z,W){if(Nu(z)){this.expire_days=pa(W)?this.default_expiry:W;var ce=!1;if(tl(z,(Te,D)=>{z.hasOwnProperty(D)&&this.props[D]!==Te&&(this.props[D]=Te,ce=!0)}),ce)return this.save(),!0}return!1}unregister(z){z in this.props&&(delete this.props[z],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var z=Tu.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Hm(Ox(z))||this.register(z),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Tu.searchInfo())}update_referrer_info(){this.register_once(Tu.referrerInfo(),void 0)}set_initial_person_info(){this.props[Sb]||this.props[Mb]||this.register_once({[Eb]:Tu.initialPersonInfo()},void 0)}get_referrer_info(){return Ox({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var z={};tl([Mb,Sb],Te=>{var D=this.props[Te];D&&tl(D,function(L,t){z["$initial_"+xb(t)]=L})});var W=this.props[Eb];if(W){var ce=Tu.initialPersonPropsFromInfo(W);Xc(z,ce)}return z}safe_merge(z){return tl(this.props,function(W,ce){ce in z||(z[ce]=W)}),z}update_config(z,W){if(this.default_expiry=this.expire_days=z.cookie_expiration,this.set_disabled(z.disable_persistence),this.set_cross_subdomain(z.cross_subdomain_cookie),this.set_secure(z.secure_cookie),z.persistence!==W.persistence){var ce=this.buildStorage(z),Te=this.props;this.clear(),this.storage=ce,this.props=Te,this.save()}}set_disabled(z){this.disabled=z,this.disabled?this.remove():this.save()}set_cross_subdomain(z){z!==this.cross_subdomain&&(this.cross_subdomain=z,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(z){z!==this.secure&&(this.secure=z,this.remove(),this.save())}set_event_timer(z,W){var ce=this.props[i1]||{};ce[z]=W,this.props[i1]=ce,this.save()}remove_event_timer(z){var W=(this.props[i1]||{})[z];return pa(W)||(delete this.props[i1][z],this.save()),W}get_property(z){return this.props[z]}set_property(z,W){this.props[z]=W,this.save()}}function Vx(O){var z,W;return((z=JSON.stringify(O,(W=[],function(ce,Te){if(Nu(Te)){for(;W.length>0&&W[W.length-1]!==this;)W.pop();return W.includes(Te)?"[Circular]":(W.push(Te),Te)}return Te})))===null||z===void 0?void 0:z.length)||0}function zb(O){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(O.size>=z&&O.data.length>1){var W=Math.floor(O.data.length/2),ce=O.data.slice(0,W),Te=O.data.slice(W);return[zb({size:Vx(ce),data:ce,sessionId:O.sessionId,windowId:O.windowId}),zb({size:Vx(Te),data:Te,sessionId:O.sessionId,windowId:O.windowId})].flatMap(D=>D)}return[O]}var ed=(O=>(O[O.DomContentLoaded=0]="DomContentLoaded",O[O.Load=1]="Load",O[O.FullSnapshot=2]="FullSnapshot",O[O.IncrementalSnapshot=3]="IncrementalSnapshot",O[O.Meta=4]="Meta",O[O.Custom=5]="Custom",O[O.Plugin=6]="Plugin",O))(ed||{}),$f=(O=>(O[O.Mutation=0]="Mutation",O[O.MouseMove=1]="MouseMove",O[O.MouseInteraction=2]="MouseInteraction",O[O.Scroll=3]="Scroll",O[O.ViewportResize=4]="ViewportResize",O[O.Input=5]="Input",O[O.TouchMove=6]="TouchMove",O[O.MediaInteraction=7]="MediaInteraction",O[O.StyleSheetRule=8]="StyleSheetRule",O[O.CanvasMutation=9]="CanvasMutation",O[O.Font=10]="Font",O[O.Log=11]="Log",O[O.Drag=12]="Drag",O[O.StyleDeclaration=13]="StyleDeclaration",O[O.Selection=14]="Selection",O[O.AdoptedStyleSheet=15]="AdoptedStyleSheet",O[O.CustomElement=16]="CustomElement",O))($f||{});function Y5(O){var z;return O instanceof Element&&(O.id===yk||!((z=O.closest)===null||z===void 0||!z.call(O,".toolbar-global-fade-container")))}function m_(O){return!!O&&O.nodeType===1}function v0(O,z){return!!O&&!!O.tagName&&O.tagName.toLowerCase()===z.toLowerCase()}function Dk(O){return!!O&&O.nodeType===3}function Rk(O){return!!O&&O.nodeType===11}function Jw(O){return O?d_(O).split(/\s+/):[]}function X5(O){var z=Hr==null?void 0:Hr.location.href;return!!(z&&O&&O.some(W=>z.match(W)))}function qx(O){var z="";switch(typeof O.className){case"string":z=O.className;break;case"object":z=(O.className&&"baseVal"in O.className?O.className.baseVal:null)||O.getAttribute("class")||"";break;default:z=""}return Jw(z)}function Fk(O){return nl(O)?null:d_(O).split(/(\s+)/).filter(z=>fv(z)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function v_(O){var z="";return Db(O)&&!jk(O)&&O.childNodes&&O.childNodes.length&&tl(O.childNodes,function(W){var ce;Dk(W)&&W.textContent&&(z+=(ce=Fk(W.textContent))!==null&&ce!==void 0?ce:"")}),d_(z)}function Bk(O){return pa(O.target)?O.srcElement||null:(z=O.target)!==null&&z!==void 0&&z.shadowRoot?O.composedPath()[0]||null:O.target||null;var z}var Ob=["a","button","form","input","select","textarea","label"];function Nk(O){var z=O.parentNode;return!(!z||!m_(z))&&z}function m7(O,z){var W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ce=arguments.length>3?arguments[3]:void 0,Te=arguments.length>4?arguments[4]:void 0;if(!Hr||!O||v0(O,"html")||!m_(O)||W!=null&&W.url_allowlist&&!X5(W.url_allowlist)||W!=null&&W.url_ignorelist&&X5(W.url_ignorelist))return!1;if(W!=null&&W.dom_event_allowlist){var D=W.dom_event_allowlist;if(D&&!D.some(_=>z.type===_))return!1}for(var L=!1,t=[O],b=!0,d=O;d.parentNode&&!v0(d,"body");)if(Rk(d.parentNode))t.push(d.parentNode.host),d=d.parentNode.host;else{if(!(b=Nk(d)))break;if(ce||Ob.indexOf(b.tagName.toLowerCase())>-1)L=!0;else{var e=Hr.getComputedStyle(b);e&&e.getPropertyValue("cursor")==="pointer"&&(L=!0)}t.push(b),d=b}if(!function(_,u){var r=u==null?void 0:u.element_allowlist;if(pa(r))return!0;var n=function(s){if(r.some(c=>s.tagName.toLowerCase()===c))return{v:!0}};for(var l of _){var o=n(l);if(typeof o=="object")return o.v}return!1}(t,W)||!function(_,u){var r=u==null?void 0:u.css_selector_allowlist;if(pa(r))return!0;var n=function(s){if(r.some(c=>s.matches(c)))return{v:!0}};for(var l of _){var o=n(l);if(typeof o=="object")return o.v}return!1}(t,W))return!1;var w=Hr.getComputedStyle(O);if(w&&w.getPropertyValue("cursor")==="pointer"&&z.type==="click")return!0;var y=O.tagName.toLowerCase();switch(y){case"html":return!1;case"form":return(Te||["submit"]).indexOf(z.type)>=0;case"input":case"select":case"textarea":return(Te||["change","click"]).indexOf(z.type)>=0;default:return L?(Te||["click"]).indexOf(z.type)>=0:(Te||["click"]).indexOf(z.type)>=0&&(Ob.indexOf(y)>-1||O.getAttribute("contenteditable")==="true")}}function Db(O){for(var z=O;z.parentNode&&!v0(z,"body");z=z.parentNode){var W=qx(z);if(bo(W,"ph-sensitive")||bo(W,"ph-no-capture"))return!1}if(bo(qx(O),"ph-include"))return!0;var ce=O.type||"";if(Oc(ce))switch(ce.toLowerCase()){case"hidden":case"password":return!1}var Te=O.name||O.id||"";return!(Oc(Te)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(Te.replace(/[^a-zA-Z0-9]/g,"")))}function jk(O){return!!(v0(O,"input")&&!["button","checkbox","submit","reset"].includes(O.type)||v0(O,"select")||v0(O,"textarea")||O.getAttribute("contenteditable")==="true")}var Uk="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",v7=new RegExp("^(?:".concat(Uk,")$")),y7=new RegExp(Uk),Vk="\\d{3}-?\\d{2}-?\\d{4}",x7=new RegExp("^(".concat(Vk,")$")),_7=new RegExp("(".concat(Vk,")"));function fv(O){var z=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(nl(O)||Oc(O)&&(O=d_(O),(z?v7:y7).test((O||"").replace(/[- ]/g,""))||(z?x7:_7).test(O)))}function qk(O){var z=v_(O);return fv(z="".concat(z," ").concat(Hk(O)).trim())?z:""}function Hk(O){var z="";return O&&O.childNodes&&O.childNodes.length&&tl(O.childNodes,function(W){var ce;if(W&&((ce=W.tagName)===null||ce===void 0?void 0:ce.toLowerCase())==="span")try{var Te=v_(W);z="".concat(z," ").concat(Te).trim(),W.childNodes&&W.childNodes.length&&(z="".concat(z," ").concat(Hk(W)).trim())}catch(D){ha.error("[AutoCapture]",D)}}),z}function b7(O){return function(z){var W=z.map(ce=>{var Te,D,L="";if(ce.tag_name&&(L+=ce.tag_name),ce.attr_class)for(var t of(ce.attr_class.sort(),ce.attr_class))L+=".".concat(t.replace(/"/g,""));var b=bi(bi(bi(bi({},ce.text?{text:ce.text}:{}),{},{"nth-child":(Te=ce.nth_child)!==null&&Te!==void 0?Te:0,"nth-of-type":(D=ce.nth_of_type)!==null&&D!==void 0?D:0},ce.href?{href:ce.href}:{}),ce.attr_id?{attr_id:ce.attr_id}:{}),ce.attributes),d={};return rx(b).sort((e,w)=>{var[y]=e,[_]=w;return y.localeCompare(_)}).forEach(e=>{var[w,y]=e;return d[K5(w.toString())]=K5(y.toString())}),L+=":",L+=rx(b).map(e=>{var[w,y]=e;return"".concat(w,'="').concat(y,'"')}).join("")});return W.join(";")}(function(z){return z.map(W=>{var ce,Te,D={text:(ce=W.$el_text)===null||ce===void 0?void 0:ce.slice(0,400),tag_name:W.tag_name,href:(Te=W.attr__href)===null||Te===void 0?void 0:Te.slice(0,2048),attr_class:w7(W),attr_id:W.attr__id,nth_child:W.nth_child,nth_of_type:W.nth_of_type,attributes:{}};return rx(W).filter(L=>{var[t]=L;return t.indexOf("attr__")===0}).forEach(L=>{var[t,b]=L;return D.attributes[t]=b}),D})}(O))}function K5(O){return O.replace(/"|\\"/g,'\\"')}function w7(O){var z=O.attr__class;return z?Bu(z)?z:Jw(z):void 0}var Rb="[SessionRecording]",Fb="redacted",Ry={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:O=>O,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},T7=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],k7=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],A7=["/s/","/e/","/i/"];function J5(O,z,W,ce){if(nl(O))return O;var Te=(z==null?void 0:z["content-length"])||function(D){return new Blob([D]).size}(O);return Oc(Te)&&(Te=parseInt(Te)),Te>W?Rb+" ".concat(ce," body too large to record (").concat(Te," bytes)"):O}function Q5(O,z){if(nl(O))return O;var W=O;return fv(W,!1)||(W=Rb+" "+z+" body "+Fb),tl(k7,ce=>{var Te,D;(Te=W)!==null&&Te!==void 0&&Te.length&&((D=W)===null||D===void 0?void 0:D.indexOf(ce))!==-1&&(W=Rb+" "+z+" body "+Fb+" as might contain: "+ce)}),W}var S7=(O,z)=>{var W,ce,Te,D={payloadSizeLimitBytes:Ry.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ry.performanceEntryTypeToObserve],payloadHostDenyList:[...z.payloadHostDenyList||[],...Ry.payloadHostDenyList]},L=O.session_recording.recordHeaders!==!1&&z.recordHeaders,t=O.session_recording.recordBody!==!1&&z.recordBody,b=O.capture_performance!==!1&&z.recordPerformance,d=(W=D,Te=Math.min(1e6,(ce=W.payloadSizeLimitBytes)!==null&&ce!==void 0?ce:1e6),y=>(y!=null&&y.requestBody&&(y.requestBody=J5(y.requestBody,y.requestHeaders,Te,"Request")),y!=null&&y.responseBody&&(y.responseBody=J5(y.responseBody,y.responseHeaders,Te,"Response")),y)),e=y=>{return d(((r,n)=>{var l,o=Qm(r.name),s=n.indexOf("http")===0?(l=Qm(n))===null||l===void 0?void 0:l.pathname:n;s==="/"&&(s="");var c=o==null?void 0:o.pathname.replace(s||"","");if(!(o&&c&&A7.some(h=>c.indexOf(h)===0)))return r})((u=(_=y).requestHeaders,nl(u)||tl(Object.keys(u??{}),r=>{T7.includes(r.toLowerCase())&&(u[r]=Fb)}),_),O.api_host));var _,u},w=Yh(O.session_recording.maskNetworkRequestFn);return w&&Yh(O.session_recording.maskCapturedNetworkRequestFn)&&ha.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),w&&(O.session_recording.maskCapturedNetworkRequestFn=y=>{var _=O.session_recording.maskNetworkRequestFn({url:y.name});return bi(bi({},y),{},{name:_==null?void 0:_.url})}),D.maskRequestFn=Yh(O.session_recording.maskCapturedNetworkRequestFn)?y=>{var _,u,r,n=e(y);return n&&(_=(u=(r=O.session_recording).maskCapturedNetworkRequestFn)===null||u===void 0?void 0:u.call(r,n))!==null&&_!==void 0?_:void 0}:y=>function(_){if(!pa(_))return _.requestBody=Q5(_.requestBody,"Request"),_.responseBody=Q5(_.responseBody,"Response"),_}(e(y)),bi(bi(bi({},Ry),D),{},{recordHeaders:L,recordBody:t,recordPerformance:b,recordInitialRequests:b})};function bp(O,z,W,ce,Te){return z>W&&(ha.warn("min cannot be greater than max."),z=W),ch(O)?O>W?(ce&&ha.warn(ce+" cannot be greater than max: "+W+". Using max value instead."),W):O1&&arguments[1]!==void 0?arguments[1]:{};Ri(this,"bucketSize",100),Ri(this,"refillRate",10),Ri(this,"mutationBuckets",{}),Ri(this,"loggedTracker",{}),Ri(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(D=>{this.mutationBuckets[D]=this.mutationBuckets[D]+this.refillRate,this.mutationBuckets[D]>=this.bucketSize&&delete this.mutationBuckets[D]})}),Ri(this,"getNodeOrRelevantParent",D=>{var L=this.rrweb.mirror.getNode(D);if((L==null?void 0:L.nodeName)!=="svg"&&L instanceof Element){var t=L.closest("svg");if(t)return[this.rrweb.mirror.getId(t),t]}return[D,L]}),Ri(this,"numberOfChanges",D=>{var L,t,b,d,e,w,y,_;return((L=(t=D.removes)===null||t===void 0?void 0:t.length)!==null&&L!==void 0?L:0)+((b=(d=D.attributes)===null||d===void 0?void 0:d.length)!==null&&b!==void 0?b:0)+((e=(w=D.texts)===null||w===void 0?void 0:w.length)!==null&&e!==void 0?e:0)+((y=(_=D.adds)===null||_===void 0?void 0:_.length)!==null&&y!==void 0?y:0)}),Ri(this,"throttleMutations",D=>{if(D.type!==3||D.data.source!==0)return D;var L=D.data,t=this.numberOfChanges(L);L.attributes&&(L.attributes=L.attributes.filter(d=>{var e,w,y,[_,u]=this.getNodeOrRelevantParent(d.id);return this.mutationBuckets[_]===0?!1:(this.mutationBuckets[_]=(e=this.mutationBuckets[_])!==null&&e!==void 0?e:this.bucketSize,this.mutationBuckets[_]=Math.max(this.mutationBuckets[_]-1,0),this.mutationBuckets[_]===0&&(this.loggedTracker[_]||(this.loggedTracker[_]=!0,(w=(y=this.options).onBlockedNode)===null||w===void 0||w.call(y,_,u))),d)}));var b=this.numberOfChanges(L);return b!==0||t===b?D:void 0}),this.rrweb=z,this.options=Te,this.refillRate=bp((W=this.options.refillRate)!==null&&W!==void 0?W:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=bp((ce=this.options.bucketSize)!==null&&ce!==void 0?ce:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}}var Af=Uint8Array,hh=Uint16Array,pv=Uint32Array,Qw=new Af([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),e3=new Af([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),e4=new Af([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gk=function(O,z){for(var W=new hh(31),ce=0;ce<31;++ce)W[ce]=z+=1<>>1|(21845&Rl)<<1;pg=(61680&(pg=(52428&pg)>>>2|(13107&pg)<<2))>>>4|(3855&pg)<<4,Nb[Rl]=((65280&pg)>>>8|(255&pg)<<8)>>>1}var _1=function(O,z,W){for(var ce=O.length,Te=0,D=new hh(z);Te>>b]=d}else for(L=new hh(ce),Te=0;Te>>15-O[Te];return L},Rg=new Af(288);for(Rl=0;Rl<144;++Rl)Rg[Rl]=8;for(Rl=144;Rl<256;++Rl)Rg[Rl]=9;for(Rl=256;Rl<280;++Rl)Rg[Rl]=7;for(Rl=280;Rl<288;++Rl)Rg[Rl]=8;var Hx=new Af(32);for(Rl=0;Rl<32;++Rl)Hx[Rl]=5;var C7=_1(Rg,9,0),I7=_1(Hx,5,0),Zk=function(O){return(O/8>>0)+(7&O&&1)},$k=function(O,z,W){(W==null||W>O.length)&&(W=O.length);var ce=new(O instanceof hh?hh:O instanceof pv?pv:Af)(W-z);return ce.set(O.subarray(z,W)),ce},Kp=function(O,z,W){W<<=7&z;var ce=z/8>>0;O[ce]|=W,O[ce+1]|=W>>>8},Kv=function(O,z,W){W<<=7&z;var ce=z/8>>0;O[ce]|=W,O[ce+1]|=W>>>8,O[ce+2]|=W>>>16},u2=function(O,z){for(var W=[],ce=0;cey&&(y=D[ce].s);var _=new hh(y+1),u=jb(W[e-1],_,0);if(u>z){ce=0;var r=0,n=u-z,l=1<z))break;r+=l-(1<>>=n;r>0;){var s=D[ce].s;_[s]=0&&r;--ce){var c=D[ce].s;_[c]==z&&(--_[c],++r)}u=z}return[new Af(_),u]},jb=function(O,z,W){return O.s==-1?Math.max(jb(O.l,z,W+1),jb(O.r,z,W+1)):z[O.s]=W},n4=function(O){for(var z=O.length;z&&!O[--z];);for(var W=new hh(++z),ce=0,Te=O[0],D=1,L=function(b){W[ce++]=b},t=1;t<=z;++t)if(O[t]==Te&&t!=z)++D;else{if(!Te&&D>2){for(;D>138;D-=138)L(32754);D>2&&(L(D>10?D-11<<5|28690:D-3<<5|12305),D=0)}else if(D>3){for(L(Te),--D;D>6;D-=6)L(8304);D>2&&(L(D-3<<5|8208),D=0)}for(;D--;)L(Te);D=1,Te=O[t]}return[W.subarray(0,ce),z]},Jv=function(O,z){for(var W=0,ce=0;ce>>8,O[Te+2]=255^O[Te],O[Te+3]=255^O[Te+1];for(var D=0;D4&&!A[e4[S-1]];--S);var T,p,M,f,E=d+5<<3,I=Jv(Te,Rg)+Jv(D,Hx)+L,B=Jv(Te,y)+Jv(D,r)+L+14+3*S+Jv(m,A)+(2*m[16]+3*m[17]+7*m[18]);if(E<=I&&E<=B)return Ub(z,e,O.subarray(b,b+d));if(Kp(z,e,1+(B15&&(Kp(z,e,$[g]>>>5&127),e+=$[g]>>>12)}}}else T=C7,p=Rg,M=I7,f=Hx;for(g=0;g255){ee=ce[g]>>>18&31,Kv(z,e,T[ee+257]),e+=p[ee+257],ee>7&&(Kp(z,e,ce[g]>>>23&31),e+=Qw[ee]);var H=31&ce[g];Kv(z,e,M[H]),e+=f[H],H>3&&(Kv(z,e,ce[g]>>>5&8191),e+=e3[H])}else Kv(z,e,T[ce[g]]),e+=p[ce[g]];return Kv(z,e,T[256]),e+p[256]},P7=new pv([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),L7=function(){for(var O=new pv(256),z=0;z<256;++z){for(var W=z,ce=9;--ce;)W=(1&W&&3988292384)^W>>>1;O[z]=W}return O}(),z7=function(){var O=4294967295;return{p:function(z){for(var W=O,ce=0;ce>>8;O=W},d:function(){return 4294967295^O}}},O7=function(O,z,W,ce,Te){return function(D,L,t,b,d,e){var w=D.length,y=new Af(b+w+5*(1+Math.floor(w/7e3))+d),_=y.subarray(b,y.length-d),u=0;if(!L||w<8)for(var r=0;r<=w;r+=65535){var n=r+65535;n>>13,s=8191&l,c=(1<7e3||M>24576)&&V>423){u=r4(D,_,0,A,v,S,p,M,E,r-E,u),M=T=p=0,E=r;for(var j=0;j<286;++j)v[j]=0;for(j=0;j<30;++j)S[j]=0}var $=2,ee=0,H=s,J=B-N&32767;if(V>2&&I==k(r-J))for(var Q=Math.min(o,V)-1,Z=Math.min(32767,r),K=Math.min(258,V);J<=Z&&--H&&B!=N;){if(D[r+$]==D[r+$-J]){for(var ae=0;ae$){if($=ae,ee=J,ae>Q)break;var se=Math.min(J,ae-2),he=0;for(j=0;jhe&&(he=ie,N=fe)}}}J+=(B=N)-(N=h[B])+32768&32767}if(ee){A[M++]=268435456|Bb[$]<<18|t4[ee];var oe=31&Bb[$],le=31&t4[ee];p+=Qw[oe]+e3[le],++v[257+oe],++S[le],f=r+$,++T}else A[M++]=D[r],++v[D[r]]}}u=r4(D,_,e,A,v,S,p,M,E,r-E,u)}return $k(y,0,b+Zk(u)+d)}(O,z.level==null?6:z.level,z.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(O.length)))):12+z.mem,W,ce,!Te)},Vb=function(O,z,W){for(;W;++z)O[z]=W,W>>>=8},D7=function(O,z){var W=z.filename;if(O[0]=31,O[1]=139,O[2]=8,O[8]=z.level<2?4:z.level==9?2:0,O[9]=3,z.mtime!=0&&Vb(O,4,Math.floor(new Date(z.mtime||Date.now())/1e3)),W){O[3]=8;for(var ce=0;ce<=W.length;++ce)O[ce+10]=W.charCodeAt(ce)}},R7=function(O){return 10+(O.filename&&O.filename.length+1||0)};function Yk(O,z){z===void 0&&(z={});var W=z7(),ce=O.length;W.p(O);var Te=O7(O,z,R7(z),8),D=Te.length;return D7(Te,z),Vb(Te,D-8,W.d()),Vb(Te,D-4,ce),Te}function Xk(O,z){var W=O.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(O);for(var ce=new Af(O.length+(O.length>>>1)),Te=0,D=function(d){ce[Te++]=d},L=0;Lce.length){var t=new Af(Te+8+(W-L<<1));t.set(ce),ce=t}var b=O.charCodeAt(L);b<128||z?D(b):b<2048?(D(192|b>>>6),D(128|63&b)):b>55295&&b<57344?(D(240|(b=65536+(1047552&b)|1023&O.charCodeAt(++L))>>>18),D(128|b>>>12&63),D(128|b>>>6&63),D(128|63&b)):(D(224|b>>>12),D(128|b>>>6&63),D(128|63&b))}return $k(ce,0,Te)}var l1="[SessionRecording]",Zc=Jc(l1),F7=3e5,B7=[$f.MouseMove,$f.MouseInteraction,$f.Scroll,$f.ViewportResize,$f.Input,$f.TouchMove,$f.MediaInteraction,$f.Drag],i4=O=>({rrwebMethod:O,enqueuedAt:Date.now(),attempt:1});function dg(O){return function(z,W){for(var ce="",Te=0;Te>10,56320|1023&D))}return ce}(Yk(Xk(JSON.stringify(O))),!0)}function a4(O){return O.type===ed.Custom&&O.data.tag==="sessionIdle"}function o4(O,z){return z.some(W=>W.matching==="regex"&&new RegExp(W.url).test(O))}class N7{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var z,W;return Wa==null||(z=Wa.__PosthogExtensions__)===null||z===void 0||(W=z.rrweb)===null||W===void 0?void 0:W.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(l1+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var z,W;return this.triggerStatus==="trigger_pending"?6e4:(z=(W=this.instance.config.session_recording)===null||W===void 0?void 0:W.full_snapshot_interval_millis)!==null&&z!==void 0?z:F7}get isSampled(){var z=this.instance.get_property(a1);return Sg(z)?z:null}get sessionDuration(){var z,W,ce=(z=this.buffer)===null||z===void 0?void 0:z.data[((W=this.buffer)===null||W===void 0?void 0:W.data.length)-1],{sessionStartTimestamp:Te}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return ce?ce.timestamp-Te:null}get isRecordingEnabled(){var z=!!this.instance.get_property(wb),W=!this.instance.config.disable_session_recording;return Hr&&z&&W}get isConsoleLogCaptureEnabled(){var z=!!this.instance.get_property(L5),W=this.instance.config.enable_recording_console_log;return W??z}get canvasRecording(){var z,W,ce,Te,D,L,t=this.instance.config.session_recording.captureCanvas,b=this.instance.get_property(O5),d=(z=(W=t==null?void 0:t.recordCanvas)!==null&&W!==void 0?W:b==null?void 0:b.enabled)!==null&&z!==void 0&&z,e=(ce=(Te=t==null?void 0:t.canvasFps)!==null&&Te!==void 0?Te:b==null?void 0:b.fps)!==null&&ce!==void 0?ce:0,w=(D=(L=t==null?void 0:t.canvasQuality)!==null&&L!==void 0?L:b==null?void 0:b.quality)!==null&&D!==void 0?D:0;return{enabled:d,fps:bp(e,0,12,"canvas recording fps"),quality:bp(w,0,1,"canvas recording quality")}}get networkPayloadCapture(){var z,W,ce=this.instance.get_property(z5),Te={recordHeaders:(z=this.instance.config.session_recording)===null||z===void 0?void 0:z.recordHeaders,recordBody:(W=this.instance.config.session_recording)===null||W===void 0?void 0:W.recordBody},D=(Te==null?void 0:Te.recordHeaders)||(ce==null?void 0:ce.recordHeaders),L=(Te==null?void 0:Te.recordBody)||(ce==null?void 0:ce.recordBody),t=Nu(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,b=!!(Sg(t)?t:ce!=null&&ce.capturePerformance);return D||L||b?{recordHeaders:D,recordBody:L,recordPerformance:b}:void 0}get sampleRate(){var z=this.instance.get_property(D5);return ch(z)?z:null}get minimumDuration(){var z=this.instance.get_property(R5);return ch(z)?z:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":nl(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":Sg(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var z;return this._urlTriggers.length===0?"trigger_disabled":((z=this.instance)===null||z===void 0?void 0:z.get_property(r2))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var z;return this._eventTriggers.length===0?"trigger_disabled":((z=this.instance)===null||z===void 0?void 0:z.get_property(i2))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var z=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",W=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return z?"trigger_activated":W?"trigger_pending":"trigger_disabled"}constructor(z){if(Ri(this,"queuedRRWebEvents",[]),Ri(this,"isIdle",!1),Ri(this,"_linkedFlagSeen",!1),Ri(this,"_lastActivityTimestamp",Date.now()),Ri(this,"_linkedFlag",null),Ri(this,"_removePageViewCaptureHook",void 0),Ri(this,"_onSessionIdListener",void 0),Ri(this,"_persistDecideOnSessionListener",void 0),Ri(this,"_samplingSessionListener",void 0),Ri(this,"_urlTriggers",[]),Ri(this,"_urlBlocklist",[]),Ri(this,"_urlBlocked",!1),Ri(this,"_eventTriggers",[]),Ri(this,"_removeEventTriggerCaptureHook",void 0),Ri(this,"_forceAllowLocalhostNetworkCapture",!1),Ri(this,"_onBeforeUnload",()=>{this._flushBuffer()}),Ri(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),Ri(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),Ri(this,"_onVisibilityChange",()=>{if(Xi!=null&&Xi.visibilityState){var Te="window "+Xi.visibilityState;this._tryAddCustomEvent(Te,{})}}),this.instance=z,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Zc.error("started without valid sessionManager"),new Error(l1+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(l1+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:W,windowId:ce}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=W,this.windowId=ce,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Zc.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(z){this.isRecordingEnabled?(this._startCapture(z),Hr==null||Hr.addEventListener("beforeunload",this._onBeforeUnload),Hr==null||Hr.addEventListener("offline",this._onOffline),Hr==null||Hr.addEventListener("online",this._onOnline),Hr==null||Hr.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),nl(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",W=>{try{if(W.event==="$pageview"){var ce=W!=null&&W.properties.$current_url?this._maskUrl(W==null?void 0:W.properties.$current_url):"";if(!ce)return;this._tryAddCustomEvent("$pageview",{href:ce})}}catch(Te){Zc.error("Could not add $pageview to rrweb session",Te)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((W,ce,Te)=>{var D,L,t,b;Te&&(this._tryAddCustomEvent("$session_id_change",{sessionId:W,windowId:ce,changeReason:Te}),(D=this.instance)===null||D===void 0||(L=D.persistence)===null||L===void 0||L.unregister(i2),(t=this.instance)===null||t===void 0||(b=t.persistence)===null||b===void 0||b.unregister(r2))}))):this.stopRecording()}stopRecording(){var z,W,ce,Te;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,Hr==null||Hr.removeEventListener("beforeunload",this._onBeforeUnload),Hr==null||Hr.removeEventListener("offline",this._onOffline),Hr==null||Hr.removeEventListener("online",this._onOnline),Hr==null||Hr.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(z=this._removePageViewCaptureHook)===null||z===void 0||z.call(this),this._removePageViewCaptureHook=void 0,(W=this._removeEventTriggerCaptureHook)===null||W===void 0||W.call(this),this._removeEventTriggerCaptureHook=void 0,(ce=this._onSessionIdListener)===null||ce===void 0||ce.call(this),this._onSessionIdListener=void 0,(Te=this._samplingSessionListener)===null||Te===void 0||Te.call(this),this._samplingSessionListener=void 0,Zc.info("stopped"))}makeSamplingDecision(z){var W,ce=this.sessionId!==z,Te=this.sampleRate;if(ch(Te)){var D,L=this.isSampled,t=ce||!Sg(L);t?D=Math.random(){var y=Nu(w)&&b in w,_=d?w[b]===d:y;_&&this._reportStarted("linked_flag_matched",{linkedFlag:b,linkedVariant:d}),this._linkedFlagSeen=_})}(Te=z.sessionRecording)!==null&&Te!==void 0&&Te.urlTriggers&&(this._urlTriggers=z.sessionRecording.urlTriggers),(D=z.sessionRecording)!==null&&D!==void 0&&D.urlBlocklist&&(this._urlBlocklist=z.sessionRecording.urlBlocklist),(L=z.sessionRecording)!==null&&L!==void 0&&L.eventTriggers&&(this._eventTriggers=z.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){ch(this.sampleRate)&&nl(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(z=>{this.makeSamplingDecision(z)}))}_persistRemoteConfig(z){if(this.instance.persistence){var W,ce=this.instance.persistence,Te=()=>{var D,L,t,b,d,e,w,y,_=(D=z.sessionRecording)===null||D===void 0?void 0:D.sampleRate,u=nl(_)?null:parseFloat(_),r=(L=z.sessionRecording)===null||L===void 0?void 0:L.minimumDurationMilliseconds;ce.register({[wb]:!!z.sessionRecording,[L5]:(t=z.sessionRecording)===null||t===void 0?void 0:t.consoleLogRecordingEnabled,[z5]:bi({capturePerformance:z.capturePerformance},(b=z.sessionRecording)===null||b===void 0?void 0:b.networkPayloadCapture),[O5]:{enabled:(d=z.sessionRecording)===null||d===void 0?void 0:d.recordCanvas,fps:(e=z.sessionRecording)===null||e===void 0?void 0:e.canvasFps,quality:(w=z.sessionRecording)===null||w===void 0?void 0:w.canvasQuality},[D5]:u,[R5]:pa(r)?null:r,[F5]:(y=z.sessionRecording)===null||y===void 0?void 0:y.scriptConfig})};Te(),(W=this._persistDecideOnSessionListener)===null||W===void 0||W.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(Te)}}log(z){var W,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(W=this.instance.sessionRecording)===null||W===void 0||W.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:ce,trace:[],payload:[JSON.stringify(z)]}},timestamp:Date.now()})}_startCapture(z){if(!pa(Object.assign)&&!pa(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var W,ce;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.loadExternalDependency)===null||ce===void 0||ce.call(W,this.instance,this.scriptName,Te=>{if(Te)return Zc.error("could not load recorder",Te);this._onScriptLoaded()}),Zc.info("starting"),this.status==="active"&&this._reportStarted(z||"recording_initialized")}}get scriptName(){var z,W,ce;return((z=this.instance)===null||z===void 0||(W=z.persistence)===null||W===void 0||(ce=W.get_property(F5))===null||ce===void 0?void 0:ce.script)||"recorder"}isInteractiveEvent(z){var W;return z.type===3&&B7.indexOf((W=z.data)===null||W===void 0?void 0:W.source)!==-1}_updateWindowAndSessionIds(z){var W=this.isInteractiveEvent(z);W||this.isIdle||z.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:z.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var ce=!1;if(W&&(this._lastActivityTimestamp=z.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:z.type}),ce=!0)),!this.isIdle){var{windowId:Te,sessionId:D}=this.sessionManager.checkAndGetSessionAndWindowId(!W,z.timestamp),L=this.sessionId!==D,t=this.windowId!==Te;this.windowId=Te,this.sessionId=D,L||t?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):ce&&this._scheduleFullSnapshot()}}_tryRRWebMethod(z){try{return z.rrwebMethod(),!0}catch(W){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:z.enqueuedAt||Date.now(),attempt:z.attempt++,rrwebMethod:z.rrwebMethod}):Zc.warn("could not emit queued rrweb event.",W,z),!1}}_tryAddCustomEvent(z,W){return this._tryRRWebMethod(i4(()=>this.rrwebRecord.addCustomEvent(z,W)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(i4(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var z,W={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},ce=this.instance.config.session_recording;for(var[Te,D]of Object.entries(ce||{}))Te in W&&(Te==="maskInputOptions"?W.maskInputOptions=bi({password:!0},D):W[Te]=D);if(this.canvasRecording&&this.canvasRecording.enabled&&(W.recordCanvas=!0,W.sampling={canvas:this.canvasRecording.fps},W.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(z=this.mutationRateLimiter)!==null&&z!==void 0?z:new M7(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(t,b)=>{var d="Too many mutations on node '".concat(t,"'. Rate limiting. This could be due to SVG animations or something similar");Zc.info(d,{node:b}),this.log(l1+" "+d,"warn")}});var L=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(bi({emit:t=>{this.onRRwebEmit(t)},plugins:L},W)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:W,activePlugins:L.map(t=>t==null?void 0:t.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Zc.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var z=this.fullSnapshotIntervalMillis;z&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},z))}}_gatherRRWebPlugins(){var z,W,ce,Te,D=[],L=(z=Wa.__PosthogExtensions__)===null||z===void 0||(W=z.rrwebPlugins)===null||W===void 0?void 0:W.getRecordConsolePlugin;L&&this.isConsoleLogCaptureEnabled&&D.push(L());var t=(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.rrwebPlugins)===null||Te===void 0?void 0:Te.getRecordNetworkPlugin;return this.networkPayloadCapture&&Yh(t)&&(!r7.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?D.push(t(S7(this.instance.config,this.networkPayloadCapture))):Zc.info("NetworkCapture not started because we are on localhost.")),D}onRRwebEmit(z){var W;if(this._processQueuedEvents(),z&&Nu(z)){if(z.type===ed.Meta){var ce=this._maskUrl(z.data.href);if(this._lastHref=ce,!ce)return;z.data.href=ce}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(w){return w.type===ed.Custom&&w.data.tag==="recording paused"}(z)){z.type===ed.FullSnapshot&&this._scheduleFullSnapshot(),z.type===ed.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var Te=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(z):z;if(Te){var D=function(w){var y=w;if(y&&Nu(y)&&y.type===6&&Nu(y.data)&&y.data.plugin==="rrweb/console@1"){y.data.payload.payload.length>10&&(y.data.payload.payload=y.data.payload.payload.slice(0,10),y.data.payload.payload.push("...[truncated]"));for(var _=[],u=0;u2e3?_.push(y.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):_.push(y.data.payload.payload[u]);return y.data.payload.payload=_,w}return w}(Te);if(this._updateWindowAndSessionIds(D),!this.isIdle||a4(D)){if(a4(D)){var L=D.data.payload;if(L){var t=L.lastActivityTimestamp,b=L.threshold;D.timestamp=t+b}}var d=(W=this.instance.config.session_recording.compress_events)===null||W===void 0||W?function(w){if(Vx(w)<1024)return w;try{if(w.type===ed.FullSnapshot)return bi(bi({},w),{},{data:dg(w.data),cv:"2024-10"});if(w.type===ed.IncrementalSnapshot&&w.data.source===$f.Mutation)return bi(bi({},w),{},{cv:"2024-10",data:bi(bi({},w.data),{},{texts:dg(w.data.texts),attributes:dg(w.data.attributes),removes:dg(w.data.removes),adds:dg(w.data.adds)})});if(w.type===ed.IncrementalSnapshot&&w.data.source===$f.StyleSheetRule)return bi(bi({},w),{},{cv:"2024-10",data:bi(bi({},w.data),{},{adds:dg(w.data.adds),removes:dg(w.data.removes)})})}catch(y){Zc.error("could not compress event - will use uncompressed event",y)}return w}(D):D,e={$snapshot_bytes:Vx(d),$snapshot_data:d,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(e):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&Hr){var z=this._maskUrl(Hr.location.href);this._lastHref!==z&&(this._tryAddCustomEvent("$url_changed",{href:z}),this._lastHref=z)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var z=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],z.forEach(W=>{Date.now()-W.enqueuedAt<=2e3&&this._tryRRWebMethod(W)})}}_maskUrl(z){var W=this.instance.config.session_recording;if(W.maskNetworkRequestFn){var ce,Te={url:z};return(ce=Te=W.maskNetworkRequestFn(Te))===null||ce===void 0?void 0:ce.url}return z}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var z=this.minimumDuration,W=this.sessionDuration,ce=ch(W)&&W>=0,Te=ch(z)&&ce&&W{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&zb(this.buffer).forEach(D=>{this._captureSnapshot({$snapshot_bytes:D.size,$snapshot_data:D.data,$session_id:D.sessionId,$window_id:D.windowId,$lib:"web",$lib_version:id.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(z){var W,ce=2+(((W=this.buffer)===null||W===void 0?void 0:W.data.length)||0);!this.isIdle&&(this.buffer.size+z.$snapshot_bytes+ce>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=z.$snapshot_bytes,this.buffer.data.push(z.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(z){this.instance.capture("$snapshot",z,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(Hr!==void 0&&Hr.location.href){var z=Hr.location.href,W=this.status==="paused",ce=o4(z,this._urlBlocklist);ce&&!W?this._pauseRecording():!ce&&W&&this._resumeRecording(),o4(z,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(z){var W,ce;this.triggerStatus==="trigger_pending"&&((W=this.instance)===null||W===void 0||(ce=W.persistence)===null||ce===void 0||ce.register({[z==="url"?r2:i2]:this.sessionId}),this._flushBuffer(),this._reportStarted(z+"_trigger_matched"))}_pauseRecording(){this.status!=="paused"&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Zc.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this.status==="paused"&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Zc.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&nl(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",z=>{try{this._eventTriggers.includes(z.event)&&this._activateTrigger("event")}catch(W){Zc.error("Could not activate event trigger",W)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var z;(z=this.instance.persistence)===null||z===void 0||z.register({[a1]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(z){this._activateTrigger(z)}_reportStarted(z,W){this.instance.register_for_session({$session_recording_start_reason:z}),Zc.info(z.replace("_"," "),W),bo(["recording_initialized","session_id_changed"],z)||this._tryAddCustomEvent(z,W)}}var gg=Jc("[RemoteConfig]");class j7{constructor(z){this.instance=z}get remoteConfig(){var z,W;return(z=Wa._POSTHOG_REMOTE_CONFIG)===null||z===void 0||(W=z[this.instance.config.token])===null||W===void 0?void 0:W.config}_loadRemoteConfigJs(z){var W,ce,Te;(W=Wa.__PosthogExtensions__)!==null&&W!==void 0&&W.loadExternalDependency?(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.loadExternalDependency)===null||Te===void 0||Te.call(ce,this.instance,"remote-config",()=>z(this.remoteConfig)):(gg.error("PostHog Extensions not found. Cannot load remote config."),z())}_loadRemoteConfigJSON(z){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:W=>{z(W.json)}})}load(){try{if(this.remoteConfig)return gg.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void gg.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(z=>{if(!z)return gg.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(W=>{this.onRemoteConfig(W)});this.onRemoteConfig(z)})}catch(z){gg.error("Error loading remote config",z)}}onRemoteConfig(z){z?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(z),z.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):gg.info("__preview_remote_config is disabled. Logging config instead",z):gg.error("Failed to fetch remote config from PostHog.")}}var td,U7=Hr!=null&&Hr.location?jx(Hr.location.hash,"__posthog")||jx(location.hash,"state"):null,s4="_postHogToolbarParams",l4=Jc("[Toolbar]");(function(O){O[O.UNINITIALIZED=0]="UNINITIALIZED",O[O.LOADING=1]="LOADING",O[O.LOADED=2]="LOADED"})(td||(td={}));class V7{constructor(z){this.instance=z}setToolbarState(z){Wa.ph_toolbar_state=z}getToolbarState(){var z;return(z=Wa.ph_toolbar_state)!==null&&z!==void 0?z:td.UNINITIALIZED}maybeLoadToolbar(){var z,W,ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!Hr||!Xi)return!1;ce=(z=ce)!==null&&z!==void 0?z:Hr.location,D=(W=D)!==null&&W!==void 0?W:Hr.history;try{if(!Te){try{Hr.localStorage.setItem("test","test"),Hr.localStorage.removeItem("test")}catch{return!1}Te=Hr==null?void 0:Hr.localStorage}var L,t=U7||jx(ce.hash,"__posthog")||jx(ce.hash,"state"),b=t?M5(()=>JSON.parse(atob(decodeURIComponent(t))))||M5(()=>JSON.parse(decodeURIComponent(t))):null;return b&&b.action==="ph_authorize"?((L=b).source="url",L&&Object.keys(L).length>0&&(b.desiredHash?ce.hash=b.desiredHash:D?D.replaceState(D.state,"",ce.pathname+ce.search):ce.hash="")):((L=JSON.parse(Te.getItem(s4)||"{}")).source="localstorage",delete L.userIntent),!(!L.token||this.instance.config.token!==L.token)&&(this.loadToolbar(L),!0)}catch{return!1}}_callLoadToolbar(z){var W=Wa.ph_load_toolbar||Wa.ph_load_editor;!nl(W)&&Yh(W)?W(z,this.instance):l4.warn("No toolbar load function found")}loadToolbar(z){var W=!(Xi==null||!Xi.getElementById(yk));if(!Hr||W)return!1;var ce=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,Te=bi(bi({token:this.instance.config.token},z),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},ce?{instrument:!1}:{});if(Hr.localStorage.setItem(s4,JSON.stringify(bi(bi({},Te),{},{source:void 0}))),this.getToolbarState()===td.LOADED)this._callLoadToolbar(Te);else if(this.getToolbarState()===td.UNINITIALIZED){var D,L;this.setToolbarState(td.LOADING),(D=Wa.__PosthogExtensions__)===null||D===void 0||(L=D.loadExternalDependency)===null||L===void 0||L.call(D,this.instance,"toolbar",t=>{if(t)return l4.error("[Toolbar] Failed to load",t),void this.setToolbarState(td.UNINITIALIZED);this.setToolbarState(td.LOADED),this._callLoadToolbar(Te)}),ad(Hr,"turbolinks:load",()=>{this.setToolbarState(td.UNINITIALIZED),this.loadToolbar(Te)})}return!0}_loadEditor(z){return this.loadToolbar(z)}maybeLoadEditor(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(z,W,ce)}}class q7{constructor(z){Ri(this,"isPaused",!0),Ri(this,"queue",[]),Ri(this,"flushTimeoutMs",3e3),this.sendRequest=z}enqueue(z){this.queue.push(z),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var z=this.queue.length>0?this.formatQueue():{},W=Object.values(z),ce=[...W.filter(Te=>Te.url.indexOf("/e")===0),...W.filter(Te=>Te.url.indexOf("/e")!==0)];ce.map(Te=>{this.sendRequest(bi(bi({},Te),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var z=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var W=this.formatQueue(),ce=function(D){var L=W[D],t=new Date().getTime();L.data&&Bu(L.data)&&tl(L.data,b=>{b.offset=Math.abs(b.timestamp-t),delete b.timestamp}),z.sendRequest(L)};for(var Te in W)ce(Te)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var z={};return tl(this.queue,W=>{var ce,Te=W,D=(Te?Te.batchKey:null)||Te.url;pa(z[D])&&(z[D]=bi(bi({},Te),{},{data:[]})),(ce=z[D].data)===null||ce===void 0||ce.push(Te.data)}),this.queue=[],z}}var H7=function(O){var z,W,ce,Te,D="";for(z=W=0,ce=(O=(O+"").replace(/\r\n/g,` +`+D.stack}return{value:O,source:z,stack:Te,digest:null}}function J_(O,z,W){return{value:O,source:null,stack:W??null,digest:z??null}}function rb(O,z){try{console.error(z.value)}catch(W){setTimeout(function(){throw W})}}var dM=typeof WeakMap=="function"?WeakMap:Map;function OT(O,z,W){W=ld(-1,W),W.tag=3,W.payload={element:null};var ce=z.value;return W.callback=function(){Cx||(Cx=!0,pb=ce),rb(O,z)},W}function DT(O,z,W){W=ld(-1,W),W.tag=3;var ce=O.type.getDerivedStateFromError;if(typeof ce=="function"){var Te=z.value;W.payload=function(){return ce(Te)},W.callback=function(){rb(O,z)}}var D=O.stateNode;return D!==null&&typeof D.componentDidCatch=="function"&&(W.callback=function(){rb(O,z),typeof ce!="function"&&(p0===null?p0=new Set([this]):p0.add(this));var L=z.stack;this.componentDidCatch(z.value,{componentStack:L!==null?L:""})}),W}function n5(O,z,W){var ce=O.pingCache;if(ce===null){ce=O.pingCache=new dM;var Te=new Set;ce.set(z,Te)}else Te=ce.get(z),Te===void 0&&(Te=new Set,ce.set(z,Te));Te.has(W)||(Te.add(W),O=EM.bind(null,O,z,W),z.then(O,O))}function r5(O){do{var z;if((z=O.tag===13)&&(z=O.memoizedState,z=z!==null?z.dehydrated!==null:!0),z)return O;O=O.return}while(O!==null);return null}function i5(O,z,W,ce,Te){return O.mode&1?(O.flags|=65536,O.lanes=Te,O):(O===z?O.flags|=65536:(O.flags|=128,W.flags|=131072,W.flags&=-52805,W.tag===1&&(W.alternate===null?W.tag=17:(z=ld(-1,1),z.tag=2,f0(W,z,1))),W.lanes|=1),O)}var gM=dd.ReactCurrentOwner,kh=!1;function uh(O,z,W,ce){z.child=O===null?cT(z,null,W,ce):ov(z,O.child,W,ce)}function a5(O,z,W,ce,Te){W=W.render;var D=z.ref;return Km(z,Te),ce=Lw(O,z,W,ce,D,Te),W=zw(),O!==null&&!kh?(z.updateQueue=O.updateQueue,z.flags&=-2053,O.lanes&=~Te,pd(O,z,Te)):(Jl&&W&&_w(z),z.flags|=1,uh(O,z,ce,Te),z.child)}function o5(O,z,W,ce,Te){if(O===null){var D=W.type;return typeof D=="function"&&!qw(D)&&D.defaultProps===void 0&&W.compare===null&&W.defaultProps===void 0?(z.tag=15,z.type=D,RT(O,z,D,ce,Te)):(O=nx(W.type,null,ce,z,z.mode,Te),O.ref=z.ref,O.return=z,z.child=O)}if(D=O.child,!(O.lanes&Te)){var L=D.memoizedProps;if(W=W.compare,W=W!==null?W:I1,W(L,ce)&&O.ref===z.ref)return pd(O,z,Te)}return z.flags|=1,O=g0(D,ce),O.ref=z.ref,O.return=z,z.child=O}function RT(O,z,W,ce,Te){if(O!==null){var D=O.memoizedProps;if(I1(D,ce)&&O.ref===z.ref)if(kh=!1,z.pendingProps=ce=D,(O.lanes&Te)!==0)O.flags&131072&&(kh=!0);else return z.lanes=O.lanes,pd(O,z,Te)}return ib(O,z,W,ce,Te)}function FT(O,z,W){var ce=z.pendingProps,Te=ce.children,D=O!==null?O.memoizedState:null;if(ce.mode==="hidden")if(!(z.mode&1))z.memoizedState={baseLanes:0,cachePool:null,transitions:null},ml(qm,Wh),Wh|=W;else{if(!(W&1073741824))return O=D!==null?D.baseLanes|W:W,z.lanes=z.childLanes=1073741824,z.memoizedState={baseLanes:O,cachePool:null,transitions:null},z.updateQueue=null,ml(qm,Wh),Wh|=O,null;z.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce=D!==null?D.baseLanes:W,ml(qm,Wh),Wh|=ce}else D!==null?(ce=D.baseLanes|W,z.memoizedState=null):ce=W,ml(qm,Wh),Wh|=ce;return uh(O,z,Te,W),z.child}function BT(O,z){var W=z.ref;(O===null&&W!==null||O!==null&&O.ref!==W)&&(z.flags|=512,z.flags|=2097152)}function ib(O,z,W,ce,Te){var D=Mh(W)?Ig:Kc.current;return D=iv(z,D),Km(z,Te),W=Lw(O,z,W,ce,D,Te),ce=zw(),O!==null&&!kh?(z.updateQueue=O.updateQueue,z.flags&=-2053,O.lanes&=~Te,pd(O,z,Te)):(Jl&&ce&&_w(z),z.flags|=1,uh(O,z,W,Te),z.child)}function s5(O,z,W,ce,Te){if(Mh(W)){var D=!0;xx(z)}else D=!1;if(Km(z,Te),z.stateNode===null)Qy(O,z),zT(z,W,ce),nb(z,W,ce,Te),ce=!0;else if(O===null){var L=z.stateNode,t=z.memoizedProps;L.props=t;var b=L.context,d=W.contextType;typeof d=="object"&&d!==null?d=Sf(d):(d=Mh(W)?Ig:Kc.current,d=iv(z,d));var e=W.getDerivedStateFromProps,w=typeof e=="function"||typeof L.getSnapshotBeforeUpdate=="function";w||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(t!==ce||b!==d)&&t5(z,L,ce,d),Jd=!1;var y=z.memoizedState;L.state=y,kx(z,ce,L,Te),b=z.memoizedState,t!==ce||y!==b||Sh.current||Jd?(typeof e=="function"&&(tb(z,W,e,ce),b=z.memoizedState),(t=Jd||e5(z,W,t,ce,y,b,d))?(w||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(z.flags|=4194308)):(typeof L.componentDidMount=="function"&&(z.flags|=4194308),z.memoizedProps=ce,z.memoizedState=b),L.props=ce,L.state=b,L.context=d,ce=t):(typeof L.componentDidMount=="function"&&(z.flags|=4194308),ce=!1)}else{L=z.stateNode,fT(O,z),t=z.memoizedProps,d=z.type===z.elementType?t:Zf(z.type,t),L.props=d,w=z.pendingProps,y=L.context,b=W.contextType,typeof b=="object"&&b!==null?b=Sf(b):(b=Mh(W)?Ig:Kc.current,b=iv(z,b));var _=W.getDerivedStateFromProps;(e=typeof _=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(t!==w||y!==b)&&t5(z,L,ce,b),Jd=!1,y=z.memoizedState,L.state=y,kx(z,ce,L,Te);var u=z.memoizedState;t!==w||y!==u||Sh.current||Jd?(typeof _=="function"&&(tb(z,W,_,ce),u=z.memoizedState),(d=Jd||e5(z,W,d,ce,y,u,b)||!1)?(e||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(ce,u,b),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(ce,u,b)),typeof L.componentDidUpdate=="function"&&(z.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(z.flags|=1024)):(typeof L.componentDidUpdate!="function"||t===O.memoizedProps&&y===O.memoizedState||(z.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||t===O.memoizedProps&&y===O.memoizedState||(z.flags|=1024),z.memoizedProps=ce,z.memoizedState=u),L.props=ce,L.state=u,L.context=b,ce=d):(typeof L.componentDidUpdate!="function"||t===O.memoizedProps&&y===O.memoizedState||(z.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||t===O.memoizedProps&&y===O.memoizedState||(z.flags|=1024),ce=!1)}return ab(O,z,W,ce,D,Te)}function ab(O,z,W,ce,Te,D){BT(O,z);var L=(z.flags&128)!==0;if(!ce&&!L)return Te&&W3(z,W,!1),pd(O,z,D);ce=z.stateNode,gM.current=z;var t=L&&typeof W.getDerivedStateFromError!="function"?null:ce.render();return z.flags|=1,O!==null&&L?(z.child=ov(z,O.child,null,D),z.child=ov(z,null,t,D)):uh(O,z,t,D),z.memoizedState=ce.state,Te&&W3(z,W,!0),z.child}function NT(O){var z=O.stateNode;z.pendingContext?G3(O,z.pendingContext,z.pendingContext!==z.context):z.context&&G3(O,z.context,!1),Ew(O,z.containerInfo)}function l5(O,z,W,ce,Te){return av(),ww(Te),z.flags|=256,uh(O,z,W,ce),z.child}var ob={dehydrated:null,treeContext:null,retryLane:0};function sb(O){return{baseLanes:O,cachePool:null,transitions:null}}function jT(O,z,W){var ce=z.pendingProps,Te=pu.current,D=!1,L=(z.flags&128)!==0,t;if((t=L)||(t=O!==null&&O.memoizedState===null?!1:(Te&2)!==0),t?(D=!0,z.flags&=-129):(O===null||O.memoizedState!==null)&&(Te|=1),ml(pu,Te&1),O===null)return Q2(z),O=z.memoizedState,O!==null&&(O=O.dehydrated,O!==null)?(z.mode&1?O.data==="$!"?z.lanes=8:z.lanes=1073741824:z.lanes=1,null):(L=ce.children,O=ce.fallback,D?(ce=z.mode,D=z.child,L={mode:"hidden",children:L},!(ce&1)&&D!==null?(D.childLanes=0,D.pendingProps=L):D=u_(L,ce,0,null),O=Cg(O,ce,W,null),D.return=z,O.return=z,D.sibling=O,z.child=D,z.child.memoizedState=sb(W),z.memoizedState=ob,O):Rw(z,L));if(Te=O.memoizedState,Te!==null&&(t=Te.dehydrated,t!==null))return mM(O,z,L,ce,t,Te,W);if(D){D=ce.fallback,L=z.mode,Te=O.child,t=Te.sibling;var b={mode:"hidden",children:ce.children};return!(L&1)&&z.child!==Te?(ce=z.child,ce.childLanes=0,ce.pendingProps=b,z.deletions=null):(ce=g0(Te,b),ce.subtreeFlags=Te.subtreeFlags&14680064),t!==null?D=g0(t,D):(D=Cg(D,L,W,null),D.flags|=2),D.return=z,ce.return=z,ce.sibling=D,z.child=ce,ce=D,D=z.child,L=O.child.memoizedState,L=L===null?sb(W):{baseLanes:L.baseLanes|W,cachePool:null,transitions:L.transitions},D.memoizedState=L,D.childLanes=O.childLanes&~W,z.memoizedState=ob,ce}return D=O.child,O=D.sibling,ce=g0(D,{mode:"visible",children:ce.children}),!(z.mode&1)&&(ce.lanes=W),ce.return=z,ce.sibling=null,O!==null&&(W=z.deletions,W===null?(z.deletions=[O],z.flags|=16):W.push(O)),z.child=ce,z.memoizedState=null,ce}function Rw(O,z){return z=u_({mode:"visible",children:z},O.mode,0,null),z.return=O,O.child=z}function Sy(O,z,W,ce){return ce!==null&&ww(ce),ov(z,O.child,null,W),O=Rw(z,z.pendingProps.children),O.flags|=2,z.memoizedState=null,O}function mM(O,z,W,ce,Te,D,L){if(W)return z.flags&256?(z.flags&=-257,ce=J_(Error(wi(422))),Sy(O,z,L,ce)):z.memoizedState!==null?(z.child=O.child,z.flags|=128,null):(D=ce.fallback,Te=z.mode,ce=u_({mode:"visible",children:ce.children},Te,0,null),D=Cg(D,Te,L,null),D.flags|=2,ce.return=z,D.return=z,ce.sibling=D,z.child=ce,z.mode&1&&ov(z,O.child,null,L),z.child.memoizedState=sb(L),z.memoizedState=ob,D);if(!(z.mode&1))return Sy(O,z,L,null);if(Te.data==="$!"){if(ce=Te.nextSibling&&Te.nextSibling.dataset,ce)var t=ce.dgst;return ce=t,D=Error(wi(419)),ce=J_(D,ce,void 0),Sy(O,z,L,ce)}if(t=(L&O.childLanes)!==0,kh||t){if(ce=kc,ce!==null){switch(L&-L){case 4:Te=2;break;case 16:Te=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:Te=32;break;case 536870912:Te=268435456;break;default:Te=0}Te=Te&(ce.suspendedLanes|L)?0:Te,Te!==0&&Te!==D.retryLane&&(D.retryLane=Te,fd(O,Te),Jf(ce,O,Te,-1))}return Vw(),ce=J_(Error(wi(421))),Sy(O,z,L,ce)}return Te.data==="$?"?(z.flags|=128,z.child=O.child,z=CM.bind(null,O),Te._reactRetry=z,null):(O=D.treeContext,Zh=h0(Te.nextSibling),Xh=z,Jl=!0,Xf=null,O!==null&&(xf[_f++]=od,xf[_f++]=sd,xf[_f++]=Pg,od=O.id,sd=O.overflow,Pg=z),z=Rw(z,ce.children),z.flags|=4096,z)}function u5(O,z,W){O.lanes|=z;var ce=O.alternate;ce!==null&&(ce.lanes|=z),eb(O.return,z,W)}function Q_(O,z,W,ce,Te){var D=O.memoizedState;D===null?O.memoizedState={isBackwards:z,rendering:null,renderingStartTime:0,last:ce,tail:W,tailMode:Te}:(D.isBackwards=z,D.rendering=null,D.renderingStartTime=0,D.last=ce,D.tail=W,D.tailMode=Te)}function UT(O,z,W){var ce=z.pendingProps,Te=ce.revealOrder,D=ce.tail;if(uh(O,z,ce.children,W),ce=pu.current,ce&2)ce=ce&1|2,z.flags|=128;else{if(O!==null&&O.flags&128)e:for(O=z.child;O!==null;){if(O.tag===13)O.memoizedState!==null&&u5(O,W,z);else if(O.tag===19)u5(O,W,z);else if(O.child!==null){O.child.return=O,O=O.child;continue}if(O===z)break e;for(;O.sibling===null;){if(O.return===null||O.return===z)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}ce&=1}if(ml(pu,ce),!(z.mode&1))z.memoizedState=null;else switch(Te){case"forwards":for(W=z.child,Te=null;W!==null;)O=W.alternate,O!==null&&Ax(O)===null&&(Te=W),W=W.sibling;W=Te,W===null?(Te=z.child,z.child=null):(Te=W.sibling,W.sibling=null),Q_(z,!1,Te,W,D);break;case"backwards":for(W=null,Te=z.child,z.child=null;Te!==null;){if(O=Te.alternate,O!==null&&Ax(O)===null){z.child=Te;break}O=Te.sibling,Te.sibling=W,W=Te,Te=O}Q_(z,!0,W,null,D);break;case"together":Q_(z,!1,null,null,void 0);break;default:z.memoizedState=null}return z.child}function Qy(O,z){!(z.mode&1)&&O!==null&&(O.alternate=null,z.alternate=null,z.flags|=2)}function pd(O,z,W){if(O!==null&&(z.dependencies=O.dependencies),zg|=z.lanes,!(W&z.childLanes))return null;if(O!==null&&z.child!==O.child)throw Error(wi(153));if(z.child!==null){for(O=z.child,W=g0(O,O.pendingProps),z.child=W,W.return=z;O.sibling!==null;)O=O.sibling,W=W.sibling=g0(O,O.pendingProps),W.return=z;W.sibling=null}return z.child}function vM(O,z,W){switch(z.tag){case 3:NT(z),av();break;case 5:pT(z);break;case 1:Mh(z.type)&&xx(z);break;case 4:Ew(z,z.stateNode.containerInfo);break;case 10:var ce=z.type._context,Te=z.memoizedProps.value;ml(wx,ce._currentValue),ce._currentValue=Te;break;case 13:if(ce=z.memoizedState,ce!==null)return ce.dehydrated!==null?(ml(pu,pu.current&1),z.flags|=128,null):W&z.child.childLanes?jT(O,z,W):(ml(pu,pu.current&1),O=pd(O,z,W),O!==null?O.sibling:null);ml(pu,pu.current&1);break;case 19:if(ce=(W&z.childLanes)!==0,O.flags&128){if(ce)return UT(O,z,W);z.flags|=128}if(Te=z.memoizedState,Te!==null&&(Te.rendering=null,Te.tail=null,Te.lastEffect=null),ml(pu,pu.current),ce)break;return null;case 22:case 23:return z.lanes=0,FT(O,z,W)}return pd(O,z,W)}var VT,lb,qT,HT;VT=function(O,z){for(var W=z.child;W!==null;){if(W.tag===5||W.tag===6)O.appendChild(W.stateNode);else if(W.tag!==4&&W.child!==null){W.child.return=W,W=W.child;continue}if(W===z)break;for(;W.sibling===null;){if(W.return===null||W.return===z)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};lb=function(){};qT=function(O,z,W,ce){var Te=O.memoizedProps;if(Te!==ce){O=z.stateNode,Ag(Tp.current);var D=null;switch(W){case"input":Te=I2(O,Te),ce=I2(O,ce),D=[];break;case"select":Te=gu({},Te,{value:void 0}),ce=gu({},ce,{value:void 0}),D=[];break;case"textarea":Te=z2(O,Te),ce=z2(O,ce),D=[];break;default:typeof Te.onClick!="function"&&typeof ce.onClick=="function"&&(O.onclick=vx)}D2(W,ce);var L;W=null;for(d in Te)if(!ce.hasOwnProperty(d)&&Te.hasOwnProperty(d)&&Te[d]!=null)if(d==="style"){var t=Te[d];for(L in t)t.hasOwnProperty(L)&&(W||(W={}),W[L]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(T1.hasOwnProperty(d)?D||(D=[]):(D=D||[]).push(d,null));for(d in ce){var b=ce[d];if(t=Te!=null?Te[d]:void 0,ce.hasOwnProperty(d)&&b!==t&&(b!=null||t!=null))if(d==="style")if(t){for(L in t)!t.hasOwnProperty(L)||b&&b.hasOwnProperty(L)||(W||(W={}),W[L]="");for(L in b)b.hasOwnProperty(L)&&t[L]!==b[L]&&(W||(W={}),W[L]=b[L])}else W||(D||(D=[]),D.push(d,W)),W=b;else d==="dangerouslySetInnerHTML"?(b=b?b.__html:void 0,t=t?t.__html:void 0,b!=null&&t!==b&&(D=D||[]).push(d,b)):d==="children"?typeof b!="string"&&typeof b!="number"||(D=D||[]).push(d,""+b):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(T1.hasOwnProperty(d)?(b!=null&&d==="onScroll"&&Dl("scroll",O),D||t===b||(D=[])):(D=D||[]).push(d,b))}W&&(D=D||[]).push("style",W);var d=D;(z.updateQueue=d)&&(z.flags|=4)}};HT=function(O,z,W,ce){W!==ce&&(z.flags|=4)};function $v(O,z){if(!Jl)switch(O.tailMode){case"hidden":z=O.tail;for(var W=null;z!==null;)z.alternate!==null&&(W=z),z=z.sibling;W===null?O.tail=null:W.sibling=null;break;case"collapsed":W=O.tail;for(var ce=null;W!==null;)W.alternate!==null&&(ce=W),W=W.sibling;ce===null?z||O.tail===null?O.tail=null:O.tail.sibling=null:ce.sibling=null}}function Wc(O){var z=O.alternate!==null&&O.alternate.child===O.child,W=0,ce=0;if(z)for(var Te=O.child;Te!==null;)W|=Te.lanes|Te.childLanes,ce|=Te.subtreeFlags&14680064,ce|=Te.flags&14680064,Te.return=O,Te=Te.sibling;else for(Te=O.child;Te!==null;)W|=Te.lanes|Te.childLanes,ce|=Te.subtreeFlags,ce|=Te.flags,Te.return=O,Te=Te.sibling;return O.subtreeFlags|=ce,O.childLanes=W,z}function yM(O,z,W){var ce=z.pendingProps;switch(bw(z),z.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wc(z),null;case 1:return Mh(z.type)&&yx(),Wc(z),null;case 3:return ce=z.stateNode,sv(),Fl(Sh),Fl(Kc),Iw(),ce.pendingContext&&(ce.context=ce.pendingContext,ce.pendingContext=null),(O===null||O.child===null)&&(ky(z)?z.flags|=4:O===null||O.memoizedState.isDehydrated&&!(z.flags&256)||(z.flags|=1024,Xf!==null&&(mb(Xf),Xf=null))),lb(O,z),Wc(z),null;case 5:Cw(z);var Te=Ag(D1.current);if(W=z.type,O!==null&&z.stateNode!=null)qT(O,z,W,ce,Te),O.ref!==z.ref&&(z.flags|=512,z.flags|=2097152);else{if(!ce){if(z.stateNode===null)throw Error(wi(166));return Wc(z),null}if(O=Ag(Tp.current),ky(z)){ce=z.stateNode,W=z.type;var D=z.memoizedProps;switch(ce[vp]=z,ce[z1]=D,O=(z.mode&1)!==0,W){case"dialog":Dl("cancel",ce),Dl("close",ce);break;case"iframe":case"object":case"embed":Dl("load",ce);break;case"video":case"audio":for(Te=0;Te<\/script>",O=O.removeChild(O.firstChild)):typeof ce.is=="string"?O=L.createElement(W,{is:ce.is}):(O=L.createElement(W),W==="select"&&(L=O,ce.multiple?L.multiple=!0:ce.size&&(L.size=ce.size))):O=L.createElementNS(O,W),O[vp]=z,O[z1]=ce,VT(O,z,!1,!1),z.stateNode=O;e:{switch(L=R2(W,ce),W){case"dialog":Dl("cancel",O),Dl("close",O),Te=ce;break;case"iframe":case"object":case"embed":Dl("load",O),Te=ce;break;case"video":case"audio":for(Te=0;Teuv&&(z.flags|=128,ce=!0,$v(D,!1),z.lanes=4194304)}else{if(!ce)if(O=Ax(L),O!==null){if(z.flags|=128,ce=!0,W=O.updateQueue,W!==null&&(z.updateQueue=W,z.flags|=4),$v(D,!0),D.tail===null&&D.tailMode==="hidden"&&!L.alternate&&!Jl)return Wc(z),null}else 2*Fu()-D.renderingStartTime>uv&&W!==1073741824&&(z.flags|=128,ce=!0,$v(D,!1),z.lanes=4194304);D.isBackwards?(L.sibling=z.child,z.child=L):(W=D.last,W!==null?W.sibling=L:z.child=L,D.last=L)}return D.tail!==null?(z=D.tail,D.rendering=z,D.tail=z.sibling,D.renderingStartTime=Fu(),z.sibling=null,W=pu.current,ml(pu,ce?W&1|2:W&1),z):(Wc(z),null);case 22:case 23:return Uw(),ce=z.memoizedState!==null,O!==null&&O.memoizedState!==null!==ce&&(z.flags|=8192),ce&&z.mode&1?Wh&1073741824&&(Wc(z),z.subtreeFlags&6&&(z.flags|=8192)):Wc(z),null;case 24:return null;case 25:return null}throw Error(wi(156,z.tag))}function xM(O,z){switch(bw(z),z.tag){case 1:return Mh(z.type)&&yx(),O=z.flags,O&65536?(z.flags=O&-65537|128,z):null;case 3:return sv(),Fl(Sh),Fl(Kc),Iw(),O=z.flags,O&65536&&!(O&128)?(z.flags=O&-65537|128,z):null;case 5:return Cw(z),null;case 13:if(Fl(pu),O=z.memoizedState,O!==null&&O.dehydrated!==null){if(z.alternate===null)throw Error(wi(340));av()}return O=z.flags,O&65536?(z.flags=O&-65537|128,z):null;case 19:return Fl(pu),null;case 4:return sv(),null;case 10:return Aw(z.type._context),null;case 22:case 23:return Uw(),null;case 24:return null;default:return null}}var My=!1,Yc=!1,_M=typeof WeakSet=="function"?WeakSet:Set,$i=null;function Vm(O,z){var W=O.ref;if(W!==null)if(typeof W=="function")try{W(null)}catch(ce){ku(O,z,ce)}else W.current=null}function ub(O,z,W){try{W()}catch(ce){ku(O,z,ce)}}var c5=!1;function bM(O,z){if(W2=dx,O=Y6(),xw(O)){if("selectionStart"in O)var W={start:O.selectionStart,end:O.selectionEnd};else e:{W=(W=O.ownerDocument)&&W.defaultView||window;var ce=W.getSelection&&W.getSelection();if(ce&&ce.rangeCount!==0){W=ce.anchorNode;var Te=ce.anchorOffset,D=ce.focusNode;ce=ce.focusOffset;try{W.nodeType,D.nodeType}catch{W=null;break e}var L=0,t=-1,b=-1,d=0,e=0,w=O,y=null;t:for(;;){for(var _;w!==W||Te!==0&&w.nodeType!==3||(t=L+Te),w!==D||ce!==0&&w.nodeType!==3||(b=L+ce),w.nodeType===3&&(L+=w.nodeValue.length),(_=w.firstChild)!==null;)y=w,w=_;for(;;){if(w===O)break t;if(y===W&&++d===Te&&(t=L),y===D&&++e===ce&&(b=L),(_=w.nextSibling)!==null)break;w=y,y=w.parentNode}w=_}W=t===-1||b===-1?null:{start:t,end:b}}else W=null}W=W||{start:0,end:0}}else W=null;for(Z2={focusedElem:O,selectionRange:W},dx=!1,$i=z;$i!==null;)if(z=$i,O=z.child,(z.subtreeFlags&1028)!==0&&O!==null)O.return=z,$i=O;else for(;$i!==null;){z=$i;try{var u=z.alternate;if(z.flags&1024)switch(z.tag){case 0:case 11:case 15:break;case 1:if(u!==null){var r=u.memoizedProps,n=u.memoizedState,l=z.stateNode,o=l.getSnapshotBeforeUpdate(z.elementType===z.type?r:Zf(z.type,r),n);l.__reactInternalSnapshotBeforeUpdate=o}break;case 3:var s=z.stateNode.containerInfo;s.nodeType===1?s.textContent="":s.nodeType===9&&s.documentElement&&s.removeChild(s.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(wi(163))}}catch(c){ku(z,z.return,c)}if(O=z.sibling,O!==null){O.return=z.return,$i=O;break}$i=z.return}return u=c5,c5=!1,u}function v1(O,z,W){var ce=z.updateQueue;if(ce=ce!==null?ce.lastEffect:null,ce!==null){var Te=ce=ce.next;do{if((Te.tag&O)===O){var D=Te.destroy;Te.destroy=void 0,D!==void 0&&ub(z,W,D)}Te=Te.next}while(Te!==ce)}}function s_(O,z){if(z=z.updateQueue,z=z!==null?z.lastEffect:null,z!==null){var W=z=z.next;do{if((W.tag&O)===O){var ce=W.create;W.destroy=ce()}W=W.next}while(W!==z)}}function cb(O){var z=O.ref;if(z!==null){var W=O.stateNode;switch(O.tag){case 5:O=W;break;default:O=W}typeof z=="function"?z(O):z.current=O}}function GT(O){var z=O.alternate;z!==null&&(O.alternate=null,GT(z)),O.child=null,O.deletions=null,O.sibling=null,O.tag===5&&(z=O.stateNode,z!==null&&(delete z[vp],delete z[z1],delete z[X2],delete z[rM],delete z[iM])),O.stateNode=null,O.return=null,O.dependencies=null,O.memoizedProps=null,O.memoizedState=null,O.pendingProps=null,O.stateNode=null,O.updateQueue=null}function WT(O){return O.tag===5||O.tag===3||O.tag===4}function h5(O){e:for(;;){for(;O.sibling===null;){if(O.return===null||WT(O.return))return null;O=O.return}for(O.sibling.return=O.return,O=O.sibling;O.tag!==5&&O.tag!==6&&O.tag!==18;){if(O.flags&2||O.child===null||O.tag===4)continue e;O.child.return=O,O=O.child}if(!(O.flags&2))return O.stateNode}}function hb(O,z,W){var ce=O.tag;if(ce===5||ce===6)O=O.stateNode,z?W.nodeType===8?W.parentNode.insertBefore(O,z):W.insertBefore(O,z):(W.nodeType===8?(z=W.parentNode,z.insertBefore(O,W)):(z=W,z.appendChild(O)),W=W._reactRootContainer,W!=null||z.onclick!==null||(z.onclick=vx));else if(ce!==4&&(O=O.child,O!==null))for(hb(O,z,W),O=O.sibling;O!==null;)hb(O,z,W),O=O.sibling}function fb(O,z,W){var ce=O.tag;if(ce===5||ce===6)O=O.stateNode,z?W.insertBefore(O,z):W.appendChild(O);else if(ce!==4&&(O=O.child,O!==null))for(fb(O,z,W),O=O.sibling;O!==null;)fb(O,z,W),O=O.sibling}var Lc=null,Yf=!1;function $d(O,z,W){for(W=W.child;W!==null;)ZT(O,z,W),W=W.sibling}function ZT(O,z,W){if(wp&&typeof wp.onCommitFiberUnmount=="function")try{wp.onCommitFiberUnmount(Qx,W)}catch{}switch(W.tag){case 5:Yc||Vm(W,z);case 6:var ce=Lc,Te=Yf;Lc=null,$d(O,z,W),Lc=ce,Yf=Te,Lc!==null&&(Yf?(O=Lc,W=W.stateNode,O.nodeType===8?O.parentNode.removeChild(W):O.removeChild(W)):Lc.removeChild(W.stateNode));break;case 18:Lc!==null&&(Yf?(O=Lc,W=W.stateNode,O.nodeType===8?W_(O.parentNode,W):O.nodeType===1&&W_(O,W),E1(O)):W_(Lc,W.stateNode));break;case 4:ce=Lc,Te=Yf,Lc=W.stateNode.containerInfo,Yf=!0,$d(O,z,W),Lc=ce,Yf=Te;break;case 0:case 11:case 14:case 15:if(!Yc&&(ce=W.updateQueue,ce!==null&&(ce=ce.lastEffect,ce!==null))){Te=ce=ce.next;do{var D=Te,L=D.destroy;D=D.tag,L!==void 0&&(D&2||D&4)&&ub(W,z,L),Te=Te.next}while(Te!==ce)}$d(O,z,W);break;case 1:if(!Yc&&(Vm(W,z),ce=W.stateNode,typeof ce.componentWillUnmount=="function"))try{ce.props=W.memoizedProps,ce.state=W.memoizedState,ce.componentWillUnmount()}catch(t){ku(W,z,t)}$d(O,z,W);break;case 21:$d(O,z,W);break;case 22:W.mode&1?(Yc=(ce=Yc)||W.memoizedState!==null,$d(O,z,W),Yc=ce):$d(O,z,W);break;default:$d(O,z,W)}}function f5(O){var z=O.updateQueue;if(z!==null){O.updateQueue=null;var W=O.stateNode;W===null&&(W=O.stateNode=new _M),z.forEach(function(ce){var Te=IM.bind(null,O,ce);W.has(ce)||(W.add(ce),ce.then(Te,Te))})}}function Gf(O,z){var W=z.deletions;if(W!==null)for(var ce=0;ceTe&&(Te=L),ce&=~D}if(ce=Te,ce=Fu()-ce,ce=(120>ce?120:480>ce?480:1080>ce?1080:1920>ce?1920:3e3>ce?3e3:4320>ce?4320:1960*TM(ce/1960))-ce,10O?16:O,r0===null)var ce=!1;else{if(O=r0,r0=null,Ix=0,$o&6)throw Error(wi(331));var Te=$o;for($o|=4,$i=O.current;$i!==null;){var D=$i,L=D.child;if($i.flags&16){var t=D.deletions;if(t!==null){for(var b=0;bFu()-Nw?Eg(O,0):Bw|=W),Eh(O,z)}function tk(O,z){z===0&&(O.mode&1?(z=yy,yy<<=1,!(yy&130023424)&&(yy=4194304)):z=1);var W=fh();O=fd(O,z),O!==null&&($1(O,z,W),Eh(O,W))}function CM(O){var z=O.memoizedState,W=0;z!==null&&(W=z.retryLane),tk(O,W)}function IM(O,z){var W=0;switch(O.tag){case 13:var ce=O.stateNode,Te=O.memoizedState;Te!==null&&(W=Te.retryLane);break;case 19:ce=O.stateNode;break;default:throw Error(wi(314))}ce!==null&&ce.delete(z),tk(O,W)}var nk;nk=function(O,z,W){if(O!==null)if(O.memoizedProps!==z.pendingProps||Sh.current)kh=!0;else{if(!(O.lanes&W)&&!(z.flags&128))return kh=!1,vM(O,z,W);kh=!!(O.flags&131072)}else kh=!1,Jl&&z.flags&1048576&&oT(z,bx,z.index);switch(z.lanes=0,z.tag){case 2:var ce=z.type;Qy(O,z),O=z.pendingProps;var Te=iv(z,Kc.current);Km(z,W),Te=Lw(null,z,ce,O,Te,W);var D=zw();return z.flags|=1,typeof Te=="object"&&Te!==null&&typeof Te.render=="function"&&Te.$$typeof===void 0?(z.tag=1,z.memoizedState=null,z.updateQueue=null,Mh(ce)?(D=!0,xx(z)):D=!1,z.memoizedState=Te.state!==null&&Te.state!==void 0?Te.state:null,Mw(z),Te.updater=o_,z.stateNode=Te,Te._reactInternals=z,nb(z,ce,O,W),z=ab(null,z,ce,!0,D,W)):(z.tag=0,Jl&&D&&_w(z),uh(null,z,Te,W),z=z.child),z;case 16:ce=z.elementType;e:{switch(Qy(O,z),O=z.pendingProps,Te=ce._init,ce=Te(ce._payload),z.type=ce,Te=z.tag=LM(ce),O=Zf(ce,O),Te){case 0:z=ib(null,z,ce,O,W);break e;case 1:z=s5(null,z,ce,O,W);break e;case 11:z=a5(null,z,ce,O,W);break e;case 14:z=o5(null,z,ce,Zf(ce.type,O),W);break e}throw Error(wi(306,ce,""))}return z;case 0:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),ib(O,z,ce,Te,W);case 1:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),s5(O,z,ce,Te,W);case 3:e:{if(NT(z),O===null)throw Error(wi(387));ce=z.pendingProps,D=z.memoizedState,Te=D.element,fT(O,z),kx(z,ce,null,W);var L=z.memoizedState;if(ce=L.element,D.isDehydrated)if(D={element:ce,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},z.updateQueue.baseState=D,z.memoizedState=D,z.flags&256){Te=lv(Error(wi(423)),z),z=l5(O,z,ce,W,Te);break e}else if(ce!==Te){Te=lv(Error(wi(424)),z),z=l5(O,z,ce,W,Te);break e}else for(Zh=h0(z.stateNode.containerInfo.firstChild),Xh=z,Jl=!0,Xf=null,W=cT(z,null,ce,W),z.child=W;W;)W.flags=W.flags&-3|4096,W=W.sibling;else{if(av(),ce===Te){z=pd(O,z,W);break e}uh(O,z,ce,W)}z=z.child}return z;case 5:return pT(z),O===null&&Q2(z),ce=z.type,Te=z.pendingProps,D=O!==null?O.memoizedProps:null,L=Te.children,$2(ce,Te)?L=null:D!==null&&$2(ce,D)&&(z.flags|=32),BT(O,z),uh(O,z,L,W),z.child;case 6:return O===null&&Q2(z),null;case 13:return jT(O,z,W);case 4:return Ew(z,z.stateNode.containerInfo),ce=z.pendingProps,O===null?z.child=ov(z,null,ce,W):uh(O,z,ce,W),z.child;case 11:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),a5(O,z,ce,Te,W);case 7:return uh(O,z,z.pendingProps,W),z.child;case 8:return uh(O,z,z.pendingProps.children,W),z.child;case 12:return uh(O,z,z.pendingProps.children,W),z.child;case 10:e:{if(ce=z.type._context,Te=z.pendingProps,D=z.memoizedProps,L=Te.value,ml(wx,ce._currentValue),ce._currentValue=L,D!==null)if(Qf(D.value,L)){if(D.children===Te.children&&!Sh.current){z=pd(O,z,W);break e}}else for(D=z.child,D!==null&&(D.return=z);D!==null;){var t=D.dependencies;if(t!==null){L=D.child;for(var b=t.firstContext;b!==null;){if(b.context===ce){if(D.tag===1){b=ld(-1,W&-W),b.tag=2;var d=D.updateQueue;if(d!==null){d=d.shared;var e=d.pending;e===null?b.next=b:(b.next=e.next,e.next=b),d.pending=b}}D.lanes|=W,b=D.alternate,b!==null&&(b.lanes|=W),eb(D.return,W,z),t.lanes|=W;break}b=b.next}}else if(D.tag===10)L=D.type===z.type?null:D.child;else if(D.tag===18){if(L=D.return,L===null)throw Error(wi(341));L.lanes|=W,t=L.alternate,t!==null&&(t.lanes|=W),eb(L,W,z),L=D.sibling}else L=D.child;if(L!==null)L.return=D;else for(L=D;L!==null;){if(L===z){L=null;break}if(D=L.sibling,D!==null){D.return=L.return,L=D;break}L=L.return}D=L}uh(O,z,Te.children,W),z=z.child}return z;case 9:return Te=z.type,ce=z.pendingProps.children,Km(z,W),Te=Sf(Te),ce=ce(Te),z.flags|=1,uh(O,z,ce,W),z.child;case 14:return ce=z.type,Te=Zf(ce,z.pendingProps),Te=Zf(ce.type,Te),o5(O,z,ce,Te,W);case 15:return RT(O,z,z.type,z.pendingProps,W);case 17:return ce=z.type,Te=z.pendingProps,Te=z.elementType===ce?Te:Zf(ce,Te),Qy(O,z),z.tag=1,Mh(ce)?(O=!0,xx(z)):O=!1,Km(z,W),zT(z,ce,Te),nb(z,ce,Te,W),ab(null,z,ce,!0,O,W);case 19:return UT(O,z,W);case 22:return FT(O,z,W)}throw Error(wi(156,z.tag))};function rk(O,z){return I6(O,z)}function PM(O,z,W,ce){this.tag=O,this.key=W,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=z,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ce,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wf(O,z,W,ce){return new PM(O,z,W,ce)}function qw(O){return O=O.prototype,!(!O||!O.isReactComponent)}function LM(O){if(typeof O=="function")return qw(O)?1:0;if(O!=null){if(O=O.$$typeof,O===lw)return 11;if(O===uw)return 14}return 2}function g0(O,z){var W=O.alternate;return W===null?(W=wf(O.tag,z,O.key,O.mode),W.elementType=O.elementType,W.type=O.type,W.stateNode=O.stateNode,W.alternate=O,O.alternate=W):(W.pendingProps=z,W.type=O.type,W.flags=0,W.subtreeFlags=0,W.deletions=null),W.flags=O.flags&14680064,W.childLanes=O.childLanes,W.lanes=O.lanes,W.child=O.child,W.memoizedProps=O.memoizedProps,W.memoizedState=O.memoizedState,W.updateQueue=O.updateQueue,z=O.dependencies,W.dependencies=z===null?null:{lanes:z.lanes,firstContext:z.firstContext},W.sibling=O.sibling,W.index=O.index,W.ref=O.ref,W}function nx(O,z,W,ce,Te,D){var L=2;if(ce=O,typeof O=="function")qw(O)&&(L=1);else if(typeof O=="string")L=5;else e:switch(O){case zm:return Cg(W.children,Te,D,z);case sw:L=8,Te|=8;break;case S2:return O=wf(12,W,z,Te|2),O.elementType=S2,O.lanes=D,O;case M2:return O=wf(13,W,z,Te),O.elementType=M2,O.lanes=D,O;case E2:return O=wf(19,W,z,Te),O.elementType=E2,O.lanes=D,O;case p6:return u_(W,Te,D,z);default:if(typeof O=="object"&&O!==null)switch(O.$$typeof){case h6:L=10;break e;case f6:L=9;break e;case lw:L=11;break e;case uw:L=14;break e;case Kd:L=16,ce=null;break e}throw Error(wi(130,O==null?O:typeof O,""))}return z=wf(L,W,z,Te),z.elementType=O,z.type=ce,z.lanes=D,z}function Cg(O,z,W,ce){return O=wf(7,O,ce,z),O.lanes=W,O}function u_(O,z,W,ce){return O=wf(22,O,ce,z),O.elementType=p6,O.lanes=W,O.stateNode={isHidden:!1},O}function e2(O,z,W){return O=wf(6,O,null,z),O.lanes=W,O}function t2(O,z,W){return z=wf(4,O.children!==null?O.children:[],O.key,z),z.lanes=W,z.stateNode={containerInfo:O.containerInfo,pendingChildren:null,implementation:O.implementation},z}function zM(O,z,W,ce,Te){this.tag=z,this.containerInfo=O,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=D_(0),this.expirationTimes=D_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=D_(0),this.identifierPrefix=ce,this.onRecoverableError=Te,this.mutableSourceEagerHydrationData=null}function Hw(O,z,W,ce,Te,D,L,t,b){return O=new zM(O,z,W,t,b),z===1?(z=1,D===!0&&(z|=8)):z=0,D=wf(3,null,null,z),O.current=D,D.stateNode=O,D.memoizedState={element:ce,isDehydrated:W,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mw(D),O}function OM(O,z,W){var ce=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sk)}catch(O){console.error(O)}}sk(),s6.exports=Jh;var lk=s6.exports,uk,_5=lk;uk=_5.createRoot,_5.hydrateRoot;var yp,Hr=typeof window<"u"?window:void 0,Ah=typeof globalThis<"u"?globalThis:Hr,ck=Array.prototype,b5=ck.forEach,w5=ck.indexOf,$h=Ah==null?void 0:Ah.navigator,Xi=Ah==null?void 0:Ah.document,wh=Ah==null?void 0:Ah.location,vb=Ah==null?void 0:Ah.fetch,yb=Ah!=null&&Ah.XMLHttpRequest&&"withCredentials"in new Ah.XMLHttpRequest?Ah.XMLHttpRequest:void 0,T5=Ah==null?void 0:Ah.AbortController,wc=$h==null?void 0:$h.userAgent,Wa=Hr??{},id={DEBUG:!1,LIB_VERSION:"1.207.5"},n2="$copy_autocapture",NM=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(O){O.GZipJS="gzip-js",O.Base64="base64"})(yp||(yp={}));function bo(O,z){return O.indexOf(z)!==-1}var d_=function(O){return O.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},xb=function(O){return O.replace(/^\$/,"")},jM=Array.isArray,hk=Object.prototype,fk=hk.hasOwnProperty,g_=hk.toString,Bu=jM||function(O){return g_.call(O)==="[object Array]"},Yh=O=>typeof O=="function",Nu=O=>O===Object(O)&&!Bu(O),Hm=O=>{if(Nu(O)){for(var z in O)if(fk.call(O,z))return!1;return!0}return!1},pa=O=>O===void 0,Oc=O=>g_.call(O)=="[object String]",k5=O=>Oc(O)&&O.trim().length===0,A0=O=>O===null,nl=O=>pa(O)||A0(O),ch=O=>g_.call(O)=="[object Number]",Sg=O=>g_.call(O)==="[object Boolean]",UM=O=>O instanceof FormData,VM=O=>bo(NM,O),pk=O=>{var z={_log:function(W){if(Hr&&(id.DEBUG||Wa.POSTHOG_DEBUG)&&!pa(Hr.console)&&Hr.console){for(var ce=("__rrweb_original__"in Hr.console[W])?Hr.console[W].__rrweb_original__:Hr.console[W],Te=arguments.length,D=new Array(Te>1?Te-1:0),L=1;L{z.error("You must initialize PostHog before calling ".concat(W))},createLogger:W=>pk("".concat(O," ").concat(W))};return z},ha=pk("[PostHog.js]"),Jc=ha.createLogger,qM=Jc("[ExternalScriptsLoader]"),A5=(O,z,W)=>{if(O.config.disable_external_dependency_loading)return qM.warn("".concat(z," was requested but loading of external scripts is disabled.")),W("Loading of external scripts is disabled");var ce=()=>{if(!Xi)return W("document not found");var Te=Xi.createElement("script");if(Te.type="text/javascript",Te.crossOrigin="anonymous",Te.src=z,Te.onload=t=>W(void 0,t),Te.onerror=t=>W(t),O.config.prepare_external_dependency_script&&(Te=O.config.prepare_external_dependency_script(Te)),!Te)return W("prepare_external_dependency_script returned null");var D,L=Xi.querySelectorAll("body > script");L.length>0?(D=L[0].parentNode)===null||D===void 0||D.insertBefore(Te,L[0]):Xi.body.appendChild(Te)};Xi!=null&&Xi.body?ce():Xi==null||Xi.addEventListener("DOMContentLoaded",ce)};function S5(O,z){var W=Object.keys(O);if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(O);z&&(ce=ce.filter(function(Te){return Object.getOwnPropertyDescriptor(O,Te).enumerable})),W.push.apply(W,ce)}return W}function bi(O){for(var z=1;z=0||(e[b]=L[b]);return e}(O,z);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(O);for(ce=0;ce=0||Object.prototype.propertyIsEnumerable.call(O,W)&&(Te[W]=O[W])}return Te}Wa.__PosthogExtensions__=Wa.__PosthogExtensions__||{},Wa.__PosthogExtensions__.loadExternalDependency=(O,z,W)=>{var ce="/static/".concat(z,".js")+"?v=".concat(O.version);if(z==="remote-config"&&(ce="/array/".concat(O.config.token,"/config.js")),z==="toolbar"){var Te=3e5,D=Math.floor(Date.now()/Te)*Te;ce="".concat(ce,"&t=").concat(D)}var L=O.requestRouter.endpointFor("assets",ce);A5(O,L,W)},Wa.__PosthogExtensions__.loadSiteApp=(O,z,W)=>{var ce=O.requestRouter.endpointFor("api",z);A5(O,ce,W)};var zx={};function m0(O,z,W){if(Bu(O)){if(b5&&O.forEach===b5)O.forEach(z,W);else if("length"in O&&O.length===+O.length){for(var ce=0,Te=O.length;ce1?z-1:0),ce=1;ce1?z-1:0),ce=1;ce0&&(z[ce]=W)}),z};function GM(O,z){return W=O,ce=D=>Oc(D)&&!A0(z)?D.slice(0,z):D,Te=new Set,function D(L,t){return L!==Object(L)?ce?ce(L,t):L:Te.has(L)?void 0:(Te.add(L),Bu(L)?(b=[],m0(L,d=>{b.push(D(d))})):(b={},tl(L,(d,e)=>{Te.has(d)||(b[e]=D(d,e))})),b);var b}(W);var W,ce,Te}var ad=function(){function O(z){return z&&(z.preventDefault=O.preventDefault,z.stopPropagation=O.stopPropagation),z}return O.preventDefault=function(){this.returnValue=!1},O.stopPropagation=function(){this.cancelBubble=!0},function(z,W,ce,Te,D){if(z)if(z.addEventListener&&!Te)z.addEventListener(W,ce,!!D);else{var L="on"+W,t=z[L];z[L]=function(b,d,e){return function(w){if(w=w||O(Hr==null?void 0:Hr.event)){var y,_=!0;Yh(e)&&(y=e(w));var u=d.call(b,w);return y!==!1&&u!==!1||(_=!1),_}}}(z,ce,t)}else ha.error("No valid element provided to register_event")}}();function gk(O,z){for(var W=0;W{var z={};for(var[W,ce]of rx(O||{}))ce&&(z[W]=ce);return z};class ZM{constructor(z){Ri(this,"_override_warning",!1),Ri(this,"_hasLoadedFlags",!1),Ri(this,"_requestInFlight",!1),Ri(this,"_reloadingDisabled",!1),Ri(this,"_additionalReloadRequested",!1),Ri(this,"_decideCalled",!1),Ri(this,"_flagsLoadedFromRemote",!1),this.instance=z,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var z=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:z})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var z=this.instance.get_property(Gm),W=this.instance.get_property(Ly);if(!W)return z||{};for(var ce=Xc({},z),Te=Object.keys(W),D=0;D{this._callDecideEndpoint()},5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(z){this.$anon_distinct_id=z}setReloadingPaused(z){this._reloadingDisabled=z}_callDecideEndpoint(z){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var W={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(o1),group_properties:this.instance.get_property(_g)};(z!=null&&z.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(W.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:W,compression:this.instance.config.disable_compression?void 0:yp.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:ce=>{var Te,D,L=!0;ce.statusCode===200&&(this.$anon_distinct_id=void 0,L=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((D=ce.json)!==null&&D!==void 0?D:{})),W.disable_flags||(this._flagsLoadedFromRemote=!L,this.receivedFeatureFlags((Te=ce.json)!==null&&Te!==void 0?Te:{},L),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var ce,Te,D,L,t,b=this.getFlagVariants()[z],d="".concat(b),e=this.instance.get_property(Rx)||{};return(W.send_event||!("send_event"in W))&&(!(z in e)||!e[z].includes(d))&&(Bu(e[z])?e[z].push(d):e[z]=[d],(ce=this.instance.persistence)===null||ce===void 0||ce.register({[Rx]:e}),this.instance.capture("$feature_flag_called",{$feature_flag:z,$feature_flag_response:b,$feature_flag_payload:this.getFeatureFlagPayload(z)||null,$feature_flag_bootstrapped_response:((Te=this.instance.config.bootstrap)===null||Te===void 0||(D=Te.featureFlags)===null||D===void 0?void 0:D[z])||null,$feature_flag_bootstrapped_payload:((L=this.instance.config.bootstrap)===null||L===void 0||(t=L.featureFlagPayloads)===null||t===void 0?void 0:t[z])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote})),b}Py.warn('getFeatureFlag for key "'+z+`" failed. Feature flags didn't load in time.`)}getFeatureFlagPayload(z){return this.getFlagPayloads()[z]}isFeatureEnabled(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(z,W);Py.warn('isFeatureEnabled for key "'+z+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(z){this.featureFlagEventHandlers.push(z)}removeFeatureFlagsHandler(z){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(W=>W!==z)}receivedFeatureFlags(z,W){if(this.instance.persistence){this._hasLoadedFlags=!0;var ce=this.getFlagVariants(),Te=this.getFlagPayloads();(function(D,L){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},b=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=D.featureFlags,e=D.featureFlagPayloads;if(d)if(Bu(d)){var w={};if(d)for(var y=0;y1&&arguments[1]!==void 0&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return Py.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=W,z===!1)this.instance.persistence.unregister(Ly);else if(Bu(z)){for(var ce={},Te=0;Tethis.removeFeatureFlagsHandler(z)}updateEarlyAccessFeatureEnrollment(z,W){var ce,Te=(this.instance.get_property(ix)||[]).find(b=>b.flagKey===z),D={["$feature_enrollment/".concat(z)]:W},L={$feature_flag:z,$feature_enrollment:W,$set:D};Te&&(L.$early_access_feature_name=Te.name),this.instance.capture("$feature_enrollment_update",L),this.setPersonPropertiesForFlags(D,!1);var t=bi(bi({},this.getFlagVariants()),{},{[z]:W});(ce=this.instance.persistence)===null||ce===void 0||ce.register({[a2]:Object.keys(j5(t)),[Gm]:t}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1],ce=this.instance.get_property(ix);if(ce&&!W)return z(ce);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:Te=>{var D;if(Te.json){var L=Te.json.earlyAccessFeatures;return(D=this.instance.persistence)===null||D===void 0||D.register({[ix]:L}),z(L)}}})}_prepareFeatureFlagsForCallbacks(){var z=this.getFlags(),W=this.getFlagVariants();return{flags:z.filter(ce=>W[ce]),flagVariants:Object.keys(W).filter(ce=>W[ce]).reduce((ce,Te)=>(ce[Te]=W[Te],ce),{})}}_fireFeatureFlagsCallbacks(z){var{flags:W,flagVariants:ce}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(Te=>Te(W,ce,{errorsLoading:z}))}setPersonPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],ce=this.instance.get_property(o1)||{};this.instance.register({[o1]:bi(bi({},ce),z)}),W&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(o1)}setGroupPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],ce=this.instance.get_property(_g)||{};Object.keys(ce).length!==0&&Object.keys(ce).forEach(Te=>{ce[Te]=bi(bi({},ce[Te]),z[Te]),delete z[Te]}),this.instance.register({[_g]:bi(bi({},ce),z)}),W&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(z){if(z){var W=this.instance.get_property(_g)||{};this.instance.register({[_g]:bi(bi({},W),{},{[z]:{}})})}else this.instance.unregister(_g)}}Math.trunc||(Math.trunc=function(O){return O<0?Math.ceil(O):Math.floor(O)}),Number.isInteger||(Number.isInteger=function(O){return ch(O)&&isFinite(O)&&Math.floor(O)===O});var U5="0123456789abcdef";class Bx{constructor(z){if(this.bytes=z,z.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(z,W,ce,Te){if(!Number.isInteger(z)||!Number.isInteger(W)||!Number.isInteger(ce)||!Number.isInteger(Te)||z<0||W<0||ce<0||Te<0||z>0xffffffffffff||W>4095||ce>1073741823||Te>4294967295)throw new RangeError("invalid field value");var D=new Uint8Array(16);return D[0]=z/Math.pow(2,40),D[1]=z/Math.pow(2,32),D[2]=z/Math.pow(2,24),D[3]=z/Math.pow(2,16),D[4]=z/Math.pow(2,8),D[5]=z,D[6]=112|W>>>8,D[7]=W,D[8]=128|ce>>>24,D[9]=ce>>>16,D[10]=ce>>>8,D[11]=ce,D[12]=Te>>>24,D[13]=Te>>>16,D[14]=Te>>>8,D[15]=Te,new Bx(D)}toString(){for(var z="",W=0;W>>4)+U5.charAt(15&this.bytes[W]),W!==3&&W!==5&&W!==7&&W!==9||(z+="-");if(z.length!==36)throw new Error("Invalid UUIDv7 was generated");return z}clone(){return new Bx(this.bytes.slice(0))}equals(z){return this.compareTo(z)===0}compareTo(z){for(var W=0;W<16;W++){var ce=this.bytes[W]-z.bytes[W];if(ce!==0)return Math.sign(ce)}return 0}}class $M{constructor(){Ri(this,"timestamp",0),Ri(this,"counter",0),Ri(this,"random",new YM)}generate(){var z=this.generateOrAbort();if(pa(z)){this.timestamp=0;var W=this.generateOrAbort();if(pa(W))throw new Error("Could not generate UUID after timestamp reset");return W}return z}generateOrAbort(){var z=Date.now();if(z>this.timestamp)this.timestamp=z,this.resetCounter();else{if(!(z+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Bx.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var V5,xk=O=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var z=0;zcrypto.getRandomValues(O));class YM{constructor(){Ri(this,"buffer",new Uint32Array(8)),Ri(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(xk(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var i0=()=>XM().toString(),XM=()=>(V5||(V5=new $M)).generate(),KM="Thu, 01 Jan 1970 00:00:00 GMT",Xv="",JM=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function QM(O,z){if(z){var W=function(Te){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xi;if(Xv)return Xv;if(!D||["localhost","127.0.0.1"].includes(Te))return"";for(var L=Te.split("."),t=Math.min(L.length,8),b="dmn_chk_"+i0(),d=new RegExp("(^|;)\\s*"+b+"=1");!Xv&&t--;){var e=L.slice(t).join("."),w=b+"=1;domain=."+e;D.cookie=w,d.test(D.cookie)&&(D.cookie=w+";expires="+KM,Xv=e)}return Xv}(O);if(!W){var ce=(Te=>{var D=Te.match(JM);return D?D[0]:""})(O);ce!==W&&ha.info("Warning: cookie subdomain discovery mismatch",ce,W),W=ce}return W?"; domain=."+W:""}return""}var ud={is_supported:()=>!!Xi,error:function(O){ha.error("cookieStore error: "+O)},get:function(O){if(Xi){try{for(var z=O+"=",W=Xi.cookie.split(";").filter(D=>D.length),ce=0;ce3686.4&&ha.warn("cookieStore warning: large cookie, len="+d.length),Xi.cookie=d,d}catch{return}},remove:function(O,z){try{ud.set(O,"",-1,z)}catch{return}}},o2=null,hc={is_supported:function(){if(!A0(o2))return o2;var O=!0;if(pa(Hr))O=!1;else try{var z="__mplssupport__";hc.set(z,"xyz"),hc.get(z)!=='"xyz"'&&(O=!1),hc.remove(z)}catch{O=!1}return O||ha.error("localStorage unsupported; falling back to cookie store"),o2=O,O},error:function(O){ha.error("localStorage error: "+O)},get:function(O){try{return Hr==null?void 0:Hr.localStorage.getItem(O)}catch(z){hc.error(z)}return null},parse:function(O){try{return JSON.parse(hc.get(O))||{}}catch{}return null},set:function(O,z){try{Hr==null||Hr.localStorage.setItem(O,JSON.stringify(z))}catch(W){hc.error(W)}},remove:function(O){try{Hr==null||Hr.localStorage.removeItem(O)}catch(z){hc.error(z)}}},e7=["distinct_id",Dx,a1,Fx,Eb],zy=bi(bi({},hc),{},{parse:function(O){try{var z={};try{z=ud.parse(O)||{}}catch{}var W=Xc(z,JSON.parse(hc.get(O)||"{}"));return hc.set(O,W),W}catch{}return null},set:function(O,z,W,ce,Te,D){try{hc.set(O,z,void 0,void 0,D);var L={};e7.forEach(t=>{z[t]&&(L[t]=z[t])}),Object.keys(L).length&&ud.set(O,L,W,ce,Te,D)}catch(t){hc.error(t)}},remove:function(O,z){try{Hr==null||Hr.localStorage.removeItem(O),ud.remove(O,z)}catch(W){hc.error(W)}}}),Oy={},t7={is_supported:function(){return!0},error:function(O){ha.error("memoryStorage error: "+O)},get:function(O){return Oy[O]||null},parse:function(O){return Oy[O]||null},set:function(O,z){Oy[O]=z},remove:function(O){delete Oy[O]}},fg=null,zc={is_supported:function(){if(!A0(fg))return fg;if(fg=!0,pa(Hr))fg=!1;else try{var O="__support__";zc.set(O,"xyz"),zc.get(O)!=='"xyz"'&&(fg=!1),zc.remove(O)}catch{fg=!1}return fg},error:function(O){ha.error("sessionStorage error: ",O)},get:function(O){try{return Hr==null?void 0:Hr.sessionStorage.getItem(O)}catch(z){zc.error(z)}return null},parse:function(O){try{return JSON.parse(zc.get(O))||null}catch{}return null},set:function(O,z){try{Hr==null||Hr.sessionStorage.setItem(O,JSON.stringify(z))}catch(W){zc.error(W)}},remove:function(O){try{Hr==null||Hr.sessionStorage.removeItem(O)}catch(z){zc.error(z)}}},n7=["localhost","127.0.0.1"],Qm=O=>{var z=Xi==null?void 0:Xi.createElement("a");return pa(z)?null:(z.href=O,z)},cv=function(O,z){return!!function(W){try{new RegExp(W)}catch{return!1}return!0}(z)&&new RegExp(z).test(O)},r7=function(O){var z,W,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",Te=[];return tl(O,function(D,L){pa(D)||pa(L)||L==="undefined"||(z=encodeURIComponent((t=>t instanceof File)(D)?D.name:D.toString()),W=encodeURIComponent(L),Te[Te.length]=W+"="+z)}),Te.join(ce)},Nx=function(O,z){for(var W,ce=((O.split("#")[0]||"").split("?")[1]||"").split("&"),Te=0;Tez&&bo(z,wk)||function(W){return bo(W,U1)&&!bo(W,Dg)&&!bo(W,_p)}(O),G5=function(O,z){return z=z||"",bo(O," OPR/")&&bo(O,"Mini")?a7:bo(O," OPR/")?Yw:Kw.test(O)?hv:bo(O,"IE"+kf)||bo(O,"WPDesktop")?Ek:bo(O,Ak)?Sk:bo(O,Xw)||bo(O,"Edg/")?Ck:bo(O,"FBIOS")?"Facebook "+kf:bo(O,"UCWEB")||bo(O,"UCBrowser")?"UC Browser":bo(O,"CriOS")?Mk:bo(O,"CrMo")||bo(O,Dg)?Dg:bo(O,_p)&&bo(O,U1)?Pk:bo(O,"FxiOS")?Ik:bo(O.toLowerCase(),Pb.toLowerCase())?Pb:h7(O,z)?bo(O,kf)?Lk:U1:bo(O,ev)?ev:bo(O,"MSIE")||bo(O,"Trident/")?$w:bo(O,"Gecko")?ev:""},f7={[Ek]:[new RegExp("rv:"+lh)],[Ck]:[new RegExp(Xw+"?\\/"+lh)],[Dg]:[new RegExp("("+Dg+"|CrMo)\\/"+lh)],[Mk]:[new RegExp("CriOS\\/"+lh)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+lh)],[U1]:[s2],[Lk]:[s2],[Yw]:[new RegExp("(Opera|OPR)\\/"+lh)],[ev]:[new RegExp(ev+"\\/"+lh)],[Ik]:[new RegExp("FxiOS\\/"+lh)],[Pb]:[new RegExp("Konqueror[:/]?"+lh,"i")],[hv]:[new RegExp(hv+" "+lh),s2],[Pk]:[new RegExp("android\\s"+lh,"i")],[Sk]:[new RegExp(Ak+"\\/"+lh)],[$w]:[new RegExp("(rv:|MSIE )"+lh)],Mozilla:[new RegExp("rv:"+lh)]},W5=[[new RegExp(tv+"; "+tv+" (.*?)[);]","i"),O=>[tv,O&&O[1]||""]],[new RegExp(V1,"i"),[V1,""]],[new RegExp(q1,"i"),[q1,""]],[Kw,[hv,""]],[new RegExp(s1,"i"),(O,z)=>{if(/Phone/.test(z)||/WPDesktop/.test(z))return[Cb,""];if(new RegExp(kf).test(z)&&!/IEMobile\b/.test(z))return[s1+" "+kf,""];var W=/Windows NT ([0-9.]+)/i.exec(z);if(W&&W[1]){var ce=W[1],Te=c7[ce]||"";return/arm/i.test(z)&&(Te="RT"),[s1,Te]}return[s1,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,O=>{if(O&&O[3]){var z=[O[3],O[4],O[5]||"0"];return[Ux,z.join(".")]}return[Ux,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,O=>{var z="";return O&&O.length>=3&&(z=pa(O[2])?O[3]:O[2]),["watchOS",z]}],[new RegExp("("+_p+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_p+")","i"),O=>{if(O&&O[2]){var z=[O[2],O[3],O[4]||"0"];return[_p,z.join(".")]}return[_p,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,O=>{var z=["Mac OS X",""];if(O&&O[1]){var W=[O[1],O[2],O[3]||"0"];z[1]=W.join(".")}return z}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[i7,""]],[/Linux|debian/i,["Linux",""]]],Z5=function(O){return u7.test(O)?V1:l7.test(O)?q1:s7.test(O)?tv:new RegExp(Ib,"i").test(O)?Ib:new RegExp("("+Cb+"|WPDesktop)","i").test(O)?Cb:/iPad/.test(O)?bk:/iPod/.test(O)?"iPod Touch":/iPhone/.test(O)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(O)?Tk:Kw.test(O)?hv:/(kobo)\s(ereader|touch)/i.test(O)?"Kobo":new RegExp(H5,"i").test(O)?H5:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(O)||/(kf[a-z]+)( bui|\)).+silk\//i.test(O)?"Kindle Fire":/(Android|ZTE)/i.test(O)?!new RegExp(kf).test(O)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(O)?/pixel[\daxl ]{1,6}/i.test(O)&&!/pixel c/i.test(O)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(O)||/lmy47v/i.test(O)&&!/QTAQZ3/i.test(O)?_p:_k:_p:new RegExp("(pda|"+kf+")","i").test(O)?o7:new RegExp(j1,"i").test(O)&&!new RegExp(j1+" pc","i").test(O)?Ok:""},Dy="https?://(.*)",Lb=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],p7=_b(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Lb),$5="",Tu={campaignParams:function(){var{customTrackedParams:O,maskPersonalDataProperties:z,customPersonalDataProperties:W}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Xi)return{};var ce=z?_b([],Lb,W||[]):[];return this._campaignParamsFromUrl(q5(Xi.URL,ce,$5),O)},_campaignParamsFromUrl:function(O,z){var W=p7.concat(z||[]),ce={};return tl(W,function(Te){var D=Nx(O,Te);ce[Te]=D||null}),ce},_searchEngine:function(O){return O?O.search(Dy+"google.([^/?]*)")===0?"google":O.search(Dy+"bing.com")===0?"bing":O.search(Dy+"yahoo.com")===0?"yahoo":O.search(Dy+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(O){var z=Tu._searchEngine(O),W=z!="yahoo"?"q":"p",ce={};if(!A0(z)){ce.$search_engine=z;var Te=Xi?Nx(Xi.referrer,W):"";Te.length&&(ce.ph_keyword=Te)}return ce},searchInfo:function(){var O=Xi==null?void 0:Xi.referrer;return O?this._searchInfoFromReferrer(O):{}},browser:G5,browserVersion:function(O,z){var W=G5(O,z),ce=f7[W];if(pa(ce))return null;for(var Te=0;Te0&&arguments[0]!==void 0?arguments[0]:{};if(!wc)return{};var W=O?_b([],Lb,z||[]):[],[ce,Te]=Tu.os(wc);return Xc(Ox({$os:ce,$os_version:Te,$browser:Tu.browser(wc,navigator.vendor),$device:Tu.device(wc),$device_type:Tu.deviceType(wc),$timezone:Tu.timezone(),$timezone_offset:Tu.timezoneOffset()}),{$current_url:q5(wh==null?void 0:wh.href,W,$5),$host:wh==null?void 0:wh.host,$pathname:wh==null?void 0:wh.pathname,$raw_user_agent:wc.length>1e3?wc.substring(0,997)+"...":wc,$browser_version:Tu.browserVersion(wc,navigator.vendor),$browser_language:Tu.browserLanguage(),$browser_language_prefix:Tu.browserLanguagePrefix(),$screen_height:Hr==null?void 0:Hr.screen.height,$screen_width:Hr==null?void 0:Hr.screen.width,$viewport_height:Hr==null?void 0:Hr.innerHeight,$viewport_width:Hr==null?void 0:Hr.innerWidth,$lib:"web",$lib_version:id.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!wc)return{};var[O,z]=Tu.os(wc);return Xc(Ox({$os:O,$os_version:z,$browser:Tu.browser(wc,navigator.vendor)}),{$browser_version:Tu.browserVersion(wc,navigator.vendor)})}},d7=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class l2{constructor(z){this.config=z,this.props={},this.campaign_params_saved=!1,this.name=(W=>{var ce="";return W.token&&(ce=W.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),W.persistence_name?"ph_"+W.persistence_name:"ph_"+ce+"_posthog"})(z),this.storage=this.buildStorage(z),this.load(),z.debug&&ha.info("Persistence loaded",z.persistence,bi({},this.props)),this.update_config(z,z),this.save()}buildStorage(z){d7.indexOf(z.persistence.toLowerCase())===-1&&(ha.critical("Unknown persistence type "+z.persistence+"; falling back to localStorage+cookie"),z.persistence="localStorage+cookie");var W=z.persistence.toLowerCase();return W==="localstorage"&&hc.is_supported()?hc:W==="localstorage+cookie"&&zy.is_supported()?zy:W==="sessionstorage"&&zc.is_supported()?zc:W==="memory"?t7:W==="cookie"?ud:zy.is_supported()?zy:ud}properties(){var z={};return tl(this.props,function(W,ce){if(ce===Gm&&Nu(W))for(var Te=Object.keys(W),D=0;D{this.props.hasOwnProperty(L)&&this.props[L]!==W||(this.props[L]=D,Te=!0)}),Te)return this.save(),!0}return!1}register(z,W){if(Nu(z)){this.expire_days=pa(W)?this.default_expiry:W;var ce=!1;if(tl(z,(Te,D)=>{z.hasOwnProperty(D)&&this.props[D]!==Te&&(this.props[D]=Te,ce=!0)}),ce)return this.save(),!0}return!1}unregister(z){z in this.props&&(delete this.props[z],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var z=Tu.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Hm(Ox(z))||this.register(z),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Tu.searchInfo())}update_referrer_info(){this.register_once(Tu.referrerInfo(),void 0)}set_initial_person_info(){this.props[Sb]||this.props[Mb]||this.register_once({[Eb]:Tu.initialPersonInfo()},void 0)}get_referrer_info(){return Ox({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var z={};tl([Mb,Sb],Te=>{var D=this.props[Te];D&&tl(D,function(L,t){z["$initial_"+xb(t)]=L})});var W=this.props[Eb];if(W){var ce=Tu.initialPersonPropsFromInfo(W);Xc(z,ce)}return z}safe_merge(z){return tl(this.props,function(W,ce){ce in z||(z[ce]=W)}),z}update_config(z,W){if(this.default_expiry=this.expire_days=z.cookie_expiration,this.set_disabled(z.disable_persistence),this.set_cross_subdomain(z.cross_subdomain_cookie),this.set_secure(z.secure_cookie),z.persistence!==W.persistence){var ce=this.buildStorage(z),Te=this.props;this.clear(),this.storage=ce,this.props=Te,this.save()}}set_disabled(z){this.disabled=z,this.disabled?this.remove():this.save()}set_cross_subdomain(z){z!==this.cross_subdomain&&(this.cross_subdomain=z,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(z){z!==this.secure&&(this.secure=z,this.remove(),this.save())}set_event_timer(z,W){var ce=this.props[i1]||{};ce[z]=W,this.props[i1]=ce,this.save()}remove_event_timer(z){var W=(this.props[i1]||{})[z];return pa(W)||(delete this.props[i1][z],this.save()),W}get_property(z){return this.props[z]}set_property(z,W){this.props[z]=W,this.save()}}function Vx(O){var z,W;return((z=JSON.stringify(O,(W=[],function(ce,Te){if(Nu(Te)){for(;W.length>0&&W[W.length-1]!==this;)W.pop();return W.includes(Te)?"[Circular]":(W.push(Te),Te)}return Te})))===null||z===void 0?void 0:z.length)||0}function zb(O){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(O.size>=z&&O.data.length>1){var W=Math.floor(O.data.length/2),ce=O.data.slice(0,W),Te=O.data.slice(W);return[zb({size:Vx(ce),data:ce,sessionId:O.sessionId,windowId:O.windowId}),zb({size:Vx(Te),data:Te,sessionId:O.sessionId,windowId:O.windowId})].flatMap(D=>D)}return[O]}var ed=(O=>(O[O.DomContentLoaded=0]="DomContentLoaded",O[O.Load=1]="Load",O[O.FullSnapshot=2]="FullSnapshot",O[O.IncrementalSnapshot=3]="IncrementalSnapshot",O[O.Meta=4]="Meta",O[O.Custom=5]="Custom",O[O.Plugin=6]="Plugin",O))(ed||{}),$f=(O=>(O[O.Mutation=0]="Mutation",O[O.MouseMove=1]="MouseMove",O[O.MouseInteraction=2]="MouseInteraction",O[O.Scroll=3]="Scroll",O[O.ViewportResize=4]="ViewportResize",O[O.Input=5]="Input",O[O.TouchMove=6]="TouchMove",O[O.MediaInteraction=7]="MediaInteraction",O[O.StyleSheetRule=8]="StyleSheetRule",O[O.CanvasMutation=9]="CanvasMutation",O[O.Font=10]="Font",O[O.Log=11]="Log",O[O.Drag=12]="Drag",O[O.StyleDeclaration=13]="StyleDeclaration",O[O.Selection=14]="Selection",O[O.AdoptedStyleSheet=15]="AdoptedStyleSheet",O[O.CustomElement=16]="CustomElement",O))($f||{});function Y5(O){var z;return O instanceof Element&&(O.id===yk||!((z=O.closest)===null||z===void 0||!z.call(O,".toolbar-global-fade-container")))}function m_(O){return!!O&&O.nodeType===1}function v0(O,z){return!!O&&!!O.tagName&&O.tagName.toLowerCase()===z.toLowerCase()}function Dk(O){return!!O&&O.nodeType===3}function Rk(O){return!!O&&O.nodeType===11}function Jw(O){return O?d_(O).split(/\s+/):[]}function X5(O){var z=Hr==null?void 0:Hr.location.href;return!!(z&&O&&O.some(W=>z.match(W)))}function qx(O){var z="";switch(typeof O.className){case"string":z=O.className;break;case"object":z=(O.className&&"baseVal"in O.className?O.className.baseVal:null)||O.getAttribute("class")||"";break;default:z=""}return Jw(z)}function Fk(O){return nl(O)?null:d_(O).split(/(\s+)/).filter(z=>fv(z)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function v_(O){var z="";return Db(O)&&!jk(O)&&O.childNodes&&O.childNodes.length&&tl(O.childNodes,function(W){var ce;Dk(W)&&W.textContent&&(z+=(ce=Fk(W.textContent))!==null&&ce!==void 0?ce:"")}),d_(z)}function Bk(O){return pa(O.target)?O.srcElement||null:(z=O.target)!==null&&z!==void 0&&z.shadowRoot?O.composedPath()[0]||null:O.target||null;var z}var Ob=["a","button","form","input","select","textarea","label"];function Nk(O){var z=O.parentNode;return!(!z||!m_(z))&&z}function g7(O,z){var W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,ce=arguments.length>3?arguments[3]:void 0,Te=arguments.length>4?arguments[4]:void 0;if(!Hr||!O||v0(O,"html")||!m_(O)||W!=null&&W.url_allowlist&&!X5(W.url_allowlist)||W!=null&&W.url_ignorelist&&X5(W.url_ignorelist))return!1;if(W!=null&&W.dom_event_allowlist){var D=W.dom_event_allowlist;if(D&&!D.some(_=>z.type===_))return!1}for(var L=!1,t=[O],b=!0,d=O;d.parentNode&&!v0(d,"body");)if(Rk(d.parentNode))t.push(d.parentNode.host),d=d.parentNode.host;else{if(!(b=Nk(d)))break;if(ce||Ob.indexOf(b.tagName.toLowerCase())>-1)L=!0;else{var e=Hr.getComputedStyle(b);e&&e.getPropertyValue("cursor")==="pointer"&&(L=!0)}t.push(b),d=b}if(!function(_,u){var r=u==null?void 0:u.element_allowlist;if(pa(r))return!0;var n=function(s){if(r.some(c=>s.tagName.toLowerCase()===c))return{v:!0}};for(var l of _){var o=n(l);if(typeof o=="object")return o.v}return!1}(t,W)||!function(_,u){var r=u==null?void 0:u.css_selector_allowlist;if(pa(r))return!0;var n=function(s){if(r.some(c=>s.matches(c)))return{v:!0}};for(var l of _){var o=n(l);if(typeof o=="object")return o.v}return!1}(t,W))return!1;var w=Hr.getComputedStyle(O);if(w&&w.getPropertyValue("cursor")==="pointer"&&z.type==="click")return!0;var y=O.tagName.toLowerCase();switch(y){case"html":return!1;case"form":return(Te||["submit"]).indexOf(z.type)>=0;case"input":case"select":case"textarea":return(Te||["change","click"]).indexOf(z.type)>=0;default:return L?(Te||["click"]).indexOf(z.type)>=0:(Te||["click"]).indexOf(z.type)>=0&&(Ob.indexOf(y)>-1||O.getAttribute("contenteditable")==="true")}}function Db(O){for(var z=O;z.parentNode&&!v0(z,"body");z=z.parentNode){var W=qx(z);if(bo(W,"ph-sensitive")||bo(W,"ph-no-capture"))return!1}if(bo(qx(O),"ph-include"))return!0;var ce=O.type||"";if(Oc(ce))switch(ce.toLowerCase()){case"hidden":case"password":return!1}var Te=O.name||O.id||"";return!(Oc(Te)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(Te.replace(/[^a-zA-Z0-9]/g,"")))}function jk(O){return!!(v0(O,"input")&&!["button","checkbox","submit","reset"].includes(O.type)||v0(O,"select")||v0(O,"textarea")||O.getAttribute("contenteditable")==="true")}var Uk="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",m7=new RegExp("^(?:".concat(Uk,")$")),v7=new RegExp(Uk),Vk="\\d{3}-?\\d{2}-?\\d{4}",y7=new RegExp("^(".concat(Vk,")$")),x7=new RegExp("(".concat(Vk,")"));function fv(O){var z=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(nl(O)||Oc(O)&&(O=d_(O),(z?m7:v7).test((O||"").replace(/[- ]/g,""))||(z?y7:x7).test(O)))}function qk(O){var z=v_(O);return fv(z="".concat(z," ").concat(Hk(O)).trim())?z:""}function Hk(O){var z="";return O&&O.childNodes&&O.childNodes.length&&tl(O.childNodes,function(W){var ce;if(W&&((ce=W.tagName)===null||ce===void 0?void 0:ce.toLowerCase())==="span")try{var Te=v_(W);z="".concat(z," ").concat(Te).trim(),W.childNodes&&W.childNodes.length&&(z="".concat(z," ").concat(Hk(W)).trim())}catch(D){ha.error("[AutoCapture]",D)}}),z}function _7(O){return function(z){var W=z.map(ce=>{var Te,D,L="";if(ce.tag_name&&(L+=ce.tag_name),ce.attr_class)for(var t of(ce.attr_class.sort(),ce.attr_class))L+=".".concat(t.replace(/"/g,""));var b=bi(bi(bi(bi({},ce.text?{text:ce.text}:{}),{},{"nth-child":(Te=ce.nth_child)!==null&&Te!==void 0?Te:0,"nth-of-type":(D=ce.nth_of_type)!==null&&D!==void 0?D:0},ce.href?{href:ce.href}:{}),ce.attr_id?{attr_id:ce.attr_id}:{}),ce.attributes),d={};return rx(b).sort((e,w)=>{var[y]=e,[_]=w;return y.localeCompare(_)}).forEach(e=>{var[w,y]=e;return d[K5(w.toString())]=K5(y.toString())}),L+=":",L+=rx(b).map(e=>{var[w,y]=e;return"".concat(w,'="').concat(y,'"')}).join("")});return W.join(";")}(function(z){return z.map(W=>{var ce,Te,D={text:(ce=W.$el_text)===null||ce===void 0?void 0:ce.slice(0,400),tag_name:W.tag_name,href:(Te=W.attr__href)===null||Te===void 0?void 0:Te.slice(0,2048),attr_class:b7(W),attr_id:W.attr__id,nth_child:W.nth_child,nth_of_type:W.nth_of_type,attributes:{}};return rx(W).filter(L=>{var[t]=L;return t.indexOf("attr__")===0}).forEach(L=>{var[t,b]=L;return D.attributes[t]=b}),D})}(O))}function K5(O){return O.replace(/"|\\"/g,'\\"')}function b7(O){var z=O.attr__class;return z?Bu(z)?z:Jw(z):void 0}var Rb="[SessionRecording]",Fb="redacted",Ry={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:O=>O,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},w7=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],T7=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],k7=["/s/","/e/","/i/"];function J5(O,z,W,ce){if(nl(O))return O;var Te=(z==null?void 0:z["content-length"])||function(D){return new Blob([D]).size}(O);return Oc(Te)&&(Te=parseInt(Te)),Te>W?Rb+" ".concat(ce," body too large to record (").concat(Te," bytes)"):O}function Q5(O,z){if(nl(O))return O;var W=O;return fv(W,!1)||(W=Rb+" "+z+" body "+Fb),tl(T7,ce=>{var Te,D;(Te=W)!==null&&Te!==void 0&&Te.length&&((D=W)===null||D===void 0?void 0:D.indexOf(ce))!==-1&&(W=Rb+" "+z+" body "+Fb+" as might contain: "+ce)}),W}var A7=(O,z)=>{var W,ce,Te,D={payloadSizeLimitBytes:Ry.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ry.performanceEntryTypeToObserve],payloadHostDenyList:[...z.payloadHostDenyList||[],...Ry.payloadHostDenyList]},L=O.session_recording.recordHeaders!==!1&&z.recordHeaders,t=O.session_recording.recordBody!==!1&&z.recordBody,b=O.capture_performance!==!1&&z.recordPerformance,d=(W=D,Te=Math.min(1e6,(ce=W.payloadSizeLimitBytes)!==null&&ce!==void 0?ce:1e6),y=>(y!=null&&y.requestBody&&(y.requestBody=J5(y.requestBody,y.requestHeaders,Te,"Request")),y!=null&&y.responseBody&&(y.responseBody=J5(y.responseBody,y.responseHeaders,Te,"Response")),y)),e=y=>{return d(((r,n)=>{var l,o=Qm(r.name),s=n.indexOf("http")===0?(l=Qm(n))===null||l===void 0?void 0:l.pathname:n;s==="/"&&(s="");var c=o==null?void 0:o.pathname.replace(s||"","");if(!(o&&c&&k7.some(h=>c.indexOf(h)===0)))return r})((u=(_=y).requestHeaders,nl(u)||tl(Object.keys(u??{}),r=>{w7.includes(r.toLowerCase())&&(u[r]=Fb)}),_),O.api_host));var _,u},w=Yh(O.session_recording.maskNetworkRequestFn);return w&&Yh(O.session_recording.maskCapturedNetworkRequestFn)&&ha.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),w&&(O.session_recording.maskCapturedNetworkRequestFn=y=>{var _=O.session_recording.maskNetworkRequestFn({url:y.name});return bi(bi({},y),{},{name:_==null?void 0:_.url})}),D.maskRequestFn=Yh(O.session_recording.maskCapturedNetworkRequestFn)?y=>{var _,u,r,n=e(y);return n&&(_=(u=(r=O.session_recording).maskCapturedNetworkRequestFn)===null||u===void 0?void 0:u.call(r,n))!==null&&_!==void 0?_:void 0}:y=>function(_){if(!pa(_))return _.requestBody=Q5(_.requestBody,"Request"),_.responseBody=Q5(_.responseBody,"Response"),_}(e(y)),bi(bi(bi({},Ry),D),{},{recordHeaders:L,recordBody:t,recordPerformance:b,recordInitialRequests:b})};function bp(O,z,W,ce,Te){return z>W&&(ha.warn("min cannot be greater than max."),z=W),ch(O)?O>W?(ce&&ha.warn(ce+" cannot be greater than max: "+W+". Using max value instead."),W):O1&&arguments[1]!==void 0?arguments[1]:{};Ri(this,"bucketSize",100),Ri(this,"refillRate",10),Ri(this,"mutationBuckets",{}),Ri(this,"loggedTracker",{}),Ri(this,"refillBuckets",()=>{Object.keys(this.mutationBuckets).forEach(D=>{this.mutationBuckets[D]=this.mutationBuckets[D]+this.refillRate,this.mutationBuckets[D]>=this.bucketSize&&delete this.mutationBuckets[D]})}),Ri(this,"getNodeOrRelevantParent",D=>{var L=this.rrweb.mirror.getNode(D);if((L==null?void 0:L.nodeName)!=="svg"&&L instanceof Element){var t=L.closest("svg");if(t)return[this.rrweb.mirror.getId(t),t]}return[D,L]}),Ri(this,"numberOfChanges",D=>{var L,t,b,d,e,w,y,_;return((L=(t=D.removes)===null||t===void 0?void 0:t.length)!==null&&L!==void 0?L:0)+((b=(d=D.attributes)===null||d===void 0?void 0:d.length)!==null&&b!==void 0?b:0)+((e=(w=D.texts)===null||w===void 0?void 0:w.length)!==null&&e!==void 0?e:0)+((y=(_=D.adds)===null||_===void 0?void 0:_.length)!==null&&y!==void 0?y:0)}),Ri(this,"throttleMutations",D=>{if(D.type!==3||D.data.source!==0)return D;var L=D.data,t=this.numberOfChanges(L);L.attributes&&(L.attributes=L.attributes.filter(d=>{var e,w,y,[_,u]=this.getNodeOrRelevantParent(d.id);return this.mutationBuckets[_]===0?!1:(this.mutationBuckets[_]=(e=this.mutationBuckets[_])!==null&&e!==void 0?e:this.bucketSize,this.mutationBuckets[_]=Math.max(this.mutationBuckets[_]-1,0),this.mutationBuckets[_]===0&&(this.loggedTracker[_]||(this.loggedTracker[_]=!0,(w=(y=this.options).onBlockedNode)===null||w===void 0||w.call(y,_,u))),d)}));var b=this.numberOfChanges(L);return b!==0||t===b?D:void 0}),this.rrweb=z,this.options=Te,this.refillRate=bp((W=this.options.refillRate)!==null&&W!==void 0?W:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=bp((ce=this.options.bucketSize)!==null&&ce!==void 0?ce:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval(()=>{this.refillBuckets()},1e3)}}var Af=Uint8Array,hh=Uint16Array,pv=Uint32Array,Qw=new Af([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),e3=new Af([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),e4=new Af([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gk=function(O,z){for(var W=new hh(31),ce=0;ce<31;++ce)W[ce]=z+=1<>>1|(21845&Rl)<<1;pg=(61680&(pg=(52428&pg)>>>2|(13107&pg)<<2))>>>4|(3855&pg)<<4,Nb[Rl]=((65280&pg)>>>8|(255&pg)<<8)>>>1}var _1=function(O,z,W){for(var ce=O.length,Te=0,D=new hh(z);Te>>b]=d}else for(L=new hh(ce),Te=0;Te>>15-O[Te];return L},Rg=new Af(288);for(Rl=0;Rl<144;++Rl)Rg[Rl]=8;for(Rl=144;Rl<256;++Rl)Rg[Rl]=9;for(Rl=256;Rl<280;++Rl)Rg[Rl]=7;for(Rl=280;Rl<288;++Rl)Rg[Rl]=8;var Hx=new Af(32);for(Rl=0;Rl<32;++Rl)Hx[Rl]=5;var E7=_1(Rg,9,0),C7=_1(Hx,5,0),Zk=function(O){return(O/8>>0)+(7&O&&1)},$k=function(O,z,W){(W==null||W>O.length)&&(W=O.length);var ce=new(O instanceof hh?hh:O instanceof pv?pv:Af)(W-z);return ce.set(O.subarray(z,W)),ce},Kp=function(O,z,W){W<<=7&z;var ce=z/8>>0;O[ce]|=W,O[ce+1]|=W>>>8},Kv=function(O,z,W){W<<=7&z;var ce=z/8>>0;O[ce]|=W,O[ce+1]|=W>>>8,O[ce+2]|=W>>>16},u2=function(O,z){for(var W=[],ce=0;cey&&(y=D[ce].s);var _=new hh(y+1),u=jb(W[e-1],_,0);if(u>z){ce=0;var r=0,n=u-z,l=1<z))break;r+=l-(1<>>=n;r>0;){var s=D[ce].s;_[s]=0&&r;--ce){var c=D[ce].s;_[c]==z&&(--_[c],++r)}u=z}return[new Af(_),u]},jb=function(O,z,W){return O.s==-1?Math.max(jb(O.l,z,W+1),jb(O.r,z,W+1)):z[O.s]=W},n4=function(O){for(var z=O.length;z&&!O[--z];);for(var W=new hh(++z),ce=0,Te=O[0],D=1,L=function(b){W[ce++]=b},t=1;t<=z;++t)if(O[t]==Te&&t!=z)++D;else{if(!Te&&D>2){for(;D>138;D-=138)L(32754);D>2&&(L(D>10?D-11<<5|28690:D-3<<5|12305),D=0)}else if(D>3){for(L(Te),--D;D>6;D-=6)L(8304);D>2&&(L(D-3<<5|8208),D=0)}for(;D--;)L(Te);D=1,Te=O[t]}return[W.subarray(0,ce),z]},Jv=function(O,z){for(var W=0,ce=0;ce>>8,O[Te+2]=255^O[Te],O[Te+3]=255^O[Te+1];for(var D=0;D4&&!A[e4[S-1]];--S);var T,p,M,f,E=d+5<<3,I=Jv(Te,Rg)+Jv(D,Hx)+L,B=Jv(Te,y)+Jv(D,r)+L+14+3*S+Jv(m,A)+(2*m[16]+3*m[17]+7*m[18]);if(E<=I&&E<=B)return Ub(z,e,O.subarray(b,b+d));if(Kp(z,e,1+(B15&&(Kp(z,e,$[g]>>>5&127),e+=$[g]>>>12)}}}else T=E7,p=Rg,M=C7,f=Hx;for(g=0;g255){ee=ce[g]>>>18&31,Kv(z,e,T[ee+257]),e+=p[ee+257],ee>7&&(Kp(z,e,ce[g]>>>23&31),e+=Qw[ee]);var H=31&ce[g];Kv(z,e,M[H]),e+=f[H],H>3&&(Kv(z,e,ce[g]>>>5&8191),e+=e3[H])}else Kv(z,e,T[ce[g]]),e+=p[ce[g]];return Kv(z,e,T[256]),e+p[256]},I7=new pv([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),P7=function(){for(var O=new pv(256),z=0;z<256;++z){for(var W=z,ce=9;--ce;)W=(1&W&&3988292384)^W>>>1;O[z]=W}return O}(),L7=function(){var O=4294967295;return{p:function(z){for(var W=O,ce=0;ce>>8;O=W},d:function(){return 4294967295^O}}},z7=function(O,z,W,ce,Te){return function(D,L,t,b,d,e){var w=D.length,y=new Af(b+w+5*(1+Math.floor(w/7e3))+d),_=y.subarray(b,y.length-d),u=0;if(!L||w<8)for(var r=0;r<=w;r+=65535){var n=r+65535;n>>13,s=8191&l,c=(1<7e3||M>24576)&&V>423){u=r4(D,_,0,A,v,S,p,M,E,r-E,u),M=T=p=0,E=r;for(var j=0;j<286;++j)v[j]=0;for(j=0;j<30;++j)S[j]=0}var $=2,ee=0,H=s,J=B-N&32767;if(V>2&&I==k(r-J))for(var Q=Math.min(o,V)-1,Z=Math.min(32767,r),K=Math.min(258,V);J<=Z&&--H&&B!=N;){if(D[r+$]==D[r+$-J]){for(var ae=0;ae$){if($=ae,ee=J,ae>Q)break;var se=Math.min(J,ae-2),he=0;for(j=0;jhe&&(he=ie,N=fe)}}}J+=(B=N)-(N=h[B])+32768&32767}if(ee){A[M++]=268435456|Bb[$]<<18|t4[ee];var oe=31&Bb[$],le=31&t4[ee];p+=Qw[oe]+e3[le],++v[257+oe],++S[le],f=r+$,++T}else A[M++]=D[r],++v[D[r]]}}u=r4(D,_,e,A,v,S,p,M,E,r-E,u)}return $k(y,0,b+Zk(u)+d)}(O,z.level==null?6:z.level,z.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(O.length)))):12+z.mem,W,ce,!Te)},Vb=function(O,z,W){for(;W;++z)O[z]=W,W>>>=8},O7=function(O,z){var W=z.filename;if(O[0]=31,O[1]=139,O[2]=8,O[8]=z.level<2?4:z.level==9?2:0,O[9]=3,z.mtime!=0&&Vb(O,4,Math.floor(new Date(z.mtime||Date.now())/1e3)),W){O[3]=8;for(var ce=0;ce<=W.length;++ce)O[ce+10]=W.charCodeAt(ce)}},D7=function(O){return 10+(O.filename&&O.filename.length+1||0)};function Yk(O,z){z===void 0&&(z={});var W=L7(),ce=O.length;W.p(O);var Te=z7(O,z,D7(z),8),D=Te.length;return O7(Te,z),Vb(Te,D-8,W.d()),Vb(Te,D-4,ce),Te}function Xk(O,z){var W=O.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(O);for(var ce=new Af(O.length+(O.length>>>1)),Te=0,D=function(d){ce[Te++]=d},L=0;Lce.length){var t=new Af(Te+8+(W-L<<1));t.set(ce),ce=t}var b=O.charCodeAt(L);b<128||z?D(b):b<2048?(D(192|b>>>6),D(128|63&b)):b>55295&&b<57344?(D(240|(b=65536+(1047552&b)|1023&O.charCodeAt(++L))>>>18),D(128|b>>>12&63),D(128|b>>>6&63),D(128|63&b)):(D(224|b>>>12),D(128|b>>>6&63),D(128|63&b))}return $k(ce,0,Te)}var l1="[SessionRecording]",Zc=Jc(l1),R7=3e5,F7=[$f.MouseMove,$f.MouseInteraction,$f.Scroll,$f.ViewportResize,$f.Input,$f.TouchMove,$f.MediaInteraction,$f.Drag],i4=O=>({rrwebMethod:O,enqueuedAt:Date.now(),attempt:1});function dg(O){return function(z,W){for(var ce="",Te=0;Te>10,56320|1023&D))}return ce}(Yk(Xk(JSON.stringify(O))),!0)}function a4(O){return O.type===ed.Custom&&O.data.tag==="sessionIdle"}function o4(O,z){return z.some(W=>W.matching==="regex"&&new RegExp(W.url).test(O))}class B7{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var z,W;return Wa==null||(z=Wa.__PosthogExtensions__)===null||z===void 0||(W=z.rrweb)===null||W===void 0?void 0:W.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(l1+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var z,W;return this.triggerStatus==="trigger_pending"?6e4:(z=(W=this.instance.config.session_recording)===null||W===void 0?void 0:W.full_snapshot_interval_millis)!==null&&z!==void 0?z:R7}get isSampled(){var z=this.instance.get_property(a1);return Sg(z)?z:null}get sessionDuration(){var z,W,ce=(z=this.buffer)===null||z===void 0?void 0:z.data[((W=this.buffer)===null||W===void 0?void 0:W.data.length)-1],{sessionStartTimestamp:Te}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return ce?ce.timestamp-Te:null}get isRecordingEnabled(){var z=!!this.instance.get_property(wb),W=!this.instance.config.disable_session_recording;return Hr&&z&&W}get isConsoleLogCaptureEnabled(){var z=!!this.instance.get_property(L5),W=this.instance.config.enable_recording_console_log;return W??z}get canvasRecording(){var z,W,ce,Te,D,L,t=this.instance.config.session_recording.captureCanvas,b=this.instance.get_property(O5),d=(z=(W=t==null?void 0:t.recordCanvas)!==null&&W!==void 0?W:b==null?void 0:b.enabled)!==null&&z!==void 0&&z,e=(ce=(Te=t==null?void 0:t.canvasFps)!==null&&Te!==void 0?Te:b==null?void 0:b.fps)!==null&&ce!==void 0?ce:0,w=(D=(L=t==null?void 0:t.canvasQuality)!==null&&L!==void 0?L:b==null?void 0:b.quality)!==null&&D!==void 0?D:0;return{enabled:d,fps:bp(e,0,12,"canvas recording fps"),quality:bp(w,0,1,"canvas recording quality")}}get networkPayloadCapture(){var z,W,ce=this.instance.get_property(z5),Te={recordHeaders:(z=this.instance.config.session_recording)===null||z===void 0?void 0:z.recordHeaders,recordBody:(W=this.instance.config.session_recording)===null||W===void 0?void 0:W.recordBody},D=(Te==null?void 0:Te.recordHeaders)||(ce==null?void 0:ce.recordHeaders),L=(Te==null?void 0:Te.recordBody)||(ce==null?void 0:ce.recordBody),t=Nu(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,b=!!(Sg(t)?t:ce!=null&&ce.capturePerformance);return D||L||b?{recordHeaders:D,recordBody:L,recordPerformance:b}:void 0}get sampleRate(){var z=this.instance.get_property(D5);return ch(z)?z:null}get minimumDuration(){var z=this.instance.get_property(R5);return ch(z)?z:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this._urlBlocked?"paused":nl(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":Sg(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var z;return this._urlTriggers.length===0?"trigger_disabled":((z=this.instance)===null||z===void 0?void 0:z.get_property(r2))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var z;return this._eventTriggers.length===0?"trigger_disabled":((z=this.instance)===null||z===void 0?void 0:z.get_property(i2))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var z=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",W=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return z?"trigger_activated":W?"trigger_pending":"trigger_disabled"}constructor(z){if(Ri(this,"queuedRRWebEvents",[]),Ri(this,"isIdle",!1),Ri(this,"_linkedFlagSeen",!1),Ri(this,"_lastActivityTimestamp",Date.now()),Ri(this,"_linkedFlag",null),Ri(this,"_removePageViewCaptureHook",void 0),Ri(this,"_onSessionIdListener",void 0),Ri(this,"_persistDecideOnSessionListener",void 0),Ri(this,"_samplingSessionListener",void 0),Ri(this,"_urlTriggers",[]),Ri(this,"_urlBlocklist",[]),Ri(this,"_urlBlocked",!1),Ri(this,"_eventTriggers",[]),Ri(this,"_removeEventTriggerCaptureHook",void 0),Ri(this,"_forceAllowLocalhostNetworkCapture",!1),Ri(this,"_onBeforeUnload",()=>{this._flushBuffer()}),Ri(this,"_onOffline",()=>{this._tryAddCustomEvent("browser offline",{})}),Ri(this,"_onOnline",()=>{this._tryAddCustomEvent("browser online",{})}),Ri(this,"_onVisibilityChange",()=>{if(Xi!=null&&Xi.visibilityState){var Te="window "+Xi.visibilityState;this._tryAddCustomEvent(Te,{})}}),this.instance=z,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Zc.error("started without valid sessionManager"),new Error(l1+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(l1+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:W,windowId:ce}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=W,this.windowId=ce,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Zc.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(z){this.isRecordingEnabled?(this._startCapture(z),Hr==null||Hr.addEventListener("beforeunload",this._onBeforeUnload),Hr==null||Hr.addEventListener("offline",this._onOffline),Hr==null||Hr.addEventListener("online",this._onOnline),Hr==null||Hr.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),nl(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",W=>{try{if(W.event==="$pageview"){var ce=W!=null&&W.properties.$current_url?this._maskUrl(W==null?void 0:W.properties.$current_url):"";if(!ce)return;this._tryAddCustomEvent("$pageview",{href:ce})}}catch(Te){Zc.error("Could not add $pageview to rrweb session",Te)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((W,ce,Te)=>{var D,L,t,b;Te&&(this._tryAddCustomEvent("$session_id_change",{sessionId:W,windowId:ce,changeReason:Te}),(D=this.instance)===null||D===void 0||(L=D.persistence)===null||L===void 0||L.unregister(i2),(t=this.instance)===null||t===void 0||(b=t.persistence)===null||b===void 0||b.unregister(r2))}))):this.stopRecording()}stopRecording(){var z,W,ce,Te;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,Hr==null||Hr.removeEventListener("beforeunload",this._onBeforeUnload),Hr==null||Hr.removeEventListener("offline",this._onOffline),Hr==null||Hr.removeEventListener("online",this._onOnline),Hr==null||Hr.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(z=this._removePageViewCaptureHook)===null||z===void 0||z.call(this),this._removePageViewCaptureHook=void 0,(W=this._removeEventTriggerCaptureHook)===null||W===void 0||W.call(this),this._removeEventTriggerCaptureHook=void 0,(ce=this._onSessionIdListener)===null||ce===void 0||ce.call(this),this._onSessionIdListener=void 0,(Te=this._samplingSessionListener)===null||Te===void 0||Te.call(this),this._samplingSessionListener=void 0,Zc.info("stopped"))}makeSamplingDecision(z){var W,ce=this.sessionId!==z,Te=this.sampleRate;if(ch(Te)){var D,L=this.isSampled,t=ce||!Sg(L);t?D=Math.random(){var y=Nu(w)&&b in w,_=d?w[b]===d:y;_&&this._reportStarted("linked_flag_matched",{linkedFlag:b,linkedVariant:d}),this._linkedFlagSeen=_})}(Te=z.sessionRecording)!==null&&Te!==void 0&&Te.urlTriggers&&(this._urlTriggers=z.sessionRecording.urlTriggers),(D=z.sessionRecording)!==null&&D!==void 0&&D.urlBlocklist&&(this._urlBlocklist=z.sessionRecording.urlBlocklist),(L=z.sessionRecording)!==null&&L!==void 0&&L.eventTriggers&&(this._eventTriggers=z.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){ch(this.sampleRate)&&nl(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(z=>{this.makeSamplingDecision(z)}))}_persistRemoteConfig(z){if(this.instance.persistence){var W,ce=this.instance.persistence,Te=()=>{var D,L,t,b,d,e,w,y,_=(D=z.sessionRecording)===null||D===void 0?void 0:D.sampleRate,u=nl(_)?null:parseFloat(_),r=(L=z.sessionRecording)===null||L===void 0?void 0:L.minimumDurationMilliseconds;ce.register({[wb]:!!z.sessionRecording,[L5]:(t=z.sessionRecording)===null||t===void 0?void 0:t.consoleLogRecordingEnabled,[z5]:bi({capturePerformance:z.capturePerformance},(b=z.sessionRecording)===null||b===void 0?void 0:b.networkPayloadCapture),[O5]:{enabled:(d=z.sessionRecording)===null||d===void 0?void 0:d.recordCanvas,fps:(e=z.sessionRecording)===null||e===void 0?void 0:e.canvasFps,quality:(w=z.sessionRecording)===null||w===void 0?void 0:w.canvasQuality},[D5]:u,[R5]:pa(r)?null:r,[F5]:(y=z.sessionRecording)===null||y===void 0?void 0:y.scriptConfig})};Te(),(W=this._persistDecideOnSessionListener)===null||W===void 0||W.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(Te)}}log(z){var W,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(W=this.instance.sessionRecording)===null||W===void 0||W.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:ce,trace:[],payload:[JSON.stringify(z)]}},timestamp:Date.now()})}_startCapture(z){if(!pa(Object.assign)&&!pa(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var W,ce;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():(W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.loadExternalDependency)===null||ce===void 0||ce.call(W,this.instance,this.scriptName,Te=>{if(Te)return Zc.error("could not load recorder",Te);this._onScriptLoaded()}),Zc.info("starting"),this.status==="active"&&this._reportStarted(z||"recording_initialized")}}get scriptName(){var z,W,ce;return((z=this.instance)===null||z===void 0||(W=z.persistence)===null||W===void 0||(ce=W.get_property(F5))===null||ce===void 0?void 0:ce.script)||"recorder"}isInteractiveEvent(z){var W;return z.type===3&&F7.indexOf((W=z.data)===null||W===void 0?void 0:W.source)!==-1}_updateWindowAndSessionIds(z){var W=this.isInteractiveEvent(z);W||this.isIdle||z.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:z.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var ce=!1;if(W&&(this._lastActivityTimestamp=z.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:z.type}),ce=!0)),!this.isIdle){var{windowId:Te,sessionId:D}=this.sessionManager.checkAndGetSessionAndWindowId(!W,z.timestamp),L=this.sessionId!==D,t=this.windowId!==Te;this.windowId=Te,this.sessionId=D,L||t?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):ce&&this._scheduleFullSnapshot()}}_tryRRWebMethod(z){try{return z.rrwebMethod(),!0}catch(W){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:z.enqueuedAt||Date.now(),attempt:z.attempt++,rrwebMethod:z.rrwebMethod}):Zc.warn("could not emit queued rrweb event.",W,z),!1}}_tryAddCustomEvent(z,W){return this._tryRRWebMethod(i4(()=>this.rrwebRecord.addCustomEvent(z,W)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(i4(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var z,W={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},ce=this.instance.config.session_recording;for(var[Te,D]of Object.entries(ce||{}))Te in W&&(Te==="maskInputOptions"?W.maskInputOptions=bi({password:!0},D):W[Te]=D);if(this.canvasRecording&&this.canvasRecording.enabled&&(W.recordCanvas=!0,W.sampling={canvas:this.canvasRecording.fps},W.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(z=this.mutationRateLimiter)!==null&&z!==void 0?z:new S7(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(t,b)=>{var d="Too many mutations on node '".concat(t,"'. Rate limiting. This could be due to SVG animations or something similar");Zc.info(d,{node:b}),this.log(l1+" "+d,"warn")}});var L=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(bi({emit:t=>{this.onRRwebEmit(t)},plugins:L},W)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:W,activePlugins:L.map(t=>t==null?void 0:t.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Zc.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var z=this.fullSnapshotIntervalMillis;z&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},z))}}_gatherRRWebPlugins(){var z,W,ce,Te,D=[],L=(z=Wa.__PosthogExtensions__)===null||z===void 0||(W=z.rrwebPlugins)===null||W===void 0?void 0:W.getRecordConsolePlugin;L&&this.isConsoleLogCaptureEnabled&&D.push(L());var t=(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.rrwebPlugins)===null||Te===void 0?void 0:Te.getRecordNetworkPlugin;return this.networkPayloadCapture&&Yh(t)&&(!n7.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?D.push(t(A7(this.instance.config,this.networkPayloadCapture))):Zc.info("NetworkCapture not started because we are on localhost.")),D}onRRwebEmit(z){var W;if(this._processQueuedEvents(),z&&Nu(z)){if(z.type===ed.Meta){var ce=this._maskUrl(z.data.href);if(this._lastHref=ce,!ce)return;z.data.href=ce}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),this.status!=="paused"||function(w){return w.type===ed.Custom&&w.data.tag==="recording paused"}(z)){z.type===ed.FullSnapshot&&this._scheduleFullSnapshot(),z.type===ed.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var Te=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(z):z;if(Te){var D=function(w){var y=w;if(y&&Nu(y)&&y.type===6&&Nu(y.data)&&y.data.plugin==="rrweb/console@1"){y.data.payload.payload.length>10&&(y.data.payload.payload=y.data.payload.payload.slice(0,10),y.data.payload.payload.push("...[truncated]"));for(var _=[],u=0;u2e3?_.push(y.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):_.push(y.data.payload.payload[u]);return y.data.payload.payload=_,w}return w}(Te);if(this._updateWindowAndSessionIds(D),!this.isIdle||a4(D)){if(a4(D)){var L=D.data.payload;if(L){var t=L.lastActivityTimestamp,b=L.threshold;D.timestamp=t+b}}var d=(W=this.instance.config.session_recording.compress_events)===null||W===void 0||W?function(w){if(Vx(w)<1024)return w;try{if(w.type===ed.FullSnapshot)return bi(bi({},w),{},{data:dg(w.data),cv:"2024-10"});if(w.type===ed.IncrementalSnapshot&&w.data.source===$f.Mutation)return bi(bi({},w),{},{cv:"2024-10",data:bi(bi({},w.data),{},{texts:dg(w.data.texts),attributes:dg(w.data.attributes),removes:dg(w.data.removes),adds:dg(w.data.adds)})});if(w.type===ed.IncrementalSnapshot&&w.data.source===$f.StyleSheetRule)return bi(bi({},w),{},{cv:"2024-10",data:bi(bi({},w.data),{},{adds:dg(w.data.adds),removes:dg(w.data.removes)})})}catch(y){Zc.error("could not compress event - will use uncompressed event",y)}return w}(D):D,e={$snapshot_bytes:Vx(d),$snapshot_data:d,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(e):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&Hr){var z=this._maskUrl(Hr.location.href);this._lastHref!==z&&(this._tryAddCustomEvent("$url_changed",{href:z}),this._lastHref=z)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var z=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],z.forEach(W=>{Date.now()-W.enqueuedAt<=2e3&&this._tryRRWebMethod(W)})}}_maskUrl(z){var W=this.instance.config.session_recording;if(W.maskNetworkRequestFn){var ce,Te={url:z};return(ce=Te=W.maskNetworkRequestFn(Te))===null||ce===void 0?void 0:ce.url}return z}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var z=this.minimumDuration,W=this.sessionDuration,ce=ch(W)&&W>=0,Te=ch(z)&&ce&&W{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&zb(this.buffer).forEach(D=>{this._captureSnapshot({$snapshot_bytes:D.size,$snapshot_data:D.data,$session_id:D.sessionId,$window_id:D.windowId,$lib:"web",$lib_version:id.LIB_VERSION})}),this.clearBuffer())}_captureSnapshotBuffered(z){var W,ce=2+(((W=this.buffer)===null||W===void 0?void 0:W.data.length)||0);!this.isIdle&&(this.buffer.size+z.$snapshot_bytes+ce>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=z.$snapshot_bytes,this.buffer.data.push(z.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(z){this.instance.capture("$snapshot",z,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(Hr!==void 0&&Hr.location.href){var z=Hr.location.href,W=this.status==="paused",ce=o4(z,this._urlBlocklist);ce&&!W?this._pauseRecording():!ce&&W&&this._resumeRecording(),o4(z,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(z){var W,ce;this.triggerStatus==="trigger_pending"&&((W=this.instance)===null||W===void 0||(ce=W.persistence)===null||ce===void 0||ce.register({[z==="url"?r2:i2]:this.sessionId}),this._flushBuffer(),this._reportStarted(z+"_trigger_matched"))}_pauseRecording(){this.status!=="paused"&&(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Zc.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this.status==="paused"&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Zc.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&nl(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",z=>{try{this._eventTriggers.includes(z.event)&&this._activateTrigger("event")}catch(W){Zc.error("Could not activate event trigger",W)}}))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var z;(z=this.instance.persistence)===null||z===void 0||z.register({[a1]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(z){this._activateTrigger(z)}_reportStarted(z,W){this.instance.register_for_session({$session_recording_start_reason:z}),Zc.info(z.replace("_"," "),W),bo(["recording_initialized","session_id_changed"],z)||this._tryAddCustomEvent(z,W)}}var gg=Jc("[RemoteConfig]");class N7{constructor(z){this.instance=z}get remoteConfig(){var z,W;return(z=Wa._POSTHOG_REMOTE_CONFIG)===null||z===void 0||(W=z[this.instance.config.token])===null||W===void 0?void 0:W.config}_loadRemoteConfigJs(z){var W,ce,Te;(W=Wa.__PosthogExtensions__)!==null&&W!==void 0&&W.loadExternalDependency?(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.loadExternalDependency)===null||Te===void 0||Te.call(ce,this.instance,"remote-config",()=>z(this.remoteConfig)):(gg.error("PostHog Extensions not found. Cannot load remote config."),z())}_loadRemoteConfigJSON(z){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:W=>{z(W.json)}})}load(){try{if(this.remoteConfig)return gg.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void gg.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs(z=>{if(!z)return gg.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON(W=>{this.onRemoteConfig(W)});this.onRemoteConfig(z)})}catch(z){gg.error("Error loading remote config",z)}}onRemoteConfig(z){z?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(z),z.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):gg.info("__preview_remote_config is disabled. Logging config instead",z):gg.error("Failed to fetch remote config from PostHog.")}}var td,j7=Hr!=null&&Hr.location?jx(Hr.location.hash,"__posthog")||jx(location.hash,"state"):null,s4="_postHogToolbarParams",l4=Jc("[Toolbar]");(function(O){O[O.UNINITIALIZED=0]="UNINITIALIZED",O[O.LOADING=1]="LOADING",O[O.LOADED=2]="LOADED"})(td||(td={}));class U7{constructor(z){this.instance=z}setToolbarState(z){Wa.ph_toolbar_state=z}getToolbarState(){var z;return(z=Wa.ph_toolbar_state)!==null&&z!==void 0?z:td.UNINITIALIZED}maybeLoadToolbar(){var z,W,ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!Hr||!Xi)return!1;ce=(z=ce)!==null&&z!==void 0?z:Hr.location,D=(W=D)!==null&&W!==void 0?W:Hr.history;try{if(!Te){try{Hr.localStorage.setItem("test","test"),Hr.localStorage.removeItem("test")}catch{return!1}Te=Hr==null?void 0:Hr.localStorage}var L,t=j7||jx(ce.hash,"__posthog")||jx(ce.hash,"state"),b=t?M5(()=>JSON.parse(atob(decodeURIComponent(t))))||M5(()=>JSON.parse(decodeURIComponent(t))):null;return b&&b.action==="ph_authorize"?((L=b).source="url",L&&Object.keys(L).length>0&&(b.desiredHash?ce.hash=b.desiredHash:D?D.replaceState(D.state,"",ce.pathname+ce.search):ce.hash="")):((L=JSON.parse(Te.getItem(s4)||"{}")).source="localstorage",delete L.userIntent),!(!L.token||this.instance.config.token!==L.token)&&(this.loadToolbar(L),!0)}catch{return!1}}_callLoadToolbar(z){var W=Wa.ph_load_toolbar||Wa.ph_load_editor;!nl(W)&&Yh(W)?W(z,this.instance):l4.warn("No toolbar load function found")}loadToolbar(z){var W=!(Xi==null||!Xi.getElementById(yk));if(!Hr||W)return!1;var ce=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,Te=bi(bi({token:this.instance.config.token},z),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},ce?{instrument:!1}:{});if(Hr.localStorage.setItem(s4,JSON.stringify(bi(bi({},Te),{},{source:void 0}))),this.getToolbarState()===td.LOADED)this._callLoadToolbar(Te);else if(this.getToolbarState()===td.UNINITIALIZED){var D,L;this.setToolbarState(td.LOADING),(D=Wa.__PosthogExtensions__)===null||D===void 0||(L=D.loadExternalDependency)===null||L===void 0||L.call(D,this.instance,"toolbar",t=>{if(t)return l4.error("[Toolbar] Failed to load",t),void this.setToolbarState(td.UNINITIALIZED);this.setToolbarState(td.LOADED),this._callLoadToolbar(Te)}),ad(Hr,"turbolinks:load",()=>{this.setToolbarState(td.UNINITIALIZED),this.loadToolbar(Te)})}return!0}_loadEditor(z){return this.loadToolbar(z)}maybeLoadEditor(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(z,W,ce)}}class V7{constructor(z){Ri(this,"isPaused",!0),Ri(this,"queue",[]),Ri(this,"flushTimeoutMs",3e3),this.sendRequest=z}enqueue(z){this.queue.push(z),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var z=this.queue.length>0?this.formatQueue():{},W=Object.values(z),ce=[...W.filter(Te=>Te.url.indexOf("/e")===0),...W.filter(Te=>Te.url.indexOf("/e")!==0)];ce.map(Te=>{this.sendRequest(bi(bi({},Te),{},{transport:"sendBeacon"}))})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var z=this;this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){var W=this.formatQueue(),ce=function(D){var L=W[D],t=new Date().getTime();L.data&&Bu(L.data)&&tl(L.data,b=>{b.offset=Math.abs(b.timestamp-t),delete b.timestamp}),z.sendRequest(L)};for(var Te in W)ce(Te)}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var z={};return tl(this.queue,W=>{var ce,Te=W,D=(Te?Te.batchKey:null)||Te.url;pa(z[D])&&(z[D]=bi(bi({},Te),{},{data:[]})),(ce=z[D].data)===null||ce===void 0||ce.push(Te.data)}),this.queue=[],z}}var q7=function(O){var z,W,ce,Te,D="";for(z=W=0,ce=(O=(O+"").replace(/\r\n/g,` `).replace(/\r/g,` -`)).length,Te=0;Te127&&L<2048?String.fromCharCode(L>>6|192,63&L|128):String.fromCharCode(L>>12|224,L>>6&63|128,63&L|128),A0(t)||(W>z&&(D+=O.substring(z,W)),D+=t,z=W=Te+1)}return W>z&&(D+=O.substring(z,O.length)),D},G7=!!yb||!!vb,u4="text/plain",Gx=(O,z)=>{var[W,ce]=O.split("?"),Te=bi({},z);ce==null||ce.split("&").forEach(L=>{var[t]=L.split("=");delete Te[t]});var D=i7(Te);return D=D?(ce?ce+"&":"")+D:ce,"".concat(W,"?").concat(D)},u1=(O,z)=>JSON.stringify(O,(W,ce)=>typeof ce=="bigint"?ce.toString():ce,z),c2=O=>{var{data:z,compression:W}=O;if(z){if(W===yp.GZipJS){var ce=Yk(Xk(u1(z)),{mtime:0}),Te=new Blob([ce],{type:u4});return{contentType:u4,body:Te,estimatedSize:Te.size}}if(W===yp.Base64){var D=function(b){var d,e,w,y,_,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=0,n=0,l="",o=[];if(!b)return b;b=H7(b);do d=(_=b.charCodeAt(r++)<<16|b.charCodeAt(r++)<<8|b.charCodeAt(r++))>>18&63,e=_>>12&63,w=_>>6&63,y=63&_,o[n++]=u.charAt(d)+u.charAt(e)+u.charAt(w)+u.charAt(y);while(r"data="+encodeURIComponent(typeof b=="string"?b:u1(b)))(D);return{contentType:"application/x-www-form-urlencoded",body:L,estimatedSize:new Blob([L]).size}}var t=u1(z);return{contentType:"application/json",body:t,estimatedSize:new Blob([t]).size}}},b1=[];vb&&b1.push({transport:"fetch",method:O=>{var z,W,{contentType:ce,body:Te,estimatedSize:D}=(z=c2(O))!==null&&z!==void 0?z:{},L=new Headers;tl(O.headers,function(e,w){L.append(w,e)}),ce&&L.append("Content-Type",ce);var t=O.url,b=null;if(T5){var d=new T5;b={signal:d.signal,timeout:setTimeout(()=>d.abort(),O.timeout)}}vb(t,bi({method:(O==null?void 0:O.method)||"GET",headers:L,keepalive:O.method==="POST"&&(D||0)<52428.8,body:Te,signal:(W=b)===null||W===void 0?void 0:W.signal},O.fetchOptions)).then(e=>e.text().then(w=>{var y,_={statusCode:e.status,text:w};if(e.status===200)try{_.json=JSON.parse(w)}catch(u){ha.error(u)}(y=O.callback)===null||y===void 0||y.call(O,_)})).catch(e=>{var w;ha.error(e),(w=O.callback)===null||w===void 0||w.call(O,{statusCode:0,text:e})}).finally(()=>b?clearTimeout(b.timeout):null)}}),yb&&b1.push({transport:"XHR",method:O=>{var z,W=new yb;W.open(O.method||"GET",O.url,!0);var{contentType:ce,body:Te}=(z=c2(O))!==null&&z!==void 0?z:{};tl(O.headers,function(D,L){W.setRequestHeader(L,D)}),ce&&W.setRequestHeader("Content-Type",ce),O.timeout&&(W.timeout=O.timeout),W.withCredentials=!0,W.onreadystatechange=()=>{if(W.readyState===4){var D,L={statusCode:W.status,text:W.responseText};if(W.status===200)try{L.json=JSON.parse(W.responseText)}catch{}(D=O.callback)===null||D===void 0||D.call(O,L)}},W.send(Te)}}),$h!=null&&$h.sendBeacon&&b1.push({transport:"sendBeacon",method:O=>{var z=Gx(O.url,{beacon:"1"});try{var W,{contentType:ce,body:Te}=(W=c2(O))!==null&&W!==void 0?W:{},D=typeof Te=="string"?new Blob([Te],{type:ce}):Te;$h.sendBeacon(z,D)}catch{}}});var W7=["retriesPerformedSoFar"];class Z7{constructor(z){Ri(this,"isPolling",!1),Ri(this,"pollIntervalMs",3e3),Ri(this,"queue",[]),this.instance=z,this.queue=[],this.areWeOnline=!0,!pa(Hr)&&"onLine"in Hr.navigator&&(this.areWeOnline=Hr.navigator.onLine,Hr.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),Hr.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(z){var{retriesPerformedSoFar:W}=z,ce=dk(z,W7);ch(W)&&W>0&&(ce.url=Gx(ce.url,{retry_count:W})),this.instance._send_request(bi(bi({},ce),{},{callback:Te=>{var D;Te.statusCode!==200&&(Te.statusCode<400||Te.statusCode>=500)&&(W??0)<10?this.enqueue(bi({retriesPerformedSoFar:W},ce)):(D=ce.callback)===null||D===void 0||D.call(ce,Te)}}))}enqueue(z){var W=z.retriesPerformedSoFar||0;z.retriesPerformedSoFar=W+1;var ce=function(L){var t=3e3*Math.pow(2,L),b=t/2,d=Math.min(18e5,t),e=(Math.random()-.5)*(d-b);return Math.ceil(d+e)}(W),Te=Date.now()+ce;this.queue.push({retryAt:Te,requestOptions:z});var D="Enqueued failed request for retry in ".concat(ce);navigator.onLine||(D+=" (Browser is offline)"),ha.warn(D),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var z=Date.now(),W=[],ce=this.queue.filter(D=>D.retryAt0)for(var{requestOptions:Te}of ce)this.retriableRequest(Te)}unload(){for(var{requestOptions:z}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(bi(bi({},z),{},{transport:"sendBeacon"}))}catch(W){ha.error(W)}this.queue=[]}}var Mg,c4=Jc("[SessionId]");class $7{constructor(z,W,ce){var Te;if(Ri(this,"_sessionIdChangedHandlers",[]),!z.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(z.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=z.config,this.persistence=z.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=W||i0,this._windowIdGenerator=ce||i0;var D=this.config.persistence_name||this.config.token,L=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*bp(L,60,36e3,"session_idle_timeout_seconds",1800),z.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+D+"_window_id",this._primary_window_exists_storage_key="ph_"+D+"_primary_window_exists",this._canUseSessionStorage()){var t=zc.parse(this._window_id_storage_key),b=zc.parse(this._primary_window_exists_storage_key);t&&!b?this._windowId=t:zc.remove(this._window_id_storage_key),zc.set(this._primary_window_exists_storage_key,!0)}if((Te=this.config.bootstrap)!==null&&Te!==void 0&&Te.sessionID)try{var d=(e=>{var w=e.replace(/-/g,"");if(w.length!==32)throw new Error("Not a valid UUID");if(w[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(w.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),d)}catch(e){c4.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(z){return pa(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(z),this._sessionId&&z(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(W=>W!==z)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&zc.is_supported()}_setWindowId(z){z!==this._windowId&&(this._windowId=z,this._canUseSessionStorage()&&zc.set(this._window_id_storage_key,z))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?zc.parse(this._window_id_storage_key):null}_setSessionId(z,W,ce){z===this._sessionId&&W===this._sessionActivityTimestamp&&ce===this._sessionStartTimestamp||(this._sessionStartTimestamp=ce,this._sessionActivityTimestamp=W,this._sessionId=z,this.persistence.register({[Dx]:[W,z,ce]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var z=this.persistence.props[Dx];return Bu(z)&&z.length===2&&z.push(z[0]),z||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){Hr==null||Hr.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&zc.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var z=arguments.length>0&&arguments[0]!==void 0&&arguments[0],W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var ce=W||new Date().getTime(),[Te,D,L]=this._getSessionId(),t=this._getWindowId(),b=ch(L)&&L>0&&Math.abs(ce-L)>864e5,d=!1,e=!D,w=!z&&Math.abs(ce-Te)>this.sessionTimeoutMs;e||w||b?(D=this._sessionIdGenerator(),t=this._windowIdGenerator(),c4.info("new session ID generated",{sessionId:D,windowId:t,changeReason:{noSessionId:e,activityTimeout:w,sessionPastMaximumLength:b}}),L=ce,d=!0):t||(t=this._windowIdGenerator(),d=!0);var y=Te===0||!z||b?ce:Te,_=L===0?new Date().getTime():L;return this._setWindowId(t),this._setSessionId(D,y,_),z||this.resetIdleTimer(),d&&this._sessionIdChangedHandlers.forEach(u=>u(D,t,d?{noSessionId:e,activityTimeout:w,sessionPastMaximumLength:b}:void 0)),{sessionId:D,windowId:t,sessionStartTimestamp:_,changeReason:d?{noSessionId:e,activityTimeout:w,sessionPastMaximumLength:b}:void 0,lastActivityTimestamp:Te}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}(function(O){O.US="us",O.EU="eu",O.CUSTOM="custom"})(Mg||(Mg={}));var h4="i.posthog.com";class Y7{constructor(z){Ri(this,"_regionCache",{}),this.instance=z}get apiHost(){var z=this.instance.config.api_host.trim().replace(/\/$/,"");return z==="https://app.posthog.com"?"https://us.i.posthog.com":z}get uiHost(){var z,W=(z=this.instance.config.ui_host)===null||z===void 0?void 0:z.replace(/\/$/,"");return W||(W=this.apiHost.replace(".".concat(h4),".posthog.com")),W==="https://app.posthog.com"?"https://us.posthog.com":W}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Mg.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Mg.EU:this._regionCache[this.apiHost]=Mg.CUSTOM),this._regionCache[this.apiHost]}endpointFor(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(W&&(W=W[0]==="/"?W:"/".concat(W)),z==="ui")return this.uiHost+W;if(this.region===Mg.CUSTOM)return this.apiHost+W;var ce=h4+W;switch(z){case"assets":return"https://".concat(this.region,"-assets.").concat(ce);case"api":return"https://".concat(this.region,".").concat(ce)}}}var Kk="posthog-js";function Jk(O){var{organization:z,projectId:W,prefix:ce,severityAllowList:Te=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return D=>{var L,t,b,d,e;if(!(Te==="*"||Te.includes(D.level))||!O.__loaded)return D;D.tags||(D.tags={});var w=O.requestRouter.endpointFor("ui","/project/".concat(O.config.token,"/person/").concat(O.get_distinct_id()));D.tags["PostHog Person URL"]=w,O.sessionRecordingStarted()&&(D.tags["PostHog Recording URL"]=O.get_session_replay_url({withTimestamp:!0}));var y=((L=D.exception)===null||L===void 0?void 0:L.values)||[];y.forEach(u=>{u.stacktrace&&(u.stacktrace.type="raw",u.stacktrace.frames.forEach(r=>{r.platform="web:javascript"}))});var _={$exception_message:((t=y[0])===null||t===void 0?void 0:t.value)||D.message,$exception_type:(b=y[0])===null||b===void 0?void 0:b.type,$exception_personURL:w,$exception_level:D.level,$exception_list:y,$sentry_event_id:D.event_id,$sentry_exception:D.exception,$sentry_exception_message:((d=y[0])===null||d===void 0?void 0:d.value)||D.message,$sentry_exception_type:(e=y[0])===null||e===void 0?void 0:e.type,$sentry_tags:D.tags};return z&&W&&(_.$sentry_url=(ce||"https://sentry.io/organizations/")+z+"/issues/?project="+W+"&query="+D.event_id),O.exceptions.sendExceptionEvent(_),D}}class X7{constructor(z,W,ce,Te,D){this.name=Kk,this.setupOnce=function(L){L(Jk(z,{organization:W,projectId:ce,prefix:Te,severityAllowList:D}))}}}var h2=Jc("[SegmentIntegration]");function K7(O,z){var W=O.config.segment;if(!W)return z();(function(ce,Te){var D=ce.config.segment;if(!D)return Te();var L=b=>{var d=()=>b.anonymousId()||i0();ce.config.get_device_id=d,b.id()&&(ce.register({distinct_id:b.id(),$device_id:d()}),ce.persistence.set_property(Qp,"identified")),Te()},t=D.user();"then"in t&&Yh(t.then)?t.then(b=>L(b)):L(t)})(O,()=>{W.register((ce=>{Promise&&Promise.resolve||h2.warn("This browser does not have Promise support, and can not use the segment integration");var Te=(D,L)=>{var t;if(!L)return D;D.event.userId||D.event.anonymousId===ce.get_distinct_id()||(h2.info("No userId set, resetting PostHog"),ce.reset()),D.event.userId&&D.event.userId!==ce.get_distinct_id()&&(h2.info("UserId set, identifying with PostHog"),ce.identify(D.event.userId));var b=ce._calculate_event_properties(L,(t=D.event.properties)!==null&&t!==void 0?t:{},new Date);return D.event.properties=Object.assign({},b,D.event.properties),D};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:D=>Te(D,D.event.event),page:D=>Te(D,"$pageview"),identify:D=>Te(D,"$identify"),screen:D=>Te(D,"$screen")}})(O)).then(()=>{z()})})}class J7{constructor(z){this._instance=z}doPageView(z,W){var ce,Te=this._previousPageViewProperties(z,W);return this._currentPageview={pathname:(ce=Hr==null?void 0:Hr.location.pathname)!==null&&ce!==void 0?ce:"",pageViewId:W,timestamp:z},this._instance.scrollManager.resetContext(),Te}doPageLeave(z){var W;return this._previousPageViewProperties(z,(W=this._currentPageview)===null||W===void 0?void 0:W.pageViewId)}doEvent(){var z;return{$pageview_id:(z=this._currentPageview)===null||z===void 0?void 0:z.pageViewId}}_previousPageViewProperties(z,W){var ce=this._currentPageview;if(!ce)return{$pageview_id:W};var Te={$pageview_id:W,$prev_pageview_id:ce.pageViewId},D=this._instance.scrollManager.getContext();if(D&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:L,lastScrollY:t,maxScrollY:b,maxContentHeight:d,lastContentY:e,maxContentY:w}=D;if(!(pa(L)||pa(t)||pa(b)||pa(d)||pa(e)||pa(w))){L=Math.ceil(L),t=Math.ceil(t),b=Math.ceil(b),d=Math.ceil(d),e=Math.ceil(e),w=Math.ceil(w);var y=L<=1?1:bp(t/L,0,1),_=L<=1?1:bp(b/L,0,1),u=d<=1?1:bp(e/d,0,1),r=d<=1?1:bp(w/d,0,1);Te=Xc(Te,{$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:y,$prev_pageview_max_scroll:b,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:e,$prev_pageview_last_content_percentage:u,$prev_pageview_max_content:w,$prev_pageview_max_content_percentage:r})}}return ce.pathname&&(Te.$prev_pageview_pathname=ce.pathname),ce.timestamp&&(Te.$prev_pageview_duration=(z.getTime()-ce.timestamp.getTime())/1e3),Te}}var Qk,Au,e8,bg,f4,t8,qb,n8,Hb={},r8=[],Q7=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,t3=Array.isArray;function a0(O,z){for(var W in z)O[W]=z[W];return O}function i8(O){var z=O.parentNode;z&&z.removeChild(O)}function f2(O,z,W,ce,Te){var D={type:O,props:z,key:W,ref:ce,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:Te??++e8,__i:-1,__u:0};return Te==null&&Au.vnode!=null&&Au.vnode(D),D}function n3(O){return O.children}function ax(O,z){this.props=O,this.context=z}function dv(O,z){if(z==null)return O.__?dv(O.__,O.__i+1):null;for(var W;zz&&bg.sort(qb));Wx.__r=0}function o8(O,z,W,ce,Te,D,L,t,b,d,e){var w,y,_,u,r,n=ce&&ce.__k||r8,l=z.length;for(W.__d=b,e9(W,z,n),b=W.__d,w=0;w0?f2(Te.type,Te.props,Te.key,Te.ref?Te.ref:null,Te.__v):Te)!=null?(Te.__=O,Te.__b=O.__b+1,t=t9(Te,W,L=ce+w,e),Te.__i=t,D=null,t!==-1&&(e--,(D=W[t])&&(D.__u|=131072)),D==null||D.__v===null?(t==-1&&w--,typeof Te.type!="function"&&(Te.__u|=65536)):t!==L&&(t===L+1?w++:t>L?e>b-L?w+=t-L:w--:w=t(b!=null&&!(131072&b.__u)?1:0))for(;L>=0||t=0){if((b=z[L])&&!(131072&b.__u)&&Te==b.key&&D===b.type)return L;L--}if(t{},isPopup:!0,onPreviewSubmit:()=>{}}),function(O){O.Popover="popover",O.API="api",O.Widget="widget"}(m4||(m4={})),function(O){O.Open="open",O.MultipleChoice="multiple_choice",O.SingleChoice="single_choice",O.Rating="rating",O.Link="link"}(Zx||(Zx={})),function(O){O.NextQuestion="next_question",O.End="end",O.ResponseBased="response_based",O.SpecificQuestion="specific_question"}(Wf||(Wf={}));class u8{constructor(){Ri(this,"events",{}),this.events={}}on(z,W){return this.events[z]||(this.events[z]=[]),this.events[z].push(W),()=>{this.events[z]=this.events[z].filter(ce=>ce!==W)}}emit(z,W){for(var ce of this.events[z]||[])ce(W);for(var Te of this.events["*"]||[])Te(z,W)}}class wg{constructor(z){Ri(this,"_debugEventEmitter",new u8),Ri(this,"checkStep",(W,ce)=>this.checkStepEvent(W,ce)&&this.checkStepUrl(W,ce)&&this.checkStepElement(W,ce)),Ri(this,"checkStepEvent",(W,ce)=>ce==null||!ce.event||(W==null?void 0:W.event)===(ce==null?void 0:ce.event)),this.instance=z,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var z;if(!pa((z=this.instance)===null||z===void 0?void 0:z._addCaptureHook)){var W;(W=this.instance)===null||W===void 0||W._addCaptureHook((ce,Te)=>{this.on(ce,Te)})}}register(z){var W,ce;if(!pa((W=this.instance)===null||W===void 0?void 0:W._addCaptureHook)&&(z.forEach(L=>{var t,b;(t=this.actionRegistry)===null||t===void 0||t.add(L),(b=L.steps)===null||b===void 0||b.forEach(d=>{var e;(e=this.actionEvents)===null||e===void 0||e.add((d==null?void 0:d.event)||"")})}),(ce=this.instance)!==null&&ce!==void 0&&ce.autocapture)){var Te,D=new Set;z.forEach(L=>{var t;(t=L.steps)===null||t===void 0||t.forEach(b=>{b!=null&&b.selector&&D.add(b==null?void 0:b.selector)})}),(Te=this.instance)===null||Te===void 0||Te.autocapture.setElementSelectors(D)}}on(z,W){var ce;W!=null&&z.length!=0&&(this.actionEvents.has(z)||this.actionEvents.has(W==null?void 0:W.event))&&this.actionRegistry&&((ce=this.actionRegistry)===null||ce===void 0?void 0:ce.size)>0&&this.actionRegistry.forEach(Te=>{this.checkAction(W,Te)&&this._debugEventEmitter.emit("actionCaptured",Te.name)})}_addActionHook(z){this.onAction("actionCaptured",W=>z(W))}checkAction(z,W){if((W==null?void 0:W.steps)==null)return!1;for(var ce of W.steps)if(this.checkStep(z,ce))return!0;return!1}onAction(z,W){return this._debugEventEmitter.on(z,W)}checkStepUrl(z,W){if(W!=null&&W.url){var ce,Te=z==null||(ce=z.properties)===null||ce===void 0?void 0:ce.$current_url;if(!Te||typeof Te!="string"||!wg.matchString(Te,W==null?void 0:W.url,(W==null?void 0:W.url_matching)||"contains"))return!1}return!0}static matchString(z,W,ce){switch(ce){case"regex":return!!Hr&&cv(z,W);case"exact":return W===z;case"contains":var Te=wg.escapeStringRegexp(W).replace(/_/g,".").replace(/%/g,".*");return cv(z,Te);default:return!1}}static escapeStringRegexp(z){return z.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(z,W){if((W!=null&&W.href||W!=null&&W.tag_name||W!=null&&W.text)&&!this.getElementsList(z).some(D=>!(W!=null&&W.href&&!wg.matchString(D.href||"",W==null?void 0:W.href,(W==null?void 0:W.href_matching)||"exact"))&&(W==null||!W.tag_name||D.tag_name===(W==null?void 0:W.tag_name))&&!(W!=null&&W.text&&!wg.matchString(D.text||"",W==null?void 0:W.text,(W==null?void 0:W.text_matching)||"exact")&&!wg.matchString(D.$el_text||"",W==null?void 0:W.text,(W==null?void 0:W.text_matching)||"exact"))))return!1;if(W!=null&&W.selector){var ce,Te=z==null||(ce=z.properties)===null||ce===void 0?void 0:ce.$element_selectors;if(!Te||!Te.includes(W==null?void 0:W.selector))return!1}return!0}getElementsList(z){return(z==null?void 0:z.properties.$elements)==null?[]:z==null?void 0:z.properties.$elements}}class H1{constructor(z){this.instance=z,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(z){var W;pa((W=this.instance)===null||W===void 0?void 0:W._addCaptureHook)||(this.setupEventBasedSurveys(z),this.setupActionBasedSurveys(z))}setupActionBasedSurveys(z){var W=z.filter(ce=>{var Te,D,L,t;return((Te=ce.conditions)===null||Te===void 0?void 0:Te.actions)&&((D=ce.conditions)===null||D===void 0||(L=D.actions)===null||L===void 0||(t=L.values)===null||t===void 0?void 0:t.length)>0});W.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new wg(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(ce=>{this.onAction(ce)})),W.forEach(ce=>{var Te,D,L,t,b,d,e,w,y,_;ce.conditions&&(Te=ce.conditions)!==null&&Te!==void 0&&Te.actions&&(D=ce.conditions)!==null&&D!==void 0&&(L=D.actions)!==null&&L!==void 0&&L.values&&((t=ce.conditions)===null||t===void 0||(b=t.actions)===null||b===void 0||(d=b.values)===null||d===void 0?void 0:d.length)>0&&((e=this.actionMatcher)===null||e===void 0||e.register(ce.conditions.actions.values),(w=ce.conditions)===null||w===void 0||(y=w.actions)===null||y===void 0||(_=y.values)===null||_===void 0||_.forEach(u=>{if(u&&u.name){var r=this.actionToSurveys.get(u.name);r&&r.push(ce.id),this.actionToSurveys.set(u.name,r||[ce.id])}}))}))}setupEventBasedSurveys(z){var W;z.filter(ce=>{var Te,D,L,t;return((Te=ce.conditions)===null||Te===void 0?void 0:Te.events)&&((D=ce.conditions)===null||D===void 0||(L=D.events)===null||L===void 0||(t=L.values)===null||t===void 0?void 0:t.length)>0}).length!==0&&((W=this.instance)===null||W===void 0||W._addCaptureHook((ce,Te)=>{this.onEvent(ce,Te)}),z.forEach(ce=>{var Te,D,L;(Te=ce.conditions)===null||Te===void 0||(D=Te.events)===null||D===void 0||(L=D.values)===null||L===void 0||L.forEach(t=>{if(t&&t.name){var b=this.eventToSurveys.get(t.name);b&&b.push(ce.id),this.eventToSurveys.set(t.name,b||[ce.id])}})}))}onEvent(z,W){var ce,Te,D=((ce=this.instance)===null||ce===void 0||(Te=ce.persistence)===null||Te===void 0?void 0:Te.props[Iy])||[];if(H1.SURVEY_SHOWN_EVENT_NAME==z&&W&&D.length>0){var L,t=W==null||(L=W.properties)===null||L===void 0?void 0:L.$survey_id;if(t){var b=D.indexOf(t);b>=0&&(D.splice(b,1),this._updateActivatedSurveys(D))}}else this.eventToSurveys.has(z)&&this._updateActivatedSurveys(D.concat(this.eventToSurveys.get(z)||[]))}onAction(z){var W,ce,Te=((W=this.instance)===null||W===void 0||(ce=W.persistence)===null||ce===void 0?void 0:ce.props[Iy])||[];this.actionToSurveys.has(z)&&this._updateActivatedSurveys(Te.concat(this.actionToSurveys.get(z)||[]))}_updateActivatedSurveys(z){var W,ce;(W=this.instance)===null||W===void 0||(ce=W.persistence)===null||ce===void 0||ce.register({[Iy]:[...new Set(z)]})}getSurveys(){var z,W,ce=(z=this.instance)===null||z===void 0||(W=z.persistence)===null||W===void 0?void 0:W.props[Iy];return ce||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}Ri(H1,"SURVEY_SHOWN_EVENT_NAME","survey shown");var c1=Jc("[Surveys]"),a9={icontains:O=>!!Hr&&Hr.location.href.toLowerCase().indexOf(O.toLowerCase())>-1,not_icontains:O=>!!Hr&&Hr.location.href.toLowerCase().indexOf(O.toLowerCase())===-1,regex:O=>!!Hr&&cv(Hr.location.href,O),not_regex:O=>!!Hr&&!cv(Hr.location.href,O),exact:O=>(Hr==null?void 0:Hr.location.href)===O,is_not:O=>(Hr==null?void 0:Hr.location.href)!==O};function o9(O,z,W){var ce,Te=O.questions[z],D=z+1;if((ce=Te.branching)===null||ce===void 0||!ce.type)return z===O.questions.length-1?Wf.End:D;if(Te.branching.type===Wf.End)return Wf.End;if(Te.branching.type===Wf.SpecificQuestion){if(Number.isInteger(Te.branching.index))return Te.branching.index}else if(Te.branching.type===Wf.ResponseBased){if(Te.type===Zx.SingleChoice){var L,t,b=Te.choices.indexOf("".concat(W));if((L=Te.branching)!==null&&L!==void 0&&(t=L.responseValues)!==null&&t!==void 0&&t.hasOwnProperty(b)){var d=Te.branching.responseValues[b];return Number.isInteger(d)?d:d===Wf.End?Wf.End:D}}else if(Te.type===Zx.Rating){var e,w;if(typeof W!="number"||!Number.isInteger(W))throw new Error("The response type must be an integer");var y=function(u,r){if(r===3){if(u<1||u>3)throw new Error("The response must be in range 1-3");return u===1?"negative":u===2?"neutral":"positive"}if(r===5){if(u<1||u>5)throw new Error("The response must be in range 1-5");return u<=2?"negative":u===3?"neutral":"positive"}if(r===7){if(u<1||u>7)throw new Error("The response must be in range 1-7");return u<=3?"negative":u===4?"neutral":"positive"}if(r===10){if(u<0||u>10)throw new Error("The response must be in range 0-10");return u<=6?"detractors":u<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(W,Te.scale);if((e=Te.branching)!==null&&e!==void 0&&(w=e.responseValues)!==null&&w!==void 0&&w.hasOwnProperty(y)){var _=Te.branching.responseValues[y];return Number.isInteger(_)?_:_===Wf.End?Wf.End:D}}return D}return c1.warn("Falling back to next question index due to unexpected branching type"),D}class s9{constructor(z){Ri(this,"getNextSurveyStep",o9),this.instance=z,this._surveyEventReceiver=null}onRemoteConfig(z){this._decideServerResponse=!!z.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var z=(()=>{for(var W=[],ce=0;celocalStorage.removeItem(W))}loadIfEnabled(){var z,W,ce,Te=Wa==null||(z=Wa.__PosthogExtensions__)===null||z===void 0?void 0:z.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||Te||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new H1(this.instance)),(W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.loadExternalDependency)===null||ce===void 0||ce.call(W,this.instance,"surveys",D=>{var L,t;if(D)return c1.error("Could not load surveys script",D);this._surveyManager=(L=Wa.__PosthogExtensions__)===null||L===void 0||(t=L.generateSurveys)===null||t===void 0?void 0:t.call(L,this.instance)}))}getSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return z([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new H1(this.instance));var ce=this.instance.get_property(Tb);if(ce&&!W)return z(ce);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:Te=>{var D;if(Te.statusCode!==200||!Te.json)return z([]);var L,t=Te.json.surveys||[],b=t.filter(d=>{var e,w,y,_,u,r,n,l,o,s,c,h;return((e=d.conditions)===null||e===void 0?void 0:e.events)&&((w=d.conditions)===null||w===void 0||(y=w.events)===null||y===void 0?void 0:y.values)&&((_=d.conditions)===null||_===void 0||(u=_.events)===null||u===void 0||(r=u.values)===null||r===void 0?void 0:r.length)>0||((n=d.conditions)===null||n===void 0?void 0:n.actions)&&((l=d.conditions)===null||l===void 0||(o=l.actions)===null||o===void 0?void 0:o.values)&&((s=d.conditions)===null||s===void 0||(c=s.actions)===null||c===void 0||(h=c.values)===null||h===void 0?void 0:h.length)>0});return b.length>0&&((L=this._surveyEventReceiver)===null||L===void 0||L.register(b)),(D=this.instance.persistence)===null||D===void 0||D.register({[Tb]:t}),z(t)}})}getActiveMatchingSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(ce=>{var Te,D=ce.filter(b=>!(!b.start_date||b.end_date)).filter(b=>{var d,e,w,y;if(!b.conditions)return!0;var _=(d=b.conditions)===null||d===void 0||!d.url||a9[(e=(w=b.conditions)===null||w===void 0?void 0:w.urlMatchType)!==null&&e!==void 0?e:"icontains"](b.conditions.url),u=(y=b.conditions)===null||y===void 0||!y.selector||(Xi==null?void 0:Xi.querySelector(b.conditions.selector));return _&&u}),L=(Te=this._surveyEventReceiver)===null||Te===void 0?void 0:Te.getSurveys(),t=D.filter(b=>{var d,e,w,y,_,u,r,n,l,o,s;if(!(b.linked_flag_key||b.targeting_flag_key||b.internal_targeting_flag_key||(d=b.feature_flag_keys)!==null&&d!==void 0&&d.length))return!0;var c=!b.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(b.linked_flag_key),h=!b.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(b.targeting_flag_key),x=((e=b.conditions)===null||e===void 0?void 0:e.events)&&((w=b.conditions)===null||w===void 0||(y=w.events)===null||y===void 0?void 0:y.values)&&((_=b.conditions)===null||_===void 0||(u=_.events)===null||u===void 0?void 0:u.values.length)>0,m=((r=b.conditions)===null||r===void 0?void 0:r.actions)&&((n=b.conditions)===null||n===void 0||(l=n.actions)===null||l===void 0?void 0:l.values)&&((o=b.conditions)===null||o===void 0||(s=o.actions)===null||s===void 0?void 0:s.values.length)>0,g=!x&&!m||(L==null?void 0:L.includes(b.id)),k=this._canActivateRepeatedly(b),A=!(b.internal_targeting_flag_key&&!k)||this.instance.featureFlags.isFeatureEnabled(b.internal_targeting_flag_key),v=this.checkFlags(b);return c&&h&&A&&g&&v});return z(t)},W)}checkFlags(z){var W;return(W=z.feature_flag_keys)===null||W===void 0||!W.length||z.feature_flag_keys.every(ce=>{var{key:Te,value:D}=ce;return!Te||!D||this.instance.featureFlags.isFeatureEnabled(D)})}_canActivateRepeatedly(z){var W;return nl((W=Wa.__PosthogExtensions__)===null||W===void 0?void 0:W.canActivateRepeatedly)?(c1.warn("init was not called"),!1):Wa.__PosthogExtensions__.canActivateRepeatedly(z)}canRenderSurvey(z){nl(this._surveyManager)?c1.warn("init was not called"):this.getSurveys(W=>{var ce=W.filter(Te=>Te.id===z)[0];this._surveyManager.canRenderSurvey(ce)})}renderSurvey(z,W){nl(this._surveyManager)?c1.warn("init was not called"):this.getSurveys(ce=>{var Te=ce.filter(D=>D.id===z)[0];this._surveyManager.renderSurvey(Te,Xi==null?void 0:Xi.querySelector(W))})}}var v4=Jc("[RateLimiter]");class l9{constructor(z){var W,ce;Ri(this,"serverLimits",{}),Ri(this,"lastEventRateLimited",!1),Ri(this,"checkForLimiting",Te=>{var D=Te.text;if(D&&D.length)try{(JSON.parse(D).quota_limited||[]).forEach(L=>{v4.info("".concat(L||"events"," is quota limited.")),this.serverLimits[L]=new Date().getTime()+6e4})}catch(L){return void v4.warn('could not rate limit - continuing. Error: "'.concat(L==null?void 0:L.message,'"'),{text:D})}}),this.instance=z,this.captureEventsPerSecond=((W=z.config.rate_limiting)===null||W===void 0?void 0:W.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((ce=z.config.rate_limiting)===null||ce===void 0?void 0:ce.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var z,W,ce,Te=arguments.length>0&&arguments[0]!==void 0&&arguments[0],D=new Date().getTime(),L=(z=(W=this.instance.persistence)===null||W===void 0?void 0:W.get_property(Ab))!==null&&z!==void 0?z:{tokens:this.captureEventsBurstLimit,last:D};L.tokens+=(D-L.last)/1e3*this.captureEventsPerSecond,L.last=D,L.tokens>this.captureEventsBurstLimit&&(L.tokens=this.captureEventsBurstLimit);var t=L.tokens<1;return t||Te||(L.tokens=Math.max(0,L.tokens-1)),!t||this.lastEventRateLimited||Te||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=t,(ce=this.instance.persistence)===null||ce===void 0||ce.set_property(Ab,L),{isRateLimited:t,remainingTokens:L.tokens}}isServerRateLimited(z){var W=this.serverLimits[z||"events"]||!1;return W!==!1&&new Date().getTime(){var z=O==null?void 0:O.config;return bi({initialPathName:(wh==null?void 0:wh.pathname)||"",referringDomain:Tu.referringDomain()},Tu.campaignParams({customTrackedParams:z==null?void 0:z.custom_campaign_params,maskPersonalDataProperties:z==null?void 0:z.mask_personal_data_properties,customPersonalDataProperties:z==null?void 0:z.custom_personal_data_properties}))};class c9{constructor(z,W,ce,Te){Ri(this,"_onSessionIdCallback",D=>{var L=this._getStoredProps();if(!L||L.sessionId!==D){var t={sessionId:D,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[kb]:t})}}),this.instance=z,this._sessionIdManager=W,this._persistence=ce,this._sessionSourceParamGenerator=Te||u9,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[kb]}getSessionProps(){var z,W=(z=this._getStoredProps())===null||z===void 0?void 0:z.props;return W?{$client_session_initial_referring_host:W.referringDomain,$client_session_initial_pathname:W.initialPathName,$client_session_initial_utm_source:W.utm_source,$client_session_initial_utm_campaign:W.utm_campaign,$client_session_initial_utm_medium:W.utm_medium,$client_session_initial_utm_content:W.utm_content,$client_session_initial_utm_term:W.utm_term}:{}}}var h9=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","better uptime bot","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],y4=function(O,z){if(!O)return!1;var W=O.toLowerCase();return h9.concat(z||[]).some(ce=>{var Te=ce.toLowerCase();return W.indexOf(Te)!==-1})},c8=function(O,z){if(!O)return!1;var W=O.userAgent;if(W&&y4(W,z))return!0;try{var ce=O==null?void 0:O.userAgentData;if(ce!=null&&ce.brands&&ce.brands.some(Te=>y4(Te==null?void 0:Te.brand,z)))return!0}catch{}return!!O.webdriver};class h8{constructor(){this.clicks=[]}isRageClick(z,W,ce){var Te=this.clicks[this.clicks.length-1];if(Te&&Math.abs(z-Te.x)+Math.abs(W-Te.y)<30&&ce-Te.timestamp<1e3){if(this.clicks.push({x:z,y:W,timestamp:ce}),this.clicks.length===3)return!0}else this.clicks=[{x:z,y:W,timestamp:ce}];return!1}}var By=Jc("[Dead Clicks]"),f9=()=>!0,p9=O=>{var z,W=!((z=O.instance.persistence)===null||z===void 0||!z.get_property(vk)),ce=O.instance.config.capture_dead_clicks;return Sg(ce)?ce:W};class f8{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(z,W,ce){this.instance=z,this.isEnabled=W,this.onCapture=ce,this.startIfEnabled()}onRemoteConfig(z){this.instance.persistence&&this.instance.persistence.register({[vk]:z==null?void 0:z.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(z){var W,ce,Te;(W=Wa.__PosthogExtensions__)!==null&&W!==void 0&&W.initDeadClicksAutocapture&&z(),(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.loadExternalDependency)===null||Te===void 0||Te.call(ce,this.instance,"dead-clicks-autocapture",D=>{D?By.error("failed to load script",D):z()})}start(){var z;if(Xi){if(!this._lazyLoadedDeadClicksAutocapture&&(z=Wa.__PosthogExtensions__)!==null&&z!==void 0&&z.initDeadClicksAutocapture){var W=Nu(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};W.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Wa.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,W),this._lazyLoadedDeadClicksAutocapture.start(Xi),By.info("starting...")}}else By.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,By.info("stopping..."))}}var d9=Jc("[Heatmaps]");function x4(O){return Nu(O)&&"clientX"in O&&"clientY"in O&&ch(O.clientX)&&ch(O.clientY)}class g9{constructor(z){var W;Ri(this,"rageclicks",new h8),Ri(this,"_enabledServerSide",!1),Ri(this,"_initialized",!1),Ri(this,"_flushInterval",null),this.instance=z,this._enabledServerSide=!((W=this.instance.persistence)===null||W===void 0||!W.props[bb]),Hr==null||Hr.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var z=5e3;return Nu(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(z=this.instance.config.capture_heatmaps.flush_interval_milliseconds),z}get isEnabled(){return pa(this.instance.config.capture_heatmaps)?pa(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;d9.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var z,W;clearInterval((z=this._flushInterval)!==null&&z!==void 0?z:void 0),(W=this.deadClicksCapture)===null||W===void 0||W.stop(),this.getAndClearBuffer()}}onRemoteConfig(z){var W=!!z.heatmaps;this.instance.persistence&&this.instance.persistence.register({[bb]:W}),this._enabledServerSide=W,this.startIfEnabled()}getAndClearBuffer(){var z=this.buffer;return this.buffer=void 0,z}_onDeadClick(z){this._onClick(z.originalEvent,"deadclick")}_setupListeners(){Hr&&Xi&&(ad(Xi,"click",z=>this._onClick(z||(Hr==null?void 0:Hr.event)),!1,!0),ad(Xi,"mousemove",z=>this._onMouseMove(z||(Hr==null?void 0:Hr.event)),!1,!0),this.deadClicksCapture=new f8(this.instance,f9,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(z,W){var ce=this.instance.scrollManager.scrollY(),Te=this.instance.scrollManager.scrollX(),D=this.instance.scrollManager.scrollElement(),L=function(t,b,d){for(var e=t;e&&m_(e)&&!v0(e,"body");){if(e===d)return!1;if(bo(b,Hr==null?void 0:Hr.getComputedStyle(e).position))return!0;e=Nk(e)}return!1}(Bk(z),["fixed","sticky"],D);return{x:z.clientX+(L?0:Te),y:z.clientY+(L?0:ce),target_fixed:L,type:W}}_onClick(z){var W,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!Y5(z.target)&&x4(z)){var Te=this._getProperties(z,ce);(W=this.rageclicks)!==null&&W!==void 0&&W.isRageClick(z.clientX,z.clientY,new Date().getTime())&&this._capture(bi(bi({},Te),{},{type:"rageclick"})),this._capture(Te)}}_onMouseMove(z){!Y5(z.target)&&x4(z)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(z,"mousemove"))},500))}_capture(z){if(Hr){var W=Hr.location.href;this.buffer=this.buffer||{},this.buffer[W]||(this.buffer[W]=[]),this.buffer[W].push(z)}}flush(){this.buffer&&!Hm(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class m9{constructor(z){Ri(this,"_updateScrollData",()=>{var W,ce,Te,D;this.context||(this.context={});var L=this.scrollElement(),t=this.scrollY(),b=L?Math.max(0,L.scrollHeight-L.clientHeight):0,d=t+((L==null?void 0:L.clientHeight)||0),e=(L==null?void 0:L.scrollHeight)||0;this.context.lastScrollY=Math.ceil(t),this.context.maxScrollY=Math.max(t,(W=this.context.maxScrollY)!==null&&W!==void 0?W:0),this.context.maxScrollHeight=Math.max(b,(ce=this.context.maxScrollHeight)!==null&&ce!==void 0?ce:0),this.context.lastContentY=d,this.context.maxContentY=Math.max(d,(Te=this.context.maxContentY)!==null&&Te!==void 0?Te:0),this.context.maxContentHeight=Math.max(e,(D=this.context.maxContentHeight)!==null&&D!==void 0?D:0)}),this.instance=z}getContext(){return this.context}resetContext(){var z=this.context;return setTimeout(this._updateScrollData,0),z}startMeasuringScrollPosition(){Hr==null||Hr.addEventListener("scroll",this._updateScrollData,!0),Hr==null||Hr.addEventListener("scrollend",this._updateScrollData,!0),Hr==null||Hr.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return Hr==null?void 0:Hr.document.documentElement;var z=Bu(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var W of z){var ce=Hr==null?void 0:Hr.document.querySelector(W);if(ce)return ce}}scrollY(){if(this.instance.config.scroll_root_selector){var z=this.scrollElement();return z&&z.scrollTop||0}return Hr&&(Hr.scrollY||Hr.pageYOffset||Hr.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var z=this.scrollElement();return z&&z.scrollLeft||0}return Hr&&(Hr.scrollX||Hr.pageXOffset||Hr.document.documentElement.scrollLeft)||0}}var _4=Jc("[AutoCapture]");function p2(O,z){return z.length>O?z.slice(0,O)+"...":z}function v9(O){if(O.previousElementSibling)return O.previousElementSibling;var z=O;do z=z.previousSibling;while(z&&!m_(z));return z}function y9(O,z,W,ce){var Te=O.tagName.toLowerCase(),D={tag_name:Te};Ob.indexOf(Te)>-1&&!W&&(Te.toLowerCase()==="a"||Te.toLowerCase()==="button"?D.$el_text=p2(1024,qk(O)):D.$el_text=p2(1024,v_(O)));var L=qx(O);L.length>0&&(D.classes=L.filter(function(e){return e!==""})),tl(O.attributes,function(e){var w;if((!jk(O)||["name","id","class","aria-label"].indexOf(e.name)!==-1)&&(ce==null||!ce.includes(e.name))&&!z&&fv(e.value)&&(w=e.name,!Oc(w)||w.substring(0,10)!=="_ngcontent"&&w.substring(0,7)!=="_nghost")){var y=e.value;e.name==="class"&&(y=Jw(y).join(" ")),D["attr__"+e.name]=p2(1024,y)}});for(var t=1,b=1,d=O;d=v9(d);)t++,d.tagName===O.tagName&&b++;return D.nth_child=t,D.nth_of_type=b,D}function x9(O,z){for(var W,ce,{e:Te,maskAllElementAttributes:D,maskAllText:L,elementAttributeIgnoreList:t,elementsChainAsString:b}=z,d=[O],e=O;e.parentNode&&!v0(e,"body");)Rk(e.parentNode)?(d.push(e.parentNode.host),e=e.parentNode.host):(d.push(e.parentNode),e=e.parentNode);var w,y=[],_={},u=!1,r=!1;if(tl(d,c=>{var h=Db(c);c.tagName.toLowerCase()==="a"&&(u=c.getAttribute("href"),u=h&&u&&fv(u)&&u),bo(qx(c),"ph-no-capture")&&(r=!0),y.push(y9(c,D,L,t));var x=function(m){if(!Db(m))return{};var g={};return tl(m.attributes,function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var A=k.name.replace("data-ph-capture-attribute-",""),v=k.value;A&&v&&fv(v)&&(g[A]=v)}}),g}(c);Xc(_,x)}),r)return{props:{},explicitNoCapture:r};if(L||(O.tagName.toLowerCase()==="a"||O.tagName.toLowerCase()==="button"?y[0].$el_text=qk(O):y[0].$el_text=v_(O)),u){var n,l;y[0].attr__href=u;var o=(n=Qm(u))===null||n===void 0?void 0:n.host,s=Hr==null||(l=Hr.location)===null||l===void 0?void 0:l.host;o&&s&&o!==s&&(w=u)}return{props:Xc({$event_type:Te.type,$ce_version:1},b?{}:{$elements:y},{$elements_chain:b7(y)},(W=y[0])!==null&&W!==void 0&&W.$el_text?{$el_text:(ce=y[0])===null||ce===void 0?void 0:ce.$el_text}:{},w&&Te.type==="click"?{$external_click_url:w}:{},_)}}class _9{constructor(z){Ri(this,"_initialized",!1),Ri(this,"_isDisabledServerSide",null),Ri(this,"rageclicks",new h8),Ri(this,"_elementsChainAsString",!1),this.instance=z,this._elementSelectors=null}get config(){var z,W,ce=Nu(this.instance.config.autocapture)?this.instance.config.autocapture:{};return ce.url_allowlist=(z=ce.url_allowlist)===null||z===void 0?void 0:z.map(Te=>new RegExp(Te)),ce.url_ignorelist=(W=ce.url_ignorelist)===null||W===void 0?void 0:W.map(Te=>new RegExp(Te)),ce}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Hr&&Xi){var z=ce=>{ce=ce||(Hr==null?void 0:Hr.event);try{this._captureEvent(ce)}catch(Te){_4.error("Failed to capture event",Te)}},W=ce=>{ce=ce||(Hr==null?void 0:Hr.event),this._captureEvent(ce,n2)};ad(Xi,"submit",z,!1,!0),ad(Xi,"change",z,!1,!0),ad(Xi,"click",z,!1,!0),this.config.capture_copied_text&&(ad(Xi,"copy",W,!1,!0),ad(Xi,"cut",W,!1,!0))}}else _4.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(z){z.elementsChainAsString&&(this._elementsChainAsString=z.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[E5]:!!z.autocapture_opt_out}),this._isDisabledServerSide=!!z.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(z){this._elementSelectors=z}getElementSelectors(z){var W,ce=[];return(W=this._elementSelectors)===null||W===void 0||W.forEach(Te=>{var D=Xi==null?void 0:Xi.querySelectorAll(Te);D==null||D.forEach(L=>{z===L&&ce.push(Te)})}),ce}get isEnabled(){var z,W,ce=(z=this.instance.persistence)===null||z===void 0?void 0:z.props[E5],Te=this._isDisabledServerSide;if(A0(Te)&&!Sg(ce)&&!this.instance.config.advanced_disable_decide)return!1;var D=(W=this._isDisabledServerSide)!==null&&W!==void 0?W:!!ce;return!!this.instance.config.autocapture&&!D}_captureEvent(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var ce,Te=Bk(z);Dk(Te)&&(Te=Te.parentNode||null),W==="$autocapture"&&z.type==="click"&&z instanceof MouseEvent&&this.instance.config.rageclick&&(ce=this.rageclicks)!==null&&ce!==void 0&&ce.isRageClick(z.clientX,z.clientY,new Date().getTime())&&this._captureEvent(z,"$rageclick");var D=W===n2;if(Te&&m7(Te,z,this.config,D,D?["copy","cut"]:void 0)){var{props:L,explicitNoCapture:t}=x9(Te,{e:z,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(t)return!1;var b=this.getElementSelectors(Te);if(b&&b.length>0&&(L.$element_selectors=b),W===n2){var d,e=Fk(Hr==null||(d=Hr.getSelection())===null||d===void 0?void 0:d.toString()),w=z.type||"clipboard";if(!e)return!1;L.$selected_content=e,L.$copy_type=w}return this.instance.capture(W,L),!0}}}isBrowserSupported(){return Yh(Xi==null?void 0:Xi.querySelectorAll)}}var b9=Jc("[TracingHeaders]");class w9{constructor(z){Ri(this,"_restoreXHRPatch",void 0),Ri(this,"_restoreFetchPatch",void 0),Ri(this,"_startCapturing",()=>{var W,ce,Te,D;pa(this._restoreXHRPatch)&&((W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.tracingHeadersPatchFns)===null||ce===void 0||ce._patchXHR(this.instance.sessionManager)),pa(this._restoreFetchPatch)&&((Te=Wa.__PosthogExtensions__)===null||Te===void 0||(D=Te.tracingHeadersPatchFns)===null||D===void 0||D._patchFetch(this.instance.sessionManager))}),this.instance=z}_loadScript(z){var W,ce,Te;(W=Wa.__PosthogExtensions__)!==null&&W!==void 0&&W.tracingHeadersPatchFns&&z(),(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.loadExternalDependency)===null||Te===void 0||Te.call(ce,this.instance,"tracing-headers",D=>{if(D)return b9.error("failed to load script",D);z()})}startIfEnabledOrStop(){var z,W;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((z=this._restoreXHRPatch)===null||z===void 0||z.call(this),(W=this._restoreFetchPatch)===null||W===void 0||W.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Qd;(function(O){O[O.PENDING=-1]="PENDING",O[O.DENIED=0]="DENIED",O[O.GRANTED=1]="GRANTED"})(Qd||(Qd={}));class T9{constructor(z){this.instance=z}get config(){return this.instance.config}get consent(){return this.getDnt()?Qd.DENIED:this.storedConsent}isOptedOut(){return this.consent===Qd.DENIED||this.consent===Qd.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(z){this.storage.set(this.storageKey,z?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:z,opt_out_capturing_cookie_prefix:W}=this.instance.config;return(W||"__ph_opt_in_out_")+z}get storedConsent(){var z=this.storage.get(this.storageKey);return z==="1"?Qd.GRANTED:z==="0"?Qd.DENIED:Qd.PENDING}get storage(){if(!this._storage){var z=this.config.opt_out_capturing_persistence_type;this._storage=z==="localStorage"?hc:ud;var W=z==="localStorage"?ud:hc;W.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(W.get(this.storageKey)==="1"),W.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!gk([$h==null?void 0:$h.doNotTrack,$h==null?void 0:$h.msDoNotTrack,Wa.doNotTrack],z=>bo([!0,1,"1","yes"],z))}}var Ny=Jc("[ExceptionAutocapture]");class k9{constructor(z){var W;Ri(this,"originalOnUnhandledRejectionHandler",void 0),Ri(this,"startCapturing",()=>{var ce,Te,D,L;if(Hr&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var t=(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.errorWrappingFunctions)===null||Te===void 0?void 0:Te.wrapOnError,b=(D=Wa.__PosthogExtensions__)===null||D===void 0||(L=D.errorWrappingFunctions)===null||L===void 0?void 0:L.wrapUnhandledRejection;if(t&&b)try{this.unwrapOnError=t(this.captureException.bind(this)),this.unwrapUnhandledRejection=b(this.captureException.bind(this))}catch(d){Ny.error("failed to start",d),this.stopCapturing()}else Ny.error("failed to load error wrapping functions - cannot start")}}),this.instance=z,this.remoteEnabled=!((W=this.instance.persistence)===null||W===void 0||!W.props[C5]),this.startIfEnabled()}get isEnabled(){var z;return(z=this.remoteEnabled)!==null&&z!==void 0&&z}get isCapturing(){var z;return!(Hr==null||(z=Hr.onerror)===null||z===void 0||!z.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(Ny.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(z){var W,ce;this.hasHandlers&&z(),(W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.loadExternalDependency)===null||ce===void 0||ce.call(W,this.instance,"exception-autocapture",Te=>{if(Te)return Ny.error("failed to load script",Te);z()})}stopCapturing(){var z,W;(z=this.unwrapOnError)===null||z===void 0||z.call(this),(W=this.unwrapUnhandledRejection)===null||W===void 0||W.call(this)}onRemoteConfig(z){var W=z.autocaptureExceptions;this.remoteEnabled=!!W||!1,this.instance.persistence&&this.instance.persistence.register({[C5]:this.remoteEnabled}),this.startIfEnabled()}captureException(z){var W=this.instance.requestRouter.endpointFor("ui");z.$exception_personURL="".concat(W,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(z)}}var mg=Jc("[Web Vitals]"),b4=9e5;class A9{constructor(z){var W;Ri(this,"_enabledServerSide",!1),Ri(this,"_initialized",!1),Ri(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),Ri(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((ce,Te)=>bi(bi({},ce),{},{["$web_vitals_".concat(Te.name,"_event")]:bi({},Te),["$web_vitals_".concat(Te.name,"_value")]:Te.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),Ri(this,"_addToBuffer",ce=>{var Te,D=(Te=this.instance.sessionManager)===null||Te===void 0?void 0:Te.checkAndGetSessionAndWindowId(!0);if(pa(D))mg.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var L=this._currentURL();pa(L)||(nl(ce==null?void 0:ce.name)||nl(ce==null?void 0:ce.value)?mg.error("Invalid metric received",ce):this._maxAllowedValue&&ce.value>=this._maxAllowedValue?mg.error("Ignoring metric with value >= "+this._maxAllowedValue,ce):(this.buffer.url!==L&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),pa(this.buffer.url)&&(this.buffer.url=L),this.buffer.firstMetricTimestamp=pa(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,ce.attribution&&ce.attribution.interactionTargetElement&&(ce.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(bi(bi({},ce),{},{$current_url:L,$session_id:D.sessionId,$window_id:D.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),Ri(this,"_startCapturing",()=>{var ce,Te,D,L,t=Wa.__PosthogExtensions__;pa(t)||pa(t.postHogWebVitalsCallbacks)||({onLCP:ce,onCLS:Te,onFCP:D,onINP:L}=t.postHogWebVitalsCallbacks),ce&&Te&&D&&L?(this.allowedMetrics.indexOf("LCP")>-1&&ce(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&Te(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&D(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&L(this._addToBuffer.bind(this)),this._initialized=!0):mg.error("web vitals callbacks not loaded - not starting")}),this.instance=z,this._enabledServerSide=!((W=this.instance.persistence)===null||W===void 0||!W.props[I5]),this.startIfEnabled()}get allowedMetrics(){var z,W,ce=Nu(this.instance.config.capture_performance)?(z=this.instance.config.capture_performance)===null||z===void 0?void 0:z.web_vitals_allowed_metrics:void 0;return pa(ce)?((W=this.instance.persistence)===null||W===void 0?void 0:W.props[P5])||["CLS","FCP","INP","LCP"]:ce}get flushToCaptureTimeoutMs(){return(Nu(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var z=Nu(this.instance.config.capture_performance)&&ch(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:b4;return 0{D?mg.error("failed to load script",D):z()})}_currentURL(){var z=Hr?Hr.location.href:void 0;return z||mg.error("Could not determine current URL"),z}}var S9={icontains:(O,z)=>!!Hr&&z.href.toLowerCase().indexOf(O.toLowerCase())>-1,not_icontains:(O,z)=>!!Hr&&z.href.toLowerCase().indexOf(O.toLowerCase())===-1,regex:(O,z)=>!!Hr&&cv(z.href,O),not_regex:(O,z)=>!!Hr&&!cv(z.href,O),exact:(O,z)=>z.href===O,is_not:(O,z)=>z.href!==O};class $c{constructor(z){var W=this;Ri(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var ce=arguments.length>0&&arguments[0]!==void 0&&arguments[0];W.getWebExperiments(Te=>{$c.logInfo("retrieved web experiments from the server"),W._flagToExperiments=new Map,Te.forEach(D=>{if(D.feature_flag_key){var L;W._flagToExperiments&&($c.logInfo("setting flag key ",D.feature_flag_key," to web experiment ",D),(L=W._flagToExperiments)===null||L===void 0||L.set(D.feature_flag_key,D));var t=W.instance.getFeatureFlag(D.feature_flag_key);Oc(t)&&D.variants[t]&&W.applyTransforms(D.name,t,D.variants[t].transforms)}else if(D.variants)for(var b in D.variants){var d=D.variants[b];$c.matchesTestVariant(d)&&W.applyTransforms(D.name,b,d.transforms)}})},ce)}),this.instance=z,this.instance.onFeatureFlags(ce=>{this.onFeatureFlags(ce)})}onFeatureFlags(z){if(this._is_bot())$c.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(nl(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();$c.logInfo("applying feature flags",z),z.forEach(W=>{var ce;if(this._flagToExperiments&&(ce=this._flagToExperiments)!==null&&ce!==void 0&&ce.has(W)){var Te,D=this.instance.getFeatureFlag(W),L=(Te=this._flagToExperiments)===null||Te===void 0?void 0:Te.get(W);D&&L!=null&&L.variants[D]&&this.applyTransforms(L.name,D,L.variants[D].transforms)}})}}previewWebExperiment(){var z=$c.getWindowLocation();if(z!=null&&z.search){var W=Nx(z==null?void 0:z.search,"__experiment_id"),ce=Nx(z==null?void 0:z.search,"__experiment_variant");W&&ce&&($c.logInfo("previewing web experiments ".concat(W," && ").concat(ce)),this.getWebExperiments(Te=>{this.showPreviewWebExperiment(parseInt(W),ce,Te)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(z,W,ce){if(this.instance.config.disable_web_experiments&&!ce)return z([]);var Te=this.instance.get_property("$web_experiments");if(Te&&!W)return z(Te);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:D=>{if(D.statusCode!==200||!D.json)return z([]);var L=D.json.experiments||[];return z(L)}})}showPreviewWebExperiment(z,W,ce){var Te=ce.filter(D=>D.id===z);Te&&Te.length>0&&($c.logInfo("Previewing web experiment [".concat(Te[0].name,"] with variant [").concat(W,"]")),this.applyTransforms(Te[0].name,W,Te[0].variants[W].transforms))}static matchesTestVariant(z){return!nl(z.conditions)&&$c.matchUrlConditions(z)&&$c.matchUTMConditions(z)}static matchUrlConditions(z){var W;if(nl(z.conditions)||nl((W=z.conditions)===null||W===void 0?void 0:W.url))return!0;var ce,Te,D,L=$c.getWindowLocation();return!!L&&((ce=z.conditions)===null||ce===void 0||!ce.url||S9[(Te=(D=z.conditions)===null||D===void 0?void 0:D.urlMatchType)!==null&&Te!==void 0?Te:"icontains"](z.conditions.url,L))}static getWindowLocation(){return Hr==null?void 0:Hr.location}static matchUTMConditions(z){var W;if(nl(z.conditions)||nl((W=z.conditions)===null||W===void 0?void 0:W.utm))return!0;var ce=Tu.campaignParams();if(ce.utm_source){var Te,D,L,t,b,d,e,w,y,_,u,r,n,l,o,s,c=(Te=z.conditions)===null||Te===void 0||(D=Te.utm)===null||D===void 0||!D.utm_campaign||((L=z.conditions)===null||L===void 0||(t=L.utm)===null||t===void 0?void 0:t.utm_campaign)==ce.utm_campaign,h=(b=z.conditions)===null||b===void 0||(d=b.utm)===null||d===void 0||!d.utm_source||((e=z.conditions)===null||e===void 0||(w=e.utm)===null||w===void 0?void 0:w.utm_source)==ce.utm_source,x=(y=z.conditions)===null||y===void 0||(_=y.utm)===null||_===void 0||!_.utm_medium||((u=z.conditions)===null||u===void 0||(r=u.utm)===null||r===void 0?void 0:r.utm_medium)==ce.utm_medium,m=(n=z.conditions)===null||n===void 0||(l=n.utm)===null||l===void 0||!l.utm_term||((o=z.conditions)===null||o===void 0||(s=o.utm)===null||s===void 0?void 0:s.utm_term)==ce.utm_term;return c&&x&&m&&h}return!1}static logInfo(z){for(var W=arguments.length,ce=new Array(W>1?W-1:0),Te=1;Te{if(Te.selector){var D;$c.logInfo("applying transform of variant ".concat(W," for experiment ").concat(z," "),Te);var L=(D=document)===null||D===void 0?void 0:D.querySelectorAll(Te.selector);L==null||L.forEach(t=>{var b=t;Te.attributes&&Te.attributes.forEach(d=>{switch(d.name){case"text":b.innerText=d.value;break;case"html":b.innerHTML=d.value;break;case"cssClass":b.className=d.value;break;default:b.setAttribute(d.name,d.value)}}),Te.text&&(b.innerText=Te.text),Te.html&&(b.parentElement?b.parentElement.innerHTML=Te.html:b.innerHTML=Te.html),Te.css&&b.setAttribute("style",Te.css)})}}):$c.logInfo("Control variants leave the page unmodified.")}_is_bot(){return $h&&this.instance?c8($h,this.instance.config.custom_blocked_useragents):void 0}}class M9{constructor(z){this.instance=z}sendExceptionEvent(z){this.instance.capture("$exception",z,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var E9=["$set_once","$set"],vg=Jc("[SiteApps]");class C9{constructor(z){this.instance=z,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(z,W){if(W){var ce=this.globalsForEvent(W);this.bufferedInvocations.push(ce),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var z,W;return(z=Wa._POSTHOG_REMOTE_CONFIG)===null||z===void 0||(W=z[this.instance.config.token])===null||W===void 0?void 0:W.siteApps}init(){if(this.isEnabled){var z=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{z(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(z){var W,ce,Te,D,L,t,b;if(!z)throw new Error("Event payload is required");var d={},e=this.instance.get_property("$groups")||[],w=this.instance.get_property("$stored_group_properties")||{};for(var[y,_]of Object.entries(w))d[y]={id:e[y],type:y,properties:_};var{$set_once:u,$set:r}=z;return{event:bi(bi({},dk(z,E9)),{},{properties:bi(bi(bi({},z.properties),r?{$set:bi(bi({},(W=(ce=z.properties)===null||ce===void 0?void 0:ce.$set)!==null&&W!==void 0?W:{}),r)}:{}),u?{$set_once:bi(bi({},(Te=(D=z.properties)===null||D===void 0?void 0:D.$set_once)!==null&&Te!==void 0?Te:{}),u)}:{}),elements_chain:(L=(t=z.properties)===null||t===void 0?void 0:t.$elements_chain)!==null&&L!==void 0?L:"",distinct_id:(b=z.properties)===null||b===void 0?void 0:b.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(z){var W={id:z.id,loaded:!1,errored:!1};this.apps[z.id]=W;var ce=D=>{var L;for(var t of(this.apps[z.id].errored=!D,this.apps[z.id].loaded=!0,vg.info("Site app with id ".concat(z.id," ").concat(D?"loaded":"errored")),D&&this.bufferedInvocations.length&&(vg.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(z.id)),this.bufferedInvocations.forEach(b=>{var d;return(d=W.processEvent)===null||d===void 0?void 0:d.call(W,b)})),Object.values(this.apps)))if(!t.loaded)return;(L=this.stopBuffering)===null||L===void 0||L.call(this)};try{var{processEvent:Te}=z.init({posthog:this.instance,callback:D=>{ce(D)}});Te&&(W.processEvent=Te)}catch(D){vg.error("Error while initializing PostHog app with config id ".concat(z.id),D),ce(!1)}}onCapturedEvent(z){if(Object.keys(this.apps).length!==0){var W=this.globalsForEvent(z);for(var ce of Object.values(this.apps))try{var Te;(Te=ce.processEvent)===null||Te===void 0||Te.call(ce,W)}catch(D){vg.error("Error while processing event ".concat(z.event," for site app ").concat(ce.id),D)}}}onRemoteConfig(z){var W,ce,Te,D=this;if((W=this.siteAppLoaders)!==null&&W!==void 0&&W.length){if(!this.isEnabled)return void vg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var L of this.siteAppLoaders)this.setupSiteApp(L);this.instance.on("eventCaptured",e=>this.onCapturedEvent(e))}else if((ce=this.stopBuffering)===null||ce===void 0||ce.call(this),(Te=z.siteApps)!==null&&Te!==void 0&&Te.length)if(this.isEnabled){var t=function(e,w){var y,_;Wa["__$$ph_site_app_".concat(e)]=D.instance,(y=Wa.__PosthogExtensions__)===null||y===void 0||(_=y.loadSiteApp)===null||_===void 0||_.call(y,D.instance,w,u=>{if(u)return vg.error("Error while initializing PostHog app with config id ".concat(e),u)})};for(var{id:b,url:d}of z.siteApps)t(b,d)}else vg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}function d2(O,z,W){return u1({distinct_id:O,userPropertiesToSet:z,userPropertiesToSetOnce:W})}var w1={},Zb=()=>{},Pm="posthog",p8=!G7&&(wc==null?void 0:wc.indexOf("MSIE"))===-1&&(wc==null?void 0:wc.indexOf("Mozilla"))===-1,w4=()=>{var O,z,W;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(z=Xi==null?void 0:Xi.location,W=z==null?void 0:z.hostname,!!Oc(W)&&W.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Zb,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:wh&&Oc(wh==null?void 0:wh.search)&&wh.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(Hr==null||(O=Hr.location)===null||O===void 0?void 0:O.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:ce=>{var Te="Bad HTTP status: "+ce.statusCode+" "+ce.text;ha.error(Te)},get_device_id:ce=>ce,_onCapture:Zb,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},T4=O=>{var z={};pa(O.process_person)||(z.person_profiles=O.process_person),pa(O.xhr_headers)||(z.request_headers=O.xhr_headers),pa(O.cookie_name)||(z.persistence_name=O.cookie_name),pa(O.disable_cookie)||(z.disable_persistence=O.disable_cookie);var W=Xc({},z,O);return Bu(O.property_blacklist)&&(pa(O.property_denylist)?W.property_denylist=O.property_blacklist:Bu(O.property_denylist)?W.property_denylist=[...O.property_blacklist,...O.property_denylist]:ha.error("Invalid value for property_denylist config: "+O.property_denylist)),W};class I9{constructor(){Ri(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(z){ha.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=z}}class y_{get decideEndpointWasHit(){var z,W;return(z=(W=this.featureFlags)===null||W===void 0?void 0:W.hasLoadedFlags)!==null&&z!==void 0&&z}constructor(){Ri(this,"webPerformance",new I9),Ri(this,"version",id.LIB_VERSION),Ri(this,"_internalEventEmitter",new u8),this.config=w4(),this.SentryIntegration=X7,this.sentryIntegration=z=>function(W,ce){var Te=Jk(W,ce);return{name:Kk,processEvent:D=>Te(D)}}(this,z),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new $M(this),this.toolbar=new V7(this),this.scrollManager=new m9(this),this.pageViewManager=new J7(this),this.surveys=new s9(this),this.experiments=new $c(this),this.exceptions=new M9(this),this.rateLimiter=new l9(this),this.requestRouter=new Y7(this),this.consent=new T9(this),this.people={set:(z,W,ce)=>{var Te=Oc(z)?{[z]:W}:z;this.setPersonProperties(Te),ce==null||ce({})},set_once:(z,W,ce)=>{var Te=Oc(z)?{[z]:W}:z;this.setPersonProperties(void 0,Te),ce==null||ce({})}},this.on("eventCaptured",z=>ha.info('send "'.concat(z==null?void 0:z.event,'"'),z))}init(z,W,ce){if(ce&&ce!==Pm){var Te,D=(Te=w1[ce])!==null&&Te!==void 0?Te:new y_;return D._init(z,W,ce),w1[ce]=D,w1[Pm][ce]=D,D}return this._init(z,W,ce)}_init(z){var W,ce,Te,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=arguments.length>2?arguments[2]:void 0;if(pa(z)||k5(z))return ha.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return ha.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],D.person_profiles&&(this._initialPersonProfilesConfig=D.person_profiles),this.set_config(Xc({},w4(),T4(D),{name:L,token:z})),this.config.on_xhr_error&&ha.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=D.disable_compression?void 0:yp.GZipJS,this.persistence=new l2(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new l2(bi(bi({},this.config),{},{persistence:"sessionStorage"}));var t=bi({},this.persistence.props),b=bi({},this.sessionPersistence.props);if(this._requestQueue=new q7(o=>this._send_retriable_request(o)),this._retryQueue=new Z7(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new $7(this),this.sessionPropsManager=new c9(this,this.sessionManager,this.persistence)),new w9(this).startIfEnabledOrStop(),this.siteApps=new C9(this),(W=this.siteApps)===null||W===void 0||W.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new N7(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new _9(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new g9(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new A9(this),this.exceptionObserver=new k9(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new f8(this,p9),this.deadClicksAutocapture.startIfEnabled(),id.DEBUG=id.DEBUG||this.config.debug,id.DEBUG&&ha.info("Starting in debug mode",{this:this,config:D,thisC:bi({},this.config),p:t,s:b}),this._sync_opt_out_with_persistence(),((ce=D.bootstrap)===null||ce===void 0?void 0:ce.distinctID)!==void 0){var d,e,w=this.config.get_device_id(i0()),y=(d=D.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?w:D.bootstrap.distinctID;this.persistence.set_property(Qp,(e=D.bootstrap)!==null&&e!==void 0&&e.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:D.bootstrap.distinctID,$device_id:y})}if(this._hasBootstrappedFeatureFlags()){var _,u,r=Object.keys(((_=D.bootstrap)===null||_===void 0?void 0:_.featureFlags)||{}).filter(o=>{var s,c;return!((s=D.bootstrap)===null||s===void 0||(c=s.featureFlags)===null||c===void 0||!c[o])}).reduce((o,s)=>{var c,h;return o[s]=((c=D.bootstrap)===null||c===void 0||(h=c.featureFlags)===null||h===void 0?void 0:h[s])||!1,o},{}),n=Object.keys(((u=D.bootstrap)===null||u===void 0?void 0:u.featureFlagPayloads)||{}).filter(o=>r[o]).reduce((o,s)=>{var c,h,x,m;return(c=D.bootstrap)!==null&&c!==void 0&&(h=c.featureFlagPayloads)!==null&&h!==void 0&&h[s]&&(o[s]=(x=D.bootstrap)===null||x===void 0||(m=x.featureFlagPayloads)===null||m===void 0?void 0:m[s]),o},{});this.featureFlags.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:n})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:B5,$device_id:null},"");else if(!this.get_distinct_id()){var l=this.config.get_device_id(i0());this.register_once({distinct_id:l,$device_id:l},""),this.persistence.set_property(Qp,"anonymous")}return Hr==null||(Te=Hr.addEventListener)===null||Te===void 0||Te.call(Hr,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),D.segment?K7(this,()=>this._loaded()):this._loaded(),Yh(this.config._onCapture)&&this.config._onCapture!==Zb&&(ha.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",o=>this.config._onCapture(o.event,o))),this}_onRemoteConfig(z){var W,ce,Te,D,L,t,b,d,e;if(!Xi||!Xi.body)return ha.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(z)},500);this.compression=void 0,z.supportedCompression&&!this.config.disable_compression&&(this.compression=bo(z.supportedCompression,yp.GZipJS)?yp.GZipJS:bo(z.supportedCompression,yp.Base64)?yp.Base64:void 0),(W=z.analytics)!==null&&W!==void 0&&W.endpoint&&(this.analyticsDefaultEndpoint=z.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),(ce=this.siteApps)===null||ce===void 0||ce.onRemoteConfig(z),(Te=this.sessionRecording)===null||Te===void 0||Te.onRemoteConfig(z),(D=this.autocapture)===null||D===void 0||D.onRemoteConfig(z),(L=this.heatmaps)===null||L===void 0||L.onRemoteConfig(z),(t=this.surveys)===null||t===void 0||t.onRemoteConfig(z),(b=this.webVitalsAutocapture)===null||b===void 0||b.onRemoteConfig(z),(d=this.exceptionObserver)===null||d===void 0||d.onRemoteConfig(z),(e=this.deadClicksAutocapture)===null||e===void 0||e.onRemoteConfig(z)}_loaded(){try{this.config.loaded(this)}catch(z){ha.critical("`loaded` function failed",z)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new j7(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var z;this.has_opted_out_capturing()||this.config.request_batching&&((z=this._requestQueue)===null||z===void 0||z.enable())}_dom_loaded(){this.has_opted_out_capturing()||m0(this.__request_queue,z=>this._send_retriable_request(z)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var z,W;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(z=this._requestQueue)===null||z===void 0||z.unload(),(W=this._retryQueue)===null||W===void 0||W.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(z){this.__loaded&&(p8?this.__request_queue.push(z):this.rateLimiter.isServerRateLimited(z.batchKey)||(z.transport=z.transport||this.config.api_transport,z.url=Gx(z.url,{ip:this.config.ip?1:0}),z.headers=bi({},this.config.request_headers),z.compression=z.compression==="best-available"?this.compression:z.compression,z.fetchOptions=z.fetchOptions||this.config.fetch_options,(W=>{var ce,Te,D,L=bi({},W);L.timeout=L.timeout||6e4,L.url=Gx(L.url,{_:new Date().getTime().toString(),ver:id.LIB_VERSION,compression:L.compression});var t=(ce=L.transport)!==null&&ce!==void 0?ce:"fetch",b=(Te=(D=gk(b1,d=>d.transport===t))===null||D===void 0?void 0:D.method)!==null&&Te!==void 0?Te:b1[0].method;if(!b)throw new Error("No available transport method");b(L)})(bi(bi({},z),{},{callback:W=>{var ce,Te,D;this.rateLimiter.checkForLimiting(W),W.statusCode>=400&&((Te=(D=this.config).on_request_error)===null||Te===void 0||Te.call(D,W)),(ce=z.callback)===null||ce===void 0||ce.call(z,W)}}))))}_send_retriable_request(z){this._retryQueue?this._retryQueue.retriableRequest(z):this._send_request(z)}_execute_array(z){var W,ce=[],Te=[],D=[];m0(z,t=>{t&&(W=t[0],Bu(W)?D.push(t):Yh(t)?t.call(this):Bu(t)&&W==="alias"?ce.push(t):Bu(t)&&W.indexOf("capture")!==-1&&Yh(this[W])?D.push(t):Te.push(t))});var L=function(t,b){m0(t,function(d){if(Bu(d[0])){var e=b;tl(d,function(w){e=e[w[0]].apply(e,w.slice(1))})}else this[d[0]].apply(this,d.slice(1))},b)};L(ce,this),L(Te,this),L(D,this)}_hasBootstrappedFeatureFlags(){var z,W;return((z=this.config.bootstrap)===null||z===void 0?void 0:z.featureFlags)&&Object.keys((W=this.config.bootstrap)===null||W===void 0?void 0:W.featureFlags).length>0||!1}push(z){this._execute_array([z])}capture(z,W,ce){var Te;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!pa(z)&&Oc(z)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var D=ce!=null&&ce.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(D==null||!D.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var L=new Date,t=(ce==null?void 0:ce.timestamp)||L,b=i0(),d={uuid:b,event:z,properties:this._calculate_event_properties(z,W||{},t,b)};D&&(d.properties.$lib_rate_limit_remaining_tokens=D.remainingTokens),ce!=null&&ce.$set&&(d.$set=ce==null?void 0:ce.$set);var e=this._calculate_set_once_properties(ce==null?void 0:ce.$set_once);e&&(d.$set_once=e),(d=WM(d,ce!=null&&ce._noTruncate?null:this.config.properties_string_max_length)).timestamp=t,pa(ce==null?void 0:ce.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=L);var w=bi(bi({},d.properties.$set),d.$set);if(Hm(w)||this.setPersonPropertiesForFlags(w),!nl(this.config.before_send)){var y=this._runBeforeSend(d);if(!y)return;d=y}this._internalEventEmitter.emit("eventCaptured",d);var _={method:"POST",url:(Te=ce==null?void 0:ce._url)!==null&&Te!==void 0?Te:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:ce==null?void 0:ce._batchKey};return!this.config.request_batching||ce&&(ce==null||!ce._batchKey)||ce!=null&&ce.send_instantly?this._send_retriable_request(_):this._requestQueue.enqueue(_),d}ha.critical("This capture call is ignored due to client rate limiting.")}}else ha.error("No event name provided to posthog.capture")}else ha.uninitializedWarning("posthog.capture")}_addCaptureHook(z){return this.on("eventCaptured",W=>z(W.event,W))}_calculate_event_properties(z,W,ce,Te){if(ce=ce||new Date,!this.persistence||!this.sessionPersistence)return W;var D=this.persistence.remove_event_timer(z),L=bi({},W);if(L.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(L.$cookieless_mode=!0),z==="$snapshot"){var t=bi(bi({},this.persistence.properties()),this.sessionPersistence.properties());return L.distinct_id=t.distinct_id,(!Oc(L.distinct_id)&&!ch(L.distinct_id)||k5(L.distinct_id))&&ha.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),L}var b,d=Tu.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:e,windowId:w}=this.sessionManager.checkAndGetSessionAndWindowId();L.$session_id=e,L.$window_id=w}if(this.sessionRecording&&(L.$recording_status=this.sessionRecording.status),this.requestRouter.region===Mg.CUSTOM&&(L.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(z==="$pageview"||z==="$pageleave"||z==="$autocapture")){var y=this.sessionPropsManager.getSessionProps();L=Xc(L,y)}if(b=z==="$pageview"?this.pageViewManager.doPageView(ce,Te):z==="$pageleave"?this.pageViewManager.doPageLeave(ce):this.pageViewManager.doEvent(),L=Xc(L,b),z==="$pageview"&&Xi&&(L.title=Xi.title),!pa(D)){var _=ce.getTime()-D;L.$duration=parseFloat((_/1e3).toFixed(3))}wc&&this.config.opt_out_useragent_filter&&(L.$browser_type=this._is_bot()?"bot":"browser"),(L=Xc({},d,this.persistence.properties(),this.sessionPersistence.properties(),L)).$is_identified=this._isIdentified(),Bu(this.config.property_denylist)?tl(this.config.property_denylist,function(n){delete L[n]}):ha.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var u=this.config.sanitize_properties;u&&(ha.error("sanitize_properties is deprecated. Use before_send instead"),L=u(L,z));var r=this._hasPersonProcessing();return L.$process_person_profile=r,r&&this._requirePersonProcessing("_calculate_event_properties"),L}_calculate_set_once_properties(z){if(!this.persistence||!this._hasPersonProcessing())return z;var W=Xc({},this.persistence.get_initial_props(),z||{}),ce=this.config.sanitize_properties;return ce&&(ha.error("sanitize_properties is deprecated. Use before_send instead"),W=ce(W,"$set_once")),Hm(W)?void 0:W}register(z,W){var ce;(ce=this.persistence)===null||ce===void 0||ce.register(z,W)}register_once(z,W,ce){var Te;(Te=this.persistence)===null||Te===void 0||Te.register_once(z,W,ce)}register_for_session(z){var W;(W=this.sessionPersistence)===null||W===void 0||W.register(z)}unregister(z){var W;(W=this.persistence)===null||W===void 0||W.unregister(z)}unregister_for_session(z){var W;(W=this.sessionPersistence)===null||W===void 0||W.unregister(z)}_register_single(z,W){this.register({[z]:W})}getFeatureFlag(z,W){return this.featureFlags.getFeatureFlag(z,W)}getFeatureFlagPayload(z){var W=this.featureFlags.getFeatureFlagPayload(z);try{return JSON.parse(W)}catch{return W}}isFeatureEnabled(z,W){return this.featureFlags.isFeatureEnabled(z,W)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(z,W){this.featureFlags.updateEarlyAccessFeatureEnrollment(z,W)}getEarlyAccessFeatures(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(z,W)}on(z,W){return this._internalEventEmitter.on(z,W)}onFeatureFlags(z){return this.featureFlags.onFeatureFlags(z)}onSessionId(z){var W,ce;return(W=(ce=this.sessionManager)===null||ce===void 0?void 0:ce.onSessionId(z))!==null&&W!==void 0?W:()=>{}}getSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(z,W)}getActiveMatchingSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(z,W)}renderSurvey(z,W){this.surveys.renderSurvey(z,W)}canRenderSurvey(z){this.surveys.canRenderSurvey(z)}getNextSurveyStep(z,W,ce){return this.surveys.getNextSurveyStep(z,W,ce)}identify(z,W,ce){if(!this.__loaded||!this.persistence)return ha.uninitializedWarning("posthog.identify");if(ch(z)&&(z=z.toString(),ha.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),z){if(["distinct_id","distinctid"].includes(z.toLowerCase()))ha.critical('The string "'.concat(z,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var Te=this.get_distinct_id();if(this.register({$user_id:z}),!this.get_property("$device_id")){var D=Te;this.register_once({$had_persisted_distinct_id:!0,$device_id:D},"")}z!==Te&&z!==this.get_property(r1)&&(this.unregister(r1),this.register({distinct_id:z}));var L=(this.persistence.get_property(Qp)||"anonymous")==="anonymous";z!==Te&&L?(this.persistence.set_property(Qp,"identified"),this.setPersonPropertiesForFlags(W||{},!1),this.capture("$identify",{distinct_id:z,$anon_distinct_id:Te},{$set:W||{},$set_once:ce||{}}),this.featureFlags.setAnonymousDistinctId(Te),this._cachedIdentify=d2(z,W,ce)):(W||ce)&&(this._cachedIdentify!==d2(z,W,ce)?(this.setPersonProperties(W,ce),this._cachedIdentify=d2(z,W,ce)):ha.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),z!==Te&&(this.reloadFeatureFlags(),this.unregister(Rx))}}else ha.error("Unique user id has not been set in posthog.identify")}setPersonProperties(z,W){(z||W)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(z||{}),this.capture("$set",{$set:z||{},$set_once:W||{}}))}group(z,W,ce){if(z&&W){if(this._requirePersonProcessing("posthog.group")){var Te=this.getGroups();Te[z]!==W&&this.resetGroupPropertiesForFlags(z),this.register({$groups:bi(bi({},Te),{},{[z]:W})}),ce&&(this.capture("$groupidentify",{$group_type:z,$group_key:W,$group_set:ce}),this.setGroupPropertiesForFlags({[z]:ce})),Te[z]===W||ce||this.reloadFeatureFlags()}}else ha.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(z,W)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(z,W)}resetGroupPropertiesForFlags(z){this.featureFlags.resetGroupPropertiesForFlags(z)}reset(z){var W,ce,Te,D,L;if(ha.info("reset"),!this.__loaded)return ha.uninitializedWarning("posthog.reset");var t=this.get_property("$device_id");if(this.consent.reset(),(W=this.persistence)===null||W===void 0||W.clear(),(ce=this.sessionPersistence)===null||ce===void 0||ce.clear(),(Te=this.surveys)===null||Te===void 0||Te.reset(),(D=this.persistence)===null||D===void 0||D.set_property(Qp,"anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:B5,$device_id:null},"");else{var b=this.config.get_device_id(i0());this.register_once({distinct_id:b,$device_id:z?b:t},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var z,W;return(z=(W=this.sessionManager)===null||W===void 0?void 0:W.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&z!==void 0?z:""}get_session_replay_url(z){if(!this.sessionManager)return"";var{sessionId:W,sessionStartTimestamp:ce}=this.sessionManager.checkAndGetSessionAndWindowId(!0),Te=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(W));if(z!=null&&z.withTimestamp&&ce){var D,L=(D=z.timestampLookBack)!==null&&D!==void 0?D:10;if(!ce)return Te;var t=Math.max(Math.floor((new Date().getTime()-ce)/1e3)-L,0);Te+="?t=".concat(t)}return Te}alias(z,W){return z===this.get_property(mk)?(ha.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(pa(W)&&(W=this.get_distinct_id()),z!==W?(this._register_single(r1,z),this.capture("$create_alias",{alias:z,distinct_id:W})):(ha.warn("alias matches current distinct_id - skipping api call."),this.identify(z),-1)):void 0}set_config(z){var W,ce,Te,D,L=bi({},this.config);Nu(z)&&(Xc(this.config,T4(z)),(W=this.persistence)===null||W===void 0||W.update_config(this.config,L),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new l2(bi(bi({},this.config),{},{persistence:"sessionStorage"})),hc.is_supported()&&hc.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(id.DEBUG=!0,ha.info("set_config",{config:z,oldConfig:L,newConfig:bi({},this.config)})),(ce=this.sessionRecording)===null||ce===void 0||ce.startIfEnabledOrStop(),(Te=this.autocapture)===null||Te===void 0||Te.startIfEnabled(),(D=this.heatmaps)===null||D===void 0||D.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(z){var W=z===!0,ce={sampling:W||!(z==null||!z.sampling),linked_flag:W||!(z==null||!z.linked_flag),url_trigger:W||!(z==null||!z.url_trigger),event_trigger:W||!(z==null||!z.event_trigger)};if(Object.values(ce).some(Boolean)){var Te,D,L,t,b;(Te=this.sessionManager)===null||Te===void 0||Te.checkAndGetSessionAndWindowId(),ce.sampling&&((D=this.sessionRecording)===null||D===void 0||D.overrideSampling()),ce.linked_flag&&((L=this.sessionRecording)===null||L===void 0||L.overrideLinkedFlag()),ce.url_trigger&&((t=this.sessionRecording)===null||t===void 0||t.overrideTrigger("url")),ce.event_trigger&&((b=this.sessionRecording)===null||b===void 0||b.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var z;return!((z=this.sessionRecording)===null||z===void 0||!z.started)}captureException(z,W){var ce,Te=new Error("PostHog syntheticException"),D=Yh((ce=Wa.__PosthogExtensions__)===null||ce===void 0?void 0:ce.parseErrorAsProperties)?bi(bi({},Wa.__PosthogExtensions__.parseErrorAsProperties([z.message,void 0,void 0,void 0,z],{syntheticException:Te})),W):bi({$exception_level:"error",$exception_list:[{type:z.name,value:z.message,mechanism:{handled:!0,synthetic:!1}}]},W);this.exceptions.sendExceptionEvent(D)}loadToolbar(z){return this.toolbar.loadToolbar(z)}get_property(z){var W;return(W=this.persistence)===null||W===void 0?void 0:W.props[z]}getSessionProperty(z){var W;return(W=this.sessionPersistence)===null||W===void 0?void 0:W.props[z]}toString(){var z,W=(z=this.config.name)!==null&&z!==void 0?z:Pm;return W!==Pm&&(W=Pm+"."+W),W}_isIdentified(){var z,W;return((z=this.persistence)===null||z===void 0?void 0:z.get_property(Qp))==="identified"||((W=this.sessionPersistence)===null||W===void 0?void 0:W.get_property(Qp))==="identified"}_hasPersonProcessing(){var z,W,ce,Te;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Hm(this.getGroups())&&((z=this.persistence)===null||z===void 0||(W=z.props)===null||W===void 0||!W[r1])&&((ce=this.persistence)===null||ce===void 0||(Te=ce.props)===null||Te===void 0||!Te[Fx]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(z){return this.config.person_profiles==="never"?(ha.error(z+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Fx,!0),!0)}_sync_opt_out_with_persistence(){var z,W,ce,Te,D=this.consent.isOptedOut(),L=this.config.opt_out_persistence_by_default,t=this.config.disable_persistence||D&&!!L;((z=this.persistence)===null||z===void 0?void 0:z.disabled)!==t&&((ce=this.persistence)===null||ce===void 0||ce.set_disabled(t)),((W=this.sessionPersistence)===null||W===void 0?void 0:W.disabled)!==t&&((Te=this.sessionPersistence)===null||Te===void 0||Te.set_disabled(t))}opt_in_capturing(z){var W;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(pa(z==null?void 0:z.captureEventName)||z!=null&&z.captureEventName)&&this.capture((W=z==null?void 0:z.captureEventName)!==null&&W!==void 0?W:"$opt_in",z==null?void 0:z.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return $h?c8($h,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Xi&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Xi.title},{send_instantly:!0}))}debug(z){z===!1?(Hr==null||Hr.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Hr==null||Hr.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(z){if(nl(this.config.before_send))return z;var W=Bu(this.config.before_send)?this.config.before_send:[this.config.before_send],ce=z;for(var Te of W){if(ce=Te(ce),nl(ce)){var D="Event '".concat(z.event,"' was rejected in beforeSend function");return qM(z.event)?ha.warn("".concat(D,". This can cause unexpected behavior.")):ha.info(D),null}ce.properties&&!Hm(ce.properties)||ha.warn("Event '".concat(z.event,"' has no properties after beforeSend function, this is likely an error."))}return ce}getPageViewId(){var z;return(z=this.pageViewManager._currentPageview)===null||z===void 0?void 0:z.pageViewId}}(function(O,z){for(var W=0;W127&&L<2048?String.fromCharCode(L>>6|192,63&L|128):String.fromCharCode(L>>12|224,L>>6&63|128,63&L|128),A0(t)||(W>z&&(D+=O.substring(z,W)),D+=t,z=W=Te+1)}return W>z&&(D+=O.substring(z,O.length)),D},H7=!!yb||!!vb,u4="text/plain",Gx=(O,z)=>{var[W,ce]=O.split("?"),Te=bi({},z);ce==null||ce.split("&").forEach(L=>{var[t]=L.split("=");delete Te[t]});var D=r7(Te);return D=D?(ce?ce+"&":"")+D:ce,"".concat(W,"?").concat(D)},u1=(O,z)=>JSON.stringify(O,(W,ce)=>typeof ce=="bigint"?ce.toString():ce,z),c2=O=>{var{data:z,compression:W}=O;if(z){if(W===yp.GZipJS){var ce=Yk(Xk(u1(z)),{mtime:0}),Te=new Blob([ce],{type:u4});return{contentType:u4,body:Te,estimatedSize:Te.size}}if(W===yp.Base64){var D=function(b){var d,e,w,y,_,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=0,n=0,l="",o=[];if(!b)return b;b=q7(b);do d=(_=b.charCodeAt(r++)<<16|b.charCodeAt(r++)<<8|b.charCodeAt(r++))>>18&63,e=_>>12&63,w=_>>6&63,y=63&_,o[n++]=u.charAt(d)+u.charAt(e)+u.charAt(w)+u.charAt(y);while(r"data="+encodeURIComponent(typeof b=="string"?b:u1(b)))(D);return{contentType:"application/x-www-form-urlencoded",body:L,estimatedSize:new Blob([L]).size}}var t=u1(z);return{contentType:"application/json",body:t,estimatedSize:new Blob([t]).size}}},b1=[];vb&&b1.push({transport:"fetch",method:O=>{var z,W,{contentType:ce,body:Te,estimatedSize:D}=(z=c2(O))!==null&&z!==void 0?z:{},L=new Headers;tl(O.headers,function(e,w){L.append(w,e)}),ce&&L.append("Content-Type",ce);var t=O.url,b=null;if(T5){var d=new T5;b={signal:d.signal,timeout:setTimeout(()=>d.abort(),O.timeout)}}vb(t,bi({method:(O==null?void 0:O.method)||"GET",headers:L,keepalive:O.method==="POST"&&(D||0)<52428.8,body:Te,signal:(W=b)===null||W===void 0?void 0:W.signal},O.fetchOptions)).then(e=>e.text().then(w=>{var y,_={statusCode:e.status,text:w};if(e.status===200)try{_.json=JSON.parse(w)}catch(u){ha.error(u)}(y=O.callback)===null||y===void 0||y.call(O,_)})).catch(e=>{var w;ha.error(e),(w=O.callback)===null||w===void 0||w.call(O,{statusCode:0,text:e})}).finally(()=>b?clearTimeout(b.timeout):null)}}),yb&&b1.push({transport:"XHR",method:O=>{var z,W=new yb;W.open(O.method||"GET",O.url,!0);var{contentType:ce,body:Te}=(z=c2(O))!==null&&z!==void 0?z:{};tl(O.headers,function(D,L){W.setRequestHeader(L,D)}),ce&&W.setRequestHeader("Content-Type",ce),O.timeout&&(W.timeout=O.timeout),W.withCredentials=!0,W.onreadystatechange=()=>{if(W.readyState===4){var D,L={statusCode:W.status,text:W.responseText};if(W.status===200)try{L.json=JSON.parse(W.responseText)}catch{}(D=O.callback)===null||D===void 0||D.call(O,L)}},W.send(Te)}}),$h!=null&&$h.sendBeacon&&b1.push({transport:"sendBeacon",method:O=>{var z=Gx(O.url,{beacon:"1"});try{var W,{contentType:ce,body:Te}=(W=c2(O))!==null&&W!==void 0?W:{},D=typeof Te=="string"?new Blob([Te],{type:ce}):Te;$h.sendBeacon(z,D)}catch{}}});var G7=["retriesPerformedSoFar"];class W7{constructor(z){Ri(this,"isPolling",!1),Ri(this,"pollIntervalMs",3e3),Ri(this,"queue",[]),this.instance=z,this.queue=[],this.areWeOnline=!0,!pa(Hr)&&"onLine"in Hr.navigator&&(this.areWeOnline=Hr.navigator.onLine,Hr.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),Hr.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(z){var{retriesPerformedSoFar:W}=z,ce=dk(z,G7);ch(W)&&W>0&&(ce.url=Gx(ce.url,{retry_count:W})),this.instance._send_request(bi(bi({},ce),{},{callback:Te=>{var D;Te.statusCode!==200&&(Te.statusCode<400||Te.statusCode>=500)&&(W??0)<10?this.enqueue(bi({retriesPerformedSoFar:W},ce)):(D=ce.callback)===null||D===void 0||D.call(ce,Te)}}))}enqueue(z){var W=z.retriesPerformedSoFar||0;z.retriesPerformedSoFar=W+1;var ce=function(L){var t=3e3*Math.pow(2,L),b=t/2,d=Math.min(18e5,t),e=(Math.random()-.5)*(d-b);return Math.ceil(d+e)}(W),Te=Date.now()+ce;this.queue.push({retryAt:Te,requestOptions:z});var D="Enqueued failed request for retry in ".concat(ce);navigator.onLine||(D+=" (Browser is offline)"),ha.warn(D),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){var z=Date.now(),W=[],ce=this.queue.filter(D=>D.retryAt0)for(var{requestOptions:Te}of ce)this.retriableRequest(Te)}unload(){for(var{requestOptions:z}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(bi(bi({},z),{},{transport:"sendBeacon"}))}catch(W){ha.error(W)}this.queue=[]}}var Mg,c4=Jc("[SessionId]");class Z7{constructor(z,W,ce){var Te;if(Ri(this,"_sessionIdChangedHandlers",[]),!z.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(z.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=z.config,this.persistence=z.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=W||i0,this._windowIdGenerator=ce||i0;var D=this.config.persistence_name||this.config.token,L=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*bp(L,60,36e3,"session_idle_timeout_seconds",1800),z.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+D+"_window_id",this._primary_window_exists_storage_key="ph_"+D+"_primary_window_exists",this._canUseSessionStorage()){var t=zc.parse(this._window_id_storage_key),b=zc.parse(this._primary_window_exists_storage_key);t&&!b?this._windowId=t:zc.remove(this._window_id_storage_key),zc.set(this._primary_window_exists_storage_key,!0)}if((Te=this.config.bootstrap)!==null&&Te!==void 0&&Te.sessionID)try{var d=(e=>{var w=e.replace(/-/g,"");if(w.length!==32)throw new Error("Not a valid UUID");if(w[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(w.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),d)}catch(e){c4.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(z){return pa(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(z),this._sessionId&&z(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(W=>W!==z)}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&zc.is_supported()}_setWindowId(z){z!==this._windowId&&(this._windowId=z,this._canUseSessionStorage()&&zc.set(this._window_id_storage_key,z))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?zc.parse(this._window_id_storage_key):null}_setSessionId(z,W,ce){z===this._sessionId&&W===this._sessionActivityTimestamp&&ce===this._sessionStartTimestamp||(this._sessionStartTimestamp=ce,this._sessionActivityTimestamp=W,this._sessionId=z,this.persistence.register({[Dx]:[W,z,ce]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var z=this.persistence.props[Dx];return Bu(z)&&z.length===2&&z.push(z[0]),z||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){Hr==null||Hr.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&zc.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){var z=arguments.length>0&&arguments[0]!==void 0&&arguments[0],W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var ce=W||new Date().getTime(),[Te,D,L]=this._getSessionId(),t=this._getWindowId(),b=ch(L)&&L>0&&Math.abs(ce-L)>864e5,d=!1,e=!D,w=!z&&Math.abs(ce-Te)>this.sessionTimeoutMs;e||w||b?(D=this._sessionIdGenerator(),t=this._windowIdGenerator(),c4.info("new session ID generated",{sessionId:D,windowId:t,changeReason:{noSessionId:e,activityTimeout:w,sessionPastMaximumLength:b}}),L=ce,d=!0):t||(t=this._windowIdGenerator(),d=!0);var y=Te===0||!z||b?ce:Te,_=L===0?new Date().getTime():L;return this._setWindowId(t),this._setSessionId(D,y,_),z||this.resetIdleTimer(),d&&this._sessionIdChangedHandlers.forEach(u=>u(D,t,d?{noSessionId:e,activityTimeout:w,sessionPastMaximumLength:b}:void 0)),{sessionId:D,windowId:t,sessionStartTimestamp:_,changeReason:d?{noSessionId:e,activityTimeout:w,sessionPastMaximumLength:b}:void 0,lastActivityTimestamp:Te}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}(function(O){O.US="us",O.EU="eu",O.CUSTOM="custom"})(Mg||(Mg={}));var h4="i.posthog.com";class $7{constructor(z){Ri(this,"_regionCache",{}),this.instance=z}get apiHost(){var z=this.instance.config.api_host.trim().replace(/\/$/,"");return z==="https://app.posthog.com"?"https://us.i.posthog.com":z}get uiHost(){var z,W=(z=this.instance.config.ui_host)===null||z===void 0?void 0:z.replace(/\/$/,"");return W||(W=this.apiHost.replace(".".concat(h4),".posthog.com")),W==="https://app.posthog.com"?"https://us.posthog.com":W}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Mg.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Mg.EU:this._regionCache[this.apiHost]=Mg.CUSTOM),this._regionCache[this.apiHost]}endpointFor(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(W&&(W=W[0]==="/"?W:"/".concat(W)),z==="ui")return this.uiHost+W;if(this.region===Mg.CUSTOM)return this.apiHost+W;var ce=h4+W;switch(z){case"assets":return"https://".concat(this.region,"-assets.").concat(ce);case"api":return"https://".concat(this.region,".").concat(ce)}}}var Kk="posthog-js";function Jk(O){var{organization:z,projectId:W,prefix:ce,severityAllowList:Te=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return D=>{var L,t,b,d,e;if(!(Te==="*"||Te.includes(D.level))||!O.__loaded)return D;D.tags||(D.tags={});var w=O.requestRouter.endpointFor("ui","/project/".concat(O.config.token,"/person/").concat(O.get_distinct_id()));D.tags["PostHog Person URL"]=w,O.sessionRecordingStarted()&&(D.tags["PostHog Recording URL"]=O.get_session_replay_url({withTimestamp:!0}));var y=((L=D.exception)===null||L===void 0?void 0:L.values)||[];y.forEach(u=>{u.stacktrace&&(u.stacktrace.type="raw",u.stacktrace.frames.forEach(r=>{r.platform="web:javascript"}))});var _={$exception_message:((t=y[0])===null||t===void 0?void 0:t.value)||D.message,$exception_type:(b=y[0])===null||b===void 0?void 0:b.type,$exception_personURL:w,$exception_level:D.level,$exception_list:y,$sentry_event_id:D.event_id,$sentry_exception:D.exception,$sentry_exception_message:((d=y[0])===null||d===void 0?void 0:d.value)||D.message,$sentry_exception_type:(e=y[0])===null||e===void 0?void 0:e.type,$sentry_tags:D.tags};return z&&W&&(_.$sentry_url=(ce||"https://sentry.io/organizations/")+z+"/issues/?project="+W+"&query="+D.event_id),O.exceptions.sendExceptionEvent(_),D}}class Y7{constructor(z,W,ce,Te,D){this.name=Kk,this.setupOnce=function(L){L(Jk(z,{organization:W,projectId:ce,prefix:Te,severityAllowList:D}))}}}var h2=Jc("[SegmentIntegration]");function X7(O,z){var W=O.config.segment;if(!W)return z();(function(ce,Te){var D=ce.config.segment;if(!D)return Te();var L=b=>{var d=()=>b.anonymousId()||i0();ce.config.get_device_id=d,b.id()&&(ce.register({distinct_id:b.id(),$device_id:d()}),ce.persistence.set_property(Qp,"identified")),Te()},t=D.user();"then"in t&&Yh(t.then)?t.then(b=>L(b)):L(t)})(O,()=>{W.register((ce=>{Promise&&Promise.resolve||h2.warn("This browser does not have Promise support, and can not use the segment integration");var Te=(D,L)=>{var t;if(!L)return D;D.event.userId||D.event.anonymousId===ce.get_distinct_id()||(h2.info("No userId set, resetting PostHog"),ce.reset()),D.event.userId&&D.event.userId!==ce.get_distinct_id()&&(h2.info("UserId set, identifying with PostHog"),ce.identify(D.event.userId));var b=ce._calculate_event_properties(L,(t=D.event.properties)!==null&&t!==void 0?t:{},new Date);return D.event.properties=Object.assign({},b,D.event.properties),D};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:D=>Te(D,D.event.event),page:D=>Te(D,"$pageview"),identify:D=>Te(D,"$identify"),screen:D=>Te(D,"$screen")}})(O)).then(()=>{z()})})}class K7{constructor(z){this._instance=z}doPageView(z,W){var ce,Te=this._previousPageViewProperties(z,W);return this._currentPageview={pathname:(ce=Hr==null?void 0:Hr.location.pathname)!==null&&ce!==void 0?ce:"",pageViewId:W,timestamp:z},this._instance.scrollManager.resetContext(),Te}doPageLeave(z){var W;return this._previousPageViewProperties(z,(W=this._currentPageview)===null||W===void 0?void 0:W.pageViewId)}doEvent(){var z;return{$pageview_id:(z=this._currentPageview)===null||z===void 0?void 0:z.pageViewId}}_previousPageViewProperties(z,W){var ce=this._currentPageview;if(!ce)return{$pageview_id:W};var Te={$pageview_id:W,$prev_pageview_id:ce.pageViewId},D=this._instance.scrollManager.getContext();if(D&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:L,lastScrollY:t,maxScrollY:b,maxContentHeight:d,lastContentY:e,maxContentY:w}=D;if(!(pa(L)||pa(t)||pa(b)||pa(d)||pa(e)||pa(w))){L=Math.ceil(L),t=Math.ceil(t),b=Math.ceil(b),d=Math.ceil(d),e=Math.ceil(e),w=Math.ceil(w);var y=L<=1?1:bp(t/L,0,1),_=L<=1?1:bp(b/L,0,1),u=d<=1?1:bp(e/d,0,1),r=d<=1?1:bp(w/d,0,1);Te=Xc(Te,{$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:y,$prev_pageview_max_scroll:b,$prev_pageview_max_scroll_percentage:_,$prev_pageview_last_content:e,$prev_pageview_last_content_percentage:u,$prev_pageview_max_content:w,$prev_pageview_max_content_percentage:r})}}return ce.pathname&&(Te.$prev_pageview_pathname=ce.pathname),ce.timestamp&&(Te.$prev_pageview_duration=(z.getTime()-ce.timestamp.getTime())/1e3),Te}}var Qk,Au,e8,bg,f4,t8,qb,n8,Hb={},r8=[],J7=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,t3=Array.isArray;function a0(O,z){for(var W in z)O[W]=z[W];return O}function i8(O){var z=O.parentNode;z&&z.removeChild(O)}function f2(O,z,W,ce,Te){var D={type:O,props:z,key:W,ref:ce,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:Te??++e8,__i:-1,__u:0};return Te==null&&Au.vnode!=null&&Au.vnode(D),D}function n3(O){return O.children}function ax(O,z){this.props=O,this.context=z}function dv(O,z){if(z==null)return O.__?dv(O.__,O.__i+1):null;for(var W;zz&&bg.sort(qb));Wx.__r=0}function o8(O,z,W,ce,Te,D,L,t,b,d,e){var w,y,_,u,r,n=ce&&ce.__k||r8,l=z.length;for(W.__d=b,Q7(W,z,n),b=W.__d,w=0;w0?f2(Te.type,Te.props,Te.key,Te.ref?Te.ref:null,Te.__v):Te)!=null?(Te.__=O,Te.__b=O.__b+1,t=e9(Te,W,L=ce+w,e),Te.__i=t,D=null,t!==-1&&(e--,(D=W[t])&&(D.__u|=131072)),D==null||D.__v===null?(t==-1&&w--,typeof Te.type!="function"&&(Te.__u|=65536)):t!==L&&(t===L+1?w++:t>L?e>b-L?w+=t-L:w--:w=t(b!=null&&!(131072&b.__u)?1:0))for(;L>=0||t=0){if((b=z[L])&&!(131072&b.__u)&&Te==b.key&&D===b.type)return L;L--}if(t{},isPopup:!0,onPreviewSubmit:()=>{}}),function(O){O.Popover="popover",O.API="api",O.Widget="widget"}(m4||(m4={})),function(O){O.Open="open",O.MultipleChoice="multiple_choice",O.SingleChoice="single_choice",O.Rating="rating",O.Link="link"}(Zx||(Zx={})),function(O){O.NextQuestion="next_question",O.End="end",O.ResponseBased="response_based",O.SpecificQuestion="specific_question"}(Wf||(Wf={}));class u8{constructor(){Ri(this,"events",{}),this.events={}}on(z,W){return this.events[z]||(this.events[z]=[]),this.events[z].push(W),()=>{this.events[z]=this.events[z].filter(ce=>ce!==W)}}emit(z,W){for(var ce of this.events[z]||[])ce(W);for(var Te of this.events["*"]||[])Te(z,W)}}class wg{constructor(z){Ri(this,"_debugEventEmitter",new u8),Ri(this,"checkStep",(W,ce)=>this.checkStepEvent(W,ce)&&this.checkStepUrl(W,ce)&&this.checkStepElement(W,ce)),Ri(this,"checkStepEvent",(W,ce)=>ce==null||!ce.event||(W==null?void 0:W.event)===(ce==null?void 0:ce.event)),this.instance=z,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var z;if(!pa((z=this.instance)===null||z===void 0?void 0:z._addCaptureHook)){var W;(W=this.instance)===null||W===void 0||W._addCaptureHook((ce,Te)=>{this.on(ce,Te)})}}register(z){var W,ce;if(!pa((W=this.instance)===null||W===void 0?void 0:W._addCaptureHook)&&(z.forEach(L=>{var t,b;(t=this.actionRegistry)===null||t===void 0||t.add(L),(b=L.steps)===null||b===void 0||b.forEach(d=>{var e;(e=this.actionEvents)===null||e===void 0||e.add((d==null?void 0:d.event)||"")})}),(ce=this.instance)!==null&&ce!==void 0&&ce.autocapture)){var Te,D=new Set;z.forEach(L=>{var t;(t=L.steps)===null||t===void 0||t.forEach(b=>{b!=null&&b.selector&&D.add(b==null?void 0:b.selector)})}),(Te=this.instance)===null||Te===void 0||Te.autocapture.setElementSelectors(D)}}on(z,W){var ce;W!=null&&z.length!=0&&(this.actionEvents.has(z)||this.actionEvents.has(W==null?void 0:W.event))&&this.actionRegistry&&((ce=this.actionRegistry)===null||ce===void 0?void 0:ce.size)>0&&this.actionRegistry.forEach(Te=>{this.checkAction(W,Te)&&this._debugEventEmitter.emit("actionCaptured",Te.name)})}_addActionHook(z){this.onAction("actionCaptured",W=>z(W))}checkAction(z,W){if((W==null?void 0:W.steps)==null)return!1;for(var ce of W.steps)if(this.checkStep(z,ce))return!0;return!1}onAction(z,W){return this._debugEventEmitter.on(z,W)}checkStepUrl(z,W){if(W!=null&&W.url){var ce,Te=z==null||(ce=z.properties)===null||ce===void 0?void 0:ce.$current_url;if(!Te||typeof Te!="string"||!wg.matchString(Te,W==null?void 0:W.url,(W==null?void 0:W.url_matching)||"contains"))return!1}return!0}static matchString(z,W,ce){switch(ce){case"regex":return!!Hr&&cv(z,W);case"exact":return W===z;case"contains":var Te=wg.escapeStringRegexp(W).replace(/_/g,".").replace(/%/g,".*");return cv(z,Te);default:return!1}}static escapeStringRegexp(z){return z.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(z,W){if((W!=null&&W.href||W!=null&&W.tag_name||W!=null&&W.text)&&!this.getElementsList(z).some(D=>!(W!=null&&W.href&&!wg.matchString(D.href||"",W==null?void 0:W.href,(W==null?void 0:W.href_matching)||"exact"))&&(W==null||!W.tag_name||D.tag_name===(W==null?void 0:W.tag_name))&&!(W!=null&&W.text&&!wg.matchString(D.text||"",W==null?void 0:W.text,(W==null?void 0:W.text_matching)||"exact")&&!wg.matchString(D.$el_text||"",W==null?void 0:W.text,(W==null?void 0:W.text_matching)||"exact"))))return!1;if(W!=null&&W.selector){var ce,Te=z==null||(ce=z.properties)===null||ce===void 0?void 0:ce.$element_selectors;if(!Te||!Te.includes(W==null?void 0:W.selector))return!1}return!0}getElementsList(z){return(z==null?void 0:z.properties.$elements)==null?[]:z==null?void 0:z.properties.$elements}}class H1{constructor(z){this.instance=z,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(z){var W;pa((W=this.instance)===null||W===void 0?void 0:W._addCaptureHook)||(this.setupEventBasedSurveys(z),this.setupActionBasedSurveys(z))}setupActionBasedSurveys(z){var W=z.filter(ce=>{var Te,D,L,t;return((Te=ce.conditions)===null||Te===void 0?void 0:Te.actions)&&((D=ce.conditions)===null||D===void 0||(L=D.actions)===null||L===void 0||(t=L.values)===null||t===void 0?void 0:t.length)>0});W.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new wg(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(ce=>{this.onAction(ce)})),W.forEach(ce=>{var Te,D,L,t,b,d,e,w,y,_;ce.conditions&&(Te=ce.conditions)!==null&&Te!==void 0&&Te.actions&&(D=ce.conditions)!==null&&D!==void 0&&(L=D.actions)!==null&&L!==void 0&&L.values&&((t=ce.conditions)===null||t===void 0||(b=t.actions)===null||b===void 0||(d=b.values)===null||d===void 0?void 0:d.length)>0&&((e=this.actionMatcher)===null||e===void 0||e.register(ce.conditions.actions.values),(w=ce.conditions)===null||w===void 0||(y=w.actions)===null||y===void 0||(_=y.values)===null||_===void 0||_.forEach(u=>{if(u&&u.name){var r=this.actionToSurveys.get(u.name);r&&r.push(ce.id),this.actionToSurveys.set(u.name,r||[ce.id])}}))}))}setupEventBasedSurveys(z){var W;z.filter(ce=>{var Te,D,L,t;return((Te=ce.conditions)===null||Te===void 0?void 0:Te.events)&&((D=ce.conditions)===null||D===void 0||(L=D.events)===null||L===void 0||(t=L.values)===null||t===void 0?void 0:t.length)>0}).length!==0&&((W=this.instance)===null||W===void 0||W._addCaptureHook((ce,Te)=>{this.onEvent(ce,Te)}),z.forEach(ce=>{var Te,D,L;(Te=ce.conditions)===null||Te===void 0||(D=Te.events)===null||D===void 0||(L=D.values)===null||L===void 0||L.forEach(t=>{if(t&&t.name){var b=this.eventToSurveys.get(t.name);b&&b.push(ce.id),this.eventToSurveys.set(t.name,b||[ce.id])}})}))}onEvent(z,W){var ce,Te,D=((ce=this.instance)===null||ce===void 0||(Te=ce.persistence)===null||Te===void 0?void 0:Te.props[Iy])||[];if(H1.SURVEY_SHOWN_EVENT_NAME==z&&W&&D.length>0){var L,t=W==null||(L=W.properties)===null||L===void 0?void 0:L.$survey_id;if(t){var b=D.indexOf(t);b>=0&&(D.splice(b,1),this._updateActivatedSurveys(D))}}else this.eventToSurveys.has(z)&&this._updateActivatedSurveys(D.concat(this.eventToSurveys.get(z)||[]))}onAction(z){var W,ce,Te=((W=this.instance)===null||W===void 0||(ce=W.persistence)===null||ce===void 0?void 0:ce.props[Iy])||[];this.actionToSurveys.has(z)&&this._updateActivatedSurveys(Te.concat(this.actionToSurveys.get(z)||[]))}_updateActivatedSurveys(z){var W,ce;(W=this.instance)===null||W===void 0||(ce=W.persistence)===null||ce===void 0||ce.register({[Iy]:[...new Set(z)]})}getSurveys(){var z,W,ce=(z=this.instance)===null||z===void 0||(W=z.persistence)===null||W===void 0?void 0:W.props[Iy];return ce||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}Ri(H1,"SURVEY_SHOWN_EVENT_NAME","survey shown");var c1=Jc("[Surveys]"),i9={icontains:O=>!!Hr&&Hr.location.href.toLowerCase().indexOf(O.toLowerCase())>-1,not_icontains:O=>!!Hr&&Hr.location.href.toLowerCase().indexOf(O.toLowerCase())===-1,regex:O=>!!Hr&&cv(Hr.location.href,O),not_regex:O=>!!Hr&&!cv(Hr.location.href,O),exact:O=>(Hr==null?void 0:Hr.location.href)===O,is_not:O=>(Hr==null?void 0:Hr.location.href)!==O};function a9(O,z,W){var ce,Te=O.questions[z],D=z+1;if((ce=Te.branching)===null||ce===void 0||!ce.type)return z===O.questions.length-1?Wf.End:D;if(Te.branching.type===Wf.End)return Wf.End;if(Te.branching.type===Wf.SpecificQuestion){if(Number.isInteger(Te.branching.index))return Te.branching.index}else if(Te.branching.type===Wf.ResponseBased){if(Te.type===Zx.SingleChoice){var L,t,b=Te.choices.indexOf("".concat(W));if((L=Te.branching)!==null&&L!==void 0&&(t=L.responseValues)!==null&&t!==void 0&&t.hasOwnProperty(b)){var d=Te.branching.responseValues[b];return Number.isInteger(d)?d:d===Wf.End?Wf.End:D}}else if(Te.type===Zx.Rating){var e,w;if(typeof W!="number"||!Number.isInteger(W))throw new Error("The response type must be an integer");var y=function(u,r){if(r===3){if(u<1||u>3)throw new Error("The response must be in range 1-3");return u===1?"negative":u===2?"neutral":"positive"}if(r===5){if(u<1||u>5)throw new Error("The response must be in range 1-5");return u<=2?"negative":u===3?"neutral":"positive"}if(r===7){if(u<1||u>7)throw new Error("The response must be in range 1-7");return u<=3?"negative":u===4?"neutral":"positive"}if(r===10){if(u<0||u>10)throw new Error("The response must be in range 0-10");return u<=6?"detractors":u<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(W,Te.scale);if((e=Te.branching)!==null&&e!==void 0&&(w=e.responseValues)!==null&&w!==void 0&&w.hasOwnProperty(y)){var _=Te.branching.responseValues[y];return Number.isInteger(_)?_:_===Wf.End?Wf.End:D}}return D}return c1.warn("Falling back to next question index due to unexpected branching type"),D}class o9{constructor(z){Ri(this,"getNextSurveyStep",a9),this.instance=z,this._surveyEventReceiver=null}onRemoteConfig(z){this._decideServerResponse=!!z.surveys,this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var z=(()=>{for(var W=[],ce=0;celocalStorage.removeItem(W))}loadIfEnabled(){var z,W,ce,Te=Wa==null||(z=Wa.__PosthogExtensions__)===null||z===void 0?void 0:z.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||Te||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new H1(this.instance)),(W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.loadExternalDependency)===null||ce===void 0||ce.call(W,this.instance,"surveys",D=>{var L,t;if(D)return c1.error("Could not load surveys script",D);this._surveyManager=(L=Wa.__PosthogExtensions__)===null||L===void 0||(t=L.generateSurveys)===null||t===void 0?void 0:t.call(L,this.instance)}))}getSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return z([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new H1(this.instance));var ce=this.instance.get_property(Tb);if(ce&&!W)return z(ce);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:Te=>{var D;if(Te.statusCode!==200||!Te.json)return z([]);var L,t=Te.json.surveys||[],b=t.filter(d=>{var e,w,y,_,u,r,n,l,o,s,c,h;return((e=d.conditions)===null||e===void 0?void 0:e.events)&&((w=d.conditions)===null||w===void 0||(y=w.events)===null||y===void 0?void 0:y.values)&&((_=d.conditions)===null||_===void 0||(u=_.events)===null||u===void 0||(r=u.values)===null||r===void 0?void 0:r.length)>0||((n=d.conditions)===null||n===void 0?void 0:n.actions)&&((l=d.conditions)===null||l===void 0||(o=l.actions)===null||o===void 0?void 0:o.values)&&((s=d.conditions)===null||s===void 0||(c=s.actions)===null||c===void 0||(h=c.values)===null||h===void 0?void 0:h.length)>0});return b.length>0&&((L=this._surveyEventReceiver)===null||L===void 0||L.register(b)),(D=this.instance.persistence)===null||D===void 0||D.register({[Tb]:t}),z(t)}})}getActiveMatchingSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(ce=>{var Te,D=ce.filter(b=>!(!b.start_date||b.end_date)).filter(b=>{var d,e,w,y;if(!b.conditions)return!0;var _=(d=b.conditions)===null||d===void 0||!d.url||i9[(e=(w=b.conditions)===null||w===void 0?void 0:w.urlMatchType)!==null&&e!==void 0?e:"icontains"](b.conditions.url),u=(y=b.conditions)===null||y===void 0||!y.selector||(Xi==null?void 0:Xi.querySelector(b.conditions.selector));return _&&u}),L=(Te=this._surveyEventReceiver)===null||Te===void 0?void 0:Te.getSurveys(),t=D.filter(b=>{var d,e,w,y,_,u,r,n,l,o,s;if(!(b.linked_flag_key||b.targeting_flag_key||b.internal_targeting_flag_key||(d=b.feature_flag_keys)!==null&&d!==void 0&&d.length))return!0;var c=!b.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(b.linked_flag_key),h=!b.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(b.targeting_flag_key),x=((e=b.conditions)===null||e===void 0?void 0:e.events)&&((w=b.conditions)===null||w===void 0||(y=w.events)===null||y===void 0?void 0:y.values)&&((_=b.conditions)===null||_===void 0||(u=_.events)===null||u===void 0?void 0:u.values.length)>0,m=((r=b.conditions)===null||r===void 0?void 0:r.actions)&&((n=b.conditions)===null||n===void 0||(l=n.actions)===null||l===void 0?void 0:l.values)&&((o=b.conditions)===null||o===void 0||(s=o.actions)===null||s===void 0?void 0:s.values.length)>0,g=!x&&!m||(L==null?void 0:L.includes(b.id)),k=this._canActivateRepeatedly(b),A=!(b.internal_targeting_flag_key&&!k)||this.instance.featureFlags.isFeatureEnabled(b.internal_targeting_flag_key),v=this.checkFlags(b);return c&&h&&A&&g&&v});return z(t)},W)}checkFlags(z){var W;return(W=z.feature_flag_keys)===null||W===void 0||!W.length||z.feature_flag_keys.every(ce=>{var{key:Te,value:D}=ce;return!Te||!D||this.instance.featureFlags.isFeatureEnabled(D)})}_canActivateRepeatedly(z){var W;return nl((W=Wa.__PosthogExtensions__)===null||W===void 0?void 0:W.canActivateRepeatedly)?(c1.warn("init was not called"),!1):Wa.__PosthogExtensions__.canActivateRepeatedly(z)}canRenderSurvey(z){nl(this._surveyManager)?c1.warn("init was not called"):this.getSurveys(W=>{var ce=W.filter(Te=>Te.id===z)[0];this._surveyManager.canRenderSurvey(ce)})}renderSurvey(z,W){nl(this._surveyManager)?c1.warn("init was not called"):this.getSurveys(ce=>{var Te=ce.filter(D=>D.id===z)[0];this._surveyManager.renderSurvey(Te,Xi==null?void 0:Xi.querySelector(W))})}}var v4=Jc("[RateLimiter]");class s9{constructor(z){var W,ce;Ri(this,"serverLimits",{}),Ri(this,"lastEventRateLimited",!1),Ri(this,"checkForLimiting",Te=>{var D=Te.text;if(D&&D.length)try{(JSON.parse(D).quota_limited||[]).forEach(L=>{v4.info("".concat(L||"events"," is quota limited.")),this.serverLimits[L]=new Date().getTime()+6e4})}catch(L){return void v4.warn('could not rate limit - continuing. Error: "'.concat(L==null?void 0:L.message,'"'),{text:D})}}),this.instance=z,this.captureEventsPerSecond=((W=z.config.rate_limiting)===null||W===void 0?void 0:W.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((ce=z.config.rate_limiting)===null||ce===void 0?void 0:ce.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var z,W,ce,Te=arguments.length>0&&arguments[0]!==void 0&&arguments[0],D=new Date().getTime(),L=(z=(W=this.instance.persistence)===null||W===void 0?void 0:W.get_property(Ab))!==null&&z!==void 0?z:{tokens:this.captureEventsBurstLimit,last:D};L.tokens+=(D-L.last)/1e3*this.captureEventsPerSecond,L.last=D,L.tokens>this.captureEventsBurstLimit&&(L.tokens=this.captureEventsBurstLimit);var t=L.tokens<1;return t||Te||(L.tokens=Math.max(0,L.tokens-1)),!t||this.lastEventRateLimited||Te||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=t,(ce=this.instance.persistence)===null||ce===void 0||ce.set_property(Ab,L),{isRateLimited:t,remainingTokens:L.tokens}}isServerRateLimited(z){var W=this.serverLimits[z||"events"]||!1;return W!==!1&&new Date().getTime(){var z=O==null?void 0:O.config;return bi({initialPathName:(wh==null?void 0:wh.pathname)||"",referringDomain:Tu.referringDomain()},Tu.campaignParams({customTrackedParams:z==null?void 0:z.custom_campaign_params,maskPersonalDataProperties:z==null?void 0:z.mask_personal_data_properties,customPersonalDataProperties:z==null?void 0:z.custom_personal_data_properties}))};class u9{constructor(z,W,ce,Te){Ri(this,"_onSessionIdCallback",D=>{var L=this._getStoredProps();if(!L||L.sessionId!==D){var t={sessionId:D,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[kb]:t})}}),this.instance=z,this._sessionIdManager=W,this._persistence=ce,this._sessionSourceParamGenerator=Te||l9,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[kb]}getSessionProps(){var z,W=(z=this._getStoredProps())===null||z===void 0?void 0:z.props;return W?{$client_session_initial_referring_host:W.referringDomain,$client_session_initial_pathname:W.initialPathName,$client_session_initial_utm_source:W.utm_source,$client_session_initial_utm_campaign:W.utm_campaign,$client_session_initial_utm_medium:W.utm_medium,$client_session_initial_utm_content:W.utm_content,$client_session_initial_utm_term:W.utm_term}:{}}}var c9=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","better uptime bot","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],y4=function(O,z){if(!O)return!1;var W=O.toLowerCase();return c9.concat(z||[]).some(ce=>{var Te=ce.toLowerCase();return W.indexOf(Te)!==-1})},c8=function(O,z){if(!O)return!1;var W=O.userAgent;if(W&&y4(W,z))return!0;try{var ce=O==null?void 0:O.userAgentData;if(ce!=null&&ce.brands&&ce.brands.some(Te=>y4(Te==null?void 0:Te.brand,z)))return!0}catch{}return!!O.webdriver};class h8{constructor(){this.clicks=[]}isRageClick(z,W,ce){var Te=this.clicks[this.clicks.length-1];if(Te&&Math.abs(z-Te.x)+Math.abs(W-Te.y)<30&&ce-Te.timestamp<1e3){if(this.clicks.push({x:z,y:W,timestamp:ce}),this.clicks.length===3)return!0}else this.clicks=[{x:z,y:W,timestamp:ce}];return!1}}var By=Jc("[Dead Clicks]"),h9=()=>!0,f9=O=>{var z,W=!((z=O.instance.persistence)===null||z===void 0||!z.get_property(vk)),ce=O.instance.config.capture_dead_clicks;return Sg(ce)?ce:W};class f8{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(z,W,ce){this.instance=z,this.isEnabled=W,this.onCapture=ce,this.startIfEnabled()}onRemoteConfig(z){this.instance.persistence&&this.instance.persistence.register({[vk]:z==null?void 0:z.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript(()=>{this.start()})}loadScript(z){var W,ce,Te;(W=Wa.__PosthogExtensions__)!==null&&W!==void 0&&W.initDeadClicksAutocapture&&z(),(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.loadExternalDependency)===null||Te===void 0||Te.call(ce,this.instance,"dead-clicks-autocapture",D=>{D?By.error("failed to load script",D):z()})}start(){var z;if(Xi){if(!this._lazyLoadedDeadClicksAutocapture&&(z=Wa.__PosthogExtensions__)!==null&&z!==void 0&&z.initDeadClicksAutocapture){var W=Nu(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};W.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Wa.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,W),this._lazyLoadedDeadClicksAutocapture.start(Xi),By.info("starting...")}}else By.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,By.info("stopping..."))}}var p9=Jc("[Heatmaps]");function x4(O){return Nu(O)&&"clientX"in O&&"clientY"in O&&ch(O.clientX)&&ch(O.clientY)}class d9{constructor(z){var W;Ri(this,"rageclicks",new h8),Ri(this,"_enabledServerSide",!1),Ri(this,"_initialized",!1),Ri(this,"_flushInterval",null),this.instance=z,this._enabledServerSide=!((W=this.instance.persistence)===null||W===void 0||!W.props[bb]),Hr==null||Hr.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){var z=5e3;return Nu(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(z=this.instance.config.capture_heatmaps.flush_interval_milliseconds),z}get isEnabled(){return pa(this.instance.config.capture_heatmaps)?pa(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;p9.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var z,W;clearInterval((z=this._flushInterval)!==null&&z!==void 0?z:void 0),(W=this.deadClicksCapture)===null||W===void 0||W.stop(),this.getAndClearBuffer()}}onRemoteConfig(z){var W=!!z.heatmaps;this.instance.persistence&&this.instance.persistence.register({[bb]:W}),this._enabledServerSide=W,this.startIfEnabled()}getAndClearBuffer(){var z=this.buffer;return this.buffer=void 0,z}_onDeadClick(z){this._onClick(z.originalEvent,"deadclick")}_setupListeners(){Hr&&Xi&&(ad(Xi,"click",z=>this._onClick(z||(Hr==null?void 0:Hr.event)),!1,!0),ad(Xi,"mousemove",z=>this._onMouseMove(z||(Hr==null?void 0:Hr.event)),!1,!0),this.deadClicksCapture=new f8(this.instance,h9,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(z,W){var ce=this.instance.scrollManager.scrollY(),Te=this.instance.scrollManager.scrollX(),D=this.instance.scrollManager.scrollElement(),L=function(t,b,d){for(var e=t;e&&m_(e)&&!v0(e,"body");){if(e===d)return!1;if(bo(b,Hr==null?void 0:Hr.getComputedStyle(e).position))return!0;e=Nk(e)}return!1}(Bk(z),["fixed","sticky"],D);return{x:z.clientX+(L?0:Te),y:z.clientY+(L?0:ce),target_fixed:L,type:W}}_onClick(z){var W,ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!Y5(z.target)&&x4(z)){var Te=this._getProperties(z,ce);(W=this.rageclicks)!==null&&W!==void 0&&W.isRageClick(z.clientX,z.clientY,new Date().getTime())&&this._capture(bi(bi({},Te),{},{type:"rageclick"})),this._capture(Te)}}_onMouseMove(z){!Y5(z.target)&&x4(z)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(z,"mousemove"))},500))}_capture(z){if(Hr){var W=Hr.location.href;this.buffer=this.buffer||{},this.buffer[W]||(this.buffer[W]=[]),this.buffer[W].push(z)}}flush(){this.buffer&&!Hm(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class g9{constructor(z){Ri(this,"_updateScrollData",()=>{var W,ce,Te,D;this.context||(this.context={});var L=this.scrollElement(),t=this.scrollY(),b=L?Math.max(0,L.scrollHeight-L.clientHeight):0,d=t+((L==null?void 0:L.clientHeight)||0),e=(L==null?void 0:L.scrollHeight)||0;this.context.lastScrollY=Math.ceil(t),this.context.maxScrollY=Math.max(t,(W=this.context.maxScrollY)!==null&&W!==void 0?W:0),this.context.maxScrollHeight=Math.max(b,(ce=this.context.maxScrollHeight)!==null&&ce!==void 0?ce:0),this.context.lastContentY=d,this.context.maxContentY=Math.max(d,(Te=this.context.maxContentY)!==null&&Te!==void 0?Te:0),this.context.maxContentHeight=Math.max(e,(D=this.context.maxContentHeight)!==null&&D!==void 0?D:0)}),this.instance=z}getContext(){return this.context}resetContext(){var z=this.context;return setTimeout(this._updateScrollData,0),z}startMeasuringScrollPosition(){Hr==null||Hr.addEventListener("scroll",this._updateScrollData,!0),Hr==null||Hr.addEventListener("scrollend",this._updateScrollData,!0),Hr==null||Hr.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return Hr==null?void 0:Hr.document.documentElement;var z=Bu(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var W of z){var ce=Hr==null?void 0:Hr.document.querySelector(W);if(ce)return ce}}scrollY(){if(this.instance.config.scroll_root_selector){var z=this.scrollElement();return z&&z.scrollTop||0}return Hr&&(Hr.scrollY||Hr.pageYOffset||Hr.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var z=this.scrollElement();return z&&z.scrollLeft||0}return Hr&&(Hr.scrollX||Hr.pageXOffset||Hr.document.documentElement.scrollLeft)||0}}var _4=Jc("[AutoCapture]");function p2(O,z){return z.length>O?z.slice(0,O)+"...":z}function m9(O){if(O.previousElementSibling)return O.previousElementSibling;var z=O;do z=z.previousSibling;while(z&&!m_(z));return z}function v9(O,z,W,ce){var Te=O.tagName.toLowerCase(),D={tag_name:Te};Ob.indexOf(Te)>-1&&!W&&(Te.toLowerCase()==="a"||Te.toLowerCase()==="button"?D.$el_text=p2(1024,qk(O)):D.$el_text=p2(1024,v_(O)));var L=qx(O);L.length>0&&(D.classes=L.filter(function(e){return e!==""})),tl(O.attributes,function(e){var w;if((!jk(O)||["name","id","class","aria-label"].indexOf(e.name)!==-1)&&(ce==null||!ce.includes(e.name))&&!z&&fv(e.value)&&(w=e.name,!Oc(w)||w.substring(0,10)!=="_ngcontent"&&w.substring(0,7)!=="_nghost")){var y=e.value;e.name==="class"&&(y=Jw(y).join(" ")),D["attr__"+e.name]=p2(1024,y)}});for(var t=1,b=1,d=O;d=m9(d);)t++,d.tagName===O.tagName&&b++;return D.nth_child=t,D.nth_of_type=b,D}function y9(O,z){for(var W,ce,{e:Te,maskAllElementAttributes:D,maskAllText:L,elementAttributeIgnoreList:t,elementsChainAsString:b}=z,d=[O],e=O;e.parentNode&&!v0(e,"body");)Rk(e.parentNode)?(d.push(e.parentNode.host),e=e.parentNode.host):(d.push(e.parentNode),e=e.parentNode);var w,y=[],_={},u=!1,r=!1;if(tl(d,c=>{var h=Db(c);c.tagName.toLowerCase()==="a"&&(u=c.getAttribute("href"),u=h&&u&&fv(u)&&u),bo(qx(c),"ph-no-capture")&&(r=!0),y.push(v9(c,D,L,t));var x=function(m){if(!Db(m))return{};var g={};return tl(m.attributes,function(k){if(k.name&&k.name.indexOf("data-ph-capture-attribute")===0){var A=k.name.replace("data-ph-capture-attribute-",""),v=k.value;A&&v&&fv(v)&&(g[A]=v)}}),g}(c);Xc(_,x)}),r)return{props:{},explicitNoCapture:r};if(L||(O.tagName.toLowerCase()==="a"||O.tagName.toLowerCase()==="button"?y[0].$el_text=qk(O):y[0].$el_text=v_(O)),u){var n,l;y[0].attr__href=u;var o=(n=Qm(u))===null||n===void 0?void 0:n.host,s=Hr==null||(l=Hr.location)===null||l===void 0?void 0:l.host;o&&s&&o!==s&&(w=u)}return{props:Xc({$event_type:Te.type,$ce_version:1},b?{}:{$elements:y},{$elements_chain:_7(y)},(W=y[0])!==null&&W!==void 0&&W.$el_text?{$el_text:(ce=y[0])===null||ce===void 0?void 0:ce.$el_text}:{},w&&Te.type==="click"?{$external_click_url:w}:{},_)}}class x9{constructor(z){Ri(this,"_initialized",!1),Ri(this,"_isDisabledServerSide",null),Ri(this,"rageclicks",new h8),Ri(this,"_elementsChainAsString",!1),this.instance=z,this._elementSelectors=null}get config(){var z,W,ce=Nu(this.instance.config.autocapture)?this.instance.config.autocapture:{};return ce.url_allowlist=(z=ce.url_allowlist)===null||z===void 0?void 0:z.map(Te=>new RegExp(Te)),ce.url_ignorelist=(W=ce.url_ignorelist)===null||W===void 0?void 0:W.map(Te=>new RegExp(Te)),ce}_addDomEventHandlers(){if(this.isBrowserSupported()){if(Hr&&Xi){var z=ce=>{ce=ce||(Hr==null?void 0:Hr.event);try{this._captureEvent(ce)}catch(Te){_4.error("Failed to capture event",Te)}},W=ce=>{ce=ce||(Hr==null?void 0:Hr.event),this._captureEvent(ce,n2)};ad(Xi,"submit",z,!1,!0),ad(Xi,"change",z,!1,!0),ad(Xi,"click",z,!1,!0),this.config.capture_copied_text&&(ad(Xi,"copy",W,!1,!0),ad(Xi,"cut",W,!1,!0))}}else _4.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(z){z.elementsChainAsString&&(this._elementsChainAsString=z.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[E5]:!!z.autocapture_opt_out}),this._isDisabledServerSide=!!z.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(z){this._elementSelectors=z}getElementSelectors(z){var W,ce=[];return(W=this._elementSelectors)===null||W===void 0||W.forEach(Te=>{var D=Xi==null?void 0:Xi.querySelectorAll(Te);D==null||D.forEach(L=>{z===L&&ce.push(Te)})}),ce}get isEnabled(){var z,W,ce=(z=this.instance.persistence)===null||z===void 0?void 0:z.props[E5],Te=this._isDisabledServerSide;if(A0(Te)&&!Sg(ce)&&!this.instance.config.advanced_disable_decide)return!1;var D=(W=this._isDisabledServerSide)!==null&&W!==void 0?W:!!ce;return!!this.instance.config.autocapture&&!D}_captureEvent(z){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var ce,Te=Bk(z);Dk(Te)&&(Te=Te.parentNode||null),W==="$autocapture"&&z.type==="click"&&z instanceof MouseEvent&&this.instance.config.rageclick&&(ce=this.rageclicks)!==null&&ce!==void 0&&ce.isRageClick(z.clientX,z.clientY,new Date().getTime())&&this._captureEvent(z,"$rageclick");var D=W===n2;if(Te&&g7(Te,z,this.config,D,D?["copy","cut"]:void 0)){var{props:L,explicitNoCapture:t}=y9(Te,{e:z,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(t)return!1;var b=this.getElementSelectors(Te);if(b&&b.length>0&&(L.$element_selectors=b),W===n2){var d,e=Fk(Hr==null||(d=Hr.getSelection())===null||d===void 0?void 0:d.toString()),w=z.type||"clipboard";if(!e)return!1;L.$selected_content=e,L.$copy_type=w}return this.instance.capture(W,L),!0}}}isBrowserSupported(){return Yh(Xi==null?void 0:Xi.querySelectorAll)}}var _9=Jc("[TracingHeaders]");class b9{constructor(z){Ri(this,"_restoreXHRPatch",void 0),Ri(this,"_restoreFetchPatch",void 0),Ri(this,"_startCapturing",()=>{var W,ce,Te,D;pa(this._restoreXHRPatch)&&((W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.tracingHeadersPatchFns)===null||ce===void 0||ce._patchXHR(this.instance.sessionManager)),pa(this._restoreFetchPatch)&&((Te=Wa.__PosthogExtensions__)===null||Te===void 0||(D=Te.tracingHeadersPatchFns)===null||D===void 0||D._patchFetch(this.instance.sessionManager))}),this.instance=z}_loadScript(z){var W,ce,Te;(W=Wa.__PosthogExtensions__)!==null&&W!==void 0&&W.tracingHeadersPatchFns&&z(),(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.loadExternalDependency)===null||Te===void 0||Te.call(ce,this.instance,"tracing-headers",D=>{if(D)return _9.error("failed to load script",D);z()})}startIfEnabledOrStop(){var z,W;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((z=this._restoreXHRPatch)===null||z===void 0||z.call(this),(W=this._restoreFetchPatch)===null||W===void 0||W.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Qd;(function(O){O[O.PENDING=-1]="PENDING",O[O.DENIED=0]="DENIED",O[O.GRANTED=1]="GRANTED"})(Qd||(Qd={}));class w9{constructor(z){this.instance=z}get config(){return this.instance.config}get consent(){return this.getDnt()?Qd.DENIED:this.storedConsent}isOptedOut(){return this.consent===Qd.DENIED||this.consent===Qd.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(z){this.storage.set(this.storageKey,z?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:z,opt_out_capturing_cookie_prefix:W}=this.instance.config;return(W||"__ph_opt_in_out_")+z}get storedConsent(){var z=this.storage.get(this.storageKey);return z==="1"?Qd.GRANTED:z==="0"?Qd.DENIED:Qd.PENDING}get storage(){if(!this._storage){var z=this.config.opt_out_capturing_persistence_type;this._storage=z==="localStorage"?hc:ud;var W=z==="localStorage"?ud:hc;W.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(W.get(this.storageKey)==="1"),W.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!gk([$h==null?void 0:$h.doNotTrack,$h==null?void 0:$h.msDoNotTrack,Wa.doNotTrack],z=>bo([!0,1,"1","yes"],z))}}var Ny=Jc("[ExceptionAutocapture]");class T9{constructor(z){var W;Ri(this,"originalOnUnhandledRejectionHandler",void 0),Ri(this,"startCapturing",()=>{var ce,Te,D,L;if(Hr&&this.isEnabled&&!this.hasHandlers&&!this.isCapturing){var t=(ce=Wa.__PosthogExtensions__)===null||ce===void 0||(Te=ce.errorWrappingFunctions)===null||Te===void 0?void 0:Te.wrapOnError,b=(D=Wa.__PosthogExtensions__)===null||D===void 0||(L=D.errorWrappingFunctions)===null||L===void 0?void 0:L.wrapUnhandledRejection;if(t&&b)try{this.unwrapOnError=t(this.captureException.bind(this)),this.unwrapUnhandledRejection=b(this.captureException.bind(this))}catch(d){Ny.error("failed to start",d),this.stopCapturing()}else Ny.error("failed to load error wrapping functions - cannot start")}}),this.instance=z,this.remoteEnabled=!((W=this.instance.persistence)===null||W===void 0||!W.props[C5]),this.startIfEnabled()}get isEnabled(){var z;return(z=this.remoteEnabled)!==null&&z!==void 0&&z}get isCapturing(){var z;return!(Hr==null||(z=Hr.onerror)===null||z===void 0||!z.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(Ny.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(z){var W,ce;this.hasHandlers&&z(),(W=Wa.__PosthogExtensions__)===null||W===void 0||(ce=W.loadExternalDependency)===null||ce===void 0||ce.call(W,this.instance,"exception-autocapture",Te=>{if(Te)return Ny.error("failed to load script",Te);z()})}stopCapturing(){var z,W;(z=this.unwrapOnError)===null||z===void 0||z.call(this),(W=this.unwrapUnhandledRejection)===null||W===void 0||W.call(this)}onRemoteConfig(z){var W=z.autocaptureExceptions;this.remoteEnabled=!!W||!1,this.instance.persistence&&this.instance.persistence.register({[C5]:this.remoteEnabled}),this.startIfEnabled()}captureException(z){var W=this.instance.requestRouter.endpointFor("ui");z.$exception_personURL="".concat(W,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(z)}}var mg=Jc("[Web Vitals]"),b4=9e5;class k9{constructor(z){var W;Ri(this,"_enabledServerSide",!1),Ri(this,"_initialized",!1),Ri(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),Ri(this,"_flushToCapture",()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((ce,Te)=>bi(bi({},ce),{},{["$web_vitals_".concat(Te.name,"_event")]:bi({},Te),["$web_vitals_".concat(Te.name,"_value")]:Te.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),Ri(this,"_addToBuffer",ce=>{var Te,D=(Te=this.instance.sessionManager)===null||Te===void 0?void 0:Te.checkAndGetSessionAndWindowId(!0);if(pa(D))mg.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var L=this._currentURL();pa(L)||(nl(ce==null?void 0:ce.name)||nl(ce==null?void 0:ce.value)?mg.error("Invalid metric received",ce):this._maxAllowedValue&&ce.value>=this._maxAllowedValue?mg.error("Ignoring metric with value >= "+this._maxAllowedValue,ce):(this.buffer.url!==L&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),pa(this.buffer.url)&&(this.buffer.url=L),this.buffer.firstMetricTimestamp=pa(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,ce.attribution&&ce.attribution.interactionTargetElement&&(ce.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(bi(bi({},ce),{},{$current_url:L,$session_id:D.sessionId,$window_id:D.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}}),Ri(this,"_startCapturing",()=>{var ce,Te,D,L,t=Wa.__PosthogExtensions__;pa(t)||pa(t.postHogWebVitalsCallbacks)||({onLCP:ce,onCLS:Te,onFCP:D,onINP:L}=t.postHogWebVitalsCallbacks),ce&&Te&&D&&L?(this.allowedMetrics.indexOf("LCP")>-1&&ce(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&Te(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&D(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&L(this._addToBuffer.bind(this)),this._initialized=!0):mg.error("web vitals callbacks not loaded - not starting")}),this.instance=z,this._enabledServerSide=!((W=this.instance.persistence)===null||W===void 0||!W.props[I5]),this.startIfEnabled()}get allowedMetrics(){var z,W,ce=Nu(this.instance.config.capture_performance)?(z=this.instance.config.capture_performance)===null||z===void 0?void 0:z.web_vitals_allowed_metrics:void 0;return pa(ce)?((W=this.instance.persistence)===null||W===void 0?void 0:W.props[P5])||["CLS","FCP","INP","LCP"]:ce}get flushToCaptureTimeoutMs(){return(Nu(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var z=Nu(this.instance.config.capture_performance)&&ch(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:b4;return 0{D?mg.error("failed to load script",D):z()})}_currentURL(){var z=Hr?Hr.location.href:void 0;return z||mg.error("Could not determine current URL"),z}}var A9={icontains:(O,z)=>!!Hr&&z.href.toLowerCase().indexOf(O.toLowerCase())>-1,not_icontains:(O,z)=>!!Hr&&z.href.toLowerCase().indexOf(O.toLowerCase())===-1,regex:(O,z)=>!!Hr&&cv(z.href,O),not_regex:(O,z)=>!!Hr&&!cv(z.href,O),exact:(O,z)=>z.href===O,is_not:(O,z)=>z.href!==O};class $c{constructor(z){var W=this;Ri(this,"getWebExperimentsAndEvaluateDisplayLogic",function(){var ce=arguments.length>0&&arguments[0]!==void 0&&arguments[0];W.getWebExperiments(Te=>{$c.logInfo("retrieved web experiments from the server"),W._flagToExperiments=new Map,Te.forEach(D=>{if(D.feature_flag_key){var L;W._flagToExperiments&&($c.logInfo("setting flag key ",D.feature_flag_key," to web experiment ",D),(L=W._flagToExperiments)===null||L===void 0||L.set(D.feature_flag_key,D));var t=W.instance.getFeatureFlag(D.feature_flag_key);Oc(t)&&D.variants[t]&&W.applyTransforms(D.name,t,D.variants[t].transforms)}else if(D.variants)for(var b in D.variants){var d=D.variants[b];$c.matchesTestVariant(d)&&W.applyTransforms(D.name,b,d.transforms)}})},ce)}),this.instance=z,this.instance.onFeatureFlags(ce=>{this.onFeatureFlags(ce)})}onFeatureFlags(z){if(this._is_bot())$c.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(nl(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();$c.logInfo("applying feature flags",z),z.forEach(W=>{var ce;if(this._flagToExperiments&&(ce=this._flagToExperiments)!==null&&ce!==void 0&&ce.has(W)){var Te,D=this.instance.getFeatureFlag(W),L=(Te=this._flagToExperiments)===null||Te===void 0?void 0:Te.get(W);D&&L!=null&&L.variants[D]&&this.applyTransforms(L.name,D,L.variants[D].transforms)}})}}previewWebExperiment(){var z=$c.getWindowLocation();if(z!=null&&z.search){var W=Nx(z==null?void 0:z.search,"__experiment_id"),ce=Nx(z==null?void 0:z.search,"__experiment_variant");W&&ce&&($c.logInfo("previewing web experiments ".concat(W," && ").concat(ce)),this.getWebExperiments(Te=>{this.showPreviewWebExperiment(parseInt(W),ce,Te)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(z,W,ce){if(this.instance.config.disable_web_experiments&&!ce)return z([]);var Te=this.instance.get_property("$web_experiments");if(Te&&!W)return z(Te);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:D=>{if(D.statusCode!==200||!D.json)return z([]);var L=D.json.experiments||[];return z(L)}})}showPreviewWebExperiment(z,W,ce){var Te=ce.filter(D=>D.id===z);Te&&Te.length>0&&($c.logInfo("Previewing web experiment [".concat(Te[0].name,"] with variant [").concat(W,"]")),this.applyTransforms(Te[0].name,W,Te[0].variants[W].transforms))}static matchesTestVariant(z){return!nl(z.conditions)&&$c.matchUrlConditions(z)&&$c.matchUTMConditions(z)}static matchUrlConditions(z){var W;if(nl(z.conditions)||nl((W=z.conditions)===null||W===void 0?void 0:W.url))return!0;var ce,Te,D,L=$c.getWindowLocation();return!!L&&((ce=z.conditions)===null||ce===void 0||!ce.url||A9[(Te=(D=z.conditions)===null||D===void 0?void 0:D.urlMatchType)!==null&&Te!==void 0?Te:"icontains"](z.conditions.url,L))}static getWindowLocation(){return Hr==null?void 0:Hr.location}static matchUTMConditions(z){var W;if(nl(z.conditions)||nl((W=z.conditions)===null||W===void 0?void 0:W.utm))return!0;var ce=Tu.campaignParams();if(ce.utm_source){var Te,D,L,t,b,d,e,w,y,_,u,r,n,l,o,s,c=(Te=z.conditions)===null||Te===void 0||(D=Te.utm)===null||D===void 0||!D.utm_campaign||((L=z.conditions)===null||L===void 0||(t=L.utm)===null||t===void 0?void 0:t.utm_campaign)==ce.utm_campaign,h=(b=z.conditions)===null||b===void 0||(d=b.utm)===null||d===void 0||!d.utm_source||((e=z.conditions)===null||e===void 0||(w=e.utm)===null||w===void 0?void 0:w.utm_source)==ce.utm_source,x=(y=z.conditions)===null||y===void 0||(_=y.utm)===null||_===void 0||!_.utm_medium||((u=z.conditions)===null||u===void 0||(r=u.utm)===null||r===void 0?void 0:r.utm_medium)==ce.utm_medium,m=(n=z.conditions)===null||n===void 0||(l=n.utm)===null||l===void 0||!l.utm_term||((o=z.conditions)===null||o===void 0||(s=o.utm)===null||s===void 0?void 0:s.utm_term)==ce.utm_term;return c&&x&&m&&h}return!1}static logInfo(z){for(var W=arguments.length,ce=new Array(W>1?W-1:0),Te=1;Te{if(Te.selector){var D;$c.logInfo("applying transform of variant ".concat(W," for experiment ").concat(z," "),Te);var L=(D=document)===null||D===void 0?void 0:D.querySelectorAll(Te.selector);L==null||L.forEach(t=>{var b=t;Te.attributes&&Te.attributes.forEach(d=>{switch(d.name){case"text":b.innerText=d.value;break;case"html":b.innerHTML=d.value;break;case"cssClass":b.className=d.value;break;default:b.setAttribute(d.name,d.value)}}),Te.text&&(b.innerText=Te.text),Te.html&&(b.parentElement?b.parentElement.innerHTML=Te.html:b.innerHTML=Te.html),Te.css&&b.setAttribute("style",Te.css)})}}):$c.logInfo("Control variants leave the page unmodified.")}_is_bot(){return $h&&this.instance?c8($h,this.instance.config.custom_blocked_useragents):void 0}}class S9{constructor(z){this.instance=z}sendExceptionEvent(z){this.instance.capture("$exception",z,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var M9=["$set_once","$set"],vg=Jc("[SiteApps]");class E9{constructor(z){this.instance=z,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(z,W){if(W){var ce=this.globalsForEvent(W);this.bufferedInvocations.push(ce),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var z,W;return(z=Wa._POSTHOG_REMOTE_CONFIG)===null||z===void 0||(W=z[this.instance.config.token])===null||W===void 0?void 0:W.siteApps}init(){if(this.isEnabled){var z=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{z(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(z){var W,ce,Te,D,L,t,b;if(!z)throw new Error("Event payload is required");var d={},e=this.instance.get_property("$groups")||[],w=this.instance.get_property("$stored_group_properties")||{};for(var[y,_]of Object.entries(w))d[y]={id:e[y],type:y,properties:_};var{$set_once:u,$set:r}=z;return{event:bi(bi({},dk(z,M9)),{},{properties:bi(bi(bi({},z.properties),r?{$set:bi(bi({},(W=(ce=z.properties)===null||ce===void 0?void 0:ce.$set)!==null&&W!==void 0?W:{}),r)}:{}),u?{$set_once:bi(bi({},(Te=(D=z.properties)===null||D===void 0?void 0:D.$set_once)!==null&&Te!==void 0?Te:{}),u)}:{}),elements_chain:(L=(t=z.properties)===null||t===void 0?void 0:t.$elements_chain)!==null&&L!==void 0?L:"",distinct_id:(b=z.properties)===null||b===void 0?void 0:b.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:d}}setupSiteApp(z){var W={id:z.id,loaded:!1,errored:!1};this.apps[z.id]=W;var ce=D=>{var L;for(var t of(this.apps[z.id].errored=!D,this.apps[z.id].loaded=!0,vg.info("Site app with id ".concat(z.id," ").concat(D?"loaded":"errored")),D&&this.bufferedInvocations.length&&(vg.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(z.id)),this.bufferedInvocations.forEach(b=>{var d;return(d=W.processEvent)===null||d===void 0?void 0:d.call(W,b)})),Object.values(this.apps)))if(!t.loaded)return;(L=this.stopBuffering)===null||L===void 0||L.call(this)};try{var{processEvent:Te}=z.init({posthog:this.instance,callback:D=>{ce(D)}});Te&&(W.processEvent=Te)}catch(D){vg.error("Error while initializing PostHog app with config id ".concat(z.id),D),ce(!1)}}onCapturedEvent(z){if(Object.keys(this.apps).length!==0){var W=this.globalsForEvent(z);for(var ce of Object.values(this.apps))try{var Te;(Te=ce.processEvent)===null||Te===void 0||Te.call(ce,W)}catch(D){vg.error("Error while processing event ".concat(z.event," for site app ").concat(ce.id),D)}}}onRemoteConfig(z){var W,ce,Te,D=this;if((W=this.siteAppLoaders)!==null&&W!==void 0&&W.length){if(!this.isEnabled)return void vg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var L of this.siteAppLoaders)this.setupSiteApp(L);this.instance.on("eventCaptured",e=>this.onCapturedEvent(e))}else if((ce=this.stopBuffering)===null||ce===void 0||ce.call(this),(Te=z.siteApps)!==null&&Te!==void 0&&Te.length)if(this.isEnabled){var t=function(e,w){var y,_;Wa["__$$ph_site_app_".concat(e)]=D.instance,(y=Wa.__PosthogExtensions__)===null||y===void 0||(_=y.loadSiteApp)===null||_===void 0||_.call(y,D.instance,w,u=>{if(u)return vg.error("Error while initializing PostHog app with config id ".concat(e),u)})};for(var{id:b,url:d}of z.siteApps)t(b,d)}else vg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}function d2(O,z,W){return u1({distinct_id:O,userPropertiesToSet:z,userPropertiesToSetOnce:W})}var w1={},Zb=()=>{},Pm="posthog",p8=!H7&&(wc==null?void 0:wc.indexOf("MSIE"))===-1&&(wc==null?void 0:wc.indexOf("Mozilla"))===-1,w4=()=>{var O,z,W;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(z=Xi==null?void 0:Xi.location,W=z==null?void 0:z.hostname,!!Oc(W)&&W.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Zb,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:wh&&Oc(wh==null?void 0:wh.search)&&wh.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(Hr==null||(O=Hr.location)===null||O===void 0?void 0:O.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:ce=>{var Te="Bad HTTP status: "+ce.statusCode+" "+ce.text;ha.error(Te)},get_device_id:ce=>ce,_onCapture:Zb,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1,before_send:void 0}},T4=O=>{var z={};pa(O.process_person)||(z.person_profiles=O.process_person),pa(O.xhr_headers)||(z.request_headers=O.xhr_headers),pa(O.cookie_name)||(z.persistence_name=O.cookie_name),pa(O.disable_cookie)||(z.disable_persistence=O.disable_cookie);var W=Xc({},z,O);return Bu(O.property_blacklist)&&(pa(O.property_denylist)?W.property_denylist=O.property_blacklist:Bu(O.property_denylist)?W.property_denylist=[...O.property_blacklist,...O.property_denylist]:ha.error("Invalid value for property_denylist config: "+O.property_denylist)),W};class C9{constructor(){Ri(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(z){ha.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=z}}class y_{get decideEndpointWasHit(){var z,W;return(z=(W=this.featureFlags)===null||W===void 0?void 0:W.hasLoadedFlags)!==null&&z!==void 0&&z}constructor(){Ri(this,"webPerformance",new C9),Ri(this,"version",id.LIB_VERSION),Ri(this,"_internalEventEmitter",new u8),this.config=w4(),this.SentryIntegration=Y7,this.sentryIntegration=z=>function(W,ce){var Te=Jk(W,ce);return{name:Kk,processEvent:D=>Te(D)}}(this,z),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new ZM(this),this.toolbar=new U7(this),this.scrollManager=new g9(this),this.pageViewManager=new K7(this),this.surveys=new o9(this),this.experiments=new $c(this),this.exceptions=new S9(this),this.rateLimiter=new s9(this),this.requestRouter=new $7(this),this.consent=new w9(this),this.people={set:(z,W,ce)=>{var Te=Oc(z)?{[z]:W}:z;this.setPersonProperties(Te),ce==null||ce({})},set_once:(z,W,ce)=>{var Te=Oc(z)?{[z]:W}:z;this.setPersonProperties(void 0,Te),ce==null||ce({})}},this.on("eventCaptured",z=>ha.info('send "'.concat(z==null?void 0:z.event,'"'),z))}init(z,W,ce){if(ce&&ce!==Pm){var Te,D=(Te=w1[ce])!==null&&Te!==void 0?Te:new y_;return D._init(z,W,ce),w1[ce]=D,w1[Pm][ce]=D,D}return this._init(z,W,ce)}_init(z){var W,ce,Te,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=arguments.length>2?arguments[2]:void 0;if(pa(z)||k5(z))return ha.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return ha.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],D.person_profiles&&(this._initialPersonProfilesConfig=D.person_profiles),this.set_config(Xc({},w4(),T4(D),{name:L,token:z})),this.config.on_xhr_error&&ha.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=D.disable_compression?void 0:yp.GZipJS,this.persistence=new l2(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new l2(bi(bi({},this.config),{},{persistence:"sessionStorage"}));var t=bi({},this.persistence.props),b=bi({},this.sessionPersistence.props);if(this._requestQueue=new V7(o=>this._send_retriable_request(o)),this._retryQueue=new W7(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Z7(this),this.sessionPropsManager=new u9(this,this.sessionManager,this.persistence)),new b9(this).startIfEnabledOrStop(),this.siteApps=new E9(this),(W=this.siteApps)===null||W===void 0||W.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new B7(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new x9(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new d9(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new k9(this),this.exceptionObserver=new T9(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new f8(this,f9),this.deadClicksAutocapture.startIfEnabled(),id.DEBUG=id.DEBUG||this.config.debug,id.DEBUG&&ha.info("Starting in debug mode",{this:this,config:D,thisC:bi({},this.config),p:t,s:b}),this._sync_opt_out_with_persistence(),((ce=D.bootstrap)===null||ce===void 0?void 0:ce.distinctID)!==void 0){var d,e,w=this.config.get_device_id(i0()),y=(d=D.bootstrap)!==null&&d!==void 0&&d.isIdentifiedID?w:D.bootstrap.distinctID;this.persistence.set_property(Qp,(e=D.bootstrap)!==null&&e!==void 0&&e.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:D.bootstrap.distinctID,$device_id:y})}if(this._hasBootstrappedFeatureFlags()){var _,u,r=Object.keys(((_=D.bootstrap)===null||_===void 0?void 0:_.featureFlags)||{}).filter(o=>{var s,c;return!((s=D.bootstrap)===null||s===void 0||(c=s.featureFlags)===null||c===void 0||!c[o])}).reduce((o,s)=>{var c,h;return o[s]=((c=D.bootstrap)===null||c===void 0||(h=c.featureFlags)===null||h===void 0?void 0:h[s])||!1,o},{}),n=Object.keys(((u=D.bootstrap)===null||u===void 0?void 0:u.featureFlagPayloads)||{}).filter(o=>r[o]).reduce((o,s)=>{var c,h,x,m;return(c=D.bootstrap)!==null&&c!==void 0&&(h=c.featureFlagPayloads)!==null&&h!==void 0&&h[s]&&(o[s]=(x=D.bootstrap)===null||x===void 0||(m=x.featureFlagPayloads)===null||m===void 0?void 0:m[s]),o},{});this.featureFlags.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:n})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:B5,$device_id:null},"");else if(!this.get_distinct_id()){var l=this.config.get_device_id(i0());this.register_once({distinct_id:l,$device_id:l},""),this.persistence.set_property(Qp,"anonymous")}return Hr==null||(Te=Hr.addEventListener)===null||Te===void 0||Te.call(Hr,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),D.segment?X7(this,()=>this._loaded()):this._loaded(),Yh(this.config._onCapture)&&this.config._onCapture!==Zb&&(ha.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",o=>this.config._onCapture(o.event,o))),this}_onRemoteConfig(z){var W,ce,Te,D,L,t,b,d,e;if(!Xi||!Xi.body)return ha.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this._onRemoteConfig(z)},500);this.compression=void 0,z.supportedCompression&&!this.config.disable_compression&&(this.compression=bo(z.supportedCompression,yp.GZipJS)?yp.GZipJS:bo(z.supportedCompression,yp.Base64)?yp.Base64:void 0),(W=z.analytics)!==null&&W!==void 0&&W.endpoint&&(this.analyticsDefaultEndpoint=z.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),(ce=this.siteApps)===null||ce===void 0||ce.onRemoteConfig(z),(Te=this.sessionRecording)===null||Te===void 0||Te.onRemoteConfig(z),(D=this.autocapture)===null||D===void 0||D.onRemoteConfig(z),(L=this.heatmaps)===null||L===void 0||L.onRemoteConfig(z),(t=this.surveys)===null||t===void 0||t.onRemoteConfig(z),(b=this.webVitalsAutocapture)===null||b===void 0||b.onRemoteConfig(z),(d=this.exceptionObserver)===null||d===void 0||d.onRemoteConfig(z),(e=this.deadClicksAutocapture)===null||e===void 0||e.onRemoteConfig(z)}_loaded(){try{this.config.loaded(this)}catch(z){ha.critical("`loaded` function failed",z)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),new N7(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var z;this.has_opted_out_capturing()||this.config.request_batching&&((z=this._requestQueue)===null||z===void 0||z.enable())}_dom_loaded(){this.has_opted_out_capturing()||m0(this.__request_queue,z=>this._send_retriable_request(z)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var z,W;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(z=this._requestQueue)===null||z===void 0||z.unload(),(W=this._retryQueue)===null||W===void 0||W.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(z){this.__loaded&&(p8?this.__request_queue.push(z):this.rateLimiter.isServerRateLimited(z.batchKey)||(z.transport=z.transport||this.config.api_transport,z.url=Gx(z.url,{ip:this.config.ip?1:0}),z.headers=bi({},this.config.request_headers),z.compression=z.compression==="best-available"?this.compression:z.compression,z.fetchOptions=z.fetchOptions||this.config.fetch_options,(W=>{var ce,Te,D,L=bi({},W);L.timeout=L.timeout||6e4,L.url=Gx(L.url,{_:new Date().getTime().toString(),ver:id.LIB_VERSION,compression:L.compression});var t=(ce=L.transport)!==null&&ce!==void 0?ce:"fetch",b=(Te=(D=gk(b1,d=>d.transport===t))===null||D===void 0?void 0:D.method)!==null&&Te!==void 0?Te:b1[0].method;if(!b)throw new Error("No available transport method");b(L)})(bi(bi({},z),{},{callback:W=>{var ce,Te,D;this.rateLimiter.checkForLimiting(W),W.statusCode>=400&&((Te=(D=this.config).on_request_error)===null||Te===void 0||Te.call(D,W)),(ce=z.callback)===null||ce===void 0||ce.call(z,W)}}))))}_send_retriable_request(z){this._retryQueue?this._retryQueue.retriableRequest(z):this._send_request(z)}_execute_array(z){var W,ce=[],Te=[],D=[];m0(z,t=>{t&&(W=t[0],Bu(W)?D.push(t):Yh(t)?t.call(this):Bu(t)&&W==="alias"?ce.push(t):Bu(t)&&W.indexOf("capture")!==-1&&Yh(this[W])?D.push(t):Te.push(t))});var L=function(t,b){m0(t,function(d){if(Bu(d[0])){var e=b;tl(d,function(w){e=e[w[0]].apply(e,w.slice(1))})}else this[d[0]].apply(this,d.slice(1))},b)};L(ce,this),L(Te,this),L(D,this)}_hasBootstrappedFeatureFlags(){var z,W;return((z=this.config.bootstrap)===null||z===void 0?void 0:z.featureFlags)&&Object.keys((W=this.config.bootstrap)===null||W===void 0?void 0:W.featureFlags).length>0||!1}push(z){this._execute_array([z])}capture(z,W,ce){var Te;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!pa(z)&&Oc(z)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var D=ce!=null&&ce.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(D==null||!D.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var L=new Date,t=(ce==null?void 0:ce.timestamp)||L,b=i0(),d={uuid:b,event:z,properties:this._calculate_event_properties(z,W||{},t,b)};D&&(d.properties.$lib_rate_limit_remaining_tokens=D.remainingTokens),ce!=null&&ce.$set&&(d.$set=ce==null?void 0:ce.$set);var e=this._calculate_set_once_properties(ce==null?void 0:ce.$set_once);e&&(d.$set_once=e),(d=GM(d,ce!=null&&ce._noTruncate?null:this.config.properties_string_max_length)).timestamp=t,pa(ce==null?void 0:ce.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=L);var w=bi(bi({},d.properties.$set),d.$set);if(Hm(w)||this.setPersonPropertiesForFlags(w),!nl(this.config.before_send)){var y=this._runBeforeSend(d);if(!y)return;d=y}this._internalEventEmitter.emit("eventCaptured",d);var _={method:"POST",url:(Te=ce==null?void 0:ce._url)!==null&&Te!==void 0?Te:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:ce==null?void 0:ce._batchKey};return!this.config.request_batching||ce&&(ce==null||!ce._batchKey)||ce!=null&&ce.send_instantly?this._send_retriable_request(_):this._requestQueue.enqueue(_),d}ha.critical("This capture call is ignored due to client rate limiting.")}}else ha.error("No event name provided to posthog.capture")}else ha.uninitializedWarning("posthog.capture")}_addCaptureHook(z){return this.on("eventCaptured",W=>z(W.event,W))}_calculate_event_properties(z,W,ce,Te){if(ce=ce||new Date,!this.persistence||!this.sessionPersistence)return W;var D=this.persistence.remove_event_timer(z),L=bi({},W);if(L.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(L.$cookieless_mode=!0),z==="$snapshot"){var t=bi(bi({},this.persistence.properties()),this.sessionPersistence.properties());return L.distinct_id=t.distinct_id,(!Oc(L.distinct_id)&&!ch(L.distinct_id)||k5(L.distinct_id))&&ha.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),L}var b,d=Tu.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:e,windowId:w}=this.sessionManager.checkAndGetSessionAndWindowId();L.$session_id=e,L.$window_id=w}if(this.sessionRecording&&(L.$recording_status=this.sessionRecording.status),this.requestRouter.region===Mg.CUSTOM&&(L.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(z==="$pageview"||z==="$pageleave"||z==="$autocapture")){var y=this.sessionPropsManager.getSessionProps();L=Xc(L,y)}if(b=z==="$pageview"?this.pageViewManager.doPageView(ce,Te):z==="$pageleave"?this.pageViewManager.doPageLeave(ce):this.pageViewManager.doEvent(),L=Xc(L,b),z==="$pageview"&&Xi&&(L.title=Xi.title),!pa(D)){var _=ce.getTime()-D;L.$duration=parseFloat((_/1e3).toFixed(3))}wc&&this.config.opt_out_useragent_filter&&(L.$browser_type=this._is_bot()?"bot":"browser"),(L=Xc({},d,this.persistence.properties(),this.sessionPersistence.properties(),L)).$is_identified=this._isIdentified(),Bu(this.config.property_denylist)?tl(this.config.property_denylist,function(n){delete L[n]}):ha.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var u=this.config.sanitize_properties;u&&(ha.error("sanitize_properties is deprecated. Use before_send instead"),L=u(L,z));var r=this._hasPersonProcessing();return L.$process_person_profile=r,r&&this._requirePersonProcessing("_calculate_event_properties"),L}_calculate_set_once_properties(z){if(!this.persistence||!this._hasPersonProcessing())return z;var W=Xc({},this.persistence.get_initial_props(),z||{}),ce=this.config.sanitize_properties;return ce&&(ha.error("sanitize_properties is deprecated. Use before_send instead"),W=ce(W,"$set_once")),Hm(W)?void 0:W}register(z,W){var ce;(ce=this.persistence)===null||ce===void 0||ce.register(z,W)}register_once(z,W,ce){var Te;(Te=this.persistence)===null||Te===void 0||Te.register_once(z,W,ce)}register_for_session(z){var W;(W=this.sessionPersistence)===null||W===void 0||W.register(z)}unregister(z){var W;(W=this.persistence)===null||W===void 0||W.unregister(z)}unregister_for_session(z){var W;(W=this.sessionPersistence)===null||W===void 0||W.unregister(z)}_register_single(z,W){this.register({[z]:W})}getFeatureFlag(z,W){return this.featureFlags.getFeatureFlag(z,W)}getFeatureFlagPayload(z){var W=this.featureFlags.getFeatureFlagPayload(z);try{return JSON.parse(W)}catch{return W}}isFeatureEnabled(z,W){return this.featureFlags.isFeatureEnabled(z,W)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(z,W){this.featureFlags.updateEarlyAccessFeatureEnrollment(z,W)}getEarlyAccessFeatures(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(z,W)}on(z,W){return this._internalEventEmitter.on(z,W)}onFeatureFlags(z){return this.featureFlags.onFeatureFlags(z)}onSessionId(z){var W,ce;return(W=(ce=this.sessionManager)===null||ce===void 0?void 0:ce.onSessionId(z))!==null&&W!==void 0?W:()=>{}}getSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(z,W)}getActiveMatchingSurveys(z){var W=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(z,W)}renderSurvey(z,W){this.surveys.renderSurvey(z,W)}canRenderSurvey(z){this.surveys.canRenderSurvey(z)}getNextSurveyStep(z,W,ce){return this.surveys.getNextSurveyStep(z,W,ce)}identify(z,W,ce){if(!this.__loaded||!this.persistence)return ha.uninitializedWarning("posthog.identify");if(ch(z)&&(z=z.toString(),ha.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),z){if(["distinct_id","distinctid"].includes(z.toLowerCase()))ha.critical('The string "'.concat(z,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var Te=this.get_distinct_id();if(this.register({$user_id:z}),!this.get_property("$device_id")){var D=Te;this.register_once({$had_persisted_distinct_id:!0,$device_id:D},"")}z!==Te&&z!==this.get_property(r1)&&(this.unregister(r1),this.register({distinct_id:z}));var L=(this.persistence.get_property(Qp)||"anonymous")==="anonymous";z!==Te&&L?(this.persistence.set_property(Qp,"identified"),this.setPersonPropertiesForFlags(W||{},!1),this.capture("$identify",{distinct_id:z,$anon_distinct_id:Te},{$set:W||{},$set_once:ce||{}}),this.featureFlags.setAnonymousDistinctId(Te),this._cachedIdentify=d2(z,W,ce)):(W||ce)&&(this._cachedIdentify!==d2(z,W,ce)?(this.setPersonProperties(W,ce),this._cachedIdentify=d2(z,W,ce)):ha.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),z!==Te&&(this.reloadFeatureFlags(),this.unregister(Rx))}}else ha.error("Unique user id has not been set in posthog.identify")}setPersonProperties(z,W){(z||W)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(z||{}),this.capture("$set",{$set:z||{},$set_once:W||{}}))}group(z,W,ce){if(z&&W){if(this._requirePersonProcessing("posthog.group")){var Te=this.getGroups();Te[z]!==W&&this.resetGroupPropertiesForFlags(z),this.register({$groups:bi(bi({},Te),{},{[z]:W})}),ce&&(this.capture("$groupidentify",{$group_type:z,$group_key:W,$group_set:ce}),this.setGroupPropertiesForFlags({[z]:ce})),Te[z]===W||ce||this.reloadFeatureFlags()}}else ha.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(z,W)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(z){var W=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(z,W)}resetGroupPropertiesForFlags(z){this.featureFlags.resetGroupPropertiesForFlags(z)}reset(z){var W,ce,Te,D,L;if(ha.info("reset"),!this.__loaded)return ha.uninitializedWarning("posthog.reset");var t=this.get_property("$device_id");if(this.consent.reset(),(W=this.persistence)===null||W===void 0||W.clear(),(ce=this.sessionPersistence)===null||ce===void 0||ce.clear(),(Te=this.surveys)===null||Te===void 0||Te.reset(),(D=this.persistence)===null||D===void 0||D.set_property(Qp,"anonymous"),(L=this.sessionManager)===null||L===void 0||L.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:B5,$device_id:null},"");else{var b=this.config.get_device_id(i0());this.register_once({distinct_id:b,$device_id:z?b:t},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var z,W;return(z=(W=this.sessionManager)===null||W===void 0?void 0:W.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&z!==void 0?z:""}get_session_replay_url(z){if(!this.sessionManager)return"";var{sessionId:W,sessionStartTimestamp:ce}=this.sessionManager.checkAndGetSessionAndWindowId(!0),Te=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(W));if(z!=null&&z.withTimestamp&&ce){var D,L=(D=z.timestampLookBack)!==null&&D!==void 0?D:10;if(!ce)return Te;var t=Math.max(Math.floor((new Date().getTime()-ce)/1e3)-L,0);Te+="?t=".concat(t)}return Te}alias(z,W){return z===this.get_property(mk)?(ha.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(pa(W)&&(W=this.get_distinct_id()),z!==W?(this._register_single(r1,z),this.capture("$create_alias",{alias:z,distinct_id:W})):(ha.warn("alias matches current distinct_id - skipping api call."),this.identify(z),-1)):void 0}set_config(z){var W,ce,Te,D,L=bi({},this.config);Nu(z)&&(Xc(this.config,T4(z)),(W=this.persistence)===null||W===void 0||W.update_config(this.config,L),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new l2(bi(bi({},this.config),{},{persistence:"sessionStorage"})),hc.is_supported()&&hc.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(id.DEBUG=!0,ha.info("set_config",{config:z,oldConfig:L,newConfig:bi({},this.config)})),(ce=this.sessionRecording)===null||ce===void 0||ce.startIfEnabledOrStop(),(Te=this.autocapture)===null||Te===void 0||Te.startIfEnabled(),(D=this.heatmaps)===null||D===void 0||D.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(z){var W=z===!0,ce={sampling:W||!(z==null||!z.sampling),linked_flag:W||!(z==null||!z.linked_flag),url_trigger:W||!(z==null||!z.url_trigger),event_trigger:W||!(z==null||!z.event_trigger)};if(Object.values(ce).some(Boolean)){var Te,D,L,t,b;(Te=this.sessionManager)===null||Te===void 0||Te.checkAndGetSessionAndWindowId(),ce.sampling&&((D=this.sessionRecording)===null||D===void 0||D.overrideSampling()),ce.linked_flag&&((L=this.sessionRecording)===null||L===void 0||L.overrideLinkedFlag()),ce.url_trigger&&((t=this.sessionRecording)===null||t===void 0||t.overrideTrigger("url")),ce.event_trigger&&((b=this.sessionRecording)===null||b===void 0||b.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var z;return!((z=this.sessionRecording)===null||z===void 0||!z.started)}captureException(z,W){var ce,Te=new Error("PostHog syntheticException"),D=Yh((ce=Wa.__PosthogExtensions__)===null||ce===void 0?void 0:ce.parseErrorAsProperties)?bi(bi({},Wa.__PosthogExtensions__.parseErrorAsProperties([z.message,void 0,void 0,void 0,z],{syntheticException:Te})),W):bi({$exception_level:"error",$exception_list:[{type:z.name,value:z.message,mechanism:{handled:!0,synthetic:!1}}]},W);this.exceptions.sendExceptionEvent(D)}loadToolbar(z){return this.toolbar.loadToolbar(z)}get_property(z){var W;return(W=this.persistence)===null||W===void 0?void 0:W.props[z]}getSessionProperty(z){var W;return(W=this.sessionPersistence)===null||W===void 0?void 0:W.props[z]}toString(){var z,W=(z=this.config.name)!==null&&z!==void 0?z:Pm;return W!==Pm&&(W=Pm+"."+W),W}_isIdentified(){var z,W;return((z=this.persistence)===null||z===void 0?void 0:z.get_property(Qp))==="identified"||((W=this.sessionPersistence)===null||W===void 0?void 0:W.get_property(Qp))==="identified"}_hasPersonProcessing(){var z,W,ce,Te;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Hm(this.getGroups())&&((z=this.persistence)===null||z===void 0||(W=z.props)===null||W===void 0||!W[r1])&&((ce=this.persistence)===null||ce===void 0||(Te=ce.props)===null||Te===void 0||!Te[Fx]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(z){return this.config.person_profiles==="never"?(ha.error(z+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Fx,!0),!0)}_sync_opt_out_with_persistence(){var z,W,ce,Te,D=this.consent.isOptedOut(),L=this.config.opt_out_persistence_by_default,t=this.config.disable_persistence||D&&!!L;((z=this.persistence)===null||z===void 0?void 0:z.disabled)!==t&&((ce=this.persistence)===null||ce===void 0||ce.set_disabled(t)),((W=this.sessionPersistence)===null||W===void 0?void 0:W.disabled)!==t&&((Te=this.sessionPersistence)===null||Te===void 0||Te.set_disabled(t))}opt_in_capturing(z){var W;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(pa(z==null?void 0:z.captureEventName)||z!=null&&z.captureEventName)&&this.capture((W=z==null?void 0:z.captureEventName)!==null&&W!==void 0?W:"$opt_in",z==null?void 0:z.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return $h?c8($h,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Xi&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Xi.title},{send_instantly:!0}))}debug(z){z===!1?(Hr==null||Hr.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(Hr==null||Hr.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(z){if(nl(this.config.before_send))return z;var W=Bu(this.config.before_send)?this.config.before_send:[this.config.before_send],ce=z;for(var Te of W){if(ce=Te(ce),nl(ce)){var D="Event '".concat(z.event,"' was rejected in beforeSend function");return VM(z.event)?ha.warn("".concat(D,". This can cause unexpected behavior.")):ha.info(D),null}ce.properties&&!Hm(ce.properties)||ha.warn("Event '".concat(z.event,"' has no properties after beforeSend function, this is likely an error."))}return ce}getPageViewId(){var z;return(z=this.pageViewManager._currentPageview)===null||z===void 0?void 0:z.pageViewId}}(function(O,z){for(var W=0;W * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */$x.exports;(function(O,z){(function(){var W,ce="4.17.21",Te=200,D="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",L="Expected a function",t="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",d=500,e="__lodash_placeholder__",w=1,y=2,_=4,u=1,r=2,n=1,l=2,o=4,s=8,c=16,h=32,x=64,m=128,g=256,k=512,A=30,v="...",S=800,T=16,p=1,M=2,f=3,E=1/0,I=9007199254740991,B=17976931348623157e292,N=0/0,V=4294967295,j=V-1,$=V>>>1,ee=[["ary",m],["bind",n],["bindKey",l],["curry",s],["curryRight",c],["flip",k],["partial",h],["partialRight",x],["rearg",g]],H="[object Arguments]",J="[object Array]",Q="[object AsyncFunction]",Z="[object Boolean]",K="[object Date]",ae="[object DOMException]",se="[object Error]",he="[object Function]",fe="[object GeneratorFunction]",ie="[object Map]",oe="[object Number]",le="[object Null]",ge="[object Object]",ye="[object Promise]",me="[object Proxy]",be="[object RegExp]",Se="[object Set]",Ee="[object String]",Ce="[object Symbol]",Le="[object Undefined]",Oe="[object WeakMap]",We="[object WeakSet]",Ie="[object ArrayBuffer]",Ve="[object DataView]",Pe="[object Float32Array]",de="[object Float64Array]",Me="[object Int8Array]",ke="[object Int16Array]",He="[object Int32Array]",Fe="[object Uint8Array]",qe="[object Uint8ClampedArray]",$e="[object Uint16Array]",Ye="[object Uint32Array]",_e=/\b__p \+= '';/g,De=/\b(__p \+=) '' \+/g,Be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ge=/&(?:amp|lt|gt|quot|#39);/g,tt=/[&<>"']/g,nt=RegExp(Ge.source),pt=RegExp(tt.source),At=/<%-([\s\S]+?)%>/g,wt=/<%([\s\S]+?)%>/g,Nt=/<%=([\s\S]+?)%>/g,Ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/[\\^$.*+?()[\]{}|]/g,ft=RegExp(Qe.source),yt=/^\s+/,Ot=/\s/,Pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,Xe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,Tt=/\\(\\)?/g,vt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,Ut=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,et=/^\[object .+?Constructor\]$/,Et=/^0o[0-7]+$/i,Bt=/^(?:0|[1-9]\d*)$/,Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,St=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,qt="\\ud800-\\udfff",en="\\u0300-\\u036f",Wt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",on=en+Wt+Zt,un="\\u2700-\\u27bf",Pn="a-z\\xdf-\\xf6\\xf8-\\xff",Dn="\\xac\\xb1\\xd7\\xf7",In="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",mn="\\u2000-\\u206f",En=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Kn="A-Z\\xc0-\\xd6\\xd8-\\xde",Ln="\\ufe0e\\ufe0f",Tn=Dn+In+mn+En,Fn="['’]",wn="["+qt+"]",zn="["+Tn+"]",Jn="["+on+"]",$n="\\d+",vr="["+un+"]",Qn="["+Pn+"]",lr="[^"+qt+Tn+$n+un+Pn+Kn+"]",hr="\\ud83c[\\udffb-\\udfff]",jr="(?:"+Jn+"|"+hr+")",ni="[^"+qt+"]",Or="(?:\\ud83c[\\udde6-\\uddff]){2}",Ar="[\\ud800-\\udbff][\\udc00-\\udfff]",xr="["+Kn+"]",Qr="\\u200d",kn="(?:"+Qn+"|"+lr+")",Cn="(?:"+xr+"|"+lr+")",ur="(?:"+Fn+"(?:d|ll|m|re|s|t|ve))?",Zn="(?:"+Fn+"(?:D|LL|M|RE|S|T|VE))?",cr=jr+"?",Ir="["+Ln+"]?",Er="(?:"+Qr+"(?:"+[ni,Or,Ar].join("|")+")"+Ir+cr+")*",Xr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ai="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bn=Ir+cr+Er,Yn="(?:"+[vr,Or,Ar].join("|")+")"+bn,an="(?:"+[ni+Jn+"?",Jn,Or,Ar,wn].join("|")+")",_n=RegExp(Fn,"g"),gn=RegExp(Jn,"g"),qn=RegExp(hr+"(?="+hr+")|"+an+bn,"g"),Un=RegExp([xr+"?"+Qn+"+"+ur+"(?="+[zn,xr,"$"].join("|")+")",Cn+"+"+Zn+"(?="+[zn,xr+kn,"$"].join("|")+")",xr+"?"+kn+"+"+ur,xr+"+"+Zn,ai,Xr,$n,Yn].join("|"),"g"),tr=RegExp("["+Qr+qt+on+Ln+"]"),Wn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],dn=-1,ln={};ln[Pe]=ln[de]=ln[Me]=ln[ke]=ln[He]=ln[Fe]=ln[qe]=ln[$e]=ln[Ye]=!0,ln[H]=ln[J]=ln[Ie]=ln[Z]=ln[Ve]=ln[K]=ln[se]=ln[he]=ln[ie]=ln[oe]=ln[ge]=ln[be]=ln[Se]=ln[Ee]=ln[Oe]=!1;var An={};An[H]=An[J]=An[Ie]=An[Ve]=An[Z]=An[K]=An[Pe]=An[de]=An[Me]=An[ke]=An[He]=An[ie]=An[oe]=An[ge]=An[be]=An[Se]=An[Ee]=An[Ce]=An[Fe]=An[qe]=An[$e]=An[Ye]=!0,An[se]=An[he]=An[Oe]=!1;var er={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},br={"&":"&","<":"<",">":">",'"':""","'":"'"},Tr={"&":"&","<":"<",">":">",""":'"',"'":"'"},yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ur=parseFloat,Rr=parseInt,$r=typeof Uv=="object"&&Uv&&Uv.Object===Object&&Uv,Pr=typeof self=="object"&&self&&self.Object===Object&&self,Cr=$r||Pr||Function("return this")(),Jr=z&&!z.nodeType&&z,gi=Jr&&!0&&O&&!O.nodeType&&O,ii=gi&&gi.exports===Jr,Yr=ii&&$r.process,oi=function(){try{var pr=gi&&gi.require&&gi.require("util").types;return pr||Yr&&Yr.binding&&Yr.binding("util")}catch{}}(),Ti=oi&&oi.isArrayBuffer,Wi=oi&&oi.isDate,Pa=oi&&oi.isMap,ji=oi&&oi.isRegExp,Vo=oi&&oi.isSet,Ha=oi&&oi.isTypedArray;function Oa(pr,Dr,Zr){switch(Zr.length){case 0:return pr.call(Dr);case 1:return pr.call(Dr,Zr[0]);case 2:return pr.call(Dr,Zr[0],Zr[1]);case 3:return pr.call(Dr,Zr[0],Zr[1],Zr[2])}return pr.apply(Dr,Zr)}function bs(pr,Dr,Zr,Li){for(var ia=-1,sa=pr==null?0:pr.length;++ia-1}function Os(pr,Dr,Zr){for(var Li=-1,ia=pr==null?0:pr.length;++Li-1;);return Zr}function Fo(pr,Dr){for(var Zr=pr.length;Zr--&&Ds(Dr,pr[Zr],0)>-1;);return Zr}function Qu(pr,Dr){for(var Zr=pr.length,Li=0;Zr--;)pr[Zr]===Dr&&++Li;return Li}var oa=Ul(er),Mu=Ul(br);function $a(pr){return"\\"+yr[pr]}function Ya(pr,Dr){return pr==null?W:pr[Dr]}function ys(pr){return tr.test(pr)}function qs(pr){return Wn.test(pr)}function ec(pr){for(var Dr,Zr=[];!(Dr=pr.next()).done;)Zr.push(Dr.value);return Zr}function ql(pr){var Dr=-1,Zr=Array(pr.size);return pr.forEach(function(Li,ia){Zr[++Dr]=[ia,Li]}),Zr}function Fs(pr,Dr){return function(Zr){return pr(Dr(Zr))}}function qo(pr,Dr){for(var Zr=-1,Li=pr.length,ia=0,sa=[];++Zr-1}function Fi(xe,Ne){var gt=this.__data__,$t=F(gt,xe);return $t<0?(++this.size,gt.push([xe,Ne])):gt[$t][1]=Ne,this}$s.prototype.clear=ou,$s.prototype.delete=eo,$s.prototype.get=Cl,$s.prototype.has=di,$s.prototype.set=Fi;function Mo(xe){var Ne=-1,gt=xe==null?0:xe.length;for(this.clear();++Ne=Ne?xe:Ne)),xe}function Ue(xe,Ne,gt,$t,pn,Rn){var ar,fr=Ne&w,zr=Ne&y,ci=Ne&_;if(gt&&(ar=pn?gt(xe,$t,pn,Rn):gt(xe)),ar!==W)return ar;if(!qr(xe))return xe;var hi=ot(xe);if(hi){if(ar=uf(xe),!fr)return Iu(xe,ar)}else{var mi=Wu(xe),Ui=mi==he||mi==fe;if(sn(xe))return yd(xe,fr);if(mi==ge||mi==H||Ui&&!pn){if(ar=zr||Ui?{}:lc(xe),!fr)return zr?rf(xe,ue(ar,xe)):P0(xe,te(ar,xe))}else{if(!An[mi])return pn?xe:{};ar=Pp(xe,mi,fr)}}Rn||(Rn=new xa);var la=Rn.get(xe);if(la)return la;Rn.set(xe,ar),Zi(xe)?xe.forEach(function(Ia){ar.add(Ue(Ia,Ne,gt,Ia,xe,Rn))}):ei(xe)&&xe.forEach(function(Ia,_o){ar.set(_o,Ue(Ia,Ne,gt,_o,xe,Rn))});var Ca=ci?zr?zf:lu:zr?Ii:ui,so=hi?W:Ca(xe);return lo(so||xe,function(Ia,_o){so&&(_o=Ia,Ia=xe[_o]),C(ar,_o,Ue(Ia,Ne,gt,_o,xe,Rn))}),ar}function it(xe){var Ne=ui(xe);return function(gt){return ct(gt,xe,Ne)}}function ct(xe,Ne,gt){var $t=gt.length;if(xe==null)return!$t;for(xe=ro(xe);$t--;){var pn=gt[$t],Rn=Ne[pn],ar=xe[pn];if(ar===W&&!(pn in xe)||!Rn(ar))return!1}return!0}function dt(xe,Ne,gt){if(typeof xe!="function")throw new ls(L);return Op(function(){xe.apply(W,gt)},Ne)}function bt(xe,Ne,gt,$t){var pn=-1,Rn=fo,ar=!0,fr=xe.length,zr=[],ci=Ne.length;if(!fr)return zr;gt&&(Ne=Ta(Ne,Rs(gt))),$t?(Rn=Os,ar=!1):Ne.length>=Te&&(Rn=Uu,ar=!1,Ne=new Ys(Ne));e:for(;++pnpn?0:pn+gt),$t=$t===W||$t>pn?pn:ea($t),$t<0&&($t+=pn),$t=gt>$t?0:zl($t);gt<$t;)xe[gt++]=Ne;return xe}function tn(xe,Ne){var gt=[];return Ct(xe,function($t,pn,Rn){Ne($t,pn,Rn)&>.push($t)}),gt}function Yt(xe,Ne,gt,$t,pn){var Rn=-1,ar=xe.length;for(gt||(gt=Gg),pn||(pn=[]);++Rn0&>(fr)?Ne>1?Yt(fr,Ne-1,gt,$t,pn):ws(pn,fr):$t||(pn[pn.length]=fr)}return pn}var vn=L0(),Mn=L0(!0);function Vn(xe,Ne){return xe&&vn(xe,Ne,ui)}function Hn(xe,Ne){return xe&&Mn(xe,Ne,ui)}function Xn(xe,Ne){return To(Ne,function(gt){return _r(xe[gt])})}function rr(xe,Ne){Ne=th(Ne,xe);for(var gt=0,$t=Ne.length;xe!=null&><$t;)xe=xe[Ga(Ne[gt++])];return gt&>==$t?xe:W}function Mr(xe,Ne,gt){var $t=Ne(xe);return ot(xe)?$t:ws($t,gt(xe))}function nr(xe){return xe==null?xe===W?Le:le:ka&&ka in ro(xe)?Td(xe):wv(xe)}function Lr(xe,Ne){return xe>Ne}function dr(xe,Ne){return xe!=null&&ba.call(xe,Ne)}function Br(xe,Ne){return xe!=null&&Ne in ro(xe)}function Sr(xe,Ne,gt){return xe>=ua(Ne,gt)&&xe=120&&hi.length>=120)?new Ys(ar&&hi):W}hi=xe[0];var mi=-1,Ui=fr[0];e:for(;++mi-1;)fr!==xe&&Xo.call(fr,zr,1),Xo.call(xe,zr,1);return xe}function ul(xe,Ne){for(var gt=xe?Ne.length:0,$t=gt-1;gt--;){var pn=Ne[gt];if(gt==$t||pn!==Rn){var Rn=pn;Pu(pn)?Xo.call(xe,pn,1):Sp(xe,pn)}}return xe}function Lo(xe,Ne){return xe+xs(Hu()*(Ne-xe+1))}function Bc(xe,Ne,gt,$t){for(var pn=-1,Rn=Sa(rl((Ne-xe)/(gt||1)),0),ar=Zr(Rn);Rn--;)ar[$t?Rn:++pn]=xe,xe+=gt;return ar}function ef(xe,Ne){var gt="";if(!xe||Ne<1||Ne>I)return gt;do Ne%2&&(gt+=xe),Ne=xs(Ne/2),Ne&&(xe+=xe);while(Ne);return gt}function ga(xe,Ne){return Rf(Rh(xe,Ne,Zo),xe+"")}function Ch(xe){return X(Uo(xe))}function Cu(xe,Ne){var gt=Uo(xe);return Dp(gt,Re(Ne,0,gt.length))}function Sc(xe,Ne,gt,$t){if(!qr(xe))return xe;Ne=th(Ne,xe);for(var pn=-1,Rn=Ne.length,ar=Rn-1,fr=xe;fr!=null&&++pnpn?0:pn+Ne),gt=gt>pn?pn:gt,gt<0&&(gt+=pn),pn=Ne>gt?0:gt-Ne>>>0,Ne>>>=0;for(var Rn=Zr(pn);++$t>>1,ar=xe[Rn];ar!==null&&!Ba(ar)&&(gt?ar<=Ne:ar=Te){var ci=Ne?null:z0(xe);if(ci)return Bo(ci);ar=!1,pn=Uu,zr=new Ys}else zr=Ne?[]:fr;e:for(;++$t=$t?xe:Xs(xe,Ne,gt)}var vd=Va||function(xe){return Cr.clearTimeout(xe)};function yd(xe,Ne){if(Ne)return xe.slice();var gt=xe.length,$t=us?us(gt):new xe.constructor(gt);return xe.copy($t),$t}function nh(xe){var Ne=new xe.constructor(xe.byteLength);return new Gl(Ne).set(new Gl(xe)),Ne}function Gu(xe,Ne){var gt=Ne?nh(xe.buffer):xe.buffer;return new xe.constructor(gt,xe.byteOffset,xe.byteLength)}function E0(xe){var Ne=new xe.constructor(xe.source,Lt.exec(xe));return Ne.lastIndex=xe.lastIndex,Ne}function C0(xe){return Jo?ro(Jo.call(xe)):{}}function I0(xe,Ne){var gt=Ne?nh(xe.buffer):xe.buffer;return new xe.constructor(gt,xe.byteOffset,xe.length)}function Cf(xe,Ne){if(xe!==Ne){var gt=xe!==W,$t=xe===null,pn=xe===xe,Rn=Ba(xe),ar=Ne!==W,fr=Ne===null,zr=Ne===Ne,ci=Ba(Ne);if(!fr&&!ci&&!Rn&&xe>Ne||Rn&&ar&&zr&&!fr&&!ci||$t&&ar&&zr||!gt&&zr||!pn)return 1;if(!$t&&!Rn&&!ci&&xe=fr)return zr;var ci=gt[$t];return zr*(ci=="desc"?-1:1)}}return xe.index-Ne.index}function tp(xe,Ne,gt,$t){for(var pn=-1,Rn=xe.length,ar=gt.length,fr=-1,zr=Ne.length,ci=Sa(Rn-ar,0),hi=Zr(zr+ci),mi=!$t;++fr1?gt[pn-1]:W,ar=pn>2?gt[2]:W;for(Rn=xe.length>3&&typeof Rn=="function"?(pn--,Rn):W,ar&&wu(gt[0],gt[1],ar)&&(Rn=pn<3?W:Rn,pn=1),Ne=ro(Ne);++$t-1?pn[Rn?Ne[ar]:ar]:W}}function Lf(xe){return Nc(function(Ne){var gt=Ne.length,$t=gt,pn=io.prototype.thru;for(xe&&Ne.reverse();$t--;){var Rn=Ne[$t];if(typeof Rn!="function")throw new ls(L);if(pn&&!ar&&wd(Rn)=="wrapper")var ar=new io([],!0)}for($t=ar?$t:gt;++$t1&&Ro.reverse(),hi&&zr<_o&&(Ro.length=zr),this&&this!==Cr&&this instanceof Ia&&(Xp=so||af(Xp)),Xp.apply(Hf,Ro)}return Ia}function Ms(xe,Ne){return function(gt,$t){return fi(gt,xe,Ne($t),{})}}function of(xe,Ne){return function(gt,$t){var pn;if(gt===W&&$t===W)return Ne;if(gt!==W&&(pn=gt),$t!==W){if(pn===W)return $t;typeof gt=="string"||typeof $t=="string"?(gt=vc(gt),$t=vc($t)):(gt=Ih(gt),$t=Ih($t)),pn=xe(gt,$t)}return pn}}function _d(xe){return Nc(function(Ne){return Ne=Ta(Ne,Rs(ma())),ga(function(gt){var $t=this;return xe(Ne,function(pn){return Oa(pn,$t,gt)})})})}function Lh(xe,Ne){Ne=Ne===W?" ":vc(Ne);var gt=Ne.length;if(gt<2)return gt?ef(Ne,xe):Ne;var $t=ef(Ne,rl(xe/Hs(Ne)));return ys(Ne)?mh(Yo($t),0,xe).join(""):$t.slice(0,xe)}function Ep(xe,Ne,gt,$t){var pn=Ne&n,Rn=af(xe);function ar(){for(var fr=-1,zr=arguments.length,ci=-1,hi=$t.length,mi=Zr(hi+zr),Ui=this&&this!==Cr&&this instanceof ar?Rn:xe;++cifr))return!1;var ci=Rn.get(xe),hi=Rn.get(Ne);if(ci&&hi)return ci==Ne&&hi==xe;var mi=-1,Ui=!0,la=gt&r?new Ys:W;for(Rn.set(xe,Ne),Rn.set(Ne,xe);++mi1?"& ":"")+Ne[$t],Ne=Ne.join(gt>2?", ":" "),xe.replace(Pt,`{ + */$x.exports;(function(O,z){(function(){var W,ce="4.17.21",Te=200,D="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",L="Expected a function",t="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",d=500,e="__lodash_placeholder__",w=1,y=2,_=4,u=1,r=2,n=1,l=2,o=4,s=8,c=16,h=32,x=64,m=128,g=256,k=512,A=30,v="...",S=800,T=16,p=1,M=2,f=3,E=1/0,I=9007199254740991,B=17976931348623157e292,N=0/0,V=4294967295,j=V-1,$=V>>>1,ee=[["ary",m],["bind",n],["bindKey",l],["curry",s],["curryRight",c],["flip",k],["partial",h],["partialRight",x],["rearg",g]],H="[object Arguments]",J="[object Array]",Q="[object AsyncFunction]",Z="[object Boolean]",K="[object Date]",ae="[object DOMException]",se="[object Error]",he="[object Function]",fe="[object GeneratorFunction]",ie="[object Map]",oe="[object Number]",le="[object Null]",ge="[object Object]",ye="[object Promise]",me="[object Proxy]",be="[object RegExp]",Se="[object Set]",Ee="[object String]",Ce="[object Symbol]",Le="[object Undefined]",Oe="[object WeakMap]",We="[object WeakSet]",Ie="[object ArrayBuffer]",Ve="[object DataView]",Pe="[object Float32Array]",de="[object Float64Array]",Me="[object Int8Array]",ke="[object Int16Array]",He="[object Int32Array]",Fe="[object Uint8Array]",qe="[object Uint8ClampedArray]",$e="[object Uint16Array]",Ye="[object Uint32Array]",_e=/\b__p \+= '';/g,De=/\b(__p \+=) '' \+/g,Be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ge=/&(?:amp|lt|gt|quot|#39);/g,tt=/[&<>"']/g,nt=RegExp(Ge.source),ft=RegExp(tt.source),At=/<%-([\s\S]+?)%>/g,kt=/<%([\s\S]+?)%>/g,Vt=/<%=([\s\S]+?)%>/g,Ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/,st=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/[\\^$.*+?()[\]{}|]/g,pt=RegExp(Qe.source),yt=/^\s+/,Ot=/\s/,Pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,Xe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,wt=/\\(\\)?/g,vt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lt=/\w*$/,jt=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,et=/^\[object .+?Constructor\]$/,Et=/^0o[0-7]+$/i,Bt=/^(?:0|[1-9]\d*)$/,Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,St=/($^)/,Jt=/['\n\r\u2028\u2029\\]/g,qt="\\ud800-\\udfff",en="\\u0300-\\u036f",Wt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",on=en+Wt+Zt,un="\\u2700-\\u27bf",Pn="a-z\\xdf-\\xf6\\xf8-\\xff",Dn="\\xac\\xb1\\xd7\\xf7",In="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",mn="\\u2000-\\u206f",En=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Kn="A-Z\\xc0-\\xd6\\xd8-\\xde",Ln="\\ufe0e\\ufe0f",Tn=Dn+In+mn+En,Fn="['’]",wn="["+qt+"]",zn="["+Tn+"]",Jn="["+on+"]",$n="\\d+",vr="["+un+"]",Qn="["+Pn+"]",lr="[^"+qt+Tn+$n+un+Pn+Kn+"]",hr="\\ud83c[\\udffb-\\udfff]",jr="(?:"+Jn+"|"+hr+")",ni="[^"+qt+"]",Or="(?:\\ud83c[\\udde6-\\uddff]){2}",Ar="[\\ud800-\\udbff][\\udc00-\\udfff]",xr="["+Kn+"]",Qr="\\u200d",kn="(?:"+Qn+"|"+lr+")",Cn="(?:"+xr+"|"+lr+")",ur="(?:"+Fn+"(?:d|ll|m|re|s|t|ve))?",Zn="(?:"+Fn+"(?:D|LL|M|RE|S|T|VE))?",cr=jr+"?",Ir="["+Ln+"]?",Er="(?:"+Qr+"(?:"+[ni,Or,Ar].join("|")+")"+Ir+cr+")*",Xr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ai="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bn=Ir+cr+Er,Yn="(?:"+[vr,Or,Ar].join("|")+")"+bn,an="(?:"+[ni+Jn+"?",Jn,Or,Ar,wn].join("|")+")",_n=RegExp(Fn,"g"),gn=RegExp(Jn,"g"),qn=RegExp(hr+"(?="+hr+")|"+an+bn,"g"),Un=RegExp([xr+"?"+Qn+"+"+ur+"(?="+[zn,xr,"$"].join("|")+")",Cn+"+"+Zn+"(?="+[zn,xr+kn,"$"].join("|")+")",xr+"?"+kn+"+"+ur,xr+"+"+Zn,ai,Xr,$n,Yn].join("|"),"g"),tr=RegExp("["+Qr+qt+on+Ln+"]"),Wn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],dn=-1,ln={};ln[Pe]=ln[de]=ln[Me]=ln[ke]=ln[He]=ln[Fe]=ln[qe]=ln[$e]=ln[Ye]=!0,ln[H]=ln[J]=ln[Ie]=ln[Z]=ln[Ve]=ln[K]=ln[se]=ln[he]=ln[ie]=ln[oe]=ln[ge]=ln[be]=ln[Se]=ln[Ee]=ln[Oe]=!1;var An={};An[H]=An[J]=An[Ie]=An[Ve]=An[Z]=An[K]=An[Pe]=An[de]=An[Me]=An[ke]=An[He]=An[ie]=An[oe]=An[ge]=An[be]=An[Se]=An[Ee]=An[Ce]=An[Fe]=An[qe]=An[$e]=An[Ye]=!0,An[se]=An[he]=An[Oe]=!1;var er={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},br={"&":"&","<":"<",">":">",'"':""","'":"'"},Tr={"&":"&","<":"<",">":">",""":'"',"'":"'"},yr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ur=parseFloat,Rr=parseInt,$r=typeof Uv=="object"&&Uv&&Uv.Object===Object&&Uv,Pr=typeof self=="object"&&self&&self.Object===Object&&self,Cr=$r||Pr||Function("return this")(),Jr=z&&!z.nodeType&&z,gi=Jr&&!0&&O&&!O.nodeType&&O,ii=gi&&gi.exports===Jr,Yr=ii&&$r.process,oi=function(){try{var pr=gi&&gi.require&&gi.require("util").types;return pr||Yr&&Yr.binding&&Yr.binding("util")}catch{}}(),Ti=oi&&oi.isArrayBuffer,Wi=oi&&oi.isDate,Pa=oi&&oi.isMap,ji=oi&&oi.isRegExp,Vo=oi&&oi.isSet,Ha=oi&&oi.isTypedArray;function Oa(pr,Dr,Zr){switch(Zr.length){case 0:return pr.call(Dr);case 1:return pr.call(Dr,Zr[0]);case 2:return pr.call(Dr,Zr[0],Zr[1]);case 3:return pr.call(Dr,Zr[0],Zr[1],Zr[2])}return pr.apply(Dr,Zr)}function bs(pr,Dr,Zr,Li){for(var ia=-1,sa=pr==null?0:pr.length;++ia-1}function Os(pr,Dr,Zr){for(var Li=-1,ia=pr==null?0:pr.length;++Li-1;);return Zr}function Fo(pr,Dr){for(var Zr=pr.length;Zr--&&Ds(Dr,pr[Zr],0)>-1;);return Zr}function Qu(pr,Dr){for(var Zr=pr.length,Li=0;Zr--;)pr[Zr]===Dr&&++Li;return Li}var oa=Ul(er),Mu=Ul(br);function $a(pr){return"\\"+yr[pr]}function Ya(pr,Dr){return pr==null?W:pr[Dr]}function ys(pr){return tr.test(pr)}function qs(pr){return Wn.test(pr)}function ec(pr){for(var Dr,Zr=[];!(Dr=pr.next()).done;)Zr.push(Dr.value);return Zr}function ql(pr){var Dr=-1,Zr=Array(pr.size);return pr.forEach(function(Li,ia){Zr[++Dr]=[ia,Li]}),Zr}function Fs(pr,Dr){return function(Zr){return pr(Dr(Zr))}}function qo(pr,Dr){for(var Zr=-1,Li=pr.length,ia=0,sa=[];++Zr-1}function Fi(xe,Ne){var gt=this.__data__,$t=F(gt,xe);return $t<0?(++this.size,gt.push([xe,Ne])):gt[$t][1]=Ne,this}$s.prototype.clear=ou,$s.prototype.delete=eo,$s.prototype.get=Cl,$s.prototype.has=di,$s.prototype.set=Fi;function Mo(xe){var Ne=-1,gt=xe==null?0:xe.length;for(this.clear();++Ne=Ne?xe:Ne)),xe}function Ue(xe,Ne,gt,$t,pn,Rn){var ar,fr=Ne&w,zr=Ne&y,ci=Ne&_;if(gt&&(ar=pn?gt(xe,$t,pn,Rn):gt(xe)),ar!==W)return ar;if(!qr(xe))return xe;var hi=ot(xe);if(hi){if(ar=uf(xe),!fr)return Iu(xe,ar)}else{var mi=Wu(xe),Ui=mi==he||mi==fe;if(sn(xe))return yd(xe,fr);if(mi==ge||mi==H||Ui&&!pn){if(ar=zr||Ui?{}:lc(xe),!fr)return zr?rf(xe,ue(ar,xe)):P0(xe,te(ar,xe))}else{if(!An[mi])return pn?xe:{};ar=Pp(xe,mi,fr)}}Rn||(Rn=new xa);var la=Rn.get(xe);if(la)return la;Rn.set(xe,ar),Zi(xe)?xe.forEach(function(Ia){ar.add(Ue(Ia,Ne,gt,Ia,xe,Rn))}):ei(xe)&&xe.forEach(function(Ia,_o){ar.set(_o,Ue(Ia,Ne,gt,_o,xe,Rn))});var Ca=ci?zr?zf:lu:zr?Ii:ui,so=hi?W:Ca(xe);return lo(so||xe,function(Ia,_o){so&&(_o=Ia,Ia=xe[_o]),C(ar,_o,Ue(Ia,Ne,gt,_o,xe,Rn))}),ar}function it(xe){var Ne=ui(xe);return function(gt){return ct(gt,xe,Ne)}}function ct(xe,Ne,gt){var $t=gt.length;if(xe==null)return!$t;for(xe=ro(xe);$t--;){var pn=gt[$t],Rn=Ne[pn],ar=xe[pn];if(ar===W&&!(pn in xe)||!Rn(ar))return!1}return!0}function dt(xe,Ne,gt){if(typeof xe!="function")throw new ls(L);return Op(function(){xe.apply(W,gt)},Ne)}function bt(xe,Ne,gt,$t){var pn=-1,Rn=fo,ar=!0,fr=xe.length,zr=[],ci=Ne.length;if(!fr)return zr;gt&&(Ne=Ta(Ne,Rs(gt))),$t?(Rn=Os,ar=!1):Ne.length>=Te&&(Rn=Uu,ar=!1,Ne=new Ys(Ne));e:for(;++pnpn?0:pn+gt),$t=$t===W||$t>pn?pn:ea($t),$t<0&&($t+=pn),$t=gt>$t?0:zl($t);gt<$t;)xe[gt++]=Ne;return xe}function tn(xe,Ne){var gt=[];return Ct(xe,function($t,pn,Rn){Ne($t,pn,Rn)&>.push($t)}),gt}function Yt(xe,Ne,gt,$t,pn){var Rn=-1,ar=xe.length;for(gt||(gt=Gg),pn||(pn=[]);++Rn0&>(fr)?Ne>1?Yt(fr,Ne-1,gt,$t,pn):ws(pn,fr):$t||(pn[pn.length]=fr)}return pn}var vn=L0(),Mn=L0(!0);function Vn(xe,Ne){return xe&&vn(xe,Ne,ui)}function Hn(xe,Ne){return xe&&Mn(xe,Ne,ui)}function Xn(xe,Ne){return To(Ne,function(gt){return _r(xe[gt])})}function rr(xe,Ne){Ne=th(Ne,xe);for(var gt=0,$t=Ne.length;xe!=null&><$t;)xe=xe[Ga(Ne[gt++])];return gt&>==$t?xe:W}function Mr(xe,Ne,gt){var $t=Ne(xe);return ot(xe)?$t:ws($t,gt(xe))}function nr(xe){return xe==null?xe===W?Le:le:ka&&ka in ro(xe)?Td(xe):wv(xe)}function Lr(xe,Ne){return xe>Ne}function dr(xe,Ne){return xe!=null&&ba.call(xe,Ne)}function Br(xe,Ne){return xe!=null&&Ne in ro(xe)}function Sr(xe,Ne,gt){return xe>=ua(Ne,gt)&&xe=120&&hi.length>=120)?new Ys(ar&&hi):W}hi=xe[0];var mi=-1,Ui=fr[0];e:for(;++mi-1;)fr!==xe&&Xo.call(fr,zr,1),Xo.call(xe,zr,1);return xe}function ul(xe,Ne){for(var gt=xe?Ne.length:0,$t=gt-1;gt--;){var pn=Ne[gt];if(gt==$t||pn!==Rn){var Rn=pn;Pu(pn)?Xo.call(xe,pn,1):Sp(xe,pn)}}return xe}function Lo(xe,Ne){return xe+xs(Hu()*(Ne-xe+1))}function Bc(xe,Ne,gt,$t){for(var pn=-1,Rn=Sa(rl((Ne-xe)/(gt||1)),0),ar=Zr(Rn);Rn--;)ar[$t?Rn:++pn]=xe,xe+=gt;return ar}function ef(xe,Ne){var gt="";if(!xe||Ne<1||Ne>I)return gt;do Ne%2&&(gt+=xe),Ne=xs(Ne/2),Ne&&(xe+=xe);while(Ne);return gt}function ga(xe,Ne){return Rf(Rh(xe,Ne,Zo),xe+"")}function Ch(xe){return X(Uo(xe))}function Cu(xe,Ne){var gt=Uo(xe);return Dp(gt,Re(Ne,0,gt.length))}function Sc(xe,Ne,gt,$t){if(!qr(xe))return xe;Ne=th(Ne,xe);for(var pn=-1,Rn=Ne.length,ar=Rn-1,fr=xe;fr!=null&&++pnpn?0:pn+Ne),gt=gt>pn?pn:gt,gt<0&&(gt+=pn),pn=Ne>gt?0:gt-Ne>>>0,Ne>>>=0;for(var Rn=Zr(pn);++$t>>1,ar=xe[Rn];ar!==null&&!Ba(ar)&&(gt?ar<=Ne:ar=Te){var ci=Ne?null:z0(xe);if(ci)return Bo(ci);ar=!1,pn=Uu,zr=new Ys}else zr=Ne?[]:fr;e:for(;++$t=$t?xe:Xs(xe,Ne,gt)}var vd=Va||function(xe){return Cr.clearTimeout(xe)};function yd(xe,Ne){if(Ne)return xe.slice();var gt=xe.length,$t=us?us(gt):new xe.constructor(gt);return xe.copy($t),$t}function nh(xe){var Ne=new xe.constructor(xe.byteLength);return new Gl(Ne).set(new Gl(xe)),Ne}function Gu(xe,Ne){var gt=Ne?nh(xe.buffer):xe.buffer;return new xe.constructor(gt,xe.byteOffset,xe.byteLength)}function E0(xe){var Ne=new xe.constructor(xe.source,Lt.exec(xe));return Ne.lastIndex=xe.lastIndex,Ne}function C0(xe){return Jo?ro(Jo.call(xe)):{}}function I0(xe,Ne){var gt=Ne?nh(xe.buffer):xe.buffer;return new xe.constructor(gt,xe.byteOffset,xe.length)}function Cf(xe,Ne){if(xe!==Ne){var gt=xe!==W,$t=xe===null,pn=xe===xe,Rn=Ba(xe),ar=Ne!==W,fr=Ne===null,zr=Ne===Ne,ci=Ba(Ne);if(!fr&&!ci&&!Rn&&xe>Ne||Rn&&ar&&zr&&!fr&&!ci||$t&&ar&&zr||!gt&&zr||!pn)return 1;if(!$t&&!Rn&&!ci&&xe=fr)return zr;var ci=gt[$t];return zr*(ci=="desc"?-1:1)}}return xe.index-Ne.index}function tp(xe,Ne,gt,$t){for(var pn=-1,Rn=xe.length,ar=gt.length,fr=-1,zr=Ne.length,ci=Sa(Rn-ar,0),hi=Zr(zr+ci),mi=!$t;++fr1?gt[pn-1]:W,ar=pn>2?gt[2]:W;for(Rn=xe.length>3&&typeof Rn=="function"?(pn--,Rn):W,ar&&wu(gt[0],gt[1],ar)&&(Rn=pn<3?W:Rn,pn=1),Ne=ro(Ne);++$t-1?pn[Rn?Ne[ar]:ar]:W}}function Lf(xe){return Nc(function(Ne){var gt=Ne.length,$t=gt,pn=io.prototype.thru;for(xe&&Ne.reverse();$t--;){var Rn=Ne[$t];if(typeof Rn!="function")throw new ls(L);if(pn&&!ar&&wd(Rn)=="wrapper")var ar=new io([],!0)}for($t=ar?$t:gt;++$t1&&Ro.reverse(),hi&&zr<_o&&(Ro.length=zr),this&&this!==Cr&&this instanceof Ia&&(Xp=so||af(Xp)),Xp.apply(Hf,Ro)}return Ia}function Ms(xe,Ne){return function(gt,$t){return fi(gt,xe,Ne($t),{})}}function of(xe,Ne){return function(gt,$t){var pn;if(gt===W&&$t===W)return Ne;if(gt!==W&&(pn=gt),$t!==W){if(pn===W)return $t;typeof gt=="string"||typeof $t=="string"?(gt=vc(gt),$t=vc($t)):(gt=Ih(gt),$t=Ih($t)),pn=xe(gt,$t)}return pn}}function _d(xe){return Nc(function(Ne){return Ne=Ta(Ne,Rs(ma())),ga(function(gt){var $t=this;return xe(Ne,function(pn){return Oa(pn,$t,gt)})})})}function Lh(xe,Ne){Ne=Ne===W?" ":vc(Ne);var gt=Ne.length;if(gt<2)return gt?ef(Ne,xe):Ne;var $t=ef(Ne,rl(xe/Hs(Ne)));return ys(Ne)?mh(Yo($t),0,xe).join(""):$t.slice(0,xe)}function Ep(xe,Ne,gt,$t){var pn=Ne&n,Rn=af(xe);function ar(){for(var fr=-1,zr=arguments.length,ci=-1,hi=$t.length,mi=Zr(hi+zr),Ui=this&&this!==Cr&&this instanceof ar?Rn:xe;++cifr))return!1;var ci=Rn.get(xe),hi=Rn.get(Ne);if(ci&&hi)return ci==Ne&&hi==xe;var mi=-1,Ui=!0,la=gt&r?new Ys:W;for(Rn.set(xe,Ne),Rn.set(Ne,xe);++mi1?"& ":"")+Ne[$t],Ne=Ne.join(gt>2?", ":" "),xe.replace(Pt,`{ /* [wrapped with `+Ne+`] */ -`)}function Gg(xe){return ot(xe)||Ke(xe)||!!(Xa&&xe&&xe[Xa])}function Pu(xe,Ne){var gt=typeof xe;return Ne=Ne??I,!!Ne&&(gt=="number"||gt!="symbol"&&Bt.test(xe))&&xe>-1&&xe%1==0&&xe0){if(++Ne>=S)return arguments[0]}else Ne=0;return xe.apply(W,arguments)}}function Dp(xe,Ne){var gt=-1,$t=xe.length,pn=$t-1;for(Ne=Ne===W?$t:Ne;++gt1?xe[Ne-1]:W;return gt=typeof gt=="function"?(xe.pop(),gt):W,jc(xe,gt)});function Xu(xe){var Ne=cn(xe);return Ne.__chain__=!0,Ne}function Z0(xe,Ne){return Ne(xe),xe}function vh(xe,Ne){return Ne(xe)}var Cc=Nc(function(xe){var Ne=xe.length,gt=Ne?xe[0]:0,$t=this.__wrapped__,pn=function(Rn){return Ae(Rn,xe)};return Ne>1||this.__actions__.length||!($t instanceof ta)||!Pu(gt)?this.thru(pn):($t=$t.slice(gt,+gt+(Ne?1:0)),$t.__actions__.push({func:vh,args:[pn],thisArg:W}),new io($t,this.__chain__).thru(function(Rn){return Ne&&!Rn.length&&Rn.push(W),Rn}))});function Vf(){return Xu(this)}function lp(){return new io(this.value(),this.__chain__)}function ff(){this.__values__===W&&(this.__values__=pl(this.value()));var xe=this.__index__>=this.__values__.length,Ne=xe?W:this.__values__[this.__index__++];return{done:xe,value:Ne}}function pf(){return this}function ih(xe){for(var Ne,gt=this;gt instanceof So;){var $t=Fp(gt);$t.__index__=0,$t.__values__=W,Ne?pn.__wrapped__=$t:Ne=$t;var pn=$t;gt=gt.__wrapped__}return pn.__wrapped__=xe,Ne}function pm(){var xe=this.__wrapped__;if(xe instanceof ta){var Ne=xe;return this.__actions__.length&&(Ne=new ta(this)),Ne=Ne.reverse(),Ne.__actions__.push({func:vh,args:[Pd],thisArg:W}),new io(Ne,this.__chain__)}return this.thru(Pd)}function dm(){return Ef(this.__wrapped__,this.__actions__)}var gm=Ks(function(xe,Ne,gt){ba.call(xe,gt)?++xe[gt]:ve(xe,gt,1)});function mm(xe,Ne,gt){var $t=ot(xe)?os:Vt;return gt&&wu(xe,Ne,gt)&&(Ne=W),$t(xe,ma(Ne,3))}function zv(xe,Ne){var gt=ot(xe)?To:tn;return gt(xe,ma(Ne,3))}var Vp=qg(Ev),Rd=qg(Md);function $0(xe,Ne){return Yt(Hp(xe,Ne),1)}function df(xe,Ne){return Yt(Hp(xe,Ne),E)}function qp(xe,Ne,gt){return gt=gt===W?1:ea(gt),Yt(Hp(xe,Ne),gt)}function co(xe,Ne){var gt=ot(xe)?lo:Ct;return gt(xe,ma(Ne,3))}function Y0(xe,Ne){var gt=ot(xe)?Ki:Mt;return gt(xe,ma(Ne,3))}var Fd=Ks(function(xe,Ne,gt){ba.call(xe,gt)?xe[gt].push(Ne):ve(xe,gt,[Ne])});function yh(xe,Ne,gt,$t){xe=Rt(xe)?xe:Uo(xe),gt=gt&&!$t?ea(gt):0;var pn=xe.length;return gt<0&&(gt=Sa(pn+gt,0)),Ka(xe)?gt<=pn&&xe.indexOf(Ne,gt)>-1:!!pn&&Ds(xe,Ne,gt)>-1}var xh=ga(function(xe,Ne,gt){var $t=-1,pn=typeof Ne=="function",Rn=Rt(xe)?Zr(xe.length):[];return Ct(xe,function(ar){Rn[++$t]=pn?Oa(Ne,ar,gt):Nr(ar,Ne,gt)}),Rn}),gf=Ks(function(xe,Ne,gt){ve(xe,gt,Ne)});function Hp(xe,Ne){var gt=ot(xe)?Ta:wa;return gt(xe,ma(Ne,3))}function X0(xe,Ne,gt,$t){return xe==null?[]:(ot(Ne)||(Ne=Ne==null?[]:[Ne]),gt=$t?W:gt,ot(gt)||(gt=gt==null?[]:[gt]),Hi(xe,Ne,gt))}var Ov=Ks(function(xe,Ne,gt){xe[gt?0:1].push(Ne)},function(){return[[],[]]});function Dv(xe,Ne,gt){var $t=ot(xe)?Bl:Vl,pn=arguments.length<3;return $t(xe,ma(Ne,4),gt,pn,Ct)}function Bd(xe,Ne,gt){var $t=ot(xe)?Ql:Vl,pn=arguments.length<3;return $t(xe,ma(Ne,4),gt,pn,Mt)}function Nd(xe,Ne){var gt=ot(xe)?To:tn;return gt(xe,up(ma(Ne,3)))}function vm(xe){var Ne=ot(xe)?X:Ch;return Ne(xe)}function jd(xe,Ne,gt){(gt?wu(xe,Ne,gt):Ne===W)?Ne=1:Ne=ea(Ne);var $t=ot(xe)?R:Cu;return $t(xe,Ne)}function Ud(xe){var Ne=ot(xe)?i:nf;return Ne(xe)}function Nh(xe){if(xe==null)return 0;if(Rt(xe))return Ka(xe)?Hs(xe):xe.length;var Ne=Wu(xe);return Ne==ie||Ne==Se?xe.size:ca(xe).length}function mf(xe,Ne,gt){var $t=ot(xe)?ss:Ap;return gt&&wu(xe,Ne,gt)&&(Ne=W),$t(xe,ma(Ne,3))}var Vd=ga(function(xe,Ne){if(xe==null)return[];var gt=Ne.length;return gt>1&&wu(xe,Ne[0],Ne[1])?Ne=[]:gt>2&&wu(Ne[0],Ne[1],Ne[2])&&(Ne=[Ne[0]]),Hi(xe,Yt(Ne,1),[])}),ah=Ko||function(){return Cr.Date.now()};function K0(xe,Ne){if(typeof Ne!="function")throw new ls(L);return xe=ea(xe),function(){if(--xe<1)return Ne.apply(this,arguments)}}function ds(xe,Ne,gt){return Ne=gt?W:Ne,Ne=xe&&Ne==null?xe.length:Ne,Oh(xe,m,W,W,W,W,Ne)}function qd(xe,Ne){var gt;if(typeof Ne!="function")throw new ls(L);return xe=ea(xe),function(){return--xe>0&&(gt=Ne.apply(this,arguments)),xe<=1&&(Ne=W),gt}}var zo=ga(function(xe,Ne,gt){var $t=n;if(gt.length){var pn=qo(gt,ip(zo));$t|=h}return Oh(xe,$t,Ne,gt,pn)}),J0=ga(function(xe,Ne,gt){var $t=n|l;if(gt.length){var pn=qo(gt,ip(J0));$t|=h}return Oh(Ne,$t,xe,gt,pn)});function Hd(xe,Ne,gt){Ne=gt?W:Ne;var $t=Oh(xe,s,W,W,W,W,W,Ne);return $t.placeholder=Hd.placeholder,$t}function Q0(xe,Ne,gt){Ne=gt?W:Ne;var $t=Oh(xe,c,W,W,W,W,W,Ne);return $t.placeholder=Q0.placeholder,$t}function eg(xe,Ne,gt){var $t,pn,Rn,ar,fr,zr,ci=0,hi=!1,mi=!1,Ui=!0;if(typeof xe!="function")throw new ls(L);Ne=Y(Ne)||0,qr(gt)&&(hi=!!gt.leading,mi="maxWait"in gt,Rn=mi?Sa(Y(gt.maxWait)||0,Ne):Rn,Ui="trailing"in gt?!!gt.trailing:Ui);function la(Ru){var Hf=$t,Xp=pn;return $t=pn=W,ci=Ru,ar=xe.apply(Xp,Hf),ar}function Ca(Ru){return ci=Ru,fr=Op(_o,Ne),hi?la(Ru):ar}function so(Ru){var Hf=Ru-zr,Xp=Ru-ci,h3=Ne-Hf;return mi?ua(h3,Rn-Xp):h3}function Ia(Ru){var Hf=Ru-zr,Xp=Ru-ci;return zr===W||Hf>=Ne||Hf<0||mi&&Xp>=Rn}function _o(){var Ru=ah();if(Ia(Ru))return Ro(Ru);fr=Op(_o,so(Ru))}function Ro(Ru){return fr=W,Ui&&$t?la(Ru):($t=pn=W,ar)}function Hh(){fr!==W&&vd(fr),ci=0,$t=zr=pn=fr=W}function sh(){return fr===W?ar:Ro(ah())}function Gh(){var Ru=ah(),Hf=Ia(Ru);if($t=arguments,pn=this,zr=Ru,Hf){if(fr===W)return Ca(zr);if(mi)return vd(fr),fr=Op(_o,Ne),la(zr)}return fr===W&&(fr=Op(_o,Ne)),ar}return Gh.cancel=Hh,Gh.flush=sh,Gh}var ym=ga(function(xe,Ne){return dt(xe,1,Ne)}),tg=ga(function(xe,Ne,gt){return dt(xe,Y(Ne)||0,gt)});function jh(xe){return Oh(xe,k)}function zu(xe,Ne){if(typeof xe!="function"||Ne!=null&&typeof Ne!="function")throw new ls(L);var gt=function(){var $t=arguments,pn=Ne?Ne.apply(this,$t):$t[0],Rn=gt.cache;if(Rn.has(pn))return Rn.get(pn);var ar=xe.apply(this,$t);return gt.cache=Rn.set(pn,ar)||Rn,ar};return gt.cache=new(zu.Cache||Mo),gt}zu.Cache=Mo;function up(xe){if(typeof xe!="function")throw new ls(L);return function(){var Ne=arguments;switch(Ne.length){case 0:return!xe.call(this);case 1:return!xe.call(this,Ne[0]);case 2:return!xe.call(this,Ne[0],Ne[1]);case 3:return!xe.call(this,Ne[0],Ne[1],Ne[2])}return!xe.apply(this,Ne)}}function Us(xe){return qd(2,xe)}var cp=M0(function(xe,Ne){Ne=Ne.length==1&&ot(Ne[0])?Ta(Ne[0],Rs(ma())):Ta(Yt(Ne,1),Rs(ma()));var gt=Ne.length;return ga(function($t){for(var pn=-1,Rn=ua($t.length,gt);++pn=Ne}),Ke=si(function(){return arguments}())?si:function(xe){return ri(xe)&&ba.call(xe,"callee")&&!Eu.call(xe,"callee")},ot=Zr.isArray,_t=Ti?Rs(Ti):_i;function Rt(xe){return xe!=null&&Gr(xe.length)&&!_r(xe)}function Kt(xe){return ri(xe)&&Rt(xe)}function nn(xe){return xe===!0||xe===!1||ri(xe)&&nr(xe)==Z}var sn=_s||km,yn=Wi?Rs(Wi):Gi;function fn(xe){return ri(xe)&&xe.nodeType===1&&!Ea(xe)}function On(xe){if(xe==null)return!0;if(Rt(xe)&&(ot(xe)||typeof xe=="string"||typeof xe.splice=="function"||sn(xe)||Ja(xe)||Ke(xe)))return!xe.length;var Ne=Wu(xe);if(Ne==ie||Ne==Se)return!xe.size;if(Ll(xe))return!ca(xe).length;for(var gt in xe)if(ba.call(xe,gt))return!1;return!0}function jn(xe,Ne){return Pi(xe,Ne)}function sr(xe,Ne,gt){gt=typeof gt=="function"?gt:W;var $t=gt?gt(xe,Ne):W;return $t===W?Pi(xe,Ne,W,gt):!!$t}function ir(xe){if(!ri(xe))return!1;var Ne=nr(xe);return Ne==se||Ne==ae||typeof xe.message=="string"&&typeof xe.name=="string"&&!Ea(xe)}function kr(xe){return typeof xe=="number"&&yu(xe)}function _r(xe){if(!qr(xe))return!1;var Ne=nr(xe);return Ne==he||Ne==fe||Ne==Q||Ne==me}function Fr(xe){return typeof xe=="number"&&xe==ea(xe)}function Gr(xe){return typeof xe=="number"&&xe>-1&&xe%1==0&&xe<=I}function qr(xe){var Ne=typeof xe;return xe!=null&&(Ne=="object"||Ne=="function")}function ri(xe){return xe!=null&&typeof xe=="object"}var ei=Pa?Rs(Pa):Yi;function vi(xe,Ne){return xe===Ne||na(xe,Ne,F0(Ne))}function Ei(xe,Ne,gt){return gt=typeof gt=="function"?gt:W,na(xe,Ne,F0(Ne),gt)}function aa(xe){return zi(xe)&&xe!=+xe}function Ni(xe){if(N0(xe))throw new ia(D);return Ma(xe)}function Qi(xe){return xe===null}function qi(xe){return xe==null}function zi(xe){return typeof xe=="number"||ri(xe)&&nr(xe)==oe}function Ea(xe){if(!ri(xe)||nr(xe)!=ge)return!1;var Ne=No(xe);if(Ne===null)return!0;var gt=ba.call(Ne,"constructor")&&Ne.constructor;return typeof gt=="function"&> instanceof gt&&La.call(gt)==Ua}var va=ji?Rs(ji):go;function yo(xe){return Fr(xe)&&xe>=-I&&xe<=I}var Zi=Vo?Rs(Vo):uo;function Ka(xe){return typeof xe=="string"||!ot(xe)&&ri(xe)&&nr(xe)==Ee}function Ba(xe){return typeof xe=="symbol"||ri(xe)&&nr(xe)==Ce}var Ja=Ha?Rs(Ha):Go;function Eo(xe){return xe===W}function xo(xe){return ri(xe)&&Wu(xe)==Oe}function Es(xe){return ri(xe)&&nr(xe)==We}var Oo=zh(Ra),Cs=zh(function(xe,Ne){return xe<=Ne});function pl(xe){if(!xe)return[];if(Rt(xe))return Ka(xe)?Yo(xe):Iu(xe);if(Co&&xe[Co])return ec(xe[Co]());var Ne=Wu(xe),gt=Ne==ie?ql:Ne==Se?Bo:Uo;return gt(xe)}function jo(xe){if(!xe)return xe===0?xe:0;if(xe=Y(xe),xe===E||xe===-E){var Ne=xe<0?-1:1;return Ne*B}return xe===xe?xe:0}function ea(xe){var Ne=jo(xe),gt=Ne%1;return Ne===Ne?gt?Ne-gt:Ne:0}function zl(xe){return xe?Re(ea(xe),0,V):0}function Y(xe){if(typeof xe=="number")return xe;if(Ba(xe))return N;if(qr(xe)){var Ne=typeof xe.valueOf=="function"?xe.valueOf():xe;xe=qr(Ne)?Ne+"":Ne}if(typeof xe!="string")return xe===0?xe:+xe;xe=pc(xe);var gt=rt.test(xe);return gt||Et.test(xe)?Rr(xe.slice(2),gt?2:8):Ut.test(xe)?N:+xe}function U(xe){return yc(xe,Ii(xe))}function ne(xe){return xe?Re(ea(xe),-I,I):xe===0?xe:0}function pe(xe){return xe==null?"":vc(xe)}var ze=rh(function(xe,Ne){if(Ll(Ne)||Rt(Ne)){yc(Ne,ui(Ne),xe);return}for(var gt in Ne)ba.call(Ne,gt)&&C(xe,gt,Ne[gt])}),Ze=rh(function(xe,Ne){yc(Ne,Ii(Ne),xe)}),Je=rh(function(xe,Ne,gt,$t){yc(Ne,Ii(Ne),xe,$t)}),ht=rh(function(xe,Ne,gt,$t){yc(Ne,ui(Ne),xe,$t)}),mt=Nc(Ae);function zt(xe,Ne){var gt=ya(xe);return Ne==null?gt:te(gt,Ne)}var jt=ga(function(xe,Ne){xe=ro(xe);var gt=-1,$t=Ne.length,pn=$t>2?Ne[2]:W;for(pn&&wu(Ne[0],Ne[1],pn)&&($t=1);++gt<$t;)for(var Rn=Ne[gt],ar=Ii(Rn),fr=-1,zr=ar.length;++fr1),Rn}),yc(xe,zf(xe),gt),$t&&(gt=Ue(gt,w|y|_,_v));for(var pn=Ne.length;pn--;)Sp(gt,Ne[pn]);return gt});function ra(xe,Ne){return to(xe,up(ma(Ne)))}var oo=Nc(function(xe,Ne){return xe==null?{}:fs(xe,Ne)});function to(xe,Ne){if(xe==null)return{};var gt=Ta(zf(xe),function($t){return[$t]});return Ne=ma(Ne),Po(xe,gt,function($t,pn){return Ne($t,pn[0])})}function Is(xe,Ne,gt){Ne=th(Ne,xe);var $t=-1,pn=Ne.length;for(pn||(pn=1,xe=W);++$tNe){var $t=xe;xe=Ne,Ne=$t}if(gt||xe%1||Ne%1){var pn=Hu();return ua(xe+pn*(Ne-xe+Ur("1e-"+((pn+"").length-1))),Ne)}return Lo(xe,Ne)}var ms=np(function(xe,Ne,gt){return Ne=Ne.toLowerCase(),xe+(gt?uc(Ne):Ne)});function uc(xe){return Wd(pe(xe).toLowerCase())}function Do(xe){return xe=pe(xe),xe&&xe.replace(Ft,oa).replace(gn,"")}function rs(xe,Ne,gt){xe=pe(xe),Ne=vc(Ne);var $t=xe.length;gt=gt===W?$t:Re(ea(gt),0,$t);var pn=gt;return gt-=Ne.length,gt>=0&&xe.slice(gt,pn)==Ne}function is(xe){return xe=pe(xe),xe&&pt.test(xe)?xe.replace(tt,Mu):xe}function as(xe){return xe=pe(xe),xe&&ft.test(xe)?xe.replace(Qe,"\\$&"):xe}var Vh=np(function(xe,Ne,gt){return xe+(gt?"-":"")+Ne.toLowerCase()}),_c=np(function(xe,Ne,gt){return xe+(gt?" ":"")+Ne.toLowerCase()}),dl=Vg("toLowerCase");function no(xe,Ne,gt){xe=pe(xe),Ne=ea(Ne);var $t=Ne?Hs(xe):0;if(!Ne||$t>=Ne)return xe;var pn=(Ne-$t)/2;return Lh(xs(pn),gt)+xe+Lh(rl(pn),gt)}function Wo(xe,Ne,gt){xe=pe(xe),Ne=ea(Ne);var $t=Ne?Hs(xe):0;return Ne&&$t>>0,gt?(xe=pe(xe),xe&&(typeof Ne=="string"||Ne!=null&&!va(Ne))&&(Ne=vc(Ne),!Ne&&ys(xe))?mh(Yo(xe),0,gt):xe.split(Ne,gt)):[]}var dp=np(function(xe,Ne,gt){return xe+(gt?" ":"")+Wd(Ne)});function Pc(xe,Ne,gt){return xe=pe(xe),gt=gt==null?0:Re(ea(gt),0,xe.length),Ne=vc(Ne),xe.slice(gt,gt+Ne.length)==Ne}function Zp(xe,Ne,gt){var $t=cn.templateSettings;gt&&wu(xe,Ne,gt)&&(Ne=W),xe=pe(xe),Ne=Je({},Ne,$t,O0);var pn=Je({},Ne.imports,$t.imports,O0),Rn=ui(pn),ar=Vs(pn,Rn),fr,zr,ci=0,hi=Ne.interpolate||St,mi="__p += '",Ui=mu((Ne.escape||St).source+"|"+hi.source+"|"+(hi===Nt?vt:St).source+"|"+(Ne.evaluate||St).source+"|$","g"),la="//# sourceURL="+(ba.call(Ne,"sourceURL")?(Ne.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++dn+"]")+` +`)}function Gg(xe){return ot(xe)||Ke(xe)||!!(Xa&&xe&&xe[Xa])}function Pu(xe,Ne){var gt=typeof xe;return Ne=Ne??I,!!Ne&&(gt=="number"||gt!="symbol"&&Bt.test(xe))&&xe>-1&&xe%1==0&&xe0){if(++Ne>=S)return arguments[0]}else Ne=0;return xe.apply(W,arguments)}}function Dp(xe,Ne){var gt=-1,$t=xe.length,pn=$t-1;for(Ne=Ne===W?$t:Ne;++gt1?xe[Ne-1]:W;return gt=typeof gt=="function"?(xe.pop(),gt):W,jc(xe,gt)});function Xu(xe){var Ne=cn(xe);return Ne.__chain__=!0,Ne}function Z0(xe,Ne){return Ne(xe),xe}function vh(xe,Ne){return Ne(xe)}var Cc=Nc(function(xe){var Ne=xe.length,gt=Ne?xe[0]:0,$t=this.__wrapped__,pn=function(Rn){return Ae(Rn,xe)};return Ne>1||this.__actions__.length||!($t instanceof ta)||!Pu(gt)?this.thru(pn):($t=$t.slice(gt,+gt+(Ne?1:0)),$t.__actions__.push({func:vh,args:[pn],thisArg:W}),new io($t,this.__chain__).thru(function(Rn){return Ne&&!Rn.length&&Rn.push(W),Rn}))});function Vf(){return Xu(this)}function lp(){return new io(this.value(),this.__chain__)}function ff(){this.__values__===W&&(this.__values__=pl(this.value()));var xe=this.__index__>=this.__values__.length,Ne=xe?W:this.__values__[this.__index__++];return{done:xe,value:Ne}}function pf(){return this}function ih(xe){for(var Ne,gt=this;gt instanceof So;){var $t=Fp(gt);$t.__index__=0,$t.__values__=W,Ne?pn.__wrapped__=$t:Ne=$t;var pn=$t;gt=gt.__wrapped__}return pn.__wrapped__=xe,Ne}function pm(){var xe=this.__wrapped__;if(xe instanceof ta){var Ne=xe;return this.__actions__.length&&(Ne=new ta(this)),Ne=Ne.reverse(),Ne.__actions__.push({func:vh,args:[Pd],thisArg:W}),new io(Ne,this.__chain__)}return this.thru(Pd)}function dm(){return Ef(this.__wrapped__,this.__actions__)}var gm=Ks(function(xe,Ne,gt){ba.call(xe,gt)?++xe[gt]:ve(xe,gt,1)});function mm(xe,Ne,gt){var $t=ot(xe)?os:Ut;return gt&&wu(xe,Ne,gt)&&(Ne=W),$t(xe,ma(Ne,3))}function zv(xe,Ne){var gt=ot(xe)?To:tn;return gt(xe,ma(Ne,3))}var Vp=qg(Ev),Rd=qg(Md);function $0(xe,Ne){return Yt(Hp(xe,Ne),1)}function df(xe,Ne){return Yt(Hp(xe,Ne),E)}function qp(xe,Ne,gt){return gt=gt===W?1:ea(gt),Yt(Hp(xe,Ne),gt)}function co(xe,Ne){var gt=ot(xe)?lo:Ct;return gt(xe,ma(Ne,3))}function Y0(xe,Ne){var gt=ot(xe)?Ki:Mt;return gt(xe,ma(Ne,3))}var Fd=Ks(function(xe,Ne,gt){ba.call(xe,gt)?xe[gt].push(Ne):ve(xe,gt,[Ne])});function yh(xe,Ne,gt,$t){xe=Rt(xe)?xe:Uo(xe),gt=gt&&!$t?ea(gt):0;var pn=xe.length;return gt<0&&(gt=Sa(pn+gt,0)),Ka(xe)?gt<=pn&&xe.indexOf(Ne,gt)>-1:!!pn&&Ds(xe,Ne,gt)>-1}var xh=ga(function(xe,Ne,gt){var $t=-1,pn=typeof Ne=="function",Rn=Rt(xe)?Zr(xe.length):[];return Ct(xe,function(ar){Rn[++$t]=pn?Oa(Ne,ar,gt):Nr(ar,Ne,gt)}),Rn}),gf=Ks(function(xe,Ne,gt){ve(xe,gt,Ne)});function Hp(xe,Ne){var gt=ot(xe)?Ta:wa;return gt(xe,ma(Ne,3))}function X0(xe,Ne,gt,$t){return xe==null?[]:(ot(Ne)||(Ne=Ne==null?[]:[Ne]),gt=$t?W:gt,ot(gt)||(gt=gt==null?[]:[gt]),Hi(xe,Ne,gt))}var Ov=Ks(function(xe,Ne,gt){xe[gt?0:1].push(Ne)},function(){return[[],[]]});function Dv(xe,Ne,gt){var $t=ot(xe)?Bl:Vl,pn=arguments.length<3;return $t(xe,ma(Ne,4),gt,pn,Ct)}function Bd(xe,Ne,gt){var $t=ot(xe)?Ql:Vl,pn=arguments.length<3;return $t(xe,ma(Ne,4),gt,pn,Mt)}function Nd(xe,Ne){var gt=ot(xe)?To:tn;return gt(xe,up(ma(Ne,3)))}function vm(xe){var Ne=ot(xe)?X:Ch;return Ne(xe)}function jd(xe,Ne,gt){(gt?wu(xe,Ne,gt):Ne===W)?Ne=1:Ne=ea(Ne);var $t=ot(xe)?R:Cu;return $t(xe,Ne)}function Ud(xe){var Ne=ot(xe)?i:nf;return Ne(xe)}function Nh(xe){if(xe==null)return 0;if(Rt(xe))return Ka(xe)?Hs(xe):xe.length;var Ne=Wu(xe);return Ne==ie||Ne==Se?xe.size:ca(xe).length}function mf(xe,Ne,gt){var $t=ot(xe)?ss:Ap;return gt&&wu(xe,Ne,gt)&&(Ne=W),$t(xe,ma(Ne,3))}var Vd=ga(function(xe,Ne){if(xe==null)return[];var gt=Ne.length;return gt>1&&wu(xe,Ne[0],Ne[1])?Ne=[]:gt>2&&wu(Ne[0],Ne[1],Ne[2])&&(Ne=[Ne[0]]),Hi(xe,Yt(Ne,1),[])}),ah=Ko||function(){return Cr.Date.now()};function K0(xe,Ne){if(typeof Ne!="function")throw new ls(L);return xe=ea(xe),function(){if(--xe<1)return Ne.apply(this,arguments)}}function ds(xe,Ne,gt){return Ne=gt?W:Ne,Ne=xe&&Ne==null?xe.length:Ne,Oh(xe,m,W,W,W,W,Ne)}function qd(xe,Ne){var gt;if(typeof Ne!="function")throw new ls(L);return xe=ea(xe),function(){return--xe>0&&(gt=Ne.apply(this,arguments)),xe<=1&&(Ne=W),gt}}var zo=ga(function(xe,Ne,gt){var $t=n;if(gt.length){var pn=qo(gt,ip(zo));$t|=h}return Oh(xe,$t,Ne,gt,pn)}),J0=ga(function(xe,Ne,gt){var $t=n|l;if(gt.length){var pn=qo(gt,ip(J0));$t|=h}return Oh(Ne,$t,xe,gt,pn)});function Hd(xe,Ne,gt){Ne=gt?W:Ne;var $t=Oh(xe,s,W,W,W,W,W,Ne);return $t.placeholder=Hd.placeholder,$t}function Q0(xe,Ne,gt){Ne=gt?W:Ne;var $t=Oh(xe,c,W,W,W,W,W,Ne);return $t.placeholder=Q0.placeholder,$t}function eg(xe,Ne,gt){var $t,pn,Rn,ar,fr,zr,ci=0,hi=!1,mi=!1,Ui=!0;if(typeof xe!="function")throw new ls(L);Ne=Y(Ne)||0,qr(gt)&&(hi=!!gt.leading,mi="maxWait"in gt,Rn=mi?Sa(Y(gt.maxWait)||0,Ne):Rn,Ui="trailing"in gt?!!gt.trailing:Ui);function la(Ru){var Hf=$t,Xp=pn;return $t=pn=W,ci=Ru,ar=xe.apply(Xp,Hf),ar}function Ca(Ru){return ci=Ru,fr=Op(_o,Ne),hi?la(Ru):ar}function so(Ru){var Hf=Ru-zr,Xp=Ru-ci,h3=Ne-Hf;return mi?ua(h3,Rn-Xp):h3}function Ia(Ru){var Hf=Ru-zr,Xp=Ru-ci;return zr===W||Hf>=Ne||Hf<0||mi&&Xp>=Rn}function _o(){var Ru=ah();if(Ia(Ru))return Ro(Ru);fr=Op(_o,so(Ru))}function Ro(Ru){return fr=W,Ui&&$t?la(Ru):($t=pn=W,ar)}function Hh(){fr!==W&&vd(fr),ci=0,$t=zr=pn=fr=W}function sh(){return fr===W?ar:Ro(ah())}function Gh(){var Ru=ah(),Hf=Ia(Ru);if($t=arguments,pn=this,zr=Ru,Hf){if(fr===W)return Ca(zr);if(mi)return vd(fr),fr=Op(_o,Ne),la(zr)}return fr===W&&(fr=Op(_o,Ne)),ar}return Gh.cancel=Hh,Gh.flush=sh,Gh}var ym=ga(function(xe,Ne){return dt(xe,1,Ne)}),tg=ga(function(xe,Ne,gt){return dt(xe,Y(Ne)||0,gt)});function jh(xe){return Oh(xe,k)}function zu(xe,Ne){if(typeof xe!="function"||Ne!=null&&typeof Ne!="function")throw new ls(L);var gt=function(){var $t=arguments,pn=Ne?Ne.apply(this,$t):$t[0],Rn=gt.cache;if(Rn.has(pn))return Rn.get(pn);var ar=xe.apply(this,$t);return gt.cache=Rn.set(pn,ar)||Rn,ar};return gt.cache=new(zu.Cache||Mo),gt}zu.Cache=Mo;function up(xe){if(typeof xe!="function")throw new ls(L);return function(){var Ne=arguments;switch(Ne.length){case 0:return!xe.call(this);case 1:return!xe.call(this,Ne[0]);case 2:return!xe.call(this,Ne[0],Ne[1]);case 3:return!xe.call(this,Ne[0],Ne[1],Ne[2])}return!xe.apply(this,Ne)}}function Us(xe){return qd(2,xe)}var cp=M0(function(xe,Ne){Ne=Ne.length==1&&ot(Ne[0])?Ta(Ne[0],Rs(ma())):Ta(Yt(Ne,1),Rs(ma()));var gt=Ne.length;return ga(function($t){for(var pn=-1,Rn=ua($t.length,gt);++pn=Ne}),Ke=si(function(){return arguments}())?si:function(xe){return ri(xe)&&ba.call(xe,"callee")&&!Eu.call(xe,"callee")},ot=Zr.isArray,_t=Ti?Rs(Ti):_i;function Rt(xe){return xe!=null&&Gr(xe.length)&&!_r(xe)}function Kt(xe){return ri(xe)&&Rt(xe)}function nn(xe){return xe===!0||xe===!1||ri(xe)&&nr(xe)==Z}var sn=_s||km,yn=Wi?Rs(Wi):Gi;function fn(xe){return ri(xe)&&xe.nodeType===1&&!Ea(xe)}function On(xe){if(xe==null)return!0;if(Rt(xe)&&(ot(xe)||typeof xe=="string"||typeof xe.splice=="function"||sn(xe)||Ja(xe)||Ke(xe)))return!xe.length;var Ne=Wu(xe);if(Ne==ie||Ne==Se)return!xe.size;if(Ll(xe))return!ca(xe).length;for(var gt in xe)if(ba.call(xe,gt))return!1;return!0}function jn(xe,Ne){return Pi(xe,Ne)}function sr(xe,Ne,gt){gt=typeof gt=="function"?gt:W;var $t=gt?gt(xe,Ne):W;return $t===W?Pi(xe,Ne,W,gt):!!$t}function ir(xe){if(!ri(xe))return!1;var Ne=nr(xe);return Ne==se||Ne==ae||typeof xe.message=="string"&&typeof xe.name=="string"&&!Ea(xe)}function kr(xe){return typeof xe=="number"&&yu(xe)}function _r(xe){if(!qr(xe))return!1;var Ne=nr(xe);return Ne==he||Ne==fe||Ne==Q||Ne==me}function Fr(xe){return typeof xe=="number"&&xe==ea(xe)}function Gr(xe){return typeof xe=="number"&&xe>-1&&xe%1==0&&xe<=I}function qr(xe){var Ne=typeof xe;return xe!=null&&(Ne=="object"||Ne=="function")}function ri(xe){return xe!=null&&typeof xe=="object"}var ei=Pa?Rs(Pa):Yi;function vi(xe,Ne){return xe===Ne||na(xe,Ne,F0(Ne))}function Ei(xe,Ne,gt){return gt=typeof gt=="function"?gt:W,na(xe,Ne,F0(Ne),gt)}function aa(xe){return zi(xe)&&xe!=+xe}function Ni(xe){if(N0(xe))throw new ia(D);return Ma(xe)}function Qi(xe){return xe===null}function qi(xe){return xe==null}function zi(xe){return typeof xe=="number"||ri(xe)&&nr(xe)==oe}function Ea(xe){if(!ri(xe)||nr(xe)!=ge)return!1;var Ne=No(xe);if(Ne===null)return!0;var gt=ba.call(Ne,"constructor")&&Ne.constructor;return typeof gt=="function"&> instanceof gt&&La.call(gt)==Ua}var va=ji?Rs(ji):go;function yo(xe){return Fr(xe)&&xe>=-I&&xe<=I}var Zi=Vo?Rs(Vo):uo;function Ka(xe){return typeof xe=="string"||!ot(xe)&&ri(xe)&&nr(xe)==Ee}function Ba(xe){return typeof xe=="symbol"||ri(xe)&&nr(xe)==Ce}var Ja=Ha?Rs(Ha):Go;function Eo(xe){return xe===W}function xo(xe){return ri(xe)&&Wu(xe)==Oe}function Es(xe){return ri(xe)&&nr(xe)==We}var Oo=zh(Ra),Cs=zh(function(xe,Ne){return xe<=Ne});function pl(xe){if(!xe)return[];if(Rt(xe))return Ka(xe)?Yo(xe):Iu(xe);if(Co&&xe[Co])return ec(xe[Co]());var Ne=Wu(xe),gt=Ne==ie?ql:Ne==Se?Bo:Uo;return gt(xe)}function jo(xe){if(!xe)return xe===0?xe:0;if(xe=Y(xe),xe===E||xe===-E){var Ne=xe<0?-1:1;return Ne*B}return xe===xe?xe:0}function ea(xe){var Ne=jo(xe),gt=Ne%1;return Ne===Ne?gt?Ne-gt:Ne:0}function zl(xe){return xe?Re(ea(xe),0,V):0}function Y(xe){if(typeof xe=="number")return xe;if(Ba(xe))return N;if(qr(xe)){var Ne=typeof xe.valueOf=="function"?xe.valueOf():xe;xe=qr(Ne)?Ne+"":Ne}if(typeof xe!="string")return xe===0?xe:+xe;xe=pc(xe);var gt=rt.test(xe);return gt||Et.test(xe)?Rr(xe.slice(2),gt?2:8):jt.test(xe)?N:+xe}function U(xe){return yc(xe,Ii(xe))}function ne(xe){return xe?Re(ea(xe),-I,I):xe===0?xe:0}function pe(xe){return xe==null?"":vc(xe)}var ze=rh(function(xe,Ne){if(Ll(Ne)||Rt(Ne)){yc(Ne,ui(Ne),xe);return}for(var gt in Ne)ba.call(Ne,gt)&&C(xe,gt,Ne[gt])}),Ze=rh(function(xe,Ne){yc(Ne,Ii(Ne),xe)}),Je=rh(function(xe,Ne,gt,$t){yc(Ne,Ii(Ne),xe,$t)}),ht=rh(function(xe,Ne,gt,$t){yc(Ne,ui(Ne),xe,$t)}),mt=Nc(Ae);function zt(xe,Ne){var gt=ya(xe);return Ne==null?gt:te(gt,Ne)}var Nt=ga(function(xe,Ne){xe=ro(xe);var gt=-1,$t=Ne.length,pn=$t>2?Ne[2]:W;for(pn&&wu(Ne[0],Ne[1],pn)&&($t=1);++gt<$t;)for(var Rn=Ne[gt],ar=Ii(Rn),fr=-1,zr=ar.length;++fr1),Rn}),yc(xe,zf(xe),gt),$t&&(gt=Ue(gt,w|y|_,_v));for(var pn=Ne.length;pn--;)Sp(gt,Ne[pn]);return gt});function ra(xe,Ne){return to(xe,up(ma(Ne)))}var oo=Nc(function(xe,Ne){return xe==null?{}:fs(xe,Ne)});function to(xe,Ne){if(xe==null)return{};var gt=Ta(zf(xe),function($t){return[$t]});return Ne=ma(Ne),Po(xe,gt,function($t,pn){return Ne($t,pn[0])})}function Is(xe,Ne,gt){Ne=th(Ne,xe);var $t=-1,pn=Ne.length;for(pn||(pn=1,xe=W);++$tNe){var $t=xe;xe=Ne,Ne=$t}if(gt||xe%1||Ne%1){var pn=Hu();return ua(xe+pn*(Ne-xe+Ur("1e-"+((pn+"").length-1))),Ne)}return Lo(xe,Ne)}var ms=np(function(xe,Ne,gt){return Ne=Ne.toLowerCase(),xe+(gt?uc(Ne):Ne)});function uc(xe){return Wd(pe(xe).toLowerCase())}function Do(xe){return xe=pe(xe),xe&&xe.replace(Ft,oa).replace(gn,"")}function rs(xe,Ne,gt){xe=pe(xe),Ne=vc(Ne);var $t=xe.length;gt=gt===W?$t:Re(ea(gt),0,$t);var pn=gt;return gt-=Ne.length,gt>=0&&xe.slice(gt,pn)==Ne}function is(xe){return xe=pe(xe),xe&&ft.test(xe)?xe.replace(tt,Mu):xe}function as(xe){return xe=pe(xe),xe&&pt.test(xe)?xe.replace(Qe,"\\$&"):xe}var Vh=np(function(xe,Ne,gt){return xe+(gt?"-":"")+Ne.toLowerCase()}),_c=np(function(xe,Ne,gt){return xe+(gt?" ":"")+Ne.toLowerCase()}),dl=Vg("toLowerCase");function no(xe,Ne,gt){xe=pe(xe),Ne=ea(Ne);var $t=Ne?Hs(xe):0;if(!Ne||$t>=Ne)return xe;var pn=(Ne-$t)/2;return Lh(xs(pn),gt)+xe+Lh(rl(pn),gt)}function Wo(xe,Ne,gt){xe=pe(xe),Ne=ea(Ne);var $t=Ne?Hs(xe):0;return Ne&&$t>>0,gt?(xe=pe(xe),xe&&(typeof Ne=="string"||Ne!=null&&!va(Ne))&&(Ne=vc(Ne),!Ne&&ys(xe))?mh(Yo(xe),0,gt):xe.split(Ne,gt)):[]}var dp=np(function(xe,Ne,gt){return xe+(gt?" ":"")+Wd(Ne)});function Pc(xe,Ne,gt){return xe=pe(xe),gt=gt==null?0:Re(ea(gt),0,xe.length),Ne=vc(Ne),xe.slice(gt,gt+Ne.length)==Ne}function Zp(xe,Ne,gt){var $t=cn.templateSettings;gt&&wu(xe,Ne,gt)&&(Ne=W),xe=pe(xe),Ne=Je({},Ne,$t,O0);var pn=Je({},Ne.imports,$t.imports,O0),Rn=ui(pn),ar=Vs(pn,Rn),fr,zr,ci=0,hi=Ne.interpolate||St,mi="__p += '",Ui=mu((Ne.escape||St).source+"|"+hi.source+"|"+(hi===Vt?vt:St).source+"|"+(Ne.evaluate||St).source+"|$","g"),la="//# sourceURL="+(ba.call(Ne,"sourceURL")?(Ne.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++dn+"]")+` `;xe.replace(Ui,function(Ia,_o,Ro,Hh,sh,Gh){return Ro||(Ro=Hh),mi+=xe.slice(ci,Gh).replace(Jt,$a),_o&&(fr=!0,mi+=`' + __e(`+_o+`) + '`),sh&&(zr=!0,mi+=`'; @@ -100,23 +100,23 @@ __p += '`),Ro&&(mi+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+mi+`return __p -}`;var so=vf(function(){return sa(Rn,la+"return "+mi).apply(W,ar)});if(so.source=mi,ir(so))throw so;return so}function $p(xe){return pe(xe).toLowerCase()}function ag(xe){return pe(xe).toUpperCase()}function xm(xe,Ne,gt){if(xe=pe(xe),xe&&(gt||Ne===W))return pc(xe);if(!xe||!(Ne=vc(Ne)))return xe;var $t=Yo(xe),pn=Yo(Ne),Rn=gh($t,pn),ar=Fo($t,pn)+1;return mh($t,Rn,ar).join("")}function Yp(xe,Ne,gt){if(xe=pe(xe),xe&&(gt||Ne===W))return xe.slice(0,tc(xe)+1);if(!xe||!(Ne=vc(Ne)))return xe;var $t=Yo(xe),pn=Fo($t,Yo(Ne))+1;return mh($t,0,pn).join("")}function _m(xe,Ne,gt){if(xe=pe(xe),xe&&(gt||Ne===W))return xe.replace(yt,"");if(!xe||!(Ne=vc(Ne)))return xe;var $t=Yo(xe),pn=gh($t,Yo(Ne));return mh($t,pn).join("")}function bm(xe,Ne){var gt=A,$t=v;if(qr(Ne)){var pn="separator"in Ne?Ne.separator:pn;gt="length"in Ne?ea(Ne.length):gt,$t="omission"in Ne?vc(Ne.omission):$t}xe=pe(xe);var Rn=xe.length;if(ys(xe)){var ar=Yo(xe);Rn=ar.length}if(gt>=Rn)return xe;var fr=gt-Hs($t);if(fr<1)return $t;var zr=ar?mh(ar,0,fr).join(""):xe.slice(0,fr);if(pn===W)return zr+$t;if(ar&&(fr+=zr.length-fr),va(pn)){if(xe.slice(fr).search(pn)){var ci,hi=zr;for(pn.global||(pn=mu(pn.source,pe(Lt.exec(pn))+"g")),pn.lastIndex=0;ci=pn.exec(hi);)var mi=ci.index;zr=zr.slice(0,mi===W?fr:mi)}}else if(xe.indexOf(vc(pn),fr)!=fr){var Ui=zr.lastIndexOf(pn);Ui>-1&&(zr=zr.slice(0,Ui))}return zr+$t}function wm(xe){return xe=pe(xe),xe&&nt.test(xe)?xe.replace(Ge,nc):xe}var Tm=np(function(xe,Ne,gt){return xe+(gt?" ":"")+Ne.toUpperCase()}),Wd=Vg("toUpperCase");function Ls(xe,Ne,gt){return xe=pe(xe),Ne=gt?W:Ne,Ne===W?qs(xe)?_l(xe):Za(xe):xe.match(Ne)||[]}var vf=ga(function(xe,Ne){try{return Oa(xe,W,Ne)}catch(gt){return ir(gt)?gt:new ia(gt)}}),og=Nc(function(xe,Ne){return lo(Ne,function(gt){gt=Ga(gt),ve(xe,gt,zo(xe[gt],xe))}),xe});function _h(xe){var Ne=xe==null?0:xe.length,gt=ma();return xe=Ne?Ta(xe,function($t){if(typeof $t[1]!="function")throw new ls(L);return[gt($t[0]),$t[1]]}):[],ga(function($t){for(var pn=-1;++pnI)return[];var gt=V,$t=ua(xe,V);Ne=ma(Ne),xe-=V;for(var pn=ju($t,Ne);++gt0||Ne<0)?new ta(gt):(xe<0?gt=gt.takeRight(-xe):xe&&(gt=gt.drop(xe)),Ne!==W&&(Ne=ea(Ne),gt=Ne<0?gt.dropRight(-Ne):gt.take(Ne-xe)),gt)},ta.prototype.takeRightWhile=function(xe){return this.reverse().takeWhile(xe).reverse()},ta.prototype.toArray=function(){return this.take(V)},Vn(ta.prototype,function(xe,Ne){var gt=/^(?:filter|find|map|reject)|While$/.test(Ne),$t=/^(?:head|last)$/.test(Ne),pn=cn[$t?"take"+(Ne=="last"?"Right":""):Ne],Rn=$t||/^find/.test(Ne);pn&&(cn.prototype[Ne]=function(){var ar=this.__wrapped__,fr=$t?[1]:arguments,zr=ar instanceof ta,ci=fr[0],hi=zr||ot(ar),mi=function(_o){var Ro=pn.apply(cn,ws([_o],fr));return $t&&Ui?Ro[0]:Ro};hi&>&&typeof ci=="function"&&ci.length!=1&&(zr=hi=!1);var Ui=this.__chain__,la=!!this.__actions__.length,Ca=Rn&&!Ui,so=zr&&!la;if(!Rn&&hi){ar=so?ar:new ta(this);var Ia=xe.apply(ar,fr);return Ia.__actions__.push({func:vh,args:[mi],thisArg:W}),new io(Ia,Ui)}return Ca&&so?xe.apply(this,fr):(Ia=this.thru(mi),Ca?$t?Ia.value()[0]:Ia.value():Ia)})}),lo(["pop","push","shift","sort","splice","unshift"],function(xe){var Ne=Ws[xe],gt=/^(?:push|sort|unshift)$/.test(xe)?"tap":"thru",$t=/^(?:pop|shift)$/.test(xe);cn.prototype[xe]=function(){var pn=arguments;if($t&&!this.__chain__){var Rn=this.value();return Ne.apply(ot(Rn)?Rn:[],pn)}return this[gt](function(ar){return Ne.apply(ot(ar)?ar:[],pn)})}}),Vn(ta.prototype,function(xe,Ne){var gt=cn[Ne];if(gt){var $t=gt.name+"";ba.call(Na,$t)||(Na[$t]=[]),Na[$t].push({name:Ne,func:gt})}}),Na[Mp(W,l).name]=[{name:"wrapper",func:W}],ta.prototype.clone=Qo,ta.prototype.reverse=ac,ta.prototype.value=yi,cn.prototype.at=Cc,cn.prototype.chain=Vf,cn.prototype.commit=lp,cn.prototype.next=ff,cn.prototype.plant=ih,cn.prototype.reverse=pm,cn.prototype.toJSON=cn.prototype.valueOf=cn.prototype.value=dm,cn.prototype.first=cn.prototype.head,Co&&(cn.prototype[Co]=pf),cn},Gs=Hl();gi?((gi.exports=Gs)._=Gs,Jr._=Gs):Cr._=Gs}).call(Uv)})($x,$x.exports);var A4=$x.exports,m8={exports:{}};(function(O,z){/*! For license information please see plotly.min.js.LICENSE.txt */(function(W,ce){O.exports=ce()})(self,function(){return function(){var W={6713:function(D,L,t){var b=t(34809),d={"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":"overflow:hidden;","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(var e in d){var w=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");b.addStyleRule(w,d[e])}},14187:function(D,L,t){D.exports=t(47908)},20273:function(D,L,t){D.exports=t(58218)},6457:function(D,L,t){D.exports=t(89362)},15849:function(D,L,t){D.exports=t(53794)},38847:function(D,L,t){D.exports=t(29698)},7659:function(D,L,t){D.exports=t(51252)},60089:function(D,L,t){D.exports=t(48050)},22084:function(D,L,t){D.exports=t(58075)},35892:function(D,L,t){D.exports=t(9419)},81204:function(D,L,t){D.exports=t(28128)},55857:function(D,L,t){D.exports=t(47050)},12862:function(D,L,t){D.exports=t(91405)},97629:function(D,L,t){D.exports=t(34406)},67549:function(D,L,t){D.exports=t(17430)},2660:function(D,L,t){D.exports=t(91995)},86071:function(D,L,t){D.exports=t(81264)},66200:function(D,L,t){D.exports=t(42849)},53446:function(D,L,t){D.exports=t(52213)},86899:function(D,L,t){D.exports=t(91132)},13430:function(D,L,t){D.exports=t(50453)},21548:function(D,L,t){D.exports=t(29251)},53939:function(D,L,t){D.exports=t(72892)},1902:function(D,L,t){D.exports=t(74461)},29096:function(D,L,t){D.exports=t(66143)},23820:function(D,L,t){D.exports=t(81955)},82017:function(D,L,t){D.exports=t(36858)},113:function(D,L,t){D.exports=t(92106)},20260:function(D,L,t){var b=t(67549);b.register([t(20273),t(15849),t(21548),t(1902),t(29096),t(23820),t(12862),t(1639),t(10067),t(53446),t(31014),t(113),t(78170),t(8202),t(92382),t(82017),t(86899),t(54357),t(66903),t(90594),t(71680),t(7412),t(55857),t(784),t(74221),t(22084),t(44001),t(97281),t(12345),t(53939),t(29117),t(5410),t(5057),t(81204),t(86071),t(14226),t(35892),t(2660),t(96599),t(28573),t(76832),t(60089),t(51469),t(97629),t(27700),t(7659),t(11780),t(27195),t(6457),t(84639),t(14187),t(66200),t(13430),t(90590),t(38847)]),D.exports=b},28573:function(D,L,t){D.exports=t(25638)},90594:function(D,L,t){D.exports=t(75297)},7412:function(D,L,t){D.exports=t(58859)},27700:function(D,L,t){D.exports=t(12683)},5410:function(D,L,t){D.exports=t(6305)},29117:function(D,L,t){D.exports=t(83910)},78170:function(D,L,t){D.exports=t(49913)},12345:function(D,L,t){D.exports=t(15186)},96599:function(D,L,t){D.exports=t(71760)},54357:function(D,L,t){D.exports=t(17822)},51469:function(D,L,t){D.exports=t(56534)},74221:function(D,L,t){D.exports=t(18070)},44001:function(D,L,t){D.exports=t(52378)},14226:function(D,L,t){D.exports=t(30929)},5057:function(D,L,t){D.exports=t(83866)},11780:function(D,L,t){D.exports=t(66939)},27195:function(D,L,t){D.exports=t(23748)},84639:function(D,L,t){D.exports=t(73304)},1639:function(D,L,t){D.exports=t(12864)},90590:function(D,L,t){D.exports=t(99855)},97281:function(D,L,t){D.exports=t(91450)},784:function(D,L,t){D.exports=t(51943)},8202:function(D,L,t){D.exports=t(80809)},66903:function(D,L,t){D.exports=t(95984)},76832:function(D,L,t){D.exports=t(51671)},92382:function(D,L,t){D.exports=t(47181)},10067:function(D,L,t){D.exports=t(37276)},71680:function(D,L,t){D.exports=t(75703)},31014:function(D,L,t){D.exports=t(38261)},11645:function(D){D.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}]},50222:function(D,L,t){var b=t(11645),d=t(80337),e=t(54826),w=t(78032).templatedArray;t(35081),D.exports=w("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:d({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:b.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:b.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",e.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",e.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",e.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",e.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:d({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},60317:function(D,L,t){var b=t(34809),d=t(29714),e=t(3377).draw;function w(_){var u=_._fullLayout;b.filterVisible(u.annotations).forEach(function(r){var n=d.getFromId(_,r.xref),l=d.getFromId(_,r.yref),o=d.getRefType(r.xref),s=d.getRefType(r.yref);r._extremes={},o==="range"&&y(r,n),s==="range"&&y(r,l)})}function y(_,u){var r,n=u._id,l=n.charAt(0),o=_[l],s=_["a"+l],c=_[l+"ref"],h=_["a"+l+"ref"],x=_["_"+l+"padplus"],m=_["_"+l+"padminus"],g={x:1,y:-1}[l]*_[l+"shift"],k=3*_.arrowsize*_.arrowwidth||0,A=k+g,v=k-g,S=3*_.startarrowsize*_.arrowwidth||0,T=S+g,p=S-g;if(h===c){var M=d.findExtremes(u,[u.r2c(o)],{ppadplus:A,ppadminus:v}),f=d.findExtremes(u,[u.r2c(s)],{ppadplus:Math.max(x,T),ppadminus:Math.max(m,p)});r={min:[M.min[0],f.min[0]],max:[M.max[0],f.max[0]]}}else T=s?T+s:T,p=s?p-s:p,r=d.findExtremes(u,[u.r2c(o)],{ppadplus:Math.max(x,A,T),ppadminus:Math.max(m,v,p)});_._extremes[n]=r}D.exports=function(_){var u=_._fullLayout;if(b.filterVisible(u.annotations).length&&_._fullData.length)return b.syncOrAsync([e,w],_)}},6035:function(D,L,t){var b=t(34809),d=t(33626),e=t(78032).arrayEditor;function w(_,u){var r,n,l,o,s,c,h,x=_._fullLayout.annotations,m=[],g=[],k=[],A=(u||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(_,u){var r,n,l=w(_,u),o=l.on,s=l.off.concat(l.explicitOff),c={},h=_._fullLayout.annotations;if(o.length||s.length){for(r=0;r.6666666666666666?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[St]}for(var qe=!1,$e=["x","y"],Ye=0;Ye<$e.length;Ye++){var _e,De,Be,Ge,tt,nt=$e[Ye],pt=A[nt+"ref"]||nt,At=A["a"+nt+"ref"],wt={x:T,y:p}[nt],Nt=(J+(nt==="x"?0:-90))*Math.PI/180,Ht=ke*Math.cos(Nt),Gt=He*Math.sin(Nt),st=Math.abs(Ht)+Math.abs(Gt),Qe=A[nt+"anchor"],ft=A[nt+"shift"]*(nt==="x"?1:-1),yt=H[nt],Ot=_.getRefType(pt);if(wt&&Ot!=="domain"){var Pt=wt.r2fraction(A[nt]);(Pt<0||Pt>1)&&(At===pt?((Pt=wt.r2fraction(A["a"+nt]))<0||Pt>1)&&(qe=!0):qe=!0),_e=wt._offset+wt.r2p(A[nt]),Ge=.5}else{var at=Ot==="domain";nt==="x"?(Be=A[nt],_e=at?wt._offset+wt._length*Be:_e=I.l+I.w*Be):(Be=1-A[nt],_e=at?wt._offset+wt._length*Be:_e=I.t+I.h*Be),Ge=A.showarrow?.5:Be}if(A.showarrow){yt.head=_e;var lt=A["a"+nt];if(tt=Ht*Fe(.5,A.xanchor)-Gt*Fe(.5,A.yanchor),At===pt){var Xe=_.getRefType(At);Xe==="domain"?(nt==="y"&&(lt=1-lt),yt.tail=wt._offset+wt._length*lt):Xe==="paper"?nt==="y"?(lt=1-lt,yt.tail=I.t+I.h*lt):yt.tail=I.l+I.w*lt:yt.tail=wt._offset+wt.r2p(lt),De=tt}else yt.tail=_e+lt,De=tt+lt;yt.text=yt.tail+tt;var ut=E[nt==="x"?"width":"height"];if(pt==="paper"&&(yt.head=w.constrain(yt.head,1,ut-1)),At==="pixel"){var Tt=-Math.max(yt.tail-3,yt.text),vt=Math.min(yt.tail+3,yt.text)-ut;Tt>0?(yt.tail+=Tt,yt.text+=Tt):vt>0&&(yt.tail-=vt,yt.text-=vt)}yt.tail+=ft,yt.head+=ft}else De=tt=st*Fe(Ge,Qe),yt.text=_e+tt;yt.text+=ft,tt+=ft,De+=ft,A["_"+nt+"padplus"]=st/2+De,A["_"+nt+"padminus"]=st/2-De,A["_"+nt+"size"]=st,A["_"+nt+"shift"]=tt}if(qe)se.remove();else{var Lt=0,Ut=0;if(A.align!=="left"&&(Lt=(de-Ve)*(A.align==="center"?.5:1)),A.valign!=="top"&&(Ut=(Me-Pe)*(A.valign==="middle"?.5:1)),We)Oe.select("svg").attr({x:ie+Lt-1,y:ie+Ut}).call(r.setClipUrl,le?ee:null,k);else{var rt=ie+Ut-Ie.top,et=ie+Lt-Ie.left;be.call(l.positionText,et,rt).call(r.setClipUrl,le?ee:null,k)}ge.select("rect").call(r.setRect,ie,ie,de,Me),oe.call(r.setRect,he/2,he/2,ke-he,He-he),se.call(r.setTranslate,Math.round(H.x.text-ke/2),Math.round(H.y.text-He/2)),Z.attr({transform:"rotate("+J+","+H.x.text+","+H.y.text+")"});var Et,Bt=function(Ft,St){Q.selectAll(".annotation-arrow-g").remove();var Jt=H.x.head,qt=H.y.head,en=H.x.tail+Ft,Wt=H.y.tail+St,Zt=H.x.text+Ft,on=H.y.text+St,un=w.rotationXYMatrix(J,Zt,on),Pn=w.apply2DTransform(un),Dn=w.apply2DTransform2(un),In=+oe.attr("width"),mn=+oe.attr("height"),En=Zt-.5*In,Kn=En+In,Ln=on-.5*mn,Tn=Ln+mn,Fn=[[En,Ln,En,Tn],[En,Tn,Kn,Tn],[Kn,Tn,Kn,Ln],[Kn,Ln,En,Ln]].map(Dn);if(!Fn.reduce(function(Ar,xr){return Ar^!!w.segmentsIntersect(Jt,qt,Jt+1e6,qt+1e6,xr[0],xr[1],xr[2],xr[3])},!1)){Fn.forEach(function(Ar){var xr=w.segmentsIntersect(en,Wt,Jt,qt,Ar[0],Ar[1],Ar[2],Ar[3]);xr&&(en=xr.x,Wt=xr.y)});var wn=A.arrowwidth,zn=A.arrowcolor,Jn=A.arrowside,$n=Q.append("g").style({opacity:u.opacity(zn)}).classed("annotation-arrow-g",!0),vr=$n.append("path").attr("d","M"+en+","+Wt+"L"+Jt+","+qt).style("stroke-width",wn+"px").call(u.stroke,u.rgb(zn));if(h(vr,Jn,A),B.annotationPosition&&vr.node().parentNode&&!S){var Qn=Jt,lr=qt;if(A.standoff){var hr=Math.sqrt(Math.pow(Jt-en,2)+Math.pow(qt-Wt,2));Qn+=A.standoff*(en-Jt)/hr,lr+=A.standoff*(Wt-qt)/hr}var jr,ni,Or=$n.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(en-Qn)+","+(Wt-lr),transform:y(Qn,lr)}).style("stroke-width",wn+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");s.init({element:Or.node(),gd:k,prepFn:function(){var Ar=r.getTranslate(se);jr=Ar.x,ni=Ar.y,T&&T.autorange&&V(T._name+".autorange",!0),p&&p.autorange&&V(p._name+".autorange",!0)},moveFn:function(Ar,xr){var Qr=Pn(jr,ni),kn=Qr[0]+Ar,Cn=Qr[1]+xr;se.call(r.setTranslate,kn,Cn),j("x",m(T,Ar,"x",I,A)),j("y",m(p,xr,"y",I,A)),A.axref===A.xref&&j("ax",m(T,Ar,"ax",I,A)),A.ayref===A.yref&&j("ay",m(p,xr,"ay",I,A)),$n.attr("transform",y(Ar,xr)),Z.attr({transform:"rotate("+J+","+kn+","+Cn+")"})},doneFn:function(){d.call("_guiRelayout",k,$());var Ar=document.querySelector(".js-notes-box-panel");Ar&&Ar.redraw(Ar.selectedObj)}})}}};A.showarrow&&Bt(0,0),K&&s.init({element:se.node(),gd:k,prepFn:function(){Et=Z.attr("transform")},moveFn:function(Ft,St){var Jt="pointer";if(A.showarrow)A.axref===A.xref?j("ax",m(T,Ft,"ax",I,A)):j("ax",A.ax+Ft),A.ayref===A.yref?j("ay",m(p,St,"ay",I.w,A)):j("ay",A.ay+St),Bt(Ft,St);else{if(S)return;var qt,en;if(T)qt=m(T,Ft,"x",I,A);else{var Wt=A._xsize/I.w,Zt=A.x+(A._xshift-A.xshift)/I.w-Wt/2;qt=s.align(Zt+Ft/I.w,Wt,0,1,A.xanchor)}if(p)en=m(p,St,"y",I,A);else{var on=A._ysize/I.h,un=A.y-(A._yshift+A.yshift)/I.h-on/2;en=s.align(un-St/I.h,on,0,1,A.yanchor)}j("x",qt),j("y",en),T&&p||(Jt=s.getCursor(T?.5:qt,p?.5:en,A.xanchor,A.yanchor))}Z.attr({transform:y(Ft,St)+Et}),o(se,Jt)},clickFn:function(Ft,St){A.captureevents&&k.emit("plotly_clickannotation",Se(St))},doneFn:function(){o(se),d.call("_guiRelayout",k,$());var Ft=document.querySelector(".js-notes-box-panel");Ft&&Ft.redraw(Ft.selectedObj)}})}}}D.exports={draw:function(k){var A=k._fullLayout;A._infolayer.selectAll(".annotation").remove();for(var v=0;v=0,S=n.indexOf("end")>=0,T=m.backoff*k+l.standoff,p=g.backoff*A+l.startstandoff;if(x.nodeName==="line"){o={x:+r.attr("x1"),y:+r.attr("y1")},s={x:+r.attr("x2"),y:+r.attr("y2")};var M=o.x-s.x,f=o.y-s.y;if(h=(c=Math.atan2(f,M))+Math.PI,T&&p&&T+p>Math.sqrt(M*M+f*f))return void Q();if(T){if(T*T>M*M+f*f)return void Q();var E=T*Math.cos(c),I=T*Math.sin(c);s.x+=E,s.y+=I,r.attr({x2:s.x,y2:s.y})}if(p){if(p*p>M*M+f*f)return void Q();var B=p*Math.cos(c),N=p*Math.sin(c);o.x-=B,o.y-=N,r.attr({x1:o.x,y1:o.y})}}else if(x.nodeName==="path"){var V=x.getTotalLength(),j="";if(V1){l=!0;break}}l?w.fullLayout._infolayer.select(".annotation-"+w.id+'[data-index="'+r+'"]').remove():(n._pdata=d(w.glplot.cameraParams,[y.xaxis.r2l(n.x)*_[0],y.yaxis.r2l(n.y)*_[1],y.zaxis.r2l(n.z)*_[2]]),b(w.graphDiv,n,r,w.id,n._xa,n._ya))}}},83348:function(D,L,t){var b=t(33626),d=t(34809);D.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t(38239)}}},layoutAttributes:t(38239),handleDefaults:t(34232),includeBasePlot:function(e,w){var y=b.subplotsRegistry.gl3d;if(y)for(var _=y.attrRegex,u=Object.keys(e),r=0;r=0)))return n;if(h===3)s[h]>1&&(s[h]=1);else if(s[h]>=1)return n}var x=Math.round(255*s[0])+", "+Math.round(255*s[1])+", "+Math.round(255*s[2]);return c?"rgba("+x+", "+s[3]+")":"rgb("+x+")"}w.tinyRGB=function(n){var l=n.toRgb();return"rgb("+Math.round(l.r)+", "+Math.round(l.g)+", "+Math.round(l.b)+")"},w.rgb=function(n){return w.tinyRGB(b(n))},w.opacity=function(n){return n?b(n).getAlpha():0},w.addOpacity=function(n,l){var o=b(n).toRgb();return"rgba("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+", "+l+")"},w.combine=function(n,l){var o=b(n).toRgb();if(o.a===1)return b(n).toRgbString();var s=b(l||u).toRgb(),c=s.a===1?s:{r:255*(1-s.a)+s.r*s.a,g:255*(1-s.a)+s.g*s.a,b:255*(1-s.a)+s.b*s.a},h={r:c.r*(1-o.a)+o.r*o.a,g:c.g*(1-o.a)+o.g*o.a,b:c.b*(1-o.a)+o.b*o.a};return b(h).toRgbString()},w.interpolate=function(n,l,o){var s=b(n).toRgb(),c=b(l).toRgb(),h={r:o*s.r+(1-o)*c.r,g:o*s.g+(1-o)*c.g,b:o*s.b+(1-o)*c.b};return b(h).toRgbString()},w.contrast=function(n,l,o){var s=b(n);return s.getAlpha()!==1&&(s=b(w.combine(n,u))),(s.isDark()?l?s.lighten(l):u:o?s.darken(o):_).toString()},w.stroke=function(n,l){var o=b(l);n.style({stroke:w.tinyRGB(o),"stroke-opacity":o.getAlpha()})},w.fill=function(n,l){var o=b(l);n.style({fill:w.tinyRGB(o),"fill-opacity":o.getAlpha()})},w.clean=function(n){if(n&&typeof n=="object"){var l,o,s,c,h=Object.keys(n);for(l=0;l0?vt>=Et:vt<=Et));Lt++)vt>Ft&&vt0?vt>=Et:vt<=Et));Lt++)vt>Tt[0]&&vt1){var Gt=Math.pow(10,Math.floor(Math.log(Ht)/Math.LN10));wt*=Gt*u.roundUp(Ht/Gt,[2,5,10]),(Math.abs(Ve.start)/Ve.size+1e-6)%1<2e-6&&(pt.tick0=0)}pt.dtick=wt}pt.domain=$?[tt+ie/be.h,tt+qe-ie/be.h]:[tt+fe/be.w,tt+qe-fe/be.w],pt.setScale(),N.attr("transform",r(Math.round(be.l),Math.round(be.t)));var st,Qe=N.select("."+p.cbtitleunshift).attr("transform",r(-Math.round(be.l),-Math.round(be.t))),ft=pt.ticklabelposition,yt=pt.title.font.size,Ot=N.select("."+p.cbaxis),Pt=0,at=0;function lt(Xe,ut){var Tt={propContainer:pt,propName:V._propPrefix+"title",traceIndex:V._traceIndex,_meta:V._meta,placeholder:me._dfltTitle.colorbar,containerGroup:N.select("."+p.cbtitle)},vt=Xe.charAt(0)==="h"?Xe.substr(1):"h"+Xe;N.selectAll("."+vt+",."+vt+"-math-group").remove(),c.draw(j,Xe,n(Tt,ut||{}))}return u.syncOrAsync([e.previousPromises,function(){var Xe,ut;($&&At||!$&&!At)&&(Le==="top"&&(Xe=fe+be.l+$e*oe,ut=ie+be.t+Ye*(1-tt-qe)+3+.75*yt),Le==="bottom"&&(Xe=fe+be.l+$e*oe,ut=ie+be.t+Ye*(1-tt)-3-.25*yt),Le==="right"&&(ut=ie+be.t+Ye*le+3+.75*yt,Xe=fe+be.l+$e*tt),lt(pt._id+"title",{attributes:{x:Xe,y:ut,"text-anchor":$?"start":"middle"}}))},function(){if(!$&&!At||$&&At){var Xe,ut=N.select("."+p.cbtitle),Tt=ut.select("text"),vt=[-Z/2,Z/2],Lt=ut.select(".h"+pt._id+"title-math-group").node(),Ut=15.6;if(Tt.node()&&(Ut=parseInt(Tt.node().style.fontSize,10)*v),Lt?(Xe=o.bBox(Lt),at=Xe.width,(Pt=Xe.height)>Ut&&(vt[1]-=(Pt-Ut)/2)):Tt.node()&&!Tt.classed(p.jsPlaceholder)&&(Xe=o.bBox(Tt.node()),at=Xe.width,Pt=Xe.height),$){if(Pt){if(Pt+=5,Le==="top")pt.domain[1]-=Pt/be.h,vt[1]*=-1;else{pt.domain[0]+=Pt/be.h;var rt=h.lineCount(Tt);vt[1]+=(1-rt)*Ut}ut.attr("transform",r(vt[0],vt[1])),pt.setScale()}}else at&&(Le==="right"&&(pt.domain[0]+=(at+yt/2)/be.w),ut.attr("transform",r(vt[0],vt[1])),pt.setScale())}N.selectAll("."+p.cbfills+",."+p.cblines).attr("transform",$?r(0,Math.round(be.h*(1-pt.domain[1]))):r(Math.round(be.w*pt.domain[0]),0)),Ot.attr("transform",$?r(0,Math.round(-be.t)):r(Math.round(-be.l),0));var et=N.select("."+p.cbfills).selectAll("rect."+p.cbfill).attr("style","").data(de);et.enter().append("rect").classed(p.cbfill,!0).attr("style",""),et.exit().remove();var Et=Oe.map(pt.c2p).map(Math.round).sort(function(qt,en){return qt-en});et.each(function(qt,en){var Wt=[en===0?Oe[0]:(de[en]+de[en-1])/2,en===de.length-1?Oe[1]:(de[en]+de[en+1])/2].map(pt.c2p).map(Math.round);$&&(Wt[1]=u.constrain(Wt[1]+(Wt[1]>Wt[0])?1:-1,Et[0],Et[1]));var Zt=b.select(this).attr($?"x":"y",_e).attr($?"y":"x",b.min(Wt)).attr($?"width":"height",Math.max(ke,2)).attr($?"height":"width",Math.max(b.max(Wt)-b.min(Wt),2));if(V._fillgradient)o.gradient(Zt,j,V._id,$?"vertical":"horizontalreversed",V._fillgradient,"fill");else{var on=Ie(qt).replace("e-","");Zt.attr("fill",d(on).toHexString())}});var Bt=N.select("."+p.cblines).selectAll("path."+p.cbline).data(Ee.color&&Ee.width?Me:[]);Bt.enter().append("path").classed(p.cbline,!0),Bt.exit().remove(),Bt.each(function(qt){var en=_e,Wt=Math.round(pt.c2p(qt))+Ee.width/2%1;b.select(this).attr("d","M"+($?en+","+Wt:Wt+","+en)+($?"h":"v")+ke).call(o.lineGroupStyle,Ee.width,We(qt),Ee.dash)}),Ot.selectAll("g."+pt._id+"tick,path").remove();var Ft=_e+ke+(Z||0)/2-(V.ticks==="outside"?1:0),St=y.calcTicks(pt),Jt=y.getTickSigns(pt)[2];return y.drawTicks(j,pt,{vals:pt.ticks==="inside"?y.clipEnds(pt,St):St,layer:Ot,path:y.makeTickPath(pt,Ft,Jt),transFn:y.makeTransTickFn(pt)}),y.drawLabels(j,pt,{vals:St,layer:Ot,transFn:y.makeTransTickLabelFn(pt),labelFns:y.makeLabelFns(pt,Ft)})},function(){if($&&!At||!$&&At){var Xe,ut,Tt=pt.position||0,vt=pt._offset+pt._length/2;if(Le==="right")ut=vt,Xe=be.l+$e*Tt+10+yt*(pt.showticklabels?1:.5);else if(Xe=vt,Le==="bottom"&&(ut=be.t+Ye*Tt+10+(ft.indexOf("inside")===-1?pt.tickfont.size:0)+(pt.ticks!=="intside"&&V.ticklen||0)),Le==="top"){var Lt=Ce.text.split("
").length;ut=be.t+Ye*Tt+10-ke-v*yt*Lt}lt(($?"h":"v")+pt._id+"title",{avoid:{selection:b.select(j).selectAll("g."+pt._id+"tick"),side:Le,offsetTop:$?0:be.t,offsetLeft:$?be.l:0,maxShift:$?me.width:me.height},attributes:{x:Xe,y:ut,"text-anchor":"middle"},transform:{rotate:$?-90:0,offset:0}})}},e.previousPromises,function(){var Xe,ut=ke+Z/2;ft.indexOf("inside")===-1&&(Xe=o.bBox(Ot.node()),ut+=$?Xe.width:Xe.height),st=Qe.select("text");var Tt=0,vt=$&&Le==="top",Lt=!$&&Le==="right",Ut=0;if(st.node()&&!st.classed(p.jsPlaceholder)){var rt,et=Qe.select(".h"+pt._id+"title-math-group").node();et&&($&&At||!$&&!At)?(Tt=(Xe=o.bBox(et)).width,rt=Xe.height):(Tt=(Xe=o.bBox(Qe.node())).right-be.l-($?_e:nt),rt=Xe.bottom-be.t-($?nt:_e),$||Le!=="top"||(ut+=Xe.height,Ut=Xe.height)),Lt&&(st.attr("transform",r(Tt/2+yt/2,0)),Tt*=2),ut=Math.max(ut,$?Tt:rt)}var Et=2*($?fe:ie)+ut+K+Z/2,Bt=0;!$&&Ce.text&&he==="bottom"&&le<=0&&(Et+=Bt=Et/2,Ut+=Bt),me._hColorbarMoveTitle=Bt,me._hColorbarMoveCBTitle=Ut;var Ft=K+Z,St=($?_e:nt)-Ft/2-($?fe:0),Jt=($?nt:_e)-($?Fe:ie+Ut-Bt);N.select("."+p.cbbg).attr("x",St).attr("y",Jt).attr($?"width":"height",Math.max(Et-Bt,2)).attr($?"height":"width",Math.max(Fe+Ft,2)).call(s.fill,ae).call(s.stroke,V.bordercolor).style("stroke-width",K);var qt=Lt?Math.max(Tt-10,0):0;N.selectAll("."+p.cboutline).attr("x",($?_e:nt+fe)+qt).attr("y",($?nt+ie-Fe:_e)+(vt?Pt:0)).attr($?"width":"height",Math.max(ke,2)).attr($?"height":"width",Math.max(Fe-($?2*ie+Pt:2*fe+qt),2)).call(s.stroke,V.outlinecolor).style({fill:"none","stroke-width":Z});var en=$?De*Et:0,Wt=$?0:(1-Be)*Et-Ut;if(en=ye?be.l-en:-en,Wt=ge?be.t-Wt:-Wt,N.attr("transform",r(en,Wt)),!$&&(K||d(ae).getAlpha()&&!d.equals(me.paper_bgcolor,ae))){var Zt=Ot.selectAll("text"),on=Zt[0].length,un=N.select("."+p.cbbg).node(),Pn=o.bBox(un),Dn=o.getTranslate(N);Zt.each(function(Jn,$n){var vr=on-1;if($n===0||$n===vr){var Qn,lr=o.bBox(this),hr=o.getTranslate(this);if($n===vr){var jr=lr.right+hr.x;(Qn=Pn.right+Dn.x+nt-K-2+oe-jr)>0&&(Qn=0)}else if($n===0){var ni=lr.left+hr.x;(Qn=Pn.left+Dn.x+nt+K+2-ni)<0&&(Qn=0)}Qn&&(on<3?this.setAttribute("transform","translate("+Qn+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var In={},mn=S[se],En=T[se],Kn=S[he],Ln=T[he],Tn=Et-ke;$?(H==="pixels"?(In.y=le,In.t=Fe*Kn,In.b=Fe*Ln):(In.t=In.b=0,In.yt=le+ee*Kn,In.yb=le-ee*Ln),Q==="pixels"?(In.x=oe,In.l=Et*mn,In.r=Et*En):(In.l=Tn*mn,In.r=Tn*En,In.xl=oe-J*mn,In.xr=oe+J*En)):(H==="pixels"?(In.x=oe,In.l=Fe*mn,In.r=Fe*En):(In.l=In.r=0,In.xl=oe+ee*mn,In.xr=oe-ee*En),Q==="pixels"?(In.y=1-le,In.t=Et*Kn,In.b=Et*Ln):(In.t=Tn*Kn,In.b=Tn*Ln,In.yt=le-J*Kn,In.yb=le+J*Ln));var Fn=V.y<.5?"b":"t",wn=V.x<.5?"l":"r";j._fullLayout._reservedMargin[V._id]={};var zn={r:me.width-St-en,l:St+In.r,b:me.height-Jt-Wt,t:Jt+In.b};ye&&ge?e.autoMargin(j,V._id,In):ye?j._fullLayout._reservedMargin[V._id][Fn]=zn[Fn]:ge||$?j._fullLayout._reservedMargin[V._id][wn]=zn[wn]:j._fullLayout._reservedMargin[V._id][Fn]=zn[Fn]}],j)}(I,E,M);B&&B.then&&(M._promises||[]).push(B),M._context.edits.colorbarPosition&&function(N,V,j){var $,ee,H,J=V.orientation==="v",Q=j._fullLayout._size;_.init({element:N.node(),gd:j,prepFn:function(){$=N.attr("transform"),l(N)},moveFn:function(Z,K){N.attr("transform",$+r(Z,K)),ee=_.align((J?V._uFrac:V._vFrac)+Z/Q.w,J?V._thickFrac:V._lenFrac,0,1,V.xanchor),H=_.align((J?V._vFrac:1-V._uFrac)-K/Q.h,J?V._lenFrac:V._thickFrac,0,1,V.yanchor);var ae=_.getCursor(ee,H,V.xanchor,V.yanchor);l(N,ae)},doneFn:function(){if(l(N),ee!==void 0&&H!==void 0){var Z={};Z[V._propPrefix+"x"]=ee,Z[V._propPrefix+"y"]=H,V._traceIndex!==void 0?w.call("_guiRestyle",j,Z,V._traceIndex):w.call("_guiRelayout",j,Z)}}})}(I,E,M)}),f.exit().each(function(E){e.autoMargin(M,E._id)}).remove(),f.order()}}},91362:function(D,L,t){var b=t(34809);D.exports=function(d){return b.isPlainObject(d.colorbar)}},96919:function(D,L,t){D.exports={moduleType:"component",name:"colorbar",attributes:t(25158),supplyDefaults:t(42097),draw:t(5881).draw,hasColorbar:t(91362)}},87163:function(D,L,t){var b=t(25158),d=t(90694).counter,e=t(62994),w=t(19017).scales;function y(_){return"`"+_+"`"}e(w),D.exports=function(_,u){_=_||"";var r,n=(u=u||{}).cLetter||"c",l=("onlyIfNumerical"in u&&u.onlyIfNumerical,"noScale"in u?u.noScale:_==="marker.line"),o="showScaleDflt"in u?u.showScaleDflt:n==="z",s=typeof u.colorscaleDflt=="string"?w[u.colorscaleDflt]:null,c=u.editTypeOverride||"",h=_?_+".":"";"colorAttr"in u?(r=u.colorAttr,u.colorAttr):y(h+(r={z:"z",c:"color"}[n]));var x=n+"auto",m=n+"min",g=n+"max",k=n+"mid",A={};A[m]=A[g]=void 0;var v={};v[x]=!1;var S={};return r==="color"&&(S.color={valType:"color",arrayOk:!0,editType:c||"style"},u.anim&&(S.color.anim=!0)),S[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:A},S[m]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:v},S[g]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:v},S[k]={valType:"number",dflt:null,editType:"calc",impliedEdits:A},S.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},S.autocolorscale={valType:"boolean",dflt:u.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},S.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(S.showscale={valType:"boolean",dflt:o,editType:"calc"},S.colorbar=b),u.noColorAxis||(S.coloraxis={valType:"subplotid",regex:d("coloraxis"),dflt:null,editType:"calc"}),S}},28379:function(D,L,t){var b=t(10721),d=t(34809),e=t(65477).extractOpts;D.exports=function(w,y,_){var u,r=w._fullLayout,n=_.vals,l=_.containerStr,o=l?d.nestedProperty(y,l).get():y,s=e(o),c=s.auto!==!1,h=s.min,x=s.max,m=s.mid,g=function(){return d.aggNums(Math.min,null,n)},k=function(){return d.aggNums(Math.max,null,n)};h===void 0?h=g():c&&(h=o._colorAx&&b(h)?Math.min(h,g()):g()),x===void 0?x=k():c&&(x=o._colorAx&&b(x)?Math.max(x,k()):k()),c&&m!==void 0&&(x-m>m-h?h=m-(x-m):x-m=0?r.colorscale.sequential:r.colorscale.sequentialminus,s._sync("colorscale",u))}},67623:function(D,L,t){var b=t(34809),d=t(65477).hasColorscale,e=t(65477).extractOpts;D.exports=function(w,y){function _(c,h){var x=c["_"+h];x!==void 0&&(c[h]=x)}function u(c,h){var x=h.container?b.nestedProperty(c,h.container).get():c;if(x)if(x.coloraxis)x._colorAx=y[x.coloraxis];else{var m=e(x),g=m.auto;(g||m.min===void 0)&&_(x,h.min),(g||m.max===void 0)&&_(x,h.max),m.autocolorscale&&_(x,"colorscale")}}for(var r=0;r=0;g--,k++){var A=h[g];m[k]=[1-A[0],A[1]]}return m}function s(h,x){x=x||{};for(var m=h.domain,g=h.range,k=g.length,A=new Array(k),v=0;v1.3333333333333333-_?y:_}},4001:function(D,L,t){var b=t(34809),d=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];D.exports=function(e,w,y,_){return e=y==="left"?0:y==="center"?1:y==="right"?2:b.constrain(Math.floor(3*e),0,2),w=_==="bottom"?0:_==="middle"?1:_==="top"?2:b.constrain(Math.floor(3*w),0,2),d[w][e]}},70414:function(D,L){L.selectMode=function(t){return t==="lasso"||t==="select"},L.drawMode=function(t){return t==="drawclosedpath"||t==="drawopenpath"||t==="drawline"||t==="drawrect"||t==="drawcircle"},L.openMode=function(t){return t==="drawline"||t==="drawopenpath"},L.rectMode=function(t){return t==="select"||t==="drawline"||t==="drawrect"||t==="drawcircle"},L.freeMode=function(t){return t==="lasso"||t==="drawclosedpath"||t==="drawopenpath"},L.selectingOrDrawing=function(t){return L.freeMode(t)||L.rectMode(t)}},14751:function(D,L,t){var b=t(44039),d=t(39784),e=t(74043),w=t(34809).removeElement,y=t(54826),_=D.exports={};_.align=t(53770),_.getCursor=t(4001);var u=t(60148);function r(){var l=document.createElement("div");l.className="dragcover";var o=l.style;return o.position="fixed",o.left=0,o.right=0,o.top=0,o.bottom=0,o.zIndex=999999999,o.background="none",document.body.appendChild(l),l}function n(l){return b(l.changedTouches?l.changedTouches[0]:l,document.body)}_.unhover=u.wrapped,_.unhoverRaw=u.raw,_.init=function(l){var o,s,c,h,x,m,g,k,A=l.gd,v=1,S=A._context.doubleClickDelay,T=l.element;A._mouseDownTime||(A._mouseDownTime=0),T.style.pointerEvents="all",T.onmousedown=M,e?(T._ontouchstart&&T.removeEventListener("touchstart",T._ontouchstart),T._ontouchstart=M,T.addEventListener("touchstart",M,{passive:!1})):T.ontouchstart=M;var p=l.clampFn||function(I,B,N){return Math.abs(I)S&&(v=Math.max(v-1,1)),A._dragged)l.doneFn&&l.doneFn();else if(l.clickFn&&l.clickFn(v,m),!k){var B;try{B=new MouseEvent("click",I)}catch{var N=n(I);(B=document.createEvent("MouseEvents")).initMouseEvent("click",I.bubbles,I.cancelable,I.view,I.detail,I.screenX,I.screenY,N[0],N[1],I.ctrlKey,I.altKey,I.shiftKey,I.metaKey,I.button,I.relatedTarget)}g.dispatchEvent(B)}A._dragging=!1,A._dragged=!1}else A._dragged=!1}},_.coverSlip=r},60148:function(D,L,t){var b=t(68596),d=t(64025),e=t(95425).getGraphDiv,w=t(85988),y=D.exports={};y.wrapped=function(_,u,r){(_=e(_))._fullLayout&&d.clear(_._fullLayout._uid+w.HOVERID),y.raw(_,u,r)},y.raw=function(_,u){var r=_._fullLayout,n=_._hoverdata;u||(u={}),u.target&&!_._dragged&&b.triggerHandler(_,"plotly_beforehover",u)===!1||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),_._hoverdata=void 0,u.target&&n&&_.emit("plotly_unhover",{event:u,points:n}))}},94850:function(D,L){L.T={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},L.k={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},62203:function(D,L,t){var b=t(45568),d=t(34809),e=d.numberFormat,w=t(10721),y=t(65657),_=t(33626),u=t(78766),r=t(88856),n=d.strTranslate,l=t(30635),o=t(62972),s=t(4530).LINE_SPACING,c=t(20438).DESELECTDIM,h=t(64726),x=t(92527),m=t(36040).appendArrayPointValue,g=D.exports={};function k(Ie){return Ie==="none"?void 0:Ie}g.font=function(Ie,Ve){var Pe=Ve.variant,de=Ve.style,Me=Ve.weight,ke=Ve.color,He=Ve.size,Fe=Ve.family,qe=Ve.shadow,$e=Ve.lineposition,Ye=Ve.textcase;Fe&&Ie.style("font-family",Fe),He+1&&Ie.style("font-size",He+"px"),ke&&Ie.call(u.fill,ke),Me&&Ie.style("font-weight",Me),de&&Ie.style("font-style",de),Pe&&Ie.style("font-variant",Pe),Ye&&Ie.style("text-transform",k(function(_e){return A[_e]}(Ye))),qe&&Ie.style("text-shadow",qe==="auto"?l.makeTextShadow(u.contrast(ke)):k(qe)),$e&&Ie.style("text-decoration-line",k(function(_e){return _e.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}($e)))};var A={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function v(Ie,Ve,Pe,de){var Me=Ve.fillpattern,ke=Ve.fillgradient,He=Me&&g.getPatternAttr(Me.shape,0,"");if(He){var Fe=g.getPatternAttr(Me.bgcolor,0,null),qe=g.getPatternAttr(Me.fgcolor,0,null),$e=Me.fgopacity,Ye=g.getPatternAttr(Me.size,0,8),_e=g.getPatternAttr(Me.solidity,0,.3),De=Ve.uid;g.pattern(Ie,"point",Pe,De,He,Ye,_e,void 0,Me.fillmode,Fe,qe,$e)}else if(ke&&ke.type!=="none"){var Be,Ge,tt=ke.type,nt="scatterfill-"+Ve.uid;de&&(nt="legendfill-"+Ve.uid),de||ke.start===void 0&&ke.stop===void 0?(tt==="horizontal"&&(tt+="reversed"),Ie.call(g.gradient,Pe,nt,tt,ke.colorscale,"fill")):(tt==="horizontal"?(Be={x:ke.start,y:0},Ge={x:ke.stop,y:0}):tt==="vertical"&&(Be={x:0,y:ke.start},Ge={x:0,y:ke.stop}),Be.x=Ve._xA.c2p(Be.x===void 0?Ve._extremes.x.min[0].val:Be.x,!0),Be.y=Ve._yA.c2p(Be.y===void 0?Ve._extremes.y.min[0].val:Be.y,!0),Ge.x=Ve._xA.c2p(Ge.x===void 0?Ve._extremes.x.max[0].val:Ge.x,!0),Ge.y=Ve._yA.c2p(Ge.y===void 0?Ve._extremes.y.max[0].val:Ge.y,!0),Ie.call(E,Pe,nt,"linear",ke.colorscale,"fill",Be,Ge,!0,!1))}else Ve.fillcolor&&Ie.call(u.fill,Ve.fillcolor)}g.setPosition=function(Ie,Ve,Pe){Ie.attr("x",Ve).attr("y",Pe)},g.setSize=function(Ie,Ve,Pe){Ie.attr("width",Ve).attr("height",Pe)},g.setRect=function(Ie,Ve,Pe,de,Me){Ie.call(g.setPosition,Ve,Pe).call(g.setSize,de,Me)},g.translatePoint=function(Ie,Ve,Pe,de){var Me=Pe.c2p(Ie.x),ke=de.c2p(Ie.y);return!!(w(Me)&&w(ke)&&Ve.node())&&(Ve.node().nodeName==="text"?Ve.attr("x",Me).attr("y",ke):Ve.attr("transform",n(Me,ke)),!0)},g.translatePoints=function(Ie,Ve,Pe){Ie.each(function(de){var Me=b.select(this);g.translatePoint(de,Me,Ve,Pe)})},g.hideOutsideRangePoint=function(Ie,Ve,Pe,de,Me,ke){Ve.attr("display",Pe.isPtWithinRange(Ie,Me)&&de.isPtWithinRange(Ie,ke)?null:"none")},g.hideOutsideRangePoints=function(Ie,Ve){if(Ve._hasClipOnAxisFalse){var Pe=Ve.xaxis,de=Ve.yaxis;Ie.each(function(Me){var ke=Me[0].trace,He=ke.xcalendar,Fe=ke.ycalendar,qe=_.traceIs(ke,"bar-like")?".bartext":".point,.textpoint";Ie.selectAll(qe).each(function($e){g.hideOutsideRangePoint($e,b.select(this),Pe,de,He,Fe)})})}},g.crispRound=function(Ie,Ve,Pe){return Ve&&w(Ve)?Ie._context.staticPlot?Ve:Ve<1?1:Math.round(Ve):Pe||0},g.singleLineStyle=function(Ie,Ve,Pe,de,Me){Ve.style("fill","none");var ke=(((Ie||[])[0]||{}).trace||{}).line||{},He=Pe||ke.width||0,Fe=Me||ke.dash||"";u.stroke(Ve,de||ke.color),g.dashLine(Ve,Fe,He)},g.lineGroupStyle=function(Ie,Ve,Pe,de){Ie.style("fill","none").each(function(Me){var ke=(((Me||[])[0]||{}).trace||{}).line||{},He=Ve||ke.width||0,Fe=de||ke.dash||"";b.select(this).call(u.stroke,Pe||ke.color).call(g.dashLine,Fe,He)})},g.dashLine=function(Ie,Ve,Pe){Pe=+Pe||0,Ve=g.dashStyle(Ve,Pe),Ie.style({"stroke-dasharray":Ve,"stroke-width":Pe+"px"})},g.dashStyle=function(Ie,Ve){Ve=+Ve||1;var Pe=Math.max(Ve,3);return Ie==="solid"?Ie="":Ie==="dot"?Ie=Pe+"px,"+Pe+"px":Ie==="dash"?Ie=3*Pe+"px,"+3*Pe+"px":Ie==="longdash"?Ie=5*Pe+"px,"+5*Pe+"px":Ie==="dashdot"?Ie=3*Pe+"px,"+Pe+"px,"+Pe+"px,"+Pe+"px":Ie==="longdashdot"&&(Ie=5*Pe+"px,"+2*Pe+"px,"+Pe+"px,"+2*Pe+"px"),Ie},g.singleFillStyle=function(Ie,Ve){var Pe=b.select(Ie.node());v(Ie,((Pe.data()[0]||[])[0]||{}).trace||{},Ve,!1)},g.fillGroupStyle=function(Ie,Ve,Pe){Ie.style("stroke-width",0).each(function(de){var Me=b.select(this);de[0].trace&&v(Me,de[0].trace,Ve,Pe)})};var S=t(38882);g.symbolNames=[],g.symbolFuncs=[],g.symbolBackOffs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolNoFill={},g.symbolList=[],Object.keys(S).forEach(function(Ie){var Ve=S[Ie],Pe=Ve.n;g.symbolList.push(Pe,String(Pe),Ie,Pe+100,String(Pe+100),Ie+"-open"),g.symbolNames[Pe]=Ie,g.symbolFuncs[Pe]=Ve.f,g.symbolBackOffs[Pe]=Ve.backoff||0,Ve.needLine&&(g.symbolNeedLines[Pe]=!0),Ve.noDot?g.symbolNoDot[Pe]=!0:g.symbolList.push(Pe+200,String(Pe+200),Ie+"-dot",Pe+300,String(Pe+300),Ie+"-open-dot"),Ve.noFill&&(g.symbolNoFill[Pe]=!0)});var T=g.symbolNames.length;function p(Ie,Ve,Pe,de){var Me=Ie%100;return g.symbolFuncs[Me](Ve,Pe,de)+(Ie>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}g.symbolNumber=function(Ie){if(w(Ie))Ie=+Ie;else if(typeof Ie=="string"){var Ve=0;Ie.indexOf("-open")>0&&(Ve=100,Ie=Ie.replace("-open","")),Ie.indexOf("-dot")>0&&(Ve+=200,Ie=Ie.replace("-dot","")),(Ie=g.symbolNames.indexOf(Ie))>=0&&(Ie+=Ve)}return Ie%100>=T||Ie>=400?0:Math.floor(Math.max(Ie,0))};var M=e("~f"),f={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function E(Ie,Ve,Pe,de,Me,ke,He,Fe,qe,$e){var Ye,_e=Me.length;de==="linear"?Ye={node:"linearGradient",attrs:{x1:He.x,y1:He.y,x2:Fe.x,y2:Fe.y,gradientUnits:qe?"userSpaceOnUse":"objectBoundingBox"},reversed:$e}:de==="radial"&&(Ye={node:"radialGradient",reversed:$e});for(var De=new Array(_e),Be=0;Be<_e;Be++)Ye.reversed?De[_e-1-Be]=[M(100*(1-Me[Be][0])),Me[Be][1]]:De[Be]=[M(100*Me[Be][0]),Me[Be][1]];var Ge=Ve._fullLayout,tt="g"+Ge._uid+"-"+Pe,nt=Ge._defs.select(".gradients").selectAll("#"+tt).data([de+De.join(";")],d.identity);nt.exit().remove(),nt.enter().append(Ye.node).each(function(){var pt=b.select(this);Ye.attrs&&pt.attr(Ye.attrs),pt.attr("id",tt);var At=pt.selectAll("stop").data(De);At.exit().remove(),At.enter().append("stop"),At.each(function(wt){var Nt=y(wt[1]);b.select(this).attr({offset:wt[0]+"%","stop-color":u.tinyRGB(Nt),"stop-opacity":Nt.getAlpha()})})}),Ie.style(ke,he(tt,Ve)).style(ke+"-opacity",null),Ie.classed("gradient_filled",!0)}g.gradient=function(Ie,Ve,Pe,de,Me,ke){var He=f[de];return E(Ie,Ve,Pe,He.type,Me,ke,He.start,He.stop,!1,He.reversed)},g.pattern=function(Ie,Ve,Pe,de,Me,ke,He,Fe,qe,$e,Ye,_e){var De=Ve==="legend";Fe&&(qe==="overlay"?($e=Fe,Ye=u.contrast($e)):($e=void 0,Ye=Fe));var Be,Ge,tt,nt,pt,At,wt,Nt,Ht,Gt=Pe._fullLayout,st="p"+Gt._uid+"-"+de,Qe={},ft=y(Ye),yt=u.tinyRGB(ft),Ot=_e*ft.getAlpha();switch(Me){case"/":Be=ke*Math.sqrt(2),Ge=ke*Math.sqrt(2),At="path",Qe={d:tt="M-"+Be/4+","+Ge/4+"l"+Be/2+",-"+Ge/2+"M0,"+Ge+"L"+Be+",0M"+Be/4*3+","+Ge/4*5+"l"+Be/2+",-"+Ge/2,opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"\\":Be=ke*Math.sqrt(2),Ge=ke*Math.sqrt(2),At="path",Qe={d:tt="M"+Be/4*3+",-"+Ge/4+"l"+Be/2+","+Ge/2+"M0,0L"+Be+","+Ge+"M-"+Be/4+","+Ge/4*3+"l"+Be/2+","+Ge/2,opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"x":Be=ke*Math.sqrt(2),Ge=ke*Math.sqrt(2),tt="M-"+Be/4+","+Ge/4+"l"+Be/2+",-"+Ge/2+"M0,"+Ge+"L"+Be+",0M"+Be/4*3+","+Ge/4*5+"l"+Be/2+",-"+Ge/2+"M"+Be/4*3+",-"+Ge/4+"l"+Be/2+","+Ge/2+"M0,0L"+Be+","+Ge+"M-"+Be/4+","+Ge/4*3+"l"+Be/2+","+Ge/2,nt=ke-ke*Math.sqrt(1-He),At="path",Qe={d:tt,opacity:Ot,stroke:yt,"stroke-width":nt+"px"};break;case"|":At="path",At="path",Qe={d:tt="M"+(Be=ke)/2+",0L"+Be/2+","+(Ge=ke),opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"-":At="path",At="path",Qe={d:tt="M0,"+(Ge=ke)/2+"L"+(Be=ke)+","+Ge/2,opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"+":At="path",tt="M"+(Be=ke)/2+",0L"+Be/2+","+(Ge=ke)+"M0,"+Ge/2+"L"+Be+","+Ge/2,nt=ke-ke*Math.sqrt(1-He),At="path",Qe={d:tt,opacity:Ot,stroke:yt,"stroke-width":nt+"px"};break;case".":Be=ke,Ge=ke,He=0&&Ie.i===void 0&&(Ie.i=ke.i),Ve.style("opacity",de.selectedOpacityFn?de.selectedOpacityFn(Ie):Ie.mo===void 0?He.opacity:Ie.mo),de.ms2mrc){var qe;qe=Ie.ms==="various"||He.size==="various"?3:de.ms2mrc(Ie.ms),Ie.mrc=qe,de.selectedSizeFn&&(qe=Ie.mrc=de.selectedSizeFn(Ie));var $e=g.symbolNumber(Ie.mx||He.symbol)||0;Ie.om=$e%200>=100;var Ye=We(Ie,Pe),_e=oe(Ie,Pe);Ve.attr("d",p($e,qe,Ye,_e))}var De,Be,Ge,tt=!1;if(Ie.so)Ge=Fe.outlierwidth,Be=Fe.outliercolor,De=He.outliercolor;else{var nt=(Fe||{}).width;Ge=(Ie.mlw+1||nt+1||(Ie.trace?(Ie.trace.marker.line||{}).width:0)+1)-1||0,Be="mlc"in Ie?Ie.mlcc=de.lineScale(Ie.mlc):d.isArrayOrTypedArray(Fe.color)?u.defaultLine:Fe.color,d.isArrayOrTypedArray(He.color)&&(De=u.defaultLine,tt=!0),De="mc"in Ie?Ie.mcc=de.markerScale(Ie.mc):He.color||He.colors||"rgba(0,0,0,0)",de.selectedColorFn&&(De=de.selectedColorFn(Ie))}if(Ie.om)Ve.call(u.stroke,De).style({"stroke-width":(Ge||1)+"px",fill:"none"});else{Ve.style("stroke-width",(Ie.isBlank?0:Ge)+"px");var pt=He.gradient,At=Ie.mgt;At?tt=!0:At=pt&&pt.type,d.isArrayOrTypedArray(At)&&(At=At[0],f[At]||(At=0));var wt=He.pattern,Nt=wt&&g.getPatternAttr(wt.shape,Ie.i,"");if(At&&At!=="none"){var Ht=Ie.mgc;Ht?tt=!0:Ht=pt.color;var Gt=Pe.uid;tt&&(Gt+="-"+Ie.i),g.gradient(Ve,Me,Gt,At,[[0,Ht],[1,De]],"fill")}else if(Nt){var st=!1,Qe=wt.fgcolor;!Qe&&ke&&ke.color&&(Qe=ke.color,st=!0);var ft=g.getPatternAttr(Qe,Ie.i,ke&&ke.color||null),yt=g.getPatternAttr(wt.bgcolor,Ie.i,null),Ot=wt.fgopacity,Pt=g.getPatternAttr(wt.size,Ie.i,8),at=g.getPatternAttr(wt.solidity,Ie.i,.3);st=st||Ie.mcc||d.isArrayOrTypedArray(wt.shape)||d.isArrayOrTypedArray(wt.bgcolor)||d.isArrayOrTypedArray(wt.fgcolor)||d.isArrayOrTypedArray(wt.size)||d.isArrayOrTypedArray(wt.solidity);var lt=Pe.uid;st&&(lt+="-"+Ie.i),g.pattern(Ve,"point",Me,lt,Nt,Pt,at,Ie.mcc,wt.fillmode,yt,ft,Ot)}else d.isArrayOrTypedArray(De)?u.fill(Ve,De[Ie.i]):u.fill(Ve,De);Ge&&u.stroke(Ve,Be)}},g.makePointStyleFns=function(Ie){var Ve={},Pe=Ie.marker;return Ve.markerScale=g.tryColorscale(Pe,""),Ve.lineScale=g.tryColorscale(Pe,"line"),_.traceIs(Ie,"symbols")&&(Ve.ms2mrc=h.isBubble(Ie)?x(Ie):function(){return(Pe.size||6)/2}),Ie.selectedpoints&&d.extendFlat(Ve,g.makeSelectedPointStyleFns(Ie)),Ve},g.makeSelectedPointStyleFns=function(Ie){var Ve={},Pe=Ie.selected||{},de=Ie.unselected||{},Me=Ie.marker||{},ke=Pe.marker||{},He=de.marker||{},Fe=Me.opacity,qe=ke.opacity,$e=He.opacity,Ye=qe!==void 0,_e=$e!==void 0;(d.isArrayOrTypedArray(Fe)||Ye||_e)&&(Ve.selectedOpacityFn=function(Nt){var Ht=Nt.mo===void 0?Me.opacity:Nt.mo;return Nt.selected?Ye?qe:Ht:_e?$e:c*Ht});var De=Me.color,Be=ke.color,Ge=He.color;(Be||Ge)&&(Ve.selectedColorFn=function(Nt){var Ht=Nt.mcc||De;return Nt.selected?Be||Ht:Ge||Ht});var tt=Me.size,nt=ke.size,pt=He.size,At=nt!==void 0,wt=pt!==void 0;return _.traceIs(Ie,"symbols")&&(At||wt)&&(Ve.selectedSizeFn=function(Nt){var Ht=Nt.mrc||tt/2;return Nt.selected?At?nt/2:Ht:wt?pt/2:Ht}),Ve},g.makeSelectedTextStyleFns=function(Ie){var Ve={},Pe=Ie.selected||{},de=Ie.unselected||{},Me=Ie.textfont||{},ke=Pe.textfont||{},He=de.textfont||{},Fe=Me.color,qe=ke.color,$e=He.color;return Ve.selectedTextColorFn=function(Ye){var _e=Ye.tc||Fe;return Ye.selected?qe||_e:$e||(qe?_e:u.addOpacity(_e,c))},Ve},g.selectedPointStyle=function(Ie,Ve){if(Ie.size()&&Ve.selectedpoints){var Pe=g.makeSelectedPointStyleFns(Ve),de=Ve.marker||{},Me=[];Pe.selectedOpacityFn&&Me.push(function(ke,He){ke.style("opacity",Pe.selectedOpacityFn(He))}),Pe.selectedColorFn&&Me.push(function(ke,He){u.fill(ke,Pe.selectedColorFn(He))}),Pe.selectedSizeFn&&Me.push(function(ke,He){var Fe=He.mx||de.symbol||0,qe=Pe.selectedSizeFn(He);ke.attr("d",p(g.symbolNumber(Fe),qe,We(He,Ve),oe(He,Ve))),He.mrc2=qe}),Me.length&&Ie.each(function(ke){for(var He=b.select(this),Fe=0;Fe0?Pe:0}function $(Ie,Ve,Pe){return Pe&&(Ie=K(Ie)),Ve?H(Ie[1]):ee(Ie[0])}function ee(Ie){var Ve=b.round(Ie,2);return I=Ve,Ve}function H(Ie){var Ve=b.round(Ie,2);return B=Ve,Ve}function J(Ie,Ve,Pe,de){var Me=Ie[0]-Ve[0],ke=Ie[1]-Ve[1],He=Pe[0]-Ve[0],Fe=Pe[1]-Ve[1],qe=Math.pow(Me*Me+ke*ke,.25),$e=Math.pow(He*He+Fe*Fe,.25),Ye=($e*$e*Me-qe*qe*He)*de,_e=($e*$e*ke-qe*qe*Fe)*de,De=3*$e*(qe+$e),Be=3*qe*(qe+$e);return[[ee(Ve[0]+(De&&Ye/De)),H(Ve[1]+(De&&_e/De))],[ee(Ve[0]-(Be&&Ye/Be)),H(Ve[1]-(Be&&_e/Be))]]}g.textPointStyle=function(Ie,Ve,Pe){if(Ie.size()){var de;if(Ve.selectedpoints){var Me=g.makeSelectedTextStyleFns(Ve);de=Me.selectedTextColorFn}var ke=Ve.texttemplate,He=Pe._fullLayout;Ie.each(function(Fe){var qe=b.select(this),$e=ke?d.extractOption(Fe,Ve,"txt","texttemplate"):d.extractOption(Fe,Ve,"tx","text");if($e||$e===0){if(ke){var Ye=Ve._module.formatLabels,_e=Ye?Ye(Fe,Ve,He):{},De={};m(De,Ve,Fe.i);var Be=Ve._meta||{};$e=d.texttemplateString($e,_e,He._d3locale,De,Fe,Be)}var Ge=Fe.tp||Ve.textposition,tt=j(Fe,Ve),nt=de?de(Fe):Fe.tc||Ve.textfont.color;qe.call(g.font,{family:Fe.tf||Ve.textfont.family,weight:Fe.tw||Ve.textfont.weight,style:Fe.ty||Ve.textfont.style,variant:Fe.tv||Ve.textfont.variant,textcase:Fe.tC||Ve.textfont.textcase,lineposition:Fe.tE||Ve.textfont.lineposition,shadow:Fe.tS||Ve.textfont.shadow,size:tt,color:nt}).text($e).call(l.convertToTspans,Pe).call(V,Ge,tt,Fe.mrc)}else qe.remove()})}},g.selectedTextStyle=function(Ie,Ve){if(Ie.size()&&Ve.selectedpoints){var Pe=g.makeSelectedTextStyleFns(Ve);Ie.each(function(de){var Me=b.select(this),ke=Pe.selectedTextColorFn(de),He=de.tp||Ve.textposition,Fe=j(de,Ve);u.fill(Me,ke);var qe=_.traceIs(Ve,"bar-like");V(Me,He,Fe,de.mrc2||de.mrc,qe)})}},g.smoothopen=function(Ie,Ve){if(Ie.length<3)return"M"+Ie.join("L");var Pe,de="M"+Ie[0],Me=[];for(Pe=1;Pe=qe||Nt>=Ye&&Nt<=qe)&&(Ht<=_e&&Ht>=$e||Ht>=_e&&Ht<=$e)&&(Ie=[Nt,Ht])}return Ie}g.steps=function(Ie){var Ve=Q[Ie]||Z;return function(Pe){for(var de="M"+ee(Pe[0][0])+","+H(Pe[0][1]),Me=Pe.length,ke=1;ke=1e4&&(g.savedBBoxes={},ae=0),Pe&&(g.savedBBoxes[Pe]=Be),ae++,d.extendFlat({},Be)},g.setClipUrl=function(Ie,Ve,Pe){Ie.attr("clip-path",he(Ve,Pe))},g.getTranslate=function(Ie){var Ve=(Ie[Ie.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(Pe,de,Me){return[de,Me].join(" ")}).split(" ");return{x:+Ve[0]||0,y:+Ve[1]||0}},g.setTranslate=function(Ie,Ve,Pe){var de=Ie.attr?"attr":"getAttribute",Me=Ie.attr?"attr":"setAttribute",ke=Ie[de]("transform")||"";return Ve=Ve||0,Pe=Pe||0,ke=ke.replace(/(\btranslate\(.*?\);?)/,"").trim(),ke=(ke+=n(Ve,Pe)).trim(),Ie[Me]("transform",ke),ke},g.getScale=function(Ie){var Ve=(Ie[Ie.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(Pe,de,Me){return[de,Me].join(" ")}).split(" ");return{x:+Ve[0]||1,y:+Ve[1]||1}},g.setScale=function(Ie,Ve,Pe){var de=Ie.attr?"attr":"getAttribute",Me=Ie.attr?"attr":"setAttribute",ke=Ie[de]("transform")||"";return Ve=Ve||1,Pe=Pe||1,ke=ke.replace(/(\bscale\(.*?\);?)/,"").trim(),ke=(ke+="scale("+Ve+","+Pe+")").trim(),Ie[Me]("transform",ke),ke};var fe=/\s*sc.*/;g.setPointGroupScale=function(Ie,Ve,Pe){if(Ve=Ve||1,Pe=Pe||1,Ie){var de=Ve===1&&Pe===1?"":"scale("+Ve+","+Pe+")";Ie.each(function(){var Me=(this.getAttribute("transform")||"").replace(fe,"");Me=(Me+=de).trim(),this.setAttribute("transform",Me)})}};var ie=/translate\([^)]*\)\s*$/;function oe(Ie,Ve){var Pe;return Ie&&(Pe=Ie.mf),Pe===void 0&&(Pe=Ve.marker&&Ve.marker.standoff||0),Ve._geo||Ve._xA?Pe:-Pe}g.setTextPointsScale=function(Ie,Ve,Pe){Ie&&Ie.each(function(){var de,Me=b.select(this),ke=Me.select("text");if(ke.node()){var He=parseFloat(ke.attr("x")||0),Fe=parseFloat(ke.attr("y")||0),qe=(Me.attr("transform")||"").match(ie);de=Ve===1&&Pe===1?[]:[n(He,Fe),"scale("+Ve+","+Pe+")",n(-He,-Fe)],qe&&de.push(qe),Me.attr("transform",de.join(""))}})},g.getMarkerStandoff=oe;var le,ge,ye,me,be,Se,Ee=Math.atan2,Ce=Math.cos,Le=Math.sin;function Oe(Ie,Ve){var Pe=Ve[0],de=Ve[1];return[Pe*Ce(Ie)-de*Le(Ie),Pe*Le(Ie)+de*Ce(Ie)]}function We(Ie,Ve){var Pe,de,Me=Ie.ma;Me===void 0&&((Me=Ve.marker.angle)&&!d.isArrayOrTypedArray(Me)||(Me=0));var ke=Ve.marker.angleref;if(ke==="previous"||ke==="north"){if(Ve._geo){var He=Ve._geo.project(Ie.lonlat);Pe=He[0],de=He[1]}else{var Fe=Ve._xA,qe=Ve._yA;if(!Fe||!qe)return 90;Pe=Fe.c2p(Ie.x),de=qe.c2p(Ie.y)}if(Ve._geo){var $e,Ye=Ie.lonlat[0],_e=Ie.lonlat[1],De=Ve._geo.project([Ye,_e+1e-5]),Be=Ve._geo.project([Ye+1e-5,_e]),Ge=Ee(Be[1]-de,Be[0]-Pe),tt=Ee(De[1]-de,De[0]-Pe);if(ke==="north")$e=Me/180*Math.PI;else if(ke==="previous"){var nt=Ye/180*Math.PI,pt=_e/180*Math.PI,At=le/180*Math.PI,wt=ge/180*Math.PI,Nt=At-nt,Ht=Ce(wt)*Le(Nt),Gt=Le(wt)*Ce(pt)-Ce(wt)*Le(pt)*Ce(Nt);$e=-Ee(Ht,Gt)-Math.PI,le=Ye,ge=_e}var st=Oe(Ge,[Ce($e),0]),Qe=Oe(tt,[Le($e),0]);Me=Ee(st[1]+Qe[1],st[0]+Qe[0])/Math.PI*180,ke!=="previous"||Se===Ve.uid&&Ie.i===be+1||(Me=null)}if(ke==="previous"&&!Ve._geo)if(Se===Ve.uid&&Ie.i===be+1&&w(Pe)&&w(de)){var ft=Pe-ye,yt=de-me,Ot=Ve.line&&Ve.line.shape||"",Pt=Ot.slice(Ot.length-1);Pt==="h"&&(yt=0),Pt==="v"&&(ft=0),Me+=Ee(yt,ft)/Math.PI*180+90}else Me=null}return ye=Pe,me=de,be=Ie.i,Se=Ve.uid,Me}g.getMarkerAngle=We},38882:function(D,L,t){var b,d,e,w,y=t(26953),_=t(45568).round,u="M0,0Z",r=Math.sqrt(2),n=Math.sqrt(3),l=Math.PI,o=Math.cos,s=Math.sin;function c(x){return x===null}function h(x,m,g){if(!(x&&x%360!=0||m))return g;if(e===x&&w===m&&b===g)return d;function k(j,$){var ee=o(j),H=s(j),J=$[0],Q=$[1]+(m||0);return[J*ee-Q*H,J*H+Q*ee]}e=x,w=m,b=g;for(var A=x/180*l,v=0,S=0,T=y(g),p="",M=0;M0,s=y._context.staticPlot;_.each(function(c){var h,x=c[0].trace,m=x.error_x||{},g=x.error_y||{};x.ids&&(h=function(S){return S.id});var k=w.hasMarkers(x)&&x.marker.maxdisplayed>0;g.visible||m.visible||(c=[]);var A=b.select(this).selectAll("g.errorbar").data(c,h);if(A.exit().remove(),c.length){m.visible||A.selectAll("path.xerror").remove(),g.visible||A.selectAll("path.yerror").remove(),A.style("opacity",1);var v=A.enter().append("g").classed("errorbar",!0);o&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),e.setClipUrl(A,u.layerClipId,y),A.each(function(S){var T=b.select(this),p=function(N,V,j){var $={x:V.c2p(N.x),y:j.c2p(N.y)};return N.yh!==void 0&&($.yh=j.c2p(N.yh),$.ys=j.c2p(N.ys),d($.ys)||($.noYS=!0,$.ys=j.c2p(N.ys,!0))),N.xh!==void 0&&($.xh=V.c2p(N.xh),$.xs=V.c2p(N.xs),d($.xs)||($.noXS=!0,$.xs=V.c2p(N.xs,!0))),$}(S,n,l);if(!k||S.vis){var M,f=T.select("path.yerror");if(g.visible&&d(p.x)&&d(p.yh)&&d(p.ys)){var E=g.width;M="M"+(p.x-E)+","+p.yh+"h"+2*E+"m-"+E+",0V"+p.ys,p.noYS||(M+="m-"+E+",0h"+2*E),f.size()?o&&(f=f.transition().duration(r.duration).ease(r.easing)):f=T.append("path").style("vector-effect",s?"none":"non-scaling-stroke").classed("yerror",!0),f.attr("d",M)}else f.remove();var I=T.select("path.xerror");if(m.visible&&d(p.y)&&d(p.xh)&&d(p.xs)){var B=(m.copy_ystyle?g:m).width;M="M"+p.xh+","+(p.y-B)+"v"+2*B+"m0,-"+B+"H"+p.xs,p.noXS||(M+="m0,-"+B+"v"+2*B),I.size()?o&&(I=I.transition().duration(r.duration).ease(r.easing)):I=T.append("path").style("vector-effect",s?"none":"non-scaling-stroke").classed("xerror",!0),I.attr("d",M)}else I.remove()}})}})}},22800:function(D,L,t){var b=t(45568),d=t(78766);D.exports=function(e){e.each(function(w){var y=w[0].trace,_=y.error_y||{},u=y.error_x||{},r=b.select(this);r.selectAll("path.yerror").style("stroke-width",_.thickness+"px").call(d.stroke,_.color),u.copy_ystyle&&(u=_),r.selectAll("path.xerror").style("stroke-width",u.thickness+"px").call(d.stroke,u.color)})}},70192:function(D,L,t){var b=t(80337),d=t(6811).hoverlabel,e=t(93049).extendFlat;D.exports={hoverlabel:{bgcolor:e({},d.bgcolor,{arrayOk:!0}),bordercolor:e({},d.bordercolor,{arrayOk:!0}),font:b({arrayOk:!0,editType:"none"}),align:e({},d.align,{arrayOk:!0}),namelength:e({},d.namelength,{arrayOk:!0}),editType:"none"}}},83552:function(D,L,t){var b=t(34809),d=t(33626);function e(w,y,_,u){u=u||b.identity,Array.isArray(w)&&(y[0][_]=u(w))}D.exports=function(w){var y=w.calcdata,_=w._fullLayout;function u(s){return function(c){return b.coerceHoverinfo({hoverinfo:c},{_module:s._module},_)}}for(var r=0;r=0&&n.indexpt[0]._length||St<0||St>At[0]._length)return c.unhoverRaw(Se,Ee)}else Ft="xpx"in Ee?Ee.xpx:pt[0]._length/2,St="ypx"in Ee?Ee.ypx:At[0]._length/2;if(Ee.pointerX=Ft+pt[0]._offset,Ee.pointerY=St+At[0]._offset,Qe="xval"in Ee?g.flat(Pe,Ee.xval):g.p2c(pt,Ft),ft="yval"in Ee?g.flat(Pe,Ee.yval):g.p2c(At,St),!d(Qe[0])||!d(ft[0]))return w.warn("Fx.hover failed",Ee,Se),c.unhoverRaw(Se,Ee)}var Wt=1/0;function Zt(gn,qn){for(Ot=0;OtUt&&(rt.splice(0,Ut),Wt=rt[0].distance),Fe&&st!==0&&rt.length===0){Lt.distance=st,Lt.index=!1;var dn=at._module.hoverPoints(Lt,Tt,vt,"closest",{hoverLayer:de._hoverlayer});if(dn&&(dn=dn.filter(function(yr){return yr.spikeDistance<=st})),dn&&dn.length){var ln,An=dn.filter(function(yr){return yr.xa.showspikes&&yr.xa.spikesnap!=="hovered data"});if(An.length){var er=An[0];d(er.x0)&&d(er.y0)&&(ln=un(er),(!Et.vLinePoint||Et.vLinePoint.spikeDistance>ln.spikeDistance)&&(Et.vLinePoint=ln))}var br=dn.filter(function(yr){return yr.ya.showspikes&&yr.ya.spikesnap!=="hovered data"});if(br.length){var Tr=br[0];d(Tr.x0)&&d(Tr.y0)&&(ln=un(Tr),(!Et.hLinePoint||Et.hLinePoint.spikeDistance>ln.spikeDistance)&&(Et.hLinePoint=ln))}}}}}function on(gn,qn,Un){for(var tr,Wn=null,Bn=1/0,dn=0;dn0&&Math.abs(gn.distance)zn-1;Jn--)lr(rt[Jn]);rt=$n,mn()}var hr=Se._hoverdata,jr=[],ni=fe(Se),Or=ie(Se);for(yt=0;yt1||rt.length>1)||qe==="closest"&&Bt&&rt.length>1,bn=s.combine(de.plot_bgcolor||s.background,de.paper_bgcolor),Yn=ee(rt,{gd:Se,hovermode:qe,rotateLabels:ai,bgColor:bn,container:de._hoverlayer,outerContainer:de._paper.node(),commonLabelOpts:de.hoverlabel,hoverdistance:de.hoverdistance}),an=Yn.hoverLabels;if(g.isUnifiedHover(qe)||(function(gn,qn,Un,tr){var Wn,Bn,dn,ln,An,er,br,Tr=qn?"xa":"ya",yr=qn?"ya":"xa",Ur=0,Rr=1,$r=gn.size(),Pr=new Array($r),Cr=0,Jr=tr.minX,gi=tr.maxX,ii=tr.minY,Yr=tr.maxY,oi=function(Ki){return Ki*Un._invScaleX},Ti=function(Ki){return Ki*Un._invScaleY};function Wi(Ki){var os=Ki[0],To=Ki[Ki.length-1];if(Bn=os.pmin-os.pos-os.dp+os.size,dn=To.pos+To.dp+To.size-os.pmax,Bn>.01){for(An=Ki.length-1;An>=0;An--)Ki[An].dp+=Bn;Wn=!1}if(!(dn<.01)){if(Bn<-.01){for(An=Ki.length-1;An>=0;An--)Ki[An].dp-=dn;Wn=!1}if(Wn){var fo=0;for(ln=0;lnos.pmax&&fo++;for(ln=Ki.length-1;ln>=0&&!(fo<=0);ln--)(er=Ki[ln]).pos>os.pmax-1&&(er.del=!0,fo--);for(ln=0;ln=0;An--)Ki[An].dp-=dn;for(ln=Ki.length-1;ln>=0&&!(fo<=0);ln--)(er=Ki[ln]).pos+er.dp+er.size>os.pmax&&(er.del=!0,fo--)}}}for(gn.each(function(Ki){var os=Ki[Tr],To=Ki[yr],fo=os._id.charAt(0)==="x",Os=os.range;Cr===0&&Os&&Os[0]>Os[1]!==fo&&(Rr=-1);var Ta=0,ws=fo?Un.width:Un.height;if(Un.hovermode==="x"||Un.hovermode==="y"){var Bl,Ql,ss=J(Ki,qn),eu=Ki.anchor,vl=eu==="end"?-1:1;if(eu==="middle")Ql=(Bl=Ki.crossPos+(fo?Ti(ss.y-Ki.by/2):oi(Ki.bx/2+Ki.tx2width/2)))+(fo?Ti(Ki.by):oi(Ki.bx));else if(fo)Ql=(Bl=Ki.crossPos+Ti(E+ss.y)-Ti(Ki.by/2-E))+Ti(Ki.by);else{var Za=oi(vl*E+ss.x),ko=Za+oi(vl*Ki.bx);Bl=Ki.crossPos+Math.min(Za,ko),Ql=Ki.crossPos+Math.max(Za,ko)}fo?ii!==void 0&&Yr!==void 0&&Math.min(Ql,Yr)-Math.max(Bl,ii)>1&&(To.side==="left"?(Ta=To._mainLinePosition,ws=Un.width):ws=To._mainLinePosition):Jr!==void 0&&gi!==void 0&&Math.min(Ql,gi)-Math.max(Bl,Jr)>1&&(To.side==="top"?(Ta=To._mainLinePosition,ws=Un.height):ws=To._mainLinePosition)}Pr[Cr++]=[{datum:Ki,traceIndex:Ki.trace.index,dp:0,pos:Ki.pos,posref:Ki.posref,size:Ki.by*(fo?p:1)/2,pmin:Ta,pmax:ws}]}),Pr.sort(function(Ki,os){return Ki[0].posref-os[0].posref||Rr*(os[0].traceIndex-Ki[0].traceIndex)});!Wn&&Ur<=$r;){for(Ur++,Wn=!0,ln=0;ln.01){for(An=ji.length-1;An>=0;An--)ji[An].dp+=Bn;for(Pa.push.apply(Pa,ji),Pr.splice(ln+1,1),br=0,An=Pa.length-1;An>=0;An--)br+=Pa[An].dp;for(dn=br/Pa.length,An=Pa.length-1;An>=0;An--)Pa[An].dp-=dn;Wn=!1}else ln++}Pr.forEach(Wi)}for(ln=Pr.length-1;ln>=0;ln--){var Oa=Pr[ln];for(An=Oa.length-1;An>=0;An--){var bs=Oa[An],lo=bs.datum;lo.offset=bs.dp,lo.del=bs.del}}}(an,ai,de,Yn.commonLabelBoundingBox),Q(an,ai,de._invScaleX,de._invScaleY)),Oe&&Oe.tagName){var _n=m.getComponentMethod("annotations","hasClickToShow")(Se,jr);l(b.select(Oe),_n?"pointer":"")}Oe&&!Le&&function(gn,qn,Un){if(!Un||Un.length!==gn._hoverdata.length)return!0;for(var tr=Un.length-1;tr>=0;tr--){var Wn=Un[tr],Bn=gn._hoverdata[tr];if(Wn.curveNumber!==Bn.curveNumber||String(Wn.pointNumber)!==String(Bn.pointNumber)||String(Wn.pointNumbers)!==String(Bn.pointNumbers))return!0}return!1}(Se,0,hr)&&(hr&&Se.emit("plotly_unhover",{event:Ee,points:hr}),Se.emit("plotly_hover",{event:Ee,points:Se._hoverdata,xaxes:pt,yaxes:At,xvals:Qe,yvals:ft}))})(le,ge,ye,me,be)})},L.loneHover=function(le,ge){var ye=!0;Array.isArray(le)||(ye=!1,le=[le]);var me=ge.gd,be=fe(me),Se=ie(me),Ee=ee(le.map(function(Oe){var We=Oe._x0||Oe.x0||Oe.x||0,Ie=Oe._x1||Oe.x1||Oe.x||0,Ve=Oe._y0||Oe.y0||Oe.y||0,Pe=Oe._y1||Oe.y1||Oe.y||0,de=Oe.eventData;if(de){var Me=Math.min(We,Ie),ke=Math.max(We,Ie),He=Math.min(Ve,Pe),Fe=Math.max(Ve,Pe),qe=Oe.trace;if(m.traceIs(qe,"gl3d")){var $e=me._fullLayout[qe.scene]._scene.container,Ye=$e.offsetLeft,_e=$e.offsetTop;Me+=Ye,ke+=Ye,He+=_e,Fe+=_e}de.bbox={x0:Me+Se,x1:ke+Se,y0:He+be,y1:Fe+be},ge.inOut_bbox&&ge.inOut_bbox.push(de.bbox)}else de=!1;return{color:Oe.color||s.defaultLine,x0:Oe.x0||Oe.x||0,x1:Oe.x1||Oe.x||0,y0:Oe.y0||Oe.y||0,y1:Oe.y1||Oe.y||0,xLabel:Oe.xLabel,yLabel:Oe.yLabel,zLabel:Oe.zLabel,text:Oe.text,name:Oe.name,idealAlign:Oe.idealAlign,borderColor:Oe.borderColor,fontFamily:Oe.fontFamily,fontSize:Oe.fontSize,fontColor:Oe.fontColor,fontWeight:Oe.fontWeight,fontStyle:Oe.fontStyle,fontVariant:Oe.fontVariant,nameLength:Oe.nameLength,textAlign:Oe.textAlign,trace:Oe.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Oe.hovertemplate||!1,hovertemplateLabels:Oe.hovertemplateLabels||!1,eventData:de}}),{gd:me,hovermode:"closest",rotateLabels:!1,bgColor:ge.bgColor||s.background,container:b.select(ge.container),outerContainer:ge.outerContainer||ge.container}).hoverLabels,Ce=0,Le=0;return Ee.sort(function(Oe,We){return Oe.y0-We.y0}).each(function(Oe,We){var Ie=Oe.y0-Oe.by/2;Oe.offset=Ie-5([\s\S]*)<\/extra>/;function ee(le,ge){var ye=ge.gd,me=ye._fullLayout,be=ge.hovermode,Se=ge.rotateLabels,Ee=ge.bgColor,Ce=ge.container,Le=ge.outerContainer,Oe=ge.commonLabelOpts||{};if(le.length===0)return[[]];var We=ge.fontFamily||k.HOVERFONT,Ie=ge.fontSize||k.HOVERFONTSIZE,Ve=ge.fontWeight||me.font.weight,Pe=ge.fontStyle||me.font.style,de=ge.fontVariant||me.font.variant,Me=ge.fontTextcase||me.font.textcase,ke=ge.fontLineposition||me.font.lineposition,He=ge.fontShadow||me.font.shadow,Fe=le[0],qe=Fe.xa,$e=Fe.ya,Ye=be.charAt(0),_e=Ye+"Label",De=Fe[_e];if(De===void 0&&qe.type==="multicategory")for(var Be=0;Beme.width-hr&&(jr=me.width-hr),Kn.attr("d","M"+($n-jr)+",0L"+($n-jr+E)+","+lr+E+"H"+hr+"v"+lr+(2*I+Qn.height)+"H"+-hr+"V"+lr+E+"H"+($n-jr-E)+"Z"),$n=jr,Qe.minX=$n-hr,Qe.maxX=$n+hr,qe.side==="top"?(Qe.minY=vr-(2*I+Qn.height),Qe.maxY=vr-I):(Qe.minY=vr+I,Qe.maxY=vr+(2*I+Qn.height))}else{var ni,Or,Ar;$e.side==="right"?(ni="start",Or=1,Ar="",$n=qe._offset+qe._length):(ni="end",Or=-1,Ar="-",$n=qe._offset),vr=$e._offset+(Fe.y0+Fe.y1)/2,Ln.attr("text-anchor",ni),Kn.attr("d","M0,0L"+Ar+E+","+E+"V"+(I+Qn.height/2)+"h"+Ar+(2*I+Qn.width)+"V-"+(I+Qn.height/2)+"H"+Ar+E+"V-"+E+"Z"),Qe.minY=vr-(I+Qn.height/2),Qe.maxY=vr+(I+Qn.height/2),$e.side==="right"?(Qe.minX=$n+E,Qe.maxX=$n+E+(2*I+Qn.width)):(Qe.minX=$n-E-(2*I+Qn.width),Qe.maxX=$n-E);var xr,Qr=Qn.height/2,kn=tt-Qn.top-Qr,Cn="clip"+me._uid+"commonlabel"+$e._id;if($n=0?Et:Bt+Jt=0?Bt:Dn+Jt=0?rt:et+qt=0?et:In+qt=0,En.idealAlign!=="top"&&Zn||!cr?Zn?(Ar+=Qr/2,En.anchor="start"):En.anchor="middle":(Ar-=Qr/2,En.anchor="end"),En.crossPos=Ar;else{if(En.pos=Ar,Zn=Or+xr/2+Ir<=nt,cr=Or-xr/2-Ir>=0,En.idealAlign!=="left"&&Zn||!cr)if(Zn)Or+=xr/2,En.anchor="start";else{En.anchor="middle";var Er=Ir/2,Xr=Or+Er-nt,ai=Or-Er;Xr>0&&(Or-=Xr),ai<0&&(Or+=-ai)}else Or-=xr/2,En.anchor="end";En.crossPos=Or}Qn.attr("text-anchor",En.anchor),hr&&lr.attr("text-anchor",En.anchor),Kn.attr("transform",_(Or,Ar)+(Se?u(S):""))}),{hoverLabels:mn,commonLabelBoundingBox:Qe}}function H(le,ge,ye,me,be,Se){var Ee="",Ce="";le.nameOverride!==void 0&&(le.name=le.nameOverride),le.name&&(le.trace._meta&&(le.name=w.templateString(le.name,le.trace._meta)),Ee=se(le.name,le.nameLength));var Le=ye.charAt(0),Oe=Le==="x"?"y":"x";le.zLabel!==void 0?(le.xLabel!==void 0&&(Ce+="x: "+le.xLabel+"
"),le.yLabel!==void 0&&(Ce+="y: "+le.yLabel+"
"),le.trace.type!=="choropleth"&&le.trace.type!=="choroplethmapbox"&&le.trace.type!=="choroplethmap"&&(Ce+=(Ce?"z: ":"")+le.zLabel)):ge&&le[Le+"Label"]===be?Ce=le[Oe+"Label"]||"":le.xLabel===void 0?le.yLabel!==void 0&&le.trace.type!=="scattercarpet"&&(Ce=le.yLabel):Ce=le.yLabel===void 0?le.xLabel:"("+le.xLabel+", "+le.yLabel+")",!le.text&&le.text!==0||Array.isArray(le.text)||(Ce+=(Ce?"
":"")+le.text),le.extraText!==void 0&&(Ce+=(Ce?"
":"")+le.extraText),Se&&Ce===""&&!le.hovertemplate&&(Ee===""&&Se.remove(),Ce=Ee);var We=le.hovertemplate||!1;if(We){var Ie=le.hovertemplateLabels||le;le[Le+"Label"]!==be&&(Ie[Le+"other"]=Ie[Le+"Val"],Ie[Le+"otherLabel"]=Ie[Le+"Label"]),Ce=(Ce=w.hovertemplateString(We,Ie,me._d3locale,le.eventData[0]||{},le.trace._meta)).replace($,function(Ve,Pe){return Ee=se(Pe,le.nameLength),""})}return[Ce,Ee]}function J(le,ge){var ye=0,me=le.offset;return ge&&(me*=-f,ye=le.offset*M),{x:ye,y:me}}function Q(le,ge,ye,me){var be=function(Ee){return Ee*ye},Se=function(Ee){return Ee*me};le.each(function(Ee){var Ce=b.select(this);if(Ee.del)return Ce.remove();var Le,Oe,We,Ie,Ve=Ce.select("text.nums"),Pe=Ee.anchor,de=Pe==="end"?-1:1,Me=(Ie=(We=(Oe={start:1,end:-1,middle:0}[(Le=Ee).anchor])*(E+I))+Oe*(Le.txwidth+I),Le.anchor==="middle"&&(We-=Le.tx2width/2,Ie+=Le.txwidth/2+I),{alignShift:Oe,textShiftX:We,text2ShiftX:Ie}),ke=J(Ee,ge),He=ke.x,Fe=ke.y,qe=Pe==="middle";Ce.select("path").attr("d",qe?"M-"+be(Ee.bx/2+Ee.tx2width/2)+","+Se(Fe-Ee.by/2)+"h"+be(Ee.bx)+"v"+Se(Ee.by)+"h-"+be(Ee.bx)+"Z":"M0,0L"+be(de*E+He)+","+Se(E+Fe)+"v"+Se(Ee.by/2-E)+"h"+be(de*Ee.bx)+"v-"+Se(Ee.by)+"H"+be(de*E+He)+"V"+Se(Fe-E)+"Z");var $e=He+Me.textShiftX,Ye=Fe+Ee.ty0-Ee.by/2+I,_e=Ee.textAlign||"auto";_e!=="auto"&&(_e==="left"&&Pe!=="start"?(Ve.attr("text-anchor","start"),$e=qe?-Ee.bx/2-Ee.tx2width/2+I:-Ee.bx-I):_e==="right"&&Pe!=="end"&&(Ve.attr("text-anchor","end"),$e=qe?Ee.bx/2-Ee.tx2width/2-I:Ee.bx+I)),Ve.call(n.positionText,be($e),Se(Ye)),Ee.tx2width&&(Ce.select("text.name").call(n.positionText,be(Me.text2ShiftX+Me.alignShift*I+He),Se(Fe+Ee.ty0-Ee.by/2+I)),Ce.select("rect").call(o.setRect,be(Me.text2ShiftX+(Me.alignShift-1)*Ee.tx2width/2+He),Se(Fe-Ee.by/2-1),be(Ee.tx2width),Se(Ee.by+2)))})}function Z(le,ge){var ye=le.index,me=le.trace||{},be=le.cd[0],Se=le.cd[ye]||{};function Ee(Ve){return Ve||d(Ve)&&Ve===0}var Ce=Array.isArray(ye)?function(Ve,Pe){var de=w.castOption(be,ye,Ve);return Ee(de)?de:w.extractOption({},me,"",Pe)}:function(Ve,Pe){return w.extractOption(Se,me,Ve,Pe)};function Le(Ve,Pe,de){var Me=Ce(Pe,de);Ee(Me)&&(le[Ve]=Me)}if(Le("hoverinfo","hi","hoverinfo"),Le("bgcolor","hbg","hoverlabel.bgcolor"),Le("borderColor","hbc","hoverlabel.bordercolor"),Le("fontFamily","htf","hoverlabel.font.family"),Le("fontSize","hts","hoverlabel.font.size"),Le("fontColor","htc","hoverlabel.font.color"),Le("fontWeight","htw","hoverlabel.font.weight"),Le("fontStyle","hty","hoverlabel.font.style"),Le("fontVariant","htv","hoverlabel.font.variant"),Le("nameLength","hnl","hoverlabel.namelength"),Le("textAlign","hta","hoverlabel.align"),le.posref=ge==="y"||ge==="closest"&&me.orientation==="h"?le.xa._offset+(le.x0+le.x1)/2:le.ya._offset+(le.y0+le.y1)/2,le.x0=w.constrain(le.x0,0,le.xa._length),le.x1=w.constrain(le.x1,0,le.xa._length),le.y0=w.constrain(le.y0,0,le.ya._length),le.y1=w.constrain(le.y1,0,le.ya._length),le.xLabelVal!==void 0&&(le.xLabel="xLabel"in le?le.xLabel:h.hoverLabelText(le.xa,le.xLabelVal,me.xhoverformat),le.xVal=le.xa.c2d(le.xLabelVal)),le.yLabelVal!==void 0&&(le.yLabel="yLabel"in le?le.yLabel:h.hoverLabelText(le.ya,le.yLabelVal,me.yhoverformat),le.yVal=le.ya.c2d(le.yLabelVal)),le.zLabelVal!==void 0&&le.zLabel===void 0&&(le.zLabel=String(le.zLabelVal)),!(isNaN(le.xerr)||le.xa.type==="log"&&le.xerr<=0)){var Oe=h.tickText(le.xa,le.xa.c2l(le.xerr),"hover").text;le.xerrneg!==void 0?le.xLabel+=" +"+Oe+" / -"+h.tickText(le.xa,le.xa.c2l(le.xerrneg),"hover").text:le.xLabel+=" ± "+Oe,ge==="x"&&(le.distance+=1)}if(!(isNaN(le.yerr)||le.ya.type==="log"&&le.yerr<=0)){var We=h.tickText(le.ya,le.ya.c2l(le.yerr),"hover").text;le.yerrneg!==void 0?le.yLabel+=" +"+We+" / -"+h.tickText(le.ya,le.ya.c2l(le.yerrneg),"hover").text:le.yLabel+=" ± "+We,ge==="y"&&(le.distance+=1)}var Ie=le.hoverinfo||le.trace.hoverinfo;return Ie&&Ie!=="all"&&((Ie=Array.isArray(Ie)?Ie:Ie.split("+")).indexOf("x")===-1&&(le.xLabel=void 0),Ie.indexOf("y")===-1&&(le.yLabel=void 0),Ie.indexOf("z")===-1&&(le.zLabel=void 0),Ie.indexOf("text")===-1&&(le.text=void 0),Ie.indexOf("name")===-1&&(le.name=void 0)),le}function K(le,ge,ye){var me,be,Se=ye.container,Ee=ye.fullLayout,Ce=Ee._size,Le=ye.event,Oe=!!ge.hLinePoint,We=!!ge.vLinePoint;if(Se.selectAll(".spikeline").remove(),We||Oe){var Ie=s.combine(Ee.plot_bgcolor,Ee.paper_bgcolor);if(Oe){var Ve,Pe,de=ge.hLinePoint;me=de&&de.xa,(be=de&&de.ya).spikesnap==="cursor"?(Ve=Le.pointerX,Pe=Le.pointerY):(Ve=me._offset+de.x,Pe=be._offset+de.y);var Me,ke,He=e.readability(de.color,Ie)<1.5?s.contrast(Ie):de.color,Fe=be.spikemode,qe=be.spikethickness,$e=be.spikecolor||He,Ye=h.getPxPosition(le,be);if(Fe.indexOf("toaxis")!==-1||Fe.indexOf("across")!==-1){if(Fe.indexOf("toaxis")!==-1&&(Me=Ye,ke=Ve),Fe.indexOf("across")!==-1){var _e=be._counterDomainMin,De=be._counterDomainMax;be.anchor==="free"&&(_e=Math.min(_e,be.position),De=Math.max(De,be.position)),Me=Ce.l+_e*Ce.w,ke=Ce.l+De*Ce.w}Se.insert("line",":first-child").attr({x1:Me,x2:ke,y1:Pe,y2:Pe,"stroke-width":qe,stroke:$e,"stroke-dasharray":o.dashStyle(be.spikedash,qe)}).classed("spikeline",!0).classed("crisp",!0),Se.insert("line",":first-child").attr({x1:Me,x2:ke,y1:Pe,y2:Pe,"stroke-width":qe+2,stroke:Ie}).classed("spikeline",!0).classed("crisp",!0)}Fe.indexOf("marker")!==-1&&Se.insert("circle",":first-child").attr({cx:Ye+(be.side!=="right"?qe:-qe),cy:Pe,r:qe,fill:$e}).classed("spikeline",!0)}if(We){var Be,Ge,tt=ge.vLinePoint;me=tt&&tt.xa,be=tt&&tt.ya,me.spikesnap==="cursor"?(Be=Le.pointerX,Ge=Le.pointerY):(Be=me._offset+tt.x,Ge=be._offset+tt.y);var nt,pt,At=e.readability(tt.color,Ie)<1.5?s.contrast(Ie):tt.color,wt=me.spikemode,Nt=me.spikethickness,Ht=me.spikecolor||At,Gt=h.getPxPosition(le,me);if(wt.indexOf("toaxis")!==-1||wt.indexOf("across")!==-1){if(wt.indexOf("toaxis")!==-1&&(nt=Gt,pt=Ge),wt.indexOf("across")!==-1){var st=me._counterDomainMin,Qe=me._counterDomainMax;me.anchor==="free"&&(st=Math.min(st,me.position),Qe=Math.max(Qe,me.position)),nt=Ce.t+(1-Qe)*Ce.h,pt=Ce.t+(1-st)*Ce.h}Se.insert("line",":first-child").attr({x1:Be,x2:Be,y1:nt,y2:pt,"stroke-width":Nt,stroke:Ht,"stroke-dasharray":o.dashStyle(me.spikedash,Nt)}).classed("spikeline",!0).classed("crisp",!0),Se.insert("line",":first-child").attr({x1:Be,x2:Be,y1:nt,y2:pt,"stroke-width":Nt+2,stroke:Ie}).classed("spikeline",!0).classed("crisp",!0)}wt.indexOf("marker")!==-1&&Se.insert("circle",":first-child").attr({cx:Be,cy:Gt-(me.side!=="top"?Nt:-Nt),r:Nt,fill:Ht}).classed("spikeline",!0)}}}function ae(le,ge){return!ge||ge.vLinePoint!==le._spikepoints.vLinePoint||ge.hLinePoint!==le._spikepoints.hLinePoint}function se(le,ge){return n.plainText(le||"",{len:ge,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function he(le,ge,ye){var me=ge[le+"a"],be=ge[le+"Val"],Se=ge.cd[0];if(me.type==="category"||me.type==="multicategory")be=me._categoriesMap[be];else if(me.type==="date"){var Ee=ge.trace[le+"periodalignment"];if(Ee){var Ce=ge.cd[ge.index],Le=Ce[le+"Start"];Le===void 0&&(Le=Ce[le]);var Oe=Ce[le+"End"];Oe===void 0&&(Oe=Ce[le]);var We=Oe-Le;Ee==="end"?be+=We:Ee==="middle"&&(be+=We/2)}be=me.d2c(be)}return Se&&Se.t&&Se.t.posLetter===me._id&&(ye.boxmode!=="group"&&ye.violinmode!=="group"||(be+=Se.t.dPos)),be}function fe(le){return le.offsetTop+le.clientTop}function ie(le){return le.offsetLeft+le.clientLeft}function oe(le,ge){var ye=le._fullLayout,me=ge.getBoundingClientRect(),be=me.left,Se=me.top,Ee=be+me.width,Ce=Se+me.height,Le=w.apply3DTransform(ye._invTransform)(be,Se),Oe=w.apply3DTransform(ye._invTransform)(Ee,Ce),We=Le[0],Ie=Le[1],Ve=Oe[0],Pe=Oe[1];return{x:We,y:Ie,width:Ve-We,height:Pe-Ie,top:Math.min(Ie,Pe),left:Math.min(We,Ve),right:Math.max(We,Ve),bottom:Math.max(Ie,Pe)}}},26430:function(D,L,t){var b=t(34809),d=t(78766),e=t(36040).isUnifiedHover;D.exports=function(w,y,_,u){u=u||{};var r=y.legend;function n(l){u.font[l]||(u.font[l]=r?y.legend.font[l]:y.font[l])}y&&e(y.hovermode)&&(u.font||(u.font={}),n("size"),n("family"),n("color"),n("weight"),n("style"),n("variant"),r?(u.bgcolor||(u.bgcolor=d.combine(y.legend.bgcolor,y.paper_bgcolor)),u.bordercolor||(u.bordercolor=y.legend.bordercolor)):u.bgcolor||(u.bgcolor=y.paper_bgcolor)),_("hoverlabel.bgcolor",u.bgcolor),_("hoverlabel.bordercolor",u.bordercolor),_("hoverlabel.namelength",u.namelength),b.coerceFont(_,"hoverlabel.font",u.font),_("hoverlabel.align",u.align)}},45265:function(D,L,t){var b=t(34809),d=t(6811);D.exports=function(e,w){function y(_,u){return w[_]!==void 0?w[_]:b.coerce(e,w,d,_,u)}return y("clickmode"),y("hoversubplots"),y("hovermode")}},32141:function(D,L,t){var b=t(45568),d=t(34809),e=t(14751),w=t(36040),y=t(6811),_=t(38103);D.exports={moduleType:"component",name:"fx",constants:t(85988),schema:{layout:y},attributes:t(70192),layoutAttributes:y,supplyLayoutGlobalDefaults:t(5358),supplyDefaults:t(3239),supplyLayoutDefaults:t(8412),calc:t(83552),getDistanceFunction:w.getDistanceFunction,getClosest:w.getClosest,inbox:w.inbox,quadrature:w.quadrature,appendArrayPointValue:w.appendArrayPointValue,castHoverOption:function(u,r,n){return d.castOption(u,r,"hoverlabel."+n)},castHoverinfo:function(u,r,n){return d.castOption(u,n,"hoverinfo",function(l){return d.coerceHoverinfo({hoverinfo:l},{_module:u._module},r)})},hover:_.hover,unhover:e.unhover,loneHover:_.loneHover,loneUnhover:function(u){var r=d.isD3Selection(u)?u:b.select(u);r.selectAll("g.hovertext").remove(),r.selectAll(".spikeline").remove()},click:t(94225)}},6811:function(D,L,t){var b=t(85988),d=t(80337),e=d({editType:"none"});e.family.dflt=b.HOVERFONT,e.size.dflt=b.HOVERFONTSIZE,D.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:e,grouptitlefont:d({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},8412:function(D,L,t){var b=t(34809),d=t(6811),e=t(45265),w=t(26430);D.exports=function(y,_){function u(s,c){return b.coerce(y,_,d,s,c)}e(y,_)&&(u("hoverdistance"),u("spikedistance")),u("dragmode")==="select"&&u("selectdirection");var r=_._has("mapbox"),n=_._has("map"),l=_._has("geo"),o=_._basePlotModules.length;_.dragmode==="zoom"&&((r||n||l)&&o===1||(r||n)&&l&&o===2)&&(_.dragmode="pan"),w(y,_,u),b.coerceFont(u,"hoverlabel.grouptitlefont",_.hoverlabel.font)}},5358:function(D,L,t){var b=t(34809),d=t(26430),e=t(6811);D.exports=function(w,y){d(w,y,function(_,u){return b.coerce(w,y,e,_,u)})}},83595:function(D,L,t){var b=t(34809),d=t(90694).counter,e=t(13792).u,w=t(54826).idRegex,y=t(78032),_={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[d("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[w.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[w.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:e({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(l,o,s){var c=o[s+"axes"],h=Object.keys((l._splomAxes||{})[s]||{});return Array.isArray(c)?c:h.length?h:void 0}function r(l,o,s,c,h,x){var m=o(l+"gap",s),g=o("domain."+l);o(l+"side",c);for(var k=new Array(h),A=g[0],v=(g[1]-A)/(h-m),S=v*(1-m),T=0;T1){g||k||A||N("pattern")==="independent"&&(g=!0),S._hasSubplotGrid=g;var M,f,E=N("roworder")==="top to bottom",I=g?.2:.1,B=g?.3:.1;v&&o._splomGridDflt&&(M=o._splomGridDflt.xside,f=o._splomGridDflt.yside),S._domains={x:r("x",N,I,M,p),y:r("y",N,B,f,T,E)}}else delete o.grid}function N(V,j){return b.coerce(s,S,_,V,j)}},contentDefaults:function(l,o){var s=o.grid;if(s&&s._domains){var c,h,x,m,g,k,A,v=l.grid||{},S=o._subplots,T=s._hasSubplotGrid,p=s.rows,M=s.columns,f=s.pattern==="independent",E=s._axisMap={};if(T){var I=v.subplots||[];k=s.subplots=new Array(p);var B=1;for(c=0;c(n==="legend"?1:0));if(B===!1&&(o[n]=void 0),(B!==!1||c.uirevision)&&(x("uirevision",o.uirevision),B!==!1)){x("borderwidth");var N,V,j,$=x("orientation")==="h",ee=x("yref")==="paper",H=x("xref")==="paper",J="left";if($?(N=0,b.getComponentMethod("rangeslider","isVisible")(l.xaxis)?ee?(V=1.1,j="bottom"):(V=1,j="top"):ee?(V=-.1,j="top"):(V=0,j="bottom")):(V=1,j="auto",H?N=1.02:(N=1,J="right")),d.coerce(c,h,{x:{valType:"number",editType:"legend",min:H?-2:0,max:H?3:1,dflt:N}},"x"),d.coerce(c,h,{y:{valType:"number",editType:"legend",min:ee?-2:0,max:ee?3:1,dflt:V}},"y"),x("traceorder",p),u.isGrouped(o[n])&&x("tracegroupgap"),x("entrywidth"),x("entrywidthmode"),x("indentation"),x("itemsizing"),x("itemwidth"),x("itemclick"),x("itemdoubleclick"),x("groupclick"),x("xanchor",J),x("yanchor",j),x("valign"),d.noneOrAll(c,h,["x","y"]),x("title.text")){x("title.side",$?"left":"top");var Q=d.extendFlat({},m,{size:d.bigFont(m.size)});d.coerceFont(x,"title.font",Q)}}}}D.exports=function(n,l,o){var s,c=o.slice(),h=l.shapes;if(h)for(s=0;s1)}var le=Q.hiddenlabels||[];if(!(K||Q.showlegend&&ae.length))return H.selectAll("."+Z).remove(),Q._topdefs.select("#"+ee).remove(),e.autoMargin(j,Z);var ge=d.ensureSingle(H,"g",Z,function(We){K||We.attr("pointer-events","all")}),ye=d.ensureSingleById(Q._topdefs,"clipPath",ee,function(We){We.append("rect")}),me=d.ensureSingle(ge,"rect","bg",function(We){We.attr("shape-rendering","crispEdges")});me.call(r.stroke,J.bordercolor).call(r.fill,J.bgcolor).style("stroke-width",J.borderwidth+"px");var be,Se=d.ensureSingle(ge,"g","scrollbox"),Ee=J.title;J._titleWidth=0,J._titleHeight=0,Ee.text?((be=d.ensureSingle(Se,"text",Z+"titletext")).attr("text-anchor","start").call(u.font,Ee.font).text(Ee.text),I(be,Se,j,J,A)):Se.selectAll("."+Z+"titletext").remove();var Ce=d.ensureSingle(ge,"rect","scrollbar",function(We){We.attr(o.scrollBarEnterAttrs).call(r.fill,o.scrollBarColor)}),Le=Se.selectAll("g.groups").data(ae);Le.enter().append("g").attr("class","groups"),Le.exit().remove();var Oe=Le.selectAll("g.traces").data(d.identity);Oe.enter().append("g").attr("class","traces"),Oe.exit().remove(),Oe.style("opacity",function(We){var Ie=We[0].trace;return w.traceIs(Ie,"pie-like")?le.indexOf(We[0].label)!==-1?.5:1:Ie.visible==="legendonly"?.5:1}).each(function(){b.select(this).call(M,j,J)}).call(g,j,J).each(function(){K||b.select(this).call(E,j,Z)}),d.syncOrAsync([e.previousPromises,function(){return function(We,Ie,Ve,Pe){var de=We._fullLayout,Me=V(Pe);Pe||(Pe=de[Me]);var ke=de._size,He=k.isVertical(Pe),Fe=k.isGrouped(Pe),qe=Pe.entrywidthmode==="fraction",$e=Pe.borderwidth,Ye=2*$e,_e=o.itemGap,De=Pe.indentation+Pe.itemwidth+2*_e,Be=2*($e+_e),Ge=N(Pe),tt=Pe.y<0||Pe.y===0&&Ge==="top",nt=Pe.y>1||Pe.y===1&&Ge==="bottom",pt=Pe.tracegroupgap,At={};Pe._maxHeight=Math.max(tt||nt?de.height/2:ke.h,30);var wt=0;Pe._width=0,Pe._height=0;var Nt=function(Bt){var Ft=0,St=0,Jt=Bt.title.side;return Jt&&(Jt.indexOf("left")!==-1&&(Ft=Bt._titleWidth),Jt.indexOf("top")!==-1&&(St=Bt._titleHeight)),[Ft,St]}(Pe);if(He)Ve.each(function(Bt){var Ft=Bt[0].height;u.setTranslate(this,$e+Nt[0],$e+Nt[1]+Pe._height+Ft/2+_e),Pe._height+=Ft,Pe._width=Math.max(Pe._width,Bt[0].width)}),wt=De+Pe._width,Pe._width+=_e+De+Ye,Pe._height+=Be,Fe&&(Ie.each(function(Bt,Ft){u.setTranslate(this,0,Ft*Pe.tracegroupgap)}),Pe._height+=(Pe._lgroupsLength-1)*Pe.tracegroupgap);else{var Ht=B(Pe),Gt=Pe.x<0||Pe.x===0&&Ht==="right",st=Pe.x>1||Pe.x===1&&Ht==="left",Qe=nt||tt,ft=de.width/2;Pe._maxWidth=Math.max(Gt?Qe&&Ht==="left"?ke.l+ke.w:ft:st?Qe&&Ht==="right"?ke.r+ke.w:ft:ke.w,2*De);var yt=0,Ot=0;Ve.each(function(Bt){var Ft=T(Bt,Pe,De);yt=Math.max(yt,Ft),Ot+=Ft}),wt=null;var Pt=0;if(Fe){var at=0,lt=0,Xe=0;Ie.each(function(){var Bt=0,Ft=0;b.select(this).selectAll("g.traces").each(function(Jt){var qt=T(Jt,Pe,De),en=Jt[0].height;u.setTranslate(this,Nt[0],Nt[1]+$e+_e+en/2+Ft),Ft+=en,Bt=Math.max(Bt,qt),At[Jt[0].trace.legendgroup]=Bt});var St=Bt+_e;lt>0&&St+$e+lt>Pe._maxWidth?(Pt=Math.max(Pt,lt),lt=0,Xe+=at+pt,at=Ft):at=Math.max(at,Ft),u.setTranslate(this,lt,Xe),lt+=St}),Pe._width=Math.max(Pt,lt)+$e,Pe._height=Xe+at+Be}else{var ut=Ve.size(),Tt=Ot+Ye+(ut-1)*_e=Pe._maxWidth&&(Pt=Math.max(Pt,rt),Lt=0,Ut+=vt,Pe._height+=vt,vt=0),u.setTranslate(this,Nt[0]+$e+Lt,Nt[1]+$e+Ut+Ft/2+_e),rt=Lt+St+_e,Lt+=Jt,vt=Math.max(vt,Ft)}),Tt?(Pe._width=Lt+Ye,Pe._height=vt+Be):(Pe._width=Math.max(Pt,rt)+Ye,Pe._height+=vt+Be)}}Pe._width=Math.ceil(Math.max(Pe._width+Nt[0],Pe._titleWidth+2*($e+o.titlePad))),Pe._height=Math.ceil(Math.max(Pe._height+Nt[1],Pe._titleHeight+2*($e+o.itemGap))),Pe._effHeight=Math.min(Pe._height,Pe._maxHeight);var et=We._context.edits,Et=et.legendText||et.legendPosition;Ve.each(function(Bt){var Ft=b.select(this).select("."+Me+"toggle"),St=Bt[0].height,Jt=Bt[0].trace.legendgroup,qt=T(Bt,Pe,De);Fe&&Jt!==""&&(qt=At[Jt]);var en=Et?De:wt||qt;He||qe||(en+=_e/2),u.setRect(Ft,0,-St/2,en,St)})}(j,Le,Oe,J)},function(){var We,Ie,Ve,Pe,de=Q._size,Me=J.borderwidth,ke=J.xref==="paper",He=J.yref==="paper";if(Ee.text&&function(Qe,ft,yt){if(ft.title.side==="top center"||ft.title.side==="top right"){var Ot=ft.title.font.size*c,Pt=0,at=Qe.node(),lt=u.bBox(at).width;ft.title.side==="top center"?Pt=.5*(ft._width-2*yt-2*o.titlePad-lt):ft.title.side==="top right"&&(Pt=ft._width-2*yt-2*o.titlePad-lt),n.positionText(Qe,yt+o.titlePad+Pt,yt+Ot)}}(be,J,Me),!K){var Fe,qe;Fe=ke?de.l+de.w*J.x-h[B(J)]*J._width:Q.width*J.x-h[B(J)]*J._width,qe=He?de.t+de.h*(1-J.y)-h[N(J)]*J._effHeight:Q.height*(1-J.y)-h[N(J)]*J._effHeight;var $e=function(Qe,ft,yt,Ot){var Pt=Qe._fullLayout,at=Pt[ft],lt=B(at),Xe=N(at),ut=at.xref==="paper",Tt=at.yref==="paper";Qe._fullLayout._reservedMargin[ft]={};var vt=at.y<.5?"b":"t",Lt=at.x<.5?"l":"r",Ut={r:Pt.width-yt,l:yt+at._width,b:Pt.height-Ot,t:Ot+at._effHeight};if(ut&&Tt)return e.autoMargin(Qe,ft,{x:at.x,y:at.y,l:at._width*h[lt],r:at._width*x[lt],b:at._effHeight*x[Xe],t:at._effHeight*h[Xe]});ut?Qe._fullLayout._reservedMargin[ft][vt]=Ut[vt]:Tt||at.orientation==="v"?Qe._fullLayout._reservedMargin[ft][Lt]=Ut[Lt]:Qe._fullLayout._reservedMargin[ft][vt]=Ut[vt]}(j,Z,Fe,qe);if($e)return;if(Q.margin.autoexpand){var Ye=Fe,_e=qe;Fe=ke?d.constrain(Fe,0,Q.width-J._width):Ye,qe=He?d.constrain(qe,0,Q.height-J._effHeight):_e,Fe!==Ye&&d.log("Constrain "+Z+".x to make legend fit inside graph"),qe!==_e&&d.log("Constrain "+Z+".y to make legend fit inside graph")}u.setTranslate(ge,Fe,qe)}if(Ce.on(".drag",null),ge.on("wheel",null),K||J._height<=J._maxHeight||j._context.staticPlot){var De=J._effHeight;K&&(De=J._height),me.attr({width:J._width-Me,height:De-Me,x:Me/2,y:Me/2}),u.setTranslate(Se,0,0),ye.select("rect").attr({width:J._width-2*Me,height:De-2*Me,x:Me,y:Me}),u.setClipUrl(Se,ee,j),u.setRect(Ce,0,0,0,0),delete J._scrollY}else{var Be,Ge,tt,nt=Math.max(o.scrollBarMinHeight,J._effHeight*J._effHeight/J._height),pt=J._effHeight-nt-2*o.scrollBarMargin,At=J._height-J._effHeight,wt=pt/At,Nt=Math.min(J._scrollY||0,At);me.attr({width:J._width-2*Me+o.scrollBarWidth+o.scrollBarMargin,height:J._effHeight-Me,x:Me/2,y:Me/2}),ye.select("rect").attr({width:J._width-2*Me+o.scrollBarWidth+o.scrollBarMargin,height:J._effHeight-2*Me,x:Me,y:Me+Nt}),u.setClipUrl(Se,ee,j),st(Nt,nt,wt),ge.on("wheel",function(){st(Nt=d.constrain(J._scrollY+b.event.deltaY/pt*At,0,At),nt,wt),Nt!==0&&Nt!==At&&b.event.preventDefault()});var Ht=b.behavior.drag().on("dragstart",function(){var Qe=b.event.sourceEvent;Be=Qe.type==="touchstart"?Qe.changedTouches[0].clientY:Qe.clientY,tt=Nt}).on("drag",function(){var Qe=b.event.sourceEvent;Qe.buttons===2||Qe.ctrlKey||(Ge=Qe.type==="touchmove"?Qe.changedTouches[0].clientY:Qe.clientY,Nt=function(ft,yt,Ot){var Pt=(Ot-yt)/wt+ft;return d.constrain(Pt,0,At)}(tt,Be,Ge),st(Nt,nt,wt))});Ce.call(Ht);var Gt=b.behavior.drag().on("dragstart",function(){var Qe=b.event.sourceEvent;Qe.type==="touchstart"&&(Be=Qe.changedTouches[0].clientY,tt=Nt)}).on("drag",function(){var Qe=b.event.sourceEvent;Qe.type==="touchmove"&&(Ge=Qe.changedTouches[0].clientY,Nt=function(ft,yt,Ot){var Pt=(yt-Ot)/wt+ft;return d.constrain(Pt,0,At)}(tt,Be,Ge),st(Nt,nt,wt))});Se.call(Gt)}function st(Qe,ft,yt){J._scrollY=j._fullLayout[Z]._scrollY=Qe,u.setTranslate(Se,0,-Qe),u.setRect(Ce,J._width,o.scrollBarMargin+Qe*yt,o.scrollBarWidth,ft),ye.select("rect").attr("y",Me+Qe)}j._context.edits.legendPosition&&(ge.classed("cursor-move",!0),_.init({element:ge.node(),gd:j,prepFn:function(Qe){if(Qe.target!==Ce.node()){var ft=u.getTranslate(ge);Ve=ft.x,Pe=ft.y}},moveFn:function(Qe,ft){if(Ve!==void 0&&Pe!==void 0){var yt=Ve+Qe,Ot=Pe+ft;u.setTranslate(ge,yt,Ot),We=_.align(yt,J._width,de.l,de.l+de.w,J.xanchor),Ie=_.align(Ot+J._height,-J._height,de.t+de.h,de.t,J.yanchor)}},doneFn:function(){if(We!==void 0&&Ie!==void 0){var Qe={};Qe[Z+".x"]=We,Qe[Z+".y"]=Ie,w.call("_guiRelayout",j,Qe)}},clickFn:function(Qe,ft){var yt=H.selectAll("g.traces").filter(function(){var Ot=this.getBoundingClientRect();return ft.clientX>=Ot.left&&ft.clientX<=Ot.right&&ft.clientY>=Ot.top&&ft.clientY<=Ot.bottom});yt.size()>0&&p(j,ge,yt,Qe,ft)}}))}],j)}}function T(j,$,ee){var H=j[0],J=H.width,Q=$.entrywidthmode,Z=H.trace.legendwidth||$.entrywidth;return Q==="fraction"?$._maxWidth*Z:ee+(Z||J)}function p(j,$,ee,H,J){var Q=ee.data()[0][0].trace,Z={event:J,node:ee.node(),curveNumber:Q.index,expandedIndex:Q._expandedIndex,data:j.data,layout:j.layout,frames:j._transitionData._frames,config:j._context,fullData:j._fullData,fullLayout:j._fullLayout};Q._group&&(Z.group=Q._group),w.traceIs(Q,"pie-like")&&(Z.label=ee.datum()[0].label);var K=y.triggerHandler(j,"plotly_legendclick",Z);if(H===1){if(K===!1)return;$._clickTimeout=setTimeout(function(){j._fullLayout&&l(ee,j,H)},j._context.doubleClickDelay)}else H===2&&($._clickTimeout&&clearTimeout($._clickTimeout),j._legendMouseDownTime=0,y.triggerHandler(j,"plotly_legenddoubleclick",Z)!==!1&&K!==!1&&l(ee,j,H))}function M(j,$,ee){var H,J,Q=V(ee),Z=j.data()[0][0],K=Z.trace,ae=w.traceIs(K,"pie-like"),se=!ee._inHover&&$._context.edits.legendText&&!ae,he=ee._maxNameLength;Z.groupTitle?(H=Z.groupTitle.text,J=Z.groupTitle.font):(J=ee.font,ee.entries?H=Z.text:(H=ae?Z.label:K.name,K._meta&&(H=d.templateString(H,K._meta))));var fe=d.ensureSingle(j,"text",Q+"text");fe.attr("text-anchor","start").call(u.font,J).text(se?f(H,he):H);var ie=ee.indentation+ee.itemwidth+2*o.itemGap;n.positionText(fe,ie,0),se?fe.call(n.makeEditable,{gd:$,text:H}).call(I,j,$,ee).on("edit",function(oe){this.text(f(oe,he)).call(I,j,$,ee);var le=Z.trace._fullInput||{},ge={};if(w.hasTransform(le,"groupby")){var ye=w.getTransformIndices(le,"groupby"),me=ye[ye.length-1],be=d.keyedContainer(le,"transforms["+me+"].styles","target","value.name");be.set(Z.trace._group,oe),ge=be.constructUpdate()}else ge.name=oe;return le._isShape?w.call("_guiRelayout",$,"shapes["+K.index+"].name",ge.name):w.call("_guiRestyle",$,ge,K.index)}):I(fe,j,$,ee)}function f(j,$){var ee=Math.max(4,$);if(j&&j.trim().length>=ee/2)return j;for(var H=ee-(j=j||"").length;H>0;H--)j+=" ";return j}function E(j,$,ee){var H,J=$._context.doubleClickDelay,Q=1,Z=d.ensureSingle(j,"rect",ee+"toggle",function(K){$._context.staticPlot||K.style("cursor","pointer").attr("pointer-events","all"),K.call(r.fill,"rgba(0,0,0,0)")});$._context.staticPlot||(Z.on("mousedown",function(){(H=new Date().getTime())-$._legendMouseDownTimeJ&&(Q=Math.max(Q-1,1)),p($,K,j,Q,b.event)}}))}function I(j,$,ee,H,J){H._inHover&&j.attr("data-notex",!0),n.convertToTspans(j,ee,function(){(function(Q,Z,K,ae){var se=Q.data()[0][0];if(K._inHover||!se||se.trace.showlegend){var he=Q.select("g[class*=math-group]"),fe=he.node(),ie=V(K);K||(K=Z._fullLayout[ie]);var oe,le,ge=K.borderwidth,ye=(ae===A?K.title.font:se.groupTitle?se.groupTitle.font:K.font).size*c;if(fe){var me=u.bBox(fe);oe=me.height,le=me.width,ae===A?u.setTranslate(he,ge,ge+.75*oe):u.setTranslate(he,0,.25*oe)}else{var be="."+ie+(ae===A?"title":"")+"text",Se=Q.select(be),Ee=n.lineCount(Se),Ce=Se.node();if(oe=ye*Ee,le=Ce?u.bBox(Ce).width:0,ae===A)K.title.side==="left"&&(le+=2*o.itemGap),n.positionText(Se,ge+o.titlePad,ge+ye);else{var Le=2*o.itemGap+K.indentation+K.itemwidth;se.groupTitle&&(Le=o.itemGap,le-=K.indentation+K.itemwidth),n.positionText(Se,Le,-ye*((Ee-1)/2-.3))}}ae===A?(K._titleWidth=le,K._titleHeight=oe):(se.lineHeight=ye,se.height=Math.max(oe,16)+3,se.width=le)}else Q.remove()})($,ee,H,J)})}function B(j){return d.isRightAnchor(j)?"right":d.isCenterAnchor(j)?"center":"left"}function N(j){return d.isBottomAnchor(j)?"bottom":d.isMiddleAnchor(j)?"middle":"top"}function V(j){return j._id||"legend"}D.exports=function(j,$){if($)S(j,$);else{var ee=j._fullLayout,H=ee._legends;ee._infolayer.selectAll('[class^="legend"]').each(function(){var Z=b.select(this),K=Z.attr("class").split(" ")[0];K.match(v)&&H.indexOf(K)===-1&&Z.remove()});for(var J=0;JB&&(I=B)}f[_][0]._groupMinRank=I,f[_][0]._preGroupSort=_}var N=function(H,J){return H.trace.legendrank-J.trace.legendrank||H._preSort-J._preSort};for(f.forEach(function(H,J){H[0]._preGroupSort=J}),f.sort(function(H,J){return H[0]._groupMinRank-J[0]._groupMinRank||H[0]._preGroupSort-J[0]._preGroupSort}),_=0;_g?g:x}D.exports=function(x,m,g){var k=m._fullLayout;g||(g=k.legend);var A=g.itemsizing==="constant",v=g.itemwidth,S=(v+2*o.itemGap)/2,T=w(S,0),p=function(E,I,B,N){var V;if(E+1)V=E;else{if(!(I&&I.width>0))return 0;V=I.width}return A?N:Math.min(V,B)};function M(E,I,B){var N=E[0].trace,V=N.marker||{},j=V.line||{},$=V.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",ee=B?N.visible&&N.type===B:d.traceIs(N,"bar"),H=b.select(I).select("g.legendpoints").selectAll("path.legend"+B).data(ee?[E]:[]);H.enter().append("path").classed("legend"+B,!0).attr("d",$).attr("transform",T),H.exit().remove(),H.each(function(J){var Q=b.select(this),Z=J[0],K=p(Z.mlw,V.line,5,2);Q.style("stroke-width",K+"px");var ae=Z.mcc;if(!g._inHover&&"mc"in Z){var se=u(V),he=se.mid;he===void 0&&(he=(se.max+se.min)/2),ae=y.tryColorscale(V,"")(he)}var fe=ae||Z.mc||V.color,ie=V.pattern,oe=ie&&y.getPatternAttr(ie.shape,0,"");if(oe){var le=y.getPatternAttr(ie.bgcolor,0,null),ge=y.getPatternAttr(ie.fgcolor,0,null),ye=ie.fgopacity,me=h(ie.size,8,10),be=h(ie.solidity,.5,1),Se="legend-"+N.uid;Q.call(y.pattern,"legend",m,Se,oe,me,be,ae,ie.fillmode,le,ge,ye)}else Q.call(_.fill,fe);K&&_.stroke(Q,Z.mlc||j.color)})}function f(E,I,B){var N=E[0],V=N.trace,j=B?V.visible&&V.type===B:d.traceIs(V,B),$=b.select(I).select("g.legendpoints").selectAll("path.legend"+B).data(j?[E]:[]);if($.enter().append("path").classed("legend"+B,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),$.exit().remove(),$.size()){var ee=V.marker||{},H=p(l(ee.line.width,N.pts),ee.line,5,2),J="pieLike",Q=e.minExtend(V,{marker:{line:{width:H}}},J),Z=e.minExtend(N,{trace:Q},J);n($,Z,Q,m)}}x.each(function(E){var I=b.select(this),B=e.ensureSingle(I,"g","layers");B.style("opacity",E[0].trace.opacity);var N=g.indentation,V=g.valign,j=E[0].lineHeight,$=E[0].height;if(V==="middle"&&N===0||!j||!$)B.attr("transform",null);else{var ee={top:1,bottom:-1}[V]*(.5*(j-$+3))||0,H=g.indentation;B.attr("transform",w(H,ee))}B.selectAll("g.legendfill").data([E]).enter().append("g").classed("legendfill",!0),B.selectAll("g.legendlines").data([E]).enter().append("g").classed("legendlines",!0);var J=B.selectAll("g.legendsymbols").data([E]);J.enter().append("g").classed("legendsymbols",!0),J.selectAll("g.legendpoints").data([E]).enter().append("g").classed("legendpoints",!0)}).each(function(E){var I,B=E[0].trace,N=[];if(B.visible)switch(B.type){case"histogram2d":case"heatmap":N=[["M-15,-2V4H15V-2Z"]],I=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":N=[["M-6,-6V6H6V-6Z"]],I=!0;break;case"densitymapbox":case"densitymap":N=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],I="radial";break;case"cone":N=[["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"]],I=!1;break;case"streamtube":N=[["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"]],I=!1;break;case"surface":N=[["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"]],I=!0;break;case"mesh3d":N=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],I=!1;break;case"volume":N=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],I=!0;break;case"isosurface":N=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],I=!1}var V=b.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(N);V.enter().append("path").classed("legend3dandfriends",!0).attr("transform",T).style("stroke-miterlimit",1),V.exit().remove(),V.each(function(j,$){var ee,H=b.select(this),J=u(B),Q=J.colorscale,Z=J.reversescale;if(Q){if(!I){var K=Q.length;ee=$===0?Q[Z?K-1:0][1]:$===1?Q[Z?0:K-1][1]:Q[Math.floor((K-1)/2)][1]}}else{var ae=B.vertexcolor||B.facecolor||B.color;ee=e.isArrayOrTypedArray(ae)?ae[$]||ae[0]:ae}H.attr("d",j[0]),ee?H.call(_.fill,ee):H.call(function(se){if(se.size()){var he="legendfill-"+B.uid;y.gradient(se,m,he,s(Z,I==="radial"),Q,"fill")}})})}).each(function(E){var I=E[0].trace,B=I.type==="waterfall";if(E[0]._distinct&&B){var N=E[0].trace[E[0].dir].marker;return E[0].mc=N.color,E[0].mlw=N.line.width,E[0].mlc=N.line.color,M(E,this,"waterfall")}var V=[];I.visible&&B&&(V=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 j=b.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(V);j.enter().append("path").classed("legendwaterfall",!0).attr("transform",T).style("stroke-miterlimit",1),j.exit().remove(),j.each(function($){var ee=b.select(this),H=I[$[0]].marker,J=p(void 0,H.line,5,2);ee.attr("d",$[1]).style("stroke-width",J+"px").call(_.fill,H.color),J&&ee.call(_.stroke,H.line.color)})}).each(function(E){M(E,this,"funnel")}).each(function(E){M(E,this)}).each(function(E){var I=E[0].trace,B=b.select(this).select("g.legendpoints").selectAll("path.legendbox").data(I.visible&&d.traceIs(I,"box-violin")?[E]:[]);B.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),B.exit().remove(),B.each(function(){var N=b.select(this);if(I.boxpoints!=="all"&&I.points!=="all"||_.opacity(I.fillcolor)!==0||_.opacity((I.line||{}).color)!==0){var V=p(void 0,I.line,5,2);N.style("stroke-width",V+"px").call(_.fill,I.fillcolor),V&&_.stroke(N,I.line.color)}else{var j=e.minExtend(I,{marker:{size:A?12:e.constrain(I.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});B.call(y.pointStyle,j,m)}})}).each(function(E){f(E,this,"funnelarea")}).each(function(E){f(E,this,"pie")}).each(function(E){var I,B,N=c(E),V=N.showFill,j=N.showLine,$=N.showGradientLine,ee=N.showGradientFill,H=N.anyFill,J=N.anyLine,Q=E[0],Z=Q.trace,K=u(Z),ae=K.colorscale,se=K.reversescale,he=r.hasMarkers(Z)||!H?"M5,0":J?"M5,-2":"M5,-3",fe=b.select(this),ie=fe.select(".legendfill").selectAll("path").data(V||ee?[E]:[]);if(ie.enter().append("path").classed("js-fill",!0),ie.exit().remove(),ie.attr("d",he+"h"+v+"v6h-"+v+"z").call(function(ge){if(ge.size())if(V)y.fillGroupStyle(ge,m,!0);else{var ye="legendfill-"+Z.uid;y.gradient(ge,m,ye,s(se),ae,"fill")}}),j||$){var oe=p(void 0,Z.line,10,5);B=e.minExtend(Z,{line:{width:oe}}),I=[e.minExtend(Q,{trace:B})]}var le=fe.select(".legendlines").selectAll("path").data(j||$?[I]:[]);le.enter().append("path").classed("js-line",!0),le.exit().remove(),le.attr("d",he+($?"l"+v+",0.0001":"h"+v)).call(j?y.lineGroupStyle:function(ge){if(ge.size()){var ye="legendline-"+Z.uid;y.lineGroupStyle(ge),y.gradient(ge,m,ye,s(se),ae,"stroke")}})}).each(function(E){var I,B,N=c(E),V=N.anyFill,j=N.anyLine,$=N.showLine,ee=N.showMarker,H=E[0],J=H.trace,Q=!ee&&!j&&!V&&r.hasText(J);function Z(le,ge,ye,me){var be=e.nestedProperty(J,le).get(),Se=e.isArrayOrTypedArray(be)&&ge?ge(be):be;if(A&&Se&&me!==void 0&&(Se=me),ye){if(Seye[1])return ye[1]}return Se}function K(le){return H._distinct&&H.index&&le[H.index]?le[H.index]:le[0]}if(ee||Q||$){var ae={},se={};if(ee){ae.mc=Z("marker.color",K),ae.mx=Z("marker.symbol",K),ae.mo=Z("marker.opacity",e.mean,[.2,1]),ae.mlc=Z("marker.line.color",K),ae.mlw=Z("marker.line.width",e.mean,[0,5],2),se.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var he=Z("marker.size",e.mean,[2,16],12);ae.ms=he,se.marker.size=he}$&&(se.line={width:Z("line.width",K,[0,10],5)}),Q&&(ae.tx="Aa",ae.tp=Z("textposition",K),ae.ts=10,ae.tc=Z("textfont.color",K),ae.tf=Z("textfont.family",K),ae.tw=Z("textfont.weight",K),ae.ty=Z("textfont.style",K),ae.tv=Z("textfont.variant",K),ae.tC=Z("textfont.textcase",K),ae.tE=Z("textfont.lineposition",K),ae.tS=Z("textfont.shadow",K)),I=[e.minExtend(H,ae)],(B=e.minExtend(J,se)).selectedpoints=null,B.texttemplate=null}var fe=b.select(this).select("g.legendpoints"),ie=fe.selectAll("path.scatterpts").data(ee?I:[]);ie.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",T),ie.exit().remove(),ie.call(y.pointStyle,B,m),ee&&(I[0].mrc=3);var oe=fe.selectAll("g.pointtext").data(Q?I:[]);oe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",T),oe.exit().remove(),oe.selectAll("text").call(y.textPointStyle,B,m)}).each(function(E){var I=E[0].trace,B=b.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(I.visible&&I.type==="candlestick"?[E,E]:[]);B.enter().append("path").classed("legendcandle",!0).attr("d",function(N,V){return V?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",T).style("stroke-miterlimit",1),B.exit().remove(),B.each(function(N,V){var j=b.select(this),$=I[V?"increasing":"decreasing"],ee=p(void 0,$.line,5,2);j.style("stroke-width",ee+"px").call(_.fill,$.fillcolor),ee&&_.stroke(j,$.line.color)})}).each(function(E){var I=E[0].trace,B=b.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(I.visible&&I.type==="ohlc"?[E,E]:[]);B.enter().append("path").classed("legendohlc",!0).attr("d",function(N,V){return V?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",T).style("stroke-miterlimit",1),B.exit().remove(),B.each(function(N,V){var j=b.select(this),$=I[V?"increasing":"decreasing"],ee=p(void 0,$.line,5,2);j.style("fill","none").call(y.dashLine,$.line.dash,ee),ee&&_.stroke(j,$.line.color)})})}},50308:function(D,L,t){t(87632),D.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},5832:function(D,L,t){var b=t(33626),d=t(44122),e=t(5975),w=t(35188),y=t(28231).eraseActiveShape,_=t(34809),u=_._,r=D.exports={};function n(v,S){var T,p,M=S.currentTarget,f=M.getAttribute("data-attr"),E=M.getAttribute("data-val")||!0,I=v._fullLayout,B={},N=e.list(v,null,!0),V=I._cartesianSpikesEnabled;if(f==="zoom"){var j,$=E==="in"?.5:2,ee=(1+$)/2,H=(1-$)/2;for(p=0;p1?(fe=["toggleHover"],ie=["resetViews"]):E?(he=["zoomInGeo","zoomOutGeo"],fe=["hoverClosestGeo"],ie=["resetGeo"]):f?(fe=["hoverClosest3d"],ie=["resetCameraDefault3d","resetCameraLastSave3d"]):j?(he=["zoomInMapbox","zoomOutMapbox"],fe=["toggleHover"],ie=["resetViewMapbox"]):$?(he=["zoomInMap","zoomOutMap"],fe=["toggleHover"],ie=["resetViewMap"]):N?fe=["hoverClosestGl2d"]:I?fe=["hoverClosestPie"]:J?(fe=["hoverClosestCartesian","hoverCompareCartesian"],ie=["resetViewSankey"]):fe=["toggleHover"],M&&fe.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(Se){for(var Ee=0;Ee0)){var m=function(k,A,v){for(var S=v.filter(function(f){return A[f].anchor===k._id}),T=0,p=0;p0?S.touches[0].clientX:0}function x(S,T,p,M){var f=w.ensureSingle(S,"rect",c.bgClassName,function(N){N.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),E=M.borderwidth%2==0?M.borderwidth:M.borderwidth-1,I=-M._offsetShift,B=_.crispRound(T,M.borderwidth);f.attr({width:M._width+E,height:M._height+E,transform:y(I,I),"stroke-width":B}).call(u.stroke,M.bordercolor).call(u.fill,M.bgcolor)}function m(S,T,p,M){var f=T._fullLayout;w.ensureSingleById(f._topdefs,"clipPath",M._clipId,function(E){E.append("rect").attr({x:0,y:0})}).select("rect").attr({width:M._width,height:M._height})}function g(S,T,p,M){var f,E=T.calcdata,I=S.selectAll("g."+c.rangePlotClassName).data(p._subplotsWith,w.identity);I.enter().append("g").attr("class",function(B){return c.rangePlotClassName+" "+B}).call(_.setClipUrl,M._clipId,T),I.order(),I.exit().remove(),I.each(function(B,N){var V=b.select(this),j=N===0,$=l.getFromId(T,B,"y"),ee=$._name,H=M[ee],J={data:[],layout:{xaxis:{type:p.type,domain:[0,1],range:M.range.slice(),calendar:p.calendar},width:M._width,height:M._height,margin:{t:0,b:0,l:0,r:0}},_context:T._context};p.rangebreaks&&(J.layout.xaxis.rangebreaks=p.rangebreaks),J.layout[ee]={type:$.type,domain:[0,1],range:H.rangemode!=="match"?H.range.slice():$.range.slice(),calendar:$.calendar},$.rangebreaks&&(J.layout[ee].rangebreaks=$.rangebreaks),e.supplyDefaults(J);var Q=J._fullLayout.xaxis,Z=J._fullLayout[ee];Q.clearCalc(),Q.setScale(),Z.clearCalc(),Z.setScale();var K={id:B,plotgroup:V,xaxis:Q,yaxis:Z,isRangePlot:!0};j?f=K:(K.mainplot="xy",K.mainplotinfo=f),n.rangePlot(T,K,function(ae,se){for(var he=[],fe=0;fe=Le.max)Ee=ye[Ce+1];else if(Se=Le.pmax)Ee=ye[Ce+1];else if(SeCe._length||Fe+tt<0)return;De=He+tt,Be=Fe+tt;break;case We:if(Ge="col-resize",He+tt>Ce._length)return;De=He+tt,Be=Fe;break;case Ie:if(Ge="col-resize",Fe+tt<0)return;De=He,Be=Fe+tt;break;default:Ge="ew-resize",De=ke,Be=ke+tt}if(Be=0;N--){var V=A.append("path").attr(S).style("opacity",N?.1:T).call(w.stroke,M).call(w.fill,p).call(y.dashLine,N?"solid":E,N?4+f:f);if(s(V,h,g),I){var j=_(h.layout,"selections",g);V.style({cursor:"move"});var $={element:V.node(),plotinfo:k,gd:h,editHelpers:j,isActiveSelection:!0},ee=b(v,h);d(ee,V,$)}else V.style("pointer-events",N?"all":"none");B[N]=V}var H=B[0];B[1].node().addEventListener("click",function(){return function(J,Q){if(l(J)){var Z=+Q.node().getAttribute("data-index");if(Z>=0){if(Z===J._fullLayout._activeSelectionIndex)return void c(J);J._fullLayout._activeSelectionIndex=Z,J._fullLayout._deactivateSelection=c,n(J)}}}(h,H)})}(h._fullLayout._selectionLayer)}function s(h,x,m){var g=m.xref+m.yref;y.setClipUrl(h,"clip"+x._fullLayout._uid+g,x)}function c(h){l(h)&&h._fullLayout._activeSelectionIndex>=0&&(e(h),delete h._fullLayout._activeSelectionIndex,n(h))}D.exports={draw:n,drawOne:o,activateLastSelection:function(h){if(l(h)){var x=h._fullLayout.selections.length-1;h._fullLayout._activeSelectionIndex=x,h._fullLayout._deactivateSelection=c,n(h)}}}},52307:function(D,L,t){var b=t(94850).T,d=t(93049).extendFlat;D.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:d({},b,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},43028:function(D){D.exports=function(L,t,b){b("newselection.mode"),b("newselection.line.width")&&(b("newselection.line.color"),b("newselection.line.dash")),b("activeselection.fillcolor"),b("activeselection.opacity")}},51817:function(D,L,t){var b=t(70414).selectMode,d=t(78534).clearOutline,e=t(81055),w=e.readPaths,y=e.writePaths,_=e.fixDatesForPaths;D.exports=function(u,r){if(u.length){var n=u[0][0];if(n){var l=n.getAttribute("d"),o=r.gd,s=o._fullLayout.newselection,c=r.plotinfo,h=c.xaxis,x=c.yaxis,m=r.isActiveSelection,g=r.dragmode,k=(o.layout||{}).selections||[];if(!b(g)&&m!==void 0){var A=o._fullLayout._activeSelectionIndex;if(A-1,Ot=[];if(function(ut){return ut&&Array.isArray(ut)&&ut[0].hoverOnBox!==!0}(ft)){oe($e,Ye,Ge);var Pt=function(ut,Tt){var vt,Lt,Ut=ut[0],rt=-1,et=[];for(Lt=0;Lt0?function(ut,Tt){var vt,Lt,Ut,rt=[];for(Ut=0;Ut0&&rt.push(vt);if(rt.length===1&&rt[0]===Tt.searchInfo&&(Lt=Tt.searchInfo.cd[0].trace).selectedpoints.length===Tt.pointNumbers.length){for(Ut=0;Ut1||(Lt+=Tt.selectedpoints.length)>1))return!1;return Lt===1}(nt)&&(Ht=be(Pt))){for(tt&&tt.remove(),Qe=0;Qe=0})(Be)&&Be._fullLayout._deactivateShape(Be),function(Nt){return Nt._fullLayout._activeSelectionIndex>=0}(Be)&&Be._fullLayout._deactivateSelection(Be);var Ge=Be._fullLayout._zoomlayer,tt=o(_e),nt=c(_e);if(tt||nt){var pt,At,wt=Ge.selectAll(".select-outline-"+De.id);wt&&Be._fullLayout._outlining&&(tt&&(pt=S(wt,$e)),pt&&e.call("_guiRelayout",Be,{shapes:pt}),nt&&!ae($e)&&(At=T(wt,$e)),At&&(Be._fullLayout._noEmitSelectedAtStart=!0,e.call("_guiRelayout",Be,{selections:At}).then(function(){Ye&&p(Be)})),Be._fullLayout._outlining=!1)}De.selection={},De.selection.selectionDefs=$e.selectionDefs=[],De.selection.mergedPolygons=$e.mergedPolygons=[]}function ge($e){return $e._id}function ye($e,Ye,_e,De){if(!$e.calcdata)return[];var Be,Ge,tt,nt=[],pt=Ye.map(ge),At=_e.map(ge);for(tt=0;tt<$e.calcdata.length;tt++)if((Ge=(Be=$e.calcdata[tt])[0].trace).visible===!0&&Ge._module&&Ge._module.selectPoints)if(!ae({subplot:De})||Ge.subplot!==De&&Ge.geo!==De)if(Ge.type==="splom"){if(Ge._xaxes[pt[0]]&&Ge._yaxes[At[0]]){var wt=me(Ge._module,Be,Ye[0],_e[0]);wt.scene=$e._fullLayout._splomScenes[Ge.uid],nt.push(wt)}}else if(Ge.type==="sankey"){var Nt=me(Ge._module,Be,Ye[0],_e[0]);nt.push(Nt)}else{if(!(pt.indexOf(Ge.xaxis)!==-1||Ge._xA&&Ge._xA.overlaying)||!(At.indexOf(Ge.yaxis)!==-1||Ge._yA&&Ge._yA.overlaying))continue;nt.push(me(Ge._module,Be,B($e,Ge.xaxis),B($e,Ge.yaxis)))}else nt.push(me(Ge._module,Be,Ye[0],_e[0]));return nt}function me($e,Ye,_e,De){return{_module:$e,cd:Ye,xaxis:_e,yaxis:De}}function be($e){var Ye=$e.searchInfo.cd[0].trace,_e=$e.pointNumber,De=$e.pointNumbers,Be=De.length>0?De[0]:_e;return!!Ye.selectedpoints&&Ye.selectedpoints.indexOf(Be)>-1}function Se($e,Ye,_e){var De,Be;for(De=0;De-1&&Ye;if(!Ge&&Ye){var Fn=Pe($e,!0);if(Fn.length){var wn=Fn[0].xref,zn=Fn[0].yref;if(wn&&zn){var Jn=ke(Fn);He([B($e,wn,"x"),B($e,zn,"y")])(Ln,Jn)}}$e._fullLayout._noEmitSelectedAtStart?$e._fullLayout._noEmitSelectedAtStart=!1:Tn&&Fe($e,Ln),Ht._reselect=!1}if(!Ge&&Ht._deselect){var $n=Ht._deselect;(function(vr,Qn,lr){for(var hr=0;hr=0)Gt._fullLayout._deactivateShape(Gt);else if(!At){var Jn=st.clickmode;I.done(Kn).then(function(){if(I.clear(Kn),wn===2){for(un.remove(),Ut=0;Ut-1&&se(zn,Gt,De.xaxes,De.yaxes,De.subplot,De,un),Jn==="event"&&Fe(Gt,void 0);_.click(Gt,zn,Ot.id)}).catch(M.error)}},De.doneFn=function(){mn.remove(),I.done(Kn).then(function(){I.clear(Kn),!Qe&&Lt&&De.selectionDefs&&(Lt.subtract=on,De.selectionDefs.push(Lt),De.mergedPolygons.length=0,[].push.apply(De.mergedPolygons,vt)),(Qe||At)&&le(De,Qe),De.doneFnCompleted&&De.doneFnCompleted(Ln),wt&&Fe(Gt,et)}).catch(M.error)}},clearOutline:g,clearSelectionsCache:le,selectOnClick:se}},43144:function(D,L,t){var b=t(50222),d=t(80337),e=t(36640).line,w=t(94850).T,y=t(93049).extendFlat,_=t(78032).templatedArray,u=(t(35081),t(9829)),r=t(3208).LF,n=t(41235);D.exports=_("shape",{visible:y({},u.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:y({},u.legend,{editType:"calc+arraydraw"}),legendgroup:y({},u.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:y({},u.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:d({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:y({},u.legendrank,{editType:"calc+arraydraw"}),legendwidth:y({},u.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:y({},b.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:y({},b.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:y({},e.color,{editType:"arraydraw"}),width:y({},e.width,{editType:"calc+arraydraw"}),dash:y({},w,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:r({},{keys:Object.keys(n)}),font:d({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})},44959:function(D,L,t){var b=t(34809),d=t(29714),e=t(2956),w=t(49728);function y(n){return u(n.line.width,n.xsizemode,n.x0,n.x1,n.path,!1)}function _(n){return u(n.line.width,n.ysizemode,n.y0,n.y1,n.path,!0)}function u(n,l,o,s,c,h){var x=n/2,m=h;if(l==="pixel"){var g=c?w.extractPathCoords(c,h?e.paramIsY:e.paramIsX):[o,s],k=b.aggNums(Math.max,null,g),A=b.aggNums(Math.min,null,g),v=A<0?Math.abs(A)+x:x,S=k>0?k+x:x;return{ppad:x,ppadplus:m?v:S,ppadminus:m?S:v}}return{ppad:x}}function r(n,l,o){var s,c,h=n._id.charAt(0)==="x"?"x":"y",x=n.type==="category"||n.type==="multicategory",m=0,g=0,k=x?n.r2c:n.d2c;if(l[h+"sizemode"]==="scaled"?(s=l[h+"0"],c=l[h+"1"],x&&(m=l[h+"0shift"],g=l[h+"1shift"])):(s=l[h+"anchor"],c=l[h+"anchor"]),s!==void 0)return[k(s)+m,k(c)+g];if(l.path){var A,v,S,T,p=1/0,M=-1/0,f=l.path.match(e.segmentRE);for(n.type==="date"&&(k=w.decodeDate(k)),A=0;AM&&(M=T)));return M>=p?[p,M]:void 0}}D.exports=function(n){var l=n._fullLayout,o=b.filterVisible(l.shapes);if(o.length&&n._fullData.length)for(var s=0;s=Se?Ee-Le:Le-Ee,-180/Math.PI*Math.atan2(Oe,We)}(v,T,S,p):0),E.call(function(Se){return Se.call(w.font,f).attr({}),e.convertToTspans(Se,l),Se});var ge=function(Se,Ee,Ce,Le,Oe,We,Ie){var Ve,Pe,de,Me,ke=Oe.label.textposition,He=Oe.label.textangle,Fe=Oe.label.padding,qe=Oe.type,$e=Math.PI/180*We,Ye=Math.sin($e),_e=Math.cos($e),De=Oe.label.xanchor,Be=Oe.label.yanchor;if(qe==="line"){ke==="start"?(Ve=Se,Pe=Ee):ke==="end"?(Ve=Ce,Pe=Le):(Ve=(Se+Ce)/2,Pe=(Ee+Le)/2),De==="auto"&&(De=ke==="start"?He==="auto"?Ce>Se?"left":CeSe?"right":CeSe?"right":CeSe?"left":Ce1&&(Le.length!==2||Le[1][0]!=="Z")&&(H===0&&(Le[0][0]="M"),M[ee]=Le,N(),V())}}()}}function ge(Se,Ee){(function(Ce,Le){if(M.length)for(var Oe=0;OeOe?(Ve=Ce,ke="y0",Pe=Oe,He="y1"):(Ve=Oe,ke="y1",Pe=Ce,He="y0"),Tt(et),Ut(be,ye),function(Et,Bt,Ft){var St=Bt.xref,Jt=Bt.yref,qt=w.getFromId(Ft,St),en=w.getFromId(Ft,Jt),Wt="";St==="paper"||qt.autorange||(Wt+=St),Jt==="paper"||en.autorange||(Wt+=Jt),l.setClipUrl(Et,Wt?"clip"+Ft._fullLayout._uid+Wt:null,Ft)}(ge,ye,le),ut.moveFn=Ye==="move"?vt:Lt,ut.altKey=et.altKey)},doneFn:function(){k(le)||(c(ge),rt(be),S(ge,le,ye),d.call("_guiRelayout",le,Se.getUpdateObj()))},clickFn:function(){k(le)||rt(be)}};function Tt(et){if(k(le))Ye=null;else if(tt)Ye=et.target.tagName==="path"?"move":et.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var Et=ut.element.getBoundingClientRect(),Bt=Et.right-Et.left,Ft=Et.bottom-Et.top,St=et.clientX-Et.left,Jt=et.clientY-Et.top,qt=!nt&&Bt>_e&&Ft>De&&!et.shiftKey?s.getCursor(St/Bt,1-Jt/Ft):"move";c(ge,qt),Ye=qt.split("-")[0]}}function vt(et,Et){if(ye.type==="path"){var Bt=function(Jt){return Jt},Ft=Bt,St=Bt;Be?pt("xanchor",ye.xanchor=at(We+et)):(Ft=function(Jt){return at(Ot(Jt)+et)},wt&&wt.type==="date"&&(Ft=x.encodeDate(Ft))),Ge?pt("yanchor",ye.yanchor=lt(Ie+Et)):(St=function(Jt){return lt(Pt(Jt)+Et)},Ht&&Ht.type==="date"&&(St=x.encodeDate(St))),pt("path",ye.path=T($e,Ft,St))}else Be?pt("xanchor",ye.xanchor=at(We+et)):(pt("x0",ye.x0=at(Ee+et)),pt("x1",ye.x1=at(Le+et))),Ge?pt("yanchor",ye.yanchor=lt(Ie+Et)):(pt("y0",ye.y0=lt(Ce+Et)),pt("y1",ye.y1=lt(Oe+Et)));ge.attr("d",m(le,ye)),Ut(be,ye),u(le,me,ye,At)}function Lt(et,Et){if(nt){var Bt=function(Ln){return Ln},Ft=Bt,St=Bt;Be?pt("xanchor",ye.xanchor=at(We+et)):(Ft=function(Ln){return at(Ot(Ln)+et)},wt&&wt.type==="date"&&(Ft=x.encodeDate(Ft))),Ge?pt("yanchor",ye.yanchor=lt(Ie+Et)):(St=function(Ln){return lt(Pt(Ln)+Et)},Ht&&Ht.type==="date"&&(St=x.encodeDate(St))),pt("path",ye.path=T($e,Ft,St))}else if(tt){if(Ye==="resize-over-start-point"){var Jt=Ee+et,qt=Ge?Ce-Et:Ce+Et;pt("x0",ye.x0=Be?Jt:at(Jt)),pt("y0",ye.y0=Ge?qt:lt(qt))}else if(Ye==="resize-over-end-point"){var en=Le+et,Wt=Ge?Oe-Et:Oe+Et;pt("x1",ye.x1=Be?en:at(en)),pt("y1",ye.y1=Ge?Wt:lt(Wt))}}else{var Zt=function(Ln){return Ye.indexOf(Ln)!==-1},on=Zt("n"),un=Zt("s"),Pn=Zt("w"),Dn=Zt("e"),In=on?Ve+Et:Ve,mn=un?Pe+Et:Pe,En=Pn?de+et:de,Kn=Dn?Me+et:Me;Ge&&(on&&(In=Ve-Et),un&&(mn=Pe-Et)),(!Ge&&mn-In>De||Ge&&In-mn>De)&&(pt(ke,ye[ke]=Ge?In:lt(In)),pt(He,ye[He]=Ge?mn:lt(mn))),Kn-En>_e&&(pt(Fe,ye[Fe]=Be?En:at(En)),pt(qe,ye[qe]=Be?Kn:at(Kn)))}ge.attr("d",m(le,ye)),Ut(be,ye),u(le,me,ye,At)}function Ut(et,Et){(Be||Ge)&&function(){var Bt=Et.type!=="path",Ft=et.selectAll(".visual-cue").data([0]);Ft.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var St=Ot(Be?Et.xanchor:e.midRange(Bt?[Et.x0,Et.x1]:x.extractPathCoords(Et.path,h.paramIsX))),Jt=Pt(Ge?Et.yanchor:e.midRange(Bt?[Et.y0,Et.y1]:x.extractPathCoords(Et.path,h.paramIsY)));if(St=x.roundPositionForSharpStrokeRendering(St,1),Jt=x.roundPositionForSharpStrokeRendering(Jt,1),Be&&Ge){var qt="M"+(St-1-1)+","+(Jt-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Ft.attr("d",qt)}else if(Be){var en="M"+(St-1-1)+","+(Jt-9-1)+"v18 h2 v-18 Z";Ft.attr("d",en)}else{var Wt="M"+(St-9-1)+","+(Jt-1-1)+"h18 v2 h-18 Z";Ft.attr("d",Wt)}}()}function rt(et){et.selectAll(".visual-cue").remove()}s.init(ut),Xe.node().onmousemove=Tt}(M,fe,I,f,V,se):I.editable===!0&&fe.style("pointer-events",K||n.opacity(H)*ee<=.5?"stroke":"all");fe.node().addEventListener("click",function(){return function(le,ge){if(A(le)){var ye=+ge.node().getAttribute("data-index");if(ye>=0){if(ye===le._fullLayout._activeShapeIndex)return void p(le);le._fullLayout._activeShapeIndex=ye,le._fullLayout._deactivateShape=p,g(le)}}}(M,fe)})}I._input&&I.visible===!0&&(I.layer==="above"?N(M._fullLayout._shapeUpperLayer):I.xref==="paper"||I.yref==="paper"?N(M._fullLayout._shapeLowerLayer):I.layer==="between"?N(B.shapelayerBetween):B._hadPlotinfo?N((B.mainplotinfo||B).shapelayer):N(M._fullLayout._shapeLowerLayer))}function S(M,f,E){var I=(E.xref+E.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");l.setClipUrl(M,I?"clip"+f._fullLayout._uid+I:null,f)}function T(M,f,E){return M.replace(h.segmentRE,function(I){var B=0,N=I.charAt(0),V=h.paramIsX[N],j=h.paramIsY[N],$=h.numParams[N];return N+I.substr(1).replace(h.paramRE,function(ee){return B>=$||(V[B]?ee=f(ee):j[B]&&(ee=E(ee)),B++),ee})})}function p(M){A(M)&&M._fullLayout._activeShapeIndex>=0&&(r(M),delete M._fullLayout._activeShapeIndex,g(M))}D.exports={draw:g,drawOne:v,eraseActiveShape:function(M){if(A(M)){r(M);var f=M._fullLayout._activeShapeIndex,E=(M.layout||{}).shapes||[];if(f0&&vge&&(me="X"),me});return fe>ge&&(ye=ye.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+he)),ie+ye})}(_,r,l);if(_.xsizemode==="pixel"){var f=r(_.xanchor);o=f+_.x0+S,s=f+_.x1+T}else o=r(_.x0)+S,s=r(_.x1)+T;if(_.ysizemode==="pixel"){var E=l(_.yanchor);c=E-_.y0+p,h=E-_.y1+M}else c=l(_.y0)+p,h=l(_.y1)+M;if(x==="line")return"M"+o+","+c+"L"+s+","+h;if(x==="rect")return"M"+o+","+c+"H"+s+"V"+h+"H"+o+"Z";var I=(o+s)/2,B=(c+h)/2,N=Math.abs(I-o),V=Math.abs(B-c),j="A"+N+","+V,$=I+N+","+B;return"M"+$+j+" 0 1,1 "+I+","+(B-V)+j+" 0 0,1 "+$+"Z"}},43701:function(D,L,t){var b=t(28231);D.exports={moduleType:"component",name:"shapes",layoutAttributes:t(43144),supplyLayoutDefaults:t(74367),supplyDrawNewShapeDefaults:t(85522),includeBasePlot:t(20706)("shapes"),calcAutorange:t(44959),draw:b.draw,drawOne:b.drawOne}},41235:function(D){function L(u,r){return r?r.d2l(u):u}function t(u,r){return r?r.l2d(u):u}function b(u){return u.x0shift||0}function d(u){return u.x1shift||0}function e(u){return u.y0shift||0}function w(u){return u.y1shift||0}function y(u,r){return L(u.x1,r)+d(u)-L(u.x0,r)-b(u)}function _(u,r,n){return L(u.y1,n)+w(u)-L(u.y0,n)-e(u)}D.exports={x0:function(u){return u.x0},x1:function(u){return u.x1},y0:function(u){return u.y0},y1:function(u){return u.y1},slope:function(u,r,n){return u.type!=="line"?void 0:_(u,0,n)/y(u,r)},dx:y,dy:_,width:function(u,r){return Math.abs(y(u,r))},height:function(u,r,n){return Math.abs(_(u,0,n))},length:function(u,r,n){return u.type!=="line"?void 0:Math.sqrt(Math.pow(y(u,r),2)+Math.pow(_(u,0,n),2))},xcenter:function(u,r){return t((L(u.x1,r)+d(u)+L(u.x0,r)+b(u))/2,r)},ycenter:function(u,r,n){return t((L(u.y1,n)+w(u)+L(u.y0,n)+e(u))/2,n)}}},8606:function(D,L,t){var b=t(80337),d=t(57891),e=t(93049).extendDeepAll,w=t(13582).overrideAll,y=t(49722),_=t(78032).templatedArray,u=t(64194),r=_("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});D.exports=w(_("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:r,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:e(d({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:y.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:b({})},font:b({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},64194:function(D){D.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},74537:function(D,L,t){var b=t(34809),d=t(59008),e=t(8606),w=t(64194).name,y=e.steps;function _(r,n,l){function o(m,g){return b.coerce(r,n,e,m,g)}for(var s=d(r,n,{name:"steps",handleItemDefaults:u}),c=0,h=0;h0&&(Z=Z.transition().duration(j.transition.duration).ease(j.transition.easing)),Z.attr("transform",_(Q-.5*n.gripWidth,j._dims.currentValueTotalHeight))}}function E(V,j){var $=V._dims;return $.inputAreaStart+n.stepInset+($.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,j))}function I(V,j){var $=V._dims;return Math.min(1,Math.max(0,(j-n.stepInset-$.inputAreaStart)/($.inputAreaLength-2*n.stepInset-2*$.inputAreaStart)))}function B(V,j,$){var ee=$._dims,H=y.ensureSingle(V,"rect",n.railTouchRectClass,function(J){J.call(p,j,V,$).style("pointer-events","all")});H.attr({width:ee.inputAreaLength,height:Math.max(ee.inputAreaWidth,n.tickOffset+$.ticklen+ee.labelHeight)}).call(e.fill,$.bgcolor).attr("opacity",0),w.setTranslate(H,0,ee.currentValueTotalHeight)}function N(V,j){var $=j._dims,ee=$.inputAreaLength-2*n.railInset,H=y.ensureSingle(V,"rect",n.railRectClass);H.attr({width:ee,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(e.stroke,j.bordercolor).call(e.fill,j.bgcolor).style("stroke-width",j.borderwidth+"px"),w.setTranslate(H,n.railInset,.5*($.inputAreaWidth-n.railWidth)+$.currentValueTotalHeight)}D.exports=function(V){var j=V._context.staticPlot,$=V._fullLayout,ee=function(ae,se){for(var he=ae[n.name],fe=[],ie=0;ie0?[0]:[]);function J(ae){ae._commandObserver&&(ae._commandObserver.remove(),delete ae._commandObserver),d.autoMargin(V,h(ae))}if(H.enter().append("g").classed(n.containerClassName,!0).style("cursor",j?null:"ew-resize"),H.exit().each(function(){b.select(this).selectAll("g."+n.groupClassName).each(J)}).remove(),ee.length!==0){var Q=H.selectAll("g."+n.groupClassName).data(ee,x);Q.enter().append("g").classed(n.groupClassName,!0),Q.exit().each(J).remove();for(var Z=0;Z0||Ot<0){var Xe={left:[-Pt,0],right:[Pt,0],top:[0,-Pt],bottom:[0,Pt]}[T.side];nt.attr("transform",_(Xe[0],Xe[1]))}}}function _e(Ge,tt){Ge.text(tt).on("mouseover.opacity",function(){b.select(this).transition().duration(l.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){b.select(this).transition().duration(l.HIDE_PLACEHOLDER).style("opacity",0)})}if(Me.call(qe,ke),Ie&&(B?Me.on(".opacity",null):(_e(Me,v),N=!0),Me.call(n.makeEditable,{gd:c}).on("edit",function(Ge){S!==void 0?w.call("_guiRestyle",c,A,Ge,S):w.call("_guiRelayout",c,A,Ge)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(qe)}).on("input",function(Ge){this.text(Ge||" ").call(n.positionText,p.x,p.y)}),se)){if(se&&!B){var De=Me.node().getBBox(),Be=De.y+De.height+1.6*me;ke.attr("y",Be)}ie?ke.on(".opacity",null):(_e(ke,he),oe=!0),ke.call(n.makeEditable,{gd:c}).on("edit",function(Ge){w.call("_guiRelayout",c,"title.subtitle.text",Ge)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(qe)}).on("input",function(Ge){this.text(Ge||" ").call(n.positionText,ke.attr("x"),ke.attr("y"))})}return Me.classed("js-placeholder",N),ke&&ke.classed("js-placeholder",oe),f},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}},85389:function(D,L,t){var b=t(80337),d=t(10229),e=t(93049).extendFlat,w=t(13582).overrideAll,y=t(57891),_=t(78032).templatedArray,u=_("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});D.exports=w(_("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:e(y({editType:"arraydraw"}),{}),font:b({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:d.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},71559:function(D){D.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},42746:function(D,L,t){var b=t(34809),d=t(59008),e=t(85389),w=t(71559).name,y=e.buttons;function _(r,n,l){function o(s,c){return b.coerce(r,n,e,s,c)}o("visible",d(r,n,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),b.noneOrAll(r,n,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),b.coerceFont(o,"font",l.font),o("bgcolor",l.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(r,n){function l(o,s){return b.coerce(r,n,y,o,s)}l("visible",r.method==="skip"||Array.isArray(r.args))&&(l("method"),l("args"),l("args2"),l("label"),l("execute"))}D.exports=function(r,n){d(r,n,{name:w,handleItemDefaults:_})}},40974:function(D,L,t){var b=t(45568),d=t(44122),e=t(78766),w=t(62203),y=t(34809),_=t(30635),u=t(78032).arrayEditor,r=t(4530).LINE_SPACING,n=t(71559),l=t(21736);function o(E){return E._index}function s(E,I){return+E.attr(n.menuIndexAttrName)===I._index}function c(E,I,B,N,V,j,$,ee){I.active=$,u(E.layout,n.name,I).applyUpdate("active",$),I.type==="buttons"?x(E,N,null,null,I):I.type==="dropdown"&&(V.attr(n.menuIndexAttrName,"-1"),h(E,N,V,j,I),ee||x(E,N,V,j,I))}function h(E,I,B,N,V){var j=y.ensureSingle(I,"g",n.headerClassName,function(Z){Z.style("pointer-events","all")}),$=V._dims,ee=V.active,H=V.buttons[ee]||n.blankHeaderOpts,J={y:V.pad.t,yPad:0,x:V.pad.l,xPad:0,index:0},Q={width:$.headerWidth,height:$.headerHeight};j.call(m,V,H,E).call(M,V,J,Q),y.ensureSingle(I,"text",n.headerArrowClassName,function(Z){Z.attr("text-anchor","end").call(w.font,V.font).text(n.arrowSymbol[V.direction])}).attr({x:$.headerWidth-n.arrowOffsetX+V.pad.l,y:$.headerHeight/2+n.textOffsetY+V.pad.t}),j.on("click",function(){B.call(f,String(s(B,V)?-1:V._index)),x(E,I,B,N,V)}),j.on("mouseover",function(){j.call(v)}),j.on("mouseout",function(){j.call(S,V)}),w.setTranslate(I,$.lx,$.ly)}function x(E,I,B,N,V){B||(B=I).attr("pointer-events","all");var j=function(fe){return+fe.attr(n.menuIndexAttrName)==-1}(B)&&V.type!=="buttons"?[]:V.buttons,$=V.type==="dropdown"?n.dropdownButtonClassName:n.buttonClassName,ee=B.selectAll("g."+$).data(y.filterVisible(j)),H=ee.enter().append("g").classed($,!0),J=ee.exit();V.type==="dropdown"?(H.attr("opacity","0").transition().attr("opacity","1"),J.transition().attr("opacity","0").remove()):J.remove();var Q=0,Z=0,K=V._dims,ae=["up","down"].indexOf(V.direction)!==-1;V.type==="dropdown"&&(ae?Z=K.headerHeight+n.gapButtonHeader:Q=K.headerWidth+n.gapButtonHeader),V.type==="dropdown"&&V.direction==="up"&&(Z=-n.gapButtonHeader+n.gapButton-K.openHeight),V.type==="dropdown"&&V.direction==="left"&&(Q=-n.gapButtonHeader+n.gapButton-K.openWidth);var se={x:K.lx+Q+V.pad.l,y:K.ly+Z+V.pad.t,yPad:n.gapButton,xPad:n.gapButton,index:0},he={l:se.x+V.borderwidth,t:se.y+V.borderwidth};ee.each(function(fe,ie){var oe=b.select(this);oe.call(m,V,fe,E).call(M,V,se),oe.on("click",function(){b.event.defaultPrevented||(fe.execute&&(fe.args2&&V.active===ie?(c(E,V,0,I,B,N,-1),d.executeAPICommand(E,fe.method,fe.args2)):(c(E,V,0,I,B,N,ie),d.executeAPICommand(E,fe.method,fe.args))),E.emit("plotly_buttonclicked",{menu:V,button:fe,active:V.active}))}),oe.on("mouseover",function(){oe.call(v)}),oe.on("mouseout",function(){oe.call(S,V),ee.call(A,V)})}),ee.call(A,V),ae?(he.w=Math.max(K.openWidth,K.headerWidth),he.h=se.y-he.t):(he.w=se.x-he.l,he.h=Math.max(K.openHeight,K.headerHeight)),he.direction=V.direction,N&&(ee.size()?function(fe,ie,oe,le,ge,ye){var me,be,Se,Ee=ge.direction,Ce=Ee==="up"||Ee==="down",Le=ge._dims,Oe=ge.active;if(Ce)for(be=0,Se=0;Se0?[0]:[]);if(V.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),V.exit().each(function(){b.select(this).selectAll("g."+n.headerGroupClassName).each(N)}).remove(),B.length!==0){var j=V.selectAll("g."+n.headerGroupClassName).data(B,o);j.enter().append("g").classed(n.headerGroupClassName,!0);for(var $=y.ensureSingle(V,"g",n.dropdownButtonGroupClassName,function(Z){Z.style("pointer-events","all")}),ee=0;eeM,I=y.barLength+2*y.barPad,B=y.barWidth+2*y.barPad,N=m,V=k+A;V+B>o&&(V=o-B);var j=this.container.selectAll("rect.scrollbar-horizontal").data(E?[0]:[]);j.exit().on(".drag",null).remove(),j.enter().append("rect").classed("scrollbar-horizontal",!0).call(d.fill,y.barColor),E?(this.hbar=j.attr({rx:y.barRadius,ry:y.barRadius,x:N,y:V,width:I,height:B}),this._hbarXMin=N+I/2,this._hbarTranslateMax=M-I):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var $=A>f,ee=y.barWidth+2*y.barPad,H=y.barLength+2*y.barPad,J=m+g,Q=k;J+ee>l&&(J=l-ee);var Z=this.container.selectAll("rect.scrollbar-vertical").data($?[0]:[]);Z.exit().on(".drag",null).remove(),Z.enter().append("rect").classed("scrollbar-vertical",!0).call(d.fill,y.barColor),$?(this.vbar=Z.attr({rx:y.barRadius,ry:y.barRadius,x:J,y:Q,width:ee,height:H}),this._vbarYMin=Q+H/2,this._vbarTranslateMax=f-H):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var K=this.id,ae=s-.5,se=$?c+ee+.5:c+.5,he=h-.5,fe=E?x+B+.5:x+.5,ie=n._topdefs.selectAll("#"+K).data(E||$?[0]:[]);if(ie.exit().remove(),ie.enter().append("clipPath").attr("id",K).append("rect"),E||$?(this._clipRect=ie.select("rect").attr({x:Math.floor(ae),y:Math.floor(he),width:Math.ceil(se)-Math.floor(ae),height:Math.ceil(fe)-Math.floor(he)}),this.container.call(e.setClipUrl,K,this.gd),this.bg.attr({x:m,y:k,width:g,height:A})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(e.setClipUrl,null),delete this._clipRect),E||$){var oe=b.behavior.drag().on("dragstart",function(){b.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(oe);var le=b.behavior.drag().on("dragstart",function(){b.event.sourceEvent.preventDefault(),b.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));E&&this.hbar.on(".drag",null).call(le),$&&this.vbar.on(".drag",null).call(le)}this.setTranslate(u,r)},y.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(e.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)},y.prototype._onBoxDrag=function(){var _=this.translateX,u=this.translateY;this.hbar&&(_-=b.event.dx),this.vbar&&(u-=b.event.dy),this.setTranslate(_,u)},y.prototype._onBoxWheel=function(){var _=this.translateX,u=this.translateY;this.hbar&&(_+=b.event.deltaY),this.vbar&&(u+=b.event.deltaY),this.setTranslate(_,u)},y.prototype._onBarDrag=function(){var _=this.translateX,u=this.translateY;if(this.hbar){var r=_+this._hbarXMin,n=r+this._hbarTranslateMax;_=(w.constrain(b.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var l=u+this._vbarYMin,o=l+this._vbarTranslateMax;u=(w.constrain(b.event.y,l,o)-l)/(o-l)*(this.position.h-this._box.h)}this.setTranslate(_,u)},y.prototype.setTranslate=function(_,u){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(_=w.constrain(_||0,0,r),u=w.constrain(u||0,0,n),this.translateX=_,this.translateY=u,this.container.call(e.setTranslate,this._box.l-this.position.l-_,this._box.t-this.position.t-u),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+_-.5),y:Math.floor(this.position.t+u-.5)}),this.hbar){var l=_/r;this.hbar.call(e.setTranslate,_+l*this._hbarTranslateMax,u)}if(this.vbar){var o=u/n;this.vbar.call(e.setTranslate,_,u+o*this._vbarTranslateMax)}}},4530:function(D){D.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},35081:function(D){D.exports={axisRefDescription:function(L,t,b){return["If set to a",L,"axis id (e.g. *"+L+"* or","*"+L+"2*), the `"+L+"` position refers to a",L,"coordinate. If set to *paper*, the `"+L+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+b+"). If set to a",L,"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.,","*"+L+"2 domain* refers to the domain of the second",L," axis and a",L,"position of 0.5 refers to the","point between the",t,"and the",b,"of the domain of the","second",L,"axis."].join(" ")}}},20909:function(D){D.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}},87296:function(D){D.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},20726:function(D){D.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},84770:function(D){D.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},49467:function(D){D.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},20438:function(D){D.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},63821:function(D){D.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:24405875e-1,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},1837:function(D,L){L.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],L.STYLE=L.CSS_DECLARATIONS.map(function(t){return t.join(": ")+"; "}).join("")},62972:function(D,L){L.xmlns="http://www.w3.org/2000/xmlns/",L.svg="http://www.w3.org/2000/svg",L.xlink="http://www.w3.org/1999/xlink",L.svgAttrs={xmlns:L.svg,"xmlns:xlink":L.xlink}},17430:function(D,L,t){L.version=t(29697).version,t(71116),t(6713);for(var b=t(33626),d=L.register=b.register,e=t(90742),w=Object.keys(e),y=0;y",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},32546:function(D,L){L.isLeftAnchor=function(t){return t.xanchor==="left"||t.xanchor==="auto"&&t.x<=.3333333333333333},L.isCenterAnchor=function(t){return t.xanchor==="center"||t.xanchor==="auto"&&t.x>.3333333333333333&&t.x<.6666666666666666},L.isRightAnchor=function(t){return t.xanchor==="right"||t.xanchor==="auto"&&t.x>=.6666666666666666},L.isTopAnchor=function(t){return t.yanchor==="top"||t.yanchor==="auto"&&t.y>=.6666666666666666},L.isMiddleAnchor=function(t){return t.yanchor==="middle"||t.yanchor==="auto"&&t.y>.3333333333333333&&t.y<.6666666666666666},L.isBottomAnchor=function(t){return t.yanchor==="bottom"||t.yanchor==="auto"&&t.y<=.3333333333333333}},44313:function(D,L,t){var b=t(98953),d=b.mod,e=b.modHalf,w=Math.PI,y=2*w;function _(l){return Math.abs(l[1]-l[0])>y-1e-14}function u(l,o){return e(o-l,y)}function r(l,o){if(_(o))return!0;var s,c;o[0](c=d(c,y))&&(c+=y);var h=d(l,y),x=h+y;return h>=s&&h<=c||x>=s&&x<=c}function n(l,o,s,c,h,x,m){h=h||0,x=x||0;var g,k,A,v,S,T=_([s,c]);function p(I,B){return[I*Math.cos(B)+h,x-I*Math.sin(B)]}T?(g=0,k=w,A=y):s=h&&l<=x);var h,x},pathArc:function(l,o,s,c,h){return n(null,l,o,s,c,h,0)},pathSector:function(l,o,s,c,h){return n(null,l,o,s,c,h,1)},pathAnnulus:function(l,o,s,c,h,x){return n(l,o,s,c,h,x,1)}}},87800:function(D,L,t){var b=t(93229).decode,d=t(56174),e=Array.isArray,w=ArrayBuffer,y=DataView;function _(o){return w.isView(o)&&!(o instanceof y)}function u(o){return e(o)||_(o)}L.isTypedArray=_,L.isArrayOrTypedArray=u,L.isArray1D=function(o){return!u(o[0])},L.ensureArray=function(o,s){return e(o)||(o=[]),o.length=s,o};var r={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};function n(o){return o.constructor===ArrayBuffer}function l(o,s,c){if(u(o)){if(u(o[0])){for(var h=c,x=0;xk.max?m.set(g):m.set(+x)}},integer:{coerceFunction:function(x,m,g,k){(k.extras||[]).indexOf(x)===-1?(s(x)&&(x=c(x)),x%1||!b(x)||k.min!==void 0&&xk.max?m.set(g):m.set(+x)):m.set(x)}},string:{coerceFunction:function(x,m,g,k){if(typeof x!="string"){var A=typeof x=="number";k.strict!==!0&&A?m.set(String(x)):m.set(g)}else k.noBlank&&!x?m.set(g):m.set(x)}},color:{coerceFunction:function(x,m,g){s(x)&&(x=c(x)),d(x).isValid()?m.set(x):m.set(g)}},colorlist:{coerceFunction:function(x,m,g){Array.isArray(x)&&x.length&&x.every(function(k){return d(k).isValid()})?m.set(x):m.set(g)}},colorscale:{coerceFunction:function(x,m,g){m.set(y.get(x,g))}},angle:{coerceFunction:function(x,m,g){s(x)&&(x=c(x)),x==="auto"?m.set("auto"):b(x)?m.set(l(+x,360)):m.set(g)}},subplotid:{coerceFunction:function(x,m,g,k){var A=k.regex||n(g);typeof x=="string"&&A.test(x)?m.set(x):m.set(g)},validateFunction:function(x,m){var g=m.dflt;return x===g||typeof x=="string"&&!!n(g).test(x)}},flaglist:{coerceFunction:function(x,m,g,k){if((k.extras||[]).indexOf(x)===-1)if(typeof x=="string"){for(var A=x.split("+"),v=0;v=b&&j<=d?j:r}if(typeof j!="string"&&typeof j!="number")return r;j=String(j);var Q=A($),Z=j.charAt(0);!Q||Z!=="G"&&Z!=="g"||(j=j.substr(1),$="");var K=Q&&$.substr(0,7)==="chinese",ae=j.match(K?g:m);if(!ae)return r;var se=ae[1],he=ae[3]||"1",fe=Number(ae[5]||1),ie=Number(ae[7]||0),oe=Number(ae[9]||0),le=Number(ae[11]||0);if(Q){if(se.length===2)return r;var ge;se=Number(se);try{var ye=h.getComponentMethod("calendars","getCal")($);if(K){var me=he.charAt(he.length-1)==="i";he=parseInt(he,10),ge=ye.newDate(se,ye.toMonthIndex(se,he,me),fe)}else ge=ye.newDate(se,Number(he),fe)}catch{return r}return ge?(ge.toJD()-c)*n+ie*l+oe*o+le*s:r}se=se.length===2?(Number(se)+2e3-k)%100+k:Number(se),he-=1;var be=new Date(Date.UTC(2e3,he,fe,ie,oe));return be.setUTCFullYear(se),be.getUTCMonth()!==he||be.getUTCDate()!==fe?r:be.getTime()+le*s},b=L.MIN_MS=L.dateTime2ms("-9999"),d=L.MAX_MS=L.dateTime2ms("9999-12-31 23:59:59.9999"),L.isDateTime=function(j,$){return L.dateTime2ms(j,$)!==r};var S=90*n,T=3*l,p=5*o;function M(j,$,ee,H,J){if(($||ee||H||J)&&(j+=" "+v($,2)+":"+v(ee,2),(H||J)&&(j+=":"+v(H,2),J))){for(var Q=4;J%10==0;)Q-=1,J/=10;j+="."+v(J,Q)}return j}L.ms2DateTime=function(j,$,ee){if(typeof j!="number"||!(j>=b&&j<=d))return r;$||($=0);var H,J,Q,Z,K,ae,se=Math.floor(10*_(j+.05,1)),he=Math.round(j-se/10);if(A(ee)){var fe=Math.floor(he/n)+c,ie=Math.floor(_(j,n));try{H=h.getComponentMethod("calendars","getCal")(ee).fromJD(fe).formatDate("yyyy-mm-dd")}catch{H=x("G%Y-%m-%d")(new Date(he))}if(H.charAt(0)==="-")for(;H.length<11;)H="-0"+H.substr(1);else for(;H.length<10;)H="0"+H;J=$=b+n&&j<=d-n))return r;var $=Math.floor(10*_(j+.05,1)),ee=new Date(Math.round(j-$/10));return M(e("%Y-%m-%d")(ee),ee.getHours(),ee.getMinutes(),ee.getSeconds(),10*ee.getUTCMilliseconds()+$)},L.cleanDate=function(j,$,ee){if(j===r)return $;if(L.isJSDate(j)||typeof j=="number"&&isFinite(j)){if(A(ee))return y.error("JS Dates and milliseconds are incompatible with world calendars",j),$;if(!(j=L.ms2DateTimeLocal(+j))&&$!==void 0)return $}else if(!L.isDateTime(j,ee))return y.error("unrecognized date",j),$;return j};var f=/%\d?f/g,E=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function B(j,$,ee,H){j=j.replace(f,function(Q){var Z=Math.min(+Q.charAt(1)||6,6);return($/1e3%1+2).toFixed(Z).substr(2).replace(/0+$/,"")||"0"});var J=new Date(Math.floor($+.05));if(j=j.replace(E,function(){return I[ee("%q")(J)]}),A(H))try{j=h.getComponentMethod("calendars","worldCalFmt")(j,$,H)}catch{return"Invalid"}return ee(j)(J)}var N=[59,59.9,59.99,59.999,59.9999];L.formatDate=function(j,$,ee,H,J,Q){if(J=A(J)&&J,!$)if(ee==="y")$=Q.year;else if(ee==="m")$=Q.month;else{if(ee!=="d")return function(Z,K){var ae=_(Z+.05,n),se=v(Math.floor(ae/l),2)+":"+v(_(Math.floor(ae/o),60),2);if(K!=="M"){w(K)||(K=0);var he=(100+Math.min(_(Z/s,60),N[K])).toFixed(K).substr(1);K>0&&(he=he.replace(/0+$/,"").replace(/[\.]$/,"")),se+=":"+he}return se}(j,ee)+` +}`;var so=vf(function(){return sa(Rn,la+"return "+mi).apply(W,ar)});if(so.source=mi,ir(so))throw so;return so}function $p(xe){return pe(xe).toLowerCase()}function ag(xe){return pe(xe).toUpperCase()}function xm(xe,Ne,gt){if(xe=pe(xe),xe&&(gt||Ne===W))return pc(xe);if(!xe||!(Ne=vc(Ne)))return xe;var $t=Yo(xe),pn=Yo(Ne),Rn=gh($t,pn),ar=Fo($t,pn)+1;return mh($t,Rn,ar).join("")}function Yp(xe,Ne,gt){if(xe=pe(xe),xe&&(gt||Ne===W))return xe.slice(0,tc(xe)+1);if(!xe||!(Ne=vc(Ne)))return xe;var $t=Yo(xe),pn=Fo($t,Yo(Ne))+1;return mh($t,0,pn).join("")}function _m(xe,Ne,gt){if(xe=pe(xe),xe&&(gt||Ne===W))return xe.replace(yt,"");if(!xe||!(Ne=vc(Ne)))return xe;var $t=Yo(xe),pn=gh($t,Yo(Ne));return mh($t,pn).join("")}function bm(xe,Ne){var gt=A,$t=v;if(qr(Ne)){var pn="separator"in Ne?Ne.separator:pn;gt="length"in Ne?ea(Ne.length):gt,$t="omission"in Ne?vc(Ne.omission):$t}xe=pe(xe);var Rn=xe.length;if(ys(xe)){var ar=Yo(xe);Rn=ar.length}if(gt>=Rn)return xe;var fr=gt-Hs($t);if(fr<1)return $t;var zr=ar?mh(ar,0,fr).join(""):xe.slice(0,fr);if(pn===W)return zr+$t;if(ar&&(fr+=zr.length-fr),va(pn)){if(xe.slice(fr).search(pn)){var ci,hi=zr;for(pn.global||(pn=mu(pn.source,pe(Lt.exec(pn))+"g")),pn.lastIndex=0;ci=pn.exec(hi);)var mi=ci.index;zr=zr.slice(0,mi===W?fr:mi)}}else if(xe.indexOf(vc(pn),fr)!=fr){var Ui=zr.lastIndexOf(pn);Ui>-1&&(zr=zr.slice(0,Ui))}return zr+$t}function wm(xe){return xe=pe(xe),xe&&nt.test(xe)?xe.replace(Ge,nc):xe}var Tm=np(function(xe,Ne,gt){return xe+(gt?" ":"")+Ne.toUpperCase()}),Wd=Vg("toUpperCase");function Ls(xe,Ne,gt){return xe=pe(xe),Ne=gt?W:Ne,Ne===W?qs(xe)?_l(xe):Za(xe):xe.match(Ne)||[]}var vf=ga(function(xe,Ne){try{return Oa(xe,W,Ne)}catch(gt){return ir(gt)?gt:new ia(gt)}}),og=Nc(function(xe,Ne){return lo(Ne,function(gt){gt=Ga(gt),ve(xe,gt,zo(xe[gt],xe))}),xe});function _h(xe){var Ne=xe==null?0:xe.length,gt=ma();return xe=Ne?Ta(xe,function($t){if(typeof $t[1]!="function")throw new ls(L);return[gt($t[0]),$t[1]]}):[],ga(function($t){for(var pn=-1;++pnI)return[];var gt=V,$t=ua(xe,V);Ne=ma(Ne),xe-=V;for(var pn=ju($t,Ne);++gt0||Ne<0)?new ta(gt):(xe<0?gt=gt.takeRight(-xe):xe&&(gt=gt.drop(xe)),Ne!==W&&(Ne=ea(Ne),gt=Ne<0?gt.dropRight(-Ne):gt.take(Ne-xe)),gt)},ta.prototype.takeRightWhile=function(xe){return this.reverse().takeWhile(xe).reverse()},ta.prototype.toArray=function(){return this.take(V)},Vn(ta.prototype,function(xe,Ne){var gt=/^(?:filter|find|map|reject)|While$/.test(Ne),$t=/^(?:head|last)$/.test(Ne),pn=cn[$t?"take"+(Ne=="last"?"Right":""):Ne],Rn=$t||/^find/.test(Ne);pn&&(cn.prototype[Ne]=function(){var ar=this.__wrapped__,fr=$t?[1]:arguments,zr=ar instanceof ta,ci=fr[0],hi=zr||ot(ar),mi=function(_o){var Ro=pn.apply(cn,ws([_o],fr));return $t&&Ui?Ro[0]:Ro};hi&>&&typeof ci=="function"&&ci.length!=1&&(zr=hi=!1);var Ui=this.__chain__,la=!!this.__actions__.length,Ca=Rn&&!Ui,so=zr&&!la;if(!Rn&&hi){ar=so?ar:new ta(this);var Ia=xe.apply(ar,fr);return Ia.__actions__.push({func:vh,args:[mi],thisArg:W}),new io(Ia,Ui)}return Ca&&so?xe.apply(this,fr):(Ia=this.thru(mi),Ca?$t?Ia.value()[0]:Ia.value():Ia)})}),lo(["pop","push","shift","sort","splice","unshift"],function(xe){var Ne=Ws[xe],gt=/^(?:push|sort|unshift)$/.test(xe)?"tap":"thru",$t=/^(?:pop|shift)$/.test(xe);cn.prototype[xe]=function(){var pn=arguments;if($t&&!this.__chain__){var Rn=this.value();return Ne.apply(ot(Rn)?Rn:[],pn)}return this[gt](function(ar){return Ne.apply(ot(ar)?ar:[],pn)})}}),Vn(ta.prototype,function(xe,Ne){var gt=cn[Ne];if(gt){var $t=gt.name+"";ba.call(Na,$t)||(Na[$t]=[]),Na[$t].push({name:Ne,func:gt})}}),Na[Mp(W,l).name]=[{name:"wrapper",func:W}],ta.prototype.clone=Qo,ta.prototype.reverse=ac,ta.prototype.value=yi,cn.prototype.at=Cc,cn.prototype.chain=Vf,cn.prototype.commit=lp,cn.prototype.next=ff,cn.prototype.plant=ih,cn.prototype.reverse=pm,cn.prototype.toJSON=cn.prototype.valueOf=cn.prototype.value=dm,cn.prototype.first=cn.prototype.head,Co&&(cn.prototype[Co]=pf),cn},Gs=Hl();gi?((gi.exports=Gs)._=Gs,Jr._=Gs):Cr._=Gs}).call(Uv)})($x,$x.exports);var A4=$x.exports,m8={exports:{}};(function(O,z){/*! For license information please see plotly.min.js.LICENSE.txt */(function(W,ce){O.exports=ce()})(self,function(){return function(){var W={6713:function(D,L,t){var b=t(34809),d={"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":"overflow:hidden;","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(var e in d){var w=e.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier");b.addStyleRule(w,d[e])}},14187:function(D,L,t){D.exports=t(47908)},20273:function(D,L,t){D.exports=t(58218)},6457:function(D,L,t){D.exports=t(89362)},15849:function(D,L,t){D.exports=t(53794)},38847:function(D,L,t){D.exports=t(29698)},7659:function(D,L,t){D.exports=t(51252)},60089:function(D,L,t){D.exports=t(48050)},22084:function(D,L,t){D.exports=t(58075)},35892:function(D,L,t){D.exports=t(9419)},81204:function(D,L,t){D.exports=t(28128)},55857:function(D,L,t){D.exports=t(47050)},12862:function(D,L,t){D.exports=t(91405)},97629:function(D,L,t){D.exports=t(34406)},67549:function(D,L,t){D.exports=t(17430)},2660:function(D,L,t){D.exports=t(91995)},86071:function(D,L,t){D.exports=t(81264)},66200:function(D,L,t){D.exports=t(42849)},53446:function(D,L,t){D.exports=t(52213)},86899:function(D,L,t){D.exports=t(91132)},13430:function(D,L,t){D.exports=t(50453)},21548:function(D,L,t){D.exports=t(29251)},53939:function(D,L,t){D.exports=t(72892)},1902:function(D,L,t){D.exports=t(74461)},29096:function(D,L,t){D.exports=t(66143)},23820:function(D,L,t){D.exports=t(81955)},82017:function(D,L,t){D.exports=t(36858)},113:function(D,L,t){D.exports=t(92106)},20260:function(D,L,t){var b=t(67549);b.register([t(20273),t(15849),t(21548),t(1902),t(29096),t(23820),t(12862),t(1639),t(10067),t(53446),t(31014),t(113),t(78170),t(8202),t(92382),t(82017),t(86899),t(54357),t(66903),t(90594),t(71680),t(7412),t(55857),t(784),t(74221),t(22084),t(44001),t(97281),t(12345),t(53939),t(29117),t(5410),t(5057),t(81204),t(86071),t(14226),t(35892),t(2660),t(96599),t(28573),t(76832),t(60089),t(51469),t(97629),t(27700),t(7659),t(11780),t(27195),t(6457),t(84639),t(14187),t(66200),t(13430),t(90590),t(38847)]),D.exports=b},28573:function(D,L,t){D.exports=t(25638)},90594:function(D,L,t){D.exports=t(75297)},7412:function(D,L,t){D.exports=t(58859)},27700:function(D,L,t){D.exports=t(12683)},5410:function(D,L,t){D.exports=t(6305)},29117:function(D,L,t){D.exports=t(83910)},78170:function(D,L,t){D.exports=t(49913)},12345:function(D,L,t){D.exports=t(15186)},96599:function(D,L,t){D.exports=t(71760)},54357:function(D,L,t){D.exports=t(17822)},51469:function(D,L,t){D.exports=t(56534)},74221:function(D,L,t){D.exports=t(18070)},44001:function(D,L,t){D.exports=t(52378)},14226:function(D,L,t){D.exports=t(30929)},5057:function(D,L,t){D.exports=t(83866)},11780:function(D,L,t){D.exports=t(66939)},27195:function(D,L,t){D.exports=t(23748)},84639:function(D,L,t){D.exports=t(73304)},1639:function(D,L,t){D.exports=t(12864)},90590:function(D,L,t){D.exports=t(99855)},97281:function(D,L,t){D.exports=t(91450)},784:function(D,L,t){D.exports=t(51943)},8202:function(D,L,t){D.exports=t(80809)},66903:function(D,L,t){D.exports=t(95984)},76832:function(D,L,t){D.exports=t(51671)},92382:function(D,L,t){D.exports=t(47181)},10067:function(D,L,t){D.exports=t(37276)},71680:function(D,L,t){D.exports=t(75703)},31014:function(D,L,t){D.exports=t(38261)},11645:function(D){D.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}]},50222:function(D,L,t){var b=t(11645),d=t(80337),e=t(54826),w=t(78032).templatedArray;t(35081),D.exports=w("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:d({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:b.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:b.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",e.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",e.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",e.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",e.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:d({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc",_deprecated:{ref:{valType:"string",editType:"calc"}}})},60317:function(D,L,t){var b=t(34809),d=t(29714),e=t(3377).draw;function w(_){var u=_._fullLayout;b.filterVisible(u.annotations).forEach(function(r){var n=d.getFromId(_,r.xref),l=d.getFromId(_,r.yref),o=d.getRefType(r.xref),s=d.getRefType(r.yref);r._extremes={},o==="range"&&y(r,n),s==="range"&&y(r,l)})}function y(_,u){var r,n=u._id,l=n.charAt(0),o=_[l],s=_["a"+l],c=_[l+"ref"],h=_["a"+l+"ref"],x=_["_"+l+"padplus"],m=_["_"+l+"padminus"],g={x:1,y:-1}[l]*_[l+"shift"],k=3*_.arrowsize*_.arrowwidth||0,A=k+g,v=k-g,S=3*_.startarrowsize*_.arrowwidth||0,T=S+g,p=S-g;if(h===c){var M=d.findExtremes(u,[u.r2c(o)],{ppadplus:A,ppadminus:v}),f=d.findExtremes(u,[u.r2c(s)],{ppadplus:Math.max(x,T),ppadminus:Math.max(m,p)});r={min:[M.min[0],f.min[0]],max:[M.max[0],f.max[0]]}}else T=s?T+s:T,p=s?p-s:p,r=d.findExtremes(u,[u.r2c(o)],{ppadplus:Math.max(x,A,T),ppadminus:Math.max(m,v,p)});_._extremes[n]=r}D.exports=function(_){var u=_._fullLayout;if(b.filterVisible(u.annotations).length&&_._fullData.length)return b.syncOrAsync([e,w],_)}},6035:function(D,L,t){var b=t(34809),d=t(33626),e=t(78032).arrayEditor;function w(_,u){var r,n,l,o,s,c,h,x=_._fullLayout.annotations,m=[],g=[],k=[],A=(u||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(_,u){var r,n,l=w(_,u),o=l.on,s=l.off.concat(l.explicitOff),c={},h=_._fullLayout.annotations;if(o.length||s.length){for(r=0;r.6666666666666666?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[St]}for(var qe=!1,$e=["x","y"],Ye=0;Ye<$e.length;Ye++){var _e,De,Be,Ge,tt,nt=$e[Ye],ft=A[nt+"ref"]||nt,At=A["a"+nt+"ref"],kt={x:T,y:p}[nt],Vt=(J+(nt==="x"?0:-90))*Math.PI/180,Ht=ke*Math.cos(Vt),Gt=He*Math.sin(Vt),st=Math.abs(Ht)+Math.abs(Gt),Qe=A[nt+"anchor"],pt=A[nt+"shift"]*(nt==="x"?1:-1),yt=H[nt],Ot=_.getRefType(ft);if(kt&&Ot!=="domain"){var Pt=kt.r2fraction(A[nt]);(Pt<0||Pt>1)&&(At===ft?((Pt=kt.r2fraction(A["a"+nt]))<0||Pt>1)&&(qe=!0):qe=!0),_e=kt._offset+kt.r2p(A[nt]),Ge=.5}else{var at=Ot==="domain";nt==="x"?(Be=A[nt],_e=at?kt._offset+kt._length*Be:_e=I.l+I.w*Be):(Be=1-A[nt],_e=at?kt._offset+kt._length*Be:_e=I.t+I.h*Be),Ge=A.showarrow?.5:Be}if(A.showarrow){yt.head=_e;var lt=A["a"+nt];if(tt=Ht*Fe(.5,A.xanchor)-Gt*Fe(.5,A.yanchor),At===ft){var Xe=_.getRefType(At);Xe==="domain"?(nt==="y"&&(lt=1-lt),yt.tail=kt._offset+kt._length*lt):Xe==="paper"?nt==="y"?(lt=1-lt,yt.tail=I.t+I.h*lt):yt.tail=I.l+I.w*lt:yt.tail=kt._offset+kt.r2p(lt),De=tt}else yt.tail=_e+lt,De=tt+lt;yt.text=yt.tail+tt;var ut=E[nt==="x"?"width":"height"];if(ft==="paper"&&(yt.head=w.constrain(yt.head,1,ut-1)),At==="pixel"){var wt=-Math.max(yt.tail-3,yt.text),vt=Math.min(yt.tail+3,yt.text)-ut;wt>0?(yt.tail+=wt,yt.text+=wt):vt>0&&(yt.tail-=vt,yt.text-=vt)}yt.tail+=pt,yt.head+=pt}else De=tt=st*Fe(Ge,Qe),yt.text=_e+tt;yt.text+=pt,tt+=pt,De+=pt,A["_"+nt+"padplus"]=st/2+De,A["_"+nt+"padminus"]=st/2-De,A["_"+nt+"size"]=st,A["_"+nt+"shift"]=tt}if(qe)se.remove();else{var Lt=0,jt=0;if(A.align!=="left"&&(Lt=(de-Ve)*(A.align==="center"?.5:1)),A.valign!=="top"&&(jt=(Me-Pe)*(A.valign==="middle"?.5:1)),We)Oe.select("svg").attr({x:ie+Lt-1,y:ie+jt}).call(r.setClipUrl,le?ee:null,k);else{var rt=ie+jt-Ie.top,et=ie+Lt-Ie.left;be.call(l.positionText,et,rt).call(r.setClipUrl,le?ee:null,k)}ge.select("rect").call(r.setRect,ie,ie,de,Me),oe.call(r.setRect,he/2,he/2,ke-he,He-he),se.call(r.setTranslate,Math.round(H.x.text-ke/2),Math.round(H.y.text-He/2)),Z.attr({transform:"rotate("+J+","+H.x.text+","+H.y.text+")"});var Et,Bt=function(Ft,St){Q.selectAll(".annotation-arrow-g").remove();var Jt=H.x.head,qt=H.y.head,en=H.x.tail+Ft,Wt=H.y.tail+St,Zt=H.x.text+Ft,on=H.y.text+St,un=w.rotationXYMatrix(J,Zt,on),Pn=w.apply2DTransform(un),Dn=w.apply2DTransform2(un),In=+oe.attr("width"),mn=+oe.attr("height"),En=Zt-.5*In,Kn=En+In,Ln=on-.5*mn,Tn=Ln+mn,Fn=[[En,Ln,En,Tn],[En,Tn,Kn,Tn],[Kn,Tn,Kn,Ln],[Kn,Ln,En,Ln]].map(Dn);if(!Fn.reduce(function(Ar,xr){return Ar^!!w.segmentsIntersect(Jt,qt,Jt+1e6,qt+1e6,xr[0],xr[1],xr[2],xr[3])},!1)){Fn.forEach(function(Ar){var xr=w.segmentsIntersect(en,Wt,Jt,qt,Ar[0],Ar[1],Ar[2],Ar[3]);xr&&(en=xr.x,Wt=xr.y)});var wn=A.arrowwidth,zn=A.arrowcolor,Jn=A.arrowside,$n=Q.append("g").style({opacity:u.opacity(zn)}).classed("annotation-arrow-g",!0),vr=$n.append("path").attr("d","M"+en+","+Wt+"L"+Jt+","+qt).style("stroke-width",wn+"px").call(u.stroke,u.rgb(zn));if(h(vr,Jn,A),B.annotationPosition&&vr.node().parentNode&&!S){var Qn=Jt,lr=qt;if(A.standoff){var hr=Math.sqrt(Math.pow(Jt-en,2)+Math.pow(qt-Wt,2));Qn+=A.standoff*(en-Jt)/hr,lr+=A.standoff*(Wt-qt)/hr}var jr,ni,Or=$n.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(en-Qn)+","+(Wt-lr),transform:y(Qn,lr)}).style("stroke-width",wn+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");s.init({element:Or.node(),gd:k,prepFn:function(){var Ar=r.getTranslate(se);jr=Ar.x,ni=Ar.y,T&&T.autorange&&V(T._name+".autorange",!0),p&&p.autorange&&V(p._name+".autorange",!0)},moveFn:function(Ar,xr){var Qr=Pn(jr,ni),kn=Qr[0]+Ar,Cn=Qr[1]+xr;se.call(r.setTranslate,kn,Cn),j("x",m(T,Ar,"x",I,A)),j("y",m(p,xr,"y",I,A)),A.axref===A.xref&&j("ax",m(T,Ar,"ax",I,A)),A.ayref===A.yref&&j("ay",m(p,xr,"ay",I,A)),$n.attr("transform",y(Ar,xr)),Z.attr({transform:"rotate("+J+","+kn+","+Cn+")"})},doneFn:function(){d.call("_guiRelayout",k,$());var Ar=document.querySelector(".js-notes-box-panel");Ar&&Ar.redraw(Ar.selectedObj)}})}}};A.showarrow&&Bt(0,0),K&&s.init({element:se.node(),gd:k,prepFn:function(){Et=Z.attr("transform")},moveFn:function(Ft,St){var Jt="pointer";if(A.showarrow)A.axref===A.xref?j("ax",m(T,Ft,"ax",I,A)):j("ax",A.ax+Ft),A.ayref===A.yref?j("ay",m(p,St,"ay",I.w,A)):j("ay",A.ay+St),Bt(Ft,St);else{if(S)return;var qt,en;if(T)qt=m(T,Ft,"x",I,A);else{var Wt=A._xsize/I.w,Zt=A.x+(A._xshift-A.xshift)/I.w-Wt/2;qt=s.align(Zt+Ft/I.w,Wt,0,1,A.xanchor)}if(p)en=m(p,St,"y",I,A);else{var on=A._ysize/I.h,un=A.y-(A._yshift+A.yshift)/I.h-on/2;en=s.align(un-St/I.h,on,0,1,A.yanchor)}j("x",qt),j("y",en),T&&p||(Jt=s.getCursor(T?.5:qt,p?.5:en,A.xanchor,A.yanchor))}Z.attr({transform:y(Ft,St)+Et}),o(se,Jt)},clickFn:function(Ft,St){A.captureevents&&k.emit("plotly_clickannotation",Se(St))},doneFn:function(){o(se),d.call("_guiRelayout",k,$());var Ft=document.querySelector(".js-notes-box-panel");Ft&&Ft.redraw(Ft.selectedObj)}})}}}D.exports={draw:function(k){var A=k._fullLayout;A._infolayer.selectAll(".annotation").remove();for(var v=0;v=0,S=n.indexOf("end")>=0,T=m.backoff*k+l.standoff,p=g.backoff*A+l.startstandoff;if(x.nodeName==="line"){o={x:+r.attr("x1"),y:+r.attr("y1")},s={x:+r.attr("x2"),y:+r.attr("y2")};var M=o.x-s.x,f=o.y-s.y;if(h=(c=Math.atan2(f,M))+Math.PI,T&&p&&T+p>Math.sqrt(M*M+f*f))return void Q();if(T){if(T*T>M*M+f*f)return void Q();var E=T*Math.cos(c),I=T*Math.sin(c);s.x+=E,s.y+=I,r.attr({x2:s.x,y2:s.y})}if(p){if(p*p>M*M+f*f)return void Q();var B=p*Math.cos(c),N=p*Math.sin(c);o.x-=B,o.y-=N,r.attr({x1:o.x,y1:o.y})}}else if(x.nodeName==="path"){var V=x.getTotalLength(),j="";if(V1){l=!0;break}}l?w.fullLayout._infolayer.select(".annotation-"+w.id+'[data-index="'+r+'"]').remove():(n._pdata=d(w.glplot.cameraParams,[y.xaxis.r2l(n.x)*_[0],y.yaxis.r2l(n.y)*_[1],y.zaxis.r2l(n.z)*_[2]]),b(w.graphDiv,n,r,w.id,n._xa,n._ya))}}},83348:function(D,L,t){var b=t(33626),d=t(34809);D.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t(38239)}}},layoutAttributes:t(38239),handleDefaults:t(34232),includeBasePlot:function(e,w){var y=b.subplotsRegistry.gl3d;if(y)for(var _=y.attrRegex,u=Object.keys(e),r=0;r=0)))return n;if(h===3)s[h]>1&&(s[h]=1);else if(s[h]>=1)return n}var x=Math.round(255*s[0])+", "+Math.round(255*s[1])+", "+Math.round(255*s[2]);return c?"rgba("+x+", "+s[3]+")":"rgb("+x+")"}w.tinyRGB=function(n){var l=n.toRgb();return"rgb("+Math.round(l.r)+", "+Math.round(l.g)+", "+Math.round(l.b)+")"},w.rgb=function(n){return w.tinyRGB(b(n))},w.opacity=function(n){return n?b(n).getAlpha():0},w.addOpacity=function(n,l){var o=b(n).toRgb();return"rgba("+Math.round(o.r)+", "+Math.round(o.g)+", "+Math.round(o.b)+", "+l+")"},w.combine=function(n,l){var o=b(n).toRgb();if(o.a===1)return b(n).toRgbString();var s=b(l||u).toRgb(),c=s.a===1?s:{r:255*(1-s.a)+s.r*s.a,g:255*(1-s.a)+s.g*s.a,b:255*(1-s.a)+s.b*s.a},h={r:c.r*(1-o.a)+o.r*o.a,g:c.g*(1-o.a)+o.g*o.a,b:c.b*(1-o.a)+o.b*o.a};return b(h).toRgbString()},w.interpolate=function(n,l,o){var s=b(n).toRgb(),c=b(l).toRgb(),h={r:o*s.r+(1-o)*c.r,g:o*s.g+(1-o)*c.g,b:o*s.b+(1-o)*c.b};return b(h).toRgbString()},w.contrast=function(n,l,o){var s=b(n);return s.getAlpha()!==1&&(s=b(w.combine(n,u))),(s.isDark()?l?s.lighten(l):u:o?s.darken(o):_).toString()},w.stroke=function(n,l){var o=b(l);n.style({stroke:w.tinyRGB(o),"stroke-opacity":o.getAlpha()})},w.fill=function(n,l){var o=b(l);n.style({fill:w.tinyRGB(o),"fill-opacity":o.getAlpha()})},w.clean=function(n){if(n&&typeof n=="object"){var l,o,s,c,h=Object.keys(n);for(l=0;l0?vt>=Et:vt<=Et));Lt++)vt>Ft&&vt0?vt>=Et:vt<=Et));Lt++)vt>wt[0]&&vt1){var Gt=Math.pow(10,Math.floor(Math.log(Ht)/Math.LN10));kt*=Gt*u.roundUp(Ht/Gt,[2,5,10]),(Math.abs(Ve.start)/Ve.size+1e-6)%1<2e-6&&(ft.tick0=0)}ft.dtick=kt}ft.domain=$?[tt+ie/be.h,tt+qe-ie/be.h]:[tt+fe/be.w,tt+qe-fe/be.w],ft.setScale(),N.attr("transform",r(Math.round(be.l),Math.round(be.t)));var st,Qe=N.select("."+p.cbtitleunshift).attr("transform",r(-Math.round(be.l),-Math.round(be.t))),pt=ft.ticklabelposition,yt=ft.title.font.size,Ot=N.select("."+p.cbaxis),Pt=0,at=0;function lt(Xe,ut){var wt={propContainer:ft,propName:V._propPrefix+"title",traceIndex:V._traceIndex,_meta:V._meta,placeholder:me._dfltTitle.colorbar,containerGroup:N.select("."+p.cbtitle)},vt=Xe.charAt(0)==="h"?Xe.substr(1):"h"+Xe;N.selectAll("."+vt+",."+vt+"-math-group").remove(),c.draw(j,Xe,n(wt,ut||{}))}return u.syncOrAsync([e.previousPromises,function(){var Xe,ut;($&&At||!$&&!At)&&(Le==="top"&&(Xe=fe+be.l+$e*oe,ut=ie+be.t+Ye*(1-tt-qe)+3+.75*yt),Le==="bottom"&&(Xe=fe+be.l+$e*oe,ut=ie+be.t+Ye*(1-tt)-3-.25*yt),Le==="right"&&(ut=ie+be.t+Ye*le+3+.75*yt,Xe=fe+be.l+$e*tt),lt(ft._id+"title",{attributes:{x:Xe,y:ut,"text-anchor":$?"start":"middle"}}))},function(){if(!$&&!At||$&&At){var Xe,ut=N.select("."+p.cbtitle),wt=ut.select("text"),vt=[-Z/2,Z/2],Lt=ut.select(".h"+ft._id+"title-math-group").node(),jt=15.6;if(wt.node()&&(jt=parseInt(wt.node().style.fontSize,10)*v),Lt?(Xe=o.bBox(Lt),at=Xe.width,(Pt=Xe.height)>jt&&(vt[1]-=(Pt-jt)/2)):wt.node()&&!wt.classed(p.jsPlaceholder)&&(Xe=o.bBox(wt.node()),at=Xe.width,Pt=Xe.height),$){if(Pt){if(Pt+=5,Le==="top")ft.domain[1]-=Pt/be.h,vt[1]*=-1;else{ft.domain[0]+=Pt/be.h;var rt=h.lineCount(wt);vt[1]+=(1-rt)*jt}ut.attr("transform",r(vt[0],vt[1])),ft.setScale()}}else at&&(Le==="right"&&(ft.domain[0]+=(at+yt/2)/be.w),ut.attr("transform",r(vt[0],vt[1])),ft.setScale())}N.selectAll("."+p.cbfills+",."+p.cblines).attr("transform",$?r(0,Math.round(be.h*(1-ft.domain[1]))):r(Math.round(be.w*ft.domain[0]),0)),Ot.attr("transform",$?r(0,Math.round(-be.t)):r(Math.round(-be.l),0));var et=N.select("."+p.cbfills).selectAll("rect."+p.cbfill).attr("style","").data(de);et.enter().append("rect").classed(p.cbfill,!0).attr("style",""),et.exit().remove();var Et=Oe.map(ft.c2p).map(Math.round).sort(function(qt,en){return qt-en});et.each(function(qt,en){var Wt=[en===0?Oe[0]:(de[en]+de[en-1])/2,en===de.length-1?Oe[1]:(de[en]+de[en+1])/2].map(ft.c2p).map(Math.round);$&&(Wt[1]=u.constrain(Wt[1]+(Wt[1]>Wt[0])?1:-1,Et[0],Et[1]));var Zt=b.select(this).attr($?"x":"y",_e).attr($?"y":"x",b.min(Wt)).attr($?"width":"height",Math.max(ke,2)).attr($?"height":"width",Math.max(b.max(Wt)-b.min(Wt),2));if(V._fillgradient)o.gradient(Zt,j,V._id,$?"vertical":"horizontalreversed",V._fillgradient,"fill");else{var on=Ie(qt).replace("e-","");Zt.attr("fill",d(on).toHexString())}});var Bt=N.select("."+p.cblines).selectAll("path."+p.cbline).data(Ee.color&&Ee.width?Me:[]);Bt.enter().append("path").classed(p.cbline,!0),Bt.exit().remove(),Bt.each(function(qt){var en=_e,Wt=Math.round(ft.c2p(qt))+Ee.width/2%1;b.select(this).attr("d","M"+($?en+","+Wt:Wt+","+en)+($?"h":"v")+ke).call(o.lineGroupStyle,Ee.width,We(qt),Ee.dash)}),Ot.selectAll("g."+ft._id+"tick,path").remove();var Ft=_e+ke+(Z||0)/2-(V.ticks==="outside"?1:0),St=y.calcTicks(ft),Jt=y.getTickSigns(ft)[2];return y.drawTicks(j,ft,{vals:ft.ticks==="inside"?y.clipEnds(ft,St):St,layer:Ot,path:y.makeTickPath(ft,Ft,Jt),transFn:y.makeTransTickFn(ft)}),y.drawLabels(j,ft,{vals:St,layer:Ot,transFn:y.makeTransTickLabelFn(ft),labelFns:y.makeLabelFns(ft,Ft)})},function(){if($&&!At||!$&&At){var Xe,ut,wt=ft.position||0,vt=ft._offset+ft._length/2;if(Le==="right")ut=vt,Xe=be.l+$e*wt+10+yt*(ft.showticklabels?1:.5);else if(Xe=vt,Le==="bottom"&&(ut=be.t+Ye*wt+10+(pt.indexOf("inside")===-1?ft.tickfont.size:0)+(ft.ticks!=="intside"&&V.ticklen||0)),Le==="top"){var Lt=Ce.text.split("
").length;ut=be.t+Ye*wt+10-ke-v*yt*Lt}lt(($?"h":"v")+ft._id+"title",{avoid:{selection:b.select(j).selectAll("g."+ft._id+"tick"),side:Le,offsetTop:$?0:be.t,offsetLeft:$?be.l:0,maxShift:$?me.width:me.height},attributes:{x:Xe,y:ut,"text-anchor":"middle"},transform:{rotate:$?-90:0,offset:0}})}},e.previousPromises,function(){var Xe,ut=ke+Z/2;pt.indexOf("inside")===-1&&(Xe=o.bBox(Ot.node()),ut+=$?Xe.width:Xe.height),st=Qe.select("text");var wt=0,vt=$&&Le==="top",Lt=!$&&Le==="right",jt=0;if(st.node()&&!st.classed(p.jsPlaceholder)){var rt,et=Qe.select(".h"+ft._id+"title-math-group").node();et&&($&&At||!$&&!At)?(wt=(Xe=o.bBox(et)).width,rt=Xe.height):(wt=(Xe=o.bBox(Qe.node())).right-be.l-($?_e:nt),rt=Xe.bottom-be.t-($?nt:_e),$||Le!=="top"||(ut+=Xe.height,jt=Xe.height)),Lt&&(st.attr("transform",r(wt/2+yt/2,0)),wt*=2),ut=Math.max(ut,$?wt:rt)}var Et=2*($?fe:ie)+ut+K+Z/2,Bt=0;!$&&Ce.text&&he==="bottom"&&le<=0&&(Et+=Bt=Et/2,jt+=Bt),me._hColorbarMoveTitle=Bt,me._hColorbarMoveCBTitle=jt;var Ft=K+Z,St=($?_e:nt)-Ft/2-($?fe:0),Jt=($?nt:_e)-($?Fe:ie+jt-Bt);N.select("."+p.cbbg).attr("x",St).attr("y",Jt).attr($?"width":"height",Math.max(Et-Bt,2)).attr($?"height":"width",Math.max(Fe+Ft,2)).call(s.fill,ae).call(s.stroke,V.bordercolor).style("stroke-width",K);var qt=Lt?Math.max(wt-10,0):0;N.selectAll("."+p.cboutline).attr("x",($?_e:nt+fe)+qt).attr("y",($?nt+ie-Fe:_e)+(vt?Pt:0)).attr($?"width":"height",Math.max(ke,2)).attr($?"height":"width",Math.max(Fe-($?2*ie+Pt:2*fe+qt),2)).call(s.stroke,V.outlinecolor).style({fill:"none","stroke-width":Z});var en=$?De*Et:0,Wt=$?0:(1-Be)*Et-jt;if(en=ye?be.l-en:-en,Wt=ge?be.t-Wt:-Wt,N.attr("transform",r(en,Wt)),!$&&(K||d(ae).getAlpha()&&!d.equals(me.paper_bgcolor,ae))){var Zt=Ot.selectAll("text"),on=Zt[0].length,un=N.select("."+p.cbbg).node(),Pn=o.bBox(un),Dn=o.getTranslate(N);Zt.each(function(Jn,$n){var vr=on-1;if($n===0||$n===vr){var Qn,lr=o.bBox(this),hr=o.getTranslate(this);if($n===vr){var jr=lr.right+hr.x;(Qn=Pn.right+Dn.x+nt-K-2+oe-jr)>0&&(Qn=0)}else if($n===0){var ni=lr.left+hr.x;(Qn=Pn.left+Dn.x+nt+K+2-ni)<0&&(Qn=0)}Qn&&(on<3?this.setAttribute("transform","translate("+Qn+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var In={},mn=S[se],En=T[se],Kn=S[he],Ln=T[he],Tn=Et-ke;$?(H==="pixels"?(In.y=le,In.t=Fe*Kn,In.b=Fe*Ln):(In.t=In.b=0,In.yt=le+ee*Kn,In.yb=le-ee*Ln),Q==="pixels"?(In.x=oe,In.l=Et*mn,In.r=Et*En):(In.l=Tn*mn,In.r=Tn*En,In.xl=oe-J*mn,In.xr=oe+J*En)):(H==="pixels"?(In.x=oe,In.l=Fe*mn,In.r=Fe*En):(In.l=In.r=0,In.xl=oe+ee*mn,In.xr=oe-ee*En),Q==="pixels"?(In.y=1-le,In.t=Et*Kn,In.b=Et*Ln):(In.t=Tn*Kn,In.b=Tn*Ln,In.yt=le-J*Kn,In.yb=le+J*Ln));var Fn=V.y<.5?"b":"t",wn=V.x<.5?"l":"r";j._fullLayout._reservedMargin[V._id]={};var zn={r:me.width-St-en,l:St+In.r,b:me.height-Jt-Wt,t:Jt+In.b};ye&&ge?e.autoMargin(j,V._id,In):ye?j._fullLayout._reservedMargin[V._id][Fn]=zn[Fn]:ge||$?j._fullLayout._reservedMargin[V._id][wn]=zn[wn]:j._fullLayout._reservedMargin[V._id][Fn]=zn[Fn]}],j)}(I,E,M);B&&B.then&&(M._promises||[]).push(B),M._context.edits.colorbarPosition&&function(N,V,j){var $,ee,H,J=V.orientation==="v",Q=j._fullLayout._size;_.init({element:N.node(),gd:j,prepFn:function(){$=N.attr("transform"),l(N)},moveFn:function(Z,K){N.attr("transform",$+r(Z,K)),ee=_.align((J?V._uFrac:V._vFrac)+Z/Q.w,J?V._thickFrac:V._lenFrac,0,1,V.xanchor),H=_.align((J?V._vFrac:1-V._uFrac)-K/Q.h,J?V._lenFrac:V._thickFrac,0,1,V.yanchor);var ae=_.getCursor(ee,H,V.xanchor,V.yanchor);l(N,ae)},doneFn:function(){if(l(N),ee!==void 0&&H!==void 0){var Z={};Z[V._propPrefix+"x"]=ee,Z[V._propPrefix+"y"]=H,V._traceIndex!==void 0?w.call("_guiRestyle",j,Z,V._traceIndex):w.call("_guiRelayout",j,Z)}}})}(I,E,M)}),f.exit().each(function(E){e.autoMargin(M,E._id)}).remove(),f.order()}}},91362:function(D,L,t){var b=t(34809);D.exports=function(d){return b.isPlainObject(d.colorbar)}},96919:function(D,L,t){D.exports={moduleType:"component",name:"colorbar",attributes:t(25158),supplyDefaults:t(42097),draw:t(5881).draw,hasColorbar:t(91362)}},87163:function(D,L,t){var b=t(25158),d=t(90694).counter,e=t(62994),w=t(19017).scales;function y(_){return"`"+_+"`"}e(w),D.exports=function(_,u){_=_||"";var r,n=(u=u||{}).cLetter||"c",l=("onlyIfNumerical"in u&&u.onlyIfNumerical,"noScale"in u?u.noScale:_==="marker.line"),o="showScaleDflt"in u?u.showScaleDflt:n==="z",s=typeof u.colorscaleDflt=="string"?w[u.colorscaleDflt]:null,c=u.editTypeOverride||"",h=_?_+".":"";"colorAttr"in u?(r=u.colorAttr,u.colorAttr):y(h+(r={z:"z",c:"color"}[n]));var x=n+"auto",m=n+"min",g=n+"max",k=n+"mid",A={};A[m]=A[g]=void 0;var v={};v[x]=!1;var S={};return r==="color"&&(S.color={valType:"color",arrayOk:!0,editType:c||"style"},u.anim&&(S.color.anim=!0)),S[x]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:A},S[m]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:v},S[g]={valType:"number",dflt:null,editType:c||"plot",impliedEdits:v},S[k]={valType:"number",dflt:null,editType:"calc",impliedEdits:A},S.colorscale={valType:"colorscale",editType:"calc",dflt:s,impliedEdits:{autocolorscale:!1}},S.autocolorscale={valType:"boolean",dflt:u.autoColorDflt!==!1,editType:"calc",impliedEdits:{colorscale:void 0}},S.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(S.showscale={valType:"boolean",dflt:o,editType:"calc"},S.colorbar=b),u.noColorAxis||(S.coloraxis={valType:"subplotid",regex:d("coloraxis"),dflt:null,editType:"calc"}),S}},28379:function(D,L,t){var b=t(10721),d=t(34809),e=t(65477).extractOpts;D.exports=function(w,y,_){var u,r=w._fullLayout,n=_.vals,l=_.containerStr,o=l?d.nestedProperty(y,l).get():y,s=e(o),c=s.auto!==!1,h=s.min,x=s.max,m=s.mid,g=function(){return d.aggNums(Math.min,null,n)},k=function(){return d.aggNums(Math.max,null,n)};h===void 0?h=g():c&&(h=o._colorAx&&b(h)?Math.min(h,g()):g()),x===void 0?x=k():c&&(x=o._colorAx&&b(x)?Math.max(x,k()):k()),c&&m!==void 0&&(x-m>m-h?h=m-(x-m):x-m=0?r.colorscale.sequential:r.colorscale.sequentialminus,s._sync("colorscale",u))}},67623:function(D,L,t){var b=t(34809),d=t(65477).hasColorscale,e=t(65477).extractOpts;D.exports=function(w,y){function _(c,h){var x=c["_"+h];x!==void 0&&(c[h]=x)}function u(c,h){var x=h.container?b.nestedProperty(c,h.container).get():c;if(x)if(x.coloraxis)x._colorAx=y[x.coloraxis];else{var m=e(x),g=m.auto;(g||m.min===void 0)&&_(x,h.min),(g||m.max===void 0)&&_(x,h.max),m.autocolorscale&&_(x,"colorscale")}}for(var r=0;r=0;g--,k++){var A=h[g];m[k]=[1-A[0],A[1]]}return m}function s(h,x){x=x||{};for(var m=h.domain,g=h.range,k=g.length,A=new Array(k),v=0;v1.3333333333333333-_?y:_}},4001:function(D,L,t){var b=t(34809),d=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];D.exports=function(e,w,y,_){return e=y==="left"?0:y==="center"?1:y==="right"?2:b.constrain(Math.floor(3*e),0,2),w=_==="bottom"?0:_==="middle"?1:_==="top"?2:b.constrain(Math.floor(3*w),0,2),d[w][e]}},70414:function(D,L){L.selectMode=function(t){return t==="lasso"||t==="select"},L.drawMode=function(t){return t==="drawclosedpath"||t==="drawopenpath"||t==="drawline"||t==="drawrect"||t==="drawcircle"},L.openMode=function(t){return t==="drawline"||t==="drawopenpath"},L.rectMode=function(t){return t==="select"||t==="drawline"||t==="drawrect"||t==="drawcircle"},L.freeMode=function(t){return t==="lasso"||t==="drawclosedpath"||t==="drawopenpath"},L.selectingOrDrawing=function(t){return L.freeMode(t)||L.rectMode(t)}},14751:function(D,L,t){var b=t(44039),d=t(39784),e=t(74043),w=t(34809).removeElement,y=t(54826),_=D.exports={};_.align=t(53770),_.getCursor=t(4001);var u=t(60148);function r(){var l=document.createElement("div");l.className="dragcover";var o=l.style;return o.position="fixed",o.left=0,o.right=0,o.top=0,o.bottom=0,o.zIndex=999999999,o.background="none",document.body.appendChild(l),l}function n(l){return b(l.changedTouches?l.changedTouches[0]:l,document.body)}_.unhover=u.wrapped,_.unhoverRaw=u.raw,_.init=function(l){var o,s,c,h,x,m,g,k,A=l.gd,v=1,S=A._context.doubleClickDelay,T=l.element;A._mouseDownTime||(A._mouseDownTime=0),T.style.pointerEvents="all",T.onmousedown=M,e?(T._ontouchstart&&T.removeEventListener("touchstart",T._ontouchstart),T._ontouchstart=M,T.addEventListener("touchstart",M,{passive:!1})):T.ontouchstart=M;var p=l.clampFn||function(I,B,N){return Math.abs(I)S&&(v=Math.max(v-1,1)),A._dragged)l.doneFn&&l.doneFn();else if(l.clickFn&&l.clickFn(v,m),!k){var B;try{B=new MouseEvent("click",I)}catch{var N=n(I);(B=document.createEvent("MouseEvents")).initMouseEvent("click",I.bubbles,I.cancelable,I.view,I.detail,I.screenX,I.screenY,N[0],N[1],I.ctrlKey,I.altKey,I.shiftKey,I.metaKey,I.button,I.relatedTarget)}g.dispatchEvent(B)}A._dragging=!1,A._dragged=!1}else A._dragged=!1}},_.coverSlip=r},60148:function(D,L,t){var b=t(68596),d=t(64025),e=t(95425).getGraphDiv,w=t(85988),y=D.exports={};y.wrapped=function(_,u,r){(_=e(_))._fullLayout&&d.clear(_._fullLayout._uid+w.HOVERID),y.raw(_,u,r)},y.raw=function(_,u){var r=_._fullLayout,n=_._hoverdata;u||(u={}),u.target&&!_._dragged&&b.triggerHandler(_,"plotly_beforehover",u)===!1||(r._hoverlayer.selectAll("g").remove(),r._hoverlayer.selectAll("line").remove(),r._hoverlayer.selectAll("circle").remove(),_._hoverdata=void 0,u.target&&n&&_.emit("plotly_unhover",{event:u,points:n}))}},94850:function(D,L){L.T={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},L.k={shape:{valType:"enumerated",values:["","/","\\","x","-","|","+","."],dflt:"",arrayOk:!0,editType:"style"},fillmode:{valType:"enumerated",values:["replace","overlay"],dflt:"replace",editType:"style"},bgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgcolor:{valType:"color",arrayOk:!0,editType:"style"},fgopacity:{valType:"number",editType:"style",min:0,max:1},size:{valType:"number",min:0,dflt:8,arrayOk:!0,editType:"style"},solidity:{valType:"number",min:0,max:1,dflt:.3,arrayOk:!0,editType:"style"},editType:"style"}},62203:function(D,L,t){var b=t(45568),d=t(34809),e=d.numberFormat,w=t(10721),y=t(65657),_=t(33626),u=t(78766),r=t(88856),n=d.strTranslate,l=t(30635),o=t(62972),s=t(4530).LINE_SPACING,c=t(20438).DESELECTDIM,h=t(64726),x=t(92527),m=t(36040).appendArrayPointValue,g=D.exports={};function k(Ie){return Ie==="none"?void 0:Ie}g.font=function(Ie,Ve){var Pe=Ve.variant,de=Ve.style,Me=Ve.weight,ke=Ve.color,He=Ve.size,Fe=Ve.family,qe=Ve.shadow,$e=Ve.lineposition,Ye=Ve.textcase;Fe&&Ie.style("font-family",Fe),He+1&&Ie.style("font-size",He+"px"),ke&&Ie.call(u.fill,ke),Me&&Ie.style("font-weight",Me),de&&Ie.style("font-style",de),Pe&&Ie.style("font-variant",Pe),Ye&&Ie.style("text-transform",k(function(_e){return A[_e]}(Ye))),qe&&Ie.style("text-shadow",qe==="auto"?l.makeTextShadow(u.contrast(ke)):k(qe)),$e&&Ie.style("text-decoration-line",k(function(_e){return _e.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}($e)))};var A={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function v(Ie,Ve,Pe,de){var Me=Ve.fillpattern,ke=Ve.fillgradient,He=Me&&g.getPatternAttr(Me.shape,0,"");if(He){var Fe=g.getPatternAttr(Me.bgcolor,0,null),qe=g.getPatternAttr(Me.fgcolor,0,null),$e=Me.fgopacity,Ye=g.getPatternAttr(Me.size,0,8),_e=g.getPatternAttr(Me.solidity,0,.3),De=Ve.uid;g.pattern(Ie,"point",Pe,De,He,Ye,_e,void 0,Me.fillmode,Fe,qe,$e)}else if(ke&&ke.type!=="none"){var Be,Ge,tt=ke.type,nt="scatterfill-"+Ve.uid;de&&(nt="legendfill-"+Ve.uid),de||ke.start===void 0&&ke.stop===void 0?(tt==="horizontal"&&(tt+="reversed"),Ie.call(g.gradient,Pe,nt,tt,ke.colorscale,"fill")):(tt==="horizontal"?(Be={x:ke.start,y:0},Ge={x:ke.stop,y:0}):tt==="vertical"&&(Be={x:0,y:ke.start},Ge={x:0,y:ke.stop}),Be.x=Ve._xA.c2p(Be.x===void 0?Ve._extremes.x.min[0].val:Be.x,!0),Be.y=Ve._yA.c2p(Be.y===void 0?Ve._extremes.y.min[0].val:Be.y,!0),Ge.x=Ve._xA.c2p(Ge.x===void 0?Ve._extremes.x.max[0].val:Ge.x,!0),Ge.y=Ve._yA.c2p(Ge.y===void 0?Ve._extremes.y.max[0].val:Ge.y,!0),Ie.call(E,Pe,nt,"linear",ke.colorscale,"fill",Be,Ge,!0,!1))}else Ve.fillcolor&&Ie.call(u.fill,Ve.fillcolor)}g.setPosition=function(Ie,Ve,Pe){Ie.attr("x",Ve).attr("y",Pe)},g.setSize=function(Ie,Ve,Pe){Ie.attr("width",Ve).attr("height",Pe)},g.setRect=function(Ie,Ve,Pe,de,Me){Ie.call(g.setPosition,Ve,Pe).call(g.setSize,de,Me)},g.translatePoint=function(Ie,Ve,Pe,de){var Me=Pe.c2p(Ie.x),ke=de.c2p(Ie.y);return!!(w(Me)&&w(ke)&&Ve.node())&&(Ve.node().nodeName==="text"?Ve.attr("x",Me).attr("y",ke):Ve.attr("transform",n(Me,ke)),!0)},g.translatePoints=function(Ie,Ve,Pe){Ie.each(function(de){var Me=b.select(this);g.translatePoint(de,Me,Ve,Pe)})},g.hideOutsideRangePoint=function(Ie,Ve,Pe,de,Me,ke){Ve.attr("display",Pe.isPtWithinRange(Ie,Me)&&de.isPtWithinRange(Ie,ke)?null:"none")},g.hideOutsideRangePoints=function(Ie,Ve){if(Ve._hasClipOnAxisFalse){var Pe=Ve.xaxis,de=Ve.yaxis;Ie.each(function(Me){var ke=Me[0].trace,He=ke.xcalendar,Fe=ke.ycalendar,qe=_.traceIs(ke,"bar-like")?".bartext":".point,.textpoint";Ie.selectAll(qe).each(function($e){g.hideOutsideRangePoint($e,b.select(this),Pe,de,He,Fe)})})}},g.crispRound=function(Ie,Ve,Pe){return Ve&&w(Ve)?Ie._context.staticPlot?Ve:Ve<1?1:Math.round(Ve):Pe||0},g.singleLineStyle=function(Ie,Ve,Pe,de,Me){Ve.style("fill","none");var ke=(((Ie||[])[0]||{}).trace||{}).line||{},He=Pe||ke.width||0,Fe=Me||ke.dash||"";u.stroke(Ve,de||ke.color),g.dashLine(Ve,Fe,He)},g.lineGroupStyle=function(Ie,Ve,Pe,de){Ie.style("fill","none").each(function(Me){var ke=(((Me||[])[0]||{}).trace||{}).line||{},He=Ve||ke.width||0,Fe=de||ke.dash||"";b.select(this).call(u.stroke,Pe||ke.color).call(g.dashLine,Fe,He)})},g.dashLine=function(Ie,Ve,Pe){Pe=+Pe||0,Ve=g.dashStyle(Ve,Pe),Ie.style({"stroke-dasharray":Ve,"stroke-width":Pe+"px"})},g.dashStyle=function(Ie,Ve){Ve=+Ve||1;var Pe=Math.max(Ve,3);return Ie==="solid"?Ie="":Ie==="dot"?Ie=Pe+"px,"+Pe+"px":Ie==="dash"?Ie=3*Pe+"px,"+3*Pe+"px":Ie==="longdash"?Ie=5*Pe+"px,"+5*Pe+"px":Ie==="dashdot"?Ie=3*Pe+"px,"+Pe+"px,"+Pe+"px,"+Pe+"px":Ie==="longdashdot"&&(Ie=5*Pe+"px,"+2*Pe+"px,"+Pe+"px,"+2*Pe+"px"),Ie},g.singleFillStyle=function(Ie,Ve){var Pe=b.select(Ie.node());v(Ie,((Pe.data()[0]||[])[0]||{}).trace||{},Ve,!1)},g.fillGroupStyle=function(Ie,Ve,Pe){Ie.style("stroke-width",0).each(function(de){var Me=b.select(this);de[0].trace&&v(Me,de[0].trace,Ve,Pe)})};var S=t(38882);g.symbolNames=[],g.symbolFuncs=[],g.symbolBackOffs=[],g.symbolNeedLines={},g.symbolNoDot={},g.symbolNoFill={},g.symbolList=[],Object.keys(S).forEach(function(Ie){var Ve=S[Ie],Pe=Ve.n;g.symbolList.push(Pe,String(Pe),Ie,Pe+100,String(Pe+100),Ie+"-open"),g.symbolNames[Pe]=Ie,g.symbolFuncs[Pe]=Ve.f,g.symbolBackOffs[Pe]=Ve.backoff||0,Ve.needLine&&(g.symbolNeedLines[Pe]=!0),Ve.noDot?g.symbolNoDot[Pe]=!0:g.symbolList.push(Pe+200,String(Pe+200),Ie+"-dot",Pe+300,String(Pe+300),Ie+"-open-dot"),Ve.noFill&&(g.symbolNoFill[Pe]=!0)});var T=g.symbolNames.length;function p(Ie,Ve,Pe,de){var Me=Ie%100;return g.symbolFuncs[Me](Ve,Pe,de)+(Ie>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}g.symbolNumber=function(Ie){if(w(Ie))Ie=+Ie;else if(typeof Ie=="string"){var Ve=0;Ie.indexOf("-open")>0&&(Ve=100,Ie=Ie.replace("-open","")),Ie.indexOf("-dot")>0&&(Ve+=200,Ie=Ie.replace("-dot","")),(Ie=g.symbolNames.indexOf(Ie))>=0&&(Ie+=Ve)}return Ie%100>=T||Ie>=400?0:Math.floor(Math.max(Ie,0))};var M=e("~f"),f={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function E(Ie,Ve,Pe,de,Me,ke,He,Fe,qe,$e){var Ye,_e=Me.length;de==="linear"?Ye={node:"linearGradient",attrs:{x1:He.x,y1:He.y,x2:Fe.x,y2:Fe.y,gradientUnits:qe?"userSpaceOnUse":"objectBoundingBox"},reversed:$e}:de==="radial"&&(Ye={node:"radialGradient",reversed:$e});for(var De=new Array(_e),Be=0;Be<_e;Be++)Ye.reversed?De[_e-1-Be]=[M(100*(1-Me[Be][0])),Me[Be][1]]:De[Be]=[M(100*Me[Be][0]),Me[Be][1]];var Ge=Ve._fullLayout,tt="g"+Ge._uid+"-"+Pe,nt=Ge._defs.select(".gradients").selectAll("#"+tt).data([de+De.join(";")],d.identity);nt.exit().remove(),nt.enter().append(Ye.node).each(function(){var ft=b.select(this);Ye.attrs&&ft.attr(Ye.attrs),ft.attr("id",tt);var At=ft.selectAll("stop").data(De);At.exit().remove(),At.enter().append("stop"),At.each(function(kt){var Vt=y(kt[1]);b.select(this).attr({offset:kt[0]+"%","stop-color":u.tinyRGB(Vt),"stop-opacity":Vt.getAlpha()})})}),Ie.style(ke,he(tt,Ve)).style(ke+"-opacity",null),Ie.classed("gradient_filled",!0)}g.gradient=function(Ie,Ve,Pe,de,Me,ke){var He=f[de];return E(Ie,Ve,Pe,He.type,Me,ke,He.start,He.stop,!1,He.reversed)},g.pattern=function(Ie,Ve,Pe,de,Me,ke,He,Fe,qe,$e,Ye,_e){var De=Ve==="legend";Fe&&(qe==="overlay"?($e=Fe,Ye=u.contrast($e)):($e=void 0,Ye=Fe));var Be,Ge,tt,nt,ft,At,kt,Vt,Ht,Gt=Pe._fullLayout,st="p"+Gt._uid+"-"+de,Qe={},pt=y(Ye),yt=u.tinyRGB(pt),Ot=_e*pt.getAlpha();switch(Me){case"/":Be=ke*Math.sqrt(2),Ge=ke*Math.sqrt(2),At="path",Qe={d:tt="M-"+Be/4+","+Ge/4+"l"+Be/2+",-"+Ge/2+"M0,"+Ge+"L"+Be+",0M"+Be/4*3+","+Ge/4*5+"l"+Be/2+",-"+Ge/2,opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"\\":Be=ke*Math.sqrt(2),Ge=ke*Math.sqrt(2),At="path",Qe={d:tt="M"+Be/4*3+",-"+Ge/4+"l"+Be/2+","+Ge/2+"M0,0L"+Be+","+Ge+"M-"+Be/4+","+Ge/4*3+"l"+Be/2+","+Ge/2,opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"x":Be=ke*Math.sqrt(2),Ge=ke*Math.sqrt(2),tt="M-"+Be/4+","+Ge/4+"l"+Be/2+",-"+Ge/2+"M0,"+Ge+"L"+Be+",0M"+Be/4*3+","+Ge/4*5+"l"+Be/2+",-"+Ge/2+"M"+Be/4*3+",-"+Ge/4+"l"+Be/2+","+Ge/2+"M0,0L"+Be+","+Ge+"M-"+Be/4+","+Ge/4*3+"l"+Be/2+","+Ge/2,nt=ke-ke*Math.sqrt(1-He),At="path",Qe={d:tt,opacity:Ot,stroke:yt,"stroke-width":nt+"px"};break;case"|":At="path",At="path",Qe={d:tt="M"+(Be=ke)/2+",0L"+Be/2+","+(Ge=ke),opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"-":At="path",At="path",Qe={d:tt="M0,"+(Ge=ke)/2+"L"+(Be=ke)+","+Ge/2,opacity:Ot,stroke:yt,"stroke-width":(nt=He*ke)+"px"};break;case"+":At="path",tt="M"+(Be=ke)/2+",0L"+Be/2+","+(Ge=ke)+"M0,"+Ge/2+"L"+Be+","+Ge/2,nt=ke-ke*Math.sqrt(1-He),At="path",Qe={d:tt,opacity:Ot,stroke:yt,"stroke-width":nt+"px"};break;case".":Be=ke,Ge=ke,He=0&&Ie.i===void 0&&(Ie.i=ke.i),Ve.style("opacity",de.selectedOpacityFn?de.selectedOpacityFn(Ie):Ie.mo===void 0?He.opacity:Ie.mo),de.ms2mrc){var qe;qe=Ie.ms==="various"||He.size==="various"?3:de.ms2mrc(Ie.ms),Ie.mrc=qe,de.selectedSizeFn&&(qe=Ie.mrc=de.selectedSizeFn(Ie));var $e=g.symbolNumber(Ie.mx||He.symbol)||0;Ie.om=$e%200>=100;var Ye=We(Ie,Pe),_e=oe(Ie,Pe);Ve.attr("d",p($e,qe,Ye,_e))}var De,Be,Ge,tt=!1;if(Ie.so)Ge=Fe.outlierwidth,Be=Fe.outliercolor,De=He.outliercolor;else{var nt=(Fe||{}).width;Ge=(Ie.mlw+1||nt+1||(Ie.trace?(Ie.trace.marker.line||{}).width:0)+1)-1||0,Be="mlc"in Ie?Ie.mlcc=de.lineScale(Ie.mlc):d.isArrayOrTypedArray(Fe.color)?u.defaultLine:Fe.color,d.isArrayOrTypedArray(He.color)&&(De=u.defaultLine,tt=!0),De="mc"in Ie?Ie.mcc=de.markerScale(Ie.mc):He.color||He.colors||"rgba(0,0,0,0)",de.selectedColorFn&&(De=de.selectedColorFn(Ie))}if(Ie.om)Ve.call(u.stroke,De).style({"stroke-width":(Ge||1)+"px",fill:"none"});else{Ve.style("stroke-width",(Ie.isBlank?0:Ge)+"px");var ft=He.gradient,At=Ie.mgt;At?tt=!0:At=ft&&ft.type,d.isArrayOrTypedArray(At)&&(At=At[0],f[At]||(At=0));var kt=He.pattern,Vt=kt&&g.getPatternAttr(kt.shape,Ie.i,"");if(At&&At!=="none"){var Ht=Ie.mgc;Ht?tt=!0:Ht=ft.color;var Gt=Pe.uid;tt&&(Gt+="-"+Ie.i),g.gradient(Ve,Me,Gt,At,[[0,Ht],[1,De]],"fill")}else if(Vt){var st=!1,Qe=kt.fgcolor;!Qe&&ke&&ke.color&&(Qe=ke.color,st=!0);var pt=g.getPatternAttr(Qe,Ie.i,ke&&ke.color||null),yt=g.getPatternAttr(kt.bgcolor,Ie.i,null),Ot=kt.fgopacity,Pt=g.getPatternAttr(kt.size,Ie.i,8),at=g.getPatternAttr(kt.solidity,Ie.i,.3);st=st||Ie.mcc||d.isArrayOrTypedArray(kt.shape)||d.isArrayOrTypedArray(kt.bgcolor)||d.isArrayOrTypedArray(kt.fgcolor)||d.isArrayOrTypedArray(kt.size)||d.isArrayOrTypedArray(kt.solidity);var lt=Pe.uid;st&&(lt+="-"+Ie.i),g.pattern(Ve,"point",Me,lt,Vt,Pt,at,Ie.mcc,kt.fillmode,yt,pt,Ot)}else d.isArrayOrTypedArray(De)?u.fill(Ve,De[Ie.i]):u.fill(Ve,De);Ge&&u.stroke(Ve,Be)}},g.makePointStyleFns=function(Ie){var Ve={},Pe=Ie.marker;return Ve.markerScale=g.tryColorscale(Pe,""),Ve.lineScale=g.tryColorscale(Pe,"line"),_.traceIs(Ie,"symbols")&&(Ve.ms2mrc=h.isBubble(Ie)?x(Ie):function(){return(Pe.size||6)/2}),Ie.selectedpoints&&d.extendFlat(Ve,g.makeSelectedPointStyleFns(Ie)),Ve},g.makeSelectedPointStyleFns=function(Ie){var Ve={},Pe=Ie.selected||{},de=Ie.unselected||{},Me=Ie.marker||{},ke=Pe.marker||{},He=de.marker||{},Fe=Me.opacity,qe=ke.opacity,$e=He.opacity,Ye=qe!==void 0,_e=$e!==void 0;(d.isArrayOrTypedArray(Fe)||Ye||_e)&&(Ve.selectedOpacityFn=function(Vt){var Ht=Vt.mo===void 0?Me.opacity:Vt.mo;return Vt.selected?Ye?qe:Ht:_e?$e:c*Ht});var De=Me.color,Be=ke.color,Ge=He.color;(Be||Ge)&&(Ve.selectedColorFn=function(Vt){var Ht=Vt.mcc||De;return Vt.selected?Be||Ht:Ge||Ht});var tt=Me.size,nt=ke.size,ft=He.size,At=nt!==void 0,kt=ft!==void 0;return _.traceIs(Ie,"symbols")&&(At||kt)&&(Ve.selectedSizeFn=function(Vt){var Ht=Vt.mrc||tt/2;return Vt.selected?At?nt/2:Ht:kt?ft/2:Ht}),Ve},g.makeSelectedTextStyleFns=function(Ie){var Ve={},Pe=Ie.selected||{},de=Ie.unselected||{},Me=Ie.textfont||{},ke=Pe.textfont||{},He=de.textfont||{},Fe=Me.color,qe=ke.color,$e=He.color;return Ve.selectedTextColorFn=function(Ye){var _e=Ye.tc||Fe;return Ye.selected?qe||_e:$e||(qe?_e:u.addOpacity(_e,c))},Ve},g.selectedPointStyle=function(Ie,Ve){if(Ie.size()&&Ve.selectedpoints){var Pe=g.makeSelectedPointStyleFns(Ve),de=Ve.marker||{},Me=[];Pe.selectedOpacityFn&&Me.push(function(ke,He){ke.style("opacity",Pe.selectedOpacityFn(He))}),Pe.selectedColorFn&&Me.push(function(ke,He){u.fill(ke,Pe.selectedColorFn(He))}),Pe.selectedSizeFn&&Me.push(function(ke,He){var Fe=He.mx||de.symbol||0,qe=Pe.selectedSizeFn(He);ke.attr("d",p(g.symbolNumber(Fe),qe,We(He,Ve),oe(He,Ve))),He.mrc2=qe}),Me.length&&Ie.each(function(ke){for(var He=b.select(this),Fe=0;Fe0?Pe:0}function $(Ie,Ve,Pe){return Pe&&(Ie=K(Ie)),Ve?H(Ie[1]):ee(Ie[0])}function ee(Ie){var Ve=b.round(Ie,2);return I=Ve,Ve}function H(Ie){var Ve=b.round(Ie,2);return B=Ve,Ve}function J(Ie,Ve,Pe,de){var Me=Ie[0]-Ve[0],ke=Ie[1]-Ve[1],He=Pe[0]-Ve[0],Fe=Pe[1]-Ve[1],qe=Math.pow(Me*Me+ke*ke,.25),$e=Math.pow(He*He+Fe*Fe,.25),Ye=($e*$e*Me-qe*qe*He)*de,_e=($e*$e*ke-qe*qe*Fe)*de,De=3*$e*(qe+$e),Be=3*qe*(qe+$e);return[[ee(Ve[0]+(De&&Ye/De)),H(Ve[1]+(De&&_e/De))],[ee(Ve[0]-(Be&&Ye/Be)),H(Ve[1]-(Be&&_e/Be))]]}g.textPointStyle=function(Ie,Ve,Pe){if(Ie.size()){var de;if(Ve.selectedpoints){var Me=g.makeSelectedTextStyleFns(Ve);de=Me.selectedTextColorFn}var ke=Ve.texttemplate,He=Pe._fullLayout;Ie.each(function(Fe){var qe=b.select(this),$e=ke?d.extractOption(Fe,Ve,"txt","texttemplate"):d.extractOption(Fe,Ve,"tx","text");if($e||$e===0){if(ke){var Ye=Ve._module.formatLabels,_e=Ye?Ye(Fe,Ve,He):{},De={};m(De,Ve,Fe.i);var Be=Ve._meta||{};$e=d.texttemplateString($e,_e,He._d3locale,De,Fe,Be)}var Ge=Fe.tp||Ve.textposition,tt=j(Fe,Ve),nt=de?de(Fe):Fe.tc||Ve.textfont.color;qe.call(g.font,{family:Fe.tf||Ve.textfont.family,weight:Fe.tw||Ve.textfont.weight,style:Fe.ty||Ve.textfont.style,variant:Fe.tv||Ve.textfont.variant,textcase:Fe.tC||Ve.textfont.textcase,lineposition:Fe.tE||Ve.textfont.lineposition,shadow:Fe.tS||Ve.textfont.shadow,size:tt,color:nt}).text($e).call(l.convertToTspans,Pe).call(V,Ge,tt,Fe.mrc)}else qe.remove()})}},g.selectedTextStyle=function(Ie,Ve){if(Ie.size()&&Ve.selectedpoints){var Pe=g.makeSelectedTextStyleFns(Ve);Ie.each(function(de){var Me=b.select(this),ke=Pe.selectedTextColorFn(de),He=de.tp||Ve.textposition,Fe=j(de,Ve);u.fill(Me,ke);var qe=_.traceIs(Ve,"bar-like");V(Me,He,Fe,de.mrc2||de.mrc,qe)})}},g.smoothopen=function(Ie,Ve){if(Ie.length<3)return"M"+Ie.join("L");var Pe,de="M"+Ie[0],Me=[];for(Pe=1;Pe=qe||Vt>=Ye&&Vt<=qe)&&(Ht<=_e&&Ht>=$e||Ht>=_e&&Ht<=$e)&&(Ie=[Vt,Ht])}return Ie}g.steps=function(Ie){var Ve=Q[Ie]||Z;return function(Pe){for(var de="M"+ee(Pe[0][0])+","+H(Pe[0][1]),Me=Pe.length,ke=1;ke=1e4&&(g.savedBBoxes={},ae=0),Pe&&(g.savedBBoxes[Pe]=Be),ae++,d.extendFlat({},Be)},g.setClipUrl=function(Ie,Ve,Pe){Ie.attr("clip-path",he(Ve,Pe))},g.getTranslate=function(Ie){var Ve=(Ie[Ie.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(Pe,de,Me){return[de,Me].join(" ")}).split(" ");return{x:+Ve[0]||0,y:+Ve[1]||0}},g.setTranslate=function(Ie,Ve,Pe){var de=Ie.attr?"attr":"getAttribute",Me=Ie.attr?"attr":"setAttribute",ke=Ie[de]("transform")||"";return Ve=Ve||0,Pe=Pe||0,ke=ke.replace(/(\btranslate\(.*?\);?)/,"").trim(),ke=(ke+=n(Ve,Pe)).trim(),Ie[Me]("transform",ke),ke},g.getScale=function(Ie){var Ve=(Ie[Ie.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(Pe,de,Me){return[de,Me].join(" ")}).split(" ");return{x:+Ve[0]||1,y:+Ve[1]||1}},g.setScale=function(Ie,Ve,Pe){var de=Ie.attr?"attr":"getAttribute",Me=Ie.attr?"attr":"setAttribute",ke=Ie[de]("transform")||"";return Ve=Ve||1,Pe=Pe||1,ke=ke.replace(/(\bscale\(.*?\);?)/,"").trim(),ke=(ke+="scale("+Ve+","+Pe+")").trim(),Ie[Me]("transform",ke),ke};var fe=/\s*sc.*/;g.setPointGroupScale=function(Ie,Ve,Pe){if(Ve=Ve||1,Pe=Pe||1,Ie){var de=Ve===1&&Pe===1?"":"scale("+Ve+","+Pe+")";Ie.each(function(){var Me=(this.getAttribute("transform")||"").replace(fe,"");Me=(Me+=de).trim(),this.setAttribute("transform",Me)})}};var ie=/translate\([^)]*\)\s*$/;function oe(Ie,Ve){var Pe;return Ie&&(Pe=Ie.mf),Pe===void 0&&(Pe=Ve.marker&&Ve.marker.standoff||0),Ve._geo||Ve._xA?Pe:-Pe}g.setTextPointsScale=function(Ie,Ve,Pe){Ie&&Ie.each(function(){var de,Me=b.select(this),ke=Me.select("text");if(ke.node()){var He=parseFloat(ke.attr("x")||0),Fe=parseFloat(ke.attr("y")||0),qe=(Me.attr("transform")||"").match(ie);de=Ve===1&&Pe===1?[]:[n(He,Fe),"scale("+Ve+","+Pe+")",n(-He,-Fe)],qe&&de.push(qe),Me.attr("transform",de.join(""))}})},g.getMarkerStandoff=oe;var le,ge,ye,me,be,Se,Ee=Math.atan2,Ce=Math.cos,Le=Math.sin;function Oe(Ie,Ve){var Pe=Ve[0],de=Ve[1];return[Pe*Ce(Ie)-de*Le(Ie),Pe*Le(Ie)+de*Ce(Ie)]}function We(Ie,Ve){var Pe,de,Me=Ie.ma;Me===void 0&&((Me=Ve.marker.angle)&&!d.isArrayOrTypedArray(Me)||(Me=0));var ke=Ve.marker.angleref;if(ke==="previous"||ke==="north"){if(Ve._geo){var He=Ve._geo.project(Ie.lonlat);Pe=He[0],de=He[1]}else{var Fe=Ve._xA,qe=Ve._yA;if(!Fe||!qe)return 90;Pe=Fe.c2p(Ie.x),de=qe.c2p(Ie.y)}if(Ve._geo){var $e,Ye=Ie.lonlat[0],_e=Ie.lonlat[1],De=Ve._geo.project([Ye,_e+1e-5]),Be=Ve._geo.project([Ye+1e-5,_e]),Ge=Ee(Be[1]-de,Be[0]-Pe),tt=Ee(De[1]-de,De[0]-Pe);if(ke==="north")$e=Me/180*Math.PI;else if(ke==="previous"){var nt=Ye/180*Math.PI,ft=_e/180*Math.PI,At=le/180*Math.PI,kt=ge/180*Math.PI,Vt=At-nt,Ht=Ce(kt)*Le(Vt),Gt=Le(kt)*Ce(ft)-Ce(kt)*Le(ft)*Ce(Vt);$e=-Ee(Ht,Gt)-Math.PI,le=Ye,ge=_e}var st=Oe(Ge,[Ce($e),0]),Qe=Oe(tt,[Le($e),0]);Me=Ee(st[1]+Qe[1],st[0]+Qe[0])/Math.PI*180,ke!=="previous"||Se===Ve.uid&&Ie.i===be+1||(Me=null)}if(ke==="previous"&&!Ve._geo)if(Se===Ve.uid&&Ie.i===be+1&&w(Pe)&&w(de)){var pt=Pe-ye,yt=de-me,Ot=Ve.line&&Ve.line.shape||"",Pt=Ot.slice(Ot.length-1);Pt==="h"&&(yt=0),Pt==="v"&&(pt=0),Me+=Ee(yt,pt)/Math.PI*180+90}else Me=null}return ye=Pe,me=de,be=Ie.i,Se=Ve.uid,Me}g.getMarkerAngle=We},38882:function(D,L,t){var b,d,e,w,y=t(26953),_=t(45568).round,u="M0,0Z",r=Math.sqrt(2),n=Math.sqrt(3),l=Math.PI,o=Math.cos,s=Math.sin;function c(x){return x===null}function h(x,m,g){if(!(x&&x%360!=0||m))return g;if(e===x&&w===m&&b===g)return d;function k(j,$){var ee=o(j),H=s(j),J=$[0],Q=$[1]+(m||0);return[J*ee-Q*H,J*H+Q*ee]}e=x,w=m,b=g;for(var A=x/180*l,v=0,S=0,T=y(g),p="",M=0;M0,s=y._context.staticPlot;_.each(function(c){var h,x=c[0].trace,m=x.error_x||{},g=x.error_y||{};x.ids&&(h=function(S){return S.id});var k=w.hasMarkers(x)&&x.marker.maxdisplayed>0;g.visible||m.visible||(c=[]);var A=b.select(this).selectAll("g.errorbar").data(c,h);if(A.exit().remove(),c.length){m.visible||A.selectAll("path.xerror").remove(),g.visible||A.selectAll("path.yerror").remove(),A.style("opacity",1);var v=A.enter().append("g").classed("errorbar",!0);o&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),e.setClipUrl(A,u.layerClipId,y),A.each(function(S){var T=b.select(this),p=function(N,V,j){var $={x:V.c2p(N.x),y:j.c2p(N.y)};return N.yh!==void 0&&($.yh=j.c2p(N.yh),$.ys=j.c2p(N.ys),d($.ys)||($.noYS=!0,$.ys=j.c2p(N.ys,!0))),N.xh!==void 0&&($.xh=V.c2p(N.xh),$.xs=V.c2p(N.xs),d($.xs)||($.noXS=!0,$.xs=V.c2p(N.xs,!0))),$}(S,n,l);if(!k||S.vis){var M,f=T.select("path.yerror");if(g.visible&&d(p.x)&&d(p.yh)&&d(p.ys)){var E=g.width;M="M"+(p.x-E)+","+p.yh+"h"+2*E+"m-"+E+",0V"+p.ys,p.noYS||(M+="m-"+E+",0h"+2*E),f.size()?o&&(f=f.transition().duration(r.duration).ease(r.easing)):f=T.append("path").style("vector-effect",s?"none":"non-scaling-stroke").classed("yerror",!0),f.attr("d",M)}else f.remove();var I=T.select("path.xerror");if(m.visible&&d(p.y)&&d(p.xh)&&d(p.xs)){var B=(m.copy_ystyle?g:m).width;M="M"+p.xh+","+(p.y-B)+"v"+2*B+"m0,-"+B+"H"+p.xs,p.noXS||(M+="m0,-"+B+"v"+2*B),I.size()?o&&(I=I.transition().duration(r.duration).ease(r.easing)):I=T.append("path").style("vector-effect",s?"none":"non-scaling-stroke").classed("xerror",!0),I.attr("d",M)}else I.remove()}})}})}},22800:function(D,L,t){var b=t(45568),d=t(78766);D.exports=function(e){e.each(function(w){var y=w[0].trace,_=y.error_y||{},u=y.error_x||{},r=b.select(this);r.selectAll("path.yerror").style("stroke-width",_.thickness+"px").call(d.stroke,_.color),u.copy_ystyle&&(u=_),r.selectAll("path.xerror").style("stroke-width",u.thickness+"px").call(d.stroke,u.color)})}},70192:function(D,L,t){var b=t(80337),d=t(6811).hoverlabel,e=t(93049).extendFlat;D.exports={hoverlabel:{bgcolor:e({},d.bgcolor,{arrayOk:!0}),bordercolor:e({},d.bordercolor,{arrayOk:!0}),font:b({arrayOk:!0,editType:"none"}),align:e({},d.align,{arrayOk:!0}),namelength:e({},d.namelength,{arrayOk:!0}),editType:"none"}}},83552:function(D,L,t){var b=t(34809),d=t(33626);function e(w,y,_,u){u=u||b.identity,Array.isArray(w)&&(y[0][_]=u(w))}D.exports=function(w){var y=w.calcdata,_=w._fullLayout;function u(s){return function(c){return b.coerceHoverinfo({hoverinfo:c},{_module:s._module},_)}}for(var r=0;r=0&&n.indexft[0]._length||St<0||St>At[0]._length)return c.unhoverRaw(Se,Ee)}else Ft="xpx"in Ee?Ee.xpx:ft[0]._length/2,St="ypx"in Ee?Ee.ypx:At[0]._length/2;if(Ee.pointerX=Ft+ft[0]._offset,Ee.pointerY=St+At[0]._offset,Qe="xval"in Ee?g.flat(Pe,Ee.xval):g.p2c(ft,Ft),pt="yval"in Ee?g.flat(Pe,Ee.yval):g.p2c(At,St),!d(Qe[0])||!d(pt[0]))return w.warn("Fx.hover failed",Ee,Se),c.unhoverRaw(Se,Ee)}var Wt=1/0;function Zt(gn,qn){for(Ot=0;Otjt&&(rt.splice(0,jt),Wt=rt[0].distance),Fe&&st!==0&&rt.length===0){Lt.distance=st,Lt.index=!1;var dn=at._module.hoverPoints(Lt,wt,vt,"closest",{hoverLayer:de._hoverlayer});if(dn&&(dn=dn.filter(function(yr){return yr.spikeDistance<=st})),dn&&dn.length){var ln,An=dn.filter(function(yr){return yr.xa.showspikes&&yr.xa.spikesnap!=="hovered data"});if(An.length){var er=An[0];d(er.x0)&&d(er.y0)&&(ln=un(er),(!Et.vLinePoint||Et.vLinePoint.spikeDistance>ln.spikeDistance)&&(Et.vLinePoint=ln))}var br=dn.filter(function(yr){return yr.ya.showspikes&&yr.ya.spikesnap!=="hovered data"});if(br.length){var Tr=br[0];d(Tr.x0)&&d(Tr.y0)&&(ln=un(Tr),(!Et.hLinePoint||Et.hLinePoint.spikeDistance>ln.spikeDistance)&&(Et.hLinePoint=ln))}}}}}function on(gn,qn,Un){for(var tr,Wn=null,Bn=1/0,dn=0;dn0&&Math.abs(gn.distance)zn-1;Jn--)lr(rt[Jn]);rt=$n,mn()}var hr=Se._hoverdata,jr=[],ni=fe(Se),Or=ie(Se);for(yt=0;yt1||rt.length>1)||qe==="closest"&&Bt&&rt.length>1,bn=s.combine(de.plot_bgcolor||s.background,de.paper_bgcolor),Yn=ee(rt,{gd:Se,hovermode:qe,rotateLabels:ai,bgColor:bn,container:de._hoverlayer,outerContainer:de._paper.node(),commonLabelOpts:de.hoverlabel,hoverdistance:de.hoverdistance}),an=Yn.hoverLabels;if(g.isUnifiedHover(qe)||(function(gn,qn,Un,tr){var Wn,Bn,dn,ln,An,er,br,Tr=qn?"xa":"ya",yr=qn?"ya":"xa",Ur=0,Rr=1,$r=gn.size(),Pr=new Array($r),Cr=0,Jr=tr.minX,gi=tr.maxX,ii=tr.minY,Yr=tr.maxY,oi=function(Ki){return Ki*Un._invScaleX},Ti=function(Ki){return Ki*Un._invScaleY};function Wi(Ki){var os=Ki[0],To=Ki[Ki.length-1];if(Bn=os.pmin-os.pos-os.dp+os.size,dn=To.pos+To.dp+To.size-os.pmax,Bn>.01){for(An=Ki.length-1;An>=0;An--)Ki[An].dp+=Bn;Wn=!1}if(!(dn<.01)){if(Bn<-.01){for(An=Ki.length-1;An>=0;An--)Ki[An].dp-=dn;Wn=!1}if(Wn){var fo=0;for(ln=0;lnos.pmax&&fo++;for(ln=Ki.length-1;ln>=0&&!(fo<=0);ln--)(er=Ki[ln]).pos>os.pmax-1&&(er.del=!0,fo--);for(ln=0;ln=0;An--)Ki[An].dp-=dn;for(ln=Ki.length-1;ln>=0&&!(fo<=0);ln--)(er=Ki[ln]).pos+er.dp+er.size>os.pmax&&(er.del=!0,fo--)}}}for(gn.each(function(Ki){var os=Ki[Tr],To=Ki[yr],fo=os._id.charAt(0)==="x",Os=os.range;Cr===0&&Os&&Os[0]>Os[1]!==fo&&(Rr=-1);var Ta=0,ws=fo?Un.width:Un.height;if(Un.hovermode==="x"||Un.hovermode==="y"){var Bl,Ql,ss=J(Ki,qn),eu=Ki.anchor,vl=eu==="end"?-1:1;if(eu==="middle")Ql=(Bl=Ki.crossPos+(fo?Ti(ss.y-Ki.by/2):oi(Ki.bx/2+Ki.tx2width/2)))+(fo?Ti(Ki.by):oi(Ki.bx));else if(fo)Ql=(Bl=Ki.crossPos+Ti(E+ss.y)-Ti(Ki.by/2-E))+Ti(Ki.by);else{var Za=oi(vl*E+ss.x),ko=Za+oi(vl*Ki.bx);Bl=Ki.crossPos+Math.min(Za,ko),Ql=Ki.crossPos+Math.max(Za,ko)}fo?ii!==void 0&&Yr!==void 0&&Math.min(Ql,Yr)-Math.max(Bl,ii)>1&&(To.side==="left"?(Ta=To._mainLinePosition,ws=Un.width):ws=To._mainLinePosition):Jr!==void 0&&gi!==void 0&&Math.min(Ql,gi)-Math.max(Bl,Jr)>1&&(To.side==="top"?(Ta=To._mainLinePosition,ws=Un.height):ws=To._mainLinePosition)}Pr[Cr++]=[{datum:Ki,traceIndex:Ki.trace.index,dp:0,pos:Ki.pos,posref:Ki.posref,size:Ki.by*(fo?p:1)/2,pmin:Ta,pmax:ws}]}),Pr.sort(function(Ki,os){return Ki[0].posref-os[0].posref||Rr*(os[0].traceIndex-Ki[0].traceIndex)});!Wn&&Ur<=$r;){for(Ur++,Wn=!0,ln=0;ln.01){for(An=ji.length-1;An>=0;An--)ji[An].dp+=Bn;for(Pa.push.apply(Pa,ji),Pr.splice(ln+1,1),br=0,An=Pa.length-1;An>=0;An--)br+=Pa[An].dp;for(dn=br/Pa.length,An=Pa.length-1;An>=0;An--)Pa[An].dp-=dn;Wn=!1}else ln++}Pr.forEach(Wi)}for(ln=Pr.length-1;ln>=0;ln--){var Oa=Pr[ln];for(An=Oa.length-1;An>=0;An--){var bs=Oa[An],lo=bs.datum;lo.offset=bs.dp,lo.del=bs.del}}}(an,ai,de,Yn.commonLabelBoundingBox),Q(an,ai,de._invScaleX,de._invScaleY)),Oe&&Oe.tagName){var _n=m.getComponentMethod("annotations","hasClickToShow")(Se,jr);l(b.select(Oe),_n?"pointer":"")}Oe&&!Le&&function(gn,qn,Un){if(!Un||Un.length!==gn._hoverdata.length)return!0;for(var tr=Un.length-1;tr>=0;tr--){var Wn=Un[tr],Bn=gn._hoverdata[tr];if(Wn.curveNumber!==Bn.curveNumber||String(Wn.pointNumber)!==String(Bn.pointNumber)||String(Wn.pointNumbers)!==String(Bn.pointNumbers))return!0}return!1}(Se,0,hr)&&(hr&&Se.emit("plotly_unhover",{event:Ee,points:hr}),Se.emit("plotly_hover",{event:Ee,points:Se._hoverdata,xaxes:ft,yaxes:At,xvals:Qe,yvals:pt}))})(le,ge,ye,me,be)})},L.loneHover=function(le,ge){var ye=!0;Array.isArray(le)||(ye=!1,le=[le]);var me=ge.gd,be=fe(me),Se=ie(me),Ee=ee(le.map(function(Oe){var We=Oe._x0||Oe.x0||Oe.x||0,Ie=Oe._x1||Oe.x1||Oe.x||0,Ve=Oe._y0||Oe.y0||Oe.y||0,Pe=Oe._y1||Oe.y1||Oe.y||0,de=Oe.eventData;if(de){var Me=Math.min(We,Ie),ke=Math.max(We,Ie),He=Math.min(Ve,Pe),Fe=Math.max(Ve,Pe),qe=Oe.trace;if(m.traceIs(qe,"gl3d")){var $e=me._fullLayout[qe.scene]._scene.container,Ye=$e.offsetLeft,_e=$e.offsetTop;Me+=Ye,ke+=Ye,He+=_e,Fe+=_e}de.bbox={x0:Me+Se,x1:ke+Se,y0:He+be,y1:Fe+be},ge.inOut_bbox&&ge.inOut_bbox.push(de.bbox)}else de=!1;return{color:Oe.color||s.defaultLine,x0:Oe.x0||Oe.x||0,x1:Oe.x1||Oe.x||0,y0:Oe.y0||Oe.y||0,y1:Oe.y1||Oe.y||0,xLabel:Oe.xLabel,yLabel:Oe.yLabel,zLabel:Oe.zLabel,text:Oe.text,name:Oe.name,idealAlign:Oe.idealAlign,borderColor:Oe.borderColor,fontFamily:Oe.fontFamily,fontSize:Oe.fontSize,fontColor:Oe.fontColor,fontWeight:Oe.fontWeight,fontStyle:Oe.fontStyle,fontVariant:Oe.fontVariant,nameLength:Oe.nameLength,textAlign:Oe.textAlign,trace:Oe.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Oe.hovertemplate||!1,hovertemplateLabels:Oe.hovertemplateLabels||!1,eventData:de}}),{gd:me,hovermode:"closest",rotateLabels:!1,bgColor:ge.bgColor||s.background,container:b.select(ge.container),outerContainer:ge.outerContainer||ge.container}).hoverLabels,Ce=0,Le=0;return Ee.sort(function(Oe,We){return Oe.y0-We.y0}).each(function(Oe,We){var Ie=Oe.y0-Oe.by/2;Oe.offset=Ie-5([\s\S]*)<\/extra>/;function ee(le,ge){var ye=ge.gd,me=ye._fullLayout,be=ge.hovermode,Se=ge.rotateLabels,Ee=ge.bgColor,Ce=ge.container,Le=ge.outerContainer,Oe=ge.commonLabelOpts||{};if(le.length===0)return[[]];var We=ge.fontFamily||k.HOVERFONT,Ie=ge.fontSize||k.HOVERFONTSIZE,Ve=ge.fontWeight||me.font.weight,Pe=ge.fontStyle||me.font.style,de=ge.fontVariant||me.font.variant,Me=ge.fontTextcase||me.font.textcase,ke=ge.fontLineposition||me.font.lineposition,He=ge.fontShadow||me.font.shadow,Fe=le[0],qe=Fe.xa,$e=Fe.ya,Ye=be.charAt(0),_e=Ye+"Label",De=Fe[_e];if(De===void 0&&qe.type==="multicategory")for(var Be=0;Beme.width-hr&&(jr=me.width-hr),Kn.attr("d","M"+($n-jr)+",0L"+($n-jr+E)+","+lr+E+"H"+hr+"v"+lr+(2*I+Qn.height)+"H"+-hr+"V"+lr+E+"H"+($n-jr-E)+"Z"),$n=jr,Qe.minX=$n-hr,Qe.maxX=$n+hr,qe.side==="top"?(Qe.minY=vr-(2*I+Qn.height),Qe.maxY=vr-I):(Qe.minY=vr+I,Qe.maxY=vr+(2*I+Qn.height))}else{var ni,Or,Ar;$e.side==="right"?(ni="start",Or=1,Ar="",$n=qe._offset+qe._length):(ni="end",Or=-1,Ar="-",$n=qe._offset),vr=$e._offset+(Fe.y0+Fe.y1)/2,Ln.attr("text-anchor",ni),Kn.attr("d","M0,0L"+Ar+E+","+E+"V"+(I+Qn.height/2)+"h"+Ar+(2*I+Qn.width)+"V-"+(I+Qn.height/2)+"H"+Ar+E+"V-"+E+"Z"),Qe.minY=vr-(I+Qn.height/2),Qe.maxY=vr+(I+Qn.height/2),$e.side==="right"?(Qe.minX=$n+E,Qe.maxX=$n+E+(2*I+Qn.width)):(Qe.minX=$n-E-(2*I+Qn.width),Qe.maxX=$n-E);var xr,Qr=Qn.height/2,kn=tt-Qn.top-Qr,Cn="clip"+me._uid+"commonlabel"+$e._id;if($n=0?Et:Bt+Jt=0?Bt:Dn+Jt=0?rt:et+qt=0?et:In+qt=0,En.idealAlign!=="top"&&Zn||!cr?Zn?(Ar+=Qr/2,En.anchor="start"):En.anchor="middle":(Ar-=Qr/2,En.anchor="end"),En.crossPos=Ar;else{if(En.pos=Ar,Zn=Or+xr/2+Ir<=nt,cr=Or-xr/2-Ir>=0,En.idealAlign!=="left"&&Zn||!cr)if(Zn)Or+=xr/2,En.anchor="start";else{En.anchor="middle";var Er=Ir/2,Xr=Or+Er-nt,ai=Or-Er;Xr>0&&(Or-=Xr),ai<0&&(Or+=-ai)}else Or-=xr/2,En.anchor="end";En.crossPos=Or}Qn.attr("text-anchor",En.anchor),hr&&lr.attr("text-anchor",En.anchor),Kn.attr("transform",_(Or,Ar)+(Se?u(S):""))}),{hoverLabels:mn,commonLabelBoundingBox:Qe}}function H(le,ge,ye,me,be,Se){var Ee="",Ce="";le.nameOverride!==void 0&&(le.name=le.nameOverride),le.name&&(le.trace._meta&&(le.name=w.templateString(le.name,le.trace._meta)),Ee=se(le.name,le.nameLength));var Le=ye.charAt(0),Oe=Le==="x"?"y":"x";le.zLabel!==void 0?(le.xLabel!==void 0&&(Ce+="x: "+le.xLabel+"
"),le.yLabel!==void 0&&(Ce+="y: "+le.yLabel+"
"),le.trace.type!=="choropleth"&&le.trace.type!=="choroplethmapbox"&&le.trace.type!=="choroplethmap"&&(Ce+=(Ce?"z: ":"")+le.zLabel)):ge&&le[Le+"Label"]===be?Ce=le[Oe+"Label"]||"":le.xLabel===void 0?le.yLabel!==void 0&&le.trace.type!=="scattercarpet"&&(Ce=le.yLabel):Ce=le.yLabel===void 0?le.xLabel:"("+le.xLabel+", "+le.yLabel+")",!le.text&&le.text!==0||Array.isArray(le.text)||(Ce+=(Ce?"
":"")+le.text),le.extraText!==void 0&&(Ce+=(Ce?"
":"")+le.extraText),Se&&Ce===""&&!le.hovertemplate&&(Ee===""&&Se.remove(),Ce=Ee);var We=le.hovertemplate||!1;if(We){var Ie=le.hovertemplateLabels||le;le[Le+"Label"]!==be&&(Ie[Le+"other"]=Ie[Le+"Val"],Ie[Le+"otherLabel"]=Ie[Le+"Label"]),Ce=(Ce=w.hovertemplateString(We,Ie,me._d3locale,le.eventData[0]||{},le.trace._meta)).replace($,function(Ve,Pe){return Ee=se(Pe,le.nameLength),""})}return[Ce,Ee]}function J(le,ge){var ye=0,me=le.offset;return ge&&(me*=-f,ye=le.offset*M),{x:ye,y:me}}function Q(le,ge,ye,me){var be=function(Ee){return Ee*ye},Se=function(Ee){return Ee*me};le.each(function(Ee){var Ce=b.select(this);if(Ee.del)return Ce.remove();var Le,Oe,We,Ie,Ve=Ce.select("text.nums"),Pe=Ee.anchor,de=Pe==="end"?-1:1,Me=(Ie=(We=(Oe={start:1,end:-1,middle:0}[(Le=Ee).anchor])*(E+I))+Oe*(Le.txwidth+I),Le.anchor==="middle"&&(We-=Le.tx2width/2,Ie+=Le.txwidth/2+I),{alignShift:Oe,textShiftX:We,text2ShiftX:Ie}),ke=J(Ee,ge),He=ke.x,Fe=ke.y,qe=Pe==="middle";Ce.select("path").attr("d",qe?"M-"+be(Ee.bx/2+Ee.tx2width/2)+","+Se(Fe-Ee.by/2)+"h"+be(Ee.bx)+"v"+Se(Ee.by)+"h-"+be(Ee.bx)+"Z":"M0,0L"+be(de*E+He)+","+Se(E+Fe)+"v"+Se(Ee.by/2-E)+"h"+be(de*Ee.bx)+"v-"+Se(Ee.by)+"H"+be(de*E+He)+"V"+Se(Fe-E)+"Z");var $e=He+Me.textShiftX,Ye=Fe+Ee.ty0-Ee.by/2+I,_e=Ee.textAlign||"auto";_e!=="auto"&&(_e==="left"&&Pe!=="start"?(Ve.attr("text-anchor","start"),$e=qe?-Ee.bx/2-Ee.tx2width/2+I:-Ee.bx-I):_e==="right"&&Pe!=="end"&&(Ve.attr("text-anchor","end"),$e=qe?Ee.bx/2-Ee.tx2width/2-I:Ee.bx+I)),Ve.call(n.positionText,be($e),Se(Ye)),Ee.tx2width&&(Ce.select("text.name").call(n.positionText,be(Me.text2ShiftX+Me.alignShift*I+He),Se(Fe+Ee.ty0-Ee.by/2+I)),Ce.select("rect").call(o.setRect,be(Me.text2ShiftX+(Me.alignShift-1)*Ee.tx2width/2+He),Se(Fe-Ee.by/2-1),be(Ee.tx2width),Se(Ee.by+2)))})}function Z(le,ge){var ye=le.index,me=le.trace||{},be=le.cd[0],Se=le.cd[ye]||{};function Ee(Ve){return Ve||d(Ve)&&Ve===0}var Ce=Array.isArray(ye)?function(Ve,Pe){var de=w.castOption(be,ye,Ve);return Ee(de)?de:w.extractOption({},me,"",Pe)}:function(Ve,Pe){return w.extractOption(Se,me,Ve,Pe)};function Le(Ve,Pe,de){var Me=Ce(Pe,de);Ee(Me)&&(le[Ve]=Me)}if(Le("hoverinfo","hi","hoverinfo"),Le("bgcolor","hbg","hoverlabel.bgcolor"),Le("borderColor","hbc","hoverlabel.bordercolor"),Le("fontFamily","htf","hoverlabel.font.family"),Le("fontSize","hts","hoverlabel.font.size"),Le("fontColor","htc","hoverlabel.font.color"),Le("fontWeight","htw","hoverlabel.font.weight"),Le("fontStyle","hty","hoverlabel.font.style"),Le("fontVariant","htv","hoverlabel.font.variant"),Le("nameLength","hnl","hoverlabel.namelength"),Le("textAlign","hta","hoverlabel.align"),le.posref=ge==="y"||ge==="closest"&&me.orientation==="h"?le.xa._offset+(le.x0+le.x1)/2:le.ya._offset+(le.y0+le.y1)/2,le.x0=w.constrain(le.x0,0,le.xa._length),le.x1=w.constrain(le.x1,0,le.xa._length),le.y0=w.constrain(le.y0,0,le.ya._length),le.y1=w.constrain(le.y1,0,le.ya._length),le.xLabelVal!==void 0&&(le.xLabel="xLabel"in le?le.xLabel:h.hoverLabelText(le.xa,le.xLabelVal,me.xhoverformat),le.xVal=le.xa.c2d(le.xLabelVal)),le.yLabelVal!==void 0&&(le.yLabel="yLabel"in le?le.yLabel:h.hoverLabelText(le.ya,le.yLabelVal,me.yhoverformat),le.yVal=le.ya.c2d(le.yLabelVal)),le.zLabelVal!==void 0&&le.zLabel===void 0&&(le.zLabel=String(le.zLabelVal)),!(isNaN(le.xerr)||le.xa.type==="log"&&le.xerr<=0)){var Oe=h.tickText(le.xa,le.xa.c2l(le.xerr),"hover").text;le.xerrneg!==void 0?le.xLabel+=" +"+Oe+" / -"+h.tickText(le.xa,le.xa.c2l(le.xerrneg),"hover").text:le.xLabel+=" ± "+Oe,ge==="x"&&(le.distance+=1)}if(!(isNaN(le.yerr)||le.ya.type==="log"&&le.yerr<=0)){var We=h.tickText(le.ya,le.ya.c2l(le.yerr),"hover").text;le.yerrneg!==void 0?le.yLabel+=" +"+We+" / -"+h.tickText(le.ya,le.ya.c2l(le.yerrneg),"hover").text:le.yLabel+=" ± "+We,ge==="y"&&(le.distance+=1)}var Ie=le.hoverinfo||le.trace.hoverinfo;return Ie&&Ie!=="all"&&((Ie=Array.isArray(Ie)?Ie:Ie.split("+")).indexOf("x")===-1&&(le.xLabel=void 0),Ie.indexOf("y")===-1&&(le.yLabel=void 0),Ie.indexOf("z")===-1&&(le.zLabel=void 0),Ie.indexOf("text")===-1&&(le.text=void 0),Ie.indexOf("name")===-1&&(le.name=void 0)),le}function K(le,ge,ye){var me,be,Se=ye.container,Ee=ye.fullLayout,Ce=Ee._size,Le=ye.event,Oe=!!ge.hLinePoint,We=!!ge.vLinePoint;if(Se.selectAll(".spikeline").remove(),We||Oe){var Ie=s.combine(Ee.plot_bgcolor,Ee.paper_bgcolor);if(Oe){var Ve,Pe,de=ge.hLinePoint;me=de&&de.xa,(be=de&&de.ya).spikesnap==="cursor"?(Ve=Le.pointerX,Pe=Le.pointerY):(Ve=me._offset+de.x,Pe=be._offset+de.y);var Me,ke,He=e.readability(de.color,Ie)<1.5?s.contrast(Ie):de.color,Fe=be.spikemode,qe=be.spikethickness,$e=be.spikecolor||He,Ye=h.getPxPosition(le,be);if(Fe.indexOf("toaxis")!==-1||Fe.indexOf("across")!==-1){if(Fe.indexOf("toaxis")!==-1&&(Me=Ye,ke=Ve),Fe.indexOf("across")!==-1){var _e=be._counterDomainMin,De=be._counterDomainMax;be.anchor==="free"&&(_e=Math.min(_e,be.position),De=Math.max(De,be.position)),Me=Ce.l+_e*Ce.w,ke=Ce.l+De*Ce.w}Se.insert("line",":first-child").attr({x1:Me,x2:ke,y1:Pe,y2:Pe,"stroke-width":qe,stroke:$e,"stroke-dasharray":o.dashStyle(be.spikedash,qe)}).classed("spikeline",!0).classed("crisp",!0),Se.insert("line",":first-child").attr({x1:Me,x2:ke,y1:Pe,y2:Pe,"stroke-width":qe+2,stroke:Ie}).classed("spikeline",!0).classed("crisp",!0)}Fe.indexOf("marker")!==-1&&Se.insert("circle",":first-child").attr({cx:Ye+(be.side!=="right"?qe:-qe),cy:Pe,r:qe,fill:$e}).classed("spikeline",!0)}if(We){var Be,Ge,tt=ge.vLinePoint;me=tt&&tt.xa,be=tt&&tt.ya,me.spikesnap==="cursor"?(Be=Le.pointerX,Ge=Le.pointerY):(Be=me._offset+tt.x,Ge=be._offset+tt.y);var nt,ft,At=e.readability(tt.color,Ie)<1.5?s.contrast(Ie):tt.color,kt=me.spikemode,Vt=me.spikethickness,Ht=me.spikecolor||At,Gt=h.getPxPosition(le,me);if(kt.indexOf("toaxis")!==-1||kt.indexOf("across")!==-1){if(kt.indexOf("toaxis")!==-1&&(nt=Gt,ft=Ge),kt.indexOf("across")!==-1){var st=me._counterDomainMin,Qe=me._counterDomainMax;me.anchor==="free"&&(st=Math.min(st,me.position),Qe=Math.max(Qe,me.position)),nt=Ce.t+(1-Qe)*Ce.h,ft=Ce.t+(1-st)*Ce.h}Se.insert("line",":first-child").attr({x1:Be,x2:Be,y1:nt,y2:ft,"stroke-width":Vt,stroke:Ht,"stroke-dasharray":o.dashStyle(me.spikedash,Vt)}).classed("spikeline",!0).classed("crisp",!0),Se.insert("line",":first-child").attr({x1:Be,x2:Be,y1:nt,y2:ft,"stroke-width":Vt+2,stroke:Ie}).classed("spikeline",!0).classed("crisp",!0)}kt.indexOf("marker")!==-1&&Se.insert("circle",":first-child").attr({cx:Be,cy:Gt-(me.side!=="top"?Vt:-Vt),r:Vt,fill:Ht}).classed("spikeline",!0)}}}function ae(le,ge){return!ge||ge.vLinePoint!==le._spikepoints.vLinePoint||ge.hLinePoint!==le._spikepoints.hLinePoint}function se(le,ge){return n.plainText(le||"",{len:ge,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function he(le,ge,ye){var me=ge[le+"a"],be=ge[le+"Val"],Se=ge.cd[0];if(me.type==="category"||me.type==="multicategory")be=me._categoriesMap[be];else if(me.type==="date"){var Ee=ge.trace[le+"periodalignment"];if(Ee){var Ce=ge.cd[ge.index],Le=Ce[le+"Start"];Le===void 0&&(Le=Ce[le]);var Oe=Ce[le+"End"];Oe===void 0&&(Oe=Ce[le]);var We=Oe-Le;Ee==="end"?be+=We:Ee==="middle"&&(be+=We/2)}be=me.d2c(be)}return Se&&Se.t&&Se.t.posLetter===me._id&&(ye.boxmode!=="group"&&ye.violinmode!=="group"||(be+=Se.t.dPos)),be}function fe(le){return le.offsetTop+le.clientTop}function ie(le){return le.offsetLeft+le.clientLeft}function oe(le,ge){var ye=le._fullLayout,me=ge.getBoundingClientRect(),be=me.left,Se=me.top,Ee=be+me.width,Ce=Se+me.height,Le=w.apply3DTransform(ye._invTransform)(be,Se),Oe=w.apply3DTransform(ye._invTransform)(Ee,Ce),We=Le[0],Ie=Le[1],Ve=Oe[0],Pe=Oe[1];return{x:We,y:Ie,width:Ve-We,height:Pe-Ie,top:Math.min(Ie,Pe),left:Math.min(We,Ve),right:Math.max(We,Ve),bottom:Math.max(Ie,Pe)}}},26430:function(D,L,t){var b=t(34809),d=t(78766),e=t(36040).isUnifiedHover;D.exports=function(w,y,_,u){u=u||{};var r=y.legend;function n(l){u.font[l]||(u.font[l]=r?y.legend.font[l]:y.font[l])}y&&e(y.hovermode)&&(u.font||(u.font={}),n("size"),n("family"),n("color"),n("weight"),n("style"),n("variant"),r?(u.bgcolor||(u.bgcolor=d.combine(y.legend.bgcolor,y.paper_bgcolor)),u.bordercolor||(u.bordercolor=y.legend.bordercolor)):u.bgcolor||(u.bgcolor=y.paper_bgcolor)),_("hoverlabel.bgcolor",u.bgcolor),_("hoverlabel.bordercolor",u.bordercolor),_("hoverlabel.namelength",u.namelength),b.coerceFont(_,"hoverlabel.font",u.font),_("hoverlabel.align",u.align)}},45265:function(D,L,t){var b=t(34809),d=t(6811);D.exports=function(e,w){function y(_,u){return w[_]!==void 0?w[_]:b.coerce(e,w,d,_,u)}return y("clickmode"),y("hoversubplots"),y("hovermode")}},32141:function(D,L,t){var b=t(45568),d=t(34809),e=t(14751),w=t(36040),y=t(6811),_=t(38103);D.exports={moduleType:"component",name:"fx",constants:t(85988),schema:{layout:y},attributes:t(70192),layoutAttributes:y,supplyLayoutGlobalDefaults:t(5358),supplyDefaults:t(3239),supplyLayoutDefaults:t(8412),calc:t(83552),getDistanceFunction:w.getDistanceFunction,getClosest:w.getClosest,inbox:w.inbox,quadrature:w.quadrature,appendArrayPointValue:w.appendArrayPointValue,castHoverOption:function(u,r,n){return d.castOption(u,r,"hoverlabel."+n)},castHoverinfo:function(u,r,n){return d.castOption(u,n,"hoverinfo",function(l){return d.coerceHoverinfo({hoverinfo:l},{_module:u._module},r)})},hover:_.hover,unhover:e.unhover,loneHover:_.loneHover,loneUnhover:function(u){var r=d.isD3Selection(u)?u:b.select(u);r.selectAll("g.hovertext").remove(),r.selectAll(".spikeline").remove()},click:t(94225)}},6811:function(D,L,t){var b=t(85988),d=t(80337),e=d({editType:"none"});e.family.dflt=b.HOVERFONT,e.size.dflt=b.HOVERFONTSIZE,D.exports={clickmode:{valType:"flaglist",flags:["event","select"],dflt:"event",editType:"plot",extras:["none"]},dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","drawclosedpath","drawopenpath","drawline","drawrect","drawcircle","orbit","turntable",!1],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1,"x unified","y unified"],dflt:"closest",editType:"modebar"},hoversubplots:{valType:"enumerated",values:["single","overlaying","axis"],dflt:"overlaying",editType:"none"},hoverdistance:{valType:"integer",min:-1,dflt:20,editType:"none"},spikedistance:{valType:"integer",min:-1,dflt:-1,editType:"none"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:e,grouptitlefont:d({editType:"none"}),align:{valType:"enumerated",values:["left","right","auto"],dflt:"auto",editType:"none"},namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"},selectdirection:{valType:"enumerated",values:["h","v","d","any"],dflt:"any",editType:"none"}}},8412:function(D,L,t){var b=t(34809),d=t(6811),e=t(45265),w=t(26430);D.exports=function(y,_){function u(s,c){return b.coerce(y,_,d,s,c)}e(y,_)&&(u("hoverdistance"),u("spikedistance")),u("dragmode")==="select"&&u("selectdirection");var r=_._has("mapbox"),n=_._has("map"),l=_._has("geo"),o=_._basePlotModules.length;_.dragmode==="zoom"&&((r||n||l)&&o===1||(r||n)&&l&&o===2)&&(_.dragmode="pan"),w(y,_,u),b.coerceFont(u,"hoverlabel.grouptitlefont",_.hoverlabel.font)}},5358:function(D,L,t){var b=t(34809),d=t(26430),e=t(6811);D.exports=function(w,y){d(w,y,function(_,u){return b.coerce(w,y,e,_,u)})}},83595:function(D,L,t){var b=t(34809),d=t(90694).counter,e=t(13792).u,w=t(54826).idRegex,y=t(78032),_={rows:{valType:"integer",min:1,editType:"plot"},roworder:{valType:"enumerated",values:["top to bottom","bottom to top"],dflt:"top to bottom",editType:"plot"},columns:{valType:"integer",min:1,editType:"plot"},subplots:{valType:"info_array",freeLength:!0,dimensions:2,items:{valType:"enumerated",values:[d("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[w.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[w.y.toString(),""],editType:"plot"},editType:"plot"},pattern:{valType:"enumerated",values:["independent","coupled"],dflt:"coupled",editType:"plot"},xgap:{valType:"number",min:0,max:1,editType:"plot"},ygap:{valType:"number",min:0,max:1,editType:"plot"},domain:e({name:"grid",editType:"plot",noGridCell:!0},{}),xside:{valType:"enumerated",values:["bottom","bottom plot","top plot","top"],dflt:"bottom plot",editType:"plot"},yside:{valType:"enumerated",values:["left","left plot","right plot","right"],dflt:"left plot",editType:"plot"},editType:"plot"};function u(l,o,s){var c=o[s+"axes"],h=Object.keys((l._splomAxes||{})[s]||{});return Array.isArray(c)?c:h.length?h:void 0}function r(l,o,s,c,h,x){var m=o(l+"gap",s),g=o("domain."+l);o(l+"side",c);for(var k=new Array(h),A=g[0],v=(g[1]-A)/(h-m),S=v*(1-m),T=0;T1){g||k||A||N("pattern")==="independent"&&(g=!0),S._hasSubplotGrid=g;var M,f,E=N("roworder")==="top to bottom",I=g?.2:.1,B=g?.3:.1;v&&o._splomGridDflt&&(M=o._splomGridDflt.xside,f=o._splomGridDflt.yside),S._domains={x:r("x",N,I,M,p),y:r("y",N,B,f,T,E)}}else delete o.grid}function N(V,j){return b.coerce(s,S,_,V,j)}},contentDefaults:function(l,o){var s=o.grid;if(s&&s._domains){var c,h,x,m,g,k,A,v=l.grid||{},S=o._subplots,T=s._hasSubplotGrid,p=s.rows,M=s.columns,f=s.pattern==="independent",E=s._axisMap={};if(T){var I=v.subplots||[];k=s.subplots=new Array(p);var B=1;for(c=0;c(n==="legend"?1:0));if(B===!1&&(o[n]=void 0),(B!==!1||c.uirevision)&&(x("uirevision",o.uirevision),B!==!1)){x("borderwidth");var N,V,j,$=x("orientation")==="h",ee=x("yref")==="paper",H=x("xref")==="paper",J="left";if($?(N=0,b.getComponentMethod("rangeslider","isVisible")(l.xaxis)?ee?(V=1.1,j="bottom"):(V=1,j="top"):ee?(V=-.1,j="top"):(V=0,j="bottom")):(V=1,j="auto",H?N=1.02:(N=1,J="right")),d.coerce(c,h,{x:{valType:"number",editType:"legend",min:H?-2:0,max:H?3:1,dflt:N}},"x"),d.coerce(c,h,{y:{valType:"number",editType:"legend",min:ee?-2:0,max:ee?3:1,dflt:V}},"y"),x("traceorder",p),u.isGrouped(o[n])&&x("tracegroupgap"),x("entrywidth"),x("entrywidthmode"),x("indentation"),x("itemsizing"),x("itemwidth"),x("itemclick"),x("itemdoubleclick"),x("groupclick"),x("xanchor",J),x("yanchor",j),x("valign"),d.noneOrAll(c,h,["x","y"]),x("title.text")){x("title.side",$?"left":"top");var Q=d.extendFlat({},m,{size:d.bigFont(m.size)});d.coerceFont(x,"title.font",Q)}}}}D.exports=function(n,l,o){var s,c=o.slice(),h=l.shapes;if(h)for(s=0;s1)}var le=Q.hiddenlabels||[];if(!(K||Q.showlegend&&ae.length))return H.selectAll("."+Z).remove(),Q._topdefs.select("#"+ee).remove(),e.autoMargin(j,Z);var ge=d.ensureSingle(H,"g",Z,function(We){K||We.attr("pointer-events","all")}),ye=d.ensureSingleById(Q._topdefs,"clipPath",ee,function(We){We.append("rect")}),me=d.ensureSingle(ge,"rect","bg",function(We){We.attr("shape-rendering","crispEdges")});me.call(r.stroke,J.bordercolor).call(r.fill,J.bgcolor).style("stroke-width",J.borderwidth+"px");var be,Se=d.ensureSingle(ge,"g","scrollbox"),Ee=J.title;J._titleWidth=0,J._titleHeight=0,Ee.text?((be=d.ensureSingle(Se,"text",Z+"titletext")).attr("text-anchor","start").call(u.font,Ee.font).text(Ee.text),I(be,Se,j,J,A)):Se.selectAll("."+Z+"titletext").remove();var Ce=d.ensureSingle(ge,"rect","scrollbar",function(We){We.attr(o.scrollBarEnterAttrs).call(r.fill,o.scrollBarColor)}),Le=Se.selectAll("g.groups").data(ae);Le.enter().append("g").attr("class","groups"),Le.exit().remove();var Oe=Le.selectAll("g.traces").data(d.identity);Oe.enter().append("g").attr("class","traces"),Oe.exit().remove(),Oe.style("opacity",function(We){var Ie=We[0].trace;return w.traceIs(Ie,"pie-like")?le.indexOf(We[0].label)!==-1?.5:1:Ie.visible==="legendonly"?.5:1}).each(function(){b.select(this).call(M,j,J)}).call(g,j,J).each(function(){K||b.select(this).call(E,j,Z)}),d.syncOrAsync([e.previousPromises,function(){return function(We,Ie,Ve,Pe){var de=We._fullLayout,Me=V(Pe);Pe||(Pe=de[Me]);var ke=de._size,He=k.isVertical(Pe),Fe=k.isGrouped(Pe),qe=Pe.entrywidthmode==="fraction",$e=Pe.borderwidth,Ye=2*$e,_e=o.itemGap,De=Pe.indentation+Pe.itemwidth+2*_e,Be=2*($e+_e),Ge=N(Pe),tt=Pe.y<0||Pe.y===0&&Ge==="top",nt=Pe.y>1||Pe.y===1&&Ge==="bottom",ft=Pe.tracegroupgap,At={};Pe._maxHeight=Math.max(tt||nt?de.height/2:ke.h,30);var kt=0;Pe._width=0,Pe._height=0;var Vt=function(Bt){var Ft=0,St=0,Jt=Bt.title.side;return Jt&&(Jt.indexOf("left")!==-1&&(Ft=Bt._titleWidth),Jt.indexOf("top")!==-1&&(St=Bt._titleHeight)),[Ft,St]}(Pe);if(He)Ve.each(function(Bt){var Ft=Bt[0].height;u.setTranslate(this,$e+Vt[0],$e+Vt[1]+Pe._height+Ft/2+_e),Pe._height+=Ft,Pe._width=Math.max(Pe._width,Bt[0].width)}),kt=De+Pe._width,Pe._width+=_e+De+Ye,Pe._height+=Be,Fe&&(Ie.each(function(Bt,Ft){u.setTranslate(this,0,Ft*Pe.tracegroupgap)}),Pe._height+=(Pe._lgroupsLength-1)*Pe.tracegroupgap);else{var Ht=B(Pe),Gt=Pe.x<0||Pe.x===0&&Ht==="right",st=Pe.x>1||Pe.x===1&&Ht==="left",Qe=nt||tt,pt=de.width/2;Pe._maxWidth=Math.max(Gt?Qe&&Ht==="left"?ke.l+ke.w:pt:st?Qe&&Ht==="right"?ke.r+ke.w:pt:ke.w,2*De);var yt=0,Ot=0;Ve.each(function(Bt){var Ft=T(Bt,Pe,De);yt=Math.max(yt,Ft),Ot+=Ft}),kt=null;var Pt=0;if(Fe){var at=0,lt=0,Xe=0;Ie.each(function(){var Bt=0,Ft=0;b.select(this).selectAll("g.traces").each(function(Jt){var qt=T(Jt,Pe,De),en=Jt[0].height;u.setTranslate(this,Vt[0],Vt[1]+$e+_e+en/2+Ft),Ft+=en,Bt=Math.max(Bt,qt),At[Jt[0].trace.legendgroup]=Bt});var St=Bt+_e;lt>0&&St+$e+lt>Pe._maxWidth?(Pt=Math.max(Pt,lt),lt=0,Xe+=at+ft,at=Ft):at=Math.max(at,Ft),u.setTranslate(this,lt,Xe),lt+=St}),Pe._width=Math.max(Pt,lt)+$e,Pe._height=Xe+at+Be}else{var ut=Ve.size(),wt=Ot+Ye+(ut-1)*_e=Pe._maxWidth&&(Pt=Math.max(Pt,rt),Lt=0,jt+=vt,Pe._height+=vt,vt=0),u.setTranslate(this,Vt[0]+$e+Lt,Vt[1]+$e+jt+Ft/2+_e),rt=Lt+St+_e,Lt+=Jt,vt=Math.max(vt,Ft)}),wt?(Pe._width=Lt+Ye,Pe._height=vt+Be):(Pe._width=Math.max(Pt,rt)+Ye,Pe._height+=vt+Be)}}Pe._width=Math.ceil(Math.max(Pe._width+Vt[0],Pe._titleWidth+2*($e+o.titlePad))),Pe._height=Math.ceil(Math.max(Pe._height+Vt[1],Pe._titleHeight+2*($e+o.itemGap))),Pe._effHeight=Math.min(Pe._height,Pe._maxHeight);var et=We._context.edits,Et=et.legendText||et.legendPosition;Ve.each(function(Bt){var Ft=b.select(this).select("."+Me+"toggle"),St=Bt[0].height,Jt=Bt[0].trace.legendgroup,qt=T(Bt,Pe,De);Fe&&Jt!==""&&(qt=At[Jt]);var en=Et?De:kt||qt;He||qe||(en+=_e/2),u.setRect(Ft,0,-St/2,en,St)})}(j,Le,Oe,J)},function(){var We,Ie,Ve,Pe,de=Q._size,Me=J.borderwidth,ke=J.xref==="paper",He=J.yref==="paper";if(Ee.text&&function(Qe,pt,yt){if(pt.title.side==="top center"||pt.title.side==="top right"){var Ot=pt.title.font.size*c,Pt=0,at=Qe.node(),lt=u.bBox(at).width;pt.title.side==="top center"?Pt=.5*(pt._width-2*yt-2*o.titlePad-lt):pt.title.side==="top right"&&(Pt=pt._width-2*yt-2*o.titlePad-lt),n.positionText(Qe,yt+o.titlePad+Pt,yt+Ot)}}(be,J,Me),!K){var Fe,qe;Fe=ke?de.l+de.w*J.x-h[B(J)]*J._width:Q.width*J.x-h[B(J)]*J._width,qe=He?de.t+de.h*(1-J.y)-h[N(J)]*J._effHeight:Q.height*(1-J.y)-h[N(J)]*J._effHeight;var $e=function(Qe,pt,yt,Ot){var Pt=Qe._fullLayout,at=Pt[pt],lt=B(at),Xe=N(at),ut=at.xref==="paper",wt=at.yref==="paper";Qe._fullLayout._reservedMargin[pt]={};var vt=at.y<.5?"b":"t",Lt=at.x<.5?"l":"r",jt={r:Pt.width-yt,l:yt+at._width,b:Pt.height-Ot,t:Ot+at._effHeight};if(ut&&wt)return e.autoMargin(Qe,pt,{x:at.x,y:at.y,l:at._width*h[lt],r:at._width*x[lt],b:at._effHeight*x[Xe],t:at._effHeight*h[Xe]});ut?Qe._fullLayout._reservedMargin[pt][vt]=jt[vt]:wt||at.orientation==="v"?Qe._fullLayout._reservedMargin[pt][Lt]=jt[Lt]:Qe._fullLayout._reservedMargin[pt][vt]=jt[vt]}(j,Z,Fe,qe);if($e)return;if(Q.margin.autoexpand){var Ye=Fe,_e=qe;Fe=ke?d.constrain(Fe,0,Q.width-J._width):Ye,qe=He?d.constrain(qe,0,Q.height-J._effHeight):_e,Fe!==Ye&&d.log("Constrain "+Z+".x to make legend fit inside graph"),qe!==_e&&d.log("Constrain "+Z+".y to make legend fit inside graph")}u.setTranslate(ge,Fe,qe)}if(Ce.on(".drag",null),ge.on("wheel",null),K||J._height<=J._maxHeight||j._context.staticPlot){var De=J._effHeight;K&&(De=J._height),me.attr({width:J._width-Me,height:De-Me,x:Me/2,y:Me/2}),u.setTranslate(Se,0,0),ye.select("rect").attr({width:J._width-2*Me,height:De-2*Me,x:Me,y:Me}),u.setClipUrl(Se,ee,j),u.setRect(Ce,0,0,0,0),delete J._scrollY}else{var Be,Ge,tt,nt=Math.max(o.scrollBarMinHeight,J._effHeight*J._effHeight/J._height),ft=J._effHeight-nt-2*o.scrollBarMargin,At=J._height-J._effHeight,kt=ft/At,Vt=Math.min(J._scrollY||0,At);me.attr({width:J._width-2*Me+o.scrollBarWidth+o.scrollBarMargin,height:J._effHeight-Me,x:Me/2,y:Me/2}),ye.select("rect").attr({width:J._width-2*Me+o.scrollBarWidth+o.scrollBarMargin,height:J._effHeight-2*Me,x:Me,y:Me+Vt}),u.setClipUrl(Se,ee,j),st(Vt,nt,kt),ge.on("wheel",function(){st(Vt=d.constrain(J._scrollY+b.event.deltaY/ft*At,0,At),nt,kt),Vt!==0&&Vt!==At&&b.event.preventDefault()});var Ht=b.behavior.drag().on("dragstart",function(){var Qe=b.event.sourceEvent;Be=Qe.type==="touchstart"?Qe.changedTouches[0].clientY:Qe.clientY,tt=Vt}).on("drag",function(){var Qe=b.event.sourceEvent;Qe.buttons===2||Qe.ctrlKey||(Ge=Qe.type==="touchmove"?Qe.changedTouches[0].clientY:Qe.clientY,Vt=function(pt,yt,Ot){var Pt=(Ot-yt)/kt+pt;return d.constrain(Pt,0,At)}(tt,Be,Ge),st(Vt,nt,kt))});Ce.call(Ht);var Gt=b.behavior.drag().on("dragstart",function(){var Qe=b.event.sourceEvent;Qe.type==="touchstart"&&(Be=Qe.changedTouches[0].clientY,tt=Vt)}).on("drag",function(){var Qe=b.event.sourceEvent;Qe.type==="touchmove"&&(Ge=Qe.changedTouches[0].clientY,Vt=function(pt,yt,Ot){var Pt=(yt-Ot)/kt+pt;return d.constrain(Pt,0,At)}(tt,Be,Ge),st(Vt,nt,kt))});Se.call(Gt)}function st(Qe,pt,yt){J._scrollY=j._fullLayout[Z]._scrollY=Qe,u.setTranslate(Se,0,-Qe),u.setRect(Ce,J._width,o.scrollBarMargin+Qe*yt,o.scrollBarWidth,pt),ye.select("rect").attr("y",Me+Qe)}j._context.edits.legendPosition&&(ge.classed("cursor-move",!0),_.init({element:ge.node(),gd:j,prepFn:function(Qe){if(Qe.target!==Ce.node()){var pt=u.getTranslate(ge);Ve=pt.x,Pe=pt.y}},moveFn:function(Qe,pt){if(Ve!==void 0&&Pe!==void 0){var yt=Ve+Qe,Ot=Pe+pt;u.setTranslate(ge,yt,Ot),We=_.align(yt,J._width,de.l,de.l+de.w,J.xanchor),Ie=_.align(Ot+J._height,-J._height,de.t+de.h,de.t,J.yanchor)}},doneFn:function(){if(We!==void 0&&Ie!==void 0){var Qe={};Qe[Z+".x"]=We,Qe[Z+".y"]=Ie,w.call("_guiRelayout",j,Qe)}},clickFn:function(Qe,pt){var yt=H.selectAll("g.traces").filter(function(){var Ot=this.getBoundingClientRect();return pt.clientX>=Ot.left&&pt.clientX<=Ot.right&&pt.clientY>=Ot.top&&pt.clientY<=Ot.bottom});yt.size()>0&&p(j,ge,yt,Qe,pt)}}))}],j)}}function T(j,$,ee){var H=j[0],J=H.width,Q=$.entrywidthmode,Z=H.trace.legendwidth||$.entrywidth;return Q==="fraction"?$._maxWidth*Z:ee+(Z||J)}function p(j,$,ee,H,J){var Q=ee.data()[0][0].trace,Z={event:J,node:ee.node(),curveNumber:Q.index,expandedIndex:Q._expandedIndex,data:j.data,layout:j.layout,frames:j._transitionData._frames,config:j._context,fullData:j._fullData,fullLayout:j._fullLayout};Q._group&&(Z.group=Q._group),w.traceIs(Q,"pie-like")&&(Z.label=ee.datum()[0].label);var K=y.triggerHandler(j,"plotly_legendclick",Z);if(H===1){if(K===!1)return;$._clickTimeout=setTimeout(function(){j._fullLayout&&l(ee,j,H)},j._context.doubleClickDelay)}else H===2&&($._clickTimeout&&clearTimeout($._clickTimeout),j._legendMouseDownTime=0,y.triggerHandler(j,"plotly_legenddoubleclick",Z)!==!1&&K!==!1&&l(ee,j,H))}function M(j,$,ee){var H,J,Q=V(ee),Z=j.data()[0][0],K=Z.trace,ae=w.traceIs(K,"pie-like"),se=!ee._inHover&&$._context.edits.legendText&&!ae,he=ee._maxNameLength;Z.groupTitle?(H=Z.groupTitle.text,J=Z.groupTitle.font):(J=ee.font,ee.entries?H=Z.text:(H=ae?Z.label:K.name,K._meta&&(H=d.templateString(H,K._meta))));var fe=d.ensureSingle(j,"text",Q+"text");fe.attr("text-anchor","start").call(u.font,J).text(se?f(H,he):H);var ie=ee.indentation+ee.itemwidth+2*o.itemGap;n.positionText(fe,ie,0),se?fe.call(n.makeEditable,{gd:$,text:H}).call(I,j,$,ee).on("edit",function(oe){this.text(f(oe,he)).call(I,j,$,ee);var le=Z.trace._fullInput||{},ge={};if(w.hasTransform(le,"groupby")){var ye=w.getTransformIndices(le,"groupby"),me=ye[ye.length-1],be=d.keyedContainer(le,"transforms["+me+"].styles","target","value.name");be.set(Z.trace._group,oe),ge=be.constructUpdate()}else ge.name=oe;return le._isShape?w.call("_guiRelayout",$,"shapes["+K.index+"].name",ge.name):w.call("_guiRestyle",$,ge,K.index)}):I(fe,j,$,ee)}function f(j,$){var ee=Math.max(4,$);if(j&&j.trim().length>=ee/2)return j;for(var H=ee-(j=j||"").length;H>0;H--)j+=" ";return j}function E(j,$,ee){var H,J=$._context.doubleClickDelay,Q=1,Z=d.ensureSingle(j,"rect",ee+"toggle",function(K){$._context.staticPlot||K.style("cursor","pointer").attr("pointer-events","all"),K.call(r.fill,"rgba(0,0,0,0)")});$._context.staticPlot||(Z.on("mousedown",function(){(H=new Date().getTime())-$._legendMouseDownTimeJ&&(Q=Math.max(Q-1,1)),p($,K,j,Q,b.event)}}))}function I(j,$,ee,H,J){H._inHover&&j.attr("data-notex",!0),n.convertToTspans(j,ee,function(){(function(Q,Z,K,ae){var se=Q.data()[0][0];if(K._inHover||!se||se.trace.showlegend){var he=Q.select("g[class*=math-group]"),fe=he.node(),ie=V(K);K||(K=Z._fullLayout[ie]);var oe,le,ge=K.borderwidth,ye=(ae===A?K.title.font:se.groupTitle?se.groupTitle.font:K.font).size*c;if(fe){var me=u.bBox(fe);oe=me.height,le=me.width,ae===A?u.setTranslate(he,ge,ge+.75*oe):u.setTranslate(he,0,.25*oe)}else{var be="."+ie+(ae===A?"title":"")+"text",Se=Q.select(be),Ee=n.lineCount(Se),Ce=Se.node();if(oe=ye*Ee,le=Ce?u.bBox(Ce).width:0,ae===A)K.title.side==="left"&&(le+=2*o.itemGap),n.positionText(Se,ge+o.titlePad,ge+ye);else{var Le=2*o.itemGap+K.indentation+K.itemwidth;se.groupTitle&&(Le=o.itemGap,le-=K.indentation+K.itemwidth),n.positionText(Se,Le,-ye*((Ee-1)/2-.3))}}ae===A?(K._titleWidth=le,K._titleHeight=oe):(se.lineHeight=ye,se.height=Math.max(oe,16)+3,se.width=le)}else Q.remove()})($,ee,H,J)})}function B(j){return d.isRightAnchor(j)?"right":d.isCenterAnchor(j)?"center":"left"}function N(j){return d.isBottomAnchor(j)?"bottom":d.isMiddleAnchor(j)?"middle":"top"}function V(j){return j._id||"legend"}D.exports=function(j,$){if($)S(j,$);else{var ee=j._fullLayout,H=ee._legends;ee._infolayer.selectAll('[class^="legend"]').each(function(){var Z=b.select(this),K=Z.attr("class").split(" ")[0];K.match(v)&&H.indexOf(K)===-1&&Z.remove()});for(var J=0;JB&&(I=B)}f[_][0]._groupMinRank=I,f[_][0]._preGroupSort=_}var N=function(H,J){return H.trace.legendrank-J.trace.legendrank||H._preSort-J._preSort};for(f.forEach(function(H,J){H[0]._preGroupSort=J}),f.sort(function(H,J){return H[0]._groupMinRank-J[0]._groupMinRank||H[0]._preGroupSort-J[0]._preGroupSort}),_=0;_g?g:x}D.exports=function(x,m,g){var k=m._fullLayout;g||(g=k.legend);var A=g.itemsizing==="constant",v=g.itemwidth,S=(v+2*o.itemGap)/2,T=w(S,0),p=function(E,I,B,N){var V;if(E+1)V=E;else{if(!(I&&I.width>0))return 0;V=I.width}return A?N:Math.min(V,B)};function M(E,I,B){var N=E[0].trace,V=N.marker||{},j=V.line||{},$=V.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",ee=B?N.visible&&N.type===B:d.traceIs(N,"bar"),H=b.select(I).select("g.legendpoints").selectAll("path.legend"+B).data(ee?[E]:[]);H.enter().append("path").classed("legend"+B,!0).attr("d",$).attr("transform",T),H.exit().remove(),H.each(function(J){var Q=b.select(this),Z=J[0],K=p(Z.mlw,V.line,5,2);Q.style("stroke-width",K+"px");var ae=Z.mcc;if(!g._inHover&&"mc"in Z){var se=u(V),he=se.mid;he===void 0&&(he=(se.max+se.min)/2),ae=y.tryColorscale(V,"")(he)}var fe=ae||Z.mc||V.color,ie=V.pattern,oe=ie&&y.getPatternAttr(ie.shape,0,"");if(oe){var le=y.getPatternAttr(ie.bgcolor,0,null),ge=y.getPatternAttr(ie.fgcolor,0,null),ye=ie.fgopacity,me=h(ie.size,8,10),be=h(ie.solidity,.5,1),Se="legend-"+N.uid;Q.call(y.pattern,"legend",m,Se,oe,me,be,ae,ie.fillmode,le,ge,ye)}else Q.call(_.fill,fe);K&&_.stroke(Q,Z.mlc||j.color)})}function f(E,I,B){var N=E[0],V=N.trace,j=B?V.visible&&V.type===B:d.traceIs(V,B),$=b.select(I).select("g.legendpoints").selectAll("path.legend"+B).data(j?[E]:[]);if($.enter().append("path").classed("legend"+B,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),$.exit().remove(),$.size()){var ee=V.marker||{},H=p(l(ee.line.width,N.pts),ee.line,5,2),J="pieLike",Q=e.minExtend(V,{marker:{line:{width:H}}},J),Z=e.minExtend(N,{trace:Q},J);n($,Z,Q,m)}}x.each(function(E){var I=b.select(this),B=e.ensureSingle(I,"g","layers");B.style("opacity",E[0].trace.opacity);var N=g.indentation,V=g.valign,j=E[0].lineHeight,$=E[0].height;if(V==="middle"&&N===0||!j||!$)B.attr("transform",null);else{var ee={top:1,bottom:-1}[V]*(.5*(j-$+3))||0,H=g.indentation;B.attr("transform",w(H,ee))}B.selectAll("g.legendfill").data([E]).enter().append("g").classed("legendfill",!0),B.selectAll("g.legendlines").data([E]).enter().append("g").classed("legendlines",!0);var J=B.selectAll("g.legendsymbols").data([E]);J.enter().append("g").classed("legendsymbols",!0),J.selectAll("g.legendpoints").data([E]).enter().append("g").classed("legendpoints",!0)}).each(function(E){var I,B=E[0].trace,N=[];if(B.visible)switch(B.type){case"histogram2d":case"heatmap":N=[["M-15,-2V4H15V-2Z"]],I=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":N=[["M-6,-6V6H6V-6Z"]],I=!0;break;case"densitymapbox":case"densitymap":N=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],I="radial";break;case"cone":N=[["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"]],I=!1;break;case"streamtube":N=[["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"]],I=!1;break;case"surface":N=[["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"]],I=!0;break;case"mesh3d":N=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],I=!1;break;case"volume":N=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],I=!0;break;case"isosurface":N=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],I=!1}var V=b.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(N);V.enter().append("path").classed("legend3dandfriends",!0).attr("transform",T).style("stroke-miterlimit",1),V.exit().remove(),V.each(function(j,$){var ee,H=b.select(this),J=u(B),Q=J.colorscale,Z=J.reversescale;if(Q){if(!I){var K=Q.length;ee=$===0?Q[Z?K-1:0][1]:$===1?Q[Z?0:K-1][1]:Q[Math.floor((K-1)/2)][1]}}else{var ae=B.vertexcolor||B.facecolor||B.color;ee=e.isArrayOrTypedArray(ae)?ae[$]||ae[0]:ae}H.attr("d",j[0]),ee?H.call(_.fill,ee):H.call(function(se){if(se.size()){var he="legendfill-"+B.uid;y.gradient(se,m,he,s(Z,I==="radial"),Q,"fill")}})})}).each(function(E){var I=E[0].trace,B=I.type==="waterfall";if(E[0]._distinct&&B){var N=E[0].trace[E[0].dir].marker;return E[0].mc=N.color,E[0].mlw=N.line.width,E[0].mlc=N.line.color,M(E,this,"waterfall")}var V=[];I.visible&&B&&(V=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 j=b.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(V);j.enter().append("path").classed("legendwaterfall",!0).attr("transform",T).style("stroke-miterlimit",1),j.exit().remove(),j.each(function($){var ee=b.select(this),H=I[$[0]].marker,J=p(void 0,H.line,5,2);ee.attr("d",$[1]).style("stroke-width",J+"px").call(_.fill,H.color),J&&ee.call(_.stroke,H.line.color)})}).each(function(E){M(E,this,"funnel")}).each(function(E){M(E,this)}).each(function(E){var I=E[0].trace,B=b.select(this).select("g.legendpoints").selectAll("path.legendbox").data(I.visible&&d.traceIs(I,"box-violin")?[E]:[]);B.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",T),B.exit().remove(),B.each(function(){var N=b.select(this);if(I.boxpoints!=="all"&&I.points!=="all"||_.opacity(I.fillcolor)!==0||_.opacity((I.line||{}).color)!==0){var V=p(void 0,I.line,5,2);N.style("stroke-width",V+"px").call(_.fill,I.fillcolor),V&&_.stroke(N,I.line.color)}else{var j=e.minExtend(I,{marker:{size:A?12:e.constrain(I.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});B.call(y.pointStyle,j,m)}})}).each(function(E){f(E,this,"funnelarea")}).each(function(E){f(E,this,"pie")}).each(function(E){var I,B,N=c(E),V=N.showFill,j=N.showLine,$=N.showGradientLine,ee=N.showGradientFill,H=N.anyFill,J=N.anyLine,Q=E[0],Z=Q.trace,K=u(Z),ae=K.colorscale,se=K.reversescale,he=r.hasMarkers(Z)||!H?"M5,0":J?"M5,-2":"M5,-3",fe=b.select(this),ie=fe.select(".legendfill").selectAll("path").data(V||ee?[E]:[]);if(ie.enter().append("path").classed("js-fill",!0),ie.exit().remove(),ie.attr("d",he+"h"+v+"v6h-"+v+"z").call(function(ge){if(ge.size())if(V)y.fillGroupStyle(ge,m,!0);else{var ye="legendfill-"+Z.uid;y.gradient(ge,m,ye,s(se),ae,"fill")}}),j||$){var oe=p(void 0,Z.line,10,5);B=e.minExtend(Z,{line:{width:oe}}),I=[e.minExtend(Q,{trace:B})]}var le=fe.select(".legendlines").selectAll("path").data(j||$?[I]:[]);le.enter().append("path").classed("js-line",!0),le.exit().remove(),le.attr("d",he+($?"l"+v+",0.0001":"h"+v)).call(j?y.lineGroupStyle:function(ge){if(ge.size()){var ye="legendline-"+Z.uid;y.lineGroupStyle(ge),y.gradient(ge,m,ye,s(se),ae,"stroke")}})}).each(function(E){var I,B,N=c(E),V=N.anyFill,j=N.anyLine,$=N.showLine,ee=N.showMarker,H=E[0],J=H.trace,Q=!ee&&!j&&!V&&r.hasText(J);function Z(le,ge,ye,me){var be=e.nestedProperty(J,le).get(),Se=e.isArrayOrTypedArray(be)&&ge?ge(be):be;if(A&&Se&&me!==void 0&&(Se=me),ye){if(Seye[1])return ye[1]}return Se}function K(le){return H._distinct&&H.index&&le[H.index]?le[H.index]:le[0]}if(ee||Q||$){var ae={},se={};if(ee){ae.mc=Z("marker.color",K),ae.mx=Z("marker.symbol",K),ae.mo=Z("marker.opacity",e.mean,[.2,1]),ae.mlc=Z("marker.line.color",K),ae.mlw=Z("marker.line.width",e.mean,[0,5],2),se.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var he=Z("marker.size",e.mean,[2,16],12);ae.ms=he,se.marker.size=he}$&&(se.line={width:Z("line.width",K,[0,10],5)}),Q&&(ae.tx="Aa",ae.tp=Z("textposition",K),ae.ts=10,ae.tc=Z("textfont.color",K),ae.tf=Z("textfont.family",K),ae.tw=Z("textfont.weight",K),ae.ty=Z("textfont.style",K),ae.tv=Z("textfont.variant",K),ae.tC=Z("textfont.textcase",K),ae.tE=Z("textfont.lineposition",K),ae.tS=Z("textfont.shadow",K)),I=[e.minExtend(H,ae)],(B=e.minExtend(J,se)).selectedpoints=null,B.texttemplate=null}var fe=b.select(this).select("g.legendpoints"),ie=fe.selectAll("path.scatterpts").data(ee?I:[]);ie.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",T),ie.exit().remove(),ie.call(y.pointStyle,B,m),ee&&(I[0].mrc=3);var oe=fe.selectAll("g.pointtext").data(Q?I:[]);oe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",T),oe.exit().remove(),oe.selectAll("text").call(y.textPointStyle,B,m)}).each(function(E){var I=E[0].trace,B=b.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(I.visible&&I.type==="candlestick"?[E,E]:[]);B.enter().append("path").classed("legendcandle",!0).attr("d",function(N,V){return V?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",T).style("stroke-miterlimit",1),B.exit().remove(),B.each(function(N,V){var j=b.select(this),$=I[V?"increasing":"decreasing"],ee=p(void 0,$.line,5,2);j.style("stroke-width",ee+"px").call(_.fill,$.fillcolor),ee&&_.stroke(j,$.line.color)})}).each(function(E){var I=E[0].trace,B=b.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(I.visible&&I.type==="ohlc"?[E,E]:[]);B.enter().append("path").classed("legendohlc",!0).attr("d",function(N,V){return V?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",T).style("stroke-miterlimit",1),B.exit().remove(),B.each(function(N,V){var j=b.select(this),$=I[V?"increasing":"decreasing"],ee=p(void 0,$.line,5,2);j.style("fill","none").call(y.dashLine,$.line.dash,ee),ee&&_.stroke(j,$.line.color)})})}},50308:function(D,L,t){t(87632),D.exports={editType:"modebar",orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"modebar"},bgcolor:{valType:"color",editType:"modebar"},color:{valType:"color",editType:"modebar"},activecolor:{valType:"color",editType:"modebar"},uirevision:{valType:"any",editType:"none"},add:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"},remove:{valType:"string",arrayOk:!0,dflt:"",editType:"modebar"}}},5832:function(D,L,t){var b=t(33626),d=t(44122),e=t(5975),w=t(35188),y=t(28231).eraseActiveShape,_=t(34809),u=_._,r=D.exports={};function n(v,S){var T,p,M=S.currentTarget,f=M.getAttribute("data-attr"),E=M.getAttribute("data-val")||!0,I=v._fullLayout,B={},N=e.list(v,null,!0),V=I._cartesianSpikesEnabled;if(f==="zoom"){var j,$=E==="in"?.5:2,ee=(1+$)/2,H=(1-$)/2;for(p=0;p1?(fe=["toggleHover"],ie=["resetViews"]):E?(he=["zoomInGeo","zoomOutGeo"],fe=["hoverClosestGeo"],ie=["resetGeo"]):f?(fe=["hoverClosest3d"],ie=["resetCameraDefault3d","resetCameraLastSave3d"]):j?(he=["zoomInMapbox","zoomOutMapbox"],fe=["toggleHover"],ie=["resetViewMapbox"]):$?(he=["zoomInMap","zoomOutMap"],fe=["toggleHover"],ie=["resetViewMap"]):N?fe=["hoverClosestGl2d"]:I?fe=["hoverClosestPie"]:J?(fe=["hoverClosestCartesian","hoverCompareCartesian"],ie=["resetViewSankey"]):fe=["toggleHover"],M&&fe.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(Se){for(var Ee=0;Ee0)){var m=function(k,A,v){for(var S=v.filter(function(f){return A[f].anchor===k._id}),T=0,p=0;p0?S.touches[0].clientX:0}function x(S,T,p,M){var f=w.ensureSingle(S,"rect",c.bgClassName,function(N){N.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),E=M.borderwidth%2==0?M.borderwidth:M.borderwidth-1,I=-M._offsetShift,B=_.crispRound(T,M.borderwidth);f.attr({width:M._width+E,height:M._height+E,transform:y(I,I),"stroke-width":B}).call(u.stroke,M.bordercolor).call(u.fill,M.bgcolor)}function m(S,T,p,M){var f=T._fullLayout;w.ensureSingleById(f._topdefs,"clipPath",M._clipId,function(E){E.append("rect").attr({x:0,y:0})}).select("rect").attr({width:M._width,height:M._height})}function g(S,T,p,M){var f,E=T.calcdata,I=S.selectAll("g."+c.rangePlotClassName).data(p._subplotsWith,w.identity);I.enter().append("g").attr("class",function(B){return c.rangePlotClassName+" "+B}).call(_.setClipUrl,M._clipId,T),I.order(),I.exit().remove(),I.each(function(B,N){var V=b.select(this),j=N===0,$=l.getFromId(T,B,"y"),ee=$._name,H=M[ee],J={data:[],layout:{xaxis:{type:p.type,domain:[0,1],range:M.range.slice(),calendar:p.calendar},width:M._width,height:M._height,margin:{t:0,b:0,l:0,r:0}},_context:T._context};p.rangebreaks&&(J.layout.xaxis.rangebreaks=p.rangebreaks),J.layout[ee]={type:$.type,domain:[0,1],range:H.rangemode!=="match"?H.range.slice():$.range.slice(),calendar:$.calendar},$.rangebreaks&&(J.layout[ee].rangebreaks=$.rangebreaks),e.supplyDefaults(J);var Q=J._fullLayout.xaxis,Z=J._fullLayout[ee];Q.clearCalc(),Q.setScale(),Z.clearCalc(),Z.setScale();var K={id:B,plotgroup:V,xaxis:Q,yaxis:Z,isRangePlot:!0};j?f=K:(K.mainplot="xy",K.mainplotinfo=f),n.rangePlot(T,K,function(ae,se){for(var he=[],fe=0;fe=Le.max)Ee=ye[Ce+1];else if(Se=Le.pmax)Ee=ye[Ce+1];else if(SeCe._length||Fe+tt<0)return;De=He+tt,Be=Fe+tt;break;case We:if(Ge="col-resize",He+tt>Ce._length)return;De=He+tt,Be=Fe;break;case Ie:if(Ge="col-resize",Fe+tt<0)return;De=He,Be=Fe+tt;break;default:Ge="ew-resize",De=ke,Be=ke+tt}if(Be=0;N--){var V=A.append("path").attr(S).style("opacity",N?.1:T).call(w.stroke,M).call(w.fill,p).call(y.dashLine,N?"solid":E,N?4+f:f);if(s(V,h,g),I){var j=_(h.layout,"selections",g);V.style({cursor:"move"});var $={element:V.node(),plotinfo:k,gd:h,editHelpers:j,isActiveSelection:!0},ee=b(v,h);d(ee,V,$)}else V.style("pointer-events",N?"all":"none");B[N]=V}var H=B[0];B[1].node().addEventListener("click",function(){return function(J,Q){if(l(J)){var Z=+Q.node().getAttribute("data-index");if(Z>=0){if(Z===J._fullLayout._activeSelectionIndex)return void c(J);J._fullLayout._activeSelectionIndex=Z,J._fullLayout._deactivateSelection=c,n(J)}}}(h,H)})}(h._fullLayout._selectionLayer)}function s(h,x,m){var g=m.xref+m.yref;y.setClipUrl(h,"clip"+x._fullLayout._uid+g,x)}function c(h){l(h)&&h._fullLayout._activeSelectionIndex>=0&&(e(h),delete h._fullLayout._activeSelectionIndex,n(h))}D.exports={draw:n,drawOne:o,activateLastSelection:function(h){if(l(h)){var x=h._fullLayout.selections.length-1;h._fullLayout._activeSelectionIndex=x,h._fullLayout._deactivateSelection=c,n(h)}}}},52307:function(D,L,t){var b=t(94850).T,d=t(93049).extendFlat;D.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:d({},b,{dflt:"dot",editType:"none"}),editType:"none"},editType:"none"},activeselection:{fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"none"},opacity:{valType:"number",min:0,max:1,dflt:.5,editType:"none"},editType:"none"}}},43028:function(D){D.exports=function(L,t,b){b("newselection.mode"),b("newselection.line.width")&&(b("newselection.line.color"),b("newselection.line.dash")),b("activeselection.fillcolor"),b("activeselection.opacity")}},51817:function(D,L,t){var b=t(70414).selectMode,d=t(78534).clearOutline,e=t(81055),w=e.readPaths,y=e.writePaths,_=e.fixDatesForPaths;D.exports=function(u,r){if(u.length){var n=u[0][0];if(n){var l=n.getAttribute("d"),o=r.gd,s=o._fullLayout.newselection,c=r.plotinfo,h=c.xaxis,x=c.yaxis,m=r.isActiveSelection,g=r.dragmode,k=(o.layout||{}).selections||[];if(!b(g)&&m!==void 0){var A=o._fullLayout._activeSelectionIndex;if(A-1,Ot=[];if(function(ut){return ut&&Array.isArray(ut)&&ut[0].hoverOnBox!==!0}(pt)){oe($e,Ye,Ge);var Pt=function(ut,wt){var vt,Lt,jt=ut[0],rt=-1,et=[];for(Lt=0;Lt0?function(ut,wt){var vt,Lt,jt,rt=[];for(jt=0;jt0&&rt.push(vt);if(rt.length===1&&rt[0]===wt.searchInfo&&(Lt=wt.searchInfo.cd[0].trace).selectedpoints.length===wt.pointNumbers.length){for(jt=0;jt1||(Lt+=wt.selectedpoints.length)>1))return!1;return Lt===1}(nt)&&(Ht=be(Pt))){for(tt&&tt.remove(),Qe=0;Qe=0})(Be)&&Be._fullLayout._deactivateShape(Be),function(Vt){return Vt._fullLayout._activeSelectionIndex>=0}(Be)&&Be._fullLayout._deactivateSelection(Be);var Ge=Be._fullLayout._zoomlayer,tt=o(_e),nt=c(_e);if(tt||nt){var ft,At,kt=Ge.selectAll(".select-outline-"+De.id);kt&&Be._fullLayout._outlining&&(tt&&(ft=S(kt,$e)),ft&&e.call("_guiRelayout",Be,{shapes:ft}),nt&&!ae($e)&&(At=T(kt,$e)),At&&(Be._fullLayout._noEmitSelectedAtStart=!0,e.call("_guiRelayout",Be,{selections:At}).then(function(){Ye&&p(Be)})),Be._fullLayout._outlining=!1)}De.selection={},De.selection.selectionDefs=$e.selectionDefs=[],De.selection.mergedPolygons=$e.mergedPolygons=[]}function ge($e){return $e._id}function ye($e,Ye,_e,De){if(!$e.calcdata)return[];var Be,Ge,tt,nt=[],ft=Ye.map(ge),At=_e.map(ge);for(tt=0;tt<$e.calcdata.length;tt++)if((Ge=(Be=$e.calcdata[tt])[0].trace).visible===!0&&Ge._module&&Ge._module.selectPoints)if(!ae({subplot:De})||Ge.subplot!==De&&Ge.geo!==De)if(Ge.type==="splom"){if(Ge._xaxes[ft[0]]&&Ge._yaxes[At[0]]){var kt=me(Ge._module,Be,Ye[0],_e[0]);kt.scene=$e._fullLayout._splomScenes[Ge.uid],nt.push(kt)}}else if(Ge.type==="sankey"){var Vt=me(Ge._module,Be,Ye[0],_e[0]);nt.push(Vt)}else{if(!(ft.indexOf(Ge.xaxis)!==-1||Ge._xA&&Ge._xA.overlaying)||!(At.indexOf(Ge.yaxis)!==-1||Ge._yA&&Ge._yA.overlaying))continue;nt.push(me(Ge._module,Be,B($e,Ge.xaxis),B($e,Ge.yaxis)))}else nt.push(me(Ge._module,Be,Ye[0],_e[0]));return nt}function me($e,Ye,_e,De){return{_module:$e,cd:Ye,xaxis:_e,yaxis:De}}function be($e){var Ye=$e.searchInfo.cd[0].trace,_e=$e.pointNumber,De=$e.pointNumbers,Be=De.length>0?De[0]:_e;return!!Ye.selectedpoints&&Ye.selectedpoints.indexOf(Be)>-1}function Se($e,Ye,_e){var De,Be;for(De=0;De-1&&Ye;if(!Ge&&Ye){var Fn=Pe($e,!0);if(Fn.length){var wn=Fn[0].xref,zn=Fn[0].yref;if(wn&&zn){var Jn=ke(Fn);He([B($e,wn,"x"),B($e,zn,"y")])(Ln,Jn)}}$e._fullLayout._noEmitSelectedAtStart?$e._fullLayout._noEmitSelectedAtStart=!1:Tn&&Fe($e,Ln),Ht._reselect=!1}if(!Ge&&Ht._deselect){var $n=Ht._deselect;(function(vr,Qn,lr){for(var hr=0;hr=0)Gt._fullLayout._deactivateShape(Gt);else if(!At){var Jn=st.clickmode;I.done(Kn).then(function(){if(I.clear(Kn),wn===2){for(un.remove(),jt=0;jt-1&&se(zn,Gt,De.xaxes,De.yaxes,De.subplot,De,un),Jn==="event"&&Fe(Gt,void 0);_.click(Gt,zn,Ot.id)}).catch(M.error)}},De.doneFn=function(){mn.remove(),I.done(Kn).then(function(){I.clear(Kn),!Qe&&Lt&&De.selectionDefs&&(Lt.subtract=on,De.selectionDefs.push(Lt),De.mergedPolygons.length=0,[].push.apply(De.mergedPolygons,vt)),(Qe||At)&&le(De,Qe),De.doneFnCompleted&&De.doneFnCompleted(Ln),kt&&Fe(Gt,et)}).catch(M.error)}},clearOutline:g,clearSelectionsCache:le,selectOnClick:se}},43144:function(D,L,t){var b=t(50222),d=t(80337),e=t(36640).line,w=t(94850).T,y=t(93049).extendFlat,_=t(78032).templatedArray,u=(t(35081),t(9829)),r=t(3208).LF,n=t(41235);D.exports=_("shape",{visible:y({},u.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:y({},u.legend,{editType:"calc+arraydraw"}),legendgroup:y({},u.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:y({},u.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:d({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:y({},u.legendrank,{editType:"calc+arraydraw"}),legendwidth:y({},u.legendwidth,{editType:"calc+arraydraw"}),type:{valType:"enumerated",values:["circle","rect","path","line"],editType:"calc+arraydraw"},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above",editType:"arraydraw"},xref:y({},b.xref,{}),xsizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},xanchor:{valType:"any",editType:"calc+arraydraw"},x0:{valType:"any",editType:"calc+arraydraw"},x1:{valType:"any",editType:"calc+arraydraw"},x0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},x1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},yref:y({},b.yref,{}),ysizemode:{valType:"enumerated",values:["scaled","pixel"],dflt:"scaled",editType:"calc+arraydraw"},yanchor:{valType:"any",editType:"calc+arraydraw"},y0:{valType:"any",editType:"calc+arraydraw"},y1:{valType:"any",editType:"calc+arraydraw"},y0shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},y1shift:{valType:"number",dflt:0,min:-1,max:1,editType:"calc"},path:{valType:"string",editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},line:{color:y({},e.color,{editType:"arraydraw"}),width:y({},e.width,{editType:"calc+arraydraw"}),dash:y({},w,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:r({},{keys:Object.keys(n)}),font:d({editType:"calc+arraydraw",colorEditType:"arraydraw"}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"],editType:"arraydraw"},textangle:{valType:"angle",dflt:"auto",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],editType:"calc+arraydraw"},padding:{valType:"number",dflt:3,min:0,editType:"arraydraw"},editType:"arraydraw"},editType:"arraydraw"})},44959:function(D,L,t){var b=t(34809),d=t(29714),e=t(2956),w=t(49728);function y(n){return u(n.line.width,n.xsizemode,n.x0,n.x1,n.path,!1)}function _(n){return u(n.line.width,n.ysizemode,n.y0,n.y1,n.path,!0)}function u(n,l,o,s,c,h){var x=n/2,m=h;if(l==="pixel"){var g=c?w.extractPathCoords(c,h?e.paramIsY:e.paramIsX):[o,s],k=b.aggNums(Math.max,null,g),A=b.aggNums(Math.min,null,g),v=A<0?Math.abs(A)+x:x,S=k>0?k+x:x;return{ppad:x,ppadplus:m?v:S,ppadminus:m?S:v}}return{ppad:x}}function r(n,l,o){var s,c,h=n._id.charAt(0)==="x"?"x":"y",x=n.type==="category"||n.type==="multicategory",m=0,g=0,k=x?n.r2c:n.d2c;if(l[h+"sizemode"]==="scaled"?(s=l[h+"0"],c=l[h+"1"],x&&(m=l[h+"0shift"],g=l[h+"1shift"])):(s=l[h+"anchor"],c=l[h+"anchor"]),s!==void 0)return[k(s)+m,k(c)+g];if(l.path){var A,v,S,T,p=1/0,M=-1/0,f=l.path.match(e.segmentRE);for(n.type==="date"&&(k=w.decodeDate(k)),A=0;AM&&(M=T)));return M>=p?[p,M]:void 0}}D.exports=function(n){var l=n._fullLayout,o=b.filterVisible(l.shapes);if(o.length&&n._fullData.length)for(var s=0;s=Se?Ee-Le:Le-Ee,-180/Math.PI*Math.atan2(Oe,We)}(v,T,S,p):0),E.call(function(Se){return Se.call(w.font,f).attr({}),e.convertToTspans(Se,l),Se});var ge=function(Se,Ee,Ce,Le,Oe,We,Ie){var Ve,Pe,de,Me,ke=Oe.label.textposition,He=Oe.label.textangle,Fe=Oe.label.padding,qe=Oe.type,$e=Math.PI/180*We,Ye=Math.sin($e),_e=Math.cos($e),De=Oe.label.xanchor,Be=Oe.label.yanchor;if(qe==="line"){ke==="start"?(Ve=Se,Pe=Ee):ke==="end"?(Ve=Ce,Pe=Le):(Ve=(Se+Ce)/2,Pe=(Ee+Le)/2),De==="auto"&&(De=ke==="start"?He==="auto"?Ce>Se?"left":CeSe?"right":CeSe?"right":CeSe?"left":Ce1&&(Le.length!==2||Le[1][0]!=="Z")&&(H===0&&(Le[0][0]="M"),M[ee]=Le,N(),V())}}()}}function ge(Se,Ee){(function(Ce,Le){if(M.length)for(var Oe=0;OeOe?(Ve=Ce,ke="y0",Pe=Oe,He="y1"):(Ve=Oe,ke="y1",Pe=Ce,He="y0"),wt(et),jt(be,ye),function(Et,Bt,Ft){var St=Bt.xref,Jt=Bt.yref,qt=w.getFromId(Ft,St),en=w.getFromId(Ft,Jt),Wt="";St==="paper"||qt.autorange||(Wt+=St),Jt==="paper"||en.autorange||(Wt+=Jt),l.setClipUrl(Et,Wt?"clip"+Ft._fullLayout._uid+Wt:null,Ft)}(ge,ye,le),ut.moveFn=Ye==="move"?vt:Lt,ut.altKey=et.altKey)},doneFn:function(){k(le)||(c(ge),rt(be),S(ge,le,ye),d.call("_guiRelayout",le,Se.getUpdateObj()))},clickFn:function(){k(le)||rt(be)}};function wt(et){if(k(le))Ye=null;else if(tt)Ye=et.target.tagName==="path"?"move":et.target.attributes["data-line-point"].value==="start-point"?"resize-over-start-point":"resize-over-end-point";else{var Et=ut.element.getBoundingClientRect(),Bt=Et.right-Et.left,Ft=Et.bottom-Et.top,St=et.clientX-Et.left,Jt=et.clientY-Et.top,qt=!nt&&Bt>_e&&Ft>De&&!et.shiftKey?s.getCursor(St/Bt,1-Jt/Ft):"move";c(ge,qt),Ye=qt.split("-")[0]}}function vt(et,Et){if(ye.type==="path"){var Bt=function(Jt){return Jt},Ft=Bt,St=Bt;Be?ft("xanchor",ye.xanchor=at(We+et)):(Ft=function(Jt){return at(Ot(Jt)+et)},kt&&kt.type==="date"&&(Ft=x.encodeDate(Ft))),Ge?ft("yanchor",ye.yanchor=lt(Ie+Et)):(St=function(Jt){return lt(Pt(Jt)+Et)},Ht&&Ht.type==="date"&&(St=x.encodeDate(St))),ft("path",ye.path=T($e,Ft,St))}else Be?ft("xanchor",ye.xanchor=at(We+et)):(ft("x0",ye.x0=at(Ee+et)),ft("x1",ye.x1=at(Le+et))),Ge?ft("yanchor",ye.yanchor=lt(Ie+Et)):(ft("y0",ye.y0=lt(Ce+Et)),ft("y1",ye.y1=lt(Oe+Et)));ge.attr("d",m(le,ye)),jt(be,ye),u(le,me,ye,At)}function Lt(et,Et){if(nt){var Bt=function(Ln){return Ln},Ft=Bt,St=Bt;Be?ft("xanchor",ye.xanchor=at(We+et)):(Ft=function(Ln){return at(Ot(Ln)+et)},kt&&kt.type==="date"&&(Ft=x.encodeDate(Ft))),Ge?ft("yanchor",ye.yanchor=lt(Ie+Et)):(St=function(Ln){return lt(Pt(Ln)+Et)},Ht&&Ht.type==="date"&&(St=x.encodeDate(St))),ft("path",ye.path=T($e,Ft,St))}else if(tt){if(Ye==="resize-over-start-point"){var Jt=Ee+et,qt=Ge?Ce-Et:Ce+Et;ft("x0",ye.x0=Be?Jt:at(Jt)),ft("y0",ye.y0=Ge?qt:lt(qt))}else if(Ye==="resize-over-end-point"){var en=Le+et,Wt=Ge?Oe-Et:Oe+Et;ft("x1",ye.x1=Be?en:at(en)),ft("y1",ye.y1=Ge?Wt:lt(Wt))}}else{var Zt=function(Ln){return Ye.indexOf(Ln)!==-1},on=Zt("n"),un=Zt("s"),Pn=Zt("w"),Dn=Zt("e"),In=on?Ve+Et:Ve,mn=un?Pe+Et:Pe,En=Pn?de+et:de,Kn=Dn?Me+et:Me;Ge&&(on&&(In=Ve-Et),un&&(mn=Pe-Et)),(!Ge&&mn-In>De||Ge&&In-mn>De)&&(ft(ke,ye[ke]=Ge?In:lt(In)),ft(He,ye[He]=Ge?mn:lt(mn))),Kn-En>_e&&(ft(Fe,ye[Fe]=Be?En:at(En)),ft(qe,ye[qe]=Be?Kn:at(Kn)))}ge.attr("d",m(le,ye)),jt(be,ye),u(le,me,ye,At)}function jt(et,Et){(Be||Ge)&&function(){var Bt=Et.type!=="path",Ft=et.selectAll(".visual-cue").data([0]);Ft.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":1}).classed("visual-cue",!0);var St=Ot(Be?Et.xanchor:e.midRange(Bt?[Et.x0,Et.x1]:x.extractPathCoords(Et.path,h.paramIsX))),Jt=Pt(Ge?Et.yanchor:e.midRange(Bt?[Et.y0,Et.y1]:x.extractPathCoords(Et.path,h.paramIsY)));if(St=x.roundPositionForSharpStrokeRendering(St,1),Jt=x.roundPositionForSharpStrokeRendering(Jt,1),Be&&Ge){var qt="M"+(St-1-1)+","+(Jt-1-1)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";Ft.attr("d",qt)}else if(Be){var en="M"+(St-1-1)+","+(Jt-9-1)+"v18 h2 v-18 Z";Ft.attr("d",en)}else{var Wt="M"+(St-9-1)+","+(Jt-1-1)+"h18 v2 h-18 Z";Ft.attr("d",Wt)}}()}function rt(et){et.selectAll(".visual-cue").remove()}s.init(ut),Xe.node().onmousemove=wt}(M,fe,I,f,V,se):I.editable===!0&&fe.style("pointer-events",K||n.opacity(H)*ee<=.5?"stroke":"all");fe.node().addEventListener("click",function(){return function(le,ge){if(A(le)){var ye=+ge.node().getAttribute("data-index");if(ye>=0){if(ye===le._fullLayout._activeShapeIndex)return void p(le);le._fullLayout._activeShapeIndex=ye,le._fullLayout._deactivateShape=p,g(le)}}}(M,fe)})}I._input&&I.visible===!0&&(I.layer==="above"?N(M._fullLayout._shapeUpperLayer):I.xref==="paper"||I.yref==="paper"?N(M._fullLayout._shapeLowerLayer):I.layer==="between"?N(B.shapelayerBetween):B._hadPlotinfo?N((B.mainplotinfo||B).shapelayer):N(M._fullLayout._shapeLowerLayer))}function S(M,f,E){var I=(E.xref+E.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");l.setClipUrl(M,I?"clip"+f._fullLayout._uid+I:null,f)}function T(M,f,E){return M.replace(h.segmentRE,function(I){var B=0,N=I.charAt(0),V=h.paramIsX[N],j=h.paramIsY[N],$=h.numParams[N];return N+I.substr(1).replace(h.paramRE,function(ee){return B>=$||(V[B]?ee=f(ee):j[B]&&(ee=E(ee)),B++),ee})})}function p(M){A(M)&&M._fullLayout._activeShapeIndex>=0&&(r(M),delete M._fullLayout._activeShapeIndex,g(M))}D.exports={draw:g,drawOne:v,eraseActiveShape:function(M){if(A(M)){r(M);var f=M._fullLayout._activeShapeIndex,E=(M.layout||{}).shapes||[];if(f0&&vge&&(me="X"),me});return fe>ge&&(ye=ye.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+he)),ie+ye})}(_,r,l);if(_.xsizemode==="pixel"){var f=r(_.xanchor);o=f+_.x0+S,s=f+_.x1+T}else o=r(_.x0)+S,s=r(_.x1)+T;if(_.ysizemode==="pixel"){var E=l(_.yanchor);c=E-_.y0+p,h=E-_.y1+M}else c=l(_.y0)+p,h=l(_.y1)+M;if(x==="line")return"M"+o+","+c+"L"+s+","+h;if(x==="rect")return"M"+o+","+c+"H"+s+"V"+h+"H"+o+"Z";var I=(o+s)/2,B=(c+h)/2,N=Math.abs(I-o),V=Math.abs(B-c),j="A"+N+","+V,$=I+N+","+B;return"M"+$+j+" 0 1,1 "+I+","+(B-V)+j+" 0 0,1 "+$+"Z"}},43701:function(D,L,t){var b=t(28231);D.exports={moduleType:"component",name:"shapes",layoutAttributes:t(43144),supplyLayoutDefaults:t(74367),supplyDrawNewShapeDefaults:t(85522),includeBasePlot:t(20706)("shapes"),calcAutorange:t(44959),draw:b.draw,drawOne:b.drawOne}},41235:function(D){function L(u,r){return r?r.d2l(u):u}function t(u,r){return r?r.l2d(u):u}function b(u){return u.x0shift||0}function d(u){return u.x1shift||0}function e(u){return u.y0shift||0}function w(u){return u.y1shift||0}function y(u,r){return L(u.x1,r)+d(u)-L(u.x0,r)-b(u)}function _(u,r,n){return L(u.y1,n)+w(u)-L(u.y0,n)-e(u)}D.exports={x0:function(u){return u.x0},x1:function(u){return u.x1},y0:function(u){return u.y0},y1:function(u){return u.y1},slope:function(u,r,n){return u.type!=="line"?void 0:_(u,0,n)/y(u,r)},dx:y,dy:_,width:function(u,r){return Math.abs(y(u,r))},height:function(u,r,n){return Math.abs(_(u,0,n))},length:function(u,r,n){return u.type!=="line"?void 0:Math.sqrt(Math.pow(y(u,r),2)+Math.pow(_(u,0,n),2))},xcenter:function(u,r){return t((L(u.x1,r)+d(u)+L(u.x0,r)+b(u))/2,r)},ycenter:function(u,r,n){return t((L(u.y1,n)+w(u)+L(u.y0,n)+e(u))/2,n)}}},8606:function(D,L,t){var b=t(80337),d=t(57891),e=t(93049).extendDeepAll,w=t(13582).overrideAll,y=t(49722),_=t(78032).templatedArray,u=t(64194),r=_("step",{visible:{valType:"boolean",dflt:!0},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string"},value:{valType:"string"},execute:{valType:"boolean",dflt:!0}});D.exports=w(_("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:r,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:e(d({editType:"arraydraw"}),{},{t:{dflt:20}}),xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left"},y:{valType:"number",min:-2,max:3,dflt:0},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},transition:{duration:{valType:"number",min:0,dflt:150},easing:{valType:"enumerated",values:y.transition.easing.values,dflt:"cubic-in-out"}},currentvalue:{visible:{valType:"boolean",dflt:!0},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left"},offset:{valType:"number",dflt:10},prefix:{valType:"string"},suffix:{valType:"string"},font:b({})},font:b({}),activebgcolor:{valType:"color",dflt:u.gripBgActiveColor},bgcolor:{valType:"color",dflt:u.railBgColor},bordercolor:{valType:"color",dflt:u.railBorderColor},borderwidth:{valType:"number",min:0,dflt:u.railBorderWidth},ticklen:{valType:"number",min:0,dflt:u.tickLength},tickcolor:{valType:"color",dflt:u.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:u.minorTickLength}}),"arraydraw","from-root")},64194:function(D){D.exports={name:"sliders",containerClassName:"slider-container",groupClassName:"slider-group",inputAreaClass:"slider-input-area",railRectClass:"slider-rail-rect",railTouchRectClass:"slider-rail-touch-rect",gripRectClass:"slider-grip-rect",tickRectClass:"slider-tick-rect",inputProxyClass:"slider-input-proxy",labelsClass:"slider-labels",labelGroupClass:"slider-label-group",labelClass:"slider-label",currentValueClass:"slider-current-value",railHeight:5,menuIndexAttrName:"slider-active-index",autoMarginIdRoot:"slider-",minWidth:30,minHeight:30,textPadX:40,arrowOffsetX:4,railRadius:2,railWidth:5,railBorder:4,railBorderWidth:1,railBorderColor:"#bec8d9",railBgColor:"#f8fafc",railInset:8,stepInset:10,gripRadius:10,gripWidth:20,gripHeight:20,gripBorder:20,gripBorderWidth:1,gripBorderColor:"#bec8d9",gripBgColor:"#f6f8fa",gripBgActiveColor:"#dbdde0",labelPadding:8,labelOffset:0,tickWidth:1,tickColor:"#333",tickOffset:25,tickLength:7,minorTickOffset:25,minorTickColor:"#333",minorTickLength:4,currentValuePadding:8,currentValueInset:0}},74537:function(D,L,t){var b=t(34809),d=t(59008),e=t(8606),w=t(64194).name,y=e.steps;function _(r,n,l){function o(m,g){return b.coerce(r,n,e,m,g)}for(var s=d(r,n,{name:"steps",handleItemDefaults:u}),c=0,h=0;h0&&(Z=Z.transition().duration(j.transition.duration).ease(j.transition.easing)),Z.attr("transform",_(Q-.5*n.gripWidth,j._dims.currentValueTotalHeight))}}function E(V,j){var $=V._dims;return $.inputAreaStart+n.stepInset+($.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,j))}function I(V,j){var $=V._dims;return Math.min(1,Math.max(0,(j-n.stepInset-$.inputAreaStart)/($.inputAreaLength-2*n.stepInset-2*$.inputAreaStart)))}function B(V,j,$){var ee=$._dims,H=y.ensureSingle(V,"rect",n.railTouchRectClass,function(J){J.call(p,j,V,$).style("pointer-events","all")});H.attr({width:ee.inputAreaLength,height:Math.max(ee.inputAreaWidth,n.tickOffset+$.ticklen+ee.labelHeight)}).call(e.fill,$.bgcolor).attr("opacity",0),w.setTranslate(H,0,ee.currentValueTotalHeight)}function N(V,j){var $=j._dims,ee=$.inputAreaLength-2*n.railInset,H=y.ensureSingle(V,"rect",n.railRectClass);H.attr({width:ee,height:n.railWidth,rx:n.railRadius,ry:n.railRadius,"shape-rendering":"crispEdges"}).call(e.stroke,j.bordercolor).call(e.fill,j.bgcolor).style("stroke-width",j.borderwidth+"px"),w.setTranslate(H,n.railInset,.5*($.inputAreaWidth-n.railWidth)+$.currentValueTotalHeight)}D.exports=function(V){var j=V._context.staticPlot,$=V._fullLayout,ee=function(ae,se){for(var he=ae[n.name],fe=[],ie=0;ie0?[0]:[]);function J(ae){ae._commandObserver&&(ae._commandObserver.remove(),delete ae._commandObserver),d.autoMargin(V,h(ae))}if(H.enter().append("g").classed(n.containerClassName,!0).style("cursor",j?null:"ew-resize"),H.exit().each(function(){b.select(this).selectAll("g."+n.groupClassName).each(J)}).remove(),ee.length!==0){var Q=H.selectAll("g."+n.groupClassName).data(ee,x);Q.enter().append("g").classed(n.groupClassName,!0),Q.exit().each(J).remove();for(var Z=0;Z0||Ot<0){var Xe={left:[-Pt,0],right:[Pt,0],top:[0,-Pt],bottom:[0,Pt]}[T.side];nt.attr("transform",_(Xe[0],Xe[1]))}}}function _e(Ge,tt){Ge.text(tt).on("mouseover.opacity",function(){b.select(this).transition().duration(l.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){b.select(this).transition().duration(l.HIDE_PLACEHOLDER).style("opacity",0)})}if(Me.call(qe,ke),Ie&&(B?Me.on(".opacity",null):(_e(Me,v),N=!0),Me.call(n.makeEditable,{gd:c}).on("edit",function(Ge){S!==void 0?w.call("_guiRestyle",c,A,Ge,S):w.call("_guiRelayout",c,A,Ge)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(qe)}).on("input",function(Ge){this.text(Ge||" ").call(n.positionText,p.x,p.y)}),se)){if(se&&!B){var De=Me.node().getBBox(),Be=De.y+De.height+1.6*me;ke.attr("y",Be)}ie?ke.on(".opacity",null):(_e(ke,he),oe=!0),ke.call(n.makeEditable,{gd:c}).on("edit",function(Ge){w.call("_guiRelayout",c,"title.subtitle.text",Ge)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(qe)}).on("input",function(Ge){this.text(Ge||" ").call(n.positionText,ke.attr("x"),ke.attr("y"))})}return Me.classed("js-placeholder",N),ke&&ke.classed("js-placeholder",oe),f},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}},85389:function(D,L,t){var b=t(80337),d=t(10229),e=t(93049).extendFlat,w=t(13582).overrideAll,y=t(57891),_=t(78032).templatedArray,u=_("button",{visible:{valType:"boolean"},method:{valType:"enumerated",values:["restyle","relayout","animate","update","skip"],dflt:"restyle"},args:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},args2:{valType:"info_array",freeLength:!0,items:[{valType:"any"},{valType:"any"},{valType:"any"}]},label:{valType:"string",dflt:""},execute:{valType:"boolean",dflt:!0}});D.exports=w(_("updatemenu",{_arrayAttrRegexps:[/^updatemenus\[(0|[1-9][0-9]+)\]\.buttons/],visible:{valType:"boolean"},type:{valType:"enumerated",values:["dropdown","buttons"],dflt:"dropdown"},direction:{valType:"enumerated",values:["left","right","up","down"],dflt:"down"},active:{valType:"integer",min:-1,dflt:0},showactive:{valType:"boolean",dflt:!0},buttons:u,x:{valType:"number",min:-2,max:3,dflt:-.05},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"right"},y:{valType:"number",min:-2,max:3,dflt:1},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"top"},pad:e(y({editType:"arraydraw"}),{}),font:b({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:d.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")},71559:function(D){D.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"◄",right:"►",up:"▲",down:"▼"}}},42746:function(D,L,t){var b=t(34809),d=t(59008),e=t(85389),w=t(71559).name,y=e.buttons;function _(r,n,l){function o(s,c){return b.coerce(r,n,e,s,c)}o("visible",d(r,n,{name:"buttons",handleItemDefaults:u}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),b.noneOrAll(r,n,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),b.coerceFont(o,"font",l.font),o("bgcolor",l.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function u(r,n){function l(o,s){return b.coerce(r,n,y,o,s)}l("visible",r.method==="skip"||Array.isArray(r.args))&&(l("method"),l("args"),l("args2"),l("label"),l("execute"))}D.exports=function(r,n){d(r,n,{name:w,handleItemDefaults:_})}},40974:function(D,L,t){var b=t(45568),d=t(44122),e=t(78766),w=t(62203),y=t(34809),_=t(30635),u=t(78032).arrayEditor,r=t(4530).LINE_SPACING,n=t(71559),l=t(21736);function o(E){return E._index}function s(E,I){return+E.attr(n.menuIndexAttrName)===I._index}function c(E,I,B,N,V,j,$,ee){I.active=$,u(E.layout,n.name,I).applyUpdate("active",$),I.type==="buttons"?x(E,N,null,null,I):I.type==="dropdown"&&(V.attr(n.menuIndexAttrName,"-1"),h(E,N,V,j,I),ee||x(E,N,V,j,I))}function h(E,I,B,N,V){var j=y.ensureSingle(I,"g",n.headerClassName,function(Z){Z.style("pointer-events","all")}),$=V._dims,ee=V.active,H=V.buttons[ee]||n.blankHeaderOpts,J={y:V.pad.t,yPad:0,x:V.pad.l,xPad:0,index:0},Q={width:$.headerWidth,height:$.headerHeight};j.call(m,V,H,E).call(M,V,J,Q),y.ensureSingle(I,"text",n.headerArrowClassName,function(Z){Z.attr("text-anchor","end").call(w.font,V.font).text(n.arrowSymbol[V.direction])}).attr({x:$.headerWidth-n.arrowOffsetX+V.pad.l,y:$.headerHeight/2+n.textOffsetY+V.pad.t}),j.on("click",function(){B.call(f,String(s(B,V)?-1:V._index)),x(E,I,B,N,V)}),j.on("mouseover",function(){j.call(v)}),j.on("mouseout",function(){j.call(S,V)}),w.setTranslate(I,$.lx,$.ly)}function x(E,I,B,N,V){B||(B=I).attr("pointer-events","all");var j=function(fe){return+fe.attr(n.menuIndexAttrName)==-1}(B)&&V.type!=="buttons"?[]:V.buttons,$=V.type==="dropdown"?n.dropdownButtonClassName:n.buttonClassName,ee=B.selectAll("g."+$).data(y.filterVisible(j)),H=ee.enter().append("g").classed($,!0),J=ee.exit();V.type==="dropdown"?(H.attr("opacity","0").transition().attr("opacity","1"),J.transition().attr("opacity","0").remove()):J.remove();var Q=0,Z=0,K=V._dims,ae=["up","down"].indexOf(V.direction)!==-1;V.type==="dropdown"&&(ae?Z=K.headerHeight+n.gapButtonHeader:Q=K.headerWidth+n.gapButtonHeader),V.type==="dropdown"&&V.direction==="up"&&(Z=-n.gapButtonHeader+n.gapButton-K.openHeight),V.type==="dropdown"&&V.direction==="left"&&(Q=-n.gapButtonHeader+n.gapButton-K.openWidth);var se={x:K.lx+Q+V.pad.l,y:K.ly+Z+V.pad.t,yPad:n.gapButton,xPad:n.gapButton,index:0},he={l:se.x+V.borderwidth,t:se.y+V.borderwidth};ee.each(function(fe,ie){var oe=b.select(this);oe.call(m,V,fe,E).call(M,V,se),oe.on("click",function(){b.event.defaultPrevented||(fe.execute&&(fe.args2&&V.active===ie?(c(E,V,0,I,B,N,-1),d.executeAPICommand(E,fe.method,fe.args2)):(c(E,V,0,I,B,N,ie),d.executeAPICommand(E,fe.method,fe.args))),E.emit("plotly_buttonclicked",{menu:V,button:fe,active:V.active}))}),oe.on("mouseover",function(){oe.call(v)}),oe.on("mouseout",function(){oe.call(S,V),ee.call(A,V)})}),ee.call(A,V),ae?(he.w=Math.max(K.openWidth,K.headerWidth),he.h=se.y-he.t):(he.w=se.x-he.l,he.h=Math.max(K.openHeight,K.headerHeight)),he.direction=V.direction,N&&(ee.size()?function(fe,ie,oe,le,ge,ye){var me,be,Se,Ee=ge.direction,Ce=Ee==="up"||Ee==="down",Le=ge._dims,Oe=ge.active;if(Ce)for(be=0,Se=0;Se0?[0]:[]);if(V.enter().append("g").classed(n.containerClassName,!0).style("cursor","pointer"),V.exit().each(function(){b.select(this).selectAll("g."+n.headerGroupClassName).each(N)}).remove(),B.length!==0){var j=V.selectAll("g."+n.headerGroupClassName).data(B,o);j.enter().append("g").classed(n.headerGroupClassName,!0);for(var $=y.ensureSingle(V,"g",n.dropdownButtonGroupClassName,function(Z){Z.style("pointer-events","all")}),ee=0;eeM,I=y.barLength+2*y.barPad,B=y.barWidth+2*y.barPad,N=m,V=k+A;V+B>o&&(V=o-B);var j=this.container.selectAll("rect.scrollbar-horizontal").data(E?[0]:[]);j.exit().on(".drag",null).remove(),j.enter().append("rect").classed("scrollbar-horizontal",!0).call(d.fill,y.barColor),E?(this.hbar=j.attr({rx:y.barRadius,ry:y.barRadius,x:N,y:V,width:I,height:B}),this._hbarXMin=N+I/2,this._hbarTranslateMax=M-I):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var $=A>f,ee=y.barWidth+2*y.barPad,H=y.barLength+2*y.barPad,J=m+g,Q=k;J+ee>l&&(J=l-ee);var Z=this.container.selectAll("rect.scrollbar-vertical").data($?[0]:[]);Z.exit().on(".drag",null).remove(),Z.enter().append("rect").classed("scrollbar-vertical",!0).call(d.fill,y.barColor),$?(this.vbar=Z.attr({rx:y.barRadius,ry:y.barRadius,x:J,y:Q,width:ee,height:H}),this._vbarYMin=Q+H/2,this._vbarTranslateMax=f-H):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var K=this.id,ae=s-.5,se=$?c+ee+.5:c+.5,he=h-.5,fe=E?x+B+.5:x+.5,ie=n._topdefs.selectAll("#"+K).data(E||$?[0]:[]);if(ie.exit().remove(),ie.enter().append("clipPath").attr("id",K).append("rect"),E||$?(this._clipRect=ie.select("rect").attr({x:Math.floor(ae),y:Math.floor(he),width:Math.ceil(se)-Math.floor(ae),height:Math.ceil(fe)-Math.floor(he)}),this.container.call(e.setClipUrl,K,this.gd),this.bg.attr({x:m,y:k,width:g,height:A})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(e.setClipUrl,null),delete this._clipRect),E||$){var oe=b.behavior.drag().on("dragstart",function(){b.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(oe);var le=b.behavior.drag().on("dragstart",function(){b.event.sourceEvent.preventDefault(),b.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));E&&this.hbar.on(".drag",null).call(le),$&&this.vbar.on(".drag",null).call(le)}this.setTranslate(u,r)},y.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(e.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)},y.prototype._onBoxDrag=function(){var _=this.translateX,u=this.translateY;this.hbar&&(_-=b.event.dx),this.vbar&&(u-=b.event.dy),this.setTranslate(_,u)},y.prototype._onBoxWheel=function(){var _=this.translateX,u=this.translateY;this.hbar&&(_+=b.event.deltaY),this.vbar&&(u+=b.event.deltaY),this.setTranslate(_,u)},y.prototype._onBarDrag=function(){var _=this.translateX,u=this.translateY;if(this.hbar){var r=_+this._hbarXMin,n=r+this._hbarTranslateMax;_=(w.constrain(b.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var l=u+this._vbarYMin,o=l+this._vbarTranslateMax;u=(w.constrain(b.event.y,l,o)-l)/(o-l)*(this.position.h-this._box.h)}this.setTranslate(_,u)},y.prototype.setTranslate=function(_,u){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(_=w.constrain(_||0,0,r),u=w.constrain(u||0,0,n),this.translateX=_,this.translateY=u,this.container.call(e.setTranslate,this._box.l-this.position.l-_,this._box.t-this.position.t-u),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+_-.5),y:Math.floor(this.position.t+u-.5)}),this.hbar){var l=_/r;this.hbar.call(e.setTranslate,_+l*this._hbarTranslateMax,u)}if(this.vbar){var o=u/n;this.vbar.call(e.setTranslate,_,u+o*this._vbarTranslateMax)}}},4530:function(D){D.exports={FROM_BL:{left:0,center:.5,right:1,bottom:0,middle:.5,top:1},FROM_TL:{left:0,center:.5,right:1,bottom:1,middle:.5,top:0},FROM_BR:{left:1,center:.5,right:0,bottom:0,middle:.5,top:1},LINE_SPACING:1.3,CAP_SHIFT:.7,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},35081:function(D){D.exports={axisRefDescription:function(L,t,b){return["If set to a",L,"axis id (e.g. *"+L+"* or","*"+L+"2*), the `"+L+"` position refers to a",L,"coordinate. If set to *paper*, the `"+L+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+b+"). If set to a",L,"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.,","*"+L+"2 domain* refers to the domain of the second",L," axis and a",L,"position of 0.5 refers to the","point between the",t,"and the",b,"of the domain of the","second",L,"axis."].join(" ")}}},20909:function(D){D.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}},87296:function(D){D.exports={FORMAT_LINK:"https://github.com/d3/d3-format/tree/v1.4.5#d3-format",DATE_FORMAT_LINK:"https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format"}},20726:function(D){D.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}},84770:function(D){D.exports={solid:[[],0],dot:[[.5,1],200],dash:[[.5,1],50],longdash:[[.5,1],10],dashdot:[[.5,.625,.875,1],50],longdashdot:[[.5,.7,.8,1],10]}},49467:function(D){D.exports={circle:"●","circle-open":"○",square:"■","square-open":"□",diamond:"◆","diamond-open":"◇",cross:"+",x:"❌"}},20438:function(D){D.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}},63821:function(D){D.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:24405875e-1,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"−"}},1837:function(D,L){L.CSS_DECLARATIONS=[["image-rendering","optimizeSpeed"],["image-rendering","-moz-crisp-edges"],["image-rendering","-o-crisp-edges"],["image-rendering","-webkit-optimize-contrast"],["image-rendering","optimize-contrast"],["image-rendering","crisp-edges"],["image-rendering","pixelated"]],L.STYLE=L.CSS_DECLARATIONS.map(function(t){return t.join(": ")+"; "}).join("")},62972:function(D,L){L.xmlns="http://www.w3.org/2000/xmlns/",L.svg="http://www.w3.org/2000/svg",L.xlink="http://www.w3.org/1999/xlink",L.svgAttrs={xmlns:L.svg,"xmlns:xlink":L.xlink}},17430:function(D,L,t){L.version=t(29697).version,t(71116),t(6713);for(var b=t(33626),d=L.register=b.register,e=t(90742),w=Object.keys(e),y=0;y",""," ",""," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}},32546:function(D,L){L.isLeftAnchor=function(t){return t.xanchor==="left"||t.xanchor==="auto"&&t.x<=.3333333333333333},L.isCenterAnchor=function(t){return t.xanchor==="center"||t.xanchor==="auto"&&t.x>.3333333333333333&&t.x<.6666666666666666},L.isRightAnchor=function(t){return t.xanchor==="right"||t.xanchor==="auto"&&t.x>=.6666666666666666},L.isTopAnchor=function(t){return t.yanchor==="top"||t.yanchor==="auto"&&t.y>=.6666666666666666},L.isMiddleAnchor=function(t){return t.yanchor==="middle"||t.yanchor==="auto"&&t.y>.3333333333333333&&t.y<.6666666666666666},L.isBottomAnchor=function(t){return t.yanchor==="bottom"||t.yanchor==="auto"&&t.y<=.3333333333333333}},44313:function(D,L,t){var b=t(98953),d=b.mod,e=b.modHalf,w=Math.PI,y=2*w;function _(l){return Math.abs(l[1]-l[0])>y-1e-14}function u(l,o){return e(o-l,y)}function r(l,o){if(_(o))return!0;var s,c;o[0](c=d(c,y))&&(c+=y);var h=d(l,y),x=h+y;return h>=s&&h<=c||x>=s&&x<=c}function n(l,o,s,c,h,x,m){h=h||0,x=x||0;var g,k,A,v,S,T=_([s,c]);function p(I,B){return[I*Math.cos(B)+h,x-I*Math.sin(B)]}T?(g=0,k=w,A=y):s=h&&l<=x);var h,x},pathArc:function(l,o,s,c,h){return n(null,l,o,s,c,h,0)},pathSector:function(l,o,s,c,h){return n(null,l,o,s,c,h,1)},pathAnnulus:function(l,o,s,c,h,x){return n(l,o,s,c,h,x,1)}}},87800:function(D,L,t){var b=t(93229).decode,d=t(56174),e=Array.isArray,w=ArrayBuffer,y=DataView;function _(o){return w.isView(o)&&!(o instanceof y)}function u(o){return e(o)||_(o)}L.isTypedArray=_,L.isArrayOrTypedArray=u,L.isArray1D=function(o){return!u(o[0])},L.ensureArray=function(o,s){return e(o)||(o=[]),o.length=s,o};var r={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};function n(o){return o.constructor===ArrayBuffer}function l(o,s,c){if(u(o)){if(u(o[0])){for(var h=c,x=0;xk.max?m.set(g):m.set(+x)}},integer:{coerceFunction:function(x,m,g,k){(k.extras||[]).indexOf(x)===-1?(s(x)&&(x=c(x)),x%1||!b(x)||k.min!==void 0&&xk.max?m.set(g):m.set(+x)):m.set(x)}},string:{coerceFunction:function(x,m,g,k){if(typeof x!="string"){var A=typeof x=="number";k.strict!==!0&&A?m.set(String(x)):m.set(g)}else k.noBlank&&!x?m.set(g):m.set(x)}},color:{coerceFunction:function(x,m,g){s(x)&&(x=c(x)),d(x).isValid()?m.set(x):m.set(g)}},colorlist:{coerceFunction:function(x,m,g){Array.isArray(x)&&x.length&&x.every(function(k){return d(k).isValid()})?m.set(x):m.set(g)}},colorscale:{coerceFunction:function(x,m,g){m.set(y.get(x,g))}},angle:{coerceFunction:function(x,m,g){s(x)&&(x=c(x)),x==="auto"?m.set("auto"):b(x)?m.set(l(+x,360)):m.set(g)}},subplotid:{coerceFunction:function(x,m,g,k){var A=k.regex||n(g);typeof x=="string"&&A.test(x)?m.set(x):m.set(g)},validateFunction:function(x,m){var g=m.dflt;return x===g||typeof x=="string"&&!!n(g).test(x)}},flaglist:{coerceFunction:function(x,m,g,k){if((k.extras||[]).indexOf(x)===-1)if(typeof x=="string"){for(var A=x.split("+"),v=0;v=b&&j<=d?j:r}if(typeof j!="string"&&typeof j!="number")return r;j=String(j);var Q=A($),Z=j.charAt(0);!Q||Z!=="G"&&Z!=="g"||(j=j.substr(1),$="");var K=Q&&$.substr(0,7)==="chinese",ae=j.match(K?g:m);if(!ae)return r;var se=ae[1],he=ae[3]||"1",fe=Number(ae[5]||1),ie=Number(ae[7]||0),oe=Number(ae[9]||0),le=Number(ae[11]||0);if(Q){if(se.length===2)return r;var ge;se=Number(se);try{var ye=h.getComponentMethod("calendars","getCal")($);if(K){var me=he.charAt(he.length-1)==="i";he=parseInt(he,10),ge=ye.newDate(se,ye.toMonthIndex(se,he,me),fe)}else ge=ye.newDate(se,Number(he),fe)}catch{return r}return ge?(ge.toJD()-c)*n+ie*l+oe*o+le*s:r}se=se.length===2?(Number(se)+2e3-k)%100+k:Number(se),he-=1;var be=new Date(Date.UTC(2e3,he,fe,ie,oe));return be.setUTCFullYear(se),be.getUTCMonth()!==he||be.getUTCDate()!==fe?r:be.getTime()+le*s},b=L.MIN_MS=L.dateTime2ms("-9999"),d=L.MAX_MS=L.dateTime2ms("9999-12-31 23:59:59.9999"),L.isDateTime=function(j,$){return L.dateTime2ms(j,$)!==r};var S=90*n,T=3*l,p=5*o;function M(j,$,ee,H,J){if(($||ee||H||J)&&(j+=" "+v($,2)+":"+v(ee,2),(H||J)&&(j+=":"+v(H,2),J))){for(var Q=4;J%10==0;)Q-=1,J/=10;j+="."+v(J,Q)}return j}L.ms2DateTime=function(j,$,ee){if(typeof j!="number"||!(j>=b&&j<=d))return r;$||($=0);var H,J,Q,Z,K,ae,se=Math.floor(10*_(j+.05,1)),he=Math.round(j-se/10);if(A(ee)){var fe=Math.floor(he/n)+c,ie=Math.floor(_(j,n));try{H=h.getComponentMethod("calendars","getCal")(ee).fromJD(fe).formatDate("yyyy-mm-dd")}catch{H=x("G%Y-%m-%d")(new Date(he))}if(H.charAt(0)==="-")for(;H.length<11;)H="-0"+H.substr(1);else for(;H.length<10;)H="0"+H;J=$=b+n&&j<=d-n))return r;var $=Math.floor(10*_(j+.05,1)),ee=new Date(Math.round(j-$/10));return M(e("%Y-%m-%d")(ee),ee.getHours(),ee.getMinutes(),ee.getSeconds(),10*ee.getUTCMilliseconds()+$)},L.cleanDate=function(j,$,ee){if(j===r)return $;if(L.isJSDate(j)||typeof j=="number"&&isFinite(j)){if(A(ee))return y.error("JS Dates and milliseconds are incompatible with world calendars",j),$;if(!(j=L.ms2DateTimeLocal(+j))&&$!==void 0)return $}else if(!L.isDateTime(j,ee))return y.error("unrecognized date",j),$;return j};var f=/%\d?f/g,E=/%h/g,I={1:"1",2:"1",3:"2",4:"2"};function B(j,$,ee,H){j=j.replace(f,function(Q){var Z=Math.min(+Q.charAt(1)||6,6);return($/1e3%1+2).toFixed(Z).substr(2).replace(/0+$/,"")||"0"});var J=new Date(Math.floor($+.05));if(j=j.replace(E,function(){return I[ee("%q")(J)]}),A(H))try{j=h.getComponentMethod("calendars","worldCalFmt")(j,$,H)}catch{return"Invalid"}return ee(j)(J)}var N=[59,59.9,59.99,59.999,59.9999];L.formatDate=function(j,$,ee,H,J,Q){if(J=A(J)&&J,!$)if(ee==="y")$=Q.year;else if(ee==="m")$=Q.month;else{if(ee!=="d")return function(Z,K){var ae=_(Z+.05,n),se=v(Math.floor(ae/l),2)+":"+v(_(Math.floor(ae/o),60),2);if(K!=="M"){w(K)||(K=0);var he=(100+Math.min(_(Z/s,60),N[K])).toFixed(K).substr(1);K>0&&(he=he.replace(/0+$/,"").replace(/[\.]$/,"")),se+=":"+he}return se}(j,ee)+` `+B(Q.dayMonthYear,j,H,J);$=Q.dayMonth+` -`+Q.year}return B($,j,H,J)};var V=3*n;L.incrementMonth=function(j,$,ee){ee=A(ee)&ⅇvar H=_(j,n);if(j=Math.round(j-H),ee)try{var J=Math.round(j/n)+c,Q=h.getComponentMethod("calendars","getCal")(ee),Z=Q.fromJD(J);return $%12?Q.add(Z,$,"m"):Q.add(Z,$/12,"y"),(Z.toJD()-c)*n+H}catch{y.error("invalid ms "+j+" in calendar "+ee)}var K=new Date(j+V);return K.setUTCMonth(K.getUTCMonth()+$)+H-V},L.findExactDates=function(j,$){for(var ee,H,J=0,Q=0,Z=0,K=0,ae=A($)&&h.getComponentMethod("calendars","getCal")($),se=0;se0&&M[f+1][0]<0)return f;return null}switch(x=S==="RUS"||S==="FJI"?function(M){var f;if(p(M)===null)f=M;else for(f=new Array(M.length),k=0;kf?E[I++]=[M[k][0]+360,M[k][1]]:k===f?(E[I++]=M[k],E[I++]=[M[k][0],-90]):E[I++]=M[k];var B=l.tester(E);B.pts.pop(),T.push(B)}:function(M){T.push(l.tester(M))},A.type){case"MultiPolygon":for(m=0;m0?B.properties.ct=function(N){var V,j=N.geometry;if(j.type==="MultiPolygon")for(var $=j.coordinates,ee=0,H=0;H<$.length;H++){var J={type:"Polygon",coordinates:$[H]},Q=e(J);Q>ee&&(ee=Q,V=J)}else V=j;return w(V).geometry.coordinates}(B):B.properties.ct=[NaN,NaN],E.fIn=M,E.fOut=B,A.push(B)}else u.log(["Location",E.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete k[f]}switch(m.type){case"FeatureCollection":var T=m.features;for(g=0;g100?(clearInterval(f),p("Unexpected error while fetching from "+S)):void M++},50)})}for(var A=0;A0&&(w.push(y),y=[])}return y.length>0&&w.push(y),w},L.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},L.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var e=new Array(d.length),w=0;w1||T<0||T>1?null:{x:u+x*T,y:r+k*T}}function _(u,r,n,l,o){var s=l*u+o*r;if(s<0)return l*l+o*o;if(s>n){var c=l-u,h=o-r;return c*c+h*h}var x=l*r-o*u;return x*x/n}L.segmentsIntersect=y,L.segmentDistance=function(u,r,n,l,o,s,c,h){if(y(u,r,n,l,o,s,c,h))return 0;var x=n-u,m=l-r,g=c-o,k=h-s,A=x*x+m*m,v=g*g+k*k,S=Math.min(_(x,m,A,o-u,s-r),_(x,m,A,c-u,h-r),_(g,k,v,u-o,r-s),_(g,k,v,n-o,l-s));return Math.sqrt(S)},L.getTextLocation=function(u,r,n,l){if(u===d&&l===e||(b={},d=u,e=l),b[n])return b[n];var o=u.getPointAtLength(w(n-l/2,r)),s=u.getPointAtLength(w(n+l/2,r)),c=Math.atan((s.y-o.y)/(s.x-o.x)),h=u.getPointAtLength(w(n,r)),x={x:(4*h.x+o.x+s.x)/6,y:(4*h.y+o.y+s.y)/6,theta:c};return b[n]=x,x},L.clearLocationCache=function(){d=null},L.getVisibleSegment=function(u,r,n){var l,o,s=r.left,c=r.right,h=r.top,x=r.bottom,m=0,g=u.getTotalLength(),k=g;function A(S){var T=u.getPointAtLength(S);S===0?l=T:S===g&&(o=T);var p=T.xc?T.x-c:0,M=T.yx?T.y-x:0;return Math.sqrt(p*p+M*M)}for(var v=A(m);v;){if((m+=v+n)>k)return;v=A(m)}for(v=A(k);v;){if(m>(k-=v+n))return;v=A(k)}return{min:m,max:k,len:k-m,total:g,isClosed:m===0&&k===g&&Math.abs(l.x-o.x)<.1&&Math.abs(l.y-o.y)<.1}},L.findPointOnPath=function(u,r,n,l){for(var o,s,c,h=(l=l||{}).pathLength||u.getTotalLength(),x=l.tolerance||.001,m=l.iterationLimit||30,g=u.getPointAtLength(0)[n]>u.getPointAtLength(h)[n]?-1:1,k=0,A=0,v=h;k0?v=o:A=o,k++}return s}},46998:function(D,L,t){var b=t(10721),d=t(65657),e=t(162),w=t(88856),y=t(10229).defaultLine,_=t(87800).isArrayOrTypedArray,u=e(y);function r(o,s){var c=o;return c[3]*=s,c}function n(o){if(b(o))return u;var s=e(o);return s.length?s:u}function l(o){return b(o)?o:1}D.exports={formatColor:function(o,s,c){var h=o.color;h&&h._inputArray&&(h=h._inputArray);var x,m,g,k,A,v=_(h),S=_(s),T=w.extractOpts(o),p=[];if(x=T.colorscale!==void 0?w.makeColorScaleFuncFromTrace(o):n,m=v?function(f,E){return f[E]===void 0?u:e(x(f[E]))}:n,g=S?function(f,E){return f[E]===void 0?1:l(f[E])}:l,v||S)for(var M=0;M1?(b*L+b*t)/b:L+t,e=String(d).length;if(e>16){var w=String(t).length;if(e>=String(L).length+w){var y=parseFloat(d).toPrecision(12);y.indexOf("e+")===-1&&(d=+y)}}return d}},34809:function(D,L,t){var b=t(45568),d=t(42696).aL,e=t(36464).GP,w=t(10721),y=t(63821),_=y.FP_SAFE,u=-_,r=y.BADNUM,n=D.exports={};n.adjustFormat=function(ie){return!ie||/^\d[.]\df/.test(ie)||/[.]\d%/.test(ie)?ie:ie==="0.f"?"~f":/^\d%/.test(ie)?"~%":/^\ds/.test(ie)?"~s":!/^[~,.0$]/.test(ie)&&/[&fps]/.test(ie)?"~"+ie:ie};var l={};n.warnBadFormat=function(ie){var oe=String(ie);l[oe]||(l[oe]=1,n.warn('encountered bad format: "'+oe+'"'))},n.noFormat=function(ie){return String(ie)},n.numberFormat=function(ie){var oe;try{oe=e(n.adjustFormat(ie))}catch{return n.warnBadFormat(ie),n.noFormat}return oe},n.nestedProperty=t(35632),n.keyedContainer=t(34967),n.relativeAttr=t(82047),n.isPlainObject=t(56174),n.toLogRange=t(8083),n.relinkPrivateKeys=t(80428);var o=t(87800);n.isArrayBuffer=o.isArrayBuffer,n.isTypedArray=o.isTypedArray,n.isArrayOrTypedArray=o.isArrayOrTypedArray,n.isArray1D=o.isArray1D,n.ensureArray=o.ensureArray,n.concat=o.concat,n.maxRowLength=o.maxRowLength,n.minRowLength=o.minRowLength;var s=t(98953);n.mod=s.mod,n.modHalf=s.modHalf;var c=t(34220);n.valObjectMeta=c.valObjectMeta,n.coerce=c.coerce,n.coerce2=c.coerce2,n.coerceFont=c.coerceFont,n.coercePattern=c.coercePattern,n.coerceHoverinfo=c.coerceHoverinfo,n.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,n.validate=c.validate;var h=t(92596);n.dateTime2ms=h.dateTime2ms,n.isDateTime=h.isDateTime,n.ms2DateTime=h.ms2DateTime,n.ms2DateTimeLocal=h.ms2DateTimeLocal,n.cleanDate=h.cleanDate,n.isJSDate=h.isJSDate,n.formatDate=h.formatDate,n.incrementMonth=h.incrementMonth,n.dateTick0=h.dateTick0,n.dfltRange=h.dfltRange,n.findExactDates=h.findExactDates,n.MIN_MS=h.MIN_MS,n.MAX_MS=h.MAX_MS;var x=t(98813);n.findBin=x.findBin,n.sorterAsc=x.sorterAsc,n.sorterDes=x.sorterDes,n.distinctVals=x.distinctVals,n.roundUp=x.roundUp,n.sort=x.sort,n.findIndexOfMin=x.findIndexOfMin,n.sortObjectKeys=t(62994);var m=t(89258);n.aggNums=m.aggNums,n.len=m.len,n.mean=m.mean,n.geometricMean=m.geometricMean,n.median=m.median,n.midRange=m.midRange,n.variance=m.variance,n.stdev=m.stdev,n.interp=m.interp;var g=t(15236);n.init2dArray=g.init2dArray,n.transposeRagged=g.transposeRagged,n.dot=g.dot,n.translationMatrix=g.translationMatrix,n.rotationMatrix=g.rotationMatrix,n.rotationXYMatrix=g.rotationXYMatrix,n.apply3DTransform=g.apply3DTransform,n.apply2DTransform=g.apply2DTransform,n.apply2DTransform2=g.apply2DTransform2,n.convertCssMatrix=g.convertCssMatrix,n.inverseTransformMatrix=g.inverseTransformMatrix;var k=t(44313);n.deg2rad=k.deg2rad,n.rad2deg=k.rad2deg,n.angleDelta=k.angleDelta,n.angleDist=k.angleDist,n.isFullCircle=k.isFullCircle,n.isAngleInsideSector=k.isAngleInsideSector,n.isPtInsideSector=k.isPtInsideSector,n.pathArc=k.pathArc,n.pathSector=k.pathSector,n.pathAnnulus=k.pathAnnulus;var A=t(32546);n.isLeftAnchor=A.isLeftAnchor,n.isCenterAnchor=A.isCenterAnchor,n.isRightAnchor=A.isRightAnchor,n.isTopAnchor=A.isTopAnchor,n.isMiddleAnchor=A.isMiddleAnchor,n.isBottomAnchor=A.isBottomAnchor;var v=t(3447);n.segmentsIntersect=v.segmentsIntersect,n.segmentDistance=v.segmentDistance,n.getTextLocation=v.getTextLocation,n.clearLocationCache=v.clearLocationCache,n.getVisibleSegment=v.getVisibleSegment,n.findPointOnPath=v.findPointOnPath;var S=t(93049);n.extendFlat=S.extendFlat,n.extendDeep=S.extendDeep,n.extendDeepAll=S.extendDeepAll,n.extendDeepNoArrays=S.extendDeepNoArrays;var T=t(48636);n.log=T.log,n.warn=T.warn,n.error=T.error;var p=t(90694);n.counterRegex=p.counter;var M=t(64025);n.throttle=M.throttle,n.throttleDone=M.done,n.clearThrottle=M.clear;var f=t(95425);function E(ie){var oe={};for(var le in ie)for(var ge=ie[le],ye=0;ye_||ie=oe)&&w(ie)&&ie>=0&&ie%1==0},n.noop=t(4969),n.identity=t(29527),n.repeat=function(ie,oe){for(var le=new Array(oe),ge=0;gele?Math.max(le,Math.min(oe,ie)):Math.max(oe,Math.min(le,ie))},n.bBoxIntersect=function(ie,oe,le){return le=le||0,ie.left<=oe.right+le&&oe.left<=ie.right+le&&ie.top<=oe.bottom+le&&oe.top<=ie.bottom+le},n.simpleMap=function(ie,oe,le,ge,ye){for(var me=ie.length,be=new Array(me),Se=0;Se=Math.pow(2,le)?ye>10?(n.warn("randstr failed uniqueness"),Ee):ie(oe,le,ge,(ye||0)+1):Ee},n.OptionControl=function(ie,oe){ie||(ie={}),oe||(oe="opt");var le={optionList:[],_newoption:function(ge){ge[oe]=ie,le[ge.name]=ge,le.optionList.push(ge)}};return le["_"+oe]=ie,le},n.smooth=function(ie,oe){if((oe=Math.round(oe)||0)<2)return ie;var le,ge,ye,me,be=ie.length,Se=2*be,Ee=2*oe-1,Ce=new Array(Ee),Le=new Array(be);for(le=0;le=Se&&(ye-=Se*Math.floor(ye/Se)),ye<0?ye=-1-ye:ye>=be&&(ye=Se-1-ye),me+=ie[ye]*Ce[ge];Le[le]=me}return Le},n.syncOrAsync=function(ie,oe,le){var ge;function ye(){return n.syncOrAsync(ie,oe,le)}for(;ie.length;)if((ge=(0,ie.splice(0,1)[0])(oe))&&ge.then)return ge.then(ye);return le&&le(oe)},n.stripTrailingSlash=function(ie){return ie.substr(-1)==="/"?ie.substr(0,ie.length-1):ie},n.noneOrAll=function(ie,oe,le){if(ie){var ge,ye=!1,me=!0;for(ge=0;ge0?ye:0})},n.fillArray=function(ie,oe,le,ge){if(ge=ge||n.identity,n.isArrayOrTypedArray(ie))for(var ye=0;ye1?ye+be[1]:"";if(me&&(be.length>1||Se.length>4||le))for(;ge.test(Se);)Se=Se.replace(ge,"$1"+me+"$2");return Se+Ee},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var ee=/^\w*$/;n.templateString=function(ie,oe){var le={};return ie.replace(n.TEMPLATE_STRING_REGEX,function(ge,ye){var me;return ee.test(ye)?me=oe[ye]:(le[ye]=le[ye]||n.nestedProperty(oe,ye).get,me=le[ye]()),n.isValidTextValue(me)?me:""})};var H={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=function(){return ae.apply(H,arguments)};var J={max:10,count:0,name:"texttemplate"};n.texttemplateString=function(){return ae.apply(J,arguments)};var Q=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,Z={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=function(){return ae.apply(Z,arguments)};var K=/^[:|\|]/;function ae(ie,oe,le){var ge=this,ye=arguments;oe||(oe={});var me={};return ie.replace(n.TEMPLATE_STRING_REGEX,function(be,Se,Ee){var Ce=Se==="_xother"||Se==="_yother",Le=Se==="_xother_"||Se==="_yother_",Oe=Se==="xother_"||Se==="yother_",We=Se==="xother"||Se==="yother"||Ce||Oe||Le,Ie=Se;(Ce||Le)&&(Ie=Ie.substring(1)),(Oe||Le)&&(Ie=Ie.substring(0,Ie.length-1));var Ve,Pe,de,Me=null,ke=null;if(ge.parseMultDiv){var He=function(Ye){var _e=Ye.match(Q);return _e?{key:_e[1],op:_e[2],number:Number(_e[3])}:{key:Ye,op:null,number:null}}(Ie);Ie=He.key,Me=He.op,ke=He.number}if(We){if((Ve=oe[Ie])===void 0)return""}else for(de=3;de=48&&be<=57,Ce=Se>=48&&Se<=57;if(Ee&&(ge=10*ge+be-48),Ce&&(ye=10*ye+Se-48),!Ee||!Ce){if(ge!==ye)return ge-ye;if(be!==Se)return be-Se}}return ye-ge};var se=2e9;n.seedPseudoRandom=function(){se=2e9},n.pseudoRandom=function(){var ie=se;return se=(69069*se+1)%4294967296,Math.abs(se-ie)<429496729?n.pseudoRandom():se/4294967296},n.fillText=function(ie,oe,le){var ge=Array.isArray(le)?function(be){le.push(be)}:function(be){le.text=be},ye=n.extractOption(ie,oe,"htx","hovertext");if(n.isValidTextValue(ye))return ge(ye);var me=n.extractOption(ie,oe,"tx","text");return n.isValidTextValue(me)?ge(me):void 0},n.isValidTextValue=function(ie){return ie||ie===0},n.formatPercent=function(ie,oe){oe=oe||0;for(var le=(Math.round(100*ie*Math.pow(10,oe))*Math.pow(.1,oe)).toFixed(oe)+"%",ge=0;ge1&&(Ce=1):Ce=0,n.strTranslate(ye-Ce*(le+be),me-Ce*(ge+Se))+n.strScale(Ce)+(Ee?"rotate("+Ee+(oe?"":" "+le+" "+ge)+")":"")},n.setTransormAndDisplay=function(ie,oe){ie.attr("transform",n.getTextTransform(oe)),ie.style("display",oe.scale?null:"none")},n.ensureUniformFontSize=function(ie,oe){var le=n.extendFlat({},oe);return le.size=Math.max(oe.size,ie._fullLayout.uniformtext.minsize||0),le},n.join2=function(ie,oe,le){var ge=ie.length;return ge>1?ie.slice(0,-1).join(oe)+le+ie[ge-1]:ie.join(oe)},n.bigFont=function(ie){return Math.round(1.2*ie)};var he=n.getFirefoxVersion(),fe=he!==null&&he<86;n.getPositionFromD3Event=function(){return fe?[b.event.layerX,b.event.layerY]:[b.event.offsetX,b.event.offsetY]}},56174:function(D){D.exports=function(L){return window&&window.process&&window.process.versions?Object.prototype.toString.call(L)==="[object Object]":Object.prototype.toString.call(L)==="[object Object]"&&Object.getPrototypeOf(L).hasOwnProperty("hasOwnProperty")}},34967:function(D,L,t){var b=t(35632),d=/^\w*$/;D.exports=function(e,w,y,_){var u,r,n;y=y||"name",_=_||"value";var l={};w&&w.length?(n=b(e,w),r=n.get()):r=e,w=w||"";var o={};if(r)for(u=0;u2)return l[x]=2|l[x],c.set(h,null);if(s){for(u=x;u1){var y=["LOG:"];for(w=0;w1){var _=[];for(w=0;w"),"long")}},e.warn=function(){var w;if(b.logging>0){var y=["WARN:"];for(w=0;w0){var _=[];for(w=0;w"),"stick")}},e.error=function(){var w;if(b.logging>0){var y=["ERROR:"];for(w=0;w0){var _=[];for(w=0;w"),"stick")}}},75944:function(D,L,t){var b=t(45568);D.exports=function(d,e,w){var y=d.selectAll("g."+w.replace(/\s/g,".")).data(e,function(u){return u[0].trace.uid});y.exit().remove(),y.enter().append("g").attr("class",w),y.order();var _=d.classed("rangeplot")?"nodeRangePlot3":"node3";return y.each(function(u){u[0][_]=b.select(this)}),y}},15236:function(D,L,t){var b=t(11191);L.init2dArray=function(d,e){for(var w=new Array(d),y=0;yt/2?L-Math.round(L/t)*t:L}}},35632:function(D,L,t){var b=t(10721),d=t(87800).isArrayOrTypedArray;function e(l,o){return function(){var s,c,h,x,m,g=l;for(x=0;x/g),c=0;cr||k===d||kl||m&&o(x))}:function(x,m){var g=x[0],k=x[1];if(g===d||gr||k===d||kl)return!1;var A,v,S,T,p,M=_.length,f=_[0][0],E=_[0][1],I=0;for(A=1;AMath.max(v,f)||k>Math.max(S,E)))if(kc||Math.abs(b(n,x))>u)return!0;return!1},e.filter=function(w,y){var _=[w[0]],u=0,r=0;function n(l){w.push(l);var o=_.length,s=u;_.splice(r+1);for(var c=s+1;c1&&n(w.pop()),{addPt:n,raw:w,filtered:_}}},22459:function(D,L,t){var b=t(97464),d=t(81330);D.exports=function(e,w,y){var _=e._fullLayout,u=!0;return _._glcanvas.each(function(r){if(r.regl)r.regl.preloadCachedCode(y);else if(!r.pick||_._has("parcoords")){try{r.regl=d({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||t.g.devicePixelRatio,extensions:w||[],cachedCode:y||{}})}catch{u=!1}r.regl||(u=!1),u&&this.addEventListener("webglcontextlost",function(n){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:n,layer:r.key})},!1)}}),u||b({container:_._glcontainer.node()}),u}},32521:function(D,L,t){var b=t(10721),d=t(13087);D.exports=function(e){var w;if(typeof(w=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var o;return typeof navigator<"u"&&(o=navigator.userAgent),o&&o.headers&&typeof o.headers["user-agent"]=="string"&&(o=o.headers["user-agent"]),o}())!="string")return!0;var y=d({ua:{headers:{"user-agent":w}},tablet:!0,featureDetect:!1});if(!y){for(var _=w.split(" "),u=1;u<_.length;u++)if(_[u].indexOf("Safari")!==-1)for(var r=u-1;r>-1;r--){var n=_[r];if(n.substr(0,8)==="Version/"){var l=n.substr(8).split(".")[0];if(b(l)&&(l=+l),l>=13)return!0}}}return y}},36539:function(D){D.exports=function(L,t){if(t instanceof RegExp){for(var b=t.toString(),d=0;dd.queueLength&&(w.undoQueue.queue.shift(),w.undoQueue.index--))},startSequence:function(w){w.undoQueue=w.undoQueue||{index:0,queue:[],sequence:!1},w.undoQueue.sequence=!0,w.undoQueue.beginSequence=!0},stopSequence:function(w){w.undoQueue=w.undoQueue||{index:0,queue:[],sequence:!1},w.undoQueue.sequence=!1,w.undoQueue.beginSequence=!1},undo:function(w){var y,_;if(!(w.undoQueue===void 0||isNaN(w.undoQueue.index)||w.undoQueue.index<=0)){for(w.undoQueue.index--,y=w.undoQueue.queue[w.undoQueue.index],w.undoQueue.inSequence=!0,_=0;_=w.undoQueue.queue.length)){for(y=w.undoQueue.queue[w.undoQueue.index],w.undoQueue.inSequence=!0,_=0;_o}function n(l,o){return l>=o}L.findBin=function(l,o,s){if(b(o.start))return s?Math.ceil((l-o.start)/o.size-y)-1:Math.floor((l-o.start)/o.size+y);var c,h,x=0,m=o.length,g=0,k=m>1?(o[m-1]-o[0])/(m-1):1;for(h=k>=0?s?_:u:s?n:r,l+=k*y*(s?-1:1)*(k>=0?1:-1);x90&&d.log("Long binary search..."),x-1},L.sorterAsc=function(l,o){return l-o},L.sorterDes=function(l,o){return o-l},L.distinctVals=function(l){var o,s=l.slice();for(s.sort(L.sorterAsc),o=s.length-1;o>-1&&s[o]===w;o--);for(var c,h=s[o]-s[0]||1,x=h/(o||1)/1e4,m=[],g=0;g<=o;g++){var k=s[g],A=k-c;c===void 0?(m.push(k),c=k):A>x&&(h=Math.min(h,A),m.push(k),c=k)}return{vals:m,minDiff:h}},L.roundUp=function(l,o,s){for(var c,h=0,x=o.length-1,m=0,g=s?0:1,k=s?1:0,A=s?Math.ceil:Math.floor;h0&&(c=1),s&&c)return l.sort(o)}return c?l:l.reverse()},L.findIndexOfMin=function(l,o){o=o||e;for(var s,c=1/0,h=0;hy.length)&&(_=y.length),b(w)||(w=!1),d(y[0])){for(r=new Array(_),u=0;u<_;u++)r[u]=L.aggNums(e,w,y[u]);y=r}for(u=0;u<_;u++)b(w)?b(y[u])&&(w=e(+w,+y[u])):w=y[u];return w},L.len=function(e){return L.aggNums(function(w){return w+1},0,e)},L.mean=function(e,w){return w||(w=L.len(e)),L.aggNums(function(y,_){return y+_},0,e)/w},L.geometricMean=function(e,w){return w||(w=L.len(e)),Math.pow(L.aggNums(function(y,_){return y*_},1,e),1/w)},L.midRange=function(e){if(e!==void 0&&e.length!==0)return(L.aggNums(Math.max,null,e)+L.aggNums(Math.min,null,e))/2},L.variance=function(e,w,y){return w||(w=L.len(e)),b(y)||(y=L.mean(e,w)),L.aggNums(function(_,u){return _+Math.pow(u-y,2)},0,e)/w},L.stdev=function(e,w,y){return Math.sqrt(L.variance(e,w,y))},L.median=function(e){var w=e.slice().sort();return L.interp(w,.5)},L.interp=function(e,w){if(!b(w))throw"n should be a finite number";if((w=w*e.length-.5)<0)return e[0];if(w>e.length-1)return e[e.length-1];var y=w%1;return y*e[Math.ceil(w)]+(1-y)*e[Math.floor(w)]}},55010:function(D,L,t){var b=t(162);D.exports=function(d){return d?b(d):[0,0,0,1]}},95544:function(D,L,t){var b=t(1837),d=t(62203),e=t(34809),w=null;D.exports=function(){if(w!==null)return w;w=!1;var y=e.isIE()||e.isSafari()||e.isIOS();if(window.navigator.userAgent&&!y){var _=Array.from(b.CSS_DECLARATIONS).reverse(),u=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof u=="function")w=_.some(function(l){return u.apply(null,l)});else{var r=d.tester.append("image").attr("style",b.STYLE),n=window.getComputedStyle(r.node()).imageRendering;w=_.some(function(l){var o=l[1];return n===o||n===o.toLowerCase()}),r.remove()}}return w}},30635:function(D,L,t){var b=t(45568),d=t(34809),e=d.strTranslate,w=t(62972),y=t(4530).LINE_SPACING,_=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;L.convertToTspans=function(j,$,ee){var H=j.text(),J=!j.attr("data-notex")&&$&&$._context.typesetMath&&typeof MathJax<"u"&&H.match(_),Q=b.select(j.node().parentNode);if(!Q.empty()){var Z=j.attr("class")?j.attr("class").split(" ")[0]:"text";return Z+="-math",Q.selectAll("svg."+Z).remove(),Q.selectAll("g."+Z+"-group").remove(),j.style("display",null).attr({"data-unformatted":H,"data-math":"N"}),J?($&&$._promises||[]).push(new Promise(function(ae){j.style("display","none");var se=parseInt(j.node().style.fontSize,10),he={fontSize:se};(function(fe,ie,oe){var le,ge,ye,me,be=parseInt((MathJax.version||"").split(".")[0]);if(be===2||be===3){var Se=function(){var Ce="math-output-"+d.randstr({},64),Le=(me=b.select("body").append("div").attr({id:Ce}).style({visibility:"hidden",position:"absolute","font-size":ie.fontSize+"px"}).text(fe.replace(u,"\\lt ").replace(r,"\\gt "))).node();return be===2?MathJax.Hub.Typeset(Le):MathJax.typeset([Le])},Ee=function(){var Ce=me.select(be===2?".MathJax_SVG":".MathJax"),Le=!Ce.empty()&&me.select("svg").node();if(Le){var Oe,We=Le.getBoundingClientRect();Oe=be===2?b.select("body").select("#MathJax_SVG_glyphs"):Ce.select("defs"),oe(Ce,Oe,We)}else d.log("There was an error in the tex syntax.",fe),oe();me.remove()};be===2?MathJax.Hub.Queue(function(){return ge=d.extendDeepAll({},MathJax.Hub.config),ye=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},function(){if((le=MathJax.Hub.config.menuSettings.renderer)!=="SVG")return MathJax.Hub.setRenderer("SVG")},Se,Ee,function(){if(le!=="SVG")return MathJax.Hub.setRenderer(le)},function(){return ye!==void 0&&(MathJax.Hub.processSectionDelay=ye),MathJax.Hub.Config(ge)}):be===3&&(ge=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n,(le=MathJax.config.startup.output)!=="svg"&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Se(),Ee(),le!=="svg"&&(MathJax.config.startup.output=le),MathJax.config=ge}))}else d.warn("No MathJax version:",MathJax.version)})(J[2],he,function(fe,ie,oe){Q.selectAll("svg."+Z).remove(),Q.selectAll("g."+Z+"-group").remove();var le=fe&&fe.select("svg");if(!le||!le.node())return K(),void ae();var ge=Q.append("g").classed(Z+"-group",!0).attr({"pointer-events":"none","data-unformatted":H,"data-math":"Y"});ge.node().appendChild(le.node()),ie&&ie.node()&&le.node().insertBefore(ie.node().cloneNode(!0),le.node().firstChild);var ye=oe.width,me=oe.height;le.attr({class:Z,height:me,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var be=j.node().style.fill||"black",Se=le.select("g");Se.attr({fill:be,stroke:be});var Ee=Se.node().getBoundingClientRect(),Ce=Ee.width,Le=Ee.height;(Ce>ye||Le>me)&&(le.style("overflow","hidden"),Ce=(Ee=le.node().getBoundingClientRect()).width,Le=Ee.height);var Oe=+j.attr("x"),We=+j.attr("y"),Ie=-(se||j.node().getBoundingClientRect().height)/4;if(Z[0]==="y")ge.attr({transform:"rotate("+[-90,Oe,We]+")"+e(-Ce/2,Ie-Le/2)});else if(Z[0]==="l")We=Ie-Le/2;else if(Z[0]==="a"&&Z.indexOf("atitle")!==0)Oe=0,We=Ie;else{var Ve=j.attr("text-anchor");Oe-=Ce*(Ve==="middle"?.5:Ve==="end"?1:0),We=We+Ie-Le/2}le.attr({x:Oe,y:We}),ee&&ee.call(j,ge),ae(ge)})})):K(),j}function K(){Q.empty()||(Z=j.attr("class")+"-math",Q.select("svg."+Z).remove()),j.text("").style("white-space","pre");var ae=function(se,he){he=he.replace(x," ");var fe,ie=!1,oe=[],le=-1;function ge(){le++;var ke=document.createElementNS(w.svg,"tspan");b.select(ke).attr({class:"line",dy:le*y+"em"}),se.appendChild(ke),fe=ke;var He=oe;if(oe=[{node:ke}],He.length>1)for(var Fe=1;Fe doesnt match end tag <"+ke+">. Pretending it did match.",he),fe=oe[oe.length-1].node}else d.log("Ignoring unexpected end tag .",he)}k.test(he)?ge():(fe=se,oe=[{node:se}]);for(var Se=he.split(m),Ee=0;Ee|>|>)/g,n=[["$","$"],["\\(","\\)"]],l={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"},o={sub:"0.3em",sup:"-0.6em"},s={sub:"-0.21em",sup:"0.42em"},c="​",h=["http:","https:","mailto:","",void 0,":"],x=L.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,g=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;L.BR_TAG_ALL=//gi;var A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,v=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,S=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function p(j,$){if(!j)return null;var ee=j.match($),H=ee&&(ee[3]||ee[4]);return H&&I(H)}var M=/(^|;)\s*color:/;L.plainText=function(j,$){for(var ee=($=$||{}).len!==void 0&&$.len!==-1?$.len:1/0,H=$.allowedTags!==void 0?$.allowedTags:["br"],J=j.split(m),Q=[],Z="",K=0,ae=0;ae3?Q.push(se.substr(0,oe-3)+"..."):Q.push(se.substr(0,oe));break}Z=""}}return Q.join("")};var f={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function I(j){return j.replace(E,function($,ee){return(ee.charAt(0)==="#"?function(H){if(!(H>1114111)){var J=String.fromCodePoint;if(J)return J(H);var Q=String.fromCharCode;return H<=65535?Q(H):Q(55232+(H>>10),H%1024+56320)}}(ee.charAt(1)==="x"?parseInt(ee.substr(2),16):parseInt(ee.substr(1),10)):f[ee])||$})}function B(j){var $=encodeURI(decodeURI(j)),ee=document.createElement("a"),H=document.createElement("a");ee.href=j,H.href=$;var J=ee.protocol,Q=H.protocol;return h.indexOf(J)!==-1&&h.indexOf(Q)!==-1?$:""}function N(j,$,ee){var H,J,Q,Z=ee.horizontalAlign,K=ee.verticalAlign||"top",ae=j.node().getBoundingClientRect(),se=$.node().getBoundingClientRect();return J=K==="bottom"?function(){return ae.bottom-H.height}:K==="middle"?function(){return ae.top+(ae.height-H.height)/2}:function(){return ae.top},Q=Z==="right"?function(){return ae.right-H.width}:Z==="center"?function(){return ae.left+(ae.width-H.width)/2}:function(){return ae.left},function(){H=this.node().getBoundingClientRect();var he=Q()-se.left,fe=J()-se.top,ie=ee.gd||{};if(ee.gd){ie._fullLayout._calcInverseTransform(ie);var oe=d.apply3DTransform(ie._fullLayout._invTransform)(he,fe);he=oe[0],fe=oe[1]}return this.style({top:fe+"px",left:he+"px","z-index":1e3}),this}}L.convertEntities=I,L.sanitizeHTML=function(j){j=j.replace(x," ");for(var $=document.createElement("p"),ee=$,H=[],J=j.split(m),Q=0;Qy.ts+e?r():y.timer=setTimeout(function(){r(),y.timer=null},e)},L.done=function(d){var e=t[d];return e&&e.timer?new Promise(function(w){var y=e.onDone;e.onDone=function(){y&&y(),w(),e.onDone=null}}):Promise.resolve()},L.clear=function(d){if(d)b(t[d]),delete t[d];else for(var e in t)L.clear(e)}},8083:function(D,L,t){var b=t(10721);D.exports=function(d,e){if(d>0)return Math.log(d)/Math.LN10;var w=Math.log(Math.min(e[0],e[1]))/Math.LN10;return b(w)||(w=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),w}},11577:function(D,L,t){var b=D.exports={},d=t(74285).locationmodeToLayer,e=t(48640).N4;b.getTopojsonName=function(w){return[w.scope.replace(/ /g,"-"),"_",w.resolution.toString(),"m"].join("")},b.getTopojsonPath=function(w,y){return w+y+".json"},b.getTopojsonFeatures=function(w,y){var _=d[w.locationmode],u=y.objects[_];return e(y,u).features}},44611:function(D){D.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},30227:function(D){D.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"}}},56037:function(D,L,t){var b=t(33626);D.exports=function(d){for(var e,w,y=b.layoutArrayContainers,_=b.layoutArrayRegexes,u=d.split("[")[0],r=0;r<_.length;r++)if((w=d.match(_[r]))&&w.index===0){e=w[0];break}if(e||(e=y[y.indexOf(u)]),!e)return!1;var n=d.substr(e.length);return n?!!(w=n.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(w[1]),property:w[3]||""}:{array:e,index:"",property:""}}},13582:function(D,L,t){var b=t(93049).extendFlat,d=t(56174),e={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},w={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},y=e.flags.slice().concat(["fullReplot"]),_=w.flags.slice().concat("layoutReplot");function u(l){for(var o={},s=0;s0&&w.log("Clearing previous rejected promises from queue."),v._promises=[]},L.cleanLayout=function(v){var S,T;v||(v={}),v.xaxis1&&(v.xaxis||(v.xaxis=v.xaxis1),delete v.xaxis1),v.yaxis1&&(v.yaxis||(v.yaxis=v.yaxis1),delete v.yaxis1),v.scene1&&(v.scene||(v.scene=v.scene1),delete v.scene1);var p=(y.subplotsRegistry.cartesian||{}).attrRegex,M=(y.subplotsRegistry.polar||{}).attrRegex,f=(y.subplotsRegistry.ternary||{}).attrRegex,E=(y.subplotsRegistry.gl3d||{}).attrRegex,I=Object.keys(v);for(S=0;S3?(oe.x=1.02,oe.xanchor="left"):oe.x<-2&&(oe.x=-.02,oe.xanchor="right"),oe.y>3?(oe.y=1.02,oe.yanchor="bottom"):oe.y<-2&&(oe.y=-.02,oe.yanchor="top")),s(v),v.dragmode==="rotate"&&(v.dragmode="orbit"),u.clean(v),v.template&&v.template.layout&&L.cleanLayout(v.template.layout),v},L.cleanData=function(v){for(var S=0;S0)return v.substr(0,S)}L.hasParent=function(v,S){for(var T=k(S);T;){if(T in v)return!0;T=k(T)}return!1};var A=["x","y","z"];L.clearAxisTypes=function(v,S,T){for(var p=0;p1&&e.warn("Full array edits are incompatible with other edits",c);var v=l[""][""];if(u(v))n.set(null);else{if(!Array.isArray(v))return e.warn("Unrecognized full array edit value",c,v),!0;n.set(v)}return!g&&(h(k,A),x(r),!0)}var S,T,p,M,f,E,I,B,N=Object.keys(l).map(Number).sort(w),V=n.get(),j=V||[],$=s(A,c).get(),ee=[],H=-1,J=j.length;for(S=0;Sj.length-(I?0:1))e.warn("index out of range",c,p);else if(E!==void 0)f.length>1&&e.warn("Insertion & removal are incompatible with edits to the same index.",c,p),u(E)?ee.push(p):I?(E==="add"&&(E={}),j.splice(p,0,E),$&&$.splice(p,0,{})):e.warn("Unrecognized full object edit value",c,p,E),H===-1&&(H=p);else for(T=0;T=0;S--)j.splice(ee[S],1),$&&$.splice(ee[S],1);if(j.length?V||n.set(j):n.set(null),g)return!1;if(h(k,A),m!==d){var Q;if(H===-1)Q=N;else{for(J=Math.max(j.length,J),Q=[],S=0;S=H);S++)Q.push(p);for(S=H;S=ke.data.length||$e<-ke.data.length)throw new Error(Fe+" must be valid indices for gd.data.");if(He.indexOf($e,qe+1)>-1||$e>=0&&He.indexOf(-ke.data.length+$e)>-1||$e<0&&He.indexOf(ke.data.length+$e)>-1)throw new Error("each index in "+Fe+" must be unique.")}}function $(ke,He,Fe){if(!Array.isArray(ke.data))throw new Error("gd.data must be an array.");if(He===void 0)throw new Error("currentIndices is a required argument.");if(Array.isArray(He)||(He=[He]),j(ke,He,"currentIndices"),Fe===void 0||Array.isArray(Fe)||(Fe=[Fe]),Fe!==void 0&&j(ke,Fe,"newIndices"),Fe!==void 0&&He.length!==Fe.length)throw new Error("current and new indices must be of equal length.")}function ee(ke,He,Fe,qe,$e){(function(pt,At,wt,Nt){var Ht=w.isPlainObject(Nt);if(!Array.isArray(pt.data))throw new Error("gd.data must be an array");if(!w.isPlainObject(At))throw new Error("update must be a key:value object");if(wt===void 0)throw new Error("indices must be an integer or array of integers");for(var Gt in j(pt,wt,"indices"),At){if(!Array.isArray(At[Gt])||At[Gt].length!==wt.length)throw new Error("attribute "+Gt+" must be an array of length equal to indices array length");if(Ht&&(!(Gt in Nt)||!Array.isArray(Nt[Gt])||Nt[Gt].length!==At[Gt].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")}})(ke,He,Fe,qe);for(var Ye=function(pt,At,wt,Nt){var Ht,Gt,st,Qe,ft,yt=w.isPlainObject(Nt),Ot=[];for(var Pt in Array.isArray(wt)||(wt=[wt]),wt=V(wt,pt.data.length-1),At)for(var at=0;at-1&&Fe.indexOf("grouptitlefont")===-1?De(Fe,Fe.replace("titlefont","title.font")):Fe.indexOf("titleposition")>-1?De(Fe,Fe.replace("titleposition","title.position")):Fe.indexOf("titleside")>-1?De(Fe,Fe.replace("titleside","title.side")):Fe.indexOf("titleoffset")>-1&&De(Fe,Fe.replace("titleoffset","title.offset")):De(Fe,Fe.replace("title","title.text"));function De(Be,Ge){ke[Ge]=ke[Be],delete ke[Be]}}function he(ke,He,Fe){ke=w.getGraphDiv(ke),S.clearPromiseQueue(ke);var qe={};if(typeof He=="string")qe[He]=Fe;else{if(!w.isPlainObject(He))return w.warn("Relayout fail.",He,Fe),Promise.reject();qe=w.extendFlat({},He)}Object.keys(qe).length&&(ke.changed=!0);var $e=ye(ke,qe),Ye=$e.flags;Ye.calc&&(ke.calcdata=void 0);var _e=[l.previousPromises];Ye.layoutReplot?_e.push(T.layoutReplot):Object.keys(qe).length&&(fe(ke,Ye,$e)||l.supplyDefaults(ke),Ye.legend&&_e.push(T.doLegend),Ye.layoutstyle&&_e.push(T.layoutStyles),Ye.axrange&&ie(_e,$e.rangesAltered),Ye.ticks&&_e.push(T.doTicksRelayout),Ye.modebar&&_e.push(T.doModeBar),Ye.camera&&_e.push(T.doCamera),Ye.colorbars&&_e.push(T.doColorBars),_e.push(E)),_e.push(l.rehover,l.redrag,l.reselect),u.add(ke,he,[ke,$e.undoit],he,[ke,$e.redoit]);var De=w.syncOrAsync(_e,ke);return De&&De.then||(De=Promise.resolve(ke)),De.then(function(){return ke.emit("plotly_relayout",$e.eventData),ke})}function fe(ke,He,Fe){var qe,$e,Ye=ke._fullLayout;if(!He.axrange)return!1;for(var _e in He)if(_e!=="axrange"&&He[_e])return!1;var De=function(At,wt){return w.coerce(qe,$e,c,At,wt)},Be={};for(var Ge in Fe.rangesAltered){var tt=o.id2name(Ge);if(qe=ke.layout[tt],$e=Ye[tt],s(qe,$e,De,Be),$e._matchGroup){for(var nt in $e._matchGroup)if(nt!==Ge){var pt=Ye[o.id2name(nt)];pt.autorange=$e.autorange,pt.range=$e.range.slice(),pt._input.range=$e.range.slice()}}}return!0}function ie(ke,He){var Fe=He?function(qe){var $e=[];for(var Ye in He){var _e=o.getFromId(qe,Ye);if($e.push(Ye),(_e.ticklabelposition||"").indexOf("inside")!==-1&&_e._anchorAxis&&$e.push(_e._anchorAxis._id),_e._matchGroup)for(var De in _e._matchGroup)He[De]||$e.push(De)}return o.draw(qe,$e,{skipTitle:!0})}:function(qe){return o.draw(qe,"redraw")};ke.push(k,T.doAutoRangeAndConstraints,Fe,T.drawData,T.finalDraw)}var oe=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,le=/^[xyz]axis[0-9]*\.autorange$/,ge=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function ye(ke,He){var Fe,qe,$e,Ye=ke.layout,_e=ke._fullLayout,De=_e._guiEditing,Be=Z(_e._preGUI,De),Ge=Object.keys(He),tt=o.list(ke),nt=w.extendDeepAll({},He),pt={};for(se(He),Ge=Object.keys(He),qe=0;qe0&&typeof at.parts[Xe]!="string";)Xe--;var ut=at.parts[Xe],Tt=at.parts[Xe-1]+"."+ut,vt=at.parts.slice(0,Xe).join("."),Lt=y(ke.layout,vt).get(),Ut=y(_e,vt).get(),rt=at.get();if(lt!==void 0){Gt[Pt]=lt,st[Pt]=ut==="reverse"?lt:Q(rt);var et=n.getLayoutValObject(_e,at.parts);if(et&&et.impliedEdits&<!==null)for(var Et in et.impliedEdits)Qe(w.relativeAttr(Pt,Et),et.impliedEdits[Et]);if(["width","height"].indexOf(Pt)!==-1)if(lt){Qe("autosize",null);var Bt=Pt==="height"?"width":"height";Qe(Bt,_e[Bt])}else _e[Pt]=ke._initialAutoSize[Pt];else if(Pt==="autosize")Qe("width",lt?null:_e.width),Qe("height",lt?null:_e.height);else if(Tt.match(oe))Ot(Tt),y(_e,vt+"._inputRange").set(null);else if(Tt.match(le)){Ot(Tt),y(_e,vt+"._inputRange").set(null);var Ft=y(_e,vt).get();Ft._inputDomain&&(Ft._input.domain=Ft._inputDomain.slice())}else Tt.match(ge)&&y(_e,vt+"._inputDomain").set(null);if(ut==="type"){ft=Lt;var St=Ut.type==="linear"&<==="log",Jt=Ut.type==="log"&<==="linear";if(St||Jt){if(ft&&ft.range)if(Ut.autorange)St&&(ft.range=ft.range[1]>ft.range[0]?[1,2]:[2,1]);else{var qt=ft.range[0],en=ft.range[1];St?(qt<=0&&en<=0&&Qe(vt+".autorange",!0),qt<=0?qt=en/1e6:en<=0&&(en=qt/1e6),Qe(vt+".range[0]",Math.log(qt)/Math.LN10),Qe(vt+".range[1]",Math.log(en)/Math.LN10)):(Qe(vt+".range[0]",Math.pow(10,qt)),Qe(vt+".range[1]",Math.pow(10,en)))}else Qe(vt+".autorange",!0);Array.isArray(_e._subplots.polar)&&_e._subplots.polar.length&&_e[at.parts[0]]&&at.parts[1]==="radialaxis"&&delete _e[at.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ke,Ut,lt,Qe),r.getComponentMethod("images","convertCoords")(ke,Ut,lt,Qe)}else Qe(vt+".autorange",!0),Qe(vt+".range",null);y(_e,vt+"._inputRange").set(null)}else if(ut.match(M)){var Wt=y(_e,Pt).get(),Zt=(lt||{}).type;Zt&&Zt!=="-"||(Zt="linear"),r.getComponentMethod("annotations","convertCoords")(ke,Wt,Zt,Qe),r.getComponentMethod("images","convertCoords")(ke,Wt,Zt,Qe)}var on=v.containerArrayMatch(Pt);if(on){Fe=on.array,qe=on.index;var un=on.property,Pn=et||{editType:"calc"};qe!==""&&un===""&&(v.isAddVal(lt)?st[Pt]=null:v.isRemoveVal(lt)?st[Pt]=(y(Ye,Fe).get()||[])[qe]:w.warn("unrecognized full object value",He)),p.update(Ht,Pn),pt[Fe]||(pt[Fe]={});var Dn=pt[Fe][qe];Dn||(Dn=pt[Fe][qe]={}),Dn[un]=lt,delete He[Pt]}else ut==="reverse"?(Lt.range?Lt.range.reverse():(Qe(vt+".autorange",!0),Lt.range=[1,0]),Ut.autorange?Ht.calc=!0:Ht.plot=!0):(Pt==="dragmode"&&(lt===!1&&rt!==!1||lt!==!1&&rt===!1)||_e._has("scatter-like")&&_e._has("regl")&&Pt==="dragmode"&&(lt==="lasso"||lt==="select")&&rt!=="lasso"&&rt!=="select"||_e._has("gl2d")?Ht.plot=!0:et?p.update(Ht,et):Ht.calc=!0,at.set(lt))}}for(Fe in pt)v.applyContainerArrayChanges(ke,Be(Ye,Fe),pt[Fe],Ht,Be)||(Ht.plot=!0);for(var In in yt){var mn=(ft=o.getFromId(ke,In))&&ft._constraintGroup;if(mn)for(var En in Ht.calc=!0,mn)yt[En]||(o.getFromId(ke,En)._constraintShrinkable=!0)}(me(ke)||He.height||He.width)&&(Ht.plot=!0);var Kn=_e.shapes;for(qe=0;qe1;)if(qe.pop(),(Fe=y(He,qe.join(".")+".uirevision").get())!==void 0)return Fe;return He.uirevision}function We(ke,He){for(var Fe=0;Fe=$e.length?$e[0]:$e[Ge]:$e}function De(Ge){return Array.isArray(Ye)?Ge>=Ye.length?Ye[0]:Ye[Ge]:Ye}function Be(Ge,tt){var nt=0;return function(){if(Ge&&++nt===tt)return Ge()}}return qe._frameWaitingCnt===void 0&&(qe._frameWaitingCnt=0),new Promise(function(Ge,tt){function nt(){ke.emit("plotly_animating"),qe._lastFrameAt=-1/0,qe._timeToNext=0,qe._runningTransitions=0,qe._currentFrame=null;var Pt=function(){qe._animationRaf=window.requestAnimationFrame(Pt),Date.now()-qe._lastFrameAt>qe._timeToNext&&function(){qe._currentFrame&&qe._currentFrame.onComplete&&qe._currentFrame.onComplete();var at=qe._currentFrame=qe._frameQueue.shift();if(at){var lt=at.name?at.name.toString():null;ke._fullLayout._currentFrame=lt,qe._lastFrameAt=Date.now(),qe._timeToNext=at.frameOpts.duration,l.transition(ke,at.frame.data,at.frame.layout,S.coerceTraceIndices(ke,at.frame.traces),at.frameOpts,at.transitionOpts).then(function(){at.onComplete&&at.onComplete()}),ke.emit("plotly_animatingframe",{name:lt,frame:at.frame,animation:{frame:at.frameOpts,transition:at.transitionOpts}})}else ke.emit("plotly_animated"),window.cancelAnimationFrame(qe._animationRaf),qe._animationRaf=null}()};Pt()}var pt,At,wt=0;function Nt(Pt){return Array.isArray($e)?wt>=$e.length?Pt.transitionOpts=$e[wt]:Pt.transitionOpts=$e[0]:Pt.transitionOpts=$e,wt++,Pt}var Ht=[],Gt=He==null,st=Array.isArray(He);if(Gt||st||!w.isPlainObject(He)){if(Gt||["string","number"].indexOf(typeof He)!==-1)for(pt=0;pt0&&ytyt)&&Ot.push(At);Ht=Ot}}Ht.length>0?function(Pt){if(Pt.length!==0){for(var at=0;at=0;qe--)if(w.isPlainObject(He[qe])){var pt=He[qe].name,At=(Be[pt]||nt[pt]||{}).name,wt=He[qe].name,Nt=Be[At]||nt[At];At&&wt&&typeof wt=="number"&&Nt&&f<5&&(f++,w.warn('addFrames: overwriting frame "'+(Be[At]||nt[At]).name+'" with a frame whose name of type "number" also equates to "'+At+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),f===5&&w.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.")),nt[pt]={name:pt},tt.push({frame:l.supplyFrameDefaults(He[qe]),index:Fe&&Fe[qe]!==void 0&&Fe[qe]!==null?Fe[qe]:Ge+qe})}tt.sort(function(Pt,at){return Pt.index>at.index?-1:Pt.index=0;qe--){if(typeof($e=tt[qe].frame).name=="number"&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!$e.name)for(;Be[$e.name="frame "+ke._transitionData._counter++];);if(Be[$e.name]){for(Ye=0;Ye=0;Fe--)qe=He[Fe],Ye.push({type:"delete",index:qe}),_e.unshift({type:"insert",index:qe,value:$e[qe]});var De=l.modifyFrames,Be=l.modifyFrames,Ge=[ke,_e],tt=[ke,Ye];return u&&u.add(ke,De,Ge,Be,tt),l.modifyFrames(ke,Ye)},L.addTraces=function ke(He,Fe,qe){He=w.getGraphDiv(He);var $e,Ye,_e=[],De=L.deleteTraces,Be=ke,Ge=[He,_e],tt=[He,Fe];for(function(nt,pt,At){var wt,Nt;if(!Array.isArray(nt.data))throw new Error("gd.data must be an array.");if(pt===void 0)throw new Error("traces must be defined.");for(Array.isArray(pt)||(pt=[pt]),wt=0;wt=0&&tt=0&&tt=N.length)return!1;if(M.dimensions===2){if(E++,f.length===E)return M;var V=f[E];if(!A(V))return!1;M=N[B][V]}else M=N[B]}else M=N}}return M}function A(M){return M===Math.round(M)&&M>=0}function v(){var M,f,E={};for(M in n(E,w),b.subplotsRegistry)if((f=b.subplotsRegistry[M]).layoutAttributes)if(Array.isArray(f.attr))for(var I=0;I=V.length)return!1;I=(E=(b.transformsRegistry[V[j].type]||{}).attributes)&&E[f[2]],N=3}else{var $=M._module;if($||($=(b.modules[M.type||e.type.dflt]||{})._module),!$)return!1;if(!(I=(E=$.attributes)&&E[B])){var ee=$.basePlotModule;ee&&ee.attributes&&(I=ee.attributes[B])}I||(I=e[B])}return k(I,f,N)},L.getLayoutValObject=function(M,f){var E=function(I,B){var N,V,j,$,ee=I._basePlotModules;if(ee){var H;for(N=0;N=l&&(n._input||{})._templateitemname;s&&(o=l);var c,h=r+"["+o+"]";function x(){c={},s&&(c[h]={},c[h][e]=s)}function m(k,A){s?b.nestedProperty(c[h],k).set(A):c[h+"."+k]=A}function g(){var k=c;return x(),k}return x(),{modifyBase:function(k,A){c[k]=A},modifyItem:m,getUpdateObj:g,applyUpdate:function(k,A){k&&m(k,A);var v=g();for(var S in v)b.nestedProperty(u,S).set(v[S])}}}},71817:function(D,L,t){var b=t(45568),d=t(33626),e=t(44122),w=t(34809),y=t(30635),_=t(34823),u=t(78766),r=t(62203),n=t(17240),l=t(95433),o=t(29714),s=t(4530),c=t(84391),h=c.enforce,x=c.clean,m=t(32919).doAutoRange,g="start",k=t(54826).zindexSeparator;function A(f,E,I){for(var B=0;B=f[1]||N[1]<=f[0])&&V[0]E[0])return!0}return!1}function v(f){var E,I,B,N,V,j,$=f._fullLayout,ee=$._size,H=ee.p,J=o.list(f,"",!0);if($._paperdiv.style({width:f._context.responsive&&$.autosize&&!f._context._hasZeroWidth&&!f.layout.width?"100%":$.width+"px",height:f._context.responsive&&$.autosize&&!f._context._hasZeroHeight&&!f.layout.height?"100%":$.height+"px"}).selectAll(".main-svg").call(r.setSize,$.width,$.height),f._context.setBackground(f,$.paper_bgcolor),L.drawMainTitle(f),l.manage(f),!$._has("cartesian"))return e.previousPromises(f);function Q(nt,pt,At){var wt=nt._lw/2;return nt._id.charAt(0)==="x"?pt?At==="top"?pt._offset-H-wt:pt._offset+pt._length+H+wt:ee.t+ee.h*(1-(nt.position||0))+wt%1:pt?At==="right"?pt._offset+pt._length+H+wt:pt._offset-H-wt:ee.l+ee.w*(nt.position||0)+wt%1}for(E=0;E.5?"t":"b",ge=se._fullLayout.margin[le],ye=0;return he.yref==="paper"?ye=fe+he.pad.t+he.pad.b:he.yref==="container"&&(ye=function(me,be,Se,Ee,Ce){var Le=0;return Se==="middle"&&(Le+=Ce/2),me==="t"?(Se==="top"&&(Le+=Ce),Le+=Ee-be*Ee):(Se==="bottom"&&(Le+=Ce),Le+=be*Ee),Le}(le,ie,oe,se._fullLayout.height,fe)+he.pad.t+he.pad.b),ye>ge?ye:0}(f,E,ee);if(H>0){(function(se,he,fe,ie){var oe="title.automargin",le=se._fullLayout.title,ge=le.y>.5?"t":"b",ye={x:le.x,y:le.y,t:0,b:0},me={};le.yref==="paper"&&function(be,Se,Ee,Ce,Le){var Oe=Se.yref==="paper"?be._fullLayout._size.h:be._fullLayout.height,We=w.isTopAnchor(Se)?Ce:Ce-Le,Ie=Ee==="b"?Oe-We:We;return!(w.isTopAnchor(Se)&&Ee==="t"||w.isBottomAnchor(Se)&&Ee==="b")&&Iej?T.push({code:"unused",traceType:E,templateCount:V,dataCount:j}):j>V&&T.push({code:"reused",traceType:E,templateCount:V,dataCount:j})}}else T.push({code:"data"});if(function $(ee,H){for(var J in ee)if(J.charAt(0)!=="_"){var Q=ee[J],Z=c(ee,J,H);d(Q)?(Array.isArray(ee)&&Q._template===!1&&Q.templateitemname&&T.push({code:"missing",path:Z,templateitemname:Q.templateitemname}),$(Q,Z)):Array.isArray(Q)&&h(Q)&&$(Q,Z)}}({data:M,layout:p},""),T.length)return T.map(x)}},80491:function(D,L,t){var b=t(10721),d=t(31420),e=t(44122),w=t(34809),y=t(84619),_=t(6243),u=t(72914),r=t(29697).version,n={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}};D.exports=function(l,o){var s,c,h,x;function m(j){return!(j in o)||w.validate(o[j],n[j])}if(o=o||{},w.isPlainObject(l)?(s=l.data||[],c=l.layout||{},h=l.config||{},x={}):(l=w.getGraphDiv(l),s=w.extendDeep([],l.data),c=w.extendDeep({},l.layout),h=l._context,x=l._fullLayout||{}),!m("width")&&o.width!==null||!m("height")&&o.height!==null)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+w.join2(n.format.values,", "," or ")+".");var g={};function k(j,$){return w.coerce(o,g,n,j,$)}var A=k("format"),v=k("width"),S=k("height"),T=k("scale"),p=k("setBackground"),M=k("imageDataOnly"),f=document.createElement("div");f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var E=w.extendFlat({},c);v?E.width=v:o.width===null&&b(x.width)&&(E.width=x.width),S?E.height=S:o.height===null&&b(x.height)&&(E.height=x.height);var I=w.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:p}),B=y.getRedrawFunc(f);function N(){return new Promise(function(j){setTimeout(j,y.getDelay(f._fullLayout))})}function V(){return new Promise(function(j,$){var ee=_(f,A,T),H=f._fullLayout.width,J=f._fullLayout.height;function Q(){d.purge(f),document.body.removeChild(f)}if(A==="full-json"){var Z=e.graphJson(f,!1,"keepdata","object",!0,!0);return Z.version=r,Z=JSON.stringify(Z),Q(),j(M?Z:y.encodeJSON(Z))}if(Q(),A==="svg")return j(M?ee:y.encodeSVG(ee));var K=document.createElement("canvas");K.id=w.randstr(),u({format:A,width:H,height:J,scale:T,canvas:K,svg:ee,promise:!0}).then(j).catch($)})}return new Promise(function(j,$){d.newPlot(f,s,E,I).then(B).then(N).then(V).then(function(ee){j(function(H){return M?H.replace(y.IMAGE_URL_PREFIX,""):H}(ee))}).catch(function(ee){$(ee)})})}},2466:function(D,L,t){var b=t(34809),d=t(44122),e=t(57297),w=t(24452).dfltConfig,y=b.isPlainObject,_=Array.isArray,u=b.isArrayOrTypedArray;function r(m,g,k,A,v,S){S=S||[];for(var T=Object.keys(m),p=0;pI.length&&A.push(o("unused",v,f.concat(I.length)));var ee,H,J,Q,Z,K=I.length,ae=Array.isArray($);if(ae&&(K=Math.min(K,$.length)),B.dimensions===2)for(H=0;HI[H].length&&A.push(o("unused",v,f.concat(H,I[H].length)));var se=I[H].length;for(ee=0;ee<(ae?Math.min(se,$[H].length):se);ee++)J=ae?$[H][ee]:$,Q=E[H][ee],Z=I[H][ee],b.validate(Q,J)?Z!==Q&&Z!==+Q&&A.push(o("dynamic",v,f.concat(H,ee),Q,Z)):A.push(o("value",v,f.concat(H,ee),Q))}else A.push(o("array",v,f.concat(H),E[H]));else for(H=0;H1&&S.push(o("object","layout"))),d.supplyDefaults(T);for(var p=T._fullData,M=k.length,f=0;f0&&Math.round(c)===c))return{vals:n};o=c}for(var h=u.calendar,x=l==="start",m=l==="end",g=_[r+"period0"],k=e(g,h)||0,A=[],v=[],S=[],T=n.length,p=0;pI;)E=w(E,-o,h);for(;E<=I;)E=w(E,o,h);f=w(E,-o,h)}else{for(E=k+(M=Math.round((I-k)/s))*s;E>I;)E-=s;for(;E<=I;)E+=s;f=E-s}A[p]=x?f:m?E:(f+E)/2,v[p]=f,S[p]=E}return{vals:A,starts:v,ends:S}}},55126:function(D){D.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},32919:function(D,L,t){var b=t(45568),d=t(10721),e=t(34809),w=t(63821).FP_SAFE,y=t(33626),_=t(62203),u=t(5975),r=u.getFromId,n=u.isLinked;function l(p,M){var f,E,I=[],B=p._fullLayout,N=s(B,M,0),V=s(B,M,1),j=h(p,M),$=j.min,ee=j.max;if($.length===0||ee.length===0)return e.simpleMap(M.range,M.r2l);var H=$[0].val,J=ee[0].val;for(f=1;f<$.length&&H===J;f++)H=Math.min(H,$[f].val);for(f=1;f0&&((ie=me-N(ae)-V(se))>be?oe/ie>Se&&(he=ae,fe=se,Se=oe/ie):oe/me>Se&&(he={val:ae.val,nopad:1},fe={val:se.val,nopad:1},Se=oe/me));if(H===J){var Ee=H-1,Ce=H+1;if(ge)if(H===0)I=[0,1];else{var Le=(H>0?ee:$).reduce(function(We,Ie){return Math.max(We,V(Ie))},0),Oe=H/(1-Math.min(.5,Le/me));I=H>0?[0,Oe]:[Oe,0]}else I=ye?[Math.max(0,Ee),Math.max(1,Ce)]:[Ee,Ce]}else ge?(he.val>=0&&(he={val:0,nopad:1}),fe.val<=0&&(fe={val:0,nopad:1})):ye&&(he.val-Se*N(he)<0&&(he={val:0,nopad:1}),fe.val<=0&&(fe={val:1,nopad:1})),Se=(fe.val-he.val-o(M,ae.val,se.val))/(me-N(he)-V(fe)),I=[he.val-Se*N(he),fe.val+Se*V(fe)];return I=T(I,M),M.limitRange&&M.limitRange(),Z&&I.reverse(),e.simpleMap(I,M.l2r||Number)}function o(p,M,f){var E=0;if(p.rangebreaks)for(var I=p.locateBreaks(M,f),B=0;B0?f.ppadplus:f.ppadminus)||f.ppad||0),le=ie((p._m>0?f.ppadminus:f.ppadplus)||f.ppad||0),ge=ie(f.vpadplus||f.vpad),ye=ie(f.vpadminus||f.vpad);if(!he){if(ee=1/0,H=-1/0,se)for(E=0;E0&&(ee=I),I>H&&I-w&&(ee=I),I>H&&I=Se;E--)be(E);return{min:J,max:Q,opts:f}},concatExtremes:h};var c=3;function h(p,M,f){var E,I,B,N=M._id,V=p._fullData,j=p._fullLayout,$=[],ee=[];function H(ae,se){for(E=0;E=f&&($.extrapad||!N)){V=!1;break}I(M,$.val)&&$.pad<=f&&(N||!$.extrapad)&&(p.splice(j,1),j--)}if(V){var ee=B&&M===0;p.push({val:M,pad:ee?0:f,extrapad:!ee&&N})}}function k(p){return d(p)&&Math.abs(p)=M}function S(p,M,f){return M===void 0||f===void 0||(M=p.d2l(M))=j&&(B=j,f=j),N<=j&&(N=j,E=j)}}return f=function($,ee){var H=ee.autorangeoptions;return H&&H.minallowed!==void 0&&S(ee,H.minallowed,H.maxallowed)?H.minallowed:H&&H.clipmin!==void 0&&S(ee,H.clipmin,H.clipmax)?Math.max($,ee.d2l(H.clipmin)):$}(f,M),E=function($,ee){var H=ee.autorangeoptions;return H&&H.maxallowed!==void 0&&S(ee,H.minallowed,H.maxallowed)?H.maxallowed:H&&H.clipmax!==void 0&&S(ee,H.clipmin,H.clipmax)?Math.min($,ee.d2l(H.clipmax)):$}(E,M),[f,E]}},75511:function(D){D.exports=function(L,t,b){var d,e;if(b){var w=t==="reversed"||t==="min reversed"||t==="max reversed";d=b[w?1:0],e=b[w?0:1]}var y=L("autorangeoptions.minallowed",e===null?d:void 0),_=L("autorangeoptions.maxallowed",d===null?e:void 0);y===void 0&&L("autorangeoptions.clipmin"),_===void 0&&L("autorangeoptions.clipmax"),L("autorangeoptions.include")}},29714:function(D,L,t){var b=t(45568),d=t(10721),e=t(44122),w=t(33626),y=t(34809),_=y.strTranslate,u=t(30635),r=t(17240),n=t(78766),l=t(62203),o=t(25829),s=t(68599),c=t(63821),h=c.ONEMAXYEAR,x=c.ONEAVGYEAR,m=c.ONEMINYEAR,g=c.ONEMAXQUARTER,k=c.ONEAVGQUARTER,A=c.ONEMINQUARTER,v=c.ONEMAXMONTH,S=c.ONEAVGMONTH,T=c.ONEMINMONTH,p=c.ONEWEEK,M=c.ONEDAY,f=M/2,E=c.ONEHOUR,I=c.ONEMIN,B=c.ONESEC,N=c.ONEMILLI,V=c.ONEMICROSEC,j=c.MINUS_SIGN,$=c.BADNUM,ee={K:"zeroline"},H={K:"gridline",L:"path"},J={K:"minor-gridline",L:"path"},Q={K:"tick",L:"path"},Z={K:"tick",L:"text"},K={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},ae=t(4530),se=ae.MID_SHIFT,he=ae.CAP_SHIFT,fe=ae.LINE_SPACING,ie=ae.OPPOSITE_SIDE,oe=D.exports={};oe.setConvert=t(19091);var le=t(9666),ge=t(5975),ye=ge.idSort,me=ge.isLinked;oe.id2name=ge.id2name,oe.name2id=ge.name2id,oe.cleanId=ge.cleanId,oe.list=ge.list,oe.listIds=ge.listIds,oe.getFromId=ge.getFromId,oe.getFromTrace=ge.getFromTrace;var be=t(32919);oe.getAutoRange=be.getAutoRange,oe.findExtremes=be.findExtremes;var Se=1e-4;function Ee(rt){var et=(rt[1]-rt[0])*Se;return[rt[0]-et,rt[1]+et]}oe.coerceRef=function(rt,et,Et,Bt,Ft,St){var Jt=Bt.charAt(Bt.length-1),qt=Et._fullLayout._subplots[Jt+"axis"],en=Bt+"ref",Wt={};return Ft||(Ft=qt[0]||(typeof St=="string"?St:St[0])),St||(St=Ft),qt=qt.concat(qt.map(function(Zt){return Zt+" domain"})),Wt[en]={valType:"enumerated",values:qt.concat(St?typeof St=="string"?[St]:St:[]),dflt:Ft},y.coerce(rt,et,Wt,en)},oe.getRefType=function(rt){return rt===void 0?rt:rt==="paper"?"paper":rt==="pixel"?"pixel":/( domain)$/.test(rt)?"domain":"range"},oe.coercePosition=function(rt,et,Et,Bt,Ft,St){var Jt,qt;if(oe.getRefType(Bt)!=="range")Jt=y.ensureNumber,qt=Et(Ft,St);else{var en=oe.getFromId(et,Bt);qt=Et(Ft,St=en.fraction2r(St)),Jt=en.cleanPos}rt[Ft]=Jt(qt)},oe.cleanPosition=function(rt,et,Et){return(Et==="paper"||Et==="pixel"?y.ensureNumber:oe.getFromId(et,Et).cleanPos)(rt)},oe.redrawComponents=function(rt,et){et=et||oe.listIds(rt);var Et=rt._fullLayout;function Bt(Ft,St,Jt,qt){for(var en=w.getComponentMethod(Ft,St),Wt={},Zt=0;ZtBt&&on2e-6||((Et-rt._forceTick0)/rt._minDtick%1+1.000001)%1>2e-6)&&(rt._minDtick=0)):rt._minDtick=0},oe.saveRangeInitial=function(rt,et){for(var Et=oe.list(rt,"",!0),Bt=!1,Ft=0;Ft.3*Qn||$n(Ln)||$n(Tn))){var lr=Kn.dtick/2;mn+=mn+lr.8){var wn=Number(Kn.substr(1));Fn.exactYears>.8&&wn%12==0?mn=oe.tickIncrement(mn,"M6","reverse")+1.5*M:Fn.exactMonths>.8?mn=oe.tickIncrement(mn,"M1","reverse")+15.5*M:mn-=f;var zn=oe.tickIncrement(mn,Kn);if(zn<=Ln)return zn}return mn}(In,rt,Dn,qt,Ft)),Pn=In;Pn<=en;)Pn=oe.tickIncrement(Pn,Dn,!1,Ft);return{start:et.c2r(In,0,Ft),end:et.c2r(Pn,0,Ft),size:Dn,_dataSpan:en-qt}},oe.prepMinorTicks=function(rt,et,Et){if(!et.minor.dtick){delete rt.dtick;var Bt,Ft=et.dtick&&d(et._tmin);if(Ft){var St=oe.tickIncrement(et._tmin,et.dtick,!0);Bt=[et._tmin,.99*St+.01*et._tmin]}else{var Jt=y.simpleMap(et.range,et.r2l);Bt=[Jt[0],.8*Jt[0]+.2*Jt[1]]}if(rt.range=y.simpleMap(Bt,et.l2r),rt._isMinor=!0,oe.prepTicks(rt,Et),Ft){var qt=d(et.dtick),en=d(rt.dtick),Wt=qt?et.dtick:+et.dtick.substring(1),Zt=en?rt.dtick:+rt.dtick.substring(1);qt&&en?We(Wt,Zt)?Wt===2*p&&Zt===2*M&&(rt.dtick=p):Wt===2*p&&Zt===3*M?rt.dtick=p:Wt!==p||(et._input.minor||{}).nticks?Ie(Wt/Zt,2.5)?rt.dtick=Wt/2:rt.dtick=Wt:rt.dtick=M:String(et.dtick).charAt(0)==="M"?en?rt.dtick="M1":We(Wt,Zt)?Wt>=12&&Zt===2&&(rt.dtick="M3"):rt.dtick=et.dtick:String(rt.dtick).charAt(0)==="L"?String(et.dtick).charAt(0)==="L"?We(Wt,Zt)||(rt.dtick=Ie(Wt/Zt,2.5)?et.dtick/2:et.dtick):rt.dtick="D1":rt.dtick==="D2"&&+et.dtick>1&&(rt.dtick=1)}rt.range=et.range}et.minor._tick0Init===void 0&&(rt.tick0=et.tick0)},oe.prepTicks=function(rt,et){var Et=y.simpleMap(rt.range,rt.r2l,void 0,void 0,et);if(rt.tickmode==="auto"||!rt.dtick){var Bt,Ft=rt.nticks;Ft||(rt.type==="category"||rt.type==="multicategory"?(Bt=rt.tickfont?y.bigFont(rt.tickfont.size||12):15,Ft=rt._length/Bt):(Bt=rt._id.charAt(0)==="y"?40:80,Ft=y.constrain(rt._length/Bt,4,9)+1),rt._name==="radialaxis"&&(Ft*=2)),rt.minor&&rt.minor.tickmode!=="array"||rt.tickmode==="array"&&(Ft*=100),rt._roughDTick=Math.abs(Et[1]-Et[0])/Ft,oe.autoTicks(rt,rt._roughDTick),rt._minDtick>0&&rt.dtick<2*rt._minDtick&&(rt.dtick=rt._minDtick,rt.tick0=rt.l2r(rt._forceTick0))}rt.ticklabelmode==="period"&&function(St){var Jt;function qt(){return!(d(St.dtick)||St.dtick.charAt(0)!=="M")}var en=qt(),Wt=oe.getTickFormat(St);if(Wt){var Zt=St._dtickInit!==St.dtick;/%[fLQsSMX]/.test(Wt)||(/%[HI]/.test(Wt)?(Jt=E,Zt&&!en&&St.dtickrt.range[1],on=!rt.ticklabelindex||y.isArrayOrTypedArray(rt.ticklabelindex)?rt.ticklabelindex:[rt.ticklabelindex],un=y.simpleMap(rt.range,rt.r2l,void 0,void 0,et),Pn=un[1]=(wn?0:1);zn--){var Jn=!zn;zn?(rt._dtickInit=rt.dtick,rt._tick0Init=rt.tick0):(rt.minor._dtickInit=rt.minor.dtick,rt.minor._tick0Init=rt.minor.tick0);var $n=zn?rt:y.extendFlat({},rt,rt.minor);if(Jn?oe.prepMinorTicks($n,rt,et):oe.prepTicks($n,et),$n.tickmode!=="array")if($n.tickmode!=="sync"){var vr=Ee(un),Qn=vr[0],lr=vr[1],hr=d($n.dtick),jr=Jt==="log"&&!(hr||$n.dtick.charAt(0)==="L"),ni=oe.tickFirst($n,et);if(zn){if(rt._tmin=ni,ni=lr:Qr<=lr;Qr=oe.tickIncrement(Qr,kn,Pn,qt)){if(zn&&Or++,$n.rangebreaks&&!Pn){if(Qr=In)break}if(Ln.length>mn||Qr===xr)break;xr=Qr;var Cn={value:Qr};zn?(jr&&Qr!==(0|Qr)&&(Cn.simpleLabel=!0),en>1&&Or%en&&(Cn.skipLabel=!0),Ln.push(Cn)):(Cn.minor=!0,Tn.push(Cn))}}else Ln=[],En=de(rt);else zn?(Ln=[],En=Me(rt,!Jn)):(Tn=[],Kn=Me(rt,!Jn))}if(!Tn||Tn.length<2?on=!1:(Et=(Tn[1].value-Tn[0].value)*(Zt?-1:1),Bt=rt.tickformat,(/%f/.test(Bt)?Et>=V:/%L/.test(Bt)?Et>=N:/%[SX]/.test(Bt)?Et>=B:/%M/.test(Bt)?Et>=I:/%[HI]/.test(Bt)?Et>=E:/%p/.test(Bt)?Et>=f:/%[Aadejuwx]/.test(Bt)?Et>=M:/%[UVW]/.test(Bt)?Et>=p:/%[Bbm]/.test(Bt)?Et>=T:/%[q]/.test(Bt)?Et>=A:!/%[Yy]/.test(Bt)||Et>=m)||(on=!1)),on){var ur=Ln.concat(Tn);Wt&&Ln.length&&(ur=ur.slice(1)),(ur=ur.sort(function(dn,ln){return dn.value-ln.value}).filter(function(dn,ln,An){return ln===0||dn.value!==An[ln-1].value})).map(function(dn,ln){return dn.minor!==void 0||dn.skipLabel?null:ln}).filter(function(dn){return dn!==null}).forEach(function(dn){on.map(function(ln){var An=dn+ln;An>=0&&An0?(Tr=er-1,yr=er):(Tr=er,yr=er);var Ur,Rr=dn[Tr].value,$r=dn[yr].value,Pr=Math.abs($r-Rr),Cr=An||Pr,Jr=0;Cr>=m?Jr=Pr>=m&&Pr<=h?Pr:x:An===k&&Cr>=A?Jr=Pr>=A&&Pr<=g?Pr:k:Cr>=T?Jr=Pr>=T&&Pr<=v?Pr:S:An===p&&Cr>=p?Jr=p:Cr>=M?Jr=M:An===f&&Cr>=f?Jr=f:An===E&&Cr>=E&&(Jr=E),Jr>=Pr&&(Jr=Pr,Ur=!0);var gi=br+Jr;if(ln.rangebreaks&&Jr>0){for(var ii=0,Yr=0;Yr<84;Yr++){var oi=(Yr+.5)/84;ln.maskBreaks(br*(1-oi)+oi*gi)!==$&&ii++}(Jr*=ii/84)||(dn[er].drop=!0),Ur&&Pr>p&&(Jr=Pr)}(Jr>0||er===0)&&(dn[er].periodX=br+Jr/2)}}(Fn,rt,rt._definedDelta),rt.rangebreaks){var Yn=rt._id.charAt(0)==="y",an=1;rt.tickmode==="auto"&&(an=rt.tickfont?rt.tickfont.size:12);var _n=NaN;for(Ft=Ln.length-1;Ft>-1;Ft--)if(Ln[Ft].drop)Ln.splice(Ft,1);else{Ln[Ft].value=Tt(Ln[Ft].value,rt);var gn=rt.c2p(Ln[Ft].value);(Yn?_n>gn-an:_nIn||erIn&&(An.periodX=In),er10||Bt.substr(5)!=="01-01"?rt._tickround="d":rt._tickround=+et.substr(1)%12==0?"y":"m";else if(et>=M&&Ft<=10||et>=15*M)rt._tickround="d";else if(et>=I&&Ft<=16||et>=E)rt._tickround="M";else if(et>=B&&Ft<=19||et>=I)rt._tickround="S";else{var St=rt.l2r(Et+et).replace(/^-/,"").length;rt._tickround=Math.max(Ft,St)-20,rt._tickround<0&&(rt._tickround=4)}}else if(d(et)||et.charAt(0)==="L"){var Jt=rt.range.map(rt.r2d||Number);d(et)||(et=Number(et.substr(1))),rt._tickround=2-Math.floor(Math.log(et)/Math.LN10+.01);var qt=Math.max(Math.abs(Jt[0]),Math.abs(Jt[1])),en=Math.floor(Math.log(qt)/Math.LN10+.01),Wt=rt.minexponent===void 0?3:rt.minexponent;Math.abs(en)>Wt&&(nt(rt.exponentformat)&&!pt(en)?rt._tickexponent=3*Math.round((en-1)/3):rt._tickexponent=en)}else rt._tickround=null}function Ge(rt,et,Et){var Bt=rt.tickfont||{};return{x:et,dx:0,dy:0,text:Et||"",fontSize:Bt.size,font:Bt.family,fontWeight:Bt.weight,fontStyle:Bt.style,fontVariant:Bt.variant,fontTextcase:Bt.textcase,fontLineposition:Bt.lineposition,fontShadow:Bt.shadow,fontColor:Bt.color}}oe.autoTicks=function(rt,et,Et){var Bt;function Ft(on){return Math.pow(on,Math.floor(Math.log(et)/Math.LN10))}if(rt.type==="date"){rt.tick0=y.dateTick0(rt.calendar,0);var St=2*et;if(St>x)et/=x,Bt=Ft(10),rt.dtick="M"+12*De(et,Bt,ke);else if(St>S)et/=S,rt.dtick="M"+De(et,1,He);else if(St>M){if(rt.dtick=De(et,M,rt._hasDayOfWeekBreaks?[1,2,7,14]:qe),!Et){var Jt=oe.getTickFormat(rt),qt=rt.ticklabelmode==="period";qt&&(rt._rawTick0=rt.tick0),/%[uVW]/.test(Jt)?rt.tick0=y.dateTick0(rt.calendar,2):rt.tick0=y.dateTick0(rt.calendar,1),qt&&(rt._dowTick0=rt.tick0)}}else St>E?rt.dtick=De(et,E,He):St>I?rt.dtick=De(et,I,Fe):St>B?rt.dtick=De(et,B,Fe):(Bt=Ft(10),rt.dtick=De(et,Bt,ke))}else if(rt.type==="log"){rt.tick0=0;var en=y.simpleMap(rt.range,rt.r2l);if(rt._isMinor&&(et*=1.5),et>.7)rt.dtick=Math.ceil(et);else if(Math.abs(en[1]-en[0])<1){var Wt=1.5*Math.abs((en[1]-en[0])/et);et=Math.abs(Math.pow(10,en[1])-Math.pow(10,en[0]))/Wt,Bt=Ft(10),rt.dtick="L"+De(et,Bt,ke)}else rt.dtick=et>.3?"D2":"D1"}else rt.type==="category"||rt.type==="multicategory"?(rt.tick0=0,rt.dtick=Math.ceil(Math.max(et,1))):ut(rt)?(rt.tick0=0,Bt=1,rt.dtick=De(et,Bt,_e)):(rt.tick0=0,Bt=Ft(10),rt.dtick=De(et,Bt,ke));if(rt.dtick===0&&(rt.dtick=1),!d(rt.dtick)&&typeof rt.dtick!="string"){var Zt=rt.dtick;throw rt.dtick=1,"ax.dtick error: "+String(Zt)}},oe.tickIncrement=function(rt,et,Et,Bt){var Ft=Et?-1:1;if(d(et))return y.increment(rt,Ft*et);var St=et.charAt(0),Jt=Ft*Number(et.substr(1));if(St==="M")return y.incrementMonth(rt,Jt,Bt);if(St==="L")return Math.log(Math.pow(10,rt)+Jt)/Math.LN10;if(St==="D"){var qt=et==="D2"?Ye:$e,en=rt+.01*Ft,Wt=y.roundUp(y.mod(en,1),qt,Et);return Math.floor(en)+Math.log(b.round(Math.pow(10,Wt),1))/Math.LN10}throw"unrecognized dtick "+String(et)},oe.tickFirst=function(rt,et){var Et=rt.r2l||Number,Bt=y.simpleMap(rt.range,Et,void 0,void 0,et),Ft=Bt[1]=0&&En<=rt._length?mn:null};if(Jt&&y.isArrayOrTypedArray(rt.ticktext)){var on=y.simpleMap(rt.range,rt.r2l),un=(Math.abs(on[1]-on[0])-(rt._lBreaks||0))/1e4;for(Ft=0;Ft ")}else mn._prevDateHead=wn,zn+="
"+wn;En.text=zn}(rt,St,Et,qt):en==="log"?function(mn,En,Kn,Ln,Tn){var Fn=mn.dtick,wn=En.x,zn=mn.tickformat,Jn=typeof Fn=="string"&&Fn.charAt(0);if(Tn==="never"&&(Tn=""),Ln&&Jn!=="L"&&(Fn="L3",Jn="L"),zn||Jn==="L")En.text=At(Math.pow(10,wn),mn,Tn,Ln);else if(d(Fn)||Jn==="D"&&y.mod(wn+.01,1)<.1){var $n=Math.round(wn),vr=Math.abs($n),Qn=mn.exponentformat;Qn==="power"||nt(Qn)&&pt($n)?(En.text=$n===0?1:$n===1?"10":"10"+($n>1?"":j)+vr+"",En.fontSize*=1.25):(Qn==="e"||Qn==="E")&&vr>2?En.text="1"+Qn+($n>0?"+":j)+vr:(En.text=At(Math.pow(10,wn),mn,"","fakehover"),Fn==="D1"&&mn._id.charAt(0)==="y"&&(En.dy-=En.fontSize/6))}else{if(Jn!=="D")throw"unrecognized dtick "+String(Fn);En.text=String(Math.round(Math.pow(10,y.mod(wn,1)))),En.fontSize*=.75}if(mn.dtick==="D1"){var lr=String(En.text).charAt(0);lr!=="0"&&lr!=="1"||(mn._id.charAt(0)==="y"?En.dx-=En.fontSize/4:(En.dy+=En.fontSize/2,En.dx+=(mn.range[1]>mn.range[0]?1:-1)*En.fontSize*(wn<0?.5:.25)))}}(rt,St,0,qt,Dn):en==="category"?function(mn,En){var Kn=mn._categories[Math.round(En.x)];Kn===void 0&&(Kn=""),En.text=String(Kn)}(rt,St):en==="multicategory"?function(mn,En,Kn){var Ln=Math.round(En.x),Tn=mn._categories[Ln]||[],Fn=Tn[1]===void 0?"":String(Tn[1]),wn=Tn[0]===void 0?"":String(Tn[0]);Kn?En.text=wn+" - "+Fn:(En.text=Fn,En.text2=wn)}(rt,St,Et):ut(rt)?function(mn,En,Kn,Ln,Tn){if(mn.thetaunit!=="radians"||Kn)En.text=At(En.x,mn,Tn,Ln);else{var Fn=En.x/180;if(Fn===0)En.text="0";else{var wn=function(Jn){function $n(hr,jr){return Math.abs(hr-jr)<=1e-6}var vr=function(hr){for(var jr=1;!$n(Math.round(hr*jr)/jr,hr);)jr*=10;return jr}(Jn),Qn=Jn*vr,lr=Math.abs(function hr(jr,ni){return $n(ni,0)?jr:hr(ni,jr%ni)}(Qn,vr));return[Math.round(Qn/lr),Math.round(vr/lr)]}(Fn);if(wn[1]>=100)En.text=At(y.deg2rad(En.x),mn,Tn,Ln);else{var zn=En.x<0;wn[1]===1?wn[0]===1?En.text="π":En.text=wn[0]+"π":En.text=["",wn[0],"","⁄","",wn[1],"","π"].join(""),zn&&(En.text=j+En.text)}}}}(rt,St,Et,qt,Dn):function(mn,En,Kn,Ln,Tn){Tn==="never"?Tn="":mn.showexponent==="all"&&Math.abs(En.x/mn.dtick)<1e-6&&(Tn="hide"),En.text=At(En.x,mn,Tn,Ln)}(rt,St,0,qt,Dn),Bt||(rt.tickprefix&&!Pn(rt.showtickprefix)&&(St.text=rt.tickprefix+St.text),rt.ticksuffix&&!Pn(rt.showticksuffix)&&(St.text+=rt.ticksuffix)),rt.labelalias&&rt.labelalias.hasOwnProperty(St.text)){var In=rt.labelalias[St.text];typeof In=="string"&&(St.text=In)}return(rt.tickson==="boundaries"||rt.showdividers)&&(St.xbnd=[Zt(St.x-.5),Zt(St.x+rt.dtick-.5)]),St},oe.hoverLabelText=function(rt,et,Et){Et&&(rt=y.extendFlat({},rt,{hoverformat:Et}));var Bt=y.isArrayOrTypedArray(et)?et[0]:et,Ft=y.isArrayOrTypedArray(et)?et[1]:void 0;if(Ft!==void 0&&Ft!==Bt)return oe.hoverLabelText(rt,Bt,Et)+" - "+oe.hoverLabelText(rt,Ft,Et);var St=rt.type==="log"&&Bt<=0,Jt=oe.tickText(rt,rt.c2l(St?-Bt:Bt),"hover").text;return St?Bt===0?"0":j+Jt:Jt};var tt=["f","p","n","μ","m","","k","M","G","T"];function nt(rt){return rt==="SI"||rt==="B"}function pt(rt){return rt>14||rt<-15}function At(rt,et,Et,Bt){var Ft=rt<0,St=et._tickround,Jt=Et||et.exponentformat||"B",qt=et._tickexponent,en=oe.getTickFormat(et),Wt=et.separatethousands;if(Bt){var Zt={exponentformat:Jt,minexponent:et.minexponent,dtick:et.showexponent==="none"?et.dtick:d(rt)&&Math.abs(rt)||1,range:et.showexponent==="none"?et.range.map(et.r2d):[0,rt||1]};Be(Zt),St=(Number(Zt._tickround)||0)+4,qt=Zt._tickexponent,et.hoverformat&&(en=et.hoverformat)}if(en)return et._numFormat(en)(rt).replace(/-/g,j);var on,un=Math.pow(10,-St)/2;if(Jt==="none"&&(qt=0),(rt=Math.abs(rt))"+on+"":Jt==="B"&&qt===9?rt+="B":nt(Jt)&&(rt+=tt[qt/3+5])),Ft?j+rt:rt}function wt(rt,et){if(rt){var Et=Object.keys(K).reduce(function(Bt,Ft){return et.indexOf(Ft)!==-1&&K[Ft].forEach(function(St){Bt[St]=1}),Bt},{});Object.keys(rt).forEach(function(Bt){Et[Bt]||(Bt.length===1?rt[Bt]=0:delete rt[Bt])})}}function Nt(rt,et){for(var Et=[],Bt={},Ft=0;Ft1&&Et=Ft.min&&rt=0,En=Zt(un,Pn[1])<=0;return(Dn||mn)&&(In||En)}if(rt.tickformatstops&&rt.tickformatstops.length>0)switch(rt.type){case"date":case"linear":for(et=0;et=Jt(Ft)))){Et=Bt;break}break;case"log":for(et=0;et=0&&Ft.unshift(Ft.splice(Wt,1).shift())}});var Jt={false:{left:0,right:0}};return y.syncOrAsync(Ft.map(function(qt){return function(){if(qt){var en=oe.getFromId(rt,qt);Et||(Et={}),Et.axShifts=Jt,Et.overlayingShiftedAx=St;var Wt=oe.drawOne(rt,en,Et);return en._shiftPusher&&Ut(en,en._fullDepth||0,Jt,!0),en._r=en.range.slice(),en._rl=y.simpleMap(en._r,en.r2l),Wt}}}))},oe.drawOne=function(rt,et,Et){var Bt,Ft,St,Jt=(Et=Et||{}).axShifts||{},qt=Et.overlayingShiftedAx||[];et.setScale();var en=rt._fullLayout,Wt=et._id,Zt=Wt.charAt(0),on=oe.counterLetter(Wt),un=en._plots[et._mainSubplot];if(un){if(et._shiftPusher=et.autoshift||qt.indexOf(et._id)!==-1||qt.indexOf(et.overlaying)!==-1,et._shiftPusher&et.anchor==="free"){var Pn=et.linewidth/2||0;et.ticks==="inside"&&(Pn+=et.ticklen),Ut(et,Pn,Jt,!0),Ut(et,et.shift||0,Jt,!1)}Et.skipTitle===!0&&et._shift!==void 0||(et._shift=function(dn,ln){return dn.autoshift?ln[dn.overlaying][dn.side]:dn.shift||0}(et,Jt));var Dn=un[Zt+"axislayer"],In=et._mainLinePosition,mn=In+=et._shift,En=et._mainMirrorPosition,Kn=et._vals=oe.calcTicks(et),Ln=[et.mirror,mn,En].join("_");for(Bt=0;Bt0?dn.bottom-yr:0,Ur))));var Rr=0,$r=0;if(et._shiftPusher&&(Rr=Math.max(Ur,dn.height>0?br==="l"?yr-dn.left:dn.right-yr:0),et.title.text!==en._dfltTitle[Zt]&&($r=(et._titleStandoff||0)+(et._titleScoot||0),br==="l"&&($r+=st(et))),et._fullDepth=Math.max(Rr,$r)),et.automargin){ln={x:0,y:0,r:0,l:0,t:0,b:0};var Pr=[0,1],Cr=typeof et._shift=="number"?et._shift:0;if(Zt==="x"){if(br==="b"?ln[br]=et._depth:(ln[br]=et._depth=Math.max(dn.width>0?yr-dn.top:0,Ur),Pr.reverse()),dn.width>0){var Jr=dn.right-(et._offset+et._length);Jr>0&&(ln.xr=1,ln.r=Jr);var gi=et._offset-dn.left;gi>0&&(ln.xl=0,ln.l=gi)}}else if(br==="l"?(et._depth=Math.max(dn.height>0?yr-dn.left:0,Ur),ln[br]=et._depth-Cr):(et._depth=Math.max(dn.height>0?dn.right-yr:0,Ur),ln[br]=et._depth+Cr,Pr.reverse()),dn.height>0){var ii=dn.bottom-(et._offset+et._length);ii>0&&(ln.yb=0,ln.b=ii);var Yr=et._offset-dn.top;Yr>0&&(ln.yt=1,ln.t=Yr)}ln[on]=et.anchor==="free"?et.position:et._anchorAxis.domain[Pr[0]],et.title.text!==en._dfltTitle[Zt]&&(ln[br]+=st(et)+(et.title.standoff||0)),et.mirror&&et.anchor!=="free"&&((An={x:0,y:0,r:0,l:0,t:0,b:0})[Tr]=et.linewidth,et.mirror&&et.mirror!==!0&&(An[Tr]+=Ur),et.mirror===!0||et.mirror==="ticks"?An[on]=et._anchorAxis.domain[Pr[1]]:et.mirror!=="all"&&et.mirror!=="allticks"||(An[on]=[et._counterDomainMin,et._counterDomainMax][Pr[1]]))}Wn&&(er=w.getComponentMethod("rangeslider","autoMarginOpts")(rt,et)),typeof et.automargin=="string"&&(wt(ln,et.automargin),wt(An,et.automargin)),e.autoMargin(rt,yt(et),ln),e.autoMargin(rt,Ot(et),An),e.autoMargin(rt,Pt(et),er)}),y.syncOrAsync(Un)}}function Bn(dn){var ln=Wt+(dn||"tick");return Tn[ln]||(Tn[ln]=function(An,er,br){var Tr,yr,Ur,Rr;if(An._selections[er].size())Tr=1/0,yr=-1/0,Ur=1/0,Rr=-1/0,An._selections[er].each(function(){var Pr=ft(this),Cr=l.bBox(Pr.node().parentNode);Tr=Math.min(Tr,Cr.top),yr=Math.max(yr,Cr.bottom),Ur=Math.min(Ur,Cr.left),Rr=Math.max(Rr,Cr.right)});else{var $r=oe.makeLabelFns(An,br);Tr=yr=$r.yFn({dx:0,dy:0,fontSize:0}),Ur=Rr=$r.xFn({dx:0,dy:0,fontSize:0})}return{top:Tr,bottom:yr,left:Ur,right:Rr,height:yr-Tr,width:Rr-Ur}}(et,ln,mn)),Tn[ln]}},oe.getTickSigns=function(rt,et){var Et=rt._id.charAt(0),Bt={x:"top",y:"right"}[Et],Ft=rt.side===Bt?1:-1,St=[-1,1,Ft,-Ft];return(et?(rt.minor||{}).ticks:rt.ticks)!=="inside"==(Et==="x")&&(St=St.map(function(Jt){return-Jt})),rt.side&&St.push({l:-1,t:-1,r:1,b:1}[rt.side.charAt(0)]),St},oe.makeTransTickFn=function(rt){return rt._id.charAt(0)==="x"?function(et){return _(rt._offset+rt.l2p(et.x),0)}:function(et){return _(0,rt._offset+rt.l2p(et.x))}},oe.makeTransTickLabelFn=function(rt){var et=function(Zt){var on=Zt.ticklabelposition||"",un=function(zn){return on.indexOf(zn)!==-1},Pn=un("top"),Dn=un("left"),In=un("right"),mn=un("bottom"),En=un("inside"),Kn=mn||Dn||Pn||In;if(!Kn&&!En)return[0,0];var Ln=Zt.side,Tn=Kn?(Zt.tickwidth||0)/2:0,Fn=3,wn=Zt.tickfont?Zt.tickfont.size:12;return(mn||Pn)&&(Tn+=wn*he,Fn+=(Zt.linewidth||0)/2),(Dn||In)&&(Tn+=(Zt.linewidth||0)/2,Fn+=3),En&&Ln==="top"&&(Fn-=wn*(1-he)),(Dn||Pn)&&(Tn=-Tn),Ln!=="bottom"&&Ln!=="right"||(Fn=-Fn),[Kn?Tn:0,En?Fn:0]}(rt),Et=rt.ticklabelshift||0,Bt=rt.ticklabelstandoff||0,Ft=et[0],St=et[1],Jt=rt.range[0]>rt.range[1],qt=rt.ticklabelposition&&rt.ticklabelposition.indexOf("inside")!==-1,en=!qt;if(Et&&(Et*=Jt?-1:1),Bt){var Wt=rt.side;Bt*=qt&&(Wt==="top"||Wt==="left")||en&&(Wt==="bottom"||Wt==="right")?1:-1}return rt._id.charAt(0)==="x"?function(Zt){return _(Ft+rt._offset+rt.l2p(Ht(Zt))+Et,St+Bt)}:function(Zt){return _(St+Bt,Ft+rt._offset+rt.l2p(Ht(Zt))+Et)}},oe.makeTickPath=function(rt,et,Et,Bt){Bt||(Bt={});var Ft=Bt.minor;if(Ft&&!rt.minor)return"";var St=Bt.len!==void 0?Bt.len:Ft?rt.minor.ticklen:rt.ticklen,Jt=rt._id.charAt(0),qt=(rt.linewidth||1)/2;return Jt==="x"?"M0,"+(et+qt*Et)+"v"+St*Et:"M"+(et+qt*Et)+",0h"+St*Et},oe.makeLabelFns=function(rt,et,Et){var Bt=rt.ticklabelposition||"",Ft=function(Qn){return Bt.indexOf(Qn)!==-1},St=Ft("top"),Jt=Ft("left"),qt=Ft("right"),en=Ft("bottom")||Jt||St||qt,Wt=Ft("inside"),Zt=Bt==="inside"&&rt.ticks==="inside"||!Wt&&rt.ticks==="outside"&&rt.tickson!=="boundaries",on=0,un=0,Pn=Zt?rt.ticklen:0;if(Wt?Pn*=-1:en&&(Pn=0),Zt&&(on+=Pn,Et)){var Dn=y.deg2rad(Et);on=Pn*Math.cos(Dn)+1,un=Pn*Math.sin(Dn)}rt.showticklabels&&(Zt||rt.showline)&&(on+=.2*rt.tickfont.size);var In,mn,En,Kn,Ln,Tn={labelStandoff:on+=(rt.linewidth||1)/2*(Wt?-1:1),labelShift:un},Fn=0,wn=rt.side,zn=rt._id.charAt(0),Jn=rt.tickangle;if(zn==="x")Kn=(Ln=!Wt&&wn==="bottom"||Wt&&wn==="top")?1:-1,Wt&&(Kn*=-1),In=un*Kn,mn=et+on*Kn,En=Ln?1:-.2,Math.abs(Jn)===90&&(Wt?En+=se:En=Jn===-90&&wn==="bottom"?he:Jn===90&&wn==="top"?se:.5,Fn=se/2*(Jn/90)),Tn.xFn=function(Qn){return Qn.dx+In+Fn*Qn.fontSize},Tn.yFn=function(Qn){return Qn.dy+mn+Qn.fontSize*En},Tn.anchorFn=function(Qn,lr){if(en){if(Jt)return"end";if(qt)return"start"}return d(lr)&&lr!==0&&lr!==180?lr*Kn<0!==Wt?"end":"start":"middle"},Tn.heightFn=function(Qn,lr,hr){return lr<-60||lr>60?-.5*hr:rt.side==="top"!==Wt?-hr:0};else if(zn==="y"){if(Kn=(Ln=!Wt&&wn==="left"||Wt&&wn==="right")?1:-1,Wt&&(Kn*=-1),In=on,mn=un*Kn,En=0,Wt||Math.abs(Jn)!==90||(En=Jn===-90&&wn==="left"||Jn===90&&wn==="right"?he:.5),Wt){var $n=d(Jn)?+Jn:0;if($n!==0){var vr=y.deg2rad($n);Fn=Math.abs(Math.sin(vr))*he*Kn,En=0}}Tn.xFn=function(Qn){return Qn.dx+et-(In+Qn.fontSize*En)*Kn+Fn*Qn.fontSize},Tn.yFn=function(Qn){return Qn.dy+mn+Qn.fontSize*se},Tn.anchorFn=function(Qn,lr){return d(lr)&&Math.abs(lr)===90?"middle":Ln?"end":"start"},Tn.heightFn=function(Qn,lr,hr){return rt.side==="right"&&(lr*=-1),lr<-30?-hr:lr<30?-.5*hr:0}}return Tn},oe.drawTicks=function(rt,et,Et){Et=Et||{};var Bt=et._id+"tick",Ft=[].concat(et.minor&&et.minor.ticks?Et.vals.filter(function(Jt){return Jt.minor&&!Jt.noTick}):[]).concat(et.ticks?Et.vals.filter(function(Jt){return!Jt.minor&&!Jt.noTick}):[]),St=Et.layer.selectAll("path."+Bt).data(Ft,Gt);St.exit().remove(),St.enter().append("path").classed(Bt,1).classed("ticks",1).classed("crisp",Et.crisp!==!1).each(function(Jt){return n.stroke(b.select(this),Jt.minor?et.minor.tickcolor:et.tickcolor)}).style("stroke-width",function(Jt){return l.crispRound(rt,Jt.minor?et.minor.tickwidth:et.tickwidth,1)+"px"}).attr("d",Et.path).style("display",null),Lt(et,[Q]),St.attr("transform",Et.transFn)},oe.drawGrid=function(rt,et,Et){if(Et=Et||{},et.tickmode!=="sync"){var Bt=et._id+"grid",Ft=et.minor&&et.minor.showgrid,St=Ft?Et.vals.filter(function(En){return En.minor}):[],Jt=et.showgrid?Et.vals.filter(function(En){return!En.minor}):[],qt=Et.counterAxis;if(qt&&oe.shouldShowZeroLine(rt,et,qt))for(var en=et.tickmode==="array",Wt=0;Wt=0;Dn--){var In=Dn?un:Pn;if(In){var mn=In.selectAll("path."+Bt).data(Dn?Jt:St,Gt);mn.exit().remove(),mn.enter().append("path").classed(Bt,1).classed("crisp",Et.crisp!==!1),mn.attr("transform",Et.transFn).attr("d",Et.path).each(function(En){return n.stroke(b.select(this),En.minor?et.minor.gridcolor:et.gridcolor||"#ddd")}).style("stroke-dasharray",function(En){return l.dashStyle(En.minor?et.minor.griddash:et.griddash,En.minor?et.minor.gridwidth:et.gridwidth)}).style("stroke-width",function(En){return(En.minor?on:et._gw)+"px"}).style("display",null),typeof Et.path=="function"&&mn.attr("d",Et.path)}}Lt(et,[H,J])}},oe.drawZeroLine=function(rt,et,Et){Et=Et||Et;var Bt=et._id+"zl",Ft=oe.shouldShowZeroLine(rt,et,Et.counterAxis),St=Et.layer.selectAll("path."+Bt).data(Ft?[{x:0,id:et._id}]:[]);St.exit().remove(),St.enter().append("path").classed(Bt,1).classed("zl",1).classed("crisp",Et.crisp!==!1).each(function(){Et.layer.selectAll("path").sort(function(Jt,qt){return ye(Jt.id,qt.id)})}),St.attr("transform",Et.transFn).attr("d",Et.path).call(n.stroke,et.zerolinecolor||n.defaultLine).style("stroke-width",l.crispRound(rt,et.zerolinewidth,et._gw||1)+"px").style("display",null),Lt(et,[ee])},oe.drawLabels=function(rt,et,Et){Et=Et||{};var Bt=rt._fullLayout,Ft=et._id,St=Et.cls||Ft+"tick",Jt=Et.vals.filter(function(Or){return Or.text}),qt=Et.labelFns,en=Et.secondary?0:et.tickangle,Wt=(et._prevTickAngles||{})[St],Zt=Et.layer.selectAll("g."+St).data(et.showticklabels?Jt:[],Gt),on=[];function un(Or,Ar){Or.each(function(xr){var Qr=b.select(this),kn=Qr.select(".text-math-group"),Cn=qt.anchorFn(xr,Ar),ur=Et.transFn.call(Qr.node(),xr)+(d(Ar)&&+Ar!=0?" rotate("+Ar+","+qt.xFn(xr)+","+(qt.yFn(xr)-xr.fontSize/2)+")":""),Zn=u.lineCount(Qr),cr=fe*xr.fontSize,Ir=qt.heightFn(xr,d(Ar)?+Ar:0,(Zn-1)*cr);if(Ir&&(ur+=_(0,Ir)),kn.empty()){var Er=Qr.select("text");Er.attr({transform:ur,"text-anchor":Cn}),Er.style("opacity",1),et._adjustTickLabelsOverflow&&et._adjustTickLabelsOverflow()}else{var Xr=l.bBox(kn.node()).width*{end:-.5,start:.5}[Cn];kn.attr("transform",ur+_(Xr,0))}})}Zt.enter().append("g").classed(St,1).append("text").attr("text-anchor","middle").each(function(Or){var Ar=b.select(this),xr=rt._promises.length;Ar.call(u.positionText,qt.xFn(Or),qt.yFn(Or)).call(l.font,{family:Or.font,size:Or.fontSize,color:Or.fontColor,weight:Or.fontWeight,style:Or.fontStyle,variant:Or.fontVariant,textcase:Or.fontTextcase,lineposition:Or.fontLineposition,shadow:Or.fontShadow}).text(Or.text).call(u.convertToTspans,rt),rt._promises[xr]?on.push(rt._promises.pop().then(function(){un(Ar,en)})):un(Ar,en)}),Lt(et,[Z]),Zt.exit().remove(),Et.repositionOnUpdate&&Zt.each(function(Or){b.select(this).select("text").call(u.positionText,qt.xFn(Or),qt.yFn(Or))}),et._adjustTickLabelsOverflow=function(){var Or=et.ticklabeloverflow;if(Or&&Or!=="allow"){var Ar=Or.indexOf("hide")!==-1,xr=et._id.charAt(0)==="x",Qr=0,kn=xr?rt._fullLayout.width:rt._fullLayout.height;if(Or.indexOf("domain")!==-1){var Cn=y.simpleMap(et.range,et.r2l);Qr=et.l2p(Cn[0])+et._offset,kn=et.l2p(Cn[1])+et._offset}var ur=Math.min(Qr,kn),Zn=Math.max(Qr,kn),cr=et.side,Ir=1/0,Er=-1/0;for(var Xr in Zt.each(function(Yn){var an=b.select(this);if(an.select(".text-math-group").empty()){var _n=l.bBox(an.node()),gn=0;xr?(_n.right>Zn||_n.leftZn||_n.top+(et.tickangle?0:Yn.fontSize/4)et["_visibleLabelMin_"+Cn._id]?bn.style("display","none"):Zn.K!=="tick"||ur||bn.style("display",null)})})})})},un(Zt,Wt+1?Wt:en);var Pn=null;et._selections&&(et._selections[St]=Zt);var Dn=[function(){return on.length&&Promise.all(on)}];et.automargin&&Bt._redrawFromAutoMarginCount&&Wt===90?(Pn=Wt,Dn.push(function(){un(Zt,Wt)})):Dn.push(function(){if(un(Zt,en),Jt.length&&et.autotickangles&&(et.type!=="log"||String(et.dtick).charAt(0)!=="D")){Pn=et.autotickangles[0];var Or,Ar=0,xr=[],Qr=1;Zt.each(function(Bn){Ar=Math.max(Ar,Bn.fontSize);var dn=et.l2p(Bn.x),ln=ft(this),An=l.bBox(ln.node());Qr=Math.max(Qr,u.lineCount(ln)),xr.push({top:0,bottom:10,height:10,left:dn-An.width/2,right:dn+An.width/2+2,width:An.width+2})});var kn=(et.tickson==="boundaries"||et.showdividers)&&!Et.secondary,Cn=Jt.length,ur=Math.abs((Jt[Cn-1].x-Jt[0].x)*et._m)/(Cn-1),Zn=kn?ur/2:ur,cr=kn?et.ticklen:1.25*Ar*Qr,Ir=Zn/Math.sqrt(Math.pow(Zn,2)+Math.pow(cr,2)),Er=et.autotickangles.map(function(Bn){return Bn*Math.PI/180}),Xr=Er.find(function(Bn){return Math.abs(Math.cos(Bn))<=Ir});Xr===void 0&&(Xr=Er.reduce(function(Bn,dn){return Math.abs(Math.cos(Bn))hr*lr&&($n=lr,wn[Fn]=zn[Fn]=vr[Fn])}var jr=Math.abs($n-Jn);jr-Kn>0?Kn*=1+Kn/(jr-=Kn):Kn=0,et._id.charAt(0)!=="y"&&(Kn=-Kn),wn[Tn]=mn.p2r(mn.r2p(zn[Tn])+Ln*Kn),mn.autorange==="min"||mn.autorange==="max reversed"?(wn[0]=null,mn._rangeInitial0=void 0,mn._rangeInitial1=void 0):mn.autorange!=="max"&&mn.autorange!=="min reversed"||(wn[1]=null,mn._rangeInitial0=void 0,mn._rangeInitial1=void 0),Bt._insideTickLabelsUpdaterange[mn._name+".range"]=wn}var ni=y.syncOrAsync(Dn);return ni&&ni.then&&rt._promises.push(ni),ni},oe.getPxPosition=function(rt,et){var Et,Bt=rt._fullLayout._size,Ft=et._id.charAt(0),St=et.side;return et.anchor!=="free"?Et=et._anchorAxis:Ft==="x"?Et={_offset:Bt.t+(1-(et.position||0))*Bt.h,_length:0}:Ft==="y"&&(Et={_offset:Bt.l+(et.position||0)*Bt.w+et._shift,_length:0}),St==="top"||St==="left"?Et._offset:St==="bottom"||St==="right"?Et._offset+Et._length:void 0},oe.shouldShowZeroLine=function(rt,et,Et){var Bt=y.simpleMap(et.range,et.r2l);return Bt[0]*Bt[1]<=0&&et.zeroline&&(et.type==="linear"||et.type==="-")&&!(et.rangebreaks&&et.maskBreaks(0)===$)&&(Qe(et,0)||!function(Ft,St,Jt,qt){var en=Jt._mainAxis;if(en){var Wt=Ft._fullLayout,Zt=St._id.charAt(0),on=oe.counterLetter(St._id),un=St._offset+(Math.abs(qt[0])1)for(qt=1;qt2*M}(c,o))return"date";var k=s.autotypenumbers!=="strict";return function(A,v){for(var S=A.length,T=n(S),p=0,M=0,f={},E=0;E2*p}(c,k)?"category":function(A,v){for(var S=A.length,T=0;T=2){var f,E,I="";if(M.length===2){for(f=0;f<2;f++)if(E=A(M[f])){I=x;break}}var B=p("pattern",I);if(B===x)for(f=0;f<2;f++)(E=A(M[f]))&&(S.bounds[f]=M[f]=E-1);if(B)for(f=0;f<2;f++)switch(E=M[f],B){case x:if(!b(E)||(E=+E)!==Math.floor(E)||E<0||E>=7)return void(S.enabled=!1);S.bounds[f]=M[f]=E;break;case m:if(!b(E)||(E=+E)<0||E>24)return void(S.enabled=!1);S.bounds[f]=M[f]=E}if(T.autorange===!1){var N=T.range;if(N[0]N[1])return void(S.enabled=!1)}else if(M[0]>N[0]&&M[1]u?1:-1:+(w.substr(1)||1)-+(y.substr(1)||1)},L.ref2id=function(w){return!!/^[xyz]/.test(w)&&w.split(" ")[0]},L.isLinked=function(w,y){return e(y,w._axisMatchGroups)||e(y,w._axisConstraintGroups)}},46473:function(D,L,t){var b=t(87800).isTypedArraySpec;D.exports=function(d,e,w,y){if(e.type==="category"){var _,u=d.categoryarray,r=Array.isArray(u)&&u.length>0||b(u);r&&(_="array");var n,l=w("categoryorder",_);l==="array"&&(n=w("categoryarray")),r||l!=="array"||(l=e.categoryorder="trace"),l==="trace"?e._initialCategories=[]:l==="array"?e._initialCategories=n.slice():(n=function(o,s){var c,h,x,m=s.dataAttr||o._id.charAt(0),g={};if(s.axData)c=s.axData;else for(c=[],h=0;hA?v.substr(A):S.substr(k))+T:v+S+m*g:T}function h(m,g){for(var k=g._size,A=k.h/k.w,v={},S=Object.keys(m),T=0;Tu*N)||ee){for(k=0;kie&&yehe&&(he=ye);M/=(he-se)/(2*fe),se=S.l2r(se),he=S.l2r(he),S.range=S._input.range=Z=0?Math.min(ye,.9):1/(1/Math.max(ye,-.3)+3.222))}function Z(ye,me,be,Se,Ee){return ye.append("path").attr("class","zoombox").style({fill:me>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(be,Se)).attr("d",Ee+"Z")}function K(ye,me,be){return ye.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(me,be)).attr("d","M0,0Z")}function ae(ye,me,be,Se,Ee,Ce){ye.attr("d",Se+"M"+be.l+","+be.t+"v"+be.h+"h"+be.w+"v-"+be.h+"h-"+be.w+"Z"),se(ye,me,Ee,Ce)}function se(ye,me,be,Se){be||(ye.transition().style("fill",Se>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),me.transition().style("opacity",1).duration(200))}function he(ye){b.select(ye).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function fe(ye){V&&ye.data&&ye._context.showTips&&(d.notifier(d._(ye,"Double-click to zoom back out"),"long"),V=!1)}function ie(ye){var me=Math.floor(Math.min(ye.b-ye.t,ye.r-ye.l,N)/2);return"M"+(ye.l-3.5)+","+(ye.t-.5+me)+"h3v"+-me+"h"+me+"v-3h-"+(me+3)+"ZM"+(ye.r+3.5)+","+(ye.t-.5+me)+"h-3v"+-me+"h"+-me+"v-3h"+(me+3)+"ZM"+(ye.r+3.5)+","+(ye.b+.5-me)+"h-3v"+me+"h"+-me+"v3h"+(me+3)+"ZM"+(ye.l-3.5)+","+(ye.b+.5-me)+"h3v"+me+"h"+me+"v3h-"+(me+3)+"Z"}function oe(ye,me,be,Se,Ee){for(var Ce,Le,Oe,We,Ie=!1,Ve={},Pe={},de=(Ee||{}).xaHash,Me=(Ee||{}).yaHash,ke=0;ke=0)wn._fullLayout._deactivateShape(wn);else{var zn=wn._fullLayout.clickmode;if(he(wn),Tn!==2||Qe||Dn(),st)zn.indexOf("select")>-1&&f(Fn,wn,de,Me,me.id,et),zn.indexOf("event")>-1&&o.click(wn,Fn,me.id);else if(Tn===1&&Qe){var Jn=Le?Ie:We,$n=Le==="s"||Oe==="w"?0:1,vr=Jn._name+".range["+$n+"]",Qn=function(jr,ni){var Or,Ar=jr.range[ni],xr=Math.abs(Ar-jr.range[1-ni]);return jr.type==="date"?Ar:jr.type==="log"?(Or=Math.ceil(Math.max(0,-Math.log(xr)/Math.LN10))+3,e("."+Or+"g")(Math.pow(10,Ar))):(Or=Math.floor(Math.log(Math.abs(Ar))/Math.LN10)-Math.floor(Math.log(xr)/Math.LN10)+4,e("."+String(Or)+"g")(Ar))}(Jn,$n),lr="left",hr="middle";if(Jn.fixedrange)return;Le?(hr=Le==="n"?"top":"bottom",Jn.side==="right"&&(lr="right")):Oe==="e"&&(lr="right"),wn._context.showAxisRangeEntryBoxes&&b.select(Ot).call(r.makeEditable,{gd:wn,immediate:!0,background:wn._fullLayout.paper_bgcolor,text:String(Qn),fill:Jn.tickfont?Jn.tickfont.color:"#444",horizontalAlign:lr,verticalAlign:hr}).on("edit",function(jr){var ni=Jn.d2r(jr);ni!==void 0&&_.call("_guiRelayout",wn,vr,ni)})}}}function Ft(Tn,Fn){if(ye._transitioningWithDuration)return!1;var wn=Math.max(0,Math.min(Fe,Nt*Tn+Pt)),zn=Math.max(0,Math.min(qe,Ht*Fn+at)),Jn=Math.abs(wn-Pt),$n=Math.abs(zn-at);function vr(){vt="",lt.r=lt.l,lt.t=lt.b,Ut.attr("d","M0,0Z")}if(lt.l=Math.min(Pt,wn),lt.r=Math.max(Pt,wn),lt.t=Math.min(at,zn),lt.b=Math.max(at,zn),$e.isSubplotConstrained)Jn>N||$n>N?(vt="xy",Jn/Fe>$n/qe?($n=Jn*qe/Fe,at>zn?lt.t=at-$n:lt.b=at+$n):(Jn=$n*Fe/qe,Pt>wn?lt.l=Pt-Jn:lt.r=Pt+Jn),Ut.attr("d",ie(lt))):vr();else if(Ye.isSubplotConstrained)if(Jn>N||$n>N){vt="xy";var Qn=Math.min(lt.l/Fe,(qe-lt.b)/qe),lr=Math.max(lt.r/Fe,(qe-lt.t)/qe);lt.l=Qn*Fe,lt.r=lr*Fe,lt.b=(1-Qn)*qe,lt.t=(1-lr)*qe,Ut.attr("d",ie(lt))}else vr();else!De||$n0){var hr;if(Ye.isSubplotConstrained||!_e&&De.length===1){for(hr=0;hr1&&(zn.maxallowed!==void 0&&Ge===(zn.range[0]1&&(Jn.maxallowed!==void 0&&tt===(Jn.range[0]1)if(f)k.xlines=l(v,"path","xlines-above"),k.ylines=l(v,"path","ylines-above"),k.xaxislayer=l(v,"g","xaxislayer-above"),k.yaxislayer=l(v,"g","yaxislayer-above");else{if(!T){var E=l(v,"g","layer-subplot");k.shapelayer=l(E,"g","shapelayer"),k.imagelayer=l(E,"g","imagelayer"),k.minorGridlayer=l(v,"g","minor-gridlayer"),k.gridlayer=l(v,"g","gridlayer"),k.zerolinelayer=l(v,"g","zerolinelayer");var I=l(v,"g","layer-between");k.shapelayerBetween=l(I,"g","shapelayer"),k.imagelayerBetween=l(I,"g","imagelayer"),l(v,"path","xlines-below"),l(v,"path","ylines-below"),k.overlinesBelow=l(v,"g","overlines-below"),l(v,"g","xaxislayer-below"),l(v,"g","yaxislayer-below"),k.overaxesBelow=l(v,"g","overaxes-below")}k.overplot=l(v,"g","overplot"),k.plot=l(k.overplot,"g",S),T||(k.xlines=l(v,"path","xlines-above"),k.ylines=l(v,"path","ylines-above"),k.overlinesAbove=l(v,"g","overlines-above"),l(v,"g","xaxislayer-above"),l(v,"g","yaxislayer-above"),k.overaxesAbove=l(v,"g","overaxes-above"),k.xlines=v.select(".xlines-"+p),k.ylines=v.select(".ylines-"+M),k.xaxislayer=v.select(".xaxislayer-"+p),k.yaxislayer=v.select(".yaxislayer-"+M))}else{var B=k.mainplotinfo,N=B.plotgroup,V=S+"-x",j=S+"-y";k.minorGridlayer=B.minorGridlayer,k.gridlayer=B.gridlayer,k.zerolinelayer=B.zerolinelayer,l(B.overlinesBelow,"path",V),l(B.overlinesBelow,"path",j),l(B.overaxesBelow,"g",V),l(B.overaxesBelow,"g",j),k.plot=l(B.overplot,"g",S),l(B.overlinesAbove,"path",V),l(B.overlinesAbove,"path",j),l(B.overaxesAbove,"g",V),l(B.overaxesAbove,"g",j),k.xlines=N.select(".overlines-"+p).select("."+V),k.ylines=N.select(".overlines-"+M).select("."+j),k.xaxislayer=N.select(".overaxes-"+p).select("."+V),k.yaxislayer=N.select(".overaxes-"+M).select("."+j)}T||(f||(o(k.minorGridlayer,"g",k.xaxis._id),o(k.minorGridlayer,"g",k.yaxis._id),k.minorGridlayer.selectAll("g").map(function($){return $[0]}).sort(u.idSort),o(k.gridlayer,"g",k.xaxis._id),o(k.gridlayer,"g",k.yaxis._id),k.gridlayer.selectAll("g").map(function($){return $[0]}).sort(u.idSort)),k.xlines.style("fill","none").classed("crisp",!0),k.ylines.style("fill","none").classed("crisp",!0))}function x(g,k){if(g){var A={};for(var v in g.each(function(M){var f=M[0];b.select(this).remove(),m(f,k),A[f]=!0}),k._plots)for(var S=k._plots[v].overlays||[],T=0;T0){var V=N.id;if(V.indexOf(s)!==-1)continue;V+=s+(E+1),N=e.extendFlat({},N,{id:V,plot:T._cartesianlayer.selectAll(".subplot").select("."+V)})}for(var j,$=[],ee=0;ee1&&(Ce+=s+Ee),Se.push(H+Ce),ee=0;eeS[1]-.000244140625&&(w.domain=r),d.noneOrAll(e.domain,w.domain,r),w.tickmode==="sync"&&(w.tickmode="auto")}return y("layer"),w}},54616:function(D,L,t){var b=t(87703);D.exports=function(d,e,w,y,_){_||(_={});var u=_.tickSuffixDflt,r=b(d);w("tickprefix")&&w("showtickprefix",r),w("ticksuffix",u)&&w("showticksuffix",r)}},90259:function(D,L,t){var b=t(75511);D.exports=function(d,e,w,y){var _=e._template||{},u=e.type||_.type||"-";w("minallowed"),w("maxallowed");var r,n=w("range");n||y.noInsiderange||u==="log"||(!(r=w("insiderange"))||r[0]!==null&&r[1]!==null||(e.insiderange=!1,r=void 0),r&&(n=w("range",r)));var l,o=e.getAutorangeDflt(n,y),s=w("autorange",o);!n||(n[0]!==null||n[1]!==null)&&(n[0]!==null&&n[1]!==null||s!=="reversed"&&s!==!0)&&(n[0]===null||s!=="min"&&s!=="max reversed")&&(n[1]===null||s!=="max"&&s!=="min reversed")||(n=void 0,delete e.range,e.autorange=!0,l=!0),l||(s=w("autorange",o=e.getAutorangeDflt(n,y))),s&&(b(w,s,n),u!=="linear"&&u!=="-"||w("rangemode")),e.cleanRange()}},67611:function(D,L,t){var b=t(4530).FROM_BL;D.exports=function(d,e,w){w===void 0&&(w=b[d.constraintoward||"center"]);var y=[d.r2l(d.range[0]),d.r2l(d.range[1])],_=y[0]+(y[1]-y[0])*w;d.range=d._input.range=[d.l2r(_+(y[0]-_)*e),d.l2r(_+(y[1]-_)*e)],d.setScale()}},19091:function(D,L,t){var b=t(45568),d=t(42696).aL,e=t(34809),w=e.numberFormat,y=t(10721),_=e.cleanNumber,u=e.ms2DateTime,r=e.dateTime2ms,n=e.ensureNumber,l=e.isArrayOrTypedArray,o=t(63821),s=o.FP_SAFE,c=o.BADNUM,h=o.LOG_CLIP,x=o.ONEWEEK,m=o.ONEDAY,g=o.ONEHOUR,k=o.ONEMIN,A=o.ONESEC,v=t(5975),S=t(54826),T=S.HOUR_PATTERN,p=S.WEEKDAY_PATTERN;function M(E){return Math.pow(10,E)}function f(E){return E!=null}D.exports=function(E,I){I=I||{};var B=E._id||"x",N=B.charAt(0);function V(oe,le){if(oe>0)return Math.log(oe)/Math.LN10;if(oe<=0&&le&&E.range&&E.range.length===2){var ge=E.range[0],ye=E.range[1];return .5*(ge+ye-2*h*Math.abs(ge-ye))}return c}function j(oe,le,ge,ye){if((ye||{}).msUTC&&y(oe))return+oe;var me=r(oe,ge||E.calendar);if(me===c){if(!y(oe))return c;oe=+oe;var be=Math.floor(10*e.mod(oe+.05,1)),Se=Math.round(oe-be/10);me=r(new Date(Se))+be/10}return me}function $(oe,le,ge){return u(oe,le,ge||E.calendar)}function ee(oe){return E._categories[Math.round(oe)]}function H(oe){if(f(oe)){if(E._categoriesMap===void 0&&(E._categoriesMap={}),E._categoriesMap[oe]!==void 0)return E._categoriesMap[oe];E._categories.push(typeof oe=="number"?String(oe):oe);var le=E._categories.length-1;return E._categoriesMap[oe]=le,le}return c}function J(oe){if(E._categoriesMap)return E._categoriesMap[oe]}function Q(oe){var le=J(oe);return le!==void 0?le:y(oe)?+oe:void 0}function Z(oe){return y(oe)?+oe:J(oe)}function K(oe,le,ge){return b.round(ge+le*oe,2)}function ae(oe,le,ge){return(oe-ge)/le}var se=function(oe){return y(oe)?K(oe,E._m,E._b):c},he=function(oe){return ae(oe,E._m,E._b)};if(E.rangebreaks){var fe=N==="y";se=function(oe){if(!y(oe))return c;var le=E._rangebreaks.length;if(!le)return K(oe,E._m,E._b);var ge=fe;E.range[0]>E.range[1]&&(ge=!ge);for(var ye=ge?-1:1,me=ye*oe,be=0,Se=0;SeCe)){be=me<(Ee+Ce)/2?Se:Se+1;break}be=Se+1}var Le=E._B[be]||0;return isFinite(Le)?K(oe,E._m2,Le):0},he=function(oe){var le=E._rangebreaks.length;if(!le)return ae(oe,E._m,E._b);for(var ge=0,ye=0;yeE._rangebreaks[ye].pmax&&(ge=ye+1);return ae(oe,E._m2,E._B[ge])}}E.c2l=E.type==="log"?V:n,E.l2c=E.type==="log"?M:n,E.l2p=se,E.p2l=he,E.c2p=E.type==="log"?function(oe,le){return se(V(oe,le))}:se,E.p2c=E.type==="log"?function(oe){return M(he(oe))}:he,["linear","-"].indexOf(E.type)!==-1?(E.d2r=E.r2d=E.d2c=E.r2c=E.d2l=E.r2l=_,E.c2d=E.c2r=E.l2d=E.l2r=n,E.d2p=E.r2p=function(oe){return E.l2p(_(oe))},E.p2d=E.p2r=he,E.cleanPos=n):E.type==="log"?(E.d2r=E.d2l=function(oe,le){return V(_(oe),le)},E.r2d=E.r2c=function(oe){return M(_(oe))},E.d2c=E.r2l=_,E.c2d=E.l2r=n,E.c2r=V,E.l2d=M,E.d2p=function(oe,le){return E.l2p(E.d2r(oe,le))},E.p2d=function(oe){return M(he(oe))},E.r2p=function(oe){return E.l2p(_(oe))},E.p2r=he,E.cleanPos=n):E.type==="date"?(E.d2r=E.r2d=e.identity,E.d2c=E.r2c=E.d2l=E.r2l=j,E.c2d=E.c2r=E.l2d=E.l2r=$,E.d2p=E.r2p=function(oe,le,ge){return E.l2p(j(oe,0,ge))},E.p2d=E.p2r=function(oe,le,ge){return $(he(oe),le,ge)},E.cleanPos=function(oe){return e.cleanDate(oe,c,E.calendar)}):E.type==="category"?(E.d2c=E.d2l=H,E.r2d=E.c2d=E.l2d=ee,E.d2r=E.d2l_noadd=Q,E.r2c=function(oe){var le=Z(oe);return le!==void 0?le:E.fraction2r(.5)},E.l2r=E.c2r=n,E.r2l=Z,E.d2p=function(oe){return E.l2p(E.r2c(oe))},E.p2d=function(oe){return ee(he(oe))},E.r2p=E.d2p,E.p2r=he,E.cleanPos=function(oe){return typeof oe=="string"&&oe!==""?oe:n(oe)}):E.type==="multicategory"&&(E.r2d=E.c2d=E.l2d=ee,E.d2r=E.d2l_noadd=Q,E.r2c=function(oe){var le=Q(oe);return le!==void 0?le:E.fraction2r(.5)},E.r2c_just_indices=J,E.l2r=E.c2r=n,E.r2l=Q,E.d2p=function(oe){return E.l2p(E.r2c(oe))},E.p2d=function(oe){return ee(he(oe))},E.r2p=E.d2p,E.p2r=he,E.cleanPos=function(oe){return Array.isArray(oe)||typeof oe=="string"&&oe!==""?oe:n(oe)},E.setupMultiCategory=function(oe){var le,ge,ye=E._traceIndices,me=E._matchGroup;if(me&&E._categories.length===0){for(var be in me)if(be!==B){var Se=I[v.id2name(be)];ye=ye.concat(Se._traceIndices)}}var Ee=[[0,{}],[0,{}]],Ce=[];for(le=0;leSe[1]&&(ye[be?0:1]=ge),ye[0]===ye[1]){var Ee=E.l2r(le),Ce=E.l2r(ge);if(le!==void 0){var Le=Ee+1;ge!==void 0&&(Le=Math.min(Le,Ce)),ye[be?1:0]=Le}if(ge!==void 0){var Oe=Ce+1;le!==void 0&&(Oe=Math.max(Oe,Ee)),ye[be?0:1]=Oe}}}},E.cleanRange=function(oe,le){E._cleanRange(oe,le),E.limitRange(oe)},E._cleanRange=function(oe,le){le||(le={}),oe||(oe="range");var ge,ye,me=e.nestedProperty(E,oe).get();if(ye=(ye=E.type==="date"?e.dfltRange(E.calendar):N==="y"?S.DFLTRANGEY:E._name==="realaxis"?[0,1]:le.dfltRange||S.DFLTRANGEX).slice(),E.rangemode!=="tozero"&&E.rangemode!=="nonnegative"||(ye[0]=0),me&&me.length===2){var be=me[0]===null,Se=me[1]===null;for(E.type!=="date"||E.autorange||(me[0]=e.cleanDate(me[0],c,E.calendar),me[1]=e.cleanDate(me[1],c,E.calendar)),ge=0;ge<2;ge++)if(E.type==="date"){if(!e.isDateTime(me[ge],E.calendar)){E[oe]=ye;break}if(E.r2l(me[0])===E.r2l(me[1])){var Ee=e.constrain(E.r2l(me[0]),e.MIN_MS+1e3,e.MAX_MS-1e3);me[0]=E.l2r(Ee-1e3),me[1]=E.l2r(Ee+1e3);break}}else{if(!y(me[ge])){if(be||Se||!y(me[1-ge])){E[oe]=ye;break}me[ge]=me[1-ge]*(ge?10:.1)}if(me[ge]<-s?me[ge]=-s:me[ge]>s&&(me[ge]=s),me[0]===me[1]){var Ce=Math.max(1,Math.abs(1e-6*me[0]));me[0]-=Ce,me[1]+=Ce}}}else e.nestedProperty(E,oe).set(ye)},E.setScale=function(oe){var le=I._size;if(E.overlaying){var ge=v.getFromId({_fullLayout:I},E.overlaying);E.domain=ge.domain}var ye=oe&&E._r?"_r":"range",me=E.calendar;E.cleanRange(ye);var be,Se,Ee=E.r2l(E[ye][0],me),Ce=E.r2l(E[ye][1],me),Le=N==="y";if(Le?(E._offset=le.t+(1-E.domain[1])*le.h,E._length=le.h*(E.domain[1]-E.domain[0]),E._m=E._length/(Ee-Ce),E._b=-E._m*Ce):(E._offset=le.l+E.domain[0]*le.w,E._length=le.w*(E.domain[1]-E.domain[0]),E._m=E._length/(Ce-Ee),E._b=-E._m*Ee),E._rangebreaks=[],E._lBreaks=0,E._m2=0,E._B=[],E.rangebreaks&&(E._rangebreaks=E.locateBreaks(Math.min(Ee,Ce),Math.max(Ee,Ce)),E._rangebreaks.length)){for(be=0;beCe&&(Oe=!Oe),Oe&&E._rangebreaks.reverse();var We=Oe?-1:1;for(E._m2=We*E._length/(Math.abs(Ce-Ee)-E._lBreaks),E._B.push(-E._m2*(Le?Ce:Ee)),be=0;beye&&(ye+=7,meye&&(ye+=24,me=ge&&me=ge&&oe=Ye.min&&(HeYe.max&&(Ye.max=Fe),qe=!1)}qe&&Se.push({min:He,max:Fe})}};for(ge=0;ger.duration?(function(){for(var T={},p=0;p rect").call(w.setTranslate,0,0).call(w.setScale,1,1),k.plot.call(w.setTranslate,A._offset,v._offset).call(w.setScale,1,1);var S=k.plot.selectAll(".scatterlayer .trace");S.selectAll(".point").call(w.setPointGroupScale,1,1),S.selectAll(".textpoint").call(w.setTextPointsScale,1,1),S.call(w.hideOutsideRangePoints,k)}function g(k,A){var v=k.plotinfo,S=v.xaxis,T=v.yaxis,p=S._length,M=T._length,f=!!k.xr1,E=!!k.yr1,I=[];if(f){var B=e.simpleMap(k.xr0,S.r2l),N=e.simpleMap(k.xr1,S.r2l),V=B[1]-B[0],j=N[1]-N[0];I[0]=(B[0]*(1-A)+A*N[0]-B[0])/(B[1]-B[0])*p,I[2]=p*(1-A+A*j/V),S.range[0]=S.l2r(B[0]*(1-A)+A*N[0]),S.range[1]=S.l2r(B[1]*(1-A)+A*N[1])}else I[0]=0,I[2]=p;if(E){var $=e.simpleMap(k.yr0,T.r2l),ee=e.simpleMap(k.yr1,T.r2l),H=$[1]-$[0],J=ee[1]-ee[0];I[1]=($[1]*(1-A)+A*ee[1]-$[1])/($[0]-$[1])*M,I[3]=M*(1-A+A*J/H),T.range[0]=S.l2r($[0]*(1-A)+A*ee[0]),T.range[1]=T.l2r($[1]*(1-A)+A*ee[1])}else I[1]=0,I[3]=M;y.drawOne(_,S,{skipTitle:!0}),y.drawOne(_,T,{skipTitle:!0}),y.redrawComponents(_,[S._id,T._id]);var Q=f?p/I[2]:1,Z=E?M/I[3]:1,K=f?I[0]:0,ae=E?I[1]:0,se=f?I[0]/I[2]*p:0,he=E?I[1]/I[3]*M:0,fe=S._offset-se,ie=T._offset-he;v.clipRect.call(w.setTranslate,K,ae).call(w.setScale,1/Q,1/Z),v.plot.call(w.setTranslate,fe,ie).call(w.setScale,Q,Z),w.setPointGroupScale(v.zoomScalePts,1/Q,1/Z),w.setTextPointsScale(v.zoomScaleTxt,1/Q,1/Z)}y.redrawComponents(_)}},4392:function(D,L,t){var b=t(33626).traceIs,d=t(9666);function e(y){return{v:"x",h:"y"}[y.orientation||"v"]}function w(y,_){var u=e(y),r=b(y,"box-violin"),n=b(y._fullInput||{},"candlestick");return r&&!n&&_===u&&y[u]===void 0&&y[u+"0"]===void 0}D.exports=function(y,_,u,r){u("autotypenumbers",r.autotypenumbersDflt),u("type",(r.splomStash||{}).type)==="-"&&(function(n,l){if(n.type==="-"){var o,s=n._id,c=s.charAt(0);s.indexOf("scene")!==-1&&(s=c);var h=function(T,p,M){for(var f=0;f0&&(E["_"+M+"axes"]||{})[p]||(E[M+"axis"]||M)===p&&(w(E,M)||(E[M]||[]).length||E[M+"0"]))return E}}(l,s,c);if(h)if(h.type!=="histogram"||c!=={v:"y",h:"x"}[h.orientation||"v"]){var x=c+"calendar",m=h[x],g={noMultiCategory:!b(h,"cartesian")||b(h,"noMultiCategory")};if(h.type==="box"&&h._hasPreCompStats&&c==={h:"x",v:"y"}[h.orientation||"v"]&&(g.noMultiCategory=!0),g.autotypenumbers=n.autotypenumbers,w(h,c)){var k=e(h),A=[];for(o=0;o0?".":"")+o;d.isPlainObject(s)?_(s,r,c,l+1):r(c,o,s)}})}L.manageCommandObserver=function(u,r,n,l){var o={},s=!0;r&&r._commandObserver&&(o=r._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=L.hasSimpleAPICommandBindings(u,n,o.lookupTable);if(r&&r._commandObserver){if(c)return o;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,o}if(c){e(u,c,o.cache),o.check=function(){if(s){var m=e(u,c,o.cache);return m.changed&&l&&o.lookupTable[m.value]!==void 0&&(o.disable(),Promise.resolve(l({value:m.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[m.value]})).then(o.enable,o.enable)),m.changed}};for(var h=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0&&j<0&&(j+=360);var H=(j-V)/4;return{type:"Polygon",coordinates:[[[V,$],[V,ee],[V+H,ee],[V+2*H,ee],[V+3*H,ee],[j,ee],[j,$],[j-H,$],[j-2*H,$],[j-3*H,$],[V,$]]]}}D.exports=function(I){return new M(I)},f.plot=function(I,B,N,V){var j=this;if(V)return j.update(I,B,!0);j._geoCalcData=I,j._fullLayout=B;var $=B[this.id],ee=[],H=!1;for(var J in v.layerNameToAdjective)if(J!=="frame"&&$["show"+J]){H=!0;break}for(var Q=!1,Z=0;Z0&&ee._module.calcGeoJSON($,B)}if(!N){if(this.updateProjection(I,B))return;this.viewInitial&&this.scope===V.scope||this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(B,V),this.updateDims(B,V),this.updateFx(B,V),s.generalUpdatePerTraceModule(this.graphDiv,this,I,V);var H=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=H.selectAll(".point"),this.dataPoints.text=H.selectAll("text"),this.dataPaths.line=H.selectAll(".js-line");var J=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=J.selectAll("path"),this._render()},f.updateProjection=function(I,B){var N=this.graphDiv,V=B[this.id],j=B._size,$=V.domain,ee=V.projection,H=V.lonaxis,J=V.lataxis,Q=H._ax,Z=J._ax,K=this.projection=function(Pe){var de=Pe.projection,Me=de.type,ke=v.projNames[Me];ke="geo"+u.titleCase(ke);for(var He=(d[ke]||y[ke])(),Fe=Pe._isSatellite?180*Math.acos(1/de.distance)/Math.PI:Pe._isClipped?v.lonaxisSpan[Me]/2:null,qe=["center","rotate","parallels","clipExtent"],$e=function(De){return De?He:[]},Ye=0;YeFe*Math.PI/180}return!1},He.getPath=function(){return e().projection(He)},He.getBounds=function(De){return He.getPath().bounds(De)},He.precision(v.precision),Pe._isSatellite&&He.tilt(de.tilt).distance(de.distance),Fe&&He.clipAngle(Fe-v.clipPad),He}(V),ae=[[j.l+j.w*$.x[0],j.t+j.h*(1-$.y[1])],[j.l+j.w*$.x[1],j.t+j.h*(1-$.y[0])]],se=V.center||{},he=ee.rotation||{},fe=H.range||[],ie=J.range||[];if(V.fitbounds){Q._length=ae[1][0]-ae[0][0],Z._length=ae[1][1]-ae[0][1],Q.range=h(N,Q),Z.range=h(N,Z);var oe=(Q.range[0]+Q.range[1])/2,le=(Z.range[0]+Z.range[1])/2;if(V._isScoped)se={lon:oe,lat:le};else if(V._isClipped){se={lon:oe,lat:le},he={lon:oe,lat:le,roll:he.roll};var ge=ee.type,ye=v.lonaxisSpan[ge]/2||180,me=v.lataxisSpan[ge]/2||90;fe=[oe-ye,oe+ye],ie=[le-me,le+me]}else se={lon:oe,lat:le},he={lon:oe,lat:he.lat,roll:he.roll}}K.center([se.lon-he.lon,se.lat-he.lat]).rotate([-he.lon,-he.lat,he.roll]).parallels(ee.parallels);var be=E(fe,ie);K.fitExtent(ae,be);var Se=this.bounds=K.getBounds(be),Ee=this.fitScale=K.scale(),Ce=K.translate();if(V.fitbounds){var Le=K.getBounds(E(Q.range,Z.range)),Oe=Math.min((Se[1][0]-Se[0][0])/(Le[1][0]-Le[0][0]),(Se[1][1]-Se[0][1])/(Le[1][1]-Le[0][1]));isFinite(Oe)?K.scale(Oe*Ee):u.warn("Something went wrong during"+this.id+"fitbounds computations.")}else K.scale(ee.scale*Ee);var We=this.midPt=[(Se[0][0]+Se[1][0])/2,(Se[0][1]+Se[1][1])/2];if(K.translate([Ce[0]+(We[0]-Ce[0]),Ce[1]+(We[1]-Ce[1])]).clipExtent(Se),V._isAlbersUsa){var Ie=K([se.lon,se.lat]),Ve=K.translate();K.translate([Ve[0]-(Ie[0]-Ve[0]),Ve[1]-(Ie[1]-Ve[1])])}},f.updateBaseLayers=function(I,B){var N=this,V=N.topojson,j=N.layers,$=N.basePaths;function ee(K){return K==="lonaxis"||K==="lataxis"}function H(K){return!!v.lineLayers[K]}function J(K){return!!v.fillLayers[K]}var Q=(this.hasChoropleth?v.layersForChoropleth:v.layers).filter(function(K){return H(K)||J(K)?B["show"+K]:!ee(K)||B[K].showgrid}),Z=N.framework.selectAll(".layer").data(Q,String);Z.exit().each(function(K){delete j[K],delete $[K],b.select(this).remove()}),Z.enter().append("g").attr("class",function(K){return"layer "+K}).each(function(K){var ae=j[K]=b.select(this);K==="bg"?N.bgRect=ae.append("rect").style("pointer-events","all"):ee(K)?$[K]=ae.append("path").style("fill","none"):K==="backplot"?ae.append("g").classed("choroplethlayer",!0):K==="frontplot"?ae.append("g").classed("scatterlayer",!0):H(K)?$[K]=ae.append("path").style("fill","none").style("stroke-miterlimit",2):J(K)&&($[K]=ae.append("path").style("stroke","none"))}),Z.order(),Z.each(function(K){var ae=$[K],se=v.layerNameToAdjective[K];K==="frame"?ae.datum(v.sphereSVG):H(K)||J(K)?ae.datum(p(V,V.objects[K])):ee(K)&&ae.datum(function(he,fe,ie){var oe,le,ge,ye=fe[he],me=v.scopeDefaults[fe.scope];he==="lonaxis"?(oe=me.lonaxisRange,le=me.lataxisRange,ge=function(Ve,Pe){return[Ve,Pe]}):he==="lataxis"&&(oe=me.lataxisRange,le=me.lonaxisRange,ge=function(Ve,Pe){return[Pe,Ve]});var be={type:"linear",range:[oe[0],oe[1]-1e-6],tick0:ye.tick0,dtick:ye.dtick};c.setConvert(be,ie);var Se=c.calcTicks(be);fe.isScoped||he!=="lonaxis"||Se.pop();for(var Ee=Se.length,Ce=new Array(Ee),Le=0;Le-1&&k(b.event,V,[N.xaxis],[N.yaxis],N.id,H),ee.indexOf("event")>-1&&o.click(V,b.event))})}function J(Q){return N.projection.invert([Q[0]+N.xaxis._offset,Q[1]+N.yaxis._offset])}},f.makeFramework=function(){var I=this,B=I.graphDiv,N=B._fullLayout,V="clip"+N._uid+I.id;I.clipDef=N._clips.append("clipPath").attr("id",V),I.clipRect=I.clipDef.append("rect"),I.framework=b.select(I.container).append("g").attr("class","geo "+I.id).call(l.setClipUrl,V,B),I.project=function(j){var $=I.projection(j);return $?[$[0]-I.xaxis._offset,$[1]-I.yaxis._offset]:[null,null]},I.xaxis={_id:"x",c2p:function(j){return I.project(j)[0]}},I.yaxis={_id:"y",c2p:function(j){return I.project(j)[1]}},I.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(I.mockAxis,N)},f.saveViewInitial=function(I){var B,N=I.center||{},V=I.projection,j=V.rotation||{};this.viewInitial={fitbounds:I.fitbounds,"projection.scale":V.scale},B=I._isScoped?{"center.lon":N.lon,"center.lat":N.lat}:I._isClipped?{"projection.rotation.lon":j.lon,"projection.rotation.lat":j.lat}:{"center.lon":N.lon,"center.lat":N.lat,"projection.rotation.lon":j.lon},u.extendFlat(this.viewInitial,B)},f.render=function(I){this._hasMarkerAngles&&I?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},f._render=function(){var I,B=this.projection,N=B.getPath();function V($){var ee=B($.lonlat);return ee?r(ee[0],ee[1]):null}function j($){return B.isLonLatOverEdges($.lonlat)?"none":null}for(I in this.basePaths)this.basePaths[I].attr("d",N);for(I in this.dataPaths)this.dataPaths[I].attr("d",function($){return N($.geojson)});for(I in this.dataPoints)this.dataPoints[I].attr("display",j).attr("transform",V)}},47544:function(D,L,t){var b=t(4173).fX,d=t(34809).counterRegex,e=t(6493),w="geo",y=d(w),_={};_[w]={valType:"subplotid",dflt:w,editType:"calc"},D.exports={attr:w,name:w,idRoot:w,idRegex:y,attrRegex:y,attributes:_,layoutAttributes:t(42194),supplyLayoutDefaults:t(31653),plot:function(u){for(var r=u._fullLayout,n=u.calcdata,l=r._subplots[w],o=0;o0&&J<0&&(J+=360);var Q,Z,K,ae=(H+J)/2;if(!g){var se=k?x.projRotate:[ae,0,0];Q=l("projection.rotation.lon",se[0]),l("projection.rotation.lat",se[1]),l("projection.rotation.roll",se[2]),l("showcoastlines",!k&&p)&&(l("coastlinecolor"),l("coastlinewidth")),l("showocean",!!p&&void 0)&&l("oceancolor")}g?(Z=-96.6,K=38.7):(Z=k?ae:Q,K=(ee[0]+ee[1])/2),l("center.lon",Z),l("center.lat",K),A&&(l("projection.tilt"),l("projection.distance")),v&&l("projection.parallels",x.projParallels||[0,60]),l("projection.scale"),l("showland",!!p&&void 0)&&l("landcolor"),l("showlakes",!!p&&void 0)&&l("lakecolor"),l("showrivers",!!p&&void 0)&&(l("rivercolor"),l("riverwidth")),l("showcountries",k&&h!=="usa"&&p)&&(l("countrycolor"),l("countrywidth")),(h==="usa"||h==="north america"&&c===50)&&(l("showsubunits",p),l("subunitcolor"),l("subunitwidth")),k||l("showframe",p)&&(l("framecolor"),l("framewidth")),l("bgcolor"),l("fitbounds")&&(delete n.projection.scale,k?(delete n.center.lon,delete n.center.lat):S?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}D.exports=function(r,n,l){d(r,n,l,{type:"geo",attributes:y,handleDefaults:u,fullData:l,partition:"y"})}},14309:function(D,L,t){var b=t(45568),d=t(34809),e=t(33626),w=Math.PI/180,y=180/Math.PI,_={cursor:"pointer"},u={cursor:"auto"};function r(k,A){return b.behavior.zoom().translate(A.translate()).scale(A.scale())}function n(k,A,v){var S=k.id,T=k.graphDiv,p=T.layout,M=p[S],f=T._fullLayout,E=f[S],I={},B={};function N(V,j){I[S+"."+V]=d.nestedProperty(M,V).get(),e.call("_storeDirectGUIEdit",p,f._preGUI,I);var $=d.nestedProperty(E,V);$.get()!==j&&($.set(j),d.nestedProperty(M,V).set(j),B[S+"."+V]=j)}v(N),N("projection.scale",A.scale()/k.fitScale),N("fitbounds",!1),T.emit("plotly_relayout",B)}function l(k,A){var v=r(0,A);function S(T){var p=A.invert(k.midPt);T("center.lon",p[0]),T("center.lat",p[1])}return v.on("zoomstart",function(){b.select(this).style(_)}).on("zoom",function(){A.scale(b.event.scale).translate(b.event.translate),k.render(!0);var T=A.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":A.scale()/k.fitScale,"geo.center.lon":T[0],"geo.center.lat":T[1]})}).on("zoomend",function(){b.select(this).style(u),n(k,A,S)}),v}function o(k,A){var v,S,T,p,M,f,E,I,B,N=r(0,A);function V($){return A.invert($)}function j($){var ee=A.rotate(),H=A.invert(k.midPt);$("projection.rotation.lon",-ee[0]),$("center.lon",H[0]),$("center.lat",H[1])}return N.on("zoomstart",function(){b.select(this).style(_),v=b.mouse(this),S=A.rotate(),T=A.translate(),p=S,M=V(v)}).on("zoom",function(){if(f=b.mouse(this),function(H){var J=V(H);if(!J)return!0;var Q=A(J);return Math.abs(Q[0]-H[0])>2||Math.abs(Q[1]-H[1])>2}(v))return N.scale(A.scale()),void N.translate(A.translate());A.scale(b.event.scale),A.translate([T[0],b.event.translate[1]]),M?V(f)&&(I=V(f),E=[p[0]+(I[0]-M[0]),S[1],S[2]],A.rotate(E),p=E):M=V(v=f),B=!0,k.render(!0);var $=A.rotate(),ee=A.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":A.scale()/k.fitScale,"geo.center.lon":ee[0],"geo.center.lat":ee[1],"geo.projection.rotation.lon":-$[0]})}).on("zoomend",function(){b.select(this).style(u),B&&n(k,A,j)}),N}function s(k,A){var v;A.rotate(),A.scale();var S=r(0,A),T=function(E){for(var I=0,B=arguments.length,N=[];++IGe?(He=(_e>0?90:-90)-Be,ke=0):(He=Math.asin(_e/Ge)*y-Be,ke=Math.sqrt(Ge*Ge-_e*_e));var tt=180-He-2*Be,nt=(Math.atan2(De,Ye)-Math.atan2($e,ke))*y,pt=(Math.atan2(De,Ye)-Math.atan2($e,-ke))*y;return h(de[0],de[1],He,nt)<=h(de[0],de[1],tt,pt)?[He,nt,de[2]]:[tt,pt,de[2]]}(We,v,ae);isFinite(Ie[0])&&isFinite(Ie[1])&&isFinite(Ie[2])||(Ie=ae),A.rotate(Ie),ae=Ie}}else v=c(A,Z=Ce);T.of(this,arguments)({type:"zoom"})}),Q=T.of(this,arguments),p++||Q({type:"zoomstart"})}).on("zoomend",function(){var E;b.select(this).style(u),M.call(S,"zoom",null),E=T.of(this,arguments),--p||E({type:"zoomend"}),n(k,A,f)}).on("zoom.redraw",function(){k.render(!0);var E=A.rotate();k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":A.scale()/k.fitScale,"geo.projection.rotation.lon":-E[0],"geo.projection.rotation.lat":-E[1]})}),b.rebind(S,T,"on")}function c(k,A){var v=k.invert(A);return v&&isFinite(v[0])&&isFinite(v[1])&&function(S){var T=S[0]*w,p=S[1]*w,M=Math.cos(p);return[M*Math.cos(T),M*Math.sin(T),Math.sin(p)]}(v)}function h(k,A,v,S){var T=x(v-k),p=x(S-A);return Math.sqrt(T*T+p*p)}function x(k){return(k%360+540)%360-180}function m(k,A,v){var S=v*w,T=k.slice(),p=A===0?1:0,M=A===2?1:2,f=Math.cos(S),E=Math.sin(S);return T[p]=k[p]*f-k[M]*E,T[M]=k[M]*f+k[p]*E,T}function g(k,A){for(var v=0,S=0,T=k.length;SMath.abs(g)?(l.boxEnd[1]=l.boxStart[1]+Math.abs(m)*N*(g>=0?1:-1),l.boxEnd[1]k[3]&&(l.boxEnd[1]=k[3],l.boxEnd[0]=l.boxStart[0]+(k[3]-l.boxStart[1])/Math.abs(N))):(l.boxEnd[0]=l.boxStart[0]+Math.abs(g)/N*(m>=0?1:-1),l.boxEnd[0]k[2]&&(l.boxEnd[0]=k[2],l.boxEnd[1]=l.boxStart[1]+(k[2]-l.boxStart[0])*Math.abs(N)))}}else l.boxEnabled?(m=l.boxStart[0]!==l.boxEnd[0],g=l.boxStart[1]!==l.boxEnd[1],m||g?(m&&(M(0,l.boxStart[0],l.boxEnd[0]),u.xaxis.autorange=!1),g&&(M(1,l.boxStart[1],l.boxEnd[1]),u.yaxis.autorange=!1),u.relayoutCallback()):u.glplot.setDirty(),l.boxEnabled=!1,l.boxInited=!1):l.boxInited&&(l.boxInited=!1);break;case"pan":l.boxEnabled=!1,l.boxInited=!1,c?(l.panning||(l.dragStart[0]=h,l.dragStart[1]=x),Math.abs(l.dragStart[0]-h).999&&(S="turntable"):S="turntable")}else S="turntable";s("dragmode",S),s("hovermode",c.getDfltFromLayout("hovermode"))}D.exports=function(l,o,s){var c=o._basePlotModules.length>1;w(l,o,s,{type:r,attributes:_,handleDefaults:n,fullLayout:o,font:o.font,fullData:s,getDfltFromLayout:function(h){if(!c)return b.validate(l[h],_[h])?l[h]:void 0},autotypenumbersDflt:o.autotypenumbers,paper_bgcolor:o.paper_bgcolor,calendar:o.calendar})}},77168:function(D,L,t){var b=t(63397),d=t(13792).u,e=t(93049).extendFlat,w=t(34809).counterRegex;function y(_,u,r){return{x:{valType:"number",dflt:_,editType:"camera"},y:{valType:"number",dflt:u,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}D.exports={_arrayAttrRegexps:[w("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:e(y(0,0,1),{}),center:e(y(0,0,0),{}),eye:e(y(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:d({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:b,yaxis:b,zaxis:b,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},64087:function(D,L,t){var b=t(55010),d=["xaxis","yaxis","zaxis"];function e(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}e.prototype.merge=function(w){for(var y=0;y<3;++y){var _=w[d[y]];_.visible?(this.enabled[y]=_.showspikes,this.colors[y]=b(_.spikecolor),this.drawSides[y]=_.spikesides,this.lineWidth[y]=_.spikethickness):(this.enabled[y]=!1,this.drawSides[y]=!1)}},D.exports=function(w){var y=new e;return y.merge(w),y}},32412:function(D,L,t){D.exports=function(y){for(var _=y.axesOptions,u=y.glplot.axesPixels,r=y.fullSceneLayout,n=[[],[],[]],l=0;l<3;++l){var o=r[e[l]];if(o._length=(u[l].hi-u[l].lo)*u[l].pixelsPerDataUnit/y.dataScale[l],Math.abs(o._length)===1/0||isNaN(o._length))n[l]=[];else{o._input_range=o.range.slice(),o.range[0]=u[l].lo/y.dataScale[l],o.range[1]=u[l].hi/y.dataScale[l],o._m=1/(y.dataScale[l]*u[l].pixelsPerDataUnit),o.range[0]===o.range[1]&&(o.range[0]-=1,o.range[1]+=1);var s=o.tickmode;if(o.tickmode==="auto"){o.tickmode="linear";var c=o.nticks||d.constrain(o._length/40,4,9);b.autoTicks(o,Math.abs(o.range[1]-o.range[0])/c)}for(var h=b.calcTicks(o,{msUTC:!0}),x=0;x/g," "));n[l]=h,o.tickmode=s}}for(_.ticks=n,l=0;l<3;++l)for(w[l]=.5*(y.glplot.bounds[0][l]+y.glplot.bounds[1][l]),x=0;x<2;++x)_.bounds[x][l]=y.glplot.bounds[x][l];y.contourLevels=function(m){for(var g=new Array(3),k=0;k<3;++k){for(var A=m[k],v=new Array(A.length),S=0;Sj.deltaY?1.1:.9090909090909091,ee=E.glplot.getAspectratio();E.glplot.setAspectratio({x:$*ee.x,y:$*ee.y,z:$*ee.z})}V(E)}},!!u&&{passive:!1}),E.glplot.canvas.addEventListener("mousemove",function(){if(E.fullSceneLayout.dragmode!==!1&&E.camera.mouseListener.buttons!==0){var j=N();E.graphDiv.emit("plotly_relayouting",j)}}),E.staticMode||E.glplot.canvas.addEventListener("webglcontextlost",function(j){I&&I.emit&&I.emit("plotly_webglcontextlost",{event:j,layer:E.id})},!1)),E.glplot.oncontextloss=function(){E.recoverContext()},E.glplot.onrender=function(){E.render()},!0},T.render=function(){var E,I=this,B=I.graphDiv,N=I.svgContainer,V=I.container.getBoundingClientRect();B._fullLayout._calcInverseTransform(B);var j=B._fullLayout._invScaleX,$=B._fullLayout._invScaleY,ee=V.width*j,H=V.height*$;N.setAttributeNS(null,"viewBox","0 0 "+ee+" "+H),N.setAttributeNS(null,"width",ee),N.setAttributeNS(null,"height",H),k(I),I.glplot.axes.update(I.axesOptions);for(var J=Object.keys(I.traces),Q=null,Z=I.glplot.selection,K=0;K")):E.type==="isosurface"||E.type==="volume"?(oe.valueLabel=o.hoverLabelText(I._mockAxis,I._mockAxis.d2l(Z.traceCoordinate[3]),E.valuehoverformat),me.push("value: "+oe.valueLabel),Z.textLabel&&me.push(Z.textLabel),he=me.join("
")):he=Z.textLabel;var be={x:Z.traceCoordinate[0],y:Z.traceCoordinate[1],z:Z.traceCoordinate[2],data:fe._input,fullData:fe,curveNumber:fe.index,pointNumber:ie};s.appendArrayPointValue(be,fe,ie),E._module.eventData&&(be=fe._module.eventData(be,Z,fe,{},ie));var Se={points:[be]};if(I.fullSceneLayout.hovermode){var Ee=[];s.loneHover({trace:fe,x:(.5+.5*se[0]/se[3])*ee,y:(.5-.5*se[1]/se[3])*H,xLabel:oe.xLabel,yLabel:oe.yLabel,zLabel:oe.zLabel,text:he,name:Q.name,color:s.castHoverOption(fe,ie,"bgcolor")||Q.color,borderColor:s.castHoverOption(fe,ie,"bordercolor"),fontFamily:s.castHoverOption(fe,ie,"font.family"),fontSize:s.castHoverOption(fe,ie,"font.size"),fontColor:s.castHoverOption(fe,ie,"font.color"),nameLength:s.castHoverOption(fe,ie,"namelength"),textAlign:s.castHoverOption(fe,ie,"align"),hovertemplate:n.castOption(fe,ie,"hovertemplate"),hovertemplateLabels:n.extendFlat({},be,oe),eventData:[be]},{container:N,gd:B,inOut_bbox:Ee}),be.bbox=Ee[0]}Z.distance<5&&(Z.buttons||v)?B.emit("plotly_click",Se):B.emit("plotly_hover",Se),this.oldEventData=Se}else s.loneUnhover(N),this.oldEventData&&B.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;I.drawAnnotations(I)},T.recoverContext=function(){var E=this;E.glplot.dispose();var I=function(){E.glplot.gl.isContextLost()?requestAnimationFrame(I):E.initializeGLPlot()?E.plot.apply(E,E.plotArgs):n.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(I)};var M=["xaxis","yaxis","zaxis"];function f(E,I,B){for(var N=E.fullSceneLayout,V=0;V<3;V++){var j=M[V],$=j.charAt(0),ee=N[j],H=I[$],J=I[$+"calendar"],Q=I["_"+$+"length"];if(n.isArrayOrTypedArray(H))for(var Z,K=0;K<(Q||H.length);K++)if(n.isArrayOrTypedArray(H[K]))for(var ae=0;aefe[1][$])fe[0][$]=-1,fe[1][$]=1;else{var Oe=fe[1][$]-fe[0][$];fe[0][$]-=Oe/32,fe[1][$]+=Oe/32}if(le=[fe[0][$],fe[1][$]],le=A(le,H),fe[0][$]=le[0],fe[1][$]=le[1],H.isReversed()){var We=fe[0][$];fe[0][$]=fe[1][$],fe[1][$]=We}}else le=H.range,fe[0][$]=H.r2l(le[0]),fe[1][$]=H.r2l(le[1]);fe[0][$]===fe[1][$]&&(fe[0][$]-=1,fe[1][$]+=1),ie[$]=fe[1][$]-fe[0][$],H.range=[fe[0][$],fe[1][$]],H.limitRange(),N.glplot.setBounds($,{min:H.range[0]*ae[$],max:H.range[1]*ae[$]})}var Ie=Q.aspectmode;if(Ie==="cube")he=[1,1,1];else if(Ie==="manual"){var Ve=Q.aspectratio;he=[Ve.x,Ve.y,Ve.z]}else{if(Ie!=="auto"&&Ie!=="data")throw new Error("scene.js aspectRatio was not one of the enumerated types");var Pe=[1,1,1];for($=0;$<3;++$){var de=oe[J=(H=Q[M[$]]).type];Pe[$]=Math.pow(de.acc,1/de.count)/ae[$]}he=Ie==="data"||Math.max.apply(null,Pe)/Math.min.apply(null,Pe)<=4?Pe:[1,1,1]}Q.aspectratio.x=Z.aspectratio.x=he[0],Q.aspectratio.y=Z.aspectratio.y=he[1],Q.aspectratio.z=Z.aspectratio.z=he[2],N.glplot.setAspectratio(Q.aspectratio),N.viewInitial.aspectratio||(N.viewInitial.aspectratio={x:Q.aspectratio.x,y:Q.aspectratio.y,z:Q.aspectratio.z}),N.viewInitial.aspectmode||(N.viewInitial.aspectmode=Q.aspectmode);var Me=Q.domain||null,ke=I._size||null;if(Me&&ke){var He=N.container.style;He.position="absolute",He.left=ke.l+Me.x[0]*ke.w+"px",He.top=ke.t+(1-Me.y[1])*ke.h+"px",He.width=ke.w*(Me.x[1]-Me.x[0])+"px",He.height=ke.h*(Me.y[1]-Me.y[0])+"px"}N.glplot.redraw()}},T.destroy=function(){var E=this;E.glplot&&(E.camera.mouseListener.enabled=!1,E.container.removeEventListener("wheel",E.camera.wheelListener),E.camera=null,E.glplot.dispose(),E.container.parentNode.removeChild(E.container),E.glplot=null)},T.getCamera=function(){var E,I=this;return I.camera.view.recalcMatrix(I.camera.view.lastT()),{up:{x:(E=I.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:E._ortho===!0?"orthographic":"perspective"}}},T.setViewport=function(E){var I,B=this,N=E.camera;B.camera.lookAt.apply(this,[[(I=N).eye.x,I.eye.y,I.eye.z],[I.center.x,I.center.y,I.center.z],[I.up.x,I.up.y,I.up.z]]),B.glplot.setAspectratio(E.aspectratio),N.projection.type==="orthographic"!==B.camera._ortho&&(B.glplot.redraw(),B.glplot.clearRGBA(),B.glplot.dispose(),B.initializeGLPlot())},T.isCameraChanged=function(E){var I=this.getCamera(),B=n.nestedProperty(E,this.id+".camera").get();function N(ee,H,J,Q){var Z=["up","center","eye"],K=["x","y","z"];return H[Z[J]]&&ee[Z[J]][K[Q]]===H[Z[J]][K[Q]]}var V=!1;if(B===void 0)V=!0;else{for(var j=0;j<3;j++)for(var $=0;$<3;$++)if(!N(I,B,j,$)){V=!0;break}(!B.projection||I.projection&&I.projection.type!==B.projection.type)&&(V=!0)}return V},T.isAspectChanged=function(E){var I=this.glplot.getAspectratio(),B=n.nestedProperty(E,this.id+".aspectratio").get();return B===void 0||B.x!==I.x||B.y!==I.y||B.z!==I.z},T.saveLayout=function(E){var I,B,N,V,j,$,ee=this,H=ee.fullLayout,J=ee.isCameraChanged(E),Q=ee.isAspectChanged(E),Z=J||Q;if(Z){var K={};J&&(I=ee.getCamera(),N=(B=n.nestedProperty(E,ee.id+".camera")).get(),K[ee.id+".camera"]=N),Q&&(V=ee.glplot.getAspectratio(),$=(j=n.nestedProperty(E,ee.id+".aspectratio")).get(),K[ee.id+".aspectratio"]=$),r.call("_storeDirectGUIEdit",E,H._preGUI,K),J&&(B.set(I),n.nestedProperty(H,ee.id+".camera").set(I)),Q&&(j.set(V),n.nestedProperty(H,ee.id+".aspectratio").set(V),ee.glplot.redraw())}return Z},T.updateFx=function(E,I){var B=this,N=B.camera;if(N)if(E==="orbit")N.mode="orbit",N.keyBindingMode="rotate";else if(E==="turntable"){N.up=[0,0,1],N.mode="turntable",N.keyBindingMode="rotate";var V=B.graphDiv,j=V._fullLayout,$=B.fullSceneLayout.camera,ee=$.up.x,H=$.up.y,J=$.up.z;if(J/Math.sqrt(ee*ee+H*H+J*J)<.999){var Q=B.id+".camera.up",Z={x:0,y:0,z:1},K={};K[Q]=Z;var ae=V.layout;r.call("_storeDirectGUIEdit",ae,j._preGUI,K),$.up=Z,n.nestedProperty(ae,Q).set(Z)}}else N.keyBindingMode=E;B.fullSceneLayout.hovermode=I},T.toImage=function(E){var I=this;E||(E="png"),I.staticMode&&I.container.appendChild(b),I.glplot.redraw();var B=I.glplot.gl,N=B.drawingBufferWidth,V=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var j=new Uint8Array(N*V*4);B.readPixels(0,0,N,V,B.RGBA,B.UNSIGNED_BYTE,j),function(Q,Z,K){for(var ae=0,se=K-1;ae0)for(var ie=255/fe,oe=0;oe<3;++oe)Q[he+oe]=Math.min(ie*Q[he+oe],255)}}(j,N,V);var $=document.createElement("canvas");$.width=N,$.height=V;var ee,H=$.getContext("2d",{willReadFrequently:!0}),J=H.createImageData(N,V);switch(J.data.set(j),H.putImageData(J,0,0),E){case"jpeg":ee=$.toDataURL("image/jpeg");break;case"webp":ee=$.toDataURL("image/webp");break;default:ee=$.toDataURL("image/png")}return I.staticMode&&I.container.removeChild(b),ee},T.setConvert=function(){for(var E=0;E<3;E++){var I=this.fullSceneLayout[M[E]];o.setConvert(I,this.fullLayout),I.setScale=n.noop}},T.make4thDimension=function(){var E=this,I=E.graphDiv._fullLayout;E._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(E._mockAxis,I)},D.exports=S},88239:function(D){D.exports=function(L,t,b,d){d=d||L.length;for(var e=new Array(d),w=0;wOpenStreetMap 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":e,"carto-darkmatter":w,"carto-voyager":y,"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"},u=b(_);D.exports={styleValueDflt:"basic",stylesMap:_,styleValuesMap:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",u.join(", "),"or use a tile service."].join(` +`+Q.year}return B($,j,H,J)};var V=3*n;L.incrementMonth=function(j,$,ee){ee=A(ee)&ⅇvar H=_(j,n);if(j=Math.round(j-H),ee)try{var J=Math.round(j/n)+c,Q=h.getComponentMethod("calendars","getCal")(ee),Z=Q.fromJD(J);return $%12?Q.add(Z,$,"m"):Q.add(Z,$/12,"y"),(Z.toJD()-c)*n+H}catch{y.error("invalid ms "+j+" in calendar "+ee)}var K=new Date(j+V);return K.setUTCMonth(K.getUTCMonth()+$)+H-V},L.findExactDates=function(j,$){for(var ee,H,J=0,Q=0,Z=0,K=0,ae=A($)&&h.getComponentMethod("calendars","getCal")($),se=0;se0&&M[f+1][0]<0)return f;return null}switch(x=S==="RUS"||S==="FJI"?function(M){var f;if(p(M)===null)f=M;else for(f=new Array(M.length),k=0;kf?E[I++]=[M[k][0]+360,M[k][1]]:k===f?(E[I++]=M[k],E[I++]=[M[k][0],-90]):E[I++]=M[k];var B=l.tester(E);B.pts.pop(),T.push(B)}:function(M){T.push(l.tester(M))},A.type){case"MultiPolygon":for(m=0;m0?B.properties.ct=function(N){var V,j=N.geometry;if(j.type==="MultiPolygon")for(var $=j.coordinates,ee=0,H=0;H<$.length;H++){var J={type:"Polygon",coordinates:$[H]},Q=e(J);Q>ee&&(ee=Q,V=J)}else V=j;return w(V).geometry.coordinates}(B):B.properties.ct=[NaN,NaN],E.fIn=M,E.fOut=B,A.push(B)}else u.log(["Location",E.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete k[f]}switch(m.type){case"FeatureCollection":var T=m.features;for(g=0;g100?(clearInterval(f),p("Unexpected error while fetching from "+S)):void M++},50)})}for(var A=0;A0&&(w.push(y),y=[])}return y.length>0&&w.push(y),w},L.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},L.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var e=new Array(d.length),w=0;w1||T<0||T>1?null:{x:u+x*T,y:r+k*T}}function _(u,r,n,l,o){var s=l*u+o*r;if(s<0)return l*l+o*o;if(s>n){var c=l-u,h=o-r;return c*c+h*h}var x=l*r-o*u;return x*x/n}L.segmentsIntersect=y,L.segmentDistance=function(u,r,n,l,o,s,c,h){if(y(u,r,n,l,o,s,c,h))return 0;var x=n-u,m=l-r,g=c-o,k=h-s,A=x*x+m*m,v=g*g+k*k,S=Math.min(_(x,m,A,o-u,s-r),_(x,m,A,c-u,h-r),_(g,k,v,u-o,r-s),_(g,k,v,n-o,l-s));return Math.sqrt(S)},L.getTextLocation=function(u,r,n,l){if(u===d&&l===e||(b={},d=u,e=l),b[n])return b[n];var o=u.getPointAtLength(w(n-l/2,r)),s=u.getPointAtLength(w(n+l/2,r)),c=Math.atan((s.y-o.y)/(s.x-o.x)),h=u.getPointAtLength(w(n,r)),x={x:(4*h.x+o.x+s.x)/6,y:(4*h.y+o.y+s.y)/6,theta:c};return b[n]=x,x},L.clearLocationCache=function(){d=null},L.getVisibleSegment=function(u,r,n){var l,o,s=r.left,c=r.right,h=r.top,x=r.bottom,m=0,g=u.getTotalLength(),k=g;function A(S){var T=u.getPointAtLength(S);S===0?l=T:S===g&&(o=T);var p=T.xc?T.x-c:0,M=T.yx?T.y-x:0;return Math.sqrt(p*p+M*M)}for(var v=A(m);v;){if((m+=v+n)>k)return;v=A(m)}for(v=A(k);v;){if(m>(k-=v+n))return;v=A(k)}return{min:m,max:k,len:k-m,total:g,isClosed:m===0&&k===g&&Math.abs(l.x-o.x)<.1&&Math.abs(l.y-o.y)<.1}},L.findPointOnPath=function(u,r,n,l){for(var o,s,c,h=(l=l||{}).pathLength||u.getTotalLength(),x=l.tolerance||.001,m=l.iterationLimit||30,g=u.getPointAtLength(0)[n]>u.getPointAtLength(h)[n]?-1:1,k=0,A=0,v=h;k0?v=o:A=o,k++}return s}},46998:function(D,L,t){var b=t(10721),d=t(65657),e=t(162),w=t(88856),y=t(10229).defaultLine,_=t(87800).isArrayOrTypedArray,u=e(y);function r(o,s){var c=o;return c[3]*=s,c}function n(o){if(b(o))return u;var s=e(o);return s.length?s:u}function l(o){return b(o)?o:1}D.exports={formatColor:function(o,s,c){var h=o.color;h&&h._inputArray&&(h=h._inputArray);var x,m,g,k,A,v=_(h),S=_(s),T=w.extractOpts(o),p=[];if(x=T.colorscale!==void 0?w.makeColorScaleFuncFromTrace(o):n,m=v?function(f,E){return f[E]===void 0?u:e(x(f[E]))}:n,g=S?function(f,E){return f[E]===void 0?1:l(f[E])}:l,v||S)for(var M=0;M1?(b*L+b*t)/b:L+t,e=String(d).length;if(e>16){var w=String(t).length;if(e>=String(L).length+w){var y=parseFloat(d).toPrecision(12);y.indexOf("e+")===-1&&(d=+y)}}return d}},34809:function(D,L,t){var b=t(45568),d=t(42696).aL,e=t(36464).GP,w=t(10721),y=t(63821),_=y.FP_SAFE,u=-_,r=y.BADNUM,n=D.exports={};n.adjustFormat=function(ie){return!ie||/^\d[.]\df/.test(ie)||/[.]\d%/.test(ie)?ie:ie==="0.f"?"~f":/^\d%/.test(ie)?"~%":/^\ds/.test(ie)?"~s":!/^[~,.0$]/.test(ie)&&/[&fps]/.test(ie)?"~"+ie:ie};var l={};n.warnBadFormat=function(ie){var oe=String(ie);l[oe]||(l[oe]=1,n.warn('encountered bad format: "'+oe+'"'))},n.noFormat=function(ie){return String(ie)},n.numberFormat=function(ie){var oe;try{oe=e(n.adjustFormat(ie))}catch{return n.warnBadFormat(ie),n.noFormat}return oe},n.nestedProperty=t(35632),n.keyedContainer=t(34967),n.relativeAttr=t(82047),n.isPlainObject=t(56174),n.toLogRange=t(8083),n.relinkPrivateKeys=t(80428);var o=t(87800);n.isArrayBuffer=o.isArrayBuffer,n.isTypedArray=o.isTypedArray,n.isArrayOrTypedArray=o.isArrayOrTypedArray,n.isArray1D=o.isArray1D,n.ensureArray=o.ensureArray,n.concat=o.concat,n.maxRowLength=o.maxRowLength,n.minRowLength=o.minRowLength;var s=t(98953);n.mod=s.mod,n.modHalf=s.modHalf;var c=t(34220);n.valObjectMeta=c.valObjectMeta,n.coerce=c.coerce,n.coerce2=c.coerce2,n.coerceFont=c.coerceFont,n.coercePattern=c.coercePattern,n.coerceHoverinfo=c.coerceHoverinfo,n.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,n.validate=c.validate;var h=t(92596);n.dateTime2ms=h.dateTime2ms,n.isDateTime=h.isDateTime,n.ms2DateTime=h.ms2DateTime,n.ms2DateTimeLocal=h.ms2DateTimeLocal,n.cleanDate=h.cleanDate,n.isJSDate=h.isJSDate,n.formatDate=h.formatDate,n.incrementMonth=h.incrementMonth,n.dateTick0=h.dateTick0,n.dfltRange=h.dfltRange,n.findExactDates=h.findExactDates,n.MIN_MS=h.MIN_MS,n.MAX_MS=h.MAX_MS;var x=t(98813);n.findBin=x.findBin,n.sorterAsc=x.sorterAsc,n.sorterDes=x.sorterDes,n.distinctVals=x.distinctVals,n.roundUp=x.roundUp,n.sort=x.sort,n.findIndexOfMin=x.findIndexOfMin,n.sortObjectKeys=t(62994);var m=t(89258);n.aggNums=m.aggNums,n.len=m.len,n.mean=m.mean,n.geometricMean=m.geometricMean,n.median=m.median,n.midRange=m.midRange,n.variance=m.variance,n.stdev=m.stdev,n.interp=m.interp;var g=t(15236);n.init2dArray=g.init2dArray,n.transposeRagged=g.transposeRagged,n.dot=g.dot,n.translationMatrix=g.translationMatrix,n.rotationMatrix=g.rotationMatrix,n.rotationXYMatrix=g.rotationXYMatrix,n.apply3DTransform=g.apply3DTransform,n.apply2DTransform=g.apply2DTransform,n.apply2DTransform2=g.apply2DTransform2,n.convertCssMatrix=g.convertCssMatrix,n.inverseTransformMatrix=g.inverseTransformMatrix;var k=t(44313);n.deg2rad=k.deg2rad,n.rad2deg=k.rad2deg,n.angleDelta=k.angleDelta,n.angleDist=k.angleDist,n.isFullCircle=k.isFullCircle,n.isAngleInsideSector=k.isAngleInsideSector,n.isPtInsideSector=k.isPtInsideSector,n.pathArc=k.pathArc,n.pathSector=k.pathSector,n.pathAnnulus=k.pathAnnulus;var A=t(32546);n.isLeftAnchor=A.isLeftAnchor,n.isCenterAnchor=A.isCenterAnchor,n.isRightAnchor=A.isRightAnchor,n.isTopAnchor=A.isTopAnchor,n.isMiddleAnchor=A.isMiddleAnchor,n.isBottomAnchor=A.isBottomAnchor;var v=t(3447);n.segmentsIntersect=v.segmentsIntersect,n.segmentDistance=v.segmentDistance,n.getTextLocation=v.getTextLocation,n.clearLocationCache=v.clearLocationCache,n.getVisibleSegment=v.getVisibleSegment,n.findPointOnPath=v.findPointOnPath;var S=t(93049);n.extendFlat=S.extendFlat,n.extendDeep=S.extendDeep,n.extendDeepAll=S.extendDeepAll,n.extendDeepNoArrays=S.extendDeepNoArrays;var T=t(48636);n.log=T.log,n.warn=T.warn,n.error=T.error;var p=t(90694);n.counterRegex=p.counter;var M=t(64025);n.throttle=M.throttle,n.throttleDone=M.done,n.clearThrottle=M.clear;var f=t(95425);function E(ie){var oe={};for(var le in ie)for(var ge=ie[le],ye=0;ye_||ie=oe)&&w(ie)&&ie>=0&&ie%1==0},n.noop=t(4969),n.identity=t(29527),n.repeat=function(ie,oe){for(var le=new Array(oe),ge=0;gele?Math.max(le,Math.min(oe,ie)):Math.max(oe,Math.min(le,ie))},n.bBoxIntersect=function(ie,oe,le){return le=le||0,ie.left<=oe.right+le&&oe.left<=ie.right+le&&ie.top<=oe.bottom+le&&oe.top<=ie.bottom+le},n.simpleMap=function(ie,oe,le,ge,ye){for(var me=ie.length,be=new Array(me),Se=0;Se=Math.pow(2,le)?ye>10?(n.warn("randstr failed uniqueness"),Ee):ie(oe,le,ge,(ye||0)+1):Ee},n.OptionControl=function(ie,oe){ie||(ie={}),oe||(oe="opt");var le={optionList:[],_newoption:function(ge){ge[oe]=ie,le[ge.name]=ge,le.optionList.push(ge)}};return le["_"+oe]=ie,le},n.smooth=function(ie,oe){if((oe=Math.round(oe)||0)<2)return ie;var le,ge,ye,me,be=ie.length,Se=2*be,Ee=2*oe-1,Ce=new Array(Ee),Le=new Array(be);for(le=0;le=Se&&(ye-=Se*Math.floor(ye/Se)),ye<0?ye=-1-ye:ye>=be&&(ye=Se-1-ye),me+=ie[ye]*Ce[ge];Le[le]=me}return Le},n.syncOrAsync=function(ie,oe,le){var ge;function ye(){return n.syncOrAsync(ie,oe,le)}for(;ie.length;)if((ge=(0,ie.splice(0,1)[0])(oe))&&ge.then)return ge.then(ye);return le&&le(oe)},n.stripTrailingSlash=function(ie){return ie.substr(-1)==="/"?ie.substr(0,ie.length-1):ie},n.noneOrAll=function(ie,oe,le){if(ie){var ge,ye=!1,me=!0;for(ge=0;ge0?ye:0})},n.fillArray=function(ie,oe,le,ge){if(ge=ge||n.identity,n.isArrayOrTypedArray(ie))for(var ye=0;ye1?ye+be[1]:"";if(me&&(be.length>1||Se.length>4||le))for(;ge.test(Se);)Se=Se.replace(ge,"$1"+me+"$2");return Se+Ee},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var ee=/^\w*$/;n.templateString=function(ie,oe){var le={};return ie.replace(n.TEMPLATE_STRING_REGEX,function(ge,ye){var me;return ee.test(ye)?me=oe[ye]:(le[ye]=le[ye]||n.nestedProperty(oe,ye).get,me=le[ye]()),n.isValidTextValue(me)?me:""})};var H={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=function(){return ae.apply(H,arguments)};var J={max:10,count:0,name:"texttemplate"};n.texttemplateString=function(){return ae.apply(J,arguments)};var Q=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,Z={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=function(){return ae.apply(Z,arguments)};var K=/^[:|\|]/;function ae(ie,oe,le){var ge=this,ye=arguments;oe||(oe={});var me={};return ie.replace(n.TEMPLATE_STRING_REGEX,function(be,Se,Ee){var Ce=Se==="_xother"||Se==="_yother",Le=Se==="_xother_"||Se==="_yother_",Oe=Se==="xother_"||Se==="yother_",We=Se==="xother"||Se==="yother"||Ce||Oe||Le,Ie=Se;(Ce||Le)&&(Ie=Ie.substring(1)),(Oe||Le)&&(Ie=Ie.substring(0,Ie.length-1));var Ve,Pe,de,Me=null,ke=null;if(ge.parseMultDiv){var He=function(Ye){var _e=Ye.match(Q);return _e?{key:_e[1],op:_e[2],number:Number(_e[3])}:{key:Ye,op:null,number:null}}(Ie);Ie=He.key,Me=He.op,ke=He.number}if(We){if((Ve=oe[Ie])===void 0)return""}else for(de=3;de=48&&be<=57,Ce=Se>=48&&Se<=57;if(Ee&&(ge=10*ge+be-48),Ce&&(ye=10*ye+Se-48),!Ee||!Ce){if(ge!==ye)return ge-ye;if(be!==Se)return be-Se}}return ye-ge};var se=2e9;n.seedPseudoRandom=function(){se=2e9},n.pseudoRandom=function(){var ie=se;return se=(69069*se+1)%4294967296,Math.abs(se-ie)<429496729?n.pseudoRandom():se/4294967296},n.fillText=function(ie,oe,le){var ge=Array.isArray(le)?function(be){le.push(be)}:function(be){le.text=be},ye=n.extractOption(ie,oe,"htx","hovertext");if(n.isValidTextValue(ye))return ge(ye);var me=n.extractOption(ie,oe,"tx","text");return n.isValidTextValue(me)?ge(me):void 0},n.isValidTextValue=function(ie){return ie||ie===0},n.formatPercent=function(ie,oe){oe=oe||0;for(var le=(Math.round(100*ie*Math.pow(10,oe))*Math.pow(.1,oe)).toFixed(oe)+"%",ge=0;ge1&&(Ce=1):Ce=0,n.strTranslate(ye-Ce*(le+be),me-Ce*(ge+Se))+n.strScale(Ce)+(Ee?"rotate("+Ee+(oe?"":" "+le+" "+ge)+")":"")},n.setTransormAndDisplay=function(ie,oe){ie.attr("transform",n.getTextTransform(oe)),ie.style("display",oe.scale?null:"none")},n.ensureUniformFontSize=function(ie,oe){var le=n.extendFlat({},oe);return le.size=Math.max(oe.size,ie._fullLayout.uniformtext.minsize||0),le},n.join2=function(ie,oe,le){var ge=ie.length;return ge>1?ie.slice(0,-1).join(oe)+le+ie[ge-1]:ie.join(oe)},n.bigFont=function(ie){return Math.round(1.2*ie)};var he=n.getFirefoxVersion(),fe=he!==null&&he<86;n.getPositionFromD3Event=function(){return fe?[b.event.layerX,b.event.layerY]:[b.event.offsetX,b.event.offsetY]}},56174:function(D){D.exports=function(L){return window&&window.process&&window.process.versions?Object.prototype.toString.call(L)==="[object Object]":Object.prototype.toString.call(L)==="[object Object]"&&Object.getPrototypeOf(L).hasOwnProperty("hasOwnProperty")}},34967:function(D,L,t){var b=t(35632),d=/^\w*$/;D.exports=function(e,w,y,_){var u,r,n;y=y||"name",_=_||"value";var l={};w&&w.length?(n=b(e,w),r=n.get()):r=e,w=w||"";var o={};if(r)for(u=0;u2)return l[x]=2|l[x],c.set(h,null);if(s){for(u=x;u1){var y=["LOG:"];for(w=0;w1){var _=[];for(w=0;w"),"long")}},e.warn=function(){var w;if(b.logging>0){var y=["WARN:"];for(w=0;w0){var _=[];for(w=0;w"),"stick")}},e.error=function(){var w;if(b.logging>0){var y=["ERROR:"];for(w=0;w0){var _=[];for(w=0;w"),"stick")}}},75944:function(D,L,t){var b=t(45568);D.exports=function(d,e,w){var y=d.selectAll("g."+w.replace(/\s/g,".")).data(e,function(u){return u[0].trace.uid});y.exit().remove(),y.enter().append("g").attr("class",w),y.order();var _=d.classed("rangeplot")?"nodeRangePlot3":"node3";return y.each(function(u){u[0][_]=b.select(this)}),y}},15236:function(D,L,t){var b=t(11191);L.init2dArray=function(d,e){for(var w=new Array(d),y=0;yt/2?L-Math.round(L/t)*t:L}}},35632:function(D,L,t){var b=t(10721),d=t(87800).isArrayOrTypedArray;function e(l,o){return function(){var s,c,h,x,m,g=l;for(x=0;x/g),c=0;cr||k===d||kl||m&&o(x))}:function(x,m){var g=x[0],k=x[1];if(g===d||gr||k===d||kl)return!1;var A,v,S,T,p,M=_.length,f=_[0][0],E=_[0][1],I=0;for(A=1;AMath.max(v,f)||k>Math.max(S,E)))if(kc||Math.abs(b(n,x))>u)return!0;return!1},e.filter=function(w,y){var _=[w[0]],u=0,r=0;function n(l){w.push(l);var o=_.length,s=u;_.splice(r+1);for(var c=s+1;c1&&n(w.pop()),{addPt:n,raw:w,filtered:_}}},22459:function(D,L,t){var b=t(97464),d=t(81330);D.exports=function(e,w,y){var _=e._fullLayout,u=!0;return _._glcanvas.each(function(r){if(r.regl)r.regl.preloadCachedCode(y);else if(!r.pick||_._has("parcoords")){try{r.regl=d({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||t.g.devicePixelRatio,extensions:w||[],cachedCode:y||{}})}catch{u=!1}r.regl||(u=!1),u&&this.addEventListener("webglcontextlost",function(n){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:n,layer:r.key})},!1)}}),u||b({container:_._glcontainer.node()}),u}},32521:function(D,L,t){var b=t(10721),d=t(13087);D.exports=function(e){var w;if(typeof(w=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var o;return typeof navigator<"u"&&(o=navigator.userAgent),o&&o.headers&&typeof o.headers["user-agent"]=="string"&&(o=o.headers["user-agent"]),o}())!="string")return!0;var y=d({ua:{headers:{"user-agent":w}},tablet:!0,featureDetect:!1});if(!y){for(var _=w.split(" "),u=1;u<_.length;u++)if(_[u].indexOf("Safari")!==-1)for(var r=u-1;r>-1;r--){var n=_[r];if(n.substr(0,8)==="Version/"){var l=n.substr(8).split(".")[0];if(b(l)&&(l=+l),l>=13)return!0}}}return y}},36539:function(D){D.exports=function(L,t){if(t instanceof RegExp){for(var b=t.toString(),d=0;dd.queueLength&&(w.undoQueue.queue.shift(),w.undoQueue.index--))},startSequence:function(w){w.undoQueue=w.undoQueue||{index:0,queue:[],sequence:!1},w.undoQueue.sequence=!0,w.undoQueue.beginSequence=!0},stopSequence:function(w){w.undoQueue=w.undoQueue||{index:0,queue:[],sequence:!1},w.undoQueue.sequence=!1,w.undoQueue.beginSequence=!1},undo:function(w){var y,_;if(!(w.undoQueue===void 0||isNaN(w.undoQueue.index)||w.undoQueue.index<=0)){for(w.undoQueue.index--,y=w.undoQueue.queue[w.undoQueue.index],w.undoQueue.inSequence=!0,_=0;_=w.undoQueue.queue.length)){for(y=w.undoQueue.queue[w.undoQueue.index],w.undoQueue.inSequence=!0,_=0;_o}function n(l,o){return l>=o}L.findBin=function(l,o,s){if(b(o.start))return s?Math.ceil((l-o.start)/o.size-y)-1:Math.floor((l-o.start)/o.size+y);var c,h,x=0,m=o.length,g=0,k=m>1?(o[m-1]-o[0])/(m-1):1;for(h=k>=0?s?_:u:s?n:r,l+=k*y*(s?-1:1)*(k>=0?1:-1);x90&&d.log("Long binary search..."),x-1},L.sorterAsc=function(l,o){return l-o},L.sorterDes=function(l,o){return o-l},L.distinctVals=function(l){var o,s=l.slice();for(s.sort(L.sorterAsc),o=s.length-1;o>-1&&s[o]===w;o--);for(var c,h=s[o]-s[0]||1,x=h/(o||1)/1e4,m=[],g=0;g<=o;g++){var k=s[g],A=k-c;c===void 0?(m.push(k),c=k):A>x&&(h=Math.min(h,A),m.push(k),c=k)}return{vals:m,minDiff:h}},L.roundUp=function(l,o,s){for(var c,h=0,x=o.length-1,m=0,g=s?0:1,k=s?1:0,A=s?Math.ceil:Math.floor;h0&&(c=1),s&&c)return l.sort(o)}return c?l:l.reverse()},L.findIndexOfMin=function(l,o){o=o||e;for(var s,c=1/0,h=0;hy.length)&&(_=y.length),b(w)||(w=!1),d(y[0])){for(r=new Array(_),u=0;u<_;u++)r[u]=L.aggNums(e,w,y[u]);y=r}for(u=0;u<_;u++)b(w)?b(y[u])&&(w=e(+w,+y[u])):w=y[u];return w},L.len=function(e){return L.aggNums(function(w){return w+1},0,e)},L.mean=function(e,w){return w||(w=L.len(e)),L.aggNums(function(y,_){return y+_},0,e)/w},L.geometricMean=function(e,w){return w||(w=L.len(e)),Math.pow(L.aggNums(function(y,_){return y*_},1,e),1/w)},L.midRange=function(e){if(e!==void 0&&e.length!==0)return(L.aggNums(Math.max,null,e)+L.aggNums(Math.min,null,e))/2},L.variance=function(e,w,y){return w||(w=L.len(e)),b(y)||(y=L.mean(e,w)),L.aggNums(function(_,u){return _+Math.pow(u-y,2)},0,e)/w},L.stdev=function(e,w,y){return Math.sqrt(L.variance(e,w,y))},L.median=function(e){var w=e.slice().sort();return L.interp(w,.5)},L.interp=function(e,w){if(!b(w))throw"n should be a finite number";if((w=w*e.length-.5)<0)return e[0];if(w>e.length-1)return e[e.length-1];var y=w%1;return y*e[Math.ceil(w)]+(1-y)*e[Math.floor(w)]}},55010:function(D,L,t){var b=t(162);D.exports=function(d){return d?b(d):[0,0,0,1]}},95544:function(D,L,t){var b=t(1837),d=t(62203),e=t(34809),w=null;D.exports=function(){if(w!==null)return w;w=!1;var y=e.isIE()||e.isSafari()||e.isIOS();if(window.navigator.userAgent&&!y){var _=Array.from(b.CSS_DECLARATIONS).reverse(),u=window.CSS&&window.CSS.supports||window.supportsCSS;if(typeof u=="function")w=_.some(function(l){return u.apply(null,l)});else{var r=d.tester.append("image").attr("style",b.STYLE),n=window.getComputedStyle(r.node()).imageRendering;w=_.some(function(l){var o=l[1];return n===o||n===o.toLowerCase()}),r.remove()}}return w}},30635:function(D,L,t){var b=t(45568),d=t(34809),e=d.strTranslate,w=t(62972),y=t(4530).LINE_SPACING,_=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;L.convertToTspans=function(j,$,ee){var H=j.text(),J=!j.attr("data-notex")&&$&&$._context.typesetMath&&typeof MathJax<"u"&&H.match(_),Q=b.select(j.node().parentNode);if(!Q.empty()){var Z=j.attr("class")?j.attr("class").split(" ")[0]:"text";return Z+="-math",Q.selectAll("svg."+Z).remove(),Q.selectAll("g."+Z+"-group").remove(),j.style("display",null).attr({"data-unformatted":H,"data-math":"N"}),J?($&&$._promises||[]).push(new Promise(function(ae){j.style("display","none");var se=parseInt(j.node().style.fontSize,10),he={fontSize:se};(function(fe,ie,oe){var le,ge,ye,me,be=parseInt((MathJax.version||"").split(".")[0]);if(be===2||be===3){var Se=function(){var Ce="math-output-"+d.randstr({},64),Le=(me=b.select("body").append("div").attr({id:Ce}).style({visibility:"hidden",position:"absolute","font-size":ie.fontSize+"px"}).text(fe.replace(u,"\\lt ").replace(r,"\\gt "))).node();return be===2?MathJax.Hub.Typeset(Le):MathJax.typeset([Le])},Ee=function(){var Ce=me.select(be===2?".MathJax_SVG":".MathJax"),Le=!Ce.empty()&&me.select("svg").node();if(Le){var Oe,We=Le.getBoundingClientRect();Oe=be===2?b.select("body").select("#MathJax_SVG_glyphs"):Ce.select("defs"),oe(Ce,Oe,We)}else d.log("There was an error in the tex syntax.",fe),oe();me.remove()};be===2?MathJax.Hub.Queue(function(){return ge=d.extendDeepAll({},MathJax.Hub.config),ye=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},function(){if((le=MathJax.Hub.config.menuSettings.renderer)!=="SVG")return MathJax.Hub.setRenderer("SVG")},Se,Ee,function(){if(le!=="SVG")return MathJax.Hub.setRenderer(le)},function(){return ye!==void 0&&(MathJax.Hub.processSectionDelay=ye),MathJax.Hub.Config(ge)}):be===3&&(ge=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n,(le=MathJax.config.startup.output)!=="svg"&&(MathJax.config.startup.output="svg"),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Se(),Ee(),le!=="svg"&&(MathJax.config.startup.output=le),MathJax.config=ge}))}else d.warn("No MathJax version:",MathJax.version)})(J[2],he,function(fe,ie,oe){Q.selectAll("svg."+Z).remove(),Q.selectAll("g."+Z+"-group").remove();var le=fe&&fe.select("svg");if(!le||!le.node())return K(),void ae();var ge=Q.append("g").classed(Z+"-group",!0).attr({"pointer-events":"none","data-unformatted":H,"data-math":"Y"});ge.node().appendChild(le.node()),ie&&ie.node()&&le.node().insertBefore(ie.node().cloneNode(!0),le.node().firstChild);var ye=oe.width,me=oe.height;le.attr({class:Z,height:me,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var be=j.node().style.fill||"black",Se=le.select("g");Se.attr({fill:be,stroke:be});var Ee=Se.node().getBoundingClientRect(),Ce=Ee.width,Le=Ee.height;(Ce>ye||Le>me)&&(le.style("overflow","hidden"),Ce=(Ee=le.node().getBoundingClientRect()).width,Le=Ee.height);var Oe=+j.attr("x"),We=+j.attr("y"),Ie=-(se||j.node().getBoundingClientRect().height)/4;if(Z[0]==="y")ge.attr({transform:"rotate("+[-90,Oe,We]+")"+e(-Ce/2,Ie-Le/2)});else if(Z[0]==="l")We=Ie-Le/2;else if(Z[0]==="a"&&Z.indexOf("atitle")!==0)Oe=0,We=Ie;else{var Ve=j.attr("text-anchor");Oe-=Ce*(Ve==="middle"?.5:Ve==="end"?1:0),We=We+Ie-Le/2}le.attr({x:Oe,y:We}),ee&&ee.call(j,ge),ae(ge)})})):K(),j}function K(){Q.empty()||(Z=j.attr("class")+"-math",Q.select("svg."+Z).remove()),j.text("").style("white-space","pre");var ae=function(se,he){he=he.replace(x," ");var fe,ie=!1,oe=[],le=-1;function ge(){le++;var ke=document.createElementNS(w.svg,"tspan");b.select(ke).attr({class:"line",dy:le*y+"em"}),se.appendChild(ke),fe=ke;var He=oe;if(oe=[{node:ke}],He.length>1)for(var Fe=1;Fe doesnt match end tag <"+ke+">. Pretending it did match.",he),fe=oe[oe.length-1].node}else d.log("Ignoring unexpected end tag .",he)}k.test(he)?ge():(fe=se,oe=[{node:se}]);for(var Se=he.split(m),Ee=0;Ee|>|>)/g,n=[["$","$"],["\\(","\\)"]],l={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"},o={sub:"0.3em",sup:"-0.6em"},s={sub:"-0.21em",sup:"0.42em"},c="​",h=["http:","https:","mailto:","",void 0,":"],x=L.NEWLINES=/(\r\n?|\n)/g,m=/(<[^<>]*>)/,g=/<(\/?)([^ >]*)(\s+(.*))?>/i,k=//i;L.BR_TAG_ALL=//gi;var A=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,v=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,S=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,T=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function p(j,$){if(!j)return null;var ee=j.match($),H=ee&&(ee[3]||ee[4]);return H&&I(H)}var M=/(^|;)\s*color:/;L.plainText=function(j,$){for(var ee=($=$||{}).len!==void 0&&$.len!==-1?$.len:1/0,H=$.allowedTags!==void 0?$.allowedTags:["br"],J=j.split(m),Q=[],Z="",K=0,ae=0;ae3?Q.push(se.substr(0,oe-3)+"..."):Q.push(se.substr(0,oe));break}Z=""}}return Q.join("")};var f={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},E=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function I(j){return j.replace(E,function($,ee){return(ee.charAt(0)==="#"?function(H){if(!(H>1114111)){var J=String.fromCodePoint;if(J)return J(H);var Q=String.fromCharCode;return H<=65535?Q(H):Q(55232+(H>>10),H%1024+56320)}}(ee.charAt(1)==="x"?parseInt(ee.substr(2),16):parseInt(ee.substr(1),10)):f[ee])||$})}function B(j){var $=encodeURI(decodeURI(j)),ee=document.createElement("a"),H=document.createElement("a");ee.href=j,H.href=$;var J=ee.protocol,Q=H.protocol;return h.indexOf(J)!==-1&&h.indexOf(Q)!==-1?$:""}function N(j,$,ee){var H,J,Q,Z=ee.horizontalAlign,K=ee.verticalAlign||"top",ae=j.node().getBoundingClientRect(),se=$.node().getBoundingClientRect();return J=K==="bottom"?function(){return ae.bottom-H.height}:K==="middle"?function(){return ae.top+(ae.height-H.height)/2}:function(){return ae.top},Q=Z==="right"?function(){return ae.right-H.width}:Z==="center"?function(){return ae.left+(ae.width-H.width)/2}:function(){return ae.left},function(){H=this.node().getBoundingClientRect();var he=Q()-se.left,fe=J()-se.top,ie=ee.gd||{};if(ee.gd){ie._fullLayout._calcInverseTransform(ie);var oe=d.apply3DTransform(ie._fullLayout._invTransform)(he,fe);he=oe[0],fe=oe[1]}return this.style({top:fe+"px",left:he+"px","z-index":1e3}),this}}L.convertEntities=I,L.sanitizeHTML=function(j){j=j.replace(x," ");for(var $=document.createElement("p"),ee=$,H=[],J=j.split(m),Q=0;Qy.ts+e?r():y.timer=setTimeout(function(){r(),y.timer=null},e)},L.done=function(d){var e=t[d];return e&&e.timer?new Promise(function(w){var y=e.onDone;e.onDone=function(){y&&y(),w(),e.onDone=null}}):Promise.resolve()},L.clear=function(d){if(d)b(t[d]),delete t[d];else for(var e in t)L.clear(e)}},8083:function(D,L,t){var b=t(10721);D.exports=function(d,e){if(d>0)return Math.log(d)/Math.LN10;var w=Math.log(Math.min(e[0],e[1]))/Math.LN10;return b(w)||(w=Math.log(Math.max(e[0],e[1]))/Math.LN10-6),w}},11577:function(D,L,t){var b=D.exports={},d=t(74285).locationmodeToLayer,e=t(48640).N4;b.getTopojsonName=function(w){return[w.scope.replace(/ /g,"-"),"_",w.resolution.toString(),"m"].join("")},b.getTopojsonPath=function(w,y){return w+y+".json"},b.getTopojsonFeatures=function(w,y){var _=d[w.locationmode],u=y.objects[_];return e(y,u).features}},44611:function(D){D.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},30227:function(D){D.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"}}},56037:function(D,L,t){var b=t(33626);D.exports=function(d){for(var e,w,y=b.layoutArrayContainers,_=b.layoutArrayRegexes,u=d.split("[")[0],r=0;r<_.length;r++)if((w=d.match(_[r]))&&w.index===0){e=w[0];break}if(e||(e=y[y.indexOf(u)]),!e)return!1;var n=d.substr(e.length);return n?!!(w=n.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:e,index:Number(w[1]),property:w[3]||""}:{array:e,index:"",property:""}}},13582:function(D,L,t){var b=t(93049).extendFlat,d=t(56174),e={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},w={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},y=e.flags.slice().concat(["fullReplot"]),_=w.flags.slice().concat("layoutReplot");function u(l){for(var o={},s=0;s0&&w.log("Clearing previous rejected promises from queue."),v._promises=[]},L.cleanLayout=function(v){var S,T;v||(v={}),v.xaxis1&&(v.xaxis||(v.xaxis=v.xaxis1),delete v.xaxis1),v.yaxis1&&(v.yaxis||(v.yaxis=v.yaxis1),delete v.yaxis1),v.scene1&&(v.scene||(v.scene=v.scene1),delete v.scene1);var p=(y.subplotsRegistry.cartesian||{}).attrRegex,M=(y.subplotsRegistry.polar||{}).attrRegex,f=(y.subplotsRegistry.ternary||{}).attrRegex,E=(y.subplotsRegistry.gl3d||{}).attrRegex,I=Object.keys(v);for(S=0;S3?(oe.x=1.02,oe.xanchor="left"):oe.x<-2&&(oe.x=-.02,oe.xanchor="right"),oe.y>3?(oe.y=1.02,oe.yanchor="bottom"):oe.y<-2&&(oe.y=-.02,oe.yanchor="top")),s(v),v.dragmode==="rotate"&&(v.dragmode="orbit"),u.clean(v),v.template&&v.template.layout&&L.cleanLayout(v.template.layout),v},L.cleanData=function(v){for(var S=0;S0)return v.substr(0,S)}L.hasParent=function(v,S){for(var T=k(S);T;){if(T in v)return!0;T=k(T)}return!1};var A=["x","y","z"];L.clearAxisTypes=function(v,S,T){for(var p=0;p1&&e.warn("Full array edits are incompatible with other edits",c);var v=l[""][""];if(u(v))n.set(null);else{if(!Array.isArray(v))return e.warn("Unrecognized full array edit value",c,v),!0;n.set(v)}return!g&&(h(k,A),x(r),!0)}var S,T,p,M,f,E,I,B,N=Object.keys(l).map(Number).sort(w),V=n.get(),j=V||[],$=s(A,c).get(),ee=[],H=-1,J=j.length;for(S=0;Sj.length-(I?0:1))e.warn("index out of range",c,p);else if(E!==void 0)f.length>1&&e.warn("Insertion & removal are incompatible with edits to the same index.",c,p),u(E)?ee.push(p):I?(E==="add"&&(E={}),j.splice(p,0,E),$&&$.splice(p,0,{})):e.warn("Unrecognized full object edit value",c,p,E),H===-1&&(H=p);else for(T=0;T=0;S--)j.splice(ee[S],1),$&&$.splice(ee[S],1);if(j.length?V||n.set(j):n.set(null),g)return!1;if(h(k,A),m!==d){var Q;if(H===-1)Q=N;else{for(J=Math.max(j.length,J),Q=[],S=0;S=H);S++)Q.push(p);for(S=H;S=ke.data.length||$e<-ke.data.length)throw new Error(Fe+" must be valid indices for gd.data.");if(He.indexOf($e,qe+1)>-1||$e>=0&&He.indexOf(-ke.data.length+$e)>-1||$e<0&&He.indexOf(ke.data.length+$e)>-1)throw new Error("each index in "+Fe+" must be unique.")}}function $(ke,He,Fe){if(!Array.isArray(ke.data))throw new Error("gd.data must be an array.");if(He===void 0)throw new Error("currentIndices is a required argument.");if(Array.isArray(He)||(He=[He]),j(ke,He,"currentIndices"),Fe===void 0||Array.isArray(Fe)||(Fe=[Fe]),Fe!==void 0&&j(ke,Fe,"newIndices"),Fe!==void 0&&He.length!==Fe.length)throw new Error("current and new indices must be of equal length.")}function ee(ke,He,Fe,qe,$e){(function(ft,At,kt,Vt){var Ht=w.isPlainObject(Vt);if(!Array.isArray(ft.data))throw new Error("gd.data must be an array");if(!w.isPlainObject(At))throw new Error("update must be a key:value object");if(kt===void 0)throw new Error("indices must be an integer or array of integers");for(var Gt in j(ft,kt,"indices"),At){if(!Array.isArray(At[Gt])||At[Gt].length!==kt.length)throw new Error("attribute "+Gt+" must be an array of length equal to indices array length");if(Ht&&(!(Gt in Vt)||!Array.isArray(Vt[Gt])||Vt[Gt].length!==At[Gt].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")}})(ke,He,Fe,qe);for(var Ye=function(ft,At,kt,Vt){var Ht,Gt,st,Qe,pt,yt=w.isPlainObject(Vt),Ot=[];for(var Pt in Array.isArray(kt)||(kt=[kt]),kt=V(kt,ft.data.length-1),At)for(var at=0;at-1&&Fe.indexOf("grouptitlefont")===-1?De(Fe,Fe.replace("titlefont","title.font")):Fe.indexOf("titleposition")>-1?De(Fe,Fe.replace("titleposition","title.position")):Fe.indexOf("titleside")>-1?De(Fe,Fe.replace("titleside","title.side")):Fe.indexOf("titleoffset")>-1&&De(Fe,Fe.replace("titleoffset","title.offset")):De(Fe,Fe.replace("title","title.text"));function De(Be,Ge){ke[Ge]=ke[Be],delete ke[Be]}}function he(ke,He,Fe){ke=w.getGraphDiv(ke),S.clearPromiseQueue(ke);var qe={};if(typeof He=="string")qe[He]=Fe;else{if(!w.isPlainObject(He))return w.warn("Relayout fail.",He,Fe),Promise.reject();qe=w.extendFlat({},He)}Object.keys(qe).length&&(ke.changed=!0);var $e=ye(ke,qe),Ye=$e.flags;Ye.calc&&(ke.calcdata=void 0);var _e=[l.previousPromises];Ye.layoutReplot?_e.push(T.layoutReplot):Object.keys(qe).length&&(fe(ke,Ye,$e)||l.supplyDefaults(ke),Ye.legend&&_e.push(T.doLegend),Ye.layoutstyle&&_e.push(T.layoutStyles),Ye.axrange&&ie(_e,$e.rangesAltered),Ye.ticks&&_e.push(T.doTicksRelayout),Ye.modebar&&_e.push(T.doModeBar),Ye.camera&&_e.push(T.doCamera),Ye.colorbars&&_e.push(T.doColorBars),_e.push(E)),_e.push(l.rehover,l.redrag,l.reselect),u.add(ke,he,[ke,$e.undoit],he,[ke,$e.redoit]);var De=w.syncOrAsync(_e,ke);return De&&De.then||(De=Promise.resolve(ke)),De.then(function(){return ke.emit("plotly_relayout",$e.eventData),ke})}function fe(ke,He,Fe){var qe,$e,Ye=ke._fullLayout;if(!He.axrange)return!1;for(var _e in He)if(_e!=="axrange"&&He[_e])return!1;var De=function(At,kt){return w.coerce(qe,$e,c,At,kt)},Be={};for(var Ge in Fe.rangesAltered){var tt=o.id2name(Ge);if(qe=ke.layout[tt],$e=Ye[tt],s(qe,$e,De,Be),$e._matchGroup){for(var nt in $e._matchGroup)if(nt!==Ge){var ft=Ye[o.id2name(nt)];ft.autorange=$e.autorange,ft.range=$e.range.slice(),ft._input.range=$e.range.slice()}}}return!0}function ie(ke,He){var Fe=He?function(qe){var $e=[];for(var Ye in He){var _e=o.getFromId(qe,Ye);if($e.push(Ye),(_e.ticklabelposition||"").indexOf("inside")!==-1&&_e._anchorAxis&&$e.push(_e._anchorAxis._id),_e._matchGroup)for(var De in _e._matchGroup)He[De]||$e.push(De)}return o.draw(qe,$e,{skipTitle:!0})}:function(qe){return o.draw(qe,"redraw")};ke.push(k,T.doAutoRangeAndConstraints,Fe,T.drawData,T.finalDraw)}var oe=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,le=/^[xyz]axis[0-9]*\.autorange$/,ge=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function ye(ke,He){var Fe,qe,$e,Ye=ke.layout,_e=ke._fullLayout,De=_e._guiEditing,Be=Z(_e._preGUI,De),Ge=Object.keys(He),tt=o.list(ke),nt=w.extendDeepAll({},He),ft={};for(se(He),Ge=Object.keys(He),qe=0;qe0&&typeof at.parts[Xe]!="string";)Xe--;var ut=at.parts[Xe],wt=at.parts[Xe-1]+"."+ut,vt=at.parts.slice(0,Xe).join("."),Lt=y(ke.layout,vt).get(),jt=y(_e,vt).get(),rt=at.get();if(lt!==void 0){Gt[Pt]=lt,st[Pt]=ut==="reverse"?lt:Q(rt);var et=n.getLayoutValObject(_e,at.parts);if(et&&et.impliedEdits&<!==null)for(var Et in et.impliedEdits)Qe(w.relativeAttr(Pt,Et),et.impliedEdits[Et]);if(["width","height"].indexOf(Pt)!==-1)if(lt){Qe("autosize",null);var Bt=Pt==="height"?"width":"height";Qe(Bt,_e[Bt])}else _e[Pt]=ke._initialAutoSize[Pt];else if(Pt==="autosize")Qe("width",lt?null:_e.width),Qe("height",lt?null:_e.height);else if(wt.match(oe))Ot(wt),y(_e,vt+"._inputRange").set(null);else if(wt.match(le)){Ot(wt),y(_e,vt+"._inputRange").set(null);var Ft=y(_e,vt).get();Ft._inputDomain&&(Ft._input.domain=Ft._inputDomain.slice())}else wt.match(ge)&&y(_e,vt+"._inputDomain").set(null);if(ut==="type"){pt=Lt;var St=jt.type==="linear"&<==="log",Jt=jt.type==="log"&<==="linear";if(St||Jt){if(pt&&pt.range)if(jt.autorange)St&&(pt.range=pt.range[1]>pt.range[0]?[1,2]:[2,1]);else{var qt=pt.range[0],en=pt.range[1];St?(qt<=0&&en<=0&&Qe(vt+".autorange",!0),qt<=0?qt=en/1e6:en<=0&&(en=qt/1e6),Qe(vt+".range[0]",Math.log(qt)/Math.LN10),Qe(vt+".range[1]",Math.log(en)/Math.LN10)):(Qe(vt+".range[0]",Math.pow(10,qt)),Qe(vt+".range[1]",Math.pow(10,en)))}else Qe(vt+".autorange",!0);Array.isArray(_e._subplots.polar)&&_e._subplots.polar.length&&_e[at.parts[0]]&&at.parts[1]==="radialaxis"&&delete _e[at.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ke,jt,lt,Qe),r.getComponentMethod("images","convertCoords")(ke,jt,lt,Qe)}else Qe(vt+".autorange",!0),Qe(vt+".range",null);y(_e,vt+"._inputRange").set(null)}else if(ut.match(M)){var Wt=y(_e,Pt).get(),Zt=(lt||{}).type;Zt&&Zt!=="-"||(Zt="linear"),r.getComponentMethod("annotations","convertCoords")(ke,Wt,Zt,Qe),r.getComponentMethod("images","convertCoords")(ke,Wt,Zt,Qe)}var on=v.containerArrayMatch(Pt);if(on){Fe=on.array,qe=on.index;var un=on.property,Pn=et||{editType:"calc"};qe!==""&&un===""&&(v.isAddVal(lt)?st[Pt]=null:v.isRemoveVal(lt)?st[Pt]=(y(Ye,Fe).get()||[])[qe]:w.warn("unrecognized full object value",He)),p.update(Ht,Pn),ft[Fe]||(ft[Fe]={});var Dn=ft[Fe][qe];Dn||(Dn=ft[Fe][qe]={}),Dn[un]=lt,delete He[Pt]}else ut==="reverse"?(Lt.range?Lt.range.reverse():(Qe(vt+".autorange",!0),Lt.range=[1,0]),jt.autorange?Ht.calc=!0:Ht.plot=!0):(Pt==="dragmode"&&(lt===!1&&rt!==!1||lt!==!1&&rt===!1)||_e._has("scatter-like")&&_e._has("regl")&&Pt==="dragmode"&&(lt==="lasso"||lt==="select")&&rt!=="lasso"&&rt!=="select"||_e._has("gl2d")?Ht.plot=!0:et?p.update(Ht,et):Ht.calc=!0,at.set(lt))}}for(Fe in ft)v.applyContainerArrayChanges(ke,Be(Ye,Fe),ft[Fe],Ht,Be)||(Ht.plot=!0);for(var In in yt){var mn=(pt=o.getFromId(ke,In))&&pt._constraintGroup;if(mn)for(var En in Ht.calc=!0,mn)yt[En]||(o.getFromId(ke,En)._constraintShrinkable=!0)}(me(ke)||He.height||He.width)&&(Ht.plot=!0);var Kn=_e.shapes;for(qe=0;qe1;)if(qe.pop(),(Fe=y(He,qe.join(".")+".uirevision").get())!==void 0)return Fe;return He.uirevision}function We(ke,He){for(var Fe=0;Fe=$e.length?$e[0]:$e[Ge]:$e}function De(Ge){return Array.isArray(Ye)?Ge>=Ye.length?Ye[0]:Ye[Ge]:Ye}function Be(Ge,tt){var nt=0;return function(){if(Ge&&++nt===tt)return Ge()}}return qe._frameWaitingCnt===void 0&&(qe._frameWaitingCnt=0),new Promise(function(Ge,tt){function nt(){ke.emit("plotly_animating"),qe._lastFrameAt=-1/0,qe._timeToNext=0,qe._runningTransitions=0,qe._currentFrame=null;var Pt=function(){qe._animationRaf=window.requestAnimationFrame(Pt),Date.now()-qe._lastFrameAt>qe._timeToNext&&function(){qe._currentFrame&&qe._currentFrame.onComplete&&qe._currentFrame.onComplete();var at=qe._currentFrame=qe._frameQueue.shift();if(at){var lt=at.name?at.name.toString():null;ke._fullLayout._currentFrame=lt,qe._lastFrameAt=Date.now(),qe._timeToNext=at.frameOpts.duration,l.transition(ke,at.frame.data,at.frame.layout,S.coerceTraceIndices(ke,at.frame.traces),at.frameOpts,at.transitionOpts).then(function(){at.onComplete&&at.onComplete()}),ke.emit("plotly_animatingframe",{name:lt,frame:at.frame,animation:{frame:at.frameOpts,transition:at.transitionOpts}})}else ke.emit("plotly_animated"),window.cancelAnimationFrame(qe._animationRaf),qe._animationRaf=null}()};Pt()}var ft,At,kt=0;function Vt(Pt){return Array.isArray($e)?kt>=$e.length?Pt.transitionOpts=$e[kt]:Pt.transitionOpts=$e[0]:Pt.transitionOpts=$e,kt++,Pt}var Ht=[],Gt=He==null,st=Array.isArray(He);if(Gt||st||!w.isPlainObject(He)){if(Gt||["string","number"].indexOf(typeof He)!==-1)for(ft=0;ft0&&ytyt)&&Ot.push(At);Ht=Ot}}Ht.length>0?function(Pt){if(Pt.length!==0){for(var at=0;at=0;qe--)if(w.isPlainObject(He[qe])){var ft=He[qe].name,At=(Be[ft]||nt[ft]||{}).name,kt=He[qe].name,Vt=Be[At]||nt[At];At&&kt&&typeof kt=="number"&&Vt&&f<5&&(f++,w.warn('addFrames: overwriting frame "'+(Be[At]||nt[At]).name+'" with a frame whose name of type "number" also equates to "'+At+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),f===5&&w.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.")),nt[ft]={name:ft},tt.push({frame:l.supplyFrameDefaults(He[qe]),index:Fe&&Fe[qe]!==void 0&&Fe[qe]!==null?Fe[qe]:Ge+qe})}tt.sort(function(Pt,at){return Pt.index>at.index?-1:Pt.index=0;qe--){if(typeof($e=tt[qe].frame).name=="number"&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!$e.name)for(;Be[$e.name="frame "+ke._transitionData._counter++];);if(Be[$e.name]){for(Ye=0;Ye=0;Fe--)qe=He[Fe],Ye.push({type:"delete",index:qe}),_e.unshift({type:"insert",index:qe,value:$e[qe]});var De=l.modifyFrames,Be=l.modifyFrames,Ge=[ke,_e],tt=[ke,Ye];return u&&u.add(ke,De,Ge,Be,tt),l.modifyFrames(ke,Ye)},L.addTraces=function ke(He,Fe,qe){He=w.getGraphDiv(He);var $e,Ye,_e=[],De=L.deleteTraces,Be=ke,Ge=[He,_e],tt=[He,Fe];for(function(nt,ft,At){var kt,Vt;if(!Array.isArray(nt.data))throw new Error("gd.data must be an array.");if(ft===void 0)throw new Error("traces must be defined.");for(Array.isArray(ft)||(ft=[ft]),kt=0;kt=0&&tt=0&&tt=N.length)return!1;if(M.dimensions===2){if(E++,f.length===E)return M;var V=f[E];if(!A(V))return!1;M=N[B][V]}else M=N[B]}else M=N}}return M}function A(M){return M===Math.round(M)&&M>=0}function v(){var M,f,E={};for(M in n(E,w),b.subplotsRegistry)if((f=b.subplotsRegistry[M]).layoutAttributes)if(Array.isArray(f.attr))for(var I=0;I=V.length)return!1;I=(E=(b.transformsRegistry[V[j].type]||{}).attributes)&&E[f[2]],N=3}else{var $=M._module;if($||($=(b.modules[M.type||e.type.dflt]||{})._module),!$)return!1;if(!(I=(E=$.attributes)&&E[B])){var ee=$.basePlotModule;ee&&ee.attributes&&(I=ee.attributes[B])}I||(I=e[B])}return k(I,f,N)},L.getLayoutValObject=function(M,f){var E=function(I,B){var N,V,j,$,ee=I._basePlotModules;if(ee){var H;for(N=0;N=l&&(n._input||{})._templateitemname;s&&(o=l);var c,h=r+"["+o+"]";function x(){c={},s&&(c[h]={},c[h][e]=s)}function m(k,A){s?b.nestedProperty(c[h],k).set(A):c[h+"."+k]=A}function g(){var k=c;return x(),k}return x(),{modifyBase:function(k,A){c[k]=A},modifyItem:m,getUpdateObj:g,applyUpdate:function(k,A){k&&m(k,A);var v=g();for(var S in v)b.nestedProperty(u,S).set(v[S])}}}},71817:function(D,L,t){var b=t(45568),d=t(33626),e=t(44122),w=t(34809),y=t(30635),_=t(34823),u=t(78766),r=t(62203),n=t(17240),l=t(95433),o=t(29714),s=t(4530),c=t(84391),h=c.enforce,x=c.clean,m=t(32919).doAutoRange,g="start",k=t(54826).zindexSeparator;function A(f,E,I){for(var B=0;B=f[1]||N[1]<=f[0])&&V[0]E[0])return!0}return!1}function v(f){var E,I,B,N,V,j,$=f._fullLayout,ee=$._size,H=ee.p,J=o.list(f,"",!0);if($._paperdiv.style({width:f._context.responsive&&$.autosize&&!f._context._hasZeroWidth&&!f.layout.width?"100%":$.width+"px",height:f._context.responsive&&$.autosize&&!f._context._hasZeroHeight&&!f.layout.height?"100%":$.height+"px"}).selectAll(".main-svg").call(r.setSize,$.width,$.height),f._context.setBackground(f,$.paper_bgcolor),L.drawMainTitle(f),l.manage(f),!$._has("cartesian"))return e.previousPromises(f);function Q(nt,ft,At){var kt=nt._lw/2;return nt._id.charAt(0)==="x"?ft?At==="top"?ft._offset-H-kt:ft._offset+ft._length+H+kt:ee.t+ee.h*(1-(nt.position||0))+kt%1:ft?At==="right"?ft._offset+ft._length+H+kt:ft._offset-H-kt:ee.l+ee.w*(nt.position||0)+kt%1}for(E=0;E.5?"t":"b",ge=se._fullLayout.margin[le],ye=0;return he.yref==="paper"?ye=fe+he.pad.t+he.pad.b:he.yref==="container"&&(ye=function(me,be,Se,Ee,Ce){var Le=0;return Se==="middle"&&(Le+=Ce/2),me==="t"?(Se==="top"&&(Le+=Ce),Le+=Ee-be*Ee):(Se==="bottom"&&(Le+=Ce),Le+=be*Ee),Le}(le,ie,oe,se._fullLayout.height,fe)+he.pad.t+he.pad.b),ye>ge?ye:0}(f,E,ee);if(H>0){(function(se,he,fe,ie){var oe="title.automargin",le=se._fullLayout.title,ge=le.y>.5?"t":"b",ye={x:le.x,y:le.y,t:0,b:0},me={};le.yref==="paper"&&function(be,Se,Ee,Ce,Le){var Oe=Se.yref==="paper"?be._fullLayout._size.h:be._fullLayout.height,We=w.isTopAnchor(Se)?Ce:Ce-Le,Ie=Ee==="b"?Oe-We:We;return!(w.isTopAnchor(Se)&&Ee==="t"||w.isBottomAnchor(Se)&&Ee==="b")&&Iej?T.push({code:"unused",traceType:E,templateCount:V,dataCount:j}):j>V&&T.push({code:"reused",traceType:E,templateCount:V,dataCount:j})}}else T.push({code:"data"});if(function $(ee,H){for(var J in ee)if(J.charAt(0)!=="_"){var Q=ee[J],Z=c(ee,J,H);d(Q)?(Array.isArray(ee)&&Q._template===!1&&Q.templateitemname&&T.push({code:"missing",path:Z,templateitemname:Q.templateitemname}),$(Q,Z)):Array.isArray(Q)&&h(Q)&&$(Q,Z)}}({data:M,layout:p},""),T.length)return T.map(x)}},80491:function(D,L,t){var b=t(10721),d=t(31420),e=t(44122),w=t(34809),y=t(84619),_=t(6243),u=t(72914),r=t(29697).version,n={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}};D.exports=function(l,o){var s,c,h,x;function m(j){return!(j in o)||w.validate(o[j],n[j])}if(o=o||{},w.isPlainObject(l)?(s=l.data||[],c=l.layout||{},h=l.config||{},x={}):(l=w.getGraphDiv(l),s=w.extendDeep([],l.data),c=w.extendDeep({},l.layout),h=l._context,x=l._fullLayout||{}),!m("width")&&o.width!==null||!m("height")&&o.height!==null)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+w.join2(n.format.values,", "," or ")+".");var g={};function k(j,$){return w.coerce(o,g,n,j,$)}var A=k("format"),v=k("width"),S=k("height"),T=k("scale"),p=k("setBackground"),M=k("imageDataOnly"),f=document.createElement("div");f.style.position="absolute",f.style.left="-5000px",document.body.appendChild(f);var E=w.extendFlat({},c);v?E.width=v:o.width===null&&b(x.width)&&(E.width=x.width),S?E.height=S:o.height===null&&b(x.height)&&(E.height=x.height);var I=w.extendFlat({},h,{_exportedPlot:!0,staticPlot:!0,setBackground:p}),B=y.getRedrawFunc(f);function N(){return new Promise(function(j){setTimeout(j,y.getDelay(f._fullLayout))})}function V(){return new Promise(function(j,$){var ee=_(f,A,T),H=f._fullLayout.width,J=f._fullLayout.height;function Q(){d.purge(f),document.body.removeChild(f)}if(A==="full-json"){var Z=e.graphJson(f,!1,"keepdata","object",!0,!0);return Z.version=r,Z=JSON.stringify(Z),Q(),j(M?Z:y.encodeJSON(Z))}if(Q(),A==="svg")return j(M?ee:y.encodeSVG(ee));var K=document.createElement("canvas");K.id=w.randstr(),u({format:A,width:H,height:J,scale:T,canvas:K,svg:ee,promise:!0}).then(j).catch($)})}return new Promise(function(j,$){d.newPlot(f,s,E,I).then(B).then(N).then(V).then(function(ee){j(function(H){return M?H.replace(y.IMAGE_URL_PREFIX,""):H}(ee))}).catch(function(ee){$(ee)})})}},2466:function(D,L,t){var b=t(34809),d=t(44122),e=t(57297),w=t(24452).dfltConfig,y=b.isPlainObject,_=Array.isArray,u=b.isArrayOrTypedArray;function r(m,g,k,A,v,S){S=S||[];for(var T=Object.keys(m),p=0;pI.length&&A.push(o("unused",v,f.concat(I.length)));var ee,H,J,Q,Z,K=I.length,ae=Array.isArray($);if(ae&&(K=Math.min(K,$.length)),B.dimensions===2)for(H=0;HI[H].length&&A.push(o("unused",v,f.concat(H,I[H].length)));var se=I[H].length;for(ee=0;ee<(ae?Math.min(se,$[H].length):se);ee++)J=ae?$[H][ee]:$,Q=E[H][ee],Z=I[H][ee],b.validate(Q,J)?Z!==Q&&Z!==+Q&&A.push(o("dynamic",v,f.concat(H,ee),Q,Z)):A.push(o("value",v,f.concat(H,ee),Q))}else A.push(o("array",v,f.concat(H),E[H]));else for(H=0;H1&&S.push(o("object","layout"))),d.supplyDefaults(T);for(var p=T._fullData,M=k.length,f=0;f0&&Math.round(c)===c))return{vals:n};o=c}for(var h=u.calendar,x=l==="start",m=l==="end",g=_[r+"period0"],k=e(g,h)||0,A=[],v=[],S=[],T=n.length,p=0;pI;)E=w(E,-o,h);for(;E<=I;)E=w(E,o,h);f=w(E,-o,h)}else{for(E=k+(M=Math.round((I-k)/s))*s;E>I;)E-=s;for(;E<=I;)E+=s;f=E-s}A[p]=x?f:m?E:(f+E)/2,v[p]=f,S[p]=E}return{vals:A,starts:v,ends:S}}},55126:function(D){D.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}},32919:function(D,L,t){var b=t(45568),d=t(10721),e=t(34809),w=t(63821).FP_SAFE,y=t(33626),_=t(62203),u=t(5975),r=u.getFromId,n=u.isLinked;function l(p,M){var f,E,I=[],B=p._fullLayout,N=s(B,M,0),V=s(B,M,1),j=h(p,M),$=j.min,ee=j.max;if($.length===0||ee.length===0)return e.simpleMap(M.range,M.r2l);var H=$[0].val,J=ee[0].val;for(f=1;f<$.length&&H===J;f++)H=Math.min(H,$[f].val);for(f=1;f0&&((ie=me-N(ae)-V(se))>be?oe/ie>Se&&(he=ae,fe=se,Se=oe/ie):oe/me>Se&&(he={val:ae.val,nopad:1},fe={val:se.val,nopad:1},Se=oe/me));if(H===J){var Ee=H-1,Ce=H+1;if(ge)if(H===0)I=[0,1];else{var Le=(H>0?ee:$).reduce(function(We,Ie){return Math.max(We,V(Ie))},0),Oe=H/(1-Math.min(.5,Le/me));I=H>0?[0,Oe]:[Oe,0]}else I=ye?[Math.max(0,Ee),Math.max(1,Ce)]:[Ee,Ce]}else ge?(he.val>=0&&(he={val:0,nopad:1}),fe.val<=0&&(fe={val:0,nopad:1})):ye&&(he.val-Se*N(he)<0&&(he={val:0,nopad:1}),fe.val<=0&&(fe={val:1,nopad:1})),Se=(fe.val-he.val-o(M,ae.val,se.val))/(me-N(he)-V(fe)),I=[he.val-Se*N(he),fe.val+Se*V(fe)];return I=T(I,M),M.limitRange&&M.limitRange(),Z&&I.reverse(),e.simpleMap(I,M.l2r||Number)}function o(p,M,f){var E=0;if(p.rangebreaks)for(var I=p.locateBreaks(M,f),B=0;B0?f.ppadplus:f.ppadminus)||f.ppad||0),le=ie((p._m>0?f.ppadminus:f.ppadplus)||f.ppad||0),ge=ie(f.vpadplus||f.vpad),ye=ie(f.vpadminus||f.vpad);if(!he){if(ee=1/0,H=-1/0,se)for(E=0;E0&&(ee=I),I>H&&I-w&&(ee=I),I>H&&I=Se;E--)be(E);return{min:J,max:Q,opts:f}},concatExtremes:h};var c=3;function h(p,M,f){var E,I,B,N=M._id,V=p._fullData,j=p._fullLayout,$=[],ee=[];function H(ae,se){for(E=0;E=f&&($.extrapad||!N)){V=!1;break}I(M,$.val)&&$.pad<=f&&(N||!$.extrapad)&&(p.splice(j,1),j--)}if(V){var ee=B&&M===0;p.push({val:M,pad:ee?0:f,extrapad:!ee&&N})}}function k(p){return d(p)&&Math.abs(p)=M}function S(p,M,f){return M===void 0||f===void 0||(M=p.d2l(M))=j&&(B=j,f=j),N<=j&&(N=j,E=j)}}return f=function($,ee){var H=ee.autorangeoptions;return H&&H.minallowed!==void 0&&S(ee,H.minallowed,H.maxallowed)?H.minallowed:H&&H.clipmin!==void 0&&S(ee,H.clipmin,H.clipmax)?Math.max($,ee.d2l(H.clipmin)):$}(f,M),E=function($,ee){var H=ee.autorangeoptions;return H&&H.maxallowed!==void 0&&S(ee,H.minallowed,H.maxallowed)?H.maxallowed:H&&H.clipmax!==void 0&&S(ee,H.clipmin,H.clipmax)?Math.min($,ee.d2l(H.clipmax)):$}(E,M),[f,E]}},75511:function(D){D.exports=function(L,t,b){var d,e;if(b){var w=t==="reversed"||t==="min reversed"||t==="max reversed";d=b[w?1:0],e=b[w?0:1]}var y=L("autorangeoptions.minallowed",e===null?d:void 0),_=L("autorangeoptions.maxallowed",d===null?e:void 0);y===void 0&&L("autorangeoptions.clipmin"),_===void 0&&L("autorangeoptions.clipmax"),L("autorangeoptions.include")}},29714:function(D,L,t){var b=t(45568),d=t(10721),e=t(44122),w=t(33626),y=t(34809),_=y.strTranslate,u=t(30635),r=t(17240),n=t(78766),l=t(62203),o=t(25829),s=t(68599),c=t(63821),h=c.ONEMAXYEAR,x=c.ONEAVGYEAR,m=c.ONEMINYEAR,g=c.ONEMAXQUARTER,k=c.ONEAVGQUARTER,A=c.ONEMINQUARTER,v=c.ONEMAXMONTH,S=c.ONEAVGMONTH,T=c.ONEMINMONTH,p=c.ONEWEEK,M=c.ONEDAY,f=M/2,E=c.ONEHOUR,I=c.ONEMIN,B=c.ONESEC,N=c.ONEMILLI,V=c.ONEMICROSEC,j=c.MINUS_SIGN,$=c.BADNUM,ee={K:"zeroline"},H={K:"gridline",L:"path"},J={K:"minor-gridline",L:"path"},Q={K:"tick",L:"path"},Z={K:"tick",L:"text"},K={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},ae=t(4530),se=ae.MID_SHIFT,he=ae.CAP_SHIFT,fe=ae.LINE_SPACING,ie=ae.OPPOSITE_SIDE,oe=D.exports={};oe.setConvert=t(19091);var le=t(9666),ge=t(5975),ye=ge.idSort,me=ge.isLinked;oe.id2name=ge.id2name,oe.name2id=ge.name2id,oe.cleanId=ge.cleanId,oe.list=ge.list,oe.listIds=ge.listIds,oe.getFromId=ge.getFromId,oe.getFromTrace=ge.getFromTrace;var be=t(32919);oe.getAutoRange=be.getAutoRange,oe.findExtremes=be.findExtremes;var Se=1e-4;function Ee(rt){var et=(rt[1]-rt[0])*Se;return[rt[0]-et,rt[1]+et]}oe.coerceRef=function(rt,et,Et,Bt,Ft,St){var Jt=Bt.charAt(Bt.length-1),qt=Et._fullLayout._subplots[Jt+"axis"],en=Bt+"ref",Wt={};return Ft||(Ft=qt[0]||(typeof St=="string"?St:St[0])),St||(St=Ft),qt=qt.concat(qt.map(function(Zt){return Zt+" domain"})),Wt[en]={valType:"enumerated",values:qt.concat(St?typeof St=="string"?[St]:St:[]),dflt:Ft},y.coerce(rt,et,Wt,en)},oe.getRefType=function(rt){return rt===void 0?rt:rt==="paper"?"paper":rt==="pixel"?"pixel":/( domain)$/.test(rt)?"domain":"range"},oe.coercePosition=function(rt,et,Et,Bt,Ft,St){var Jt,qt;if(oe.getRefType(Bt)!=="range")Jt=y.ensureNumber,qt=Et(Ft,St);else{var en=oe.getFromId(et,Bt);qt=Et(Ft,St=en.fraction2r(St)),Jt=en.cleanPos}rt[Ft]=Jt(qt)},oe.cleanPosition=function(rt,et,Et){return(Et==="paper"||Et==="pixel"?y.ensureNumber:oe.getFromId(et,Et).cleanPos)(rt)},oe.redrawComponents=function(rt,et){et=et||oe.listIds(rt);var Et=rt._fullLayout;function Bt(Ft,St,Jt,qt){for(var en=w.getComponentMethod(Ft,St),Wt={},Zt=0;ZtBt&&on2e-6||((Et-rt._forceTick0)/rt._minDtick%1+1.000001)%1>2e-6)&&(rt._minDtick=0)):rt._minDtick=0},oe.saveRangeInitial=function(rt,et){for(var Et=oe.list(rt,"",!0),Bt=!1,Ft=0;Ft.3*Qn||$n(Ln)||$n(Tn))){var lr=Kn.dtick/2;mn+=mn+lr.8){var wn=Number(Kn.substr(1));Fn.exactYears>.8&&wn%12==0?mn=oe.tickIncrement(mn,"M6","reverse")+1.5*M:Fn.exactMonths>.8?mn=oe.tickIncrement(mn,"M1","reverse")+15.5*M:mn-=f;var zn=oe.tickIncrement(mn,Kn);if(zn<=Ln)return zn}return mn}(In,rt,Dn,qt,Ft)),Pn=In;Pn<=en;)Pn=oe.tickIncrement(Pn,Dn,!1,Ft);return{start:et.c2r(In,0,Ft),end:et.c2r(Pn,0,Ft),size:Dn,_dataSpan:en-qt}},oe.prepMinorTicks=function(rt,et,Et){if(!et.minor.dtick){delete rt.dtick;var Bt,Ft=et.dtick&&d(et._tmin);if(Ft){var St=oe.tickIncrement(et._tmin,et.dtick,!0);Bt=[et._tmin,.99*St+.01*et._tmin]}else{var Jt=y.simpleMap(et.range,et.r2l);Bt=[Jt[0],.8*Jt[0]+.2*Jt[1]]}if(rt.range=y.simpleMap(Bt,et.l2r),rt._isMinor=!0,oe.prepTicks(rt,Et),Ft){var qt=d(et.dtick),en=d(rt.dtick),Wt=qt?et.dtick:+et.dtick.substring(1),Zt=en?rt.dtick:+rt.dtick.substring(1);qt&&en?We(Wt,Zt)?Wt===2*p&&Zt===2*M&&(rt.dtick=p):Wt===2*p&&Zt===3*M?rt.dtick=p:Wt!==p||(et._input.minor||{}).nticks?Ie(Wt/Zt,2.5)?rt.dtick=Wt/2:rt.dtick=Wt:rt.dtick=M:String(et.dtick).charAt(0)==="M"?en?rt.dtick="M1":We(Wt,Zt)?Wt>=12&&Zt===2&&(rt.dtick="M3"):rt.dtick=et.dtick:String(rt.dtick).charAt(0)==="L"?String(et.dtick).charAt(0)==="L"?We(Wt,Zt)||(rt.dtick=Ie(Wt/Zt,2.5)?et.dtick/2:et.dtick):rt.dtick="D1":rt.dtick==="D2"&&+et.dtick>1&&(rt.dtick=1)}rt.range=et.range}et.minor._tick0Init===void 0&&(rt.tick0=et.tick0)},oe.prepTicks=function(rt,et){var Et=y.simpleMap(rt.range,rt.r2l,void 0,void 0,et);if(rt.tickmode==="auto"||!rt.dtick){var Bt,Ft=rt.nticks;Ft||(rt.type==="category"||rt.type==="multicategory"?(Bt=rt.tickfont?y.bigFont(rt.tickfont.size||12):15,Ft=rt._length/Bt):(Bt=rt._id.charAt(0)==="y"?40:80,Ft=y.constrain(rt._length/Bt,4,9)+1),rt._name==="radialaxis"&&(Ft*=2)),rt.minor&&rt.minor.tickmode!=="array"||rt.tickmode==="array"&&(Ft*=100),rt._roughDTick=Math.abs(Et[1]-Et[0])/Ft,oe.autoTicks(rt,rt._roughDTick),rt._minDtick>0&&rt.dtick<2*rt._minDtick&&(rt.dtick=rt._minDtick,rt.tick0=rt.l2r(rt._forceTick0))}rt.ticklabelmode==="period"&&function(St){var Jt;function qt(){return!(d(St.dtick)||St.dtick.charAt(0)!=="M")}var en=qt(),Wt=oe.getTickFormat(St);if(Wt){var Zt=St._dtickInit!==St.dtick;/%[fLQsSMX]/.test(Wt)||(/%[HI]/.test(Wt)?(Jt=E,Zt&&!en&&St.dtickrt.range[1],on=!rt.ticklabelindex||y.isArrayOrTypedArray(rt.ticklabelindex)?rt.ticklabelindex:[rt.ticklabelindex],un=y.simpleMap(rt.range,rt.r2l,void 0,void 0,et),Pn=un[1]=(wn?0:1);zn--){var Jn=!zn;zn?(rt._dtickInit=rt.dtick,rt._tick0Init=rt.tick0):(rt.minor._dtickInit=rt.minor.dtick,rt.minor._tick0Init=rt.minor.tick0);var $n=zn?rt:y.extendFlat({},rt,rt.minor);if(Jn?oe.prepMinorTicks($n,rt,et):oe.prepTicks($n,et),$n.tickmode!=="array")if($n.tickmode!=="sync"){var vr=Ee(un),Qn=vr[0],lr=vr[1],hr=d($n.dtick),jr=Jt==="log"&&!(hr||$n.dtick.charAt(0)==="L"),ni=oe.tickFirst($n,et);if(zn){if(rt._tmin=ni,ni=lr:Qr<=lr;Qr=oe.tickIncrement(Qr,kn,Pn,qt)){if(zn&&Or++,$n.rangebreaks&&!Pn){if(Qr=In)break}if(Ln.length>mn||Qr===xr)break;xr=Qr;var Cn={value:Qr};zn?(jr&&Qr!==(0|Qr)&&(Cn.simpleLabel=!0),en>1&&Or%en&&(Cn.skipLabel=!0),Ln.push(Cn)):(Cn.minor=!0,Tn.push(Cn))}}else Ln=[],En=de(rt);else zn?(Ln=[],En=Me(rt,!Jn)):(Tn=[],Kn=Me(rt,!Jn))}if(!Tn||Tn.length<2?on=!1:(Et=(Tn[1].value-Tn[0].value)*(Zt?-1:1),Bt=rt.tickformat,(/%f/.test(Bt)?Et>=V:/%L/.test(Bt)?Et>=N:/%[SX]/.test(Bt)?Et>=B:/%M/.test(Bt)?Et>=I:/%[HI]/.test(Bt)?Et>=E:/%p/.test(Bt)?Et>=f:/%[Aadejuwx]/.test(Bt)?Et>=M:/%[UVW]/.test(Bt)?Et>=p:/%[Bbm]/.test(Bt)?Et>=T:/%[q]/.test(Bt)?Et>=A:!/%[Yy]/.test(Bt)||Et>=m)||(on=!1)),on){var ur=Ln.concat(Tn);Wt&&Ln.length&&(ur=ur.slice(1)),(ur=ur.sort(function(dn,ln){return dn.value-ln.value}).filter(function(dn,ln,An){return ln===0||dn.value!==An[ln-1].value})).map(function(dn,ln){return dn.minor!==void 0||dn.skipLabel?null:ln}).filter(function(dn){return dn!==null}).forEach(function(dn){on.map(function(ln){var An=dn+ln;An>=0&&An0?(Tr=er-1,yr=er):(Tr=er,yr=er);var Ur,Rr=dn[Tr].value,$r=dn[yr].value,Pr=Math.abs($r-Rr),Cr=An||Pr,Jr=0;Cr>=m?Jr=Pr>=m&&Pr<=h?Pr:x:An===k&&Cr>=A?Jr=Pr>=A&&Pr<=g?Pr:k:Cr>=T?Jr=Pr>=T&&Pr<=v?Pr:S:An===p&&Cr>=p?Jr=p:Cr>=M?Jr=M:An===f&&Cr>=f?Jr=f:An===E&&Cr>=E&&(Jr=E),Jr>=Pr&&(Jr=Pr,Ur=!0);var gi=br+Jr;if(ln.rangebreaks&&Jr>0){for(var ii=0,Yr=0;Yr<84;Yr++){var oi=(Yr+.5)/84;ln.maskBreaks(br*(1-oi)+oi*gi)!==$&&ii++}(Jr*=ii/84)||(dn[er].drop=!0),Ur&&Pr>p&&(Jr=Pr)}(Jr>0||er===0)&&(dn[er].periodX=br+Jr/2)}}(Fn,rt,rt._definedDelta),rt.rangebreaks){var Yn=rt._id.charAt(0)==="y",an=1;rt.tickmode==="auto"&&(an=rt.tickfont?rt.tickfont.size:12);var _n=NaN;for(Ft=Ln.length-1;Ft>-1;Ft--)if(Ln[Ft].drop)Ln.splice(Ft,1);else{Ln[Ft].value=wt(Ln[Ft].value,rt);var gn=rt.c2p(Ln[Ft].value);(Yn?_n>gn-an:_nIn||erIn&&(An.periodX=In),er10||Bt.substr(5)!=="01-01"?rt._tickround="d":rt._tickround=+et.substr(1)%12==0?"y":"m";else if(et>=M&&Ft<=10||et>=15*M)rt._tickround="d";else if(et>=I&&Ft<=16||et>=E)rt._tickround="M";else if(et>=B&&Ft<=19||et>=I)rt._tickround="S";else{var St=rt.l2r(Et+et).replace(/^-/,"").length;rt._tickround=Math.max(Ft,St)-20,rt._tickround<0&&(rt._tickround=4)}}else if(d(et)||et.charAt(0)==="L"){var Jt=rt.range.map(rt.r2d||Number);d(et)||(et=Number(et.substr(1))),rt._tickround=2-Math.floor(Math.log(et)/Math.LN10+.01);var qt=Math.max(Math.abs(Jt[0]),Math.abs(Jt[1])),en=Math.floor(Math.log(qt)/Math.LN10+.01),Wt=rt.minexponent===void 0?3:rt.minexponent;Math.abs(en)>Wt&&(nt(rt.exponentformat)&&!ft(en)?rt._tickexponent=3*Math.round((en-1)/3):rt._tickexponent=en)}else rt._tickround=null}function Ge(rt,et,Et){var Bt=rt.tickfont||{};return{x:et,dx:0,dy:0,text:Et||"",fontSize:Bt.size,font:Bt.family,fontWeight:Bt.weight,fontStyle:Bt.style,fontVariant:Bt.variant,fontTextcase:Bt.textcase,fontLineposition:Bt.lineposition,fontShadow:Bt.shadow,fontColor:Bt.color}}oe.autoTicks=function(rt,et,Et){var Bt;function Ft(on){return Math.pow(on,Math.floor(Math.log(et)/Math.LN10))}if(rt.type==="date"){rt.tick0=y.dateTick0(rt.calendar,0);var St=2*et;if(St>x)et/=x,Bt=Ft(10),rt.dtick="M"+12*De(et,Bt,ke);else if(St>S)et/=S,rt.dtick="M"+De(et,1,He);else if(St>M){if(rt.dtick=De(et,M,rt._hasDayOfWeekBreaks?[1,2,7,14]:qe),!Et){var Jt=oe.getTickFormat(rt),qt=rt.ticklabelmode==="period";qt&&(rt._rawTick0=rt.tick0),/%[uVW]/.test(Jt)?rt.tick0=y.dateTick0(rt.calendar,2):rt.tick0=y.dateTick0(rt.calendar,1),qt&&(rt._dowTick0=rt.tick0)}}else St>E?rt.dtick=De(et,E,He):St>I?rt.dtick=De(et,I,Fe):St>B?rt.dtick=De(et,B,Fe):(Bt=Ft(10),rt.dtick=De(et,Bt,ke))}else if(rt.type==="log"){rt.tick0=0;var en=y.simpleMap(rt.range,rt.r2l);if(rt._isMinor&&(et*=1.5),et>.7)rt.dtick=Math.ceil(et);else if(Math.abs(en[1]-en[0])<1){var Wt=1.5*Math.abs((en[1]-en[0])/et);et=Math.abs(Math.pow(10,en[1])-Math.pow(10,en[0]))/Wt,Bt=Ft(10),rt.dtick="L"+De(et,Bt,ke)}else rt.dtick=et>.3?"D2":"D1"}else rt.type==="category"||rt.type==="multicategory"?(rt.tick0=0,rt.dtick=Math.ceil(Math.max(et,1))):ut(rt)?(rt.tick0=0,Bt=1,rt.dtick=De(et,Bt,_e)):(rt.tick0=0,Bt=Ft(10),rt.dtick=De(et,Bt,ke));if(rt.dtick===0&&(rt.dtick=1),!d(rt.dtick)&&typeof rt.dtick!="string"){var Zt=rt.dtick;throw rt.dtick=1,"ax.dtick error: "+String(Zt)}},oe.tickIncrement=function(rt,et,Et,Bt){var Ft=Et?-1:1;if(d(et))return y.increment(rt,Ft*et);var St=et.charAt(0),Jt=Ft*Number(et.substr(1));if(St==="M")return y.incrementMonth(rt,Jt,Bt);if(St==="L")return Math.log(Math.pow(10,rt)+Jt)/Math.LN10;if(St==="D"){var qt=et==="D2"?Ye:$e,en=rt+.01*Ft,Wt=y.roundUp(y.mod(en,1),qt,Et);return Math.floor(en)+Math.log(b.round(Math.pow(10,Wt),1))/Math.LN10}throw"unrecognized dtick "+String(et)},oe.tickFirst=function(rt,et){var Et=rt.r2l||Number,Bt=y.simpleMap(rt.range,Et,void 0,void 0,et),Ft=Bt[1]=0&&En<=rt._length?mn:null};if(Jt&&y.isArrayOrTypedArray(rt.ticktext)){var on=y.simpleMap(rt.range,rt.r2l),un=(Math.abs(on[1]-on[0])-(rt._lBreaks||0))/1e4;for(Ft=0;Ft ")}else mn._prevDateHead=wn,zn+="
"+wn;En.text=zn}(rt,St,Et,qt):en==="log"?function(mn,En,Kn,Ln,Tn){var Fn=mn.dtick,wn=En.x,zn=mn.tickformat,Jn=typeof Fn=="string"&&Fn.charAt(0);if(Tn==="never"&&(Tn=""),Ln&&Jn!=="L"&&(Fn="L3",Jn="L"),zn||Jn==="L")En.text=At(Math.pow(10,wn),mn,Tn,Ln);else if(d(Fn)||Jn==="D"&&y.mod(wn+.01,1)<.1){var $n=Math.round(wn),vr=Math.abs($n),Qn=mn.exponentformat;Qn==="power"||nt(Qn)&&ft($n)?(En.text=$n===0?1:$n===1?"10":"10"+($n>1?"":j)+vr+"",En.fontSize*=1.25):(Qn==="e"||Qn==="E")&&vr>2?En.text="1"+Qn+($n>0?"+":j)+vr:(En.text=At(Math.pow(10,wn),mn,"","fakehover"),Fn==="D1"&&mn._id.charAt(0)==="y"&&(En.dy-=En.fontSize/6))}else{if(Jn!=="D")throw"unrecognized dtick "+String(Fn);En.text=String(Math.round(Math.pow(10,y.mod(wn,1)))),En.fontSize*=.75}if(mn.dtick==="D1"){var lr=String(En.text).charAt(0);lr!=="0"&&lr!=="1"||(mn._id.charAt(0)==="y"?En.dx-=En.fontSize/4:(En.dy+=En.fontSize/2,En.dx+=(mn.range[1]>mn.range[0]?1:-1)*En.fontSize*(wn<0?.5:.25)))}}(rt,St,0,qt,Dn):en==="category"?function(mn,En){var Kn=mn._categories[Math.round(En.x)];Kn===void 0&&(Kn=""),En.text=String(Kn)}(rt,St):en==="multicategory"?function(mn,En,Kn){var Ln=Math.round(En.x),Tn=mn._categories[Ln]||[],Fn=Tn[1]===void 0?"":String(Tn[1]),wn=Tn[0]===void 0?"":String(Tn[0]);Kn?En.text=wn+" - "+Fn:(En.text=Fn,En.text2=wn)}(rt,St,Et):ut(rt)?function(mn,En,Kn,Ln,Tn){if(mn.thetaunit!=="radians"||Kn)En.text=At(En.x,mn,Tn,Ln);else{var Fn=En.x/180;if(Fn===0)En.text="0";else{var wn=function(Jn){function $n(hr,jr){return Math.abs(hr-jr)<=1e-6}var vr=function(hr){for(var jr=1;!$n(Math.round(hr*jr)/jr,hr);)jr*=10;return jr}(Jn),Qn=Jn*vr,lr=Math.abs(function hr(jr,ni){return $n(ni,0)?jr:hr(ni,jr%ni)}(Qn,vr));return[Math.round(Qn/lr),Math.round(vr/lr)]}(Fn);if(wn[1]>=100)En.text=At(y.deg2rad(En.x),mn,Tn,Ln);else{var zn=En.x<0;wn[1]===1?wn[0]===1?En.text="π":En.text=wn[0]+"π":En.text=["",wn[0],"","⁄","",wn[1],"","π"].join(""),zn&&(En.text=j+En.text)}}}}(rt,St,Et,qt,Dn):function(mn,En,Kn,Ln,Tn){Tn==="never"?Tn="":mn.showexponent==="all"&&Math.abs(En.x/mn.dtick)<1e-6&&(Tn="hide"),En.text=At(En.x,mn,Tn,Ln)}(rt,St,0,qt,Dn),Bt||(rt.tickprefix&&!Pn(rt.showtickprefix)&&(St.text=rt.tickprefix+St.text),rt.ticksuffix&&!Pn(rt.showticksuffix)&&(St.text+=rt.ticksuffix)),rt.labelalias&&rt.labelalias.hasOwnProperty(St.text)){var In=rt.labelalias[St.text];typeof In=="string"&&(St.text=In)}return(rt.tickson==="boundaries"||rt.showdividers)&&(St.xbnd=[Zt(St.x-.5),Zt(St.x+rt.dtick-.5)]),St},oe.hoverLabelText=function(rt,et,Et){Et&&(rt=y.extendFlat({},rt,{hoverformat:Et}));var Bt=y.isArrayOrTypedArray(et)?et[0]:et,Ft=y.isArrayOrTypedArray(et)?et[1]:void 0;if(Ft!==void 0&&Ft!==Bt)return oe.hoverLabelText(rt,Bt,Et)+" - "+oe.hoverLabelText(rt,Ft,Et);var St=rt.type==="log"&&Bt<=0,Jt=oe.tickText(rt,rt.c2l(St?-Bt:Bt),"hover").text;return St?Bt===0?"0":j+Jt:Jt};var tt=["f","p","n","μ","m","","k","M","G","T"];function nt(rt){return rt==="SI"||rt==="B"}function ft(rt){return rt>14||rt<-15}function At(rt,et,Et,Bt){var Ft=rt<0,St=et._tickround,Jt=Et||et.exponentformat||"B",qt=et._tickexponent,en=oe.getTickFormat(et),Wt=et.separatethousands;if(Bt){var Zt={exponentformat:Jt,minexponent:et.minexponent,dtick:et.showexponent==="none"?et.dtick:d(rt)&&Math.abs(rt)||1,range:et.showexponent==="none"?et.range.map(et.r2d):[0,rt||1]};Be(Zt),St=(Number(Zt._tickround)||0)+4,qt=Zt._tickexponent,et.hoverformat&&(en=et.hoverformat)}if(en)return et._numFormat(en)(rt).replace(/-/g,j);var on,un=Math.pow(10,-St)/2;if(Jt==="none"&&(qt=0),(rt=Math.abs(rt))"+on+"":Jt==="B"&&qt===9?rt+="B":nt(Jt)&&(rt+=tt[qt/3+5])),Ft?j+rt:rt}function kt(rt,et){if(rt){var Et=Object.keys(K).reduce(function(Bt,Ft){return et.indexOf(Ft)!==-1&&K[Ft].forEach(function(St){Bt[St]=1}),Bt},{});Object.keys(rt).forEach(function(Bt){Et[Bt]||(Bt.length===1?rt[Bt]=0:delete rt[Bt])})}}function Vt(rt,et){for(var Et=[],Bt={},Ft=0;Ft1&&Et=Ft.min&&rt=0,En=Zt(un,Pn[1])<=0;return(Dn||mn)&&(In||En)}if(rt.tickformatstops&&rt.tickformatstops.length>0)switch(rt.type){case"date":case"linear":for(et=0;et=Jt(Ft)))){Et=Bt;break}break;case"log":for(et=0;et=0&&Ft.unshift(Ft.splice(Wt,1).shift())}});var Jt={false:{left:0,right:0}};return y.syncOrAsync(Ft.map(function(qt){return function(){if(qt){var en=oe.getFromId(rt,qt);Et||(Et={}),Et.axShifts=Jt,Et.overlayingShiftedAx=St;var Wt=oe.drawOne(rt,en,Et);return en._shiftPusher&&jt(en,en._fullDepth||0,Jt,!0),en._r=en.range.slice(),en._rl=y.simpleMap(en._r,en.r2l),Wt}}}))},oe.drawOne=function(rt,et,Et){var Bt,Ft,St,Jt=(Et=Et||{}).axShifts||{},qt=Et.overlayingShiftedAx||[];et.setScale();var en=rt._fullLayout,Wt=et._id,Zt=Wt.charAt(0),on=oe.counterLetter(Wt),un=en._plots[et._mainSubplot];if(un){if(et._shiftPusher=et.autoshift||qt.indexOf(et._id)!==-1||qt.indexOf(et.overlaying)!==-1,et._shiftPusher&et.anchor==="free"){var Pn=et.linewidth/2||0;et.ticks==="inside"&&(Pn+=et.ticklen),jt(et,Pn,Jt,!0),jt(et,et.shift||0,Jt,!1)}Et.skipTitle===!0&&et._shift!==void 0||(et._shift=function(dn,ln){return dn.autoshift?ln[dn.overlaying][dn.side]:dn.shift||0}(et,Jt));var Dn=un[Zt+"axislayer"],In=et._mainLinePosition,mn=In+=et._shift,En=et._mainMirrorPosition,Kn=et._vals=oe.calcTicks(et),Ln=[et.mirror,mn,En].join("_");for(Bt=0;Bt0?dn.bottom-yr:0,Ur))));var Rr=0,$r=0;if(et._shiftPusher&&(Rr=Math.max(Ur,dn.height>0?br==="l"?yr-dn.left:dn.right-yr:0),et.title.text!==en._dfltTitle[Zt]&&($r=(et._titleStandoff||0)+(et._titleScoot||0),br==="l"&&($r+=st(et))),et._fullDepth=Math.max(Rr,$r)),et.automargin){ln={x:0,y:0,r:0,l:0,t:0,b:0};var Pr=[0,1],Cr=typeof et._shift=="number"?et._shift:0;if(Zt==="x"){if(br==="b"?ln[br]=et._depth:(ln[br]=et._depth=Math.max(dn.width>0?yr-dn.top:0,Ur),Pr.reverse()),dn.width>0){var Jr=dn.right-(et._offset+et._length);Jr>0&&(ln.xr=1,ln.r=Jr);var gi=et._offset-dn.left;gi>0&&(ln.xl=0,ln.l=gi)}}else if(br==="l"?(et._depth=Math.max(dn.height>0?yr-dn.left:0,Ur),ln[br]=et._depth-Cr):(et._depth=Math.max(dn.height>0?dn.right-yr:0,Ur),ln[br]=et._depth+Cr,Pr.reverse()),dn.height>0){var ii=dn.bottom-(et._offset+et._length);ii>0&&(ln.yb=0,ln.b=ii);var Yr=et._offset-dn.top;Yr>0&&(ln.yt=1,ln.t=Yr)}ln[on]=et.anchor==="free"?et.position:et._anchorAxis.domain[Pr[0]],et.title.text!==en._dfltTitle[Zt]&&(ln[br]+=st(et)+(et.title.standoff||0)),et.mirror&&et.anchor!=="free"&&((An={x:0,y:0,r:0,l:0,t:0,b:0})[Tr]=et.linewidth,et.mirror&&et.mirror!==!0&&(An[Tr]+=Ur),et.mirror===!0||et.mirror==="ticks"?An[on]=et._anchorAxis.domain[Pr[1]]:et.mirror!=="all"&&et.mirror!=="allticks"||(An[on]=[et._counterDomainMin,et._counterDomainMax][Pr[1]]))}Wn&&(er=w.getComponentMethod("rangeslider","autoMarginOpts")(rt,et)),typeof et.automargin=="string"&&(kt(ln,et.automargin),kt(An,et.automargin)),e.autoMargin(rt,yt(et),ln),e.autoMargin(rt,Ot(et),An),e.autoMargin(rt,Pt(et),er)}),y.syncOrAsync(Un)}}function Bn(dn){var ln=Wt+(dn||"tick");return Tn[ln]||(Tn[ln]=function(An,er,br){var Tr,yr,Ur,Rr;if(An._selections[er].size())Tr=1/0,yr=-1/0,Ur=1/0,Rr=-1/0,An._selections[er].each(function(){var Pr=pt(this),Cr=l.bBox(Pr.node().parentNode);Tr=Math.min(Tr,Cr.top),yr=Math.max(yr,Cr.bottom),Ur=Math.min(Ur,Cr.left),Rr=Math.max(Rr,Cr.right)});else{var $r=oe.makeLabelFns(An,br);Tr=yr=$r.yFn({dx:0,dy:0,fontSize:0}),Ur=Rr=$r.xFn({dx:0,dy:0,fontSize:0})}return{top:Tr,bottom:yr,left:Ur,right:Rr,height:yr-Tr,width:Rr-Ur}}(et,ln,mn)),Tn[ln]}},oe.getTickSigns=function(rt,et){var Et=rt._id.charAt(0),Bt={x:"top",y:"right"}[Et],Ft=rt.side===Bt?1:-1,St=[-1,1,Ft,-Ft];return(et?(rt.minor||{}).ticks:rt.ticks)!=="inside"==(Et==="x")&&(St=St.map(function(Jt){return-Jt})),rt.side&&St.push({l:-1,t:-1,r:1,b:1}[rt.side.charAt(0)]),St},oe.makeTransTickFn=function(rt){return rt._id.charAt(0)==="x"?function(et){return _(rt._offset+rt.l2p(et.x),0)}:function(et){return _(0,rt._offset+rt.l2p(et.x))}},oe.makeTransTickLabelFn=function(rt){var et=function(Zt){var on=Zt.ticklabelposition||"",un=function(zn){return on.indexOf(zn)!==-1},Pn=un("top"),Dn=un("left"),In=un("right"),mn=un("bottom"),En=un("inside"),Kn=mn||Dn||Pn||In;if(!Kn&&!En)return[0,0];var Ln=Zt.side,Tn=Kn?(Zt.tickwidth||0)/2:0,Fn=3,wn=Zt.tickfont?Zt.tickfont.size:12;return(mn||Pn)&&(Tn+=wn*he,Fn+=(Zt.linewidth||0)/2),(Dn||In)&&(Tn+=(Zt.linewidth||0)/2,Fn+=3),En&&Ln==="top"&&(Fn-=wn*(1-he)),(Dn||Pn)&&(Tn=-Tn),Ln!=="bottom"&&Ln!=="right"||(Fn=-Fn),[Kn?Tn:0,En?Fn:0]}(rt),Et=rt.ticklabelshift||0,Bt=rt.ticklabelstandoff||0,Ft=et[0],St=et[1],Jt=rt.range[0]>rt.range[1],qt=rt.ticklabelposition&&rt.ticklabelposition.indexOf("inside")!==-1,en=!qt;if(Et&&(Et*=Jt?-1:1),Bt){var Wt=rt.side;Bt*=qt&&(Wt==="top"||Wt==="left")||en&&(Wt==="bottom"||Wt==="right")?1:-1}return rt._id.charAt(0)==="x"?function(Zt){return _(Ft+rt._offset+rt.l2p(Ht(Zt))+Et,St+Bt)}:function(Zt){return _(St+Bt,Ft+rt._offset+rt.l2p(Ht(Zt))+Et)}},oe.makeTickPath=function(rt,et,Et,Bt){Bt||(Bt={});var Ft=Bt.minor;if(Ft&&!rt.minor)return"";var St=Bt.len!==void 0?Bt.len:Ft?rt.minor.ticklen:rt.ticklen,Jt=rt._id.charAt(0),qt=(rt.linewidth||1)/2;return Jt==="x"?"M0,"+(et+qt*Et)+"v"+St*Et:"M"+(et+qt*Et)+",0h"+St*Et},oe.makeLabelFns=function(rt,et,Et){var Bt=rt.ticklabelposition||"",Ft=function(Qn){return Bt.indexOf(Qn)!==-1},St=Ft("top"),Jt=Ft("left"),qt=Ft("right"),en=Ft("bottom")||Jt||St||qt,Wt=Ft("inside"),Zt=Bt==="inside"&&rt.ticks==="inside"||!Wt&&rt.ticks==="outside"&&rt.tickson!=="boundaries",on=0,un=0,Pn=Zt?rt.ticklen:0;if(Wt?Pn*=-1:en&&(Pn=0),Zt&&(on+=Pn,Et)){var Dn=y.deg2rad(Et);on=Pn*Math.cos(Dn)+1,un=Pn*Math.sin(Dn)}rt.showticklabels&&(Zt||rt.showline)&&(on+=.2*rt.tickfont.size);var In,mn,En,Kn,Ln,Tn={labelStandoff:on+=(rt.linewidth||1)/2*(Wt?-1:1),labelShift:un},Fn=0,wn=rt.side,zn=rt._id.charAt(0),Jn=rt.tickangle;if(zn==="x")Kn=(Ln=!Wt&&wn==="bottom"||Wt&&wn==="top")?1:-1,Wt&&(Kn*=-1),In=un*Kn,mn=et+on*Kn,En=Ln?1:-.2,Math.abs(Jn)===90&&(Wt?En+=se:En=Jn===-90&&wn==="bottom"?he:Jn===90&&wn==="top"?se:.5,Fn=se/2*(Jn/90)),Tn.xFn=function(Qn){return Qn.dx+In+Fn*Qn.fontSize},Tn.yFn=function(Qn){return Qn.dy+mn+Qn.fontSize*En},Tn.anchorFn=function(Qn,lr){if(en){if(Jt)return"end";if(qt)return"start"}return d(lr)&&lr!==0&&lr!==180?lr*Kn<0!==Wt?"end":"start":"middle"},Tn.heightFn=function(Qn,lr,hr){return lr<-60||lr>60?-.5*hr:rt.side==="top"!==Wt?-hr:0};else if(zn==="y"){if(Kn=(Ln=!Wt&&wn==="left"||Wt&&wn==="right")?1:-1,Wt&&(Kn*=-1),In=on,mn=un*Kn,En=0,Wt||Math.abs(Jn)!==90||(En=Jn===-90&&wn==="left"||Jn===90&&wn==="right"?he:.5),Wt){var $n=d(Jn)?+Jn:0;if($n!==0){var vr=y.deg2rad($n);Fn=Math.abs(Math.sin(vr))*he*Kn,En=0}}Tn.xFn=function(Qn){return Qn.dx+et-(In+Qn.fontSize*En)*Kn+Fn*Qn.fontSize},Tn.yFn=function(Qn){return Qn.dy+mn+Qn.fontSize*se},Tn.anchorFn=function(Qn,lr){return d(lr)&&Math.abs(lr)===90?"middle":Ln?"end":"start"},Tn.heightFn=function(Qn,lr,hr){return rt.side==="right"&&(lr*=-1),lr<-30?-hr:lr<30?-.5*hr:0}}return Tn},oe.drawTicks=function(rt,et,Et){Et=Et||{};var Bt=et._id+"tick",Ft=[].concat(et.minor&&et.minor.ticks?Et.vals.filter(function(Jt){return Jt.minor&&!Jt.noTick}):[]).concat(et.ticks?Et.vals.filter(function(Jt){return!Jt.minor&&!Jt.noTick}):[]),St=Et.layer.selectAll("path."+Bt).data(Ft,Gt);St.exit().remove(),St.enter().append("path").classed(Bt,1).classed("ticks",1).classed("crisp",Et.crisp!==!1).each(function(Jt){return n.stroke(b.select(this),Jt.minor?et.minor.tickcolor:et.tickcolor)}).style("stroke-width",function(Jt){return l.crispRound(rt,Jt.minor?et.minor.tickwidth:et.tickwidth,1)+"px"}).attr("d",Et.path).style("display",null),Lt(et,[Q]),St.attr("transform",Et.transFn)},oe.drawGrid=function(rt,et,Et){if(Et=Et||{},et.tickmode!=="sync"){var Bt=et._id+"grid",Ft=et.minor&&et.minor.showgrid,St=Ft?Et.vals.filter(function(En){return En.minor}):[],Jt=et.showgrid?Et.vals.filter(function(En){return!En.minor}):[],qt=Et.counterAxis;if(qt&&oe.shouldShowZeroLine(rt,et,qt))for(var en=et.tickmode==="array",Wt=0;Wt=0;Dn--){var In=Dn?un:Pn;if(In){var mn=In.selectAll("path."+Bt).data(Dn?Jt:St,Gt);mn.exit().remove(),mn.enter().append("path").classed(Bt,1).classed("crisp",Et.crisp!==!1),mn.attr("transform",Et.transFn).attr("d",Et.path).each(function(En){return n.stroke(b.select(this),En.minor?et.minor.gridcolor:et.gridcolor||"#ddd")}).style("stroke-dasharray",function(En){return l.dashStyle(En.minor?et.minor.griddash:et.griddash,En.minor?et.minor.gridwidth:et.gridwidth)}).style("stroke-width",function(En){return(En.minor?on:et._gw)+"px"}).style("display",null),typeof Et.path=="function"&&mn.attr("d",Et.path)}}Lt(et,[H,J])}},oe.drawZeroLine=function(rt,et,Et){Et=Et||Et;var Bt=et._id+"zl",Ft=oe.shouldShowZeroLine(rt,et,Et.counterAxis),St=Et.layer.selectAll("path."+Bt).data(Ft?[{x:0,id:et._id}]:[]);St.exit().remove(),St.enter().append("path").classed(Bt,1).classed("zl",1).classed("crisp",Et.crisp!==!1).each(function(){Et.layer.selectAll("path").sort(function(Jt,qt){return ye(Jt.id,qt.id)})}),St.attr("transform",Et.transFn).attr("d",Et.path).call(n.stroke,et.zerolinecolor||n.defaultLine).style("stroke-width",l.crispRound(rt,et.zerolinewidth,et._gw||1)+"px").style("display",null),Lt(et,[ee])},oe.drawLabels=function(rt,et,Et){Et=Et||{};var Bt=rt._fullLayout,Ft=et._id,St=Et.cls||Ft+"tick",Jt=Et.vals.filter(function(Or){return Or.text}),qt=Et.labelFns,en=Et.secondary?0:et.tickangle,Wt=(et._prevTickAngles||{})[St],Zt=Et.layer.selectAll("g."+St).data(et.showticklabels?Jt:[],Gt),on=[];function un(Or,Ar){Or.each(function(xr){var Qr=b.select(this),kn=Qr.select(".text-math-group"),Cn=qt.anchorFn(xr,Ar),ur=Et.transFn.call(Qr.node(),xr)+(d(Ar)&&+Ar!=0?" rotate("+Ar+","+qt.xFn(xr)+","+(qt.yFn(xr)-xr.fontSize/2)+")":""),Zn=u.lineCount(Qr),cr=fe*xr.fontSize,Ir=qt.heightFn(xr,d(Ar)?+Ar:0,(Zn-1)*cr);if(Ir&&(ur+=_(0,Ir)),kn.empty()){var Er=Qr.select("text");Er.attr({transform:ur,"text-anchor":Cn}),Er.style("opacity",1),et._adjustTickLabelsOverflow&&et._adjustTickLabelsOverflow()}else{var Xr=l.bBox(kn.node()).width*{end:-.5,start:.5}[Cn];kn.attr("transform",ur+_(Xr,0))}})}Zt.enter().append("g").classed(St,1).append("text").attr("text-anchor","middle").each(function(Or){var Ar=b.select(this),xr=rt._promises.length;Ar.call(u.positionText,qt.xFn(Or),qt.yFn(Or)).call(l.font,{family:Or.font,size:Or.fontSize,color:Or.fontColor,weight:Or.fontWeight,style:Or.fontStyle,variant:Or.fontVariant,textcase:Or.fontTextcase,lineposition:Or.fontLineposition,shadow:Or.fontShadow}).text(Or.text).call(u.convertToTspans,rt),rt._promises[xr]?on.push(rt._promises.pop().then(function(){un(Ar,en)})):un(Ar,en)}),Lt(et,[Z]),Zt.exit().remove(),Et.repositionOnUpdate&&Zt.each(function(Or){b.select(this).select("text").call(u.positionText,qt.xFn(Or),qt.yFn(Or))}),et._adjustTickLabelsOverflow=function(){var Or=et.ticklabeloverflow;if(Or&&Or!=="allow"){var Ar=Or.indexOf("hide")!==-1,xr=et._id.charAt(0)==="x",Qr=0,kn=xr?rt._fullLayout.width:rt._fullLayout.height;if(Or.indexOf("domain")!==-1){var Cn=y.simpleMap(et.range,et.r2l);Qr=et.l2p(Cn[0])+et._offset,kn=et.l2p(Cn[1])+et._offset}var ur=Math.min(Qr,kn),Zn=Math.max(Qr,kn),cr=et.side,Ir=1/0,Er=-1/0;for(var Xr in Zt.each(function(Yn){var an=b.select(this);if(an.select(".text-math-group").empty()){var _n=l.bBox(an.node()),gn=0;xr?(_n.right>Zn||_n.leftZn||_n.top+(et.tickangle?0:Yn.fontSize/4)et["_visibleLabelMin_"+Cn._id]?bn.style("display","none"):Zn.K!=="tick"||ur||bn.style("display",null)})})})})},un(Zt,Wt+1?Wt:en);var Pn=null;et._selections&&(et._selections[St]=Zt);var Dn=[function(){return on.length&&Promise.all(on)}];et.automargin&&Bt._redrawFromAutoMarginCount&&Wt===90?(Pn=Wt,Dn.push(function(){un(Zt,Wt)})):Dn.push(function(){if(un(Zt,en),Jt.length&&et.autotickangles&&(et.type!=="log"||String(et.dtick).charAt(0)!=="D")){Pn=et.autotickangles[0];var Or,Ar=0,xr=[],Qr=1;Zt.each(function(Bn){Ar=Math.max(Ar,Bn.fontSize);var dn=et.l2p(Bn.x),ln=pt(this),An=l.bBox(ln.node());Qr=Math.max(Qr,u.lineCount(ln)),xr.push({top:0,bottom:10,height:10,left:dn-An.width/2,right:dn+An.width/2+2,width:An.width+2})});var kn=(et.tickson==="boundaries"||et.showdividers)&&!Et.secondary,Cn=Jt.length,ur=Math.abs((Jt[Cn-1].x-Jt[0].x)*et._m)/(Cn-1),Zn=kn?ur/2:ur,cr=kn?et.ticklen:1.25*Ar*Qr,Ir=Zn/Math.sqrt(Math.pow(Zn,2)+Math.pow(cr,2)),Er=et.autotickangles.map(function(Bn){return Bn*Math.PI/180}),Xr=Er.find(function(Bn){return Math.abs(Math.cos(Bn))<=Ir});Xr===void 0&&(Xr=Er.reduce(function(Bn,dn){return Math.abs(Math.cos(Bn))hr*lr&&($n=lr,wn[Fn]=zn[Fn]=vr[Fn])}var jr=Math.abs($n-Jn);jr-Kn>0?Kn*=1+Kn/(jr-=Kn):Kn=0,et._id.charAt(0)!=="y"&&(Kn=-Kn),wn[Tn]=mn.p2r(mn.r2p(zn[Tn])+Ln*Kn),mn.autorange==="min"||mn.autorange==="max reversed"?(wn[0]=null,mn._rangeInitial0=void 0,mn._rangeInitial1=void 0):mn.autorange!=="max"&&mn.autorange!=="min reversed"||(wn[1]=null,mn._rangeInitial0=void 0,mn._rangeInitial1=void 0),Bt._insideTickLabelsUpdaterange[mn._name+".range"]=wn}var ni=y.syncOrAsync(Dn);return ni&&ni.then&&rt._promises.push(ni),ni},oe.getPxPosition=function(rt,et){var Et,Bt=rt._fullLayout._size,Ft=et._id.charAt(0),St=et.side;return et.anchor!=="free"?Et=et._anchorAxis:Ft==="x"?Et={_offset:Bt.t+(1-(et.position||0))*Bt.h,_length:0}:Ft==="y"&&(Et={_offset:Bt.l+(et.position||0)*Bt.w+et._shift,_length:0}),St==="top"||St==="left"?Et._offset:St==="bottom"||St==="right"?Et._offset+Et._length:void 0},oe.shouldShowZeroLine=function(rt,et,Et){var Bt=y.simpleMap(et.range,et.r2l);return Bt[0]*Bt[1]<=0&&et.zeroline&&(et.type==="linear"||et.type==="-")&&!(et.rangebreaks&&et.maskBreaks(0)===$)&&(Qe(et,0)||!function(Ft,St,Jt,qt){var en=Jt._mainAxis;if(en){var Wt=Ft._fullLayout,Zt=St._id.charAt(0),on=oe.counterLetter(St._id),un=St._offset+(Math.abs(qt[0])1)for(qt=1;qt2*M}(c,o))return"date";var k=s.autotypenumbers!=="strict";return function(A,v){for(var S=A.length,T=n(S),p=0,M=0,f={},E=0;E2*p}(c,k)?"category":function(A,v){for(var S=A.length,T=0;T=2){var f,E,I="";if(M.length===2){for(f=0;f<2;f++)if(E=A(M[f])){I=x;break}}var B=p("pattern",I);if(B===x)for(f=0;f<2;f++)(E=A(M[f]))&&(S.bounds[f]=M[f]=E-1);if(B)for(f=0;f<2;f++)switch(E=M[f],B){case x:if(!b(E)||(E=+E)!==Math.floor(E)||E<0||E>=7)return void(S.enabled=!1);S.bounds[f]=M[f]=E;break;case m:if(!b(E)||(E=+E)<0||E>24)return void(S.enabled=!1);S.bounds[f]=M[f]=E}if(T.autorange===!1){var N=T.range;if(N[0]N[1])return void(S.enabled=!1)}else if(M[0]>N[0]&&M[1]u?1:-1:+(w.substr(1)||1)-+(y.substr(1)||1)},L.ref2id=function(w){return!!/^[xyz]/.test(w)&&w.split(" ")[0]},L.isLinked=function(w,y){return e(y,w._axisMatchGroups)||e(y,w._axisConstraintGroups)}},46473:function(D,L,t){var b=t(87800).isTypedArraySpec;D.exports=function(d,e,w,y){if(e.type==="category"){var _,u=d.categoryarray,r=Array.isArray(u)&&u.length>0||b(u);r&&(_="array");var n,l=w("categoryorder",_);l==="array"&&(n=w("categoryarray")),r||l!=="array"||(l=e.categoryorder="trace"),l==="trace"?e._initialCategories=[]:l==="array"?e._initialCategories=n.slice():(n=function(o,s){var c,h,x,m=s.dataAttr||o._id.charAt(0),g={};if(s.axData)c=s.axData;else for(c=[],h=0;hA?v.substr(A):S.substr(k))+T:v+S+m*g:T}function h(m,g){for(var k=g._size,A=k.h/k.w,v={},S=Object.keys(m),T=0;Tu*N)||ee){for(k=0;kie&&yehe&&(he=ye);M/=(he-se)/(2*fe),se=S.l2r(se),he=S.l2r(he),S.range=S._input.range=Z=0?Math.min(ye,.9):1/(1/Math.max(ye,-.3)+3.222))}function Z(ye,me,be,Se,Ee){return ye.append("path").attr("class","zoombox").style({fill:me>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",u(be,Se)).attr("d",Ee+"Z")}function K(ye,me,be){return ye.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",u(me,be)).attr("d","M0,0Z")}function ae(ye,me,be,Se,Ee,Ce){ye.attr("d",Se+"M"+be.l+","+be.t+"v"+be.h+"h"+be.w+"v-"+be.h+"h-"+be.w+"Z"),se(ye,me,Ee,Ce)}function se(ye,me,be,Se){be||(ye.transition().style("fill",Se>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),me.transition().style("opacity",1).duration(200))}function he(ye){b.select(ye).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function fe(ye){V&&ye.data&&ye._context.showTips&&(d.notifier(d._(ye,"Double-click to zoom back out"),"long"),V=!1)}function ie(ye){var me=Math.floor(Math.min(ye.b-ye.t,ye.r-ye.l,N)/2);return"M"+(ye.l-3.5)+","+(ye.t-.5+me)+"h3v"+-me+"h"+me+"v-3h-"+(me+3)+"ZM"+(ye.r+3.5)+","+(ye.t-.5+me)+"h-3v"+-me+"h"+-me+"v-3h"+(me+3)+"ZM"+(ye.r+3.5)+","+(ye.b+.5-me)+"h-3v"+me+"h"+-me+"v3h"+(me+3)+"ZM"+(ye.l-3.5)+","+(ye.b+.5-me)+"h3v"+me+"h"+me+"v3h-"+(me+3)+"Z"}function oe(ye,me,be,Se,Ee){for(var Ce,Le,Oe,We,Ie=!1,Ve={},Pe={},de=(Ee||{}).xaHash,Me=(Ee||{}).yaHash,ke=0;ke=0)wn._fullLayout._deactivateShape(wn);else{var zn=wn._fullLayout.clickmode;if(he(wn),Tn!==2||Qe||Dn(),st)zn.indexOf("select")>-1&&f(Fn,wn,de,Me,me.id,et),zn.indexOf("event")>-1&&o.click(wn,Fn,me.id);else if(Tn===1&&Qe){var Jn=Le?Ie:We,$n=Le==="s"||Oe==="w"?0:1,vr=Jn._name+".range["+$n+"]",Qn=function(jr,ni){var Or,Ar=jr.range[ni],xr=Math.abs(Ar-jr.range[1-ni]);return jr.type==="date"?Ar:jr.type==="log"?(Or=Math.ceil(Math.max(0,-Math.log(xr)/Math.LN10))+3,e("."+Or+"g")(Math.pow(10,Ar))):(Or=Math.floor(Math.log(Math.abs(Ar))/Math.LN10)-Math.floor(Math.log(xr)/Math.LN10)+4,e("."+String(Or)+"g")(Ar))}(Jn,$n),lr="left",hr="middle";if(Jn.fixedrange)return;Le?(hr=Le==="n"?"top":"bottom",Jn.side==="right"&&(lr="right")):Oe==="e"&&(lr="right"),wn._context.showAxisRangeEntryBoxes&&b.select(Ot).call(r.makeEditable,{gd:wn,immediate:!0,background:wn._fullLayout.paper_bgcolor,text:String(Qn),fill:Jn.tickfont?Jn.tickfont.color:"#444",horizontalAlign:lr,verticalAlign:hr}).on("edit",function(jr){var ni=Jn.d2r(jr);ni!==void 0&&_.call("_guiRelayout",wn,vr,ni)})}}}function Ft(Tn,Fn){if(ye._transitioningWithDuration)return!1;var wn=Math.max(0,Math.min(Fe,Vt*Tn+Pt)),zn=Math.max(0,Math.min(qe,Ht*Fn+at)),Jn=Math.abs(wn-Pt),$n=Math.abs(zn-at);function vr(){vt="",lt.r=lt.l,lt.t=lt.b,jt.attr("d","M0,0Z")}if(lt.l=Math.min(Pt,wn),lt.r=Math.max(Pt,wn),lt.t=Math.min(at,zn),lt.b=Math.max(at,zn),$e.isSubplotConstrained)Jn>N||$n>N?(vt="xy",Jn/Fe>$n/qe?($n=Jn*qe/Fe,at>zn?lt.t=at-$n:lt.b=at+$n):(Jn=$n*Fe/qe,Pt>wn?lt.l=Pt-Jn:lt.r=Pt+Jn),jt.attr("d",ie(lt))):vr();else if(Ye.isSubplotConstrained)if(Jn>N||$n>N){vt="xy";var Qn=Math.min(lt.l/Fe,(qe-lt.b)/qe),lr=Math.max(lt.r/Fe,(qe-lt.t)/qe);lt.l=Qn*Fe,lt.r=lr*Fe,lt.b=(1-Qn)*qe,lt.t=(1-lr)*qe,jt.attr("d",ie(lt))}else vr();else!De||$n0){var hr;if(Ye.isSubplotConstrained||!_e&&De.length===1){for(hr=0;hr1&&(zn.maxallowed!==void 0&&Ge===(zn.range[0]1&&(Jn.maxallowed!==void 0&&tt===(Jn.range[0]1)if(f)k.xlines=l(v,"path","xlines-above"),k.ylines=l(v,"path","ylines-above"),k.xaxislayer=l(v,"g","xaxislayer-above"),k.yaxislayer=l(v,"g","yaxislayer-above");else{if(!T){var E=l(v,"g","layer-subplot");k.shapelayer=l(E,"g","shapelayer"),k.imagelayer=l(E,"g","imagelayer"),k.minorGridlayer=l(v,"g","minor-gridlayer"),k.gridlayer=l(v,"g","gridlayer"),k.zerolinelayer=l(v,"g","zerolinelayer");var I=l(v,"g","layer-between");k.shapelayerBetween=l(I,"g","shapelayer"),k.imagelayerBetween=l(I,"g","imagelayer"),l(v,"path","xlines-below"),l(v,"path","ylines-below"),k.overlinesBelow=l(v,"g","overlines-below"),l(v,"g","xaxislayer-below"),l(v,"g","yaxislayer-below"),k.overaxesBelow=l(v,"g","overaxes-below")}k.overplot=l(v,"g","overplot"),k.plot=l(k.overplot,"g",S),T||(k.xlines=l(v,"path","xlines-above"),k.ylines=l(v,"path","ylines-above"),k.overlinesAbove=l(v,"g","overlines-above"),l(v,"g","xaxislayer-above"),l(v,"g","yaxislayer-above"),k.overaxesAbove=l(v,"g","overaxes-above"),k.xlines=v.select(".xlines-"+p),k.ylines=v.select(".ylines-"+M),k.xaxislayer=v.select(".xaxislayer-"+p),k.yaxislayer=v.select(".yaxislayer-"+M))}else{var B=k.mainplotinfo,N=B.plotgroup,V=S+"-x",j=S+"-y";k.minorGridlayer=B.minorGridlayer,k.gridlayer=B.gridlayer,k.zerolinelayer=B.zerolinelayer,l(B.overlinesBelow,"path",V),l(B.overlinesBelow,"path",j),l(B.overaxesBelow,"g",V),l(B.overaxesBelow,"g",j),k.plot=l(B.overplot,"g",S),l(B.overlinesAbove,"path",V),l(B.overlinesAbove,"path",j),l(B.overaxesAbove,"g",V),l(B.overaxesAbove,"g",j),k.xlines=N.select(".overlines-"+p).select("."+V),k.ylines=N.select(".overlines-"+M).select("."+j),k.xaxislayer=N.select(".overaxes-"+p).select("."+V),k.yaxislayer=N.select(".overaxes-"+M).select("."+j)}T||(f||(o(k.minorGridlayer,"g",k.xaxis._id),o(k.minorGridlayer,"g",k.yaxis._id),k.minorGridlayer.selectAll("g").map(function($){return $[0]}).sort(u.idSort),o(k.gridlayer,"g",k.xaxis._id),o(k.gridlayer,"g",k.yaxis._id),k.gridlayer.selectAll("g").map(function($){return $[0]}).sort(u.idSort)),k.xlines.style("fill","none").classed("crisp",!0),k.ylines.style("fill","none").classed("crisp",!0))}function x(g,k){if(g){var A={};for(var v in g.each(function(M){var f=M[0];b.select(this).remove(),m(f,k),A[f]=!0}),k._plots)for(var S=k._plots[v].overlays||[],T=0;T0){var V=N.id;if(V.indexOf(s)!==-1)continue;V+=s+(E+1),N=e.extendFlat({},N,{id:V,plot:T._cartesianlayer.selectAll(".subplot").select("."+V)})}for(var j,$=[],ee=0;ee1&&(Ce+=s+Ee),Se.push(H+Ce),ee=0;eeS[1]-.000244140625&&(w.domain=r),d.noneOrAll(e.domain,w.domain,r),w.tickmode==="sync"&&(w.tickmode="auto")}return y("layer"),w}},54616:function(D,L,t){var b=t(87703);D.exports=function(d,e,w,y,_){_||(_={});var u=_.tickSuffixDflt,r=b(d);w("tickprefix")&&w("showtickprefix",r),w("ticksuffix",u)&&w("showticksuffix",r)}},90259:function(D,L,t){var b=t(75511);D.exports=function(d,e,w,y){var _=e._template||{},u=e.type||_.type||"-";w("minallowed"),w("maxallowed");var r,n=w("range");n||y.noInsiderange||u==="log"||(!(r=w("insiderange"))||r[0]!==null&&r[1]!==null||(e.insiderange=!1,r=void 0),r&&(n=w("range",r)));var l,o=e.getAutorangeDflt(n,y),s=w("autorange",o);!n||(n[0]!==null||n[1]!==null)&&(n[0]!==null&&n[1]!==null||s!=="reversed"&&s!==!0)&&(n[0]===null||s!=="min"&&s!=="max reversed")&&(n[1]===null||s!=="max"&&s!=="min reversed")||(n=void 0,delete e.range,e.autorange=!0,l=!0),l||(s=w("autorange",o=e.getAutorangeDflt(n,y))),s&&(b(w,s,n),u!=="linear"&&u!=="-"||w("rangemode")),e.cleanRange()}},67611:function(D,L,t){var b=t(4530).FROM_BL;D.exports=function(d,e,w){w===void 0&&(w=b[d.constraintoward||"center"]);var y=[d.r2l(d.range[0]),d.r2l(d.range[1])],_=y[0]+(y[1]-y[0])*w;d.range=d._input.range=[d.l2r(_+(y[0]-_)*e),d.l2r(_+(y[1]-_)*e)],d.setScale()}},19091:function(D,L,t){var b=t(45568),d=t(42696).aL,e=t(34809),w=e.numberFormat,y=t(10721),_=e.cleanNumber,u=e.ms2DateTime,r=e.dateTime2ms,n=e.ensureNumber,l=e.isArrayOrTypedArray,o=t(63821),s=o.FP_SAFE,c=o.BADNUM,h=o.LOG_CLIP,x=o.ONEWEEK,m=o.ONEDAY,g=o.ONEHOUR,k=o.ONEMIN,A=o.ONESEC,v=t(5975),S=t(54826),T=S.HOUR_PATTERN,p=S.WEEKDAY_PATTERN;function M(E){return Math.pow(10,E)}function f(E){return E!=null}D.exports=function(E,I){I=I||{};var B=E._id||"x",N=B.charAt(0);function V(oe,le){if(oe>0)return Math.log(oe)/Math.LN10;if(oe<=0&&le&&E.range&&E.range.length===2){var ge=E.range[0],ye=E.range[1];return .5*(ge+ye-2*h*Math.abs(ge-ye))}return c}function j(oe,le,ge,ye){if((ye||{}).msUTC&&y(oe))return+oe;var me=r(oe,ge||E.calendar);if(me===c){if(!y(oe))return c;oe=+oe;var be=Math.floor(10*e.mod(oe+.05,1)),Se=Math.round(oe-be/10);me=r(new Date(Se))+be/10}return me}function $(oe,le,ge){return u(oe,le,ge||E.calendar)}function ee(oe){return E._categories[Math.round(oe)]}function H(oe){if(f(oe)){if(E._categoriesMap===void 0&&(E._categoriesMap={}),E._categoriesMap[oe]!==void 0)return E._categoriesMap[oe];E._categories.push(typeof oe=="number"?String(oe):oe);var le=E._categories.length-1;return E._categoriesMap[oe]=le,le}return c}function J(oe){if(E._categoriesMap)return E._categoriesMap[oe]}function Q(oe){var le=J(oe);return le!==void 0?le:y(oe)?+oe:void 0}function Z(oe){return y(oe)?+oe:J(oe)}function K(oe,le,ge){return b.round(ge+le*oe,2)}function ae(oe,le,ge){return(oe-ge)/le}var se=function(oe){return y(oe)?K(oe,E._m,E._b):c},he=function(oe){return ae(oe,E._m,E._b)};if(E.rangebreaks){var fe=N==="y";se=function(oe){if(!y(oe))return c;var le=E._rangebreaks.length;if(!le)return K(oe,E._m,E._b);var ge=fe;E.range[0]>E.range[1]&&(ge=!ge);for(var ye=ge?-1:1,me=ye*oe,be=0,Se=0;SeCe)){be=me<(Ee+Ce)/2?Se:Se+1;break}be=Se+1}var Le=E._B[be]||0;return isFinite(Le)?K(oe,E._m2,Le):0},he=function(oe){var le=E._rangebreaks.length;if(!le)return ae(oe,E._m,E._b);for(var ge=0,ye=0;yeE._rangebreaks[ye].pmax&&(ge=ye+1);return ae(oe,E._m2,E._B[ge])}}E.c2l=E.type==="log"?V:n,E.l2c=E.type==="log"?M:n,E.l2p=se,E.p2l=he,E.c2p=E.type==="log"?function(oe,le){return se(V(oe,le))}:se,E.p2c=E.type==="log"?function(oe){return M(he(oe))}:he,["linear","-"].indexOf(E.type)!==-1?(E.d2r=E.r2d=E.d2c=E.r2c=E.d2l=E.r2l=_,E.c2d=E.c2r=E.l2d=E.l2r=n,E.d2p=E.r2p=function(oe){return E.l2p(_(oe))},E.p2d=E.p2r=he,E.cleanPos=n):E.type==="log"?(E.d2r=E.d2l=function(oe,le){return V(_(oe),le)},E.r2d=E.r2c=function(oe){return M(_(oe))},E.d2c=E.r2l=_,E.c2d=E.l2r=n,E.c2r=V,E.l2d=M,E.d2p=function(oe,le){return E.l2p(E.d2r(oe,le))},E.p2d=function(oe){return M(he(oe))},E.r2p=function(oe){return E.l2p(_(oe))},E.p2r=he,E.cleanPos=n):E.type==="date"?(E.d2r=E.r2d=e.identity,E.d2c=E.r2c=E.d2l=E.r2l=j,E.c2d=E.c2r=E.l2d=E.l2r=$,E.d2p=E.r2p=function(oe,le,ge){return E.l2p(j(oe,0,ge))},E.p2d=E.p2r=function(oe,le,ge){return $(he(oe),le,ge)},E.cleanPos=function(oe){return e.cleanDate(oe,c,E.calendar)}):E.type==="category"?(E.d2c=E.d2l=H,E.r2d=E.c2d=E.l2d=ee,E.d2r=E.d2l_noadd=Q,E.r2c=function(oe){var le=Z(oe);return le!==void 0?le:E.fraction2r(.5)},E.l2r=E.c2r=n,E.r2l=Z,E.d2p=function(oe){return E.l2p(E.r2c(oe))},E.p2d=function(oe){return ee(he(oe))},E.r2p=E.d2p,E.p2r=he,E.cleanPos=function(oe){return typeof oe=="string"&&oe!==""?oe:n(oe)}):E.type==="multicategory"&&(E.r2d=E.c2d=E.l2d=ee,E.d2r=E.d2l_noadd=Q,E.r2c=function(oe){var le=Q(oe);return le!==void 0?le:E.fraction2r(.5)},E.r2c_just_indices=J,E.l2r=E.c2r=n,E.r2l=Q,E.d2p=function(oe){return E.l2p(E.r2c(oe))},E.p2d=function(oe){return ee(he(oe))},E.r2p=E.d2p,E.p2r=he,E.cleanPos=function(oe){return Array.isArray(oe)||typeof oe=="string"&&oe!==""?oe:n(oe)},E.setupMultiCategory=function(oe){var le,ge,ye=E._traceIndices,me=E._matchGroup;if(me&&E._categories.length===0){for(var be in me)if(be!==B){var Se=I[v.id2name(be)];ye=ye.concat(Se._traceIndices)}}var Ee=[[0,{}],[0,{}]],Ce=[];for(le=0;leSe[1]&&(ye[be?0:1]=ge),ye[0]===ye[1]){var Ee=E.l2r(le),Ce=E.l2r(ge);if(le!==void 0){var Le=Ee+1;ge!==void 0&&(Le=Math.min(Le,Ce)),ye[be?1:0]=Le}if(ge!==void 0){var Oe=Ce+1;le!==void 0&&(Oe=Math.max(Oe,Ee)),ye[be?0:1]=Oe}}}},E.cleanRange=function(oe,le){E._cleanRange(oe,le),E.limitRange(oe)},E._cleanRange=function(oe,le){le||(le={}),oe||(oe="range");var ge,ye,me=e.nestedProperty(E,oe).get();if(ye=(ye=E.type==="date"?e.dfltRange(E.calendar):N==="y"?S.DFLTRANGEY:E._name==="realaxis"?[0,1]:le.dfltRange||S.DFLTRANGEX).slice(),E.rangemode!=="tozero"&&E.rangemode!=="nonnegative"||(ye[0]=0),me&&me.length===2){var be=me[0]===null,Se=me[1]===null;for(E.type!=="date"||E.autorange||(me[0]=e.cleanDate(me[0],c,E.calendar),me[1]=e.cleanDate(me[1],c,E.calendar)),ge=0;ge<2;ge++)if(E.type==="date"){if(!e.isDateTime(me[ge],E.calendar)){E[oe]=ye;break}if(E.r2l(me[0])===E.r2l(me[1])){var Ee=e.constrain(E.r2l(me[0]),e.MIN_MS+1e3,e.MAX_MS-1e3);me[0]=E.l2r(Ee-1e3),me[1]=E.l2r(Ee+1e3);break}}else{if(!y(me[ge])){if(be||Se||!y(me[1-ge])){E[oe]=ye;break}me[ge]=me[1-ge]*(ge?10:.1)}if(me[ge]<-s?me[ge]=-s:me[ge]>s&&(me[ge]=s),me[0]===me[1]){var Ce=Math.max(1,Math.abs(1e-6*me[0]));me[0]-=Ce,me[1]+=Ce}}}else e.nestedProperty(E,oe).set(ye)},E.setScale=function(oe){var le=I._size;if(E.overlaying){var ge=v.getFromId({_fullLayout:I},E.overlaying);E.domain=ge.domain}var ye=oe&&E._r?"_r":"range",me=E.calendar;E.cleanRange(ye);var be,Se,Ee=E.r2l(E[ye][0],me),Ce=E.r2l(E[ye][1],me),Le=N==="y";if(Le?(E._offset=le.t+(1-E.domain[1])*le.h,E._length=le.h*(E.domain[1]-E.domain[0]),E._m=E._length/(Ee-Ce),E._b=-E._m*Ce):(E._offset=le.l+E.domain[0]*le.w,E._length=le.w*(E.domain[1]-E.domain[0]),E._m=E._length/(Ce-Ee),E._b=-E._m*Ee),E._rangebreaks=[],E._lBreaks=0,E._m2=0,E._B=[],E.rangebreaks&&(E._rangebreaks=E.locateBreaks(Math.min(Ee,Ce),Math.max(Ee,Ce)),E._rangebreaks.length)){for(be=0;beCe&&(Oe=!Oe),Oe&&E._rangebreaks.reverse();var We=Oe?-1:1;for(E._m2=We*E._length/(Math.abs(Ce-Ee)-E._lBreaks),E._B.push(-E._m2*(Le?Ce:Ee)),be=0;beye&&(ye+=7,meye&&(ye+=24,me=ge&&me=ge&&oe=Ye.min&&(HeYe.max&&(Ye.max=Fe),qe=!1)}qe&&Se.push({min:He,max:Fe})}};for(ge=0;ger.duration?(function(){for(var T={},p=0;p rect").call(w.setTranslate,0,0).call(w.setScale,1,1),k.plot.call(w.setTranslate,A._offset,v._offset).call(w.setScale,1,1);var S=k.plot.selectAll(".scatterlayer .trace");S.selectAll(".point").call(w.setPointGroupScale,1,1),S.selectAll(".textpoint").call(w.setTextPointsScale,1,1),S.call(w.hideOutsideRangePoints,k)}function g(k,A){var v=k.plotinfo,S=v.xaxis,T=v.yaxis,p=S._length,M=T._length,f=!!k.xr1,E=!!k.yr1,I=[];if(f){var B=e.simpleMap(k.xr0,S.r2l),N=e.simpleMap(k.xr1,S.r2l),V=B[1]-B[0],j=N[1]-N[0];I[0]=(B[0]*(1-A)+A*N[0]-B[0])/(B[1]-B[0])*p,I[2]=p*(1-A+A*j/V),S.range[0]=S.l2r(B[0]*(1-A)+A*N[0]),S.range[1]=S.l2r(B[1]*(1-A)+A*N[1])}else I[0]=0,I[2]=p;if(E){var $=e.simpleMap(k.yr0,T.r2l),ee=e.simpleMap(k.yr1,T.r2l),H=$[1]-$[0],J=ee[1]-ee[0];I[1]=($[1]*(1-A)+A*ee[1]-$[1])/($[0]-$[1])*M,I[3]=M*(1-A+A*J/H),T.range[0]=S.l2r($[0]*(1-A)+A*ee[0]),T.range[1]=T.l2r($[1]*(1-A)+A*ee[1])}else I[1]=0,I[3]=M;y.drawOne(_,S,{skipTitle:!0}),y.drawOne(_,T,{skipTitle:!0}),y.redrawComponents(_,[S._id,T._id]);var Q=f?p/I[2]:1,Z=E?M/I[3]:1,K=f?I[0]:0,ae=E?I[1]:0,se=f?I[0]/I[2]*p:0,he=E?I[1]/I[3]*M:0,fe=S._offset-se,ie=T._offset-he;v.clipRect.call(w.setTranslate,K,ae).call(w.setScale,1/Q,1/Z),v.plot.call(w.setTranslate,fe,ie).call(w.setScale,Q,Z),w.setPointGroupScale(v.zoomScalePts,1/Q,1/Z),w.setTextPointsScale(v.zoomScaleTxt,1/Q,1/Z)}y.redrawComponents(_)}},4392:function(D,L,t){var b=t(33626).traceIs,d=t(9666);function e(y){return{v:"x",h:"y"}[y.orientation||"v"]}function w(y,_){var u=e(y),r=b(y,"box-violin"),n=b(y._fullInput||{},"candlestick");return r&&!n&&_===u&&y[u]===void 0&&y[u+"0"]===void 0}D.exports=function(y,_,u,r){u("autotypenumbers",r.autotypenumbersDflt),u("type",(r.splomStash||{}).type)==="-"&&(function(n,l){if(n.type==="-"){var o,s=n._id,c=s.charAt(0);s.indexOf("scene")!==-1&&(s=c);var h=function(T,p,M){for(var f=0;f0&&(E["_"+M+"axes"]||{})[p]||(E[M+"axis"]||M)===p&&(w(E,M)||(E[M]||[]).length||E[M+"0"]))return E}}(l,s,c);if(h)if(h.type!=="histogram"||c!=={v:"y",h:"x"}[h.orientation||"v"]){var x=c+"calendar",m=h[x],g={noMultiCategory:!b(h,"cartesian")||b(h,"noMultiCategory")};if(h.type==="box"&&h._hasPreCompStats&&c==={h:"x",v:"y"}[h.orientation||"v"]&&(g.noMultiCategory=!0),g.autotypenumbers=n.autotypenumbers,w(h,c)){var k=e(h),A=[];for(o=0;o0?".":"")+o;d.isPlainObject(s)?_(s,r,c,l+1):r(c,o,s)}})}L.manageCommandObserver=function(u,r,n,l){var o={},s=!0;r&&r._commandObserver&&(o=r._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=L.hasSimpleAPICommandBindings(u,n,o.lookupTable);if(r&&r._commandObserver){if(c)return o;if(r._commandObserver.remove)return r._commandObserver.remove(),r._commandObserver=null,o}if(c){e(u,c,o.cache),o.check=function(){if(s){var m=e(u,c,o.cache);return m.changed&&l&&o.lookupTable[m.value]!==void 0&&(o.disable(),Promise.resolve(l({value:m.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[m.value]})).then(o.enable,o.enable)),m.changed}};for(var h=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],x=0;x0&&j<0&&(j+=360);var H=(j-V)/4;return{type:"Polygon",coordinates:[[[V,$],[V,ee],[V+H,ee],[V+2*H,ee],[V+3*H,ee],[j,ee],[j,$],[j-H,$],[j-2*H,$],[j-3*H,$],[V,$]]]}}D.exports=function(I){return new M(I)},f.plot=function(I,B,N,V){var j=this;if(V)return j.update(I,B,!0);j._geoCalcData=I,j._fullLayout=B;var $=B[this.id],ee=[],H=!1;for(var J in v.layerNameToAdjective)if(J!=="frame"&&$["show"+J]){H=!0;break}for(var Q=!1,Z=0;Z0&&ee._module.calcGeoJSON($,B)}if(!N){if(this.updateProjection(I,B))return;this.viewInitial&&this.scope===V.scope||this.saveViewInitial(V)}this.scope=V.scope,this.updateBaseLayers(B,V),this.updateDims(B,V),this.updateFx(B,V),s.generalUpdatePerTraceModule(this.graphDiv,this,I,V);var H=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=H.selectAll(".point"),this.dataPoints.text=H.selectAll("text"),this.dataPaths.line=H.selectAll(".js-line");var J=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=J.selectAll("path"),this._render()},f.updateProjection=function(I,B){var N=this.graphDiv,V=B[this.id],j=B._size,$=V.domain,ee=V.projection,H=V.lonaxis,J=V.lataxis,Q=H._ax,Z=J._ax,K=this.projection=function(Pe){var de=Pe.projection,Me=de.type,ke=v.projNames[Me];ke="geo"+u.titleCase(ke);for(var He=(d[ke]||y[ke])(),Fe=Pe._isSatellite?180*Math.acos(1/de.distance)/Math.PI:Pe._isClipped?v.lonaxisSpan[Me]/2:null,qe=["center","rotate","parallels","clipExtent"],$e=function(De){return De?He:[]},Ye=0;YeFe*Math.PI/180}return!1},He.getPath=function(){return e().projection(He)},He.getBounds=function(De){return He.getPath().bounds(De)},He.precision(v.precision),Pe._isSatellite&&He.tilt(de.tilt).distance(de.distance),Fe&&He.clipAngle(Fe-v.clipPad),He}(V),ae=[[j.l+j.w*$.x[0],j.t+j.h*(1-$.y[1])],[j.l+j.w*$.x[1],j.t+j.h*(1-$.y[0])]],se=V.center||{},he=ee.rotation||{},fe=H.range||[],ie=J.range||[];if(V.fitbounds){Q._length=ae[1][0]-ae[0][0],Z._length=ae[1][1]-ae[0][1],Q.range=h(N,Q),Z.range=h(N,Z);var oe=(Q.range[0]+Q.range[1])/2,le=(Z.range[0]+Z.range[1])/2;if(V._isScoped)se={lon:oe,lat:le};else if(V._isClipped){se={lon:oe,lat:le},he={lon:oe,lat:le,roll:he.roll};var ge=ee.type,ye=v.lonaxisSpan[ge]/2||180,me=v.lataxisSpan[ge]/2||90;fe=[oe-ye,oe+ye],ie=[le-me,le+me]}else se={lon:oe,lat:le},he={lon:oe,lat:he.lat,roll:he.roll}}K.center([se.lon-he.lon,se.lat-he.lat]).rotate([-he.lon,-he.lat,he.roll]).parallels(ee.parallels);var be=E(fe,ie);K.fitExtent(ae,be);var Se=this.bounds=K.getBounds(be),Ee=this.fitScale=K.scale(),Ce=K.translate();if(V.fitbounds){var Le=K.getBounds(E(Q.range,Z.range)),Oe=Math.min((Se[1][0]-Se[0][0])/(Le[1][0]-Le[0][0]),(Se[1][1]-Se[0][1])/(Le[1][1]-Le[0][1]));isFinite(Oe)?K.scale(Oe*Ee):u.warn("Something went wrong during"+this.id+"fitbounds computations.")}else K.scale(ee.scale*Ee);var We=this.midPt=[(Se[0][0]+Se[1][0])/2,(Se[0][1]+Se[1][1])/2];if(K.translate([Ce[0]+(We[0]-Ce[0]),Ce[1]+(We[1]-Ce[1])]).clipExtent(Se),V._isAlbersUsa){var Ie=K([se.lon,se.lat]),Ve=K.translate();K.translate([Ve[0]-(Ie[0]-Ve[0]),Ve[1]-(Ie[1]-Ve[1])])}},f.updateBaseLayers=function(I,B){var N=this,V=N.topojson,j=N.layers,$=N.basePaths;function ee(K){return K==="lonaxis"||K==="lataxis"}function H(K){return!!v.lineLayers[K]}function J(K){return!!v.fillLayers[K]}var Q=(this.hasChoropleth?v.layersForChoropleth:v.layers).filter(function(K){return H(K)||J(K)?B["show"+K]:!ee(K)||B[K].showgrid}),Z=N.framework.selectAll(".layer").data(Q,String);Z.exit().each(function(K){delete j[K],delete $[K],b.select(this).remove()}),Z.enter().append("g").attr("class",function(K){return"layer "+K}).each(function(K){var ae=j[K]=b.select(this);K==="bg"?N.bgRect=ae.append("rect").style("pointer-events","all"):ee(K)?$[K]=ae.append("path").style("fill","none"):K==="backplot"?ae.append("g").classed("choroplethlayer",!0):K==="frontplot"?ae.append("g").classed("scatterlayer",!0):H(K)?$[K]=ae.append("path").style("fill","none").style("stroke-miterlimit",2):J(K)&&($[K]=ae.append("path").style("stroke","none"))}),Z.order(),Z.each(function(K){var ae=$[K],se=v.layerNameToAdjective[K];K==="frame"?ae.datum(v.sphereSVG):H(K)||J(K)?ae.datum(p(V,V.objects[K])):ee(K)&&ae.datum(function(he,fe,ie){var oe,le,ge,ye=fe[he],me=v.scopeDefaults[fe.scope];he==="lonaxis"?(oe=me.lonaxisRange,le=me.lataxisRange,ge=function(Ve,Pe){return[Ve,Pe]}):he==="lataxis"&&(oe=me.lataxisRange,le=me.lonaxisRange,ge=function(Ve,Pe){return[Pe,Ve]});var be={type:"linear",range:[oe[0],oe[1]-1e-6],tick0:ye.tick0,dtick:ye.dtick};c.setConvert(be,ie);var Se=c.calcTicks(be);fe.isScoped||he!=="lonaxis"||Se.pop();for(var Ee=Se.length,Ce=new Array(Ee),Le=0;Le-1&&k(b.event,V,[N.xaxis],[N.yaxis],N.id,H),ee.indexOf("event")>-1&&o.click(V,b.event))})}function J(Q){return N.projection.invert([Q[0]+N.xaxis._offset,Q[1]+N.yaxis._offset])}},f.makeFramework=function(){var I=this,B=I.graphDiv,N=B._fullLayout,V="clip"+N._uid+I.id;I.clipDef=N._clips.append("clipPath").attr("id",V),I.clipRect=I.clipDef.append("rect"),I.framework=b.select(I.container).append("g").attr("class","geo "+I.id).call(l.setClipUrl,V,B),I.project=function(j){var $=I.projection(j);return $?[$[0]-I.xaxis._offset,$[1]-I.yaxis._offset]:[null,null]},I.xaxis={_id:"x",c2p:function(j){return I.project(j)[0]}},I.yaxis={_id:"y",c2p:function(j){return I.project(j)[1]}},I.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(I.mockAxis,N)},f.saveViewInitial=function(I){var B,N=I.center||{},V=I.projection,j=V.rotation||{};this.viewInitial={fitbounds:I.fitbounds,"projection.scale":V.scale},B=I._isScoped?{"center.lon":N.lon,"center.lat":N.lat}:I._isClipped?{"projection.rotation.lon":j.lon,"projection.rotation.lat":j.lat}:{"center.lon":N.lon,"center.lat":N.lat,"projection.rotation.lon":j.lon},u.extendFlat(this.viewInitial,B)},f.render=function(I){this._hasMarkerAngles&&I?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},f._render=function(){var I,B=this.projection,N=B.getPath();function V($){var ee=B($.lonlat);return ee?r(ee[0],ee[1]):null}function j($){return B.isLonLatOverEdges($.lonlat)?"none":null}for(I in this.basePaths)this.basePaths[I].attr("d",N);for(I in this.dataPaths)this.dataPaths[I].attr("d",function($){return N($.geojson)});for(I in this.dataPoints)this.dataPoints[I].attr("display",j).attr("transform",V)}},47544:function(D,L,t){var b=t(4173).fX,d=t(34809).counterRegex,e=t(6493),w="geo",y=d(w),_={};_[w]={valType:"subplotid",dflt:w,editType:"calc"},D.exports={attr:w,name:w,idRoot:w,idRegex:y,attrRegex:y,attributes:_,layoutAttributes:t(42194),supplyLayoutDefaults:t(31653),plot:function(u){for(var r=u._fullLayout,n=u.calcdata,l=r._subplots[w],o=0;o0&&J<0&&(J+=360);var Q,Z,K,ae=(H+J)/2;if(!g){var se=k?x.projRotate:[ae,0,0];Q=l("projection.rotation.lon",se[0]),l("projection.rotation.lat",se[1]),l("projection.rotation.roll",se[2]),l("showcoastlines",!k&&p)&&(l("coastlinecolor"),l("coastlinewidth")),l("showocean",!!p&&void 0)&&l("oceancolor")}g?(Z=-96.6,K=38.7):(Z=k?ae:Q,K=(ee[0]+ee[1])/2),l("center.lon",Z),l("center.lat",K),A&&(l("projection.tilt"),l("projection.distance")),v&&l("projection.parallels",x.projParallels||[0,60]),l("projection.scale"),l("showland",!!p&&void 0)&&l("landcolor"),l("showlakes",!!p&&void 0)&&l("lakecolor"),l("showrivers",!!p&&void 0)&&(l("rivercolor"),l("riverwidth")),l("showcountries",k&&h!=="usa"&&p)&&(l("countrycolor"),l("countrywidth")),(h==="usa"||h==="north america"&&c===50)&&(l("showsubunits",p),l("subunitcolor"),l("subunitwidth")),k||l("showframe",p)&&(l("framecolor"),l("framewidth")),l("bgcolor"),l("fitbounds")&&(delete n.projection.scale,k?(delete n.center.lon,delete n.center.lat):S?(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon,delete n.projection.rotation.lat,delete n.lonaxis.range,delete n.lataxis.range):(delete n.center.lon,delete n.center.lat,delete n.projection.rotation.lon))}D.exports=function(r,n,l){d(r,n,l,{type:"geo",attributes:y,handleDefaults:u,fullData:l,partition:"y"})}},14309:function(D,L,t){var b=t(45568),d=t(34809),e=t(33626),w=Math.PI/180,y=180/Math.PI,_={cursor:"pointer"},u={cursor:"auto"};function r(k,A){return b.behavior.zoom().translate(A.translate()).scale(A.scale())}function n(k,A,v){var S=k.id,T=k.graphDiv,p=T.layout,M=p[S],f=T._fullLayout,E=f[S],I={},B={};function N(V,j){I[S+"."+V]=d.nestedProperty(M,V).get(),e.call("_storeDirectGUIEdit",p,f._preGUI,I);var $=d.nestedProperty(E,V);$.get()!==j&&($.set(j),d.nestedProperty(M,V).set(j),B[S+"."+V]=j)}v(N),N("projection.scale",A.scale()/k.fitScale),N("fitbounds",!1),T.emit("plotly_relayout",B)}function l(k,A){var v=r(0,A);function S(T){var p=A.invert(k.midPt);T("center.lon",p[0]),T("center.lat",p[1])}return v.on("zoomstart",function(){b.select(this).style(_)}).on("zoom",function(){A.scale(b.event.scale).translate(b.event.translate),k.render(!0);var T=A.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":A.scale()/k.fitScale,"geo.center.lon":T[0],"geo.center.lat":T[1]})}).on("zoomend",function(){b.select(this).style(u),n(k,A,S)}),v}function o(k,A){var v,S,T,p,M,f,E,I,B,N=r(0,A);function V($){return A.invert($)}function j($){var ee=A.rotate(),H=A.invert(k.midPt);$("projection.rotation.lon",-ee[0]),$("center.lon",H[0]),$("center.lat",H[1])}return N.on("zoomstart",function(){b.select(this).style(_),v=b.mouse(this),S=A.rotate(),T=A.translate(),p=S,M=V(v)}).on("zoom",function(){if(f=b.mouse(this),function(H){var J=V(H);if(!J)return!0;var Q=A(J);return Math.abs(Q[0]-H[0])>2||Math.abs(Q[1]-H[1])>2}(v))return N.scale(A.scale()),void N.translate(A.translate());A.scale(b.event.scale),A.translate([T[0],b.event.translate[1]]),M?V(f)&&(I=V(f),E=[p[0]+(I[0]-M[0]),S[1],S[2]],A.rotate(E),p=E):M=V(v=f),B=!0,k.render(!0);var $=A.rotate(),ee=A.invert(k.midPt);k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":A.scale()/k.fitScale,"geo.center.lon":ee[0],"geo.center.lat":ee[1],"geo.projection.rotation.lon":-$[0]})}).on("zoomend",function(){b.select(this).style(u),B&&n(k,A,j)}),N}function s(k,A){var v;A.rotate(),A.scale();var S=r(0,A),T=function(E){for(var I=0,B=arguments.length,N=[];++IGe?(He=(_e>0?90:-90)-Be,ke=0):(He=Math.asin(_e/Ge)*y-Be,ke=Math.sqrt(Ge*Ge-_e*_e));var tt=180-He-2*Be,nt=(Math.atan2(De,Ye)-Math.atan2($e,ke))*y,ft=(Math.atan2(De,Ye)-Math.atan2($e,-ke))*y;return h(de[0],de[1],He,nt)<=h(de[0],de[1],tt,ft)?[He,nt,de[2]]:[tt,ft,de[2]]}(We,v,ae);isFinite(Ie[0])&&isFinite(Ie[1])&&isFinite(Ie[2])||(Ie=ae),A.rotate(Ie),ae=Ie}}else v=c(A,Z=Ce);T.of(this,arguments)({type:"zoom"})}),Q=T.of(this,arguments),p++||Q({type:"zoomstart"})}).on("zoomend",function(){var E;b.select(this).style(u),M.call(S,"zoom",null),E=T.of(this,arguments),--p||E({type:"zoomend"}),n(k,A,f)}).on("zoom.redraw",function(){k.render(!0);var E=A.rotate();k.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":A.scale()/k.fitScale,"geo.projection.rotation.lon":-E[0],"geo.projection.rotation.lat":-E[1]})}),b.rebind(S,T,"on")}function c(k,A){var v=k.invert(A);return v&&isFinite(v[0])&&isFinite(v[1])&&function(S){var T=S[0]*w,p=S[1]*w,M=Math.cos(p);return[M*Math.cos(T),M*Math.sin(T),Math.sin(p)]}(v)}function h(k,A,v,S){var T=x(v-k),p=x(S-A);return Math.sqrt(T*T+p*p)}function x(k){return(k%360+540)%360-180}function m(k,A,v){var S=v*w,T=k.slice(),p=A===0?1:0,M=A===2?1:2,f=Math.cos(S),E=Math.sin(S);return T[p]=k[p]*f-k[M]*E,T[M]=k[M]*f+k[p]*E,T}function g(k,A){for(var v=0,S=0,T=k.length;SMath.abs(g)?(l.boxEnd[1]=l.boxStart[1]+Math.abs(m)*N*(g>=0?1:-1),l.boxEnd[1]k[3]&&(l.boxEnd[1]=k[3],l.boxEnd[0]=l.boxStart[0]+(k[3]-l.boxStart[1])/Math.abs(N))):(l.boxEnd[0]=l.boxStart[0]+Math.abs(g)/N*(m>=0?1:-1),l.boxEnd[0]k[2]&&(l.boxEnd[0]=k[2],l.boxEnd[1]=l.boxStart[1]+(k[2]-l.boxStart[0])*Math.abs(N)))}}else l.boxEnabled?(m=l.boxStart[0]!==l.boxEnd[0],g=l.boxStart[1]!==l.boxEnd[1],m||g?(m&&(M(0,l.boxStart[0],l.boxEnd[0]),u.xaxis.autorange=!1),g&&(M(1,l.boxStart[1],l.boxEnd[1]),u.yaxis.autorange=!1),u.relayoutCallback()):u.glplot.setDirty(),l.boxEnabled=!1,l.boxInited=!1):l.boxInited&&(l.boxInited=!1);break;case"pan":l.boxEnabled=!1,l.boxInited=!1,c?(l.panning||(l.dragStart[0]=h,l.dragStart[1]=x),Math.abs(l.dragStart[0]-h).999&&(S="turntable"):S="turntable")}else S="turntable";s("dragmode",S),s("hovermode",c.getDfltFromLayout("hovermode"))}D.exports=function(l,o,s){var c=o._basePlotModules.length>1;w(l,o,s,{type:r,attributes:_,handleDefaults:n,fullLayout:o,font:o.font,fullData:s,getDfltFromLayout:function(h){if(!c)return b.validate(l[h],_[h])?l[h]:void 0},autotypenumbersDflt:o.autotypenumbers,paper_bgcolor:o.paper_bgcolor,calendar:o.calendar})}},77168:function(D,L,t){var b=t(63397),d=t(13792).u,e=t(93049).extendFlat,w=t(34809).counterRegex;function y(_,u,r){return{x:{valType:"number",dflt:_,editType:"camera"},y:{valType:"number",dflt:u,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}D.exports={_arrayAttrRegexps:[w("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:e(y(0,0,1),{}),center:e(y(0,0,0),{}),eye:e(y(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:d({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:b,yaxis:b,zaxis:b,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},64087:function(D,L,t){var b=t(55010),d=["xaxis","yaxis","zaxis"];function e(){this.enabled=[!0,!0,!0],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.drawSides=[!0,!0,!0],this.lineWidth=[1,1,1]}e.prototype.merge=function(w){for(var y=0;y<3;++y){var _=w[d[y]];_.visible?(this.enabled[y]=_.showspikes,this.colors[y]=b(_.spikecolor),this.drawSides[y]=_.spikesides,this.lineWidth[y]=_.spikethickness):(this.enabled[y]=!1,this.drawSides[y]=!1)}},D.exports=function(w){var y=new e;return y.merge(w),y}},32412:function(D,L,t){D.exports=function(y){for(var _=y.axesOptions,u=y.glplot.axesPixels,r=y.fullSceneLayout,n=[[],[],[]],l=0;l<3;++l){var o=r[e[l]];if(o._length=(u[l].hi-u[l].lo)*u[l].pixelsPerDataUnit/y.dataScale[l],Math.abs(o._length)===1/0||isNaN(o._length))n[l]=[];else{o._input_range=o.range.slice(),o.range[0]=u[l].lo/y.dataScale[l],o.range[1]=u[l].hi/y.dataScale[l],o._m=1/(y.dataScale[l]*u[l].pixelsPerDataUnit),o.range[0]===o.range[1]&&(o.range[0]-=1,o.range[1]+=1);var s=o.tickmode;if(o.tickmode==="auto"){o.tickmode="linear";var c=o.nticks||d.constrain(o._length/40,4,9);b.autoTicks(o,Math.abs(o.range[1]-o.range[0])/c)}for(var h=b.calcTicks(o,{msUTC:!0}),x=0;x/g," "));n[l]=h,o.tickmode=s}}for(_.ticks=n,l=0;l<3;++l)for(w[l]=.5*(y.glplot.bounds[0][l]+y.glplot.bounds[1][l]),x=0;x<2;++x)_.bounds[x][l]=y.glplot.bounds[x][l];y.contourLevels=function(m){for(var g=new Array(3),k=0;k<3;++k){for(var A=m[k],v=new Array(A.length),S=0;Sj.deltaY?1.1:.9090909090909091,ee=E.glplot.getAspectratio();E.glplot.setAspectratio({x:$*ee.x,y:$*ee.y,z:$*ee.z})}V(E)}},!!u&&{passive:!1}),E.glplot.canvas.addEventListener("mousemove",function(){if(E.fullSceneLayout.dragmode!==!1&&E.camera.mouseListener.buttons!==0){var j=N();E.graphDiv.emit("plotly_relayouting",j)}}),E.staticMode||E.glplot.canvas.addEventListener("webglcontextlost",function(j){I&&I.emit&&I.emit("plotly_webglcontextlost",{event:j,layer:E.id})},!1)),E.glplot.oncontextloss=function(){E.recoverContext()},E.glplot.onrender=function(){E.render()},!0},T.render=function(){var E,I=this,B=I.graphDiv,N=I.svgContainer,V=I.container.getBoundingClientRect();B._fullLayout._calcInverseTransform(B);var j=B._fullLayout._invScaleX,$=B._fullLayout._invScaleY,ee=V.width*j,H=V.height*$;N.setAttributeNS(null,"viewBox","0 0 "+ee+" "+H),N.setAttributeNS(null,"width",ee),N.setAttributeNS(null,"height",H),k(I),I.glplot.axes.update(I.axesOptions);for(var J=Object.keys(I.traces),Q=null,Z=I.glplot.selection,K=0;K")):E.type==="isosurface"||E.type==="volume"?(oe.valueLabel=o.hoverLabelText(I._mockAxis,I._mockAxis.d2l(Z.traceCoordinate[3]),E.valuehoverformat),me.push("value: "+oe.valueLabel),Z.textLabel&&me.push(Z.textLabel),he=me.join("
")):he=Z.textLabel;var be={x:Z.traceCoordinate[0],y:Z.traceCoordinate[1],z:Z.traceCoordinate[2],data:fe._input,fullData:fe,curveNumber:fe.index,pointNumber:ie};s.appendArrayPointValue(be,fe,ie),E._module.eventData&&(be=fe._module.eventData(be,Z,fe,{},ie));var Se={points:[be]};if(I.fullSceneLayout.hovermode){var Ee=[];s.loneHover({trace:fe,x:(.5+.5*se[0]/se[3])*ee,y:(.5-.5*se[1]/se[3])*H,xLabel:oe.xLabel,yLabel:oe.yLabel,zLabel:oe.zLabel,text:he,name:Q.name,color:s.castHoverOption(fe,ie,"bgcolor")||Q.color,borderColor:s.castHoverOption(fe,ie,"bordercolor"),fontFamily:s.castHoverOption(fe,ie,"font.family"),fontSize:s.castHoverOption(fe,ie,"font.size"),fontColor:s.castHoverOption(fe,ie,"font.color"),nameLength:s.castHoverOption(fe,ie,"namelength"),textAlign:s.castHoverOption(fe,ie,"align"),hovertemplate:n.castOption(fe,ie,"hovertemplate"),hovertemplateLabels:n.extendFlat({},be,oe),eventData:[be]},{container:N,gd:B,inOut_bbox:Ee}),be.bbox=Ee[0]}Z.distance<5&&(Z.buttons||v)?B.emit("plotly_click",Se):B.emit("plotly_hover",Se),this.oldEventData=Se}else s.loneUnhover(N),this.oldEventData&&B.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;I.drawAnnotations(I)},T.recoverContext=function(){var E=this;E.glplot.dispose();var I=function(){E.glplot.gl.isContextLost()?requestAnimationFrame(I):E.initializeGLPlot()?E.plot.apply(E,E.plotArgs):n.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(I)};var M=["xaxis","yaxis","zaxis"];function f(E,I,B){for(var N=E.fullSceneLayout,V=0;V<3;V++){var j=M[V],$=j.charAt(0),ee=N[j],H=I[$],J=I[$+"calendar"],Q=I["_"+$+"length"];if(n.isArrayOrTypedArray(H))for(var Z,K=0;K<(Q||H.length);K++)if(n.isArrayOrTypedArray(H[K]))for(var ae=0;aefe[1][$])fe[0][$]=-1,fe[1][$]=1;else{var Oe=fe[1][$]-fe[0][$];fe[0][$]-=Oe/32,fe[1][$]+=Oe/32}if(le=[fe[0][$],fe[1][$]],le=A(le,H),fe[0][$]=le[0],fe[1][$]=le[1],H.isReversed()){var We=fe[0][$];fe[0][$]=fe[1][$],fe[1][$]=We}}else le=H.range,fe[0][$]=H.r2l(le[0]),fe[1][$]=H.r2l(le[1]);fe[0][$]===fe[1][$]&&(fe[0][$]-=1,fe[1][$]+=1),ie[$]=fe[1][$]-fe[0][$],H.range=[fe[0][$],fe[1][$]],H.limitRange(),N.glplot.setBounds($,{min:H.range[0]*ae[$],max:H.range[1]*ae[$]})}var Ie=Q.aspectmode;if(Ie==="cube")he=[1,1,1];else if(Ie==="manual"){var Ve=Q.aspectratio;he=[Ve.x,Ve.y,Ve.z]}else{if(Ie!=="auto"&&Ie!=="data")throw new Error("scene.js aspectRatio was not one of the enumerated types");var Pe=[1,1,1];for($=0;$<3;++$){var de=oe[J=(H=Q[M[$]]).type];Pe[$]=Math.pow(de.acc,1/de.count)/ae[$]}he=Ie==="data"||Math.max.apply(null,Pe)/Math.min.apply(null,Pe)<=4?Pe:[1,1,1]}Q.aspectratio.x=Z.aspectratio.x=he[0],Q.aspectratio.y=Z.aspectratio.y=he[1],Q.aspectratio.z=Z.aspectratio.z=he[2],N.glplot.setAspectratio(Q.aspectratio),N.viewInitial.aspectratio||(N.viewInitial.aspectratio={x:Q.aspectratio.x,y:Q.aspectratio.y,z:Q.aspectratio.z}),N.viewInitial.aspectmode||(N.viewInitial.aspectmode=Q.aspectmode);var Me=Q.domain||null,ke=I._size||null;if(Me&&ke){var He=N.container.style;He.position="absolute",He.left=ke.l+Me.x[0]*ke.w+"px",He.top=ke.t+(1-Me.y[1])*ke.h+"px",He.width=ke.w*(Me.x[1]-Me.x[0])+"px",He.height=ke.h*(Me.y[1]-Me.y[0])+"px"}N.glplot.redraw()}},T.destroy=function(){var E=this;E.glplot&&(E.camera.mouseListener.enabled=!1,E.container.removeEventListener("wheel",E.camera.wheelListener),E.camera=null,E.glplot.dispose(),E.container.parentNode.removeChild(E.container),E.glplot=null)},T.getCamera=function(){var E,I=this;return I.camera.view.recalcMatrix(I.camera.view.lastT()),{up:{x:(E=I.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:E._ortho===!0?"orthographic":"perspective"}}},T.setViewport=function(E){var I,B=this,N=E.camera;B.camera.lookAt.apply(this,[[(I=N).eye.x,I.eye.y,I.eye.z],[I.center.x,I.center.y,I.center.z],[I.up.x,I.up.y,I.up.z]]),B.glplot.setAspectratio(E.aspectratio),N.projection.type==="orthographic"!==B.camera._ortho&&(B.glplot.redraw(),B.glplot.clearRGBA(),B.glplot.dispose(),B.initializeGLPlot())},T.isCameraChanged=function(E){var I=this.getCamera(),B=n.nestedProperty(E,this.id+".camera").get();function N(ee,H,J,Q){var Z=["up","center","eye"],K=["x","y","z"];return H[Z[J]]&&ee[Z[J]][K[Q]]===H[Z[J]][K[Q]]}var V=!1;if(B===void 0)V=!0;else{for(var j=0;j<3;j++)for(var $=0;$<3;$++)if(!N(I,B,j,$)){V=!0;break}(!B.projection||I.projection&&I.projection.type!==B.projection.type)&&(V=!0)}return V},T.isAspectChanged=function(E){var I=this.glplot.getAspectratio(),B=n.nestedProperty(E,this.id+".aspectratio").get();return B===void 0||B.x!==I.x||B.y!==I.y||B.z!==I.z},T.saveLayout=function(E){var I,B,N,V,j,$,ee=this,H=ee.fullLayout,J=ee.isCameraChanged(E),Q=ee.isAspectChanged(E),Z=J||Q;if(Z){var K={};J&&(I=ee.getCamera(),N=(B=n.nestedProperty(E,ee.id+".camera")).get(),K[ee.id+".camera"]=N),Q&&(V=ee.glplot.getAspectratio(),$=(j=n.nestedProperty(E,ee.id+".aspectratio")).get(),K[ee.id+".aspectratio"]=$),r.call("_storeDirectGUIEdit",E,H._preGUI,K),J&&(B.set(I),n.nestedProperty(H,ee.id+".camera").set(I)),Q&&(j.set(V),n.nestedProperty(H,ee.id+".aspectratio").set(V),ee.glplot.redraw())}return Z},T.updateFx=function(E,I){var B=this,N=B.camera;if(N)if(E==="orbit")N.mode="orbit",N.keyBindingMode="rotate";else if(E==="turntable"){N.up=[0,0,1],N.mode="turntable",N.keyBindingMode="rotate";var V=B.graphDiv,j=V._fullLayout,$=B.fullSceneLayout.camera,ee=$.up.x,H=$.up.y,J=$.up.z;if(J/Math.sqrt(ee*ee+H*H+J*J)<.999){var Q=B.id+".camera.up",Z={x:0,y:0,z:1},K={};K[Q]=Z;var ae=V.layout;r.call("_storeDirectGUIEdit",ae,j._preGUI,K),$.up=Z,n.nestedProperty(ae,Q).set(Z)}}else N.keyBindingMode=E;B.fullSceneLayout.hovermode=I},T.toImage=function(E){var I=this;E||(E="png"),I.staticMode&&I.container.appendChild(b),I.glplot.redraw();var B=I.glplot.gl,N=B.drawingBufferWidth,V=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var j=new Uint8Array(N*V*4);B.readPixels(0,0,N,V,B.RGBA,B.UNSIGNED_BYTE,j),function(Q,Z,K){for(var ae=0,se=K-1;ae0)for(var ie=255/fe,oe=0;oe<3;++oe)Q[he+oe]=Math.min(ie*Q[he+oe],255)}}(j,N,V);var $=document.createElement("canvas");$.width=N,$.height=V;var ee,H=$.getContext("2d",{willReadFrequently:!0}),J=H.createImageData(N,V);switch(J.data.set(j),H.putImageData(J,0,0),E){case"jpeg":ee=$.toDataURL("image/jpeg");break;case"webp":ee=$.toDataURL("image/webp");break;default:ee=$.toDataURL("image/png")}return I.staticMode&&I.container.removeChild(b),ee},T.setConvert=function(){for(var E=0;E<3;E++){var I=this.fullSceneLayout[M[E]];o.setConvert(I,this.fullLayout),I.setScale=n.noop}},T.make4thDimension=function(){var E=this,I=E.graphDiv._fullLayout;E._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(E._mockAxis,I)},D.exports=S},88239:function(D){D.exports=function(L,t,b,d){d=d||L.length;for(var e=new Array(d),w=0;wOpenStreetMap 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":e,"carto-darkmatter":w,"carto-voyager":y,"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"},u=b(_);D.exports={styleValueDflt:"basic",stylesMap:_,styleValuesMap:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",u.join(", "),"or use a tile service."].join(` `),mapOnErrorMsg:"Map error."}},4657:function(D,L,t){var b=t(34809);D.exports=function(d,e){var w=d.split(" "),y=w[0],_=w[1],u=b.isArrayOrTypedArray(e)?b.mean(e):e,r=.5+u/100,n=1.5+u/100,l=["",""],o=[0,0];switch(y){case"top":l[0]="top",o[1]=-n;break;case"bottom":l[0]="bottom",o[1]=n}switch(_){case"left":l[1]="right",o[0]=-r;break;case"right":l[1]="left",o[0]=r}return{anchor:l[0]&&l[1]?l.join("-"):l[0]?l[0]:l[1]?l[1]:"center",offset:o}}},34091:function(D,L,t){var b=t(34809),d=b.strTranslate,e=b.strScale,w=t(4173).fX,y=t(62972),_=t(45568),u=t(62203),r=t(30635),n=t(38793),l="map";L.name=l,L.attr="subplot",L.idRoot=l,L.idRegex=L.attrRegex=b.counterRegex(l),L.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},L.layoutAttributes=t(8257),L.supplyLayoutDefaults=t(97446),L.plot=function(o){for(var s=o._fullLayout,c=o.calcdata,h=s._subplots[l],x=0;xp/2){var M=A.split("|").join("
");S.text(M).attr("data-unformatted",M).call(r.convertToTspans,o),T=u.bBox(S.node())}S.attr("transform",d(-3,8-T.height)),v.insert("rect",".static-attribution").attr({x:-T.width-6,y:-T.height-3,width:T.width+6,height:T.height+3,fill:"rgba(255, 255, 255, 0.75)"});var f=1;T.width+6>p&&(f=p/(T.width+6));var E=[h.l+h.w*g.x[1],h.t+h.h*(1-g.y[0])];v.attr("transform",d(E[0],E[1])+e(f))}},L.updateFx=function(o){for(var s=o._fullLayout,c=s._subplots[l],h=0;h0){for(var o=0;o0}function r(n){var l={},o={};switch(n.type){case"circle":b.extendFlat(o,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":b.extendFlat(o,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":b.extendFlat(o,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var s=n.symbol,c=e(s.textposition,s.iconsize);b.extendFlat(l,{"icon-image":s.icon+"-15","icon-size":s.iconsize/10,"text-field":s.text,"text-size":s.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":s.placement}),b.extendFlat(o,{"icon-color":n.color,"text-color":s.textfont.color,"text-opacity":n.opacity});break;case"raster":b.extendFlat(o,{"raster-fade-duration":0,"raster-opacity":n.opacity})}return{layout:l,paint:o}}_.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=u(n)},_.needsNewImage=function(n){return this.subplot.map.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},_.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},_.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},_.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},_.updateImage=function(n){this.subplot.map.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var l=this.findFollowingMapLayerId(this.lookupBelow());l!==null&&this.subplot.map.moveLayer(this.idLayer,l)},_.updateSource=function(n){var l=this.subplot.map;if(l.getSource(this.idSource)&&l.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,u(n)){var o=function(s){var c,h=s.sourcetype,x=s.source,m={type:h};return h==="geojson"?c="data":h==="vector"?c=typeof x=="string"?"url":"tiles":h==="raster"?(c="tiles",m.tileSize=256):h==="image"&&(c="url",m.coordinates=s.coordinates),m[c]=x,s.sourceattribution&&(m.attribution=d(s.sourceattribution)),m}(n);l.addSource(this.idSource,o)}},_.findFollowingMapLayerId=function(n){if(n==="traces")for(var l=this.subplot.getMapLayers(),o=0;o1)for(M=0;M-1&&h(V.originalEvent,f,[M.xaxis],[M.yaxis],M.id,N),j.indexOf("event")>-1&&u.click(f,V.originalEvent)}}},k.updateFx=function(T){var p=this,M=p.map,f=p.gd;if(!p.isStatic){var E,I=T.dragmode;E=function(V,j){j.isRect?(V.range={})[p.id]=[N([j.xmin,j.ymin]),N([j.xmax,j.ymax])]:(V.lassoPoints={})[p.id]=j.map(N)};var B=p.dragOptions;p.dragOptions=d.extendDeep(B||{},{dragmode:T.dragmode,element:p.div,gd:f,plotinfo:{id:p.id,domain:T[p.id].domain,xaxis:p.xaxis,yaxis:p.yaxis,fillRangeItems:E},xaxes:[p.xaxis],yaxes:[p.yaxis],subplot:p.id}),M.off("click",p.onClickInPanHandler),l(I)||n(I)?(M.dragPan.disable(),M.on("zoomstart",p.clearOutline),p.dragOptions.prepFn=function(V,j,$){o(V,j,$,p.dragOptions,I)},_.init(p.dragOptions)):(M.dragPan.enable(),M.off("zoomstart",p.clearOutline),p.div.onmousedown=null,p.div.ontouchstart=null,p.div.removeEventListener("touchstart",p.div._ontouchstart),p.onClickInPanHandler=p.onClickInPanFn(p.dragOptions),M.on("click",p.onClickInPanHandler))}function N(V){var j=p.map.unproject(V);return[j.lng,j.lat]}},k.updateFramework=function(T){var p=T[this.id].domain,M=T._size,f=this.div.style;f.width=M.w*(p.x[1]-p.x[0])+"px",f.height=M.h*(p.y[1]-p.y[0])+"px",f.left=M.l+p.x[0]*M.w+"px",f.top=M.t+(1-p.y[1])*M.h+"px",this.xaxis._offset=M.l+p.x[0]*M.w,this.xaxis._length=M.w*(p.x[1]-p.x[0]),this.yaxis._offset=M.t+(1-p.y[1])*M.h,this.yaxis._length=M.h*(p.y[1]-p.y[0])},k.updateLayers=function(T){var p,M=T[this.id].layers,f=this.layerList;if(M.length!==f.length){for(p=0;pOpenStreetMap contributors',w=['© Carto',e].join(" "),y=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),_={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:e,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:w,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:w,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:y,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:y,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"}},u=b(_);D.exports={requiredVersion:d,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:_,styleValuesNonMapbox:u,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+d+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",u.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` -`),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}},2178:function(D,L,t){var b=t(34809);D.exports=function(d,e){var w=d.split(" "),y=w[0],_=w[1],u=b.isArrayOrTypedArray(e)?b.mean(e):e,r=.5+u/100,n=1.5+u/100,l=["",""],o=[0,0];switch(y){case"top":l[0]="top",o[1]=-n;break;case"bottom":l[0]="bottom",o[1]=n}switch(_){case"left":l[1]="right",o[0]=-r;break;case"right":l[1]="left",o[0]=r}return{anchor:l[0]&&l[1]?l.join("-"):l[0]?l[0]:l[1]?l[1]:"center",offset:o}}},68192:function(D,L,t){var b=t(32280),d=t(34809),e=d.strTranslate,w=d.strScale,y=t(4173).fX,_=t(62972),u=t(45568),r=t(62203),n=t(30635),l=t(5417),o="mapbox",s=L.constants=t(44245);L.name=o,L.attr="subplot",L.idRoot=o,L.idRegex=L.attrRegex=d.counterRegex(o);var c=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/javascript/maplibre-migration/"].join(" ");L.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},L.layoutAttributes=t(67514),L.supplyLayoutDefaults=t(86989);var h=!0;function x(m){return typeof m=="string"&&(s.styleValuesMapbox.indexOf(m)!==-1||m.indexOf("mapbox://")===0||m.indexOf("stamen")===0)}L.plot=function(m){h&&(h=!1,d.warn(c));var g=m._fullLayout,k=m.calcdata,A=g._subplots[o];if(b.version!==s.requiredVersion)throw new Error(s.wrongVersionErrorMsg);var v=function(E,I){var B=E._fullLayout;if(E._context.mapboxAccessToken==="")return"";for(var N=[],V=[],j=!1,$=!1,ee=0;ee1&&d.warn(s.multipleTokensErrorMsg),N[0]):(V.length&&d.log(["Listed mapbox access token(s)",V.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(m,A);b.accessToken=v;for(var S=0;SV/2){var j=E.split("|").join("
");B.text(j).attr("data-unformatted",j).call(n.convertToTspans,m),N=r.bBox(B.node())}B.attr("transform",e(-3,8-N.height)),I.insert("rect",".static-attribution").attr({x:-N.width-6,y:-N.height-3,width:N.width+6,height:N.height+3,fill:"rgba(255, 255, 255, 0.75)"});var $=1;N.width+6>V&&($=V/(N.width+6));var ee=[A.l+A.w*T.x[1],A.t+A.h*(1-T.y[0])];I.attr("transform",e(ee[0],ee[1])+w($))}},L.updateFx=function(m){for(var g=m._fullLayout,k=g._subplots[o],A=0;A0){for(var o=0;o0}function r(n){var l={},o={};switch(n.type){case"circle":b.extendFlat(o,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":b.extendFlat(o,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":b.extendFlat(o,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var s=n.symbol,c=e(s.textposition,s.iconsize);b.extendFlat(l,{"icon-image":s.icon+"-15","icon-size":s.iconsize/10,"text-field":s.text,"text-size":s.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":s.placement}),b.extendFlat(o,{"icon-color":n.color,"text-color":s.textfont.color,"text-opacity":n.opacity});break;case"raster":b.extendFlat(o,{"raster-fade-duration":0,"raster-opacity":n.opacity})}return{layout:l,paint:o}}_.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=u(n)},_.needsNewImage=function(n){return this.subplot.map.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},_.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},_.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},_.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},_.updateImage=function(n){this.subplot.map.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var l=this.findFollowingMapboxLayerId(this.lookupBelow());l!==null&&this.subplot.map.moveLayer(this.idLayer,l)},_.updateSource=function(n){var l=this.subplot.map;if(l.getSource(this.idSource)&&l.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,u(n)){var o=function(s){var c,h=s.sourcetype,x=s.source,m={type:h};return h==="geojson"?c="data":h==="vector"?c=typeof x=="string"?"url":"tiles":h==="raster"?(c="tiles",m.tileSize=256):h==="image"&&(c="url",m.coordinates=s.coordinates),m[c]=x,s.sourceattribution&&(m.attribution=d(s.sourceattribution)),m}(n);l.addSource(this.idSource,o)}},_.findFollowingMapboxLayerId=function(n){if(n==="traces")for(var l=this.subplot.getMapLayers(),o=0;o1)for(f=0;f-1&&h(j.originalEvent,E,[f.xaxis],[f.yaxis],f.id,V),$.indexOf("event")>-1&&u.click(E,j.originalEvent)}}},k.updateFx=function(p){var M=this,f=M.map,E=M.gd;if(!M.isStatic){var I,B=p.dragmode;I=function(j,$){$.isRect?(j.range={})[M.id]=[V([$.xmin,$.ymin]),V([$.xmax,$.ymax])]:(j.lassoPoints={})[M.id]=$.map(V)};var N=M.dragOptions;M.dragOptions=d.extendDeep(N||{},{dragmode:p.dragmode,element:M.div,gd:E,plotinfo:{id:M.id,domain:p[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:I},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),f.off("click",M.onClickInPanHandler),l(B)||n(B)?(f.dragPan.disable(),f.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(j,$,ee){o(j,$,ee,M.dragOptions,B)},_.init(M.dragOptions)):(f.dragPan.enable(),f.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),f.on("click",M.onClickInPanHandler))}function V(j){var $=M.map.unproject(j);return[$.lng,$.lat]}},k.updateFramework=function(p){var M=p[this.id].domain,f=p._size,E=this.div.style;E.width=f.w*(M.x[1]-M.x[0])+"px",E.height=f.h*(M.y[1]-M.y[0])+"px",E.left=f.l+M.x[0]*f.w+"px",E.top=f.t+(1-M.y[1])*f.h+"px",this.xaxis._offset=f.l+M.x[0]*f.w,this.xaxis._length=f.w*(M.x[1]-M.x[0]),this.yaxis._offset=f.t+(1-M.y[1])*f.h,this.yaxis._length=f.h*(M.y[1]-M.y[0])},k.updateLayers=function(p){var M,f=p[this.id].layers,E=this.layerList;if(f.length!==E.length){for(M=0;M=Z.width-20?(se["text-anchor"]="start",se.x=5):(se["text-anchor"]="end",se.x=Z._paper.attr("width")-7),K.attr(se);var he=K.select(".js-link-to-tool"),fe=K.select(".js-link-spacer"),ie=K.select(".js-sourcelinks");Q._context.showSources&&Q._context.showSources(Q),Q._context.showLink&&function(oe,le){le.text("");var ge=le.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(oe._context.linkText+" "+String.fromCharCode(187));if(oe._context.sendData)ge.on("click",function(){v.sendDataToCloud(oe)});else{var ye=window.location.pathname.split("/"),me=window.location.search;ge.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+ye[2].split(".")[0]+"/"+ye[1]+me})}}(Q,he),fe.text(he.text()&&ie.text()?" - ":"")}},v.sendDataToCloud=function(Q){var Z=(window.PLOTLYENV||{}).BASE_URL||Q._context.plotlyServerURL;if(Z){Q.emit("plotly_beforeexport");var K=b.select(Q).append("div").attr("id","hiddenform").style("display","none"),ae=K.append("form").attr({action:Z+"/external",method:"post",target:"_blank"});return ae.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(Q,!1,"keepdata"),ae.node().submit(),K.remove(),Q.emit("plotly_afterexport"),!1}};var p=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function f(Q,Z){var K=Q._context.locale;K||(K="en-US");var ae=!1,se={};function he(ye){for(var me=!0,be=0;be1&&Pe.length>1){for(_.getComponentMethod("grid","sizeDefaults")(fe,he),se=0;se15&&Pe.length>15&&he.shapes.length===0&&he.images.length===0,v.linkSubplots(oe,he,ie,ae),v.cleanPlot(oe,he,ie,ae);var Fe=!(!ae._has||!ae._has("gl2d")),qe=!(!he._has||!he._has("gl2d")),$e=!(!ae._has||!ae._has("cartesian"))||Fe,Ye=!(!he._has||!he._has("cartesian"))||qe;$e&&!Ye?ae._bgLayer.remove():Ye&&!$e&&(he._shouldCreateBgLayer=!0),ae._zoomlayer&&!Q._dragging&&c({_fullLayout:ae}),function(Ge,tt){var nt,pt=[];tt.meta&&(nt=tt._meta={meta:tt.meta,layout:{meta:tt.meta}});for(var At=0;At0){var le=1-2*fe;ae=Math.round(le*ae),se=Math.round(le*se)}}var ge=v.layoutAttributes.width.min,ye=v.layoutAttributes.height.min;ae1,be=!Z.height&&Math.abs(K.height-se)>1;(be||me)&&(me&&(K.width=ae),be&&(K.height=se)),Q._initialAutoSize||(Q._initialAutoSize={width:ae,height:se}),v.sanitizeMargins(K)},v.supplyLayoutModuleDefaults=function(Q,Z,K,ae){var se,he,fe,ie=_.componentsRegistry,oe=Z._basePlotModules,le=_.subplotsRegistry.cartesian;for(se in ie)(fe=ie[se]).includeBasePlot&&fe.includeBasePlot(Q,Z);for(var ge in oe.length||oe.push(le),Z._has("cartesian")&&(_.getComponentMethod("grid","contentDefaults")(Q,Z),le.finalizeSubplots(Q,Z)),Z._subplots)Z._subplots[ge].sort(n.subplotSort);for(he=0;he1&&(K.l/=Ce,K.r/=Ce)}if(me){var Le=(K.t+K.b)/me;Le>1&&(K.t/=Le,K.b/=Le)}var Oe=K.xl!==void 0?K.xl:K.x,We=K.xr!==void 0?K.xr:K.x,Ie=K.yt!==void 0?K.yt:K.y,Ve=K.yb!==void 0?K.yb:K.y;be[Z]={l:{val:Oe,size:K.l+Ee},r:{val:We,size:K.r+Ee},b:{val:Ve,size:K.b+Ee},t:{val:Ie,size:K.t+Ee}},Se[Z]=1}else delete be[Z],delete Se[Z];if(!ae._replotting)return v.doAutoMargin(Q)}},v.doAutoMargin=function(Q){var Z=Q._fullLayout,K=Z.width,ae=Z.height;Z._size||(Z._size={}),V(Z);var se=Z._size,he=Z.margin,fe={t:0,b:0,l:0,r:0},ie=n.extendFlat({},se),oe=he.l,le=he.r,ge=he.t,ye=he.b,me=Z._pushmargin,be=Z._pushmarginIds,Se=Z.minreducedwidth,Ee=Z.minreducedheight;if(he.autoexpand!==!1){for(var Ce in me)be[Ce]||delete me[Ce];var Le=Q._fullLayout._reservedMargin;for(var Oe in Le)for(var We in Le[Oe]){var Ie=Le[Oe][We];fe[We]=Math.max(fe[We],Ie)}for(var Ve in me.base={l:{val:0,size:oe},r:{val:1,size:le},t:{val:1,size:ge},b:{val:0,size:ye}},fe){var Pe=0;for(var de in me)de!=="base"&&w(me[de][Ve].size)&&(Pe=me[de][Ve].size>Pe?me[de][Ve].size:Pe);var Me=Math.max(0,he[Ve]-Pe);fe[Ve]=Math.max(0,fe[Ve]-Me)}for(var ke in me){var He=me[ke].l||{},Fe=me[ke].b||{},qe=He.val,$e=He.size,Ye=Fe.val,_e=Fe.size,De=K-fe.r-fe.l,Be=ae-fe.t-fe.b;for(var Ge in me){if(w($e)&&me[Ge].r){var tt=me[Ge].r.val,nt=me[Ge].r.size;if(tt>qe){var pt=($e*tt+(nt-De)*qe)/(tt-qe),At=(nt*(1-qe)+($e-De)*(1-tt))/(tt-qe);pt+At>oe+le&&(oe=pt,le=At)}}if(w(_e)&&me[Ge].t){var wt=me[Ge].t.val,Nt=me[Ge].t.size;if(wt>Ye){var Ht=(_e*wt+(Nt-Be)*Ye)/(wt-Ye),Gt=(Nt*(1-Ye)+(_e-Be)*(1-wt))/(wt-Ye);Ht+Gt>ye+ge&&(ye=Ht,ge=Gt)}}}}}var st=n.constrain(K-he.l-he.r,2,Se),Qe=n.constrain(ae-he.t-he.b,2,Ee),ft=Math.max(0,K-st),yt=Math.max(0,ae-Qe);if(ft){var Ot=(oe+le)/ft;Ot>1&&(oe/=Ot,le/=Ot)}if(yt){var Pt=(ye+ge)/yt;Pt>1&&(ye/=Pt,ge/=Pt)}if(se.l=Math.round(oe)+fe.l,se.r=Math.round(le)+fe.r,se.t=Math.round(ge)+fe.t,se.b=Math.round(ye)+fe.b,se.p=Math.round(he.pad),se.w=Math.round(K)-se.l-se.r,se.h=Math.round(ae)-se.t-se.b,!Z._replotting&&(v.didMarginChange(ie,se)||function(lt){if("_redrawFromAutoMarginCount"in lt._fullLayout)return!1;var Xe=s.list(lt,"",!0);for(var ut in Xe)if(Xe[ut].autoshift||Xe[ut].shift)return!0;return!1}(Q))){"_redrawFromAutoMarginCount"in Z?Z._redrawFromAutoMarginCount++:Z._redrawFromAutoMarginCount=1;var at=3*(1+Object.keys(be).length);if(Z._redrawFromAutoMarginCount0&&(Q._transitioningWithDuration=!0),Q._transitionData._interruptCallbacks.push(function(){ae=!0}),K.redraw&&Q._transitionData._interruptCallbacks.push(function(){return _.call("redraw",Q)}),Q._transitionData._interruptCallbacks.push(function(){Q.emit("plotly_transitioninterrupted",[])});var ie=0,oe=0;function le(){return ie++,function(){var ge;oe++,ae||oe!==ie||(ge=fe,Q._transitionData&&(function(ye){if(ye)for(;ye.length;)ye.shift()}(Q._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(K.redraw)return _.call("redraw",Q)}).then(function(){Q._transitioning=!1,Q._transitioningWithDuration=!1,Q.emit("plotly_transitioned",[])}).then(ge)))}}K.runFn(le),setTimeout(le())})}],he=n.syncOrAsync(se,Q);return he&&he.then||(he=Promise.resolve()),he.then(function(){return Q})}v.didMarginChange=function(Q,Z){for(var K=0;K1)return!0}return!1},v.graphJson=function(Q,Z,K,ae,se,he){(se&&Z&&!Q._fullData||se&&!Z&&!Q._fullLayout)&&v.supplyDefaults(Q);var fe=se?Q._fullData:Q.data,ie=se?Q._fullLayout:Q.layout,oe=(Q._transitionData||{})._frames;function le(me,be){if(typeof me=="function")return be?"_function_":null;if(n.isPlainObject(me)){var Se,Ee={};return Object.keys(me).sort().forEach(function(We){if(["_","["].indexOf(We.charAt(0))===-1)if(typeof me[We]!="function"){if(K==="keepdata"){if(We.substr(We.length-3)==="src")return}else if(K==="keepstream"){if(typeof(Se=me[We+"src"])=="string"&&Se.indexOf(":")>0&&!n.isPlainObject(me.stream))return}else if(K!=="keepall"&&typeof(Se=me[We+"src"])=="string"&&Se.indexOf(":")>0)return;Ee[We]=le(me[We],be)}else be&&(Ee[We]="_function")}),Ee}var Ce=Array.isArray(me),Le=n.isTypedArray(me);if((Ce||Le)&&me.dtype&&me.shape){var Oe=me.bdata;return le({dtype:me.dtype,shape:me.shape,bdata:n.isArrayBuffer(Oe)?y.encode(Oe):Oe},be)}return Ce?me.map(function(We){return le(We,be)}):Le?n.simpleMap(me,n.identity):n.isJSDate(me)?n.ms2DateTimeLocal(+me):me}var ge={data:(fe||[]).map(function(me){var be=le(me);return Z&&delete be.fit,be})};if(!Z&&(ge.layout=le(ie),se)){var ye=ie._size;ge.layout.computed={margin:{b:ye.b,l:ye.l,r:ye.r,t:ye.t}}}return oe&&(ge.frames=le(oe)),he&&(ge.config=le(Q._context,!0)),ae==="object"?ge:JSON.stringify(ge)},v.modifyFrames=function(Q,Z){var K,ae,se,he=Q._transitionData._frames,fe=Q._transitionData._frameHash;for(K=0;K=0;he--)if(Ve[he].enabled){K._indexToPoints=Ve[he]._indexToPoints;break}ae&&ae.calc&&(Ie=ae.calc(Q,K))}Array.isArray(Ie)&&Ie[0]||(Ie=[{x:o,y:o}]),Ie[0].t||(Ie[0].t={}),Ie[0].trace=K,le[Oe]=Ie}}for(H(fe,ie,oe),se=0;se1e-10?o:0}function l(o,s,c){s=s||0,c=c||0;for(var h=o.length,x=new Array(h),m=0;m0?m:1/0}),h=b.mod(c+1,s.length);return[s[c],s[h]]},findIntersectionXY:u,findXYatLength:function(o,s,c,h){var x=-s*c,m=s*s+1,g=2*(s*x-c),k=x*x+c*c-o*o,A=Math.sqrt(g*g-4*m*k),v=(-g+A)/(2*m),S=(-g-A)/(2*m);return[[v,s*v+x+h],[S,s*S+x+h]]},clampTiny:n,pathPolygon:function(o,s,c,h,x,m){return"M"+l(r(o,s,c,h),x,m).join("L")},pathPolygonAnnulus:function(o,s,c,h,x,m,g){var k,A;o=90||Gt>90&&st>=450?1:ft<=0&&Ot<=0?0:Math.max(ft,Ot),[Gt<=180&&st>=180||Gt>180&&st>=540?-1:Qe>=0&&yt>=0?0:Math.min(Qe,yt),Gt<=270&&st>=270||Gt>270&&st>=630?-1:ft>=0&&Ot>=0?0:Math.min(ft,Ot),st>=360?1:Qe<=0&&yt<=0?0:Math.max(Qe,yt),wt]}(Ce),de=Pe[2]-Pe[0],Me=Pe[3]-Pe[1],ke=Ee/Se,He=Math.abs(Me/de);ke>He?(Le=Se,Ve=(Ee-(Oe=Se*He))/le.h/2,We=[me[0],me[1]],Ie=[be[0]+Ve,be[1]-Ve]):(Oe=Ee,Ve=(Se-(Le=Ee/He))/le.w/2,We=[me[0]+Ve,me[1]-Ve],Ie=[be[0],be[1]]),ie.xLength2=Le,ie.yLength2=Oe,ie.xDomain2=We,ie.yDomain2=Ie;var Fe,qe=ie.xOffset2=le.l+le.w*We[0],$e=ie.yOffset2=le.t+le.h*(1-Ie[1]),Ye=ie.radius=Le/de,_e=ie.innerRadius=ie.getHole(fe)*Ye,De=ie.cx=qe-Ye*Pe[0],Be=ie.cy=$e+Ye*Pe[3],Ge=ie.cxx=De-qe,tt=ie.cyy=Be-$e,nt=ge.side;nt==="counterclockwise"?(Fe=nt,nt="top"):nt==="clockwise"&&(Fe=nt,nt="bottom"),ie.radialAxis=ie.mockAxis(he,fe,ge,{_id:"x",side:nt,_trueSide:Fe,domain:[_e/le.w,Ye/le.w]}),ie.angularAxis=ie.mockAxis(he,fe,ye,{side:"right",domain:[0,Math.PI],autorange:!1}),ie.doAutoRange(he,fe),ie.updateAngularAxis(he,fe),ie.updateRadialAxis(he,fe),ie.updateRadialAxisTitle(he,fe),ie.xaxis=ie.mockCartesianAxis(he,fe,{_id:"x",domain:We}),ie.yaxis=ie.mockCartesianAxis(he,fe,{_id:"y",domain:Ie});var pt=ie.pathSubplot();ie.clipPaths.forTraces.select("path").attr("d",pt).attr("transform",_(Ge,tt)),oe.frontplot.attr("transform",_(qe,$e)).call(r.setClipUrl,ie._hasClipOnAxisFalse?null:ie.clipIds.forTraces,ie.gd),oe.bg.attr("d",pt).attr("transform",_(De,Be)).call(u.fill,fe.bgcolor)},Z.mockAxis=function(he,fe,ie,oe){var le=w.extendFlat({},ie,oe);return s(le,fe,he),le},Z.mockCartesianAxis=function(he,fe,ie){var oe=this,le=oe.isSmith,ge=ie._id,ye=w.extendFlat({type:"linear"},ie);o(ye,he);var me={x:[0,2],y:[1,3]};return ye.setRange=function(){var be=oe.sectorBBox,Se=me[ge],Ee=oe.radialAxis._rl,Ce=(Ee[1]-Ee[0])/(1-oe.getHole(fe));ye.range=[be[Se[0]]*Ce,be[Se[1]]*Ce]},ye.isPtWithinRange=ge!=="x"||le?function(){return!0}:function(be){return oe.isPtInside(be)},ye.setRange(),ye.setScale(),ye},Z.doAutoRange=function(he,fe){var ie=this,oe=ie.gd,le=ie.radialAxis,ge=ie.getRadial(fe);c(oe,le);var ye=le.range;if(ge.range=ye.slice(),ge._input.range=ye.slice(),le._rl=[le.r2l(ye[0],null,"gregorian"),le.r2l(ye[1],null,"gregorian")],le.minallowed!==void 0){var me=le.r2l(le.minallowed);le._rl[0]>le._rl[1]?le._rl[1]=Math.max(le._rl[1],me):le._rl[0]=Math.max(le._rl[0],me)}if(le.maxallowed!==void 0){var be=le.r2l(le.maxallowed);le._rl[0]90&&Ee<=270&&(Ce.tickangle=180);var We=Oe?function($e){var Ye=j(ie,B([$e.x,0]));return _(Ye[0]-me,Ye[1]-be)}:function($e){return _(Ce.l2p($e.x)+ye,0)},Ie=Oe?function($e){return V(ie,$e.x,-1/0,1/0)}:function($e){return ie.pathArc(Ce.r2p($e.x)+ye)},Ve=K(Se);if(ie.radialTickLayout!==Ve&&(le["radial-axis"].selectAll(".xtick").remove(),ie.radialTickLayout=Ve),Le){Ce.setScale();var Pe=0,de=Oe?(Ce.tickvals||[]).filter(function($e){return $e>=0}).map(function($e){return l.tickText(Ce,$e,!0,!1)}):l.calcTicks(Ce),Me=Oe?de:l.clipEnds(Ce,de),ke=l.getTickSigns(Ce)[2];Oe&&((Ce.ticks==="top"&&Ce.side==="bottom"||Ce.ticks==="bottom"&&Ce.side==="top")&&(ke=-ke),Ce.ticks==="top"&&Ce.side==="top"&&(Pe=-Ce.ticklen),Ce.ticks==="bottom"&&Ce.side==="bottom"&&(Pe=Ce.ticklen)),l.drawTicks(oe,Ce,{vals:de,layer:le["radial-axis"],path:l.makeTickPath(Ce,0,ke),transFn:We,crisp:!1}),l.drawGrid(oe,Ce,{vals:Me,layer:le["radial-grid"],path:Ie,transFn:w.noop,crisp:!1}),l.drawLabels(oe,Ce,{vals:de,layer:le["radial-axis"],transFn:We,labelFns:l.makeLabelFns(Ce,Pe)})}var He=ie.radialAxisAngle=ie.vangles?J(ae(H(Se.angle),ie.vangles)):Se.angle,Fe=_(me,be),qe=Fe+y(-He);se(le["radial-axis"],Le&&(Se.showticklabels||Se.ticks),{transform:qe}),se(le["radial-grid"],Le&&Se.showgrid,{transform:Oe?"":Fe}),se(le["radial-line"].select("line"),Le&&Se.showline,{x1:Oe?-ge:ye,y1:0,x2:ge,y2:0,transform:qe}).attr("stroke-width",Se.linewidth).call(u.stroke,Se.linecolor)},Z.updateRadialAxisTitle=function(he,fe,ie){if(!this.isSmith){var oe=this,le=oe.gd,ge=oe.radius,ye=oe.cx,me=oe.cy,be=oe.getRadial(fe),Se=oe.id+"title",Ee=0;if(be.title){var Ce=r.bBox(oe.layers["radial-axis"].node()).height,Le=be.title.font.size,Oe=be.side;Ee=Oe==="top"?Le:Oe==="counterclockwise"?-(Ce+.4*Le):Ce+.8*Le}var We=ie!==void 0?ie:oe.radialAxisAngle,Ie=H(We),Ve=Math.cos(Ie),Pe=Math.sin(Ie),de=ye+ge/2*Ve+Ee*Pe,Me=me-ge/2*Pe+Ee*Ve;oe.layers["radial-axis-title"]=g.draw(le,Se,{propContainer:be,propName:oe.id+".radialaxis.title",placeholder:$(le,"Click to enter radial axis title"),attributes:{x:de,y:Me,"text-anchor":"middle"},transform:{rotate:-We}})}},Z.updateAngularAxis=function(he,fe){var ie=this,oe=ie.gd,le=ie.layers,ge=ie.radius,ye=ie.innerRadius,me=ie.cx,be=ie.cy,Se=ie.getAngular(fe),Ee=ie.angularAxis,Ce=ie.isSmith;Ce||(ie.fillViewInitialKey("angularaxis.rotation",Se.rotation),Ee.setGeometry(),Ee.setScale());var Le=Ce?function($e){var Ye=j(ie,B([0,$e.x]));return Math.atan2(Ye[0]-me,Ye[1]-be)-Math.PI/2}:function($e){return Ee.t2g($e.x)};Ee.type==="linear"&&Ee.thetaunit==="radians"&&(Ee.tick0=J(Ee.tick0),Ee.dtick=J(Ee.dtick));var Oe=function($e){return _(me+ge*Math.cos($e),be-ge*Math.sin($e))},We=Ce?function($e){var Ye=j(ie,B([0,$e.x]));return _(Ye[0],Ye[1])}:function($e){return Oe(Le($e))},Ie=Ce?function($e){var Ye=j(ie,B([0,$e.x])),_e=Math.atan2(Ye[0]-me,Ye[1]-be)-Math.PI/2;return _(Ye[0],Ye[1])+y(-J(_e))}:function($e){var Ye=Le($e);return Oe(Ye)+y(-J(Ye))},Ve=Ce?function($e){return N(ie,$e.x,0,1/0)}:function($e){var Ye=Le($e),_e=Math.cos(Ye),De=Math.sin(Ye);return"M"+[me+ye*_e,be-ye*De]+"L"+[me+ge*_e,be-ge*De]},Pe=l.makeLabelFns(Ee,0).labelStandoff,de={xFn:function($e){var Ye=Le($e);return Math.cos(Ye)*Pe},yFn:function($e){var Ye=Le($e),_e=Math.sin(Ye)>0?.2:1;return-Math.sin(Ye)*(Pe+$e.fontSize*_e)+Math.abs(Math.cos(Ye))*($e.fontSize*M)},anchorFn:function($e){var Ye=Le($e),_e=Math.cos(Ye);return Math.abs(_e)<.1?"middle":_e>0?"start":"end"},heightFn:function($e,Ye,_e){var De=Le($e);return-.5*(1+Math.sin(De))*_e}},Me=K(Se);ie.angularTickLayout!==Me&&(le["angular-axis"].selectAll("."+Ee._id+"tick").remove(),ie.angularTickLayout=Me);var ke,He=Ce?[1/0].concat(Ee.tickvals||[]).map(function($e){return l.tickText(Ee,$e,!0,!1)}):l.calcTicks(Ee);if(Ce&&(He[0].text="∞",He[0].fontSize*=1.75),fe.gridshape==="linear"?(ke=He.map(Le),w.angleDelta(ke[0],ke[1])<0&&(ke=ke.slice().reverse())):ke=null,ie.vangles=ke,Ee.type==="category"&&(He=He.filter(function($e){return w.isAngleInsideSector(Le($e),ie.sectorInRad)})),Ee.visible){var Fe=Ee.ticks==="inside"?-1:1,qe=(Ee.linewidth||1)/2;l.drawTicks(oe,Ee,{vals:He,layer:le["angular-axis"],path:"M"+Fe*qe+",0h"+Fe*Ee.ticklen,transFn:Ie,crisp:!1}),l.drawGrid(oe,Ee,{vals:He,layer:le["angular-grid"],path:Ve,transFn:w.noop,crisp:!1}),l.drawLabels(oe,Ee,{vals:He,layer:le["angular-axis"],repositionOnUpdate:!0,transFn:We,labelFns:de})}se(le["angular-line"].select("path"),Se.showline,{d:ie.pathSubplot(),transform:_(me,be)}).attr("stroke-width",Se.linewidth).call(u.stroke,Se.linecolor)},Z.updateFx=function(he,fe){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(he),this.updateRadialDrag(he,fe,0),this.updateRadialDrag(he,fe,1)),this.updateHoverAndMainDrag(he))},Z.updateHoverAndMainDrag=function(he){var fe,ie,oe=this,le=oe.isSmith,ge=oe.gd,ye=oe.layers,me=he._zoomlayer,be=f.MINZOOM,Se=f.OFFEDGE,Ee=oe.radius,Ce=oe.innerRadius,Le=oe.cx,Oe=oe.cy,We=oe.cxx,Ie=oe.cyy,Ve=oe.sectorInRad,Pe=oe.vangles,de=oe.radialAxis,Me=E.clampTiny,ke=E.findXYatLength,He=E.findEnclosingVertexAngles,Fe=f.cornerHalfWidth,qe=f.cornerLen/2,$e=h.makeDragger(ye,"path","maindrag",he.dragmode===!1?"none":"crosshair");b.select($e).attr("d",oe.pathSubplot()).attr("transform",_(Le,Oe)),$e.onmousemove=function(vt){m.hover(ge,vt,oe.id),ge._fullLayout._lasthover=$e,ge._fullLayout._hoversubplot=oe.id},$e.onmouseout=function(vt){ge._dragging||x.unhover(ge,vt)};var Ye,_e,De,Be,Ge,tt,nt,pt,At,wt={element:$e,gd:ge,subplot:oe.id,plotinfo:{id:oe.id,xaxis:oe.xaxis,yaxis:oe.yaxis},xaxes:[oe.xaxis],yaxes:[oe.yaxis]};function Nt(vt,Lt){return Math.sqrt(vt*vt+Lt*Lt)}function Ht(vt,Lt){return Nt(vt-We,Lt-Ie)}function Gt(vt,Lt){return Math.atan2(Ie-Lt,vt-We)}function st(vt,Lt){return[vt*Math.cos(Lt),vt*Math.sin(-Lt)]}function Qe(vt,Lt){if(vt===0)return oe.pathSector(2*Fe);var Ut=qe/vt,rt=Lt-Ut,et=Lt+Ut,Et=Math.max(0,Math.min(vt,Ee)),Bt=Et-Fe,Ft=Et+Fe;return"M"+st(Bt,rt)+"A"+[Bt,Bt]+" 0,0,0 "+st(Bt,et)+"L"+st(Ft,et)+"A"+[Ft,Ft]+" 0,0,1 "+st(Ft,rt)+"Z"}function ft(vt,Lt,Ut){if(vt===0)return oe.pathSector(2*Fe);var rt,et,Et=st(vt,Lt),Bt=st(vt,Ut),Ft=Me((Et[0]+Bt[0])/2),St=Me((Et[1]+Bt[1])/2);if(Ft&&St){var Jt=St/Ft,qt=-1/Jt,en=ke(Fe,Jt,Ft,St);rt=ke(qe,qt,en[0][0],en[0][1]),et=ke(qe,qt,en[1][0],en[1][1])}else{var Wt,Zt;St?(Wt=qe,Zt=Fe):(Wt=Fe,Zt=qe),rt=[[Ft-Wt,St-Zt],[Ft+Wt,St-Zt]],et=[[Ft-Wt,St+Zt],[Ft+Wt,St+Zt]]}return"M"+rt.join("L")+"L"+et.reverse().join("L")+"Z"}function yt(vt,Lt){return Lt=Math.max(Math.min(Lt,Ee),Ce),vtbe?(vt-1&&vt===1&&A(Lt,ge,[oe.xaxis],[oe.yaxis],oe.id,wt),Ut.indexOf("event")>-1&&m.click(ge,Lt,oe.id)}wt.prepFn=function(vt,Lt,Ut){var rt=ge._fullLayout.dragmode,et=$e.getBoundingClientRect();ge._fullLayout._calcInverseTransform(ge);var Et=ge._fullLayout._invTransform;fe=ge._fullLayout._invScaleX,ie=ge._fullLayout._invScaleY;var Bt=w.apply3DTransform(Et)(Lt-et.left,Ut-et.top);if(Ye=Bt[0],_e=Bt[1],Pe){var Ft=E.findPolygonOffset(Ee,Ve[0],Ve[1],Pe);Ye+=We+Ft[0],_e+=Ie+Ft[1]}switch(rt){case"zoom":wt.clickFn=Tt,le||(wt.moveFn=Pe?lt:Pt,wt.doneFn=Xe,function(){De=null,Be=null,Ge=oe.pathSubplot(),tt=!1;var St=ge._fullLayout[oe.id];nt=d(St.bgcolor).getLuminance(),(pt=h.makeZoombox(me,nt,Le,Oe,Ge)).attr("fill-rule","evenodd"),At=h.makeCorners(me,Le,Oe),v(ge)}());break;case"select":case"lasso":k(vt,Lt,Ut,wt,rt)}},x.init(wt)},Z.updateRadialDrag=function(he,fe,ie){var oe=this,le=oe.gd,ge=oe.layers,ye=oe.radius,me=oe.innerRadius,be=oe.cx,Se=oe.cy,Ee=oe.radialAxis,Ce=f.radialDragBoxSize,Le=Ce/2;if(Ee.visible){var Oe,We,Ie,Ve=H(oe.radialAxisAngle),Pe=Ee._rl,de=Pe[0],Me=Pe[1],ke=Pe[ie],He=.75*(Pe[1]-Pe[0])/(1-oe.getHole(fe))/ye;ie?(Oe=be+(ye+Le)*Math.cos(Ve),We=Se-(ye+Le)*Math.sin(Ve),Ie="radialdrag"):(Oe=be+(me-Le)*Math.cos(Ve),We=Se-(me-Le)*Math.sin(Ve),Ie="radialdrag-inner");var Fe,qe,$e,Ye=h.makeRectDragger(ge,Ie,"crosshair",-Le,-Le,Ce,Ce),_e={element:Ye,gd:le};he.dragmode===!1&&(_e.dragmode=!1),se(b.select(Ye),Ee.visible&&me0==(ie?$e>de:$es?function(g){return g<=0}:function(g){return g>=0};r.c2g=function(g){var k=r.c2l(g)-o;return(m(k)?k:0)+x},r.g2c=function(g){return r.l2c(g+o-x)},r.g2p=function(g){return g*h},r.c2p=function(g){return r.g2p(r.c2g(g))}}})(y,_);break;case"angularaxis":(function(r,n){var l=r.type;if(l==="linear"){var o=r.d2c,s=r.c2d;r.d2c=function(c,h){return function(x,m){return m==="degrees"?e(x):x}(o(c),h)},r.c2d=function(c,h){return s(function(x,m){return m==="degrees"?w(x):x}(c,h))}}r.makeCalcdata=function(c,h){var x,m,g=c[h],k=c._length,A=function(M){return r.d2c(M,c.thetaunit)};if(g)for(x=new Array(k),m=0;m0?1:0}function t(e){var w=e[0],y=e[1];if(!isFinite(w)||!isFinite(y))return[1,0];var _=(w+1)*(w+1)+y*y;return[(w*w+y*y-1)/_,2*y/_]}function b(e,w){var y=w[0],_=w[1];return[y*e.radius+e.cx,-_*e.radius+e.cy]}function d(e,w){return w*e.radius}D.exports={smith:t,reactanceArc:function(e,w,y,_){var u=b(e,t([y,w])),r=u[0],n=u[1],l=b(e,t([_,w])),o=l[0],s=l[1];if(w===0)return["M"+r+","+n,"L"+o+","+s].join(" ");var c=d(e,1/Math.abs(w));return["M"+r+","+n,"A"+c+","+c+" 0 0,"+(w<0?1:0)+" "+o+","+s].join(" ")},resistanceArc:function(e,w,y,_){var u=d(e,1/(w+1)),r=b(e,t([w,y])),n=r[0],l=r[1],o=b(e,t([w,_])),s=o[0],c=o[1];if(L(y)!==L(_)){var h=b(e,t([w,0]));return["M"+n+","+l,"A"+u+","+u+" 0 0,"+(00){for(var _=[],u=0;u=T&&(M.min=0,f.min=0,E.min=0,h.aaxis&&delete h.aaxis.min,h.baxis&&delete h.baxis.min,h.caxis&&delete h.caxis.min)}function c(h,x,m,g){var k=l[x._name];function A(f,E){return e.coerce(h,x,k,f,E)}A("uirevision",g.uirevision),x.type="linear";var v=A("color"),S=v!==k.color.dflt?v:m.font.color,T=x._name.charAt(0).toUpperCase(),p="Component "+T,M=A("title.text",p);x._hovertitle=M===p?M:T,e.coerceFont(A,"title.font",m.font,{overrideDflt:{size:e.bigFont(m.font.size),color:S}}),A("min"),r(h,x,A,"linear"),_(h,x,A,"linear"),y(h,x,A,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),u(h,x,A,{outerTicks:!0}),A("showticklabels")&&(e.coerceFont(A,"tickfont",m.font,{overrideDflt:{color:S}}),A("tickangle"),A("tickformat")),n(h,x,A,{dfltColor:v,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:k}),A("hoverformat"),A("layer")}D.exports=function(h,x,m){w(h,x,m,{type:"ternary",attributes:l,handleDefaults:s,font:x.font,paper_bgcolor:x.paper_bgcolor})}},83637:function(D,L,t){var b=t(45568),d=t(65657),e=t(33626),w=t(34809),y=w.strTranslate,_=w._,u=t(78766),r=t(62203),n=t(19091),l=t(93049).extendFlat,o=t(44122),s=t(29714),c=t(14751),h=t(32141),x=t(70414),m=x.freeMode,g=x.rectMode,k=t(17240),A=t(44844).prepSelect,v=t(44844).selectOnClick,S=t(44844).clearOutline,T=t(44844).clearSelectionsCache,p=t(54826);function M(ee,H){this.id=ee.id,this.graphDiv=ee.graphDiv,this.init(H),this.makeFramework(H),this.updateFx(H),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}D.exports=M;var f=M.prototype;f.init=function(ee){this.container=ee._ternarylayer,this.defs=ee._defs,this.layoutId=ee._uid,this.traceHash={},this.layers={}},f.plot=function(ee,H){var J=this,Q=H[J.id],Z=H._size;J._hasClipOnAxisFalse=!1;for(var K=0;KE*me?Z=(K=me)*E:K=(Z=ye)/E,ae=le*Z/ye,se=ge*K/me,J=H.l+H.w*ie-Z/2,Q=H.t+H.h*(1-oe)-K/2,he.x0=J,he.y0=Q,he.w=Z,he.h=K,he.sum=be,he.xaxis={type:"linear",range:[Se+2*Ce-be,be-Se-2*Ee],domain:[ie-ae/2,ie+ae/2],_id:"x"},n(he.xaxis,he.graphDiv._fullLayout),he.xaxis.setScale(),he.xaxis.isPtWithinRange=function(Fe){return Fe.a>=he.aaxis.range[0]&&Fe.a<=he.aaxis.range[1]&&Fe.b>=he.baxis.range[1]&&Fe.b<=he.baxis.range[0]&&Fe.c>=he.caxis.range[1]&&Fe.c<=he.caxis.range[0]},he.yaxis={type:"linear",range:[Se,be-Ee-Ce],domain:[oe-se/2,oe+se/2],_id:"y"},n(he.yaxis,he.graphDiv._fullLayout),he.yaxis.setScale(),he.yaxis.isPtWithinRange=function(){return!0};var Le=he.yaxis.domain[0],Oe=he.aaxis=l({},ee.aaxis,{range:[Se,be-Ee-Ce],side:"left",tickangle:(+ee.aaxis.tickangle||0)-30,domain:[Le,Le+se*E],anchor:"free",position:0,_id:"y",_length:Z});n(Oe,he.graphDiv._fullLayout),Oe.setScale();var We=he.baxis=l({},ee.baxis,{range:[be-Se-Ce,Ee],side:"bottom",domain:he.xaxis.domain,anchor:"free",position:0,_id:"x",_length:Z});n(We,he.graphDiv._fullLayout),We.setScale();var Ie=he.caxis=l({},ee.caxis,{range:[be-Se-Ee,Ce],side:"right",tickangle:(+ee.caxis.tickangle||0)+30,domain:[Le,Le+se*E],anchor:"free",position:0,_id:"y",_length:Z});n(Ie,he.graphDiv._fullLayout),Ie.setScale();var Ve="M"+J+","+(Q+K)+"h"+Z+"l-"+Z/2+",-"+K+"Z";he.clipDef.select("path").attr("d",Ve),he.layers.plotbg.select("path").attr("d",Ve);var Pe="M0,"+K+"h"+Z+"l-"+Z/2+",-"+K+"Z";he.clipDefRelative.select("path").attr("d",Pe);var de=y(J,Q);he.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",de),he.clipDefRelative.select("path").attr("transform",null);var Me=y(J-We._offset,Q+K);he.layers.baxis.attr("transform",Me),he.layers.bgrid.attr("transform",Me);var ke=y(J+Z/2,Q)+"rotate(30)"+y(0,-Oe._offset);he.layers.aaxis.attr("transform",ke),he.layers.agrid.attr("transform",ke);var He=y(J+Z/2,Q)+"rotate(-30)"+y(0,-Ie._offset);he.layers.caxis.attr("transform",He),he.layers.cgrid.attr("transform",He),he.drawAxes(!0),he.layers.aline.select("path").attr("d",Oe.showline?"M"+J+","+(Q+K)+"l"+Z/2+",-"+K:"M0,0").call(u.stroke,Oe.linecolor||"#000").style("stroke-width",(Oe.linewidth||0)+"px"),he.layers.bline.select("path").attr("d",We.showline?"M"+J+","+(Q+K)+"h"+Z:"M0,0").call(u.stroke,We.linecolor||"#000").style("stroke-width",(We.linewidth||0)+"px"),he.layers.cline.select("path").attr("d",Ie.showline?"M"+(J+Z/2)+","+Q+"l"+Z/2+","+K:"M0,0").call(u.stroke,Ie.linecolor||"#000").style("stroke-width",(Ie.linewidth||0)+"px"),he.graphDiv._context.staticPlot||he.initInteractions(),r.setClipUrl(he.layers.frontplot,he._hasClipOnAxisFalse?null:he.clipId,he.graphDiv)},f.drawAxes=function(ee){var H=this,J=H.graphDiv,Q=H.id.substr(7)+"title",Z=H.layers,K=H.aaxis,ae=H.baxis,se=H.caxis;if(H.drawAx(K),H.drawAx(ae),H.drawAx(se),ee){var he=Math.max(K.showticklabels?K.tickfont.size/2:0,(se.showticklabels?.75*se.tickfont.size:0)+(se.ticks==="outside"?.87*se.ticklen:0)),fe=(ae.showticklabels?ae.tickfont.size:0)+(ae.ticks==="outside"?ae.ticklen:0)+3;Z["a-title"]=k.draw(J,"a"+Q,{propContainer:K,propName:H.id+".aaxis.title",placeholder:_(J,"Click to enter Component A title"),attributes:{x:H.x0+H.w/2,y:H.y0-K.title.font.size/3-he,"text-anchor":"middle"}}),Z["b-title"]=k.draw(J,"b"+Q,{propContainer:ae,propName:H.id+".baxis.title",placeholder:_(J,"Click to enter Component B title"),attributes:{x:H.x0-fe,y:H.y0+H.h+.83*ae.title.font.size+fe,"text-anchor":"middle"}}),Z["c-title"]=k.draw(J,"c"+Q,{propContainer:se,propName:H.id+".caxis.title",placeholder:_(J,"Click to enter Component C title"),attributes:{x:H.x0+H.w+fe,y:H.y0+H.h+.83*se.title.font.size+fe,"text-anchor":"middle"}})}},f.drawAx=function(ee){var H,J=this,Q=J.graphDiv,Z=ee._name,K=Z.charAt(0),ae=ee._id,se=J.layers[Z],he=K+"tickLayout",fe=(H=ee).ticks+String(H.ticklen)+String(H.showticklabels);J[he]!==fe&&(se.selectAll("."+ae+"tick").remove(),J[he]=fe),ee.setScale();var ie=s.calcTicks(ee),oe=s.clipEnds(ee,ie),le=s.makeTransTickFn(ee),ge=s.getTickSigns(ee)[2],ye=w.deg2rad(30),me=ge*(ee.linewidth||1)/2,be=ge*ee.ticklen,Se=J.w,Ee=J.h,Ce=K==="b"?"M0,"+me+"l"+Math.sin(ye)*be+","+Math.cos(ye)*be:"M"+me+",0l"+Math.cos(ye)*be+","+-Math.sin(ye)*be,Le={a:"M0,0l"+Ee+",-"+Se/2,b:"M0,0l-"+Se/2+",-"+Ee,c:"M0,0l-"+Ee+","+Se/2}[K];s.drawTicks(Q,ee,{vals:ee.ticks==="inside"?oe:ie,layer:se,path:Ce,transFn:le,crisp:!1}),s.drawGrid(Q,ee,{vals:oe,layer:J.layers[K+"grid"],path:Le,transFn:le,crisp:!1}),s.drawLabels(Q,ee,{vals:ie,layer:se,transFn:le,labelFns:s.makeLabelFns(ee,0,30)})};var I=p.MINZOOM/2+.87,B="m-0.87,.5h"+I+"v3h-"+(I+5.2)+"l"+(I/2+2.6)+",-"+(.87*I+4.5)+"l2.6,1.5l-"+I/2+","+.87*I+"Z",N="m0.87,.5h-"+I+"v3h"+(I+5.2)+"l-"+(I/2+2.6)+",-"+(.87*I+4.5)+"l-2.6,1.5l"+I/2+","+.87*I+"Z",V="m0,1l"+I/2+","+.87*I+"l2.6,-1.5l-"+(I/2+2.6)+",-"+(.87*I+4.5)+"l-"+(I/2+2.6)+","+(.87*I+4.5)+"l2.6,1.5l"+I/2+",-"+.87*I+"Z",j=!0;function $(ee){b.select(ee).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}f.clearOutline=function(){T(this.dragOptions),S(this.dragOptions.gd)},f.initInteractions=function(){var ee,H,J,Q,Z,K,ae,se,he,fe,ie,oe,le=this,ge=le.layers.plotbg.select("path").node(),ye=le.graphDiv,me=ye._fullLayout._zoomlayer;function be(Pe){var de={};return de[le.id+".aaxis.min"]=Pe.a,de[le.id+".baxis.min"]=Pe.b,de[le.id+".caxis.min"]=Pe.c,de}function Se(Pe,de){var Me=ye._fullLayout.clickmode;$(ye),Pe===2&&(ye.emit("plotly_doubleclick",null),e.call("_guiRelayout",ye,be({a:0,b:0,c:0}))),Me.indexOf("select")>-1&&Pe===1&&v(de,ye,[le.xaxis],[le.yaxis],le.id,le.dragOptions),Me.indexOf("event")>-1&&h.click(ye,de,le.id)}function Ee(Pe,de){return 1-de/le.h}function Ce(Pe,de){return 1-(Pe+(le.h-de)/Math.sqrt(3))/le.w}function Le(Pe,de){return(Pe-(le.h-de)/Math.sqrt(3))/le.w}function Oe(Pe,de){var Me=J+Pe*ee,ke=Q+de*H,He=Math.max(0,Math.min(1,Ee(0,Q),Ee(0,ke))),Fe=Math.max(0,Math.min(1,Ce(J,Q),Ce(Me,ke))),qe=Math.max(0,Math.min(1,Le(J,Q),Le(Me,ke))),$e=(He/2+qe)*le.w,Ye=(1-He/2-Fe)*le.w,_e=($e+Ye)/2,De=Ye-$e,Be=(1-He)*le.h,Ge=Be-De/E;De.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),oe.transition().style("opacity",1).duration(200),fe=!0),ye.emit("plotly_relayouting",be(ae))}function We(){$(ye),ae!==Z&&(e.call("_guiRelayout",ye,be(ae)),j&&ye.data&&ye._context.showTips&&(w.notifier(_(ye,"Double-click to zoom back out"),"long"),j=!1))}function Ie(Pe,de){var Me=Pe/le.xaxis._m,ke=de/le.yaxis._m,He=[(ae={a:Z.a-ke,b:Z.b+(Me+ke)/2,c:Z.c-(Me-ke)/2}).a,ae.b,ae.c].sort(w.sorterAsc),Fe=He.indexOf(ae.a),qe=He.indexOf(ae.b),$e=He.indexOf(ae.c);He[0]<0&&(He[1]+He[0]/2<0?(He[2]+=He[0]+He[1],He[0]=He[1]=0):(He[2]+=He[0]/2,He[1]+=He[0]/2,He[0]=0),ae={a:He[Fe],b:He[qe],c:He[$e]},de=(Z.a-ae.a)*le.yaxis._m,Pe=(Z.c-ae.c-Z.b+ae.b)*le.xaxis._m);var Ye=y(le.x0+Pe,le.y0+de);le.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Ye);var _e=y(-Pe,-de);le.clipDefRelative.select("path").attr("transform",_e),le.aaxis.range=[ae.a,le.sum-ae.b-ae.c],le.baxis.range=[le.sum-ae.a-ae.c,ae.b],le.caxis.range=[le.sum-ae.a-ae.b,ae.c],le.drawAxes(!1),le._hasClipOnAxisFalse&&le.plotContainer.select(".scatterlayer").selectAll(".trace").call(r.hideOutsideRangePoints,le),ye.emit("plotly_relayouting",be(ae))}function Ve(){e.call("_guiRelayout",ye,be(ae))}this.dragOptions={element:ge,gd:ye,plotinfo:{id:le.id,domain:ye._fullLayout[le.id].domain,xaxis:le.xaxis,yaxis:le.yaxis},subplot:le.id,prepFn:function(Pe,de,Me){le.dragOptions.xaxes=[le.xaxis],le.dragOptions.yaxes=[le.yaxis],ee=ye._fullLayout._invScaleX,H=ye._fullLayout._invScaleY;var ke=le.dragOptions.dragmode=ye._fullLayout.dragmode;m(ke)?le.dragOptions.minDrag=1:le.dragOptions.minDrag=void 0,ke==="zoom"?(le.dragOptions.moveFn=Oe,le.dragOptions.clickFn=Se,le.dragOptions.doneFn=We,function(He,Fe,qe){var $e=ge.getBoundingClientRect();J=Fe-$e.left,Q=qe-$e.top,ye._fullLayout._calcInverseTransform(ye);var Ye=ye._fullLayout._invTransform,_e=w.apply3DTransform(Ye)(J,Q);J=_e[0],Q=_e[1],Z={a:le.aaxis.range[0],b:le.baxis.range[1],c:le.caxis.range[1]},ae=Z,K=le.aaxis.range[1]-Z.a,se=d(le.graphDiv._fullLayout[le.id].bgcolor).getLuminance(),he="M0,"+le.h+"L"+le.w/2+", 0L"+le.w+","+le.h+"Z",fe=!1,ie=me.append("path").attr("class","zoombox").attr("transform",y(le.x0,le.y0)).style({fill:se>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",he),oe=me.append("path").attr("class","zoombox-corners").attr("transform",y(le.x0,le.y0)).style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),le.clearOutline(ye)}(0,de,Me)):ke==="pan"?(le.dragOptions.moveFn=Ie,le.dragOptions.clickFn=Se,le.dragOptions.doneFn=Ve,Z={a:le.aaxis.range[0],b:le.baxis.range[1],c:le.caxis.range[1]},ae=Z,le.clearOutline(ye)):(g(ke)||m(ke))&&A(Pe,de,Me,le.dragOptions,ke)}},ge.onmousemove=function(Pe){h.hover(ye,Pe,le.id),ye._fullLayout._lasthover=ge,ye._fullLayout._hoversubplot=le.id},ge.onmouseout=function(Pe){ye._dragging||c.unhover(ye,Pe)},c.init(this.dragOptions)}},33626:function(D,L,t){var b=t(48636),d=t(4969),e=t(36539),w=t(56174),y=t(95425).addStyleRule,_=t(93049),u=t(9829),r=t(6704),n=_.extendFlat,l=_.extendDeepAll;function o(v){var S=v.name,T=v.categories,p=v.meta;if(L.modules[S])b.log("Type "+S+" already registered");else{L.subplotsRegistry[v.basePlotModule.name]||function(j){var $=j.name;if(L.subplotsRegistry[$])b.log("Plot type "+$+" already registered.");else for(var ee in x(j),L.subplotsRegistry[$]=j,L.componentsRegistry)k(ee,j.name)}(v.basePlotModule);for(var M={},f=0;f-1&&(c[x[r]].title={text:""});for(r=0;r")!==-1?"":f.html(I).text()});return f.remove(),E}(p)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(r,"'"),d.isIE()&&(p=(p=(p=p.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),p}},35374:function(D,L,t){var b=t(34809);D.exports=function(d,e){for(var w=0;wE+M||!b(f))}for(var B=0;B=0)return c}else if(typeof c=="string"&&(c=c.trim()).slice(-1)==="%"&&b(c.slice(0,-1))&&(c=+c.slice(0,-1))>=0)return c+"%"}function s(c,h,x,m,g,k){var A=(k=k||{}).moduleHasSelected!==!1,v=k.moduleHasUnselected!==!1,S=k.moduleHasConstrain!==!1,T=k.moduleHasCliponaxis!==!1,p=k.moduleHasTextangle!==!1,M=k.moduleHasInsideanchor!==!1,f=!!k.hasPathbar,E=Array.isArray(g)||g==="auto",I=E||g==="inside",B=E||g==="outside";if(I||B){var N=l(m,"textfont",x.font),V=d.extendFlat({},N),j=!(c.textfont&&c.textfont.color);if(j&&delete V.color,l(m,"insidetextfont",V),f){var $=d.extendFlat({},N);j&&delete $.color,l(m,"pathbar.textfont",$)}B&&l(m,"outsidetextfont",N),A&&m("selected.textfont.color"),v&&m("unselected.textfont.color"),S&&m("constraintext"),T&&m("cliponaxis"),p&&m("textangle"),m("texttemplate")}I&&M&&m("insidetextanchor")}D.exports={supplyDefaults:function(c,h,x,m){function g(S,T){return d.coerce(c,h,n,S,T)}if(y(c,h,m,g)){_(c,h,m,g),g("xhoverformat"),g("yhoverformat"),g("zorder"),g("orientation",h.x&&!h.y?"h":"v"),g("base"),g("offset"),g("width"),g("text"),g("hovertext"),g("hovertemplate");var k=g("textposition");s(c,0,m,g,k,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u(c,h,g,x,m);var A=(h.marker.line||{}).color,v=w.getComponentMethod("errorbars","supplyDefaults");v(c,h,A||e.defaultLine,{axis:"y"}),v(c,h,A||e.defaultLine,{axis:"x",inherit:"y"}),d.coerceSelectionMarkerOpacity(h,g)}else h.visible=!1},crossTraceDefaults:function(c,h){var x,m;function g(v,S){return d.coerce(m._input,m,n,v,S)}for(var k=0;kr))return y}return _!==void 0?_:w.dflt},L.coerceColor=function(w,y,_){return d(y).isValid()?y:_!==void 0?_:w.dflt},L.coerceEnumerated=function(w,y,_){return w.coerceNumber&&(y=+y),w.values.indexOf(y)!==-1?y:_!==void 0?_:w.dflt},L.getValue=function(w,y){var _;return e(w)?y0?be+=Se:m<0&&(be-=Se)}return be}function se(me){var be=m,Se=me.b,Ee=ae(me);return b.inbox(Se-be,Ee-be,I+(Ee-be)/(Ee-Se)-1)}var he=l[g+"a"],fe=l[k+"a"];S=Math.abs(he.r2c(he.range[1])-he.r2c(he.range[0]));var ie=b.getDistanceFunction(c,A,v,function(me){return(A(me)+v(me))/2});if(b.getClosest(T,ie,l),l.index!==!1&&T[l.index].p!==u){V||(J=function(me){return Math.min(j(me),me.p-M.bargroupwidth/2)},Q=function(me){return Math.max($(me),me.p+M.bargroupwidth/2)});var oe=T[l.index],le=p.base?oe.b+oe.s:oe.s;l[k+"0"]=l[k+"1"]=fe.c2p(oe[k],!0),l[k+"LabelVal"]=le;var ge=M.extents[M.extents.round(oe.p)];l[g+"0"]=he.c2p(f?J(oe):ge[0],!0),l[g+"1"]=he.c2p(f?Q(oe):ge[1],!0);var ye=oe.orig_p!==void 0;return l[g+"LabelVal"]=ye?oe.orig_p:oe.p,l.labelLabel=_(he,l[g+"LabelVal"],p[g+"hoverformat"]),l.valueLabel=_(fe,l[k+"LabelVal"],p[k+"hoverformat"]),l.baseLabel=_(fe,oe.b,p[k+"hoverformat"]),l.spikeDistance=(function(me){var be=m,Se=me.b,Ee=ae(me);return b.inbox(Se-be,Ee-be,B+(Ee-be)/(Ee-Se)-1)}(oe)+function(me){return Z(j(me),$(me),B)}(oe))/2,l[g+"Spike"]=he.c2p(oe.p,!0),w(oe,p,l),l.hovertemplate=p.hovertemplate,l}}function n(l,o){var s=o.mcc||l.marker.color,c=o.mlcc||l.marker.line.color,h=y(l,o);return e.opacity(s)?s:e.opacity(c)&&h?c:void 0}D.exports={hoverPoints:function(l,o,s,c,h){var x=r(l,o,s,c,h);if(x){var m=x.cd,g=m[0].trace,k=m[x.index];return x.color=n(g,k),d.getComponentMethod("errorbars","hoverInfo")(k,g,x),[x]}},hoverOnBars:r,getTraceColor:n}},58218:function(D,L,t){D.exports={attributes:t(81481),layoutAttributes:t(25412),supplyDefaults:t(17550).supplyDefaults,crossTraceDefaults:t(17550).crossTraceDefaults,supplyLayoutDefaults:t(78931),calc:t(67565),crossTraceCalc:t(24782).crossTraceCalc,colorbar:t(21146),arraysToCalcdata:t(35374),plot:t(32995).plot,style:t(6851).style,styleOnSelect:t(6851).styleOnSelect,hoverPoints:t(91664).hoverPoints,eventData:t(59541),selectPoints:t(88384),moduleType:"trace",name:"bar",basePlotModule:t(37703),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},25412:function(D){D.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}},78931:function(D,L,t){var b=t(33626),d=t(29714),e=t(34809),w=t(25412),y=t(17550).validateCornerradius;D.exports=function(_,u,r){function n(A,v){return e.coerce(_,u,w,A,v)}for(var l=!1,o=!1,s=!1,c={},h=n("barmode"),x=0;x0)-(V<0)}function p(V,j){return V0}function E(V,j,$,ee,H){return!(V<0||j<0)&&($<=V&&ee<=j||$<=j&&ee<=V||(H?V>=$*(j/ee):j>=ee*(V/$)))}function I(V){return V==="auto"?0:V}function B(V,j){var $=Math.PI/180*j,ee=Math.abs(Math.sin($)),H=Math.abs(Math.cos($));return{x:V.width*H+V.height*ee,y:V.width*ee+V.height*H}}function N(V,j,$,ee,H,J){var Q=!!J.isHorizontal,Z=!!J.constrained,K=J.angle||0,ae=J.anchor,se=ae==="end",he=ae==="start",fe=((J.leftToRight||0)+1)/2,ie=1-fe,oe=J.hasB,le=J.r,ge=J.overhead,ye=H.width,me=H.height,be=Math.abs(j-V),Se=Math.abs(ee-$),Ee=be>2*A&&Se>2*A?A:0;be-=2*Ee,Se-=2*Ee;var Ce=I(K);K!=="auto"||ye<=be&&me<=Se||!(ye>be||me>Se)||(ye>Se||me>be)&&yeA){var Ie=function($e,Ye,_e,De,Be,Ge,tt,nt,pt){var At,wt,Nt,Ht,Gt=Math.max(0,Math.abs(Ye-$e)-2*A),st=Math.max(0,Math.abs(De-_e)-2*A),Qe=Ge-A,ft=tt?Qe-Math.sqrt(Qe*Qe-(Qe-tt)*(Qe-tt)):Qe,yt=pt?2*Qe:nt?Qe-tt:2*ft,Ot=pt?2*Qe:nt?2*ft:Qe-tt;return Be.y/Be.x>=st/(Gt-yt)?Ht=st/Be.y:Be.y/Be.x<=(st-Ot)/Gt?Ht=Gt/Be.x:!pt&&nt?(At=Be.x*Be.x+Be.y*Be.y/4,Nt=(Gt-Qe)*(Gt-Qe)+(st/2-Qe)*(st/2-Qe)-Qe*Qe,Ht=(-(wt=-2*Be.x*(Gt-Qe)-Be.y*(st/2-Qe))+Math.sqrt(wt*wt-4*At*Nt))/(2*At)):pt?(At=(Be.x*Be.x+Be.y*Be.y)/4,Nt=(Gt/2-Qe)*(Gt/2-Qe)+(st/2-Qe)*(st/2-Qe)-Qe*Qe,Ht=(-(wt=-Be.x*(Gt/2-Qe)-Be.y*(st/2-Qe))+Math.sqrt(wt*wt-4*At*Nt))/(2*At)):(At=Be.x*Be.x/4+Be.y*Be.y,Nt=(Gt/2-Qe)*(Gt/2-Qe)+(st-Qe)*(st-Qe)-Qe*Qe,Ht=(-(wt=-Be.x*(Gt/2-Qe)-2*Be.y*(st-Qe))+Math.sqrt(wt*wt-4*At*Nt))/(2*At)),{scale:Ht=Math.min(1,Ht),pad:nt?Math.max(0,Qe-Math.sqrt(Math.max(0,Qe*Qe-(Qe-(st-Be.y*Ht)/2)*(Qe-(st-Be.y*Ht)/2)))-tt):Math.max(0,Qe-Math.sqrt(Math.max(0,Qe*Qe-(Qe-(Gt-Be.x*Ht)/2)*(Qe-(Gt-Be.x*Ht)/2)))-tt)}}(V,j,$,ee,We,le,ge,Q,oe);Le=Ie.scale,Oe=Ie.pad}else Le=1,Z&&(Le=Math.min(1,be/We.x,Se/We.y)),Oe=0;var Ve=H.left*ie+H.right*fe,Pe=(H.top+H.bottom)/2,de=(V+A)*ie+(j-A)*fe,Me=($+ee)/2,ke=0,He=0;if(he||se){var Fe=(Q?We.x:We.y)/2;le&&(se||oe)&&(Ee+=Oe);var qe=Q?p(V,j):p($,ee);Q?he?(de=V+qe*Ee,ke=-qe*Fe):(de=j-qe*Ee,ke=qe*Fe):he?(Me=$+qe*Ee,He=-qe*Fe):(Me=ee-qe*Ee,He=qe*Fe)}return{textX:Ve,textY:Pe,targetX:de,targetY:Me,anchorX:ke,anchorY:He,scale:Le,rotate:Ce}}D.exports={plot:function(V,j,$,ee,H,J){var Q=j.xaxis,Z=j.yaxis,K=V._fullLayout,ae=V._context.staticPlot;H||(H={mode:K.barmode,norm:K.barmode,gap:K.bargap,groupgap:K.bargroupgap},o("bar",K));var se=e.makeTraceGroups(ee,$,"trace bars").each(function(he){var fe=b.select(this),ie=he[0].trace,oe=he[0].t,le=ie.type==="waterfall",ge=ie.type==="funnel",ye=ie.type==="histogram",me=ie.type==="bar",be=me||ge,Se=0;le&&ie.connector.visible&&ie.connector.mode==="between"&&(Se=ie.connector.line.width/2);var Ee=ie.orientation==="h",Ce=f(H),Le=e.ensureSingle(fe,"g","points"),Oe=S(ie),We=Le.selectAll("g.point").data(e.identity,Oe);We.enter().append("g").classed("point",!0),We.exit().remove(),We.each(function(Ve,Pe){var de,Me,ke=b.select(this),He=function(vt,Lt,Ut,rt){var et=[],Et=[],Bt=rt?Lt:Ut,Ft=rt?Ut:Lt;return et[0]=Bt.c2p(vt.s0,!0),Et[0]=Ft.c2p(vt.p0,!0),et[1]=Bt.c2p(vt.s1,!0),Et[1]=Ft.c2p(vt.p1,!0),rt?[et,Et]:[Et,et]}(Ve,Q,Z,Ee),Fe=He[0][0],qe=He[0][1],$e=He[1][0],Ye=He[1][1],_e=(Ee?qe-Fe:Ye-$e)==0;if(_e&&be&&c.getLineWidth(ie,Ve)&&(_e=!1),_e||(_e=!(d(Fe)&&d(qe)&&d($e)&&d(Ye))),Ve.isBlank=_e,_e&&(Ee?qe=Fe:Ye=$e),Se&&!_e&&(Ee?(Fe-=p(Fe,qe)*Se,qe+=p(Fe,qe)*Se):($e-=p($e,Ye)*Se,Ye+=p($e,Ye)*Se)),ie.type==="waterfall"){if(!_e){var De=ie[Ve.dir].marker;de=De.line.width,Me=De.color}}else de=c.getLineWidth(ie,Ve),Me=Ve.mc||ie.marker.color;function Be(vt){var Lt=b.round(de/2%1,2);return H.gap===0&&H.groupgap===0?b.round(Math.round(vt)-Lt,2):vt}var Ge=y.opacity(Me)<1||de>.01?Be:function(vt,Lt,Ut){return Ut&&vt===Lt?vt:Math.abs(vt-Lt)>=2?Be(vt):vt>Lt?Math.ceil(vt):Math.floor(vt)};V._context.staticPlot||(Fe=Ge(Fe,qe,Ee),qe=Ge(qe,Fe,Ee),$e=Ge($e,Ye,!Ee),Ye=Ge(Ye,$e,!Ee));var tt,nt=Ee?Q.c2p:Z.c2p;tt=Ve.s0>0?Ve._sMax:Ve.s0<0?Ve._sMin:Ve.s1>0?Ve._sMax:Ve._sMin;var pt,At,wt=me||ye?function(vt,Lt){if(!vt)return 0;var Ut,rt=Math.abs(Ee?Ye-$e:qe-Fe),et=Math.abs(Ee?qe-Fe:Ye-$e),Et=Ge(Math.abs(nt(tt,!0)-nt(0,!0))),Bt=Ve.hasB?Math.min(rt/2,et/2):Math.min(rt/2,Et);return Ut=Lt==="%"?rt*(Math.min(50,vt)/100):vt,Ge(Math.max(Math.min(Ut,Bt),0))}(oe.cornerradiusvalue,oe.cornerradiusform):0,Nt="M"+Fe+","+$e+"V"+Ye+"H"+qe+"V"+$e+"Z",Ht=0;if(wt&&Ve.s){var Gt=T(Ve.s0)===0||T(Ve.s)===T(Ve.s0)?Ve.s1:Ve.s0;if((Ht=Ge(Ve.hasB?0:Math.abs(nt(tt,!0)-nt(Gt,!0))))0?Math.sqrt(Ht*(2*wt-Ht)):0,Pt=st>0?Math.max:Math.min;pt="M"+Fe+","+$e+"V"+(Ye-yt*Qe)+"H"+Pt(qe-(wt-Ht)*st,Fe)+"A "+wt+","+wt+" 0 0 "+ft+" "+qe+","+(Ye-wt*Qe-Ot)+"V"+($e+wt*Qe+Ot)+"A "+wt+","+wt+" 0 0 "+ft+" "+Pt(qe-(wt-Ht)*st,Fe)+","+($e+yt*Qe)+"Z"}else if(Ve.hasB)pt="M"+(Fe+wt*st)+","+$e+"A "+wt+","+wt+" 0 0 "+ft+" "+Fe+","+($e+wt*Qe)+"V"+(Ye-wt*Qe)+"A "+wt+","+wt+" 0 0 "+ft+" "+(Fe+wt*st)+","+Ye+"H"+(qe-wt*st)+"A "+wt+","+wt+" 0 0 "+ft+" "+qe+","+(Ye-wt*Qe)+"V"+($e+wt*Qe)+"A "+wt+","+wt+" 0 0 "+ft+" "+(qe-wt*st)+","+$e+"Z";else{var at=(At=Math.abs(Ye-$e)+Ht)0?Math.sqrt(Ht*(2*wt-Ht)):0,Xe=Qe>0?Math.max:Math.min;pt="M"+(Fe+at*st)+","+$e+"V"+Xe(Ye-(wt-Ht)*Qe,$e)+"A "+wt+","+wt+" 0 0 "+ft+" "+(Fe+wt*st-lt)+","+Ye+"H"+(qe-wt*st+lt)+"A "+wt+","+wt+" 0 0 "+ft+" "+(qe-at*st)+","+Xe(Ye-(wt-Ht)*Qe,$e)+"V"+$e+"Z"}}else pt=Nt}else pt=Nt;var ut=M(e.ensureSingle(ke,"path"),K,H,J);if(ut.style("vector-effect",ae?"none":"non-scaling-stroke").attr("d",isNaN((qe-Fe)*(Ye-$e))||_e&&V._context.staticPlot?"M0,0Z":pt).call(_.setClipUrl,j.layerClipId,V),!K.uniformtext.mode&&Ce){var Tt=_.makePointStyleFns(ie);_.singlePointStyle(Ve,ut,ie,Tt,V)}(function(vt,Lt,Ut,rt,et,Et,Bt,Ft,St,Jt,qt,en,Wt){var Zt,on=Lt.xaxis,un=Lt.yaxis,Pn=vt._fullLayout;function Dn(ai,bn,Yn){return e.ensureSingle(ai,"text").text(bn).attr({class:"bartext bartext-"+Zt,"text-anchor":"middle","data-notex":1}).call(_.font,Yn).call(w.convertToTspans,vt)}var In=rt[0].trace,mn=In.orientation==="h",En=function(ai,bn,Yn,an,_n){var gn,qn=bn[0].trace;return gn=qn.texttemplate?function(Un,tr,Wn,Bn,dn){var ln=tr[0].trace,An=e.castOption(ln,Wn,"texttemplate");if(!An)return"";var er,br,Tr,yr,Ur=ln.type==="histogram",Rr=ln.type==="waterfall",$r=ln.type==="funnel",Pr=ln.orientation==="h";function Cr(Wi){return r(yr,yr.c2l(Wi),!0).text}Pr?(er="y",br=dn,Tr="x",yr=Bn):(er="x",br=Bn,Tr="y",yr=dn);var Jr,gi=tr[Wn],ii={};ii.label=gi.p,ii.labelLabel=ii[er+"Label"]=(Jr=gi.p,r(br,br.c2l(Jr),!0).text);var Yr=e.castOption(ln,gi.i,"text");(Yr===0||Yr)&&(ii.text=Yr),ii.value=gi.s,ii.valueLabel=ii[Tr+"Label"]=Cr(gi.s);var oi={};k(oi,ln,gi.i),(Ur||oi.x===void 0)&&(oi.x=Pr?ii.value:ii.label),(Ur||oi.y===void 0)&&(oi.y=Pr?ii.label:ii.value),(Ur||oi.xLabel===void 0)&&(oi.xLabel=Pr?ii.valueLabel:ii.labelLabel),(Ur||oi.yLabel===void 0)&&(oi.yLabel=Pr?ii.labelLabel:ii.valueLabel),Rr&&(ii.delta=+gi.rawS||gi.s,ii.deltaLabel=Cr(ii.delta),ii.final=gi.v,ii.finalLabel=Cr(ii.final),ii.initial=ii.final-ii.delta,ii.initialLabel=Cr(ii.initial)),$r&&(ii.value=gi.s,ii.valueLabel=Cr(ii.value),ii.percentInitial=gi.begR,ii.percentInitialLabel=e.formatPercent(gi.begR),ii.percentPrevious=gi.difR,ii.percentPreviousLabel=e.formatPercent(gi.difR),ii.percentTotal=gi.sumR,ii.percenTotalLabel=e.formatPercent(gi.sumR));var Ti=e.castOption(ln,gi.i,"customdata");return Ti&&(ii.customdata=Ti),e.texttemplateString(An,ii,Un._d3locale,oi,ii,ln._meta||{})}(ai,bn,Yn,an,_n):qn.textinfo?function(Un,tr,Wn,Bn){var dn=Un[0].trace,ln=dn.orientation==="h",An=dn.type==="waterfall",er=dn.type==="funnel";function br(Ti){return r(ln?Wn:Bn,+Ti,!0).text}var Tr,yr,Ur=dn.textinfo,Rr=Un[tr],$r=Ur.split("+"),Pr=[],Cr=function(Ti){return $r.indexOf(Ti)!==-1};if(Cr("label")&&Pr.push((yr=Un[tr].p,r(ln?Bn:Wn,yr,!0).text)),Cr("text")&&((Tr=e.castOption(dn,Rr.i,"text"))===0||Tr)&&Pr.push(Tr),An){var Jr=+Rr.rawS||Rr.s,gi=Rr.v,ii=gi-Jr;Cr("initial")&&Pr.push(br(ii)),Cr("delta")&&Pr.push(br(Jr)),Cr("final")&&Pr.push(br(gi))}if(er){Cr("value")&&Pr.push(br(Rr.s));var Yr=0;Cr("percent initial")&&Yr++,Cr("percent previous")&&Yr++,Cr("percent total")&&Yr++;var oi=Yr>1;Cr("percent initial")&&(Tr=e.formatPercent(Rr.begR),oi&&(Tr+=" of initial"),Pr.push(Tr)),Cr("percent previous")&&(Tr=e.formatPercent(Rr.difR),oi&&(Tr+=" of previous"),Pr.push(Tr)),Cr("percent total")&&(Tr=e.formatPercent(Rr.sumR),oi&&(Tr+=" of total"),Pr.push(Tr))}return Pr.join("
")}(bn,Yn,an,_n):c.getValue(qn.text,Yn),c.coerceString(m,gn)}(Pn,rt,et,on,un);Zt=function(ai,bn){var Yn=c.getValue(ai.textposition,bn);return c.coerceEnumerated(g,Yn)}(In,et);var Kn=en.mode==="stack"||en.mode==="relative",Ln=rt[et],Tn=!Kn||Ln._outmost,Fn=Ln.hasB,wn=Jt&&Jt-qt>A;if(En&&Zt!=="none"&&(!Ln.isBlank&&Et!==Bt&&Ft!==St||Zt!=="auto"&&Zt!=="inside")){var zn=Pn.font,Jn=s.getBarColor(rt[et],In),$n=s.getInsideTextFont(In,et,zn,Jn),vr=s.getOutsideTextFont(In,et,zn),Qn=In.insidetextanchor||"end",lr=Ut.datum();mn?on.type==="log"&&lr.s0<=0&&(Et=on.range[0]0&&Or>0;ur=wn?Fn?E(kn-2*Jt,Cn,ni,Or,mn)||E(kn,Cn-2*Jt,ni,Or,mn):mn?E(kn-(Jt-qt),Cn,ni,Or,mn)||E(kn,Cn-2*(Jt-qt),ni,Or,mn):E(kn,Cn-(Jt-qt),ni,Or,mn)||E(kn-2*(Jt-qt),Cn,ni,Or,mn):E(kn,Cn,ni,Or,mn),Zn&&ur?Zt="inside":(Zt="outside",hr.remove(),hr=null)}else Zt="inside";if(!hr){var cr=(hr=Dn(Ut,En,Ar=e.ensureUniformFontSize(vt,Zt==="outside"?vr:$n))).attr("transform");if(hr.attr("transform",""),ni=(jr=_.bBox(hr.node())).width,Or=jr.height,hr.attr("transform",cr),ni<=0||Or<=0)return void hr.remove()}var Ir,Er=In.textangle;Ir=Zt==="outside"?function(ai,bn,Yn,an,_n,gn){var qn,Un=!!gn.isHorizontal,tr=!!gn.constrained,Wn=gn.angle||0,Bn=_n.width,dn=_n.height,ln=Math.abs(bn-ai),An=Math.abs(an-Yn);qn=Un?An>2*A?A:0:ln>2*A?A:0;var er=1;tr&&(er=Un?Math.min(1,An/dn):Math.min(1,ln/Bn));var br=I(Wn),Tr=B(_n,br),yr=(Un?Tr.x:Tr.y)/2,Ur=(_n.left+_n.right)/2,Rr=(_n.top+_n.bottom)/2,$r=(ai+bn)/2,Pr=(Yn+an)/2,Cr=0,Jr=0,gi=Un?p(bn,ai):p(Yn,an);return Un?($r=bn-gi*qn,Cr=gi*yr):(Pr=an+gi*qn,Jr=-gi*yr),{textX:Ur,textY:Rr,targetX:$r,targetY:Pr,anchorX:Cr,anchorY:Jr,scale:er,rotate:br}}(Et,Bt,Ft,St,jr,{isHorizontal:mn,constrained:In.constraintext==="both"||In.constraintext==="outside",angle:Er}):N(Et,Bt,Ft,St,jr,{isHorizontal:mn,constrained:In.constraintext==="both"||In.constraintext==="inside",angle:Er,anchor:Qn,hasB:Fn,r:Jt,overhead:qt}),Ir.fontSize=Ar.size,l(In.type==="histogram"?"bar":In.type,Ir,Pn),Ln.transform=Ir;var Xr=M(hr,Pn,en,Wt);e.setTransormAndDisplay(Xr,Ir)}else Ut.select("text").remove()})(V,j,ke,he,Pe,Fe,qe,$e,Ye,wt,Ht,H,J),j.layerClipId&&_.hideOutsideRangePoint(Ve,ke.select("text"),Q,Z,ie.xcalendar,ie.ycalendar)});var Ie=ie.cliponaxis===!1;_.setClipUrl(fe,Ie?null:j.layerClipId,V)});u.getComponentMethod("errorbars","plot")(V,se,j,H)},toMoveInsideBar:N}},88384:function(D){function L(t,b,d,e,w){var y=b.c2p(e?t.s0:t.p0,!0),_=b.c2p(e?t.s1:t.p1,!0),u=d.c2p(e?t.p0:t.s0,!0),r=d.c2p(e?t.p1:t.s1,!0);return w?[(y+_)/2,(u+r)/2]:e?[_,(u+r)/2]:[(y+_)/2,r]}D.exports=function(t,b){var d,e=t.cd,w=t.xaxis,y=t.yaxis,_=e[0].trace,u=_.type==="funnel",r=_.orientation==="h",n=[];if(b===!1)for(d=0;d1||p.bargap===0&&p.bargroupgap===0&&!M[0].trace.marker.line.width)&&b.select(this).attr("shape-rendering","crispEdges")}),S.selectAll("g.points").each(function(M){s(b.select(this),M[0].trace,v)}),y.getComponentMethod("errorbars","style")(S)},styleTextPoints:c,styleOnSelect:function(v,S,T){var p=S[0].trace;p.selectedpoints?function(M,f,E){e.selectedPointStyle(M.selectAll("path"),f),function(I,B,N){I.each(function(V){var j,$=b.select(this);if(V.selected){j=w.ensureUniformFontSize(N,h($,V,B,N));var ee=B.selected.textfont&&B.selected.textfont.color;ee&&(j.color=ee),e.font($,j)}else e.selectedTextStyle($,B)})}(M.selectAll("text"),f,E)}(T,p,v):(s(T,p,v),y.getComponentMethod("errorbars","style")(T))},getInsideTextFont:m,getOutsideTextFont:g,getBarColor:A,resizeText:_}},59760:function(D,L,t){var b=t(78766),d=t(65477).hasColorscale,e=t(39356),w=t(34809).coercePattern;D.exports=function(y,_,u,r,n){var l=u("marker.color",r),o=d(y,"marker");o&&e(y,_,n,u,{prefix:"marker.",cLetter:"c"}),u("marker.line.color",b.defaultLine),d(y,"marker.line")&&e(y,_,n,u,{prefix:"marker.line.",cLetter:"c"}),u("marker.line.width"),u("marker.opacity"),w(u,"marker.pattern",l,o),u("selected.marker.color"),u("unselected.marker.color")}},84102:function(D,L,t){var b=t(45568),d=t(34809);function e(w){return"_"+w+"Text_minsize"}D.exports={recordMinTextSize:function(w,y,_){if(_.uniformtext.mode){var u=e(w),r=_.uniformtext.minsize,n=y.scale*y.fontSize;y.hide=nc.range[1]&&(v+=Math.PI),b.getClosest(l,function(p){return m(A,v,[p.rp0,p.rp1],[p.thetag0,p.thetag1],x)?g+Math.min(1,Math.abs(p.thetag1-p.thetag0)/k)-1+(p.rp1-A)/(p.rp1-p.rp0)-1:1/0},u),u.index!==!1){var S=l[u.index];u.x0=u.x1=S.ct[0],u.y0=u.y1=S.ct[1];var T=d.extendFlat({},S,{r:S.s,theta:S.p});return w(S,o,u),y(T,o,s,u),u.hovertemplate=o.hovertemplate,u.color=e(o,S),u.xLabelVal=u.yLabelVal=void 0,S.s<0&&(u.idealAlign="left"),[u]}}},89362:function(D,L,t){D.exports={moduleType:"trace",name:"barpolar",basePlotModule:t(31645),categories:["polar","bar","showLegend"],attributes:t(32225),layoutAttributes:t(42956),supplyDefaults:t(77318),supplyLayoutDefaults:t(60507),calc:t(27941).calc,crossTraceCalc:t(27941).crossTraceCalc,plot:t(11627),colorbar:t(21146),formatLabels:t(33368),style:t(6851).style,styleOnSelect:t(6851).styleOnSelect,hoverPoints:t(83080),selectPoints:t(88384),meta:{}}},42956:function(D){D.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},60507:function(D,L,t){var b=t(34809),d=t(42956);D.exports=function(e,w,y){var _,u={};function r(o,s){return b.coerce(e[_]||{},w[_],d,o,s)}for(var n=0;n0?(p=S,M=T):(p=T,M=S);var f=[y.findEnclosingVertexAngles(p,m.vangles)[0],(p+M)/2,y.findEnclosingVertexAngles(M,m.vangles)[1]];return y.pathPolygonAnnulus(A,v,p,M,f,g,k)}:function(A,v,S,T){return e.pathAnnulus(A,v,S,T,g,k)}}(u),x=u.layers.frontplot.select("g.barlayer");e.makeTraceGroups(x,r,"trace bars").each(function(){var m=b.select(this),g=e.ensureSingle(m,"g","points").selectAll("g.point").data(e.identity);g.enter().append("g").style("vector-effect",n?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),g.exit().remove(),g.each(function(k){var A,v=b.select(this),S=k.rp0=s.c2p(k.s0),T=k.rp1=s.c2p(k.s1),p=k.thetag0=c.c2g(k.p0),M=k.thetag1=c.c2g(k.p1);if(d(S)&&d(T)&&d(p)&&d(M)&&S!==T&&p!==M){var f=s.c2g(k.s1),E=(p+M)/2;k.ct=[l.c2p(f*Math.cos(E)),o.c2p(f*Math.sin(E))],A=h(S,T,p,M)}else A="M0,0Z";e.ensureSingle(v,"path").attr("d",A)}),w.setClipUrl(m,u._hasClipOnAxisFalse?u.clipIds.forTraces:null,_)})}},64625:function(D,L,t){var b=t(19326),d=t(36640),e=t(81481),w=t(10229),y=t(80712).axisHoverFormat,_=t(3208).rb,u=t(93049).extendFlat,r=d.marker,n=r.line;D.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:u({},r.symbol,{arrayOk:!1,editType:"plot"}),opacity:u({},r.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:u({},r.angle,{arrayOk:!1,editType:"calc"}),size:u({},r.size,{arrayOk:!1,editType:"calc"}),color:u({},r.color,{arrayOk:!1,editType:"style"}),line:{color:u({},n.color,{arrayOk:!1,dflt:w.defaultLine,editType:"style"}),width:u({},n.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:b(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:e.offsetgroup,alignmentgroup:e.alignmentgroup,selected:{marker:d.selected.marker,editType:"style"},unselected:{marker:d.unselected.marker,editType:"style"},text:u({},d.text,{}),hovertext:u({},d.hovertext,{}),hovertemplate:_({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:d.zorder}},89429:function(D,L,t){var b=t(10721),d=t(29714),e=t(40528),w=t(34809),y=t(63821).BADNUM,_=w._;D.exports=function(m,g){var k,A,v,S,T,p,M,f=m._fullLayout,E=d.getFromId(m,g.xaxis||"x"),I=d.getFromId(m,g.yaxis||"y"),B=[],N=g.type==="violin"?"_numViolins":"_numBoxes";g.orientation==="h"?(v=E,S="x",T=I,p="y",M=!!g.yperiodalignment):(v=I,S="y",T=E,p="x",M=!!g.xperiodalignment);var V,j,$,ee,H,J,Q=function(Be,Ge,tt,nt){var pt,At=Ge+"0"in Be;if(Ge in Be||At&&"d"+Ge in Be){var wt=tt.makeCalcdata(Be,Ge);return[e(Be,tt,Ge,wt).vals,wt]}pt=At?Be[Ge+"0"]:"name"in Be&&(tt.type==="category"||b(Be.name)&&["linear","log"].indexOf(tt.type)!==-1||w.isDateTime(Be.name)&&tt.type==="date")?Be.name:nt;for(var Nt=tt.type==="multicategory"?tt.r2c_just_indices(pt):tt.d2c(pt,0,Be[Ge+"calendar"]),Ht=Be._length,Gt=new Array(Ht),st=0;stV.uf};if(g._hasPreCompStats){var ie=g[S],oe=function(Be){return v.d2c((g[Be]||[])[k])},le=1/0,ge=-1/0;for(k=0;k=V.q1&&V.q3>=V.med){var me=oe("lowerfence");V.lf=me!==y&&me<=V.q1?me:o(V,$,ee);var be=oe("upperfence");V.uf=be!==y&&be>=V.q3?be:s(V,$,ee);var Se=oe("mean");V.mean=Se!==y?Se:ee?w.mean($,ee):(V.q1+V.q3)/2;var Ee=oe("sd");V.sd=Se!==y&&Ee>=0?Ee:ee?w.stdev($,ee,V.mean):V.q3-V.q1,V.lo=c(V),V.uo=h(V);var Ce=oe("notchspan");Ce=Ce!==y&&Ce>0?Ce:x(V,ee),V.ln=V.med-Ce,V.un=V.med+Ce;var Le=V.lf,Oe=V.uf;g.boxpoints&&$.length&&(Le=Math.min(Le,$[0]),Oe=Math.max(Oe,$[ee-1])),g.notched&&(Le=Math.min(Le,V.ln),Oe=Math.max(Oe,V.un)),V.min=Le,V.max=Oe}else{var We;w.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+V.q1,"median = "+V.med,"q3 = "+V.q3].join(` -`)),We=V.med!==y?V.med:V.q1!==y?V.q3!==y?(V.q1+V.q3)/2:V.q1:V.q3!==y?V.q3:0,V.med=We,V.q1=V.q3=We,V.lf=V.uf=We,V.mean=V.sd=We,V.ln=V.un=We,V.min=V.max=We}le=Math.min(le,V.min),ge=Math.max(ge,V.max),V.pts2=j.filter(fe),B.push(V)}}g._extremes[v._id]=d.findExtremes(v,[le,ge],{padded:!0})}else{var Ie=v.makeCalcdata(g,S),Ve=function(Be,Ge){for(var tt=Be.length,nt=new Array(tt+1),pt=0;pt=0&&Me0){var Ye,_e;(V={}).pos=V[p]=se[k],j=V.pts=de[k].sort(n),ee=($=V[S]=j.map(l)).length,V.min=$[0],V.max=$[ee-1],V.mean=w.mean($,ee),V.sd=w.stdev($,ee,V.mean)*g.sdmultiple,V.med=w.interp($,.5),ee%2&&(qe||$e)?(qe?(Ye=$.slice(0,ee/2),_e=$.slice(ee/2+1)):$e&&(Ye=$.slice(0,ee/2+1),_e=$.slice(ee/2)),V.q1=w.interp(Ye,.5),V.q3=w.interp(_e,.5)):(V.q1=w.interp($,.25),V.q3=w.interp($,.75)),V.lf=o(V,$,ee),V.uf=s(V,$,ee),V.lo=c(V),V.uo=h(V);var De=x(V,ee);V.ln=V.med-De,V.un=V.med+De,ke=Math.min(ke,V.ln),He=Math.max(He,V.un),V.pts2=j.filter(fe),B.push(V)}g.notched&&w.isTypedArray(Ie)&&(Ie=Array.from(Ie)),g._extremes[v._id]=d.findExtremes(v,g.notched?Ie.concat([ke,He]):Ie,{padded:!0})}return function(Be,Ge){if(w.isArrayOrTypedArray(Ge.selectedpoints))for(var tt=0;tt0?(B[0].t={num:f[N],dPos:he,posLetter:p,valLetter:S,labels:{med:_(m,"median:"),min:_(m,"min:"),q1:_(m,"q1:"),q3:_(m,"q3:"),max:_(m,"max:"),mean:g.boxmean==="sd"||g.sizemode==="sd"?_(m,"mean ± σ:").replace("σ",g.sdmultiple===1?"σ":g.sdmultiple+"σ"):_(m,"mean:"),lf:_(m,"lower fence:"),uf:_(m,"upper fence:")}},f[N]++,B):[{t:{empty:!0}}]};var u={text:"tx",hovertext:"htx"};function r(m,g,k){for(var A in u)w.isArrayOrTypedArray(g[A])&&(Array.isArray(k)?w.isArrayOrTypedArray(g[A][k[0]])&&(m[u[A]]=g[A][k[0]][k[1]]):m[u[A]]=g[A][k])}function n(m,g){return m.v-g.v}function l(m){return m.v}function o(m,g,k){return k===0?m.q1:Math.min(m.q1,g[Math.min(w.findBin(2.5*m.q1-1.5*m.q3,g,!0)+1,k-1)])}function s(m,g,k){return k===0?m.q3:Math.max(m.q3,g[Math.max(w.findBin(2.5*m.q3-1.5*m.q1,g),0)])}function c(m){return 4*m.q1-3*m.q3}function h(m){return 4*m.q3-3*m.q1}function x(m,g){return g===0?0:1.57*(m.q3-m.q1)/Math.sqrt(g)}},81606:function(D,L,t){var b=t(29714),d=t(34809),e=t(84391).getAxisGroup,w=["v","h"];function y(_,u,r,n){var l,o,s,c=u.calcdata,h=u._fullLayout,x=n._id,m=x.charAt(0),g=[],k=0;for(l=0;l1,p=1-h[_+"gap"],M=1-h[_+"groupgap"];for(l=0;l0){var ye=j.pointpos,me=j.jitter,be=j.marker.size/2,Se=0;ye+me>=0&&((Se=le*(ye+me))>N?(ge=!0,ie=be,he=Se):Se>ae&&(ie=be,he=N)),Se<=N&&(he=N);var Ee=0;ye-me<=0&&((Ee=-le*(ye-me))>V?(ge=!0,oe=be,fe=Ee):Ee>se&&(oe=be,fe=V)),Ee<=V&&(fe=V)}else he=N,fe=V;var Ce=new Array(s.length);for(o=0;o0?(T="v",p=f>0?Math.min(I,E):Math.min(E)):f>0?(T="h",p=Math.min(I)):p=0;if(p){o._length=p;var ee=s("orientation",T);o._hasPreCompStats?ee==="v"&&f===0?(s("x0",0),s("dx",1)):ee==="h"&&M===0&&(s("y0",0),s("dy",1)):ee==="v"&&f===0?s("x0"):ee==="h"&&M===0&&s("y0"),d.getComponentMethod("calendars","handleTraceDefaults")(l,o,["x","y"],c)}else o.visible=!1}function n(l,o,s,c){var h=c.prefix,x=b.coerce2(l,o,u,"marker.outliercolor"),m=s("marker.line.outliercolor"),g="outliers";o._hasPreCompStats?g="all":(x||m)&&(g="suspectedoutliers");var k=s(h+"points",g);k?(s("jitter",k==="all"?.3:0),s("pointpos",k==="all"?-1.5:0),s("marker.symbol"),s("marker.opacity"),s("marker.size"),s("marker.angle"),s("marker.color",o.line.color),s("marker.line.color"),s("marker.line.width"),k==="suspectedoutliers"&&(s("marker.line.outliercolor",o.marker.color),s("marker.line.outlierwidth")),s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size"),s("text"),s("hovertext")):delete o.marker;var A=s("hoveron");A!=="all"&&A.indexOf("points")===-1||s("hovertemplate"),b.coerceSelectionMarkerOpacity(o,s)}D.exports={supplyDefaults:function(l,o,s,c){function h(p,M){return b.coerce(l,o,u,p,M)}if(r(l,o,h,c),o.visible!==!1){w(l,o,c,h),h("xhoverformat"),h("yhoverformat");var x=o._hasPreCompStats;x&&(h("lowerfence"),h("upperfence")),h("line.color",(l.marker||{}).color||s),h("line.width"),h("fillcolor",e.addOpacity(o.line.color,.5));var m=!1;if(x){var g=h("mean"),k=h("sd");g&&g.length&&(m=!0,k&&k.length&&(m="sd"))}h("whiskerwidth");var A,v=h("sizemode");v==="quartiles"&&(A=h("boxmean",m)),h("showwhiskers",v==="quartiles"),v!=="sd"&&A!=="sd"||h("sdmultiple"),h("width"),h("quartilemethod");var S=!1;if(x){var T=h("notchspan");T&&T.length&&(S=!0)}else b.validate(l.notchwidth,u.notchwidth)&&(S=!0);h("notched",S)&&h("notchwidth"),n(l,o,h,{prefix:"box"}),h("zorder")}},crossTraceDefaults:function(l,o){var s,c;function h(g){return b.coerce(c._input,c,u,g)}for(var x=0;xk.lo&&($.so=!0)}return S});g.enter().append("path").classed("point",!0),g.exit().remove(),g.call(e.translatePoints,o,s)}function _(u,r,n,l){var o,s,c=r.val,h=r.pos,x=!!h.rangebreaks,m=l.bPos,g=l.bPosPxOffset||0,k=n.boxmean||(n.meanline||{}).visible;Array.isArray(l.bdPos)?(o=l.bdPos[0],s=l.bdPos[1]):(o=l.bdPos,s=l.bdPos);var A=u.selectAll("path.mean").data(n.type==="box"&&n.boxmean||n.type==="violin"&&n.box.visible&&n.meanline.visible?d.identity:[]);A.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),A.exit().remove(),A.each(function(v){var S=h.c2l(v.pos+m,!0),T=h.l2p(S-o)+g,p=h.l2p(S+s)+g,M=x?(T+p)/2:h.l2p(S)+g,f=c.c2p(v.mean,!0),E=c.c2p(v.mean-v.sd,!0),I=c.c2p(v.mean+v.sd,!0);n.orientation==="h"?b.select(this).attr("d","M"+f+","+T+"V"+p+(k==="sd"?"m0,0L"+E+","+M+"L"+f+","+T+"L"+I+","+M+"Z":"")):b.select(this).attr("d","M"+T+","+f+"H"+p+(k==="sd"?"m0,0L"+M+","+E+"L"+T+","+f+"L"+M+","+I+"Z":""))})}D.exports={plot:function(u,r,n,l){var o=u._context.staticPlot,s=r.xaxis,c=r.yaxis;d.makeTraceGroups(l,n,"trace boxes").each(function(h){var x,m,g=b.select(this),k=h[0],A=k.t,v=k.trace;A.wdPos=A.bdPos*v.whiskerwidth,v.visible!==!0||A.empty?g.remove():(v.orientation==="h"?(x=c,m=s):(x=s,m=c),w(g,{pos:x,val:m},v,A,o),y(g,{x:s,y:c},v,A),_(g,{pos:x,val:m},v,A))})},plotBoxAndWhiskers:w,plotPoints:y,plotBoxMean:_}},72488:function(D){D.exports=function(L,t){var b,d,e=L.cd,w=L.xaxis,y=L.yaxis,_=[];if(t===!1)for(b=0;b=10)return null;for(var y=1/0,_=-1/0,u=e.length,r=0;r0?Math.floor:Math.ceil,ee=V>0?Math.ceil:Math.floor,H=V>0?Math.min:Math.max,J=V>0?Math.max:Math.min,Q=$(B+j),Z=ee(N-j),K=[[s=I(B)]];for(_=Q;_*V=0;e--)w[n-e]=L[l][e],y[n-e]=t[l][e];for(_.push({x:w,y,bicubic:u}),e=l,w=[],y=[];e>=0;e--)w[l-e]=L[e][0],y[l-e]=t[e][0];return _.push({x:w,y,bicubic:r}),_}},4753:function(D,L,t){var b=t(29714),d=t(93049).extendFlat;D.exports=function(e,w,y){var _,u,r,n,l,o,s,c,h,x,m,g,k,A,v=e["_"+w],S=e[w+"axis"],T=S._gridlines=[],p=S._minorgridlines=[],M=S._boundarylines=[],f=e["_"+y],E=e[y+"axis"];S.tickmode==="array"&&(S.tickvals=v.slice());var I=e._xctrl,B=e._yctrl,N=I[0].length,V=I.length,j=e._a.length,$=e._b.length;b.prepTicks(S),S.tickmode==="array"&&delete S.tickvals;var ee=S.smoothing?3:1;function H(Q){var Z,K,ae,se,he,fe,ie,oe,le,ge,ye,me,be=[],Se=[],Ee={};if(w==="b")for(K=e.b2j(Q),ae=Math.floor(Math.max(0,Math.min($-2,K))),se=K-ae,Ee.length=$,Ee.crossLength=j,Ee.xy=function(Ce){return e.evalxy([],Ce,K)},Ee.dxy=function(Ce,Le){return e.dxydi([],Ce,ae,Le,se)},Z=0;Z0&&(le=e.dxydi([],Z-1,ae,0,se),be.push(he[0]+le[0]/3),Se.push(he[1]+le[1]/3),ge=e.dxydi([],Z-1,ae,1,se),be.push(oe[0]-ge[0]/3),Se.push(oe[1]-ge[1]/3)),be.push(oe[0]),Se.push(oe[1]),he=oe;else for(Z=e.a2i(Q),fe=Math.floor(Math.max(0,Math.min(j-2,Z))),ie=Z-fe,Ee.length=j,Ee.crossLength=$,Ee.xy=function(Ce){return e.evalxy([],Z,Ce)},Ee.dxy=function(Ce,Le){return e.dxydj([],fe,Ce,ie,Le)},K=0;K<$;K++)ae=Math.min($-2,K),se=K-ae,oe=e.evalxy([],Z,K),E.smoothing&&K>0&&(ye=e.dxydj([],fe,K-1,ie,0),be.push(he[0]+ye[0]/3),Se.push(he[1]+ye[1]/3),me=e.dxydj([],fe,K-1,ie,1),be.push(oe[0]-me[0]/3),Se.push(oe[1]-me[1]/3)),be.push(oe[0]),Se.push(oe[1]),he=oe;return Ee.axisLetter=w,Ee.axis=S,Ee.crossAxis=E,Ee.value=Q,Ee.constvar=y,Ee.index=c,Ee.x=be,Ee.y=Se,Ee.smoothing=E.smoothing,Ee}function J(Q){var Z,K,ae,se,he,fe=[],ie=[],oe={};if(oe.length=v.length,oe.crossLength=f.length,w==="b")for(ae=Math.max(0,Math.min($-2,Q)),he=Math.min(1,Math.max(0,Q-ae)),oe.xy=function(le){return e.evalxy([],le,Q)},oe.dxy=function(le,ge){return e.dxydi([],le,ae,ge,he)},Z=0;Zv.length-1||T.push(d(J(u),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(c=o;cv.length-1||m<0||m>v.length-1))for(g=v[r],k=v[m],_=0;_v[v.length-1]||p.push(d(H(x),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&M.push(d(J(0),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&M.push(d(J(v.length-1),{color:S.endlinecolor,width:S.endlinewidth}))}else{for(n=5e-15,o=(l=[Math.floor((v[v.length-1]-S.tick0)/S.dtick*(1+n)),Math.ceil((v[0]-S.tick0)/S.dtick/(1+n))].sort(function(Q,Z){return Q-Z}))[0],s=l[1],c=o;c<=s;c++)h=S.tick0+S.dtick*c,T.push(d(H(h),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(c=o-1;cv[v.length-1]||p.push(d(H(x),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&M.push(d(H(v[0]),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&M.push(d(H(v[v.length-1]),{color:S.endlinecolor,width:S.endlinewidth}))}}},93923:function(D,L,t){var b=t(29714),d=t(93049).extendFlat;D.exports=function(e,w){var y,_,u,r=w._labels=[],n=w._gridlines;for(y=0;ye.length&&(d=d.slice(0,e.length)):d=[],y=0;y90&&(s-=180,u=-u),{angle:s,flip:u,p:L.c2p(d,t,b),offsetMultplier:r}}},87947:function(D,L,t){var b=t(45568),d=t(62203),e=t(6720),w=t(3685),y=t(33163),_=t(30635),u=t(34809),r=u.strRotate,n=u.strTranslate,l=t(4530);function o(m,g,k,A,v,S,T){var p="const-"+v+"-lines",M=k.selectAll("."+p).data(S);M.enter().append("path").classed(p,!0).style("vector-effect",T?"none":"non-scaling-stroke"),M.each(function(f){var E=f,I=E.x,B=E.y,N=e([],I,m.c2p),V=e([],B,g.c2p),j="M"+w(N,V,E.smoothing);b.select(this).attr("d",j).style("stroke-width",E.width).style("stroke",E.color).style("stroke-dasharray",d.dashStyle(E.dash,E.width)).style("fill","none")}),M.exit().remove()}function s(m,g,k,A,v,S,T,p){var M=S.selectAll("text."+p).data(T);M.enter().append("text").classed(p,!0);var f=0,E={};return M.each(function(I,B){var N;if(I.axis.tickangle==="auto")N=y(A,g,k,I.xy,I.dxy);else{var V=(I.axis.tickangle+180)*Math.PI/180;N=y(A,g,k,I.xy,[Math.cos(V),Math.sin(V)])}B||(E={angle:N.angle,flip:N.flip});var j=(I.endAnchor?-1:1)*N.flip,$=b.select(this).attr({"text-anchor":j>0?"start":"end","data-notex":1}).call(d.font,I.font).text(I.text).call(_.convertToTspans,m),ee=d.bBox(this);$.attr("transform",n(N.p[0],N.p[1])+r(N.angle)+n(I.axis.labelpadding*j,.3*ee.height)),f=Math.max(f,ee.width+I.axis.labelpadding)}),M.exit().remove(),E.maxExtent=f,E}D.exports=function(m,g,k,A){var v=m._context.staticPlot,S=g.xaxis,T=g.yaxis,p=m._fullLayout._clips;u.makeTraceGroups(A,k,"trace").each(function(M){var f=b.select(this),E=M[0],I=E.trace,B=I.aaxis,N=I.baxis,V=u.ensureSingle(f,"g","minorlayer"),j=u.ensureSingle(f,"g","majorlayer"),$=u.ensureSingle(f,"g","boundarylayer"),ee=u.ensureSingle(f,"g","labellayer");f.style("opacity",I.opacity),o(S,T,j,0,"a",B._gridlines,!0),o(S,T,j,0,"b",N._gridlines,!0),o(S,T,V,0,"a",B._minorgridlines,!0),o(S,T,V,0,"b",N._minorgridlines,!0),o(S,T,$,0,"a-boundary",B._boundarylines,v),o(S,T,$,0,"b-boundary",N._boundarylines,v);var H=s(m,S,T,I,0,ee,B._labels,"a-label"),J=s(m,S,T,I,0,ee,N._labels,"b-label");(function(Q,Z,K,ae,se,he,fe,ie){var oe,le,ge,ye,me=u.aggNums(Math.min,null,K.a),be=u.aggNums(Math.max,null,K.a),Se=u.aggNums(Math.min,null,K.b),Ee=u.aggNums(Math.max,null,K.b);oe=.5*(me+be),le=Se,ge=K.ab2xy(oe,le,!0),ye=K.dxyda_rough(oe,le),fe.angle===void 0&&u.extendFlat(fe,y(K,se,he,ge,K.dxydb_rough(oe,le))),x(Q,Z,K,0,ge,ye,K.aaxis,se,he,fe,"a-title"),oe=me,le=.5*(Se+Ee),ge=K.ab2xy(oe,le,!0),ye=K.dxydb_rough(oe,le),ie.angle===void 0&&u.extendFlat(ie,y(K,se,he,ge,K.dxyda_rough(oe,le))),x(Q,Z,K,0,ge,ye,K.baxis,se,he,ie,"b-title")})(m,ee,I,0,S,T,H,J),function(Q,Z,K,ae,se){var he,fe,ie,oe,le=K.select("#"+Q._clipPathId);le.size()||(le=K.append("clipPath").classed("carpetclip",!0));var ge=u.ensureSingle(le,"path","carpetboundary"),ye=Z.clipsegments,me=[];for(oe=0;oe90&&$<270,H=b.select(this);H.text(T.title.text).call(_.convertToTspans,m),ee&&(N=(-_.lineCount(H)+h)*c*j-N),H.attr("transform",n(V.p[0],V.p[1])+r(V.angle)+n(0,N)).attr("text-anchor","middle").call(d.font,T.title.font)}),B.exit().remove()}},76842:function(D,L,t){var b=t(45923),d=t(98813).findBin,e=t(57075),w=t(13828),y=t(39848),_=t(41839);D.exports=function(u){var r=u._a,n=u._b,l=r.length,o=n.length,s=u.aaxis,c=u.baxis,h=r[0],x=r[l-1],m=n[0],g=n[o-1],k=r[r.length-1]-r[0],A=n[n.length-1]-n[0],v=k*b.RELATIVE_CULL_TOLERANCE,S=A*b.RELATIVE_CULL_TOLERANCE;h-=v,x+=v,m-=S,g+=S,u.isVisible=function(T,p){return T>h&&Tm&&px||pg},u.setScale=function(){var T=u._x,p=u._y,M=e(u._xctrl,u._yctrl,T,p,s.smoothing,c.smoothing);u._xctrl=M[0],u._yctrl=M[1],u.evalxy=w([u._xctrl,u._yctrl],l,o,s.smoothing,c.smoothing),u.dxydi=y([u._xctrl,u._yctrl],s.smoothing,c.smoothing),u.dxydj=_([u._xctrl,u._yctrl],s.smoothing,c.smoothing)},u.i2a=function(T){var p=Math.max(0,Math.floor(T[0]),l-2),M=T[0]-p;return(1-M)*r[p]+M*r[p+1]},u.j2b=function(T){var p=Math.max(0,Math.floor(T[1]),l-2),M=T[1]-p;return(1-M)*n[p]+M*n[p+1]},u.ij2ab=function(T){return[u.i2a(T[0]),u.j2b(T[1])]},u.a2i=function(T){var p=Math.max(0,Math.min(d(T,r),l-2)),M=r[p],f=r[p+1];return Math.max(0,Math.min(l-1,p+(T-M)/(f-M)))},u.b2j=function(T){var p=Math.max(0,Math.min(d(T,n),o-2)),M=n[p],f=n[p+1];return Math.max(0,Math.min(o-1,p+(T-M)/(f-M)))},u.ab2ij=function(T){return[u.a2i(T[0]),u.b2j(T[1])]},u.i2c=function(T,p){return u.evalxy([],T,p)},u.ab2xy=function(T,p,M){if(!M&&(Tr[l-1]|pn[o-1]))return[!1,!1];var f=u.a2i(T),E=u.b2j(p),I=u.evalxy([],f,E);if(M){var B,N,V,j,$=0,ee=0,H=[];Tr[l-1]?(B=l-2,N=1,$=(T-r[l-1])/(r[l-1]-r[l-2])):N=f-(B=Math.max(0,Math.min(l-2,Math.floor(f)))),pn[o-1]?(V=o-2,j=1,ee=(p-n[o-1])/(n[o-1]-n[o-2])):j=E-(V=Math.max(0,Math.min(o-2,Math.floor(E)))),$&&(u.dxydi(H,B,V,N,j),I[0]+=H[0]*$,I[1]+=H[1]*$),ee&&(u.dxydj(H,B,V,N,j),I[0]+=H[0]*ee,I[1]+=H[1]*ee)}return I},u.c2p=function(T,p,M){return[p.c2p(T[0]),M.c2p(T[1])]},u.p2x=function(T,p,M){return[p.p2c(T[0]),M.p2c(T[1])]},u.dadi=function(T){var p=Math.max(0,Math.min(r.length-2,T));return r[p+1]-r[p]},u.dbdj=function(T){var p=Math.max(0,Math.min(n.length-2,T));return n[p+1]-n[p]},u.dxyda=function(T,p,M,f){var E=u.dxydi(null,T,p,M,f),I=u.dadi(T,M);return[E[0]/I,E[1]/I]},u.dxydb=function(T,p,M,f){var E=u.dxydj(null,T,p,M,f),I=u.dbdj(p,f);return[E[0]/I,E[1]/I]},u.dxyda_rough=function(T,p,M){var f=k*(M||.1),E=u.ab2xy(T+f,p,!0),I=u.ab2xy(T-f,p,!0);return[.5*(E[0]-I[0])/f,.5*(E[1]-I[1])/f]},u.dxydb_rough=function(T,p,M){var f=A*(M||.1),E=u.ab2xy(T,p+f,!0),I=u.ab2xy(T,p-f,!0);return[.5*(E[0]-I[0])/f,.5*(E[1]-I[1])/f]},u.dpdx=function(T){return T._m},u.dpdy=function(T){return T._m}}},13007:function(D,L,t){var b=t(34809);D.exports=function(d,e,w){var y,_,u,r=[],n=[],l=d[0].length,o=d.length;function s(Q,Z){var K,ae=0,se=0;return Q>0&&(K=d[Z][Q-1])!==void 0&&(se++,ae+=K),Q0&&(K=d[Z-1][Q])!==void 0&&(se++,ae+=K),Z0&&_0&&y1e-5);return b.log("Smoother converged to",f,"after",E,"iterations"),d}},10820:function(D,L,t){var b=t(34809).isArray1D;D.exports=function(d,e,w){var y=w("x"),_=y&&y.length,u=w("y"),r=u&&u.length;if(!_&&!r)return!1;if(e._cheater=!y,_&&!b(y)||r&&!b(u))e._length=null;else{var n=_?y.length:1/0;r&&(n=Math.min(n,u.length)),e.a&&e.a.length&&(n=Math.min(n,e.a.length)),e.b&&e.b.length&&(n=Math.min(n,e.b.length)),e._length=n}return!0}},92802:function(D,L,t){var b=t(3208).rb,d=t(6893),e=t(87163),w=t(9829),y=t(10229).defaultLine,_=t(93049).extendFlat,u=d.marker.line;D.exports=_({locations:{valType:"data_array",editType:"calc"},locationmode:d.locationmode,z:{valType:"data_array",editType:"calc"},geojson:_({},d.geojson,{}),featureidkey:d.featureidkey,text:_({},d.text,{}),hovertext:_({},d.hovertext,{}),marker:{line:{color:_({},u.color,{dflt:y}),width:_({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:d.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:d.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:_({},w.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:b(),showlegend:_({},w.showlegend,{dflt:!1})},e("",{cLetter:"z",editTypeOverride:"calc"}))},12702:function(D,L,t){var b=t(10721),d=t(63821).BADNUM,e=t(28379),w=t(99203),y=t(48861);function _(u){return u&&typeof u=="string"}D.exports=function(u,r){var n,l=r._length,o=new Array(l);n=r.geojson?function(m){return _(m)||b(m)}:_;for(var s=0;s")}}(w,s,u),[w]}},58075:function(D,L,t){D.exports={attributes:t(92802),supplyDefaults:t(51893),colorbar:t(12431),calc:t(12702),calcGeoJSON:t(4700).calcGeoJSON,plot:t(4700).plot,style:t(59342).style,styleOnSelect:t(59342).styleOnSelect,hoverPoints:t(94125),eventData:t(38414),selectPoints:t(43727),moduleType:"trace",name:"choropleth",basePlotModule:t(47544),categories:["geo","noOpacity","showLegend"],meta:{}}},4700:function(D,L,t){var b=t(45568),d=t(34809),e=t(3994),w=t(11577).getTopojsonFeatures,y=t(32919).findExtremes,_=t(59342).style;D.exports={calcGeoJSON:function(u,r){for(var n=u[0].trace,l=r[n.geo],o=l._subplot,s=n.locationmode,c=n._length,h=s==="geojson-id"?e.extractTraceFeature(u):w(n,o.topojson),x=[],m=[],g=0;g=0;w--){var y=e[w].id;if(typeof y=="string"&&y.indexOf("water")===0){for(var _=w+1;_=0;r--)_.removeLayer(u[r][1])},y.dispose=function(){var _=this.subplot.map;this._removeLayers(),_.removeSource(this.sourceId)},D.exports=function(_,u){var r=u[0].trace,n=new w(_,r.uid),l=n.sourceId,o=b(u),s=n.below=_.belowLookup["trace-"+r.uid];return _.map.addSource(l,{type:"geojson",data:o.geojson}),n._addLayers(o,s),u[0].trace._glTrace=n,n}},86227:function(D,L,t){var b=t(92802),d=t(87163),e=t(3208).rb,w=t(9829),y=t(93049).extendFlat;D.exports=y({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:y({},b.featureidkey,{}),below:{valType:"string",editType:"plot"},text:b.text,hovertext:b.hovertext,marker:{line:{color:y({},b.marker.line.color,{editType:"plot"}),width:y({},b.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:y({},b.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:y({},b.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:y({},b.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:b.hoverinfo,hovertemplate:e({},{keys:["properties"]}),showlegend:y({},w.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))},51335:function(D,L,t){var b=t(10721),d=t(34809),e=t(88856),w=t(62203),y=t(39532).makeBlank,_=t(3994);function u(r){var n,l=r[0].trace,o=l._opts;if(l.selectedpoints){for(var s=w.makeSelectedPointStyleFns(l),c=0;c=0;w--){var y=e[w].id;if(typeof y=="string"&&y.indexOf("water")===0){for(var _=w+1;_=0;r--)_.removeLayer(u[r][1])},y.dispose=function(){var _=this.subplot.map;this._removeLayers(),_.removeSource(this.sourceId)},D.exports=function(_,u){var r=u[0].trace,n=new w(_,r.uid),l=n.sourceId,o=b(u),s=n.below=_.belowLookup["trace-"+r.uid];return _.map.addSource(l,{type:"geojson",data:o.geojson}),n._addLayers(o,s),u[0].trace._glTrace=n,n}},49865:function(D,L,t){var b=t(87163),d=t(80712).axisHoverFormat,e=t(3208).rb,w=t(42450),y=t(9829),_=t(93049).extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:e({editType:"calc"},{keys:["norm"]}),uhoverformat:d("u",1),vhoverformat:d("v",1),whoverformat:d("w",1),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),showlegend:_({},y.showlegend,{dflt:!1})};_(u,b("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach(function(r){u[r]=w[r]}),u.hoverinfo=_({},y.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,D.exports=u},93805:function(D,L,t){var b=t(28379);D.exports=function(d,e){for(var w=e.u,y=e.v,_=e.w,u=Math.min(e.x.length,e.y.length,e.z.length,w.length,y.length,_.length),r=-1/0,n=1/0,l=0;ly.level||y.starts.length&&w===y.level)}break;case"constraint":if(d.prefixBoundary=!1,d.edgepaths.length)return;var _=d.x.length,u=d.y.length,r=-1/0,n=1/0;for(b=0;b":s>r&&(d.prefixBoundary=!0);break;case"<":(sr||d.starts.length&&o===n)&&(d.prefixBoundary=!0);break;case"][":l=Math.min(s[0],s[1]),o=Math.max(s[0],s[1]),lr&&(d.prefixBoundary=!0)}}}},92697:function(D,L,t){var b=t(88856),d=t(16438),e=t(48715);D.exports={min:"zmin",max:"zmax",calc:function(w,y,_){var u=y.contours,r=y.line,n=u.size||1,l=u.coloring,o=d(y,{isColorbar:!0});if(l==="heatmap"){var s=b.extractOpts(y);_._fillgradient=s.reversescale?b.flipScale(s.colorscale):s.colorscale,_._zrange=[s.min,s.max]}else l==="fill"&&(_._fillcolor=o);_._line={color:l==="lines"?o:r.color,width:u.showlines!==!1?r.width:0,dash:r.dash},_._levels={start:u.start,end:e(u),size:n}}}},53156:function(D){D.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}}},29503:function(D,L,t){var b=t(10721),d=t(20576),e=t(78766),w=e.addOpacity,y=e.opacity,_=t(20726),u=t(34809).isArrayOrTypedArray,r=_.CONSTRAINT_REDUCTION,n=_.COMPARISON_OPS2;D.exports=function(l,o,s,c,h,x){var m,g,k,A=o.contours,v=s("contours.operation");A._operation=r[v],function(S,T){var p;n.indexOf(T.operation)===-1?(S("contours.value",[0,1]),u(T.value)?T.value.length>2?T.value=T.value.slice(2):T.length===0?T.value=[0,1]:T.length<2?(p=parseFloat(T.value[0]),T.value=[p,p+1]):T.value=[parseFloat(T.value[0]),parseFloat(T.value[1])]:b(T.value)&&(p=parseFloat(T.value),T.value=[p,p+1])):(S("contours.value",0),b(T.value)||(u(T.value)?T.value=parseFloat(T.value[0]):T.value=0))}(s,A),v==="="?m=A.showlines=!0:(m=s("contours.showlines"),k=s("fillcolor",w((l.line||{}).color||h,.5))),m&&(g=s("line.color",k&&y(k)?w(o.fillcolor,1):h),s("line.width",2),s("line.dash")),s("line.smoothing"),d(s,c,g,x)}},22783:function(D,L,t){var b=t(20726),d=t(10721);function e(_,u){var r,n=Array.isArray(u);function l(o){return d(o)?+o:null}return b.COMPARISON_OPS2.indexOf(_)!==-1?r=l(n?u[0]:u):b.INTERVAL_OPS.indexOf(_)!==-1?r=n?[l(u[0]),l(u[1])]:[l(u),l(u)]:b.SET_OPS.indexOf(_)!==-1&&(r=n?u.map(l):[l(u)]),r}function w(_){return function(u){u=e(_,u);var r=Math.min(u[0],u[1]),n=Math.max(u[0],u[1]);return{start:r,end:n,size:n-r}}}function y(_){return function(u){return{start:u=e(_,u),end:1/0,size:1/0}}}D.exports={"[]":w("[]"),"][":w("]["),">":y(">"),"<":y("<"),"=":y("=")}},47495:function(D){D.exports=function(L,t,b,d){var e=d("contours.start"),w=d("contours.end"),y=e===!1||w===!1,_=b("contours.size");!(y?t.autocontour=!0:b("autocontour",!1))&&_||b("ncontours")}},1999:function(D,L,t){var b=t(34809);function d(e){return b.extendFlat({},e,{edgepaths:b.extendDeep([],e.edgepaths),paths:b.extendDeep([],e.paths),starts:b.extendDeep([],e.starts)})}D.exports=function(e,w){var y,_,u,r=function(o){return o.reverse()},n=function(o){return o};switch(w){case"=":case"<":return e;case">":for(e.length!==1&&b.warn("Contour data invalid for the specified inequality operation."),_=e[0],y=0;y<_.edgepaths.length;y++)_.edgepaths[y]=r(_.edgepaths[y]);for(y=0;y<_.paths.length;y++)_.paths[y]=r(_.paths[y]);for(y=0;y<_.starts.length;y++)_.starts[y]=r(_.starts[y]);return e;case"][":var l=r;r=n,n=l;case"[]":for(e.length!==2&&b.warn("Contour data invalid for the specified inequality range operation."),_=d(e[0]),u=d(e[1]),y=0;y<_.edgepaths.length;y++)_.edgepaths[y]=r(_.edgepaths[y]);for(y=0;y<_.paths.length;y++)_.paths[y]=r(_.paths[y]);for(y=0;y<_.starts.length;y++)_.starts[y]=r(_.starts[y]);for(;u.edgepaths.length;)_.edgepaths.push(n(u.edgepaths.shift()));for(;u.paths.length;)_.paths.push(n(u.paths.shift()));for(;u.starts.length;)_.starts.push(n(u.starts.shift()));return[_]}}},57543:function(D,L,t){var b=t(34809),d=t(86073),e=t(99669),w=t(29503),y=t(47495),_=t(39889),u=t(63814),r=t(52240);D.exports=function(n,l,o,s){function c(x,m){return b.coerce(n,l,r,x,m)}if(d(n,l,c,s)){e(n,l,s,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hoverongaps"),c("hovertemplate");var h=c("contours.type")==="constraint";c("connectgaps",b.isArray1D(l.z)),h?w(n,l,c,s,o):(y(n,l,c,function(x){return b.coerce2(n,l,r,x)}),_(n,l,c,s)),l.contours&&l.contours.coloring==="heatmap"&&u(c,s),c("zorder")}else l.visible=!1}},86828:function(D,L,t){var b=t(34809),d=t(22783),e=t(48715);D.exports=function(w,y,_){for(var u=w.type==="constraint"?d[w._operation](w.value):w,r=u.size,n=[],l=e(u),o=_.trace._carpetTrace,s=o?{xaxis:o.aaxis,yaxis:o.baxis,x:_.a,y:_.b}:{xaxis:y.xaxis,yaxis:y.yaxis,x:_.x,y:_.y},c=u.start;c1e3){b.warn("Too many contours, clipping at 1000",w);break}return n}},48715:function(D){D.exports=function(L){return L.end+L.size/1e6}},27657:function(D,L,t){var b=t(34809),d=t(53156);function e(_,u,r,n){return Math.abs(_[0]-u[0])20&&ge?le===208||le===1114?me=ye[0]===0?1:-1:be=ye[1]===0?1:-1:d.BOTTOMSTART.indexOf(le)!==-1?be=1:d.LEFTSTART.indexOf(le)!==-1?me=1:d.TOPSTART.indexOf(le)!==-1?be=-1:me=-1,[me,be]}(c,r,u),x=[y(_,u,[-h[0],-h[1]])],m=_.z.length,g=_.z[0].length,k=u.slice(),A=h.slice();for(o=0;o<1e4;o++){if(c>20?(c=d.CHOOSESADDLE[c][(h[0]||h[1])<0?0:1],_.crossings[s]=d.SADDLEREMAINDER[c]):delete _.crossings[s],!(h=d.NEWDELTA[c])){b.log("Found bad marching index:",c,u,_.level);break}x.push(y(_,u,h)),u[0]+=h[0],u[1]+=h[1],s=u.join(","),e(x[x.length-1],x[x.length-2],n,l)&&x.pop();var v=h[0]&&(u[0]<0||u[0]>g-2)||h[1]&&(u[1]<0||u[1]>m-2);if(u[0]===k[0]&&u[1]===k[1]&&h[0]===A[0]&&h[1]===A[1]||r&&v)break;c=_.crossings[s]}o===1e4&&b.log("Infinite loop in contour?");var S,T,p,M,f,E,I,B,N,V,j,$,ee,H,J,Q=e(x[0],x[x.length-1],n,l),Z=0,K=.2*_.smoothing,ae=[],se=0;for(o=1;o=se;o--)if((S=ae[o])=se&&S+ae[T]B&&N--,_.edgepaths[N]=j.concat(x,V));break}oe||(_.edgepaths[B]=x.concat(V))}for(B=0;B<_.edgepaths.length&&!ie;B++)e((V=_.edgepaths[B])[V.length-1],x[0],n,l)&&(x.shift(),_.edgepaths[B]=V.concat(x),ie=!0);ie||_.edgepaths.push(x)}}function y(_,u,r){var n=u[0]+Math.max(r[0],0),l=u[1]+Math.max(r[1],0),o=_.z[l][n],s=_.xaxis,c=_.yaxis;if(r[1]){var h=(_.level-o)/(_.z[l][n+1]-o),x=(h!==1?(1-h)*s.c2l(_.x[n]):0)+(h!==0?h*s.c2l(_.x[n+1]):0);return[s.c2p(s.l2c(x),!0),c.c2p(_.y[l],!0),n+h,l]}var m=(_.level-o)/(_.z[l+1][n]-o),g=(m!==1?(1-m)*c.c2l(_.y[l]):0)+(m!==0?m*c.c2l(_.y[l+1]):0);return[s.c2p(_.x[n],!0),c.c2p(c.l2c(g),!0),n,l+m]}D.exports=function(_,u,r){var n,l,o,s;for(u=u||.01,r=r||.01,l=0;l<_.length;l++){for(o=_[l],s=0;s=A)&&(_<=k&&(_=k),u>=A&&(u=A),n=Math.floor((u-_)/r)+1,l=0),c=0;ck&&(m.unshift(k),g.unshift(g[0])),m[m.length-1]e?0:1)+(w[0][1]>e?0:2)+(w[1][1]>e?0:4)+(w[1][0]>e?0:8);return y===5||y===10?e>(w[0][0]+w[0][1]+w[1][0]+w[1][1])/4?y===5?713:1114:y===5?104:208:y===15?0:y}D.exports=function(e){var w,y,_,u,r,n,l,o,s,c=e[0].z,h=c.length,x=c[0].length,m=h===2||x===2;for(y=0;y=0&&(T=J,M=f):Math.abs(S[1]-T[1])<.01?Math.abs(S[1]-J[1])<.01&&(J[0]-S[0])*(T[0]-J[0])>=0&&(T=J,M=f):d.log("endpt to newendpt is not vert. or horz.",S,T,J)}if(S=T,M>=0)break;B+="L"+T}if(M===A.edgepaths.length){d.log("unclosed perimeter path");break}N=M,(j=V.indexOf(N)===-1)&&(N=V[0],B+="Z")}for(N=0;NT.center?T.right-f:f-T.left)/(B+Math.abs(Math.sin(I)*M)),j=(E>T.middle?T.bottom-E:E-T.top)/(Math.abs(N)+Math.cos(I)*M);if(V<1||j<1)return 1/0;var $=x.EDGECOST*(1/(V-1)+1/(j-1));$+=x.ANGLECOST*I*I;for(var ee=f-B,H=E-N,J=f+B,Q=E+N,Z=0;Z2*x.MAXCOST)break;j&&(f/=2),E=(M=I-f/2)+1.5*f}if(V<=x.MAXCOST)return B},L.addLabelData=function(A,v,S,T){var p=v.fontSize,M=v.width+p/3,f=Math.max(0,v.height-p/3),E=A.x,I=A.y,B=A.theta,N=Math.sin(B),V=Math.cos(B),j=function(ee,H){return[E+ee*V-H*N,I+ee*N+H*V]},$=[j(-M/2,-f/2),j(-M/2,f/2),j(M/2,f/2),j(M/2,-f/2)];S.push({text:v.text,x:E,y:I,dy:v.dy,theta:B,level:v.level,width:M,height:f}),T.push($)},L.drawLabels=function(A,v,S,T,p){var M=A.selectAll("text").data(v,function(I){return I.text+","+I.x+","+I.y+","+I.theta});if(M.exit().remove(),M.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(I){var B=I.x+Math.sin(I.theta)*I.dy,N=I.y-Math.cos(I.theta)*I.dy;b.select(this).text(I.text).attr({x:B,y:N,transform:"rotate("+180*I.theta/Math.PI+" "+B+" "+N+")"}).call(y.convertToTspans,S)}),p){for(var f="",E=0;E_.end&&(_.start=_.end=(_.start+_.end)/2),w._input.contours||(w._input.contours={}),d.extendFlat(w._input.contours,{start:_.start,end:_.end,size:_.size}),w._input.autocontour=!0}else if(_.type!=="constraint"){var l,o=_.start,s=_.end,c=w._input.contours;o>s&&(_.start=c.start=s,s=_.end=c.end=o,o=_.start),_.size>0||(l=o===s?1:e(o,s,w.ncontours).dtick,c.size=_.size=l)}}},1328:function(D,L,t){var b=t(45568),d=t(62203),e=t(12774),w=t(16438);D.exports=function(y){var _=b.select(y).selectAll("g.contour");_.style("opacity",function(u){return u[0].trace.opacity}),_.each(function(u){var r=b.select(this),n=u[0].trace,l=n.contours,o=n.line,s=l.size||1,c=l.start,h=l.type==="constraint",x=!h&&l.coloring==="lines",m=!h&&l.coloring==="fill",g=x||m?w(n):null;r.selectAll("g.contourlevel").each(function(v){b.select(this).selectAll("path").call(d.lineGroupStyle,o.width,x?g(v.level):o.color,o.dash)});var k=l.labelfont;if(r.selectAll("g.contourlabels text").each(function(v){d.font(b.select(this),{weight:k.weight,style:k.style,variant:k.variant,textcase:k.textcase,lineposition:k.lineposition,shadow:k.shadow,family:k.family,size:k.size,color:k.color||(x?g(v.level):o.color)})}),h)r.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(m){var A;r.selectAll("g.contourfill path").style("fill",function(v){return A===void 0&&(A=v.level),g(v.level+.5*s)}),A===void 0&&(A=c),r.selectAll("g.contourbg path").style("fill",g(A-.5*s))}}),e(y)}},39889:function(D,L,t){var b=t(39356),d=t(20576);D.exports=function(e,w,y,_,u){var r,n=y("contours.coloring"),l="";n==="fill"&&(r=y("contours.showlines")),r!==!1&&(n!=="lines"&&(l=y("line.color","#000")),y("line.width",.5),y("line.dash")),n!=="none"&&(e.showlegend!==!0&&(w.showlegend=!1),w._dfltShowLegend=!1,b(e,w,_,y,{prefix:"",cLetter:"z"})),y("line.smoothing"),d(y,_,l,u)}},66365:function(D,L,t){var b=t(81658),d=t(52240),e=t(87163),w=t(93049).extendFlat,y=d.contours;D.exports=w({carpet:{valType:"string",editType:"calc"},z:b.z,a:b.x,a0:b.x0,da:b.dx,b:b.y,b0:b.y0,db:b.dy,text:b.text,hovertext:b.hovertext,transpose:b.transpose,atype:b.xtype,btype:b.ytype,fillcolor:d.fillcolor,autocontour:d.autocontour,ncontours:d.ncontours,contours:{type:y.type,start:y.start,end:y.end,size:y.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:y.showlines,showlabels:y.showlabels,labelfont:y.labelfont,labelformat:y.labelformat,operation:y.operation,value:y.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:d.line.color,width:d.line.width,dash:d.line.dash,smoothing:d.line.smoothing,editType:"plot"},zorder:d.zorder,transforms:void 0},e("",{cLetter:"z",autoColorDflt:!1}))},80849:function(D,L,t){var b=t(28379),d=t(34809),e=t(87869),w=t(93877),y=t(69295),_=t(78106),u=t(80924),r=t(50538),n=t(26571),l=t(62475);D.exports=function(o,s){var c=s._carpetTrace=n(o,s);if(c&&c.visible&&c.visible!=="legendonly"){if(!s.a||!s.b){var h=o.data[c.index],x=o.data[s.index];x.a||(x.a=h.a),x.b||(x.b=h.b),r(x,s,s._defaultColor,o._fullLayout)}var m=function(g,k){var A,v,S,T,p,M,f,E=k._carpetTrace,I=E.aaxis,B=E.baxis;I._minDtick=0,B._minDtick=0,d.isArray1D(k.z)&&e(k,I,B,"a","b",["z"]),A=k._a=k._a||k.a,T=k._b=k._b||k.b,A=A?I.makeCalcdata(k,"_a"):[],T=T?B.makeCalcdata(k,"_b"):[],v=k.a0||0,S=k.da||1,p=k.b0||0,M=k.db||1,f=k._z=w(k._z||k.z,k.transpose),k._emptypoints=_(f),y(f,k._emptypoints);var N=d.maxRowLength(f),V=k.xtype==="scaled"?"":A,j=u(k,V,v,S,N,I),$=k.ytype==="scaled"?"":T,ee={a:j,b:u(k,$,p,M,f.length,B),z:f};return k.contours.type==="levels"&&k.contours.coloring!=="none"&&b(g,k,{vals:f,containerStr:"",cLetter:"z"}),[ee]}(o,s);return l(s,s._z),m}}},50538:function(D,L,t){var b=t(34809),d=t(86073),e=t(66365),w=t(29503),y=t(47495),_=t(39889);D.exports=function(u,r,n,l){function o(s,c){return b.coerce(u,r,e,s,c)}if(o("carpet"),u.a&&u.b){if(!d(u,r,o,l,"a","b"))return void(r.visible=!1);o("text"),o("contours.type")==="constraint"?w(u,r,o,l,n,{hasHover:!1}):(y(u,r,o,function(s){return b.coerce2(u,r,e,s)}),_(u,r,o,l,{hasHover:!1}))}else r._defaultColor=n,r._length=null;o("zorder")}},34406:function(D,L,t){D.exports={attributes:t(66365),supplyDefaults:t(50538),colorbar:t(92697),calc:t(80849),plot:t(71815),style:t(1328),moduleType:"trace",name:"contourcarpet",basePlotModule:t(37703),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},71815:function(D,L,t){var b=t(45568),d=t(6720),e=t(3685),w=t(62203),y=t(34809),_=t(83545),u=t(27657),r=t(8850),n=t(53156),l=t(1999),o=t(86828),s=t(49886),c=t(26571),h=t(94903);function x(k,A,v){var S=k.getPointAtLength(A),T=k.getPointAtLength(v),p=T.x-S.x,M=T.y-S.y,f=Math.sqrt(p*p+M*M);return[p/f,M/f]}function m(k){var A=Math.sqrt(k[0]*k[0]+k[1]*k[1]);return[k[0]/A,k[1]/A]}function g(k,A){var v=Math.abs(k[0]*A[0]+k[1]*A[1]);return Math.sqrt(1-v*v)/v}D.exports=function(k,A,v,S){var T=A.xaxis,p=A.yaxis;y.makeTraceGroups(S,v,"contour").each(function(M){var f=b.select(this),E=M[0],I=E.trace,B=I._carpetTrace=c(k,I),N=k.calcdata[B.index][0];if(B.visible&&B.visible!=="legendonly"){var V=E.a,j=E.b,$=I.contours,ee=o($,A,E),H=$.type==="constraint",J=$._operation,Q=H?J==="="?"lines":"fill":$.coloring,Z=[[V[0],j[j.length-1]],[V[V.length-1],j[j.length-1]],[V[V.length-1],j[0]],[V[0],j[0]]];_(ee);var K=1e-8*(V[V.length-1]-V[0]),ae=1e-8*(j[j.length-1]-j[0]);u(ee,K,ae);var se,he,fe,ie,oe=ee;$.type==="constraint"&&(oe=l(ee,J)),function(me,be){var Se,Ee,Ce,Le,Oe,We,Ie,Ve,Pe;for(Se=0;Se=0;ie--)se=N.clipsegments[ie],he=d([],se.x,T.c2p),fe=d([],se.y,p.c2p),he.reverse(),fe.reverse(),le.push(e(he,fe,se.bicubic));var ge="M"+le.join("L")+"Z";(function(me,be,Se,Ee,Ce,Le){var Oe,We,Ie,Ve,Pe=y.ensureSingle(me,"g","contourbg").selectAll("path").data(Le!=="fill"||Ce?[]:[0]);Pe.enter().append("path"),Pe.exit().remove();var de=[];for(Ve=0;Ve=0&&(pt=Tt,wt=Nt):Math.abs(nt[1]-pt[1])=0&&(pt=Tt,wt=Nt):y.log("endpt to newendpt is not vert. or horz.",nt,pt,Tt)}if(wt>=0)break;Gt+=Xe(nt,pt),nt=pt}if(wt===qe.edgepaths.length){y.log("unclosed perimeter path");break}tt=wt,(Qe=st.indexOf(tt)===-1)&&(tt=st[0],Gt+=Xe(nt,pt)+"Z",nt=null)}for(tt=0;ttFt&&(at.max=Ft),at.len=at.max-at.min}function St(Jt,qt){var en,Wt=0,Zt=.1;return(Math.abs(Jt[0]-vt)0?+h[o]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:A})}}var S=w.extractOpts(r),T=S.reversescale?w.flipScale(S.colorscale):S.colorscale,p=T[0][1],M=["interpolate",["linear"],["heatmap-density"],0,e.opacity(p)<1?p:e.addOpacity(p,0)];for(o=1;o=0;u--)y.removeLayer(_[u][1])},w.dispose=function(){var y=this.subplot.map;this._removeLayers(),y.removeSource(this.sourceId)},D.exports=function(y,_){var u=_[0].trace,r=new e(y,u.uid),n=r.sourceId,l=b(_),o=r.below=y.belowLookup["trace-"+u.uid];return y.map.addSource(n,{type:"geojson",data:l.geojson}),r._addLayers(l,o),r}},17347:function(D,L,t){var b=t(87163),d=t(3208).rb,e=t(9829),w=t(95833),y=t(93049).extendFlat;D.exports=y({lon:w.lon,lat:w.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:w.text,hovertext:w.hovertext,hoverinfo:y({},e.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:d(),showlegend:y({},e.showlegend,{dflt:!1})},b("",{cLetter:"z",editTypeOverride:"calc"}))},60675:function(D,L,t){var b=t(10721),d=t(34809).isArrayOrTypedArray,e=t(63821).BADNUM,w=t(28379),y=t(34809)._;D.exports=function(_,u){for(var r=u._length,n=new Array(r),l=u.z,o=d(l)&&l.length,s=0;s0?+h[o]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:A})}}var S=w.extractOpts(r),T=S.reversescale?w.flipScale(S.colorscale):S.colorscale,p=T[0][1],M=["interpolate",["linear"],["heatmap-density"],0,e.opacity(p)<1?p:e.addOpacity(p,0)];for(o=1;o=0;u--)y.removeLayer(_[u][1])},w.dispose=function(){var y=this.subplot.map;this._removeLayers(),y.removeSource(this.sourceId)},D.exports=function(y,_){var u=_[0].trace,r=new e(y,u.uid),n=r.sourceId,l=b(_),o=r.below=y.belowLookup["trace-"+u.uid];return y.map.addSource(n,{type:"geojson",data:l.geojson}),r._addLayers(l,o),r}},43179:function(D,L,t){var b=t(34809);D.exports=function(d,e){for(var w=0;w"),n.color=function(A,v){var S=A.marker,T=v.mc||S.color,p=v.mlc||S.line.color,M=v.mlw||S.line.width;return b(T)?T:b(p)&&M?p:void 0}(o,c),[n]}}},52213:function(D,L,t){D.exports={attributes:t(62824),layoutAttributes:t(93795),supplyDefaults:t(30495).supplyDefaults,crossTraceDefaults:t(30495).crossTraceDefaults,supplyLayoutDefaults:t(34980),calc:t(28152),crossTraceCalc:t(82539),plot:t(83482),style:t(7240).style,hoverPoints:t(27759),eventData:t(29412),selectPoints:t(88384),moduleType:"trace",name:"funnel",basePlotModule:t(37703),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},93795:function(D){D.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},34980:function(D,L,t){var b=t(34809),d=t(93795);D.exports=function(e,w,y){var _=!1;function u(l,o){return b.coerce(e,w,d,l,o)}for(var r=0;r path").each(function(x){if(!x.isBlank){var m=h.marker;b.select(this).call(e.fill,x.mc||m.color).call(e.stroke,x.mlc||m.line.color).call(d.dashLine,m.line.dash,x.mlw||m.line.width).style("opacity",h.selectedpoints&&!x.selected?w:1)}}),u(c,h,r),c.selectAll(".regions").each(function(){b.select(this).selectAll("path").style("stroke-width",0).call(e.fill,h.connector.fillcolor)}),c.selectAll(".lines").each(function(){var x=h.connector.line;d.lineGroupStyle(b.select(this).selectAll("path"),x.width,x.color,x.dash)})})}}},63447:function(D,L,t){var b=t(55412),d=t(9829),e=t(13792).u,w=t(3208).rb,y=t(3208).ay,_=t(93049).extendFlat;D.exports={labels:b.labels,label0:b.label0,dlabel:b.dlabel,values:b.values,marker:{colors:b.marker.colors,line:{color:_({},b.marker.line.color,{dflt:null}),width:_({},b.marker.line.width,{dflt:1}),editType:"calc"},pattern:b.marker.pattern,editType:"calc"},text:b.text,hovertext:b.hovertext,scalegroup:_({},b.scalegroup,{}),textinfo:_({},b.textinfo,{flags:["label","text","value","percent"]}),texttemplate:y({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:_({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:w({},{keys:["label","color","value","text","percent"]}),textposition:_({},b.textposition,{values:["inside","none"],dflt:"inside"}),textfont:b.textfont,insidetextfont:b.insidetextfont,title:{text:b.title.text,font:b.title.font,position:_({},b.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:e({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"}}},86817:function(D,L,t){var b=t(44122);L.name="funnelarea",L.plot=function(d,e,w,y){b.plotBasePlot(L.name,d,e,w,y)},L.clean=function(d,e,w,y){b.cleanBasePlot(L.name,d,e,w,y)}},2807:function(D,L,t){var b=t(44148);D.exports={calc:function(d,e){return b.calc(d,e)},crossTraceCalc:function(d){b.crossTraceCalc(d,{type:"funnelarea"})}}},79824:function(D,L,t){var b=t(34809),d=t(63447),e=t(13792).N,w=t(17550).handleText,y=t(46979).handleLabelsAndValues,_=t(46979).handleMarkerDefaults;D.exports=function(u,r,n,l){function o(v,S){return b.coerce(u,r,d,v,S)}var s=o("labels"),c=o("values"),h=y(s,c),x=h.len;if(r._hasLabels=h.hasLabels,r._hasValues=h.hasValues,!r._hasLabels&&r._hasValues&&(o("label0"),o("dlabel")),x){r._length=x,_(u,r,l,o),o("scalegroup");var m,g=o("text"),k=o("texttemplate");if(k||(m=o("textinfo",Array.isArray(g)?"text+percent":"percent")),o("hovertext"),o("hovertemplate"),k||m&&m!=="none"){var A=o("textposition");w(u,r,l,o,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else m==="none"&&o("textposition","none");e(r,l,o),o("title.text")&&(o("title.position"),b.coerceFont(o,"title.font",l.font)),o("aspectratio"),o("baseratio")}else r.visible=!1}},91132:function(D,L,t){D.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t(86817),categories:["pie-like","funnelarea","showLegend"],attributes:t(63447),layoutAttributes:t(10270),supplyDefaults:t(79824),supplyLayoutDefaults:t(69161),calc:t(2807).calc,crossTraceCalc:t(2807).crossTraceCalc,plot:t(96673),style:t(13757),styleOne:t(32891),meta:{}}},10270:function(D,L,t){var b=t(4031).hiddenlabels;D.exports={hiddenlabels:b,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},69161:function(D,L,t){var b=t(34809),d=t(10270);D.exports=function(e,w){function y(_,u){return b.coerce(e,w,d,_,u)}y("hiddenlabels"),y("funnelareacolorway",w.colorway),y("extendfunnelareacolors")}},96673:function(D,L,t){var b=t(45568),d=t(62203),e=t(34809),w=e.strScale,y=e.strTranslate,_=t(30635),u=t(32995).toMoveInsideBar,r=t(84102),n=r.recordMinTextSize,l=r.clearMinTextSize,o=t(37252),s=t(35734),c=s.attachFxHandlers,h=s.determineInsideTextFont,x=s.layoutAreas,m=s.prerenderTitles,g=s.positionTitleOutside,k=s.formatSliceLabel;function A(v,S){return"l"+(S[0]-v[0])+","+(S[1]-v[1])}D.exports=function(v,S){var T=v._context.staticPlot,p=v._fullLayout;l("funnelarea",p),m(S,v),x(S,p._size),e.makeTraceGroups(p._funnelarealayer,S,"trace").each(function(M){var f=b.select(this),E=M[0],I=E.trace;(function(B){if(B.length){var N=B[0],V=N.trace,j=V.aspectratio,$=V.baseratio;$>.999&&($=.999);var ee,H,J,Q=Math.pow($,2),Z=N.vTotal,K=Z,ae=Z*Q/(1-Q)/Z,se=[];for(se.push(Ie()),H=B.length-1;H>-1;H--)if(!(J=B[H]).hidden){var he=J.v/K;ae+=he,se.push(Ie())}var fe=1/0,ie=-1/0;for(H=0;H-1;H--)if(!(J=B[H]).hidden){var Oe=se[Le+=1][0],We=se[Le][1];J.TL=[-Oe,We],J.TR=[Oe,We],J.BL=Ee,J.BR=Ce,J.pxmid=(be=J.TR,Se=J.BR,[.5*(be[0]+Se[0]),.5*(be[1]+Se[1])]),Ee=J.TL,Ce=J.TR}}function Ie(){var Ve,Pe={x:Ve=Math.sqrt(ae),y:-Ve};return[Pe.x,Pe.y]}})(M),f.each(function(){var B=b.select(this).selectAll("g.slice").data(M);B.enter().append("g").classed("slice",!0),B.exit().remove(),B.each(function(V,j){if(V.hidden)b.select(this).selectAll("path,g").remove();else{V.pointNumber=V.i,V.curveNumber=I.index;var $=E.cx,ee=E.cy,H=b.select(this),J=H.selectAll("path.surface").data([V]);J.enter().append("path").classed("surface",!0).style({"pointer-events":T?"none":"all"}),H.call(c,v,M);var Q="M"+($+V.TR[0])+","+(ee+V.TR[1])+A(V.TR,V.BR)+A(V.BR,V.BL)+A(V.BL,V.TL)+"Z";J.attr("d",Q),k(v,V,E);var Z=o.castOption(I.textposition,V.pts),K=H.selectAll("g.slicetext").data(V.text&&Z!=="none"?[0]:[]);K.enter().append("g").classed("slicetext",!0),K.exit().remove(),K.each(function(){var ae=e.ensureSingle(b.select(this),"text","",function(ye){ye.attr("data-notex",1)}),se=e.ensureUniformFontSize(v,h(I,V,p.font));ae.text(V.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,se).call(_.convertToTspans,v);var he,fe,ie,oe=d.bBox(ae.node()),le=Math.min(V.BL[1],V.BR[1])+ee,ge=Math.max(V.TL[1],V.TR[1])+ee;fe=Math.max(V.TL[0],V.BL[0])+$,ie=Math.min(V.TR[0],V.BR[0])+$,(he=u(fe,ie,le,ge,oe,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=se.size,n(I.type,he,p),M[j].transform=he,e.setTransormAndDisplay(ae,he)})}});var N=b.select(this).selectAll("g.titletext").data(I.title.text?[0]:[]);N.enter().append("g").classed("titletext",!0),N.exit().remove(),N.each(function(){var V=e.ensureSingle(b.select(this),"text","",function(ee){ee.attr("data-notex",1)}),j=I.title.text;I._meta&&(j=e.templateString(j,I._meta)),V.text(j).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(d.font,I.title.font).call(_.convertToTspans,v);var $=g(E,p._size);V.attr("transform",y($.x,$.y)+w(Math.min(1,$.scale))+y($.tx,$.ty))})})})}},13757:function(D,L,t){var b=t(45568),d=t(32891),e=t(84102).resizeText;D.exports=function(w){var y=w._fullLayout._funnelarealayer.selectAll(".trace");e(w,y,"funnelarea"),y.each(function(_){var u=_[0].trace,r=b.select(this);r.style({opacity:u.opacity}),r.selectAll("path.surface").each(function(n){b.select(this).call(d,n,u,w)})})}},81658:function(D,L,t){var b=t(36640),d=t(9829),e=t(80337),w=t(80712).axisHoverFormat,y=t(3208).rb,_=t(3208).ay,u=t(87163),r=t(93049).extendFlat;D.exports=r({z:{valType:"data_array",editType:"calc"},x:r({},b.x,{impliedEdits:{xtype:"array"}}),x0:r({},b.x0,{impliedEdits:{xtype:"scaled"}}),dx:r({},b.dx,{impliedEdits:{xtype:"scaled"}}),y:r({},b.y,{impliedEdits:{ytype:"array"}}),y0:r({},b.y0,{impliedEdits:{ytype:"scaled"}}),dy:r({},b.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:r({},b.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:r({},b.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:r({},b.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:r({},b.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:r({},b.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:r({},b.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:w("x"),yhoverformat:w("y"),zhoverformat:w("z",1),hovertemplate:y(),texttemplate:_({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:e({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:r({},d.showlegend,{dflt:!1}),zorder:b.zorder},{transforms:void 0},u("",{cLetter:"z",autoColorDflt:!1}))},51670:function(D,L,t){var b=t(33626),d=t(34809),e=t(29714),w=t(40528),y=t(19226),_=t(28379),u=t(87869),r=t(93877),n=t(69295),l=t(78106),o=t(80924),s=t(63821).BADNUM;function c(h){for(var x=[],m=h.length,g=0;g1){var oe=(ie[ie.length-1]-ie[0])/(ie.length-1),le=Math.abs(oe/100);for(f=0;fle)return!1}return!0}(I.rangebreaks||B.rangebreaks)&&(M=function(ie,oe,le){for(var ge=[],ye=-1,me=0;me=0;u--)(r=((s[[(w=(_=c[u])[0])-1,y=_[1]]]||m)[2]+(s[[w+1,y]]||m)[2]+(s[[w,y-1]]||m)[2]+(s[[w,y+1]]||m)[2])/20)&&(n[_]=[w,y,r],c.splice(u,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(_ in n)s[_]=n[_],o.push(n[_])}return o.sort(function(k,A){return A[2]-k[2]})}},93125:function(D,L,t){var b=t(32141),d=t(34809),e=d.isArrayOrTypedArray,w=t(29714),y=t(88856).extractOpts;D.exports=function(_,u,r,n,l){l||(l={});var o,s,c,h,x=l.isContour,m=_.cd[0],g=m.trace,k=_.xa,A=_.ya,v=m.x,S=m.y,T=m.z,p=m.xCenter,M=m.yCenter,f=m.zmask,E=g.zhoverformat,I=v,B=S;if(_.index!==!1){try{c=Math.round(_.index[1]),h=Math.round(_.index[0])}catch{return void d.error("Error hovering on heatmap, pointNumber must be [row,col], found:",_.index)}if(c<0||c>=T[0].length||h<0||h>T.length)return}else{if(b.inbox(u-v[0],u-v[v.length-1],0)>0||b.inbox(r-S[0],r-S[S.length-1],0)>0)return;if(x){var N;for(I=[2*v[0]-v[1]],N=1;NA&&(S=Math.max(S,Math.abs(y[n][l]-k)/(v-A))))}return S}D.exports=function(y,_){var u,r=1;for(w(y,_),u=0;u<_.length&&!(_[u][2]<4);u++);for(_=_.slice(u),u=0;u<100&&r>.01;u++)r=w(y,_,e(r));return r>.01&&b.log("interp2d didn't converge quickly",r),y}},63814:function(D,L,t){var b=t(34809);D.exports=function(d,e){d("texttemplate");var w=b.extendFlat({},e.font,{color:"auto",size:"auto"});b.coerceFont(d,"textfont",w)}},80924:function(D,L,t){var b=t(33626),d=t(34809).isArrayOrTypedArray;D.exports=function(e,w,y,_,u,r){var n,l,o,s=[],c=b.traceIs(e,"contour"),h=b.traceIs(e,"histogram"),x=b.traceIs(e,"gl2d");if(d(w)&&w.length>1&&!h&&r.type!=="category"){var m=w.length;if(!(m<=u))return c?w.slice(0,u):w.slice(0,u+1);if(c||x)s=Array.from(w).slice(0,u);else if(u===1)s=r.type==="log"?[.5*w[0],2*w[0]]:[w[0]-.5,w[0]+.5];else if(r.type==="log"){for(s=[Math.pow(w[0],1.5)/Math.pow(w[1],.5)],o=1;o0;)V=E.c2p(ie[H]),H--;for(V0;)ee=I.c2p(oe[H]),H--;ee<$&&(j=$,$=ee,ee=j,Ce=!0),ye&&(le=ie,ge=oe,ie=K.xfill,oe=K.yfill);var Le="default";if(me?Le=me==="best"?"smooth":"fast":ae._islinear&&se===0&&he===0&&h()&&(Le="fast"),Le!=="fast"){var Oe=me==="best"?0:.5;N=Math.max(-Oe*E._length,N),V=Math.min((1+Oe)*E._length,V),$=Math.max(-Oe*I._length,$),ee=Math.min((1+Oe)*I._length,ee)}var We,Ie,Ve=Math.round(V-N),Pe=Math.round(ee-$);if(N>=E._length||V<=0||$>=I._length||ee<=0)return Z.selectAll("image").data([]).exit().remove(),void k(Z);Le==="fast"?(We=Se,Ie=be):(We=Ve,Ie=Pe);var de=document.createElement("canvas");de.width=We,de.height=Ie;var Me,ke,He=de.getContext("2d",{willReadFrequently:!0}),Fe=o(ae,{noNumericCheck:!0,returnArray:!0});Le==="fast"?(Me=Ee?function(Qr){return Se-1-Qr}:_.identity,ke=Ce?function(Qr){return be-1-Qr}:_.identity):(Me=function(Qr){return _.constrain(Math.round(E.c2p(ie[Qr])-N),0,Ve)},ke=function(Qr){return _.constrain(Math.round(I.c2p(oe[Qr])-$),0,Pe)});var qe,$e,Ye,_e,De=ke(0),Be=[De,De],Ge=Ee?0:1,tt=Ce?0:1,nt=0,pt=0,At=0,wt=0;function Nt(Qr,kn){if(Qr!==void 0){var Cn=Fe(Qr);return Cn[0]=Math.round(Cn[0]),Cn[1]=Math.round(Cn[1]),Cn[2]=Math.round(Cn[2]),nt+=kn,pt+=Cn[0]*kn,At+=Cn[1]*kn,wt+=Cn[2]*kn,Cn}return[0,0,0,0]}function Ht(Qr,kn,Cn,ur){var Zn=Qr[Cn.bin0];if(Zn===void 0)return Nt(void 0,1);var cr,Ir=Qr[Cn.bin1],Er=kn[Cn.bin0],Xr=kn[Cn.bin1],ai=Ir-Zn||0,bn=Er-Zn||0;return cr=Ir===void 0?Xr===void 0?0:Er===void 0?2*(Xr-Zn):2*(2*Xr-Er-Zn)/3:Xr===void 0?Er===void 0?0:2*(2*Zn-Ir-Er)/3:Er===void 0?2*(2*Xr-Ir-Zn)/3:Xr+Zn-Ir-Er,Nt(Zn+Cn.frac*ai+ur.frac*(bn+Cn.frac*cr))}if(Le!=="default"){var Gt,st=0;try{Gt=new Uint8Array(We*Ie*4)}catch{Gt=new Array(We*Ie*4)}if(Le==="smooth"){var Qe,ft,yt,Ot=le||ie,Pt=ge||oe,at=new Array(Ot.length),lt=new Array(Pt.length),Xe=new Array(Ve),ut=le?v:A,Tt=ge?v:A;for(H=0;HDn||Dn>I._length))for(J=Zt;Jmn||mn>E._length)){var En=r({x:In,y:Pn},ae,T._fullLayout);En.x=In,En.y=Pn;var Kn=K.z[H][J];Kn===void 0?(En.z="",En.zLabel=""):(En.z=Kn,En.zLabel=y.tickText(Jt,Kn,"hover").text);var Ln=K.text&&K.text[H]&&K.text[H][J];Ln!==void 0&&Ln!==!1||(Ln=""),En.text=Ln;var Tn=_.texttemplateString(Ft,En,T._fullLayout._d3locale,En,ae._meta||{});if(Tn){var Fn=Tn.split("
"),wn=Fn.length,zn=0;for(Q=0;Q0&&(A=!0);for(var T=0;T_){var u=_-w[d];return w[d]=_,u}}return 0},max:function(d,e,w,y){var _=y[e];if(b(_)){if(_=Number(_),!b(w[d]))return w[d]=_,_;if(w[d]<_){var u=_-w[d];return w[d]=_,u}}return 0}}},64852:function(D,L,t){var b=t(63821),d=b.ONEAVGYEAR,e=b.ONEAVGMONTH,w=b.ONEDAY,y=b.ONEHOUR,_=b.ONEMIN,u=b.ONESEC,r=t(29714).tickIncrement;function n(c,h,x,m){if(c*h<=0)return 1/0;for(var g=Math.abs(h-c),k=x.type==="date",A=l(g,k),v=0;v<10;v++){var S=l(80*A,k);if(A===S||!o(S,c,h,k,x,m))break;A=S}return A}function l(c,h){return h&&c>u?c>w?c>1.1*d?d:c>1.1*e?e:w:c>y?y:c>_?_:u:Math.pow(10,Math.floor(Math.log(c)/Math.LN10))}function o(c,h,x,m,g,k){if(m&&c>w){var A=s(h,g,k),v=s(x,g,k),S=c===d?0:1;return A[S]!==v[S]}return Math.floor(x/c)-Math.floor(h/c)>.1}function s(c,h,x){var m=h.c2d(c,d,x).split("-");return m[0]===""&&(m.unshift(),m[0]="-"+m[0]),m}D.exports=function(c,h,x,m,g){var k,A,v=-1.1*h,S=-.1*h,T=c-S,p=x[0],M=x[1],f=Math.min(n(p+S,p+T,m,g),n(M+S,M+T,m,g)),E=Math.min(n(p+v,p+S,m,g),n(M+v,M+S,m,g));if(f>E&&Ew){var I=k===d?1:6,B=k===d?"M12":"M1";return function(N,V){var j=m.c2d(N,d,g),$=j.indexOf("-",I);$>0&&(j=j.substr(0,$));var ee=m.d2c(j,0,g);if(eec.r2l(oe)&&(ge=w.tickIncrement(ge,E.size,!0,A)),se.start=c.l2r(ge),ie||d.nestedProperty(s,p+".start").set(se.start)}var ye=E.end,me=c.r2l(ae.end),be=me!==void 0;if((E.endFound||be)&&me!==c.r2l(ye)){var Se=be?me:d.aggNums(Math.max,null,v);se.end=c.l2r(Se),be||d.nestedProperty(s,p+".start").set(se.end)}var Ee="autobin"+h;return s._input[Ee]===!1&&(s._input[p]=d.extendFlat({},s[p]||{}),delete s._input[Ee],delete s[Ee]),[se,v]}D.exports={calc:function(o,s){var c,h,x,m,g=[],k=[],A=s.orientation==="h",v=w.getFromId(o,A?s.yaxis:s.xaxis),S=A?"y":"x",T={x:"y",y:"x"}[S],p=s[S+"calendar"],M=s.cumulative,f=l(o,s,v,S),E=f[0],I=f[1],B=typeof E.size=="string",N=[],V=B?N:E,j=[],$=[],ee=[],H=0,J=s.histnorm,Q=s.histfunc,Z=J.indexOf("density")!==-1;M.enabled&&Z&&(J=J.replace(/ ?density$/,""),Z=!1);var K,ae=Q==="max"||Q==="min"?null:0,se=_.count,he=u[J],fe=!1,ie=function(Pe){return v.r2c(Pe,0,p)};for(d.isArrayOrTypedArray(s[T])&&Q!=="count"&&(K=s[T],fe=Q==="avg",se=_[Q]),c=ie(E.start),x=ie(E.end)+(c-w.tickIncrement(c,E.size,!1,p))/1e6;c=0&&m=0;ke--)$e(ke);else if(de==="increasing"){for(ke=1;ke=0;ke--)Pe[ke]+=Pe[ke+1];Me==="exclude"&&(Pe.push(0),Pe.shift())}}(k,M.direction,M.currentbin);var Le=Math.min(g.length,k.length),Oe=[],We=0,Ie=Le-1;for(c=0;c=We;c--)if(k[c]){Ie=c;break}for(c=We;c<=Ie;c++)if(b(g[c])&&b(k[c])){var Ve={p:g[c],s:k[c],b:0};M.enabled||(Ve.pts=ee[c],me?Ve.ph0=Ve.ph1=ee[c].length?I[ee[c][0]]:g[c]:(s._computePh=!0,Ve.ph0=ge(N[c]),Ve.ph1=ge(N[c+1],!0))),Oe.push(Ve)}return Oe.length===1&&(Oe[0].width1=w.tickIncrement(Oe[0].p,E.size,!1,p)-Oe[0].p),y(Oe,s),d.isArrayOrTypedArray(s.selectedpoints)&&d.tagSelected(Oe,s,Ee),Oe},calcAllAutoBins:l}},39732:function(D){D.exports={eventDataKeys:["binNumber"]}},83380:function(D,L,t){var b=t(34809),d=t(5975),e=t(33626).traceIs,w=t(36301),y=t(17550).validateCornerradius,_=b.nestedProperty,u=t(84391).getAxisGroup,r=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],n=["x","y"];D.exports=function(l,o){var s,c,h,x,m,g,k,A=o._histogramBinOpts={},v=[],S={},T=[];function p(ae,se){return b.coerce(s._input,s,s._module.attributes,ae,se)}function M(ae){return ae.orientation==="v"?"x":"y"}function f(ae,se,he){var fe=ae.uid+"__"+he;se||(se=fe);var ie=function(ye,me){return d.getFromTrace({_fullLayout:o},ye,me).type}(ae,he),oe=ae[he+"calendar"]||"",le=A[se],ge=!0;le&&(ie===le.axType&&oe===le.calendar?(ge=!1,le.traces.push(ae),le.dirs.push(he)):(se=fe,ie!==le.axType&&b.warn(["Attempted to group the bins of trace",ae.index,"set on a","type:"+ie,"axis","with bins on","type:"+le.axType,"axis."].join(" ")),oe!==le.calendar&&b.warn(["Attempted to group the bins of trace",ae.index,"set with a",oe,"calendar","with bins",le.calendar?"on a "+le.calendar+" calendar":"w/o a set calendar"].join(" ")))),ge&&(A[se]={traces:[ae],dirs:[he],axType:ie,calendar:ae[he+"calendar"]||""}),ae["_"+he+"bingroup"]=se}for(m=0;mN&&f.splice(N,f.length-N),B.length>N&&B.splice(N,B.length-N);var V=[],j=[],$=[],ee=typeof M.size=="string",H=typeof I.size=="string",J=[],Q=[],Z=ee?J:M,K=H?Q:I,ae=0,se=[],he=[],fe=s.histnorm,ie=s.histfunc,oe=fe.indexOf("density")!==-1,le=ie==="max"||ie==="min"?null:0,ge=e.count,ye=w[fe],me=!1,be=[],Se=[],Ee="z"in s?s.z:"marker"in s&&Array.isArray(s.marker.color)?s.marker.color:"";Ee&&ie!=="count"&&(me=ie==="avg",ge=e[ie]);var Ce=M.size,Le=S(M.start),Oe=S(M.end)+(Le-d.tickIncrement(Le,Ce,!1,A))/1e6;for(c=Le;c=0&&x=0&&m-1,flipY:j.tiling.flip.indexOf("y")>-1,orientation:j.tiling.orientation,pad:{inner:j.tiling.pad},maxDepth:j._maxDepth}).descendants(),Q=1/0,Z=-1/0;J.forEach(function(fe){var ie=fe.depth;ie>=j._maxDepth?(fe.x0=fe.x1=(fe.x0+fe.x1)/2,fe.y0=fe.y1=(fe.y0+fe.y1)/2):(Q=Math.min(Q,ie),Z=Math.max(Z,ie))}),x=x.data(J,r.getPtId),j._maxVisibleLayers=isFinite(Z)?Z-Q+1:0,x.enter().append("g").classed("slice",!0),f(x,o,{},[g,k],S),x.order();var K=null;if(M&&B){var ae=r.getPtId(B);x.each(function(fe){K===null&&r.getPtId(fe)===ae&&(K={x0:fe.x0,x1:fe.x1,y0:fe.y0,y1:fe.y1})})}var se=function(){return K||{x0:0,x1:g,y0:0,y1:k}},he=x;return M&&(he=he.transition().each("end",function(){var fe=b.select(this);r.setSliceCursor(fe,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),he.each(function(fe){fe._x0=A(fe.x0),fe._x1=A(fe.x1),fe._y0=v(fe.y0),fe._y1=v(fe.y1),fe._hoverX=A(fe.x1-j.tiling.pad),fe._hoverY=v(H?fe.y1-j.tiling.pad/2:fe.y0+j.tiling.pad/2);var ie=b.select(this),oe=d.ensureSingle(ie,"path","surface",function(me){me.style("pointer-events",N?"none":"all")});M?oe.transition().attrTween("d",function(me){var be=E(me,o,se(),[g,k],{orientation:j.tiling.orientation,flipX:j.tiling.flip.indexOf("x")>-1,flipY:j.tiling.flip.indexOf("y")>-1});return function(Se){return S(be(Se))}}):oe.attr("d",S),ie.call(n,h,s,c,{styleOne:_,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(r.setSliceCursor,s,{isTransitioning:s._transitioning}),oe.call(_,fe,j,s,{hovered:!1}),fe.x0===fe.x1||fe.y0===fe.y1?fe._text="":fe._text=l(fe,h,j,c,V)||"";var le=d.ensureSingle(ie,"g","slicetext"),ge=d.ensureSingle(le,"text","",function(me){me.attr("data-notex",1)}),ye=d.ensureUniformFontSize(s,r.determineTextFont(j,fe,V.font));ge.text(fe._text||" ").classed("slicetext",!0).attr("text-anchor",ee?"end":$?"start":"middle").call(e.font,ye).call(w.convertToTspans,s),fe.textBB=e.bBox(ge.node()),fe.transform=T(fe,{fontSize:ye.size}),fe.transform.fontSize=ye.size,M?ge.transition().attrTween("transform",function(me){var be=I(me,o,se(),[g,k]);return function(Se){return p(be(Se))}}):ge.attr("transform",p(fe))}),K}},36858:function(D,L,t){D.exports={moduleType:"trace",name:"icicle",basePlotModule:t(63387),categories:[],animatable:!0,attributes:t(12505),layoutAttributes:t(60052),supplyDefaults:t(17918),supplyLayoutDefaults:t(11747),calc:t(36349)._,crossTraceCalc:t(36349).t,plot:t(1395),style:t(50579).style,colorbar:t(21146),meta:{}}},60052:function(D){D.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},11747:function(D,L,t){var b=t(34809),d=t(60052);D.exports=function(e,w){function y(_,u){return b.coerce(e,w,d,_,u)}y("iciclecolorway",w.colorway),y("extendiciclecolors")}},29316:function(D,L,t){var b=t(92264),d=t(36141);D.exports=function(e,w,y){var _=y.flipX,u=y.flipY,r=y.orientation==="h",n=y.maxDepth,l=w[0],o=w[1];n&&(l=(e.height+1)*w[0]/Math.min(e.height+1,n),o=(e.height+1)*w[1]/Math.min(e.height+1,n));var s=b.partition().padding(y.pad.inner).size(r?[w[1],l]:[w[0],o])(e);return(r||_||u)&&d(s,w,{swapXY:r,flipX:_,flipY:u}),s}},1395:function(D,L,t){var b=t(41567),d=t(23593);D.exports=function(e,w,y,_){return b(e,w,y,_,{type:"icicle",drawDescendants:d})}},50579:function(D,L,t){var b=t(45568),d=t(78766),e=t(34809),w=t(84102).resizeText,y=t(72043);function _(u,r,n,l){var o=r.data.data,s=!r.children,c=o.i,h=e.castOption(n,c,"marker.line.color")||d.defaultLine,x=e.castOption(n,c,"marker.line.width")||0;u.call(y,r,n,l).style("stroke-width",x).call(d.stroke,h).style("opacity",s?n.leaf.opacity:null)}D.exports={style:function(u){var r=u._fullLayout._iciclelayer.selectAll(".trace");w(u,r,"icicle"),r.each(function(n){var l=b.select(this),o=n[0].trace;l.style("opacity",o.opacity),l.selectAll("path.surface").each(function(s){b.select(this).call(_,s,o,u)})})},styleOne:_}},22153:function(D,L,t){for(var b=t(9829),d=t(36640).zorder,e=t(3208).rb,w=t(93049).extendFlat,y=t(42939).colormodel,_=["rgb","rgba","rgba256","hsl","hsla"],u=[],r=[],n=0;n<_.length;n++){var l=y[_[n]];u.push("For the `"+_[n]+"` colormodel, it is ["+(l.zminDflt||l.min).join(", ")+"]."),r.push("For the `"+_[n]+"` colormodel, it is ["+(l.zmaxDflt||l.max).join(", ")+"].")}D.exports=w({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:_,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:w({},b.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:e({},{keys:["z","color","colormodel"]}),zorder:d,transforms:void 0})},31181:function(D,L,t){var b=t(34809),d=t(42939),e=t(10721),w=t(29714),y=t(34809).maxRowLength,_=t(96315).p;function u(n,l,o,s){return function(c){return b.constrain((c-n)*l,o,s)}}function r(n,l){return function(o){return b.constrain(o,n,l)}}D.exports=function(n,l){var o,s;if(l._hasZ)o=l.z.length,s=y(l.z);else if(l._hasSource){var c=_(l.source);o=c.height,s=c.width}var h,x=w.getFromId(n,l.xaxis||"x"),m=w.getFromId(n,l.yaxis||"y"),g=x.d2c(l.x0)-l.dx/2,k=m.d2c(l.y0)-l.dy/2,A=[g,g+s*l.dx],v=[k,k+o*l.dy];if(x&&x.type==="log")for(h=0;h0||b.inbox(u-r.y0,u-(r.y0+r.h*n.dy),0)>0)){var s,c=Math.floor((_-r.x0)/n.dx),h=Math.floor(Math.abs(u-r.y0)/n.dy);if(n._hasZ?s=r.z[h][c]:n._hasSource&&(s=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,h,1,1).data),s){var x,m=r.hi||n.hoverinfo;if(m){var g=m.split("+");g.indexOf("all")!==-1&&(g=["color"]),g.indexOf("color")!==-1&&(x=!0)}var k,A=w.colormodel[n.colormodel],v=A.colormodel||n.colormodel,S=v.length,T=n._scaler(s),p=A.suffix,M=[];(n.hovertemplate||x)&&(M.push("["+[T[0]+p[0],T[1]+p[1],T[2]+p[2]].join(", ")),S===4&&M.push(", "+T[3]+p[3]),M.push("]"),M=M.join(""),y.extraText=v.toUpperCase()+": "+M),e(n.hovertext)&&e(n.hovertext[h])?k=n.hovertext[h][c]:e(n.text)&&e(n.text[h])&&(k=n.text[h][c]);var f=o.c2p(r.y0+(h+.5)*n.dy),E=r.x0+(c+.5)*n.dx,I=r.y0+(h+.5)*n.dy,B="["+s.slice(0,n.colormodel.length).join(", ")+"]";return[d.extendFlat(y,{index:[h,c],x0:l.c2p(r.x0+c*n.dx),x1:l.c2p(r.x0+(c+1)*n.dx),y0:f,y1:f,color:T,xVal:E,xLabelVal:E,yVal:I,yLabelVal:I,zLabelVal:B,text:k,hovertemplateLabels:{zLabel:B,colorLabel:M,"color[0]Label":T[0]+p[0],"color[1]Label":T[1]+p[1],"color[2]Label":T[2]+p[2],"color[3]Label":T[3]+p[3]}})]}}}},92106:function(D,L,t){D.exports={attributes:t(22153),supplyDefaults:t(82766),calc:t(31181),plot:t(36899),style:t(67555),hoverPoints:t(57328),eventData:t(45461),moduleType:"trace",name:"image",basePlotModule:t(37703),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},36899:function(D,L,t){var b=t(45568),d=t(34809),e=d.strTranslate,w=t(62972),y=t(42939),_=t(95544),u=t(1837).STYLE;D.exports=function(r,n,l,o){var s=n.xaxis,c=n.yaxis,h=!r._context._exportedPlot&&_();d.makeTraceGroups(o,l,"im").each(function(x){var m=b.select(this),g=x[0],k=g.trace,A=(k.zsmooth==="fast"||k.zsmooth===!1&&h)&&!k._hasZ&&k._hasSource&&s.type==="linear"&&c.type==="linear";k._realImage=A;var v,S,T,p,M,f,E=g.z,I=g.x0,B=g.y0,N=g.w,V=g.h,j=k.dx,$=k.dy;for(f=0;v===void 0&&f0;)S=s.c2p(I+f*j),f--;for(f=0;p===void 0&&f0;)M=c.c2p(B+f*$),f--;SK[0];if(ae||se){var he=v+ee/2,fe=p+H/2;Q+="transform:"+e(he+"px",fe+"px")+"scale("+(ae?-1:1)+","+(se?-1:1)+")"+e(-he+"px",-fe+"px")+";"}}J.attr("style",Q);var ie=new Promise(function(le){if(k._hasZ)le();else if(k._hasSource)if(k._canvas&&k._canvas.el.width===N&&k._canvas.el.height===V&&k._canvas.source===k.source)le();else{var ge=document.createElement("canvas");ge.width=N,ge.height=V;var ye=ge.getContext("2d",{willReadFrequently:!0});k._image=k._image||new Image;var me=k._image;me.onload=function(){ye.drawImage(me,0,0),k._canvas={el:ge,source:k.source},le()},me.setAttribute("src",k.source)}}).then(function(){var le,ge;if(k._hasZ)ge=oe(function(me,be){var Se=E[be][me];return d.isTypedArray(Se)&&(Se=Array.from(Se)),Se}),le=ge.toDataURL("image/png");else if(k._hasSource)if(A)le=k.source;else{var ye=k._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,N,V).data;ge=oe(function(me,be){var Se=4*(be*N+me);return[ye[Se],ye[Se+1],ye[Se+2],ye[Se+3]]}),le=ge.toDataURL("image/png")}J.attr({"xlink:href":le,height:H,width:ee,x:v,y:p})});r._promises.push(ie)}function oe(le){var ge=document.createElement("canvas");ge.width=ee,ge.height=H;var ye,me=ge.getContext("2d",{willReadFrequently:!0}),be=function(de){return d.constrain(Math.round(s.c2p(I+de*j)-v),0,ee)},Se=function(de){return d.constrain(Math.round(c.c2p(B+de*$)-p),0,H)},Ee=y.colormodel[k.colormodel],Ce=Ee.colormodel||k.colormodel,Le=Ee.fmt;for(f=0;f0}function S(E){E.each(function(I){m.stroke(b.select(this),I.line.color)}).each(function(I){m.fill(b.select(this),I.color)}).style("stroke-width",function(I){return I.line.width})}function T(E,I,B){var N=E._fullLayout,V=w.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},I),j={type:"linear",_id:"x"+I._id},$={letter:"x",font:N.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function ee(H,J){return w.coerce(V,j,x,H,J)}return c(V,j,ee,$,N),h(V,j,ee,$),j}function p(E,I,B){return[Math.min(I/E.width,B/E.height),E,I+"x"+B]}function M(E,I,B,N){var V=document.createElementNS("http://www.w3.org/2000/svg","text"),j=b.select(V);return j.text(E).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",E).call(o.convertToTspans,N).call(n.font,I),n.bBox(j.node())}function f(E,I,B,N,V,j){var $="_cache"+I;E[$]&&E[$].key===V||(E[$]={key:V,value:B});var ee=w.aggNums(j,null,[E[$].value,N],2);return E[$].value=ee,ee}D.exports=function(E,I,B,N){var V,j=E._fullLayout;v(B)&&N&&(V=N()),w.makeTraceGroups(j._indicatorlayer,I,"trace").each(function($){var ee,H,J,Q,Z,K=$[0].trace,ae=b.select(this),se=K._hasGauge,he=K._isAngular,fe=K._isBullet,ie=K.domain,oe={w:j._size.w*(ie.x[1]-ie.x[0]),h:j._size.h*(ie.y[1]-ie.y[0]),l:j._size.l+j._size.w*ie.x[0],r:j._size.r+j._size.w*(1-ie.x[1]),t:j._size.t+j._size.h*(1-ie.y[1]),b:j._size.b+j._size.h*ie.y[0]},le=oe.l+oe.w/2,ge=oe.t+oe.h/2,ye=Math.min(oe.w/2,oe.h),me=l.innerRadius*ye,be=K.align||"center";if(H=ge,se){if(he&&(ee=le,H=ge+ye/2,J=function(Ve){return function(Pe,de){return[de/Math.sqrt(Pe.width/2*(Pe.width/2)+Pe.height*Pe.height),Pe,de]}(Ve,.9*me)}),fe){var Se=l.bulletPadding,Ee=1-l.bulletNumberDomainSize+Se;ee=oe.l+(Ee+(1-Ee)*k[be])*oe.w,J=function(Ve){return p(Ve,(l.bulletNumberDomainSize-Se)*oe.w,oe.h)}}}else ee=oe.l+k[be]*oe.w,J=function(Ve){return p(Ve,oe.w,oe.h)};(function(Ve,Pe,de,Me){var ke,He,Fe,qe=de[0].trace,$e=Me.numbersX,Ye=Me.numbersY,_e=qe.align||"center",De=g[_e],Be=Me.transitionOpts,Ge=Me.onComplete,tt=w.ensureSingle(Pe,"g","numbers"),nt=[];qe._hasNumber&&nt.push("number"),qe._hasDelta&&(nt.push("delta"),qe.delta.position==="left"&&nt.reverse());var pt=tt.selectAll("text").data(nt);function At(yt,Ot,Pt,at){if(!yt.match("s")||Pt>=0==at>=0||Ot(Pt).slice(-1).match(A)||Ot(at).slice(-1).match(A))return Ot;var lt=yt.slice().replace("s","f").replace(/\d+/,function(ut){return parseInt(ut)-1}),Xe=T(Ve,{tickformat:lt});return function(ut){return Math.abs(ut)<1?s.tickText(Xe,ut).text:Ot(ut)}}pt.enter().append("text"),pt.attr("text-anchor",function(){return De}).attr("class",function(yt){return yt}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),pt.exit().remove();var wt,Nt=qe.mode+qe.align;if(qe._hasDelta&&(wt=function(){var yt=T(Ve,{tickformat:qe.delta.valueformat},qe._range);yt.setScale(),s.prepTicks(yt);var Ot=function(Lt){return s.tickText(yt,Lt).text},Pt=qe.delta.suffix,at=qe.delta.prefix,lt=function(Lt){return qe.delta.relative?Lt.relativeDelta:Lt.delta},Xe=function(Lt,Ut){return Lt===0||typeof Lt!="number"||isNaN(Lt)?"-":(Lt>0?qe.delta.increasing.symbol:qe.delta.decreasing.symbol)+at+Ut(Lt)+Pt},ut=function(Lt){return Lt.delta>=0?qe.delta.increasing.color:qe.delta.decreasing.color};qe._deltaLastValue===void 0&&(qe._deltaLastValue=lt(de[0]));var Tt=tt.select("text.delta");function vt(){Tt.text(Xe(lt(de[0]),Ot)).call(m.fill,ut(de[0])).call(o.convertToTspans,Ve)}return Tt.call(n.font,qe.delta.font).call(m.fill,ut({delta:qe._deltaLastValue})),v(Be)?Tt.transition().duration(Be.duration).ease(Be.easing).tween("text",function(){var Lt=b.select(this),Ut=lt(de[0]),rt=qe._deltaLastValue,et=At(qe.delta.valueformat,Ot,rt,Ut),Et=e(rt,Ut);return qe._deltaLastValue=Ut,function(Bt){Lt.text(Xe(Et(Bt),et)),Lt.call(m.fill,ut({delta:Et(Bt)}))}}).each("end",function(){vt(),Ge&&Ge()}).each("interrupt",function(){vt(),Ge&&Ge()}):vt(),He=M(Xe(lt(de[0]),Ot),qe.delta.font,De,Ve),Tt}(),Nt+=qe.delta.position+qe.delta.font.size+qe.delta.font.family+qe.delta.valueformat,Nt+=qe.delta.increasing.symbol+qe.delta.decreasing.symbol,Fe=He),qe._hasNumber&&(function(){var yt=T(Ve,{tickformat:qe.number.valueformat},qe._range);yt.setScale(),s.prepTicks(yt);var Ot=function(ut){return s.tickText(yt,ut).text},Pt=qe.number.suffix,at=qe.number.prefix,lt=tt.select("text.number");function Xe(){var ut=typeof de[0].y=="number"?at+Ot(de[0].y)+Pt:"-";lt.text(ut).call(n.font,qe.number.font).call(o.convertToTspans,Ve)}v(Be)?lt.transition().duration(Be.duration).ease(Be.easing).each("end",function(){Xe(),Ge&&Ge()}).each("interrupt",function(){Xe(),Ge&&Ge()}).attrTween("text",function(){var ut=b.select(this),Tt=e(de[0].lastY,de[0].y);qe._lastValue=de[0].y;var vt=At(qe.number.valueformat,Ot,de[0].lastY,de[0].y);return function(Lt){ut.text(at+vt(Tt(Lt))+Pt)}}):Xe(),ke=M(at+Ot(de[0].y)+Pt,qe.number.font,De,Ve)}(),Nt+=qe.number.font.size+qe.number.font.family+qe.number.valueformat+qe.number.suffix+qe.number.prefix,Fe=ke),qe._hasDelta&&qe._hasNumber){var Ht,Gt,st=[(ke.left+ke.right)/2,(ke.top+ke.bottom)/2],Qe=[(He.left+He.right)/2,(He.top+He.bottom)/2],ft=.75*qe.delta.font.size;qe.delta.position==="left"&&(Ht=f(qe,"deltaPos",0,-1*(ke.width*k[qe.align]+He.width*(1-k[qe.align])+ft),Nt,Math.min),Gt=st[1]-Qe[1],Fe={width:ke.width+He.width+ft,height:Math.max(ke.height,He.height),left:He.left+Ht,right:ke.right,top:Math.min(ke.top,He.top+Gt),bottom:Math.max(ke.bottom,He.bottom+Gt)}),qe.delta.position==="right"&&(Ht=f(qe,"deltaPos",0,ke.width*(1-k[qe.align])+He.width*k[qe.align]+ft,Nt,Math.max),Gt=st[1]-Qe[1],Fe={width:ke.width+He.width+ft,height:Math.max(ke.height,He.height),left:ke.left,right:He.right+Ht,top:Math.min(ke.top,He.top+Gt),bottom:Math.max(ke.bottom,He.bottom+Gt)}),qe.delta.position==="bottom"&&(Ht=null,Gt=He.height,Fe={width:Math.max(ke.width,He.width),height:ke.height+He.height,left:Math.min(ke.left,He.left),right:Math.max(ke.right,He.right),top:ke.bottom-ke.height,bottom:ke.bottom+He.height}),qe.delta.position==="top"&&(Ht=null,Gt=ke.top,Fe={width:Math.max(ke.width,He.width),height:ke.height+He.height,left:Math.min(ke.left,He.left),right:Math.max(ke.right,He.right),top:ke.bottom-ke.height-He.height,bottom:ke.bottom}),wt.attr({dx:Ht,dy:Gt})}(qe._hasNumber||qe._hasDelta)&&tt.attr("transform",function(){var yt=Me.numbersScaler(Fe);Nt+=yt[2];var Ot,Pt=f(qe,"numbersScale",1,yt[0],Nt,Math.min);qe._scaleNumbers||(Pt=1),Ot=qe._isAngular?Ye-Pt*Fe.bottom:Ye-Pt*(Fe.top+Fe.bottom)/2,qe._numbersTop=Pt*Fe.top+Ot;var at=Fe[_e];_e==="center"&&(at=(Fe.left+Fe.right)/2);var lt=$e-Pt*at;return lt=f(qe,"numbersTranslate",0,lt,Nt,Math.max),_(lt,Ot)+y(Pt)})})(E,ae,$,{numbersX:ee,numbersY:H,numbersScaler:J,transitionOpts:B,onComplete:V}),se&&(Q={range:K.gauge.axis.range,color:K.gauge.bgcolor,line:{color:K.gauge.bordercolor,width:0},thickness:1},Z={range:K.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:K.gauge.bordercolor,width:K.gauge.borderwidth},thickness:1});var Ce=ae.selectAll("g.angular").data(he?$:[]);Ce.exit().remove();var Le=ae.selectAll("g.angularaxis").data(he?$:[]);Le.exit().remove(),he&&function(Ve,Pe,de,Me){var ke,He,Fe,qe,$e=de[0].trace,Ye=Me.size,_e=Me.radius,De=Me.innerRadius,Be=Me.gaugeBg,Ge=Me.gaugeOutline,tt=[Ye.l+Ye.w/2,Ye.t+Ye.h/2+_e/2],nt=Me.gauge,pt=Me.layer,At=Me.transitionOpts,wt=Me.onComplete,Nt=Math.PI/2;function Ht(Bt){var Ft=$e.gauge.axis.range[0],St=(Bt-Ft)/($e.gauge.axis.range[1]-Ft)*Math.PI-Nt;return St<-Nt?-Nt:St>Nt?Nt:St}function Gt(Bt){return b.svg.arc().innerRadius((De+_e)/2-Bt/2*(_e-De)).outerRadius((De+_e)/2+Bt/2*(_e-De)).startAngle(-Nt)}function st(Bt){Bt.attr("d",function(Ft){return Gt(Ft.thickness).startAngle(Ht(Ft.range[0])).endAngle(Ht(Ft.range[1]))()})}nt.enter().append("g").classed("angular",!0),nt.attr("transform",_(tt[0],tt[1])),pt.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),pt.selectAll("g.xangularaxistick,path,text").remove(),(ke=T(Ve,$e.gauge.axis)).type="linear",ke.range=$e.gauge.axis.range,ke._id="xangularaxis",ke.ticklabeloverflow="allow",ke.setScale();var Qe=function(Bt){return(ke.range[0]-Bt.x)/(ke.range[1]-ke.range[0])*Math.PI+Math.PI},ft={},yt=s.makeLabelFns(ke,0).labelStandoff;ft.xFn=function(Bt){var Ft=Qe(Bt);return Math.cos(Ft)*yt},ft.yFn=function(Bt){var Ft=Qe(Bt),St=Math.sin(Ft)>0?.2:1;return-Math.sin(Ft)*(yt+Bt.fontSize*St)+Math.abs(Math.cos(Ft))*(Bt.fontSize*r)},ft.anchorFn=function(Bt){var Ft=Qe(Bt),St=Math.cos(Ft);return Math.abs(St)<.1?"middle":St>0?"start":"end"},ft.heightFn=function(Bt,Ft,St){var Jt=Qe(Bt);return-.5*(1+Math.sin(Jt))*St};var Ot=function(Bt){return _(tt[0]+_e*Math.cos(Bt),tt[1]-_e*Math.sin(Bt))};if(Fe=function(Bt){return Ot(Qe(Bt))},He=s.calcTicks(ke),qe=s.getTickSigns(ke)[2],ke.visible){qe=ke.ticks==="inside"?-1:1;var Pt=(ke.linewidth||1)/2;s.drawTicks(Ve,ke,{vals:He,layer:pt,path:"M"+qe*Pt+",0h"+qe*ke.ticklen,transFn:function(Bt){var Ft=Qe(Bt);return Ot(Ft)+"rotate("+-u(Ft)+")"}}),s.drawLabels(Ve,ke,{vals:He,layer:pt,transFn:Fe,labelFns:ft})}var at=[Be].concat($e.gauge.steps),lt=nt.selectAll("g.bg-arc").data(at);lt.enter().append("g").classed("bg-arc",!0).append("path"),lt.select("path").call(st).call(S),lt.exit().remove();var Xe=Gt($e.gauge.bar.thickness),ut=nt.selectAll("g.value-arc").data([$e.gauge.bar]);ut.enter().append("g").classed("value-arc",!0).append("path");var Tt,vt,Lt,Ut=ut.select("path");v(At)?(Ut.transition().duration(At.duration).ease(At.easing).each("end",function(){wt&&wt()}).each("interrupt",function(){wt&&wt()}).attrTween("d",(Tt=Xe,vt=Ht(de[0].lastY),Lt=Ht(de[0].y),function(){var Bt=d(vt,Lt);return function(Ft){return Tt.endAngle(Bt(Ft))()}})),$e._lastValue=de[0].y):Ut.attr("d",typeof de[0].y=="number"?Xe.endAngle(Ht(de[0].y)):"M0,0Z"),Ut.call(S),ut.exit().remove(),at=[];var rt=$e.gauge.threshold.value;(rt||rt===0)&&at.push({range:[rt,rt],color:$e.gauge.threshold.color,line:{color:$e.gauge.threshold.line.color,width:$e.gauge.threshold.line.width},thickness:$e.gauge.threshold.thickness});var et=nt.selectAll("g.threshold-arc").data(at);et.enter().append("g").classed("threshold-arc",!0).append("path"),et.select("path").call(st).call(S),et.exit().remove();var Et=nt.selectAll("g.gauge-outline").data([Ge]);Et.enter().append("g").classed("gauge-outline",!0).append("path"),Et.select("path").call(st).call(S),Et.exit().remove()}(E,0,$,{radius:ye,innerRadius:me,gauge:Ce,layer:Le,size:oe,gaugeBg:Q,gaugeOutline:Z,transitionOpts:B,onComplete:V});var Oe=ae.selectAll("g.bullet").data(fe?$:[]);Oe.exit().remove();var We=ae.selectAll("g.bulletaxis").data(fe?$:[]);We.exit().remove(),fe&&function(Ve,Pe,de,Me){var ke,He,Fe,qe,$e,Ye=de[0].trace,_e=Me.gauge,De=Me.layer,Be=Me.gaugeBg,Ge=Me.gaugeOutline,tt=Me.size,nt=Ye.domain,pt=Me.transitionOpts,At=Me.onComplete;_e.enter().append("g").classed("bullet",!0),_e.attr("transform",_(tt.l,tt.t)),De.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),De.selectAll("g.xbulletaxistick,path,text").remove();var wt=tt.h,Nt=Ye.gauge.bar.thickness*wt,Ht=nt.x[0],Gt=nt.x[0]+(nt.x[1]-nt.x[0])*(Ye._hasNumber||Ye._hasDelta?1-l.bulletNumberDomainSize:1);function st(lt){lt.attr("width",function(Xe){return Math.max(0,ke.c2p(Xe.range[1])-ke.c2p(Xe.range[0]))}).attr("x",function(Xe){return ke.c2p(Xe.range[0])}).attr("y",function(Xe){return .5*(1-Xe.thickness)*wt}).attr("height",function(Xe){return Xe.thickness*wt})}(ke=T(Ve,Ye.gauge.axis))._id="xbulletaxis",ke.domain=[Ht,Gt],ke.setScale(),He=s.calcTicks(ke),Fe=s.makeTransTickFn(ke),qe=s.getTickSigns(ke)[2],$e=tt.t+tt.h,ke.visible&&(s.drawTicks(Ve,ke,{vals:ke.ticks==="inside"?s.clipEnds(ke,He):He,layer:De,path:s.makeTickPath(ke,$e,qe),transFn:Fe}),s.drawLabels(Ve,ke,{vals:He,layer:De,transFn:Fe,labelFns:s.makeLabelFns(ke,$e)}));var Qe=[Be].concat(Ye.gauge.steps),ft=_e.selectAll("g.bg-bullet").data(Qe);ft.enter().append("g").classed("bg-bullet",!0).append("rect"),ft.select("rect").call(st).call(S),ft.exit().remove();var yt=_e.selectAll("g.value-bullet").data([Ye.gauge.bar]);yt.enter().append("g").classed("value-bullet",!0).append("rect"),yt.select("rect").attr("height",Nt).attr("y",(wt-Nt)/2).call(S),v(pt)?yt.select("rect").transition().duration(pt.duration).ease(pt.easing).each("end",function(){At&&At()}).each("interrupt",function(){At&&At()}).attr("width",Math.max(0,ke.c2p(Math.min(Ye.gauge.axis.range[1],de[0].y)))):yt.select("rect").attr("width",typeof de[0].y=="number"?Math.max(0,ke.c2p(Math.min(Ye.gauge.axis.range[1],de[0].y))):0),yt.exit().remove();var Ot=de.filter(function(){return Ye.gauge.threshold.value||Ye.gauge.threshold.value===0}),Pt=_e.selectAll("g.threshold-bullet").data(Ot);Pt.enter().append("g").classed("threshold-bullet",!0).append("line"),Pt.select("line").attr("x1",ke.c2p(Ye.gauge.threshold.value)).attr("x2",ke.c2p(Ye.gauge.threshold.value)).attr("y1",(1-Ye.gauge.threshold.thickness)/2*wt).attr("y2",(1-(1-Ye.gauge.threshold.thickness)/2)*wt).call(m.stroke,Ye.gauge.threshold.line.color).style("stroke-width",Ye.gauge.threshold.line.width),Pt.exit().remove();var at=_e.selectAll("g.gauge-outline").data([Ge]);at.enter().append("g").classed("gauge-outline",!0).append("rect"),at.select("rect").call(st).call(S),at.exit().remove()}(E,0,$,{gauge:Oe,layer:We,size:oe,gaugeBg:Q,gaugeOutline:Z,transitionOpts:B,onComplete:V});var Ie=ae.selectAll("text.title").data($);Ie.exit().remove(),Ie.enter().append("text").classed("title",!0),Ie.attr("text-anchor",function(){return fe?g.right:g[K.title.align]}).text(K.title.text).call(n.font,K.title.font).call(o.convertToTspans,E),Ie.attr("transform",function(){var Ve,Pe=oe.l+oe.w*k[K.title.align],de=l.titlePadding,Me=n.bBox(Ie.node());return se?(he&&(Ve=K.gauge.axis.visible?n.bBox(Le.node()).top-de-Me.bottom:oe.t+oe.h/2-ye/2-Me.bottom-de),fe&&(Ve=H-(Me.top+Me.bottom)/2,Pe=oe.l-l.bulletPadding*oe.w)):Ve=K._numbersTop-de-Me.bottom,_(Pe,Ve)})})}},70252:function(D,L,t){var b=t(87163),d=t(80712).axisHoverFormat,e=t(3208).rb,w=t(42450),y=t(9829),_=t(93049).extendFlat,u=t(13582).overrideAll,r=D.exports=u(_({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:e(),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),valuehoverformat:d("value",1),showlegend:_({},y.showlegend,{dflt:!1})},b("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:w.opacity,lightposition:w.lightposition,lighting:w.lighting,flatshading:w.flatshading,contour:w.contour,hoverinfo:_({},y.hoverinfo)}),"calc","nested");r.flatshading.dflt=!0,r.lighting.facenormalsepsilon.dflt=0,r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes",r.transforms=void 0},58988:function(D,L,t){var b=t(28379),d=t(36402).processGrid,e=t(36402).filter;D.exports=function(w,y){y._len=Math.min(y.x.length,y.y.length,y.z.length,y.value.length),y._x=e(y.x,y._len),y._y=e(y.y,y._len),y._z=e(y.z,y._len),y._value=e(y.value,y._len);var _=d(y);y._gridFill=_.fill,y._Xs=_.Xs,y._Ys=_.Ys,y._Zs=_.Zs,y._len=_.len;for(var u=1/0,r=-1/0,n=0;n0;h--){var x=Math.min(c[h],c[h-1]),m=Math.max(c[h],c[h-1]);if(m>x&&x-1}function ge(De,Be){return De===null?Be:De}function ye(De,Be,Ge){se();var tt,nt,pt,At=[Be],wt=[Ge];if(A>=1)At=[Be],wt=[Ge];else if(A>0){var Nt=function(at,lt){var Xe=at[0],ut=at[1],Tt=at[2],vt=function(St,Jt,qt){for(var en=[],Wt=0;Wt-1?Ge[st]:ae(Qe,ft,yt);Gt[st]=Pt>-1?Pt:fe(Qe,ft,yt,ge(De,Ot))}tt=Gt[0],nt=Gt[1],pt=Gt[2],s._meshI.push(tt),s._meshJ.push(nt),s._meshK.push(pt),++E}}function me(De,Be,Ge,tt){var nt=De[3];nttt&&(nt=tt);for(var pt=(De[3]-nt)/(De[3]-Be[3]+1e-9),At=[],wt=0;wt<4;wt++)At[wt]=(1-pt)*De[wt]+pt*Be[wt];return At}function be(De,Be,Ge){return De>=Be&&De<=Ge}function Se(De){var Be=.001*(K-Z);return De>=Z-Be&&De<=K+Be}function Ee(De){for(var Be=[],Ge=0;Ge<4;Ge++){var tt=De[Ge];Be.push([s._x[tt],s._y[tt],s._z[tt],s._value[tt]])}return Be}var Ce=3;function Le(De,Be,Ge,tt,nt,pt){pt||(pt=1),Ge=[-1,-1,-1];var At=!1,wt=[be(Be[0][3],tt,nt),be(Be[1][3],tt,nt),be(Be[2][3],tt,nt)];if(!wt[0]&&!wt[1]&&!wt[2])return!1;var Nt=function(Gt,st,Qe){return Se(st[0][3])&&Se(st[1][3])&&Se(st[2][3])?(ye(Gt,st,Qe),!0):ptMath.abs(pt-Q)?[J,pt]:[pt,Q];M=!0,Fe(Be,At[0],At[1]),M=!1}}var wt=[[Math.min(Z,Q),Math.max(Z,Q)],[Math.min(J,K),Math.max(J,K)]];["x","y","z"].forEach(function(Nt){for(var Ht=[],Gt=0;Gt0&&(Pt.push(Xe.id),Nt==="x"?at.push([Xe.distRatio,0,0]):Nt==="y"?at.push([0,Xe.distRatio,0]):at.push([0,0,Xe.distRatio]))}else Ot=_e(1,Nt==="x"?V-1:Nt==="y"?j-1:$-1);Pt.length>0&&(Ht[st]=Nt==="x"?qe(De,Pt,Qe,ft,at,Ht[st]):Nt==="y"?$e(De,Pt,Qe,ft,at,Ht[st]):Ye(De,Pt,Qe,ft,at,Ht[st]),st++),Ot.length>0&&(Ht[st]=Nt==="x"?Me(De,Ot,Qe,ft,Ht[st]):Nt==="y"?ke(De,Ot,Qe,ft,Ht[st]):He(De,Ot,Qe,ft,Ht[st]),st++)}var ut=s.caps[Nt];ut.show&&ut.fill&&(oe(ut.fill),Ht[st]=Nt==="x"?Me(De,[0,V-1],Qe,ft,Ht[st]):Nt==="y"?ke(De,[0,j-1],Qe,ft,Ht[st]):He(De,[0,$-1],Qe,ft,Ht[st]),st++)}}),E===0&&he(),s._meshX=x,s._meshY=m,s._meshZ=g,s._meshIntensity=k,s._Xs=I,s._Ys=B,s._Zs=N}(),s}D.exports={findNearestOnAxis:u,generateIsoMeshes:o,createIsosurfaceTrace:function(s,c){var h=s.glplot.gl,x=b({gl:h}),m=new r(s,x,c.uid);return x._trace=m,m.update(c),s.glplot.add(x),m}}},44731:function(D,L,t){var b=t(34809),d=t(33626),e=t(70252),w=t(39356);function y(_,u,r,n,l){var o=l("isomin"),s=l("isomax");s!=null&&o!=null&&o>s&&(u.isomin=null,u.isomax=null);var c=l("x"),h=l("y"),x=l("z"),m=l("value");c&&c.length&&h&&h.length&&x&&x.length&&m&&m.length?(d.getComponentMethod("calendars","handleTraceDefaults")(_,u,["x","y","z"],n),l("valuehoverformat"),["x","y","z"].forEach(function(g){l(g+"hoverformat");var k="caps."+g;l(k+".show")&&l(k+".fill");var A="slices."+g;l(A+".show")&&(l(A+".fill"),l(A+".locations"))}),l("spaceframe.show")&&l("spaceframe.fill"),l("surface.show")&&(l("surface.count"),l("surface.fill"),l("surface.pattern")),l("contour.show")&&(l("contour.color"),l("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(g){l(g)}),w(_,u,n,l,{prefix:"",cLetter:"c"}),u._length=null):u.visible=!1}D.exports={supplyDefaults:function(_,u,r,n){y(_,u,0,n,function(l,o){return b.coerce(_,u,e,l,o)})},supplyIsoDefaults:y}},75297:function(D,L,t){D.exports={attributes:t(70252),supplyDefaults:t(44731).supplyDefaults,calc:t(58988),colorbar:{min:"cmin",max:"cmax"},plot:t(91370).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t(2487),categories:["gl3d","showLegend"],meta:{}}},42450:function(D,L,t){var b=t(87163),d=t(80712).axisHoverFormat,e=t(3208).rb,w=t(16131),y=t(9829),_=t(93049).extendFlat;D.exports=_({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:e({editType:"calc"}),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},b("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:w.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:_({},w.contours.x.show,{}),color:w.contours.x.color,width:w.contours.x.width,editType:"calc"},lightposition:{x:_({},w.lightposition.x,{dflt:1e5}),y:_({},w.lightposition.y,{dflt:1e5}),z:_({},w.lightposition.z,{dflt:0}),editType:"calc"},lighting:_({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},w.lighting),hoverinfo:_({},y.hoverinfo,{editType:"calc"}),showlegend:_({},y.showlegend,{dflt:!1})})},44878:function(D,L,t){var b=t(28379);D.exports=function(d,e){e.intensity&&b(d,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},82836:function(D,L,t){var b=t(99098).gl_mesh3d,d=t(99098).delaunay_triangulate,e=t(99098).alpha_shape,w=t(99098).convex_hull,y=t(46998).parseColorScale,_=t(34809).isArrayOrTypedArray,u=t(55010),r=t(88856).extractOpts,n=t(88239);function l(m,g,k){this.scene=m,this.uid=k,this.mesh=g,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var o=l.prototype;function s(m){for(var g=[],k=m.length,A=0;A=g-.5)return!1;return!0}o.handlePick=function(m){if(m.object===this.mesh){var g=m.index=m.data.index;m.data._cellCenter?m.traceCoordinate=m.data.dataCoordinate:m.traceCoordinate=[this.data.x[g],this.data.y[g],this.data.z[g]];var k=this.data.hovertext||this.data.text;return _(k)&&k[g]!==void 0?m.textLabel=k[g]:k&&(m.textLabel=k),!0}},o.update=function(m){var g=this.scene,k=g.fullSceneLayout;this.data=m;var A,v=m.x.length,S=n(c(k.xaxis,m.x,g.dataScale[0],m.xcalendar),c(k.yaxis,m.y,g.dataScale[1],m.ycalendar),c(k.zaxis,m.z,g.dataScale[2],m.zcalendar));if(m.i&&m.j&&m.k){if(m.i.length!==m.j.length||m.j.length!==m.k.length||!x(m.i,v)||!x(m.j,v)||!x(m.k,v))return;A=n(h(m.i),h(m.j),h(m.k))}else A=m.alphahull===0?w(S):m.alphahull>0?e(m.alphahull,S):function(f,E){for(var I=["x","y","z"].indexOf(f),B=[],N=E.length,V=0;VS):v=N>E,S=N;var V=c(E,I,B,N);V.pos=f,V.yc=(E+N)/2,V.i=M,V.dir=v?"increasing":"decreasing",V.x=V.pos,V.y=[B,I],T&&(V.orig_p=l[M]),k&&(V.tx=n.text[M]),A&&(V.htx=n.hovertext[M]),p.push(V)}else p.push({pos:f,empty:!0})}return n._extremes[s._id]=e.findExtremes(s,b.concat(m,x),{padded:!0}),p.length&&(p[0].t={labels:{open:d(r,"open:")+" ",high:d(r,"high:")+" ",low:d(r,"low:")+" ",close:d(r,"close:")+" "}}),p}D.exports={calc:function(r,n){var l=e.getFromId(r,n.xaxis),o=e.getFromId(r,n.yaxis),s=function(g,k,A){var v=A._minDiff;if(!v){var S,T=g._fullData,p=[];for(v=1/0,S=0;S"+k.labels[I]+b.hoverLabelText(m,B,g.yhoverformat):((E=d.extendFlat({},v)).y0=E.y1=N,E.yLabelVal=B,E.yLabel=k.labels[I]+b.hoverLabelText(m,B,g.yhoverformat),E.name="",A.push(E),M[B]=E)}return A}function l(o,s,c,h){var x=o.cd,m=o.ya,g=x[0].trace,k=x[0].t,A=r(o,s,c,h);if(!A)return[];var v=x[A.index],S=A.index=v.i,T=v.dir;function p(V){return k.labels[V]+b.hoverLabelText(m,g[V][S],g.yhoverformat)}var M=v.hi||g.hoverinfo,f=M.split("+"),E=M==="all",I=E||f.indexOf("y")!==-1,B=E||f.indexOf("text")!==-1,N=I?[p("open"),p("high"),p("low"),p("close")+" "+u[T]]:[];return B&&y(v,g,N),A.extraText=N.join("
"),A.y0=A.y1=m.c2p(v.yc,!0),[A]}D.exports={hoverPoints:function(o,s,c,h){return o.cd[0].trace.hoverlabel.split?n(o,s,c,h):l(o,s,c,h)},hoverSplit:n,hoverOnPoints:l}},12683:function(D,L,t){D.exports={moduleType:"trace",name:"ohlc",basePlotModule:t(37703),categories:["cartesian","svg","showLegend"],meta:{},attributes:t(86706),supplyDefaults:t(22629),calc:t(95694).calc,plot:t(38956),style:t(57406),hoverPoints:t(93245).hoverPoints,selectPoints:t(49343)}},28270:function(D,L,t){var b=t(33626),d=t(34809);D.exports=function(e,w,y,_){var u=y("x"),r=y("open"),n=y("high"),l=y("low"),o=y("close");if(y("hoverlabel.split"),b.getComponentMethod("calendars","handleTraceDefaults")(e,w,["x"],_),r&&n&&l&&o){var s=Math.min(r.length,n.length,l.length,o.length);return u&&(s=Math.min(s,d.minRowLength(u))),w._length=s,s}}},38956:function(D,L,t){var b=t(45568),d=t(34809);D.exports=function(e,w,y,_){var u=w.yaxis,r=w.xaxis,n=!!r.rangebreaks;d.makeTraceGroups(_,y,"trace ohlc").each(function(l){var o=b.select(this),s=l[0],c=s.t;if(s.trace.visible!==!0||c.empty)o.remove();else{var h=c.tickLen,x=o.selectAll("path").data(d.identity);x.enter().append("path"),x.exit().remove(),x.attr("d",function(m){if(m.empty)return"M0,0Z";var g=r.c2p(m.pos-h,!0),k=r.c2p(m.pos+h,!0),A=n?(g+k)/2:r.c2p(m.pos,!0);return"M"+g+","+u.c2p(m.o,!0)+"H"+A+"M"+A+","+u.c2p(m.h,!0)+"V"+u.c2p(m.l,!0)+"M"+k+","+u.c2p(m.c,!0)+"H"+A})}})}},49343:function(D){D.exports=function(L,t){var b,d=L.cd,e=L.xaxis,w=L.yaxis,y=[],_=d[0].t.bPos||0;if(t===!1)for(b=0;b=he.length||fe[he[ie]]!==void 0)return!1;fe[he[ie]]=!0}return!0}(se))for(ae=0;ae0||r(m);g&&(x="array");var k=s("categoryorder",x);k==="array"?(s("categoryarray"),s("ticktext")):(delete l.categoryarray,delete l.ticktext),g||k!=="array"||(o.categoryorder="trace")}}D.exports=function(l,o,s,c){function h(k,A){return b.coerce(l,o,_,k,A)}var x=y(l,o,{name:"dimensions",handleItemDefaults:n}),m=function(k,A,v,S,T){T("line.shape"),T("line.hovertemplate");var p=T("line.color",S.colorway[0]);if(d(k,"line")&&b.isArrayOrTypedArray(p)){if(p.length)return T("line.colorscale"),e(k,A,S,T,{prefix:"line.",cLetter:"c"}),p.length;A.line.color=v}return 1/0}(l,o,s,c,h);w(o,c,h),Array.isArray(x)&&x.length||(o.visible=!1),u(o,x,"values",m),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var g=c.font;b.coerceFont(h,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),b.coerceFont(h,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}},6305:function(D,L,t){D.exports={attributes:t(11660),supplyDefaults:t(62651),calc:t(95564),plot:t(37822),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t(83260),categories:["noOpacity"],meta:{}}},27219:function(D,L,t){var b=t(45568),d=t(88640).Dj,e=t(31420),w=t(32141),y=t(34809),_=y.strTranslate,u=t(62203),r=t(65657),n=t(30635);function l(se,he,fe,ie){var oe=he._context.staticPlot,le=se.map(J.bind(0,he,fe)),ge=ie.selectAll("g.parcatslayer").data([null]);ge.enter().append("g").attr("class","parcatslayer").style("pointer-events",oe?"none":"all");var ye=ge.selectAll("g.trace.parcats").data(le,o),me=ye.enter().append("g").attr("class","trace parcats");ye.attr("transform",function(Ie){return _(Ie.x,Ie.y)}),me.append("g").attr("class","paths");var be=ye.select("g.paths").selectAll("path.path").data(function(Ie){return Ie.paths},o);be.attr("fill",function(Ie){return Ie.model.color});var Se=be.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Ie){return Ie.model.color}).attr("fill-opacity",0);A(Se),be.attr("d",function(Ie){return Ie.svgD}),Se.empty()||be.sort(c),be.exit().remove(),be.on("mouseover",h).on("mouseout",x).on("click",k),me.append("g").attr("class","dimensions");var Ee=ye.select("g.dimensions").selectAll("g.dimension").data(function(Ie){return Ie.dimensions},o);Ee.enter().append("g").attr("class","dimension"),Ee.attr("transform",function(Ie){return _(Ie.x,0)}),Ee.exit().remove();var Ce=Ee.selectAll("g.category").data(function(Ie){return Ie.categories},o),Le=Ce.enter().append("g").attr("class","category");Ce.attr("transform",function(Ie){return _(0,Ie.y)}),Le.append("rect").attr("class","catrect").attr("pointer-events","none"),Ce.select("rect.catrect").attr("fill","none").attr("width",function(Ie){return Ie.width}).attr("height",function(Ie){return Ie.height}),S(Le);var Oe=Ce.selectAll("rect.bandrect").data(function(Ie){return Ie.bands},o);Oe.each(function(){y.raiseToTop(this)}),Oe.attr("fill",function(Ie){return Ie.color});var We=Oe.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Ie){return Ie.color}).attr("fill-opacity",0);Oe.attr("fill",function(Ie){return Ie.color}).attr("width",function(Ie){return Ie.width}).attr("height",function(Ie){return Ie.height}).attr("y",function(Ie){return Ie.y}).attr("cursor",function(Ie){return Ie.parcatsViewModel.arrangement==="fixed"?"default":Ie.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),T(We),Oe.exit().remove(),Le.append("text").attr("class","catlabel").attr("pointer-events","none"),Ce.select("text.catlabel").attr("text-anchor",function(Ie){return s(Ie)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Ie){return s(Ie)?Ie.width+5:-5}).attr("y",function(Ie){return Ie.height/2}).text(function(Ie){return Ie.model.categoryLabel}).each(function(Ie){u.font(b.select(this),Ie.parcatsViewModel.categorylabelfont),n.convertToTspans(b.select(this),he)}),Le.append("text").attr("class","dimlabel"),Ce.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Ie){return Ie.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Ie){return Ie.width/2}).attr("y",-5).text(function(Ie,Ve){return Ve===0?Ie.parcatsViewModel.model.dimensions[Ie.model.dimensionInd].dimensionLabel:null}).each(function(Ie){u.font(b.select(this),Ie.parcatsViewModel.labelfont)}),Ce.selectAll("rect.bandrect").on("mouseover",I).on("mouseout",B),Ce.exit().remove(),Ee.call(b.behavior.drag().origin(function(Ie){return{x:Ie.x,y:0}}).on("dragstart",N).on("drag",V).on("dragend",j)),ye.each(function(Ie){Ie.traceSelection=b.select(this),Ie.pathSelection=b.select(this).selectAll("g.paths").selectAll("path.path"),Ie.dimensionSelection=b.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),ye.exit().remove()}function o(se){return se.key}function s(se){var he=se.parcatsViewModel.dimensions.length,fe=se.parcatsViewModel.dimensions[he-1].model.dimensionInd;return se.model.dimensionInd===fe}function c(se,he){return se.model.rawColor>he.model.rawColor?1:se.model.rawColor"),He=b.mouse(ye)[0];w.loneHover({trace:me,x:Oe-Se.left+Ee.left,y:We-Se.top+Ee.top,text:ke,color:se.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ie,idealAlign:He1&&Ee.displayInd===Se.dimensions.length-1?(ie=me.left,oe="left"):(ie=me.left+me.width,oe="right");var Oe=be.model.count,We=be.model.categoryLabel,Ie=Oe/be.parcatsViewModel.model.count,Ve={countLabel:Oe,categoryLabel:We,probabilityLabel:Ie.toFixed(3)},Pe=[];be.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Pe.push(["Count:",Ve.countLabel].join(" ")),be.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Pe.push(["P("+Ve.categoryLabel+"):",Ve.probabilityLabel].join(" "));var de=Pe.join("
");return{trace:Ce,x:le*(ie-he.left),y:ge*(Le-he.top),text:de,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:oe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:Ve,eventData:[{data:Ce._input,fullData:Ce,count:Oe,category:We,probability:Ie}]}}function I(se){if(!se.parcatsViewModel.dragDimension&&se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){if(b.mouse(this)[1]<-1)return;var he,fe=se.parcatsViewModel.graphDiv,ie=fe._fullLayout,oe=ie._paperdiv.node().getBoundingClientRect(),le=se.parcatsViewModel.hoveron,ge=this;le==="color"?(function(ye){var me=b.select(ye).datum(),be=p(me);v(be),be.each(function(){y.raiseToTop(this)}),b.select(ye.parentNode).selectAll("rect.bandrect").filter(function(Se){return Se.color===me.color}).each(function(){y.raiseToTop(this),b.select(this).attr("stroke","black").attr("stroke-width",1.5)})}(ge),f(ge,"plotly_hover",b.event)):(function(ye){b.select(ye.parentNode).selectAll("rect.bandrect").each(function(me){var be=p(me);v(be),be.each(function(){y.raiseToTop(this)})}),b.select(ye.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(ge),M(ge,"plotly_hover",b.event)),se.parcatsViewModel.hoverinfoItems.indexOf("none")===-1&&(le==="category"?he=E(fe,oe,ge):le==="color"?he=function(ye,me,be){ye._fullLayout._calcInverseTransform(ye);var Se,Ee,Ce=ye._fullLayout._invScaleX,Le=ye._fullLayout._invScaleY,Oe=be.getBoundingClientRect(),We=b.select(be).datum(),Ie=We.categoryViewModel,Ve=Ie.parcatsViewModel,Pe=Ve.model.dimensions[Ie.model.dimensionInd],de=Ve.trace,Me=Oe.y+Oe.height/2;Ve.dimensions.length>1&&Pe.displayInd===Ve.dimensions.length-1?(Se=Oe.left,Ee="left"):(Se=Oe.left+Oe.width,Ee="right");var ke=Ie.model.categoryLabel,He=We.parcatsViewModel.model.count,Fe=0;We.categoryViewModel.bands.forEach(function(pt){pt.color===We.color&&(Fe+=pt.count)});var qe=Ie.model.count,$e=0;Ve.pathSelection.each(function(pt){pt.model.color===We.color&&($e+=pt.model.count)});var Ye=Fe/He,_e=Fe/$e,De=Fe/qe,Be={countLabel:Fe,categoryLabel:ke,probabilityLabel:Ye.toFixed(3)},Ge=[];Ie.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ge.push(["Count:",Be.countLabel].join(" ")),Ie.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ge.push("P(color ∩ "+ke+"): "+Be.probabilityLabel),Ge.push("P("+ke+" | color): "+_e.toFixed(3)),Ge.push("P(color | "+ke+"): "+De.toFixed(3)));var tt=Ge.join("
"),nt=r.mostReadable(We.color,["black","white"]);return{trace:de,x:Ce*(Se-me.left),y:Le*(Me-me.top),text:tt,color:We.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:nt,fontSize:10,idealAlign:Ee,hovertemplate:de.hovertemplate,hovertemplateLabels:Be,eventData:[{data:de._input,fullData:de,category:ke,count:He,probability:Ye,categorycount:qe,colorcount:$e,bandcolorcount:Fe}]}}(fe,oe,ge):le==="dimension"&&(he=function(ye,me,be){var Se=[];return b.select(be.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){Se.push(E(ye,me,this))}),Se}(fe,oe,ge)),he&&w.loneHover(he,{container:ie._hoverlayer.node(),outerContainer:ie._paper.node(),gd:fe}))}}function B(se){var he=se.parcatsViewModel;he.dragDimension||(A(he.pathSelection),S(he.dimensionSelection.selectAll("g.category")),T(he.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),w.loneUnhover(he.graphDiv._fullLayout._hoverlayer.node()),he.pathSelection.sort(c),he.hoverinfoItems.indexOf("skip")!==-1)||(se.parcatsViewModel.hoveron==="color"?f(this,"plotly_unhover",b.event):M(this,"plotly_unhover",b.event))}function N(se){se.parcatsViewModel.arrangement!=="fixed"&&(se.dragDimensionDisplayInd=se.model.displayInd,se.initialDragDimensionDisplayInds=se.parcatsViewModel.model.dimensions.map(function(he){return he.displayInd}),se.dragHasMoved=!1,se.dragCategoryDisplayInd=null,b.select(this).selectAll("g.category").select("rect.catrect").each(function(he){var fe=b.mouse(this)[0],ie=b.mouse(this)[1];-2<=fe&&fe<=he.width+2&&-2<=ie&&ie<=he.height+2&&(se.dragCategoryDisplayInd=he.model.displayInd,se.initialDragCategoryDisplayInds=se.model.categories.map(function(oe){return oe.displayInd}),he.model.dragY=he.y,y.raiseToTop(this.parentNode),b.select(this.parentNode).selectAll("rect.bandrect").each(function(oe){oe.ySe.y+Se.height/2&&(le.model.displayInd=Se.model.displayInd,Se.model.displayInd=ye),se.dragCategoryDisplayInd=le.model.displayInd}if(se.dragCategoryDisplayInd===null||se.parcatsViewModel.arrangement==="freeform"){oe.model.dragX=b.event.x;var Ee=se.parcatsViewModel.dimensions[fe],Ce=se.parcatsViewModel.dimensions[ie];Ee!==void 0&&oe.model.dragXCe.x&&(oe.model.displayInd=Ce.model.displayInd,Ce.model.displayInd=se.dragDimensionDisplayInd),se.dragDimensionDisplayInd=oe.model.displayInd}K(se.parcatsViewModel),Z(se.parcatsViewModel),H(se.parcatsViewModel),ee(se.parcatsViewModel)}}function j(se){if(se.parcatsViewModel.arrangement!=="fixed"&&se.dragDimensionDisplayInd!==null){b.select(this).selectAll("text").attr("font-weight","normal");var he={},fe=$(se.parcatsViewModel),ie=se.parcatsViewModel.model.dimensions.map(function(Se){return Se.displayInd}),oe=se.initialDragDimensionDisplayInds.some(function(Se,Ee){return Se!==ie[Ee]});oe&&ie.forEach(function(Se,Ee){var Ce=se.parcatsViewModel.model.dimensions[Ee].containerInd;he["dimensions["+Ce+"].displayindex"]=Se});var le=!1;if(se.dragCategoryDisplayInd!==null){var ge=se.model.categories.map(function(Se){return Se.displayInd});if(le=se.initialDragCategoryDisplayInds.some(function(Se,Ee){return Se!==ge[Ee]})){var ye=se.model.categories.slice().sort(function(Se,Ee){return Se.displayInd-Ee.displayInd}),me=ye.map(function(Se){return Se.categoryValue}),be=ye.map(function(Se){return Se.categoryLabel});he["dimensions["+se.model.containerInd+"].categoryarray"]=[me],he["dimensions["+se.model.containerInd+"].ticktext"]=[be],he["dimensions["+se.model.containerInd+"].categoryorder"]="array"}}se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!se.dragHasMoved&&se.potentialClickBand&&(se.parcatsViewModel.hoveron==="color"?f(se.potentialClickBand,"plotly_click",b.event.sourceEvent):M(se.potentialClickBand,"plotly_click",b.event.sourceEvent)),se.model.dragX=null,se.dragCategoryDisplayInd!==null&&(se.parcatsViewModel.dimensions[se.dragDimensionDisplayInd].categories[se.dragCategoryDisplayInd].model.dragY=null,se.dragCategoryDisplayInd=null),se.dragDimensionDisplayInd=null,se.parcatsViewModel.dragDimension=null,se.dragHasMoved=null,se.potentialClickBand=null,K(se.parcatsViewModel),Z(se.parcatsViewModel),b.transition().duration(300).ease("cubic-in-out").each(function(){H(se.parcatsViewModel,!0),ee(se.parcatsViewModel,!0)}).each("end",function(){(oe||le)&&e.restyle(se.parcatsViewModel.graphDiv,he,[fe])})}}function $(se){for(var he,fe=se.graphDiv._fullData,ie=0;ie=0;ge--)be+="C"+me[ge]+","+(he[ge+1]+ie)+" "+ye[ge]+","+(he[ge]+ie)+" "+(se[ge]+fe[ge])+","+(he[ge]+ie),be+="l-"+fe[ge]+",0 ";return be+"Z"}function Z(se){var he=se.dimensions,fe=se.model,ie=he.map(function(Be){return Be.categories.map(function(Ge){return Ge.y})}),oe=se.model.dimensions.map(function(Be){return Be.categories.map(function(Ge){return Ge.displayInd})}),le=se.model.dimensions.map(function(Be){return Be.displayInd}),ge=se.dimensions.map(function(Be){return Be.model.dimensionInd}),ye=he.map(function(Be){return Be.x}),me=he.map(function(Be){return Be.width}),be=[];for(var Se in fe.paths)fe.paths.hasOwnProperty(Se)&&be.push(fe.paths[Se]);function Ee(Be){var Ge=Be.categoryInds.map(function(tt,nt){return oe[nt][tt]});return ge.map(function(tt){return Ge[tt]})}be.sort(function(Be,Ge){var tt=Ee(Be),nt=Ee(Ge);return se.sortpaths==="backward"&&(tt.reverse(),nt.reverse()),tt.push(Be.valueInds[0]),nt.push(Ge.valueInds[0]),se.bundlecolors&&(tt.unshift(Be.rawColor),nt.unshift(Ge.rawColor)),ttnt?1:0});for(var Ce=new Array(be.length),Le=he[0].model.count,Oe=he[0].categories.map(function(Be){return Be.height}).reduce(function(Be,Ge){return Be+Ge}),We=0;We0?Oe*(Ve.count/Le):0;for(var Pe,de=new Array(ie.length),Me=0;Me1?(se.width-80-16)/(ie-1):0)*oe;var le,ge,ye,me,be,Se=[],Ee=se.model.maxCats,Ce=he.categories.length,Le=he.count,Oe=se.height-8*(Ee-1),We=8*(Ee-Ce)/2,Ie=he.categories.map(function(Ve){return{displayInd:Ve.displayInd,categoryInd:Ve.categoryInd}});for(Ie.sort(function(Ve,Pe){return Ve.displayInd-Pe.displayInd}),be=0;be0?ge.count/Le*Oe:0,ye={key:ge.valueInds[0],model:ge,width:16,height:le,y:ge.dragY!==null?ge.dragY:We,bands:[],parcatsViewModel:se},We=We+le+8,Se.push(ye);return{key:he.dimensionInd,x:he.dragX!==null?he.dragX:fe,y:0,width:16,model:he,categories:Se,parcatsViewModel:se,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}D.exports=function(se,he,fe,ie){l(fe,se,ie,he)}},37822:function(D,L,t){var b=t(27219);D.exports=function(d,e,w,y){var _=d._fullLayout,u=_._paper,r=_._size;b(d,u,e,{width:r.w,height:r.h,margin:{t:r.t,r:r.r,b:r.b,l:r.l}},w,y)}},59549:function(D,L,t){var b=t(87163),d=t(25829),e=t(80337),w=t(13792).u,y=t(93049).extendFlat,_=t(78032).templatedArray;D.exports={domain:w({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:e({editType:"plot"}),tickfont:e({autoShadowDflt:!0,editType:"plot"}),rangefont:e({editType:"plot"}),dimensions:_("dimension",{label:{valType:"string",editType:"plot"},tickvals:y({},d.tickvals,{editType:"plot"}),ticktext:y({},d.ticktext,{editType:"plot"}),tickformat:y({},d.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:y({editType:"calc"},b("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},23245:function(D,L,t){var b=t(77911),d=t(45568),e=t(71293).keyFun,w=t(71293).repeat,y=t(34809).sorterAsc,_=t(34809).strTranslate,u=b.bar.snapRatio;function r(E,I){return E*(1-u)+I*u}var n=b.bar.snapClose;function l(E,I){return E*(1-n)+I*n}function o(E,I,B,N){if(function(ae,se){for(var he=0;he=se[he][0]&&ae<=se[he][1])return!0;return!1}(B,N))return B;var V=E?-1:1,j=0,$=I.length-1;if(V<0){var ee=j;j=$,$=ee}for(var H=I[j],J=H,Q=j;V*QI){Z=B;break}}if(V=J,isNaN(V)&&(V=isNaN(Q)||isNaN(Z)?isNaN(Q)?Z:Q:I-H[Q][1]oe[1]+ge||le=.9*oe[1]+.1*oe[0]?"n":le<=.9*oe[0]+.1*oe[1]?"s":"ns"}(ae,I);se&&(j.interval=ee[V],j.intervalPix=ae,j.region=se)}}if(E.ordinal&&!j.region){var he=E.unitTickvals,fe=E.unitToPaddedPx.invert(I);for(B=0;B=ie[0]&&fe<=ie[1]){j.clickableOrdinalRange=ie;break}}}return j}function v(E,I){d.event.sourceEvent.stopPropagation();var B=I.height-d.mouse(E)[1]-2*b.verticalPadding,N=I.brush.svgBrush;N.wasDragged=!0,N._dragging=!0,N.grabbingBar?N.newExtent=[B-N.grabPoint,B+N.barLength-N.grabPoint].map(I.unitToPaddedPx.invert):N.newExtent=[N.startExtent,I.unitToPaddedPx.invert(B)].sort(y),I.brush.filterSpecified=!0,N.extent=N.stayingIntervals.concat([N.newExtent]),N.brushCallback(I),k(E.parentNode)}function S(E,I){var B=A(I,I.height-d.mouse(E)[1]-2*b.verticalPadding),N="crosshair";B.clickableOrdinalRange?N="pointer":B.region&&(N=B.region+"-resize"),d.select(document.body).style("cursor",N)}function T(E){E.on("mousemove",function(I){d.event.preventDefault(),I.parent.inBrushDrag||S(this,I)}).on("mouseleave",function(I){I.parent.inBrushDrag||m()}).call(d.behavior.drag().on("dragstart",function(I){(function(B,N){d.event.sourceEvent.stopPropagation();var V=N.height-d.mouse(B)[1]-2*b.verticalPadding,j=N.unitToPaddedPx.invert(V),$=N.brush,ee=A(N,V),H=ee.interval,J=$.svgBrush;if(J.wasDragged=!1,J.grabbingBar=ee.region==="ns",J.grabbingBar){var Q=H.map(N.unitToPaddedPx);J.grabPoint=V-Q[0]-b.verticalPadding,J.barLength=Q[1]-Q[0]}J.clickableOrdinalRange=ee.clickableOrdinalRange,J.stayingIntervals=N.multiselect&&$.filterSpecified?$.filter.getConsolidated():[],H&&(J.stayingIntervals=J.stayingIntervals.filter(function(Z){return Z[0]!==H[0]&&Z[1]!==H[1]})),J.startExtent=ee.region?H[ee.region==="s"?1:0]:j,N.parent.inBrushDrag=!0,J.brushStartCallback()})(this,I)}).on("drag",function(I){v(this,I)}).on("dragend",function(I){(function(B,N){var V=N.brush,j=V.filter,$=V.svgBrush;$._dragging||(S(B,N),v(B,N),N.brush.svgBrush.wasDragged=!1),$._dragging=!1,d.event.sourceEvent.stopPropagation();var ee=$.grabbingBar;if($.grabbingBar=!1,$.grabLocation=void 0,N.parent.inBrushDrag=!1,m(),!$.wasDragged)return $.wasDragged=void 0,$.clickableOrdinalRange?V.filterSpecified&&N.multiselect?$.extent.push($.clickableOrdinalRange):($.extent=[$.clickableOrdinalRange],V.filterSpecified=!0):ee?($.extent=$.stayingIntervals,$.extent.length===0&&M(V)):M(V),$.brushCallback(N),k(B.parentNode),void $.brushEndCallback(V.filterSpecified?j.getConsolidated():[]);var H=function(){j.set(j.getConsolidated())};if(N.ordinal){var J=N.unitTickvals;J[J.length-1]$.newExtent[0];$.extent=$.stayingIntervals.concat(Q?[$.newExtent]:[]),$.extent.length||M(V),$.brushCallback(N),Q?k(B.parentNode,H):(H(),k(B.parentNode))}else H();$.brushEndCallback(V.filterSpecified?j.getConsolidated():[])})(this,I)}))}function p(E,I){return E[0]-I[0]}function M(E){E.filterSpecified=!1,E.svgBrush.extent=[[-1/0,1/0]]}function f(E){for(var I,B=E.slice(),N=[],V=B.shift();V;){for(I=V.slice();(V=B.shift())&&V[0]<=I[1];)I[1]=Math.max(I[1],V[1]);N.push(I)}return N.length===1&&N[0][0]>N[0][1]&&(N=[]),N}D.exports={makeBrush:function(E,I,B,N,V,j){var $,ee=function(){var H,J,Q=[];return{set:function(Z){(Q=Z.map(function(K){return K.slice().sort(y)}).sort(p)).length===1&&Q[0][0]===-1/0&&Q[0][1]===1/0&&(Q=[[0,-1]]),H=f(Q),J=Q.reduce(function(K,ae){return[Math.min(K[0],ae[0]),Math.max(K[1],ae[1])]},[1/0,-1/0])},get:function(){return Q.slice()},getConsolidated:function(){return H},getBounds:function(){return J}}}();return ee.set(B),{filter:ee,filterSpecified:I,svgBrush:{extent:[],brushStartCallback:N,brushCallback:($=V,function(H){var J=H.brush,Q=function(K){return K.svgBrush.extent.map(function(ae){return ae.slice()})}(J),Z=Q.slice();J.filter.set(Z),$()}),brushEndCallback:j}}},ensureAxisBrush:function(E,I,B){var N=E.selectAll("."+b.cn.axisBrush).data(w,e);N.enter().append("g").classed(b.cn.axisBrush,!0),function(V,j,$){var ee=$._context.staticPlot,H=V.selectAll(".background").data(w);H.enter().append("rect").classed("background",!0).call(s).call(c).style("pointer-events",ee?"none":"auto").attr("transform",_(0,b.verticalPadding)),H.call(T).attr("height",function(Z){return Z.height-b.verticalPadding});var J=V.selectAll(".highlight-shadow").data(w);J.enter().append("line").classed("highlight-shadow",!0).attr("x",-b.bar.width/2).attr("stroke-width",b.bar.width+b.bar.strokeWidth).attr("stroke",j).attr("opacity",b.bar.strokeOpacity).attr("stroke-linecap","butt"),J.attr("y1",function(Z){return Z.height}).call(g);var Q=V.selectAll(".highlight").data(w);Q.enter().append("line").classed("highlight",!0).attr("x",-b.bar.width/2).attr("stroke-width",b.bar.width-b.bar.strokeWidth).attr("stroke",b.bar.fillColor).attr("opacity",b.bar.fillOpacity).attr("stroke-linecap","butt"),Q.attr("y1",function(Z){return Z.height}).call(g)}(N,I,B)},cleanRanges:function(E,I){if(Array.isArray(E[0])?(E=E.map(function(N){return N.sort(y)}),E=I.multiselect?f(E.sort(p)):[E[0]]):E=[E.sort(y)],I.tickvals){var B=I.tickvals.slice().sort(y);if(!(E=E.map(function(N){var V=[o(0,B,N[0],[]),o(1,B,N[1],[])];if(V[1]>V[0])return V}).filter(function(N){return N})).length)return}return E.length>1?E:E[0]}}},79846:function(D,L,t){D.exports={attributes:t(59549),supplyDefaults:t(12842),calc:t(20113),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t(67207),categories:["gl","regl","noOpacity","noHover"],meta:{}}},67207:function(D,L,t){var b=t(45568),d=t(4173).eV,e=t(58823),w=t(62972);L.name="parcoords",L.plot=function(y){var _=d(y.calcdata,"parcoords")[0];_.length&&e(y,_)},L.clean=function(y,_,u,r){var n=r._has&&r._has("parcoords"),l=_._has&&_._has("parcoords");n&&!l&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},L.toSVG=function(y){var _=y._fullLayout._glimages,u=b.select(y).selectAll(".svg-container");u.filter(function(r,n){return n===u.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var r=this,n=r.toDataURL("image/png");_.append("svg:image").attr({xmlns:w.svg,"xlink:href":n,preserveAspectRatio:"none",x:0,y:0,width:r.style.width,height:r.style.height})}),window.setTimeout(function(){b.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},20113:function(D,L,t){var b=t(34809).isArrayOrTypedArray,d=t(88856),e=t(71293).wrap;D.exports=function(w,y){var _,u;return d.hasColorscale(y,"line")&&b(y.line.color)?(_=y.line.color,u=d.extractOpts(y.line).colorscale,d.calc(w,y,{vals:_,containerStr:"line",cLetter:"c"})):(_=function(r){for(var n=new Array(r),l=0;ln&&(b.log("parcoords traces support up to "+n+" dimensions at the moment"),g.splice(n));var k=y(s,c,{name:"dimensions",layout:x,handleItemDefaults:o}),A=function(S,T,p,M,f){var E=f("line.color",p);if(d(S,"line")&&b.isArrayOrTypedArray(E)){if(E.length)return f("line.colorscale"),e(S,T,M,f,{prefix:"line.",cLetter:"c"}),E.length;T.line.color=p}return 1/0}(s,c,h,x,m);w(c,x,m),Array.isArray(k)&&k.length||(c.visible=!1),l(c,k,"values",A);var v=b.extendFlat({},x.font,{size:Math.round(x.font.size/1.2)});b.coerceFont(m,"labelfont",v),b.coerceFont(m,"tickfont",v,{autoShadowDflt:!0}),b.coerceFont(m,"rangefont",v),m("labelangle"),m("labelside"),m("unselected.line.color"),m("unselected.line.opacity")}},62935:function(D,L,t){var b=t(34809).isTypedArray;L.convertTypedArray=function(d){return b(d)?Array.prototype.slice.call(d):d},L.isOrdinal=function(d){return!!d.tickvals},L.isVisible=function(d){return d.visible||!("visible"in d)}},83910:function(D,L,t){var b=t(79846);b.plot=t(58823),D.exports=b},1293:function(D,L,t){var b=["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(` +`),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')`}}},2178:function(D,L,t){var b=t(34809);D.exports=function(d,e){var w=d.split(" "),y=w[0],_=w[1],u=b.isArrayOrTypedArray(e)?b.mean(e):e,r=.5+u/100,n=1.5+u/100,l=["",""],o=[0,0];switch(y){case"top":l[0]="top",o[1]=-n;break;case"bottom":l[0]="bottom",o[1]=n}switch(_){case"left":l[1]="right",o[0]=-r;break;case"right":l[1]="left",o[0]=r}return{anchor:l[0]&&l[1]?l.join("-"):l[0]?l[0]:l[1]?l[1]:"center",offset:o}}},68192:function(D,L,t){var b=t(32280),d=t(34809),e=d.strTranslate,w=d.strScale,y=t(4173).fX,_=t(62972),u=t(45568),r=t(62203),n=t(30635),l=t(5417),o="mapbox",s=L.constants=t(44245);L.name=o,L.attr="subplot",L.idRoot=o,L.idRegex=L.attrRegex=d.counterRegex(o);var c=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/javascript/maplibre-migration/"].join(" ");L.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},L.layoutAttributes=t(67514),L.supplyLayoutDefaults=t(86989);var h=!0;function x(m){return typeof m=="string"&&(s.styleValuesMapbox.indexOf(m)!==-1||m.indexOf("mapbox://")===0||m.indexOf("stamen")===0)}L.plot=function(m){h&&(h=!1,d.warn(c));var g=m._fullLayout,k=m.calcdata,A=g._subplots[o];if(b.version!==s.requiredVersion)throw new Error(s.wrongVersionErrorMsg);var v=function(E,I){var B=E._fullLayout;if(E._context.mapboxAccessToken==="")return"";for(var N=[],V=[],j=!1,$=!1,ee=0;ee1&&d.warn(s.multipleTokensErrorMsg),N[0]):(V.length&&d.log(["Listed mapbox access token(s)",V.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(m,A);b.accessToken=v;for(var S=0;SV/2){var j=E.split("|").join("
");B.text(j).attr("data-unformatted",j).call(n.convertToTspans,m),N=r.bBox(B.node())}B.attr("transform",e(-3,8-N.height)),I.insert("rect",".static-attribution").attr({x:-N.width-6,y:-N.height-3,width:N.width+6,height:N.height+3,fill:"rgba(255, 255, 255, 0.75)"});var $=1;N.width+6>V&&($=V/(N.width+6));var ee=[A.l+A.w*T.x[1],A.t+A.h*(1-T.y[0])];I.attr("transform",e(ee[0],ee[1])+w($))}},L.updateFx=function(m){for(var g=m._fullLayout,k=g._subplots[o],A=0;A0){for(var o=0;o0}function r(n){var l={},o={};switch(n.type){case"circle":b.extendFlat(o,{"circle-radius":n.circle.radius,"circle-color":n.color,"circle-opacity":n.opacity});break;case"line":b.extendFlat(o,{"line-width":n.line.width,"line-color":n.color,"line-opacity":n.opacity,"line-dasharray":n.line.dash});break;case"fill":b.extendFlat(o,{"fill-color":n.color,"fill-outline-color":n.fill.outlinecolor,"fill-opacity":n.opacity});break;case"symbol":var s=n.symbol,c=e(s.textposition,s.iconsize);b.extendFlat(l,{"icon-image":s.icon+"-15","icon-size":s.iconsize/10,"text-field":s.text,"text-size":s.textfont.size,"text-anchor":c.anchor,"text-offset":c.offset,"symbol-placement":s.placement}),b.extendFlat(o,{"icon-color":n.color,"text-color":s.textfont.color,"text-opacity":n.opacity});break;case"raster":b.extendFlat(o,{"raster-fade-duration":0,"raster-opacity":n.opacity})}return{layout:l,paint:o}}_.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=u(n)},_.needsNewImage=function(n){return this.subplot.map.getSource(this.idSource)&&this.sourceType==="image"&&n.sourcetype==="image"&&(this.source!==n.source||JSON.stringify(this.coordinates)!==JSON.stringify(n.coordinates))},_.needsNewSource=function(n){return this.sourceType!==n.sourcetype||JSON.stringify(this.source)!==JSON.stringify(n.source)||this.layerType!==n.type},_.needsNewLayer=function(n){return this.layerType!==n.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},_.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},_.updateImage=function(n){this.subplot.map.getSource(this.idSource).updateImage({url:n.source,coordinates:n.coordinates});var l=this.findFollowingMapboxLayerId(this.lookupBelow());l!==null&&this.subplot.map.moveLayer(this.idLayer,l)},_.updateSource=function(n){var l=this.subplot.map;if(l.getSource(this.idSource)&&l.removeSource(this.idSource),this.sourceType=n.sourcetype,this.source=n.source,u(n)){var o=function(s){var c,h=s.sourcetype,x=s.source,m={type:h};return h==="geojson"?c="data":h==="vector"?c=typeof x=="string"?"url":"tiles":h==="raster"?(c="tiles",m.tileSize=256):h==="image"&&(c="url",m.coordinates=s.coordinates),m[c]=x,s.sourceattribution&&(m.attribution=d(s.sourceattribution)),m}(n);l.addSource(this.idSource,o)}},_.findFollowingMapboxLayerId=function(n){if(n==="traces")for(var l=this.subplot.getMapLayers(),o=0;o1)for(f=0;f-1&&h(j.originalEvent,E,[f.xaxis],[f.yaxis],f.id,V),$.indexOf("event")>-1&&u.click(E,j.originalEvent)}}},k.updateFx=function(p){var M=this,f=M.map,E=M.gd;if(!M.isStatic){var I,B=p.dragmode;I=function(j,$){$.isRect?(j.range={})[M.id]=[V([$.xmin,$.ymin]),V([$.xmax,$.ymax])]:(j.lassoPoints={})[M.id]=$.map(V)};var N=M.dragOptions;M.dragOptions=d.extendDeep(N||{},{dragmode:p.dragmode,element:M.div,gd:E,plotinfo:{id:M.id,domain:p[M.id].domain,xaxis:M.xaxis,yaxis:M.yaxis,fillRangeItems:I},xaxes:[M.xaxis],yaxes:[M.yaxis],subplot:M.id}),f.off("click",M.onClickInPanHandler),l(B)||n(B)?(f.dragPan.disable(),f.on("zoomstart",M.clearOutline),M.dragOptions.prepFn=function(j,$,ee){o(j,$,ee,M.dragOptions,B)},_.init(M.dragOptions)):(f.dragPan.enable(),f.off("zoomstart",M.clearOutline),M.div.onmousedown=null,M.div.ontouchstart=null,M.div.removeEventListener("touchstart",M.div._ontouchstart),M.onClickInPanHandler=M.onClickInPanFn(M.dragOptions),f.on("click",M.onClickInPanHandler))}function V(j){var $=M.map.unproject(j);return[$.lng,$.lat]}},k.updateFramework=function(p){var M=p[this.id].domain,f=p._size,E=this.div.style;E.width=f.w*(M.x[1]-M.x[0])+"px",E.height=f.h*(M.y[1]-M.y[0])+"px",E.left=f.l+M.x[0]*f.w+"px",E.top=f.t+(1-M.y[1])*f.h+"px",this.xaxis._offset=f.l+M.x[0]*f.w,this.xaxis._length=f.w*(M.x[1]-M.x[0]),this.yaxis._offset=f.t+(1-M.y[1])*f.h,this.yaxis._length=f.h*(M.y[1]-M.y[0])},k.updateLayers=function(p){var M,f=p[this.id].layers,E=this.layerList;if(f.length!==E.length){for(M=0;M=Z.width-20?(se["text-anchor"]="start",se.x=5):(se["text-anchor"]="end",se.x=Z._paper.attr("width")-7),K.attr(se);var he=K.select(".js-link-to-tool"),fe=K.select(".js-link-spacer"),ie=K.select(".js-sourcelinks");Q._context.showSources&&Q._context.showSources(Q),Q._context.showLink&&function(oe,le){le.text("");var ge=le.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(oe._context.linkText+" "+String.fromCharCode(187));if(oe._context.sendData)ge.on("click",function(){v.sendDataToCloud(oe)});else{var ye=window.location.pathname.split("/"),me=window.location.search;ge.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+ye[2].split(".")[0]+"/"+ye[1]+me})}}(Q,he),fe.text(he.text()&&ie.text()?" - ":"")}},v.sendDataToCloud=function(Q){var Z=(window.PLOTLYENV||{}).BASE_URL||Q._context.plotlyServerURL;if(Z){Q.emit("plotly_beforeexport");var K=b.select(Q).append("div").attr("id","hiddenform").style("display","none"),ae=K.append("form").attr({action:Z+"/external",method:"post",target:"_blank"});return ae.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(Q,!1,"keepdata"),ae.node().submit(),K.remove(),Q.emit("plotly_afterexport"),!1}};var p=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],M=["year","month","dayMonth","dayMonthYear"];function f(Q,Z){var K=Q._context.locale;K||(K="en-US");var ae=!1,se={};function he(ye){for(var me=!0,be=0;be1&&Pe.length>1){for(_.getComponentMethod("grid","sizeDefaults")(fe,he),se=0;se15&&Pe.length>15&&he.shapes.length===0&&he.images.length===0,v.linkSubplots(oe,he,ie,ae),v.cleanPlot(oe,he,ie,ae);var Fe=!(!ae._has||!ae._has("gl2d")),qe=!(!he._has||!he._has("gl2d")),$e=!(!ae._has||!ae._has("cartesian"))||Fe,Ye=!(!he._has||!he._has("cartesian"))||qe;$e&&!Ye?ae._bgLayer.remove():Ye&&!$e&&(he._shouldCreateBgLayer=!0),ae._zoomlayer&&!Q._dragging&&c({_fullLayout:ae}),function(Ge,tt){var nt,ft=[];tt.meta&&(nt=tt._meta={meta:tt.meta,layout:{meta:tt.meta}});for(var At=0;At0){var le=1-2*fe;ae=Math.round(le*ae),se=Math.round(le*se)}}var ge=v.layoutAttributes.width.min,ye=v.layoutAttributes.height.min;ae1,be=!Z.height&&Math.abs(K.height-se)>1;(be||me)&&(me&&(K.width=ae),be&&(K.height=se)),Q._initialAutoSize||(Q._initialAutoSize={width:ae,height:se}),v.sanitizeMargins(K)},v.supplyLayoutModuleDefaults=function(Q,Z,K,ae){var se,he,fe,ie=_.componentsRegistry,oe=Z._basePlotModules,le=_.subplotsRegistry.cartesian;for(se in ie)(fe=ie[se]).includeBasePlot&&fe.includeBasePlot(Q,Z);for(var ge in oe.length||oe.push(le),Z._has("cartesian")&&(_.getComponentMethod("grid","contentDefaults")(Q,Z),le.finalizeSubplots(Q,Z)),Z._subplots)Z._subplots[ge].sort(n.subplotSort);for(he=0;he1&&(K.l/=Ce,K.r/=Ce)}if(me){var Le=(K.t+K.b)/me;Le>1&&(K.t/=Le,K.b/=Le)}var Oe=K.xl!==void 0?K.xl:K.x,We=K.xr!==void 0?K.xr:K.x,Ie=K.yt!==void 0?K.yt:K.y,Ve=K.yb!==void 0?K.yb:K.y;be[Z]={l:{val:Oe,size:K.l+Ee},r:{val:We,size:K.r+Ee},b:{val:Ve,size:K.b+Ee},t:{val:Ie,size:K.t+Ee}},Se[Z]=1}else delete be[Z],delete Se[Z];if(!ae._replotting)return v.doAutoMargin(Q)}},v.doAutoMargin=function(Q){var Z=Q._fullLayout,K=Z.width,ae=Z.height;Z._size||(Z._size={}),V(Z);var se=Z._size,he=Z.margin,fe={t:0,b:0,l:0,r:0},ie=n.extendFlat({},se),oe=he.l,le=he.r,ge=he.t,ye=he.b,me=Z._pushmargin,be=Z._pushmarginIds,Se=Z.minreducedwidth,Ee=Z.minreducedheight;if(he.autoexpand!==!1){for(var Ce in me)be[Ce]||delete me[Ce];var Le=Q._fullLayout._reservedMargin;for(var Oe in Le)for(var We in Le[Oe]){var Ie=Le[Oe][We];fe[We]=Math.max(fe[We],Ie)}for(var Ve in me.base={l:{val:0,size:oe},r:{val:1,size:le},t:{val:1,size:ge},b:{val:0,size:ye}},fe){var Pe=0;for(var de in me)de!=="base"&&w(me[de][Ve].size)&&(Pe=me[de][Ve].size>Pe?me[de][Ve].size:Pe);var Me=Math.max(0,he[Ve]-Pe);fe[Ve]=Math.max(0,fe[Ve]-Me)}for(var ke in me){var He=me[ke].l||{},Fe=me[ke].b||{},qe=He.val,$e=He.size,Ye=Fe.val,_e=Fe.size,De=K-fe.r-fe.l,Be=ae-fe.t-fe.b;for(var Ge in me){if(w($e)&&me[Ge].r){var tt=me[Ge].r.val,nt=me[Ge].r.size;if(tt>qe){var ft=($e*tt+(nt-De)*qe)/(tt-qe),At=(nt*(1-qe)+($e-De)*(1-tt))/(tt-qe);ft+At>oe+le&&(oe=ft,le=At)}}if(w(_e)&&me[Ge].t){var kt=me[Ge].t.val,Vt=me[Ge].t.size;if(kt>Ye){var Ht=(_e*kt+(Vt-Be)*Ye)/(kt-Ye),Gt=(Vt*(1-Ye)+(_e-Be)*(1-kt))/(kt-Ye);Ht+Gt>ye+ge&&(ye=Ht,ge=Gt)}}}}}var st=n.constrain(K-he.l-he.r,2,Se),Qe=n.constrain(ae-he.t-he.b,2,Ee),pt=Math.max(0,K-st),yt=Math.max(0,ae-Qe);if(pt){var Ot=(oe+le)/pt;Ot>1&&(oe/=Ot,le/=Ot)}if(yt){var Pt=(ye+ge)/yt;Pt>1&&(ye/=Pt,ge/=Pt)}if(se.l=Math.round(oe)+fe.l,se.r=Math.round(le)+fe.r,se.t=Math.round(ge)+fe.t,se.b=Math.round(ye)+fe.b,se.p=Math.round(he.pad),se.w=Math.round(K)-se.l-se.r,se.h=Math.round(ae)-se.t-se.b,!Z._replotting&&(v.didMarginChange(ie,se)||function(lt){if("_redrawFromAutoMarginCount"in lt._fullLayout)return!1;var Xe=s.list(lt,"",!0);for(var ut in Xe)if(Xe[ut].autoshift||Xe[ut].shift)return!0;return!1}(Q))){"_redrawFromAutoMarginCount"in Z?Z._redrawFromAutoMarginCount++:Z._redrawFromAutoMarginCount=1;var at=3*(1+Object.keys(be).length);if(Z._redrawFromAutoMarginCount0&&(Q._transitioningWithDuration=!0),Q._transitionData._interruptCallbacks.push(function(){ae=!0}),K.redraw&&Q._transitionData._interruptCallbacks.push(function(){return _.call("redraw",Q)}),Q._transitionData._interruptCallbacks.push(function(){Q.emit("plotly_transitioninterrupted",[])});var ie=0,oe=0;function le(){return ie++,function(){var ge;oe++,ae||oe!==ie||(ge=fe,Q._transitionData&&(function(ye){if(ye)for(;ye.length;)ye.shift()}(Q._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(K.redraw)return _.call("redraw",Q)}).then(function(){Q._transitioning=!1,Q._transitioningWithDuration=!1,Q.emit("plotly_transitioned",[])}).then(ge)))}}K.runFn(le),setTimeout(le())})}],he=n.syncOrAsync(se,Q);return he&&he.then||(he=Promise.resolve()),he.then(function(){return Q})}v.didMarginChange=function(Q,Z){for(var K=0;K1)return!0}return!1},v.graphJson=function(Q,Z,K,ae,se,he){(se&&Z&&!Q._fullData||se&&!Z&&!Q._fullLayout)&&v.supplyDefaults(Q);var fe=se?Q._fullData:Q.data,ie=se?Q._fullLayout:Q.layout,oe=(Q._transitionData||{})._frames;function le(me,be){if(typeof me=="function")return be?"_function_":null;if(n.isPlainObject(me)){var Se,Ee={};return Object.keys(me).sort().forEach(function(We){if(["_","["].indexOf(We.charAt(0))===-1)if(typeof me[We]!="function"){if(K==="keepdata"){if(We.substr(We.length-3)==="src")return}else if(K==="keepstream"){if(typeof(Se=me[We+"src"])=="string"&&Se.indexOf(":")>0&&!n.isPlainObject(me.stream))return}else if(K!=="keepall"&&typeof(Se=me[We+"src"])=="string"&&Se.indexOf(":")>0)return;Ee[We]=le(me[We],be)}else be&&(Ee[We]="_function")}),Ee}var Ce=Array.isArray(me),Le=n.isTypedArray(me);if((Ce||Le)&&me.dtype&&me.shape){var Oe=me.bdata;return le({dtype:me.dtype,shape:me.shape,bdata:n.isArrayBuffer(Oe)?y.encode(Oe):Oe},be)}return Ce?me.map(function(We){return le(We,be)}):Le?n.simpleMap(me,n.identity):n.isJSDate(me)?n.ms2DateTimeLocal(+me):me}var ge={data:(fe||[]).map(function(me){var be=le(me);return Z&&delete be.fit,be})};if(!Z&&(ge.layout=le(ie),se)){var ye=ie._size;ge.layout.computed={margin:{b:ye.b,l:ye.l,r:ye.r,t:ye.t}}}return oe&&(ge.frames=le(oe)),he&&(ge.config=le(Q._context,!0)),ae==="object"?ge:JSON.stringify(ge)},v.modifyFrames=function(Q,Z){var K,ae,se,he=Q._transitionData._frames,fe=Q._transitionData._frameHash;for(K=0;K=0;he--)if(Ve[he].enabled){K._indexToPoints=Ve[he]._indexToPoints;break}ae&&ae.calc&&(Ie=ae.calc(Q,K))}Array.isArray(Ie)&&Ie[0]||(Ie=[{x:o,y:o}]),Ie[0].t||(Ie[0].t={}),Ie[0].trace=K,le[Oe]=Ie}}for(H(fe,ie,oe),se=0;se1e-10?o:0}function l(o,s,c){s=s||0,c=c||0;for(var h=o.length,x=new Array(h),m=0;m0?m:1/0}),h=b.mod(c+1,s.length);return[s[c],s[h]]},findIntersectionXY:u,findXYatLength:function(o,s,c,h){var x=-s*c,m=s*s+1,g=2*(s*x-c),k=x*x+c*c-o*o,A=Math.sqrt(g*g-4*m*k),v=(-g+A)/(2*m),S=(-g-A)/(2*m);return[[v,s*v+x+h],[S,s*S+x+h]]},clampTiny:n,pathPolygon:function(o,s,c,h,x,m){return"M"+l(r(o,s,c,h),x,m).join("L")},pathPolygonAnnulus:function(o,s,c,h,x,m,g){var k,A;o=90||Gt>90&&st>=450?1:pt<=0&&Ot<=0?0:Math.max(pt,Ot),[Gt<=180&&st>=180||Gt>180&&st>=540?-1:Qe>=0&&yt>=0?0:Math.min(Qe,yt),Gt<=270&&st>=270||Gt>270&&st>=630?-1:pt>=0&&Ot>=0?0:Math.min(pt,Ot),st>=360?1:Qe<=0&&yt<=0?0:Math.max(Qe,yt),kt]}(Ce),de=Pe[2]-Pe[0],Me=Pe[3]-Pe[1],ke=Ee/Se,He=Math.abs(Me/de);ke>He?(Le=Se,Ve=(Ee-(Oe=Se*He))/le.h/2,We=[me[0],me[1]],Ie=[be[0]+Ve,be[1]-Ve]):(Oe=Ee,Ve=(Se-(Le=Ee/He))/le.w/2,We=[me[0]+Ve,me[1]-Ve],Ie=[be[0],be[1]]),ie.xLength2=Le,ie.yLength2=Oe,ie.xDomain2=We,ie.yDomain2=Ie;var Fe,qe=ie.xOffset2=le.l+le.w*We[0],$e=ie.yOffset2=le.t+le.h*(1-Ie[1]),Ye=ie.radius=Le/de,_e=ie.innerRadius=ie.getHole(fe)*Ye,De=ie.cx=qe-Ye*Pe[0],Be=ie.cy=$e+Ye*Pe[3],Ge=ie.cxx=De-qe,tt=ie.cyy=Be-$e,nt=ge.side;nt==="counterclockwise"?(Fe=nt,nt="top"):nt==="clockwise"&&(Fe=nt,nt="bottom"),ie.radialAxis=ie.mockAxis(he,fe,ge,{_id:"x",side:nt,_trueSide:Fe,domain:[_e/le.w,Ye/le.w]}),ie.angularAxis=ie.mockAxis(he,fe,ye,{side:"right",domain:[0,Math.PI],autorange:!1}),ie.doAutoRange(he,fe),ie.updateAngularAxis(he,fe),ie.updateRadialAxis(he,fe),ie.updateRadialAxisTitle(he,fe),ie.xaxis=ie.mockCartesianAxis(he,fe,{_id:"x",domain:We}),ie.yaxis=ie.mockCartesianAxis(he,fe,{_id:"y",domain:Ie});var ft=ie.pathSubplot();ie.clipPaths.forTraces.select("path").attr("d",ft).attr("transform",_(Ge,tt)),oe.frontplot.attr("transform",_(qe,$e)).call(r.setClipUrl,ie._hasClipOnAxisFalse?null:ie.clipIds.forTraces,ie.gd),oe.bg.attr("d",ft).attr("transform",_(De,Be)).call(u.fill,fe.bgcolor)},Z.mockAxis=function(he,fe,ie,oe){var le=w.extendFlat({},ie,oe);return s(le,fe,he),le},Z.mockCartesianAxis=function(he,fe,ie){var oe=this,le=oe.isSmith,ge=ie._id,ye=w.extendFlat({type:"linear"},ie);o(ye,he);var me={x:[0,2],y:[1,3]};return ye.setRange=function(){var be=oe.sectorBBox,Se=me[ge],Ee=oe.radialAxis._rl,Ce=(Ee[1]-Ee[0])/(1-oe.getHole(fe));ye.range=[be[Se[0]]*Ce,be[Se[1]]*Ce]},ye.isPtWithinRange=ge!=="x"||le?function(){return!0}:function(be){return oe.isPtInside(be)},ye.setRange(),ye.setScale(),ye},Z.doAutoRange=function(he,fe){var ie=this,oe=ie.gd,le=ie.radialAxis,ge=ie.getRadial(fe);c(oe,le);var ye=le.range;if(ge.range=ye.slice(),ge._input.range=ye.slice(),le._rl=[le.r2l(ye[0],null,"gregorian"),le.r2l(ye[1],null,"gregorian")],le.minallowed!==void 0){var me=le.r2l(le.minallowed);le._rl[0]>le._rl[1]?le._rl[1]=Math.max(le._rl[1],me):le._rl[0]=Math.max(le._rl[0],me)}if(le.maxallowed!==void 0){var be=le.r2l(le.maxallowed);le._rl[0]90&&Ee<=270&&(Ce.tickangle=180);var We=Oe?function($e){var Ye=j(ie,B([$e.x,0]));return _(Ye[0]-me,Ye[1]-be)}:function($e){return _(Ce.l2p($e.x)+ye,0)},Ie=Oe?function($e){return V(ie,$e.x,-1/0,1/0)}:function($e){return ie.pathArc(Ce.r2p($e.x)+ye)},Ve=K(Se);if(ie.radialTickLayout!==Ve&&(le["radial-axis"].selectAll(".xtick").remove(),ie.radialTickLayout=Ve),Le){Ce.setScale();var Pe=0,de=Oe?(Ce.tickvals||[]).filter(function($e){return $e>=0}).map(function($e){return l.tickText(Ce,$e,!0,!1)}):l.calcTicks(Ce),Me=Oe?de:l.clipEnds(Ce,de),ke=l.getTickSigns(Ce)[2];Oe&&((Ce.ticks==="top"&&Ce.side==="bottom"||Ce.ticks==="bottom"&&Ce.side==="top")&&(ke=-ke),Ce.ticks==="top"&&Ce.side==="top"&&(Pe=-Ce.ticklen),Ce.ticks==="bottom"&&Ce.side==="bottom"&&(Pe=Ce.ticklen)),l.drawTicks(oe,Ce,{vals:de,layer:le["radial-axis"],path:l.makeTickPath(Ce,0,ke),transFn:We,crisp:!1}),l.drawGrid(oe,Ce,{vals:Me,layer:le["radial-grid"],path:Ie,transFn:w.noop,crisp:!1}),l.drawLabels(oe,Ce,{vals:de,layer:le["radial-axis"],transFn:We,labelFns:l.makeLabelFns(Ce,Pe)})}var He=ie.radialAxisAngle=ie.vangles?J(ae(H(Se.angle),ie.vangles)):Se.angle,Fe=_(me,be),qe=Fe+y(-He);se(le["radial-axis"],Le&&(Se.showticklabels||Se.ticks),{transform:qe}),se(le["radial-grid"],Le&&Se.showgrid,{transform:Oe?"":Fe}),se(le["radial-line"].select("line"),Le&&Se.showline,{x1:Oe?-ge:ye,y1:0,x2:ge,y2:0,transform:qe}).attr("stroke-width",Se.linewidth).call(u.stroke,Se.linecolor)},Z.updateRadialAxisTitle=function(he,fe,ie){if(!this.isSmith){var oe=this,le=oe.gd,ge=oe.radius,ye=oe.cx,me=oe.cy,be=oe.getRadial(fe),Se=oe.id+"title",Ee=0;if(be.title){var Ce=r.bBox(oe.layers["radial-axis"].node()).height,Le=be.title.font.size,Oe=be.side;Ee=Oe==="top"?Le:Oe==="counterclockwise"?-(Ce+.4*Le):Ce+.8*Le}var We=ie!==void 0?ie:oe.radialAxisAngle,Ie=H(We),Ve=Math.cos(Ie),Pe=Math.sin(Ie),de=ye+ge/2*Ve+Ee*Pe,Me=me-ge/2*Pe+Ee*Ve;oe.layers["radial-axis-title"]=g.draw(le,Se,{propContainer:be,propName:oe.id+".radialaxis.title",placeholder:$(le,"Click to enter radial axis title"),attributes:{x:de,y:Me,"text-anchor":"middle"},transform:{rotate:-We}})}},Z.updateAngularAxis=function(he,fe){var ie=this,oe=ie.gd,le=ie.layers,ge=ie.radius,ye=ie.innerRadius,me=ie.cx,be=ie.cy,Se=ie.getAngular(fe),Ee=ie.angularAxis,Ce=ie.isSmith;Ce||(ie.fillViewInitialKey("angularaxis.rotation",Se.rotation),Ee.setGeometry(),Ee.setScale());var Le=Ce?function($e){var Ye=j(ie,B([0,$e.x]));return Math.atan2(Ye[0]-me,Ye[1]-be)-Math.PI/2}:function($e){return Ee.t2g($e.x)};Ee.type==="linear"&&Ee.thetaunit==="radians"&&(Ee.tick0=J(Ee.tick0),Ee.dtick=J(Ee.dtick));var Oe=function($e){return _(me+ge*Math.cos($e),be-ge*Math.sin($e))},We=Ce?function($e){var Ye=j(ie,B([0,$e.x]));return _(Ye[0],Ye[1])}:function($e){return Oe(Le($e))},Ie=Ce?function($e){var Ye=j(ie,B([0,$e.x])),_e=Math.atan2(Ye[0]-me,Ye[1]-be)-Math.PI/2;return _(Ye[0],Ye[1])+y(-J(_e))}:function($e){var Ye=Le($e);return Oe(Ye)+y(-J(Ye))},Ve=Ce?function($e){return N(ie,$e.x,0,1/0)}:function($e){var Ye=Le($e),_e=Math.cos(Ye),De=Math.sin(Ye);return"M"+[me+ye*_e,be-ye*De]+"L"+[me+ge*_e,be-ge*De]},Pe=l.makeLabelFns(Ee,0).labelStandoff,de={xFn:function($e){var Ye=Le($e);return Math.cos(Ye)*Pe},yFn:function($e){var Ye=Le($e),_e=Math.sin(Ye)>0?.2:1;return-Math.sin(Ye)*(Pe+$e.fontSize*_e)+Math.abs(Math.cos(Ye))*($e.fontSize*M)},anchorFn:function($e){var Ye=Le($e),_e=Math.cos(Ye);return Math.abs(_e)<.1?"middle":_e>0?"start":"end"},heightFn:function($e,Ye,_e){var De=Le($e);return-.5*(1+Math.sin(De))*_e}},Me=K(Se);ie.angularTickLayout!==Me&&(le["angular-axis"].selectAll("."+Ee._id+"tick").remove(),ie.angularTickLayout=Me);var ke,He=Ce?[1/0].concat(Ee.tickvals||[]).map(function($e){return l.tickText(Ee,$e,!0,!1)}):l.calcTicks(Ee);if(Ce&&(He[0].text="∞",He[0].fontSize*=1.75),fe.gridshape==="linear"?(ke=He.map(Le),w.angleDelta(ke[0],ke[1])<0&&(ke=ke.slice().reverse())):ke=null,ie.vangles=ke,Ee.type==="category"&&(He=He.filter(function($e){return w.isAngleInsideSector(Le($e),ie.sectorInRad)})),Ee.visible){var Fe=Ee.ticks==="inside"?-1:1,qe=(Ee.linewidth||1)/2;l.drawTicks(oe,Ee,{vals:He,layer:le["angular-axis"],path:"M"+Fe*qe+",0h"+Fe*Ee.ticklen,transFn:Ie,crisp:!1}),l.drawGrid(oe,Ee,{vals:He,layer:le["angular-grid"],path:Ve,transFn:w.noop,crisp:!1}),l.drawLabels(oe,Ee,{vals:He,layer:le["angular-axis"],repositionOnUpdate:!0,transFn:We,labelFns:de})}se(le["angular-line"].select("path"),Se.showline,{d:ie.pathSubplot(),transform:_(me,be)}).attr("stroke-width",Se.linewidth).call(u.stroke,Se.linecolor)},Z.updateFx=function(he,fe){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(he),this.updateRadialDrag(he,fe,0),this.updateRadialDrag(he,fe,1)),this.updateHoverAndMainDrag(he))},Z.updateHoverAndMainDrag=function(he){var fe,ie,oe=this,le=oe.isSmith,ge=oe.gd,ye=oe.layers,me=he._zoomlayer,be=f.MINZOOM,Se=f.OFFEDGE,Ee=oe.radius,Ce=oe.innerRadius,Le=oe.cx,Oe=oe.cy,We=oe.cxx,Ie=oe.cyy,Ve=oe.sectorInRad,Pe=oe.vangles,de=oe.radialAxis,Me=E.clampTiny,ke=E.findXYatLength,He=E.findEnclosingVertexAngles,Fe=f.cornerHalfWidth,qe=f.cornerLen/2,$e=h.makeDragger(ye,"path","maindrag",he.dragmode===!1?"none":"crosshair");b.select($e).attr("d",oe.pathSubplot()).attr("transform",_(Le,Oe)),$e.onmousemove=function(vt){m.hover(ge,vt,oe.id),ge._fullLayout._lasthover=$e,ge._fullLayout._hoversubplot=oe.id},$e.onmouseout=function(vt){ge._dragging||x.unhover(ge,vt)};var Ye,_e,De,Be,Ge,tt,nt,ft,At,kt={element:$e,gd:ge,subplot:oe.id,plotinfo:{id:oe.id,xaxis:oe.xaxis,yaxis:oe.yaxis},xaxes:[oe.xaxis],yaxes:[oe.yaxis]};function Vt(vt,Lt){return Math.sqrt(vt*vt+Lt*Lt)}function Ht(vt,Lt){return Vt(vt-We,Lt-Ie)}function Gt(vt,Lt){return Math.atan2(Ie-Lt,vt-We)}function st(vt,Lt){return[vt*Math.cos(Lt),vt*Math.sin(-Lt)]}function Qe(vt,Lt){if(vt===0)return oe.pathSector(2*Fe);var jt=qe/vt,rt=Lt-jt,et=Lt+jt,Et=Math.max(0,Math.min(vt,Ee)),Bt=Et-Fe,Ft=Et+Fe;return"M"+st(Bt,rt)+"A"+[Bt,Bt]+" 0,0,0 "+st(Bt,et)+"L"+st(Ft,et)+"A"+[Ft,Ft]+" 0,0,1 "+st(Ft,rt)+"Z"}function pt(vt,Lt,jt){if(vt===0)return oe.pathSector(2*Fe);var rt,et,Et=st(vt,Lt),Bt=st(vt,jt),Ft=Me((Et[0]+Bt[0])/2),St=Me((Et[1]+Bt[1])/2);if(Ft&&St){var Jt=St/Ft,qt=-1/Jt,en=ke(Fe,Jt,Ft,St);rt=ke(qe,qt,en[0][0],en[0][1]),et=ke(qe,qt,en[1][0],en[1][1])}else{var Wt,Zt;St?(Wt=qe,Zt=Fe):(Wt=Fe,Zt=qe),rt=[[Ft-Wt,St-Zt],[Ft+Wt,St-Zt]],et=[[Ft-Wt,St+Zt],[Ft+Wt,St+Zt]]}return"M"+rt.join("L")+"L"+et.reverse().join("L")+"Z"}function yt(vt,Lt){return Lt=Math.max(Math.min(Lt,Ee),Ce),vtbe?(vt-1&&vt===1&&A(Lt,ge,[oe.xaxis],[oe.yaxis],oe.id,kt),jt.indexOf("event")>-1&&m.click(ge,Lt,oe.id)}kt.prepFn=function(vt,Lt,jt){var rt=ge._fullLayout.dragmode,et=$e.getBoundingClientRect();ge._fullLayout._calcInverseTransform(ge);var Et=ge._fullLayout._invTransform;fe=ge._fullLayout._invScaleX,ie=ge._fullLayout._invScaleY;var Bt=w.apply3DTransform(Et)(Lt-et.left,jt-et.top);if(Ye=Bt[0],_e=Bt[1],Pe){var Ft=E.findPolygonOffset(Ee,Ve[0],Ve[1],Pe);Ye+=We+Ft[0],_e+=Ie+Ft[1]}switch(rt){case"zoom":kt.clickFn=wt,le||(kt.moveFn=Pe?lt:Pt,kt.doneFn=Xe,function(){De=null,Be=null,Ge=oe.pathSubplot(),tt=!1;var St=ge._fullLayout[oe.id];nt=d(St.bgcolor).getLuminance(),(ft=h.makeZoombox(me,nt,Le,Oe,Ge)).attr("fill-rule","evenodd"),At=h.makeCorners(me,Le,Oe),v(ge)}());break;case"select":case"lasso":k(vt,Lt,jt,kt,rt)}},x.init(kt)},Z.updateRadialDrag=function(he,fe,ie){var oe=this,le=oe.gd,ge=oe.layers,ye=oe.radius,me=oe.innerRadius,be=oe.cx,Se=oe.cy,Ee=oe.radialAxis,Ce=f.radialDragBoxSize,Le=Ce/2;if(Ee.visible){var Oe,We,Ie,Ve=H(oe.radialAxisAngle),Pe=Ee._rl,de=Pe[0],Me=Pe[1],ke=Pe[ie],He=.75*(Pe[1]-Pe[0])/(1-oe.getHole(fe))/ye;ie?(Oe=be+(ye+Le)*Math.cos(Ve),We=Se-(ye+Le)*Math.sin(Ve),Ie="radialdrag"):(Oe=be+(me-Le)*Math.cos(Ve),We=Se-(me-Le)*Math.sin(Ve),Ie="radialdrag-inner");var Fe,qe,$e,Ye=h.makeRectDragger(ge,Ie,"crosshair",-Le,-Le,Ce,Ce),_e={element:Ye,gd:le};he.dragmode===!1&&(_e.dragmode=!1),se(b.select(Ye),Ee.visible&&me0==(ie?$e>de:$es?function(g){return g<=0}:function(g){return g>=0};r.c2g=function(g){var k=r.c2l(g)-o;return(m(k)?k:0)+x},r.g2c=function(g){return r.l2c(g+o-x)},r.g2p=function(g){return g*h},r.c2p=function(g){return r.g2p(r.c2g(g))}}})(y,_);break;case"angularaxis":(function(r,n){var l=r.type;if(l==="linear"){var o=r.d2c,s=r.c2d;r.d2c=function(c,h){return function(x,m){return m==="degrees"?e(x):x}(o(c),h)},r.c2d=function(c,h){return s(function(x,m){return m==="degrees"?w(x):x}(c,h))}}r.makeCalcdata=function(c,h){var x,m,g=c[h],k=c._length,A=function(M){return r.d2c(M,c.thetaunit)};if(g)for(x=new Array(k),m=0;m0?1:0}function t(e){var w=e[0],y=e[1];if(!isFinite(w)||!isFinite(y))return[1,0];var _=(w+1)*(w+1)+y*y;return[(w*w+y*y-1)/_,2*y/_]}function b(e,w){var y=w[0],_=w[1];return[y*e.radius+e.cx,-_*e.radius+e.cy]}function d(e,w){return w*e.radius}D.exports={smith:t,reactanceArc:function(e,w,y,_){var u=b(e,t([y,w])),r=u[0],n=u[1],l=b(e,t([_,w])),o=l[0],s=l[1];if(w===0)return["M"+r+","+n,"L"+o+","+s].join(" ");var c=d(e,1/Math.abs(w));return["M"+r+","+n,"A"+c+","+c+" 0 0,"+(w<0?1:0)+" "+o+","+s].join(" ")},resistanceArc:function(e,w,y,_){var u=d(e,1/(w+1)),r=b(e,t([w,y])),n=r[0],l=r[1],o=b(e,t([w,_])),s=o[0],c=o[1];if(L(y)!==L(_)){var h=b(e,t([w,0]));return["M"+n+","+l,"A"+u+","+u+" 0 0,"+(00){for(var _=[],u=0;u=T&&(M.min=0,f.min=0,E.min=0,h.aaxis&&delete h.aaxis.min,h.baxis&&delete h.baxis.min,h.caxis&&delete h.caxis.min)}function c(h,x,m,g){var k=l[x._name];function A(f,E){return e.coerce(h,x,k,f,E)}A("uirevision",g.uirevision),x.type="linear";var v=A("color"),S=v!==k.color.dflt?v:m.font.color,T=x._name.charAt(0).toUpperCase(),p="Component "+T,M=A("title.text",p);x._hovertitle=M===p?M:T,e.coerceFont(A,"title.font",m.font,{overrideDflt:{size:e.bigFont(m.font.size),color:S}}),A("min"),r(h,x,A,"linear"),_(h,x,A,"linear"),y(h,x,A,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),u(h,x,A,{outerTicks:!0}),A("showticklabels")&&(e.coerceFont(A,"tickfont",m.font,{overrideDflt:{color:S}}),A("tickangle"),A("tickformat")),n(h,x,A,{dfltColor:v,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:k}),A("hoverformat"),A("layer")}D.exports=function(h,x,m){w(h,x,m,{type:"ternary",attributes:l,handleDefaults:s,font:x.font,paper_bgcolor:x.paper_bgcolor})}},83637:function(D,L,t){var b=t(45568),d=t(65657),e=t(33626),w=t(34809),y=w.strTranslate,_=w._,u=t(78766),r=t(62203),n=t(19091),l=t(93049).extendFlat,o=t(44122),s=t(29714),c=t(14751),h=t(32141),x=t(70414),m=x.freeMode,g=x.rectMode,k=t(17240),A=t(44844).prepSelect,v=t(44844).selectOnClick,S=t(44844).clearOutline,T=t(44844).clearSelectionsCache,p=t(54826);function M(ee,H){this.id=ee.id,this.graphDiv=ee.graphDiv,this.init(H),this.makeFramework(H),this.updateFx(H),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}D.exports=M;var f=M.prototype;f.init=function(ee){this.container=ee._ternarylayer,this.defs=ee._defs,this.layoutId=ee._uid,this.traceHash={},this.layers={}},f.plot=function(ee,H){var J=this,Q=H[J.id],Z=H._size;J._hasClipOnAxisFalse=!1;for(var K=0;KE*me?Z=(K=me)*E:K=(Z=ye)/E,ae=le*Z/ye,se=ge*K/me,J=H.l+H.w*ie-Z/2,Q=H.t+H.h*(1-oe)-K/2,he.x0=J,he.y0=Q,he.w=Z,he.h=K,he.sum=be,he.xaxis={type:"linear",range:[Se+2*Ce-be,be-Se-2*Ee],domain:[ie-ae/2,ie+ae/2],_id:"x"},n(he.xaxis,he.graphDiv._fullLayout),he.xaxis.setScale(),he.xaxis.isPtWithinRange=function(Fe){return Fe.a>=he.aaxis.range[0]&&Fe.a<=he.aaxis.range[1]&&Fe.b>=he.baxis.range[1]&&Fe.b<=he.baxis.range[0]&&Fe.c>=he.caxis.range[1]&&Fe.c<=he.caxis.range[0]},he.yaxis={type:"linear",range:[Se,be-Ee-Ce],domain:[oe-se/2,oe+se/2],_id:"y"},n(he.yaxis,he.graphDiv._fullLayout),he.yaxis.setScale(),he.yaxis.isPtWithinRange=function(){return!0};var Le=he.yaxis.domain[0],Oe=he.aaxis=l({},ee.aaxis,{range:[Se,be-Ee-Ce],side:"left",tickangle:(+ee.aaxis.tickangle||0)-30,domain:[Le,Le+se*E],anchor:"free",position:0,_id:"y",_length:Z});n(Oe,he.graphDiv._fullLayout),Oe.setScale();var We=he.baxis=l({},ee.baxis,{range:[be-Se-Ce,Ee],side:"bottom",domain:he.xaxis.domain,anchor:"free",position:0,_id:"x",_length:Z});n(We,he.graphDiv._fullLayout),We.setScale();var Ie=he.caxis=l({},ee.caxis,{range:[be-Se-Ee,Ce],side:"right",tickangle:(+ee.caxis.tickangle||0)+30,domain:[Le,Le+se*E],anchor:"free",position:0,_id:"y",_length:Z});n(Ie,he.graphDiv._fullLayout),Ie.setScale();var Ve="M"+J+","+(Q+K)+"h"+Z+"l-"+Z/2+",-"+K+"Z";he.clipDef.select("path").attr("d",Ve),he.layers.plotbg.select("path").attr("d",Ve);var Pe="M0,"+K+"h"+Z+"l-"+Z/2+",-"+K+"Z";he.clipDefRelative.select("path").attr("d",Pe);var de=y(J,Q);he.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",de),he.clipDefRelative.select("path").attr("transform",null);var Me=y(J-We._offset,Q+K);he.layers.baxis.attr("transform",Me),he.layers.bgrid.attr("transform",Me);var ke=y(J+Z/2,Q)+"rotate(30)"+y(0,-Oe._offset);he.layers.aaxis.attr("transform",ke),he.layers.agrid.attr("transform",ke);var He=y(J+Z/2,Q)+"rotate(-30)"+y(0,-Ie._offset);he.layers.caxis.attr("transform",He),he.layers.cgrid.attr("transform",He),he.drawAxes(!0),he.layers.aline.select("path").attr("d",Oe.showline?"M"+J+","+(Q+K)+"l"+Z/2+",-"+K:"M0,0").call(u.stroke,Oe.linecolor||"#000").style("stroke-width",(Oe.linewidth||0)+"px"),he.layers.bline.select("path").attr("d",We.showline?"M"+J+","+(Q+K)+"h"+Z:"M0,0").call(u.stroke,We.linecolor||"#000").style("stroke-width",(We.linewidth||0)+"px"),he.layers.cline.select("path").attr("d",Ie.showline?"M"+(J+Z/2)+","+Q+"l"+Z/2+","+K:"M0,0").call(u.stroke,Ie.linecolor||"#000").style("stroke-width",(Ie.linewidth||0)+"px"),he.graphDiv._context.staticPlot||he.initInteractions(),r.setClipUrl(he.layers.frontplot,he._hasClipOnAxisFalse?null:he.clipId,he.graphDiv)},f.drawAxes=function(ee){var H=this,J=H.graphDiv,Q=H.id.substr(7)+"title",Z=H.layers,K=H.aaxis,ae=H.baxis,se=H.caxis;if(H.drawAx(K),H.drawAx(ae),H.drawAx(se),ee){var he=Math.max(K.showticklabels?K.tickfont.size/2:0,(se.showticklabels?.75*se.tickfont.size:0)+(se.ticks==="outside"?.87*se.ticklen:0)),fe=(ae.showticklabels?ae.tickfont.size:0)+(ae.ticks==="outside"?ae.ticklen:0)+3;Z["a-title"]=k.draw(J,"a"+Q,{propContainer:K,propName:H.id+".aaxis.title",placeholder:_(J,"Click to enter Component A title"),attributes:{x:H.x0+H.w/2,y:H.y0-K.title.font.size/3-he,"text-anchor":"middle"}}),Z["b-title"]=k.draw(J,"b"+Q,{propContainer:ae,propName:H.id+".baxis.title",placeholder:_(J,"Click to enter Component B title"),attributes:{x:H.x0-fe,y:H.y0+H.h+.83*ae.title.font.size+fe,"text-anchor":"middle"}}),Z["c-title"]=k.draw(J,"c"+Q,{propContainer:se,propName:H.id+".caxis.title",placeholder:_(J,"Click to enter Component C title"),attributes:{x:H.x0+H.w+fe,y:H.y0+H.h+.83*se.title.font.size+fe,"text-anchor":"middle"}})}},f.drawAx=function(ee){var H,J=this,Q=J.graphDiv,Z=ee._name,K=Z.charAt(0),ae=ee._id,se=J.layers[Z],he=K+"tickLayout",fe=(H=ee).ticks+String(H.ticklen)+String(H.showticklabels);J[he]!==fe&&(se.selectAll("."+ae+"tick").remove(),J[he]=fe),ee.setScale();var ie=s.calcTicks(ee),oe=s.clipEnds(ee,ie),le=s.makeTransTickFn(ee),ge=s.getTickSigns(ee)[2],ye=w.deg2rad(30),me=ge*(ee.linewidth||1)/2,be=ge*ee.ticklen,Se=J.w,Ee=J.h,Ce=K==="b"?"M0,"+me+"l"+Math.sin(ye)*be+","+Math.cos(ye)*be:"M"+me+",0l"+Math.cos(ye)*be+","+-Math.sin(ye)*be,Le={a:"M0,0l"+Ee+",-"+Se/2,b:"M0,0l-"+Se/2+",-"+Ee,c:"M0,0l-"+Ee+","+Se/2}[K];s.drawTicks(Q,ee,{vals:ee.ticks==="inside"?oe:ie,layer:se,path:Ce,transFn:le,crisp:!1}),s.drawGrid(Q,ee,{vals:oe,layer:J.layers[K+"grid"],path:Le,transFn:le,crisp:!1}),s.drawLabels(Q,ee,{vals:ie,layer:se,transFn:le,labelFns:s.makeLabelFns(ee,0,30)})};var I=p.MINZOOM/2+.87,B="m-0.87,.5h"+I+"v3h-"+(I+5.2)+"l"+(I/2+2.6)+",-"+(.87*I+4.5)+"l2.6,1.5l-"+I/2+","+.87*I+"Z",N="m0.87,.5h-"+I+"v3h"+(I+5.2)+"l-"+(I/2+2.6)+",-"+(.87*I+4.5)+"l-2.6,1.5l"+I/2+","+.87*I+"Z",V="m0,1l"+I/2+","+.87*I+"l2.6,-1.5l-"+(I/2+2.6)+",-"+(.87*I+4.5)+"l-"+(I/2+2.6)+","+(.87*I+4.5)+"l2.6,1.5l"+I/2+",-"+.87*I+"Z",j=!0;function $(ee){b.select(ee).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}f.clearOutline=function(){T(this.dragOptions),S(this.dragOptions.gd)},f.initInteractions=function(){var ee,H,J,Q,Z,K,ae,se,he,fe,ie,oe,le=this,ge=le.layers.plotbg.select("path").node(),ye=le.graphDiv,me=ye._fullLayout._zoomlayer;function be(Pe){var de={};return de[le.id+".aaxis.min"]=Pe.a,de[le.id+".baxis.min"]=Pe.b,de[le.id+".caxis.min"]=Pe.c,de}function Se(Pe,de){var Me=ye._fullLayout.clickmode;$(ye),Pe===2&&(ye.emit("plotly_doubleclick",null),e.call("_guiRelayout",ye,be({a:0,b:0,c:0}))),Me.indexOf("select")>-1&&Pe===1&&v(de,ye,[le.xaxis],[le.yaxis],le.id,le.dragOptions),Me.indexOf("event")>-1&&h.click(ye,de,le.id)}function Ee(Pe,de){return 1-de/le.h}function Ce(Pe,de){return 1-(Pe+(le.h-de)/Math.sqrt(3))/le.w}function Le(Pe,de){return(Pe-(le.h-de)/Math.sqrt(3))/le.w}function Oe(Pe,de){var Me=J+Pe*ee,ke=Q+de*H,He=Math.max(0,Math.min(1,Ee(0,Q),Ee(0,ke))),Fe=Math.max(0,Math.min(1,Ce(J,Q),Ce(Me,ke))),qe=Math.max(0,Math.min(1,Le(J,Q),Le(Me,ke))),$e=(He/2+qe)*le.w,Ye=(1-He/2-Fe)*le.w,_e=($e+Ye)/2,De=Ye-$e,Be=(1-He)*le.h,Ge=Be-De/E;De.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),oe.transition().style("opacity",1).duration(200),fe=!0),ye.emit("plotly_relayouting",be(ae))}function We(){$(ye),ae!==Z&&(e.call("_guiRelayout",ye,be(ae)),j&&ye.data&&ye._context.showTips&&(w.notifier(_(ye,"Double-click to zoom back out"),"long"),j=!1))}function Ie(Pe,de){var Me=Pe/le.xaxis._m,ke=de/le.yaxis._m,He=[(ae={a:Z.a-ke,b:Z.b+(Me+ke)/2,c:Z.c-(Me-ke)/2}).a,ae.b,ae.c].sort(w.sorterAsc),Fe=He.indexOf(ae.a),qe=He.indexOf(ae.b),$e=He.indexOf(ae.c);He[0]<0&&(He[1]+He[0]/2<0?(He[2]+=He[0]+He[1],He[0]=He[1]=0):(He[2]+=He[0]/2,He[1]+=He[0]/2,He[0]=0),ae={a:He[Fe],b:He[qe],c:He[$e]},de=(Z.a-ae.a)*le.yaxis._m,Pe=(Z.c-ae.c-Z.b+ae.b)*le.xaxis._m);var Ye=y(le.x0+Pe,le.y0+de);le.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Ye);var _e=y(-Pe,-de);le.clipDefRelative.select("path").attr("transform",_e),le.aaxis.range=[ae.a,le.sum-ae.b-ae.c],le.baxis.range=[le.sum-ae.a-ae.c,ae.b],le.caxis.range=[le.sum-ae.a-ae.b,ae.c],le.drawAxes(!1),le._hasClipOnAxisFalse&&le.plotContainer.select(".scatterlayer").selectAll(".trace").call(r.hideOutsideRangePoints,le),ye.emit("plotly_relayouting",be(ae))}function Ve(){e.call("_guiRelayout",ye,be(ae))}this.dragOptions={element:ge,gd:ye,plotinfo:{id:le.id,domain:ye._fullLayout[le.id].domain,xaxis:le.xaxis,yaxis:le.yaxis},subplot:le.id,prepFn:function(Pe,de,Me){le.dragOptions.xaxes=[le.xaxis],le.dragOptions.yaxes=[le.yaxis],ee=ye._fullLayout._invScaleX,H=ye._fullLayout._invScaleY;var ke=le.dragOptions.dragmode=ye._fullLayout.dragmode;m(ke)?le.dragOptions.minDrag=1:le.dragOptions.minDrag=void 0,ke==="zoom"?(le.dragOptions.moveFn=Oe,le.dragOptions.clickFn=Se,le.dragOptions.doneFn=We,function(He,Fe,qe){var $e=ge.getBoundingClientRect();J=Fe-$e.left,Q=qe-$e.top,ye._fullLayout._calcInverseTransform(ye);var Ye=ye._fullLayout._invTransform,_e=w.apply3DTransform(Ye)(J,Q);J=_e[0],Q=_e[1],Z={a:le.aaxis.range[0],b:le.baxis.range[1],c:le.caxis.range[1]},ae=Z,K=le.aaxis.range[1]-Z.a,se=d(le.graphDiv._fullLayout[le.id].bgcolor).getLuminance(),he="M0,"+le.h+"L"+le.w/2+", 0L"+le.w+","+le.h+"Z",fe=!1,ie=me.append("path").attr("class","zoombox").attr("transform",y(le.x0,le.y0)).style({fill:se>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",he),oe=me.append("path").attr("class","zoombox-corners").attr("transform",y(le.x0,le.y0)).style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),le.clearOutline(ye)}(0,de,Me)):ke==="pan"?(le.dragOptions.moveFn=Ie,le.dragOptions.clickFn=Se,le.dragOptions.doneFn=Ve,Z={a:le.aaxis.range[0],b:le.baxis.range[1],c:le.caxis.range[1]},ae=Z,le.clearOutline(ye)):(g(ke)||m(ke))&&A(Pe,de,Me,le.dragOptions,ke)}},ge.onmousemove=function(Pe){h.hover(ye,Pe,le.id),ye._fullLayout._lasthover=ge,ye._fullLayout._hoversubplot=le.id},ge.onmouseout=function(Pe){ye._dragging||c.unhover(ye,Pe)},c.init(this.dragOptions)}},33626:function(D,L,t){var b=t(48636),d=t(4969),e=t(36539),w=t(56174),y=t(95425).addStyleRule,_=t(93049),u=t(9829),r=t(6704),n=_.extendFlat,l=_.extendDeepAll;function o(v){var S=v.name,T=v.categories,p=v.meta;if(L.modules[S])b.log("Type "+S+" already registered");else{L.subplotsRegistry[v.basePlotModule.name]||function(j){var $=j.name;if(L.subplotsRegistry[$])b.log("Plot type "+$+" already registered.");else for(var ee in x(j),L.subplotsRegistry[$]=j,L.componentsRegistry)k(ee,j.name)}(v.basePlotModule);for(var M={},f=0;f-1&&(c[x[r]].title={text:""});for(r=0;r")!==-1?"":f.html(I).text()});return f.remove(),E}(p)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")).replace(r,"'"),d.isIE()&&(p=(p=(p=p.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),p}},35374:function(D,L,t){var b=t(34809);D.exports=function(d,e){for(var w=0;wE+M||!b(f))}for(var B=0;B=0)return c}else if(typeof c=="string"&&(c=c.trim()).slice(-1)==="%"&&b(c.slice(0,-1))&&(c=+c.slice(0,-1))>=0)return c+"%"}function s(c,h,x,m,g,k){var A=(k=k||{}).moduleHasSelected!==!1,v=k.moduleHasUnselected!==!1,S=k.moduleHasConstrain!==!1,T=k.moduleHasCliponaxis!==!1,p=k.moduleHasTextangle!==!1,M=k.moduleHasInsideanchor!==!1,f=!!k.hasPathbar,E=Array.isArray(g)||g==="auto",I=E||g==="inside",B=E||g==="outside";if(I||B){var N=l(m,"textfont",x.font),V=d.extendFlat({},N),j=!(c.textfont&&c.textfont.color);if(j&&delete V.color,l(m,"insidetextfont",V),f){var $=d.extendFlat({},N);j&&delete $.color,l(m,"pathbar.textfont",$)}B&&l(m,"outsidetextfont",N),A&&m("selected.textfont.color"),v&&m("unselected.textfont.color"),S&&m("constraintext"),T&&m("cliponaxis"),p&&m("textangle"),m("texttemplate")}I&&M&&m("insidetextanchor")}D.exports={supplyDefaults:function(c,h,x,m){function g(S,T){return d.coerce(c,h,n,S,T)}if(y(c,h,m,g)){_(c,h,m,g),g("xhoverformat"),g("yhoverformat"),g("zorder"),g("orientation",h.x&&!h.y?"h":"v"),g("base"),g("offset"),g("width"),g("text"),g("hovertext"),g("hovertemplate");var k=g("textposition");s(c,0,m,g,k,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u(c,h,g,x,m);var A=(h.marker.line||{}).color,v=w.getComponentMethod("errorbars","supplyDefaults");v(c,h,A||e.defaultLine,{axis:"y"}),v(c,h,A||e.defaultLine,{axis:"x",inherit:"y"}),d.coerceSelectionMarkerOpacity(h,g)}else h.visible=!1},crossTraceDefaults:function(c,h){var x,m;function g(v,S){return d.coerce(m._input,m,n,v,S)}for(var k=0;kr))return y}return _!==void 0?_:w.dflt},L.coerceColor=function(w,y,_){return d(y).isValid()?y:_!==void 0?_:w.dflt},L.coerceEnumerated=function(w,y,_){return w.coerceNumber&&(y=+y),w.values.indexOf(y)!==-1?y:_!==void 0?_:w.dflt},L.getValue=function(w,y){var _;return e(w)?y0?be+=Se:m<0&&(be-=Se)}return be}function se(me){var be=m,Se=me.b,Ee=ae(me);return b.inbox(Se-be,Ee-be,I+(Ee-be)/(Ee-Se)-1)}var he=l[g+"a"],fe=l[k+"a"];S=Math.abs(he.r2c(he.range[1])-he.r2c(he.range[0]));var ie=b.getDistanceFunction(c,A,v,function(me){return(A(me)+v(me))/2});if(b.getClosest(T,ie,l),l.index!==!1&&T[l.index].p!==u){V||(J=function(me){return Math.min(j(me),me.p-M.bargroupwidth/2)},Q=function(me){return Math.max($(me),me.p+M.bargroupwidth/2)});var oe=T[l.index],le=p.base?oe.b+oe.s:oe.s;l[k+"0"]=l[k+"1"]=fe.c2p(oe[k],!0),l[k+"LabelVal"]=le;var ge=M.extents[M.extents.round(oe.p)];l[g+"0"]=he.c2p(f?J(oe):ge[0],!0),l[g+"1"]=he.c2p(f?Q(oe):ge[1],!0);var ye=oe.orig_p!==void 0;return l[g+"LabelVal"]=ye?oe.orig_p:oe.p,l.labelLabel=_(he,l[g+"LabelVal"],p[g+"hoverformat"]),l.valueLabel=_(fe,l[k+"LabelVal"],p[k+"hoverformat"]),l.baseLabel=_(fe,oe.b,p[k+"hoverformat"]),l.spikeDistance=(function(me){var be=m,Se=me.b,Ee=ae(me);return b.inbox(Se-be,Ee-be,B+(Ee-be)/(Ee-Se)-1)}(oe)+function(me){return Z(j(me),$(me),B)}(oe))/2,l[g+"Spike"]=he.c2p(oe.p,!0),w(oe,p,l),l.hovertemplate=p.hovertemplate,l}}function n(l,o){var s=o.mcc||l.marker.color,c=o.mlcc||l.marker.line.color,h=y(l,o);return e.opacity(s)?s:e.opacity(c)&&h?c:void 0}D.exports={hoverPoints:function(l,o,s,c,h){var x=r(l,o,s,c,h);if(x){var m=x.cd,g=m[0].trace,k=m[x.index];return x.color=n(g,k),d.getComponentMethod("errorbars","hoverInfo")(k,g,x),[x]}},hoverOnBars:r,getTraceColor:n}},58218:function(D,L,t){D.exports={attributes:t(81481),layoutAttributes:t(25412),supplyDefaults:t(17550).supplyDefaults,crossTraceDefaults:t(17550).crossTraceDefaults,supplyLayoutDefaults:t(78931),calc:t(67565),crossTraceCalc:t(24782).crossTraceCalc,colorbar:t(21146),arraysToCalcdata:t(35374),plot:t(32995).plot,style:t(6851).style,styleOnSelect:t(6851).styleOnSelect,hoverPoints:t(91664).hoverPoints,eventData:t(59541),selectPoints:t(88384),moduleType:"trace",name:"bar",basePlotModule:t(37703),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}},25412:function(D){D.exports={barmode:{valType:"enumerated",values:["stack","group","overlay","relative"],dflt:"group",editType:"calc"},barnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},bargap:{valType:"number",min:0,max:1,editType:"calc"},bargroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},barcornerradius:{valType:"any",editType:"calc"}}},78931:function(D,L,t){var b=t(33626),d=t(29714),e=t(34809),w=t(25412),y=t(17550).validateCornerradius;D.exports=function(_,u,r){function n(A,v){return e.coerce(_,u,w,A,v)}for(var l=!1,o=!1,s=!1,c={},h=n("barmode"),x=0;x0)-(V<0)}function p(V,j){return V0}function E(V,j,$,ee,H){return!(V<0||j<0)&&($<=V&&ee<=j||$<=j&&ee<=V||(H?V>=$*(j/ee):j>=ee*(V/$)))}function I(V){return V==="auto"?0:V}function B(V,j){var $=Math.PI/180*j,ee=Math.abs(Math.sin($)),H=Math.abs(Math.cos($));return{x:V.width*H+V.height*ee,y:V.width*ee+V.height*H}}function N(V,j,$,ee,H,J){var Q=!!J.isHorizontal,Z=!!J.constrained,K=J.angle||0,ae=J.anchor,se=ae==="end",he=ae==="start",fe=((J.leftToRight||0)+1)/2,ie=1-fe,oe=J.hasB,le=J.r,ge=J.overhead,ye=H.width,me=H.height,be=Math.abs(j-V),Se=Math.abs(ee-$),Ee=be>2*A&&Se>2*A?A:0;be-=2*Ee,Se-=2*Ee;var Ce=I(K);K!=="auto"||ye<=be&&me<=Se||!(ye>be||me>Se)||(ye>Se||me>be)&&yeA){var Ie=function($e,Ye,_e,De,Be,Ge,tt,nt,ft){var At,kt,Vt,Ht,Gt=Math.max(0,Math.abs(Ye-$e)-2*A),st=Math.max(0,Math.abs(De-_e)-2*A),Qe=Ge-A,pt=tt?Qe-Math.sqrt(Qe*Qe-(Qe-tt)*(Qe-tt)):Qe,yt=ft?2*Qe:nt?Qe-tt:2*pt,Ot=ft?2*Qe:nt?2*pt:Qe-tt;return Be.y/Be.x>=st/(Gt-yt)?Ht=st/Be.y:Be.y/Be.x<=(st-Ot)/Gt?Ht=Gt/Be.x:!ft&&nt?(At=Be.x*Be.x+Be.y*Be.y/4,Vt=(Gt-Qe)*(Gt-Qe)+(st/2-Qe)*(st/2-Qe)-Qe*Qe,Ht=(-(kt=-2*Be.x*(Gt-Qe)-Be.y*(st/2-Qe))+Math.sqrt(kt*kt-4*At*Vt))/(2*At)):ft?(At=(Be.x*Be.x+Be.y*Be.y)/4,Vt=(Gt/2-Qe)*(Gt/2-Qe)+(st/2-Qe)*(st/2-Qe)-Qe*Qe,Ht=(-(kt=-Be.x*(Gt/2-Qe)-Be.y*(st/2-Qe))+Math.sqrt(kt*kt-4*At*Vt))/(2*At)):(At=Be.x*Be.x/4+Be.y*Be.y,Vt=(Gt/2-Qe)*(Gt/2-Qe)+(st-Qe)*(st-Qe)-Qe*Qe,Ht=(-(kt=-Be.x*(Gt/2-Qe)-2*Be.y*(st-Qe))+Math.sqrt(kt*kt-4*At*Vt))/(2*At)),{scale:Ht=Math.min(1,Ht),pad:nt?Math.max(0,Qe-Math.sqrt(Math.max(0,Qe*Qe-(Qe-(st-Be.y*Ht)/2)*(Qe-(st-Be.y*Ht)/2)))-tt):Math.max(0,Qe-Math.sqrt(Math.max(0,Qe*Qe-(Qe-(Gt-Be.x*Ht)/2)*(Qe-(Gt-Be.x*Ht)/2)))-tt)}}(V,j,$,ee,We,le,ge,Q,oe);Le=Ie.scale,Oe=Ie.pad}else Le=1,Z&&(Le=Math.min(1,be/We.x,Se/We.y)),Oe=0;var Ve=H.left*ie+H.right*fe,Pe=(H.top+H.bottom)/2,de=(V+A)*ie+(j-A)*fe,Me=($+ee)/2,ke=0,He=0;if(he||se){var Fe=(Q?We.x:We.y)/2;le&&(se||oe)&&(Ee+=Oe);var qe=Q?p(V,j):p($,ee);Q?he?(de=V+qe*Ee,ke=-qe*Fe):(de=j-qe*Ee,ke=qe*Fe):he?(Me=$+qe*Ee,He=-qe*Fe):(Me=ee-qe*Ee,He=qe*Fe)}return{textX:Ve,textY:Pe,targetX:de,targetY:Me,anchorX:ke,anchorY:He,scale:Le,rotate:Ce}}D.exports={plot:function(V,j,$,ee,H,J){var Q=j.xaxis,Z=j.yaxis,K=V._fullLayout,ae=V._context.staticPlot;H||(H={mode:K.barmode,norm:K.barmode,gap:K.bargap,groupgap:K.bargroupgap},o("bar",K));var se=e.makeTraceGroups(ee,$,"trace bars").each(function(he){var fe=b.select(this),ie=he[0].trace,oe=he[0].t,le=ie.type==="waterfall",ge=ie.type==="funnel",ye=ie.type==="histogram",me=ie.type==="bar",be=me||ge,Se=0;le&&ie.connector.visible&&ie.connector.mode==="between"&&(Se=ie.connector.line.width/2);var Ee=ie.orientation==="h",Ce=f(H),Le=e.ensureSingle(fe,"g","points"),Oe=S(ie),We=Le.selectAll("g.point").data(e.identity,Oe);We.enter().append("g").classed("point",!0),We.exit().remove(),We.each(function(Ve,Pe){var de,Me,ke=b.select(this),He=function(vt,Lt,jt,rt){var et=[],Et=[],Bt=rt?Lt:jt,Ft=rt?jt:Lt;return et[0]=Bt.c2p(vt.s0,!0),Et[0]=Ft.c2p(vt.p0,!0),et[1]=Bt.c2p(vt.s1,!0),Et[1]=Ft.c2p(vt.p1,!0),rt?[et,Et]:[Et,et]}(Ve,Q,Z,Ee),Fe=He[0][0],qe=He[0][1],$e=He[1][0],Ye=He[1][1],_e=(Ee?qe-Fe:Ye-$e)==0;if(_e&&be&&c.getLineWidth(ie,Ve)&&(_e=!1),_e||(_e=!(d(Fe)&&d(qe)&&d($e)&&d(Ye))),Ve.isBlank=_e,_e&&(Ee?qe=Fe:Ye=$e),Se&&!_e&&(Ee?(Fe-=p(Fe,qe)*Se,qe+=p(Fe,qe)*Se):($e-=p($e,Ye)*Se,Ye+=p($e,Ye)*Se)),ie.type==="waterfall"){if(!_e){var De=ie[Ve.dir].marker;de=De.line.width,Me=De.color}}else de=c.getLineWidth(ie,Ve),Me=Ve.mc||ie.marker.color;function Be(vt){var Lt=b.round(de/2%1,2);return H.gap===0&&H.groupgap===0?b.round(Math.round(vt)-Lt,2):vt}var Ge=y.opacity(Me)<1||de>.01?Be:function(vt,Lt,jt){return jt&&vt===Lt?vt:Math.abs(vt-Lt)>=2?Be(vt):vt>Lt?Math.ceil(vt):Math.floor(vt)};V._context.staticPlot||(Fe=Ge(Fe,qe,Ee),qe=Ge(qe,Fe,Ee),$e=Ge($e,Ye,!Ee),Ye=Ge(Ye,$e,!Ee));var tt,nt=Ee?Q.c2p:Z.c2p;tt=Ve.s0>0?Ve._sMax:Ve.s0<0?Ve._sMin:Ve.s1>0?Ve._sMax:Ve._sMin;var ft,At,kt=me||ye?function(vt,Lt){if(!vt)return 0;var jt,rt=Math.abs(Ee?Ye-$e:qe-Fe),et=Math.abs(Ee?qe-Fe:Ye-$e),Et=Ge(Math.abs(nt(tt,!0)-nt(0,!0))),Bt=Ve.hasB?Math.min(rt/2,et/2):Math.min(rt/2,Et);return jt=Lt==="%"?rt*(Math.min(50,vt)/100):vt,Ge(Math.max(Math.min(jt,Bt),0))}(oe.cornerradiusvalue,oe.cornerradiusform):0,Vt="M"+Fe+","+$e+"V"+Ye+"H"+qe+"V"+$e+"Z",Ht=0;if(kt&&Ve.s){var Gt=T(Ve.s0)===0||T(Ve.s)===T(Ve.s0)?Ve.s1:Ve.s0;if((Ht=Ge(Ve.hasB?0:Math.abs(nt(tt,!0)-nt(Gt,!0))))0?Math.sqrt(Ht*(2*kt-Ht)):0,Pt=st>0?Math.max:Math.min;ft="M"+Fe+","+$e+"V"+(Ye-yt*Qe)+"H"+Pt(qe-(kt-Ht)*st,Fe)+"A "+kt+","+kt+" 0 0 "+pt+" "+qe+","+(Ye-kt*Qe-Ot)+"V"+($e+kt*Qe+Ot)+"A "+kt+","+kt+" 0 0 "+pt+" "+Pt(qe-(kt-Ht)*st,Fe)+","+($e+yt*Qe)+"Z"}else if(Ve.hasB)ft="M"+(Fe+kt*st)+","+$e+"A "+kt+","+kt+" 0 0 "+pt+" "+Fe+","+($e+kt*Qe)+"V"+(Ye-kt*Qe)+"A "+kt+","+kt+" 0 0 "+pt+" "+(Fe+kt*st)+","+Ye+"H"+(qe-kt*st)+"A "+kt+","+kt+" 0 0 "+pt+" "+qe+","+(Ye-kt*Qe)+"V"+($e+kt*Qe)+"A "+kt+","+kt+" 0 0 "+pt+" "+(qe-kt*st)+","+$e+"Z";else{var at=(At=Math.abs(Ye-$e)+Ht)0?Math.sqrt(Ht*(2*kt-Ht)):0,Xe=Qe>0?Math.max:Math.min;ft="M"+(Fe+at*st)+","+$e+"V"+Xe(Ye-(kt-Ht)*Qe,$e)+"A "+kt+","+kt+" 0 0 "+pt+" "+(Fe+kt*st-lt)+","+Ye+"H"+(qe-kt*st+lt)+"A "+kt+","+kt+" 0 0 "+pt+" "+(qe-at*st)+","+Xe(Ye-(kt-Ht)*Qe,$e)+"V"+$e+"Z"}}else ft=Vt}else ft=Vt;var ut=M(e.ensureSingle(ke,"path"),K,H,J);if(ut.style("vector-effect",ae?"none":"non-scaling-stroke").attr("d",isNaN((qe-Fe)*(Ye-$e))||_e&&V._context.staticPlot?"M0,0Z":ft).call(_.setClipUrl,j.layerClipId,V),!K.uniformtext.mode&&Ce){var wt=_.makePointStyleFns(ie);_.singlePointStyle(Ve,ut,ie,wt,V)}(function(vt,Lt,jt,rt,et,Et,Bt,Ft,St,Jt,qt,en,Wt){var Zt,on=Lt.xaxis,un=Lt.yaxis,Pn=vt._fullLayout;function Dn(ai,bn,Yn){return e.ensureSingle(ai,"text").text(bn).attr({class:"bartext bartext-"+Zt,"text-anchor":"middle","data-notex":1}).call(_.font,Yn).call(w.convertToTspans,vt)}var In=rt[0].trace,mn=In.orientation==="h",En=function(ai,bn,Yn,an,_n){var gn,qn=bn[0].trace;return gn=qn.texttemplate?function(Un,tr,Wn,Bn,dn){var ln=tr[0].trace,An=e.castOption(ln,Wn,"texttemplate");if(!An)return"";var er,br,Tr,yr,Ur=ln.type==="histogram",Rr=ln.type==="waterfall",$r=ln.type==="funnel",Pr=ln.orientation==="h";function Cr(Wi){return r(yr,yr.c2l(Wi),!0).text}Pr?(er="y",br=dn,Tr="x",yr=Bn):(er="x",br=Bn,Tr="y",yr=dn);var Jr,gi=tr[Wn],ii={};ii.label=gi.p,ii.labelLabel=ii[er+"Label"]=(Jr=gi.p,r(br,br.c2l(Jr),!0).text);var Yr=e.castOption(ln,gi.i,"text");(Yr===0||Yr)&&(ii.text=Yr),ii.value=gi.s,ii.valueLabel=ii[Tr+"Label"]=Cr(gi.s);var oi={};k(oi,ln,gi.i),(Ur||oi.x===void 0)&&(oi.x=Pr?ii.value:ii.label),(Ur||oi.y===void 0)&&(oi.y=Pr?ii.label:ii.value),(Ur||oi.xLabel===void 0)&&(oi.xLabel=Pr?ii.valueLabel:ii.labelLabel),(Ur||oi.yLabel===void 0)&&(oi.yLabel=Pr?ii.labelLabel:ii.valueLabel),Rr&&(ii.delta=+gi.rawS||gi.s,ii.deltaLabel=Cr(ii.delta),ii.final=gi.v,ii.finalLabel=Cr(ii.final),ii.initial=ii.final-ii.delta,ii.initialLabel=Cr(ii.initial)),$r&&(ii.value=gi.s,ii.valueLabel=Cr(ii.value),ii.percentInitial=gi.begR,ii.percentInitialLabel=e.formatPercent(gi.begR),ii.percentPrevious=gi.difR,ii.percentPreviousLabel=e.formatPercent(gi.difR),ii.percentTotal=gi.sumR,ii.percenTotalLabel=e.formatPercent(gi.sumR));var Ti=e.castOption(ln,gi.i,"customdata");return Ti&&(ii.customdata=Ti),e.texttemplateString(An,ii,Un._d3locale,oi,ii,ln._meta||{})}(ai,bn,Yn,an,_n):qn.textinfo?function(Un,tr,Wn,Bn){var dn=Un[0].trace,ln=dn.orientation==="h",An=dn.type==="waterfall",er=dn.type==="funnel";function br(Ti){return r(ln?Wn:Bn,+Ti,!0).text}var Tr,yr,Ur=dn.textinfo,Rr=Un[tr],$r=Ur.split("+"),Pr=[],Cr=function(Ti){return $r.indexOf(Ti)!==-1};if(Cr("label")&&Pr.push((yr=Un[tr].p,r(ln?Bn:Wn,yr,!0).text)),Cr("text")&&((Tr=e.castOption(dn,Rr.i,"text"))===0||Tr)&&Pr.push(Tr),An){var Jr=+Rr.rawS||Rr.s,gi=Rr.v,ii=gi-Jr;Cr("initial")&&Pr.push(br(ii)),Cr("delta")&&Pr.push(br(Jr)),Cr("final")&&Pr.push(br(gi))}if(er){Cr("value")&&Pr.push(br(Rr.s));var Yr=0;Cr("percent initial")&&Yr++,Cr("percent previous")&&Yr++,Cr("percent total")&&Yr++;var oi=Yr>1;Cr("percent initial")&&(Tr=e.formatPercent(Rr.begR),oi&&(Tr+=" of initial"),Pr.push(Tr)),Cr("percent previous")&&(Tr=e.formatPercent(Rr.difR),oi&&(Tr+=" of previous"),Pr.push(Tr)),Cr("percent total")&&(Tr=e.formatPercent(Rr.sumR),oi&&(Tr+=" of total"),Pr.push(Tr))}return Pr.join("
")}(bn,Yn,an,_n):c.getValue(qn.text,Yn),c.coerceString(m,gn)}(Pn,rt,et,on,un);Zt=function(ai,bn){var Yn=c.getValue(ai.textposition,bn);return c.coerceEnumerated(g,Yn)}(In,et);var Kn=en.mode==="stack"||en.mode==="relative",Ln=rt[et],Tn=!Kn||Ln._outmost,Fn=Ln.hasB,wn=Jt&&Jt-qt>A;if(En&&Zt!=="none"&&(!Ln.isBlank&&Et!==Bt&&Ft!==St||Zt!=="auto"&&Zt!=="inside")){var zn=Pn.font,Jn=s.getBarColor(rt[et],In),$n=s.getInsideTextFont(In,et,zn,Jn),vr=s.getOutsideTextFont(In,et,zn),Qn=In.insidetextanchor||"end",lr=jt.datum();mn?on.type==="log"&&lr.s0<=0&&(Et=on.range[0]0&&Or>0;ur=wn?Fn?E(kn-2*Jt,Cn,ni,Or,mn)||E(kn,Cn-2*Jt,ni,Or,mn):mn?E(kn-(Jt-qt),Cn,ni,Or,mn)||E(kn,Cn-2*(Jt-qt),ni,Or,mn):E(kn,Cn-(Jt-qt),ni,Or,mn)||E(kn-2*(Jt-qt),Cn,ni,Or,mn):E(kn,Cn,ni,Or,mn),Zn&&ur?Zt="inside":(Zt="outside",hr.remove(),hr=null)}else Zt="inside";if(!hr){var cr=(hr=Dn(jt,En,Ar=e.ensureUniformFontSize(vt,Zt==="outside"?vr:$n))).attr("transform");if(hr.attr("transform",""),ni=(jr=_.bBox(hr.node())).width,Or=jr.height,hr.attr("transform",cr),ni<=0||Or<=0)return void hr.remove()}var Ir,Er=In.textangle;Ir=Zt==="outside"?function(ai,bn,Yn,an,_n,gn){var qn,Un=!!gn.isHorizontal,tr=!!gn.constrained,Wn=gn.angle||0,Bn=_n.width,dn=_n.height,ln=Math.abs(bn-ai),An=Math.abs(an-Yn);qn=Un?An>2*A?A:0:ln>2*A?A:0;var er=1;tr&&(er=Un?Math.min(1,An/dn):Math.min(1,ln/Bn));var br=I(Wn),Tr=B(_n,br),yr=(Un?Tr.x:Tr.y)/2,Ur=(_n.left+_n.right)/2,Rr=(_n.top+_n.bottom)/2,$r=(ai+bn)/2,Pr=(Yn+an)/2,Cr=0,Jr=0,gi=Un?p(bn,ai):p(Yn,an);return Un?($r=bn-gi*qn,Cr=gi*yr):(Pr=an+gi*qn,Jr=-gi*yr),{textX:Ur,textY:Rr,targetX:$r,targetY:Pr,anchorX:Cr,anchorY:Jr,scale:er,rotate:br}}(Et,Bt,Ft,St,jr,{isHorizontal:mn,constrained:In.constraintext==="both"||In.constraintext==="outside",angle:Er}):N(Et,Bt,Ft,St,jr,{isHorizontal:mn,constrained:In.constraintext==="both"||In.constraintext==="inside",angle:Er,anchor:Qn,hasB:Fn,r:Jt,overhead:qt}),Ir.fontSize=Ar.size,l(In.type==="histogram"?"bar":In.type,Ir,Pn),Ln.transform=Ir;var Xr=M(hr,Pn,en,Wt);e.setTransormAndDisplay(Xr,Ir)}else jt.select("text").remove()})(V,j,ke,he,Pe,Fe,qe,$e,Ye,kt,Ht,H,J),j.layerClipId&&_.hideOutsideRangePoint(Ve,ke.select("text"),Q,Z,ie.xcalendar,ie.ycalendar)});var Ie=ie.cliponaxis===!1;_.setClipUrl(fe,Ie?null:j.layerClipId,V)});u.getComponentMethod("errorbars","plot")(V,se,j,H)},toMoveInsideBar:N}},88384:function(D){function L(t,b,d,e,w){var y=b.c2p(e?t.s0:t.p0,!0),_=b.c2p(e?t.s1:t.p1,!0),u=d.c2p(e?t.p0:t.s0,!0),r=d.c2p(e?t.p1:t.s1,!0);return w?[(y+_)/2,(u+r)/2]:e?[_,(u+r)/2]:[(y+_)/2,r]}D.exports=function(t,b){var d,e=t.cd,w=t.xaxis,y=t.yaxis,_=e[0].trace,u=_.type==="funnel",r=_.orientation==="h",n=[];if(b===!1)for(d=0;d1||p.bargap===0&&p.bargroupgap===0&&!M[0].trace.marker.line.width)&&b.select(this).attr("shape-rendering","crispEdges")}),S.selectAll("g.points").each(function(M){s(b.select(this),M[0].trace,v)}),y.getComponentMethod("errorbars","style")(S)},styleTextPoints:c,styleOnSelect:function(v,S,T){var p=S[0].trace;p.selectedpoints?function(M,f,E){e.selectedPointStyle(M.selectAll("path"),f),function(I,B,N){I.each(function(V){var j,$=b.select(this);if(V.selected){j=w.ensureUniformFontSize(N,h($,V,B,N));var ee=B.selected.textfont&&B.selected.textfont.color;ee&&(j.color=ee),e.font($,j)}else e.selectedTextStyle($,B)})}(M.selectAll("text"),f,E)}(T,p,v):(s(T,p,v),y.getComponentMethod("errorbars","style")(T))},getInsideTextFont:m,getOutsideTextFont:g,getBarColor:A,resizeText:_}},59760:function(D,L,t){var b=t(78766),d=t(65477).hasColorscale,e=t(39356),w=t(34809).coercePattern;D.exports=function(y,_,u,r,n){var l=u("marker.color",r),o=d(y,"marker");o&&e(y,_,n,u,{prefix:"marker.",cLetter:"c"}),u("marker.line.color",b.defaultLine),d(y,"marker.line")&&e(y,_,n,u,{prefix:"marker.line.",cLetter:"c"}),u("marker.line.width"),u("marker.opacity"),w(u,"marker.pattern",l,o),u("selected.marker.color"),u("unselected.marker.color")}},84102:function(D,L,t){var b=t(45568),d=t(34809);function e(w){return"_"+w+"Text_minsize"}D.exports={recordMinTextSize:function(w,y,_){if(_.uniformtext.mode){var u=e(w),r=_.uniformtext.minsize,n=y.scale*y.fontSize;y.hide=nc.range[1]&&(v+=Math.PI),b.getClosest(l,function(p){return m(A,v,[p.rp0,p.rp1],[p.thetag0,p.thetag1],x)?g+Math.min(1,Math.abs(p.thetag1-p.thetag0)/k)-1+(p.rp1-A)/(p.rp1-p.rp0)-1:1/0},u),u.index!==!1){var S=l[u.index];u.x0=u.x1=S.ct[0],u.y0=u.y1=S.ct[1];var T=d.extendFlat({},S,{r:S.s,theta:S.p});return w(S,o,u),y(T,o,s,u),u.hovertemplate=o.hovertemplate,u.color=e(o,S),u.xLabelVal=u.yLabelVal=void 0,S.s<0&&(u.idealAlign="left"),[u]}}},89362:function(D,L,t){D.exports={moduleType:"trace",name:"barpolar",basePlotModule:t(31645),categories:["polar","bar","showLegend"],attributes:t(32225),layoutAttributes:t(42956),supplyDefaults:t(77318),supplyLayoutDefaults:t(60507),calc:t(27941).calc,crossTraceCalc:t(27941).crossTraceCalc,plot:t(11627),colorbar:t(21146),formatLabels:t(33368),style:t(6851).style,styleOnSelect:t(6851).styleOnSelect,hoverPoints:t(83080),selectPoints:t(88384),meta:{}}},42956:function(D){D.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}},60507:function(D,L,t){var b=t(34809),d=t(42956);D.exports=function(e,w,y){var _,u={};function r(o,s){return b.coerce(e[_]||{},w[_],d,o,s)}for(var n=0;n0?(p=S,M=T):(p=T,M=S);var f=[y.findEnclosingVertexAngles(p,m.vangles)[0],(p+M)/2,y.findEnclosingVertexAngles(M,m.vangles)[1]];return y.pathPolygonAnnulus(A,v,p,M,f,g,k)}:function(A,v,S,T){return e.pathAnnulus(A,v,S,T,g,k)}}(u),x=u.layers.frontplot.select("g.barlayer");e.makeTraceGroups(x,r,"trace bars").each(function(){var m=b.select(this),g=e.ensureSingle(m,"g","points").selectAll("g.point").data(e.identity);g.enter().append("g").style("vector-effect",n?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),g.exit().remove(),g.each(function(k){var A,v=b.select(this),S=k.rp0=s.c2p(k.s0),T=k.rp1=s.c2p(k.s1),p=k.thetag0=c.c2g(k.p0),M=k.thetag1=c.c2g(k.p1);if(d(S)&&d(T)&&d(p)&&d(M)&&S!==T&&p!==M){var f=s.c2g(k.s1),E=(p+M)/2;k.ct=[l.c2p(f*Math.cos(E)),o.c2p(f*Math.sin(E))],A=h(S,T,p,M)}else A="M0,0Z";e.ensureSingle(v,"path").attr("d",A)}),w.setClipUrl(m,u._hasClipOnAxisFalse?u.clipIds.forTraces:null,_)})}},64625:function(D,L,t){var b=t(19326),d=t(36640),e=t(81481),w=t(10229),y=t(80712).axisHoverFormat,_=t(3208).rb,u=t(93049).extendFlat,r=d.marker,n=r.line;D.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:y("x"),yhoverformat:y("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:u({},r.symbol,{arrayOk:!1,editType:"plot"}),opacity:u({},r.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:u({},r.angle,{arrayOk:!1,editType:"calc"}),size:u({},r.size,{arrayOk:!1,editType:"calc"}),color:u({},r.color,{arrayOk:!1,editType:"style"}),line:{color:u({},n.color,{arrayOk:!1,dflt:w.defaultLine,editType:"style"}),width:u({},n.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:b(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:e.offsetgroup,alignmentgroup:e.alignmentgroup,selected:{marker:d.selected.marker,editType:"style"},unselected:{marker:d.unselected.marker,editType:"style"},text:u({},d.text,{}),hovertext:u({},d.hovertext,{}),hovertemplate:_({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:d.zorder}},89429:function(D,L,t){var b=t(10721),d=t(29714),e=t(40528),w=t(34809),y=t(63821).BADNUM,_=w._;D.exports=function(m,g){var k,A,v,S,T,p,M,f=m._fullLayout,E=d.getFromId(m,g.xaxis||"x"),I=d.getFromId(m,g.yaxis||"y"),B=[],N=g.type==="violin"?"_numViolins":"_numBoxes";g.orientation==="h"?(v=E,S="x",T=I,p="y",M=!!g.yperiodalignment):(v=I,S="y",T=E,p="x",M=!!g.xperiodalignment);var V,j,$,ee,H,J,Q=function(Be,Ge,tt,nt){var ft,At=Ge+"0"in Be;if(Ge in Be||At&&"d"+Ge in Be){var kt=tt.makeCalcdata(Be,Ge);return[e(Be,tt,Ge,kt).vals,kt]}ft=At?Be[Ge+"0"]:"name"in Be&&(tt.type==="category"||b(Be.name)&&["linear","log"].indexOf(tt.type)!==-1||w.isDateTime(Be.name)&&tt.type==="date")?Be.name:nt;for(var Vt=tt.type==="multicategory"?tt.r2c_just_indices(ft):tt.d2c(ft,0,Be[Ge+"calendar"]),Ht=Be._length,Gt=new Array(Ht),st=0;stV.uf};if(g._hasPreCompStats){var ie=g[S],oe=function(Be){return v.d2c((g[Be]||[])[k])},le=1/0,ge=-1/0;for(k=0;k=V.q1&&V.q3>=V.med){var me=oe("lowerfence");V.lf=me!==y&&me<=V.q1?me:o(V,$,ee);var be=oe("upperfence");V.uf=be!==y&&be>=V.q3?be:s(V,$,ee);var Se=oe("mean");V.mean=Se!==y?Se:ee?w.mean($,ee):(V.q1+V.q3)/2;var Ee=oe("sd");V.sd=Se!==y&&Ee>=0?Ee:ee?w.stdev($,ee,V.mean):V.q3-V.q1,V.lo=c(V),V.uo=h(V);var Ce=oe("notchspan");Ce=Ce!==y&&Ce>0?Ce:x(V,ee),V.ln=V.med-Ce,V.un=V.med+Ce;var Le=V.lf,Oe=V.uf;g.boxpoints&&$.length&&(Le=Math.min(Le,$[0]),Oe=Math.max(Oe,$[ee-1])),g.notched&&(Le=Math.min(Le,V.ln),Oe=Math.max(Oe,V.un)),V.min=Le,V.max=Oe}else{var We;w.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+V.q1,"median = "+V.med,"q3 = "+V.q3].join(` +`)),We=V.med!==y?V.med:V.q1!==y?V.q3!==y?(V.q1+V.q3)/2:V.q1:V.q3!==y?V.q3:0,V.med=We,V.q1=V.q3=We,V.lf=V.uf=We,V.mean=V.sd=We,V.ln=V.un=We,V.min=V.max=We}le=Math.min(le,V.min),ge=Math.max(ge,V.max),V.pts2=j.filter(fe),B.push(V)}}g._extremes[v._id]=d.findExtremes(v,[le,ge],{padded:!0})}else{var Ie=v.makeCalcdata(g,S),Ve=function(Be,Ge){for(var tt=Be.length,nt=new Array(tt+1),ft=0;ft=0&&Me0){var Ye,_e;(V={}).pos=V[p]=se[k],j=V.pts=de[k].sort(n),ee=($=V[S]=j.map(l)).length,V.min=$[0],V.max=$[ee-1],V.mean=w.mean($,ee),V.sd=w.stdev($,ee,V.mean)*g.sdmultiple,V.med=w.interp($,.5),ee%2&&(qe||$e)?(qe?(Ye=$.slice(0,ee/2),_e=$.slice(ee/2+1)):$e&&(Ye=$.slice(0,ee/2+1),_e=$.slice(ee/2)),V.q1=w.interp(Ye,.5),V.q3=w.interp(_e,.5)):(V.q1=w.interp($,.25),V.q3=w.interp($,.75)),V.lf=o(V,$,ee),V.uf=s(V,$,ee),V.lo=c(V),V.uo=h(V);var De=x(V,ee);V.ln=V.med-De,V.un=V.med+De,ke=Math.min(ke,V.ln),He=Math.max(He,V.un),V.pts2=j.filter(fe),B.push(V)}g.notched&&w.isTypedArray(Ie)&&(Ie=Array.from(Ie)),g._extremes[v._id]=d.findExtremes(v,g.notched?Ie.concat([ke,He]):Ie,{padded:!0})}return function(Be,Ge){if(w.isArrayOrTypedArray(Ge.selectedpoints))for(var tt=0;tt0?(B[0].t={num:f[N],dPos:he,posLetter:p,valLetter:S,labels:{med:_(m,"median:"),min:_(m,"min:"),q1:_(m,"q1:"),q3:_(m,"q3:"),max:_(m,"max:"),mean:g.boxmean==="sd"||g.sizemode==="sd"?_(m,"mean ± σ:").replace("σ",g.sdmultiple===1?"σ":g.sdmultiple+"σ"):_(m,"mean:"),lf:_(m,"lower fence:"),uf:_(m,"upper fence:")}},f[N]++,B):[{t:{empty:!0}}]};var u={text:"tx",hovertext:"htx"};function r(m,g,k){for(var A in u)w.isArrayOrTypedArray(g[A])&&(Array.isArray(k)?w.isArrayOrTypedArray(g[A][k[0]])&&(m[u[A]]=g[A][k[0]][k[1]]):m[u[A]]=g[A][k])}function n(m,g){return m.v-g.v}function l(m){return m.v}function o(m,g,k){return k===0?m.q1:Math.min(m.q1,g[Math.min(w.findBin(2.5*m.q1-1.5*m.q3,g,!0)+1,k-1)])}function s(m,g,k){return k===0?m.q3:Math.max(m.q3,g[Math.max(w.findBin(2.5*m.q3-1.5*m.q1,g),0)])}function c(m){return 4*m.q1-3*m.q3}function h(m){return 4*m.q3-3*m.q1}function x(m,g){return g===0?0:1.57*(m.q3-m.q1)/Math.sqrt(g)}},81606:function(D,L,t){var b=t(29714),d=t(34809),e=t(84391).getAxisGroup,w=["v","h"];function y(_,u,r,n){var l,o,s,c=u.calcdata,h=u._fullLayout,x=n._id,m=x.charAt(0),g=[],k=0;for(l=0;l1,p=1-h[_+"gap"],M=1-h[_+"groupgap"];for(l=0;l0){var ye=j.pointpos,me=j.jitter,be=j.marker.size/2,Se=0;ye+me>=0&&((Se=le*(ye+me))>N?(ge=!0,ie=be,he=Se):Se>ae&&(ie=be,he=N)),Se<=N&&(he=N);var Ee=0;ye-me<=0&&((Ee=-le*(ye-me))>V?(ge=!0,oe=be,fe=Ee):Ee>se&&(oe=be,fe=V)),Ee<=V&&(fe=V)}else he=N,fe=V;var Ce=new Array(s.length);for(o=0;o0?(T="v",p=f>0?Math.min(I,E):Math.min(E)):f>0?(T="h",p=Math.min(I)):p=0;if(p){o._length=p;var ee=s("orientation",T);o._hasPreCompStats?ee==="v"&&f===0?(s("x0",0),s("dx",1)):ee==="h"&&M===0&&(s("y0",0),s("dy",1)):ee==="v"&&f===0?s("x0"):ee==="h"&&M===0&&s("y0"),d.getComponentMethod("calendars","handleTraceDefaults")(l,o,["x","y"],c)}else o.visible=!1}function n(l,o,s,c){var h=c.prefix,x=b.coerce2(l,o,u,"marker.outliercolor"),m=s("marker.line.outliercolor"),g="outliers";o._hasPreCompStats?g="all":(x||m)&&(g="suspectedoutliers");var k=s(h+"points",g);k?(s("jitter",k==="all"?.3:0),s("pointpos",k==="all"?-1.5:0),s("marker.symbol"),s("marker.opacity"),s("marker.size"),s("marker.angle"),s("marker.color",o.line.color),s("marker.line.color"),s("marker.line.width"),k==="suspectedoutliers"&&(s("marker.line.outliercolor",o.marker.color),s("marker.line.outlierwidth")),s("selected.marker.color"),s("unselected.marker.color"),s("selected.marker.size"),s("unselected.marker.size"),s("text"),s("hovertext")):delete o.marker;var A=s("hoveron");A!=="all"&&A.indexOf("points")===-1||s("hovertemplate"),b.coerceSelectionMarkerOpacity(o,s)}D.exports={supplyDefaults:function(l,o,s,c){function h(p,M){return b.coerce(l,o,u,p,M)}if(r(l,o,h,c),o.visible!==!1){w(l,o,c,h),h("xhoverformat"),h("yhoverformat");var x=o._hasPreCompStats;x&&(h("lowerfence"),h("upperfence")),h("line.color",(l.marker||{}).color||s),h("line.width"),h("fillcolor",e.addOpacity(o.line.color,.5));var m=!1;if(x){var g=h("mean"),k=h("sd");g&&g.length&&(m=!0,k&&k.length&&(m="sd"))}h("whiskerwidth");var A,v=h("sizemode");v==="quartiles"&&(A=h("boxmean",m)),h("showwhiskers",v==="quartiles"),v!=="sd"&&A!=="sd"||h("sdmultiple"),h("width"),h("quartilemethod");var S=!1;if(x){var T=h("notchspan");T&&T.length&&(S=!0)}else b.validate(l.notchwidth,u.notchwidth)&&(S=!0);h("notched",S)&&h("notchwidth"),n(l,o,h,{prefix:"box"}),h("zorder")}},crossTraceDefaults:function(l,o){var s,c;function h(g){return b.coerce(c._input,c,u,g)}for(var x=0;xk.lo&&($.so=!0)}return S});g.enter().append("path").classed("point",!0),g.exit().remove(),g.call(e.translatePoints,o,s)}function _(u,r,n,l){var o,s,c=r.val,h=r.pos,x=!!h.rangebreaks,m=l.bPos,g=l.bPosPxOffset||0,k=n.boxmean||(n.meanline||{}).visible;Array.isArray(l.bdPos)?(o=l.bdPos[0],s=l.bdPos[1]):(o=l.bdPos,s=l.bdPos);var A=u.selectAll("path.mean").data(n.type==="box"&&n.boxmean||n.type==="violin"&&n.box.visible&&n.meanline.visible?d.identity:[]);A.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),A.exit().remove(),A.each(function(v){var S=h.c2l(v.pos+m,!0),T=h.l2p(S-o)+g,p=h.l2p(S+s)+g,M=x?(T+p)/2:h.l2p(S)+g,f=c.c2p(v.mean,!0),E=c.c2p(v.mean-v.sd,!0),I=c.c2p(v.mean+v.sd,!0);n.orientation==="h"?b.select(this).attr("d","M"+f+","+T+"V"+p+(k==="sd"?"m0,0L"+E+","+M+"L"+f+","+T+"L"+I+","+M+"Z":"")):b.select(this).attr("d","M"+T+","+f+"H"+p+(k==="sd"?"m0,0L"+M+","+E+"L"+T+","+f+"L"+M+","+I+"Z":""))})}D.exports={plot:function(u,r,n,l){var o=u._context.staticPlot,s=r.xaxis,c=r.yaxis;d.makeTraceGroups(l,n,"trace boxes").each(function(h){var x,m,g=b.select(this),k=h[0],A=k.t,v=k.trace;A.wdPos=A.bdPos*v.whiskerwidth,v.visible!==!0||A.empty?g.remove():(v.orientation==="h"?(x=c,m=s):(x=s,m=c),w(g,{pos:x,val:m},v,A,o),y(g,{x:s,y:c},v,A),_(g,{pos:x,val:m},v,A))})},plotBoxAndWhiskers:w,plotPoints:y,plotBoxMean:_}},72488:function(D){D.exports=function(L,t){var b,d,e=L.cd,w=L.xaxis,y=L.yaxis,_=[];if(t===!1)for(b=0;b=10)return null;for(var y=1/0,_=-1/0,u=e.length,r=0;r0?Math.floor:Math.ceil,ee=V>0?Math.ceil:Math.floor,H=V>0?Math.min:Math.max,J=V>0?Math.max:Math.min,Q=$(B+j),Z=ee(N-j),K=[[s=I(B)]];for(_=Q;_*V=0;e--)w[n-e]=L[l][e],y[n-e]=t[l][e];for(_.push({x:w,y,bicubic:u}),e=l,w=[],y=[];e>=0;e--)w[l-e]=L[e][0],y[l-e]=t[e][0];return _.push({x:w,y,bicubic:r}),_}},4753:function(D,L,t){var b=t(29714),d=t(93049).extendFlat;D.exports=function(e,w,y){var _,u,r,n,l,o,s,c,h,x,m,g,k,A,v=e["_"+w],S=e[w+"axis"],T=S._gridlines=[],p=S._minorgridlines=[],M=S._boundarylines=[],f=e["_"+y],E=e[y+"axis"];S.tickmode==="array"&&(S.tickvals=v.slice());var I=e._xctrl,B=e._yctrl,N=I[0].length,V=I.length,j=e._a.length,$=e._b.length;b.prepTicks(S),S.tickmode==="array"&&delete S.tickvals;var ee=S.smoothing?3:1;function H(Q){var Z,K,ae,se,he,fe,ie,oe,le,ge,ye,me,be=[],Se=[],Ee={};if(w==="b")for(K=e.b2j(Q),ae=Math.floor(Math.max(0,Math.min($-2,K))),se=K-ae,Ee.length=$,Ee.crossLength=j,Ee.xy=function(Ce){return e.evalxy([],Ce,K)},Ee.dxy=function(Ce,Le){return e.dxydi([],Ce,ae,Le,se)},Z=0;Z0&&(le=e.dxydi([],Z-1,ae,0,se),be.push(he[0]+le[0]/3),Se.push(he[1]+le[1]/3),ge=e.dxydi([],Z-1,ae,1,se),be.push(oe[0]-ge[0]/3),Se.push(oe[1]-ge[1]/3)),be.push(oe[0]),Se.push(oe[1]),he=oe;else for(Z=e.a2i(Q),fe=Math.floor(Math.max(0,Math.min(j-2,Z))),ie=Z-fe,Ee.length=j,Ee.crossLength=$,Ee.xy=function(Ce){return e.evalxy([],Z,Ce)},Ee.dxy=function(Ce,Le){return e.dxydj([],fe,Ce,ie,Le)},K=0;K<$;K++)ae=Math.min($-2,K),se=K-ae,oe=e.evalxy([],Z,K),E.smoothing&&K>0&&(ye=e.dxydj([],fe,K-1,ie,0),be.push(he[0]+ye[0]/3),Se.push(he[1]+ye[1]/3),me=e.dxydj([],fe,K-1,ie,1),be.push(oe[0]-me[0]/3),Se.push(oe[1]-me[1]/3)),be.push(oe[0]),Se.push(oe[1]),he=oe;return Ee.axisLetter=w,Ee.axis=S,Ee.crossAxis=E,Ee.value=Q,Ee.constvar=y,Ee.index=c,Ee.x=be,Ee.y=Se,Ee.smoothing=E.smoothing,Ee}function J(Q){var Z,K,ae,se,he,fe=[],ie=[],oe={};if(oe.length=v.length,oe.crossLength=f.length,w==="b")for(ae=Math.max(0,Math.min($-2,Q)),he=Math.min(1,Math.max(0,Q-ae)),oe.xy=function(le){return e.evalxy([],le,Q)},oe.dxy=function(le,ge){return e.dxydi([],le,ae,ge,he)},Z=0;Zv.length-1||T.push(d(J(u),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(c=o;cv.length-1||m<0||m>v.length-1))for(g=v[r],k=v[m],_=0;_v[v.length-1]||p.push(d(H(x),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&M.push(d(J(0),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&M.push(d(J(v.length-1),{color:S.endlinecolor,width:S.endlinewidth}))}else{for(n=5e-15,o=(l=[Math.floor((v[v.length-1]-S.tick0)/S.dtick*(1+n)),Math.ceil((v[0]-S.tick0)/S.dtick/(1+n))].sort(function(Q,Z){return Q-Z}))[0],s=l[1],c=o;c<=s;c++)h=S.tick0+S.dtick*c,T.push(d(H(h),{color:S.gridcolor,width:S.gridwidth,dash:S.griddash}));for(c=o-1;cv[v.length-1]||p.push(d(H(x),{color:S.minorgridcolor,width:S.minorgridwidth,dash:S.minorgriddash}));S.startline&&M.push(d(H(v[0]),{color:S.startlinecolor,width:S.startlinewidth})),S.endline&&M.push(d(H(v[v.length-1]),{color:S.endlinecolor,width:S.endlinewidth}))}}},93923:function(D,L,t){var b=t(29714),d=t(93049).extendFlat;D.exports=function(e,w){var y,_,u,r=w._labels=[],n=w._gridlines;for(y=0;ye.length&&(d=d.slice(0,e.length)):d=[],y=0;y90&&(s-=180,u=-u),{angle:s,flip:u,p:L.c2p(d,t,b),offsetMultplier:r}}},87947:function(D,L,t){var b=t(45568),d=t(62203),e=t(6720),w=t(3685),y=t(33163),_=t(30635),u=t(34809),r=u.strRotate,n=u.strTranslate,l=t(4530);function o(m,g,k,A,v,S,T){var p="const-"+v+"-lines",M=k.selectAll("."+p).data(S);M.enter().append("path").classed(p,!0).style("vector-effect",T?"none":"non-scaling-stroke"),M.each(function(f){var E=f,I=E.x,B=E.y,N=e([],I,m.c2p),V=e([],B,g.c2p),j="M"+w(N,V,E.smoothing);b.select(this).attr("d",j).style("stroke-width",E.width).style("stroke",E.color).style("stroke-dasharray",d.dashStyle(E.dash,E.width)).style("fill","none")}),M.exit().remove()}function s(m,g,k,A,v,S,T,p){var M=S.selectAll("text."+p).data(T);M.enter().append("text").classed(p,!0);var f=0,E={};return M.each(function(I,B){var N;if(I.axis.tickangle==="auto")N=y(A,g,k,I.xy,I.dxy);else{var V=(I.axis.tickangle+180)*Math.PI/180;N=y(A,g,k,I.xy,[Math.cos(V),Math.sin(V)])}B||(E={angle:N.angle,flip:N.flip});var j=(I.endAnchor?-1:1)*N.flip,$=b.select(this).attr({"text-anchor":j>0?"start":"end","data-notex":1}).call(d.font,I.font).text(I.text).call(_.convertToTspans,m),ee=d.bBox(this);$.attr("transform",n(N.p[0],N.p[1])+r(N.angle)+n(I.axis.labelpadding*j,.3*ee.height)),f=Math.max(f,ee.width+I.axis.labelpadding)}),M.exit().remove(),E.maxExtent=f,E}D.exports=function(m,g,k,A){var v=m._context.staticPlot,S=g.xaxis,T=g.yaxis,p=m._fullLayout._clips;u.makeTraceGroups(A,k,"trace").each(function(M){var f=b.select(this),E=M[0],I=E.trace,B=I.aaxis,N=I.baxis,V=u.ensureSingle(f,"g","minorlayer"),j=u.ensureSingle(f,"g","majorlayer"),$=u.ensureSingle(f,"g","boundarylayer"),ee=u.ensureSingle(f,"g","labellayer");f.style("opacity",I.opacity),o(S,T,j,0,"a",B._gridlines,!0),o(S,T,j,0,"b",N._gridlines,!0),o(S,T,V,0,"a",B._minorgridlines,!0),o(S,T,V,0,"b",N._minorgridlines,!0),o(S,T,$,0,"a-boundary",B._boundarylines,v),o(S,T,$,0,"b-boundary",N._boundarylines,v);var H=s(m,S,T,I,0,ee,B._labels,"a-label"),J=s(m,S,T,I,0,ee,N._labels,"b-label");(function(Q,Z,K,ae,se,he,fe,ie){var oe,le,ge,ye,me=u.aggNums(Math.min,null,K.a),be=u.aggNums(Math.max,null,K.a),Se=u.aggNums(Math.min,null,K.b),Ee=u.aggNums(Math.max,null,K.b);oe=.5*(me+be),le=Se,ge=K.ab2xy(oe,le,!0),ye=K.dxyda_rough(oe,le),fe.angle===void 0&&u.extendFlat(fe,y(K,se,he,ge,K.dxydb_rough(oe,le))),x(Q,Z,K,0,ge,ye,K.aaxis,se,he,fe,"a-title"),oe=me,le=.5*(Se+Ee),ge=K.ab2xy(oe,le,!0),ye=K.dxydb_rough(oe,le),ie.angle===void 0&&u.extendFlat(ie,y(K,se,he,ge,K.dxyda_rough(oe,le))),x(Q,Z,K,0,ge,ye,K.baxis,se,he,ie,"b-title")})(m,ee,I,0,S,T,H,J),function(Q,Z,K,ae,se){var he,fe,ie,oe,le=K.select("#"+Q._clipPathId);le.size()||(le=K.append("clipPath").classed("carpetclip",!0));var ge=u.ensureSingle(le,"path","carpetboundary"),ye=Z.clipsegments,me=[];for(oe=0;oe90&&$<270,H=b.select(this);H.text(T.title.text).call(_.convertToTspans,m),ee&&(N=(-_.lineCount(H)+h)*c*j-N),H.attr("transform",n(V.p[0],V.p[1])+r(V.angle)+n(0,N)).attr("text-anchor","middle").call(d.font,T.title.font)}),B.exit().remove()}},76842:function(D,L,t){var b=t(45923),d=t(98813).findBin,e=t(57075),w=t(13828),y=t(39848),_=t(41839);D.exports=function(u){var r=u._a,n=u._b,l=r.length,o=n.length,s=u.aaxis,c=u.baxis,h=r[0],x=r[l-1],m=n[0],g=n[o-1],k=r[r.length-1]-r[0],A=n[n.length-1]-n[0],v=k*b.RELATIVE_CULL_TOLERANCE,S=A*b.RELATIVE_CULL_TOLERANCE;h-=v,x+=v,m-=S,g+=S,u.isVisible=function(T,p){return T>h&&Tm&&px||pg},u.setScale=function(){var T=u._x,p=u._y,M=e(u._xctrl,u._yctrl,T,p,s.smoothing,c.smoothing);u._xctrl=M[0],u._yctrl=M[1],u.evalxy=w([u._xctrl,u._yctrl],l,o,s.smoothing,c.smoothing),u.dxydi=y([u._xctrl,u._yctrl],s.smoothing,c.smoothing),u.dxydj=_([u._xctrl,u._yctrl],s.smoothing,c.smoothing)},u.i2a=function(T){var p=Math.max(0,Math.floor(T[0]),l-2),M=T[0]-p;return(1-M)*r[p]+M*r[p+1]},u.j2b=function(T){var p=Math.max(0,Math.floor(T[1]),l-2),M=T[1]-p;return(1-M)*n[p]+M*n[p+1]},u.ij2ab=function(T){return[u.i2a(T[0]),u.j2b(T[1])]},u.a2i=function(T){var p=Math.max(0,Math.min(d(T,r),l-2)),M=r[p],f=r[p+1];return Math.max(0,Math.min(l-1,p+(T-M)/(f-M)))},u.b2j=function(T){var p=Math.max(0,Math.min(d(T,n),o-2)),M=n[p],f=n[p+1];return Math.max(0,Math.min(o-1,p+(T-M)/(f-M)))},u.ab2ij=function(T){return[u.a2i(T[0]),u.b2j(T[1])]},u.i2c=function(T,p){return u.evalxy([],T,p)},u.ab2xy=function(T,p,M){if(!M&&(Tr[l-1]|pn[o-1]))return[!1,!1];var f=u.a2i(T),E=u.b2j(p),I=u.evalxy([],f,E);if(M){var B,N,V,j,$=0,ee=0,H=[];Tr[l-1]?(B=l-2,N=1,$=(T-r[l-1])/(r[l-1]-r[l-2])):N=f-(B=Math.max(0,Math.min(l-2,Math.floor(f)))),pn[o-1]?(V=o-2,j=1,ee=(p-n[o-1])/(n[o-1]-n[o-2])):j=E-(V=Math.max(0,Math.min(o-2,Math.floor(E)))),$&&(u.dxydi(H,B,V,N,j),I[0]+=H[0]*$,I[1]+=H[1]*$),ee&&(u.dxydj(H,B,V,N,j),I[0]+=H[0]*ee,I[1]+=H[1]*ee)}return I},u.c2p=function(T,p,M){return[p.c2p(T[0]),M.c2p(T[1])]},u.p2x=function(T,p,M){return[p.p2c(T[0]),M.p2c(T[1])]},u.dadi=function(T){var p=Math.max(0,Math.min(r.length-2,T));return r[p+1]-r[p]},u.dbdj=function(T){var p=Math.max(0,Math.min(n.length-2,T));return n[p+1]-n[p]},u.dxyda=function(T,p,M,f){var E=u.dxydi(null,T,p,M,f),I=u.dadi(T,M);return[E[0]/I,E[1]/I]},u.dxydb=function(T,p,M,f){var E=u.dxydj(null,T,p,M,f),I=u.dbdj(p,f);return[E[0]/I,E[1]/I]},u.dxyda_rough=function(T,p,M){var f=k*(M||.1),E=u.ab2xy(T+f,p,!0),I=u.ab2xy(T-f,p,!0);return[.5*(E[0]-I[0])/f,.5*(E[1]-I[1])/f]},u.dxydb_rough=function(T,p,M){var f=A*(M||.1),E=u.ab2xy(T,p+f,!0),I=u.ab2xy(T,p-f,!0);return[.5*(E[0]-I[0])/f,.5*(E[1]-I[1])/f]},u.dpdx=function(T){return T._m},u.dpdy=function(T){return T._m}}},13007:function(D,L,t){var b=t(34809);D.exports=function(d,e,w){var y,_,u,r=[],n=[],l=d[0].length,o=d.length;function s(Q,Z){var K,ae=0,se=0;return Q>0&&(K=d[Z][Q-1])!==void 0&&(se++,ae+=K),Q0&&(K=d[Z-1][Q])!==void 0&&(se++,ae+=K),Z0&&_0&&y1e-5);return b.log("Smoother converged to",f,"after",E,"iterations"),d}},10820:function(D,L,t){var b=t(34809).isArray1D;D.exports=function(d,e,w){var y=w("x"),_=y&&y.length,u=w("y"),r=u&&u.length;if(!_&&!r)return!1;if(e._cheater=!y,_&&!b(y)||r&&!b(u))e._length=null;else{var n=_?y.length:1/0;r&&(n=Math.min(n,u.length)),e.a&&e.a.length&&(n=Math.min(n,e.a.length)),e.b&&e.b.length&&(n=Math.min(n,e.b.length)),e._length=n}return!0}},92802:function(D,L,t){var b=t(3208).rb,d=t(6893),e=t(87163),w=t(9829),y=t(10229).defaultLine,_=t(93049).extendFlat,u=d.marker.line;D.exports=_({locations:{valType:"data_array",editType:"calc"},locationmode:d.locationmode,z:{valType:"data_array",editType:"calc"},geojson:_({},d.geojson,{}),featureidkey:d.featureidkey,text:_({},d.text,{}),hovertext:_({},d.hovertext,{}),marker:{line:{color:_({},u.color,{dflt:y}),width:_({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:d.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:d.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:_({},w.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:b(),showlegend:_({},w.showlegend,{dflt:!1})},e("",{cLetter:"z",editTypeOverride:"calc"}))},12702:function(D,L,t){var b=t(10721),d=t(63821).BADNUM,e=t(28379),w=t(99203),y=t(48861);function _(u){return u&&typeof u=="string"}D.exports=function(u,r){var n,l=r._length,o=new Array(l);n=r.geojson?function(m){return _(m)||b(m)}:_;for(var s=0;s")}}(w,s,u),[w]}},58075:function(D,L,t){D.exports={attributes:t(92802),supplyDefaults:t(51893),colorbar:t(12431),calc:t(12702),calcGeoJSON:t(4700).calcGeoJSON,plot:t(4700).plot,style:t(59342).style,styleOnSelect:t(59342).styleOnSelect,hoverPoints:t(94125),eventData:t(38414),selectPoints:t(43727),moduleType:"trace",name:"choropleth",basePlotModule:t(47544),categories:["geo","noOpacity","showLegend"],meta:{}}},4700:function(D,L,t){var b=t(45568),d=t(34809),e=t(3994),w=t(11577).getTopojsonFeatures,y=t(32919).findExtremes,_=t(59342).style;D.exports={calcGeoJSON:function(u,r){for(var n=u[0].trace,l=r[n.geo],o=l._subplot,s=n.locationmode,c=n._length,h=s==="geojson-id"?e.extractTraceFeature(u):w(n,o.topojson),x=[],m=[],g=0;g=0;w--){var y=e[w].id;if(typeof y=="string"&&y.indexOf("water")===0){for(var _=w+1;_=0;r--)_.removeLayer(u[r][1])},y.dispose=function(){var _=this.subplot.map;this._removeLayers(),_.removeSource(this.sourceId)},D.exports=function(_,u){var r=u[0].trace,n=new w(_,r.uid),l=n.sourceId,o=b(u),s=n.below=_.belowLookup["trace-"+r.uid];return _.map.addSource(l,{type:"geojson",data:o.geojson}),n._addLayers(o,s),u[0].trace._glTrace=n,n}},86227:function(D,L,t){var b=t(92802),d=t(87163),e=t(3208).rb,w=t(9829),y=t(93049).extendFlat;D.exports=y({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:y({},b.featureidkey,{}),below:{valType:"string",editType:"plot"},text:b.text,hovertext:b.hovertext,marker:{line:{color:y({},b.marker.line.color,{editType:"plot"}),width:y({},b.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:y({},b.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:y({},b.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:y({},b.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:b.hoverinfo,hovertemplate:e({},{keys:["properties"]}),showlegend:y({},w.showlegend,{dflt:!1})},d("",{cLetter:"z",editTypeOverride:"calc"}))},51335:function(D,L,t){var b=t(10721),d=t(34809),e=t(88856),w=t(62203),y=t(39532).makeBlank,_=t(3994);function u(r){var n,l=r[0].trace,o=l._opts;if(l.selectedpoints){for(var s=w.makeSelectedPointStyleFns(l),c=0;c=0;w--){var y=e[w].id;if(typeof y=="string"&&y.indexOf("water")===0){for(var _=w+1;_=0;r--)_.removeLayer(u[r][1])},y.dispose=function(){var _=this.subplot.map;this._removeLayers(),_.removeSource(this.sourceId)},D.exports=function(_,u){var r=u[0].trace,n=new w(_,r.uid),l=n.sourceId,o=b(u),s=n.below=_.belowLookup["trace-"+r.uid];return _.map.addSource(l,{type:"geojson",data:o.geojson}),n._addLayers(o,s),u[0].trace._glTrace=n,n}},49865:function(D,L,t){var b=t(87163),d=t(80712).axisHoverFormat,e=t(3208).rb,w=t(42450),y=t(9829),_=t(93049).extendFlat,u={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:e({editType:"calc"},{keys:["norm"]}),uhoverformat:d("u",1),vhoverformat:d("v",1),whoverformat:d("w",1),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),showlegend:_({},y.showlegend,{dflt:!1})};_(u,b("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach(function(r){u[r]=w[r]}),u.hoverinfo=_({},y.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),u.transforms=void 0,D.exports=u},93805:function(D,L,t){var b=t(28379);D.exports=function(d,e){for(var w=e.u,y=e.v,_=e.w,u=Math.min(e.x.length,e.y.length,e.z.length,w.length,y.length,_.length),r=-1/0,n=1/0,l=0;ly.level||y.starts.length&&w===y.level)}break;case"constraint":if(d.prefixBoundary=!1,d.edgepaths.length)return;var _=d.x.length,u=d.y.length,r=-1/0,n=1/0;for(b=0;b":s>r&&(d.prefixBoundary=!0);break;case"<":(sr||d.starts.length&&o===n)&&(d.prefixBoundary=!0);break;case"][":l=Math.min(s[0],s[1]),o=Math.max(s[0],s[1]),lr&&(d.prefixBoundary=!0)}}}},92697:function(D,L,t){var b=t(88856),d=t(16438),e=t(48715);D.exports={min:"zmin",max:"zmax",calc:function(w,y,_){var u=y.contours,r=y.line,n=u.size||1,l=u.coloring,o=d(y,{isColorbar:!0});if(l==="heatmap"){var s=b.extractOpts(y);_._fillgradient=s.reversescale?b.flipScale(s.colorscale):s.colorscale,_._zrange=[s.min,s.max]}else l==="fill"&&(_._fillcolor=o);_._line={color:l==="lines"?o:r.color,width:u.showlines!==!1?r.width:0,dash:r.dash},_._levels={start:u.start,end:e(u),size:n}}}},53156:function(D){D.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}}},29503:function(D,L,t){var b=t(10721),d=t(20576),e=t(78766),w=e.addOpacity,y=e.opacity,_=t(20726),u=t(34809).isArrayOrTypedArray,r=_.CONSTRAINT_REDUCTION,n=_.COMPARISON_OPS2;D.exports=function(l,o,s,c,h,x){var m,g,k,A=o.contours,v=s("contours.operation");A._operation=r[v],function(S,T){var p;n.indexOf(T.operation)===-1?(S("contours.value",[0,1]),u(T.value)?T.value.length>2?T.value=T.value.slice(2):T.length===0?T.value=[0,1]:T.length<2?(p=parseFloat(T.value[0]),T.value=[p,p+1]):T.value=[parseFloat(T.value[0]),parseFloat(T.value[1])]:b(T.value)&&(p=parseFloat(T.value),T.value=[p,p+1])):(S("contours.value",0),b(T.value)||(u(T.value)?T.value=parseFloat(T.value[0]):T.value=0))}(s,A),v==="="?m=A.showlines=!0:(m=s("contours.showlines"),k=s("fillcolor",w((l.line||{}).color||h,.5))),m&&(g=s("line.color",k&&y(k)?w(o.fillcolor,1):h),s("line.width",2),s("line.dash")),s("line.smoothing"),d(s,c,g,x)}},22783:function(D,L,t){var b=t(20726),d=t(10721);function e(_,u){var r,n=Array.isArray(u);function l(o){return d(o)?+o:null}return b.COMPARISON_OPS2.indexOf(_)!==-1?r=l(n?u[0]:u):b.INTERVAL_OPS.indexOf(_)!==-1?r=n?[l(u[0]),l(u[1])]:[l(u),l(u)]:b.SET_OPS.indexOf(_)!==-1&&(r=n?u.map(l):[l(u)]),r}function w(_){return function(u){u=e(_,u);var r=Math.min(u[0],u[1]),n=Math.max(u[0],u[1]);return{start:r,end:n,size:n-r}}}function y(_){return function(u){return{start:u=e(_,u),end:1/0,size:1/0}}}D.exports={"[]":w("[]"),"][":w("]["),">":y(">"),"<":y("<"),"=":y("=")}},47495:function(D){D.exports=function(L,t,b,d){var e=d("contours.start"),w=d("contours.end"),y=e===!1||w===!1,_=b("contours.size");!(y?t.autocontour=!0:b("autocontour",!1))&&_||b("ncontours")}},1999:function(D,L,t){var b=t(34809);function d(e){return b.extendFlat({},e,{edgepaths:b.extendDeep([],e.edgepaths),paths:b.extendDeep([],e.paths),starts:b.extendDeep([],e.starts)})}D.exports=function(e,w){var y,_,u,r=function(o){return o.reverse()},n=function(o){return o};switch(w){case"=":case"<":return e;case">":for(e.length!==1&&b.warn("Contour data invalid for the specified inequality operation."),_=e[0],y=0;y<_.edgepaths.length;y++)_.edgepaths[y]=r(_.edgepaths[y]);for(y=0;y<_.paths.length;y++)_.paths[y]=r(_.paths[y]);for(y=0;y<_.starts.length;y++)_.starts[y]=r(_.starts[y]);return e;case"][":var l=r;r=n,n=l;case"[]":for(e.length!==2&&b.warn("Contour data invalid for the specified inequality range operation."),_=d(e[0]),u=d(e[1]),y=0;y<_.edgepaths.length;y++)_.edgepaths[y]=r(_.edgepaths[y]);for(y=0;y<_.paths.length;y++)_.paths[y]=r(_.paths[y]);for(y=0;y<_.starts.length;y++)_.starts[y]=r(_.starts[y]);for(;u.edgepaths.length;)_.edgepaths.push(n(u.edgepaths.shift()));for(;u.paths.length;)_.paths.push(n(u.paths.shift()));for(;u.starts.length;)_.starts.push(n(u.starts.shift()));return[_]}}},57543:function(D,L,t){var b=t(34809),d=t(86073),e=t(99669),w=t(29503),y=t(47495),_=t(39889),u=t(63814),r=t(52240);D.exports=function(n,l,o,s){function c(x,m){return b.coerce(n,l,r,x,m)}if(d(n,l,c,s)){e(n,l,s,c),c("xhoverformat"),c("yhoverformat"),c("text"),c("hovertext"),c("hoverongaps"),c("hovertemplate");var h=c("contours.type")==="constraint";c("connectgaps",b.isArray1D(l.z)),h?w(n,l,c,s,o):(y(n,l,c,function(x){return b.coerce2(n,l,r,x)}),_(n,l,c,s)),l.contours&&l.contours.coloring==="heatmap"&&u(c,s),c("zorder")}else l.visible=!1}},86828:function(D,L,t){var b=t(34809),d=t(22783),e=t(48715);D.exports=function(w,y,_){for(var u=w.type==="constraint"?d[w._operation](w.value):w,r=u.size,n=[],l=e(u),o=_.trace._carpetTrace,s=o?{xaxis:o.aaxis,yaxis:o.baxis,x:_.a,y:_.b}:{xaxis:y.xaxis,yaxis:y.yaxis,x:_.x,y:_.y},c=u.start;c1e3){b.warn("Too many contours, clipping at 1000",w);break}return n}},48715:function(D){D.exports=function(L){return L.end+L.size/1e6}},27657:function(D,L,t){var b=t(34809),d=t(53156);function e(_,u,r,n){return Math.abs(_[0]-u[0])20&&ge?le===208||le===1114?me=ye[0]===0?1:-1:be=ye[1]===0?1:-1:d.BOTTOMSTART.indexOf(le)!==-1?be=1:d.LEFTSTART.indexOf(le)!==-1?me=1:d.TOPSTART.indexOf(le)!==-1?be=-1:me=-1,[me,be]}(c,r,u),x=[y(_,u,[-h[0],-h[1]])],m=_.z.length,g=_.z[0].length,k=u.slice(),A=h.slice();for(o=0;o<1e4;o++){if(c>20?(c=d.CHOOSESADDLE[c][(h[0]||h[1])<0?0:1],_.crossings[s]=d.SADDLEREMAINDER[c]):delete _.crossings[s],!(h=d.NEWDELTA[c])){b.log("Found bad marching index:",c,u,_.level);break}x.push(y(_,u,h)),u[0]+=h[0],u[1]+=h[1],s=u.join(","),e(x[x.length-1],x[x.length-2],n,l)&&x.pop();var v=h[0]&&(u[0]<0||u[0]>g-2)||h[1]&&(u[1]<0||u[1]>m-2);if(u[0]===k[0]&&u[1]===k[1]&&h[0]===A[0]&&h[1]===A[1]||r&&v)break;c=_.crossings[s]}o===1e4&&b.log("Infinite loop in contour?");var S,T,p,M,f,E,I,B,N,V,j,$,ee,H,J,Q=e(x[0],x[x.length-1],n,l),Z=0,K=.2*_.smoothing,ae=[],se=0;for(o=1;o=se;o--)if((S=ae[o])=se&&S+ae[T]B&&N--,_.edgepaths[N]=j.concat(x,V));break}oe||(_.edgepaths[B]=x.concat(V))}for(B=0;B<_.edgepaths.length&&!ie;B++)e((V=_.edgepaths[B])[V.length-1],x[0],n,l)&&(x.shift(),_.edgepaths[B]=V.concat(x),ie=!0);ie||_.edgepaths.push(x)}}function y(_,u,r){var n=u[0]+Math.max(r[0],0),l=u[1]+Math.max(r[1],0),o=_.z[l][n],s=_.xaxis,c=_.yaxis;if(r[1]){var h=(_.level-o)/(_.z[l][n+1]-o),x=(h!==1?(1-h)*s.c2l(_.x[n]):0)+(h!==0?h*s.c2l(_.x[n+1]):0);return[s.c2p(s.l2c(x),!0),c.c2p(_.y[l],!0),n+h,l]}var m=(_.level-o)/(_.z[l+1][n]-o),g=(m!==1?(1-m)*c.c2l(_.y[l]):0)+(m!==0?m*c.c2l(_.y[l+1]):0);return[s.c2p(_.x[n],!0),c.c2p(c.l2c(g),!0),n,l+m]}D.exports=function(_,u,r){var n,l,o,s;for(u=u||.01,r=r||.01,l=0;l<_.length;l++){for(o=_[l],s=0;s=A)&&(_<=k&&(_=k),u>=A&&(u=A),n=Math.floor((u-_)/r)+1,l=0),c=0;ck&&(m.unshift(k),g.unshift(g[0])),m[m.length-1]e?0:1)+(w[0][1]>e?0:2)+(w[1][1]>e?0:4)+(w[1][0]>e?0:8);return y===5||y===10?e>(w[0][0]+w[0][1]+w[1][0]+w[1][1])/4?y===5?713:1114:y===5?104:208:y===15?0:y}D.exports=function(e){var w,y,_,u,r,n,l,o,s,c=e[0].z,h=c.length,x=c[0].length,m=h===2||x===2;for(y=0;y=0&&(T=J,M=f):Math.abs(S[1]-T[1])<.01?Math.abs(S[1]-J[1])<.01&&(J[0]-S[0])*(T[0]-J[0])>=0&&(T=J,M=f):d.log("endpt to newendpt is not vert. or horz.",S,T,J)}if(S=T,M>=0)break;B+="L"+T}if(M===A.edgepaths.length){d.log("unclosed perimeter path");break}N=M,(j=V.indexOf(N)===-1)&&(N=V[0],B+="Z")}for(N=0;NT.center?T.right-f:f-T.left)/(B+Math.abs(Math.sin(I)*M)),j=(E>T.middle?T.bottom-E:E-T.top)/(Math.abs(N)+Math.cos(I)*M);if(V<1||j<1)return 1/0;var $=x.EDGECOST*(1/(V-1)+1/(j-1));$+=x.ANGLECOST*I*I;for(var ee=f-B,H=E-N,J=f+B,Q=E+N,Z=0;Z2*x.MAXCOST)break;j&&(f/=2),E=(M=I-f/2)+1.5*f}if(V<=x.MAXCOST)return B},L.addLabelData=function(A,v,S,T){var p=v.fontSize,M=v.width+p/3,f=Math.max(0,v.height-p/3),E=A.x,I=A.y,B=A.theta,N=Math.sin(B),V=Math.cos(B),j=function(ee,H){return[E+ee*V-H*N,I+ee*N+H*V]},$=[j(-M/2,-f/2),j(-M/2,f/2),j(M/2,f/2),j(M/2,-f/2)];S.push({text:v.text,x:E,y:I,dy:v.dy,theta:B,level:v.level,width:M,height:f}),T.push($)},L.drawLabels=function(A,v,S,T,p){var M=A.selectAll("text").data(v,function(I){return I.text+","+I.x+","+I.y+","+I.theta});if(M.exit().remove(),M.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(I){var B=I.x+Math.sin(I.theta)*I.dy,N=I.y-Math.cos(I.theta)*I.dy;b.select(this).text(I.text).attr({x:B,y:N,transform:"rotate("+180*I.theta/Math.PI+" "+B+" "+N+")"}).call(y.convertToTspans,S)}),p){for(var f="",E=0;E_.end&&(_.start=_.end=(_.start+_.end)/2),w._input.contours||(w._input.contours={}),d.extendFlat(w._input.contours,{start:_.start,end:_.end,size:_.size}),w._input.autocontour=!0}else if(_.type!=="constraint"){var l,o=_.start,s=_.end,c=w._input.contours;o>s&&(_.start=c.start=s,s=_.end=c.end=o,o=_.start),_.size>0||(l=o===s?1:e(o,s,w.ncontours).dtick,c.size=_.size=l)}}},1328:function(D,L,t){var b=t(45568),d=t(62203),e=t(12774),w=t(16438);D.exports=function(y){var _=b.select(y).selectAll("g.contour");_.style("opacity",function(u){return u[0].trace.opacity}),_.each(function(u){var r=b.select(this),n=u[0].trace,l=n.contours,o=n.line,s=l.size||1,c=l.start,h=l.type==="constraint",x=!h&&l.coloring==="lines",m=!h&&l.coloring==="fill",g=x||m?w(n):null;r.selectAll("g.contourlevel").each(function(v){b.select(this).selectAll("path").call(d.lineGroupStyle,o.width,x?g(v.level):o.color,o.dash)});var k=l.labelfont;if(r.selectAll("g.contourlabels text").each(function(v){d.font(b.select(this),{weight:k.weight,style:k.style,variant:k.variant,textcase:k.textcase,lineposition:k.lineposition,shadow:k.shadow,family:k.family,size:k.size,color:k.color||(x?g(v.level):o.color)})}),h)r.selectAll("g.contourfill path").style("fill",n.fillcolor);else if(m){var A;r.selectAll("g.contourfill path").style("fill",function(v){return A===void 0&&(A=v.level),g(v.level+.5*s)}),A===void 0&&(A=c),r.selectAll("g.contourbg path").style("fill",g(A-.5*s))}}),e(y)}},39889:function(D,L,t){var b=t(39356),d=t(20576);D.exports=function(e,w,y,_,u){var r,n=y("contours.coloring"),l="";n==="fill"&&(r=y("contours.showlines")),r!==!1&&(n!=="lines"&&(l=y("line.color","#000")),y("line.width",.5),y("line.dash")),n!=="none"&&(e.showlegend!==!0&&(w.showlegend=!1),w._dfltShowLegend=!1,b(e,w,_,y,{prefix:"",cLetter:"z"})),y("line.smoothing"),d(y,_,l,u)}},66365:function(D,L,t){var b=t(81658),d=t(52240),e=t(87163),w=t(93049).extendFlat,y=d.contours;D.exports=w({carpet:{valType:"string",editType:"calc"},z:b.z,a:b.x,a0:b.x0,da:b.dx,b:b.y,b0:b.y0,db:b.dy,text:b.text,hovertext:b.hovertext,transpose:b.transpose,atype:b.xtype,btype:b.ytype,fillcolor:d.fillcolor,autocontour:d.autocontour,ncontours:d.ncontours,contours:{type:y.type,start:y.start,end:y.end,size:y.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:y.showlines,showlabels:y.showlabels,labelfont:y.labelfont,labelformat:y.labelformat,operation:y.operation,value:y.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:d.line.color,width:d.line.width,dash:d.line.dash,smoothing:d.line.smoothing,editType:"plot"},zorder:d.zorder,transforms:void 0},e("",{cLetter:"z",autoColorDflt:!1}))},80849:function(D,L,t){var b=t(28379),d=t(34809),e=t(87869),w=t(93877),y=t(69295),_=t(78106),u=t(80924),r=t(50538),n=t(26571),l=t(62475);D.exports=function(o,s){var c=s._carpetTrace=n(o,s);if(c&&c.visible&&c.visible!=="legendonly"){if(!s.a||!s.b){var h=o.data[c.index],x=o.data[s.index];x.a||(x.a=h.a),x.b||(x.b=h.b),r(x,s,s._defaultColor,o._fullLayout)}var m=function(g,k){var A,v,S,T,p,M,f,E=k._carpetTrace,I=E.aaxis,B=E.baxis;I._minDtick=0,B._minDtick=0,d.isArray1D(k.z)&&e(k,I,B,"a","b",["z"]),A=k._a=k._a||k.a,T=k._b=k._b||k.b,A=A?I.makeCalcdata(k,"_a"):[],T=T?B.makeCalcdata(k,"_b"):[],v=k.a0||0,S=k.da||1,p=k.b0||0,M=k.db||1,f=k._z=w(k._z||k.z,k.transpose),k._emptypoints=_(f),y(f,k._emptypoints);var N=d.maxRowLength(f),V=k.xtype==="scaled"?"":A,j=u(k,V,v,S,N,I),$=k.ytype==="scaled"?"":T,ee={a:j,b:u(k,$,p,M,f.length,B),z:f};return k.contours.type==="levels"&&k.contours.coloring!=="none"&&b(g,k,{vals:f,containerStr:"",cLetter:"z"}),[ee]}(o,s);return l(s,s._z),m}}},50538:function(D,L,t){var b=t(34809),d=t(86073),e=t(66365),w=t(29503),y=t(47495),_=t(39889);D.exports=function(u,r,n,l){function o(s,c){return b.coerce(u,r,e,s,c)}if(o("carpet"),u.a&&u.b){if(!d(u,r,o,l,"a","b"))return void(r.visible=!1);o("text"),o("contours.type")==="constraint"?w(u,r,o,l,n,{hasHover:!1}):(y(u,r,o,function(s){return b.coerce2(u,r,e,s)}),_(u,r,o,l,{hasHover:!1}))}else r._defaultColor=n,r._length=null;o("zorder")}},34406:function(D,L,t){D.exports={attributes:t(66365),supplyDefaults:t(50538),colorbar:t(92697),calc:t(80849),plot:t(71815),style:t(1328),moduleType:"trace",name:"contourcarpet",basePlotModule:t(37703),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}},71815:function(D,L,t){var b=t(45568),d=t(6720),e=t(3685),w=t(62203),y=t(34809),_=t(83545),u=t(27657),r=t(8850),n=t(53156),l=t(1999),o=t(86828),s=t(49886),c=t(26571),h=t(94903);function x(k,A,v){var S=k.getPointAtLength(A),T=k.getPointAtLength(v),p=T.x-S.x,M=T.y-S.y,f=Math.sqrt(p*p+M*M);return[p/f,M/f]}function m(k){var A=Math.sqrt(k[0]*k[0]+k[1]*k[1]);return[k[0]/A,k[1]/A]}function g(k,A){var v=Math.abs(k[0]*A[0]+k[1]*A[1]);return Math.sqrt(1-v*v)/v}D.exports=function(k,A,v,S){var T=A.xaxis,p=A.yaxis;y.makeTraceGroups(S,v,"contour").each(function(M){var f=b.select(this),E=M[0],I=E.trace,B=I._carpetTrace=c(k,I),N=k.calcdata[B.index][0];if(B.visible&&B.visible!=="legendonly"){var V=E.a,j=E.b,$=I.contours,ee=o($,A,E),H=$.type==="constraint",J=$._operation,Q=H?J==="="?"lines":"fill":$.coloring,Z=[[V[0],j[j.length-1]],[V[V.length-1],j[j.length-1]],[V[V.length-1],j[0]],[V[0],j[0]]];_(ee);var K=1e-8*(V[V.length-1]-V[0]),ae=1e-8*(j[j.length-1]-j[0]);u(ee,K,ae);var se,he,fe,ie,oe=ee;$.type==="constraint"&&(oe=l(ee,J)),function(me,be){var Se,Ee,Ce,Le,Oe,We,Ie,Ve,Pe;for(Se=0;Se=0;ie--)se=N.clipsegments[ie],he=d([],se.x,T.c2p),fe=d([],se.y,p.c2p),he.reverse(),fe.reverse(),le.push(e(he,fe,se.bicubic));var ge="M"+le.join("L")+"Z";(function(me,be,Se,Ee,Ce,Le){var Oe,We,Ie,Ve,Pe=y.ensureSingle(me,"g","contourbg").selectAll("path").data(Le!=="fill"||Ce?[]:[0]);Pe.enter().append("path"),Pe.exit().remove();var de=[];for(Ve=0;Ve=0&&(ft=wt,kt=Vt):Math.abs(nt[1]-ft[1])=0&&(ft=wt,kt=Vt):y.log("endpt to newendpt is not vert. or horz.",nt,ft,wt)}if(kt>=0)break;Gt+=Xe(nt,ft),nt=ft}if(kt===qe.edgepaths.length){y.log("unclosed perimeter path");break}tt=kt,(Qe=st.indexOf(tt)===-1)&&(tt=st[0],Gt+=Xe(nt,ft)+"Z",nt=null)}for(tt=0;ttFt&&(at.max=Ft),at.len=at.max-at.min}function St(Jt,qt){var en,Wt=0,Zt=.1;return(Math.abs(Jt[0]-vt)0?+h[o]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:A})}}var S=w.extractOpts(r),T=S.reversescale?w.flipScale(S.colorscale):S.colorscale,p=T[0][1],M=["interpolate",["linear"],["heatmap-density"],0,e.opacity(p)<1?p:e.addOpacity(p,0)];for(o=1;o=0;u--)y.removeLayer(_[u][1])},w.dispose=function(){var y=this.subplot.map;this._removeLayers(),y.removeSource(this.sourceId)},D.exports=function(y,_){var u=_[0].trace,r=new e(y,u.uid),n=r.sourceId,l=b(_),o=r.below=y.belowLookup["trace-"+u.uid];return y.map.addSource(n,{type:"geojson",data:l.geojson}),r._addLayers(l,o),r}},17347:function(D,L,t){var b=t(87163),d=t(3208).rb,e=t(9829),w=t(95833),y=t(93049).extendFlat;D.exports=y({lon:w.lon,lat:w.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:w.text,hovertext:w.hovertext,hoverinfo:y({},e.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:d(),showlegend:y({},e.showlegend,{dflt:!1})},b("",{cLetter:"z",editTypeOverride:"calc"}))},60675:function(D,L,t){var b=t(10721),d=t(34809).isArrayOrTypedArray,e=t(63821).BADNUM,w=t(28379),y=t(34809)._;D.exports=function(_,u){for(var r=u._length,n=new Array(r),l=u.z,o=d(l)&&l.length,s=0;s0?+h[o]:0),s.push({type:"Feature",geometry:{type:"Point",coordinates:k},properties:A})}}var S=w.extractOpts(r),T=S.reversescale?w.flipScale(S.colorscale):S.colorscale,p=T[0][1],M=["interpolate",["linear"],["heatmap-density"],0,e.opacity(p)<1?p:e.addOpacity(p,0)];for(o=1;o=0;u--)y.removeLayer(_[u][1])},w.dispose=function(){var y=this.subplot.map;this._removeLayers(),y.removeSource(this.sourceId)},D.exports=function(y,_){var u=_[0].trace,r=new e(y,u.uid),n=r.sourceId,l=b(_),o=r.below=y.belowLookup["trace-"+u.uid];return y.map.addSource(n,{type:"geojson",data:l.geojson}),r._addLayers(l,o),r}},43179:function(D,L,t){var b=t(34809);D.exports=function(d,e){for(var w=0;w"),n.color=function(A,v){var S=A.marker,T=v.mc||S.color,p=v.mlc||S.line.color,M=v.mlw||S.line.width;return b(T)?T:b(p)&&M?p:void 0}(o,c),[n]}}},52213:function(D,L,t){D.exports={attributes:t(62824),layoutAttributes:t(93795),supplyDefaults:t(30495).supplyDefaults,crossTraceDefaults:t(30495).crossTraceDefaults,supplyLayoutDefaults:t(34980),calc:t(28152),crossTraceCalc:t(82539),plot:t(83482),style:t(7240).style,hoverPoints:t(27759),eventData:t(29412),selectPoints:t(88384),moduleType:"trace",name:"funnel",basePlotModule:t(37703),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},93795:function(D){D.exports={funnelmode:{valType:"enumerated",values:["stack","group","overlay"],dflt:"stack",editType:"calc"},funnelgap:{valType:"number",min:0,max:1,editType:"calc"},funnelgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}},34980:function(D,L,t){var b=t(34809),d=t(93795);D.exports=function(e,w,y){var _=!1;function u(l,o){return b.coerce(e,w,d,l,o)}for(var r=0;r path").each(function(x){if(!x.isBlank){var m=h.marker;b.select(this).call(e.fill,x.mc||m.color).call(e.stroke,x.mlc||m.line.color).call(d.dashLine,m.line.dash,x.mlw||m.line.width).style("opacity",h.selectedpoints&&!x.selected?w:1)}}),u(c,h,r),c.selectAll(".regions").each(function(){b.select(this).selectAll("path").style("stroke-width",0).call(e.fill,h.connector.fillcolor)}),c.selectAll(".lines").each(function(){var x=h.connector.line;d.lineGroupStyle(b.select(this).selectAll("path"),x.width,x.color,x.dash)})})}}},63447:function(D,L,t){var b=t(55412),d=t(9829),e=t(13792).u,w=t(3208).rb,y=t(3208).ay,_=t(93049).extendFlat;D.exports={labels:b.labels,label0:b.label0,dlabel:b.dlabel,values:b.values,marker:{colors:b.marker.colors,line:{color:_({},b.marker.line.color,{dflt:null}),width:_({},b.marker.line.width,{dflt:1}),editType:"calc"},pattern:b.marker.pattern,editType:"calc"},text:b.text,hovertext:b.hovertext,scalegroup:_({},b.scalegroup,{}),textinfo:_({},b.textinfo,{flags:["label","text","value","percent"]}),texttemplate:y({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:_({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:w({},{keys:["label","color","value","text","percent"]}),textposition:_({},b.textposition,{values:["inside","none"],dflt:"inside"}),textfont:b.textfont,insidetextfont:b.insidetextfont,title:{text:b.title.text,font:b.title.font,position:_({},b.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:e({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"}}},86817:function(D,L,t){var b=t(44122);L.name="funnelarea",L.plot=function(d,e,w,y){b.plotBasePlot(L.name,d,e,w,y)},L.clean=function(d,e,w,y){b.cleanBasePlot(L.name,d,e,w,y)}},2807:function(D,L,t){var b=t(44148);D.exports={calc:function(d,e){return b.calc(d,e)},crossTraceCalc:function(d){b.crossTraceCalc(d,{type:"funnelarea"})}}},79824:function(D,L,t){var b=t(34809),d=t(63447),e=t(13792).N,w=t(17550).handleText,y=t(46979).handleLabelsAndValues,_=t(46979).handleMarkerDefaults;D.exports=function(u,r,n,l){function o(v,S){return b.coerce(u,r,d,v,S)}var s=o("labels"),c=o("values"),h=y(s,c),x=h.len;if(r._hasLabels=h.hasLabels,r._hasValues=h.hasValues,!r._hasLabels&&r._hasValues&&(o("label0"),o("dlabel")),x){r._length=x,_(u,r,l,o),o("scalegroup");var m,g=o("text"),k=o("texttemplate");if(k||(m=o("textinfo",Array.isArray(g)?"text+percent":"percent")),o("hovertext"),o("hovertemplate"),k||m&&m!=="none"){var A=o("textposition");w(u,r,l,o,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else m==="none"&&o("textposition","none");e(r,l,o),o("title.text")&&(o("title.position"),b.coerceFont(o,"title.font",l.font)),o("aspectratio"),o("baseratio")}else r.visible=!1}},91132:function(D,L,t){D.exports={moduleType:"trace",name:"funnelarea",basePlotModule:t(86817),categories:["pie-like","funnelarea","showLegend"],attributes:t(63447),layoutAttributes:t(10270),supplyDefaults:t(79824),supplyLayoutDefaults:t(69161),calc:t(2807).calc,crossTraceCalc:t(2807).crossTraceCalc,plot:t(96673),style:t(13757),styleOne:t(32891),meta:{}}},10270:function(D,L,t){var b=t(4031).hiddenlabels;D.exports={hiddenlabels:b,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}},69161:function(D,L,t){var b=t(34809),d=t(10270);D.exports=function(e,w){function y(_,u){return b.coerce(e,w,d,_,u)}y("hiddenlabels"),y("funnelareacolorway",w.colorway),y("extendfunnelareacolors")}},96673:function(D,L,t){var b=t(45568),d=t(62203),e=t(34809),w=e.strScale,y=e.strTranslate,_=t(30635),u=t(32995).toMoveInsideBar,r=t(84102),n=r.recordMinTextSize,l=r.clearMinTextSize,o=t(37252),s=t(35734),c=s.attachFxHandlers,h=s.determineInsideTextFont,x=s.layoutAreas,m=s.prerenderTitles,g=s.positionTitleOutside,k=s.formatSliceLabel;function A(v,S){return"l"+(S[0]-v[0])+","+(S[1]-v[1])}D.exports=function(v,S){var T=v._context.staticPlot,p=v._fullLayout;l("funnelarea",p),m(S,v),x(S,p._size),e.makeTraceGroups(p._funnelarealayer,S,"trace").each(function(M){var f=b.select(this),E=M[0],I=E.trace;(function(B){if(B.length){var N=B[0],V=N.trace,j=V.aspectratio,$=V.baseratio;$>.999&&($=.999);var ee,H,J,Q=Math.pow($,2),Z=N.vTotal,K=Z,ae=Z*Q/(1-Q)/Z,se=[];for(se.push(Ie()),H=B.length-1;H>-1;H--)if(!(J=B[H]).hidden){var he=J.v/K;ae+=he,se.push(Ie())}var fe=1/0,ie=-1/0;for(H=0;H-1;H--)if(!(J=B[H]).hidden){var Oe=se[Le+=1][0],We=se[Le][1];J.TL=[-Oe,We],J.TR=[Oe,We],J.BL=Ee,J.BR=Ce,J.pxmid=(be=J.TR,Se=J.BR,[.5*(be[0]+Se[0]),.5*(be[1]+Se[1])]),Ee=J.TL,Ce=J.TR}}function Ie(){var Ve,Pe={x:Ve=Math.sqrt(ae),y:-Ve};return[Pe.x,Pe.y]}})(M),f.each(function(){var B=b.select(this).selectAll("g.slice").data(M);B.enter().append("g").classed("slice",!0),B.exit().remove(),B.each(function(V,j){if(V.hidden)b.select(this).selectAll("path,g").remove();else{V.pointNumber=V.i,V.curveNumber=I.index;var $=E.cx,ee=E.cy,H=b.select(this),J=H.selectAll("path.surface").data([V]);J.enter().append("path").classed("surface",!0).style({"pointer-events":T?"none":"all"}),H.call(c,v,M);var Q="M"+($+V.TR[0])+","+(ee+V.TR[1])+A(V.TR,V.BR)+A(V.BR,V.BL)+A(V.BL,V.TL)+"Z";J.attr("d",Q),k(v,V,E);var Z=o.castOption(I.textposition,V.pts),K=H.selectAll("g.slicetext").data(V.text&&Z!=="none"?[0]:[]);K.enter().append("g").classed("slicetext",!0),K.exit().remove(),K.each(function(){var ae=e.ensureSingle(b.select(this),"text","",function(ye){ye.attr("data-notex",1)}),se=e.ensureUniformFontSize(v,h(I,V,p.font));ae.text(V.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(d.font,se).call(_.convertToTspans,v);var he,fe,ie,oe=d.bBox(ae.node()),le=Math.min(V.BL[1],V.BR[1])+ee,ge=Math.max(V.TL[1],V.TR[1])+ee;fe=Math.max(V.TL[0],V.BL[0])+$,ie=Math.min(V.TR[0],V.BR[0])+$,(he=u(fe,ie,le,ge,oe,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=se.size,n(I.type,he,p),M[j].transform=he,e.setTransormAndDisplay(ae,he)})}});var N=b.select(this).selectAll("g.titletext").data(I.title.text?[0]:[]);N.enter().append("g").classed("titletext",!0),N.exit().remove(),N.each(function(){var V=e.ensureSingle(b.select(this),"text","",function(ee){ee.attr("data-notex",1)}),j=I.title.text;I._meta&&(j=e.templateString(j,I._meta)),V.text(j).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(d.font,I.title.font).call(_.convertToTspans,v);var $=g(E,p._size);V.attr("transform",y($.x,$.y)+w(Math.min(1,$.scale))+y($.tx,$.ty))})})})}},13757:function(D,L,t){var b=t(45568),d=t(32891),e=t(84102).resizeText;D.exports=function(w){var y=w._fullLayout._funnelarealayer.selectAll(".trace");e(w,y,"funnelarea"),y.each(function(_){var u=_[0].trace,r=b.select(this);r.style({opacity:u.opacity}),r.selectAll("path.surface").each(function(n){b.select(this).call(d,n,u,w)})})}},81658:function(D,L,t){var b=t(36640),d=t(9829),e=t(80337),w=t(80712).axisHoverFormat,y=t(3208).rb,_=t(3208).ay,u=t(87163),r=t(93049).extendFlat;D.exports=r({z:{valType:"data_array",editType:"calc"},x:r({},b.x,{impliedEdits:{xtype:"array"}}),x0:r({},b.x0,{impliedEdits:{xtype:"scaled"}}),dx:r({},b.dx,{impliedEdits:{xtype:"scaled"}}),y:r({},b.y,{impliedEdits:{ytype:"array"}}),y0:r({},b.y0,{impliedEdits:{ytype:"scaled"}}),dy:r({},b.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:r({},b.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:r({},b.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:r({},b.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:r({},b.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:r({},b.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:r({},b.yperiodalignment,{impliedEdits:{ytype:"scaled"}}),text:{valType:"data_array",editType:"calc"},hovertext:{valType:"data_array",editType:"calc"},transpose:{valType:"boolean",dflt:!1,editType:"calc"},xtype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},ytype:{valType:"enumerated",values:["array","scaled"],editType:"calc+clearAxisTypes"},zsmooth:{valType:"enumerated",values:["fast","best",!1],dflt:!1,editType:"calc"},hoverongaps:{valType:"boolean",dflt:!0,editType:"none"},connectgaps:{valType:"boolean",editType:"calc"},xgap:{valType:"number",dflt:0,min:0,editType:"plot"},ygap:{valType:"number",dflt:0,min:0,editType:"plot"},xhoverformat:w("x"),yhoverformat:w("y"),zhoverformat:w("z",1),hovertemplate:y(),texttemplate:_({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:e({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:r({},d.showlegend,{dflt:!1}),zorder:b.zorder},{transforms:void 0},u("",{cLetter:"z",autoColorDflt:!1}))},51670:function(D,L,t){var b=t(33626),d=t(34809),e=t(29714),w=t(40528),y=t(19226),_=t(28379),u=t(87869),r=t(93877),n=t(69295),l=t(78106),o=t(80924),s=t(63821).BADNUM;function c(h){for(var x=[],m=h.length,g=0;g1){var oe=(ie[ie.length-1]-ie[0])/(ie.length-1),le=Math.abs(oe/100);for(f=0;fle)return!1}return!0}(I.rangebreaks||B.rangebreaks)&&(M=function(ie,oe,le){for(var ge=[],ye=-1,me=0;me=0;u--)(r=((s[[(w=(_=c[u])[0])-1,y=_[1]]]||m)[2]+(s[[w+1,y]]||m)[2]+(s[[w,y-1]]||m)[2]+(s[[w,y+1]]||m)[2])/20)&&(n[_]=[w,y,r],c.splice(u,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(_ in n)s[_]=n[_],o.push(n[_])}return o.sort(function(k,A){return A[2]-k[2]})}},93125:function(D,L,t){var b=t(32141),d=t(34809),e=d.isArrayOrTypedArray,w=t(29714),y=t(88856).extractOpts;D.exports=function(_,u,r,n,l){l||(l={});var o,s,c,h,x=l.isContour,m=_.cd[0],g=m.trace,k=_.xa,A=_.ya,v=m.x,S=m.y,T=m.z,p=m.xCenter,M=m.yCenter,f=m.zmask,E=g.zhoverformat,I=v,B=S;if(_.index!==!1){try{c=Math.round(_.index[1]),h=Math.round(_.index[0])}catch{return void d.error("Error hovering on heatmap, pointNumber must be [row,col], found:",_.index)}if(c<0||c>=T[0].length||h<0||h>T.length)return}else{if(b.inbox(u-v[0],u-v[v.length-1],0)>0||b.inbox(r-S[0],r-S[S.length-1],0)>0)return;if(x){var N;for(I=[2*v[0]-v[1]],N=1;NA&&(S=Math.max(S,Math.abs(y[n][l]-k)/(v-A))))}return S}D.exports=function(y,_){var u,r=1;for(w(y,_),u=0;u<_.length&&!(_[u][2]<4);u++);for(_=_.slice(u),u=0;u<100&&r>.01;u++)r=w(y,_,e(r));return r>.01&&b.log("interp2d didn't converge quickly",r),y}},63814:function(D,L,t){var b=t(34809);D.exports=function(d,e){d("texttemplate");var w=b.extendFlat({},e.font,{color:"auto",size:"auto"});b.coerceFont(d,"textfont",w)}},80924:function(D,L,t){var b=t(33626),d=t(34809).isArrayOrTypedArray;D.exports=function(e,w,y,_,u,r){var n,l,o,s=[],c=b.traceIs(e,"contour"),h=b.traceIs(e,"histogram"),x=b.traceIs(e,"gl2d");if(d(w)&&w.length>1&&!h&&r.type!=="category"){var m=w.length;if(!(m<=u))return c?w.slice(0,u):w.slice(0,u+1);if(c||x)s=Array.from(w).slice(0,u);else if(u===1)s=r.type==="log"?[.5*w[0],2*w[0]]:[w[0]-.5,w[0]+.5];else if(r.type==="log"){for(s=[Math.pow(w[0],1.5)/Math.pow(w[1],.5)],o=1;o0;)V=E.c2p(ie[H]),H--;for(V0;)ee=I.c2p(oe[H]),H--;ee<$&&(j=$,$=ee,ee=j,Ce=!0),ye&&(le=ie,ge=oe,ie=K.xfill,oe=K.yfill);var Le="default";if(me?Le=me==="best"?"smooth":"fast":ae._islinear&&se===0&&he===0&&h()&&(Le="fast"),Le!=="fast"){var Oe=me==="best"?0:.5;N=Math.max(-Oe*E._length,N),V=Math.min((1+Oe)*E._length,V),$=Math.max(-Oe*I._length,$),ee=Math.min((1+Oe)*I._length,ee)}var We,Ie,Ve=Math.round(V-N),Pe=Math.round(ee-$);if(N>=E._length||V<=0||$>=I._length||ee<=0)return Z.selectAll("image").data([]).exit().remove(),void k(Z);Le==="fast"?(We=Se,Ie=be):(We=Ve,Ie=Pe);var de=document.createElement("canvas");de.width=We,de.height=Ie;var Me,ke,He=de.getContext("2d",{willReadFrequently:!0}),Fe=o(ae,{noNumericCheck:!0,returnArray:!0});Le==="fast"?(Me=Ee?function(Qr){return Se-1-Qr}:_.identity,ke=Ce?function(Qr){return be-1-Qr}:_.identity):(Me=function(Qr){return _.constrain(Math.round(E.c2p(ie[Qr])-N),0,Ve)},ke=function(Qr){return _.constrain(Math.round(I.c2p(oe[Qr])-$),0,Pe)});var qe,$e,Ye,_e,De=ke(0),Be=[De,De],Ge=Ee?0:1,tt=Ce?0:1,nt=0,ft=0,At=0,kt=0;function Vt(Qr,kn){if(Qr!==void 0){var Cn=Fe(Qr);return Cn[0]=Math.round(Cn[0]),Cn[1]=Math.round(Cn[1]),Cn[2]=Math.round(Cn[2]),nt+=kn,ft+=Cn[0]*kn,At+=Cn[1]*kn,kt+=Cn[2]*kn,Cn}return[0,0,0,0]}function Ht(Qr,kn,Cn,ur){var Zn=Qr[Cn.bin0];if(Zn===void 0)return Vt(void 0,1);var cr,Ir=Qr[Cn.bin1],Er=kn[Cn.bin0],Xr=kn[Cn.bin1],ai=Ir-Zn||0,bn=Er-Zn||0;return cr=Ir===void 0?Xr===void 0?0:Er===void 0?2*(Xr-Zn):2*(2*Xr-Er-Zn)/3:Xr===void 0?Er===void 0?0:2*(2*Zn-Ir-Er)/3:Er===void 0?2*(2*Xr-Ir-Zn)/3:Xr+Zn-Ir-Er,Vt(Zn+Cn.frac*ai+ur.frac*(bn+Cn.frac*cr))}if(Le!=="default"){var Gt,st=0;try{Gt=new Uint8Array(We*Ie*4)}catch{Gt=new Array(We*Ie*4)}if(Le==="smooth"){var Qe,pt,yt,Ot=le||ie,Pt=ge||oe,at=new Array(Ot.length),lt=new Array(Pt.length),Xe=new Array(Ve),ut=le?v:A,wt=ge?v:A;for(H=0;HDn||Dn>I._length))for(J=Zt;Jmn||mn>E._length)){var En=r({x:In,y:Pn},ae,T._fullLayout);En.x=In,En.y=Pn;var Kn=K.z[H][J];Kn===void 0?(En.z="",En.zLabel=""):(En.z=Kn,En.zLabel=y.tickText(Jt,Kn,"hover").text);var Ln=K.text&&K.text[H]&&K.text[H][J];Ln!==void 0&&Ln!==!1||(Ln=""),En.text=Ln;var Tn=_.texttemplateString(Ft,En,T._fullLayout._d3locale,En,ae._meta||{});if(Tn){var Fn=Tn.split("
"),wn=Fn.length,zn=0;for(Q=0;Q0&&(A=!0);for(var T=0;T_){var u=_-w[d];return w[d]=_,u}}return 0},max:function(d,e,w,y){var _=y[e];if(b(_)){if(_=Number(_),!b(w[d]))return w[d]=_,_;if(w[d]<_){var u=_-w[d];return w[d]=_,u}}return 0}}},64852:function(D,L,t){var b=t(63821),d=b.ONEAVGYEAR,e=b.ONEAVGMONTH,w=b.ONEDAY,y=b.ONEHOUR,_=b.ONEMIN,u=b.ONESEC,r=t(29714).tickIncrement;function n(c,h,x,m){if(c*h<=0)return 1/0;for(var g=Math.abs(h-c),k=x.type==="date",A=l(g,k),v=0;v<10;v++){var S=l(80*A,k);if(A===S||!o(S,c,h,k,x,m))break;A=S}return A}function l(c,h){return h&&c>u?c>w?c>1.1*d?d:c>1.1*e?e:w:c>y?y:c>_?_:u:Math.pow(10,Math.floor(Math.log(c)/Math.LN10))}function o(c,h,x,m,g,k){if(m&&c>w){var A=s(h,g,k),v=s(x,g,k),S=c===d?0:1;return A[S]!==v[S]}return Math.floor(x/c)-Math.floor(h/c)>.1}function s(c,h,x){var m=h.c2d(c,d,x).split("-");return m[0]===""&&(m.unshift(),m[0]="-"+m[0]),m}D.exports=function(c,h,x,m,g){var k,A,v=-1.1*h,S=-.1*h,T=c-S,p=x[0],M=x[1],f=Math.min(n(p+S,p+T,m,g),n(M+S,M+T,m,g)),E=Math.min(n(p+v,p+S,m,g),n(M+v,M+S,m,g));if(f>E&&Ew){var I=k===d?1:6,B=k===d?"M12":"M1";return function(N,V){var j=m.c2d(N,d,g),$=j.indexOf("-",I);$>0&&(j=j.substr(0,$));var ee=m.d2c(j,0,g);if(eec.r2l(oe)&&(ge=w.tickIncrement(ge,E.size,!0,A)),se.start=c.l2r(ge),ie||d.nestedProperty(s,p+".start").set(se.start)}var ye=E.end,me=c.r2l(ae.end),be=me!==void 0;if((E.endFound||be)&&me!==c.r2l(ye)){var Se=be?me:d.aggNums(Math.max,null,v);se.end=c.l2r(Se),be||d.nestedProperty(s,p+".start").set(se.end)}var Ee="autobin"+h;return s._input[Ee]===!1&&(s._input[p]=d.extendFlat({},s[p]||{}),delete s._input[Ee],delete s[Ee]),[se,v]}D.exports={calc:function(o,s){var c,h,x,m,g=[],k=[],A=s.orientation==="h",v=w.getFromId(o,A?s.yaxis:s.xaxis),S=A?"y":"x",T={x:"y",y:"x"}[S],p=s[S+"calendar"],M=s.cumulative,f=l(o,s,v,S),E=f[0],I=f[1],B=typeof E.size=="string",N=[],V=B?N:E,j=[],$=[],ee=[],H=0,J=s.histnorm,Q=s.histfunc,Z=J.indexOf("density")!==-1;M.enabled&&Z&&(J=J.replace(/ ?density$/,""),Z=!1);var K,ae=Q==="max"||Q==="min"?null:0,se=_.count,he=u[J],fe=!1,ie=function(Pe){return v.r2c(Pe,0,p)};for(d.isArrayOrTypedArray(s[T])&&Q!=="count"&&(K=s[T],fe=Q==="avg",se=_[Q]),c=ie(E.start),x=ie(E.end)+(c-w.tickIncrement(c,E.size,!1,p))/1e6;c=0&&m=0;ke--)$e(ke);else if(de==="increasing"){for(ke=1;ke=0;ke--)Pe[ke]+=Pe[ke+1];Me==="exclude"&&(Pe.push(0),Pe.shift())}}(k,M.direction,M.currentbin);var Le=Math.min(g.length,k.length),Oe=[],We=0,Ie=Le-1;for(c=0;c=We;c--)if(k[c]){Ie=c;break}for(c=We;c<=Ie;c++)if(b(g[c])&&b(k[c])){var Ve={p:g[c],s:k[c],b:0};M.enabled||(Ve.pts=ee[c],me?Ve.ph0=Ve.ph1=ee[c].length?I[ee[c][0]]:g[c]:(s._computePh=!0,Ve.ph0=ge(N[c]),Ve.ph1=ge(N[c+1],!0))),Oe.push(Ve)}return Oe.length===1&&(Oe[0].width1=w.tickIncrement(Oe[0].p,E.size,!1,p)-Oe[0].p),y(Oe,s),d.isArrayOrTypedArray(s.selectedpoints)&&d.tagSelected(Oe,s,Ee),Oe},calcAllAutoBins:l}},39732:function(D){D.exports={eventDataKeys:["binNumber"]}},83380:function(D,L,t){var b=t(34809),d=t(5975),e=t(33626).traceIs,w=t(36301),y=t(17550).validateCornerradius,_=b.nestedProperty,u=t(84391).getAxisGroup,r=[{aStr:{x:"xbins.start",y:"ybins.start"},name:"start"},{aStr:{x:"xbins.end",y:"ybins.end"},name:"end"},{aStr:{x:"xbins.size",y:"ybins.size"},name:"size"},{aStr:{x:"nbinsx",y:"nbinsy"},name:"nbins"}],n=["x","y"];D.exports=function(l,o){var s,c,h,x,m,g,k,A=o._histogramBinOpts={},v=[],S={},T=[];function p(ae,se){return b.coerce(s._input,s,s._module.attributes,ae,se)}function M(ae){return ae.orientation==="v"?"x":"y"}function f(ae,se,he){var fe=ae.uid+"__"+he;se||(se=fe);var ie=function(ye,me){return d.getFromTrace({_fullLayout:o},ye,me).type}(ae,he),oe=ae[he+"calendar"]||"",le=A[se],ge=!0;le&&(ie===le.axType&&oe===le.calendar?(ge=!1,le.traces.push(ae),le.dirs.push(he)):(se=fe,ie!==le.axType&&b.warn(["Attempted to group the bins of trace",ae.index,"set on a","type:"+ie,"axis","with bins on","type:"+le.axType,"axis."].join(" ")),oe!==le.calendar&&b.warn(["Attempted to group the bins of trace",ae.index,"set with a",oe,"calendar","with bins",le.calendar?"on a "+le.calendar+" calendar":"w/o a set calendar"].join(" ")))),ge&&(A[se]={traces:[ae],dirs:[he],axType:ie,calendar:ae[he+"calendar"]||""}),ae["_"+he+"bingroup"]=se}for(m=0;mN&&f.splice(N,f.length-N),B.length>N&&B.splice(N,B.length-N);var V=[],j=[],$=[],ee=typeof M.size=="string",H=typeof I.size=="string",J=[],Q=[],Z=ee?J:M,K=H?Q:I,ae=0,se=[],he=[],fe=s.histnorm,ie=s.histfunc,oe=fe.indexOf("density")!==-1,le=ie==="max"||ie==="min"?null:0,ge=e.count,ye=w[fe],me=!1,be=[],Se=[],Ee="z"in s?s.z:"marker"in s&&Array.isArray(s.marker.color)?s.marker.color:"";Ee&&ie!=="count"&&(me=ie==="avg",ge=e[ie]);var Ce=M.size,Le=S(M.start),Oe=S(M.end)+(Le-d.tickIncrement(Le,Ce,!1,A))/1e6;for(c=Le;c=0&&x=0&&m-1,flipY:j.tiling.flip.indexOf("y")>-1,orientation:j.tiling.orientation,pad:{inner:j.tiling.pad},maxDepth:j._maxDepth}).descendants(),Q=1/0,Z=-1/0;J.forEach(function(fe){var ie=fe.depth;ie>=j._maxDepth?(fe.x0=fe.x1=(fe.x0+fe.x1)/2,fe.y0=fe.y1=(fe.y0+fe.y1)/2):(Q=Math.min(Q,ie),Z=Math.max(Z,ie))}),x=x.data(J,r.getPtId),j._maxVisibleLayers=isFinite(Z)?Z-Q+1:0,x.enter().append("g").classed("slice",!0),f(x,o,{},[g,k],S),x.order();var K=null;if(M&&B){var ae=r.getPtId(B);x.each(function(fe){K===null&&r.getPtId(fe)===ae&&(K={x0:fe.x0,x1:fe.x1,y0:fe.y0,y1:fe.y1})})}var se=function(){return K||{x0:0,x1:g,y0:0,y1:k}},he=x;return M&&(he=he.transition().each("end",function(){var fe=b.select(this);r.setSliceCursor(fe,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),he.each(function(fe){fe._x0=A(fe.x0),fe._x1=A(fe.x1),fe._y0=v(fe.y0),fe._y1=v(fe.y1),fe._hoverX=A(fe.x1-j.tiling.pad),fe._hoverY=v(H?fe.y1-j.tiling.pad/2:fe.y0+j.tiling.pad/2);var ie=b.select(this),oe=d.ensureSingle(ie,"path","surface",function(me){me.style("pointer-events",N?"none":"all")});M?oe.transition().attrTween("d",function(me){var be=E(me,o,se(),[g,k],{orientation:j.tiling.orientation,flipX:j.tiling.flip.indexOf("x")>-1,flipY:j.tiling.flip.indexOf("y")>-1});return function(Se){return S(be(Se))}}):oe.attr("d",S),ie.call(n,h,s,c,{styleOne:_,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(r.setSliceCursor,s,{isTransitioning:s._transitioning}),oe.call(_,fe,j,s,{hovered:!1}),fe.x0===fe.x1||fe.y0===fe.y1?fe._text="":fe._text=l(fe,h,j,c,V)||"";var le=d.ensureSingle(ie,"g","slicetext"),ge=d.ensureSingle(le,"text","",function(me){me.attr("data-notex",1)}),ye=d.ensureUniformFontSize(s,r.determineTextFont(j,fe,V.font));ge.text(fe._text||" ").classed("slicetext",!0).attr("text-anchor",ee?"end":$?"start":"middle").call(e.font,ye).call(w.convertToTspans,s),fe.textBB=e.bBox(ge.node()),fe.transform=T(fe,{fontSize:ye.size}),fe.transform.fontSize=ye.size,M?ge.transition().attrTween("transform",function(me){var be=I(me,o,se(),[g,k]);return function(Se){return p(be(Se))}}):ge.attr("transform",p(fe))}),K}},36858:function(D,L,t){D.exports={moduleType:"trace",name:"icicle",basePlotModule:t(63387),categories:[],animatable:!0,attributes:t(12505),layoutAttributes:t(60052),supplyDefaults:t(17918),supplyLayoutDefaults:t(11747),calc:t(36349)._,crossTraceCalc:t(36349).t,plot:t(1395),style:t(50579).style,colorbar:t(21146),meta:{}}},60052:function(D){D.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}},11747:function(D,L,t){var b=t(34809),d=t(60052);D.exports=function(e,w){function y(_,u){return b.coerce(e,w,d,_,u)}y("iciclecolorway",w.colorway),y("extendiciclecolors")}},29316:function(D,L,t){var b=t(92264),d=t(36141);D.exports=function(e,w,y){var _=y.flipX,u=y.flipY,r=y.orientation==="h",n=y.maxDepth,l=w[0],o=w[1];n&&(l=(e.height+1)*w[0]/Math.min(e.height+1,n),o=(e.height+1)*w[1]/Math.min(e.height+1,n));var s=b.partition().padding(y.pad.inner).size(r?[w[1],l]:[w[0],o])(e);return(r||_||u)&&d(s,w,{swapXY:r,flipX:_,flipY:u}),s}},1395:function(D,L,t){var b=t(41567),d=t(23593);D.exports=function(e,w,y,_){return b(e,w,y,_,{type:"icicle",drawDescendants:d})}},50579:function(D,L,t){var b=t(45568),d=t(78766),e=t(34809),w=t(84102).resizeText,y=t(72043);function _(u,r,n,l){var o=r.data.data,s=!r.children,c=o.i,h=e.castOption(n,c,"marker.line.color")||d.defaultLine,x=e.castOption(n,c,"marker.line.width")||0;u.call(y,r,n,l).style("stroke-width",x).call(d.stroke,h).style("opacity",s?n.leaf.opacity:null)}D.exports={style:function(u){var r=u._fullLayout._iciclelayer.selectAll(".trace");w(u,r,"icicle"),r.each(function(n){var l=b.select(this),o=n[0].trace;l.style("opacity",o.opacity),l.selectAll("path.surface").each(function(s){b.select(this).call(_,s,o,u)})})},styleOne:_}},22153:function(D,L,t){for(var b=t(9829),d=t(36640).zorder,e=t(3208).rb,w=t(93049).extendFlat,y=t(42939).colormodel,_=["rgb","rgba","rgba256","hsl","hsla"],u=[],r=[],n=0;n<_.length;n++){var l=y[_[n]];u.push("For the `"+_[n]+"` colormodel, it is ["+(l.zminDflt||l.min).join(", ")+"]."),r.push("For the `"+_[n]+"` colormodel, it is ["+(l.zmaxDflt||l.max).join(", ")+"].")}D.exports=w({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:_,editType:"calc"},zsmooth:{valType:"enumerated",values:["fast",!1],dflt:!1,editType:"plot"},zmin:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},zmax:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dx:{valType:"number",dflt:1,editType:"calc"},dy:{valType:"number",dflt:1,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"data_array",editType:"plot"},hoverinfo:w({},b.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:e({},{keys:["z","color","colormodel"]}),zorder:d,transforms:void 0})},31181:function(D,L,t){var b=t(34809),d=t(42939),e=t(10721),w=t(29714),y=t(34809).maxRowLength,_=t(96315).p;function u(n,l,o,s){return function(c){return b.constrain((c-n)*l,o,s)}}function r(n,l){return function(o){return b.constrain(o,n,l)}}D.exports=function(n,l){var o,s;if(l._hasZ)o=l.z.length,s=y(l.z);else if(l._hasSource){var c=_(l.source);o=c.height,s=c.width}var h,x=w.getFromId(n,l.xaxis||"x"),m=w.getFromId(n,l.yaxis||"y"),g=x.d2c(l.x0)-l.dx/2,k=m.d2c(l.y0)-l.dy/2,A=[g,g+s*l.dx],v=[k,k+o*l.dy];if(x&&x.type==="log")for(h=0;h0||b.inbox(u-r.y0,u-(r.y0+r.h*n.dy),0)>0)){var s,c=Math.floor((_-r.x0)/n.dx),h=Math.floor(Math.abs(u-r.y0)/n.dy);if(n._hasZ?s=r.z[h][c]:n._hasSource&&(s=n._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,h,1,1).data),s){var x,m=r.hi||n.hoverinfo;if(m){var g=m.split("+");g.indexOf("all")!==-1&&(g=["color"]),g.indexOf("color")!==-1&&(x=!0)}var k,A=w.colormodel[n.colormodel],v=A.colormodel||n.colormodel,S=v.length,T=n._scaler(s),p=A.suffix,M=[];(n.hovertemplate||x)&&(M.push("["+[T[0]+p[0],T[1]+p[1],T[2]+p[2]].join(", ")),S===4&&M.push(", "+T[3]+p[3]),M.push("]"),M=M.join(""),y.extraText=v.toUpperCase()+": "+M),e(n.hovertext)&&e(n.hovertext[h])?k=n.hovertext[h][c]:e(n.text)&&e(n.text[h])&&(k=n.text[h][c]);var f=o.c2p(r.y0+(h+.5)*n.dy),E=r.x0+(c+.5)*n.dx,I=r.y0+(h+.5)*n.dy,B="["+s.slice(0,n.colormodel.length).join(", ")+"]";return[d.extendFlat(y,{index:[h,c],x0:l.c2p(r.x0+c*n.dx),x1:l.c2p(r.x0+(c+1)*n.dx),y0:f,y1:f,color:T,xVal:E,xLabelVal:E,yVal:I,yLabelVal:I,zLabelVal:B,text:k,hovertemplateLabels:{zLabel:B,colorLabel:M,"color[0]Label":T[0]+p[0],"color[1]Label":T[1]+p[1],"color[2]Label":T[2]+p[2],"color[3]Label":T[3]+p[3]}})]}}}},92106:function(D,L,t){D.exports={attributes:t(22153),supplyDefaults:t(82766),calc:t(31181),plot:t(36899),style:t(67555),hoverPoints:t(57328),eventData:t(45461),moduleType:"trace",name:"image",basePlotModule:t(37703),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}},36899:function(D,L,t){var b=t(45568),d=t(34809),e=d.strTranslate,w=t(62972),y=t(42939),_=t(95544),u=t(1837).STYLE;D.exports=function(r,n,l,o){var s=n.xaxis,c=n.yaxis,h=!r._context._exportedPlot&&_();d.makeTraceGroups(o,l,"im").each(function(x){var m=b.select(this),g=x[0],k=g.trace,A=(k.zsmooth==="fast"||k.zsmooth===!1&&h)&&!k._hasZ&&k._hasSource&&s.type==="linear"&&c.type==="linear";k._realImage=A;var v,S,T,p,M,f,E=g.z,I=g.x0,B=g.y0,N=g.w,V=g.h,j=k.dx,$=k.dy;for(f=0;v===void 0&&f0;)S=s.c2p(I+f*j),f--;for(f=0;p===void 0&&f0;)M=c.c2p(B+f*$),f--;SK[0];if(ae||se){var he=v+ee/2,fe=p+H/2;Q+="transform:"+e(he+"px",fe+"px")+"scale("+(ae?-1:1)+","+(se?-1:1)+")"+e(-he+"px",-fe+"px")+";"}}J.attr("style",Q);var ie=new Promise(function(le){if(k._hasZ)le();else if(k._hasSource)if(k._canvas&&k._canvas.el.width===N&&k._canvas.el.height===V&&k._canvas.source===k.source)le();else{var ge=document.createElement("canvas");ge.width=N,ge.height=V;var ye=ge.getContext("2d",{willReadFrequently:!0});k._image=k._image||new Image;var me=k._image;me.onload=function(){ye.drawImage(me,0,0),k._canvas={el:ge,source:k.source},le()},me.setAttribute("src",k.source)}}).then(function(){var le,ge;if(k._hasZ)ge=oe(function(me,be){var Se=E[be][me];return d.isTypedArray(Se)&&(Se=Array.from(Se)),Se}),le=ge.toDataURL("image/png");else if(k._hasSource)if(A)le=k.source;else{var ye=k._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,N,V).data;ge=oe(function(me,be){var Se=4*(be*N+me);return[ye[Se],ye[Se+1],ye[Se+2],ye[Se+3]]}),le=ge.toDataURL("image/png")}J.attr({"xlink:href":le,height:H,width:ee,x:v,y:p})});r._promises.push(ie)}function oe(le){var ge=document.createElement("canvas");ge.width=ee,ge.height=H;var ye,me=ge.getContext("2d",{willReadFrequently:!0}),be=function(de){return d.constrain(Math.round(s.c2p(I+de*j)-v),0,ee)},Se=function(de){return d.constrain(Math.round(c.c2p(B+de*$)-p),0,H)},Ee=y.colormodel[k.colormodel],Ce=Ee.colormodel||k.colormodel,Le=Ee.fmt;for(f=0;f0}function S(E){E.each(function(I){m.stroke(b.select(this),I.line.color)}).each(function(I){m.fill(b.select(this),I.color)}).style("stroke-width",function(I){return I.line.width})}function T(E,I,B){var N=E._fullLayout,V=w.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},I),j={type:"linear",_id:"x"+I._id},$={letter:"x",font:N.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function ee(H,J){return w.coerce(V,j,x,H,J)}return c(V,j,ee,$,N),h(V,j,ee,$),j}function p(E,I,B){return[Math.min(I/E.width,B/E.height),E,I+"x"+B]}function M(E,I,B,N){var V=document.createElementNS("http://www.w3.org/2000/svg","text"),j=b.select(V);return j.text(E).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",E).call(o.convertToTspans,N).call(n.font,I),n.bBox(j.node())}function f(E,I,B,N,V,j){var $="_cache"+I;E[$]&&E[$].key===V||(E[$]={key:V,value:B});var ee=w.aggNums(j,null,[E[$].value,N],2);return E[$].value=ee,ee}D.exports=function(E,I,B,N){var V,j=E._fullLayout;v(B)&&N&&(V=N()),w.makeTraceGroups(j._indicatorlayer,I,"trace").each(function($){var ee,H,J,Q,Z,K=$[0].trace,ae=b.select(this),se=K._hasGauge,he=K._isAngular,fe=K._isBullet,ie=K.domain,oe={w:j._size.w*(ie.x[1]-ie.x[0]),h:j._size.h*(ie.y[1]-ie.y[0]),l:j._size.l+j._size.w*ie.x[0],r:j._size.r+j._size.w*(1-ie.x[1]),t:j._size.t+j._size.h*(1-ie.y[1]),b:j._size.b+j._size.h*ie.y[0]},le=oe.l+oe.w/2,ge=oe.t+oe.h/2,ye=Math.min(oe.w/2,oe.h),me=l.innerRadius*ye,be=K.align||"center";if(H=ge,se){if(he&&(ee=le,H=ge+ye/2,J=function(Ve){return function(Pe,de){return[de/Math.sqrt(Pe.width/2*(Pe.width/2)+Pe.height*Pe.height),Pe,de]}(Ve,.9*me)}),fe){var Se=l.bulletPadding,Ee=1-l.bulletNumberDomainSize+Se;ee=oe.l+(Ee+(1-Ee)*k[be])*oe.w,J=function(Ve){return p(Ve,(l.bulletNumberDomainSize-Se)*oe.w,oe.h)}}}else ee=oe.l+k[be]*oe.w,J=function(Ve){return p(Ve,oe.w,oe.h)};(function(Ve,Pe,de,Me){var ke,He,Fe,qe=de[0].trace,$e=Me.numbersX,Ye=Me.numbersY,_e=qe.align||"center",De=g[_e],Be=Me.transitionOpts,Ge=Me.onComplete,tt=w.ensureSingle(Pe,"g","numbers"),nt=[];qe._hasNumber&&nt.push("number"),qe._hasDelta&&(nt.push("delta"),qe.delta.position==="left"&&nt.reverse());var ft=tt.selectAll("text").data(nt);function At(yt,Ot,Pt,at){if(!yt.match("s")||Pt>=0==at>=0||Ot(Pt).slice(-1).match(A)||Ot(at).slice(-1).match(A))return Ot;var lt=yt.slice().replace("s","f").replace(/\d+/,function(ut){return parseInt(ut)-1}),Xe=T(Ve,{tickformat:lt});return function(ut){return Math.abs(ut)<1?s.tickText(Xe,ut).text:Ot(ut)}}ft.enter().append("text"),ft.attr("text-anchor",function(){return De}).attr("class",function(yt){return yt}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),ft.exit().remove();var kt,Vt=qe.mode+qe.align;if(qe._hasDelta&&(kt=function(){var yt=T(Ve,{tickformat:qe.delta.valueformat},qe._range);yt.setScale(),s.prepTicks(yt);var Ot=function(Lt){return s.tickText(yt,Lt).text},Pt=qe.delta.suffix,at=qe.delta.prefix,lt=function(Lt){return qe.delta.relative?Lt.relativeDelta:Lt.delta},Xe=function(Lt,jt){return Lt===0||typeof Lt!="number"||isNaN(Lt)?"-":(Lt>0?qe.delta.increasing.symbol:qe.delta.decreasing.symbol)+at+jt(Lt)+Pt},ut=function(Lt){return Lt.delta>=0?qe.delta.increasing.color:qe.delta.decreasing.color};qe._deltaLastValue===void 0&&(qe._deltaLastValue=lt(de[0]));var wt=tt.select("text.delta");function vt(){wt.text(Xe(lt(de[0]),Ot)).call(m.fill,ut(de[0])).call(o.convertToTspans,Ve)}return wt.call(n.font,qe.delta.font).call(m.fill,ut({delta:qe._deltaLastValue})),v(Be)?wt.transition().duration(Be.duration).ease(Be.easing).tween("text",function(){var Lt=b.select(this),jt=lt(de[0]),rt=qe._deltaLastValue,et=At(qe.delta.valueformat,Ot,rt,jt),Et=e(rt,jt);return qe._deltaLastValue=jt,function(Bt){Lt.text(Xe(Et(Bt),et)),Lt.call(m.fill,ut({delta:Et(Bt)}))}}).each("end",function(){vt(),Ge&&Ge()}).each("interrupt",function(){vt(),Ge&&Ge()}):vt(),He=M(Xe(lt(de[0]),Ot),qe.delta.font,De,Ve),wt}(),Vt+=qe.delta.position+qe.delta.font.size+qe.delta.font.family+qe.delta.valueformat,Vt+=qe.delta.increasing.symbol+qe.delta.decreasing.symbol,Fe=He),qe._hasNumber&&(function(){var yt=T(Ve,{tickformat:qe.number.valueformat},qe._range);yt.setScale(),s.prepTicks(yt);var Ot=function(ut){return s.tickText(yt,ut).text},Pt=qe.number.suffix,at=qe.number.prefix,lt=tt.select("text.number");function Xe(){var ut=typeof de[0].y=="number"?at+Ot(de[0].y)+Pt:"-";lt.text(ut).call(n.font,qe.number.font).call(o.convertToTspans,Ve)}v(Be)?lt.transition().duration(Be.duration).ease(Be.easing).each("end",function(){Xe(),Ge&&Ge()}).each("interrupt",function(){Xe(),Ge&&Ge()}).attrTween("text",function(){var ut=b.select(this),wt=e(de[0].lastY,de[0].y);qe._lastValue=de[0].y;var vt=At(qe.number.valueformat,Ot,de[0].lastY,de[0].y);return function(Lt){ut.text(at+vt(wt(Lt))+Pt)}}):Xe(),ke=M(at+Ot(de[0].y)+Pt,qe.number.font,De,Ve)}(),Vt+=qe.number.font.size+qe.number.font.family+qe.number.valueformat+qe.number.suffix+qe.number.prefix,Fe=ke),qe._hasDelta&&qe._hasNumber){var Ht,Gt,st=[(ke.left+ke.right)/2,(ke.top+ke.bottom)/2],Qe=[(He.left+He.right)/2,(He.top+He.bottom)/2],pt=.75*qe.delta.font.size;qe.delta.position==="left"&&(Ht=f(qe,"deltaPos",0,-1*(ke.width*k[qe.align]+He.width*(1-k[qe.align])+pt),Vt,Math.min),Gt=st[1]-Qe[1],Fe={width:ke.width+He.width+pt,height:Math.max(ke.height,He.height),left:He.left+Ht,right:ke.right,top:Math.min(ke.top,He.top+Gt),bottom:Math.max(ke.bottom,He.bottom+Gt)}),qe.delta.position==="right"&&(Ht=f(qe,"deltaPos",0,ke.width*(1-k[qe.align])+He.width*k[qe.align]+pt,Vt,Math.max),Gt=st[1]-Qe[1],Fe={width:ke.width+He.width+pt,height:Math.max(ke.height,He.height),left:ke.left,right:He.right+Ht,top:Math.min(ke.top,He.top+Gt),bottom:Math.max(ke.bottom,He.bottom+Gt)}),qe.delta.position==="bottom"&&(Ht=null,Gt=He.height,Fe={width:Math.max(ke.width,He.width),height:ke.height+He.height,left:Math.min(ke.left,He.left),right:Math.max(ke.right,He.right),top:ke.bottom-ke.height,bottom:ke.bottom+He.height}),qe.delta.position==="top"&&(Ht=null,Gt=ke.top,Fe={width:Math.max(ke.width,He.width),height:ke.height+He.height,left:Math.min(ke.left,He.left),right:Math.max(ke.right,He.right),top:ke.bottom-ke.height-He.height,bottom:ke.bottom}),kt.attr({dx:Ht,dy:Gt})}(qe._hasNumber||qe._hasDelta)&&tt.attr("transform",function(){var yt=Me.numbersScaler(Fe);Vt+=yt[2];var Ot,Pt=f(qe,"numbersScale",1,yt[0],Vt,Math.min);qe._scaleNumbers||(Pt=1),Ot=qe._isAngular?Ye-Pt*Fe.bottom:Ye-Pt*(Fe.top+Fe.bottom)/2,qe._numbersTop=Pt*Fe.top+Ot;var at=Fe[_e];_e==="center"&&(at=(Fe.left+Fe.right)/2);var lt=$e-Pt*at;return lt=f(qe,"numbersTranslate",0,lt,Vt,Math.max),_(lt,Ot)+y(Pt)})})(E,ae,$,{numbersX:ee,numbersY:H,numbersScaler:J,transitionOpts:B,onComplete:V}),se&&(Q={range:K.gauge.axis.range,color:K.gauge.bgcolor,line:{color:K.gauge.bordercolor,width:0},thickness:1},Z={range:K.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:K.gauge.bordercolor,width:K.gauge.borderwidth},thickness:1});var Ce=ae.selectAll("g.angular").data(he?$:[]);Ce.exit().remove();var Le=ae.selectAll("g.angularaxis").data(he?$:[]);Le.exit().remove(),he&&function(Ve,Pe,de,Me){var ke,He,Fe,qe,$e=de[0].trace,Ye=Me.size,_e=Me.radius,De=Me.innerRadius,Be=Me.gaugeBg,Ge=Me.gaugeOutline,tt=[Ye.l+Ye.w/2,Ye.t+Ye.h/2+_e/2],nt=Me.gauge,ft=Me.layer,At=Me.transitionOpts,kt=Me.onComplete,Vt=Math.PI/2;function Ht(Bt){var Ft=$e.gauge.axis.range[0],St=(Bt-Ft)/($e.gauge.axis.range[1]-Ft)*Math.PI-Vt;return St<-Vt?-Vt:St>Vt?Vt:St}function Gt(Bt){return b.svg.arc().innerRadius((De+_e)/2-Bt/2*(_e-De)).outerRadius((De+_e)/2+Bt/2*(_e-De)).startAngle(-Vt)}function st(Bt){Bt.attr("d",function(Ft){return Gt(Ft.thickness).startAngle(Ht(Ft.range[0])).endAngle(Ht(Ft.range[1]))()})}nt.enter().append("g").classed("angular",!0),nt.attr("transform",_(tt[0],tt[1])),ft.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),ft.selectAll("g.xangularaxistick,path,text").remove(),(ke=T(Ve,$e.gauge.axis)).type="linear",ke.range=$e.gauge.axis.range,ke._id="xangularaxis",ke.ticklabeloverflow="allow",ke.setScale();var Qe=function(Bt){return(ke.range[0]-Bt.x)/(ke.range[1]-ke.range[0])*Math.PI+Math.PI},pt={},yt=s.makeLabelFns(ke,0).labelStandoff;pt.xFn=function(Bt){var Ft=Qe(Bt);return Math.cos(Ft)*yt},pt.yFn=function(Bt){var Ft=Qe(Bt),St=Math.sin(Ft)>0?.2:1;return-Math.sin(Ft)*(yt+Bt.fontSize*St)+Math.abs(Math.cos(Ft))*(Bt.fontSize*r)},pt.anchorFn=function(Bt){var Ft=Qe(Bt),St=Math.cos(Ft);return Math.abs(St)<.1?"middle":St>0?"start":"end"},pt.heightFn=function(Bt,Ft,St){var Jt=Qe(Bt);return-.5*(1+Math.sin(Jt))*St};var Ot=function(Bt){return _(tt[0]+_e*Math.cos(Bt),tt[1]-_e*Math.sin(Bt))};if(Fe=function(Bt){return Ot(Qe(Bt))},He=s.calcTicks(ke),qe=s.getTickSigns(ke)[2],ke.visible){qe=ke.ticks==="inside"?-1:1;var Pt=(ke.linewidth||1)/2;s.drawTicks(Ve,ke,{vals:He,layer:ft,path:"M"+qe*Pt+",0h"+qe*ke.ticklen,transFn:function(Bt){var Ft=Qe(Bt);return Ot(Ft)+"rotate("+-u(Ft)+")"}}),s.drawLabels(Ve,ke,{vals:He,layer:ft,transFn:Fe,labelFns:pt})}var at=[Be].concat($e.gauge.steps),lt=nt.selectAll("g.bg-arc").data(at);lt.enter().append("g").classed("bg-arc",!0).append("path"),lt.select("path").call(st).call(S),lt.exit().remove();var Xe=Gt($e.gauge.bar.thickness),ut=nt.selectAll("g.value-arc").data([$e.gauge.bar]);ut.enter().append("g").classed("value-arc",!0).append("path");var wt,vt,Lt,jt=ut.select("path");v(At)?(jt.transition().duration(At.duration).ease(At.easing).each("end",function(){kt&&kt()}).each("interrupt",function(){kt&&kt()}).attrTween("d",(wt=Xe,vt=Ht(de[0].lastY),Lt=Ht(de[0].y),function(){var Bt=d(vt,Lt);return function(Ft){return wt.endAngle(Bt(Ft))()}})),$e._lastValue=de[0].y):jt.attr("d",typeof de[0].y=="number"?Xe.endAngle(Ht(de[0].y)):"M0,0Z"),jt.call(S),ut.exit().remove(),at=[];var rt=$e.gauge.threshold.value;(rt||rt===0)&&at.push({range:[rt,rt],color:$e.gauge.threshold.color,line:{color:$e.gauge.threshold.line.color,width:$e.gauge.threshold.line.width},thickness:$e.gauge.threshold.thickness});var et=nt.selectAll("g.threshold-arc").data(at);et.enter().append("g").classed("threshold-arc",!0).append("path"),et.select("path").call(st).call(S),et.exit().remove();var Et=nt.selectAll("g.gauge-outline").data([Ge]);Et.enter().append("g").classed("gauge-outline",!0).append("path"),Et.select("path").call(st).call(S),Et.exit().remove()}(E,0,$,{radius:ye,innerRadius:me,gauge:Ce,layer:Le,size:oe,gaugeBg:Q,gaugeOutline:Z,transitionOpts:B,onComplete:V});var Oe=ae.selectAll("g.bullet").data(fe?$:[]);Oe.exit().remove();var We=ae.selectAll("g.bulletaxis").data(fe?$:[]);We.exit().remove(),fe&&function(Ve,Pe,de,Me){var ke,He,Fe,qe,$e,Ye=de[0].trace,_e=Me.gauge,De=Me.layer,Be=Me.gaugeBg,Ge=Me.gaugeOutline,tt=Me.size,nt=Ye.domain,ft=Me.transitionOpts,At=Me.onComplete;_e.enter().append("g").classed("bullet",!0),_e.attr("transform",_(tt.l,tt.t)),De.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),De.selectAll("g.xbulletaxistick,path,text").remove();var kt=tt.h,Vt=Ye.gauge.bar.thickness*kt,Ht=nt.x[0],Gt=nt.x[0]+(nt.x[1]-nt.x[0])*(Ye._hasNumber||Ye._hasDelta?1-l.bulletNumberDomainSize:1);function st(lt){lt.attr("width",function(Xe){return Math.max(0,ke.c2p(Xe.range[1])-ke.c2p(Xe.range[0]))}).attr("x",function(Xe){return ke.c2p(Xe.range[0])}).attr("y",function(Xe){return .5*(1-Xe.thickness)*kt}).attr("height",function(Xe){return Xe.thickness*kt})}(ke=T(Ve,Ye.gauge.axis))._id="xbulletaxis",ke.domain=[Ht,Gt],ke.setScale(),He=s.calcTicks(ke),Fe=s.makeTransTickFn(ke),qe=s.getTickSigns(ke)[2],$e=tt.t+tt.h,ke.visible&&(s.drawTicks(Ve,ke,{vals:ke.ticks==="inside"?s.clipEnds(ke,He):He,layer:De,path:s.makeTickPath(ke,$e,qe),transFn:Fe}),s.drawLabels(Ve,ke,{vals:He,layer:De,transFn:Fe,labelFns:s.makeLabelFns(ke,$e)}));var Qe=[Be].concat(Ye.gauge.steps),pt=_e.selectAll("g.bg-bullet").data(Qe);pt.enter().append("g").classed("bg-bullet",!0).append("rect"),pt.select("rect").call(st).call(S),pt.exit().remove();var yt=_e.selectAll("g.value-bullet").data([Ye.gauge.bar]);yt.enter().append("g").classed("value-bullet",!0).append("rect"),yt.select("rect").attr("height",Vt).attr("y",(kt-Vt)/2).call(S),v(ft)?yt.select("rect").transition().duration(ft.duration).ease(ft.easing).each("end",function(){At&&At()}).each("interrupt",function(){At&&At()}).attr("width",Math.max(0,ke.c2p(Math.min(Ye.gauge.axis.range[1],de[0].y)))):yt.select("rect").attr("width",typeof de[0].y=="number"?Math.max(0,ke.c2p(Math.min(Ye.gauge.axis.range[1],de[0].y))):0),yt.exit().remove();var Ot=de.filter(function(){return Ye.gauge.threshold.value||Ye.gauge.threshold.value===0}),Pt=_e.selectAll("g.threshold-bullet").data(Ot);Pt.enter().append("g").classed("threshold-bullet",!0).append("line"),Pt.select("line").attr("x1",ke.c2p(Ye.gauge.threshold.value)).attr("x2",ke.c2p(Ye.gauge.threshold.value)).attr("y1",(1-Ye.gauge.threshold.thickness)/2*kt).attr("y2",(1-(1-Ye.gauge.threshold.thickness)/2)*kt).call(m.stroke,Ye.gauge.threshold.line.color).style("stroke-width",Ye.gauge.threshold.line.width),Pt.exit().remove();var at=_e.selectAll("g.gauge-outline").data([Ge]);at.enter().append("g").classed("gauge-outline",!0).append("rect"),at.select("rect").call(st).call(S),at.exit().remove()}(E,0,$,{gauge:Oe,layer:We,size:oe,gaugeBg:Q,gaugeOutline:Z,transitionOpts:B,onComplete:V});var Ie=ae.selectAll("text.title").data($);Ie.exit().remove(),Ie.enter().append("text").classed("title",!0),Ie.attr("text-anchor",function(){return fe?g.right:g[K.title.align]}).text(K.title.text).call(n.font,K.title.font).call(o.convertToTspans,E),Ie.attr("transform",function(){var Ve,Pe=oe.l+oe.w*k[K.title.align],de=l.titlePadding,Me=n.bBox(Ie.node());return se?(he&&(Ve=K.gauge.axis.visible?n.bBox(Le.node()).top-de-Me.bottom:oe.t+oe.h/2-ye/2-Me.bottom-de),fe&&(Ve=H-(Me.top+Me.bottom)/2,Pe=oe.l-l.bulletPadding*oe.w)):Ve=K._numbersTop-de-Me.bottom,_(Pe,Ve)})})}},70252:function(D,L,t){var b=t(87163),d=t(80712).axisHoverFormat,e=t(3208).rb,w=t(42450),y=t(9829),_=t(93049).extendFlat,u=t(13582).overrideAll,r=D.exports=u(_({x:{valType:"data_array"},y:{valType:"data_array"},z:{valType:"data_array"},value:{valType:"data_array"},isomin:{valType:"number"},isomax:{valType:"number"},surface:{show:{valType:"boolean",dflt:!0},count:{valType:"integer",dflt:2,min:1},fill:{valType:"number",min:0,max:1,dflt:1},pattern:{valType:"flaglist",flags:["A","B","C","D","E"],extras:["all","odd","even"],dflt:"all"}},spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:.15}},slices:{x:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!1},locations:{valType:"data_array",dflt:[]},fill:{valType:"number",min:0,max:1,dflt:1}}},caps:{x:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},y:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}},z:{show:{valType:"boolean",dflt:!0},fill:{valType:"number",min:0,max:1,dflt:1}}},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:e(),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),valuehoverformat:d("value",1),showlegend:_({},y.showlegend,{dflt:!1})},b("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:w.opacity,lightposition:w.lightposition,lighting:w.lighting,flatshading:w.flatshading,contour:w.contour,hoverinfo:_({},y.hoverinfo)}),"calc","nested");r.flatshading.dflt=!0,r.lighting.facenormalsepsilon.dflt=0,r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes",r.transforms=void 0},58988:function(D,L,t){var b=t(28379),d=t(36402).processGrid,e=t(36402).filter;D.exports=function(w,y){y._len=Math.min(y.x.length,y.y.length,y.z.length,y.value.length),y._x=e(y.x,y._len),y._y=e(y.y,y._len),y._z=e(y.z,y._len),y._value=e(y.value,y._len);var _=d(y);y._gridFill=_.fill,y._Xs=_.Xs,y._Ys=_.Ys,y._Zs=_.Zs,y._len=_.len;for(var u=1/0,r=-1/0,n=0;n0;h--){var x=Math.min(c[h],c[h-1]),m=Math.max(c[h],c[h-1]);if(m>x&&x-1}function ge(De,Be){return De===null?Be:De}function ye(De,Be,Ge){se();var tt,nt,ft,At=[Be],kt=[Ge];if(A>=1)At=[Be],kt=[Ge];else if(A>0){var Vt=function(at,lt){var Xe=at[0],ut=at[1],wt=at[2],vt=function(St,Jt,qt){for(var en=[],Wt=0;Wt-1?Ge[st]:ae(Qe,pt,yt);Gt[st]=Pt>-1?Pt:fe(Qe,pt,yt,ge(De,Ot))}tt=Gt[0],nt=Gt[1],ft=Gt[2],s._meshI.push(tt),s._meshJ.push(nt),s._meshK.push(ft),++E}}function me(De,Be,Ge,tt){var nt=De[3];nttt&&(nt=tt);for(var ft=(De[3]-nt)/(De[3]-Be[3]+1e-9),At=[],kt=0;kt<4;kt++)At[kt]=(1-ft)*De[kt]+ft*Be[kt];return At}function be(De,Be,Ge){return De>=Be&&De<=Ge}function Se(De){var Be=.001*(K-Z);return De>=Z-Be&&De<=K+Be}function Ee(De){for(var Be=[],Ge=0;Ge<4;Ge++){var tt=De[Ge];Be.push([s._x[tt],s._y[tt],s._z[tt],s._value[tt]])}return Be}var Ce=3;function Le(De,Be,Ge,tt,nt,ft){ft||(ft=1),Ge=[-1,-1,-1];var At=!1,kt=[be(Be[0][3],tt,nt),be(Be[1][3],tt,nt),be(Be[2][3],tt,nt)];if(!kt[0]&&!kt[1]&&!kt[2])return!1;var Vt=function(Gt,st,Qe){return Se(st[0][3])&&Se(st[1][3])&&Se(st[2][3])?(ye(Gt,st,Qe),!0):ftMath.abs(ft-Q)?[J,ft]:[ft,Q];M=!0,Fe(Be,At[0],At[1]),M=!1}}var kt=[[Math.min(Z,Q),Math.max(Z,Q)],[Math.min(J,K),Math.max(J,K)]];["x","y","z"].forEach(function(Vt){for(var Ht=[],Gt=0;Gt0&&(Pt.push(Xe.id),Vt==="x"?at.push([Xe.distRatio,0,0]):Vt==="y"?at.push([0,Xe.distRatio,0]):at.push([0,0,Xe.distRatio]))}else Ot=_e(1,Vt==="x"?V-1:Vt==="y"?j-1:$-1);Pt.length>0&&(Ht[st]=Vt==="x"?qe(De,Pt,Qe,pt,at,Ht[st]):Vt==="y"?$e(De,Pt,Qe,pt,at,Ht[st]):Ye(De,Pt,Qe,pt,at,Ht[st]),st++),Ot.length>0&&(Ht[st]=Vt==="x"?Me(De,Ot,Qe,pt,Ht[st]):Vt==="y"?ke(De,Ot,Qe,pt,Ht[st]):He(De,Ot,Qe,pt,Ht[st]),st++)}var ut=s.caps[Vt];ut.show&&ut.fill&&(oe(ut.fill),Ht[st]=Vt==="x"?Me(De,[0,V-1],Qe,pt,Ht[st]):Vt==="y"?ke(De,[0,j-1],Qe,pt,Ht[st]):He(De,[0,$-1],Qe,pt,Ht[st]),st++)}}),E===0&&he(),s._meshX=x,s._meshY=m,s._meshZ=g,s._meshIntensity=k,s._Xs=I,s._Ys=B,s._Zs=N}(),s}D.exports={findNearestOnAxis:u,generateIsoMeshes:o,createIsosurfaceTrace:function(s,c){var h=s.glplot.gl,x=b({gl:h}),m=new r(s,x,c.uid);return x._trace=m,m.update(c),s.glplot.add(x),m}}},44731:function(D,L,t){var b=t(34809),d=t(33626),e=t(70252),w=t(39356);function y(_,u,r,n,l){var o=l("isomin"),s=l("isomax");s!=null&&o!=null&&o>s&&(u.isomin=null,u.isomax=null);var c=l("x"),h=l("y"),x=l("z"),m=l("value");c&&c.length&&h&&h.length&&x&&x.length&&m&&m.length?(d.getComponentMethod("calendars","handleTraceDefaults")(_,u,["x","y","z"],n),l("valuehoverformat"),["x","y","z"].forEach(function(g){l(g+"hoverformat");var k="caps."+g;l(k+".show")&&l(k+".fill");var A="slices."+g;l(A+".show")&&(l(A+".fill"),l(A+".locations"))}),l("spaceframe.show")&&l("spaceframe.fill"),l("surface.show")&&(l("surface.count"),l("surface.fill"),l("surface.pattern")),l("contour.show")&&(l("contour.color"),l("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(g){l(g)}),w(_,u,n,l,{prefix:"",cLetter:"c"}),u._length=null):u.visible=!1}D.exports={supplyDefaults:function(_,u,r,n){y(_,u,0,n,function(l,o){return b.coerce(_,u,e,l,o)})},supplyIsoDefaults:y}},75297:function(D,L,t){D.exports={attributes:t(70252),supplyDefaults:t(44731).supplyDefaults,calc:t(58988),colorbar:{min:"cmin",max:"cmax"},plot:t(91370).createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:t(2487),categories:["gl3d","showLegend"],meta:{}}},42450:function(D,L,t){var b=t(87163),d=t(80712).axisHoverFormat,e=t(3208).rb,w=t(16131),y=t(9829),_=t(93049).extendFlat;D.exports=_({x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},i:{valType:"data_array",editType:"calc"},j:{valType:"data_array",editType:"calc"},k:{valType:"data_array",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:e({editType:"calc"}),xhoverformat:d("x"),yhoverformat:d("y"),zhoverformat:d("z"),delaunayaxis:{valType:"enumerated",values:["x","y","z"],dflt:"z",editType:"calc"},alphahull:{valType:"number",dflt:-1,editType:"calc"},intensity:{valType:"data_array",editType:"calc"},intensitymode:{valType:"enumerated",values:["vertex","cell"],dflt:"vertex",editType:"calc"},color:{valType:"color",editType:"calc"},vertexcolor:{valType:"data_array",editType:"calc"},facecolor:{valType:"data_array",editType:"calc"},transforms:void 0},b("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:w.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:_({},w.contours.x.show,{}),color:w.contours.x.color,width:w.contours.x.width,editType:"calc"},lightposition:{x:_({},w.lightposition.x,{dflt:1e5}),y:_({},w.lightposition.y,{dflt:1e5}),z:_({},w.lightposition.z,{dflt:0}),editType:"calc"},lighting:_({vertexnormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-12,editType:"calc"},facenormalsepsilon:{valType:"number",min:0,max:1,dflt:1e-6,editType:"calc"},editType:"calc"},w.lighting),hoverinfo:_({},y.hoverinfo,{editType:"calc"}),showlegend:_({},y.showlegend,{dflt:!1})})},44878:function(D,L,t){var b=t(28379);D.exports=function(d,e){e.intensity&&b(d,e,{vals:e.intensity,containerStr:"",cLetter:"c"})}},82836:function(D,L,t){var b=t(99098).gl_mesh3d,d=t(99098).delaunay_triangulate,e=t(99098).alpha_shape,w=t(99098).convex_hull,y=t(46998).parseColorScale,_=t(34809).isArrayOrTypedArray,u=t(55010),r=t(88856).extractOpts,n=t(88239);function l(m,g,k){this.scene=m,this.uid=k,this.mesh=g,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var o=l.prototype;function s(m){for(var g=[],k=m.length,A=0;A=g-.5)return!1;return!0}o.handlePick=function(m){if(m.object===this.mesh){var g=m.index=m.data.index;m.data._cellCenter?m.traceCoordinate=m.data.dataCoordinate:m.traceCoordinate=[this.data.x[g],this.data.y[g],this.data.z[g]];var k=this.data.hovertext||this.data.text;return _(k)&&k[g]!==void 0?m.textLabel=k[g]:k&&(m.textLabel=k),!0}},o.update=function(m){var g=this.scene,k=g.fullSceneLayout;this.data=m;var A,v=m.x.length,S=n(c(k.xaxis,m.x,g.dataScale[0],m.xcalendar),c(k.yaxis,m.y,g.dataScale[1],m.ycalendar),c(k.zaxis,m.z,g.dataScale[2],m.zcalendar));if(m.i&&m.j&&m.k){if(m.i.length!==m.j.length||m.j.length!==m.k.length||!x(m.i,v)||!x(m.j,v)||!x(m.k,v))return;A=n(h(m.i),h(m.j),h(m.k))}else A=m.alphahull===0?w(S):m.alphahull>0?e(m.alphahull,S):function(f,E){for(var I=["x","y","z"].indexOf(f),B=[],N=E.length,V=0;VS):v=N>E,S=N;var V=c(E,I,B,N);V.pos=f,V.yc=(E+N)/2,V.i=M,V.dir=v?"increasing":"decreasing",V.x=V.pos,V.y=[B,I],T&&(V.orig_p=l[M]),k&&(V.tx=n.text[M]),A&&(V.htx=n.hovertext[M]),p.push(V)}else p.push({pos:f,empty:!0})}return n._extremes[s._id]=e.findExtremes(s,b.concat(m,x),{padded:!0}),p.length&&(p[0].t={labels:{open:d(r,"open:")+" ",high:d(r,"high:")+" ",low:d(r,"low:")+" ",close:d(r,"close:")+" "}}),p}D.exports={calc:function(r,n){var l=e.getFromId(r,n.xaxis),o=e.getFromId(r,n.yaxis),s=function(g,k,A){var v=A._minDiff;if(!v){var S,T=g._fullData,p=[];for(v=1/0,S=0;S"+k.labels[I]+b.hoverLabelText(m,B,g.yhoverformat):((E=d.extendFlat({},v)).y0=E.y1=N,E.yLabelVal=B,E.yLabel=k.labels[I]+b.hoverLabelText(m,B,g.yhoverformat),E.name="",A.push(E),M[B]=E)}return A}function l(o,s,c,h){var x=o.cd,m=o.ya,g=x[0].trace,k=x[0].t,A=r(o,s,c,h);if(!A)return[];var v=x[A.index],S=A.index=v.i,T=v.dir;function p(V){return k.labels[V]+b.hoverLabelText(m,g[V][S],g.yhoverformat)}var M=v.hi||g.hoverinfo,f=M.split("+"),E=M==="all",I=E||f.indexOf("y")!==-1,B=E||f.indexOf("text")!==-1,N=I?[p("open"),p("high"),p("low"),p("close")+" "+u[T]]:[];return B&&y(v,g,N),A.extraText=N.join("
"),A.y0=A.y1=m.c2p(v.yc,!0),[A]}D.exports={hoverPoints:function(o,s,c,h){return o.cd[0].trace.hoverlabel.split?n(o,s,c,h):l(o,s,c,h)},hoverSplit:n,hoverOnPoints:l}},12683:function(D,L,t){D.exports={moduleType:"trace",name:"ohlc",basePlotModule:t(37703),categories:["cartesian","svg","showLegend"],meta:{},attributes:t(86706),supplyDefaults:t(22629),calc:t(95694).calc,plot:t(38956),style:t(57406),hoverPoints:t(93245).hoverPoints,selectPoints:t(49343)}},28270:function(D,L,t){var b=t(33626),d=t(34809);D.exports=function(e,w,y,_){var u=y("x"),r=y("open"),n=y("high"),l=y("low"),o=y("close");if(y("hoverlabel.split"),b.getComponentMethod("calendars","handleTraceDefaults")(e,w,["x"],_),r&&n&&l&&o){var s=Math.min(r.length,n.length,l.length,o.length);return u&&(s=Math.min(s,d.minRowLength(u))),w._length=s,s}}},38956:function(D,L,t){var b=t(45568),d=t(34809);D.exports=function(e,w,y,_){var u=w.yaxis,r=w.xaxis,n=!!r.rangebreaks;d.makeTraceGroups(_,y,"trace ohlc").each(function(l){var o=b.select(this),s=l[0],c=s.t;if(s.trace.visible!==!0||c.empty)o.remove();else{var h=c.tickLen,x=o.selectAll("path").data(d.identity);x.enter().append("path"),x.exit().remove(),x.attr("d",function(m){if(m.empty)return"M0,0Z";var g=r.c2p(m.pos-h,!0),k=r.c2p(m.pos+h,!0),A=n?(g+k)/2:r.c2p(m.pos,!0);return"M"+g+","+u.c2p(m.o,!0)+"H"+A+"M"+A+","+u.c2p(m.h,!0)+"V"+u.c2p(m.l,!0)+"M"+k+","+u.c2p(m.c,!0)+"H"+A})}})}},49343:function(D){D.exports=function(L,t){var b,d=L.cd,e=L.xaxis,w=L.yaxis,y=[],_=d[0].t.bPos||0;if(t===!1)for(b=0;b=he.length||fe[he[ie]]!==void 0)return!1;fe[he[ie]]=!0}return!0}(se))for(ae=0;ae0||r(m);g&&(x="array");var k=s("categoryorder",x);k==="array"?(s("categoryarray"),s("ticktext")):(delete l.categoryarray,delete l.ticktext),g||k!=="array"||(o.categoryorder="trace")}}D.exports=function(l,o,s,c){function h(k,A){return b.coerce(l,o,_,k,A)}var x=y(l,o,{name:"dimensions",handleItemDefaults:n}),m=function(k,A,v,S,T){T("line.shape"),T("line.hovertemplate");var p=T("line.color",S.colorway[0]);if(d(k,"line")&&b.isArrayOrTypedArray(p)){if(p.length)return T("line.colorscale"),e(k,A,S,T,{prefix:"line.",cLetter:"c"}),p.length;A.line.color=v}return 1/0}(l,o,s,c,h);w(o,c,h),Array.isArray(x)&&x.length||(o.visible=!1),u(o,x,"values",m),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var g=c.font;b.coerceFont(h,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),b.coerceFont(h,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}},6305:function(D,L,t){D.exports={attributes:t(11660),supplyDefaults:t(62651),calc:t(95564),plot:t(37822),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:t(83260),categories:["noOpacity"],meta:{}}},27219:function(D,L,t){var b=t(45568),d=t(88640).Dj,e=t(31420),w=t(32141),y=t(34809),_=y.strTranslate,u=t(62203),r=t(65657),n=t(30635);function l(se,he,fe,ie){var oe=he._context.staticPlot,le=se.map(J.bind(0,he,fe)),ge=ie.selectAll("g.parcatslayer").data([null]);ge.enter().append("g").attr("class","parcatslayer").style("pointer-events",oe?"none":"all");var ye=ge.selectAll("g.trace.parcats").data(le,o),me=ye.enter().append("g").attr("class","trace parcats");ye.attr("transform",function(Ie){return _(Ie.x,Ie.y)}),me.append("g").attr("class","paths");var be=ye.select("g.paths").selectAll("path.path").data(function(Ie){return Ie.paths},o);be.attr("fill",function(Ie){return Ie.model.color});var Se=be.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Ie){return Ie.model.color}).attr("fill-opacity",0);A(Se),be.attr("d",function(Ie){return Ie.svgD}),Se.empty()||be.sort(c),be.exit().remove(),be.on("mouseover",h).on("mouseout",x).on("click",k),me.append("g").attr("class","dimensions");var Ee=ye.select("g.dimensions").selectAll("g.dimension").data(function(Ie){return Ie.dimensions},o);Ee.enter().append("g").attr("class","dimension"),Ee.attr("transform",function(Ie){return _(Ie.x,0)}),Ee.exit().remove();var Ce=Ee.selectAll("g.category").data(function(Ie){return Ie.categories},o),Le=Ce.enter().append("g").attr("class","category");Ce.attr("transform",function(Ie){return _(0,Ie.y)}),Le.append("rect").attr("class","catrect").attr("pointer-events","none"),Ce.select("rect.catrect").attr("fill","none").attr("width",function(Ie){return Ie.width}).attr("height",function(Ie){return Ie.height}),S(Le);var Oe=Ce.selectAll("rect.bandrect").data(function(Ie){return Ie.bands},o);Oe.each(function(){y.raiseToTop(this)}),Oe.attr("fill",function(Ie){return Ie.color});var We=Oe.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Ie){return Ie.color}).attr("fill-opacity",0);Oe.attr("fill",function(Ie){return Ie.color}).attr("width",function(Ie){return Ie.width}).attr("height",function(Ie){return Ie.height}).attr("y",function(Ie){return Ie.y}).attr("cursor",function(Ie){return Ie.parcatsViewModel.arrangement==="fixed"?"default":Ie.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),T(We),Oe.exit().remove(),Le.append("text").attr("class","catlabel").attr("pointer-events","none"),Ce.select("text.catlabel").attr("text-anchor",function(Ie){return s(Ie)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Ie){return s(Ie)?Ie.width+5:-5}).attr("y",function(Ie){return Ie.height/2}).text(function(Ie){return Ie.model.categoryLabel}).each(function(Ie){u.font(b.select(this),Ie.parcatsViewModel.categorylabelfont),n.convertToTspans(b.select(this),he)}),Le.append("text").attr("class","dimlabel"),Ce.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Ie){return Ie.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Ie){return Ie.width/2}).attr("y",-5).text(function(Ie,Ve){return Ve===0?Ie.parcatsViewModel.model.dimensions[Ie.model.dimensionInd].dimensionLabel:null}).each(function(Ie){u.font(b.select(this),Ie.parcatsViewModel.labelfont)}),Ce.selectAll("rect.bandrect").on("mouseover",I).on("mouseout",B),Ce.exit().remove(),Ee.call(b.behavior.drag().origin(function(Ie){return{x:Ie.x,y:0}}).on("dragstart",N).on("drag",V).on("dragend",j)),ye.each(function(Ie){Ie.traceSelection=b.select(this),Ie.pathSelection=b.select(this).selectAll("g.paths").selectAll("path.path"),Ie.dimensionSelection=b.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),ye.exit().remove()}function o(se){return se.key}function s(se){var he=se.parcatsViewModel.dimensions.length,fe=se.parcatsViewModel.dimensions[he-1].model.dimensionInd;return se.model.dimensionInd===fe}function c(se,he){return se.model.rawColor>he.model.rawColor?1:se.model.rawColor"),He=b.mouse(ye)[0];w.loneHover({trace:me,x:Oe-Se.left+Ee.left,y:We-Se.top+Ee.top,text:ke,color:se.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Ie,idealAlign:He1&&Ee.displayInd===Se.dimensions.length-1?(ie=me.left,oe="left"):(ie=me.left+me.width,oe="right");var Oe=be.model.count,We=be.model.categoryLabel,Ie=Oe/be.parcatsViewModel.model.count,Ve={countLabel:Oe,categoryLabel:We,probabilityLabel:Ie.toFixed(3)},Pe=[];be.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Pe.push(["Count:",Ve.countLabel].join(" ")),be.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Pe.push(["P("+Ve.categoryLabel+"):",Ve.probabilityLabel].join(" "));var de=Pe.join("
");return{trace:Ce,x:le*(ie-he.left),y:ge*(Le-he.top),text:de,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:oe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:Ve,eventData:[{data:Ce._input,fullData:Ce,count:Oe,category:We,probability:Ie}]}}function I(se){if(!se.parcatsViewModel.dragDimension&&se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){if(b.mouse(this)[1]<-1)return;var he,fe=se.parcatsViewModel.graphDiv,ie=fe._fullLayout,oe=ie._paperdiv.node().getBoundingClientRect(),le=se.parcatsViewModel.hoveron,ge=this;le==="color"?(function(ye){var me=b.select(ye).datum(),be=p(me);v(be),be.each(function(){y.raiseToTop(this)}),b.select(ye.parentNode).selectAll("rect.bandrect").filter(function(Se){return Se.color===me.color}).each(function(){y.raiseToTop(this),b.select(this).attr("stroke","black").attr("stroke-width",1.5)})}(ge),f(ge,"plotly_hover",b.event)):(function(ye){b.select(ye.parentNode).selectAll("rect.bandrect").each(function(me){var be=p(me);v(be),be.each(function(){y.raiseToTop(this)})}),b.select(ye.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(ge),M(ge,"plotly_hover",b.event)),se.parcatsViewModel.hoverinfoItems.indexOf("none")===-1&&(le==="category"?he=E(fe,oe,ge):le==="color"?he=function(ye,me,be){ye._fullLayout._calcInverseTransform(ye);var Se,Ee,Ce=ye._fullLayout._invScaleX,Le=ye._fullLayout._invScaleY,Oe=be.getBoundingClientRect(),We=b.select(be).datum(),Ie=We.categoryViewModel,Ve=Ie.parcatsViewModel,Pe=Ve.model.dimensions[Ie.model.dimensionInd],de=Ve.trace,Me=Oe.y+Oe.height/2;Ve.dimensions.length>1&&Pe.displayInd===Ve.dimensions.length-1?(Se=Oe.left,Ee="left"):(Se=Oe.left+Oe.width,Ee="right");var ke=Ie.model.categoryLabel,He=We.parcatsViewModel.model.count,Fe=0;We.categoryViewModel.bands.forEach(function(ft){ft.color===We.color&&(Fe+=ft.count)});var qe=Ie.model.count,$e=0;Ve.pathSelection.each(function(ft){ft.model.color===We.color&&($e+=ft.model.count)});var Ye=Fe/He,_e=Fe/$e,De=Fe/qe,Be={countLabel:Fe,categoryLabel:ke,probabilityLabel:Ye.toFixed(3)},Ge=[];Ie.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ge.push(["Count:",Be.countLabel].join(" ")),Ie.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(Ge.push("P(color ∩ "+ke+"): "+Be.probabilityLabel),Ge.push("P("+ke+" | color): "+_e.toFixed(3)),Ge.push("P(color | "+ke+"): "+De.toFixed(3)));var tt=Ge.join("
"),nt=r.mostReadable(We.color,["black","white"]);return{trace:de,x:Ce*(Se-me.left),y:Le*(Me-me.top),text:tt,color:We.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:nt,fontSize:10,idealAlign:Ee,hovertemplate:de.hovertemplate,hovertemplateLabels:Be,eventData:[{data:de._input,fullData:de,category:ke,count:He,probability:Ye,categorycount:qe,colorcount:$e,bandcolorcount:Fe}]}}(fe,oe,ge):le==="dimension"&&(he=function(ye,me,be){var Se=[];return b.select(be.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){Se.push(E(ye,me,this))}),Se}(fe,oe,ge)),he&&w.loneHover(he,{container:ie._hoverlayer.node(),outerContainer:ie._paper.node(),gd:fe}))}}function B(se){var he=se.parcatsViewModel;he.dragDimension||(A(he.pathSelection),S(he.dimensionSelection.selectAll("g.category")),T(he.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),w.loneUnhover(he.graphDiv._fullLayout._hoverlayer.node()),he.pathSelection.sort(c),he.hoverinfoItems.indexOf("skip")!==-1)||(se.parcatsViewModel.hoveron==="color"?f(this,"plotly_unhover",b.event):M(this,"plotly_unhover",b.event))}function N(se){se.parcatsViewModel.arrangement!=="fixed"&&(se.dragDimensionDisplayInd=se.model.displayInd,se.initialDragDimensionDisplayInds=se.parcatsViewModel.model.dimensions.map(function(he){return he.displayInd}),se.dragHasMoved=!1,se.dragCategoryDisplayInd=null,b.select(this).selectAll("g.category").select("rect.catrect").each(function(he){var fe=b.mouse(this)[0],ie=b.mouse(this)[1];-2<=fe&&fe<=he.width+2&&-2<=ie&&ie<=he.height+2&&(se.dragCategoryDisplayInd=he.model.displayInd,se.initialDragCategoryDisplayInds=se.model.categories.map(function(oe){return oe.displayInd}),he.model.dragY=he.y,y.raiseToTop(this.parentNode),b.select(this.parentNode).selectAll("rect.bandrect").each(function(oe){oe.ySe.y+Se.height/2&&(le.model.displayInd=Se.model.displayInd,Se.model.displayInd=ye),se.dragCategoryDisplayInd=le.model.displayInd}if(se.dragCategoryDisplayInd===null||se.parcatsViewModel.arrangement==="freeform"){oe.model.dragX=b.event.x;var Ee=se.parcatsViewModel.dimensions[fe],Ce=se.parcatsViewModel.dimensions[ie];Ee!==void 0&&oe.model.dragXCe.x&&(oe.model.displayInd=Ce.model.displayInd,Ce.model.displayInd=se.dragDimensionDisplayInd),se.dragDimensionDisplayInd=oe.model.displayInd}K(se.parcatsViewModel),Z(se.parcatsViewModel),H(se.parcatsViewModel),ee(se.parcatsViewModel)}}function j(se){if(se.parcatsViewModel.arrangement!=="fixed"&&se.dragDimensionDisplayInd!==null){b.select(this).selectAll("text").attr("font-weight","normal");var he={},fe=$(se.parcatsViewModel),ie=se.parcatsViewModel.model.dimensions.map(function(Se){return Se.displayInd}),oe=se.initialDragDimensionDisplayInds.some(function(Se,Ee){return Se!==ie[Ee]});oe&&ie.forEach(function(Se,Ee){var Ce=se.parcatsViewModel.model.dimensions[Ee].containerInd;he["dimensions["+Ce+"].displayindex"]=Se});var le=!1;if(se.dragCategoryDisplayInd!==null){var ge=se.model.categories.map(function(Se){return Se.displayInd});if(le=se.initialDragCategoryDisplayInds.some(function(Se,Ee){return Se!==ge[Ee]})){var ye=se.model.categories.slice().sort(function(Se,Ee){return Se.displayInd-Ee.displayInd}),me=ye.map(function(Se){return Se.categoryValue}),be=ye.map(function(Se){return Se.categoryLabel});he["dimensions["+se.model.containerInd+"].categoryarray"]=[me],he["dimensions["+se.model.containerInd+"].ticktext"]=[be],he["dimensions["+se.model.containerInd+"].categoryorder"]="array"}}se.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!se.dragHasMoved&&se.potentialClickBand&&(se.parcatsViewModel.hoveron==="color"?f(se.potentialClickBand,"plotly_click",b.event.sourceEvent):M(se.potentialClickBand,"plotly_click",b.event.sourceEvent)),se.model.dragX=null,se.dragCategoryDisplayInd!==null&&(se.parcatsViewModel.dimensions[se.dragDimensionDisplayInd].categories[se.dragCategoryDisplayInd].model.dragY=null,se.dragCategoryDisplayInd=null),se.dragDimensionDisplayInd=null,se.parcatsViewModel.dragDimension=null,se.dragHasMoved=null,se.potentialClickBand=null,K(se.parcatsViewModel),Z(se.parcatsViewModel),b.transition().duration(300).ease("cubic-in-out").each(function(){H(se.parcatsViewModel,!0),ee(se.parcatsViewModel,!0)}).each("end",function(){(oe||le)&&e.restyle(se.parcatsViewModel.graphDiv,he,[fe])})}}function $(se){for(var he,fe=se.graphDiv._fullData,ie=0;ie=0;ge--)be+="C"+me[ge]+","+(he[ge+1]+ie)+" "+ye[ge]+","+(he[ge]+ie)+" "+(se[ge]+fe[ge])+","+(he[ge]+ie),be+="l-"+fe[ge]+",0 ";return be+"Z"}function Z(se){var he=se.dimensions,fe=se.model,ie=he.map(function(Be){return Be.categories.map(function(Ge){return Ge.y})}),oe=se.model.dimensions.map(function(Be){return Be.categories.map(function(Ge){return Ge.displayInd})}),le=se.model.dimensions.map(function(Be){return Be.displayInd}),ge=se.dimensions.map(function(Be){return Be.model.dimensionInd}),ye=he.map(function(Be){return Be.x}),me=he.map(function(Be){return Be.width}),be=[];for(var Se in fe.paths)fe.paths.hasOwnProperty(Se)&&be.push(fe.paths[Se]);function Ee(Be){var Ge=Be.categoryInds.map(function(tt,nt){return oe[nt][tt]});return ge.map(function(tt){return Ge[tt]})}be.sort(function(Be,Ge){var tt=Ee(Be),nt=Ee(Ge);return se.sortpaths==="backward"&&(tt.reverse(),nt.reverse()),tt.push(Be.valueInds[0]),nt.push(Ge.valueInds[0]),se.bundlecolors&&(tt.unshift(Be.rawColor),nt.unshift(Ge.rawColor)),ttnt?1:0});for(var Ce=new Array(be.length),Le=he[0].model.count,Oe=he[0].categories.map(function(Be){return Be.height}).reduce(function(Be,Ge){return Be+Ge}),We=0;We0?Oe*(Ve.count/Le):0;for(var Pe,de=new Array(ie.length),Me=0;Me1?(se.width-80-16)/(ie-1):0)*oe;var le,ge,ye,me,be,Se=[],Ee=se.model.maxCats,Ce=he.categories.length,Le=he.count,Oe=se.height-8*(Ee-1),We=8*(Ee-Ce)/2,Ie=he.categories.map(function(Ve){return{displayInd:Ve.displayInd,categoryInd:Ve.categoryInd}});for(Ie.sort(function(Ve,Pe){return Ve.displayInd-Pe.displayInd}),be=0;be0?ge.count/Le*Oe:0,ye={key:ge.valueInds[0],model:ge,width:16,height:le,y:ge.dragY!==null?ge.dragY:We,bands:[],parcatsViewModel:se},We=We+le+8,Se.push(ye);return{key:he.dimensionInd,x:he.dragX!==null?he.dragX:fe,y:0,width:16,model:he,categories:Se,parcatsViewModel:se,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}D.exports=function(se,he,fe,ie){l(fe,se,ie,he)}},37822:function(D,L,t){var b=t(27219);D.exports=function(d,e,w,y){var _=d._fullLayout,u=_._paper,r=_._size;b(d,u,e,{width:r.w,height:r.h,margin:{t:r.t,r:r.r,b:r.b,l:r.l}},w,y)}},59549:function(D,L,t){var b=t(87163),d=t(25829),e=t(80337),w=t(13792).u,y=t(93049).extendFlat,_=t(78032).templatedArray;D.exports={domain:w({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:e({editType:"plot"}),tickfont:e({autoShadowDflt:!0,editType:"plot"}),rangefont:e({editType:"plot"}),dimensions:_("dimension",{label:{valType:"string",editType:"plot"},tickvals:y({},d.tickvals,{editType:"plot"}),ticktext:y({},d.ticktext,{editType:"plot"}),tickformat:y({},d.tickformat,{editType:"plot"}),visible:{valType:"boolean",dflt:!0,editType:"plot"},range:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},constraintrange:{valType:"info_array",freeLength:!0,dimensions:"1-2",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},multiselect:{valType:"boolean",dflt:!0,editType:"plot"},values:{valType:"data_array",editType:"calc"},editType:"calc"}),line:y({editType:"calc"},b("line",{colorscaleDflt:"Viridis",autoColorDflt:!1,editTypeOverride:"calc"})),unselected:{line:{color:{valType:"color",dflt:"#7f7f7f",editType:"plot"},opacity:{valType:"number",min:0,max:1,dflt:"auto",editType:"plot"},editType:"plot"},editType:"plot"}}},23245:function(D,L,t){var b=t(77911),d=t(45568),e=t(71293).keyFun,w=t(71293).repeat,y=t(34809).sorterAsc,_=t(34809).strTranslate,u=b.bar.snapRatio;function r(E,I){return E*(1-u)+I*u}var n=b.bar.snapClose;function l(E,I){return E*(1-n)+I*n}function o(E,I,B,N){if(function(ae,se){for(var he=0;he=se[he][0]&&ae<=se[he][1])return!0;return!1}(B,N))return B;var V=E?-1:1,j=0,$=I.length-1;if(V<0){var ee=j;j=$,$=ee}for(var H=I[j],J=H,Q=j;V*QI){Z=B;break}}if(V=J,isNaN(V)&&(V=isNaN(Q)||isNaN(Z)?isNaN(Q)?Z:Q:I-H[Q][1]oe[1]+ge||le=.9*oe[1]+.1*oe[0]?"n":le<=.9*oe[0]+.1*oe[1]?"s":"ns"}(ae,I);se&&(j.interval=ee[V],j.intervalPix=ae,j.region=se)}}if(E.ordinal&&!j.region){var he=E.unitTickvals,fe=E.unitToPaddedPx.invert(I);for(B=0;B=ie[0]&&fe<=ie[1]){j.clickableOrdinalRange=ie;break}}}return j}function v(E,I){d.event.sourceEvent.stopPropagation();var B=I.height-d.mouse(E)[1]-2*b.verticalPadding,N=I.brush.svgBrush;N.wasDragged=!0,N._dragging=!0,N.grabbingBar?N.newExtent=[B-N.grabPoint,B+N.barLength-N.grabPoint].map(I.unitToPaddedPx.invert):N.newExtent=[N.startExtent,I.unitToPaddedPx.invert(B)].sort(y),I.brush.filterSpecified=!0,N.extent=N.stayingIntervals.concat([N.newExtent]),N.brushCallback(I),k(E.parentNode)}function S(E,I){var B=A(I,I.height-d.mouse(E)[1]-2*b.verticalPadding),N="crosshair";B.clickableOrdinalRange?N="pointer":B.region&&(N=B.region+"-resize"),d.select(document.body).style("cursor",N)}function T(E){E.on("mousemove",function(I){d.event.preventDefault(),I.parent.inBrushDrag||S(this,I)}).on("mouseleave",function(I){I.parent.inBrushDrag||m()}).call(d.behavior.drag().on("dragstart",function(I){(function(B,N){d.event.sourceEvent.stopPropagation();var V=N.height-d.mouse(B)[1]-2*b.verticalPadding,j=N.unitToPaddedPx.invert(V),$=N.brush,ee=A(N,V),H=ee.interval,J=$.svgBrush;if(J.wasDragged=!1,J.grabbingBar=ee.region==="ns",J.grabbingBar){var Q=H.map(N.unitToPaddedPx);J.grabPoint=V-Q[0]-b.verticalPadding,J.barLength=Q[1]-Q[0]}J.clickableOrdinalRange=ee.clickableOrdinalRange,J.stayingIntervals=N.multiselect&&$.filterSpecified?$.filter.getConsolidated():[],H&&(J.stayingIntervals=J.stayingIntervals.filter(function(Z){return Z[0]!==H[0]&&Z[1]!==H[1]})),J.startExtent=ee.region?H[ee.region==="s"?1:0]:j,N.parent.inBrushDrag=!0,J.brushStartCallback()})(this,I)}).on("drag",function(I){v(this,I)}).on("dragend",function(I){(function(B,N){var V=N.brush,j=V.filter,$=V.svgBrush;$._dragging||(S(B,N),v(B,N),N.brush.svgBrush.wasDragged=!1),$._dragging=!1,d.event.sourceEvent.stopPropagation();var ee=$.grabbingBar;if($.grabbingBar=!1,$.grabLocation=void 0,N.parent.inBrushDrag=!1,m(),!$.wasDragged)return $.wasDragged=void 0,$.clickableOrdinalRange?V.filterSpecified&&N.multiselect?$.extent.push($.clickableOrdinalRange):($.extent=[$.clickableOrdinalRange],V.filterSpecified=!0):ee?($.extent=$.stayingIntervals,$.extent.length===0&&M(V)):M(V),$.brushCallback(N),k(B.parentNode),void $.brushEndCallback(V.filterSpecified?j.getConsolidated():[]);var H=function(){j.set(j.getConsolidated())};if(N.ordinal){var J=N.unitTickvals;J[J.length-1]$.newExtent[0];$.extent=$.stayingIntervals.concat(Q?[$.newExtent]:[]),$.extent.length||M(V),$.brushCallback(N),Q?k(B.parentNode,H):(H(),k(B.parentNode))}else H();$.brushEndCallback(V.filterSpecified?j.getConsolidated():[])})(this,I)}))}function p(E,I){return E[0]-I[0]}function M(E){E.filterSpecified=!1,E.svgBrush.extent=[[-1/0,1/0]]}function f(E){for(var I,B=E.slice(),N=[],V=B.shift();V;){for(I=V.slice();(V=B.shift())&&V[0]<=I[1];)I[1]=Math.max(I[1],V[1]);N.push(I)}return N.length===1&&N[0][0]>N[0][1]&&(N=[]),N}D.exports={makeBrush:function(E,I,B,N,V,j){var $,ee=function(){var H,J,Q=[];return{set:function(Z){(Q=Z.map(function(K){return K.slice().sort(y)}).sort(p)).length===1&&Q[0][0]===-1/0&&Q[0][1]===1/0&&(Q=[[0,-1]]),H=f(Q),J=Q.reduce(function(K,ae){return[Math.min(K[0],ae[0]),Math.max(K[1],ae[1])]},[1/0,-1/0])},get:function(){return Q.slice()},getConsolidated:function(){return H},getBounds:function(){return J}}}();return ee.set(B),{filter:ee,filterSpecified:I,svgBrush:{extent:[],brushStartCallback:N,brushCallback:($=V,function(H){var J=H.brush,Q=function(K){return K.svgBrush.extent.map(function(ae){return ae.slice()})}(J),Z=Q.slice();J.filter.set(Z),$()}),brushEndCallback:j}}},ensureAxisBrush:function(E,I,B){var N=E.selectAll("."+b.cn.axisBrush).data(w,e);N.enter().append("g").classed(b.cn.axisBrush,!0),function(V,j,$){var ee=$._context.staticPlot,H=V.selectAll(".background").data(w);H.enter().append("rect").classed("background",!0).call(s).call(c).style("pointer-events",ee?"none":"auto").attr("transform",_(0,b.verticalPadding)),H.call(T).attr("height",function(Z){return Z.height-b.verticalPadding});var J=V.selectAll(".highlight-shadow").data(w);J.enter().append("line").classed("highlight-shadow",!0).attr("x",-b.bar.width/2).attr("stroke-width",b.bar.width+b.bar.strokeWidth).attr("stroke",j).attr("opacity",b.bar.strokeOpacity).attr("stroke-linecap","butt"),J.attr("y1",function(Z){return Z.height}).call(g);var Q=V.selectAll(".highlight").data(w);Q.enter().append("line").classed("highlight",!0).attr("x",-b.bar.width/2).attr("stroke-width",b.bar.width-b.bar.strokeWidth).attr("stroke",b.bar.fillColor).attr("opacity",b.bar.fillOpacity).attr("stroke-linecap","butt"),Q.attr("y1",function(Z){return Z.height}).call(g)}(N,I,B)},cleanRanges:function(E,I){if(Array.isArray(E[0])?(E=E.map(function(N){return N.sort(y)}),E=I.multiselect?f(E.sort(p)):[E[0]]):E=[E.sort(y)],I.tickvals){var B=I.tickvals.slice().sort(y);if(!(E=E.map(function(N){var V=[o(0,B,N[0],[]),o(1,B,N[1],[])];if(V[1]>V[0])return V}).filter(function(N){return N})).length)return}return E.length>1?E:E[0]}}},79846:function(D,L,t){D.exports={attributes:t(59549),supplyDefaults:t(12842),calc:t(20113),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:t(67207),categories:["gl","regl","noOpacity","noHover"],meta:{}}},67207:function(D,L,t){var b=t(45568),d=t(4173).eV,e=t(58823),w=t(62972);L.name="parcoords",L.plot=function(y){var _=d(y.calcdata,"parcoords")[0];_.length&&e(y,_)},L.clean=function(y,_,u,r){var n=r._has&&r._has("parcoords"),l=_._has&&_._has("parcoords");n&&!l&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},L.toSVG=function(y){var _=y._fullLayout._glimages,u=b.select(y).selectAll(".svg-container");u.filter(function(r,n){return n===u.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus").each(function(){var r=this,n=r.toDataURL("image/png");_.append("svg:image").attr({xmlns:w.svg,"xlink:href":n,preserveAspectRatio:"none",x:0,y:0,width:r.style.width,height:r.style.height})}),window.setTimeout(function(){b.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},20113:function(D,L,t){var b=t(34809).isArrayOrTypedArray,d=t(88856),e=t(71293).wrap;D.exports=function(w,y){var _,u;return d.hasColorscale(y,"line")&&b(y.line.color)?(_=y.line.color,u=d.extractOpts(y.line).colorscale,d.calc(w,y,{vals:_,containerStr:"line",cLetter:"c"})):(_=function(r){for(var n=new Array(r),l=0;ln&&(b.log("parcoords traces support up to "+n+" dimensions at the moment"),g.splice(n));var k=y(s,c,{name:"dimensions",layout:x,handleItemDefaults:o}),A=function(S,T,p,M,f){var E=f("line.color",p);if(d(S,"line")&&b.isArrayOrTypedArray(E)){if(E.length)return f("line.colorscale"),e(S,T,M,f,{prefix:"line.",cLetter:"c"}),E.length;T.line.color=p}return 1/0}(s,c,h,x,m);w(c,x,m),Array.isArray(k)&&k.length||(c.visible=!1),l(c,k,"values",A);var v=b.extendFlat({},x.font,{size:Math.round(x.font.size/1.2)});b.coerceFont(m,"labelfont",v),b.coerceFont(m,"tickfont",v,{autoShadowDflt:!0}),b.coerceFont(m,"rangefont",v),m("labelangle"),m("labelside"),m("unselected.line.color"),m("unselected.line.opacity")}},62935:function(D,L,t){var b=t(34809).isTypedArray;L.convertTypedArray=function(d){return b(d)?Array.prototype.slice.call(d):d},L.isOrdinal=function(d){return!!d.tickvals},L.isVisible=function(d){return d.visible||!("visible"in d)}},83910:function(D,L,t){var b=t(79846);b.plot=t(58823),D.exports=b},1293:function(D,L,t){var b=["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(` `),d=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` -`),e=t(77911).maxDimensionCount,w=t(34809),y=1e-6,_=new Uint8Array(4),u=new Uint8Array(4),r={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function n(k,A,v,S,T){var p=k._gl;p.enable(p.SCISSOR_TEST),p.scissor(A,v,S,T),k.clear({color:[0,0,0,0],depth:1})}function l(k,A,v,S,T,p){var M=p.key;v.drawCompleted||(function(f){f.read({x:0,y:0,width:1,height:1,data:_})}(k),v.drawCompleted=!0),function f(E){var I=Math.min(S,T-E*S);E===0&&(window.cancelAnimationFrame(v.currentRafs[M]),delete v.currentRafs[M],n(k,p.scissorX,p.scissorY,p.scissorWidth,p.viewBoxSize[1])),v.clearOnly||(p.count=2*I,p.offset=2*E*S,A(p),E*S+I>>8*A)%256/255}function c(k,A,v){for(var S=new Array(8*A),T=0,p=0;ple&&(le=Z[se].dim1.canvasX,fe=se);ie===0&&n(I,0,0,v.canvasWidth,v.canvasHeight);var ge=function(Ie){var Ve,Pe,de,Me=[[],[]];for(de=0;de<64;de++){var ke=!Ie&&deye._length&&(We=We.slice(0,ye._length));var Ie,Ve=ye.tickvals;function Pe(Fe,qe){return{val:Fe,text:Ie[qe]}}function de(Fe,qe){return Fe.val-qe.val}if(e(Ve)&&Ve.length){d.isTypedArray(Ve)&&(Ve=Array.from(Ve)),Ie=ye.ticktext,e(Ie)&&Ie.length?Ie.length>Ve.length?Ie=Ie.slice(0,Ve.length):Ve.length>Ie.length&&(Ve=Ve.slice(0,Ie.length)):Ie=Ve.map(w(ye.tickformat));for(var Me=1;Me=$e||Be>=Ye)return;var Ge=Fe.lineLayer.readPixel(De,Ye-1-Be),tt=Ge[3]!==0,nt=tt?Ge[2]+256*(Ge[1]+256*Ge[0]):null,pt={x:De,y:Be,clientX:qe.clientX,clientY:qe.clientY,dataIndex:Fe.model.key,curveNumber:nt};nt!==Se&&(tt?K.hover(pt):K.unhover&&K.unhover(pt),Se=nt)}}),be.style("opacity",function(Fe){return Fe.pick?0:1}),he.style("background","rgba(255, 255, 255, 0)");var Ee=he.selectAll("."+g.cn.parcoords).data(me,c);Ee.exit().remove(),Ee.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ee.attr("transform",function(Fe){return r(Fe.model.translateX,Fe.model.translateY)});var Ce=Ee.selectAll("."+g.cn.parcoordsControlView).data(h,c);Ce.enter().append("g").classed(g.cn.parcoordsControlView,!0),Ce.attr("transform",function(Fe){return r(Fe.model.pad.l,Fe.model.pad.t)});var Le=Ce.selectAll("."+g.cn.yAxis).data(function(Fe){return Fe.dimensions},c);Le.enter().append("g").classed(g.cn.yAxis,!0),Ce.each(function(Fe){$(Le,Fe,ie)}),be.each(function(Fe){if(Fe.viewModel){!Fe.lineLayer||K?Fe.lineLayer=A(this,Fe):Fe.lineLayer.update(Fe),(Fe.key||Fe.key===0)&&(Fe.viewModel[Fe.key]=Fe.lineLayer);var qe=!Fe.context||K;Fe.lineLayer.render(Fe.viewModel.panels,qe)}}),Le.attr("transform",function(Fe){return r(Fe.xScale(Fe.xIndex),0)}),Le.call(b.behavior.drag().origin(function(Fe){return Fe}).on("drag",function(Fe){var qe=Fe.parent;ye.linePickActive(!1),Fe.x=Math.max(-g.overdrag,Math.min(Fe.model.width+g.overdrag,b.event.x)),Fe.canvasX=Fe.x*Fe.model.canvasPixelRatio,Le.sort(function($e,Ye){return $e.x-Ye.x}).each(function($e,Ye){$e.xIndex=Ye,$e.x=Fe===$e?$e.x:$e.xScale($e.xIndex),$e.canvasX=$e.x*$e.model.canvasPixelRatio}),$(Le,qe,ie),Le.filter(function($e){return Math.abs(Fe.xIndex-$e.xIndex)!==0}).attr("transform",function($e){return r($e.xScale($e.xIndex),0)}),b.select(this).attr("transform",r(Fe.x,0)),Le.each(function($e,Ye,_e){_e===Fe.parent.key&&(qe.dimensions[Ye]=$e)}),qe.contextLayer&&qe.contextLayer.render(qe.panels,!1,!I(qe)),qe.focusLayer.render&&qe.focusLayer.render(qe.panels)}).on("dragend",function(Fe){var qe=Fe.parent;Fe.x=Fe.xScale(Fe.xIndex),Fe.canvasX=Fe.x*Fe.model.canvasPixelRatio,$(Le,qe,ie),b.select(this).attr("transform",function($e){return r($e.x,0)}),qe.contextLayer&&qe.contextLayer.render(qe.panels,!1,!I(qe)),qe.focusLayer&&qe.focusLayer.render(qe.panels),qe.pickLayer&&qe.pickLayer.render(qe.panels,!0),ye.linePickActive(!0),K&&K.axesMoved&&K.axesMoved(qe.key,qe.dimensions.map(function($e){return $e.crossfilterDimensionIndex}))})),Le.exit().remove();var Oe=Le.selectAll("."+g.cn.axisOverlays).data(h,c);Oe.enter().append("g").classed(g.cn.axisOverlays,!0),Oe.selectAll("."+g.cn.axis).remove();var We=Oe.selectAll("."+g.cn.axis).data(h,c);We.enter().append("g").classed(g.cn.axis,!0),We.each(function(Fe){var qe=Fe.model.height/Fe.model.tickDistance,$e=Fe.domainScale,Ye=$e.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(qe,Fe.tickFormat).tickValues(Fe.ordinal?Ye:null).tickFormat(function(_e){return m.isOrdinal(Fe)?_e:ee(Fe.model.dimensions[Fe.visibleIndex],_e)}).scale($e)),l.font(We.selectAll("text"),Fe.model.tickFont)}),We.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),We.selectAll("text").style("cursor","default");var Ie=Oe.selectAll("."+g.cn.axisHeading).data(h,c);Ie.enter().append("g").classed(g.cn.axisHeading,!0);var Ve=Ie.selectAll("."+g.cn.axisTitle).data(h,c);Ve.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ae?"none":"auto"),Ve.text(function(Fe){return Fe.label}).each(function(Fe){var qe=b.select(this);l.font(qe,Fe.model.labelFont),n.convertToTspans(qe,J)}).attr("transform",function(Fe){var qe=j(Fe.model.labelAngle,Fe.model.labelSide),$e=g.axisTitleOffset;return(qe.dir>0?"":r(0,2*$e+Fe.model.height))+u(qe.degrees)+r(-$e*qe.dx,-$e*qe.dy)}).attr("text-anchor",function(Fe){var qe=j(Fe.model.labelAngle,Fe.model.labelSide);return 2*Math.abs(qe.dx)>Math.abs(qe.dy)?qe.dir*qe.dx<0?"start":"end":"middle"});var Pe=Oe.selectAll("."+g.cn.axisExtent).data(h,c);Pe.enter().append("g").classed(g.cn.axisExtent,!0);var de=Pe.selectAll("."+g.cn.axisExtentTop).data(h,c);de.enter().append("g").classed(g.cn.axisExtentTop,!0),de.attr("transform",r(0,-g.axisExtentOffset));var Me=de.selectAll("."+g.cn.axisExtentTopText).data(h,c);Me.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(V),Me.text(function(Fe){return H(Fe,!0)}).each(function(Fe){l.font(b.select(this),Fe.model.rangeFont)});var ke=Pe.selectAll("."+g.cn.axisExtentBottom).data(h,c);ke.enter().append("g").classed(g.cn.axisExtentBottom,!0),ke.attr("transform",function(Fe){return r(0,Fe.model.height+g.axisExtentOffset)});var He=ke.selectAll("."+g.cn.axisExtentBottomText).data(h,c);He.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(V),He.text(function(Fe){return H(Fe,!1)}).each(function(Fe){l.font(b.select(this),Fe.model.rangeFont)}),k.ensureAxisBrush(Oe,oe,J)}},58823:function(D,L,t){var b=t(16019),d=t(22459),e=t(62935).isVisible,w={};function y(_,u,r){var n=u.indexOf(r),l=_.indexOf(n);return l===-1&&(l+=u.length),l}(D.exports=function(_,u){var r=_._fullLayout;if(d(_,[],w)){var n={},l={},o={},s={},c=r._size;u.forEach(function(h,x){var m=h[0].trace;o[x]=m.index;var g=s[x]=m._fullInput.index;n[x]=_.data[g].dimensions,l[x]=_.data[g].dimensions.slice()}),b(_,u,{width:c.w,height:c.h,margin:{t:c.t,r:c.r,b:c.b,l:c.l}},{filterChanged:function(h,x,m){var g=l[h][x],k=m.map(function(M){return M.slice()}),A="dimensions["+x+"].constraintrange",v=r._tracePreGUI[_._fullData[o[h]]._fullInput.uid];if(v[A]===void 0){var S=g.constraintrange;v[A]=S||null}var T=_._fullData[o[h]].dimensions[x];k.length?(k.length===1&&(k=k[0]),g.constraintrange=k,T.constraintrange=k.slice(),k=[k]):(delete g.constraintrange,delete T.constraintrange,k=null);var p={};p[A]=k,_.emit("plotly_restyle",[p,[s[h]]])},hover:function(h){_.emit("plotly_hover",h)},unhover:function(h){_.emit("plotly_unhover",h)},axesMoved:function(h,x){var m=function(g,k){return function(A,v){return y(g,k,A)-y(g,k,v)}}(x,l[h].filter(e));n[h].sort(m),l[h].filter(function(g){return!e(g)}).sort(function(g){return l[h].indexOf(g)}).forEach(function(g){n[h].splice(n[h].indexOf(g),1),n[h].splice(l[h].indexOf(g),0,g)}),_.emit("plotly_restyle",[{dimensions:[n[h]]},[s[h]]])}})}}).reglPrecompiled=w},55412:function(D,L,t){var b=t(9829),d=t(13792).u,e=t(80337),w=t(10229),y=t(3208).rb,_=t(3208).ay,u=t(93049).extendFlat,r=t(94850).k,n=e({editType:"plot",arrayOk:!0,colorEditType:"plot"});D.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:w.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:r,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},b.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:y({},{keys:["label","color","value","percent","text"]}),texttemplate:_({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},n,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},n,{}),outsidetextfont:u({},n,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},n,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:d({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:u({},n,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},96052:function(D,L,t){var b=t(44122);L.name="pie",L.plot=function(d,e,w,y){b.plotBasePlot(L.name,d,e,w,y)},L.clean=function(d,e,w,y){b.cleanBasePlot(L.name,d,e,w,y)}},44148:function(D,L,t){var b=t(10721),d=t(65657),e=t(78766),w={};function y(u){return function(r,n){return!!r&&!!(r=d(r)).isValid()&&(r=e.addOpacity(r,r.getAlpha()),u[n]||(u[n]=r),r)}}function _(u,r){var n,l=JSON.stringify(u),o=r[l];if(!o){for(o=u.slice(),n=0;n=0}),(r.type==="funnelarea"?T:r.sort)&&o.sort(function(I,B){return B.v-I.v}),o[0]&&(o[0].vTotal=S),o},crossTraceCalc:function(u,r){var n=(r||{}).type;n||(n="pie");var l=u._fullLayout,o=u.calcdata,s=l[n+"colorway"],c=l["_"+n+"colormap"];l["extend"+n+"colors"]&&(s=_(s,w));for(var h=0,x=0;x0){h=!0;break}}h||(c=0)}return{hasLabels:o,hasValues:s,len:c}}function r(n,l,o,s,c){s("marker.line.width")&&s("marker.line.color",c?void 0:o.paper_bgcolor);var h=s("marker.colors");_(s,"marker.pattern",h),n.marker&&!l.marker.pattern.fgcolor&&(l.marker.pattern.fgcolor=n.marker.colors),l.marker.pattern.bgcolor||(l.marker.pattern.bgcolor=o.paper_bgcolor)}D.exports={handleLabelsAndValues:u,handleMarkerDefaults:r,supplyDefaults:function(n,l,o,s){function c(T,p){return d.coerce(n,l,e,T,p)}var h=u(c("labels"),c("values")),x=h.len;if(l._hasLabels=h.hasLabels,l._hasValues=h.hasValues,!l._hasLabels&&l._hasValues&&(c("label0"),c("dlabel")),x){l._length=x,r(n,l,s,c,!0),c("scalegroup");var m,g=c("text"),k=c("texttemplate");if(k||(m=c("textinfo",d.isArrayOrTypedArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),k||m&&m!=="none"){var A=c("textposition");y(n,l,s,c,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(A)||A==="auto"||A==="outside")&&c("automargin"),(A==="inside"||A==="auto"||Array.isArray(A))&&c("insidetextorientation")}else m==="none"&&c("textposition","none");w(l,s,c);var v=c("hole");if(c("title.text")){var S=c("title.position",v?"middle center":"top center");v||S!=="middle center"||(l.title.position="top center"),d.coerceFont(c,"title.font",s.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else l.visible=!1}}},50568:function(D,L,t){var b=t(36040).appendArrayMultiPointValues;D.exports=function(d,e){var w={curveNumber:e.index,pointNumbers:d.pts,data:e._input,fullData:e,label:d.label,color:d.color,value:d.v,percent:d.percent,text:d.text,bbox:d.bbox,v:d.v};return d.pts.length===1&&(w.pointNumber=w.i=d.pts[0]),b(w,e,d.pts),e.type==="funnelarea"&&(delete w.v,delete w.i),w}},75067:function(D,L,t){var b=t(62203),d=t(78766);D.exports=function(e,w,y,_){var u=y.marker.pattern;u&&u.shape?b.pointStyle(e,y,_,w):d.fill(e,w.color)}},37252:function(D,L,t){var b=t(34809);function d(e){return e.indexOf("e")!==-1?e.replace(/[.]?0+e/,"e"):e.indexOf(".")!==-1?e.replace(/[.]?0+$/,""):e}L.formatPiePercent=function(e,w){var y=d((100*e).toPrecision(3));return b.numSeparate(y,w)+"%"},L.formatPieValue=function(e,w){var y=d(e.toPrecision(10));return b.numSeparate(y,w)},L.getFirstFilled=function(e,w){if(b.isArrayOrTypedArray(e))for(var y=0;y"),name:le.hovertemplate||ge.indexOf("name")!==-1?le.name:void 0,idealAlign:ie.pxmid[0]<0?"left":"right",color:h.castOption(Le.bgcolor,ie.pts)||ie.color,borderColor:h.castOption(Le.bordercolor,ie.pts),fontFamily:h.castOption(Oe.family,ie.pts),fontSize:h.castOption(Oe.size,ie.pts),fontColor:h.castOption(Oe.color,ie.pts),nameLength:h.castOption(Le.namelength,ie.pts),textAlign:h.castOption(Le.align,ie.pts),hovertemplate:h.castOption(le.hovertemplate,ie.pts),hovertemplateLabels:ie,eventData:[x(ie,le)]},{container:oe._hoverlayer.node(),outerContainer:oe._paper.node(),gd:Q,inOut_bbox:We}),ie.bbox=We[0],he._hasHoverLabel=!0}he._hasHoverEvent=!0,Q.emit("plotly_hover",{points:[x(ie,le)],event:b.event})}}),J.on("mouseout",function(ie){var oe=Q._fullLayout,le=Q._fullData[he.index],ge=b.select(this).datum();he._hasHoverEvent&&(ie.originalEvent=b.event,Q.emit("plotly_unhover",{points:[x(ge,le)],event:b.event}),he._hasHoverEvent=!1),he._hasHoverLabel&&(e.loneUnhover(oe._hoverlayer.node()),he._hasHoverLabel=!1)}),J.on("click",function(ie){var oe=Q._fullLayout,le=Q._fullData[he.index];Q._dragging||oe.hovermode===!1||(Q._hoverdata=[x(ie,le)],e.click(Q,b.event))})}function k(J,Q,Z){var K=h.castOption(J.insidetextfont.color,Q.pts);!K&&J._input.textfont&&(K=h.castOption(J._input.textfont.color,Q.pts));var ae=h.castOption(J.insidetextfont.family,Q.pts)||h.castOption(J.textfont.family,Q.pts)||Z.family,se=h.castOption(J.insidetextfont.size,Q.pts)||h.castOption(J.textfont.size,Q.pts)||Z.size,he=h.castOption(J.insidetextfont.weight,Q.pts)||h.castOption(J.textfont.weight,Q.pts)||Z.weight,fe=h.castOption(J.insidetextfont.style,Q.pts)||h.castOption(J.textfont.style,Q.pts)||Z.style,ie=h.castOption(J.insidetextfont.variant,Q.pts)||h.castOption(J.textfont.variant,Q.pts)||Z.variant,oe=h.castOption(J.insidetextfont.textcase,Q.pts)||h.castOption(J.textfont.textcase,Q.pts)||Z.textcase,le=h.castOption(J.insidetextfont.lineposition,Q.pts)||h.castOption(J.textfont.lineposition,Q.pts)||Z.lineposition,ge=h.castOption(J.insidetextfont.shadow,Q.pts)||h.castOption(J.textfont.shadow,Q.pts)||Z.shadow;return{color:K||w.contrast(Q.color),family:ae,size:se,weight:he,style:fe,variant:ie,textcase:oe,lineposition:le,shadow:ge}}function A(J,Q){for(var Z,K,ae=0;aeqe&&qe>Ye||$e=-4;Ee-=2)Ce(Math.PI*Ee,"tan");for(Ee=4;Ee>=-4;Ee-=2)Ce(Math.PI*(Ee+1),"tan")}if(ge||me){for(Ee=4;Ee>=-4;Ee-=2)Ce(Math.PI*(Ee+1.5),"rad");for(Ee=4;Ee>=-4;Ee-=2)Ce(Math.PI*(Ee+.5),"rad")}}if(fe||be||ge){var Le=Math.sqrt(J.width*J.width+J.height*J.height);if((se={scale:ae*K*2/Le,rCenter:1-ae,rotate:0}).textPosAngle=(Q.startangle+Q.stopangle)/2,se.scale>=1)return se;Se.push(se)}(be||me)&&((se=S(J,K,he,ie,oe)).textPosAngle=(Q.startangle+Q.stopangle)/2,Se.push(se)),(be||ye)&&((se=T(J,K,he,ie,oe)).textPosAngle=(Q.startangle+Q.stopangle)/2,Se.push(se));for(var Oe=0,We=0,Ie=0;Ie=1)break}return Se[Oe]}function S(J,Q,Z,K,ae){Q=Math.max(0,Q-2*c);var se=J.width/J.height,he=f(se,K,Q,Z);return{scale:2*he/J.height,rCenter:p(se,he/Q),rotate:M(ae)}}function T(J,Q,Z,K,ae){Q=Math.max(0,Q-2*c);var se=J.height/J.width,he=f(se,K,Q,Z);return{scale:2*he/J.width,rCenter:p(se,he/Q),rotate:M(ae+Math.PI/2)}}function p(J,Q){return Math.cos(Q)-J*Q}function M(J){return(180/Math.PI*J+720)%180-90}function f(J,Q,Z,K){var ae=J+1/(2*Math.tan(Q));return Z*Math.min(1/(Math.sqrt(ae*ae+.5)+ae),K/(Math.sqrt(J*J+K/2)+J))}function E(J,Q){return J.v!==Q.vTotal||Q.trace.hole?Math.min(1/(1+1/Math.sin(J.halfangle)),J.ring/2):1}function I(J,Q){var Z=Q.pxmid[0],K=Q.pxmid[1],ae=J.width/2,se=J.height/2;return Z<0&&(ae*=-1),K<0&&(se*=-1),{scale:1,rCenter:1,rotate:0,x:ae+Math.abs(se)*(ae>0?1:-1)/2,y:se/(1+Z*Z/(K*K)),outside:!0}}function B(J,Q){var Z,K,ae,se=J.trace,he={x:J.cx,y:J.cy},fe={tx:0,ty:0};fe.ty+=se.title.font.size,ae=V(se),se.title.position.indexOf("top")!==-1?(he.y-=(1+ae)*J.r,fe.ty-=J.titleBox.height):se.title.position.indexOf("bottom")!==-1&&(he.y+=(1+ae)*J.r);var ie,oe=J.r/((ie=J.trace.aspectratio)===void 0?1:ie),le=Q.w*(se.domain.x[1]-se.domain.x[0])/2;return se.title.position.indexOf("left")!==-1?(le+=oe,he.x-=(1+ae)*oe,fe.tx+=J.titleBox.width/2):se.title.position.indexOf("center")!==-1?le*=2:se.title.position.indexOf("right")!==-1&&(le+=oe,he.x+=(1+ae)*oe,fe.tx-=J.titleBox.width/2),Z=le/J.titleBox.width,K=N(J,Q)/J.titleBox.height,{x:he.x,y:he.y,scale:Math.min(Z,K),tx:fe.tx,ty:fe.ty}}function N(J,Q){var Z=J.trace,K=Q.h*(Z.domain.y[1]-Z.domain.y[0]);return Math.min(J.titleBox.height,K/2)}function V(J){var Q,Z=J.pull;if(!Z)return 0;if(_.isArrayOrTypedArray(Z))for(Z=0,Q=0;QZ&&(Z=J.pull[Q]);return Z}function j(J,Q){for(var Z=[],K=0;K1?Ie=(We=me.r)/Se.aspectratio:We=(Ie=me.r)*Se.aspectratio,Oe=(We*=(1+Se.baseratio)/2)*Ie}Ce=Math.min(Ce,Oe/me.vTotal)}for(be=0;be")}if(se){var Ee=_.castOption(ae,Q.i,"texttemplate");if(Ee){var Ce=function(Oe){return{label:Oe.label,value:Oe.v,valueLabel:h.formatPieValue(Oe.v,K.separators),percent:Oe.v/Z.vTotal,percentLabel:h.formatPiePercent(Oe.v/Z.vTotal,K.separators),color:Oe.color,text:Oe.text,customdata:_.castOption(ae,Oe.i,"customdata")}}(Q),Le=h.getFirstFilled(ae.text,Q.pts);(m(Le)||Le==="")&&(Ce.text=Le),Q.text=_.texttemplateString(Ee,Ce,J._fullLayout._d3locale,Ce,ae._meta||{})}else Q.text=""}}function H(J,Q){var Z=J.rotate*Math.PI/180,K=Math.cos(Z),ae=Math.sin(Z),se=(Q.left+Q.right)/2,he=(Q.top+Q.bottom)/2;J.textX=se*K-he*ae,J.textY=se*ae+he*K,J.noCenter=!0}D.exports={plot:function(J,Q){var Z=J._context.staticPlot,K=J._fullLayout,ae=K._size;s("pie",K),A(Q,J),j(Q,ae);var se=_.makeTraceGroups(K._pielayer,Q,"trace").each(function(he){var fe=b.select(this),ie=he[0],oe=ie.trace;(function(le){var ge,ye,me,be=le[0],Se=be.r,Ee=be.trace,Ce=h.getRotationAngle(Ee.rotation),Le=2*Math.PI/be.vTotal,Oe="px0",We="px1";if(Ee.direction==="counterclockwise"){for(ge=0;gebe.vTotal/2?1:0,ye.halfangle=Math.PI*Math.min(ye.v/be.vTotal,.5),ye.ring=1-Ee.hole,ye.rInscribed=E(ye,be))})(he),fe.attr("stroke-linejoin","round"),fe.each(function(){var le=b.select(this).selectAll("g.slice").data(he);le.enter().append("g").classed("slice",!0),le.exit().remove();var ge=[[[],[]],[[],[]]],ye=!1;le.each(function(We,Ie){if(We.hidden)b.select(this).selectAll("path,g").remove();else{We.pointNumber=We.i,We.curveNumber=oe.index,ge[We.pxmid[1]<0?0:1][We.pxmid[0]<0?0:1].push(We);var Ve=ie.cx,Pe=ie.cy,de=b.select(this),Me=de.selectAll("path.surface").data([We]);if(Me.enter().append("path").classed("surface",!0).style({"pointer-events":Z?"none":"all"}),de.call(g,J,he),oe.pull){var ke=+h.castOption(oe.pull,We.pts)||0;ke>0&&(Ve+=ke*We.pxmid[0],Pe+=ke*We.pxmid[1])}We.cxFinal=Ve,We.cyFinal=Pe;var He=oe.hole;if(We.v===ie.vTotal){var Fe="M"+(Ve+We.px0[0])+","+(Pe+We.px0[1])+De(We.px0,We.pxmid,!0,1)+De(We.pxmid,We.px0,!0,1)+"Z";He?Me.attr("d","M"+(Ve+He*We.px0[0])+","+(Pe+He*We.px0[1])+De(We.px0,We.pxmid,!1,He)+De(We.pxmid,We.px0,!1,He)+"Z"+Fe):Me.attr("d",Fe)}else{var qe=De(We.px0,We.px1,!0,1);if(He){var $e=1-He;Me.attr("d","M"+(Ve+He*We.px1[0])+","+(Pe+He*We.px1[1])+De(We.px1,We.px0,!1,He)+"l"+$e*We.px0[0]+","+$e*We.px0[1]+qe+"Z")}else Me.attr("d","M"+Ve+","+Pe+"l"+We.px0[0]+","+We.px0[1]+qe+"Z")}ee(J,We,ie);var Ye=h.castOption(oe.textposition,We.pts),_e=de.selectAll("g.slicetext").data(We.text&&Ye!=="none"?[0]:[]);_e.enter().append("g").classed("slicetext",!0),_e.exit().remove(),_e.each(function(){var Be=_.ensureSingle(b.select(this),"text","",function(Ht){Ht.attr("data-notex",1)}),Ge=_.ensureUniformFontSize(J,Ye==="outside"?function(Ht,Gt,st){return{color:h.castOption(Ht.outsidetextfont.color,Gt.pts)||h.castOption(Ht.textfont.color,Gt.pts)||st.color,family:h.castOption(Ht.outsidetextfont.family,Gt.pts)||h.castOption(Ht.textfont.family,Gt.pts)||st.family,size:h.castOption(Ht.outsidetextfont.size,Gt.pts)||h.castOption(Ht.textfont.size,Gt.pts)||st.size,weight:h.castOption(Ht.outsidetextfont.weight,Gt.pts)||h.castOption(Ht.textfont.weight,Gt.pts)||st.weight,style:h.castOption(Ht.outsidetextfont.style,Gt.pts)||h.castOption(Ht.textfont.style,Gt.pts)||st.style,variant:h.castOption(Ht.outsidetextfont.variant,Gt.pts)||h.castOption(Ht.textfont.variant,Gt.pts)||st.variant,textcase:h.castOption(Ht.outsidetextfont.textcase,Gt.pts)||h.castOption(Ht.textfont.textcase,Gt.pts)||st.textcase,lineposition:h.castOption(Ht.outsidetextfont.lineposition,Gt.pts)||h.castOption(Ht.textfont.lineposition,Gt.pts)||st.lineposition,shadow:h.castOption(Ht.outsidetextfont.shadow,Gt.pts)||h.castOption(Ht.textfont.shadow,Gt.pts)||st.shadow}}(oe,We,K.font):k(oe,We,K.font));Be.text(We.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(y.font,Ge).call(n.convertToTspans,J);var tt,nt=y.bBox(Be.node());if(Ye==="outside")tt=I(nt,We);else if(tt=v(nt,We,ie),Ye==="auto"&&tt.scale<1){var pt=_.ensureUniformFontSize(J,oe.outsidetextfont);Be.call(y.font,pt),tt=I(nt=y.bBox(Be.node()),We)}var At=tt.textPosAngle,wt=At===void 0?We.pxmid:$(ie.r,At);if(tt.targetX=Ve+wt[0]*tt.rCenter+(tt.x||0),tt.targetY=Pe+wt[1]*tt.rCenter+(tt.y||0),H(tt,nt),tt.outside){var Nt=tt.targetY;We.yLabelMin=Nt-nt.height/2,We.yLabelMid=Nt,We.yLabelMax=Nt+nt.height/2,We.labelExtraX=0,We.labelExtraY=0,ye=!0}tt.fontSize=Ge.size,o(oe.type,tt,K),he[Ie].transform=tt,_.setTransormAndDisplay(Be,tt)})}function De(Be,Ge,tt,nt){var pt=nt*(Ge[0]-Be[0]),At=nt*(Ge[1]-Be[1]);return"a"+nt*ie.r+","+nt*ie.r+" 0 "+We.largeArc+(tt?" 1 ":" 0 ")+pt+","+At}});var me=b.select(this).selectAll("g.titletext").data(oe.title.text?[0]:[]);if(me.enter().append("g").classed("titletext",!0),me.exit().remove(),me.each(function(){var We,Ie=_.ensureSingle(b.select(this),"text","",function(Pe){Pe.attr("data-notex",1)}),Ve=oe.title.text;oe._meta&&(Ve=_.templateString(Ve,oe._meta)),Ie.text(Ve).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(y.font,oe.title.font).call(n.convertToTspans,J),We=oe.title.position==="middle center"?function(Pe){var de=Math.sqrt(Pe.titleBox.width*Pe.titleBox.width+Pe.titleBox.height*Pe.titleBox.height);return{x:Pe.cx,y:Pe.cy,scale:Pe.trace.hole*Pe.r*2/de,tx:0,ty:-Pe.titleBox.height/2+Pe.trace.title.font.size}}(ie):B(ie,ae),Ie.attr("transform",r(We.x,We.y)+u(Math.min(1,We.scale))+r(We.tx,We.ty))}),ye&&function(We,Ie){var Ve,Pe,de,Me,ke,He,Fe,qe,$e,Ye,_e,De,Be;function Ge(At,wt){return At.pxmid[1]-wt.pxmid[1]}function tt(At,wt){return wt.pxmid[1]-At.pxmid[1]}function nt(At,wt){wt||(wt={});var Nt,Ht,Gt,st,Qe=wt.labelExtraY+(Pe?wt.yLabelMax:wt.yLabelMin),ft=Pe?At.yLabelMin:At.yLabelMax,yt=Pe?At.yLabelMax:At.yLabelMin,Ot=At.cyFinal+ke(At.px0[1],At.px1[1]),Pt=Qe-ft;if(Pt*Fe>0&&(At.labelExtraY=Pt),_.isArrayOrTypedArray(Ie.pull))for(Ht=0;Ht=(h.castOption(Ie.pull,Gt.pts)||0)||((At.pxmid[1]-Gt.pxmid[1])*Fe>0?(Pt=Gt.cyFinal+ke(Gt.px0[1],Gt.px1[1])-ft-At.labelExtraY)*Fe>0&&(At.labelExtraY+=Pt):(yt+At.labelExtraY-Ot)*Fe>0&&(Nt=3*He*Math.abs(Ht-Ye.indexOf(At)),(st=Gt.cxFinal+Me(Gt.px0[0],Gt.px1[0])+Nt-(At.cxFinal+At.pxmid[0])-At.labelExtraX)*He>0&&(At.labelExtraX+=st)))}for(Pe=0;Pe<2;Pe++)for(de=Pe?Ge:tt,ke=Pe?Math.max:Math.min,Fe=Pe?1:-1,Ve=0;Ve<2;Ve++){for(Me=Ve?Math.max:Math.min,He=Ve?1:-1,(qe=We[Pe][Ve]).sort(de),$e=We[1-Pe][Ve],Ye=$e.concat(qe),De=[],_e=0;_eMath.abs(qe)?ke+="l"+qe*Ve.pxmid[0]/Ve.pxmid[1]+","+qe+"H"+(Me+Ve.labelExtraX+He):ke+="l"+Ve.labelExtraX+","+Fe+"v"+(qe-Fe)+"h"+He}else ke+="V"+(Ve.yLabelMid+Ve.labelExtraY)+"h"+He;_.ensureSingle(Pe,"path","textline").call(w.stroke,Ie.outsidetextfont.color).attr({"stroke-width":Math.min(2,Ie.outsidetextfont.size/8),d:ke,fill:"none"})}else Pe.select("path.textline").remove()})}(le,oe),ye&&oe.automargin){var be=y.bBox(fe.node()),Se=oe.domain,Ee=ae.w*(Se.x[1]-Se.x[0]),Ce=ae.h*(Se.y[1]-Se.y[0]),Le=(.5*Ee-ie.r)/ae.w,Oe=(.5*Ce-ie.r)/ae.h;d.autoMargin(J,"pie."+oe.uid+".automargin",{xl:Se.x[0]-Le,xr:Se.x[1]+Le,yb:Se.y[0]-Oe,yt:Se.y[1]+Oe,l:Math.max(ie.cx-ie.r-be.left,0),r:Math.max(be.right-(ie.cx+ie.r),0),b:Math.max(be.bottom-(ie.cy+ie.r),0),t:Math.max(ie.cy-ie.r-be.top,0),pad:5})}})});setTimeout(function(){se.selectAll("tspan").each(function(){var he=b.select(this);he.attr("dy")&&he.attr("dy",he.attr("dy"))})},0)},formatSliceLabel:ee,transformInsideText:v,determineInsideTextFont:k,positionTitleOutside:B,prerenderTitles:A,layoutAreas:j,attachFxHandlers:g,computeTransform:H}},140:function(D,L,t){var b=t(45568),d=t(32891),e=t(84102).resizeText;D.exports=function(w){var y=w._fullLayout._pielayer.selectAll(".trace");e(w,y,"pie"),y.each(function(_){var u=_[0].trace,r=b.select(this);r.style({opacity:u.opacity}),r.selectAll("path.surface").each(function(n){b.select(this).call(d,n,u,w)})})}},32891:function(D,L,t){var b=t(78766),d=t(37252).castOption,e=t(75067);D.exports=function(w,y,_,u){var r=_.marker.line,n=d(r.color,y.pts)||b.defaultLine,l=d(r.width,y.pts)||0;w.call(e,y,_,u).style("stroke-width",l).call(b.stroke,n)}},36961:function(D,L,t){var b=t(36640);D.exports={x:b.x,y:b.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:b.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},71593:function(D,L,t){var b=t(99098).gl_pointcloud2d,d=t(34809).isArrayOrTypedArray,e=t(55010),w=t(32919).findExtremes,y=t(11539);function _(r,n){this.scene=r,this.uid=n,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=b(r.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var u=_.prototype;u.handlePick=function(r){var n=this.idToIndex[r.pointId];return{trace:this,dataCoord:r.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*n],this.pickXYData[2*n+1]]:[this.pickXData[n],this.pickYData[n]],textLabel:d(this.textLabels)?this.textLabels[n]:this.textLabels,color:this.color,name:this.name,pointIndex:n,hoverinfo:this.hoverinfo}},u.update=function(r){this.index=r.index,this.textLabels=r.text,this.name=r.name,this.hoverinfo=r.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(r),this.color=y(r,{})},u.updateFast=function(r){var n,l,o,s,c,h,x=this.xData=this.pickXData=r.x,m=this.yData=this.pickYData=r.y,g=this.pickXYData=r.xy,k=r.xbounds&&r.ybounds,A=r.indices,v=this.bounds;if(g){if(o=g,n=g.length>>>1,k)v[0]=r.xbounds[0],v[2]=r.xbounds[1],v[1]=r.ybounds[0],v[3]=r.ybounds[1];else for(h=0;hv[2]&&(v[2]=s),cv[3]&&(v[3]=c);if(A)l=A;else for(l=new Int32Array(n),h=0;hv[2]&&(v[2]=s),cv[3]&&(v[3]=c);this.idToIndex=l,this.pointcloudOptions.idToIndex=l,this.pointcloudOptions.positions=o;var S=e(r.marker.color),T=e(r.marker.border.color),p=r.opacity*r.marker.opacity;S[3]*=p,this.pointcloudOptions.color=S;var M=r.marker.blend;M===null&&(M=x.length<100||m.length<100),this.pointcloudOptions.blend=M,T[3]*=p,this.pointcloudOptions.borderColor=T;var f=r.marker.sizemin,E=Math.max(r.marker.sizemax,r.marker.sizemin);this.pointcloudOptions.sizeMin=f,this.pointcloudOptions.sizeMax=E,this.pointcloudOptions.areaRatio=r.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var I=this.scene.xaxis,B=this.scene.yaxis,N=E/2||.5;r._extremes[I._id]=w(I,[v[0],v[2]],{ppad:N}),r._extremes[B._id]=w(B,[v[1],v[3]],{ppad:N})},u.dispose=function(){this.pointcloud.dispose()},D.exports=function(r,n){var l=new _(r,n.uid);return l.update(n),l}},75526:function(D,L,t){var b=t(34809),d=t(36961);D.exports=function(e,w,y){function _(u,r){return b.coerce(e,w,d,u,r)}_("x"),_("y"),_("xbounds"),_("ybounds"),e.xy&&e.xy instanceof Float32Array&&(w.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(w.indices=e.indices),_("text"),_("marker.color",y),_("marker.opacity"),_("marker.blend"),_("marker.sizemin"),_("marker.sizemax"),_("marker.border.color",y),_("marker.border.arearatio"),w._length=null}},15186:function(D,L,t){D.exports={attributes:t(36961),supplyDefaults:t(75526),calc:t(37593),plot:t(71593),moduleType:"trace",name:"pointcloud",basePlotModule:t(24585),categories:["gl","gl2d","showLegend"],meta:{}}},33795:function(D,L,t){var b=t(80337),d=t(9829),e=t(10229),w=t(70192),y=t(13792).u,_=t(3208).rb,u=t(87163),r=t(78032).templatedArray,n=t(80712).descriptionOnlyNumbers,l=t(93049).extendFlat,o=t(13582).overrideAll;(D.exports=o({hoverinfo:l({},d.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:w.hoverlabel,domain:y({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:n("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:b({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:e.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:w.hoverlabel,hovertemplate:_({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:e.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:w.hoverlabel,hovertemplate:_({},{keys:["value","label"]}),colorscales:r("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:l(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},42229:function(D,L,t){var b=t(13582).overrideAll,d=t(4173).eV,e=t(16506),w=t(6811),y=t(27983),_=t(14751),u=t(44844).prepSelect,r=t(34809),n=t(33626),l="sankey";function o(s,c){var h=s._fullData[c],x=s._fullLayout,m=x.dragmode,g=x.dragmode==="pan"?"move":"crosshair",k=h._bgRect;if(k&&m!=="pan"&&m!=="zoom"){y(k,g);var A={_id:"x",c2p:r.identity,_offset:h._sankey.translateX,_length:h._sankey.width},v={_id:"y",c2p:r.identity,_offset:h._sankey.translateY,_length:h._sankey.height},S={gd:s,element:k.node(),plotinfo:{id:c,xaxis:A,yaxis:v,fillRangeItems:r.noop},subplot:c,xaxes:[A],yaxes:[v],doneFnCompleted:function(T){var p,M=s._fullData[c],f=M.node.groups.slice(),E=[];function I(j){for(var $=M._sankey.graph.nodes,ee=0;ee<$.length;ee++)if($[ee].pointNumber===j)return $[ee]}for(var B=0;BM&&(M=c.source[o]),c.target[o]>M&&(M=c.target[o]);var f,E=M+1;l.node._count=E;var I=l.node.groups,B={};for(o=0;o0&&y(H,E)&&y(J,E)&&(!B.hasOwnProperty(H)||!B.hasOwnProperty(J)||B[H]!==B[J])){B.hasOwnProperty(J)&&(J=B[J]),B.hasOwnProperty(H)&&(H=B[H]),J=+J,k[H=+H]=k[J]=!0;var Q="";c.label&&c.label[o]&&(Q=c.label[o]);var Z=null;Q&&A.hasOwnProperty(Q)&&(Z=A[Q]),h.push({pointNumber:o,label:Q,color:x?c.color[o]:c.color,hovercolor:m?c.hovercolor[o]:c.hovercolor,customdata:g?c.customdata[o]:c.customdata,concentrationscale:Z,source:H,target:J,value:+ee}),$.source.push(H),$.target.push(J)}}var K=E+I.length,ae=w(s.color),se=w(s.customdata),he=[];for(o=0;oE-1,childrenNodes:[],pointNumber:o,label:fe,color:ae?s.color[o]:s.color,customdata:se?s.customdata[o]:s.customdata})}var ie=!1;return function(oe,le,ge){for(var ye=d.init2dArray(oe,0),me=0;me1})}(K,$.source,$.target)&&(ie=!0),{circular:ie,links:h,nodes:he,groups:I,groupLookup:B}}(r);return e({circular:n.circular,_nodes:n.nodes,_links:n.links,_groups:n.groups,_groupLookup:n.groupLookup})}},21541:function(D){D.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},67940:function(D,L,t){var b=t(34809),d=t(33795),e=t(78766),w=t(65657),y=t(13792).N,_=t(26430),u=t(78032),r=t(59008);function n(l,o){function s(c,h){return b.coerce(l,o,d.link.colorscales,c,h)}s("label"),s("cmin"),s("cmax"),s("colorscale")}D.exports=function(l,o,s,c){function h(I,B){return b.coerce(l,o,d,I,B)}var x=b.extendDeep(c.hoverlabel,l.hoverlabel),m=l.node,g=u.newContainer(o,"node");function k(I,B){return b.coerce(m,g,d.node,I,B)}k("label"),k("groups"),k("x"),k("y"),k("pad"),k("thickness"),k("line.color"),k("line.width"),k("hoverinfo",l.hoverinfo),_(m,g,k,x),k("hovertemplate"),k("align");var A=c.colorway;k("color",g.label.map(function(I,B){return e.addOpacity(function(N){return A[N%A.length]}(B),.8)})),k("customdata");var v=l.link||{},S=u.newContainer(o,"link");function T(I,B){return b.coerce(v,S,d.link,I,B)}T("label"),T("arrowlen"),T("source"),T("target"),T("value"),T("line.color"),T("line.width"),T("hoverinfo",l.hoverinfo),_(v,S,T,x),T("hovertemplate");var p,M=w(c.paper_bgcolor).getLuminance()<.333,f=T("color",M?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function E(I){var B=w(I);if(!B.isValid())return I;var N=B.getAlpha();return N<=.8?B.setAlpha(N+.2):B=M?B.brighten():B.darken(),B.toRgbString()}T("hovercolor",Array.isArray(f)?f.map(E):E(f)),T("customdata"),r(v,S,{name:"colorscales",handleItemDefaults:n}),y(o,c,h),h("orientation"),h("valueformat"),h("valuesuffix"),g.x.length&&g.y.length&&(p="freeform"),h("arrangement",p),b.coerceFont(h,"textfont",c.font,{autoShadowDflt:!0}),o._length=null}},71760:function(D,L,t){D.exports={attributes:t(33795),supplyDefaults:t(67940),calc:t(22915),plot:t(16506),moduleType:"trace",name:"sankey",basePlotModule:t(42229),selectPoints:t(74670),categories:["noOpacity"],meta:{}}},16506:function(D,L,t){var b=t(45568),d=t(34809),e=d.numberFormat,w=t(90958),y=t(32141),_=t(78766),u=t(21541).cn,r=d._;function n(v){return v!==""}function l(v,S){return v.filter(function(T){return T.key===S.traceId})}function o(v,S){b.select(v).select("path").style("fill-opacity",S),b.select(v).select("rect").style("fill-opacity",S)}function s(v){b.select(v).select("text.name").style("fill","black")}function c(v){return function(S){return v.node.sourceLinks.indexOf(S.link)!==-1||v.node.targetLinks.indexOf(S.link)!==-1}}function h(v){return function(S){return S.node.sourceLinks.indexOf(v.link)!==-1||S.node.targetLinks.indexOf(v.link)!==-1}}function x(v,S,T){S&&T&&l(T,S).selectAll("."+u.sankeyLink).filter(c(S)).call(g.bind(0,S,T,!1))}function m(v,S,T){S&&T&&l(T,S).selectAll("."+u.sankeyLink).filter(c(S)).call(k.bind(0,S,T,!1))}function g(v,S,T,p){p.style("fill",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverHue}).style("fill-opacity",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverAlpha}),p.each(function(M){var f=M.link.label;f!==""&&l(S,v).selectAll("."+u.sankeyLink).filter(function(E){return E.link.label===f}).style("fill",function(E){if(!E.link.concentrationscale)return E.tinyColorHoverHue}).style("fill-opacity",function(E){if(!E.link.concentrationscale)return E.tinyColorHoverAlpha})}),T&&l(S,v).selectAll("."+u.sankeyNode).filter(h(v)).call(x)}function k(v,S,T,p){p.style("fill",function(M){return M.tinyColorHue}).style("fill-opacity",function(M){return M.tinyColorAlpha}),p.each(function(M){var f=M.link.label;f!==""&&l(S,v).selectAll("."+u.sankeyLink).filter(function(E){return E.link.label===f}).style("fill",function(E){return E.tinyColorHue}).style("fill-opacity",function(E){return E.tinyColorAlpha})}),T&&l(S,v).selectAll(u.sankeyNode).filter(h(v)).call(m)}function A(v,S){var T=v.hoverlabel||{},p=d.nestedProperty(T,S).get();return!Array.isArray(p)&&p}D.exports=function(v,S){for(var T=v._fullLayout,p=T._paper,M=T._size,f=0;f"),color:A(H,"bgcolor")||_.addOpacity(K.color,1),borderColor:A(H,"bordercolor"),fontFamily:A(H,"font.family"),fontSize:A(H,"font.size"),fontColor:A(H,"font.color"),fontWeight:A(H,"font.weight"),fontStyle:A(H,"font.style"),fontVariant:A(H,"font.variant"),fontTextcase:A(H,"font.textcase"),fontLineposition:A(H,"font.lineposition"),fontShadow:A(H,"font.shadow"),nameLength:A(H,"namelength"),textAlign:A(H,"align"),idealAlign:b.event.x"),color:A(H,"bgcolor")||ee.tinyColorHue,borderColor:A(H,"bordercolor"),fontFamily:A(H,"font.family"),fontSize:A(H,"font.size"),fontColor:A(H,"font.color"),fontWeight:A(H,"font.weight"),fontStyle:A(H,"font.style"),fontVariant:A(H,"font.variant"),fontTextcase:A(H,"font.textcase"),fontLineposition:A(H,"font.lineposition"),fontShadow:A(H,"font.shadow"),nameLength:A(H,"namelength"),textAlign:A(H,"align"),idealAlign:"left",hovertemplate:H.hovertemplate,hovertemplateLabels:he,eventData:[ee.node]},{container:T._hoverlayer.node(),outerContainer:T._paper.node(),gd:v});o(oe,.85),s(oe)}}},unhover:function($,ee,H){v._fullLayout.hovermode!==!1&&(b.select($).call(m,ee,H),ee.node.trace.node.hoverinfo!=="skip"&&(ee.node.fullData=ee.node.trace,v.emit("plotly_unhover",{event:b.event,points:[ee.node]})),y.loneUnhover(T._hoverlayer.node()))},select:function($,ee,H){var J=ee.node;J.originalEvent=b.event,v._hoverdata=[J],b.select($).call(m,ee,H),y.click(v,{target:!0})}}})}},90958:function(D,L,t){var b=t(32702),d=t(88640).Dj,e=t(45568),w=t(62369),y=t(68735),_=t(21541),u=t(65657),r=t(78766),n=t(62203),l=t(34809),o=l.strTranslate,s=l.strRotate,c=t(71293),h=c.keyFun,x=c.repeat,m=c.unwrap,g=t(30635),k=t(33626),A=t(4530),v=A.CAP_SHIFT,S=A.LINE_SPACING;function T(Z,K,ae){var se,he=m(K),fe=he.trace,ie=fe.domain,oe=fe.orientation==="h",le=fe.node.pad,ge=fe.node.thickness,ye={justify:w.sankeyJustify,left:w.sankeyLeft,right:w.sankeyRight,center:w.sankeyCenter}[fe.node.align],me=Z.width*(ie.x[1]-ie.x[0]),be=Z.height*(ie.y[1]-ie.y[0]),Se=he._nodes,Ee=he._links,Ce=he.circular;(se=Ce?y.sankeyCircular().circularLinkGap(0):w.sankey()).iterations(_.sankeyIterations).size(oe?[me,be]:[be,me]).nodeWidth(ge).nodePadding(le).nodeId(function(Fe){return Fe.pointNumber}).nodeAlign(ye).nodes(Se).links(Ee);var Le,Oe,We,Ie=se();for(var Ve in se.nodePadding()Be+ge&&(De+=1,qe=Ge.x0),Be=Ge.x0,_e[De]||(_e[De]=[]),_e[De].push(Ge),$e=qe-Ge.x0,Ge.x0+=$e,Ge.x1+=$e}return _e}(Se=Ie.nodes).forEach(function(Fe){var qe,$e,Ye,_e=0,De=Fe.length;for(Fe.sort(function(Be,Ge){return Be.y0-Ge.y0}),Ye=0;Ye=_e||($e=_e-qe.y0)>1e-6&&(qe.y0+=$e,qe.y1+=$e),_e=qe.y1+le}),se.update(Ie)}return{circular:Ce,key:ae,trace:fe,guid:l.randstr(),horizontal:oe,width:me,height:be,nodePad:fe.node.pad,nodeLineColor:fe.node.line.color,nodeLineWidth:fe.node.line.width,linkLineColor:fe.link.line.color,linkLineWidth:fe.link.line.width,linkArrowLength:fe.link.arrowlen,valueFormat:fe.valueformat,valueSuffix:fe.valuesuffix,textFont:fe.textfont,translateX:ie.x[0]*Z.width+Z.margin.l,translateY:Z.height-ie.y[1]*Z.height+Z.margin.t,dragParallel:oe?be:me,dragPerpendicular:oe?me:be,arrangement:fe.arrangement,sankey:se,graph:Ie,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function p(Z,K,ae){var se=u(K.color),he=u(K.hovercolor),fe=K.source.label+"|"+K.target.label+"__"+ae;return K.trace=Z.trace,K.curveNumber=Z.trace.index,{circular:Z.circular,key:fe,traceId:Z.key,pointNumber:K.pointNumber,link:K,tinyColorHue:r.tinyRGB(se),tinyColorAlpha:se.getAlpha(),tinyColorHoverHue:r.tinyRGB(he),tinyColorHoverAlpha:he.getAlpha(),linkPath:M,linkLineColor:Z.linkLineColor,linkLineWidth:Z.linkLineWidth,linkArrowLength:Z.linkArrowLength,valueFormat:Z.valueFormat,valueSuffix:Z.valueSuffix,sankey:Z.sankey,parent:Z,interactionState:Z.interactionState,flow:K.flow}}function M(){return function(Z){var K=Z.linkArrowLength;if(Z.link.circular)return function(Le,Oe){var We=Le.width/2,Ie=Le.circularPathData;return Le.circularLinkType==="top"?"M "+(Ie.targetX-Oe)+" "+(Ie.targetY+We)+" L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY+We)+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightSmallArcRadius+We)+" 0 0 1 "+(Ie.rightFullExtent-We-Oe)+" "+(Ie.targetY-Ie.rightSmallArcRadius)+"L"+(Ie.rightFullExtent-We-Oe)+" "+Ie.verticalRightInnerExtent+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightLargeArcRadius+We)+" 0 0 1 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent-We)+"L"+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent-We)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftLargeArcRadius+We)+" 0 0 1 "+(Ie.leftFullExtent+We)+" "+Ie.verticalLeftInnerExtent+"L"+(Ie.leftFullExtent+We)+" "+(Ie.sourceY-Ie.leftSmallArcRadius)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftSmallArcRadius+We)+" 0 0 1 "+Ie.leftInnerExtent+" "+(Ie.sourceY+We)+"L"+Ie.sourceX+" "+(Ie.sourceY+We)+"L"+Ie.sourceX+" "+(Ie.sourceY-We)+"L"+Ie.leftInnerExtent+" "+(Ie.sourceY-We)+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftSmallArcRadius-We)+" 0 0 0 "+(Ie.leftFullExtent-We)+" "+(Ie.sourceY-Ie.leftSmallArcRadius)+"L"+(Ie.leftFullExtent-We)+" "+Ie.verticalLeftInnerExtent+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftLargeArcRadius-We)+" 0 0 0 "+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent+We)+"L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent+We)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightLargeArcRadius-We)+" 0 0 0 "+(Ie.rightFullExtent+We-Oe)+" "+Ie.verticalRightInnerExtent+"L"+(Ie.rightFullExtent+We-Oe)+" "+(Ie.targetY-Ie.rightSmallArcRadius)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightSmallArcRadius-We)+" 0 0 0 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY-We)+"L"+(Ie.targetX-Oe)+" "+(Ie.targetY-We)+(Oe>0?"L"+Ie.targetX+" "+Ie.targetY:"")+"Z":"M "+(Ie.targetX-Oe)+" "+(Ie.targetY-We)+" L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY-We)+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightSmallArcRadius+We)+" 0 0 0 "+(Ie.rightFullExtent-We-Oe)+" "+(Ie.targetY+Ie.rightSmallArcRadius)+"L"+(Ie.rightFullExtent-We-Oe)+" "+Ie.verticalRightInnerExtent+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightLargeArcRadius+We)+" 0 0 0 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent+We)+"L"+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent+We)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftLargeArcRadius+We)+" 0 0 0 "+(Ie.leftFullExtent+We)+" "+Ie.verticalLeftInnerExtent+"L"+(Ie.leftFullExtent+We)+" "+(Ie.sourceY+Ie.leftSmallArcRadius)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftSmallArcRadius+We)+" 0 0 0 "+Ie.leftInnerExtent+" "+(Ie.sourceY-We)+"L"+Ie.sourceX+" "+(Ie.sourceY-We)+"L"+Ie.sourceX+" "+(Ie.sourceY+We)+"L"+Ie.leftInnerExtent+" "+(Ie.sourceY+We)+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftSmallArcRadius-We)+" 0 0 1 "+(Ie.leftFullExtent-We)+" "+(Ie.sourceY+Ie.leftSmallArcRadius)+"L"+(Ie.leftFullExtent-We)+" "+Ie.verticalLeftInnerExtent+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftLargeArcRadius-We)+" 0 0 1 "+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent-We)+"L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent-We)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightLargeArcRadius-We)+" 0 0 1 "+(Ie.rightFullExtent+We-Oe)+" "+Ie.verticalRightInnerExtent+"L"+(Ie.rightFullExtent+We-Oe)+" "+(Ie.targetY+Ie.rightSmallArcRadius)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightSmallArcRadius-We)+" 0 0 1 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY+We)+"L"+(Ie.targetX-Oe)+" "+(Ie.targetY+We)+(Oe>0?"L"+Ie.targetX+" "+Ie.targetY:"")+"Z"}(Z.link,K);var ae=Math.abs((Z.link.target.x0-Z.link.source.x1)/2);K>ae&&(K=ae);var se=Z.link.source.x1,he=Z.link.target.x0-K,fe=d(se,he),ie=fe(.5),oe=fe(.5),le=Z.link.y0-Z.link.width/2,ge=Z.link.y0+Z.link.width/2,ye=Z.link.y1-Z.link.width/2,me=Z.link.y1+Z.link.width/2,be="M"+se+","+le,Se="C"+ie+","+le+" "+oe+","+ye+" "+he+","+ye,Ee="C"+oe+","+me+" "+ie+","+ge+" "+se+","+ge,Ce=K>0?"L"+(he+K)+","+(ye+Z.link.width/2):"";return be+Se+(Ce+="L"+he+","+me)+Ee+"Z"}}function f(Z,K){var ae=u(K.color),se=_.nodePadAcross,he=Z.nodePad/2;K.dx=K.x1-K.x0,K.dy=K.y1-K.y0;var fe=K.dx,ie=Math.max(.5,K.dy),oe="node_"+K.pointNumber;return K.group&&(oe=l.randstr()),K.trace=Z.trace,K.curveNumber=Z.trace.index,{index:K.pointNumber,key:oe,partOfGroup:K.partOfGroup||!1,group:K.group,traceId:Z.key,trace:Z.trace,node:K,nodePad:Z.nodePad,nodeLineColor:Z.nodeLineColor,nodeLineWidth:Z.nodeLineWidth,textFont:Z.textFont,size:Z.horizontal?Z.height:Z.width,visibleWidth:Math.ceil(fe),visibleHeight:ie,zoneX:-se,zoneY:-he,zoneWidth:fe+2*se,zoneHeight:ie+2*he,labelY:Z.horizontal?K.dy/2+1:K.dx/2+1,left:K.originalLayer===1,sizeAcross:Z.width,forceLayouts:Z.forceLayouts,horizontal:Z.horizontal,darkBackground:ae.getBrightness()<=128,tinyColorHue:r.tinyRGB(ae),tinyColorAlpha:ae.getAlpha(),valueFormat:Z.valueFormat,valueSuffix:Z.valueSuffix,sankey:Z.sankey,graph:Z.graph,arrangement:Z.arrangement,uniqueNodeLabelPathId:[Z.guid,Z.key,oe].join("_"),interactionState:Z.interactionState,figure:Z}}function E(Z){Z.attr("transform",function(K){return o(K.node.x0.toFixed(3),K.node.y0.toFixed(3))})}function I(Z){Z.call(E)}function B(Z,K){Z.call(I),K.attr("d",M())}function N(Z){Z.attr("width",function(K){return K.node.x1-K.node.x0}).attr("height",function(K){return K.visibleHeight})}function V(Z){return Z.link.width>1||Z.linkLineWidth>0}function j(Z){return o(Z.translateX,Z.translateY)+(Z.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function $(Z,K,ae){Z.on(".basic",null).on("mouseover.basic",function(se){se.interactionState.dragInProgress||se.partOfGroup||(ae.hover(this,se,K),se.interactionState.hovered=[this,se])}).on("mousemove.basic",function(se){se.interactionState.dragInProgress||se.partOfGroup||(ae.follow(this,se),se.interactionState.hovered=[this,se])}).on("mouseout.basic",function(se){se.interactionState.dragInProgress||se.partOfGroup||(ae.unhover(this,se,K),se.interactionState.hovered=!1)}).on("click.basic",function(se){se.interactionState.hovered&&(ae.unhover(this,se,K),se.interactionState.hovered=!1),se.interactionState.dragInProgress||se.partOfGroup||ae.select(this,se,K)})}function ee(Z,K,ae,se){var he=e.behavior.drag().origin(function(fe){return{x:fe.node.x0+fe.visibleWidth/2,y:fe.node.y0+fe.visibleHeight/2}}).on("dragstart",function(fe){if(fe.arrangement!=="fixed"&&(l.ensureSingle(se._fullLayout._infolayer,"g","dragcover",function(oe){se._fullLayout._dragCover=oe}),l.raiseToTop(this),fe.interactionState.dragInProgress=fe.node,J(fe.node),fe.interactionState.hovered&&(ae.nodeEvents.unhover.apply(0,fe.interactionState.hovered),fe.interactionState.hovered=!1),fe.arrangement==="snap")){var ie=fe.traceId+"|"+fe.key;fe.forceLayouts[ie]?fe.forceLayouts[ie].alpha(1):function(oe,le,ge,ye){(function(be){for(var Se=0;Se0&&Ce.forceLayouts[Se].alpha(0)}}(0,le,me,ge)).stop()}(0,ie,fe),function(oe,le,ge,ye,me){window.requestAnimationFrame(function be(){var Se;for(Se=0;Se<_.forceTicksPerFrame;Se++)ge.forceLayouts[ye].tick();if(function(Ce){for(var Le=0;Le0)window.requestAnimationFrame(be);else{var Ee=ge.node.originalX;ge.node.x0=Ee-ge.visibleWidth/2,ge.node.x1=Ee+ge.visibleWidth/2,H(ge,me)}})}(Z,K,fe,ie,se)}}).on("drag",function(fe){if(fe.arrangement!=="fixed"){var ie=e.event.x,oe=e.event.y;fe.arrangement==="snap"?(fe.node.x0=ie-fe.visibleWidth/2,fe.node.x1=ie+fe.visibleWidth/2,fe.node.y0=oe-fe.visibleHeight/2,fe.node.y1=oe+fe.visibleHeight/2):(fe.arrangement==="freeform"&&(fe.node.x0=ie-fe.visibleWidth/2,fe.node.x1=ie+fe.visibleWidth/2),oe=Math.max(0,Math.min(fe.size-fe.visibleHeight/2,oe)),fe.node.y0=oe-fe.visibleHeight/2,fe.node.y1=oe+fe.visibleHeight/2),J(fe.node),fe.arrangement!=="snap"&&(fe.sankey.update(fe.graph),B(Z.filter(Q(fe)),K))}}).on("dragend",function(fe){if(fe.arrangement!=="fixed"){fe.interactionState.dragInProgress=!1;for(var ie=0;iek&&ee[v].gap;)v--;for(T=ee[v].s,A=ee.length-1;A>v;A--)ee[A].s=T;for(;kB[s]&&s=0;s--){var c=w[s];if(c.type==="scatter"&&c.xaxis===l.xaxis&&c.yaxis===l.yaxis){c.opacity=void 0;break}}}}}},40247:function(D,L,t){var b=t(34809),d=t(33626),e=t(36640),w=t(32660),y=t(64726),_=t(99867),u=t(99669),r=t(382),n=t(24272),l=t(98168),o=t(91602),s=t(663),c=t(54114),h=t(34809).coercePattern;D.exports=function(x,m,g,k){function A(I,B){return b.coerce(x,m,e,I,B)}var v=_(x,m,k,A);if(v||(m.visible=!1),m.visible){u(x,m,k,A),A("xhoverformat"),A("yhoverformat"),A("zorder");var S=r(x,m,k,A);k.scattermode==="group"&&m.orientation===void 0&&A("orientation","v");var T=!S&&v=Math.min(Q,Z)&&x<=Math.max(Q,Z)?0:1/0}var K=Math.max(3,J.mrc||0),ae=1-1/K,se=Math.abs(c.c2p(J.x)-x);return se=Math.min(Q,Z)&&m<=Math.max(Q,Z)?0:1/0}var K=Math.max(3,J.mrc||0),ae=1-1/K,se=Math.abs(h.c2p(J.y)-m);return seZ!=(oe=ae[K][1])>=Z&&(he=ae[K-1][0],fe=ae[K][0],oe-ie&&(se=he+(fe-he)*(Z-ie)/(oe-ie),ge=Math.min(ge,se),ye=Math.max(ye,se)));return{x0:ge=Math.max(ge,0),x1:ye=Math.min(ye,c._length),y0:Z,y1:Z}}(s._polygons);ee===null&&(ee={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var H=y.defaultLine;return y.opacity(s.fillcolor)?H=s.fillcolor:y.opacity((s.line||{}).color)&&(H=s.line.color),b.extendFlat(u,{distance:u.maxHoverDistance,x0:ee.x0,x1:ee.x1,y0:ee.y0,y1:ee.y1,color:H,hovertemplate:!1}),delete u.index,s.text&&!b.isArrayOrTypedArray(s.text)?u.text=String(s.text):u.text=s.name,[u]}}},69693:function(D,L,t){var b=t(64726);D.exports={hasLines:b.hasLines,hasMarkers:b.hasMarkers,hasText:b.hasText,isBubble:b.isBubble,attributes:t(36640),layoutAttributes:t(26667),supplyDefaults:t(40247),crossTraceDefaults:t(53044),supplyLayoutDefaults:t(12332),calc:t(26544).calc,crossTraceCalc:t(75603),arraysToCalcdata:t(99203),plot:t(36098),colorbar:t(21146),formatLabels:t(15294),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(37255),selectPoints:t(32665),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t(37703),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},26667:function(D){D.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},12332:function(D,L,t){var b=t(34809),d=t(26667);D.exports=function(e,w){var y,_=w.barmode==="group";w.scattermode==="group"&&(y=_?w.bargap:.2,b.coerce(e,w,d,"scattergap",y))}},98168:function(D,L,t){var b=t(34809).isArrayOrTypedArray,d=t(65477).hasColorscale,e=t(39356);D.exports=function(w,y,_,u,r,n){n||(n={});var l=(w.marker||{}).color;l&&l._inputArray&&(l=l._inputArray),r("line.color",_),d(w,"line")?e(w,y,u,r,{prefix:"line.",cLetter:"c"}):r("line.color",!b(l)&&l||_),r("line.width"),n.noDash||r("line.dash"),n.backoff&&r("line.backoff")}},5525:function(D,L,t){var b=t(62203),d=t(63821),e=d.BADNUM,w=d.LOG_CLIP,y=w+.5,_=w-.5,u=t(34809),r=u.segmentsIntersect,n=u.constrain,l=t(32660);D.exports=function(o,s){var c,h,x,m,g,k,A,v,S,T,p,M,f,E,I,B,N,V,j=s.trace||{},$=s.xaxis,ee=s.yaxis,H=$.type==="log",J=ee.type==="log",Q=$._length,Z=ee._length,K=s.backoff,ae=j.marker,se=s.connectGaps,he=s.baseTolerance,fe=s.shape,ie=fe==="linear",oe=j.fill&&j.fill!=="none",le=[],ge=l.minTolerance,ye=o.length,me=new Array(ye),be=0;function Se(Pt){var at=o[Pt];if(!at)return!1;var lt=s.linearized?$.l2p(at.x):$.c2p(at.x),Xe=s.linearized?ee.l2p(at.y):ee.c2p(at.y);if(lt===e){if(H&&(lt=$.c2p(at.x,!0)),lt===e)return!1;J&&Xe===e&&(lt*=Math.abs($._m*Z*($._m>0?y:_)/(ee._m*Q*(ee._m>0?y:_)))),lt*=1e3}if(Xe===e){if(J&&(Xe=ee.c2p(at.y,!0)),Xe===e)return!1;Xe*=1e3}return[lt,Xe]}function Ee(Pt,at,lt,Xe){var ut=lt-Pt,Tt=Xe-at,vt=.5-Pt,Lt=.5-at,Ut=ut*ut+Tt*Tt,rt=ut*vt+Tt*Lt;if(rt>0&&rtFe||Pt[1]$e)return[n(Pt[0],He,Fe),n(Pt[1],qe,$e)]}function De(Pt,at){return Pt[0]===at[0]&&(Pt[0]===He||Pt[0]===Fe)||Pt[1]===at[1]&&(Pt[1]===qe||Pt[1]===$e)||void 0}function Be(Pt,at,lt){return function(Xe,ut){var Tt=_e(Xe),vt=_e(ut),Lt=[];if(Tt&&vt&&De(Tt,vt))return Lt;Tt&&Lt.push(Tt),vt&&Lt.push(vt);var Ut=2*u.constrain((Xe[Pt]+ut[Pt])/2,at,lt)-((Tt||Xe)[Pt]+(vt||ut)[Pt]);return Ut&&((Tt&&vt?Ut>0==Tt[Pt]>vt[Pt]?Tt:vt:Tt||vt)[Pt]+=Ut),Lt}}function Ge(Pt){var at=Pt[0],lt=Pt[1],Xe=at===me[be-1][0],ut=lt===me[be-1][1];if(!Xe||!ut)if(be>1){var Tt=at===me[be-2][0],vt=lt===me[be-2][1];Xe&&(at===He||at===Fe)&&Tt?vt?be--:me[be-1]=Pt:ut&&(lt===qe||lt===$e)&&vt?Tt?be--:me[be-1]=Pt:me[be++]=Pt}else me[be++]=Pt}function tt(Pt){me[be-1][0]!==Pt[0]&&me[be-1][1]!==Pt[1]&&Ge([Ie,Ve]),Ge(Pt),Pe=null,Ie=Ve=0}fe==="linear"||fe==="spline"?Me=function(Pt,at){for(var lt=[],Xe=0,ut=0;ut<4;ut++){var Tt=Ye[ut],vt=r(Pt[0],Pt[1],at[0],at[1],Tt[0],Tt[1],Tt[2],Tt[3]);vt&&(!Xe||Math.abs(vt.x-lt[0][0])>1||Math.abs(vt.y-lt[0][1])>1)&&(vt=[vt.x,vt.y],Xe&&Le(vt,Pt)Fe?Fe:0,We=Pt[1]$e?$e:0,Oe||We){if(be)if(Pe){var at=Me(Pe,Pt);at.length>1&&(tt(at[0]),me[be++]=at[1])}else de=Me(me[be-1],Pt)[0],me[be++]=de;else me[be++]=[Oe||Pt[0],We||Pt[1]];var lt=me[be-1];Oe&&We&&(lt[0]!==Oe||lt[1]!==We)?(Pe&&(Ie!==Oe&&Ve!==We?Ge(Ie&&Ve?(Xe=Pe,Tt=(ut=Pt)[0]-Xe[0],vt=(ut[1]-Xe[1])/Tt,(Xe[1]*ut[0]-ut[1]*Xe[0])/Tt>0?[vt>0?He:Fe,$e]:[vt>0?Fe:He,qe]):[Ie||Oe,Ve||We]):Ie&&Ve&&Ge([Ie,Ve])),Ge([Oe,We])):Ie-Oe&&Ve-We&&Ge([Oe||Ie,We||Ve]),Pe=Pt,Ie=Oe,Ve=We}else Pe&&tt(Me(Pe,Pt)[0]),me[be++]=Pt;var Xe,ut,Tt,vt}for(c=0;cCe(k,At))break;x=k,(f=S[0]*v[0]+S[1]*v[1])>p?(p=f,m=k,A=!1):f=o.length||!k)break;pt(k),h=k}}else pt(m)}Pe&&Ge([Ie||Pe[0],Ve||Pe[1]]),le.push(me.slice(0,be))}var wt=fe.slice(fe.length-1);if(K&&wt!=="h"&&wt!=="v"){for(var Nt=!1,Ht=-1,Gt=[],st=0;st=0?u=s:(u=s=o,o++),u0?Math.max(n,_):0}}},21146:function(D){D.exports={container:"marker",min:"cmin",max:"cmax"}},24272:function(D,L,t){var b=t(78766),d=t(65477).hasColorscale,e=t(39356),w=t(64726);D.exports=function(y,_,u,r,n,l){var o=w.isBubble(y),s=(y.line||{}).color;l=l||{},s&&(u=s),n("marker.symbol"),n("marker.opacity",o?.7:1),n("marker.size"),l.noAngle||(n("marker.angle"),l.noAngleRef||n("marker.angleref"),l.noStandOff||n("marker.standoff")),n("marker.color",u),d(y,"marker")&&e(y,_,r,n,{prefix:"marker.",cLetter:"c"}),l.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),l.noLine||(n("marker.line.color",s&&!Array.isArray(s)&&_.marker.color!==s?s:o?b.background:b.defaultLine),d(y,"marker.line")&&e(y,_,r,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",o?1:0)),o&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),l.gradient&&n("marker.gradient.type")!=="none"&&n("marker.gradient.color")}},99669:function(D,L,t){var b=t(34809).dateTick0,d=t(63821).ONEWEEK;function e(w,y){return b(y,w%d==0?1:0)}D.exports=function(w,y,_,u,r){if(r||(r={x:!0,y:!0}),r.x){var n=u("xperiod");n&&(u("xperiod0",e(n,y.xcalendar)),u("xperiodalignment"))}if(r.y){var l=u("yperiod");l&&(u("yperiod0",e(l,y.ycalendar)),u("yperiodalignment"))}}},36098:function(D,L,t){var b=t(45568),d=t(33626),e=t(34809),w=e.ensureSingle,y=e.identity,_=t(62203),u=t(64726),r=t(5525),n=t(17210),l=t(80899).tester;function o(s,c,h,x,m,g,k){var A,v=s._context.staticPlot;(function(Ge,tt,nt,pt,At){var wt=nt.xaxis,Nt=nt.yaxis,Ht=b.extent(e.simpleMap(wt.range,wt.r2c)),Gt=b.extent(e.simpleMap(Nt.range,Nt.r2c)),st=pt[0].trace;if(u.hasMarkers(st)){var Qe=st.marker.maxdisplayed;if(Qe!==0){var ft=pt.filter(function(at){return at.x>=Ht[0]&&at.x<=Ht[1]&&at.y>=Gt[0]&&at.y<=Gt[1]}),yt=Math.ceil(ft.length/Qe),Ot=0;At.forEach(function(at,lt){var Xe=at[0].trace;u.hasMarkers(Xe)&&Xe.marker.maxdisplayed>0&<0;function T(Ge){return S?Ge.transition():Ge}var p=h.xaxis,M=h.yaxis,f=x[0].trace,E=f.line,I=b.select(g),B=w(I,"g","errorbars"),N=w(I,"g","lines"),V=w(I,"g","points"),j=w(I,"g","text");if(d.getComponentMethod("errorbars","plot")(s,B,h,k),f.visible===!0){var $,ee;T(I).style("opacity",f.opacity);var H,J,Q=f.fill.charAt(f.fill.length-1);Q!=="x"&&Q!=="y"&&(Q=""),Q==="y"?(H=1,J=M.c2p(0,!0)):Q==="x"&&(H=0,J=p.c2p(0,!0)),x[0][h.isRangePlot?"nodeRangePlot3":"node3"]=I;var Z,K,ae="",se=[],he=f._prevtrace,fe=null,ie=null;he&&(ae=he._prevRevpath||"",ee=he._nextFill,se=he._ownPolygons,fe=he._fillsegments,ie=he._fillElement);var oe,le,ge,ye,me,be,Se="",Ee="",Ce=[];f._polygons=[];var Le=[],Oe=[],We=e.noop;if($=f._ownFill,u.hasLines(f)||f.fill!=="none"){ee&&ee.datum(x),["hv","vh","hvh","vhv"].indexOf(E.shape)!==-1?(oe=_.steps(E.shape),le=_.steps(E.shape.split("").reverse().join(""))):oe=le=E.shape==="spline"?function(Ge){var tt=Ge[Ge.length-1];return Ge.length>1&&Ge[0][0]===tt[0]&&Ge[0][1]===tt[1]?_.smoothclosed(Ge.slice(1),E.smoothing):_.smoothopen(Ge,E.smoothing)}:function(Ge){return"M"+Ge.join("L")},ge=function(Ge){return le(Ge.reverse())},Oe=r(x,{xaxis:p,yaxis:M,trace:f,connectGaps:f.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,backoff:E.backoff,simplify:E.simplify,fill:f.fill}),Le=new Array(Oe.length);var Ie=0;for(A=0;A0,T=n(s,c,h);(k=x.selectAll("g.trace").data(T,function(p){return p[0].trace.uid})).enter().append("g").attr("class",function(p){return"trace scatter trace"+p[0].trace.uid}).style("stroke-miterlimit",2),k.order(),function(p,M,f){M.each(function(E){var I=w(b.select(this),"g","fills");_.setClipUrl(I,f.layerClipId,p);var B=E[0].trace,N=[];B._ownfill&&N.push("_ownFill"),B._nexttrace&&N.push("_nextFill");var V=I.selectAll("g").data(N,y);V.enter().append("g"),V.exit().each(function(j){B[j]=null}).remove(),V.order().each(function(j){B[j]=w(b.select(this),"path","js-fill")})})}(s,k,c),S?(g&&(A=g()),b.transition().duration(m.duration).ease(m.easing).each("end",function(){A&&A()}).each("interrupt",function(){A&&A()}).each(function(){x.selectAll("g.trace").each(function(p,M){o(s,M,c,p,T,this,m)})})):k.each(function(p,M){o(s,M,c,p,T,this,m)}),v&&k.exit().remove(),x.selectAll("path:not([d])").remove()}},32665:function(D,L,t){var b=t(64726);D.exports=function(d,e){var w,y,_,u,r=d.cd,n=d.xaxis,l=d.yaxis,o=[],s=r[0].trace;if(!b.hasMarkers(s)&&!b.hasText(s))return[];if(e===!1)for(w=0;w0){var h=_.c2l(s);_._lowerLogErrorBound||(_._lowerLogErrorBound=h),_._lowerErrorBound=Math.min(_._lowerLogErrorBound,h)}}else r[n]=[-l[0]*y,l[1]*y]}return r}D.exports=function(e,w,y){var _=[d(e.x,e.error_x,w[0],y.xaxis),d(e.y,e.error_y,w[1],y.yaxis),d(e.z,e.error_z,w[2],y.zaxis)],u=function(c){for(var h=0;h-1?-1:M.indexOf("right")>-1?1:0}function k(M){return M==null?0:M.indexOf("top")>-1?-1:M.indexOf("bottom")>-1?1:0}function A(M,f){return f(4*M)}function v(M){return o[M]}function S(M,f,E,I,B){var N=null;if(_.isArrayOrTypedArray(M)){N=[];for(var V=0;V=0){var ee=function(H,J,Q){var Z,K=(Q+1)%3,ae=(Q+2)%3,se=[],he=[];for(Z=0;Z=0&&s("surfacecolor",h||x);for(var m=["x","y","z"],g=0;g<3;++g){var k="projection."+m[g];s(k+".show")&&(s(k+".opacity"),s(k+".scale"))}var A=b.getComponentMethod("errorbars","supplyDefaults");A(r,n,h||x||l,{axis:"z"}),A(r,n,h||x||l,{axis:"y",inherit:"z"}),A(r,n,h||x||l,{axis:"x",inherit:"z"})}else n.visible=!1}},17822:function(D,L,t){D.exports={plot:t(16533),attributes:t(14117),markerSymbols:t(49467),supplyDefaults:t(82418),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t(37593),moduleType:"trace",name:"scatter3d",basePlotModule:t(2487),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},54637:function(D,L,t){var b=t(19326),d=t(36640),e=t(9829),w=t(3208).rb,y=t(3208).ay,_=t(87163),u=t(93049).extendFlat,r=d.marker,n=d.line,l=r.line;D.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:u({},d.mode,{dflt:"markers"}),text:u({},d.text,{}),texttemplate:y({editType:"plot"},{keys:["a","b","text"]}),hovertext:u({},d.hovertext,{}),line:{color:n.color,width:n.width,dash:n.dash,backoff:n.backoff,shape:u({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:d.connectgaps,fill:u({},d.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:b(),marker:u({symbol:r.symbol,opacity:r.opacity,maxdisplayed:r.maxdisplayed,angle:r.angle,angleref:r.angleref,standoff:r.standoff,size:r.size,sizeref:r.sizeref,sizemin:r.sizemin,sizemode:r.sizemode,line:u({width:l.width,editType:"calc"},_("marker.line")),gradient:r.gradient,editType:"calc"},_("marker")),textfont:d.textfont,textposition:d.textposition,selected:d.selected,unselected:d.unselected,hoverinfo:u({},e.hoverinfo,{flags:["a","b","text","name"]}),hoveron:d.hoveron,hovertemplate:w(),zorder:d.zorder}},68001:function(D,L,t){var b=t(10721),d=t(77272),e=t(99203),w=t(48861),y=t(26544).calcMarkerSize,_=t(26571);D.exports=function(u,r){var n=r._carpetTrace=_(u,r);if(n&&n.visible&&n.visible!=="legendonly"){var l;r.xaxis=n.xaxis,r.yaxis=n.yaxis;var o,s,c=r._length,h=new Array(c),x=!1;for(l=0;l")}return u}function A(v,S){var T;T=v.labelprefix&&v.labelprefix.length>0?v.labelprefix.replace(/ = $/,""):v._hovertitle,g.push(T+": "+S.toFixed(3)+v.labelsuffix)}}},56534:function(D,L,t){D.exports={attributes:t(54637),supplyDefaults:t(16986),colorbar:t(21146),formatLabels:t(32709),calc:t(68001),plot:t(64535),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(59420),selectPoints:t(32665),eventData:t(68289),moduleType:"trace",name:"scattercarpet",basePlotModule:t(37703),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},64535:function(D,L,t){var b=t(36098),d=t(29714),e=t(62203);D.exports=function(w,y,_,u){var r,n,l,o=_[0][0].carpet,s=d.getFromId(w,o.xaxis||"x"),c=d.getFromId(w,o.yaxis||"y"),h={xaxis:s,yaxis:c,plot:y.plot};for(r=0;r<_.length;r++)(n=_[r][0].trace)._xA=s,n._yA=c;for(b(w,h,_,u),r=0;r<_.length;r++)n=_[r][0].trace,l=u.selectAll("g.trace"+n.uid+" .js-line"),e.setClipUrl(l,_[r][0].carpet._clipPathId,w)}},6893:function(D,L,t){var b=t(3208).rb,d=t(3208).ay,e=t(19326),w=t(36640),y=t(9829),_=t(87163),u=t(94850).T,r=t(93049).extendFlat,n=t(13582).overrideAll,l=w.marker,o=w.line,s=l.line;D.exports=n({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:r({},w.mode,{dflt:"markers"}),text:r({},w.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:r({},w.hovertext,{}),textfont:w.textfont,textposition:w.textposition,line:{color:o.color,width:o.width,dash:u},connectgaps:w.connectgaps,marker:r({symbol:l.symbol,opacity:l.opacity,angle:l.angle,angleref:r({},l.angleref,{values:["previous","up","north"]}),standoff:l.standoff,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,colorbar:l.colorbar,line:r({width:s.width},_("marker.line")),gradient:l.gradient},_("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:e(),selected:w.selected,unselected:w.unselected,hoverinfo:r({},y.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:b()},"calc","nested")},75649:function(D,L,t){var b=t(10721),d=t(63821).BADNUM,e=t(77272),w=t(99203),y=t(48861),_=t(34809).isArrayOrTypedArray,u=t(34809)._;function r(n){return n&&typeof n=="string"}D.exports=function(n,l){var o,s=_(l.locations),c=s?l.locations.length:l._length,h=new Array(c);o=l.geojson?function(v){return r(v)||b(v)}:r;for(var x=0;x")}function ee(H){return H+"°"}}(l,m,_,n[0].t.labels),_.hovertemplate=l.hovertemplate,[_]}}},18070:function(D,L,t){D.exports={attributes:t(6893),supplyDefaults:t(27386),colorbar:t(21146),formatLabels:t(57413),calc:t(75649),calcGeoJSON:t(48887).calcGeoJSON,plot:t(48887).plot,style:t(60367),styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(40636),eventData:t(71873),selectPoints:t(45852),moduleType:"trace",name:"scattergeo",basePlotModule:t(47544),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},48887:function(D,L,t){var b=t(45568),d=t(34809),e=t(11577).getTopojsonFeatures,w=t(39532),y=t(3994),_=t(32919).findExtremes,u=t(63821).BADNUM,r=t(26544).calcMarkerSize,n=t(64726),l=t(60367);D.exports={calcGeoJSON:function(o,s){var c,h,x=o[0].trace,m=s[x.geo],g=m._subplot,k=x._length;if(d.isArrayOrTypedArray(x.locations)){var A=x.locationmode,v=A==="geojson-id"?y.extractTraceFeature(o):e(x,g.topojson);for(c=0;c=h,f=2*p,E={},I=v.makeCalcdata(g,"x"),B=S.makeCalcdata(g,"y"),N=y(g,v,"x",I),V=y(g,S,"y",B),j=N.vals,$=V.vals;g._x=j,g._y=$,g.xperiodalignment&&(g._origX=I,g._xStarts=N.starts,g._xEnds=N.ends),g.yperiodalignment&&(g._origY=B,g._yStarts=V.starts,g._yEnds=V.ends);var ee=new Array(f),H=new Array(p);for(k=0;k1&&d.extendFlat(oe.line,o.linePositions(K,se,he)),oe.errorX||oe.errorY){var le=o.errorBarPositions(K,se,he,fe,ie);oe.errorX&&d.extendFlat(oe.errorX,le.x),oe.errorY&&d.extendFlat(oe.errorY,le.y)}return oe.text&&(d.extendFlat(oe.text,{positions:he},o.textPosition(K,se,oe.text,oe.marker)),d.extendFlat(oe.textSel,{positions:he},o.textPosition(K,se,oe.text,oe.markerSel)),d.extendFlat(oe.textUnsel,{positions:he},o.textPosition(K,se,oe.text,oe.markerUnsel))),oe}(m,0,g,ee,j,$),Z=s(m,T);return n(A,g),M?Q.marker&&(J=Q.marker.sizeAvg||Math.max(Q.marker.size,3)):J=u(g,p),r(m,g,v,S,j,$,J),Q.errorX&&x(g,v,Q.errorX),Q.errorY&&x(g,S,Q.errorY),Q.fill&&!Z.fill2d&&(Z.fill2d=!0),Q.marker&&!Z.scatter2d&&(Z.scatter2d=!0),Q.line&&!Z.line2d&&(Z.line2d=!0),!Q.errorX&&!Q.errorY||Z.error2d||(Z.error2d=!0),Q.text&&!Z.glText&&(Z.glText=!0),Q.marker&&(Q.marker.snap=p),Z.lineOptions.push(Q.line),Z.errorXOptions.push(Q.errorX),Z.errorYOptions.push(Q.errorY),Z.fillOptions.push(Q.fill),Z.markerOptions.push(Q.marker),Z.markerSelectedOptions.push(Q.markerSel),Z.markerUnselectedOptions.push(Q.markerUnsel),Z.textOptions.push(Q.text),Z.textSelectedOptions.push(Q.textSel),Z.textUnselectedOptions.push(Q.textUnsel),Z.selectBatch.push([]),Z.unselectBatch.push([]),E._scene=Z,E.index=Z.count,E.x=j,E.y=$,E.positions=ee,Z.count++,[{x:!1,y:!1,t:E,trace:g}]}},29483:function(D){D.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},19937:function(D,L,t){var b=t(10721),d=t(96021),e=t(162),w=t(33626),y=t(34809),_=y.isArrayOrTypedArray,u=t(62203),r=t(5975),n=t(46998).formatColor,l=t(64726),o=t(92527),s=t(4075),c=t(29483),h=t(20438).DESELECTDIM,x={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t(36040).appendArrayPointValue;function g(N,V){var j,$=N._fullLayout,ee=V._length,H=V.textfont,J=V.textposition,Q=_(J)?J:[J],Z=H.color,K=H.size,ae=H.family,se=H.weight,he=H.style,fe=H.variant,ie={},oe=N._context.plotGlPixelRatio,le=V.texttemplate;if(le){ie.text=[];var ge=$._d3locale,ye=Array.isArray(le),me=ye?Math.min(le.length,ee):ee,be=ye?function(Ie){return le[Ie]}:function(){return le};for(j=0;j500?"bold":"normal":N}function A(N,V){var j,$,ee=V._length,H=V.marker,J={},Q=_(H.symbol),Z=_(H.angle),K=_(H.color),ae=_(H.line.color),se=_(H.opacity),he=_(H.size),fe=_(H.line.width);if(Q||($=s.isOpenSymbol(H.symbol)),Q||K||ae||se||Z){J.symbols=new Array(ee),J.angles=new Array(ee),J.colors=new Array(ee),J.borderColors=new Array(ee);var ie=H.symbol,oe=H.angle,le=n(H,H.opacity,ee),ge=n(H.line,H.opacity,ee);if(!_(ge[0])){var ye=ge;for(ge=Array(ee),j=0;jc.TOO_MANY_POINTS||l.hasMarkers(V)?"rect":"round";if(K&&V.connectgaps){var se=$[0],he=$[1];for(ee=0;ee<$.length;ee+=2)isNaN($[ee])||isNaN($[ee+1])?($[ee]=se,$[ee+1]=he):(se=$[ee],he=$[ee+1])}return{join:ae,positions:$}},errorBarPositions:function(N,V,j,$,ee){var H=w.getComponentMethod("errorbars","makeComputeError"),J=r.getFromId(N,V.xaxis,"x"),Q=r.getFromId(N,V.yaxis,"y"),Z=j.length/2,K={};function ae(se,he){var fe=he._id.charAt(0),ie=V["error_"+fe];if(ie&&ie.visible&&(he.type==="linear"||he.type==="log")){for(var oe=H(ie),le={x:0,y:1}[fe],ge={x:[0,1,2,3],y:[2,3,0,1]}[fe],ye=new Float64Array(4*Z),me=1/0,be=-1/0,Se=0,Ee=0;Se1?Z[ee]:Z[0]:Z,fe=_(K)?K.length>1?K[ee]:K[0]:K,ie=x[he],oe=x[fe],le=ae?ae/.8+1:0,ge=-oe*le-.5*oe;J.offset[ee]=[ie*le/se,ge/se]}}return J}}},86590:function(D,L,t){var b=t(34809),d=t(33626),e=t(4075),w=t(92089),y=t(32660),_=t(64726),u=t(99867),r=t(99669),n=t(24272),l=t(98168),o=t(54114),s=t(663);D.exports=function(c,h,x,m){function g(f,E){return b.coerce(c,h,w,f,E)}var k=!!c.marker&&e.isOpenSymbol(c.marker.symbol),A=_.isBubble(c),v=u(c,h,m,g);if(v){r(c,h,m,g),g("xhoverformat"),g("yhoverformat");var S=v100},L.isDotSymbol=function(d){return typeof d=="string"?b.DOT_RE.test(d):d>200}},36544:function(D,L,t){var b=t(33626),d=t(34809),e=t(11539);function w(y,_,u,r){var n=y.xa,l=y.ya,o=y.distance,s=y.dxy,c=y.index,h={pointNumber:c,x:_[c],y:u[c]};h.tx=d.isArrayOrTypedArray(r.text)?r.text[c]:r.text,h.htx=Array.isArray(r.hovertext)?r.hovertext[c]:r.hovertext,h.data=Array.isArray(r.customdata)?r.customdata[c]:r.customdata,h.tp=Array.isArray(r.textposition)?r.textposition[c]:r.textposition;var x=r.textfont;x&&(h.ts=d.isArrayOrTypedArray(x.size)?x.size[c]:x.size,h.tc=d.isArrayOrTypedArray(x.color)?x.color[c]:x.color,h.tf=Array.isArray(x.family)?x.family[c]:x.family,h.tw=Array.isArray(x.weight)?x.weight[c]:x.weight,h.ty=Array.isArray(x.style)?x.style[c]:x.style,h.tv=Array.isArray(x.variant)?x.variant[c]:x.variant);var m=r.marker;m&&(h.ms=d.isArrayOrTypedArray(m.size)?m.size[c]:m.size,h.mo=d.isArrayOrTypedArray(m.opacity)?m.opacity[c]:m.opacity,h.mx=d.isArrayOrTypedArray(m.symbol)?m.symbol[c]:m.symbol,h.ma=d.isArrayOrTypedArray(m.angle)?m.angle[c]:m.angle,h.mc=d.isArrayOrTypedArray(m.color)?m.color[c]:m.color);var g=m&&m.line;g&&(h.mlc=Array.isArray(g.color)?g.color[c]:g.color,h.mlw=d.isArrayOrTypedArray(g.width)?g.width[c]:g.width);var k=m&&m.gradient;k&&k.type!=="none"&&(h.mgt=Array.isArray(k.type)?k.type[c]:k.type,h.mgc=Array.isArray(k.color)?k.color[c]:k.color);var A=n.c2p(h.x,!0),v=l.c2p(h.y,!0),S=h.mrc||1,T=r.hoverlabel;T&&(h.hbg=Array.isArray(T.bgcolor)?T.bgcolor[c]:T.bgcolor,h.hbc=Array.isArray(T.bordercolor)?T.bordercolor[c]:T.bordercolor,h.hts=d.isArrayOrTypedArray(T.font.size)?T.font.size[c]:T.font.size,h.htc=Array.isArray(T.font.color)?T.font.color[c]:T.font.color,h.htf=Array.isArray(T.font.family)?T.font.family[c]:T.font.family,h.hnl=d.isArrayOrTypedArray(T.namelength)?T.namelength[c]:T.namelength);var p=r.hoverinfo;p&&(h.hi=Array.isArray(p)?p[c]:p);var M=r.hovertemplate;M&&(h.ht=Array.isArray(M)?M[c]:M);var f={};f[y.index]=h;var E=r._origX,I=r._origY,B=d.extendFlat({},y,{color:e(r,h),x0:A-S,x1:A+S,xLabelVal:E?E[c]:h.x,y0:v-S,y1:v+S,yLabelVal:I?I[c]:h.y,cd:f,distance:o,spikeDistance:s,hovertemplate:h.ht});return h.htx?B.text=h.htx:h.tx?B.text=h.tx:r.text&&(B.text=r.text),d.fillText(h,r,B),b.getComponentMethod("errorbars","hoverInfo")(h,r,B),B}D.exports={hoverPoints:function(y,_,u,r){var n,l,o,s,c,h,x,m,g,k,A=y.cd,v=A[0].t,S=A[0].trace,T=y.xa,p=y.ya,M=v.x,f=v.y,E=T.c2p(_),I=p.c2p(u),B=y.distance;if(v.tree){var N=T.p2c(E-B),V=T.p2c(E+B),j=p.p2c(I-B),$=p.p2c(I+B);n=r==="x"?v.tree.range(Math.min(N,V),Math.min(p._rl[0],p._rl[1]),Math.max(N,V),Math.max(p._rl[0],p._rl[1])):v.tree.range(Math.min(N,V),Math.min(j,$),Math.max(N,V),Math.max(j,$))}else n=v.ids;var ee=B;if(r==="x"){var H=!!S.xperiodalignment,J=!!S.yperiodalignment;for(h=0;h=Math.min(Q,Z)&&E<=Math.max(Q,Z)?0:1/0}if(x=Math.min(K,ae)&&I<=Math.max(K,ae)?0:1/0}k=Math.sqrt(x*x+m*m),o=n[h]}}}else for(h=n.length-1;h>-1;h--)s=M[l=n[h]],c=f[l],x=T.c2p(s)-E,m=p.c2p(c)-I,(g=Math.sqrt(x*x+m*m))A.glText.length){var M=T-A.glText.length;for(m=0;mye&&(isNaN(ge[me])||isNaN(ge[me+1]));)me-=2;le.positions=ge.slice(ye,me+2)}return le}),A.line2d.update(A.lineOptions)),A.error2d){var E=(A.errorXOptions||[]).concat(A.errorYOptions||[]);A.error2d.update(E)}A.scatter2d&&A.scatter2d.update(A.markerOptions),A.fillOrder=y.repeat(null,T),A.fill2d&&(A.fillOptions=A.fillOptions.map(function(le,ge){var ye=x[ge];if(le&&ye&&ye[0]&&ye[0].trace){var me,be,Se=ye[0],Ee=Se.trace,Ce=Se.t,Le=A.lineOptions[ge],Oe=[];Ee._ownfill&&Oe.push(ge),Ee._nexttrace&&Oe.push(ge+1),Oe.length&&(A.fillOrder[ge]=Oe);var We,Ie,Ve=[],Pe=Le&&Le.positions||Ce.positions;if(Ee.fill==="tozeroy"){for(We=0;WeWe&&isNaN(Pe[Ie+1]);)Ie-=2;Pe[We+1]!==0&&(Ve=[Pe[We],0]),Ve=Ve.concat(Pe.slice(We,Ie+2)),Pe[Ie+1]!==0&&(Ve=Ve.concat([Pe[Ie],0]))}else if(Ee.fill==="tozerox"){for(We=0;WeWe&&isNaN(Pe[Ie]);)Ie-=2;Pe[We]!==0&&(Ve=[0,Pe[We+1]]),Ve=Ve.concat(Pe.slice(We,Ie+2)),Pe[Ie]!==0&&(Ve=Ve.concat([0,Pe[Ie+1]]))}else if(Ee.fill==="toself"||Ee.fill==="tonext"){for(Ve=[],me=0,le.splitNull=!0,be=0;be-1;for(m=0;m850?" Black":M>750?" Extra Bold":M>650?" Bold":M>550?" Semi Bold":M>450?" Medium":M>350?" Regular":M>250?" Light":M>150?" Extra Light":" Thin"):f.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",I+=M>750?" Extrabold":M>650?" Bold":M>550?" Semibold":M>350?" Regular":" Light"):f.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",f[3]==="CJK"&&(I+=" CJK"),I+=M>500?" Bold":" Regular")),E&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=T),I.split(", ")}D.exports=function(v,S){var T,p=S[0].trace,M=p.visible===!0&&p._length!==0,f=p.fill!=="none",E=r.hasLines(p),I=r.hasMarkers(p),B=r.hasText(p),N=I&&p.marker.symbol==="circle",V=I&&p.marker.symbol!=="circle",j=p.cluster&&p.cluster.enabled,$=h("fill"),ee=h("line"),H=h("circle"),J=h("symbol"),Q={fill:$,line:ee,circle:H,symbol:J};if(!M)return Q;if((f||E)&&(T=w.calcTraceToLineCoords(S)),f&&($.geojson=w.makePolygon(T),$.layout.visibility="visible",d.extendFlat($.paint,{"fill-color":p.fillcolor})),E&&(ee.geojson=w.makeLine(T),ee.layout.visibility="visible",d.extendFlat(ee.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),N){var Z=function(se){var he,fe,ie,oe,le=se[0].trace,ge=le.marker,ye=le.selectedpoints,me=d.isArrayOrTypedArray(ge.color),be=d.isArrayOrTypedArray(ge.size),Se=d.isArrayOrTypedArray(ge.opacity);function Ee(de){return le.opacity*de}me&&(fe=y.hasColorscale(le,"marker")?y.makeColorScaleFuncFromTrace(ge):d.identity),be&&(ie=u(le)),Se&&(oe=function(de){return Ee(b(de)?+d.constrain(de,0,1):0)});var Ce,Le,Oe=[];for(he=0;he>>8*A)%256/255}function c(k,A,v){for(var S=new Array(8*A),T=0,p=0;ple&&(le=Z[se].dim1.canvasX,fe=se);ie===0&&n(I,0,0,v.canvasWidth,v.canvasHeight);var ge=function(Ie){var Ve,Pe,de,Me=[[],[]];for(de=0;de<64;de++){var ke=!Ie&&deye._length&&(We=We.slice(0,ye._length));var Ie,Ve=ye.tickvals;function Pe(Fe,qe){return{val:Fe,text:Ie[qe]}}function de(Fe,qe){return Fe.val-qe.val}if(e(Ve)&&Ve.length){d.isTypedArray(Ve)&&(Ve=Array.from(Ve)),Ie=ye.ticktext,e(Ie)&&Ie.length?Ie.length>Ve.length?Ie=Ie.slice(0,Ve.length):Ve.length>Ie.length&&(Ve=Ve.slice(0,Ie.length)):Ie=Ve.map(w(ye.tickformat));for(var Me=1;Me=$e||Be>=Ye)return;var Ge=Fe.lineLayer.readPixel(De,Ye-1-Be),tt=Ge[3]!==0,nt=tt?Ge[2]+256*(Ge[1]+256*Ge[0]):null,ft={x:De,y:Be,clientX:qe.clientX,clientY:qe.clientY,dataIndex:Fe.model.key,curveNumber:nt};nt!==Se&&(tt?K.hover(ft):K.unhover&&K.unhover(ft),Se=nt)}}),be.style("opacity",function(Fe){return Fe.pick?0:1}),he.style("background","rgba(255, 255, 255, 0)");var Ee=he.selectAll("."+g.cn.parcoords).data(me,c);Ee.exit().remove(),Ee.enter().append("g").classed(g.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ee.attr("transform",function(Fe){return r(Fe.model.translateX,Fe.model.translateY)});var Ce=Ee.selectAll("."+g.cn.parcoordsControlView).data(h,c);Ce.enter().append("g").classed(g.cn.parcoordsControlView,!0),Ce.attr("transform",function(Fe){return r(Fe.model.pad.l,Fe.model.pad.t)});var Le=Ce.selectAll("."+g.cn.yAxis).data(function(Fe){return Fe.dimensions},c);Le.enter().append("g").classed(g.cn.yAxis,!0),Ce.each(function(Fe){$(Le,Fe,ie)}),be.each(function(Fe){if(Fe.viewModel){!Fe.lineLayer||K?Fe.lineLayer=A(this,Fe):Fe.lineLayer.update(Fe),(Fe.key||Fe.key===0)&&(Fe.viewModel[Fe.key]=Fe.lineLayer);var qe=!Fe.context||K;Fe.lineLayer.render(Fe.viewModel.panels,qe)}}),Le.attr("transform",function(Fe){return r(Fe.xScale(Fe.xIndex),0)}),Le.call(b.behavior.drag().origin(function(Fe){return Fe}).on("drag",function(Fe){var qe=Fe.parent;ye.linePickActive(!1),Fe.x=Math.max(-g.overdrag,Math.min(Fe.model.width+g.overdrag,b.event.x)),Fe.canvasX=Fe.x*Fe.model.canvasPixelRatio,Le.sort(function($e,Ye){return $e.x-Ye.x}).each(function($e,Ye){$e.xIndex=Ye,$e.x=Fe===$e?$e.x:$e.xScale($e.xIndex),$e.canvasX=$e.x*$e.model.canvasPixelRatio}),$(Le,qe,ie),Le.filter(function($e){return Math.abs(Fe.xIndex-$e.xIndex)!==0}).attr("transform",function($e){return r($e.xScale($e.xIndex),0)}),b.select(this).attr("transform",r(Fe.x,0)),Le.each(function($e,Ye,_e){_e===Fe.parent.key&&(qe.dimensions[Ye]=$e)}),qe.contextLayer&&qe.contextLayer.render(qe.panels,!1,!I(qe)),qe.focusLayer.render&&qe.focusLayer.render(qe.panels)}).on("dragend",function(Fe){var qe=Fe.parent;Fe.x=Fe.xScale(Fe.xIndex),Fe.canvasX=Fe.x*Fe.model.canvasPixelRatio,$(Le,qe,ie),b.select(this).attr("transform",function($e){return r($e.x,0)}),qe.contextLayer&&qe.contextLayer.render(qe.panels,!1,!I(qe)),qe.focusLayer&&qe.focusLayer.render(qe.panels),qe.pickLayer&&qe.pickLayer.render(qe.panels,!0),ye.linePickActive(!0),K&&K.axesMoved&&K.axesMoved(qe.key,qe.dimensions.map(function($e){return $e.crossfilterDimensionIndex}))})),Le.exit().remove();var Oe=Le.selectAll("."+g.cn.axisOverlays).data(h,c);Oe.enter().append("g").classed(g.cn.axisOverlays,!0),Oe.selectAll("."+g.cn.axis).remove();var We=Oe.selectAll("."+g.cn.axis).data(h,c);We.enter().append("g").classed(g.cn.axis,!0),We.each(function(Fe){var qe=Fe.model.height/Fe.model.tickDistance,$e=Fe.domainScale,Ye=$e.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(qe,Fe.tickFormat).tickValues(Fe.ordinal?Ye:null).tickFormat(function(_e){return m.isOrdinal(Fe)?_e:ee(Fe.model.dimensions[Fe.visibleIndex],_e)}).scale($e)),l.font(We.selectAll("text"),Fe.model.tickFont)}),We.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),We.selectAll("text").style("cursor","default");var Ie=Oe.selectAll("."+g.cn.axisHeading).data(h,c);Ie.enter().append("g").classed(g.cn.axisHeading,!0);var Ve=Ie.selectAll("."+g.cn.axisTitle).data(h,c);Ve.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",ae?"none":"auto"),Ve.text(function(Fe){return Fe.label}).each(function(Fe){var qe=b.select(this);l.font(qe,Fe.model.labelFont),n.convertToTspans(qe,J)}).attr("transform",function(Fe){var qe=j(Fe.model.labelAngle,Fe.model.labelSide),$e=g.axisTitleOffset;return(qe.dir>0?"":r(0,2*$e+Fe.model.height))+u(qe.degrees)+r(-$e*qe.dx,-$e*qe.dy)}).attr("text-anchor",function(Fe){var qe=j(Fe.model.labelAngle,Fe.model.labelSide);return 2*Math.abs(qe.dx)>Math.abs(qe.dy)?qe.dir*qe.dx<0?"start":"end":"middle"});var Pe=Oe.selectAll("."+g.cn.axisExtent).data(h,c);Pe.enter().append("g").classed(g.cn.axisExtent,!0);var de=Pe.selectAll("."+g.cn.axisExtentTop).data(h,c);de.enter().append("g").classed(g.cn.axisExtentTop,!0),de.attr("transform",r(0,-g.axisExtentOffset));var Me=de.selectAll("."+g.cn.axisExtentTopText).data(h,c);Me.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(V),Me.text(function(Fe){return H(Fe,!0)}).each(function(Fe){l.font(b.select(this),Fe.model.rangeFont)});var ke=Pe.selectAll("."+g.cn.axisExtentBottom).data(h,c);ke.enter().append("g").classed(g.cn.axisExtentBottom,!0),ke.attr("transform",function(Fe){return r(0,Fe.model.height+g.axisExtentOffset)});var He=ke.selectAll("."+g.cn.axisExtentBottomText).data(h,c);He.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(V),He.text(function(Fe){return H(Fe,!1)}).each(function(Fe){l.font(b.select(this),Fe.model.rangeFont)}),k.ensureAxisBrush(Oe,oe,J)}},58823:function(D,L,t){var b=t(16019),d=t(22459),e=t(62935).isVisible,w={};function y(_,u,r){var n=u.indexOf(r),l=_.indexOf(n);return l===-1&&(l+=u.length),l}(D.exports=function(_,u){var r=_._fullLayout;if(d(_,[],w)){var n={},l={},o={},s={},c=r._size;u.forEach(function(h,x){var m=h[0].trace;o[x]=m.index;var g=s[x]=m._fullInput.index;n[x]=_.data[g].dimensions,l[x]=_.data[g].dimensions.slice()}),b(_,u,{width:c.w,height:c.h,margin:{t:c.t,r:c.r,b:c.b,l:c.l}},{filterChanged:function(h,x,m){var g=l[h][x],k=m.map(function(M){return M.slice()}),A="dimensions["+x+"].constraintrange",v=r._tracePreGUI[_._fullData[o[h]]._fullInput.uid];if(v[A]===void 0){var S=g.constraintrange;v[A]=S||null}var T=_._fullData[o[h]].dimensions[x];k.length?(k.length===1&&(k=k[0]),g.constraintrange=k,T.constraintrange=k.slice(),k=[k]):(delete g.constraintrange,delete T.constraintrange,k=null);var p={};p[A]=k,_.emit("plotly_restyle",[p,[s[h]]])},hover:function(h){_.emit("plotly_hover",h)},unhover:function(h){_.emit("plotly_unhover",h)},axesMoved:function(h,x){var m=function(g,k){return function(A,v){return y(g,k,A)-y(g,k,v)}}(x,l[h].filter(e));n[h].sort(m),l[h].filter(function(g){return!e(g)}).sort(function(g){return l[h].indexOf(g)}).forEach(function(g){n[h].splice(n[h].indexOf(g),1),n[h].splice(l[h].indexOf(g),0,g)}),_.emit("plotly_restyle",[{dimensions:[n[h]]},[s[h]]])}})}}).reglPrecompiled=w},55412:function(D,L,t){var b=t(9829),d=t(13792).u,e=t(80337),w=t(10229),y=t(3208).rb,_=t(3208).ay,u=t(93049).extendFlat,r=t(94850).k,n=e({editType:"plot",arrayOk:!0,colorEditType:"plot"});D.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:w.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:r,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:u({},b.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:y({},{keys:["label","color","value","percent","text"]}),texttemplate:_({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:u({},n,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:u({},n,{}),outsidetextfont:u({},n,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:u({},n,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:d({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"},_deprecated:{title:{valType:"string",dflt:"",editType:"calc"},titlefont:u({},n,{}),titleposition:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"calc"}}}},96052:function(D,L,t){var b=t(44122);L.name="pie",L.plot=function(d,e,w,y){b.plotBasePlot(L.name,d,e,w,y)},L.clean=function(d,e,w,y){b.cleanBasePlot(L.name,d,e,w,y)}},44148:function(D,L,t){var b=t(10721),d=t(65657),e=t(78766),w={};function y(u){return function(r,n){return!!r&&!!(r=d(r)).isValid()&&(r=e.addOpacity(r,r.getAlpha()),u[n]||(u[n]=r),r)}}function _(u,r){var n,l=JSON.stringify(u),o=r[l];if(!o){for(o=u.slice(),n=0;n=0}),(r.type==="funnelarea"?T:r.sort)&&o.sort(function(I,B){return B.v-I.v}),o[0]&&(o[0].vTotal=S),o},crossTraceCalc:function(u,r){var n=(r||{}).type;n||(n="pie");var l=u._fullLayout,o=u.calcdata,s=l[n+"colorway"],c=l["_"+n+"colormap"];l["extend"+n+"colors"]&&(s=_(s,w));for(var h=0,x=0;x0){h=!0;break}}h||(c=0)}return{hasLabels:o,hasValues:s,len:c}}function r(n,l,o,s,c){s("marker.line.width")&&s("marker.line.color",c?void 0:o.paper_bgcolor);var h=s("marker.colors");_(s,"marker.pattern",h),n.marker&&!l.marker.pattern.fgcolor&&(l.marker.pattern.fgcolor=n.marker.colors),l.marker.pattern.bgcolor||(l.marker.pattern.bgcolor=o.paper_bgcolor)}D.exports={handleLabelsAndValues:u,handleMarkerDefaults:r,supplyDefaults:function(n,l,o,s){function c(T,p){return d.coerce(n,l,e,T,p)}var h=u(c("labels"),c("values")),x=h.len;if(l._hasLabels=h.hasLabels,l._hasValues=h.hasValues,!l._hasLabels&&l._hasValues&&(c("label0"),c("dlabel")),x){l._length=x,r(n,l,s,c,!0),c("scalegroup");var m,g=c("text"),k=c("texttemplate");if(k||(m=c("textinfo",d.isArrayOrTypedArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),k||m&&m!=="none"){var A=c("textposition");y(n,l,s,c,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(A)||A==="auto"||A==="outside")&&c("automargin"),(A==="inside"||A==="auto"||Array.isArray(A))&&c("insidetextorientation")}else m==="none"&&c("textposition","none");w(l,s,c);var v=c("hole");if(c("title.text")){var S=c("title.position",v?"middle center":"top center");v||S!=="middle center"||(l.title.position="top center"),d.coerceFont(c,"title.font",s.font)}c("sort"),c("direction"),c("rotation"),c("pull")}else l.visible=!1}}},50568:function(D,L,t){var b=t(36040).appendArrayMultiPointValues;D.exports=function(d,e){var w={curveNumber:e.index,pointNumbers:d.pts,data:e._input,fullData:e,label:d.label,color:d.color,value:d.v,percent:d.percent,text:d.text,bbox:d.bbox,v:d.v};return d.pts.length===1&&(w.pointNumber=w.i=d.pts[0]),b(w,e,d.pts),e.type==="funnelarea"&&(delete w.v,delete w.i),w}},75067:function(D,L,t){var b=t(62203),d=t(78766);D.exports=function(e,w,y,_){var u=y.marker.pattern;u&&u.shape?b.pointStyle(e,y,_,w):d.fill(e,w.color)}},37252:function(D,L,t){var b=t(34809);function d(e){return e.indexOf("e")!==-1?e.replace(/[.]?0+e/,"e"):e.indexOf(".")!==-1?e.replace(/[.]?0+$/,""):e}L.formatPiePercent=function(e,w){var y=d((100*e).toPrecision(3));return b.numSeparate(y,w)+"%"},L.formatPieValue=function(e,w){var y=d(e.toPrecision(10));return b.numSeparate(y,w)},L.getFirstFilled=function(e,w){if(b.isArrayOrTypedArray(e))for(var y=0;y"),name:le.hovertemplate||ge.indexOf("name")!==-1?le.name:void 0,idealAlign:ie.pxmid[0]<0?"left":"right",color:h.castOption(Le.bgcolor,ie.pts)||ie.color,borderColor:h.castOption(Le.bordercolor,ie.pts),fontFamily:h.castOption(Oe.family,ie.pts),fontSize:h.castOption(Oe.size,ie.pts),fontColor:h.castOption(Oe.color,ie.pts),nameLength:h.castOption(Le.namelength,ie.pts),textAlign:h.castOption(Le.align,ie.pts),hovertemplate:h.castOption(le.hovertemplate,ie.pts),hovertemplateLabels:ie,eventData:[x(ie,le)]},{container:oe._hoverlayer.node(),outerContainer:oe._paper.node(),gd:Q,inOut_bbox:We}),ie.bbox=We[0],he._hasHoverLabel=!0}he._hasHoverEvent=!0,Q.emit("plotly_hover",{points:[x(ie,le)],event:b.event})}}),J.on("mouseout",function(ie){var oe=Q._fullLayout,le=Q._fullData[he.index],ge=b.select(this).datum();he._hasHoverEvent&&(ie.originalEvent=b.event,Q.emit("plotly_unhover",{points:[x(ge,le)],event:b.event}),he._hasHoverEvent=!1),he._hasHoverLabel&&(e.loneUnhover(oe._hoverlayer.node()),he._hasHoverLabel=!1)}),J.on("click",function(ie){var oe=Q._fullLayout,le=Q._fullData[he.index];Q._dragging||oe.hovermode===!1||(Q._hoverdata=[x(ie,le)],e.click(Q,b.event))})}function k(J,Q,Z){var K=h.castOption(J.insidetextfont.color,Q.pts);!K&&J._input.textfont&&(K=h.castOption(J._input.textfont.color,Q.pts));var ae=h.castOption(J.insidetextfont.family,Q.pts)||h.castOption(J.textfont.family,Q.pts)||Z.family,se=h.castOption(J.insidetextfont.size,Q.pts)||h.castOption(J.textfont.size,Q.pts)||Z.size,he=h.castOption(J.insidetextfont.weight,Q.pts)||h.castOption(J.textfont.weight,Q.pts)||Z.weight,fe=h.castOption(J.insidetextfont.style,Q.pts)||h.castOption(J.textfont.style,Q.pts)||Z.style,ie=h.castOption(J.insidetextfont.variant,Q.pts)||h.castOption(J.textfont.variant,Q.pts)||Z.variant,oe=h.castOption(J.insidetextfont.textcase,Q.pts)||h.castOption(J.textfont.textcase,Q.pts)||Z.textcase,le=h.castOption(J.insidetextfont.lineposition,Q.pts)||h.castOption(J.textfont.lineposition,Q.pts)||Z.lineposition,ge=h.castOption(J.insidetextfont.shadow,Q.pts)||h.castOption(J.textfont.shadow,Q.pts)||Z.shadow;return{color:K||w.contrast(Q.color),family:ae,size:se,weight:he,style:fe,variant:ie,textcase:oe,lineposition:le,shadow:ge}}function A(J,Q){for(var Z,K,ae=0;aeqe&&qe>Ye||$e=-4;Ee-=2)Ce(Math.PI*Ee,"tan");for(Ee=4;Ee>=-4;Ee-=2)Ce(Math.PI*(Ee+1),"tan")}if(ge||me){for(Ee=4;Ee>=-4;Ee-=2)Ce(Math.PI*(Ee+1.5),"rad");for(Ee=4;Ee>=-4;Ee-=2)Ce(Math.PI*(Ee+.5),"rad")}}if(fe||be||ge){var Le=Math.sqrt(J.width*J.width+J.height*J.height);if((se={scale:ae*K*2/Le,rCenter:1-ae,rotate:0}).textPosAngle=(Q.startangle+Q.stopangle)/2,se.scale>=1)return se;Se.push(se)}(be||me)&&((se=S(J,K,he,ie,oe)).textPosAngle=(Q.startangle+Q.stopangle)/2,Se.push(se)),(be||ye)&&((se=T(J,K,he,ie,oe)).textPosAngle=(Q.startangle+Q.stopangle)/2,Se.push(se));for(var Oe=0,We=0,Ie=0;Ie=1)break}return Se[Oe]}function S(J,Q,Z,K,ae){Q=Math.max(0,Q-2*c);var se=J.width/J.height,he=f(se,K,Q,Z);return{scale:2*he/J.height,rCenter:p(se,he/Q),rotate:M(ae)}}function T(J,Q,Z,K,ae){Q=Math.max(0,Q-2*c);var se=J.height/J.width,he=f(se,K,Q,Z);return{scale:2*he/J.width,rCenter:p(se,he/Q),rotate:M(ae+Math.PI/2)}}function p(J,Q){return Math.cos(Q)-J*Q}function M(J){return(180/Math.PI*J+720)%180-90}function f(J,Q,Z,K){var ae=J+1/(2*Math.tan(Q));return Z*Math.min(1/(Math.sqrt(ae*ae+.5)+ae),K/(Math.sqrt(J*J+K/2)+J))}function E(J,Q){return J.v!==Q.vTotal||Q.trace.hole?Math.min(1/(1+1/Math.sin(J.halfangle)),J.ring/2):1}function I(J,Q){var Z=Q.pxmid[0],K=Q.pxmid[1],ae=J.width/2,se=J.height/2;return Z<0&&(ae*=-1),K<0&&(se*=-1),{scale:1,rCenter:1,rotate:0,x:ae+Math.abs(se)*(ae>0?1:-1)/2,y:se/(1+Z*Z/(K*K)),outside:!0}}function B(J,Q){var Z,K,ae,se=J.trace,he={x:J.cx,y:J.cy},fe={tx:0,ty:0};fe.ty+=se.title.font.size,ae=V(se),se.title.position.indexOf("top")!==-1?(he.y-=(1+ae)*J.r,fe.ty-=J.titleBox.height):se.title.position.indexOf("bottom")!==-1&&(he.y+=(1+ae)*J.r);var ie,oe=J.r/((ie=J.trace.aspectratio)===void 0?1:ie),le=Q.w*(se.domain.x[1]-se.domain.x[0])/2;return se.title.position.indexOf("left")!==-1?(le+=oe,he.x-=(1+ae)*oe,fe.tx+=J.titleBox.width/2):se.title.position.indexOf("center")!==-1?le*=2:se.title.position.indexOf("right")!==-1&&(le+=oe,he.x+=(1+ae)*oe,fe.tx-=J.titleBox.width/2),Z=le/J.titleBox.width,K=N(J,Q)/J.titleBox.height,{x:he.x,y:he.y,scale:Math.min(Z,K),tx:fe.tx,ty:fe.ty}}function N(J,Q){var Z=J.trace,K=Q.h*(Z.domain.y[1]-Z.domain.y[0]);return Math.min(J.titleBox.height,K/2)}function V(J){var Q,Z=J.pull;if(!Z)return 0;if(_.isArrayOrTypedArray(Z))for(Z=0,Q=0;QZ&&(Z=J.pull[Q]);return Z}function j(J,Q){for(var Z=[],K=0;K1?Ie=(We=me.r)/Se.aspectratio:We=(Ie=me.r)*Se.aspectratio,Oe=(We*=(1+Se.baseratio)/2)*Ie}Ce=Math.min(Ce,Oe/me.vTotal)}for(be=0;be")}if(se){var Ee=_.castOption(ae,Q.i,"texttemplate");if(Ee){var Ce=function(Oe){return{label:Oe.label,value:Oe.v,valueLabel:h.formatPieValue(Oe.v,K.separators),percent:Oe.v/Z.vTotal,percentLabel:h.formatPiePercent(Oe.v/Z.vTotal,K.separators),color:Oe.color,text:Oe.text,customdata:_.castOption(ae,Oe.i,"customdata")}}(Q),Le=h.getFirstFilled(ae.text,Q.pts);(m(Le)||Le==="")&&(Ce.text=Le),Q.text=_.texttemplateString(Ee,Ce,J._fullLayout._d3locale,Ce,ae._meta||{})}else Q.text=""}}function H(J,Q){var Z=J.rotate*Math.PI/180,K=Math.cos(Z),ae=Math.sin(Z),se=(Q.left+Q.right)/2,he=(Q.top+Q.bottom)/2;J.textX=se*K-he*ae,J.textY=se*ae+he*K,J.noCenter=!0}D.exports={plot:function(J,Q){var Z=J._context.staticPlot,K=J._fullLayout,ae=K._size;s("pie",K),A(Q,J),j(Q,ae);var se=_.makeTraceGroups(K._pielayer,Q,"trace").each(function(he){var fe=b.select(this),ie=he[0],oe=ie.trace;(function(le){var ge,ye,me,be=le[0],Se=be.r,Ee=be.trace,Ce=h.getRotationAngle(Ee.rotation),Le=2*Math.PI/be.vTotal,Oe="px0",We="px1";if(Ee.direction==="counterclockwise"){for(ge=0;gebe.vTotal/2?1:0,ye.halfangle=Math.PI*Math.min(ye.v/be.vTotal,.5),ye.ring=1-Ee.hole,ye.rInscribed=E(ye,be))})(he),fe.attr("stroke-linejoin","round"),fe.each(function(){var le=b.select(this).selectAll("g.slice").data(he);le.enter().append("g").classed("slice",!0),le.exit().remove();var ge=[[[],[]],[[],[]]],ye=!1;le.each(function(We,Ie){if(We.hidden)b.select(this).selectAll("path,g").remove();else{We.pointNumber=We.i,We.curveNumber=oe.index,ge[We.pxmid[1]<0?0:1][We.pxmid[0]<0?0:1].push(We);var Ve=ie.cx,Pe=ie.cy,de=b.select(this),Me=de.selectAll("path.surface").data([We]);if(Me.enter().append("path").classed("surface",!0).style({"pointer-events":Z?"none":"all"}),de.call(g,J,he),oe.pull){var ke=+h.castOption(oe.pull,We.pts)||0;ke>0&&(Ve+=ke*We.pxmid[0],Pe+=ke*We.pxmid[1])}We.cxFinal=Ve,We.cyFinal=Pe;var He=oe.hole;if(We.v===ie.vTotal){var Fe="M"+(Ve+We.px0[0])+","+(Pe+We.px0[1])+De(We.px0,We.pxmid,!0,1)+De(We.pxmid,We.px0,!0,1)+"Z";He?Me.attr("d","M"+(Ve+He*We.px0[0])+","+(Pe+He*We.px0[1])+De(We.px0,We.pxmid,!1,He)+De(We.pxmid,We.px0,!1,He)+"Z"+Fe):Me.attr("d",Fe)}else{var qe=De(We.px0,We.px1,!0,1);if(He){var $e=1-He;Me.attr("d","M"+(Ve+He*We.px1[0])+","+(Pe+He*We.px1[1])+De(We.px1,We.px0,!1,He)+"l"+$e*We.px0[0]+","+$e*We.px0[1]+qe+"Z")}else Me.attr("d","M"+Ve+","+Pe+"l"+We.px0[0]+","+We.px0[1]+qe+"Z")}ee(J,We,ie);var Ye=h.castOption(oe.textposition,We.pts),_e=de.selectAll("g.slicetext").data(We.text&&Ye!=="none"?[0]:[]);_e.enter().append("g").classed("slicetext",!0),_e.exit().remove(),_e.each(function(){var Be=_.ensureSingle(b.select(this),"text","",function(Ht){Ht.attr("data-notex",1)}),Ge=_.ensureUniformFontSize(J,Ye==="outside"?function(Ht,Gt,st){return{color:h.castOption(Ht.outsidetextfont.color,Gt.pts)||h.castOption(Ht.textfont.color,Gt.pts)||st.color,family:h.castOption(Ht.outsidetextfont.family,Gt.pts)||h.castOption(Ht.textfont.family,Gt.pts)||st.family,size:h.castOption(Ht.outsidetextfont.size,Gt.pts)||h.castOption(Ht.textfont.size,Gt.pts)||st.size,weight:h.castOption(Ht.outsidetextfont.weight,Gt.pts)||h.castOption(Ht.textfont.weight,Gt.pts)||st.weight,style:h.castOption(Ht.outsidetextfont.style,Gt.pts)||h.castOption(Ht.textfont.style,Gt.pts)||st.style,variant:h.castOption(Ht.outsidetextfont.variant,Gt.pts)||h.castOption(Ht.textfont.variant,Gt.pts)||st.variant,textcase:h.castOption(Ht.outsidetextfont.textcase,Gt.pts)||h.castOption(Ht.textfont.textcase,Gt.pts)||st.textcase,lineposition:h.castOption(Ht.outsidetextfont.lineposition,Gt.pts)||h.castOption(Ht.textfont.lineposition,Gt.pts)||st.lineposition,shadow:h.castOption(Ht.outsidetextfont.shadow,Gt.pts)||h.castOption(Ht.textfont.shadow,Gt.pts)||st.shadow}}(oe,We,K.font):k(oe,We,K.font));Be.text(We.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(y.font,Ge).call(n.convertToTspans,J);var tt,nt=y.bBox(Be.node());if(Ye==="outside")tt=I(nt,We);else if(tt=v(nt,We,ie),Ye==="auto"&&tt.scale<1){var ft=_.ensureUniformFontSize(J,oe.outsidetextfont);Be.call(y.font,ft),tt=I(nt=y.bBox(Be.node()),We)}var At=tt.textPosAngle,kt=At===void 0?We.pxmid:$(ie.r,At);if(tt.targetX=Ve+kt[0]*tt.rCenter+(tt.x||0),tt.targetY=Pe+kt[1]*tt.rCenter+(tt.y||0),H(tt,nt),tt.outside){var Vt=tt.targetY;We.yLabelMin=Vt-nt.height/2,We.yLabelMid=Vt,We.yLabelMax=Vt+nt.height/2,We.labelExtraX=0,We.labelExtraY=0,ye=!0}tt.fontSize=Ge.size,o(oe.type,tt,K),he[Ie].transform=tt,_.setTransormAndDisplay(Be,tt)})}function De(Be,Ge,tt,nt){var ft=nt*(Ge[0]-Be[0]),At=nt*(Ge[1]-Be[1]);return"a"+nt*ie.r+","+nt*ie.r+" 0 "+We.largeArc+(tt?" 1 ":" 0 ")+ft+","+At}});var me=b.select(this).selectAll("g.titletext").data(oe.title.text?[0]:[]);if(me.enter().append("g").classed("titletext",!0),me.exit().remove(),me.each(function(){var We,Ie=_.ensureSingle(b.select(this),"text","",function(Pe){Pe.attr("data-notex",1)}),Ve=oe.title.text;oe._meta&&(Ve=_.templateString(Ve,oe._meta)),Ie.text(Ve).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(y.font,oe.title.font).call(n.convertToTspans,J),We=oe.title.position==="middle center"?function(Pe){var de=Math.sqrt(Pe.titleBox.width*Pe.titleBox.width+Pe.titleBox.height*Pe.titleBox.height);return{x:Pe.cx,y:Pe.cy,scale:Pe.trace.hole*Pe.r*2/de,tx:0,ty:-Pe.titleBox.height/2+Pe.trace.title.font.size}}(ie):B(ie,ae),Ie.attr("transform",r(We.x,We.y)+u(Math.min(1,We.scale))+r(We.tx,We.ty))}),ye&&function(We,Ie){var Ve,Pe,de,Me,ke,He,Fe,qe,$e,Ye,_e,De,Be;function Ge(At,kt){return At.pxmid[1]-kt.pxmid[1]}function tt(At,kt){return kt.pxmid[1]-At.pxmid[1]}function nt(At,kt){kt||(kt={});var Vt,Ht,Gt,st,Qe=kt.labelExtraY+(Pe?kt.yLabelMax:kt.yLabelMin),pt=Pe?At.yLabelMin:At.yLabelMax,yt=Pe?At.yLabelMax:At.yLabelMin,Ot=At.cyFinal+ke(At.px0[1],At.px1[1]),Pt=Qe-pt;if(Pt*Fe>0&&(At.labelExtraY=Pt),_.isArrayOrTypedArray(Ie.pull))for(Ht=0;Ht=(h.castOption(Ie.pull,Gt.pts)||0)||((At.pxmid[1]-Gt.pxmid[1])*Fe>0?(Pt=Gt.cyFinal+ke(Gt.px0[1],Gt.px1[1])-pt-At.labelExtraY)*Fe>0&&(At.labelExtraY+=Pt):(yt+At.labelExtraY-Ot)*Fe>0&&(Vt=3*He*Math.abs(Ht-Ye.indexOf(At)),(st=Gt.cxFinal+Me(Gt.px0[0],Gt.px1[0])+Vt-(At.cxFinal+At.pxmid[0])-At.labelExtraX)*He>0&&(At.labelExtraX+=st)))}for(Pe=0;Pe<2;Pe++)for(de=Pe?Ge:tt,ke=Pe?Math.max:Math.min,Fe=Pe?1:-1,Ve=0;Ve<2;Ve++){for(Me=Ve?Math.max:Math.min,He=Ve?1:-1,(qe=We[Pe][Ve]).sort(de),$e=We[1-Pe][Ve],Ye=$e.concat(qe),De=[],_e=0;_eMath.abs(qe)?ke+="l"+qe*Ve.pxmid[0]/Ve.pxmid[1]+","+qe+"H"+(Me+Ve.labelExtraX+He):ke+="l"+Ve.labelExtraX+","+Fe+"v"+(qe-Fe)+"h"+He}else ke+="V"+(Ve.yLabelMid+Ve.labelExtraY)+"h"+He;_.ensureSingle(Pe,"path","textline").call(w.stroke,Ie.outsidetextfont.color).attr({"stroke-width":Math.min(2,Ie.outsidetextfont.size/8),d:ke,fill:"none"})}else Pe.select("path.textline").remove()})}(le,oe),ye&&oe.automargin){var be=y.bBox(fe.node()),Se=oe.domain,Ee=ae.w*(Se.x[1]-Se.x[0]),Ce=ae.h*(Se.y[1]-Se.y[0]),Le=(.5*Ee-ie.r)/ae.w,Oe=(.5*Ce-ie.r)/ae.h;d.autoMargin(J,"pie."+oe.uid+".automargin",{xl:Se.x[0]-Le,xr:Se.x[1]+Le,yb:Se.y[0]-Oe,yt:Se.y[1]+Oe,l:Math.max(ie.cx-ie.r-be.left,0),r:Math.max(be.right-(ie.cx+ie.r),0),b:Math.max(be.bottom-(ie.cy+ie.r),0),t:Math.max(ie.cy-ie.r-be.top,0),pad:5})}})});setTimeout(function(){se.selectAll("tspan").each(function(){var he=b.select(this);he.attr("dy")&&he.attr("dy",he.attr("dy"))})},0)},formatSliceLabel:ee,transformInsideText:v,determineInsideTextFont:k,positionTitleOutside:B,prerenderTitles:A,layoutAreas:j,attachFxHandlers:g,computeTransform:H}},140:function(D,L,t){var b=t(45568),d=t(32891),e=t(84102).resizeText;D.exports=function(w){var y=w._fullLayout._pielayer.selectAll(".trace");e(w,y,"pie"),y.each(function(_){var u=_[0].trace,r=b.select(this);r.style({opacity:u.opacity}),r.selectAll("path.surface").each(function(n){b.select(this).call(d,n,u,w)})})}},32891:function(D,L,t){var b=t(78766),d=t(37252).castOption,e=t(75067);D.exports=function(w,y,_,u){var r=_.marker.line,n=d(r.color,y.pts)||b.defaultLine,l=d(r.width,y.pts)||0;w.call(e,y,_,u).style("stroke-width",l).call(b.stroke,n)}},36961:function(D,L,t){var b=t(36640);D.exports={x:b.x,y:b.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:b.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"},transforms:void 0}},71593:function(D,L,t){var b=t(99098).gl_pointcloud2d,d=t(34809).isArrayOrTypedArray,e=t(55010),w=t(32919).findExtremes,y=t(11539);function _(r,n){this.scene=r,this.uid=n,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=b(r.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var u=_.prototype;u.handlePick=function(r){var n=this.idToIndex[r.pointId];return{trace:this,dataCoord:r.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*n],this.pickXYData[2*n+1]]:[this.pickXData[n],this.pickYData[n]],textLabel:d(this.textLabels)?this.textLabels[n]:this.textLabels,color:this.color,name:this.name,pointIndex:n,hoverinfo:this.hoverinfo}},u.update=function(r){this.index=r.index,this.textLabels=r.text,this.name=r.name,this.hoverinfo=r.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(r),this.color=y(r,{})},u.updateFast=function(r){var n,l,o,s,c,h,x=this.xData=this.pickXData=r.x,m=this.yData=this.pickYData=r.y,g=this.pickXYData=r.xy,k=r.xbounds&&r.ybounds,A=r.indices,v=this.bounds;if(g){if(o=g,n=g.length>>>1,k)v[0]=r.xbounds[0],v[2]=r.xbounds[1],v[1]=r.ybounds[0],v[3]=r.ybounds[1];else for(h=0;hv[2]&&(v[2]=s),cv[3]&&(v[3]=c);if(A)l=A;else for(l=new Int32Array(n),h=0;hv[2]&&(v[2]=s),cv[3]&&(v[3]=c);this.idToIndex=l,this.pointcloudOptions.idToIndex=l,this.pointcloudOptions.positions=o;var S=e(r.marker.color),T=e(r.marker.border.color),p=r.opacity*r.marker.opacity;S[3]*=p,this.pointcloudOptions.color=S;var M=r.marker.blend;M===null&&(M=x.length<100||m.length<100),this.pointcloudOptions.blend=M,T[3]*=p,this.pointcloudOptions.borderColor=T;var f=r.marker.sizemin,E=Math.max(r.marker.sizemax,r.marker.sizemin);this.pointcloudOptions.sizeMin=f,this.pointcloudOptions.sizeMax=E,this.pointcloudOptions.areaRatio=r.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions);var I=this.scene.xaxis,B=this.scene.yaxis,N=E/2||.5;r._extremes[I._id]=w(I,[v[0],v[2]],{ppad:N}),r._extremes[B._id]=w(B,[v[1],v[3]],{ppad:N})},u.dispose=function(){this.pointcloud.dispose()},D.exports=function(r,n){var l=new _(r,n.uid);return l.update(n),l}},75526:function(D,L,t){var b=t(34809),d=t(36961);D.exports=function(e,w,y){function _(u,r){return b.coerce(e,w,d,u,r)}_("x"),_("y"),_("xbounds"),_("ybounds"),e.xy&&e.xy instanceof Float32Array&&(w.xy=e.xy),e.indices&&e.indices instanceof Int32Array&&(w.indices=e.indices),_("text"),_("marker.color",y),_("marker.opacity"),_("marker.blend"),_("marker.sizemin"),_("marker.sizemax"),_("marker.border.color",y),_("marker.border.arearatio"),w._length=null}},15186:function(D,L,t){D.exports={attributes:t(36961),supplyDefaults:t(75526),calc:t(37593),plot:t(71593),moduleType:"trace",name:"pointcloud",basePlotModule:t(24585),categories:["gl","gl2d","showLegend"],meta:{}}},33795:function(D,L,t){var b=t(80337),d=t(9829),e=t(10229),w=t(70192),y=t(13792).u,_=t(3208).rb,u=t(87163),r=t(78032).templatedArray,n=t(80712).descriptionOnlyNumbers,l=t(93049).extendFlat,o=t(13582).overrideAll;(D.exports=o({hoverinfo:l({},d.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:w.hoverlabel,domain:y({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:n("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:b({autoShadowDflt:!0}),customdata:void 0,node:{label:{valType:"data_array",dflt:[]},groups:{valType:"info_array",impliedEdits:{x:[],y:[]},dimensions:2,freeLength:!0,dflt:[],items:{valType:"number",editType:"calc"}},x:{valType:"data_array",dflt:[]},y:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:e.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:w.hoverlabel,hovertemplate:_({},{keys:["value","label"]}),align:{valType:"enumerated",values:["justify","left","right","center"],dflt:"justify"}},link:{arrowlen:{valType:"number",min:0,dflt:0},label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},hovercolor:{valType:"color",arrayOk:!0},customdata:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:e.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]},hoverinfo:{valType:"enumerated",values:["all","none","skip"],dflt:"all"},hoverlabel:w.hoverlabel,hovertemplate:_({},{keys:["value","label"]}),colorscales:r("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:l(u().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")).transforms=void 0},42229:function(D,L,t){var b=t(13582).overrideAll,d=t(4173).eV,e=t(16506),w=t(6811),y=t(27983),_=t(14751),u=t(44844).prepSelect,r=t(34809),n=t(33626),l="sankey";function o(s,c){var h=s._fullData[c],x=s._fullLayout,m=x.dragmode,g=x.dragmode==="pan"?"move":"crosshair",k=h._bgRect;if(k&&m!=="pan"&&m!=="zoom"){y(k,g);var A={_id:"x",c2p:r.identity,_offset:h._sankey.translateX,_length:h._sankey.width},v={_id:"y",c2p:r.identity,_offset:h._sankey.translateY,_length:h._sankey.height},S={gd:s,element:k.node(),plotinfo:{id:c,xaxis:A,yaxis:v,fillRangeItems:r.noop},subplot:c,xaxes:[A],yaxes:[v],doneFnCompleted:function(T){var p,M=s._fullData[c],f=M.node.groups.slice(),E=[];function I(j){for(var $=M._sankey.graph.nodes,ee=0;ee<$.length;ee++)if($[ee].pointNumber===j)return $[ee]}for(var B=0;BM&&(M=c.source[o]),c.target[o]>M&&(M=c.target[o]);var f,E=M+1;l.node._count=E;var I=l.node.groups,B={};for(o=0;o0&&y(H,E)&&y(J,E)&&(!B.hasOwnProperty(H)||!B.hasOwnProperty(J)||B[H]!==B[J])){B.hasOwnProperty(J)&&(J=B[J]),B.hasOwnProperty(H)&&(H=B[H]),J=+J,k[H=+H]=k[J]=!0;var Q="";c.label&&c.label[o]&&(Q=c.label[o]);var Z=null;Q&&A.hasOwnProperty(Q)&&(Z=A[Q]),h.push({pointNumber:o,label:Q,color:x?c.color[o]:c.color,hovercolor:m?c.hovercolor[o]:c.hovercolor,customdata:g?c.customdata[o]:c.customdata,concentrationscale:Z,source:H,target:J,value:+ee}),$.source.push(H),$.target.push(J)}}var K=E+I.length,ae=w(s.color),se=w(s.customdata),he=[];for(o=0;oE-1,childrenNodes:[],pointNumber:o,label:fe,color:ae?s.color[o]:s.color,customdata:se?s.customdata[o]:s.customdata})}var ie=!1;return function(oe,le,ge){for(var ye=d.init2dArray(oe,0),me=0;me1})}(K,$.source,$.target)&&(ie=!0),{circular:ie,links:h,nodes:he,groups:I,groupLookup:B}}(r);return e({circular:n.circular,_nodes:n.nodes,_links:n.links,_groups:n.groups,_groupLookup:n.groupLookup})}},21541:function(D){D.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"linear",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeLabel:"node-label"}}},67940:function(D,L,t){var b=t(34809),d=t(33795),e=t(78766),w=t(65657),y=t(13792).N,_=t(26430),u=t(78032),r=t(59008);function n(l,o){function s(c,h){return b.coerce(l,o,d.link.colorscales,c,h)}s("label"),s("cmin"),s("cmax"),s("colorscale")}D.exports=function(l,o,s,c){function h(I,B){return b.coerce(l,o,d,I,B)}var x=b.extendDeep(c.hoverlabel,l.hoverlabel),m=l.node,g=u.newContainer(o,"node");function k(I,B){return b.coerce(m,g,d.node,I,B)}k("label"),k("groups"),k("x"),k("y"),k("pad"),k("thickness"),k("line.color"),k("line.width"),k("hoverinfo",l.hoverinfo),_(m,g,k,x),k("hovertemplate"),k("align");var A=c.colorway;k("color",g.label.map(function(I,B){return e.addOpacity(function(N){return A[N%A.length]}(B),.8)})),k("customdata");var v=l.link||{},S=u.newContainer(o,"link");function T(I,B){return b.coerce(v,S,d.link,I,B)}T("label"),T("arrowlen"),T("source"),T("target"),T("value"),T("line.color"),T("line.width"),T("hoverinfo",l.hoverinfo),_(v,S,T,x),T("hovertemplate");var p,M=w(c.paper_bgcolor).getLuminance()<.333,f=T("color",M?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function E(I){var B=w(I);if(!B.isValid())return I;var N=B.getAlpha();return N<=.8?B.setAlpha(N+.2):B=M?B.brighten():B.darken(),B.toRgbString()}T("hovercolor",Array.isArray(f)?f.map(E):E(f)),T("customdata"),r(v,S,{name:"colorscales",handleItemDefaults:n}),y(o,c,h),h("orientation"),h("valueformat"),h("valuesuffix"),g.x.length&&g.y.length&&(p="freeform"),h("arrangement",p),b.coerceFont(h,"textfont",c.font,{autoShadowDflt:!0}),o._length=null}},71760:function(D,L,t){D.exports={attributes:t(33795),supplyDefaults:t(67940),calc:t(22915),plot:t(16506),moduleType:"trace",name:"sankey",basePlotModule:t(42229),selectPoints:t(74670),categories:["noOpacity"],meta:{}}},16506:function(D,L,t){var b=t(45568),d=t(34809),e=d.numberFormat,w=t(90958),y=t(32141),_=t(78766),u=t(21541).cn,r=d._;function n(v){return v!==""}function l(v,S){return v.filter(function(T){return T.key===S.traceId})}function o(v,S){b.select(v).select("path").style("fill-opacity",S),b.select(v).select("rect").style("fill-opacity",S)}function s(v){b.select(v).select("text.name").style("fill","black")}function c(v){return function(S){return v.node.sourceLinks.indexOf(S.link)!==-1||v.node.targetLinks.indexOf(S.link)!==-1}}function h(v){return function(S){return S.node.sourceLinks.indexOf(v.link)!==-1||S.node.targetLinks.indexOf(v.link)!==-1}}function x(v,S,T){S&&T&&l(T,S).selectAll("."+u.sankeyLink).filter(c(S)).call(g.bind(0,S,T,!1))}function m(v,S,T){S&&T&&l(T,S).selectAll("."+u.sankeyLink).filter(c(S)).call(k.bind(0,S,T,!1))}function g(v,S,T,p){p.style("fill",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverHue}).style("fill-opacity",function(M){if(!M.link.concentrationscale)return M.tinyColorHoverAlpha}),p.each(function(M){var f=M.link.label;f!==""&&l(S,v).selectAll("."+u.sankeyLink).filter(function(E){return E.link.label===f}).style("fill",function(E){if(!E.link.concentrationscale)return E.tinyColorHoverHue}).style("fill-opacity",function(E){if(!E.link.concentrationscale)return E.tinyColorHoverAlpha})}),T&&l(S,v).selectAll("."+u.sankeyNode).filter(h(v)).call(x)}function k(v,S,T,p){p.style("fill",function(M){return M.tinyColorHue}).style("fill-opacity",function(M){return M.tinyColorAlpha}),p.each(function(M){var f=M.link.label;f!==""&&l(S,v).selectAll("."+u.sankeyLink).filter(function(E){return E.link.label===f}).style("fill",function(E){return E.tinyColorHue}).style("fill-opacity",function(E){return E.tinyColorAlpha})}),T&&l(S,v).selectAll(u.sankeyNode).filter(h(v)).call(m)}function A(v,S){var T=v.hoverlabel||{},p=d.nestedProperty(T,S).get();return!Array.isArray(p)&&p}D.exports=function(v,S){for(var T=v._fullLayout,p=T._paper,M=T._size,f=0;f"),color:A(H,"bgcolor")||_.addOpacity(K.color,1),borderColor:A(H,"bordercolor"),fontFamily:A(H,"font.family"),fontSize:A(H,"font.size"),fontColor:A(H,"font.color"),fontWeight:A(H,"font.weight"),fontStyle:A(H,"font.style"),fontVariant:A(H,"font.variant"),fontTextcase:A(H,"font.textcase"),fontLineposition:A(H,"font.lineposition"),fontShadow:A(H,"font.shadow"),nameLength:A(H,"namelength"),textAlign:A(H,"align"),idealAlign:b.event.x"),color:A(H,"bgcolor")||ee.tinyColorHue,borderColor:A(H,"bordercolor"),fontFamily:A(H,"font.family"),fontSize:A(H,"font.size"),fontColor:A(H,"font.color"),fontWeight:A(H,"font.weight"),fontStyle:A(H,"font.style"),fontVariant:A(H,"font.variant"),fontTextcase:A(H,"font.textcase"),fontLineposition:A(H,"font.lineposition"),fontShadow:A(H,"font.shadow"),nameLength:A(H,"namelength"),textAlign:A(H,"align"),idealAlign:"left",hovertemplate:H.hovertemplate,hovertemplateLabels:he,eventData:[ee.node]},{container:T._hoverlayer.node(),outerContainer:T._paper.node(),gd:v});o(oe,.85),s(oe)}}},unhover:function($,ee,H){v._fullLayout.hovermode!==!1&&(b.select($).call(m,ee,H),ee.node.trace.node.hoverinfo!=="skip"&&(ee.node.fullData=ee.node.trace,v.emit("plotly_unhover",{event:b.event,points:[ee.node]})),y.loneUnhover(T._hoverlayer.node()))},select:function($,ee,H){var J=ee.node;J.originalEvent=b.event,v._hoverdata=[J],b.select($).call(m,ee,H),y.click(v,{target:!0})}}})}},90958:function(D,L,t){var b=t(32702),d=t(88640).Dj,e=t(45568),w=t(62369),y=t(68735),_=t(21541),u=t(65657),r=t(78766),n=t(62203),l=t(34809),o=l.strTranslate,s=l.strRotate,c=t(71293),h=c.keyFun,x=c.repeat,m=c.unwrap,g=t(30635),k=t(33626),A=t(4530),v=A.CAP_SHIFT,S=A.LINE_SPACING;function T(Z,K,ae){var se,he=m(K),fe=he.trace,ie=fe.domain,oe=fe.orientation==="h",le=fe.node.pad,ge=fe.node.thickness,ye={justify:w.sankeyJustify,left:w.sankeyLeft,right:w.sankeyRight,center:w.sankeyCenter}[fe.node.align],me=Z.width*(ie.x[1]-ie.x[0]),be=Z.height*(ie.y[1]-ie.y[0]),Se=he._nodes,Ee=he._links,Ce=he.circular;(se=Ce?y.sankeyCircular().circularLinkGap(0):w.sankey()).iterations(_.sankeyIterations).size(oe?[me,be]:[be,me]).nodeWidth(ge).nodePadding(le).nodeId(function(Fe){return Fe.pointNumber}).nodeAlign(ye).nodes(Se).links(Ee);var Le,Oe,We,Ie=se();for(var Ve in se.nodePadding()Be+ge&&(De+=1,qe=Ge.x0),Be=Ge.x0,_e[De]||(_e[De]=[]),_e[De].push(Ge),$e=qe-Ge.x0,Ge.x0+=$e,Ge.x1+=$e}return _e}(Se=Ie.nodes).forEach(function(Fe){var qe,$e,Ye,_e=0,De=Fe.length;for(Fe.sort(function(Be,Ge){return Be.y0-Ge.y0}),Ye=0;Ye=_e||($e=_e-qe.y0)>1e-6&&(qe.y0+=$e,qe.y1+=$e),_e=qe.y1+le}),se.update(Ie)}return{circular:Ce,key:ae,trace:fe,guid:l.randstr(),horizontal:oe,width:me,height:be,nodePad:fe.node.pad,nodeLineColor:fe.node.line.color,nodeLineWidth:fe.node.line.width,linkLineColor:fe.link.line.color,linkLineWidth:fe.link.line.width,linkArrowLength:fe.link.arrowlen,valueFormat:fe.valueformat,valueSuffix:fe.valuesuffix,textFont:fe.textfont,translateX:ie.x[0]*Z.width+Z.margin.l,translateY:Z.height-ie.y[1]*Z.height+Z.margin.t,dragParallel:oe?be:me,dragPerpendicular:oe?me:be,arrangement:fe.arrangement,sankey:se,graph:Ie,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function p(Z,K,ae){var se=u(K.color),he=u(K.hovercolor),fe=K.source.label+"|"+K.target.label+"__"+ae;return K.trace=Z.trace,K.curveNumber=Z.trace.index,{circular:Z.circular,key:fe,traceId:Z.key,pointNumber:K.pointNumber,link:K,tinyColorHue:r.tinyRGB(se),tinyColorAlpha:se.getAlpha(),tinyColorHoverHue:r.tinyRGB(he),tinyColorHoverAlpha:he.getAlpha(),linkPath:M,linkLineColor:Z.linkLineColor,linkLineWidth:Z.linkLineWidth,linkArrowLength:Z.linkArrowLength,valueFormat:Z.valueFormat,valueSuffix:Z.valueSuffix,sankey:Z.sankey,parent:Z,interactionState:Z.interactionState,flow:K.flow}}function M(){return function(Z){var K=Z.linkArrowLength;if(Z.link.circular)return function(Le,Oe){var We=Le.width/2,Ie=Le.circularPathData;return Le.circularLinkType==="top"?"M "+(Ie.targetX-Oe)+" "+(Ie.targetY+We)+" L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY+We)+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightSmallArcRadius+We)+" 0 0 1 "+(Ie.rightFullExtent-We-Oe)+" "+(Ie.targetY-Ie.rightSmallArcRadius)+"L"+(Ie.rightFullExtent-We-Oe)+" "+Ie.verticalRightInnerExtent+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightLargeArcRadius+We)+" 0 0 1 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent-We)+"L"+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent-We)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftLargeArcRadius+We)+" 0 0 1 "+(Ie.leftFullExtent+We)+" "+Ie.verticalLeftInnerExtent+"L"+(Ie.leftFullExtent+We)+" "+(Ie.sourceY-Ie.leftSmallArcRadius)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftSmallArcRadius+We)+" 0 0 1 "+Ie.leftInnerExtent+" "+(Ie.sourceY+We)+"L"+Ie.sourceX+" "+(Ie.sourceY+We)+"L"+Ie.sourceX+" "+(Ie.sourceY-We)+"L"+Ie.leftInnerExtent+" "+(Ie.sourceY-We)+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftSmallArcRadius-We)+" 0 0 0 "+(Ie.leftFullExtent-We)+" "+(Ie.sourceY-Ie.leftSmallArcRadius)+"L"+(Ie.leftFullExtent-We)+" "+Ie.verticalLeftInnerExtent+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftLargeArcRadius-We)+" 0 0 0 "+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent+We)+"L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent+We)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightLargeArcRadius-We)+" 0 0 0 "+(Ie.rightFullExtent+We-Oe)+" "+Ie.verticalRightInnerExtent+"L"+(Ie.rightFullExtent+We-Oe)+" "+(Ie.targetY-Ie.rightSmallArcRadius)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightSmallArcRadius-We)+" 0 0 0 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY-We)+"L"+(Ie.targetX-Oe)+" "+(Ie.targetY-We)+(Oe>0?"L"+Ie.targetX+" "+Ie.targetY:"")+"Z":"M "+(Ie.targetX-Oe)+" "+(Ie.targetY-We)+" L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY-We)+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightSmallArcRadius+We)+" 0 0 0 "+(Ie.rightFullExtent-We-Oe)+" "+(Ie.targetY+Ie.rightSmallArcRadius)+"L"+(Ie.rightFullExtent-We-Oe)+" "+Ie.verticalRightInnerExtent+"A"+(Ie.rightLargeArcRadius+We)+" "+(Ie.rightLargeArcRadius+We)+" 0 0 0 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent+We)+"L"+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent+We)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftLargeArcRadius+We)+" 0 0 0 "+(Ie.leftFullExtent+We)+" "+Ie.verticalLeftInnerExtent+"L"+(Ie.leftFullExtent+We)+" "+(Ie.sourceY+Ie.leftSmallArcRadius)+"A"+(Ie.leftLargeArcRadius+We)+" "+(Ie.leftSmallArcRadius+We)+" 0 0 0 "+Ie.leftInnerExtent+" "+(Ie.sourceY-We)+"L"+Ie.sourceX+" "+(Ie.sourceY-We)+"L"+Ie.sourceX+" "+(Ie.sourceY+We)+"L"+Ie.leftInnerExtent+" "+(Ie.sourceY+We)+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftSmallArcRadius-We)+" 0 0 1 "+(Ie.leftFullExtent-We)+" "+(Ie.sourceY+Ie.leftSmallArcRadius)+"L"+(Ie.leftFullExtent-We)+" "+Ie.verticalLeftInnerExtent+"A"+(Ie.leftLargeArcRadius-We)+" "+(Ie.leftLargeArcRadius-We)+" 0 0 1 "+Ie.leftInnerExtent+" "+(Ie.verticalFullExtent-We)+"L"+(Ie.rightInnerExtent-Oe)+" "+(Ie.verticalFullExtent-We)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightLargeArcRadius-We)+" 0 0 1 "+(Ie.rightFullExtent+We-Oe)+" "+Ie.verticalRightInnerExtent+"L"+(Ie.rightFullExtent+We-Oe)+" "+(Ie.targetY+Ie.rightSmallArcRadius)+"A"+(Ie.rightLargeArcRadius-We)+" "+(Ie.rightSmallArcRadius-We)+" 0 0 1 "+(Ie.rightInnerExtent-Oe)+" "+(Ie.targetY+We)+"L"+(Ie.targetX-Oe)+" "+(Ie.targetY+We)+(Oe>0?"L"+Ie.targetX+" "+Ie.targetY:"")+"Z"}(Z.link,K);var ae=Math.abs((Z.link.target.x0-Z.link.source.x1)/2);K>ae&&(K=ae);var se=Z.link.source.x1,he=Z.link.target.x0-K,fe=d(se,he),ie=fe(.5),oe=fe(.5),le=Z.link.y0-Z.link.width/2,ge=Z.link.y0+Z.link.width/2,ye=Z.link.y1-Z.link.width/2,me=Z.link.y1+Z.link.width/2,be="M"+se+","+le,Se="C"+ie+","+le+" "+oe+","+ye+" "+he+","+ye,Ee="C"+oe+","+me+" "+ie+","+ge+" "+se+","+ge,Ce=K>0?"L"+(he+K)+","+(ye+Z.link.width/2):"";return be+Se+(Ce+="L"+he+","+me)+Ee+"Z"}}function f(Z,K){var ae=u(K.color),se=_.nodePadAcross,he=Z.nodePad/2;K.dx=K.x1-K.x0,K.dy=K.y1-K.y0;var fe=K.dx,ie=Math.max(.5,K.dy),oe="node_"+K.pointNumber;return K.group&&(oe=l.randstr()),K.trace=Z.trace,K.curveNumber=Z.trace.index,{index:K.pointNumber,key:oe,partOfGroup:K.partOfGroup||!1,group:K.group,traceId:Z.key,trace:Z.trace,node:K,nodePad:Z.nodePad,nodeLineColor:Z.nodeLineColor,nodeLineWidth:Z.nodeLineWidth,textFont:Z.textFont,size:Z.horizontal?Z.height:Z.width,visibleWidth:Math.ceil(fe),visibleHeight:ie,zoneX:-se,zoneY:-he,zoneWidth:fe+2*se,zoneHeight:ie+2*he,labelY:Z.horizontal?K.dy/2+1:K.dx/2+1,left:K.originalLayer===1,sizeAcross:Z.width,forceLayouts:Z.forceLayouts,horizontal:Z.horizontal,darkBackground:ae.getBrightness()<=128,tinyColorHue:r.tinyRGB(ae),tinyColorAlpha:ae.getAlpha(),valueFormat:Z.valueFormat,valueSuffix:Z.valueSuffix,sankey:Z.sankey,graph:Z.graph,arrangement:Z.arrangement,uniqueNodeLabelPathId:[Z.guid,Z.key,oe].join("_"),interactionState:Z.interactionState,figure:Z}}function E(Z){Z.attr("transform",function(K){return o(K.node.x0.toFixed(3),K.node.y0.toFixed(3))})}function I(Z){Z.call(E)}function B(Z,K){Z.call(I),K.attr("d",M())}function N(Z){Z.attr("width",function(K){return K.node.x1-K.node.x0}).attr("height",function(K){return K.visibleHeight})}function V(Z){return Z.link.width>1||Z.linkLineWidth>0}function j(Z){return o(Z.translateX,Z.translateY)+(Z.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function $(Z,K,ae){Z.on(".basic",null).on("mouseover.basic",function(se){se.interactionState.dragInProgress||se.partOfGroup||(ae.hover(this,se,K),se.interactionState.hovered=[this,se])}).on("mousemove.basic",function(se){se.interactionState.dragInProgress||se.partOfGroup||(ae.follow(this,se),se.interactionState.hovered=[this,se])}).on("mouseout.basic",function(se){se.interactionState.dragInProgress||se.partOfGroup||(ae.unhover(this,se,K),se.interactionState.hovered=!1)}).on("click.basic",function(se){se.interactionState.hovered&&(ae.unhover(this,se,K),se.interactionState.hovered=!1),se.interactionState.dragInProgress||se.partOfGroup||ae.select(this,se,K)})}function ee(Z,K,ae,se){var he=e.behavior.drag().origin(function(fe){return{x:fe.node.x0+fe.visibleWidth/2,y:fe.node.y0+fe.visibleHeight/2}}).on("dragstart",function(fe){if(fe.arrangement!=="fixed"&&(l.ensureSingle(se._fullLayout._infolayer,"g","dragcover",function(oe){se._fullLayout._dragCover=oe}),l.raiseToTop(this),fe.interactionState.dragInProgress=fe.node,J(fe.node),fe.interactionState.hovered&&(ae.nodeEvents.unhover.apply(0,fe.interactionState.hovered),fe.interactionState.hovered=!1),fe.arrangement==="snap")){var ie=fe.traceId+"|"+fe.key;fe.forceLayouts[ie]?fe.forceLayouts[ie].alpha(1):function(oe,le,ge,ye){(function(be){for(var Se=0;Se0&&Ce.forceLayouts[Se].alpha(0)}}(0,le,me,ge)).stop()}(0,ie,fe),function(oe,le,ge,ye,me){window.requestAnimationFrame(function be(){var Se;for(Se=0;Se<_.forceTicksPerFrame;Se++)ge.forceLayouts[ye].tick();if(function(Ce){for(var Le=0;Le0)window.requestAnimationFrame(be);else{var Ee=ge.node.originalX;ge.node.x0=Ee-ge.visibleWidth/2,ge.node.x1=Ee+ge.visibleWidth/2,H(ge,me)}})}(Z,K,fe,ie,se)}}).on("drag",function(fe){if(fe.arrangement!=="fixed"){var ie=e.event.x,oe=e.event.y;fe.arrangement==="snap"?(fe.node.x0=ie-fe.visibleWidth/2,fe.node.x1=ie+fe.visibleWidth/2,fe.node.y0=oe-fe.visibleHeight/2,fe.node.y1=oe+fe.visibleHeight/2):(fe.arrangement==="freeform"&&(fe.node.x0=ie-fe.visibleWidth/2,fe.node.x1=ie+fe.visibleWidth/2),oe=Math.max(0,Math.min(fe.size-fe.visibleHeight/2,oe)),fe.node.y0=oe-fe.visibleHeight/2,fe.node.y1=oe+fe.visibleHeight/2),J(fe.node),fe.arrangement!=="snap"&&(fe.sankey.update(fe.graph),B(Z.filter(Q(fe)),K))}}).on("dragend",function(fe){if(fe.arrangement!=="fixed"){fe.interactionState.dragInProgress=!1;for(var ie=0;iek&&ee[v].gap;)v--;for(T=ee[v].s,A=ee.length-1;A>v;A--)ee[A].s=T;for(;kB[s]&&s=0;s--){var c=w[s];if(c.type==="scatter"&&c.xaxis===l.xaxis&&c.yaxis===l.yaxis){c.opacity=void 0;break}}}}}},40247:function(D,L,t){var b=t(34809),d=t(33626),e=t(36640),w=t(32660),y=t(64726),_=t(99867),u=t(99669),r=t(382),n=t(24272),l=t(98168),o=t(91602),s=t(663),c=t(54114),h=t(34809).coercePattern;D.exports=function(x,m,g,k){function A(I,B){return b.coerce(x,m,e,I,B)}var v=_(x,m,k,A);if(v||(m.visible=!1),m.visible){u(x,m,k,A),A("xhoverformat"),A("yhoverformat"),A("zorder");var S=r(x,m,k,A);k.scattermode==="group"&&m.orientation===void 0&&A("orientation","v");var T=!S&&v=Math.min(Q,Z)&&x<=Math.max(Q,Z)?0:1/0}var K=Math.max(3,J.mrc||0),ae=1-1/K,se=Math.abs(c.c2p(J.x)-x);return se=Math.min(Q,Z)&&m<=Math.max(Q,Z)?0:1/0}var K=Math.max(3,J.mrc||0),ae=1-1/K,se=Math.abs(h.c2p(J.y)-m);return seZ!=(oe=ae[K][1])>=Z&&(he=ae[K-1][0],fe=ae[K][0],oe-ie&&(se=he+(fe-he)*(Z-ie)/(oe-ie),ge=Math.min(ge,se),ye=Math.max(ye,se)));return{x0:ge=Math.max(ge,0),x1:ye=Math.min(ye,c._length),y0:Z,y1:Z}}(s._polygons);ee===null&&(ee={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var H=y.defaultLine;return y.opacity(s.fillcolor)?H=s.fillcolor:y.opacity((s.line||{}).color)&&(H=s.line.color),b.extendFlat(u,{distance:u.maxHoverDistance,x0:ee.x0,x1:ee.x1,y0:ee.y0,y1:ee.y1,color:H,hovertemplate:!1}),delete u.index,s.text&&!b.isArrayOrTypedArray(s.text)?u.text=String(s.text):u.text=s.name,[u]}}},69693:function(D,L,t){var b=t(64726);D.exports={hasLines:b.hasLines,hasMarkers:b.hasMarkers,hasText:b.hasText,isBubble:b.isBubble,attributes:t(36640),layoutAttributes:t(26667),supplyDefaults:t(40247),crossTraceDefaults:t(53044),supplyLayoutDefaults:t(12332),calc:t(26544).calc,crossTraceCalc:t(75603),arraysToCalcdata:t(99203),plot:t(36098),colorbar:t(21146),formatLabels:t(15294),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(37255),selectPoints:t(32665),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:t(37703),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}},26667:function(D){D.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}},12332:function(D,L,t){var b=t(34809),d=t(26667);D.exports=function(e,w){var y,_=w.barmode==="group";w.scattermode==="group"&&(y=_?w.bargap:.2,b.coerce(e,w,d,"scattergap",y))}},98168:function(D,L,t){var b=t(34809).isArrayOrTypedArray,d=t(65477).hasColorscale,e=t(39356);D.exports=function(w,y,_,u,r,n){n||(n={});var l=(w.marker||{}).color;l&&l._inputArray&&(l=l._inputArray),r("line.color",_),d(w,"line")?e(w,y,u,r,{prefix:"line.",cLetter:"c"}):r("line.color",!b(l)&&l||_),r("line.width"),n.noDash||r("line.dash"),n.backoff&&r("line.backoff")}},5525:function(D,L,t){var b=t(62203),d=t(63821),e=d.BADNUM,w=d.LOG_CLIP,y=w+.5,_=w-.5,u=t(34809),r=u.segmentsIntersect,n=u.constrain,l=t(32660);D.exports=function(o,s){var c,h,x,m,g,k,A,v,S,T,p,M,f,E,I,B,N,V,j=s.trace||{},$=s.xaxis,ee=s.yaxis,H=$.type==="log",J=ee.type==="log",Q=$._length,Z=ee._length,K=s.backoff,ae=j.marker,se=s.connectGaps,he=s.baseTolerance,fe=s.shape,ie=fe==="linear",oe=j.fill&&j.fill!=="none",le=[],ge=l.minTolerance,ye=o.length,me=new Array(ye),be=0;function Se(Pt){var at=o[Pt];if(!at)return!1;var lt=s.linearized?$.l2p(at.x):$.c2p(at.x),Xe=s.linearized?ee.l2p(at.y):ee.c2p(at.y);if(lt===e){if(H&&(lt=$.c2p(at.x,!0)),lt===e)return!1;J&&Xe===e&&(lt*=Math.abs($._m*Z*($._m>0?y:_)/(ee._m*Q*(ee._m>0?y:_)))),lt*=1e3}if(Xe===e){if(J&&(Xe=ee.c2p(at.y,!0)),Xe===e)return!1;Xe*=1e3}return[lt,Xe]}function Ee(Pt,at,lt,Xe){var ut=lt-Pt,wt=Xe-at,vt=.5-Pt,Lt=.5-at,jt=ut*ut+wt*wt,rt=ut*vt+wt*Lt;if(rt>0&&rtFe||Pt[1]$e)return[n(Pt[0],He,Fe),n(Pt[1],qe,$e)]}function De(Pt,at){return Pt[0]===at[0]&&(Pt[0]===He||Pt[0]===Fe)||Pt[1]===at[1]&&(Pt[1]===qe||Pt[1]===$e)||void 0}function Be(Pt,at,lt){return function(Xe,ut){var wt=_e(Xe),vt=_e(ut),Lt=[];if(wt&&vt&&De(wt,vt))return Lt;wt&&Lt.push(wt),vt&&Lt.push(vt);var jt=2*u.constrain((Xe[Pt]+ut[Pt])/2,at,lt)-((wt||Xe)[Pt]+(vt||ut)[Pt]);return jt&&((wt&&vt?jt>0==wt[Pt]>vt[Pt]?wt:vt:wt||vt)[Pt]+=jt),Lt}}function Ge(Pt){var at=Pt[0],lt=Pt[1],Xe=at===me[be-1][0],ut=lt===me[be-1][1];if(!Xe||!ut)if(be>1){var wt=at===me[be-2][0],vt=lt===me[be-2][1];Xe&&(at===He||at===Fe)&&wt?vt?be--:me[be-1]=Pt:ut&&(lt===qe||lt===$e)&&vt?wt?be--:me[be-1]=Pt:me[be++]=Pt}else me[be++]=Pt}function tt(Pt){me[be-1][0]!==Pt[0]&&me[be-1][1]!==Pt[1]&&Ge([Ie,Ve]),Ge(Pt),Pe=null,Ie=Ve=0}fe==="linear"||fe==="spline"?Me=function(Pt,at){for(var lt=[],Xe=0,ut=0;ut<4;ut++){var wt=Ye[ut],vt=r(Pt[0],Pt[1],at[0],at[1],wt[0],wt[1],wt[2],wt[3]);vt&&(!Xe||Math.abs(vt.x-lt[0][0])>1||Math.abs(vt.y-lt[0][1])>1)&&(vt=[vt.x,vt.y],Xe&&Le(vt,Pt)Fe?Fe:0,We=Pt[1]$e?$e:0,Oe||We){if(be)if(Pe){var at=Me(Pe,Pt);at.length>1&&(tt(at[0]),me[be++]=at[1])}else de=Me(me[be-1],Pt)[0],me[be++]=de;else me[be++]=[Oe||Pt[0],We||Pt[1]];var lt=me[be-1];Oe&&We&&(lt[0]!==Oe||lt[1]!==We)?(Pe&&(Ie!==Oe&&Ve!==We?Ge(Ie&&Ve?(Xe=Pe,wt=(ut=Pt)[0]-Xe[0],vt=(ut[1]-Xe[1])/wt,(Xe[1]*ut[0]-ut[1]*Xe[0])/wt>0?[vt>0?He:Fe,$e]:[vt>0?Fe:He,qe]):[Ie||Oe,Ve||We]):Ie&&Ve&&Ge([Ie,Ve])),Ge([Oe,We])):Ie-Oe&&Ve-We&&Ge([Oe||Ie,We||Ve]),Pe=Pt,Ie=Oe,Ve=We}else Pe&&tt(Me(Pe,Pt)[0]),me[be++]=Pt;var Xe,ut,wt,vt}for(c=0;cCe(k,At))break;x=k,(f=S[0]*v[0]+S[1]*v[1])>p?(p=f,m=k,A=!1):f=o.length||!k)break;ft(k),h=k}}else ft(m)}Pe&&Ge([Ie||Pe[0],Ve||Pe[1]]),le.push(me.slice(0,be))}var kt=fe.slice(fe.length-1);if(K&&kt!=="h"&&kt!=="v"){for(var Vt=!1,Ht=-1,Gt=[],st=0;st=0?u=s:(u=s=o,o++),u0?Math.max(n,_):0}}},21146:function(D){D.exports={container:"marker",min:"cmin",max:"cmax"}},24272:function(D,L,t){var b=t(78766),d=t(65477).hasColorscale,e=t(39356),w=t(64726);D.exports=function(y,_,u,r,n,l){var o=w.isBubble(y),s=(y.line||{}).color;l=l||{},s&&(u=s),n("marker.symbol"),n("marker.opacity",o?.7:1),n("marker.size"),l.noAngle||(n("marker.angle"),l.noAngleRef||n("marker.angleref"),l.noStandOff||n("marker.standoff")),n("marker.color",u),d(y,"marker")&&e(y,_,r,n,{prefix:"marker.",cLetter:"c"}),l.noSelect||(n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size")),l.noLine||(n("marker.line.color",s&&!Array.isArray(s)&&_.marker.color!==s?s:o?b.background:b.defaultLine),d(y,"marker.line")&&e(y,_,r,n,{prefix:"marker.line.",cLetter:"c"}),n("marker.line.width",o?1:0)),o&&(n("marker.sizeref"),n("marker.sizemin"),n("marker.sizemode")),l.gradient&&n("marker.gradient.type")!=="none"&&n("marker.gradient.color")}},99669:function(D,L,t){var b=t(34809).dateTick0,d=t(63821).ONEWEEK;function e(w,y){return b(y,w%d==0?1:0)}D.exports=function(w,y,_,u,r){if(r||(r={x:!0,y:!0}),r.x){var n=u("xperiod");n&&(u("xperiod0",e(n,y.xcalendar)),u("xperiodalignment"))}if(r.y){var l=u("yperiod");l&&(u("yperiod0",e(l,y.ycalendar)),u("yperiodalignment"))}}},36098:function(D,L,t){var b=t(45568),d=t(33626),e=t(34809),w=e.ensureSingle,y=e.identity,_=t(62203),u=t(64726),r=t(5525),n=t(17210),l=t(80899).tester;function o(s,c,h,x,m,g,k){var A,v=s._context.staticPlot;(function(Ge,tt,nt,ft,At){var kt=nt.xaxis,Vt=nt.yaxis,Ht=b.extent(e.simpleMap(kt.range,kt.r2c)),Gt=b.extent(e.simpleMap(Vt.range,Vt.r2c)),st=ft[0].trace;if(u.hasMarkers(st)){var Qe=st.marker.maxdisplayed;if(Qe!==0){var pt=ft.filter(function(at){return at.x>=Ht[0]&&at.x<=Ht[1]&&at.y>=Gt[0]&&at.y<=Gt[1]}),yt=Math.ceil(pt.length/Qe),Ot=0;At.forEach(function(at,lt){var Xe=at[0].trace;u.hasMarkers(Xe)&&Xe.marker.maxdisplayed>0&<0;function T(Ge){return S?Ge.transition():Ge}var p=h.xaxis,M=h.yaxis,f=x[0].trace,E=f.line,I=b.select(g),B=w(I,"g","errorbars"),N=w(I,"g","lines"),V=w(I,"g","points"),j=w(I,"g","text");if(d.getComponentMethod("errorbars","plot")(s,B,h,k),f.visible===!0){var $,ee;T(I).style("opacity",f.opacity);var H,J,Q=f.fill.charAt(f.fill.length-1);Q!=="x"&&Q!=="y"&&(Q=""),Q==="y"?(H=1,J=M.c2p(0,!0)):Q==="x"&&(H=0,J=p.c2p(0,!0)),x[0][h.isRangePlot?"nodeRangePlot3":"node3"]=I;var Z,K,ae="",se=[],he=f._prevtrace,fe=null,ie=null;he&&(ae=he._prevRevpath||"",ee=he._nextFill,se=he._ownPolygons,fe=he._fillsegments,ie=he._fillElement);var oe,le,ge,ye,me,be,Se="",Ee="",Ce=[];f._polygons=[];var Le=[],Oe=[],We=e.noop;if($=f._ownFill,u.hasLines(f)||f.fill!=="none"){ee&&ee.datum(x),["hv","vh","hvh","vhv"].indexOf(E.shape)!==-1?(oe=_.steps(E.shape),le=_.steps(E.shape.split("").reverse().join(""))):oe=le=E.shape==="spline"?function(Ge){var tt=Ge[Ge.length-1];return Ge.length>1&&Ge[0][0]===tt[0]&&Ge[0][1]===tt[1]?_.smoothclosed(Ge.slice(1),E.smoothing):_.smoothopen(Ge,E.smoothing)}:function(Ge){return"M"+Ge.join("L")},ge=function(Ge){return le(Ge.reverse())},Oe=r(x,{xaxis:p,yaxis:M,trace:f,connectGaps:f.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,backoff:E.backoff,simplify:E.simplify,fill:f.fill}),Le=new Array(Oe.length);var Ie=0;for(A=0;A0,T=n(s,c,h);(k=x.selectAll("g.trace").data(T,function(p){return p[0].trace.uid})).enter().append("g").attr("class",function(p){return"trace scatter trace"+p[0].trace.uid}).style("stroke-miterlimit",2),k.order(),function(p,M,f){M.each(function(E){var I=w(b.select(this),"g","fills");_.setClipUrl(I,f.layerClipId,p);var B=E[0].trace,N=[];B._ownfill&&N.push("_ownFill"),B._nexttrace&&N.push("_nextFill");var V=I.selectAll("g").data(N,y);V.enter().append("g"),V.exit().each(function(j){B[j]=null}).remove(),V.order().each(function(j){B[j]=w(b.select(this),"path","js-fill")})})}(s,k,c),S?(g&&(A=g()),b.transition().duration(m.duration).ease(m.easing).each("end",function(){A&&A()}).each("interrupt",function(){A&&A()}).each(function(){x.selectAll("g.trace").each(function(p,M){o(s,M,c,p,T,this,m)})})):k.each(function(p,M){o(s,M,c,p,T,this,m)}),v&&k.exit().remove(),x.selectAll("path:not([d])").remove()}},32665:function(D,L,t){var b=t(64726);D.exports=function(d,e){var w,y,_,u,r=d.cd,n=d.xaxis,l=d.yaxis,o=[],s=r[0].trace;if(!b.hasMarkers(s)&&!b.hasText(s))return[];if(e===!1)for(w=0;w0){var h=_.c2l(s);_._lowerLogErrorBound||(_._lowerLogErrorBound=h),_._lowerErrorBound=Math.min(_._lowerLogErrorBound,h)}}else r[n]=[-l[0]*y,l[1]*y]}return r}D.exports=function(e,w,y){var _=[d(e.x,e.error_x,w[0],y.xaxis),d(e.y,e.error_y,w[1],y.yaxis),d(e.z,e.error_z,w[2],y.zaxis)],u=function(c){for(var h=0;h-1?-1:M.indexOf("right")>-1?1:0}function k(M){return M==null?0:M.indexOf("top")>-1?-1:M.indexOf("bottom")>-1?1:0}function A(M,f){return f(4*M)}function v(M){return o[M]}function S(M,f,E,I,B){var N=null;if(_.isArrayOrTypedArray(M)){N=[];for(var V=0;V=0){var ee=function(H,J,Q){var Z,K=(Q+1)%3,ae=(Q+2)%3,se=[],he=[];for(Z=0;Z=0&&s("surfacecolor",h||x);for(var m=["x","y","z"],g=0;g<3;++g){var k="projection."+m[g];s(k+".show")&&(s(k+".opacity"),s(k+".scale"))}var A=b.getComponentMethod("errorbars","supplyDefaults");A(r,n,h||x||l,{axis:"z"}),A(r,n,h||x||l,{axis:"y",inherit:"z"}),A(r,n,h||x||l,{axis:"x",inherit:"z"})}else n.visible=!1}},17822:function(D,L,t){D.exports={plot:t(16533),attributes:t(14117),markerSymbols:t(49467),supplyDefaults:t(82418),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:t(37593),moduleType:"trace",name:"scatter3d",basePlotModule:t(2487),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}},54637:function(D,L,t){var b=t(19326),d=t(36640),e=t(9829),w=t(3208).rb,y=t(3208).ay,_=t(87163),u=t(93049).extendFlat,r=d.marker,n=d.line,l=r.line;D.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:u({},d.mode,{dflt:"markers"}),text:u({},d.text,{}),texttemplate:y({editType:"plot"},{keys:["a","b","text"]}),hovertext:u({},d.hovertext,{}),line:{color:n.color,width:n.width,dash:n.dash,backoff:n.backoff,shape:u({},n.shape,{values:["linear","spline"]}),smoothing:n.smoothing,editType:"calc"},connectgaps:d.connectgaps,fill:u({},d.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:b(),marker:u({symbol:r.symbol,opacity:r.opacity,maxdisplayed:r.maxdisplayed,angle:r.angle,angleref:r.angleref,standoff:r.standoff,size:r.size,sizeref:r.sizeref,sizemin:r.sizemin,sizemode:r.sizemode,line:u({width:l.width,editType:"calc"},_("marker.line")),gradient:r.gradient,editType:"calc"},_("marker")),textfont:d.textfont,textposition:d.textposition,selected:d.selected,unselected:d.unselected,hoverinfo:u({},e.hoverinfo,{flags:["a","b","text","name"]}),hoveron:d.hoveron,hovertemplate:w(),zorder:d.zorder}},68001:function(D,L,t){var b=t(10721),d=t(77272),e=t(99203),w=t(48861),y=t(26544).calcMarkerSize,_=t(26571);D.exports=function(u,r){var n=r._carpetTrace=_(u,r);if(n&&n.visible&&n.visible!=="legendonly"){var l;r.xaxis=n.xaxis,r.yaxis=n.yaxis;var o,s,c=r._length,h=new Array(c),x=!1;for(l=0;l")}return u}function A(v,S){var T;T=v.labelprefix&&v.labelprefix.length>0?v.labelprefix.replace(/ = $/,""):v._hovertitle,g.push(T+": "+S.toFixed(3)+v.labelsuffix)}}},56534:function(D,L,t){D.exports={attributes:t(54637),supplyDefaults:t(16986),colorbar:t(21146),formatLabels:t(32709),calc:t(68001),plot:t(64535),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(59420),selectPoints:t(32665),eventData:t(68289),moduleType:"trace",name:"scattercarpet",basePlotModule:t(37703),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}},64535:function(D,L,t){var b=t(36098),d=t(29714),e=t(62203);D.exports=function(w,y,_,u){var r,n,l,o=_[0][0].carpet,s=d.getFromId(w,o.xaxis||"x"),c=d.getFromId(w,o.yaxis||"y"),h={xaxis:s,yaxis:c,plot:y.plot};for(r=0;r<_.length;r++)(n=_[r][0].trace)._xA=s,n._yA=c;for(b(w,h,_,u),r=0;r<_.length;r++)n=_[r][0].trace,l=u.selectAll("g.trace"+n.uid+" .js-line"),e.setClipUrl(l,_[r][0].carpet._clipPathId,w)}},6893:function(D,L,t){var b=t(3208).rb,d=t(3208).ay,e=t(19326),w=t(36640),y=t(9829),_=t(87163),u=t(94850).T,r=t(93049).extendFlat,n=t(13582).overrideAll,l=w.marker,o=w.line,s=l.line;D.exports=n({lon:{valType:"data_array"},lat:{valType:"data_array"},locations:{valType:"data_array"},locationmode:{valType:"enumerated",values:["ISO-3","USA-states","country names","geojson-id"],dflt:"ISO-3"},geojson:{valType:"any",editType:"calc"},featureidkey:{valType:"string",editType:"calc",dflt:"id"},mode:r({},w.mode,{dflt:"markers"}),text:r({},w.text,{}),texttemplate:d({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:r({},w.hovertext,{}),textfont:w.textfont,textposition:w.textposition,line:{color:o.color,width:o.width,dash:u},connectgaps:w.connectgaps,marker:r({symbol:l.symbol,opacity:l.opacity,angle:l.angle,angleref:r({},l.angleref,{values:["previous","up","north"]}),standoff:l.standoff,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,colorbar:l.colorbar,line:r({width:s.width},_("marker.line")),gradient:l.gradient},_("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:e(),selected:w.selected,unselected:w.unselected,hoverinfo:r({},y.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:b()},"calc","nested")},75649:function(D,L,t){var b=t(10721),d=t(63821).BADNUM,e=t(77272),w=t(99203),y=t(48861),_=t(34809).isArrayOrTypedArray,u=t(34809)._;function r(n){return n&&typeof n=="string"}D.exports=function(n,l){var o,s=_(l.locations),c=s?l.locations.length:l._length,h=new Array(c);o=l.geojson?function(v){return r(v)||b(v)}:r;for(var x=0;x")}function ee(H){return H+"°"}}(l,m,_,n[0].t.labels),_.hovertemplate=l.hovertemplate,[_]}}},18070:function(D,L,t){D.exports={attributes:t(6893),supplyDefaults:t(27386),colorbar:t(21146),formatLabels:t(57413),calc:t(75649),calcGeoJSON:t(48887).calcGeoJSON,plot:t(48887).plot,style:t(60367),styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(40636),eventData:t(71873),selectPoints:t(45852),moduleType:"trace",name:"scattergeo",basePlotModule:t(47544),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}},48887:function(D,L,t){var b=t(45568),d=t(34809),e=t(11577).getTopojsonFeatures,w=t(39532),y=t(3994),_=t(32919).findExtremes,u=t(63821).BADNUM,r=t(26544).calcMarkerSize,n=t(64726),l=t(60367);D.exports={calcGeoJSON:function(o,s){var c,h,x=o[0].trace,m=s[x.geo],g=m._subplot,k=x._length;if(d.isArrayOrTypedArray(x.locations)){var A=x.locationmode,v=A==="geojson-id"?y.extractTraceFeature(o):e(x,g.topojson);for(c=0;c=h,f=2*p,E={},I=v.makeCalcdata(g,"x"),B=S.makeCalcdata(g,"y"),N=y(g,v,"x",I),V=y(g,S,"y",B),j=N.vals,$=V.vals;g._x=j,g._y=$,g.xperiodalignment&&(g._origX=I,g._xStarts=N.starts,g._xEnds=N.ends),g.yperiodalignment&&(g._origY=B,g._yStarts=V.starts,g._yEnds=V.ends);var ee=new Array(f),H=new Array(p);for(k=0;k1&&d.extendFlat(oe.line,o.linePositions(K,se,he)),oe.errorX||oe.errorY){var le=o.errorBarPositions(K,se,he,fe,ie);oe.errorX&&d.extendFlat(oe.errorX,le.x),oe.errorY&&d.extendFlat(oe.errorY,le.y)}return oe.text&&(d.extendFlat(oe.text,{positions:he},o.textPosition(K,se,oe.text,oe.marker)),d.extendFlat(oe.textSel,{positions:he},o.textPosition(K,se,oe.text,oe.markerSel)),d.extendFlat(oe.textUnsel,{positions:he},o.textPosition(K,se,oe.text,oe.markerUnsel))),oe}(m,0,g,ee,j,$),Z=s(m,T);return n(A,g),M?Q.marker&&(J=Q.marker.sizeAvg||Math.max(Q.marker.size,3)):J=u(g,p),r(m,g,v,S,j,$,J),Q.errorX&&x(g,v,Q.errorX),Q.errorY&&x(g,S,Q.errorY),Q.fill&&!Z.fill2d&&(Z.fill2d=!0),Q.marker&&!Z.scatter2d&&(Z.scatter2d=!0),Q.line&&!Z.line2d&&(Z.line2d=!0),!Q.errorX&&!Q.errorY||Z.error2d||(Z.error2d=!0),Q.text&&!Z.glText&&(Z.glText=!0),Q.marker&&(Q.marker.snap=p),Z.lineOptions.push(Q.line),Z.errorXOptions.push(Q.errorX),Z.errorYOptions.push(Q.errorY),Z.fillOptions.push(Q.fill),Z.markerOptions.push(Q.marker),Z.markerSelectedOptions.push(Q.markerSel),Z.markerUnselectedOptions.push(Q.markerUnsel),Z.textOptions.push(Q.text),Z.textSelectedOptions.push(Q.textSel),Z.textUnselectedOptions.push(Q.textUnsel),Z.selectBatch.push([]),Z.unselectBatch.push([]),E._scene=Z,E.index=Z.count,E.x=j,E.y=$,E.positions=ee,Z.count++,[{x:!1,y:!1,t:E,trace:g}]}},29483:function(D){D.exports={TOO_MANY_POINTS:1e5,SYMBOL_SDF_SIZE:200,SYMBOL_SIZE:20,SYMBOL_STROKE:1,DOT_RE:/-dot/,OPEN_RE:/-open/,DASHES:{solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}}},19937:function(D,L,t){var b=t(10721),d=t(96021),e=t(162),w=t(33626),y=t(34809),_=y.isArrayOrTypedArray,u=t(62203),r=t(5975),n=t(46998).formatColor,l=t(64726),o=t(92527),s=t(4075),c=t(29483),h=t(20438).DESELECTDIM,x={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},m=t(36040).appendArrayPointValue;function g(N,V){var j,$=N._fullLayout,ee=V._length,H=V.textfont,J=V.textposition,Q=_(J)?J:[J],Z=H.color,K=H.size,ae=H.family,se=H.weight,he=H.style,fe=H.variant,ie={},oe=N._context.plotGlPixelRatio,le=V.texttemplate;if(le){ie.text=[];var ge=$._d3locale,ye=Array.isArray(le),me=ye?Math.min(le.length,ee):ee,be=ye?function(Ie){return le[Ie]}:function(){return le};for(j=0;j500?"bold":"normal":N}function A(N,V){var j,$,ee=V._length,H=V.marker,J={},Q=_(H.symbol),Z=_(H.angle),K=_(H.color),ae=_(H.line.color),se=_(H.opacity),he=_(H.size),fe=_(H.line.width);if(Q||($=s.isOpenSymbol(H.symbol)),Q||K||ae||se||Z){J.symbols=new Array(ee),J.angles=new Array(ee),J.colors=new Array(ee),J.borderColors=new Array(ee);var ie=H.symbol,oe=H.angle,le=n(H,H.opacity,ee),ge=n(H.line,H.opacity,ee);if(!_(ge[0])){var ye=ge;for(ge=Array(ee),j=0;jc.TOO_MANY_POINTS||l.hasMarkers(V)?"rect":"round";if(K&&V.connectgaps){var se=$[0],he=$[1];for(ee=0;ee<$.length;ee+=2)isNaN($[ee])||isNaN($[ee+1])?($[ee]=se,$[ee+1]=he):(se=$[ee],he=$[ee+1])}return{join:ae,positions:$}},errorBarPositions:function(N,V,j,$,ee){var H=w.getComponentMethod("errorbars","makeComputeError"),J=r.getFromId(N,V.xaxis,"x"),Q=r.getFromId(N,V.yaxis,"y"),Z=j.length/2,K={};function ae(se,he){var fe=he._id.charAt(0),ie=V["error_"+fe];if(ie&&ie.visible&&(he.type==="linear"||he.type==="log")){for(var oe=H(ie),le={x:0,y:1}[fe],ge={x:[0,1,2,3],y:[2,3,0,1]}[fe],ye=new Float64Array(4*Z),me=1/0,be=-1/0,Se=0,Ee=0;Se1?Z[ee]:Z[0]:Z,fe=_(K)?K.length>1?K[ee]:K[0]:K,ie=x[he],oe=x[fe],le=ae?ae/.8+1:0,ge=-oe*le-.5*oe;J.offset[ee]=[ie*le/se,ge/se]}}return J}}},86590:function(D,L,t){var b=t(34809),d=t(33626),e=t(4075),w=t(92089),y=t(32660),_=t(64726),u=t(99867),r=t(99669),n=t(24272),l=t(98168),o=t(54114),s=t(663);D.exports=function(c,h,x,m){function g(f,E){return b.coerce(c,h,w,f,E)}var k=!!c.marker&&e.isOpenSymbol(c.marker.symbol),A=_.isBubble(c),v=u(c,h,m,g);if(v){r(c,h,m,g),g("xhoverformat"),g("yhoverformat");var S=v100},L.isDotSymbol=function(d){return typeof d=="string"?b.DOT_RE.test(d):d>200}},36544:function(D,L,t){var b=t(33626),d=t(34809),e=t(11539);function w(y,_,u,r){var n=y.xa,l=y.ya,o=y.distance,s=y.dxy,c=y.index,h={pointNumber:c,x:_[c],y:u[c]};h.tx=d.isArrayOrTypedArray(r.text)?r.text[c]:r.text,h.htx=Array.isArray(r.hovertext)?r.hovertext[c]:r.hovertext,h.data=Array.isArray(r.customdata)?r.customdata[c]:r.customdata,h.tp=Array.isArray(r.textposition)?r.textposition[c]:r.textposition;var x=r.textfont;x&&(h.ts=d.isArrayOrTypedArray(x.size)?x.size[c]:x.size,h.tc=d.isArrayOrTypedArray(x.color)?x.color[c]:x.color,h.tf=Array.isArray(x.family)?x.family[c]:x.family,h.tw=Array.isArray(x.weight)?x.weight[c]:x.weight,h.ty=Array.isArray(x.style)?x.style[c]:x.style,h.tv=Array.isArray(x.variant)?x.variant[c]:x.variant);var m=r.marker;m&&(h.ms=d.isArrayOrTypedArray(m.size)?m.size[c]:m.size,h.mo=d.isArrayOrTypedArray(m.opacity)?m.opacity[c]:m.opacity,h.mx=d.isArrayOrTypedArray(m.symbol)?m.symbol[c]:m.symbol,h.ma=d.isArrayOrTypedArray(m.angle)?m.angle[c]:m.angle,h.mc=d.isArrayOrTypedArray(m.color)?m.color[c]:m.color);var g=m&&m.line;g&&(h.mlc=Array.isArray(g.color)?g.color[c]:g.color,h.mlw=d.isArrayOrTypedArray(g.width)?g.width[c]:g.width);var k=m&&m.gradient;k&&k.type!=="none"&&(h.mgt=Array.isArray(k.type)?k.type[c]:k.type,h.mgc=Array.isArray(k.color)?k.color[c]:k.color);var A=n.c2p(h.x,!0),v=l.c2p(h.y,!0),S=h.mrc||1,T=r.hoverlabel;T&&(h.hbg=Array.isArray(T.bgcolor)?T.bgcolor[c]:T.bgcolor,h.hbc=Array.isArray(T.bordercolor)?T.bordercolor[c]:T.bordercolor,h.hts=d.isArrayOrTypedArray(T.font.size)?T.font.size[c]:T.font.size,h.htc=Array.isArray(T.font.color)?T.font.color[c]:T.font.color,h.htf=Array.isArray(T.font.family)?T.font.family[c]:T.font.family,h.hnl=d.isArrayOrTypedArray(T.namelength)?T.namelength[c]:T.namelength);var p=r.hoverinfo;p&&(h.hi=Array.isArray(p)?p[c]:p);var M=r.hovertemplate;M&&(h.ht=Array.isArray(M)?M[c]:M);var f={};f[y.index]=h;var E=r._origX,I=r._origY,B=d.extendFlat({},y,{color:e(r,h),x0:A-S,x1:A+S,xLabelVal:E?E[c]:h.x,y0:v-S,y1:v+S,yLabelVal:I?I[c]:h.y,cd:f,distance:o,spikeDistance:s,hovertemplate:h.ht});return h.htx?B.text=h.htx:h.tx?B.text=h.tx:r.text&&(B.text=r.text),d.fillText(h,r,B),b.getComponentMethod("errorbars","hoverInfo")(h,r,B),B}D.exports={hoverPoints:function(y,_,u,r){var n,l,o,s,c,h,x,m,g,k,A=y.cd,v=A[0].t,S=A[0].trace,T=y.xa,p=y.ya,M=v.x,f=v.y,E=T.c2p(_),I=p.c2p(u),B=y.distance;if(v.tree){var N=T.p2c(E-B),V=T.p2c(E+B),j=p.p2c(I-B),$=p.p2c(I+B);n=r==="x"?v.tree.range(Math.min(N,V),Math.min(p._rl[0],p._rl[1]),Math.max(N,V),Math.max(p._rl[0],p._rl[1])):v.tree.range(Math.min(N,V),Math.min(j,$),Math.max(N,V),Math.max(j,$))}else n=v.ids;var ee=B;if(r==="x"){var H=!!S.xperiodalignment,J=!!S.yperiodalignment;for(h=0;h=Math.min(Q,Z)&&E<=Math.max(Q,Z)?0:1/0}if(x=Math.min(K,ae)&&I<=Math.max(K,ae)?0:1/0}k=Math.sqrt(x*x+m*m),o=n[h]}}}else for(h=n.length-1;h>-1;h--)s=M[l=n[h]],c=f[l],x=T.c2p(s)-E,m=p.c2p(c)-I,(g=Math.sqrt(x*x+m*m))A.glText.length){var M=T-A.glText.length;for(m=0;mye&&(isNaN(ge[me])||isNaN(ge[me+1]));)me-=2;le.positions=ge.slice(ye,me+2)}return le}),A.line2d.update(A.lineOptions)),A.error2d){var E=(A.errorXOptions||[]).concat(A.errorYOptions||[]);A.error2d.update(E)}A.scatter2d&&A.scatter2d.update(A.markerOptions),A.fillOrder=y.repeat(null,T),A.fill2d&&(A.fillOptions=A.fillOptions.map(function(le,ge){var ye=x[ge];if(le&&ye&&ye[0]&&ye[0].trace){var me,be,Se=ye[0],Ee=Se.trace,Ce=Se.t,Le=A.lineOptions[ge],Oe=[];Ee._ownfill&&Oe.push(ge),Ee._nexttrace&&Oe.push(ge+1),Oe.length&&(A.fillOrder[ge]=Oe);var We,Ie,Ve=[],Pe=Le&&Le.positions||Ce.positions;if(Ee.fill==="tozeroy"){for(We=0;WeWe&&isNaN(Pe[Ie+1]);)Ie-=2;Pe[We+1]!==0&&(Ve=[Pe[We],0]),Ve=Ve.concat(Pe.slice(We,Ie+2)),Pe[Ie+1]!==0&&(Ve=Ve.concat([Pe[Ie],0]))}else if(Ee.fill==="tozerox"){for(We=0;WeWe&&isNaN(Pe[Ie]);)Ie-=2;Pe[We]!==0&&(Ve=[0,Pe[We+1]]),Ve=Ve.concat(Pe.slice(We,Ie+2)),Pe[Ie]!==0&&(Ve=Ve.concat([0,Pe[Ie+1]]))}else if(Ee.fill==="toself"||Ee.fill==="tonext"){for(Ve=[],me=0,le.splitNull=!0,be=0;be-1;for(m=0;m850?" Black":M>750?" Extra Bold":M>650?" Bold":M>550?" Semi Bold":M>450?" Medium":M>350?" Regular":M>250?" Light":M>150?" Extra Light":" Thin"):f.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",I+=M>750?" Extrabold":M>650?" Bold":M>550?" Semibold":M>350?" Regular":" Light"):f.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",f[3]==="CJK"&&(I+=" CJK"),I+=M>500?" Bold":" Regular")),E&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=T),I.split(", ")}D.exports=function(v,S){var T,p=S[0].trace,M=p.visible===!0&&p._length!==0,f=p.fill!=="none",E=r.hasLines(p),I=r.hasMarkers(p),B=r.hasText(p),N=I&&p.marker.symbol==="circle",V=I&&p.marker.symbol!=="circle",j=p.cluster&&p.cluster.enabled,$=h("fill"),ee=h("line"),H=h("circle"),J=h("symbol"),Q={fill:$,line:ee,circle:H,symbol:J};if(!M)return Q;if((f||E)&&(T=w.calcTraceToLineCoords(S)),f&&($.geojson=w.makePolygon(T),$.layout.visibility="visible",d.extendFlat($.paint,{"fill-color":p.fillcolor})),E&&(ee.geojson=w.makeLine(T),ee.layout.visibility="visible",d.extendFlat(ee.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),N){var Z=function(se){var he,fe,ie,oe,le=se[0].trace,ge=le.marker,ye=le.selectedpoints,me=d.isArrayOrTypedArray(ge.color),be=d.isArrayOrTypedArray(ge.size),Se=d.isArrayOrTypedArray(ge.opacity);function Ee(de){return le.opacity*de}me&&(fe=y.hasColorscale(le,"marker")?y.makeColorScaleFuncFromTrace(ge):d.identity),be&&(ie=u(le)),Se&&(oe=function(de){return Ee(b(de)?+d.constrain(de,0,1):0)});var Ce,Le,Oe=[];for(he=0;he")}function g(k){return k+"°"}}D.exports={hoverPoints:function(r,n,l){var o=r.cd,s=o[0].trace,c=r.xa,h=r.ya,x=r.subplot,m=[],g=_+s.uid+"-circle",k=s.cluster&&s.cluster.enabled;if(k){var A=x.map.queryRenderedFeatures(null,{layers:[g]});m=A.map(function(V){return V.id})}var v=360*(n>=0?Math.floor((n+180)/360):Math.ceil((n-180)/360)),S=n-v;if(b.getClosest(o,function(V){var j=V.lonlat;if(j[0]===y||k&&m.indexOf(V.i+1)===-1)return 1/0;var $=d.modHalf(j[0],360),ee=j[1],H=x.project([$,ee]),J=H.x-c.c2p([S,ee]),Q=H.y-h.c2p([$,l]),Z=Math.max(3,V.mrc||0);return Math.max(Math.sqrt(J*J+Q*Q)-Z,1-3/Z)},r),r.index!==!1){var T=o[r.index],p=T.lonlat,M=[d.modHalf(p[0],360)+v,p[1]],f=c.c2p(M),E=h.c2p(M),I=T.mrc||1;r.x0=f-I,r.x1=f+I,r.y0=E-I,r.y1=E+I;var B={};B[s.subplot]={_subplot:x};var N=s._module.formatLabels(T,s,B);return r.lonLabel=N.lonLabel,r.latLabel=N.latLabel,r.color=e(s,T),r.extraText=u(s,T,o[0].t.labels),r.hovertemplate=s.hovertemplate,[r]}},getExtraText:u}},30929:function(D,L,t){D.exports={attributes:t(71388),supplyDefaults:t(57387),colorbar:t(21146),formatLabels:t(66762),calc:t(75649),plot:t(26126),hoverPoints:t(67275).hoverPoints,eventData:t(58240),selectPoints:t(21501),styleOnSelect:function(b,d){d&&d[0].trace._glTrace.update(d)},moduleType:"trace",name:"scattermap",basePlotModule:t(34091),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}},26126:function(D,L,t){var b=t(34809),d=t(76717),e=t(8814).traceLayerPrefix,w={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function y(u,r,n,l){this.type="scattermap",this.subplot=u,this.uid=r,this.clusterEnabled=n,this.isHidden=l,this.sourceIds={fill:"source-"+r+"-fill",line:"source-"+r+"-line",circle:"source-"+r+"-circle",symbol:"source-"+r+"-symbol",cluster:"source-"+r+"-circle",clusterCount:"source-"+r+"-circle"},this.layerIds={fill:e+r+"-fill",line:e+r+"-line",circle:e+r+"-circle",symbol:e+r+"-symbol",cluster:e+r+"-cluster",clusterCount:e+r+"-cluster-count"},this.below=null}var _=y.prototype;_.addSource=function(u,r,n){var l={type:"geojson",data:r.geojson};n&&n.enabled&&b.extendFlat(l,{cluster:!0,clusterMaxZoom:n.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[u]);o?o.setData(r.geojson):this.subplot.map.addSource(this.sourceIds[u],l)},_.setSourceData=function(u,r){this.subplot.map.getSource(this.sourceIds[u]).setData(r.geojson)},_.addLayer=function(u,r,n){var l={type:r.type,id:this.layerIds[u],source:this.sourceIds[u],layout:r.layout,paint:r.paint};r.filter&&(l.filter=r.filter);for(var o,s=this.layerIds[u],c=this.subplot.getMapLayers(),h=0;h=0;M--){var f=p[M];l.removeLayer(x.layerIds[f])}T||l.removeSource(x.sourceIds.circle)}(S):function(T){for(var p=w.nonCluster,M=p.length-1;M>=0;M--){var f=p[M];l.removeLayer(x.layerIds[f]),T||l.removeSource(x.sourceIds[f])}}(S)}function g(S){c?function(T){T||x.addSource("circle",o.circle,r.cluster);for(var p=w.cluster,M=0;M=0;n--){var l=r[n];u.removeLayer(this.layerIds[l]),u.removeSource(this.sourceIds[l])}},D.exports=function(u,r){var n,l,o,s=r[0].trace,c=s.cluster&&s.cluster.enabled,h=s.visible!==!0,x=new y(u,s.uid,c,h),m=d(u.gd,r),g=x.below=u.belowLookup["trace-"+s.uid];if(c)for(x.addSource("circle",m.circle,s.cluster),n=0;n850?" Black":M>750?" Extra Bold":M>650?" Bold":M>550?" Semi Bold":M>450?" Medium":M>350?" Regular":M>250?" Light":M>150?" Extra Light":" Thin"):f.slice(0,2).join(" ")==="Open Sans"?(I="Open Sans",I+=M>750?" Extrabold":M>650?" Bold":M>550?" Semibold":M>350?" Regular":" Light"):f.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(I="Klokantech Noto Sans",f[3]==="CJK"&&(I+=" CJK"),I+=M>500?" Bold":" Regular")),E&&(I+=" Italic"),I==="Open Sans Regular Italic"?I="Open Sans Italic":I==="Open Sans Regular Bold"?I="Open Sans Bold":I==="Open Sans Regular Bold Italic"?I="Open Sans Bold Italic":I==="Klokantech Noto Sans Regular Italic"&&(I="Klokantech Noto Sans Italic"),n(I)||(I=T),I.split(", ")}D.exports=function(v,S){var T,p=S[0].trace,M=p.visible===!0&&p._length!==0,f=p.fill!=="none",E=r.hasLines(p),I=r.hasMarkers(p),B=r.hasText(p),N=I&&p.marker.symbol==="circle",V=I&&p.marker.symbol!=="circle",j=p.cluster&&p.cluster.enabled,$=h("fill"),ee=h("line"),H=h("circle"),J=h("symbol"),Q={fill:$,line:ee,circle:H,symbol:J};if(!M)return Q;if((f||E)&&(T=w.calcTraceToLineCoords(S)),f&&($.geojson=w.makePolygon(T),$.layout.visibility="visible",d.extendFlat($.paint,{"fill-color":p.fillcolor})),E&&(ee.geojson=w.makeLine(T),ee.layout.visibility="visible",d.extendFlat(ee.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),N){var Z=function(se){var he,fe,ie,oe,le=se[0].trace,ge=le.marker,ye=le.selectedpoints,me=d.isArrayOrTypedArray(ge.color),be=d.isArrayOrTypedArray(ge.size),Se=d.isArrayOrTypedArray(ge.opacity);function Ee(de){return le.opacity*de}me&&(fe=y.hasColorscale(le,"marker")?y.makeColorScaleFuncFromTrace(ge):d.identity),be&&(ie=u(le)),Se&&(oe=function(de){return Ee(b(de)?+d.constrain(de,0,1):0)});var Ce,Le,Oe=[];for(he=0;he")}function g(k){return k+"°"}}D.exports={hoverPoints:function(r,n,l){var o=r.cd,s=o[0].trace,c=r.xa,h=r.ya,x=r.subplot,m=[],g=_+s.uid+"-circle",k=s.cluster&&s.cluster.enabled;if(k){var A=x.map.queryRenderedFeatures(null,{layers:[g]});m=A.map(function(V){return V.id})}var v=360*(n>=0?Math.floor((n+180)/360):Math.ceil((n-180)/360)),S=n-v;if(b.getClosest(o,function(V){var j=V.lonlat;if(j[0]===y||k&&m.indexOf(V.i+1)===-1)return 1/0;var $=d.modHalf(j[0],360),ee=j[1],H=x.project([$,ee]),J=H.x-c.c2p([S,ee]),Q=H.y-h.c2p([$,l]),Z=Math.max(3,V.mrc||0);return Math.max(Math.sqrt(J*J+Q*Q)-Z,1-3/Z)},r),r.index!==!1){var T=o[r.index],p=T.lonlat,M=[d.modHalf(p[0],360)+v,p[1]],f=c.c2p(M),E=h.c2p(M),I=T.mrc||1;r.x0=f-I,r.x1=f+I,r.y0=E-I,r.y1=E+I;var B={};B[s.subplot]={_subplot:x};var N=s._module.formatLabels(T,s,B);return r.lonLabel=N.lonLabel,r.latLabel=N.latLabel,r.color=e(s,T),r.extraText=u(s,T,o[0].t.labels),r.hovertemplate=s.hovertemplate,[r]}},getExtraText:u}},83866:function(D,L,t){D.exports={attributes:t(95833),supplyDefaults:t(38302),colorbar:t(21146),formatLabels:t(69009),calc:t(75649),plot:t(20691),hoverPoints:t(18016).hoverPoints,eventData:t(68197),selectPoints:t(60784),styleOnSelect:function(b,d){d&&d[0].trace._glTrace.update(d)},moduleType:"trace",name:"scattermapbox",basePlotModule:t(68192),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}},20691:function(D,L,t){var b=t(34809),d=t(27009),e=t(44245).traceLayerPrefix,w={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function y(u,r,n,l){this.type="scattermapbox",this.subplot=u,this.uid=r,this.clusterEnabled=n,this.isHidden=l,this.sourceIds={fill:"source-"+r+"-fill",line:"source-"+r+"-line",circle:"source-"+r+"-circle",symbol:"source-"+r+"-symbol",cluster:"source-"+r+"-circle",clusterCount:"source-"+r+"-circle"},this.layerIds={fill:e+r+"-fill",line:e+r+"-line",circle:e+r+"-circle",symbol:e+r+"-symbol",cluster:e+r+"-cluster",clusterCount:e+r+"-cluster-count"},this.below=null}var _=y.prototype;_.addSource=function(u,r,n){var l={type:"geojson",data:r.geojson};n&&n.enabled&&b.extendFlat(l,{cluster:!0,clusterMaxZoom:n.maxzoom});var o=this.subplot.map.getSource(this.sourceIds[u]);o?o.setData(r.geojson):this.subplot.map.addSource(this.sourceIds[u],l)},_.setSourceData=function(u,r){this.subplot.map.getSource(this.sourceIds[u]).setData(r.geojson)},_.addLayer=function(u,r,n){var l={type:r.type,id:this.layerIds[u],source:this.sourceIds[u],layout:r.layout,paint:r.paint};r.filter&&(l.filter=r.filter);for(var o,s=this.layerIds[u],c=this.subplot.getMapLayers(),h=0;h=0;M--){var f=p[M];l.removeLayer(x.layerIds[f])}T||l.removeSource(x.sourceIds.circle)}(S):function(T){for(var p=w.nonCluster,M=p.length-1;M>=0;M--){var f=p[M];l.removeLayer(x.layerIds[f]),T||l.removeSource(x.sourceIds[f])}}(S)}function g(S){c?function(T){T||x.addSource("circle",o.circle,r.cluster);for(var p=w.cluster,M=0;M=0;n--){var l=r[n];u.removeLayer(this.layerIds[l]),u.removeSource(this.sourceIds[l])}},D.exports=function(u,r){var n,l,o,s=r[0].trace,c=s.cluster&&s.cluster.enabled,h=s.visible!==!0,x=new y(u,s.uid,c,h),m=d(u.gd,r),g=x.below=u.belowLookup["trace-"+s.uid];if(c)for(x.addSource("circle",m.circle,s.cluster),n=0;n")}}D.exports={hoverPoints:function(e,w,y,_){var u=b(e,w,y,_);if(u&&u[0].index!==!1){var r=u[0];if(r.index===void 0)return u;var n=e.subplot,l=r.cd[r.index],o=r.trace;if(n.isPtInside(l))return r.xLabelVal=void 0,r.yLabelVal=void 0,d(l,o,n,r),r.hovertemplate=o.hovertemplate,u}},makeHoverPointText:d}},66939:function(D,L,t){D.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t(31645),categories:["polar","symbols","showLegend","scatter-like"],attributes:t(8738),supplyDefaults:t(73749).supplyDefaults,colorbar:t(21146),formatLabels:t(33368),calc:t(13246),plot:t(43836),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(29709).hoverPoints,selectPoints:t(32665),meta:{}}},43836:function(D,L,t){var b=t(36098),d=t(63821).BADNUM;D.exports=function(e,w,y){for(var _=w.layers.frontplot.select("g.scatterlayer"),u=w.xaxis,r=w.yaxis,n={xaxis:u,yaxis:r,plot:w.framework,layerClipId:w._hasClipOnAxisFalse?w.clipIds.forTraces:null},l=w.radialAxis,o=w.angularAxis,s=0;s=u&&(T.marker.cluster=k.tree),T.marker&&(T.markerSel.positions=T.markerUnsel.positions=T.marker.positions=f),T.line&&f.length>1&&_.extendFlat(T.line,y.linePositions(r,g,f)),T.text&&(_.extendFlat(T.text,{positions:f},y.textPosition(r,g,T.text,T.marker)),_.extendFlat(T.textSel,{positions:f},y.textPosition(r,g,T.text,T.markerSel)),_.extendFlat(T.textUnsel,{positions:f},y.textPosition(r,g,T.text,T.markerUnsel))),T.fill&&!c.fill2d&&(c.fill2d=!0),T.marker&&!c.scatter2d&&(c.scatter2d=!0),T.line&&!c.line2d&&(c.line2d=!0),T.text&&!c.glText&&(c.glText=!0),c.lineOptions.push(T.line),c.fillOptions.push(T.fill),c.markerOptions.push(T.marker),c.markerSelectedOptions.push(T.markerSel),c.markerUnselectedOptions.push(T.markerUnsel),c.textOptions.push(T.text),c.textSelectedOptions.push(T.textSel),c.textUnselectedOptions.push(T.textUnsel),c.selectBatch.push([]),c.unselectBatch.push([]),k.x=E,k.y=I,k.rawx=E,k.rawy=I,k.r=v,k.theta=S,k.positions=f,k._scene=c,k.index=c.count,c.count++}}),e(r,n,l)}},D.exports.reglPrecompiled={}},69595:function(D,L,t){var b=t(3208).rb,d=t(3208).ay,e=t(93049).extendFlat,w=t(19326),y=t(36640),_=t(9829),u=y.line;D.exports={mode:y.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:y.text,texttemplate:d({editType:"plot"},{keys:["real","imag","text"]}),hovertext:y.hovertext,line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:e({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:y.connectgaps,marker:y.marker,cliponaxis:e({},y.cliponaxis,{dflt:!1}),textposition:y.textposition,textfont:y.textfont,fill:e({},y.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:w(),hoverinfo:e({},_.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:y.hoveron,hovertemplate:b(),selected:y.selected,unselected:y.unselected}},44315:function(D,L,t){var b=t(10721),d=t(63821).BADNUM,e=t(77272),w=t(99203),y=t(48861),_=t(26544).calcMarkerSize;D.exports=function(u,r){for(var n=u._fullLayout,l=r.subplot,o=n[l].realaxis,s=n[l].imaginaryaxis,c=o.makeCalcdata(r,"real"),h=s.makeCalcdata(r,"imag"),x=r._length,m=new Array(x),g=0;g")}}D.exports={hoverPoints:function(e,w,y,_){var u=b(e,w,y,_);if(u&&u[0].index!==!1){var r=u[0];if(r.index===void 0)return u;var n=e.subplot,l=r.cd[r.index],o=r.trace;if(n.isPtInside(l))return r.xLabelVal=void 0,r.yLabelVal=void 0,d(l,o,n,r),r.hovertemplate=o.hovertemplate,u}},makeHoverPointText:d}},73304:function(D,L,t){D.exports={moduleType:"trace",name:"scattersmith",basePlotModule:t(50358),categories:["smith","symbols","showLegend","scatter-like"],attributes:t(69595),supplyDefaults:t(93788),colorbar:t(21146),formatLabels:t(89419),calc:t(44315),plot:t(6229),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(64422).hoverPoints,selectPoints:t(32665),meta:{}}},6229:function(D,L,t){var b=t(36098),d=t(63821).BADNUM,e=t(52007).smith;D.exports=function(w,y,_){for(var u=y.layers.frontplot.select("g.scatterlayer"),r=y.xaxis,n=y.yaxis,l={xaxis:r,yaxis:n,plot:y.framework,layerClipId:y._hasClipOnAxisFalse?y.clipIds.forTraces:null},o=0;o<_.length;o++)for(var s=_[o],c=0;c"),u.hovertemplate=c.hovertemplate,_}function v(S,T){k.push(S._hovertitle+": "+T)}}},12864:function(D,L,t){D.exports={attributes:t(18483),supplyDefaults:t(79028),colorbar:t(21146),formatLabels:t(78995),calc:t(67091),plot:t(79005),style:t(9408).style,styleOnSelect:t(9408).styleOnSelect,hoverPoints:t(26558),selectPoints:t(32665),eventData:t(94343),moduleType:"trace",name:"scatterternary",basePlotModule:t(7638),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}},79005:function(D,L,t){var b=t(36098);D.exports=function(d,e,w){var y=e.plotContainer;y.select(".scatterlayer").selectAll("*").remove();for(var _=e.xaxis,u=e.yaxis,r={xaxis:_,yaxis:u,plot:y,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null},n=e.layers.frontplot.select("g.scatterlayer"),l=0;ll?S.sizeAvg||Math.max(S.size,3):e(s,v),h=0;hf&&B||M-1,ee=!0;if(w(S)||x.selectedpoints||$){var H=x._length;if(x.selectedpoints){g.selectBatch=x.selectedpoints;var J=x.selectedpoints,Q={};for(l=0;l1&&(h=A[T-1],m=v[T-1],k=S[T-1]),u=0;uh?"-":"+")+"x")).replace("y",(x>m?"-":"+")+"y")).replace("z",(g>k?"-":"+")+"z");var ee=function(){T=0,V=[],j=[],$=[]};(!T||T2?c.slice(1,h-1):h===2?[(c[0]+c[1])/2]:c}function o(c){var h=c.length;return h===1?[.5,.5]:[c[1]-c[0],c[h-1]-c[h-2]]}function s(c,h){var x=c.fullSceneLayout,m=c.dataScale,g=h._len,k={};function A(se,he){var fe=x[he],ie=m[u[he]];return e.simpleMap(se,function(oe){return fe.d2l(oe)*ie})}if(k.vectors=_(A(h._u,"xaxis"),A(h._v,"yaxis"),A(h._w,"zaxis"),g),!g)return{positions:[],cells:[]};var v=A(h._Xs,"xaxis"),S=A(h._Ys,"yaxis"),T=A(h._Zs,"zaxis");if(k.meshgrid=[v,S,T],k.gridFill=h._gridFill,h._slen)k.startingPositions=_(A(h._startsX,"xaxis"),A(h._startsY,"yaxis"),A(h._startsZ,"zaxis"));else{for(var p=S[0],M=l(v),f=l(T),E=new Array(M.length*f.length),I=0,B=0;B=0};p?(x=Math.min(T.length,f.length),m=function(ye){return j(T[ye])&&$(ye)},g=function(ye){return String(T[ye])}):(x=Math.min(M.length,f.length),m=function(ye){return j(M[ye])&&$(ye)},g=function(ye){return String(M[ye])}),I&&(x=Math.min(x,E.length));for(var ee=0;ee1){for(var Z=e.randstr(),K=0;K=0){w.i=r.i;var o=y.marker;o.pattern&&o.colors&&o.pattern.shape||(o.color=l,w.color=l),b.pointStyle(e,y,_,w)}else d.fill(e,l)}},44691:function(D,L,t){var b=t(45568),d=t(33626),e=t(36040).appendArrayPointValue,w=t(32141),y=t(34809),_=t(68596),u=t(33108),r=t(37252).formatPieValue;function n(l,o,s){for(var c=l.data.data,h={curveNumber:o.index,pointNumber:c.i,data:o._input,fullData:o},x=0;x"),name:V||ae("name")?p.name:void 0,color:N("hoverlabel.bgcolor")||M.color,borderColor:N("hoverlabel.bordercolor"),fontFamily:N("hoverlabel.font.family"),fontSize:N("hoverlabel.font.size"),fontColor:N("hoverlabel.font.color"),fontWeight:N("hoverlabel.font.weight"),fontStyle:N("hoverlabel.font.style"),fontVariant:N("hoverlabel.font.variant"),nameLength:N("hoverlabel.namelength"),textAlign:N("hoverlabel.align"),hovertemplate:V,hovertemplateLabels:Q,eventData:T};k&&(fe.x0=ee-v.rInscribed*v.rpx1,fe.x1=ee+v.rInscribed*v.rpx1,fe.idealAlign=v.pxmid[0]<0?"left":"right"),A&&(fe.x=ee,fe.idealAlign=ee<0?"left":"right");var ie=[];w.loneHover(fe,{container:S._hoverlayer.node(),outerContainer:S._paper.node(),gd:s,inOut_bbox:ie}),T[0].bbox=ie[0],m._hasHoverLabel=!0}if(A){var oe=l.select("path.surface");h.styleOne(oe,v,p,s,{hovered:!0})}m._hasHoverEvent=!0,s.emit("plotly_hover",{points:T||[n(v,p,h.eventDataKeys)],event:b.event})}}),l.on("mouseout",function(v){var S=s._fullLayout,T=s._fullData[m.index],p=b.select(this).datum();if(m._hasHoverEvent&&(v.originalEvent=b.event,s.emit("plotly_unhover",{points:[n(p,T,h.eventDataKeys)],event:b.event}),m._hasHoverEvent=!1),m._hasHoverLabel&&(w.loneUnhover(S._hoverlayer.node()),m._hasHoverLabel=!1),A){var M=l.select("path.surface");h.styleOne(M,p,T,s,{hovered:!1})}}),l.on("click",function(v){var S=s._fullLayout,T=s._fullData[m.index],p=k&&(u.isHierarchyRoot(v)||u.isLeaf(v)),M=u.getPtId(v),f=u.isEntry(v)?u.findEntryWithChild(g,M):u.findEntryWithLevel(g,M),E=u.getPtId(f),I={points:[n(v,T,h.eventDataKeys)],event:b.event};p||(I.nextLevel=E);var B=_.triggerHandler(s,"plotly_"+m.type+"click",I);if(B!==!1&&S.hovermode&&(s._hoverdata=[n(v,T,h.eventDataKeys)],w.click(s,b.event)),!p&&B!==!1&&!s._dragging&&!s._transitioning){d.call("_storeDirectGUIEdit",T,S._tracePreGUI[T.uid],{level:T.level});var N={data:[{level:E}],traces:[m.index]},V={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};w.loneUnhover(S._hoverlayer.node()),d.call("animate",s,N,V)}})}},33108:function(D,L,t){var b=t(34809),d=t(78766),e=t(27983),w=t(37252);function y(_){return _.data.data.pid}L.findEntryWithLevel=function(_,u){var r;return u&&_.eachAfter(function(n){if(L.getPtId(n)===u)return r=n.copy()}),r||_},L.findEntryWithChild=function(_,u){var r;return _.eachAfter(function(n){for(var l=n.children||[],o=0;o0)},L.getMaxDepth=function(_){return _.maxdepth>=0?_.maxdepth:1/0},L.isHeader=function(_,u){return!(L.isLeaf(_)||_.depth===u._maxDepth-1)},L.getParent=function(_,u){return L.findEntryWithLevel(_,y(u))},L.listPath=function(_,u){var r=_.parent;if(!r)return[];var n=u?[r.data[u]]:[r];return L.listPath(r,u).concat(n)},L.getPath=function(_){return L.listPath(_,"label").join("/")+"/"},L.formatValue=w.formatPieValue,L.formatPercent=function(_,u){var r=b.formatPercent(_,0);return r==="0%"&&(r=w.formatPiePercent(_,u)),r}},80809:function(D,L,t){D.exports={moduleType:"trace",name:"sunburst",basePlotModule:t(14724),categories:[],animatable:!0,attributes:t(56708),layoutAttributes:t(98959),supplyDefaults:t(33459),supplyLayoutDefaults:t(75816),calc:t(14852).calc,crossTraceCalc:t(14852).crossTraceCalc,plot:t(19718).plot,style:t(98972).style,colorbar:t(21146),meta:{}}},98959:function(D){D.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},75816:function(D,L,t){var b=t(34809),d=t(98959);D.exports=function(e,w){function y(_,u){return b.coerce(e,w,d,_,u)}y("sunburstcolorway",w.colorway),y("extendsunburstcolors")}},19718:function(D,L,t){var b=t(45568),d=t(92264),e=t(88640).GW,w=t(62203),y=t(34809),_=t(30635),u=t(84102),r=u.recordMinTextSize,n=u.clearMinTextSize,l=t(35734),o=t(37252).getRotationAngle,s=l.computeTransform,c=l.transformInsideText,h=t(98972).styleOne,x=t(6851).resizeText,m=t(44691),g=t(2032),k=t(33108);function A(S,T,p,M){var f=S._context.staticPlot,E=S._fullLayout,I=!E.uniformtext.mode&&k.hasTransition(M),B=b.select(p).selectAll("g.slice"),N=T[0],V=N.trace,j=N.hierarchy,$=k.findEntryWithLevel(j,V.level),ee=k.getMaxDepth(V),H=E._size,J=V.domain,Q=H.w*(J.x[1]-J.x[0]),Z=H.h*(J.y[1]-J.y[0]),K=.5*Math.min(Q,Z),ae=N.cx=H.l+H.w*(J.x[1]+J.x[0])/2,se=N.cy=H.t+H.h*(1-J.y[0])-Z/2;if(!$)return B.remove();var he=null,fe={};I&&B.each(function(Pe){fe[k.getPtId(Pe)]={rpx0:Pe.rpx0,rpx1:Pe.rpx1,x0:Pe.x0,x1:Pe.x1,transform:Pe.transform},!he&&k.isEntry(Pe)&&(he=Pe)});var ie=function(Pe){return d.partition().size([2*Math.PI,Pe.height+1])(Pe)}($).descendants(),oe=$.height+1,le=0,ge=ee;N.hasMultipleRoots&&k.isHierarchyRoot($)&&(ie=ie.slice(1),oe-=1,le=1,ge+=1),ie=ie.filter(function(Pe){return Pe.y1<=ge});var ye=o(V.rotation);ye&&ie.forEach(function(Pe){Pe.x0+=ye,Pe.x1+=ye});var me=Math.min(oe,ee),be=function(Pe){return(Pe-le)/me*K},Se=function(Pe,de){return[Pe*Math.cos(de),-Pe*Math.sin(de)]},Ee=function(Pe){return y.pathAnnulus(Pe.rpx0,Pe.rpx1,Pe.x0,Pe.x1,ae,se)},Ce=function(Pe){return ae+v(Pe)[0]*(Pe.transform.rCenter||0)+(Pe.transform.x||0)},Le=function(Pe){return se+v(Pe)[1]*(Pe.transform.rCenter||0)+(Pe.transform.y||0)};(B=B.data(ie,k.getPtId)).enter().append("g").classed("slice",!0),I?B.exit().transition().each(function(){var Pe=b.select(this);Pe.select("path.surface").transition().attrTween("d",function(de){var Me=function(ke){var He,Fe=k.getPtId(ke),qe=fe[Fe],$e=fe[k.getPtId($)];if($e){var Ye=(ke.x1>$e.x1?2*Math.PI:0)+ye;He=ke.rpx1<$e.rpx1?{x0:ke.x0,x1:ke.x1,rpx0:0,rpx1:0}:{x0:Ye,x1:Ye,rpx0:ke.rpx0,rpx1:ke.rpx1}}else{var _e,De=k.getPtId(ke.parent);B.each(function(pt){if(k.getPtId(pt)===De)return _e=pt});var Be,Ge=_e.children;Ge.forEach(function(pt,At){if(k.getPtId(pt)===Fe)return Be=At});var tt=Ge.length,nt=e(_e.x0,_e.x1);He={rpx0:K,rpx1:K,x0:nt(Be/tt),x1:nt((Be+1)/tt)}}return e(qe,He)}(de);return function(ke){return Ee(Me(ke))}}),Pe.select("g.slicetext").attr("opacity",0)}).remove():B.exit().remove(),B.order();var Oe=null;if(I&&he){var We=k.getPtId(he);B.each(function(Pe){Oe===null&&k.getPtId(Pe)===We&&(Oe=Pe.x1)})}var Ie=B;function Ve(Pe){var de=Pe.parent,Me=fe[k.getPtId(de)],ke={};if(Me){var He=de.children,Fe=He.indexOf(Pe),qe=He.length,$e=e(Me.x0,Me.x1);ke.x0=$e(Fe/qe),ke.x1=$e(Fe/qe)}else ke.x0=ke.x1=0;return ke}I&&(Ie=Ie.transition().each("end",function(){var Pe=b.select(this);k.setSliceCursor(Pe,S,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),Ie.each(function(Pe){var de=b.select(this),Me=y.ensureSingle(de,"path","surface",function(Ye){Ye.style("pointer-events",f?"none":"all")});Pe.rpx0=be(Pe.y0),Pe.rpx1=be(Pe.y1),Pe.xmid=(Pe.x0+Pe.x1)/2,Pe.pxmid=Se(Pe.rpx1,Pe.xmid),Pe.midangle=-(Pe.xmid-Math.PI/2),Pe.startangle=-(Pe.x0-Math.PI/2),Pe.stopangle=-(Pe.x1-Math.PI/2),Pe.halfangle=.5*Math.min(y.angleDelta(Pe.x0,Pe.x1)||Math.PI,Math.PI),Pe.ring=1-Pe.rpx0/Pe.rpx1,Pe.rInscribed=function(Ye){return Ye.rpx0===0&&y.isFullCircle([Ye.x0,Ye.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(Ye.halfangle)),Ye.ring/2))}(Pe),I?Me.transition().attrTween("d",function(Ye){var _e=function(De){var Be,Ge=fe[k.getPtId(De)],tt={x0:De.x0,x1:De.x1,rpx0:De.rpx0,rpx1:De.rpx1};if(Ge)Be=Ge;else if(he)if(De.parent)if(Oe){var nt=(De.x1>Oe?2*Math.PI:0)+ye;Be={x0:nt,x1:nt}}else Be={rpx0:K,rpx1:K},y.extendFlat(Be,Ve(De));else Be={rpx0:0,rpx1:0};else Be={x0:ye,x1:ye};return e(Be,tt)}(Ye);return function(De){return Ee(_e(De))}}):Me.attr("d",Ee),de.call(m,$,S,T,{eventDataKeys:g.eventDataKeys,transitionTime:g.CLICK_TRANSITION_TIME,transitionEasing:g.CLICK_TRANSITION_EASING}).call(k.setSliceCursor,S,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:S._transitioning}),Me.call(h,Pe,V,S);var ke=y.ensureSingle(de,"g","slicetext"),He=y.ensureSingle(ke,"text","",function(Ye){Ye.attr("data-notex",1)}),Fe=y.ensureUniformFontSize(S,k.determineTextFont(V,Pe,E.font));He.text(L.formatSliceLabel(Pe,$,V,T,E)).classed("slicetext",!0).attr("text-anchor","middle").call(w.font,Fe).call(_.convertToTspans,S);var qe=w.bBox(He.node());Pe.transform=c(qe,Pe,N),Pe.transform.targetX=Ce(Pe),Pe.transform.targetY=Le(Pe);var $e=function(Ye,_e){var De=Ye.transform;return s(De,_e),De.fontSize=Fe.size,r(V.type,De,E),y.getTextTransform(De)};I?He.transition().attrTween("transform",function(Ye){var _e=function(De){var Be,Ge=fe[k.getPtId(De)],tt=De.transform;if(Ge)Be=Ge;else if(Be={rpx1:De.rpx1,transform:{textPosAngle:tt.textPosAngle,scale:0,rotate:tt.rotate,rCenter:tt.rCenter,x:tt.x,y:tt.y}},he)if(De.parent)if(Oe){var nt=De.x1>Oe?2*Math.PI:0;Be.x0=Be.x1=nt}else y.extendFlat(Be,Ve(De));else Be.x0=Be.x1=ye;else Be.x0=Be.x1=ye;var pt=e(Be.transform.textPosAngle,De.transform.textPosAngle),At=e(Be.rpx1,De.rpx1),wt=e(Be.x0,De.x0),Nt=e(Be.x1,De.x1),Ht=e(Be.transform.scale,tt.scale),Gt=e(Be.transform.rotate,tt.rotate),st=tt.rCenter===0?3:Be.transform.rCenter===0?1/3:1,Qe=e(Be.transform.rCenter,tt.rCenter);return function(ft){var yt=At(ft),Ot=wt(ft),Pt=Nt(ft),at=function(Xe){return Qe(Math.pow(Xe,st))}(ft),lt={pxmid:Se(yt,(Ot+Pt)/2),rpx1:yt,transform:{textPosAngle:pt(ft),rCenter:at,x:tt.x,y:tt.y}};return r(V.type,tt,E),{transform:{targetX:Ce(lt),targetY:Le(lt),scale:Ht(ft),rotate:Gt(ft),rCenter:at}}}}(Ye);return function(De){return $e(_e(De),qe)}}):He.attr("transform",$e(Pe,qe))})}function v(S){return T=S.rpx1,p=S.transform.textPosAngle,[T*Math.sin(p),-T*Math.cos(p)];var T,p}L.plot=function(S,T,p,M){var f,E,I=S._fullLayout,B=I._sunburstlayer,N=!p,V=!I.uniformtext.mode&&k.hasTransition(p);n("sunburst",I),(f=B.selectAll("g.trace.sunburst").data(T,function(j){return j[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),f.order(),V?(M&&(E=M()),b.transition().duration(p.duration).ease(p.easing).each("end",function(){E&&E()}).each("interrupt",function(){E&&E()}).each(function(){B.selectAll("g.trace").each(function(j){A(S,j,this,p)})})):(f.each(function(j){A(S,j,this,p)}),I.uniformtext.mode&&x(S,I._sunburstlayer.selectAll(".trace"),"sunburst")),N&&f.exit().remove()},L.formatSliceLabel=function(S,T,p,M,f){var E=p.texttemplate,I=p.textinfo;if(!(E||I&&I!=="none"))return"";var B=f.separators,N=M[0],V=S.data.data,j=N.hierarchy,$=k.isHierarchyRoot(S),ee=k.getParent(j,S),H=k.getValue(S);if(!E){var J,Q=I.split("+"),Z=function(ge){return Q.indexOf(ge)!==-1},K=[];if(Z("label")&&V.label&&K.push(V.label),V.hasOwnProperty("v")&&Z("value")&&K.push(k.formatValue(V.v,B)),!$){Z("current path")&&K.push(k.getPath(S.data));var ae=0;Z("percent parent")&&ae++,Z("percent entry")&&ae++,Z("percent root")&&ae++;var se=ae>1;if(ae){var he,fe=function(ge){J=k.formatPercent(he,B),se&&(J+=" of "+ge),K.push(J)};Z("percent parent")&&!$&&(he=H/k.getValue(ee),fe("parent")),Z("percent entry")&&(he=H/k.getValue(T),fe("entry")),Z("percent root")&&(he=H/k.getValue(j),fe("root"))}}return Z("text")&&(J=y.castOption(p,V.i,"text"),y.isValidTextValue(J)&&K.push(J)),K.join("
")}var ie=y.castOption(p,V.i,"texttemplate");if(!ie)return"";var oe={};V.label&&(oe.label=V.label),V.hasOwnProperty("v")&&(oe.value=V.v,oe.valueLabel=k.formatValue(V.v,B)),oe.currentPath=k.getPath(S.data),$||(oe.percentParent=H/k.getValue(ee),oe.percentParentLabel=k.formatPercent(oe.percentParent,B),oe.parent=k.getPtLabel(ee)),oe.percentEntry=H/k.getValue(T),oe.percentEntryLabel=k.formatPercent(oe.percentEntry,B),oe.entry=k.getPtLabel(T),oe.percentRoot=H/k.getValue(j),oe.percentRootLabel=k.formatPercent(oe.percentRoot,B),oe.root=k.getPtLabel(j),V.hasOwnProperty("color")&&(oe.color=V.color);var le=y.castOption(p,V.i,"text");return(y.isValidTextValue(le)||le==="")&&(oe.text=le),oe.customdata=y.castOption(p,V.i,"customdata"),y.texttemplateString(ie,oe,f._d3locale,oe,p._meta||{})}},98972:function(D,L,t){var b=t(45568),d=t(78766),e=t(34809),w=t(84102).resizeText,y=t(72043);function _(u,r,n,l){var o=r.data.data,s=!r.children,c=o.i,h=e.castOption(n,c,"marker.line.color")||d.defaultLine,x=e.castOption(n,c,"marker.line.width")||0;u.call(y,r,n,l).style("stroke-width",x).call(d.stroke,h).style("opacity",s?n.leaf.opacity:null)}D.exports={style:function(u){var r=u._fullLayout._sunburstlayer.selectAll(".trace");w(u,r,"sunburst"),r.each(function(n){var l=b.select(this),o=n[0].trace;l.style("opacity",o.opacity),l.selectAll("path.surface").each(function(s){b.select(this).call(_,s,o,u)})})},styleOne:_}},16131:function(D,L,t){var b=t(78766),d=t(87163),e=t(80712).axisHoverFormat,w=t(3208).rb,y=t(9829),_=t(93049).extendFlat,u=t(13582).overrideAll;function r(l){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:b.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:b.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var n=D.exports=u(_({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:w(),xhoverformat:e("x"),yhoverformat:e("y"),zhoverformat:e("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},d("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:r(),y:r(),z:r()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:_({},d.zauto,{}),zmin:_({},d.zmin,{}),zmax:_({},d.zmax,{})},hoverinfo:_({},y.hoverinfo),showlegend:_({},y.showlegend,{dflt:!1})}),"calc","nested");n.x.editType=n.y.editType=n.z.editType="calc+clearAxisTypes",n.transforms=void 0},53027:function(D,L,t){var b=t(28379);D.exports=function(d,e){e.surfacecolor?b(d,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):b(d,e,{vals:e.z,containerStr:"",cLetter:"c"})}},27159:function(D,L,t){var b=t(99098).gl_surface3d,d=t(99098).ndarray,e=t(99098).ndarray_linear_interpolate.d2,w=t(69295),y=t(78106),_=t(34809).isArrayOrTypedArray,u=t(46998).parseColorScale,r=t(55010),n=t(88856).extractOpts;function l(p,M,f){this.scene=p,this.uid=f,this.surface=M,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var o=l.prototype;o.getXat=function(p,M,f,E){var I=_(this.data.x)?_(this.data.x[0])?this.data.x[M][p]:this.data.x[p]:p;return f===void 0?I:E.d2l(I,0,f)},o.getYat=function(p,M,f,E){var I=_(this.data.y)?_(this.data.y[0])?this.data.y[M][p]:this.data.y[M]:M;return f===void 0?I:E.d2l(I,0,f)},o.getZat=function(p,M,f,E){var I=this.data.z[M][p];return I===null&&this.data.connectgaps&&this.data._interpolatedZ&&(I=this.data._interpolatedZ[M][p]),f===void 0?I:E.d2l(I,0,f)},o.handlePick=function(p){if(p.object===this.surface){var M=(p.data.index[0]-1)/this.dataScaleX-1,f=(p.data.index[1]-1)/this.dataScaleY-1,E=Math.max(Math.min(Math.round(M),this.data.z[0].length-1),0),I=Math.max(Math.min(Math.round(f),this.data._ylength-1),0);p.index=[E,I],p.traceCoordinate=[this.getXat(E,I),this.getYat(E,I),this.getZat(E,I)],p.dataCoordinate=[this.getXat(E,I,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(E,I,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(E,I,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var B=0;B<3;B++)p.dataCoordinate[B]!=null&&(p.dataCoordinate[B]*=this.scene.dataScale[B]);var N=this.data.hovertext||this.data.text;return _(N)&&N[I]&&N[I][E]!==void 0?p.textLabel=N[I][E]:p.textLabel=N||"",p.data.dataCoordinate=p.dataCoordinate.slice(),this.surface.highlight(p.data),this.scene.glplot.spikes.position=p.dataCoordinate,!0}};var s=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function c(p,M){if(p0){f=s[E];break}return f}function m(p,M){if(!(p<1||M<1)){for(var f=h(p),E=h(M),I=1,B=0;BA;)f--,f/=x(f),++f1?E:1},o.refineCoords=function(p){for(var M=this.dataScaleX,f=this.dataScaleY,E=p[0].shape[0],I=p[0].shape[1],B=0|Math.floor(p[0].shape[0]*M+1),N=0|Math.floor(p[0].shape[1]*f+1),V=1+E+1,j=1+I+1,$=d(new Float32Array(V*j),[V,j]),ee=[1/M,0,0,0,1/f,0,0,0,1],H=0;H0&&this.contourStart[p]!==null&&this.contourEnd[p]!==null&&this.contourEnd[p]>this.contourStart[p]))for(I[p]=!0,M=this.contourStart[p];MI&&(this.minValues[M]=I),this.maxValues[M]",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"}}},21908:function(D,L,t){var b=t(18426),d=t(93049).extendFlat,e=t(10721),w=t(87800).isTypedArray,y=t(87800).isArrayOrTypedArray;function _(c){if(y(c)){for(var h=0,x=0;x=h||T===c.length-1)&&(m[g]=A,A.key=S++,A.firstRowIndex=v,A.lastRowIndex=T,A={firstRowIndex:null,lastRowIndex:null,rows:[]},g+=k,v=T+1,k=0);return m}D.exports=function(c,h){var x=r(h.cells.values),m=function(H){return H.slice(h.header.values.length,H.length)},g=r(h.header.values);g.length&&!g[0].length&&(g[0]=[""],g=r(g));var k=g.concat(m(x).map(function(){return n((g[0]||[""]).length)})),A=h.domain,v=Math.floor(c._fullLayout._size.w*(A.x[1]-A.x[0])),S=Math.floor(c._fullLayout._size.h*(A.y[1]-A.y[0])),T=h.header.values.length?k[0].map(function(){return h.header.height}):[b.emptyHeaderHeight],p=x.length?x[0].map(function(){return h.cells.height}):[],M=T.reduce(u,0),f=s(p,S-M+b.uplift),E=o(s(T,M),[]),I=o(f,E),B={},N=h._fullInput.columnorder;y(N)&&(N=Array.from(N)),N=N.concat(m(x.map(function(H,J){return J})));var V=k.map(function(H,J){var Q=y(h.columnwidth)?h.columnwidth[Math.min(J,h.columnwidth.length-1)]:h.columnwidth;return e(Q)?Number(Q):1}),j=V.reduce(u,0);V=V.map(function(H){return H/j*v});var $=Math.max(_(h.header.line.width),_(h.cells.line.width)),ee={key:h.uid+c._context.staticPlot,translateX:A.x[0]*c._fullLayout._size.w,translateY:c._fullLayout._size.h*(1-A.y[1]),size:c._fullLayout._size,width:v,maxLineWidth:$,height:S,columnOrder:N,groupHeight:S,rowBlocks:I,headerRowBlocks:E,scrollY:0,cells:d({},h.cells,{values:x}),headerCells:d({},h.header,{values:k}),gdColumns:k.map(function(H){return H[0]}),gdColumnsOriginalOrder:k.map(function(H){return H[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:k.map(function(H,J){var Q=B[H];return B[H]=(Q||0)+1,{key:H+"__"+B[H],label:H,specIndex:J,xIndex:N[J],xScale:l,x:void 0,calcdata:void 0,columnWidth:V[J]}})};return ee.columns.forEach(function(H){H.calcdata=ee,H.x=l(H)}),ee}},49618:function(D,L,t){var b=t(93049).extendFlat;L.splitToPanels=function(d){var e=[0,0],w=b({},d,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:d.calcdata.headerCells.values[d.specIndex],rowBlocks:d.calcdata.headerRowBlocks,calcdata:b({},d.calcdata,{cells:d.calcdata.headerCells})});return[b({},d,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks}),b({},d,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks}),w]},L.splitToCells=function(d){var e=function(w){var y=w.rowBlocks[w.page],_=y?y.rows[0].rowIndex:0;return[_,y?_+y.rows.length:0]}(d);return(d.values||[]).slice(e[0],e[1]).map(function(w,y){return{keyWithinBlock:y+(typeof w=="string"&&w.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+y,column:d,calcdata:d.calcdata,page:d.page,rowBlocks:d.rowBlocks,value:w}})}},23281:function(D,L,t){var b=t(34809),d=t(92294),e=t(13792).N;D.exports=function(w,y,_,u){function r(n,l){return b.coerce(w,y,d,n,l)}e(y,u,r),r("columnwidth"),r("header.values"),r("header.format"),r("header.align"),r("header.prefix"),r("header.suffix"),r("header.height"),r("header.line.width"),r("header.line.color"),r("header.fill.color"),b.coerceFont(r,"header.font",u.font),function(n,l){for(var o=n.columnorder||[],s=n.header.values.length,c=o.slice(0,s),h=c.slice().sort(function(g,k){return g-k}),x=c.map(function(g){return h.indexOf(g)}),m=x.length;m/i),me=!ge||ye;fe.mayHaveMarkup=ge&&le.match(/[<&>]/);var be,Se=typeof(be=le)=="string"&&be.match(b.latexCheck);fe.latex=Se;var Ee,Ce,Le=Se?"":T(fe.calcdata.cells.prefix,ie,oe)||"",Oe=Se?"":T(fe.calcdata.cells.suffix,ie,oe)||"",We=Se?null:T(fe.calcdata.cells.format,ie,oe)||null,Ie=Le+(We?w(We)(fe.value):fe.value)+Oe;if(fe.wrappingNeeded=!fe.wrapped&&!me&&!Se&&(Ee=S(Ie)),fe.cellHeightMayIncrease=ye||Se||fe.mayHaveMarkup||(Ee===void 0?S(Ie):Ee),fe.needsConvertToTspans=fe.mayHaveMarkup||fe.wrappingNeeded||fe.latex,fe.wrappingNeeded){var Ve=(b.wrapSplitCharacter===" "?Ie.replace(/Ce&&Ee.push(Le),Ce+=Ie}return Ee}(fe,ge,le);ye.length===1&&(ye[0]===fe.length-1?ye.unshift(ye[0]-1):ye.push(ye[0]+1)),ye[0]%2&&ye.reverse(),ae.each(function(me,be){me.page=ye[be],me.scrollY=ge}),ae.attr("transform",function(me){var be=H(me.rowBlocks,me.page)-me.scrollY;return n(0,be)}),K&&(N(K,se,ae,ye,he.prevPages,he,0),N(K,se,ae,ye,he.prevPages,he,1),k(se,K))}}function B(K,ae,se,he){return function(fe){var ie=fe.calcdata?fe.calcdata:fe,oe=ae.filter(function(me){return ie.key===me.key}),le=se||ie.scrollbarState.dragMultiplier,ge=ie.scrollY;ie.scrollY=he===void 0?ie.scrollY+le*d.event.dy:he;var ye=oe.selectAll("."+b.cn.yColumn).selectAll("."+b.cn.columnBlock).filter(M);return I(K,ye,oe),ie.scrollY===ge}}function N(K,ae,se,he,fe,ie,oe){he[oe]!==fe[oe]&&(clearTimeout(ie.currentRepaint[oe]),ie.currentRepaint[oe]=setTimeout(function(){var le=se.filter(function(ge,ye){return ye===oe&&he[ye]!==fe[ye]});A(K,ae,le,se),fe[oe]=he[oe]}))}function V(K,ae,se,he){return function(){var fe=d.select(ae.parentNode);fe.each(function(ie){var oe=ie.fragments;fe.selectAll("tspan.line").each(function(Ce,Le){oe[Le].width=this.getComputedTextLength()});var le,ge,ye=oe[oe.length-1].width,me=oe.slice(0,-1),be=[],Se=0,Ee=ie.column.columnWidth-2*b.cellPad;for(ie.value="";me.length;)Se+(ge=(le=me.shift()).width+ye)>Ee&&(ie.value+=be.join(b.wrapSpacer)+b.lineBreaker,be=[],Se=0),be.push(le.text),Se+=ge;Se&&(ie.value+=be.join(b.wrapSpacer)),ie.wrapped=!0}),fe.selectAll("tspan.line").remove(),v(fe.select("."+b.cn.cellText),se,K,he),d.select(ae.parentNode.parentNode).call(ee)}}function j(K,ae,se,he,fe){return function(){if(!fe.settledY){var ie=d.select(ae.parentNode),oe=Z(fe),le=fe.key-oe.firstRowIndex,ge=oe.rows[le].rowHeight,ye=fe.cellHeightMayIncrease?ae.parentNode.getBoundingClientRect().height+2*b.cellPad:ge,me=Math.max(ye,ge);me-oe.rows[le].rowHeight&&(oe.rows[le].rowHeight=me,K.selectAll("."+b.cn.columnCell).call(ee),I(null,K.filter(M),0),k(se,he,!0)),ie.attr("transform",function(){var be=this,Se=be.parentNode.getBoundingClientRect(),Ee=d.select(be.parentNode).select("."+b.cn.cellRect).node().getBoundingClientRect(),Ce=be.transform.baseVal.consolidate(),Le=Ee.top-Se.top+(Ce?Ce.matrix.f:b.cellPad);return n($(fe,d.select(be.parentNode).select("."+b.cn.cellTextHolder).node().getBoundingClientRect().width),Le)}),fe.settledY=!0}}}function $(K,ae){switch(K.align){case"left":default:return b.cellPad;case"right":return K.column.columnWidth-(ae||0)-b.cellPad;case"center":return(K.column.columnWidth-(ae||0))/2}}function ee(K){K.attr("transform",function(ae){var se=ae.rowBlocks[0].auxiliaryBlocks.reduce(function(fe,ie){return fe+J(ie,1/0)},0),he=J(Z(ae),ae.key);return n(0,he+se)}).selectAll("."+b.cn.cellRect).attr("height",function(ae){return(se=Z(ae),he=ae.key,se.rows[he-se.firstRowIndex]).rowHeight;var se,he})}function H(K,ae){for(var se=0,he=ae-1;he>=0;he--)se+=Q(K[he]);return se}function J(K,ae){for(var se=0,he=0;he","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:r({},y.textfont,{}),editType:"calc"},text:y.text,textinfo:_.textinfo,texttemplate:d({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:y.hovertext,hoverinfo:_.hoverinfo,hovertemplate:b({},{keys:u.eventDataKeys}),textfont:y.textfont,insidetextfont:y.insidetextfont,outsidetextfont:r({},y.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:y.sort,root:_.root,domain:w({name:"treemap",trace:!0,editType:"calc"})}},69784:function(D,L,t){var b=t(44122);L.name="treemap",L.plot=function(d,e,w,y){b.plotBasePlot(L.name,d,e,w,y)},L.clean=function(d,e,w,y){b.cleanBasePlot(L.name,d,e,w,y)}},38848:function(D,L,t){var b=t(14852);L._=function(d,e){return b.calc(d,e)},L.t=function(d){return b._runCrossTraceCalc("treemap",d)}},43236:function(D){D.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},95719:function(D,L,t){var b=t(34809),d=t(71856),e=t(78766),w=t(13792).N,y=t(17550).handleText,_=t(56155).TEXTPAD,u=t(46979).handleMarkerDefaults,r=t(88856),n=r.hasColorscale,l=r.handleDefaults;D.exports=function(o,s,c,h){function x(p,M){return b.coerce(o,s,d,p,M)}var m=x("labels"),g=x("parents");if(m&&m.length&&g&&g.length){var k=x("values");k&&k.length?x("branchvalues"):x("count"),x("level"),x("maxdepth"),x("tiling.packing")==="squarify"&&x("tiling.squarifyratio"),x("tiling.flip"),x("tiling.pad");var A=x("text");x("texttemplate"),s.texttemplate||x("textinfo",b.isArrayOrTypedArray(A)?"text+label":"label"),x("hovertext"),x("hovertemplate");var v=x("pathbar.visible");y(o,s,h,x,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition");var S=s.textposition.indexOf("bottom")!==-1;u(o,s,h,x),(s._hasColorscale=n(o,"marker","colors")||(o.marker||{}).coloraxis)?l(o,s,h,x,{prefix:"marker.",cLetter:"c"}):x("marker.depthfade",!(s.marker.colors||[]).length);var T=2*s.textfont.size;x("marker.pad.t",S?T/4:T),x("marker.pad.l",T/4),x("marker.pad.r",T/4),x("marker.pad.b",S?T:T/4),x("marker.cornerradius"),s._hovered={marker:{line:{width:2,color:e.contrast(h.paper_bgcolor)}}},v&&(x("pathbar.thickness",s.pathbar.textfont.size+2*_),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),w(s,h,x),s._length=null}else s.visible=!1}},41567:function(D,L,t){var b=t(45568),d=t(33108),e=t(84102).clearMinTextSize,w=t(6851).resizeText,y=t(95709);D.exports=function(_,u,r,n,l){var o,s,c=l.type,h=l.drawDescendants,x=_._fullLayout,m=x["_"+c+"layer"],g=!r;e(c,x),(o=m.selectAll("g.trace."+c).data(u,function(k){return k[0].trace.uid})).enter().append("g").classed("trace",!0).classed(c,!0),o.order(),!x.uniformtext.mode&&d.hasTransition(r)?(n&&(s=n()),b.transition().duration(r.duration).ease(r.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()}).each(function(){m.selectAll("g.trace").each(function(k){y(_,k,this,r,h)})})):(o.each(function(k){y(_,k,this,r,h)}),x.uniformtext.mode&&w(_,m.selectAll(".trace"),c)),g&&o.exit().remove()}},17010:function(D,L,t){var b=t(45568),d=t(34809),e=t(62203),w=t(30635),y=t(11995),_=t(92080).styleOne,u=t(43236),r=t(33108),n=t(44691),l=!0;D.exports=function(o,s,c,h,x){var m=x.barDifY,g=x.width,k=x.height,A=x.viewX,v=x.viewY,S=x.pathSlice,T=x.toMoveInsideSlice,p=x.strTransform,M=x.hasTransition,f=x.handleSlicesExit,E=x.makeUpdateSliceInterpolator,I=x.makeUpdateTextInterpolator,B={},N=o._context.staticPlot,V=o._fullLayout,j=s[0],$=j.trace,ee=j.hierarchy,H=g/$._entryDepth,J=r.listPath(c.data,"id"),Q=y(ee.copy(),[g,k],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(Q=Q.filter(function(K){var ae=J.indexOf(K.data.id);return ae!==-1&&(K.x0=H*ae,K.x1=H*(ae+1),K.y0=m,K.y1=m+k,K.onPathbar=!0,!0)})).reverse(),(h=h.data(Q,r.getPtId)).enter().append("g").classed("pathbar",!0),f(h,l,B,[g,k],S),h.order();var Z=h;M&&(Z=Z.transition().each("end",function(){var K=b.select(this);r.setSliceCursor(K,o,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),Z.each(function(K){K._x0=A(K.x0),K._x1=A(K.x1),K._y0=v(K.y0),K._y1=v(K.y1),K._hoverX=A(K.x1-Math.min(g,k)/2),K._hoverY=v(K.y1-k/2);var ae=b.select(this),se=d.ensureSingle(ae,"path","surface",function(oe){oe.style("pointer-events",N?"none":"all")});M?se.transition().attrTween("d",function(oe){var le=E(oe,l,B,[g,k]);return function(ge){return S(le(ge))}}):se.attr("d",S),ae.call(n,c,o,s,{styleOne:_,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(r.setSliceCursor,o,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:o._transitioning}),se.call(_,K,$,o,{hovered:!1}),K._text=(r.getPtLabel(K)||"").split("
").join(" ")||"";var he=d.ensureSingle(ae,"g","slicetext"),fe=d.ensureSingle(he,"text","",function(oe){oe.attr("data-notex",1)}),ie=d.ensureUniformFontSize(o,r.determineTextFont($,K,V.font,{onPathbar:!0}));fe.text(K._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(e.font,ie).call(w.convertToTspans,o),K.textBB=e.bBox(fe.node()),K.transform=T(K,{fontSize:ie.size,onPathbar:!0}),K.transform.fontSize=ie.size,M?fe.transition().attrTween("transform",function(oe){var le=I(oe,l,B,[g,k]);return function(ge){return p(le(ge))}}):fe.attr("transform",p(K))})}},50916:function(D,L,t){var b=t(45568),d=t(34809),e=t(62203),w=t(30635),y=t(11995),_=t(92080).styleOne,u=t(43236),r=t(33108),n=t(44691),l=t(19718).formatSliceLabel,o=!1;D.exports=function(s,c,h,x,m){var g=m.width,k=m.height,A=m.viewX,v=m.viewY,S=m.pathSlice,T=m.toMoveInsideSlice,p=m.strTransform,M=m.hasTransition,f=m.handleSlicesExit,E=m.makeUpdateSliceInterpolator,I=m.makeUpdateTextInterpolator,B=m.prevEntry,N=s._context.staticPlot,V=s._fullLayout,j=c[0].trace,$=j.textposition.indexOf("left")!==-1,ee=j.textposition.indexOf("right")!==-1,H=j.textposition.indexOf("bottom")!==-1,J=!H&&!j.marker.pad.t||H&&!j.marker.pad.b,Q=y(h,[g,k],{packing:j.tiling.packing,squarifyratio:j.tiling.squarifyratio,flipX:j.tiling.flip.indexOf("x")>-1,flipY:j.tiling.flip.indexOf("y")>-1,pad:{inner:j.tiling.pad,top:j.marker.pad.t,left:j.marker.pad.l,right:j.marker.pad.r,bottom:j.marker.pad.b}}).descendants(),Z=1/0,K=-1/0;Q.forEach(function(ie){var oe=ie.depth;oe>=j._maxDepth?(ie.x0=ie.x1=(ie.x0+ie.x1)/2,ie.y0=ie.y1=(ie.y0+ie.y1)/2):(Z=Math.min(Z,oe),K=Math.max(K,oe))}),x=x.data(Q,r.getPtId),j._maxVisibleLayers=isFinite(K)?K-Z+1:0,x.enter().append("g").classed("slice",!0),f(x,o,{},[g,k],S),x.order();var ae=null;if(M&&B){var se=r.getPtId(B);x.each(function(ie){ae===null&&r.getPtId(ie)===se&&(ae={x0:ie.x0,x1:ie.x1,y0:ie.y0,y1:ie.y1})})}var he=function(){return ae||{x0:0,x1:g,y0:0,y1:k}},fe=x;return M&&(fe=fe.transition().each("end",function(){var ie=b.select(this);r.setSliceCursor(ie,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),fe.each(function(ie){var oe=r.isHeader(ie,j);ie._x0=A(ie.x0),ie._x1=A(ie.x1),ie._y0=v(ie.y0),ie._y1=v(ie.y1),ie._hoverX=A(ie.x1-j.marker.pad.r),ie._hoverY=v(H?ie.y1-j.marker.pad.b/2:ie.y0+j.marker.pad.t/2);var le=b.select(this),ge=d.ensureSingle(le,"path","surface",function(Ce){Ce.style("pointer-events",N?"none":"all")});M?ge.transition().attrTween("d",function(Ce){var Le=E(Ce,o,he(),[g,k]);return function(Oe){return S(Le(Oe))}}):ge.attr("d",S),le.call(n,h,s,c,{styleOne:_,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(r.setSliceCursor,s,{isTransitioning:s._transitioning}),ge.call(_,ie,j,s,{hovered:!1}),ie.x0===ie.x1||ie.y0===ie.y1?ie._text="":ie._text=oe?J?"":r.getPtLabel(ie)||"":l(ie,h,j,c,V)||"";var ye=d.ensureSingle(le,"g","slicetext"),me=d.ensureSingle(ye,"text","",function(Ce){Ce.attr("data-notex",1)}),be=d.ensureUniformFontSize(s,r.determineTextFont(j,ie,V.font)),Se=ie._text||" ",Ee=oe&&Se.indexOf("
")===-1;me.text(Se).classed("slicetext",!0).attr("text-anchor",ee?"end":$||Ee?"start":"middle").call(e.font,be).call(w.convertToTspans,s),ie.textBB=e.bBox(me.node()),ie.transform=T(ie,{fontSize:be.size,isHeader:oe}),ie.transform.fontSize=be.size,M?me.transition().attrTween("transform",function(Ce){var Le=I(Ce,o,he(),[g,k]);return function(Oe){return p(Le(Oe))}}):me.attr("transform",p(ie))}),ae}},36141:function(D){D.exports=function L(t,b,d){var e;d.swapXY&&(e=t.x0,t.x0=t.y0,t.y0=e,e=t.x1,t.x1=t.y1,t.y1=e),d.flipX&&(e=t.x0,t.x0=b[0]-t.x1,t.x1=b[0]-e),d.flipY&&(e=t.y0,t.y0=b[1]-t.y1,t.y1=b[1]-e);var w=t.children;if(w)for(var y=0;y-1?j+H:-(ee+H):0,Q={x0:$,x1:$,y0:J,y1:J+ee},Z=function(_e,De,Be){var Ge=k.tiling.pad,tt=function(wt){return wt-Ge<=De.x0},nt=function(wt){return wt+Ge>=De.x1},pt=function(wt){return wt-Ge<=De.y0},At=function(wt){return wt+Ge>=De.y1};return _e.x0===De.x0&&_e.x1===De.x1&&_e.y0===De.y0&&_e.y1===De.y1?{x0:_e.x0,x1:_e.x1,y0:_e.y0,y1:_e.y1}:{x0:tt(_e.x0-Ge)?0:nt(_e.x0-Ge)?Be[0]:_e.x0,x1:tt(_e.x1+Ge)?0:nt(_e.x1+Ge)?Be[0]:_e.x1,y0:pt(_e.y0-Ge)?0:At(_e.y0-Ge)?Be[1]:_e.y0,y1:pt(_e.y1+Ge)?0:At(_e.y1+Ge)?Be[1]:_e.y1}},K=null,ae={},se={},he=null,fe=function(_e,De){return De?ae[l(_e)]:se[l(_e)]};g.hasMultipleRoots&&f&&I++,k._maxDepth=I,k._backgroundColor=m.paper_bgcolor,k._entryDepth=S.data.depth,k._atRootLevel=f;var ie=-V/2+B.l+B.w*(N.x[1]+N.x[0])/2,oe=-j/2+B.t+B.h*(1-(N.y[1]+N.y[0])/2),le=function(_e){return ie+_e},ge=function(_e){return oe+_e},ye=ge(0),me=le(0),be=function(_e){return me+_e},Se=function(_e){return ye+_e};function Ee(_e,De){return _e+","+De}var Ce=be(0),Le=function(_e){_e.x=Math.max(Ce,_e.x)},Oe=k.pathbar.edgeshape,We=k[A?"tiling":"marker"].pad,Ie=function(_e){return k.textposition.indexOf(_e)!==-1},Ve=Ie("top"),Pe=Ie("left"),de=Ie("right"),Me=Ie("bottom"),ke=function(_e,De){var Be=_e.x0,Ge=_e.x1,tt=_e.y0,nt=_e.y1,pt=_e.textBB,At=Ve||De.isHeader&&!Me?"start":Me?"end":"middle",wt=Ie("right"),Nt=Ie("left")||De.onPathbar?-1:wt?1:0;if(De.isHeader){if((Be+=(A?We:We.l)-y)>=(Ge-=(A?We:We.r)-y)){var Ht=(Be+Ge)/2;Be=Ht,Ge=Ht}var Gt;Me?tt<(Gt=nt-(A?We:We.b))&&Gt"?(wt.x-=nt,Nt.x-=nt,Ht.x-=nt,Gt.x-=nt):Oe==="/"?(Ht.x-=nt,Gt.x-=nt,pt.x-=nt/2,At.x-=nt/2):Oe==="\\"?(wt.x-=nt,Nt.x-=nt,pt.x-=nt/2,At.x-=nt/2):Oe==="<"&&(pt.x-=nt,At.x-=nt),Le(wt),Le(Gt),Le(pt),Le(Nt),Le(Ht),Le(At),"M"+Ee(wt.x,wt.y)+"L"+Ee(Nt.x,Nt.y)+"L"+Ee(At.x,At.y)+"L"+Ee(Ht.x,Ht.y)+"L"+Ee(Gt.x,Gt.y)+"L"+Ee(pt.x,pt.y)+"Z"},toMoveInsideSlice:ke,makeUpdateSliceInterpolator:Fe,makeUpdateTextInterpolator:qe,handleSlicesExit:$e,hasTransition:E,strTransform:Ye}):p.remove()}},92080:function(D,L,t){var b=t(45568),d=t(78766),e=t(34809),w=t(33108),y=t(84102).resizeText,_=t(72043);function u(r,n,l,o,s){var c,h,x=(s||{}).hovered,m=n.data.data,g=m.i,k=m.color,A=w.isHierarchyRoot(n),v=1;if(x)c=l._hovered.marker.line.color,h=l._hovered.marker.line.width;else if(A&&k===l.root.color)v=100,c="rgba(0,0,0,0)",h=0;else if(c=e.castOption(l,g,"marker.line.color")||d.defaultLine,h=e.castOption(l,g,"marker.line.width")||0,!l._hasColorscale&&!n.onPathbar){var S=l.marker.depthfade;if(S){var T,p=d.combine(d.addOpacity(l._backgroundColor,.75),k);if(S===!0){var M=w.getMaxDepth(l);T=isFinite(M)?w.isLeaf(n)?0:l._maxVisibleLayers-(n.data.depth-l._entryDepth):n.data.height+1}else T=n.data.depth-l._entryDepth,l._atRootLevel||T++;if(T>0)for(var f=0;f0){var S,T,p,M,f,E=_.xa,I=_.ya;x.orientation==="h"?(f=u,S="y",p=I,T="x",M=E):(f=r,S="x",p=E,T="y",M=I);var B=h[_.index];if(f>=B.span[0]&&f<=B.span[1]){var N=d.extendFlat({},_),V=M.c2p(f,!0),j=y.getKdeValue(B,x,f),$=y.getPositionOnKdePath(B,x,V),ee=p._offset,H=p._length;N[S+"0"]=$[0],N[S+"1"]=$[1],N[T+"0"]=N[T+"1"]=V,N[T+"Label"]=T+": "+e.hoverLabelText(M,f,x[T+"hoverformat"])+", "+h[0].t.labels.kde+" "+j.toFixed(3);for(var J=0,Q=0;Q")),s.color=function(I,B){var N=I[B.dir].marker,V=N.color,j=N.line.color,$=N.line.width;return d(V)?V:d(j)&&$?j:void 0}(h,k),[s]}function E(I){return b(g,I,h[m+"hoverformat"])}}},38261:function(D,L,t){D.exports={attributes:t(37832),layoutAttributes:t(579),supplyDefaults:t(67199).supplyDefaults,crossTraceDefaults:t(67199).crossTraceDefaults,supplyLayoutDefaults:t(71492),calc:t(15e3),crossTraceCalc:t(9963),plot:t(71130),style:t(57256).style,hoverPoints:t(40943),eventData:t(64932),selectPoints:t(88384),moduleType:"trace",name:"waterfall",basePlotModule:t(37703),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},579:function(D){D.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"}}},71492:function(D,L,t){var b=t(34809),d=t(579);D.exports=function(e,w,y){var _=!1;function u(l,o){return b.coerce(e,w,d,l,o)}for(var r=0;r0&&(j+=T?"M"+N[0]+","+V[1]+"V"+V[0]:"M"+N[1]+","+V[0]+"H"+N[0]),p!=="between"&&(E.isSum||I path").each(function(x){if(!x.isBlank){var m=h[x.dir].marker;b.select(this).call(e.fill,m.color).call(e.stroke,m.line.color).call(d.dashLine,m.line.dash,m.line.width).style("opacity",h.selectedpoints&&!x.selected?w:1)}}),u(c,h,r),c.selectAll(".lines").each(function(){var x=h.connector.line;d.lineGroupStyle(b.select(this).selectAll("path"),x.width,x.color,x.dash)})})}}},47908:function(D,L,t){var b=t(29714),d=t(34809),e=t(57297),w=t(5086).z,y=t(63821).BADNUM;L.moduleType="transform",L.name="aggregate";var _=L.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},u=_.aggregations;function r(s,c,h,x){if(x.enabled){for(var m=x.target,g=d.nestedProperty(c,m),k=g.get(),A=function(T,p){var M=T.func,f=p.d2c,E=p.c2d;switch(M){case"count":return n;case"first":return l;case"last":return o;case"sum":return function(I,B){for(var N=0,V=0;VV&&(V=H,j=ee)}}return V?E(j):y};case"rms":return function(I,B){for(var N=0,V=0,j=0;j":return function(K){return Z(K)>J};case">=":return function(K){return Z(K)>=J};case"[]":return function(K){var ae=Z(K);return ae>=J[0]&&ae<=J[1]};case"()":return function(K){var ae=Z(K);return ae>J[0]&&ae=J[0]&&aeJ[0]&&ae<=J[1]};case"][":return function(K){var ae=Z(K);return ae<=J[0]||ae>=J[1]};case")(":return function(K){var ae=Z(K);return aeJ[1]};case"](":return function(K){var ae=Z(K);return ae<=J[0]||ae>J[1]};case")[":return function(K){var ae=Z(K);return ae=J[1]};case"{}":return function(K){return J.indexOf(Z(K))!==-1};case"}{":return function(K){return J.indexOf(Z(K))===-1}}}(o,e.getDataToCoordFunc(n,l,c,s),x),T={},p={},M=0;g?(A=function(B){T[B.astr]=b.extendDeep([],B.get()),B.set(new Array(h))},v=function(B,N){var V=T[B.astr][N];B.get()[N]=V}):(A=function(B){T[B.astr]=b.extendDeep([],B.get()),B.set([])},v=function(B,N){var V=T[B.astr][N];B.get().push(V)}),I(A);for(var f=w(l.transforms,o),E=0;E1?"%{group} (%{trace})":"%{group}");var s=_.styles,c=l.styles=[];if(s)for(n=0;nA)throw new RangeError('The value "'+_e+'" is invalid for option "size"');var De=new Uint8Array(_e);return Object.setPrototypeOf(De,S.prototype),De}function S(_e,De,Be){if(typeof _e=="number"){if(typeof De=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(_e)}return T(_e,De,Be)}function T(_e,De,Be){if(typeof _e=="string")return function(nt,pt){if(typeof pt=="string"&&pt!==""||(pt="utf8"),!S.isEncoding(pt))throw new TypeError("Unknown encoding: "+pt);var At=0|B(nt,pt),wt=v(At),Nt=wt.write(nt,pt);return Nt!==At&&(wt=wt.slice(0,Nt)),wt}(_e,De);if(ArrayBuffer.isView(_e))return function(nt){if(He(nt,Uint8Array)){var pt=new Uint8Array(nt);return E(pt.buffer,pt.byteOffset,pt.byteLength)}return f(nt)}(_e);if(_e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(_e));if(He(_e,ArrayBuffer)||_e&&He(_e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(He(_e,SharedArrayBuffer)||_e&&He(_e.buffer,SharedArrayBuffer)))return E(_e,De,Be);if(typeof _e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Ge=_e.valueOf&&_e.valueOf();if(Ge!=null&&Ge!==_e)return S.from(Ge,De,Be);var tt=function(nt){if(S.isBuffer(nt)){var pt=0|I(nt.length),At=v(pt);return At.length===0||nt.copy(At,0,0,pt),At}return nt.length!==void 0?typeof nt.length!="number"||Fe(nt.length)?v(0):f(nt):nt.type==="Buffer"&&Array.isArray(nt.data)?f(nt.data):void 0}(_e);if(tt)return tt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _e[Symbol.toPrimitive]=="function")return S.from(_e[Symbol.toPrimitive]("string"),De,Be);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(_e))}function p(_e){if(typeof _e!="number")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 M(_e){return p(_e),v(_e<0?0:0|I(_e))}function f(_e){for(var De=_e.length<0?0:0|I(_e.length),Be=v(De),Ge=0;Ge=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return 0|_e}function B(_e,De){if(S.isBuffer(_e))return _e.length;if(ArrayBuffer.isView(_e)||He(_e,ArrayBuffer))return _e.byteLength;if(typeof _e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+x(_e));var Be=_e.length,Ge=arguments.length>2&&arguments[2]===!0;if(!Ge&&Be===0)return 0;for(var tt=!1;;)switch(De){case"ascii":case"latin1":case"binary":return Be;case"utf8":case"utf-8":return de(_e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Be;case"hex":return Be>>>1;case"base64":return Me(_e).length;default:if(tt)return Ge?-1:de(_e).length;De=(""+De).toLowerCase(),tt=!0}}function N(_e,De,Be){var Ge=!1;if((De===void 0||De<0)&&(De=0),De>this.length||((Be===void 0||Be>this.length)&&(Be=this.length),Be<=0)||(Be>>>=0)<=(De>>>=0))return"";for(_e||(_e="utf8");;)switch(_e){case"hex":return ie(this,De,Be);case"utf8":case"utf-8":return ae(this,De,Be);case"ascii":return he(this,De,Be);case"latin1":case"binary":return fe(this,De,Be);case"base64":return K(this,De,Be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,De,Be);default:if(Ge)throw new TypeError("Unknown encoding: "+_e);_e=(_e+"").toLowerCase(),Ge=!0}}function V(_e,De,Be){var Ge=_e[De];_e[De]=_e[Be],_e[Be]=Ge}function j(_e,De,Be,Ge,tt){if(_e.length===0)return-1;if(typeof Be=="string"?(Ge=Be,Be=0):Be>2147483647?Be=2147483647:Be<-2147483648&&(Be=-2147483648),Fe(Be=+Be)&&(Be=tt?0:_e.length-1),Be<0&&(Be=_e.length+Be),Be>=_e.length){if(tt)return-1;Be=_e.length-1}else if(Be<0){if(!tt)return-1;Be=0}if(typeof De=="string"&&(De=S.from(De,Ge)),S.isBuffer(De))return De.length===0?-1:$(_e,De,Be,Ge,tt);if(typeof De=="number")return De&=255,typeof Uint8Array.prototype.indexOf=="function"?tt?Uint8Array.prototype.indexOf.call(_e,De,Be):Uint8Array.prototype.lastIndexOf.call(_e,De,Be):$(_e,[De],Be,Ge,tt);throw new TypeError("val must be string, number or Buffer")}function $(_e,De,Be,Ge,tt){var nt,pt=1,At=_e.length,wt=De.length;if(Ge!==void 0&&((Ge=String(Ge).toLowerCase())==="ucs2"||Ge==="ucs-2"||Ge==="utf16le"||Ge==="utf-16le")){if(_e.length<2||De.length<2)return-1;pt=2,At/=2,wt/=2,Be/=2}function Nt(Qe,ft){return pt===1?Qe[ft]:Qe.readUInt16BE(ft*pt)}if(tt){var Ht=-1;for(nt=Be;ntAt&&(Be=At-wt),nt=Be;nt>=0;nt--){for(var Gt=!0,st=0;sttt&&(Ge=tt):Ge=tt;var nt,pt=De.length;for(Ge>pt/2&&(Ge=pt/2),nt=0;nt>8,wt=pt%256,Nt.push(wt),Nt.push(At);return Nt}(De,_e.length-Be),_e,Be,Ge)}function K(_e,De,Be){return De===0&&Be===_e.length?m.fromByteArray(_e):m.fromByteArray(_e.slice(De,Be))}function ae(_e,De,Be){Be=Math.min(_e.length,Be);for(var Ge=[],tt=De;tt239?4:nt>223?3:nt>191?2:1;if(tt+At<=Be){var wt=void 0,Nt=void 0,Ht=void 0,Gt=void 0;switch(At){case 1:nt<128&&(pt=nt);break;case 2:(192&(wt=_e[tt+1]))==128&&(Gt=(31&nt)<<6|63&wt)>127&&(pt=Gt);break;case 3:wt=_e[tt+1],Nt=_e[tt+2],(192&wt)==128&&(192&Nt)==128&&(Gt=(15&nt)<<12|(63&wt)<<6|63&Nt)>2047&&(Gt<55296||Gt>57343)&&(pt=Gt);break;case 4:wt=_e[tt+1],Nt=_e[tt+2],Ht=_e[tt+3],(192&wt)==128&&(192&Nt)==128&&(192&Ht)==128&&(Gt=(15&nt)<<18|(63&wt)<<12|(63&Nt)<<6|63&Ht)>65535&&Gt<1114112&&(pt=Gt)}}pt===null?(pt=65533,At=1):pt>65535&&(pt-=65536,Ge.push(pt>>>10&1023|55296),pt=56320|1023&pt),Ge.push(pt),tt+=At}return function(st){var Qe=st.length;if(Qe<=se)return String.fromCharCode.apply(String,st);for(var ft="",yt=0;yt"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(S.prototype,"parent",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.buffer}}),Object.defineProperty(S.prototype,"offset",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.byteOffset}}),S.poolSize=8192,S.from=function(_e,De,Be){return T(_e,De,Be)},Object.setPrototypeOf(S.prototype,Uint8Array.prototype),Object.setPrototypeOf(S,Uint8Array),S.alloc=function(_e,De,Be){return function(Ge,tt,nt){return p(Ge),Ge<=0?v(Ge):tt!==void 0?typeof nt=="string"?v(Ge).fill(tt,nt):v(Ge).fill(tt):v(Ge)}(_e,De,Be)},S.allocUnsafe=function(_e){return M(_e)},S.allocUnsafeSlow=function(_e){return M(_e)},S.isBuffer=function(_e){return _e!=null&&_e._isBuffer===!0&&_e!==S.prototype},S.compare=function(_e,De){if(He(_e,Uint8Array)&&(_e=S.from(_e,_e.offset,_e.byteLength)),He(De,Uint8Array)&&(De=S.from(De,De.offset,De.byteLength)),!S.isBuffer(_e)||!S.isBuffer(De))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_e===De)return 0;for(var Be=_e.length,Ge=De.length,tt=0,nt=Math.min(Be,Ge);ttGe.length?(S.isBuffer(nt)||(nt=S.from(nt)),nt.copy(Ge,tt)):Uint8Array.prototype.set.call(Ge,nt,tt);else{if(!S.isBuffer(nt))throw new TypeError('"list" argument must be an Array of Buffers');nt.copy(Ge,tt)}tt+=nt.length}return Ge},S.byteLength=B,S.prototype._isBuffer=!0,S.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 De=0;De<_e;De+=2)V(this,De,De+1);return this},S.prototype.swap32=function(){var _e=this.length;if(_e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var De=0;De<_e;De+=4)V(this,De,De+3),V(this,De+1,De+2);return this},S.prototype.swap64=function(){var _e=this.length;if(_e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var De=0;De<_e;De+=8)V(this,De,De+7),V(this,De+1,De+6),V(this,De+2,De+5),V(this,De+3,De+4);return this},S.prototype.toString=function(){var _e=this.length;return _e===0?"":arguments.length===0?ae(this,0,_e):N.apply(this,arguments)},S.prototype.toLocaleString=S.prototype.toString,S.prototype.equals=function(_e){if(!S.isBuffer(_e))throw new TypeError("Argument must be a Buffer");return this===_e||S.compare(this,_e)===0},S.prototype.inspect=function(){var _e="",De=r.IS;return _e=this.toString("hex",0,De).replace(/(.{2})/g,"$1 ").trim(),this.length>De&&(_e+=" ... "),""},k&&(S.prototype[k]=S.prototype.inspect),S.prototype.compare=function(_e,De,Be,Ge,tt){if(He(_e,Uint8Array)&&(_e=S.from(_e,_e.offset,_e.byteLength)),!S.isBuffer(_e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+x(_e));if(De===void 0&&(De=0),Be===void 0&&(Be=_e?_e.length:0),Ge===void 0&&(Ge=0),tt===void 0&&(tt=this.length),De<0||Be>_e.length||Ge<0||tt>this.length)throw new RangeError("out of range index");if(Ge>=tt&&De>=Be)return 0;if(Ge>=tt)return-1;if(De>=Be)return 1;if(this===_e)return 0;for(var nt=(tt>>>=0)-(Ge>>>=0),pt=(Be>>>=0)-(De>>>=0),At=Math.min(nt,pt),wt=this.slice(Ge,tt),Nt=_e.slice(De,Be),Ht=0;Ht>>=0,isFinite(Be)?(Be>>>=0,Ge===void 0&&(Ge="utf8")):(Ge=Be,Be=void 0)}var tt=this.length-De;if((Be===void 0||Be>tt)&&(Be=tt),_e.length>0&&(Be<0||De<0)||De>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ge||(Ge="utf8");for(var nt=!1;;)switch(Ge){case"hex":return ee(this,_e,De,Be);case"utf8":case"utf-8":return H(this,_e,De,Be);case"ascii":case"latin1":case"binary":return J(this,_e,De,Be);case"base64":return Q(this,_e,De,Be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,_e,De,Be);default:if(nt)throw new TypeError("Unknown encoding: "+Ge);Ge=(""+Ge).toLowerCase(),nt=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var se=4096;function he(_e,De,Be){var Ge="";Be=Math.min(_e.length,Be);for(var tt=De;ttGe)&&(Be=Ge);for(var tt="",nt=De;ntBe)throw new RangeError("Trying to access beyond buffer length")}function ge(_e,De,Be,Ge,tt,nt){if(!S.isBuffer(_e))throw new TypeError('"buffer" argument must be a Buffer instance');if(De>tt||De_e.length)throw new RangeError("Index out of range")}function ye(_e,De,Be,Ge,tt){We(De,Ge,tt,_e,Be,7);var nt=Number(De&BigInt(4294967295));_e[Be++]=nt,nt>>=8,_e[Be++]=nt,nt>>=8,_e[Be++]=nt,nt>>=8,_e[Be++]=nt;var pt=Number(De>>BigInt(32)&BigInt(4294967295));return _e[Be++]=pt,pt>>=8,_e[Be++]=pt,pt>>=8,_e[Be++]=pt,pt>>=8,_e[Be++]=pt,Be}function me(_e,De,Be,Ge,tt){We(De,Ge,tt,_e,Be,7);var nt=Number(De&BigInt(4294967295));_e[Be+7]=nt,nt>>=8,_e[Be+6]=nt,nt>>=8,_e[Be+5]=nt,nt>>=8,_e[Be+4]=nt;var pt=Number(De>>BigInt(32)&BigInt(4294967295));return _e[Be+3]=pt,pt>>=8,_e[Be+2]=pt,pt>>=8,_e[Be+1]=pt,pt>>=8,_e[Be]=pt,Be+8}function be(_e,De,Be,Ge,tt,nt){if(Be+Ge>_e.length)throw new RangeError("Index out of range");if(Be<0)throw new RangeError("Index out of range")}function Se(_e,De,Be,Ge,tt){return De=+De,Be>>>=0,tt||be(_e,0,Be,4),g.write(_e,De,Be,Ge,23,4),Be+4}function Ee(_e,De,Be,Ge,tt){return De=+De,Be>>>=0,tt||be(_e,0,Be,8),g.write(_e,De,Be,Ge,52,8),Be+8}S.prototype.slice=function(_e,De){var Be=this.length;(_e=~~_e)<0?(_e+=Be)<0&&(_e=0):_e>Be&&(_e=Be),(De=De===void 0?Be:~~De)<0?(De+=Be)<0&&(De=0):De>Be&&(De=Be),De<_e&&(De=_e);var Ge=this.subarray(_e,De);return Object.setPrototypeOf(Ge,S.prototype),Ge},S.prototype.readUintLE=S.prototype.readUIntLE=function(_e,De,Be){_e>>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=this[_e],tt=1,nt=0;++nt>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=this[_e+--De],tt=1;De>0&&(tt*=256);)Ge+=this[_e+--De]*tt;return Ge},S.prototype.readUint8=S.prototype.readUInt8=function(_e,De){return _e>>>=0,De||le(_e,1,this.length),this[_e]},S.prototype.readUint16LE=S.prototype.readUInt16LE=function(_e,De){return _e>>>=0,De||le(_e,2,this.length),this[_e]|this[_e+1]<<8},S.prototype.readUint16BE=S.prototype.readUInt16BE=function(_e,De){return _e>>>=0,De||le(_e,2,this.length),this[_e]<<8|this[_e+1]},S.prototype.readUint32LE=S.prototype.readUInt32LE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),(this[_e]|this[_e+1]<<8|this[_e+2]<<16)+16777216*this[_e+3]},S.prototype.readUint32BE=S.prototype.readUInt32BE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),16777216*this[_e]+(this[_e+1]<<16|this[_e+2]<<8|this[_e+3])},S.prototype.readBigUInt64LE=$e(function(_e){Ie(_e>>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=De+this[++_e]*Math.pow(2,8)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,24),tt=this[++_e]+this[++_e]*Math.pow(2,8)+this[++_e]*Math.pow(2,16)+Be*Math.pow(2,24);return BigInt(Ge)+(BigInt(tt)<>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=De*Math.pow(2,24)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,8)+this[++_e],tt=this[++_e]*Math.pow(2,24)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,8)+Be;return(BigInt(Ge)<>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=this[_e],tt=1,nt=0;++nt=(tt*=128)&&(Ge-=Math.pow(2,8*De)),Ge},S.prototype.readIntBE=function(_e,De,Be){_e>>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=De,tt=1,nt=this[_e+--Ge];Ge>0&&(tt*=256);)nt+=this[_e+--Ge]*tt;return nt>=(tt*=128)&&(nt-=Math.pow(2,8*De)),nt},S.prototype.readInt8=function(_e,De){return _e>>>=0,De||le(_e,1,this.length),128&this[_e]?-1*(255-this[_e]+1):this[_e]},S.prototype.readInt16LE=function(_e,De){_e>>>=0,De||le(_e,2,this.length);var Be=this[_e]|this[_e+1]<<8;return 32768&Be?4294901760|Be:Be},S.prototype.readInt16BE=function(_e,De){_e>>>=0,De||le(_e,2,this.length);var Be=this[_e+1]|this[_e]<<8;return 32768&Be?4294901760|Be:Be},S.prototype.readInt32LE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),this[_e]|this[_e+1]<<8|this[_e+2]<<16|this[_e+3]<<24},S.prototype.readInt32BE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),this[_e]<<24|this[_e+1]<<16|this[_e+2]<<8|this[_e+3]},S.prototype.readBigInt64LE=$e(function(_e){Ie(_e>>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=this[_e+4]+this[_e+5]*Math.pow(2,8)+this[_e+6]*Math.pow(2,16)+(Be<<24);return(BigInt(Ge)<>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=(De<<24)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,8)+this[++_e];return(BigInt(Ge)<>>=0,De||le(_e,4,this.length),g.read(this,_e,!0,23,4)},S.prototype.readFloatBE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),g.read(this,_e,!1,23,4)},S.prototype.readDoubleLE=function(_e,De){return _e>>>=0,De||le(_e,8,this.length),g.read(this,_e,!0,52,8)},S.prototype.readDoubleBE=function(_e,De){return _e>>>=0,De||le(_e,8,this.length),g.read(this,_e,!1,52,8)},S.prototype.writeUintLE=S.prototype.writeUIntLE=function(_e,De,Be,Ge){_e=+_e,De>>>=0,Be>>>=0,Ge||ge(this,_e,De,Be,Math.pow(2,8*Be)-1,0);var tt=1,nt=0;for(this[De]=255&_e;++nt>>=0,Be>>>=0,Ge||ge(this,_e,De,Be,Math.pow(2,8*Be)-1,0);var tt=Be-1,nt=1;for(this[De+tt]=255&_e;--tt>=0&&(nt*=256);)this[De+tt]=_e/nt&255;return De+Be},S.prototype.writeUint8=S.prototype.writeUInt8=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,1,255,0),this[De]=255&_e,De+1},S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,65535,0),this[De]=255&_e,this[De+1]=_e>>>8,De+2},S.prototype.writeUint16BE=S.prototype.writeUInt16BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,65535,0),this[De]=_e>>>8,this[De+1]=255&_e,De+2},S.prototype.writeUint32LE=S.prototype.writeUInt32LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,4294967295,0),this[De+3]=_e>>>24,this[De+2]=_e>>>16,this[De+1]=_e>>>8,this[De]=255&_e,De+4},S.prototype.writeUint32BE=S.prototype.writeUInt32BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,4294967295,0),this[De]=_e>>>24,this[De+1]=_e>>>16,this[De+2]=_e>>>8,this[De+3]=255&_e,De+4},S.prototype.writeBigUInt64LE=$e(function(_e){return ye(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),S.prototype.writeBigUInt64BE=$e(function(_e){return me(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),S.prototype.writeIntLE=function(_e,De,Be,Ge){if(_e=+_e,De>>>=0,!Ge){var tt=Math.pow(2,8*Be-1);ge(this,_e,De,Be,tt-1,-tt)}var nt=0,pt=1,At=0;for(this[De]=255&_e;++nt>0)-At&255;return De+Be},S.prototype.writeIntBE=function(_e,De,Be,Ge){if(_e=+_e,De>>>=0,!Ge){var tt=Math.pow(2,8*Be-1);ge(this,_e,De,Be,tt-1,-tt)}var nt=Be-1,pt=1,At=0;for(this[De+nt]=255&_e;--nt>=0&&(pt*=256);)_e<0&&At===0&&this[De+nt+1]!==0&&(At=1),this[De+nt]=(_e/pt>>0)-At&255;return De+Be},S.prototype.writeInt8=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,1,127,-128),_e<0&&(_e=255+_e+1),this[De]=255&_e,De+1},S.prototype.writeInt16LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,32767,-32768),this[De]=255&_e,this[De+1]=_e>>>8,De+2},S.prototype.writeInt16BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,32767,-32768),this[De]=_e>>>8,this[De+1]=255&_e,De+2},S.prototype.writeInt32LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,2147483647,-2147483648),this[De]=255&_e,this[De+1]=_e>>>8,this[De+2]=_e>>>16,this[De+3]=_e>>>24,De+4},S.prototype.writeInt32BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,2147483647,-2147483648),_e<0&&(_e=4294967295+_e+1),this[De]=_e>>>24,this[De+1]=_e>>>16,this[De+2]=_e>>>8,this[De+3]=255&_e,De+4},S.prototype.writeBigInt64LE=$e(function(_e){return ye(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),S.prototype.writeBigInt64BE=$e(function(_e){return me(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),S.prototype.writeFloatLE=function(_e,De,Be){return Se(this,_e,De,!0,Be)},S.prototype.writeFloatBE=function(_e,De,Be){return Se(this,_e,De,!1,Be)},S.prototype.writeDoubleLE=function(_e,De,Be){return Ee(this,_e,De,!0,Be)},S.prototype.writeDoubleBE=function(_e,De,Be){return Ee(this,_e,De,!1,Be)},S.prototype.copy=function(_e,De,Be,Ge){if(!S.isBuffer(_e))throw new TypeError("argument should be a Buffer");if(Be||(Be=0),Ge||Ge===0||(Ge=this.length),De>=_e.length&&(De=_e.length),De||(De=0),Ge>0&&Ge=this.length)throw new RangeError("Index out of range");if(Ge<0)throw new RangeError("sourceEnd out of bounds");Ge>this.length&&(Ge=this.length),_e.length-De>>=0,Be=Be===void 0?this.length:Be>>>0,_e||(_e=0),typeof _e=="number")for(nt=De;nt=Ge+4;Be-=3)De="_".concat(_e.slice(Be-3,Be)).concat(De);return"".concat(_e.slice(0,Be)).concat(De)}function We(_e,De,Be,Ge,tt,nt){if(_e>Be||_e3?De===0||De===BigInt(0)?">= 0".concat(At," and < 2").concat(At," ** ").concat(8*(nt+1)).concat(At):">= -(2".concat(At," ** ").concat(8*(nt+1)-1).concat(At,") and < 2 ** ")+"".concat(8*(nt+1)-1).concat(At):">= ".concat(De).concat(At," and <= ").concat(Be).concat(At),new Ce.ERR_OUT_OF_RANGE("value",pt,_e)}(function(wt,Nt,Ht){Ie(Nt,"offset"),wt[Nt]!==void 0&&wt[Nt+Ht]!==void 0||Ve(Nt,wt.length-(Ht+1))})(Ge,tt,nt)}function Ie(_e,De){if(typeof _e!="number")throw new Ce.ERR_INVALID_ARG_TYPE(De,"number",_e)}function Ve(_e,De,Be){throw Math.floor(_e)!==_e?(Ie(_e,Be),new Ce.ERR_OUT_OF_RANGE(Be||"offset","an integer",_e)):De<0?new Ce.ERR_BUFFER_OUT_OF_BOUNDS:new Ce.ERR_OUT_OF_RANGE(Be||"offset",">= ".concat(Be?1:0," and <= ").concat(De),_e)}Le("ERR_BUFFER_OUT_OF_BOUNDS",function(_e){return _e?"".concat(_e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),Le("ERR_INVALID_ARG_TYPE",function(_e,De){return'The "'.concat(_e,'" argument must be of type number. Received type ').concat(x(De))},TypeError),Le("ERR_OUT_OF_RANGE",function(_e,De,Be){var Ge='The value of "'.concat(_e,'" is out of range.'),tt=Be;return Number.isInteger(Be)&&Math.abs(Be)>Math.pow(2,32)?tt=Oe(String(Be)):typeof Be=="bigint"&&(tt=String(Be),(Be>Math.pow(BigInt(2),BigInt(32))||Be<-Math.pow(BigInt(2),BigInt(32)))&&(tt=Oe(tt)),tt+="n"),Ge+" It must be ".concat(De,". Received ").concat(tt)},RangeError);var Pe=/[^+/0-9A-Za-z-_]/g;function de(_e,De){var Be;De=De||1/0;for(var Ge=_e.length,tt=null,nt=[],pt=0;pt55295&&Be<57344){if(!tt){if(Be>56319){(De-=3)>-1&&nt.push(239,191,189);continue}if(pt+1===Ge){(De-=3)>-1&&nt.push(239,191,189);continue}tt=Be;continue}if(Be<56320){(De-=3)>-1&&nt.push(239,191,189),tt=Be;continue}Be=65536+(tt-55296<<10|Be-56320)}else tt&&(De-=3)>-1&&nt.push(239,191,189);if(tt=null,Be<128){if((De-=1)<0)break;nt.push(Be)}else if(Be<2048){if((De-=2)<0)break;nt.push(Be>>6|192,63&Be|128)}else if(Be<65536){if((De-=3)<0)break;nt.push(Be>>12|224,Be>>6&63|128,63&Be|128)}else{if(!(Be<1114112))throw new Error("Invalid code point");if((De-=4)<0)break;nt.push(Be>>18|240,Be>>12&63|128,Be>>6&63|128,63&Be|128)}}return nt}function Me(_e){return m.toByteArray(function(De){if((De=(De=De.split("=")[0]).trim().replace(Pe,"")).length<2)return"";for(;De.length%4!=0;)De+="=";return De}(_e))}function ke(_e,De,Be,Ge){var tt;for(tt=0;tt=De.length||tt>=_e.length);++tt)De[tt+Be]=_e[tt];return tt}function He(_e,De){return _e instanceof De||_e!=null&&_e.constructor!=null&&_e.constructor.name!=null&&_e.constructor.name===De.name}function Fe(_e){return _e!=_e}var qe=function(){for(var _e="0123456789abcdef",De=new Array(256),Be=0;Be<16;++Be)for(var Ge=16*Be,tt=0;tt<16;++tt)De[Ge+tt]=_e[Be]+_e[tt];return De}();function $e(_e){return typeof BigInt>"u"?Ye:_e}function Ye(){throw new Error("BigInt not supported")}},9216:function(u){u.exports=o,u.exports.isMobile=o,u.exports.default=o;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/,l=/android|ipad|playbook|silk/i;function o(s){s||(s={});var c=s.ua;if(c||typeof navigator>"u"||(c=navigator.userAgent),c&&c.headers&&typeof c.headers["user-agent"]=="string"&&(c=c.headers["user-agent"]),typeof c!="string")return!1;var h=r.test(c)&&!n.test(c)||!!s.tablet&&l.test(c);return!h&&s.tablet&&s.featureDetect&&navigator&&navigator.maxTouchPoints>1&&c.indexOf("Macintosh")!==-1&&c.indexOf("Safari")!==-1&&(h=!0),h}},6296:function(u,r,n){u.exports=function(x){var m=(x=x||{}).eye||[0,0,1],g=x.center||[0,0,0],k=x.up||[0,1,0],A=x.distanceLimits||[0,1/0],v=x.mode||"turntable",S=l(),T=o(),p=s();return S.setDistanceLimits(A[0],A[1]),S.lookAt(0,m,g,k),T.setDistanceLimits(A[0],A[1]),T.lookAt(0,m,g,k),p.setDistanceLimits(A[0],A[1]),p.lookAt(0,m,g,k),new c({turntable:S,orbit:T,matrix:p},v)};var l=n(7261),o=n(9977),s=n(4192);function c(x,m){this._controllerNames=Object.keys(x),this._controllerList=this._controllerNames.map(function(g){return x[g]}),this._mode=m,this._active=x[m],this._active||(this._mode="turntable",this._active=x.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 h=c.prototype;h.flush=function(x){for(var m=this._controllerList,g=0;g"u"?n(1538):WeakMap,o=n(2762),s=n(8116),c=new l;u.exports=function(h){var x=c.get(h),m=x&&(x._triangleBuffer.handle||x._triangleBuffer.buffer);if(!m||!h.isBuffer(m)){var g=o(h,new Float32Array([-1,-1,-1,4,4,-1]));(x=s(h,[{buffer:g,type:h.FLOAT,size:2}]))._triangleBuffer=g,c.set(h,x)}x.bind(),h.drawArrays(h.TRIANGLES,0,3),x.unbind()}},1085:function(u,r,n){var l=n(1371);u.exports=function(o,s,c){s=typeof s=="number"?s:1,c=c||": ";var h=o.split(/\r?\n/),x=String(h.length+s-1).length;return h.map(function(m,g){var k=g+s,A=String(k).length;return l(k,x-A)+c+m}).join(` -`)}},3952:function(u,r,n){u.exports=function(s){var c=s.length;if(c===0)return[];if(c===1)return[0];for(var h=s[0].length,x=[s[0]],m=[0],g=1;g0?v-4:v;for(k=0;k>16&255,T[p++]=g>>8&255,T[p++]=255&g;return S===2&&(g=l[m.charCodeAt(k)]<<2|l[m.charCodeAt(k+1)]>>4,T[p++]=255&g),S===1&&(g=l[m.charCodeAt(k)]<<10|l[m.charCodeAt(k+1)]<<4|l[m.charCodeAt(k+2)]>>2,T[p++]=g>>8&255,T[p++]=255&g),T},r.fromByteArray=function(m){for(var g,k=m.length,A=k%3,v=[],S=16383,T=0,p=k-A;Tp?p:T+S));return A===1?(g=m[k-1],v.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(m[k-2]<<8)+m[k-1],v.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),v.join("")};for(var n=[],l=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0;c<64;++c)n[c]=s[c],l[s.charCodeAt(c)]=c;function h(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=m.indexOf("=");return k===-1&&(k=g),[k,k===g?0:4-k%4]}function x(m,g,k){for(var A,v,S=[],T=g;T>18&63]+n[v>>12&63]+n[v>>6&63]+n[63&v]);return S.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},3865:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[1]).add(s[0].mul(o[1])),o[1].mul(s[1]))}},1318:function(u){u.exports=function(r,n){return r[0].mul(n[1]).cmp(n[0].mul(r[1]))}},8697:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[1]),o[1].mul(s[0]))}},7842:function(u,r,n){var l=n(6330),o=n(1533),s=n(2651),c=n(4387),h=n(869),x=n(8697);u.exports=function m(g,k){if(l(g))return k?x(g,m(k)):[g[0].clone(),g[1].clone()];var A,v,S=0;if(o(g))A=g.clone();else if(typeof g=="string")A=c(g);else{if(g===0)return[s(0),s(1)];if(g===Math.floor(g))A=s(g);else{for(;g!==Math.floor(g);)g*=Math.pow(2,256),S-=256;A=s(g)}}if(l(k))A.mul(k[1]),v=k[0].clone();else if(o(k))v=k.clone();else if(typeof k=="string")v=c(k);else if(k)if(k===Math.floor(k))v=s(k);else{for(;k!==Math.floor(k);)k*=Math.pow(2,256),S+=256;v=s(k)}else v=s(1);return S>0?A=A.ushln(S):S<0&&(v=v.ushln(-S)),h(A,v)}},6330:function(u,r,n){var l=n(1533);u.exports=function(o){return Array.isArray(o)&&o.length===2&&l(o[0])&&l(o[1])}},5716:function(u,r,n){var l=n(6859);u.exports=function(o){return o.cmp(new l(0))}},1369:function(u,r,n){var l=n(5716);u.exports=function(o){var s=o.length,c=o.words,h=0;if(s===1)h=c[0];else if(s===2)h=c[0]+67108864*c[1];else for(var x=0;x20?52:h+32}},1533:function(u,r,n){n(6859),u.exports=function(l){return l&&typeof l=="object"&&!!l.words}},2651:function(u,r,n){var l=n(6859),o=n(2361);u.exports=function(s){var c=o.exponent(s);return c<52?new l(s):new l(s*Math.pow(2,52-c)).ushln(c-52)}},869:function(u,r,n){var l=n(2651),o=n(5716);u.exports=function(s,c){var h=o(s),x=o(c);if(h===0)return[l(0),l(1)];if(x===0)return[l(0),l(0)];x<0&&(s=s.neg(),c=c.neg());var m=s.gcd(c);return m.cmpn(1)?[s.div(m),c.div(m)]:[s,c]}},4387:function(u,r,n){var l=n(6859);u.exports=function(o){return new l(o)}},6504:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[0]),o[1].mul(s[1]))}},7721:function(u,r,n){var l=n(5716);u.exports=function(o){return l(o[0])*l(o[1])}},5572:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[1]).sub(o[1].mul(s[0])),o[1].mul(s[1]))}},946:function(u,r,n){var l=n(1369),o=n(4025);u.exports=function(s){var c=s[0],h=s[1];if(c.cmpn(0)===0)return 0;var x=c.abs().divmod(h.abs()),m=x.div,g=l(m),k=x.mod,A=c.negative!==h.negative?-1:1;if(k.cmpn(0)===0)return A*g;if(g){var v=o(g)+4;return A*(g+(T=l(k.ushln(v).divRound(h)))*Math.pow(2,-v))}var S=h.bitLength()-k.bitLength()+53,T=l(k.ushln(S).divRound(h));return S<1023?A*T*Math.pow(2,-S):A*(T*=Math.pow(2,-1023))*Math.pow(2,1023-S)}},2478:function(u){function r(h,x,m,g,k){for(var A=k+1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)>=0?(A=v,k=v-1):g=v+1}return A}function n(h,x,m,g,k){for(var A=k+1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)>0?(A=v,k=v-1):g=v+1}return A}function l(h,x,m,g,k){for(var A=g-1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)<0?(A=v,g=v+1):k=v-1}return A}function o(h,x,m,g,k){for(var A=g-1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)<=0?(A=v,g=v+1):k=v-1}return A}function s(h,x,m,g,k){for(;g<=k;){var A=g+k>>>1,v=h[A],S=m!==void 0?m(v,x):v-x;if(S===0)return A;S<=0?g=A+1:k=A-1}return-1}function c(h,x,m,g,k,A){return typeof m=="function"?A(h,x,m,g===void 0?0:0|g,k===void 0?h.length-1:0|k):A(h,x,void 0,m===void 0?0:0|m,g===void 0?h.length-1:0|g)}u.exports={ge:function(h,x,m,g,k){return c(h,x,m,g,k,r)},gt:function(h,x,m,g,k){return c(h,x,m,g,k,n)},lt:function(h,x,m,g,k){return c(h,x,m,g,k,l)},le:function(h,x,m,g,k){return c(h,x,m,g,k,o)},eq:function(h,x,m,g,k){return c(h,x,m,g,k,s)}}},8828:function(u,r){function n(o){var s=32;return(o&=-o)&&s--,65535&o&&(s-=16),16711935&o&&(s-=8),252645135&o&&(s-=4),858993459&o&&(s-=2),1431655765&o&&(s-=1),s}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-2147483648,r.sign=function(o){return(o>0)-(o<0)},r.abs=function(o){var s=o>>31;return(o^s)-s},r.min=function(o,s){return s^(o^s)&-(o65535)<<4,s|=c=((o>>>=s)>255)<<3,s|=c=((o>>>=c)>15)<<2,(s|=c=((o>>>=c)>3)<<1)|(o>>>=c)>>1},r.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},r.popCount=function(o){return 16843009*((o=(858993459&(o-=o>>>1&1431655765))+(o>>>2&858993459))+(o>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,1+(o|=o>>>16)},r.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,(o|=o>>>16)-(o>>>1)},r.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,27030>>>(o&=15)&1};var l=new Array(256);(function(o){for(var s=0;s<256;++s){var c=s,h=s,x=7;for(c>>>=1;c;c>>>=1)h<<=1,h|=1&c,--x;o[s]=h<>>8&255]<<16|l[o>>>16&255]<<8|l[o>>>24&255]},r.interleave2=function(o,s){return(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o&=65535)|o<<8))|o<<4))|o<<2))|o<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s&=65535)|s<<8))|s<<4))|s<<2))|s<<1))<<1},r.deinterleave2=function(o,s){return(o=65535&((o=16711935&((o=252645135&((o=858993459&((o=o>>>s&1431655765)|o>>>1))|o>>>2))|o>>>4))|o>>>16))<<16>>16},r.interleave3=function(o,s,c){return o=1227133513&((o=3272356035&((o=251719695&((o=4278190335&((o&=1023)|o<<16))|o<<8))|o<<4))|o<<2),(o|=(s=1227133513&((s=3272356035&((s=251719695&((s=4278190335&((s&=1023)|s<<16))|s<<8))|s<<4))|s<<2))<<1)|(c=1227133513&((c=3272356035&((c=251719695&((c=4278190335&((c&=1023)|c<<16))|c<<8))|c<<4))|c<<2))<<2},r.deinterleave3=function(o,s){return(o=1023&((o=4278190335&((o=251719695&((o=3272356035&((o=o>>>s&1227133513)|o>>>2))|o>>>4))|o>>>8))|o>>>16))<<22>>22},r.nextCombination=function(o){var s=o|o-1;return s+1|(~s&-~s)-1>>>n(o)+1}},6859:function(u,r,n){(function(l,o){function s(H,J){if(!H)throw new Error(J||"Assertion failed")}function c(H,J){H.super_=J;var Q=function(){};Q.prototype=J.prototype,H.prototype=new Q,H.prototype.constructor=H}function h(H,J,Q){if(h.isBN(H))return H;this.negative=0,this.words=null,this.length=0,this.red=null,H!==null&&(J!=="le"&&J!=="be"||(Q=J,J=10),this._init(H||0,J||10,Q||"be"))}var x;typeof l=="object"?l.exports=h:o.BN=h,h.BN=h,h.wordSize=26;try{x=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:n(7790).Buffer}catch{}function m(H,J){var Q=H.charCodeAt(J);return Q>=65&&Q<=70?Q-55:Q>=97&&Q<=102?Q-87:Q-48&15}function g(H,J,Q){var Z=m(H,Q);return Q-1>=J&&(Z|=m(H,Q-1)<<4),Z}function k(H,J,Q,Z){for(var K=0,ae=Math.min(H.length,Q),se=J;se=49?he-49+10:he>=17?he-17+10:he}return K}h.isBN=function(H){return H instanceof h||H!==null&&typeof H=="object"&&H.constructor.wordSize===h.wordSize&&Array.isArray(H.words)},h.max=function(H,J){return H.cmp(J)>0?H:J},h.min=function(H,J){return H.cmp(J)<0?H:J},h.prototype._init=function(H,J,Q){if(typeof H=="number")return this._initNumber(H,J,Q);if(typeof H=="object")return this._initArray(H,J,Q);J==="hex"&&(J=16),s(J===(0|J)&&J>=2&&J<=36);var Z=0;(H=H.toString().replace(/\s+/g,""))[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)ae=H[Z]|H[Z-1]<<8|H[Z-2]<<16,this.words[K]|=ae<>>26-se&67108863,(se+=24)>=26&&(se-=26,K++);else if(Q==="le")for(Z=0,K=0;Z>>26-se&67108863,(se+=24)>=26&&(se-=26,K++);return this.strip()},h.prototype._parseHex=function(H,J,Q){this.length=Math.ceil((H.length-J)/6),this.words=new Array(this.length);for(var Z=0;Z=J;Z-=2)K=g(H,J,Z)<=18?(ae-=18,se+=1,this.words[se]|=K>>>26):ae+=8;else for(Z=(H.length-J)%2==0?J+1:J;Z=18?(ae-=18,se+=1,this.words[se]|=K>>>26):ae+=8;this.strip()},h.prototype._parseBase=function(H,J,Q){this.words=[0],this.length=1;for(var Z=0,K=1;K<=67108863;K*=J)Z++;Z--,K=K/J|0;for(var ae=H.length-Q,se=ae%Z,he=Math.min(ae,ae-se)+Q,fe=0,ie=Q;ie1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},h.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},h.prototype.inspect=function(){return(this.red?""};var A=["","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"],v=[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],S=[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 T(H,J,Q){Q.negative=J.negative^H.negative;var Z=H.length+J.length|0;Q.length=Z,Z=Z-1|0;var K=0|H.words[0],ae=0|J.words[0],se=K*ae,he=67108863&se,fe=se/67108864|0;Q.words[0]=he;for(var ie=1;ie>>26,le=67108863&fe,ge=Math.min(ie,J.length-1),ye=Math.max(0,ie-H.length+1);ye<=ge;ye++){var me=ie-ye|0;oe+=(se=(K=0|H.words[me])*(ae=0|J.words[ye])+le)/67108864|0,le=67108863&se}Q.words[ie]=0|le,fe=0|oe}return fe!==0?Q.words[ie]=0|fe:Q.length--,Q.strip()}h.prototype.toString=function(H,J){var Q;if(J=0|J||1,(H=H||10)===16||H==="hex"){Q="";for(var Z=0,K=0,ae=0;ae>>24-Z&16777215)!=0||ae!==this.length-1?A[6-he.length]+he+Q:he+Q,(Z+=2)>=26&&(Z-=26,ae--)}for(K!==0&&(Q=K.toString(16)+Q);Q.length%J!=0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}if(H===(0|H)&&H>=2&&H<=36){var fe=v[H],ie=S[H];Q="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var le=oe.modn(ie).toString(H);Q=(oe=oe.idivn(ie)).isZero()?le+Q:A[fe-le.length]+le+Q}for(this.isZero()&&(Q="0"+Q);Q.length%J!=0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}s(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var H=this.words[0];return this.length===2?H+=67108864*this.words[1]:this.length===3&&this.words[2]===1?H+=4503599627370496+67108864*this.words[1]:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-H:H},h.prototype.toJSON=function(){return this.toString(16)},h.prototype.toBuffer=function(H,J){return s(x!==void 0),this.toArrayLike(x,H,J)},h.prototype.toArray=function(H,J){return this.toArrayLike(Array,H,J)},h.prototype.toArrayLike=function(H,J,Q){var Z=this.byteLength(),K=Q||Math.max(1,Z);s(Z<=K,"byte array longer than desired length"),s(K>0,"Requested array length <= 0"),this.strip();var ae,se,he=J==="le",fe=new H(K),ie=this.clone();if(he){for(se=0;!ie.isZero();se++)ae=ie.andln(255),ie.iushrn(8),fe[se]=ae;for(;se=4096&&(Q+=13,J>>>=13),J>=64&&(Q+=7,J>>>=7),J>=8&&(Q+=4,J>>>=4),J>=2&&(Q+=2,J>>>=2),Q+J},h.prototype._zeroBits=function(H){if(H===0)return 26;var J=H,Q=0;return!(8191&J)&&(Q+=13,J>>>=13),!(127&J)&&(Q+=7,J>>>=7),!(15&J)&&(Q+=4,J>>>=4),!(3&J)&&(Q+=2,J>>>=2),!(1&J)&&Q++,Q},h.prototype.bitLength=function(){var H=this.words[this.length-1],J=this._countBits(H);return 26*(this.length-1)+J},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var H=0,J=0;JH.length?this.clone().ior(H):H.clone().ior(this)},h.prototype.uor=function(H){return this.length>H.length?this.clone().iuor(H):H.clone().iuor(this)},h.prototype.iuand=function(H){var J;J=this.length>H.length?H:this;for(var Q=0;QH.length?this.clone().iand(H):H.clone().iand(this)},h.prototype.uand=function(H){return this.length>H.length?this.clone().iuand(H):H.clone().iuand(this)},h.prototype.iuxor=function(H){var J,Q;this.length>H.length?(J=this,Q=H):(J=H,Q=this);for(var Z=0;ZH.length?this.clone().ixor(H):H.clone().ixor(this)},h.prototype.uxor=function(H){return this.length>H.length?this.clone().iuxor(H):H.clone().iuxor(this)},h.prototype.inotn=function(H){s(typeof H=="number"&&H>=0);var J=0|Math.ceil(H/26),Q=H%26;this._expand(J),Q>0&&J--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-Q),this.strip()},h.prototype.notn=function(H){return this.clone().inotn(H)},h.prototype.setn=function(H,J){s(typeof H=="number"&&H>=0);var Q=H/26|0,Z=H%26;return this._expand(Q+1),this.words[Q]=J?this.words[Q]|1<H.length?(Q=this,Z=H):(Q=H,Z=this);for(var K=0,ae=0;ae>>26;for(;K!==0&&ae>>26;if(this.length=Q.length,K!==0)this.words[this.length]=K,this.length++;else if(Q!==this)for(;aeH.length?this.clone().iadd(H):H.clone().iadd(this)},h.prototype.isub=function(H){if(H.negative!==0){H.negative=0;var J=this.iadd(H);return H.negative=1,J._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(H),this.negative=1,this._normSign();var Q,Z,K=this.cmp(H);if(K===0)return this.negative=0,this.length=1,this.words[0]=0,this;K>0?(Q=this,Z=H):(Q=H,Z=this);for(var ae=0,se=0;se>26,this.words[se]=67108863&J;for(;ae!==0&&se>26,this.words[se]=67108863&J;if(ae===0&&se>>13,ye=0|se[1],me=8191&ye,be=ye>>>13,Se=0|se[2],Ee=8191&Se,Ce=Se>>>13,Le=0|se[3],Oe=8191&Le,We=Le>>>13,Ie=0|se[4],Ve=8191&Ie,Pe=Ie>>>13,de=0|se[5],Me=8191&de,ke=de>>>13,He=0|se[6],Fe=8191&He,qe=He>>>13,$e=0|se[7],Ye=8191&$e,_e=$e>>>13,De=0|se[8],Be=8191&De,Ge=De>>>13,tt=0|se[9],nt=8191&tt,pt=tt>>>13,At=0|he[0],wt=8191&At,Nt=At>>>13,Ht=0|he[1],Gt=8191&Ht,st=Ht>>>13,Qe=0|he[2],ft=8191&Qe,yt=Qe>>>13,Ot=0|he[3],Pt=8191&Ot,at=Ot>>>13,lt=0|he[4],Xe=8191<,ut=lt>>>13,Tt=0|he[5],vt=8191&Tt,Lt=Tt>>>13,Ut=0|he[6],rt=8191&Ut,et=Ut>>>13,Et=0|he[7],Bt=8191&Et,Ft=Et>>>13,St=0|he[8],Jt=8191&St,qt=St>>>13,en=0|he[9],Wt=8191&en,Zt=en>>>13;Q.negative=H.negative^J.negative,Q.length=19;var on=(ie+(Z=Math.imul(le,wt))|0)+((8191&(K=(K=Math.imul(le,Nt))+Math.imul(ge,wt)|0))<<13)|0;ie=((ae=Math.imul(ge,Nt))+(K>>>13)|0)+(on>>>26)|0,on&=67108863,Z=Math.imul(me,wt),K=(K=Math.imul(me,Nt))+Math.imul(be,wt)|0,ae=Math.imul(be,Nt);var un=(ie+(Z=Z+Math.imul(le,Gt)|0)|0)+((8191&(K=(K=K+Math.imul(le,st)|0)+Math.imul(ge,Gt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,st)|0)+(K>>>13)|0)+(un>>>26)|0,un&=67108863,Z=Math.imul(Ee,wt),K=(K=Math.imul(Ee,Nt))+Math.imul(Ce,wt)|0,ae=Math.imul(Ce,Nt),Z=Z+Math.imul(me,Gt)|0,K=(K=K+Math.imul(me,st)|0)+Math.imul(be,Gt)|0,ae=ae+Math.imul(be,st)|0;var Pn=(ie+(Z=Z+Math.imul(le,ft)|0)|0)+((8191&(K=(K=K+Math.imul(le,yt)|0)+Math.imul(ge,ft)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,yt)|0)+(K>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,Z=Math.imul(Oe,wt),K=(K=Math.imul(Oe,Nt))+Math.imul(We,wt)|0,ae=Math.imul(We,Nt),Z=Z+Math.imul(Ee,Gt)|0,K=(K=K+Math.imul(Ee,st)|0)+Math.imul(Ce,Gt)|0,ae=ae+Math.imul(Ce,st)|0,Z=Z+Math.imul(me,ft)|0,K=(K=K+Math.imul(me,yt)|0)+Math.imul(be,ft)|0,ae=ae+Math.imul(be,yt)|0;var Dn=(ie+(Z=Z+Math.imul(le,Pt)|0)|0)+((8191&(K=(K=K+Math.imul(le,at)|0)+Math.imul(ge,Pt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,at)|0)+(K>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,Z=Math.imul(Ve,wt),K=(K=Math.imul(Ve,Nt))+Math.imul(Pe,wt)|0,ae=Math.imul(Pe,Nt),Z=Z+Math.imul(Oe,Gt)|0,K=(K=K+Math.imul(Oe,st)|0)+Math.imul(We,Gt)|0,ae=ae+Math.imul(We,st)|0,Z=Z+Math.imul(Ee,ft)|0,K=(K=K+Math.imul(Ee,yt)|0)+Math.imul(Ce,ft)|0,ae=ae+Math.imul(Ce,yt)|0,Z=Z+Math.imul(me,Pt)|0,K=(K=K+Math.imul(me,at)|0)+Math.imul(be,Pt)|0,ae=ae+Math.imul(be,at)|0;var In=(ie+(Z=Z+Math.imul(le,Xe)|0)|0)+((8191&(K=(K=K+Math.imul(le,ut)|0)+Math.imul(ge,Xe)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,ut)|0)+(K>>>13)|0)+(In>>>26)|0,In&=67108863,Z=Math.imul(Me,wt),K=(K=Math.imul(Me,Nt))+Math.imul(ke,wt)|0,ae=Math.imul(ke,Nt),Z=Z+Math.imul(Ve,Gt)|0,K=(K=K+Math.imul(Ve,st)|0)+Math.imul(Pe,Gt)|0,ae=ae+Math.imul(Pe,st)|0,Z=Z+Math.imul(Oe,ft)|0,K=(K=K+Math.imul(Oe,yt)|0)+Math.imul(We,ft)|0,ae=ae+Math.imul(We,yt)|0,Z=Z+Math.imul(Ee,Pt)|0,K=(K=K+Math.imul(Ee,at)|0)+Math.imul(Ce,Pt)|0,ae=ae+Math.imul(Ce,at)|0,Z=Z+Math.imul(me,Xe)|0,K=(K=K+Math.imul(me,ut)|0)+Math.imul(be,Xe)|0,ae=ae+Math.imul(be,ut)|0;var mn=(ie+(Z=Z+Math.imul(le,vt)|0)|0)+((8191&(K=(K=K+Math.imul(le,Lt)|0)+Math.imul(ge,vt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,Lt)|0)+(K>>>13)|0)+(mn>>>26)|0,mn&=67108863,Z=Math.imul(Fe,wt),K=(K=Math.imul(Fe,Nt))+Math.imul(qe,wt)|0,ae=Math.imul(qe,Nt),Z=Z+Math.imul(Me,Gt)|0,K=(K=K+Math.imul(Me,st)|0)+Math.imul(ke,Gt)|0,ae=ae+Math.imul(ke,st)|0,Z=Z+Math.imul(Ve,ft)|0,K=(K=K+Math.imul(Ve,yt)|0)+Math.imul(Pe,ft)|0,ae=ae+Math.imul(Pe,yt)|0,Z=Z+Math.imul(Oe,Pt)|0,K=(K=K+Math.imul(Oe,at)|0)+Math.imul(We,Pt)|0,ae=ae+Math.imul(We,at)|0,Z=Z+Math.imul(Ee,Xe)|0,K=(K=K+Math.imul(Ee,ut)|0)+Math.imul(Ce,Xe)|0,ae=ae+Math.imul(Ce,ut)|0,Z=Z+Math.imul(me,vt)|0,K=(K=K+Math.imul(me,Lt)|0)+Math.imul(be,vt)|0,ae=ae+Math.imul(be,Lt)|0;var En=(ie+(Z=Z+Math.imul(le,rt)|0)|0)+((8191&(K=(K=K+Math.imul(le,et)|0)+Math.imul(ge,rt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,et)|0)+(K>>>13)|0)+(En>>>26)|0,En&=67108863,Z=Math.imul(Ye,wt),K=(K=Math.imul(Ye,Nt))+Math.imul(_e,wt)|0,ae=Math.imul(_e,Nt),Z=Z+Math.imul(Fe,Gt)|0,K=(K=K+Math.imul(Fe,st)|0)+Math.imul(qe,Gt)|0,ae=ae+Math.imul(qe,st)|0,Z=Z+Math.imul(Me,ft)|0,K=(K=K+Math.imul(Me,yt)|0)+Math.imul(ke,ft)|0,ae=ae+Math.imul(ke,yt)|0,Z=Z+Math.imul(Ve,Pt)|0,K=(K=K+Math.imul(Ve,at)|0)+Math.imul(Pe,Pt)|0,ae=ae+Math.imul(Pe,at)|0,Z=Z+Math.imul(Oe,Xe)|0,K=(K=K+Math.imul(Oe,ut)|0)+Math.imul(We,Xe)|0,ae=ae+Math.imul(We,ut)|0,Z=Z+Math.imul(Ee,vt)|0,K=(K=K+Math.imul(Ee,Lt)|0)+Math.imul(Ce,vt)|0,ae=ae+Math.imul(Ce,Lt)|0,Z=Z+Math.imul(me,rt)|0,K=(K=K+Math.imul(me,et)|0)+Math.imul(be,rt)|0,ae=ae+Math.imul(be,et)|0;var Kn=(ie+(Z=Z+Math.imul(le,Bt)|0)|0)+((8191&(K=(K=K+Math.imul(le,Ft)|0)+Math.imul(ge,Bt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,Ft)|0)+(K>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,Z=Math.imul(Be,wt),K=(K=Math.imul(Be,Nt))+Math.imul(Ge,wt)|0,ae=Math.imul(Ge,Nt),Z=Z+Math.imul(Ye,Gt)|0,K=(K=K+Math.imul(Ye,st)|0)+Math.imul(_e,Gt)|0,ae=ae+Math.imul(_e,st)|0,Z=Z+Math.imul(Fe,ft)|0,K=(K=K+Math.imul(Fe,yt)|0)+Math.imul(qe,ft)|0,ae=ae+Math.imul(qe,yt)|0,Z=Z+Math.imul(Me,Pt)|0,K=(K=K+Math.imul(Me,at)|0)+Math.imul(ke,Pt)|0,ae=ae+Math.imul(ke,at)|0,Z=Z+Math.imul(Ve,Xe)|0,K=(K=K+Math.imul(Ve,ut)|0)+Math.imul(Pe,Xe)|0,ae=ae+Math.imul(Pe,ut)|0,Z=Z+Math.imul(Oe,vt)|0,K=(K=K+Math.imul(Oe,Lt)|0)+Math.imul(We,vt)|0,ae=ae+Math.imul(We,Lt)|0,Z=Z+Math.imul(Ee,rt)|0,K=(K=K+Math.imul(Ee,et)|0)+Math.imul(Ce,rt)|0,ae=ae+Math.imul(Ce,et)|0,Z=Z+Math.imul(me,Bt)|0,K=(K=K+Math.imul(me,Ft)|0)+Math.imul(be,Bt)|0,ae=ae+Math.imul(be,Ft)|0;var Ln=(ie+(Z=Z+Math.imul(le,Jt)|0)|0)+((8191&(K=(K=K+Math.imul(le,qt)|0)+Math.imul(ge,Jt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,qt)|0)+(K>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,Z=Math.imul(nt,wt),K=(K=Math.imul(nt,Nt))+Math.imul(pt,wt)|0,ae=Math.imul(pt,Nt),Z=Z+Math.imul(Be,Gt)|0,K=(K=K+Math.imul(Be,st)|0)+Math.imul(Ge,Gt)|0,ae=ae+Math.imul(Ge,st)|0,Z=Z+Math.imul(Ye,ft)|0,K=(K=K+Math.imul(Ye,yt)|0)+Math.imul(_e,ft)|0,ae=ae+Math.imul(_e,yt)|0,Z=Z+Math.imul(Fe,Pt)|0,K=(K=K+Math.imul(Fe,at)|0)+Math.imul(qe,Pt)|0,ae=ae+Math.imul(qe,at)|0,Z=Z+Math.imul(Me,Xe)|0,K=(K=K+Math.imul(Me,ut)|0)+Math.imul(ke,Xe)|0,ae=ae+Math.imul(ke,ut)|0,Z=Z+Math.imul(Ve,vt)|0,K=(K=K+Math.imul(Ve,Lt)|0)+Math.imul(Pe,vt)|0,ae=ae+Math.imul(Pe,Lt)|0,Z=Z+Math.imul(Oe,rt)|0,K=(K=K+Math.imul(Oe,et)|0)+Math.imul(We,rt)|0,ae=ae+Math.imul(We,et)|0,Z=Z+Math.imul(Ee,Bt)|0,K=(K=K+Math.imul(Ee,Ft)|0)+Math.imul(Ce,Bt)|0,ae=ae+Math.imul(Ce,Ft)|0,Z=Z+Math.imul(me,Jt)|0,K=(K=K+Math.imul(me,qt)|0)+Math.imul(be,Jt)|0,ae=ae+Math.imul(be,qt)|0;var Tn=(ie+(Z=Z+Math.imul(le,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(le,Zt)|0)+Math.imul(ge,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,Zt)|0)+(K>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,Z=Math.imul(nt,Gt),K=(K=Math.imul(nt,st))+Math.imul(pt,Gt)|0,ae=Math.imul(pt,st),Z=Z+Math.imul(Be,ft)|0,K=(K=K+Math.imul(Be,yt)|0)+Math.imul(Ge,ft)|0,ae=ae+Math.imul(Ge,yt)|0,Z=Z+Math.imul(Ye,Pt)|0,K=(K=K+Math.imul(Ye,at)|0)+Math.imul(_e,Pt)|0,ae=ae+Math.imul(_e,at)|0,Z=Z+Math.imul(Fe,Xe)|0,K=(K=K+Math.imul(Fe,ut)|0)+Math.imul(qe,Xe)|0,ae=ae+Math.imul(qe,ut)|0,Z=Z+Math.imul(Me,vt)|0,K=(K=K+Math.imul(Me,Lt)|0)+Math.imul(ke,vt)|0,ae=ae+Math.imul(ke,Lt)|0,Z=Z+Math.imul(Ve,rt)|0,K=(K=K+Math.imul(Ve,et)|0)+Math.imul(Pe,rt)|0,ae=ae+Math.imul(Pe,et)|0,Z=Z+Math.imul(Oe,Bt)|0,K=(K=K+Math.imul(Oe,Ft)|0)+Math.imul(We,Bt)|0,ae=ae+Math.imul(We,Ft)|0,Z=Z+Math.imul(Ee,Jt)|0,K=(K=K+Math.imul(Ee,qt)|0)+Math.imul(Ce,Jt)|0,ae=ae+Math.imul(Ce,qt)|0;var Fn=(ie+(Z=Z+Math.imul(me,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(me,Zt)|0)+Math.imul(be,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(be,Zt)|0)+(K>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,Z=Math.imul(nt,ft),K=(K=Math.imul(nt,yt))+Math.imul(pt,ft)|0,ae=Math.imul(pt,yt),Z=Z+Math.imul(Be,Pt)|0,K=(K=K+Math.imul(Be,at)|0)+Math.imul(Ge,Pt)|0,ae=ae+Math.imul(Ge,at)|0,Z=Z+Math.imul(Ye,Xe)|0,K=(K=K+Math.imul(Ye,ut)|0)+Math.imul(_e,Xe)|0,ae=ae+Math.imul(_e,ut)|0,Z=Z+Math.imul(Fe,vt)|0,K=(K=K+Math.imul(Fe,Lt)|0)+Math.imul(qe,vt)|0,ae=ae+Math.imul(qe,Lt)|0,Z=Z+Math.imul(Me,rt)|0,K=(K=K+Math.imul(Me,et)|0)+Math.imul(ke,rt)|0,ae=ae+Math.imul(ke,et)|0,Z=Z+Math.imul(Ve,Bt)|0,K=(K=K+Math.imul(Ve,Ft)|0)+Math.imul(Pe,Bt)|0,ae=ae+Math.imul(Pe,Ft)|0,Z=Z+Math.imul(Oe,Jt)|0,K=(K=K+Math.imul(Oe,qt)|0)+Math.imul(We,Jt)|0,ae=ae+Math.imul(We,qt)|0;var wn=(ie+(Z=Z+Math.imul(Ee,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Ee,Zt)|0)+Math.imul(Ce,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(Ce,Zt)|0)+(K>>>13)|0)+(wn>>>26)|0,wn&=67108863,Z=Math.imul(nt,Pt),K=(K=Math.imul(nt,at))+Math.imul(pt,Pt)|0,ae=Math.imul(pt,at),Z=Z+Math.imul(Be,Xe)|0,K=(K=K+Math.imul(Be,ut)|0)+Math.imul(Ge,Xe)|0,ae=ae+Math.imul(Ge,ut)|0,Z=Z+Math.imul(Ye,vt)|0,K=(K=K+Math.imul(Ye,Lt)|0)+Math.imul(_e,vt)|0,ae=ae+Math.imul(_e,Lt)|0,Z=Z+Math.imul(Fe,rt)|0,K=(K=K+Math.imul(Fe,et)|0)+Math.imul(qe,rt)|0,ae=ae+Math.imul(qe,et)|0,Z=Z+Math.imul(Me,Bt)|0,K=(K=K+Math.imul(Me,Ft)|0)+Math.imul(ke,Bt)|0,ae=ae+Math.imul(ke,Ft)|0,Z=Z+Math.imul(Ve,Jt)|0,K=(K=K+Math.imul(Ve,qt)|0)+Math.imul(Pe,Jt)|0,ae=ae+Math.imul(Pe,qt)|0;var zn=(ie+(Z=Z+Math.imul(Oe,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Oe,Zt)|0)+Math.imul(We,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(We,Zt)|0)+(K>>>13)|0)+(zn>>>26)|0,zn&=67108863,Z=Math.imul(nt,Xe),K=(K=Math.imul(nt,ut))+Math.imul(pt,Xe)|0,ae=Math.imul(pt,ut),Z=Z+Math.imul(Be,vt)|0,K=(K=K+Math.imul(Be,Lt)|0)+Math.imul(Ge,vt)|0,ae=ae+Math.imul(Ge,Lt)|0,Z=Z+Math.imul(Ye,rt)|0,K=(K=K+Math.imul(Ye,et)|0)+Math.imul(_e,rt)|0,ae=ae+Math.imul(_e,et)|0,Z=Z+Math.imul(Fe,Bt)|0,K=(K=K+Math.imul(Fe,Ft)|0)+Math.imul(qe,Bt)|0,ae=ae+Math.imul(qe,Ft)|0,Z=Z+Math.imul(Me,Jt)|0,K=(K=K+Math.imul(Me,qt)|0)+Math.imul(ke,Jt)|0,ae=ae+Math.imul(ke,qt)|0;var Jn=(ie+(Z=Z+Math.imul(Ve,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Ve,Zt)|0)+Math.imul(Pe,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(Pe,Zt)|0)+(K>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Z=Math.imul(nt,vt),K=(K=Math.imul(nt,Lt))+Math.imul(pt,vt)|0,ae=Math.imul(pt,Lt),Z=Z+Math.imul(Be,rt)|0,K=(K=K+Math.imul(Be,et)|0)+Math.imul(Ge,rt)|0,ae=ae+Math.imul(Ge,et)|0,Z=Z+Math.imul(Ye,Bt)|0,K=(K=K+Math.imul(Ye,Ft)|0)+Math.imul(_e,Bt)|0,ae=ae+Math.imul(_e,Ft)|0,Z=Z+Math.imul(Fe,Jt)|0,K=(K=K+Math.imul(Fe,qt)|0)+Math.imul(qe,Jt)|0,ae=ae+Math.imul(qe,qt)|0;var $n=(ie+(Z=Z+Math.imul(Me,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Me,Zt)|0)+Math.imul(ke,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(ke,Zt)|0)+(K>>>13)|0)+($n>>>26)|0,$n&=67108863,Z=Math.imul(nt,rt),K=(K=Math.imul(nt,et))+Math.imul(pt,rt)|0,ae=Math.imul(pt,et),Z=Z+Math.imul(Be,Bt)|0,K=(K=K+Math.imul(Be,Ft)|0)+Math.imul(Ge,Bt)|0,ae=ae+Math.imul(Ge,Ft)|0,Z=Z+Math.imul(Ye,Jt)|0,K=(K=K+Math.imul(Ye,qt)|0)+Math.imul(_e,Jt)|0,ae=ae+Math.imul(_e,qt)|0;var vr=(ie+(Z=Z+Math.imul(Fe,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Fe,Zt)|0)+Math.imul(qe,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(qe,Zt)|0)+(K>>>13)|0)+(vr>>>26)|0,vr&=67108863,Z=Math.imul(nt,Bt),K=(K=Math.imul(nt,Ft))+Math.imul(pt,Bt)|0,ae=Math.imul(pt,Ft),Z=Z+Math.imul(Be,Jt)|0,K=(K=K+Math.imul(Be,qt)|0)+Math.imul(Ge,Jt)|0,ae=ae+Math.imul(Ge,qt)|0;var Qn=(ie+(Z=Z+Math.imul(Ye,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Ye,Zt)|0)+Math.imul(_e,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(_e,Zt)|0)+(K>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Z=Math.imul(nt,Jt),K=(K=Math.imul(nt,qt))+Math.imul(pt,Jt)|0,ae=Math.imul(pt,qt);var lr=(ie+(Z=Z+Math.imul(Be,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Be,Zt)|0)+Math.imul(Ge,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(Ge,Zt)|0)+(K>>>13)|0)+(lr>>>26)|0,lr&=67108863;var hr=(ie+(Z=Math.imul(nt,Wt))|0)+((8191&(K=(K=Math.imul(nt,Zt))+Math.imul(pt,Wt)|0))<<13)|0;return ie=((ae=Math.imul(pt,Zt))+(K>>>13)|0)+(hr>>>26)|0,hr&=67108863,fe[0]=on,fe[1]=un,fe[2]=Pn,fe[3]=Dn,fe[4]=In,fe[5]=mn,fe[6]=En,fe[7]=Kn,fe[8]=Ln,fe[9]=Tn,fe[10]=Fn,fe[11]=wn,fe[12]=zn,fe[13]=Jn,fe[14]=$n,fe[15]=vr,fe[16]=Qn,fe[17]=lr,fe[18]=hr,ie!==0&&(fe[19]=ie,Q.length++),Q};function M(H,J,Q){return new f().mulp(H,J,Q)}function f(H,J){this.x=H,this.y=J}Math.imul||(p=T),h.prototype.mulTo=function(H,J){var Q,Z=this.length+H.length;return Q=this.length===10&&H.length===10?p(this,H,J):Z<63?T(this,H,J):Z<1024?function(K,ae,se){se.negative=ae.negative^K.negative,se.length=K.length+ae.length;for(var he=0,fe=0,ie=0;ie>>26)|0)>>>26,oe&=67108863}se.words[ie]=le,he=oe,oe=fe}return he!==0?se.words[ie]=he:se.length--,se.strip()}(this,H,J):M(this,H,J),Q},f.prototype.makeRBT=function(H){for(var J=new Array(H),Q=h.prototype._countBits(H)-1,Z=0;Z>=1;return Z},f.prototype.permute=function(H,J,Q,Z,K,ae){for(var se=0;se>>=1)K++;return 1<>>=13,Q[2*ae+1]=8191&K,K>>>=13;for(ae=2*J;ae>=26,J+=Z/67108864|0,J+=K>>>26,this.words[Q]=67108863&K}return J!==0&&(this.words[Q]=J,this.length++),this},h.prototype.muln=function(H){return this.clone().imuln(H)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(H){var J=function(ae){for(var se=new Array(ae.bitLength()),he=0;he>>ie}return se}(H);if(J.length===0)return new h(1);for(var Q=this,Z=0;Z=0);var J,Q=H%26,Z=(H-Q)/26,K=67108863>>>26-Q<<26-Q;if(Q!==0){var ae=0;for(J=0;J>>26-Q}ae&&(this.words[J]=ae,this.length++)}if(Z!==0){for(J=this.length-1;J>=0;J--)this.words[J+Z]=this.words[J];for(J=0;J=0),Z=J?(J-J%26)/26:0;var K=H%26,ae=Math.min((H-K)/26,this.length),se=67108863^67108863>>>K<ae)for(this.length-=ae,fe=0;fe=0&&(ie!==0||fe>=Z);fe--){var oe=0|this.words[fe];this.words[fe]=ie<<26-K|oe>>>K,ie=oe&se}return he&&ie!==0&&(he.words[he.length++]=ie),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},h.prototype.ishrn=function(H,J,Q){return s(this.negative===0),this.iushrn(H,J,Q)},h.prototype.shln=function(H){return this.clone().ishln(H)},h.prototype.ushln=function(H){return this.clone().iushln(H)},h.prototype.shrn=function(H){return this.clone().ishrn(H)},h.prototype.ushrn=function(H){return this.clone().iushrn(H)},h.prototype.testn=function(H){s(typeof H=="number"&&H>=0);var J=H%26,Q=(H-J)/26,Z=1<=0);var J=H%26,Q=(H-J)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=Q)return this;if(J!==0&&Q++,this.length=Math.min(Q,this.length),J!==0){var Z=67108863^67108863>>>J<=67108864;J++)this.words[J]-=67108864,J===this.length-1?this.words[J+1]=1:this.words[J+1]++;return this.length=Math.max(this.length,J+1),this},h.prototype.isubn=function(H){if(s(typeof H=="number"),s(H<67108864),H<0)return this.iaddn(-H);if(this.negative!==0)return this.negative=0,this.iaddn(H),this.negative=1,this;if(this.words[0]-=H,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var J=0;J>26)-(he/67108864|0),this.words[Z+Q]=67108863&K}for(;Z>26,this.words[Z+Q]=67108863&K;if(se===0)return this.strip();for(s(se===-1),se=0,Z=0;Z>26,this.words[Z]=67108863&K;return this.negative=1,this.strip()},h.prototype._wordDiv=function(H,J){var Q=(this.length,H.length),Z=this.clone(),K=H,ae=0|K.words[K.length-1];(Q=26-this._countBits(ae))!=0&&(K=K.ushln(Q),Z.iushln(Q),ae=0|K.words[K.length-1]);var se,he=Z.length-K.length;if(J!=="mod"){(se=new h(null)).length=he+1,se.words=new Array(se.length);for(var fe=0;fe=0;oe--){var le=67108864*(0|Z.words[K.length+oe])+(0|Z.words[K.length+oe-1]);for(le=Math.min(le/ae|0,67108863),Z._ishlnsubmul(K,le,oe);Z.negative!==0;)le--,Z.negative=0,Z._ishlnsubmul(K,1,oe),Z.isZero()||(Z.negative^=1);se&&(se.words[oe]=le)}return se&&se.strip(),Z.strip(),J!=="div"&&Q!==0&&Z.iushrn(Q),{div:se||null,mod:Z}},h.prototype.divmod=function(H,J,Q){return s(!H.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:this.negative!==0&&H.negative===0?(ae=this.neg().divmod(H,J),J!=="mod"&&(Z=ae.div.neg()),J!=="div"&&(K=ae.mod.neg(),Q&&K.negative!==0&&K.iadd(H)),{div:Z,mod:K}):this.negative===0&&H.negative!==0?(ae=this.divmod(H.neg(),J),J!=="mod"&&(Z=ae.div.neg()),{div:Z,mod:ae.mod}):this.negative&H.negative?(ae=this.neg().divmod(H.neg(),J),J!=="div"&&(K=ae.mod.neg(),Q&&K.negative!==0&&K.isub(H)),{div:ae.div,mod:K}):H.length>this.length||this.cmp(H)<0?{div:new h(0),mod:this}:H.length===1?J==="div"?{div:this.divn(H.words[0]),mod:null}:J==="mod"?{div:null,mod:new h(this.modn(H.words[0]))}:{div:this.divn(H.words[0]),mod:new h(this.modn(H.words[0]))}:this._wordDiv(H,J);var Z,K,ae},h.prototype.div=function(H){return this.divmod(H,"div",!1).div},h.prototype.mod=function(H){return this.divmod(H,"mod",!1).mod},h.prototype.umod=function(H){return this.divmod(H,"mod",!0).mod},h.prototype.divRound=function(H){var J=this.divmod(H);if(J.mod.isZero())return J.div;var Q=J.div.negative!==0?J.mod.isub(H):J.mod,Z=H.ushrn(1),K=H.andln(1),ae=Q.cmp(Z);return ae<0||K===1&&ae===0?J.div:J.div.negative!==0?J.div.isubn(1):J.div.iaddn(1)},h.prototype.modn=function(H){s(H<=67108863);for(var J=67108864%H,Q=0,Z=this.length-1;Z>=0;Z--)Q=(J*Q+(0|this.words[Z]))%H;return Q},h.prototype.idivn=function(H){s(H<=67108863);for(var J=0,Q=this.length-1;Q>=0;Q--){var Z=(0|this.words[Q])+67108864*J;this.words[Q]=Z/H|0,J=Z%H}return this.strip()},h.prototype.divn=function(H){return this.clone().idivn(H)},h.prototype.egcd=function(H){s(H.negative===0),s(!H.isZero());var J=this,Q=H.clone();J=J.negative!==0?J.umod(H):J.clone();for(var Z=new h(1),K=new h(0),ae=new h(0),se=new h(1),he=0;J.isEven()&&Q.isEven();)J.iushrn(1),Q.iushrn(1),++he;for(var fe=Q.clone(),ie=J.clone();!J.isZero();){for(var oe=0,le=1;!(J.words[0]&le)&&oe<26;++oe,le<<=1);if(oe>0)for(J.iushrn(oe);oe-- >0;)(Z.isOdd()||K.isOdd())&&(Z.iadd(fe),K.isub(ie)),Z.iushrn(1),K.iushrn(1);for(var ge=0,ye=1;!(Q.words[0]&ye)&&ge<26;++ge,ye<<=1);if(ge>0)for(Q.iushrn(ge);ge-- >0;)(ae.isOdd()||se.isOdd())&&(ae.iadd(fe),se.isub(ie)),ae.iushrn(1),se.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),Z.isub(ae),K.isub(se)):(Q.isub(J),ae.isub(Z),se.isub(K))}return{a:ae,b:se,gcd:Q.iushln(he)}},h.prototype._invmp=function(H){s(H.negative===0),s(!H.isZero());var J=this,Q=H.clone();J=J.negative!==0?J.umod(H):J.clone();for(var Z,K=new h(1),ae=new h(0),se=Q.clone();J.cmpn(1)>0&&Q.cmpn(1)>0;){for(var he=0,fe=1;!(J.words[0]&fe)&&he<26;++he,fe<<=1);if(he>0)for(J.iushrn(he);he-- >0;)K.isOdd()&&K.iadd(se),K.iushrn(1);for(var ie=0,oe=1;!(Q.words[0]&oe)&&ie<26;++ie,oe<<=1);if(ie>0)for(Q.iushrn(ie);ie-- >0;)ae.isOdd()&&ae.iadd(se),ae.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),K.isub(ae)):(Q.isub(J),ae.isub(K))}return(Z=J.cmpn(1)===0?K:ae).cmpn(0)<0&&Z.iadd(H),Z},h.prototype.gcd=function(H){if(this.isZero())return H.abs();if(H.isZero())return this.abs();var J=this.clone(),Q=H.clone();J.negative=0,Q.negative=0;for(var Z=0;J.isEven()&&Q.isEven();Z++)J.iushrn(1),Q.iushrn(1);for(;;){for(;J.isEven();)J.iushrn(1);for(;Q.isEven();)Q.iushrn(1);var K=J.cmp(Q);if(K<0){var ae=J;J=Q,Q=ae}else if(K===0||Q.cmpn(1)===0)break;J.isub(Q)}return Q.iushln(Z)},h.prototype.invm=function(H){return this.egcd(H).a.umod(H)},h.prototype.isEven=function(){return(1&this.words[0])==0},h.prototype.isOdd=function(){return(1&this.words[0])==1},h.prototype.andln=function(H){return this.words[0]&H},h.prototype.bincn=function(H){s(typeof H=="number");var J=H%26,Q=(H-J)/26,Z=1<>>26,se&=67108863,this.words[ae]=se}return K!==0&&(this.words[ae]=K,this.length++),this},h.prototype.isZero=function(){return this.length===1&&this.words[0]===0},h.prototype.cmpn=function(H){var J,Q=H<0;if(this.negative!==0&&!Q)return-1;if(this.negative===0&&Q)return 1;if(this.strip(),this.length>1)J=1;else{Q&&(H=-H),s(H<=67108863,"Number is too big");var Z=0|this.words[0];J=Z===H?0:ZH.length)return 1;if(this.length=0;Q--){var Z=0|this.words[Q],K=0|H.words[Q];if(Z!==K){ZK&&(J=1);break}}return J},h.prototype.gtn=function(H){return this.cmpn(H)===1},h.prototype.gt=function(H){return this.cmp(H)===1},h.prototype.gten=function(H){return this.cmpn(H)>=0},h.prototype.gte=function(H){return this.cmp(H)>=0},h.prototype.ltn=function(H){return this.cmpn(H)===-1},h.prototype.lt=function(H){return this.cmp(H)===-1},h.prototype.lten=function(H){return this.cmpn(H)<=0},h.prototype.lte=function(H){return this.cmp(H)<=0},h.prototype.eqn=function(H){return this.cmpn(H)===0},h.prototype.eq=function(H){return this.cmp(H)===0},h.red=function(H){return new $(H)},h.prototype.toRed=function(H){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),H.convertTo(this)._forceRed(H)},h.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(H){return this.red=H,this},h.prototype.forceRed=function(H){return s(!this.red,"Already a number in reduction context"),this._forceRed(H)},h.prototype.redAdd=function(H){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,H)},h.prototype.redIAdd=function(H){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,H)},h.prototype.redSub=function(H){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,H)},h.prototype.redISub=function(H){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,H)},h.prototype.redShl=function(H){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,H)},h.prototype.redMul=function(H){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,H),this.red.mul(this,H)},h.prototype.redIMul=function(H){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,H),this.red.imul(this,H)},h.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(H){return s(this.red&&!H.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,H)};var E={k256:null,p224:null,p192:null,p25519:null};function I(H,J){this.name=H,this.p=new h(J,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function B(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function N(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function V(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function j(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function $(H){if(typeof H=="string"){var J=h._prime(H);this.m=J.p,this.prime=J}else s(H.gtn(1),"modulus must be greater than 1"),this.m=H,this.prime=null}function ee(H){$.call(this,H),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(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)}I.prototype._tmp=function(){var H=new h(null);return H.words=new Array(Math.ceil(this.n/13)),H},I.prototype.ireduce=function(H){var J,Q=H;do this.split(Q,this.tmp),J=(Q=(Q=this.imulK(Q)).iadd(this.tmp)).bitLength();while(J>this.n);var Z=J0?Q.isub(this.p):Q.strip!==void 0?Q.strip():Q._strip(),Q},I.prototype.split=function(H,J){H.iushrn(this.n,0,J)},I.prototype.imulK=function(H){return H.imul(this.k)},c(B,I),B.prototype.split=function(H,J){for(var Q=4194303,Z=Math.min(H.length,9),K=0;K>>22,ae=se}ae>>>=22,H.words[K-10]=ae,ae===0&&H.length>10?H.length-=10:H.length-=9},B.prototype.imulK=function(H){H.words[H.length]=0,H.words[H.length+1]=0,H.length+=2;for(var J=0,Q=0;Q>>=26,H.words[Q]=K,J=Z}return J!==0&&(H.words[H.length++]=J),H},h._prime=function(H){if(E[H])return E[H];var J;if(H==="k256")J=new B;else if(H==="p224")J=new N;else if(H==="p192")J=new V;else{if(H!=="p25519")throw new Error("Unknown prime "+H);J=new j}return E[H]=J,J},$.prototype._verify1=function(H){s(H.negative===0,"red works only with positives"),s(H.red,"red works only with red numbers")},$.prototype._verify2=function(H,J){s((H.negative|J.negative)==0,"red works only with positives"),s(H.red&&H.red===J.red,"red works only with red numbers")},$.prototype.imod=function(H){return this.prime?this.prime.ireduce(H)._forceRed(this):H.umod(this.m)._forceRed(this)},$.prototype.neg=function(H){return H.isZero()?H.clone():this.m.sub(H)._forceRed(this)},$.prototype.add=function(H,J){this._verify2(H,J);var Q=H.add(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q._forceRed(this)},$.prototype.iadd=function(H,J){this._verify2(H,J);var Q=H.iadd(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q},$.prototype.sub=function(H,J){this._verify2(H,J);var Q=H.sub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q._forceRed(this)},$.prototype.isub=function(H,J){this._verify2(H,J);var Q=H.isub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q},$.prototype.shl=function(H,J){return this._verify1(H),this.imod(H.ushln(J))},$.prototype.imul=function(H,J){return this._verify2(H,J),this.imod(H.imul(J))},$.prototype.mul=function(H,J){return this._verify2(H,J),this.imod(H.mul(J))},$.prototype.isqr=function(H){return this.imul(H,H.clone())},$.prototype.sqr=function(H){return this.mul(H,H)},$.prototype.sqrt=function(H){if(H.isZero())return H.clone();var J=this.m.andln(3);if(s(J%2==1),J===3){var Q=this.m.add(new h(1)).iushrn(2);return this.pow(H,Q)}for(var Z=this.m.subn(1),K=0;!Z.isZero()&&Z.andln(1)===0;)K++,Z.iushrn(1);s(!Z.isZero());var ae=new h(1).toRed(this),se=ae.redNeg(),he=this.m.subn(1).iushrn(1),fe=this.m.bitLength();for(fe=new h(2*fe*fe).toRed(this);this.pow(fe,he).cmp(se)!==0;)fe.redIAdd(se);for(var ie=this.pow(fe,Z),oe=this.pow(H,Z.addn(1).iushrn(1)),le=this.pow(H,Z),ge=K;le.cmp(ae)!==0;){for(var ye=le,me=0;ye.cmp(ae)!==0;me++)ye=ye.redSqr();s(me=0;Z--){for(var fe=J.words[Z],ie=he-1;ie>=0;ie--){var oe=fe>>ie&1;K!==Q[0]&&(K=this.sqr(K)),oe!==0||ae!==0?(ae<<=1,ae|=oe,(++se==4||Z===0&&ie===0)&&(K=this.mul(K,Q[ae]),se=0,ae=0)):se=0}he=26}return K},$.prototype.convertTo=function(H){var J=H.umod(this.m);return J===H?J.clone():J},$.prototype.convertFrom=function(H){var J=H.clone();return J.red=null,J},h.mont=function(H){return new ee(H)},c(ee,$),ee.prototype.convertTo=function(H){return this.imod(H.ushln(this.shift))},ee.prototype.convertFrom=function(H){var J=this.imod(H.mul(this.rinv));return J.red=null,J},ee.prototype.imul=function(H,J){if(H.isZero()||J.isZero())return H.words[0]=0,H.length=1,H;var Q=H.imul(J),Z=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),K=Q.isub(Z).iushrn(this.shift),ae=K;return K.cmp(this.m)>=0?ae=K.isub(this.m):K.cmpn(0)<0&&(ae=K.iadd(this.m)),ae._forceRed(this)},ee.prototype.mul=function(H,J){if(H.isZero()||J.isZero())return new h(0)._forceRed(this);var Q=H.mul(J),Z=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),K=Q.isub(Z).iushrn(this.shift),ae=K;return K.cmp(this.m)>=0?ae=K.isub(this.m):K.cmpn(0)<0&&(ae=K.iadd(this.m)),ae._forceRed(this)},ee.prototype.invm=function(H){return this.imod(H._invmp(this.m).mul(this.r2))._forceRed(this)}})(u=n.nmd(u),this)},6204:function(u){u.exports=function(r){var n,l,o,s=r.length,c=0;for(n=0;n>>1;if(!(M<=0)){var f,E=o.mallocDouble(2*M*T),I=o.mallocInt32(T);if((T=x(k,M,E,I))>0){if(M===1&&S)s.init(T),f=s.sweepComplete(M,v,0,T,E,I,0,T,E,I);else{var B=o.mallocDouble(2*M*p),N=o.mallocInt32(p);(p=x(A,M,B,N))>0&&(s.init(T+p),f=M===1?s.sweepBipartite(M,v,0,T,E,I,0,p,B,N):c(M,v,S,T,E,I,p,B,N),o.free(B),o.free(N))}o.free(E),o.free(I)}return f}}}function g(k,A){l.push([k,A])}},2455:function(u,r){function n(l){return l?function(o,s,c,h,x,m,g,k,A,v,S){return x-h>A-k?function(T,p,M,f,E,I,B,N,V,j,$){for(var ee=2*T,H=f,J=ee*f;Hv-A?h?function(p,M,f,E,I,B,N,V,j,$,ee){for(var H=2*p,J=E,Q=H*E;J0;){var ge=(oe-=1)*I,ye=N[ge],me=N[ge+1],be=N[ge+2],Se=N[ge+3],Ee=N[ge+4],Ce=N[ge+5],Le=oe*B,Oe=V[Le],We=V[Le+1],Ie=1&Ce,Ve=!!(16&Ce),Pe=K,de=ae,Me=he,ke=fe;if(Ie&&(Pe=he,de=fe,Me=K,ke=ae),!(2&Ce&&me>=(be=p(H,ye,me,be,Pe,de,We))||4&Ce&&(me=M(H,ye,me,be,Pe,de,Oe))>=be)){var He=be-me,Fe=Ee-Se;if(Ve){if(H*He*(He+Fe)=p0)&&!(p1>=hi)"),T=g("lo===p0"),p=g("lo>>1,T=2*c,p=S,M=g[T*S+h];A=N?(p=B,M=N):I>=j?(p=E,M=I):(p=V,M=j):N>=j?(p=B,M=N):j>=I?(p=E,M=I):(p=V,M=j);for(var $=T*(v-1),ee=T*p,H=0;Hx&&g[M+h]>T;--p,M-=A){for(var f=M,E=M+A,I=0;IS;++S,g+=m)if(c[g+v]===x)if(A===S)A+=1,k+=m;else{for(var T=0;m>T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"loS;++S,g+=m)if(c[g+v]T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"lo<=p0":function(n,l,o,s,c,h,x){for(var m=2*n,g=m*o,k=g,A=o,v=n+l,S=o;s>S;++S,g+=m)if(c[g+v]<=x)if(A===S)A+=1,k+=m;else{for(var T=0;m>T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"hi<=p0":function(n,l,o,s,c,h,x){for(var m=2*n,g=m*o,k=g,A=o,v=n+l,S=o;s>S;++S,g+=m)if(c[g+v]<=x)if(A===S)A+=1,k+=m;else{for(var T=0;m>T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"loT;++T,g+=m){var p=c[g+v],M=c[g+S];if(pf;++f){var E=c[g+f];c[g+f]=c[k],c[k++]=E}var I=h[T];h[T]=h[A],h[A++]=I}}return A},"lo<=p0&&p0<=hi":function(n,l,o,s,c,h,x){for(var m=2*n,g=m*o,k=g,A=o,v=l,S=n+l,T=o;s>T;++T,g+=m){var p=c[g+v],M=c[g+S];if(p<=x&&x<=M)if(A===T)A+=1,k+=m;else{for(var f=0;m>f;++f){var E=c[g+f];c[g+f]=c[k],c[k++]=E}var I=h[T];h[T]=h[A],h[A++]=I}}return A},"!(lo>=p0)&&!(p1>=hi)":function(n,l,o,s,c,h,x,m){for(var g=2*n,k=g*o,A=k,v=o,S=l,T=n+l,p=o;s>p;++p,k+=g){var M=c[k+S],f=c[k+T];if(!(M>=x||m>=f))if(v===p)v+=1,A+=g;else{for(var E=0;g>E;++E){var I=c[k+E];c[k+E]=c[A],c[A++]=I}var B=h[p];h[p]=h[v],h[v++]=B}}return v}}},1811:function(u){u.exports=function(g,k){k<=4*r?n(0,k-1,g):m(0,k-1,g)};var r=32;function n(g,k,A){for(var v=2*(g+1),S=g+1;S<=k;++S){for(var T=A[v++],p=A[v++],M=S,f=v-2;M-- >g;){var E=A[f-2],I=A[f-1];if(EA[k+1])}function x(g,k,A,v){var S=v[g*=2];return S>1,M=p-v,f=p+v,E=S,I=M,B=p,N=f,V=T,j=g+1,$=k-1,ee=0;h(E,I,A)&&(ee=E,E=I,I=ee),h(N,V,A)&&(ee=N,N=V,V=ee),h(E,B,A)&&(ee=E,E=B,B=ee),h(I,B,A)&&(ee=I,I=B,B=ee),h(E,N,A)&&(ee=E,E=N,N=ee),h(B,N,A)&&(ee=B,B=N,N=ee),h(I,V,A)&&(ee=I,I=V,V=ee),h(I,B,A)&&(ee=I,I=B,B=ee),h(N,V,A)&&(ee=N,N=V,V=ee);for(var H=A[2*I],J=A[2*I+1],Q=A[2*N],Z=A[2*N+1],K=2*E,ae=2*B,se=2*V,he=2*S,fe=2*p,ie=2*T,oe=0;oe<2;++oe){var le=A[K+oe],ge=A[ae+oe],ye=A[se+oe];A[he+oe]=le,A[fe+oe]=ge,A[ie+oe]=ye}o(M,g,A),o(f,k,A);for(var me=j;me<=$;++me)if(x(me,H,J,A))me!==j&&l(me,j,A),++j;else if(!x(me,Q,Z,A))for(;;){if(x($,Q,Z,A)){x($,H,J,A)?(s(me,j,$,A),++j,--$):(l(me,$,A),--$);break}if(--$>>1;s(S,fe);var ie=0,oe=0;for(K=0;K=c)T(g,k,oe--,le=le-c|0);else if(le>=0)T(x,m,ie--,le);else if(le<=-c){le=-le-c|0;for(var ge=0;ge>>1;s(S,fe);var ie=0,oe=0,le=0;for(K=0;K>1==S[2*K+3]>>1&&(ye=2,K+=1),ge<0){for(var me=-(ge>>1)-1,be=0;be>1)-1,ye===0?T(x,m,ie--,me):ye===1?T(g,k,oe--,me):ye===2&&T(A,v,le--,me)}},scanBipartite:function(M,f,E,I,B,N,V,j,$,ee,H,J){var Q=0,Z=2*M,K=f,ae=f+M,se=1,he=1;I?he=c:se=c;for(var fe=B;fe>>1;s(S,ge);var ye=0;for(fe=0;fe=c?(be=!I,ie-=c):(be=!!I,ie-=1),be)p(x,m,ye++,ie);else{var Se=J[ie],Ee=Z*ie,Ce=H[Ee+f+1],Le=H[Ee+f+1+M];e:for(var Oe=0;Oe>>1;s(S,ie);var oe=0;for(ae=0;ae=c)x[oe++]=se-c;else{var ge=H[se-=1],ye=Q*se,me=ee[ye+f+1],be=ee[ye+f+1+M];e:for(var Se=0;Se=0;--Se)if(x[Se]===se){for(Oe=Se+1;Oe0;){for(var p=h.pop(),M=(v=-1,S=-1,k=m[g=h.pop()],1);M=0||(c.flip(g,p),o(s,c,h,v,g,S),o(s,c,h,g,S,v),o(s,c,h,S,p,v),o(s,c,h,p,v,S))}}},5023:function(u,r,n){var l,o=n(2478);function s(h,x,m,g,k,A,v){this.cells=h,this.neighbor=x,this.flags=g,this.constraint=m,this.active=k,this.next=A,this.boundary=v}function c(h,x){return h[0]-x[0]||h[1]-x[1]||h[2]-x[2]}u.exports=function(h,x,m){var g=function(V,j){for(var $=V.cells(),ee=$.length,H=0;H0||v.length>0;){for(;A.length>0;){var f=A.pop();if(S[f]!==-k){S[f]=k,T[f];for(var E=0;E<3;++E){var I=M[3*f+E];I>=0&&S[I]===0&&(p[3*f+E]?v.push(I):(A.push(I),S[I]=k))}}}var B=v;v=A,A=B,v.length=0,k=-k}var N=function(V,j,$){for(var ee=0,H=0;H1&&o(T[N[V-2]],T[N[V-1]],p)>0;)v.push([N[V-1],N[V-2],M]),V-=1;N.length=V,N.push(M);var j=B.upperIds;for(V=j.length;V>1&&o(T[j[V-2]],T[j[V-1]],p)<0;)v.push([j[V-2],j[V-1],M]),V-=1;j.length=V,j.push(M)}}function g(v,S){var T;return(T=v.a[0]B[0]&&M.push(new c(B,I,2,f),new c(I,B,1,f))}M.sort(h);for(var N=M[0].a[0]-(1+Math.abs(M[0].a[0]))*Math.pow(2,-52),V=[new s([N,1],[N,0],-1,[],[])],j=[],$=(f=0,M.length);f<$;++f){var ee=M[f],H=ee.type;H===0?m(j,V,v,ee.a,ee.idx):H===2?k(V,0,ee):A(V,0,ee)}return j}},5542:function(u,r,n){var l=n(2478);function o(h,x){this.stars=h,this.edges=x}u.exports=function(h,x){for(var m=new Array(h),g=0;g=0}}(),s.removeTriangle=function(h,x,m){var g=this.stars;c(g[h],x,m),c(g[x],m,h),c(g[m],h,x)},s.addTriangle=function(h,x,m){var g=this.stars;g[h].push(x,m),g[x].push(m,h),g[m].push(h,x)},s.opposite=function(h,x){for(var m=this.stars[x],g=1,k=m.length;gI[2]?1:0)}function M(E,I,B){if(E.length!==0){if(I)for(var N=0;N=0;--ae){var me=J[se=(Ie=Z[ae])[0]],be=me[0],Se=me[1],Ee=H[be],Ce=H[Se];if((Ee[0]-Ce[0]||Ee[1]-Ce[1])<0){var Le=be;be=Se,Se=Le}me[0]=be;var Oe,We=me[1]=Ie[1];for(K&&(Oe=me[2]);ae>0&&Z[ae-1][0]===se;){var Ie,Ve=(Ie=Z[--ae])[1];K?J.push([We,Ve,Oe]):J.push([We,Ve]),We=Ve}K?J.push([We,Se,Oe]):J.push([We,Se])}return he}(E,I,V,j,B),ee=S(E,$);return M(I,ee,B),!!ee||V.length>0||j.length>0}},3637:function(u,r,n){u.exports=function(k,A,v,S){var T=h(A,k),p=h(S,v),M=g(T,p);if(c(M)===0)return null;var f=g(p,h(k,v)),E=o(f,M),I=m(T,E);return x(k,I)};var l=n(6504),o=n(8697),s=n(5572),c=n(7721),h=n(544),x=n(2653),m=n(8987);function g(k,A){return s(l(k[0],A[1]),l(k[1],A[0]))}},3642:function(u){u.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(u,r,n){var l=n(3642),o=n(395);function s(x){return[x[0]/255,x[1]/255,x[2]/255,x[3]]}function c(x){for(var m,g="#",k=0;k<3;++k)g+=("00"+(m=(m=x[k]).toString(16))).substr(m.length);return g}function h(x){return"rgba("+x.join(",")+")"}u.exports=function(x){var m,g,k,A,v,S,T,p,M,f;if(x||(x={}),p=(x.nshades||72)-1,T=x.format||"hex",(S=x.colormap)||(S="jet"),typeof S=="string"){if(S=S.toLowerCase(),!l[S])throw Error(S+" not a supported colorscale");v=l[S]}else{if(!Array.isArray(S))throw Error("unsupported colormap option",S);v=S.slice()}if(v.length>p+1)throw new Error(S+" map requires nshades to be at least size "+v.length);M=Array.isArray(x.alpha)?x.alpha.length!==2?[1,1]:x.alpha.slice():typeof x.alpha=="number"?[x.alpha,x.alpha]:[1,1],m=v.map(function(V){return Math.round(V.index*p)}),M[0]=Math.min(Math.max(M[0],0),1),M[1]=Math.min(Math.max(M[1],0),1);var E=v.map(function(V,j){var $=v[j].index,ee=v[j].rgb.slice();return ee.length===4&&ee[3]>=0&&ee[3]<=1||(ee[3]=M[0]+(M[1]-M[0])*$),ee}),I=[];for(f=0;f0||x(m,g,A)?-1:1:S===0?T>0||x(m,g,k)?1:-1:o(T-S)}var M=l(m,g,k);return M>0?v>0&&l(m,g,A)>0?1:-1:M<0?v>0||l(m,g,A)>0?1:-1:l(m,g,A)>0||x(m,g,k)?1:-1};var l=n(3250),o=n(8572),s=n(9362),c=n(5382),h=n(8210);function x(m,g,k){var A=s(m[0],-g[0]),v=s(m[1],-g[1]),S=s(k[0],-g[0]),T=s(k[1],-g[1]),p=h(c(A,S),c(v,T));return p[p.length-1]>=0}},8572:function(u){u.exports=function(r){return r<0?-1:r>0?1:0}},8507:function(u){u.exports=function(l,o){var s=l.length,c=l.length-o.length;if(c)return c;switch(s){case 0:return 0;case 1:return l[0]-o[0];case 2:return l[0]+l[1]-o[0]-o[1]||r(l[0],l[1])-r(o[0],o[1]);case 3:var h=l[0]+l[1],x=o[0]+o[1];if(c=h+l[2]-(x+o[2]))return c;var m=r(l[0],l[1]),g=r(o[0],o[1]);return r(m,l[2])-r(g,o[2])||r(m+l[2],h)-r(g+o[2],x);case 4:var k=l[0],A=l[1],v=l[2],S=l[3],T=o[0],p=o[1],M=o[2],f=o[3];return k+A+v+S-(T+p+M+f)||r(k,A,v,S)-r(T,p,M,f,T)||r(k+A,k+v,k+S,A+v,A+S,v+S)-r(T+p,T+M,T+f,p+M,p+f,M+f)||r(k+A+v,k+A+S,k+v+S,A+v+S)-r(T+p+M,T+p+f,T+M+f,p+M+f);default:for(var E=l.slice().sort(n),I=o.slice().sort(n),B=0;Br[l][0]&&(l=o);return nl?[[l],[n]]:[[n]]}},4750:function(u,r,n){u.exports=function(o){var s=l(o),c=s.length;if(c<=2)return[];for(var h=new Array(c),x=s[c-1],m=0;m=k[f]&&(M+=1);T[p]=M}}return g}(l(x,!0),h)}};var l=n(8954),o=n(3952)},4769:function(u){u.exports=function(r,n,l,o,s,c){var h=s-1,x=s*s,m=h*h,g=(1+2*s)*m,k=s*m,A=x*(3-2*s),v=x*h;if(r.length){c||(c=new Array(r.length));for(var S=r.length-1;S>=0;--S)c[S]=g*r[S]+k*n[S]+A*l[S]+v*o[S];return c}return g*r+k*n+A*l+v*o},u.exports.derivative=function(r,n,l,o,s,c){var h=6*s*s-6*s,x=3*s*s-4*s+1,m=-6*s*s+6*s,g=3*s*s-2*s;if(r.length){c||(c=new Array(r.length));for(var k=r.length-1;k>=0;--k)c[k]=h*r[k]+x*n[k]+m*l[k]+g*o[k];return c}return h*r+x*n+m*l[k]+g*o}},7642:function(u,r,n){var l=n(8954),o=n(1682);function s(h,x){this.point=h,this.index=x}function c(h,x){for(var m=h.point,g=x.point,k=m.length,A=0;A=2)return!1;$[H]=J}return!0}):j.filter(function($){for(var ee=0;ee<=g;++ee){var H=I[$[ee]];if(H<0)return!1;$[ee]=H}return!0}),1&g)for(v=0;v>>31},u.exports.exponent=function(s){return(u.exports.hi(s)<<1>>>21)-1023},u.exports.fraction=function(s){var c=u.exports.lo(s),h=u.exports.hi(s),x=1048575&h;return 2146435072&h&&(x+=1048576),[c,x]},u.exports.denormalized=function(s){return!(2146435072&u.exports.hi(s))}},1338:function(u){function r(n,l,o){var s=0|n[o];if(s<=0)return[];var c,h=new Array(s);if(o===n.length-1)for(c=0;c0)return function(o,s){var c,h;for(c=new Array(o),h=0;h=k-1){f=S.length-1;var I=m-g[k-1];for(E=0;E=k-1)for(var M=S.length-1,f=(g[k-1],0);f=0;--k)if(m[--g])return!1;return!0},h.jump=function(m){var g=this.lastT(),k=this.dimension;if(!(m0;--E)A.push(s(p[E-1],M[E-1],arguments[E])),v.push(0)}},h.push=function(m){var g=this.lastT(),k=this.dimension;if(!(m1e-6?1/T:0;this._time.push(m);for(var I=k;I>0;--I){var B=s(M[I-1],f[I-1],arguments[I]);A.push(B),v.push((B-A[S++])*E)}}},h.set=function(m){var g=this.dimension;if(!(m0;--p)k.push(s(S[p-1],T[p-1],arguments[p])),A.push(0)}},h.move=function(m){var g=this.lastT(),k=this.dimension;if(!(m<=g||arguments.length!==k+1)){var A=this._state,v=this._velocity,S=A.length-this.dimension,T=this.bounds,p=T[0],M=T[1],f=m-g,E=f>1e-6?1/f:0;this._time.push(m);for(var I=k;I>0;--I){var B=arguments[I];A.push(s(p[I-1],M[I-1],A[S++]+B)),v.push(B*E)}}},h.idle=function(m){var g=this.lastT();if(!(m=0;--E)A.push(s(p[E],M[E],A[S]+f*v[S])),v.push(0),S+=1}}},3840:function(u){function r(S,T,p,M,f,E){this._color=S,this.key=T,this.value=p,this.left=M,this.right=f,this._count=E}function n(S){return new r(S._color,S.key,S.value,S.left,S.right,S._count)}function l(S,T){return new r(S,T.key,T.value,T.left,T.right,T._count)}function o(S){S._count=1+(S.left?S.left._count:0)+(S.right?S.right._count:0)}function s(S,T){this._compare=S,this.root=T}u.exports=function(S){return new s(S||v,null)};var c=s.prototype;function h(S,T){var p;return T.left&&(p=h(S,T.left))?p:(p=S(T.key,T.value))||(T.right?h(S,T.right):void 0)}function x(S,T,p,M){if(T(S,M.key)<=0){var f;if(M.left&&(f=x(S,T,p,M.left))||(f=p(M.key,M.value)))return f}if(M.right)return x(S,T,p,M.right)}function m(S,T,p,M,f){var E,I=p(S,f.key),B=p(T,f.key);if(I<=0&&(f.left&&(E=m(S,T,p,M,f.left))||B>0&&(E=M(f.key,f.value))))return E;if(B>0&&f.right)return m(S,T,p,M,f.right)}function g(S,T){this.tree=S,this._stack=T}Object.defineProperty(c,"keys",{get:function(){var S=[];return this.forEach(function(T,p){S.push(T)}),S}}),Object.defineProperty(c,"values",{get:function(){var S=[];return this.forEach(function(T,p){S.push(p)}),S}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(S,T){for(var p=this._compare,M=this.root,f=[],E=[];M;){var I=p(S,M.key);f.push(M),E.push(I),M=I<=0?M.left:M.right}f.push(new r(0,S,T,null,null,1));for(var B=f.length-2;B>=0;--B)M=f[B],E[B]<=0?f[B]=new r(M._color,M.key,M.value,f[B+1],M.right,M._count+1):f[B]=new r(M._color,M.key,M.value,M.left,f[B+1],M._count+1);for(B=f.length-1;B>1;--B){var N=f[B-1];if(M=f[B],N._color===1||M._color===1)break;var V=f[B-2];if(V.left===N)if(N.left===M){if(!(j=V.right)||j._color!==0){V._color=0,V.left=N.right,N._color=1,N.right=V,f[B-2]=N,f[B-1]=M,o(V),o(N),B>=3&&(($=f[B-3]).left===V?$.left=N:$.right=N);break}N._color=1,V.right=l(1,j),V._color=0,B-=1}else{if(!(j=V.right)||j._color!==0){N.right=M.left,V._color=0,V.left=M.right,M._color=1,M.left=N,M.right=V,f[B-2]=M,f[B-1]=N,o(V),o(N),o(M),B>=3&&(($=f[B-3]).left===V?$.left=M:$.right=M);break}N._color=1,V.right=l(1,j),V._color=0,B-=1}else if(N.right===M){if(!(j=V.left)||j._color!==0){V._color=0,V.right=N.left,N._color=1,N.left=V,f[B-2]=N,f[B-1]=M,o(V),o(N),B>=3&&(($=f[B-3]).right===V?$.right=N:$.left=N);break}N._color=1,V.left=l(1,j),V._color=0,B-=1}else{var j;if(!(j=V.left)||j._color!==0){var $;N.left=M.right,V._color=0,V.right=M.left,M._color=1,M.right=N,M.left=V,f[B-2]=M,f[B-1]=N,o(V),o(N),o(M),B>=3&&(($=f[B-3]).right===V?$.right=M:$.left=M);break}N._color=1,V.left=l(1,j),V._color=0,B-=1}}return f[0]._color=1,new s(p,f[0])},c.forEach=function(S,T,p){if(this.root)switch(arguments.length){case 1:return h(S,this.root);case 2:return x(T,this._compare,S,this.root);case 3:return this._compare(T,p)>=0?void 0:m(T,p,this._compare,S,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var S=[],T=this.root;T;)S.push(T),T=T.left;return new g(this,S)}}),Object.defineProperty(c,"end",{get:function(){for(var S=[],T=this.root;T;)S.push(T),T=T.right;return new g(this,S)}}),c.at=function(S){if(S<0)return new g(this,[]);for(var T=this.root,p=[];;){if(p.push(T),T.left){if(S=T.right._count)break;T=T.right}return new g(this,[])},c.ge=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E<=0&&(f=M.length),p=E<=0?p.left:p.right}return M.length=f,new g(this,M)},c.gt=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E<0&&(f=M.length),p=E<0?p.left:p.right}return M.length=f,new g(this,M)},c.lt=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E>0&&(f=M.length),p=E<=0?p.left:p.right}return M.length=f,new g(this,M)},c.le=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E>=0&&(f=M.length),p=E<0?p.left:p.right}return M.length=f,new g(this,M)},c.find=function(S){for(var T=this._compare,p=this.root,M=[];p;){var f=T(S,p.key);if(M.push(p),f===0)return new g(this,M);p=f<=0?p.left:p.right}return new g(this,[])},c.remove=function(S){var T=this.find(S);return T?T.remove():this},c.get=function(S){for(var T=this._compare,p=this.root;p;){var M=T(S,p.key);if(M===0)return p.value;p=M<=0?p.left:p.right}};var k=g.prototype;function A(S,T){S.key=T.key,S.value=T.value,S.left=T.left,S.right=T.right,S._color=T._color,S._count=T._count}function v(S,T){return ST?1:0}Object.defineProperty(k,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(k,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),k.clone=function(){return new g(this.tree,this._stack.slice())},k.remove=function(){var S=this._stack;if(S.length===0)return this.tree;var T=new Array(S.length),p=S[S.length-1];T[T.length-1]=new r(p._color,p.key,p.value,p.left,p.right,p._count);for(var M=S.length-2;M>=0;--M)(p=S[M]).left===S[M+1]?T[M]=new r(p._color,p.key,p.value,T[M+1],p.right,p._count):T[M]=new r(p._color,p.key,p.value,p.left,T[M+1],p._count);if((p=T[T.length-1]).left&&p.right){var f=T.length;for(p=p.left;p.right;)T.push(p),p=p.right;var E=T[f-1];for(T.push(new r(p._color,E.key,E.value,p.left,p.right,p._count)),T[f-1].key=p.key,T[f-1].value=p.value,M=T.length-2;M>=f;--M)p=T[M],T[M]=new r(p._color,p.key,p.value,p.left,T[M+1],p._count);T[f-1].left=T[f]}if((p=T[T.length-1])._color===0){var I=T[T.length-2];for(I.left===p?I.left=null:I.right===p&&(I.right=null),T.pop(),M=0;M=0;--H){if(V=N[H],H===0)return void(V._color=1);if((j=N[H-1]).left===V){if(($=j.right).right&&$.right._color===0)return ee=($=j.right=n($)).right=n($.right),j.right=$.left,$.left=j,$.right=ee,$._color=j._color,V._color=1,j._color=1,ee._color=1,o(j),o($),H>1&&((J=N[H-2]).left===j?J.left=$:J.right=$),void(N[H-1]=$);if($.left&&$.left._color===0)return ee=($=j.right=n($)).left=n($.left),j.right=ee.left,$.left=ee.right,ee.left=j,ee.right=$,ee._color=j._color,j._color=1,$._color=1,V._color=1,o(j),o($),o(ee),H>1&&((J=N[H-2]).left===j?J.left=ee:J.right=ee),void(N[H-1]=ee);if($._color===1){if(j._color===0)return j._color=1,void(j.right=l(0,$));j.right=l(0,$);continue}$=n($),j.right=$.left,$.left=j,$._color=j._color,j._color=0,o(j),o($),H>1&&((J=N[H-2]).left===j?J.left=$:J.right=$),N[H-1]=$,N[H]=j,H+11&&((J=N[H-2]).right===j?J.right=$:J.left=$),void(N[H-1]=$);if($.right&&$.right._color===0)return ee=($=j.left=n($)).right=n($.right),j.left=ee.right,$.right=ee.left,ee.right=j,ee.left=$,ee._color=j._color,j._color=1,$._color=1,V._color=1,o(j),o($),o(ee),H>1&&((J=N[H-2]).right===j?J.right=ee:J.left=ee),void(N[H-1]=ee);if($._color===1){if(j._color===0)return j._color=1,void(j.left=l(0,$));j.left=l(0,$);continue}var J;$=n($),j.left=$.right,$.right=j,$._color=j._color,j._color=0,o(j),o($),H>1&&((J=N[H-2]).right===j?J.right=$:J.left=$),N[H-1]=$,N[H]=j,H+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(k,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(k,"index",{get:function(){var S=0,T=this._stack;if(T.length===0){var p=this.tree.root;return p?p._count:0}T[T.length-1].left&&(S=T[T.length-1].left._count);for(var M=T.length-2;M>=0;--M)T[M+1]===T[M].right&&(++S,T[M].left&&(S+=T[M].left._count));return S},enumerable:!0}),k.next=function(){var S=this._stack;if(S.length!==0){var T=S[S.length-1];if(T.right)for(T=T.right;T;)S.push(T),T=T.left;else for(S.pop();S.length>0&&S[S.length-1].right===T;)T=S[S.length-1],S.pop()}},Object.defineProperty(k,"hasNext",{get:function(){var S=this._stack;if(S.length===0)return!1;if(S[S.length-1].right)return!0;for(var T=S.length-1;T>0;--T)if(S[T-1].left===S[T])return!0;return!1}}),k.update=function(S){var T=this._stack;if(T.length===0)throw new Error("Can't update empty node!");var p=new Array(T.length),M=T[T.length-1];p[p.length-1]=new r(M._color,M.key,S,M.left,M.right,M._count);for(var f=T.length-2;f>=0;--f)(M=T[f]).left===T[f+1]?p[f]=new r(M._color,M.key,M.value,p[f+1],M.right,M._count):p[f]=new r(M._color,M.key,M.value,M.left,p[f+1],M._count);return new s(this.tree._compare,p[0])},k.prev=function(){var S=this._stack;if(S.length!==0){var T=S[S.length-1];if(T.left)for(T=T.left;T;)S.push(T),T=T.right;else for(S.pop();S.length>0&&S[S.length-1].left===T;)T=S[S.length-1],S.pop()}},Object.defineProperty(k,"hasPrev",{get:function(){var S=this._stack;if(S.length===0)return!1;if(S[S.length-1].left)return!0;for(var T=S.length-1;T>0;--T)if(S[T-1].right===S[T])return!0;return!1}})},3837:function(u,r,n){u.exports=function(V,j){var $=new v(V);return $.update(j),$};var l=n(4935),o=n(501),s=n(5304),c=n(6429),h=n(6444),x=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),m=ArrayBuffer,g=DataView;function k(V){return Array.isArray(V)||function(j){return m.isView(j)&&!(j instanceof g)}(V)}function A(V,j){return V[0]=j[0],V[1]=j[1],V[2]=j[2],V}function v(V){this.gl=V,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=s(V)}var S=v.prototype;function T(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}S.update=function(V){function j(le,ge,ye){if(ye in V){var me,be=V[ye],Se=this[ye];(le?k(be)&&k(be[0]):k(be))?this[ye]=me=[ge(be[0]),ge(be[1]),ge(be[2])]:this[ye]=me=[ge(be),ge(be),ge(be)];for(var Ee=0;Ee<3;++Ee)if(me[Ee]!==Se[Ee])return!0}return!1}V=V||{};var $,ee=j.bind(this,!1,Number),H=j.bind(this,!1,Boolean),J=j.bind(this,!1,String),Q=j.bind(this,!0,function(le){if(k(le)){if(le.length===3)return[+le[0],+le[1],+le[2],1];if(le.length===4)return[+le[0],+le[1],+le[2],+le[3]]}return[0,0,0,1]}),Z=!1,K=!1;if("bounds"in V)for(var ae=V.bounds,se=0;se<2;++se)for(var he=0;he<3;++he)ae[se][he]!==this.bounds[se][he]&&(K=!0),this.bounds[se][he]=ae[se][he];if("ticks"in V)for($=V.ticks,Z=!0,this.autoTicks=!1,se=0;se<3;++se)this.tickSpacing[se]=0;else ee("tickSpacing")&&(this.autoTicks=!0,K=!0);if(this._firstInit&&("ticks"in V||"tickSpacing"in V||(this.autoTicks=!0),K=!0,Z=!0,this._firstInit=!1),K&&this.autoTicks&&($=h.create(this.bounds,this.tickSpacing),Z=!0),Z){for(se=0;se<3;++se)$[se].sort(function(le,ge){return le.x-ge.x});h.equal($,this.ticks)?Z=!1:this.ticks=$}H("tickEnable"),J("tickFont")&&(Z=!0),J("tickFontStyle")&&(Z=!0),J("tickFontWeight")&&(Z=!0),J("tickFontVariant")&&(Z=!0),ee("tickSize"),ee("tickAngle"),ee("tickPad"),Q("tickColor");var fe=J("labels");J("labelFont")&&(fe=!0),J("labelFontStyle")&&(fe=!0),J("labelFontWeight")&&(fe=!0),J("labelFontVariant")&&(fe=!0),H("labelEnable"),ee("labelSize"),ee("labelPad"),Q("labelColor"),H("lineEnable"),H("lineMirror"),ee("lineWidth"),Q("lineColor"),H("lineTickEnable"),H("lineTickMirror"),ee("lineTickLength"),ee("lineTickWidth"),Q("lineTickColor"),H("gridEnable"),ee("gridWidth"),Q("gridColor"),H("zeroEnable"),Q("zeroLineColor"),ee("zeroLineWidth"),H("backgroundEnable"),Q("backgroundColor");var ie=[{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]}],oe=[{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&&(fe||Z)&&this._text.update(this.bounds,this.labels,ie,this.ticks,oe):this._text=l(this.gl,this.bounds,this.labels,ie,this.ticks,oe),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=o(this.gl,this.bounds,this.ticks))};var p=[new T,new T,new T];function M(V,j,$,ee,H){for(var J=V.primalOffset,Q=V.primalMinor,Z=V.mirrorOffset,K=V.mirrorMinor,ae=ee[j],se=0;se<3;++se)if(j!==se){var he=J,fe=Z,ie=Q,oe=K;ae&1<0?(ie[se]=-1,oe[se]=0):(ie[se]=0,oe[se]=1)}}var f=[0,0,0],E={model:x,view:x,projection:x,_ortho:!1};S.isOpaque=function(){return!0},S.isTransparent=function(){return!1},S.drawTransparent=function(V){};var I=[0,0,0],B=[0,0,0],N=[0,0,0];S.draw=function(V){V=V||E;for(var j=this.gl,$=V.model||x,ee=V.view||x,H=V.projection||x,J=this.bounds,Q=V._ortho||!1,Z=c($,ee,H,J,Q),K=Z.cubeEdges,ae=Z.axis,se=ee[12],he=ee[13],fe=ee[14],ie=ee[15],oe=(Q?2:1)*this.pixelRatio*(H[3]*se+H[7]*he+H[11]*fe+H[15]*ie)/j.drawingBufferHeight,le=0;le<3;++le)this.lastCubeProps.cubeEdges[le]=K[le],this.lastCubeProps.axis[le]=ae[le];var ge=p;for(le=0;le<3;++le)M(p[le],le,this.bounds,K,ae);j=this.gl;var ye,me,be,Se=f;for(le=0;le<3;++le)this.backgroundEnable[le]?Se[le]=ae[le]:Se[le]=0;for(this._background.draw($,ee,H,J,Se,this.backgroundColor),this._lines.bind($,ee,H,this),le=0;le<3;++le){var Ee=[0,0,0];ae[le]>0?Ee[le]=J[1][le]:Ee[le]=J[0][le];for(var Ce=0;Ce<2;++Ce){var Le=(le+1+Ce)%3,Oe=(le+1+(1^Ce))%3;this.gridEnable[Le]&&this._lines.drawGrid(Le,Oe,this.bounds,Ee,this.gridColor[Le],this.gridWidth[Le]*this.pixelRatio)}for(Ce=0;Ce<2;++Ce)Le=(le+1+Ce)%3,Oe=(le+1+(1^Ce))%3,this.zeroEnable[Oe]&&Math.min(J[0][Oe],J[1][Oe])<=0&&Math.max(J[0][Oe],J[1][Oe])>=0&&this._lines.drawZero(Le,Oe,this.bounds,Ee,this.zeroLineColor[Oe],this.zeroLineWidth[Oe]*this.pixelRatio)}for(le=0;le<3;++le){this.lineEnable[le]&&this._lines.drawAxisLine(le,this.bounds,ge[le].primalOffset,this.lineColor[le],this.lineWidth[le]*this.pixelRatio),this.lineMirror[le]&&this._lines.drawAxisLine(le,this.bounds,ge[le].mirrorOffset,this.lineColor[le],this.lineWidth[le]*this.pixelRatio);var We=A(I,ge[le].primalMinor),Ie=A(B,ge[le].mirrorMinor),Ve=this.lineTickLength;for(Ce=0;Ce<3;++Ce){var Pe=oe/$[5*Ce];We[Ce]*=Ve[Ce]*Pe,Ie[Ce]*=Ve[Ce]*Pe}this.lineTickEnable[le]&&this._lines.drawAxisTicks(le,ge[le].primalOffset,We,this.lineTickColor[le],this.lineTickWidth[le]*this.pixelRatio),this.lineTickMirror[le]&&this._lines.drawAxisTicks(le,ge[le].mirrorOffset,Ie,this.lineTickColor[le],this.lineTickWidth[le]*this.pixelRatio)}function de($e){(be=[0,0,0])[$e]=1}function Me($e,Ye,_e){var De=($e+1)%3,Be=($e+2)%3,Ge=Ye[De],tt=Ye[Be],nt=_e[De],pt=_e[Be];Ge>0&&pt>0||Ge>0&&pt<0||Ge<0&&pt>0||Ge<0&&pt<0?de(De):(tt>0&&nt>0||tt>0&&nt<0||tt<0&&nt>0||tt<0&&nt<0)&&de(Be)}for(this._lines.unbind(),this._text.bind($,ee,H,this.pixelRatio),le=0;le<3;++le){var ke=ge[le].primalMinor,He=ge[le].mirrorMinor,Fe=A(N,ge[le].primalOffset);for(Ce=0;Ce<3;++Ce)this.lineTickEnable[le]&&(Fe[Ce]+=oe*ke[Ce]*Math.max(this.lineTickLength[Ce],0)/$[5*Ce]);var qe=[0,0,0];if(qe[le]=1,this.tickEnable[le]){for(this.tickAngle[le]===-3600?(this.tickAngle[le]=0,this.tickAlign[le]="auto"):this.tickAlign[le]=-1,me=1,(ye=[this.tickAlign[le],.5,me])[0]==="auto"?ye[0]=0:ye[0]=parseInt(""+ye[0]),be=[0,0,0],Me(le,ke,He),Ce=0;Ce<3;++Ce)Fe[Ce]+=oe*ke[Ce]*this.tickPad[Ce]/$[5*Ce];this._text.drawTicks(le,this.tickSize[le],this.tickAngle[le],Fe,this.tickColor[le],qe,be,ye)}if(this.labelEnable[le]){for(me=0,be=[0,0,0],this.labels[le].length>4&&(de(le),me=1),(ye=[this.labelAlign[le],.5,me])[0]==="auto"?ye[0]=0:ye[0]=parseInt(""+ye[0]),Ce=0;Ce<3;++Ce)Fe[Ce]+=oe*ke[Ce]*this.labelPad[Ce]/$[5*Ce];Fe[le]+=.5*(J[0][le]+J[1][le]),this._text.drawLabel(le,this.labelSize[le],this.labelAngle[le],Fe,this.labelColor[le],[0,0,0],be,ye)}}this._text.unbind()},S.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(u,r,n){u.exports=function(x){for(var m=[],g=[],k=0,A=0;A<3;++A)for(var v=(A+1)%3,S=(A+2)%3,T=[0,0,0],p=[0,0,0],M=-1;M<=1;M+=2){g.push(k,k+2,k+1,k+1,k+2,k+3),T[A]=M,p[A]=M;for(var f=-1;f<=1;f+=2){T[v]=f;for(var E=-1;E<=1;E+=2)T[S]=E,m.push(T[0],T[1],T[2],p[0],p[1],p[2]),k+=1}var I=v;v=S,S=I}var B=l(x,new Float32Array(m)),N=l(x,new Uint16Array(g),x.ELEMENT_ARRAY_BUFFER),V=o(x,[{buffer:B,type:x.FLOAT,size:3,offset:0,stride:24},{buffer:B,type:x.FLOAT,size:3,offset:12,stride:24}],N),j=s(x);return j.attributes.position.location=0,j.attributes.normal.location=1,new c(x,B,V,j)};var l=n(2762),o=n(8116),s=n(1879).bg;function c(x,m,g,k){this.gl=x,this.buffer=m,this.vao=g,this.shader=k}var h=c.prototype;h.draw=function(x,m,g,k,A,v){for(var S=!1,T=0;T<3;++T)S=S||A[T];if(S){var p=this.gl;p.enable(p.POLYGON_OFFSET_FILL),p.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:x,view:m,projection:g,bounds:k,enable:A,colors:v},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),p.disable(p.POLYGON_OFFSET_FILL)}},h.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(u,r,n){u.exports=function(f,E,I,B,N){o(h,E,f),o(h,I,h);for(var V=0,j=0;j<2;++j){g[2]=B[j][2];for(var $=0;$<2;++$){g[1]=B[$][1];for(var ee=0;ee<2;++ee)g[0]=B[ee][0],A(x[V],g,h),V+=1}}var H=-1;for(j=0;j<8;++j){for(var J=x[j][3],Q=0;Q<3;++Q)m[j][Q]=x[j][Q]/J;N&&(m[j][2]*=-1),J<0&&(H<0||m[j][2]se&&(H|=1<se&&(H|=1<m[j][1])&&(me=j);var be=-1;for(j=0;j<3;++j)(Ee=me^1<m[Se][0]&&(Se=Ee))}var Ce=T;Ce[0]=Ce[1]=Ce[2]=0,Ce[l.log2(be^me)]=me&be,Ce[l.log2(me^Se)]=me&Se;var Le=7^Se;Le===H||Le===ye?(Le=7^be,Ce[l.log2(Se^Le)]=Le&Se):Ce[l.log2(be^Le)]=Le&be;var Oe=p,We=H;for(Z=0;Z<3;++Z)Oe[Z]=We&1<=0){w.i=r.i;var o=y.marker;o.pattern&&o.colors&&o.pattern.shape||(o.color=l,w.color=l),b.pointStyle(e,y,_,w)}else d.fill(e,l)}},44691:function(D,L,t){var b=t(45568),d=t(33626),e=t(36040).appendArrayPointValue,w=t(32141),y=t(34809),_=t(68596),u=t(33108),r=t(37252).formatPieValue;function n(l,o,s){for(var c=l.data.data,h={curveNumber:o.index,pointNumber:c.i,data:o._input,fullData:o},x=0;x"),name:V||ae("name")?p.name:void 0,color:N("hoverlabel.bgcolor")||M.color,borderColor:N("hoverlabel.bordercolor"),fontFamily:N("hoverlabel.font.family"),fontSize:N("hoverlabel.font.size"),fontColor:N("hoverlabel.font.color"),fontWeight:N("hoverlabel.font.weight"),fontStyle:N("hoverlabel.font.style"),fontVariant:N("hoverlabel.font.variant"),nameLength:N("hoverlabel.namelength"),textAlign:N("hoverlabel.align"),hovertemplate:V,hovertemplateLabels:Q,eventData:T};k&&(fe.x0=ee-v.rInscribed*v.rpx1,fe.x1=ee+v.rInscribed*v.rpx1,fe.idealAlign=v.pxmid[0]<0?"left":"right"),A&&(fe.x=ee,fe.idealAlign=ee<0?"left":"right");var ie=[];w.loneHover(fe,{container:S._hoverlayer.node(),outerContainer:S._paper.node(),gd:s,inOut_bbox:ie}),T[0].bbox=ie[0],m._hasHoverLabel=!0}if(A){var oe=l.select("path.surface");h.styleOne(oe,v,p,s,{hovered:!0})}m._hasHoverEvent=!0,s.emit("plotly_hover",{points:T||[n(v,p,h.eventDataKeys)],event:b.event})}}),l.on("mouseout",function(v){var S=s._fullLayout,T=s._fullData[m.index],p=b.select(this).datum();if(m._hasHoverEvent&&(v.originalEvent=b.event,s.emit("plotly_unhover",{points:[n(p,T,h.eventDataKeys)],event:b.event}),m._hasHoverEvent=!1),m._hasHoverLabel&&(w.loneUnhover(S._hoverlayer.node()),m._hasHoverLabel=!1),A){var M=l.select("path.surface");h.styleOne(M,p,T,s,{hovered:!1})}}),l.on("click",function(v){var S=s._fullLayout,T=s._fullData[m.index],p=k&&(u.isHierarchyRoot(v)||u.isLeaf(v)),M=u.getPtId(v),f=u.isEntry(v)?u.findEntryWithChild(g,M):u.findEntryWithLevel(g,M),E=u.getPtId(f),I={points:[n(v,T,h.eventDataKeys)],event:b.event};p||(I.nextLevel=E);var B=_.triggerHandler(s,"plotly_"+m.type+"click",I);if(B!==!1&&S.hovermode&&(s._hoverdata=[n(v,T,h.eventDataKeys)],w.click(s,b.event)),!p&&B!==!1&&!s._dragging&&!s._transitioning){d.call("_storeDirectGUIEdit",T,S._tracePreGUI[T.uid],{level:T.level});var N={data:[{level:E}],traces:[m.index]},V={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};w.loneUnhover(S._hoverlayer.node()),d.call("animate",s,N,V)}})}},33108:function(D,L,t){var b=t(34809),d=t(78766),e=t(27983),w=t(37252);function y(_){return _.data.data.pid}L.findEntryWithLevel=function(_,u){var r;return u&&_.eachAfter(function(n){if(L.getPtId(n)===u)return r=n.copy()}),r||_},L.findEntryWithChild=function(_,u){var r;return _.eachAfter(function(n){for(var l=n.children||[],o=0;o0)},L.getMaxDepth=function(_){return _.maxdepth>=0?_.maxdepth:1/0},L.isHeader=function(_,u){return!(L.isLeaf(_)||_.depth===u._maxDepth-1)},L.getParent=function(_,u){return L.findEntryWithLevel(_,y(u))},L.listPath=function(_,u){var r=_.parent;if(!r)return[];var n=u?[r.data[u]]:[r];return L.listPath(r,u).concat(n)},L.getPath=function(_){return L.listPath(_,"label").join("/")+"/"},L.formatValue=w.formatPieValue,L.formatPercent=function(_,u){var r=b.formatPercent(_,0);return r==="0%"&&(r=w.formatPiePercent(_,u)),r}},80809:function(D,L,t){D.exports={moduleType:"trace",name:"sunburst",basePlotModule:t(14724),categories:[],animatable:!0,attributes:t(56708),layoutAttributes:t(98959),supplyDefaults:t(33459),supplyLayoutDefaults:t(75816),calc:t(14852).calc,crossTraceCalc:t(14852).crossTraceCalc,plot:t(19718).plot,style:t(98972).style,colorbar:t(21146),meta:{}}},98959:function(D){D.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}},75816:function(D,L,t){var b=t(34809),d=t(98959);D.exports=function(e,w){function y(_,u){return b.coerce(e,w,d,_,u)}y("sunburstcolorway",w.colorway),y("extendsunburstcolors")}},19718:function(D,L,t){var b=t(45568),d=t(92264),e=t(88640).GW,w=t(62203),y=t(34809),_=t(30635),u=t(84102),r=u.recordMinTextSize,n=u.clearMinTextSize,l=t(35734),o=t(37252).getRotationAngle,s=l.computeTransform,c=l.transformInsideText,h=t(98972).styleOne,x=t(6851).resizeText,m=t(44691),g=t(2032),k=t(33108);function A(S,T,p,M){var f=S._context.staticPlot,E=S._fullLayout,I=!E.uniformtext.mode&&k.hasTransition(M),B=b.select(p).selectAll("g.slice"),N=T[0],V=N.trace,j=N.hierarchy,$=k.findEntryWithLevel(j,V.level),ee=k.getMaxDepth(V),H=E._size,J=V.domain,Q=H.w*(J.x[1]-J.x[0]),Z=H.h*(J.y[1]-J.y[0]),K=.5*Math.min(Q,Z),ae=N.cx=H.l+H.w*(J.x[1]+J.x[0])/2,se=N.cy=H.t+H.h*(1-J.y[0])-Z/2;if(!$)return B.remove();var he=null,fe={};I&&B.each(function(Pe){fe[k.getPtId(Pe)]={rpx0:Pe.rpx0,rpx1:Pe.rpx1,x0:Pe.x0,x1:Pe.x1,transform:Pe.transform},!he&&k.isEntry(Pe)&&(he=Pe)});var ie=function(Pe){return d.partition().size([2*Math.PI,Pe.height+1])(Pe)}($).descendants(),oe=$.height+1,le=0,ge=ee;N.hasMultipleRoots&&k.isHierarchyRoot($)&&(ie=ie.slice(1),oe-=1,le=1,ge+=1),ie=ie.filter(function(Pe){return Pe.y1<=ge});var ye=o(V.rotation);ye&&ie.forEach(function(Pe){Pe.x0+=ye,Pe.x1+=ye});var me=Math.min(oe,ee),be=function(Pe){return(Pe-le)/me*K},Se=function(Pe,de){return[Pe*Math.cos(de),-Pe*Math.sin(de)]},Ee=function(Pe){return y.pathAnnulus(Pe.rpx0,Pe.rpx1,Pe.x0,Pe.x1,ae,se)},Ce=function(Pe){return ae+v(Pe)[0]*(Pe.transform.rCenter||0)+(Pe.transform.x||0)},Le=function(Pe){return se+v(Pe)[1]*(Pe.transform.rCenter||0)+(Pe.transform.y||0)};(B=B.data(ie,k.getPtId)).enter().append("g").classed("slice",!0),I?B.exit().transition().each(function(){var Pe=b.select(this);Pe.select("path.surface").transition().attrTween("d",function(de){var Me=function(ke){var He,Fe=k.getPtId(ke),qe=fe[Fe],$e=fe[k.getPtId($)];if($e){var Ye=(ke.x1>$e.x1?2*Math.PI:0)+ye;He=ke.rpx1<$e.rpx1?{x0:ke.x0,x1:ke.x1,rpx0:0,rpx1:0}:{x0:Ye,x1:Ye,rpx0:ke.rpx0,rpx1:ke.rpx1}}else{var _e,De=k.getPtId(ke.parent);B.each(function(ft){if(k.getPtId(ft)===De)return _e=ft});var Be,Ge=_e.children;Ge.forEach(function(ft,At){if(k.getPtId(ft)===Fe)return Be=At});var tt=Ge.length,nt=e(_e.x0,_e.x1);He={rpx0:K,rpx1:K,x0:nt(Be/tt),x1:nt((Be+1)/tt)}}return e(qe,He)}(de);return function(ke){return Ee(Me(ke))}}),Pe.select("g.slicetext").attr("opacity",0)}).remove():B.exit().remove(),B.order();var Oe=null;if(I&&he){var We=k.getPtId(he);B.each(function(Pe){Oe===null&&k.getPtId(Pe)===We&&(Oe=Pe.x1)})}var Ie=B;function Ve(Pe){var de=Pe.parent,Me=fe[k.getPtId(de)],ke={};if(Me){var He=de.children,Fe=He.indexOf(Pe),qe=He.length,$e=e(Me.x0,Me.x1);ke.x0=$e(Fe/qe),ke.x1=$e(Fe/qe)}else ke.x0=ke.x1=0;return ke}I&&(Ie=Ie.transition().each("end",function(){var Pe=b.select(this);k.setSliceCursor(Pe,S,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})})),Ie.each(function(Pe){var de=b.select(this),Me=y.ensureSingle(de,"path","surface",function(Ye){Ye.style("pointer-events",f?"none":"all")});Pe.rpx0=be(Pe.y0),Pe.rpx1=be(Pe.y1),Pe.xmid=(Pe.x0+Pe.x1)/2,Pe.pxmid=Se(Pe.rpx1,Pe.xmid),Pe.midangle=-(Pe.xmid-Math.PI/2),Pe.startangle=-(Pe.x0-Math.PI/2),Pe.stopangle=-(Pe.x1-Math.PI/2),Pe.halfangle=.5*Math.min(y.angleDelta(Pe.x0,Pe.x1)||Math.PI,Math.PI),Pe.ring=1-Pe.rpx0/Pe.rpx1,Pe.rInscribed=function(Ye){return Ye.rpx0===0&&y.isFullCircle([Ye.x0,Ye.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(Ye.halfangle)),Ye.ring/2))}(Pe),I?Me.transition().attrTween("d",function(Ye){var _e=function(De){var Be,Ge=fe[k.getPtId(De)],tt={x0:De.x0,x1:De.x1,rpx0:De.rpx0,rpx1:De.rpx1};if(Ge)Be=Ge;else if(he)if(De.parent)if(Oe){var nt=(De.x1>Oe?2*Math.PI:0)+ye;Be={x0:nt,x1:nt}}else Be={rpx0:K,rpx1:K},y.extendFlat(Be,Ve(De));else Be={rpx0:0,rpx1:0};else Be={x0:ye,x1:ye};return e(Be,tt)}(Ye);return function(De){return Ee(_e(De))}}):Me.attr("d",Ee),de.call(m,$,S,T,{eventDataKeys:g.eventDataKeys,transitionTime:g.CLICK_TRANSITION_TIME,transitionEasing:g.CLICK_TRANSITION_EASING}).call(k.setSliceCursor,S,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:S._transitioning}),Me.call(h,Pe,V,S);var ke=y.ensureSingle(de,"g","slicetext"),He=y.ensureSingle(ke,"text","",function(Ye){Ye.attr("data-notex",1)}),Fe=y.ensureUniformFontSize(S,k.determineTextFont(V,Pe,E.font));He.text(L.formatSliceLabel(Pe,$,V,T,E)).classed("slicetext",!0).attr("text-anchor","middle").call(w.font,Fe).call(_.convertToTspans,S);var qe=w.bBox(He.node());Pe.transform=c(qe,Pe,N),Pe.transform.targetX=Ce(Pe),Pe.transform.targetY=Le(Pe);var $e=function(Ye,_e){var De=Ye.transform;return s(De,_e),De.fontSize=Fe.size,r(V.type,De,E),y.getTextTransform(De)};I?He.transition().attrTween("transform",function(Ye){var _e=function(De){var Be,Ge=fe[k.getPtId(De)],tt=De.transform;if(Ge)Be=Ge;else if(Be={rpx1:De.rpx1,transform:{textPosAngle:tt.textPosAngle,scale:0,rotate:tt.rotate,rCenter:tt.rCenter,x:tt.x,y:tt.y}},he)if(De.parent)if(Oe){var nt=De.x1>Oe?2*Math.PI:0;Be.x0=Be.x1=nt}else y.extendFlat(Be,Ve(De));else Be.x0=Be.x1=ye;else Be.x0=Be.x1=ye;var ft=e(Be.transform.textPosAngle,De.transform.textPosAngle),At=e(Be.rpx1,De.rpx1),kt=e(Be.x0,De.x0),Vt=e(Be.x1,De.x1),Ht=e(Be.transform.scale,tt.scale),Gt=e(Be.transform.rotate,tt.rotate),st=tt.rCenter===0?3:Be.transform.rCenter===0?1/3:1,Qe=e(Be.transform.rCenter,tt.rCenter);return function(pt){var yt=At(pt),Ot=kt(pt),Pt=Vt(pt),at=function(Xe){return Qe(Math.pow(Xe,st))}(pt),lt={pxmid:Se(yt,(Ot+Pt)/2),rpx1:yt,transform:{textPosAngle:ft(pt),rCenter:at,x:tt.x,y:tt.y}};return r(V.type,tt,E),{transform:{targetX:Ce(lt),targetY:Le(lt),scale:Ht(pt),rotate:Gt(pt),rCenter:at}}}}(Ye);return function(De){return $e(_e(De),qe)}}):He.attr("transform",$e(Pe,qe))})}function v(S){return T=S.rpx1,p=S.transform.textPosAngle,[T*Math.sin(p),-T*Math.cos(p)];var T,p}L.plot=function(S,T,p,M){var f,E,I=S._fullLayout,B=I._sunburstlayer,N=!p,V=!I.uniformtext.mode&&k.hasTransition(p);n("sunburst",I),(f=B.selectAll("g.trace.sunburst").data(T,function(j){return j[0].trace.uid})).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),f.order(),V?(M&&(E=M()),b.transition().duration(p.duration).ease(p.easing).each("end",function(){E&&E()}).each("interrupt",function(){E&&E()}).each(function(){B.selectAll("g.trace").each(function(j){A(S,j,this,p)})})):(f.each(function(j){A(S,j,this,p)}),I.uniformtext.mode&&x(S,I._sunburstlayer.selectAll(".trace"),"sunburst")),N&&f.exit().remove()},L.formatSliceLabel=function(S,T,p,M,f){var E=p.texttemplate,I=p.textinfo;if(!(E||I&&I!=="none"))return"";var B=f.separators,N=M[0],V=S.data.data,j=N.hierarchy,$=k.isHierarchyRoot(S),ee=k.getParent(j,S),H=k.getValue(S);if(!E){var J,Q=I.split("+"),Z=function(ge){return Q.indexOf(ge)!==-1},K=[];if(Z("label")&&V.label&&K.push(V.label),V.hasOwnProperty("v")&&Z("value")&&K.push(k.formatValue(V.v,B)),!$){Z("current path")&&K.push(k.getPath(S.data));var ae=0;Z("percent parent")&&ae++,Z("percent entry")&&ae++,Z("percent root")&&ae++;var se=ae>1;if(ae){var he,fe=function(ge){J=k.formatPercent(he,B),se&&(J+=" of "+ge),K.push(J)};Z("percent parent")&&!$&&(he=H/k.getValue(ee),fe("parent")),Z("percent entry")&&(he=H/k.getValue(T),fe("entry")),Z("percent root")&&(he=H/k.getValue(j),fe("root"))}}return Z("text")&&(J=y.castOption(p,V.i,"text"),y.isValidTextValue(J)&&K.push(J)),K.join("
")}var ie=y.castOption(p,V.i,"texttemplate");if(!ie)return"";var oe={};V.label&&(oe.label=V.label),V.hasOwnProperty("v")&&(oe.value=V.v,oe.valueLabel=k.formatValue(V.v,B)),oe.currentPath=k.getPath(S.data),$||(oe.percentParent=H/k.getValue(ee),oe.percentParentLabel=k.formatPercent(oe.percentParent,B),oe.parent=k.getPtLabel(ee)),oe.percentEntry=H/k.getValue(T),oe.percentEntryLabel=k.formatPercent(oe.percentEntry,B),oe.entry=k.getPtLabel(T),oe.percentRoot=H/k.getValue(j),oe.percentRootLabel=k.formatPercent(oe.percentRoot,B),oe.root=k.getPtLabel(j),V.hasOwnProperty("color")&&(oe.color=V.color);var le=y.castOption(p,V.i,"text");return(y.isValidTextValue(le)||le==="")&&(oe.text=le),oe.customdata=y.castOption(p,V.i,"customdata"),y.texttemplateString(ie,oe,f._d3locale,oe,p._meta||{})}},98972:function(D,L,t){var b=t(45568),d=t(78766),e=t(34809),w=t(84102).resizeText,y=t(72043);function _(u,r,n,l){var o=r.data.data,s=!r.children,c=o.i,h=e.castOption(n,c,"marker.line.color")||d.defaultLine,x=e.castOption(n,c,"marker.line.width")||0;u.call(y,r,n,l).style("stroke-width",x).call(d.stroke,h).style("opacity",s?n.leaf.opacity:null)}D.exports={style:function(u){var r=u._fullLayout._sunburstlayer.selectAll(".trace");w(u,r,"sunburst"),r.each(function(n){var l=b.select(this),o=n[0].trace;l.style("opacity",o.opacity),l.selectAll("path.surface").each(function(s){b.select(this).call(_,s,o,u)})})},styleOne:_}},16131:function(D,L,t){var b=t(78766),d=t(87163),e=t(80712).axisHoverFormat,w=t(3208).rb,y=t(9829),_=t(93049).extendFlat,u=t(13582).overrideAll;function r(l){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:b.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:b.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var n=D.exports=u(_({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"string",dflt:"",arrayOk:!0},hovertext:{valType:"string",dflt:"",arrayOk:!0},hovertemplate:w(),xhoverformat:e("x"),yhoverformat:e("y"),zhoverformat:e("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},d("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:r(),y:r(),z:r()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},_deprecated:{zauto:_({},d.zauto,{}),zmin:_({},d.zmin,{}),zmax:_({},d.zmax,{})},hoverinfo:_({},y.hoverinfo),showlegend:_({},y.showlegend,{dflt:!1})}),"calc","nested");n.x.editType=n.y.editType=n.z.editType="calc+clearAxisTypes",n.transforms=void 0},53027:function(D,L,t){var b=t(28379);D.exports=function(d,e){e.surfacecolor?b(d,e,{vals:e.surfacecolor,containerStr:"",cLetter:"c"}):b(d,e,{vals:e.z,containerStr:"",cLetter:"c"})}},27159:function(D,L,t){var b=t(99098).gl_surface3d,d=t(99098).ndarray,e=t(99098).ndarray_linear_interpolate.d2,w=t(69295),y=t(78106),_=t(34809).isArrayOrTypedArray,u=t(46998).parseColorScale,r=t(55010),n=t(88856).extractOpts;function l(p,M,f){this.scene=p,this.uid=f,this.surface=M,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var o=l.prototype;o.getXat=function(p,M,f,E){var I=_(this.data.x)?_(this.data.x[0])?this.data.x[M][p]:this.data.x[p]:p;return f===void 0?I:E.d2l(I,0,f)},o.getYat=function(p,M,f,E){var I=_(this.data.y)?_(this.data.y[0])?this.data.y[M][p]:this.data.y[M]:M;return f===void 0?I:E.d2l(I,0,f)},o.getZat=function(p,M,f,E){var I=this.data.z[M][p];return I===null&&this.data.connectgaps&&this.data._interpolatedZ&&(I=this.data._interpolatedZ[M][p]),f===void 0?I:E.d2l(I,0,f)},o.handlePick=function(p){if(p.object===this.surface){var M=(p.data.index[0]-1)/this.dataScaleX-1,f=(p.data.index[1]-1)/this.dataScaleY-1,E=Math.max(Math.min(Math.round(M),this.data.z[0].length-1),0),I=Math.max(Math.min(Math.round(f),this.data._ylength-1),0);p.index=[E,I],p.traceCoordinate=[this.getXat(E,I),this.getYat(E,I),this.getZat(E,I)],p.dataCoordinate=[this.getXat(E,I,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(E,I,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(E,I,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var B=0;B<3;B++)p.dataCoordinate[B]!=null&&(p.dataCoordinate[B]*=this.scene.dataScale[B]);var N=this.data.hovertext||this.data.text;return _(N)&&N[I]&&N[I][E]!==void 0?p.textLabel=N[I][E]:p.textLabel=N||"",p.data.dataCoordinate=p.dataCoordinate.slice(),this.surface.highlight(p.data),this.scene.glplot.spikes.position=p.dataCoordinate,!0}};var s=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999];function c(p,M){if(p0){f=s[E];break}return f}function m(p,M){if(!(p<1||M<1)){for(var f=h(p),E=h(M),I=1,B=0;BA;)f--,f/=x(f),++f1?E:1},o.refineCoords=function(p){for(var M=this.dataScaleX,f=this.dataScaleY,E=p[0].shape[0],I=p[0].shape[1],B=0|Math.floor(p[0].shape[0]*M+1),N=0|Math.floor(p[0].shape[1]*f+1),V=1+E+1,j=1+I+1,$=d(new Float32Array(V*j),[V,j]),ee=[1/M,0,0,0,1/f,0,0,0,1],H=0;H0&&this.contourStart[p]!==null&&this.contourEnd[p]!==null&&this.contourEnd[p]>this.contourStart[p]))for(I[p]=!0,M=this.contourStart[p];MI&&(this.minValues[M]=I),this.maxValues[M]",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"}}},21908:function(D,L,t){var b=t(18426),d=t(93049).extendFlat,e=t(10721),w=t(87800).isTypedArray,y=t(87800).isArrayOrTypedArray;function _(c){if(y(c)){for(var h=0,x=0;x=h||T===c.length-1)&&(m[g]=A,A.key=S++,A.firstRowIndex=v,A.lastRowIndex=T,A={firstRowIndex:null,lastRowIndex:null,rows:[]},g+=k,v=T+1,k=0);return m}D.exports=function(c,h){var x=r(h.cells.values),m=function(H){return H.slice(h.header.values.length,H.length)},g=r(h.header.values);g.length&&!g[0].length&&(g[0]=[""],g=r(g));var k=g.concat(m(x).map(function(){return n((g[0]||[""]).length)})),A=h.domain,v=Math.floor(c._fullLayout._size.w*(A.x[1]-A.x[0])),S=Math.floor(c._fullLayout._size.h*(A.y[1]-A.y[0])),T=h.header.values.length?k[0].map(function(){return h.header.height}):[b.emptyHeaderHeight],p=x.length?x[0].map(function(){return h.cells.height}):[],M=T.reduce(u,0),f=s(p,S-M+b.uplift),E=o(s(T,M),[]),I=o(f,E),B={},N=h._fullInput.columnorder;y(N)&&(N=Array.from(N)),N=N.concat(m(x.map(function(H,J){return J})));var V=k.map(function(H,J){var Q=y(h.columnwidth)?h.columnwidth[Math.min(J,h.columnwidth.length-1)]:h.columnwidth;return e(Q)?Number(Q):1}),j=V.reduce(u,0);V=V.map(function(H){return H/j*v});var $=Math.max(_(h.header.line.width),_(h.cells.line.width)),ee={key:h.uid+c._context.staticPlot,translateX:A.x[0]*c._fullLayout._size.w,translateY:c._fullLayout._size.h*(1-A.y[1]),size:c._fullLayout._size,width:v,maxLineWidth:$,height:S,columnOrder:N,groupHeight:S,rowBlocks:I,headerRowBlocks:E,scrollY:0,cells:d({},h.cells,{values:x}),headerCells:d({},h.header,{values:k}),gdColumns:k.map(function(H){return H[0]}),gdColumnsOriginalOrder:k.map(function(H){return H[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:k.map(function(H,J){var Q=B[H];return B[H]=(Q||0)+1,{key:H+"__"+B[H],label:H,specIndex:J,xIndex:N[J],xScale:l,x:void 0,calcdata:void 0,columnWidth:V[J]}})};return ee.columns.forEach(function(H){H.calcdata=ee,H.x=l(H)}),ee}},49618:function(D,L,t){var b=t(93049).extendFlat;L.splitToPanels=function(d){var e=[0,0],w=b({},d,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:d.calcdata.headerCells.values[d.specIndex],rowBlocks:d.calcdata.headerRowBlocks,calcdata:b({},d.calcdata,{cells:d.calcdata.headerCells})});return[b({},d,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks}),b({},d,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:d.calcdata.cells.values[d.specIndex],rowBlocks:d.calcdata.rowBlocks}),w]},L.splitToCells=function(d){var e=function(w){var y=w.rowBlocks[w.page],_=y?y.rows[0].rowIndex:0;return[_,y?_+y.rows.length:0]}(d);return(d.values||[]).slice(e[0],e[1]).map(function(w,y){return{keyWithinBlock:y+(typeof w=="string"&&w.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+y,column:d,calcdata:d.calcdata,page:d.page,rowBlocks:d.rowBlocks,value:w}})}},23281:function(D,L,t){var b=t(34809),d=t(92294),e=t(13792).N;D.exports=function(w,y,_,u){function r(n,l){return b.coerce(w,y,d,n,l)}e(y,u,r),r("columnwidth"),r("header.values"),r("header.format"),r("header.align"),r("header.prefix"),r("header.suffix"),r("header.height"),r("header.line.width"),r("header.line.color"),r("header.fill.color"),b.coerceFont(r,"header.font",u.font),function(n,l){for(var o=n.columnorder||[],s=n.header.values.length,c=o.slice(0,s),h=c.slice().sort(function(g,k){return g-k}),x=c.map(function(g){return h.indexOf(g)}),m=x.length;m/i),me=!ge||ye;fe.mayHaveMarkup=ge&&le.match(/[<&>]/);var be,Se=typeof(be=le)=="string"&&be.match(b.latexCheck);fe.latex=Se;var Ee,Ce,Le=Se?"":T(fe.calcdata.cells.prefix,ie,oe)||"",Oe=Se?"":T(fe.calcdata.cells.suffix,ie,oe)||"",We=Se?null:T(fe.calcdata.cells.format,ie,oe)||null,Ie=Le+(We?w(We)(fe.value):fe.value)+Oe;if(fe.wrappingNeeded=!fe.wrapped&&!me&&!Se&&(Ee=S(Ie)),fe.cellHeightMayIncrease=ye||Se||fe.mayHaveMarkup||(Ee===void 0?S(Ie):Ee),fe.needsConvertToTspans=fe.mayHaveMarkup||fe.wrappingNeeded||fe.latex,fe.wrappingNeeded){var Ve=(b.wrapSplitCharacter===" "?Ie.replace(/
Ce&&Ee.push(Le),Ce+=Ie}return Ee}(fe,ge,le);ye.length===1&&(ye[0]===fe.length-1?ye.unshift(ye[0]-1):ye.push(ye[0]+1)),ye[0]%2&&ye.reverse(),ae.each(function(me,be){me.page=ye[be],me.scrollY=ge}),ae.attr("transform",function(me){var be=H(me.rowBlocks,me.page)-me.scrollY;return n(0,be)}),K&&(N(K,se,ae,ye,he.prevPages,he,0),N(K,se,ae,ye,he.prevPages,he,1),k(se,K))}}function B(K,ae,se,he){return function(fe){var ie=fe.calcdata?fe.calcdata:fe,oe=ae.filter(function(me){return ie.key===me.key}),le=se||ie.scrollbarState.dragMultiplier,ge=ie.scrollY;ie.scrollY=he===void 0?ie.scrollY+le*d.event.dy:he;var ye=oe.selectAll("."+b.cn.yColumn).selectAll("."+b.cn.columnBlock).filter(M);return I(K,ye,oe),ie.scrollY===ge}}function N(K,ae,se,he,fe,ie,oe){he[oe]!==fe[oe]&&(clearTimeout(ie.currentRepaint[oe]),ie.currentRepaint[oe]=setTimeout(function(){var le=se.filter(function(ge,ye){return ye===oe&&he[ye]!==fe[ye]});A(K,ae,le,se),fe[oe]=he[oe]}))}function V(K,ae,se,he){return function(){var fe=d.select(ae.parentNode);fe.each(function(ie){var oe=ie.fragments;fe.selectAll("tspan.line").each(function(Ce,Le){oe[Le].width=this.getComputedTextLength()});var le,ge,ye=oe[oe.length-1].width,me=oe.slice(0,-1),be=[],Se=0,Ee=ie.column.columnWidth-2*b.cellPad;for(ie.value="";me.length;)Se+(ge=(le=me.shift()).width+ye)>Ee&&(ie.value+=be.join(b.wrapSpacer)+b.lineBreaker,be=[],Se=0),be.push(le.text),Se+=ge;Se&&(ie.value+=be.join(b.wrapSpacer)),ie.wrapped=!0}),fe.selectAll("tspan.line").remove(),v(fe.select("."+b.cn.cellText),se,K,he),d.select(ae.parentNode.parentNode).call(ee)}}function j(K,ae,se,he,fe){return function(){if(!fe.settledY){var ie=d.select(ae.parentNode),oe=Z(fe),le=fe.key-oe.firstRowIndex,ge=oe.rows[le].rowHeight,ye=fe.cellHeightMayIncrease?ae.parentNode.getBoundingClientRect().height+2*b.cellPad:ge,me=Math.max(ye,ge);me-oe.rows[le].rowHeight&&(oe.rows[le].rowHeight=me,K.selectAll("."+b.cn.columnCell).call(ee),I(null,K.filter(M),0),k(se,he,!0)),ie.attr("transform",function(){var be=this,Se=be.parentNode.getBoundingClientRect(),Ee=d.select(be.parentNode).select("."+b.cn.cellRect).node().getBoundingClientRect(),Ce=be.transform.baseVal.consolidate(),Le=Ee.top-Se.top+(Ce?Ce.matrix.f:b.cellPad);return n($(fe,d.select(be.parentNode).select("."+b.cn.cellTextHolder).node().getBoundingClientRect().width),Le)}),fe.settledY=!0}}}function $(K,ae){switch(K.align){case"left":default:return b.cellPad;case"right":return K.column.columnWidth-(ae||0)-b.cellPad;case"center":return(K.column.columnWidth-(ae||0))/2}}function ee(K){K.attr("transform",function(ae){var se=ae.rowBlocks[0].auxiliaryBlocks.reduce(function(fe,ie){return fe+J(ie,1/0)},0),he=J(Z(ae),ae.key);return n(0,he+se)}).selectAll("."+b.cn.cellRect).attr("height",function(ae){return(se=Z(ae),he=ae.key,se.rows[he-se.firstRowIndex]).rowHeight;var se,he})}function H(K,ae){for(var se=0,he=ae-1;he>=0;he--)se+=Q(K[he]);return se}function J(K,ae){for(var se=0,he=0;he","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:r({},y.textfont,{}),editType:"calc"},text:y.text,textinfo:_.textinfo,texttemplate:d({editType:"plot"},{keys:u.eventDataKeys.concat(["label","value"])}),hovertext:y.hovertext,hoverinfo:_.hoverinfo,hovertemplate:b({},{keys:u.eventDataKeys}),textfont:y.textfont,insidetextfont:y.insidetextfont,outsidetextfont:r({},y.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:y.sort,root:_.root,domain:w({name:"treemap",trace:!0,editType:"calc"})}},69784:function(D,L,t){var b=t(44122);L.name="treemap",L.plot=function(d,e,w,y){b.plotBasePlot(L.name,d,e,w,y)},L.clean=function(d,e,w,y){b.cleanBasePlot(L.name,d,e,w,y)}},38848:function(D,L,t){var b=t(14852);L._=function(d,e){return b.calc(d,e)},L.t=function(d){return b._runCrossTraceCalc("treemap",d)}},43236:function(D){D.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}},95719:function(D,L,t){var b=t(34809),d=t(71856),e=t(78766),w=t(13792).N,y=t(17550).handleText,_=t(56155).TEXTPAD,u=t(46979).handleMarkerDefaults,r=t(88856),n=r.hasColorscale,l=r.handleDefaults;D.exports=function(o,s,c,h){function x(p,M){return b.coerce(o,s,d,p,M)}var m=x("labels"),g=x("parents");if(m&&m.length&&g&&g.length){var k=x("values");k&&k.length?x("branchvalues"):x("count"),x("level"),x("maxdepth"),x("tiling.packing")==="squarify"&&x("tiling.squarifyratio"),x("tiling.flip"),x("tiling.pad");var A=x("text");x("texttemplate"),s.texttemplate||x("textinfo",b.isArrayOrTypedArray(A)?"text+label":"label"),x("hovertext"),x("hovertemplate");var v=x("pathbar.visible");y(o,s,h,x,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),x("textposition");var S=s.textposition.indexOf("bottom")!==-1;u(o,s,h,x),(s._hasColorscale=n(o,"marker","colors")||(o.marker||{}).coloraxis)?l(o,s,h,x,{prefix:"marker.",cLetter:"c"}):x("marker.depthfade",!(s.marker.colors||[]).length);var T=2*s.textfont.size;x("marker.pad.t",S?T/4:T),x("marker.pad.l",T/4),x("marker.pad.r",T/4),x("marker.pad.b",S?T:T/4),x("marker.cornerradius"),s._hovered={marker:{line:{width:2,color:e.contrast(h.paper_bgcolor)}}},v&&(x("pathbar.thickness",s.pathbar.textfont.size+2*_),x("pathbar.side"),x("pathbar.edgeshape")),x("sort"),x("root.color"),w(s,h,x),s._length=null}else s.visible=!1}},41567:function(D,L,t){var b=t(45568),d=t(33108),e=t(84102).clearMinTextSize,w=t(6851).resizeText,y=t(95709);D.exports=function(_,u,r,n,l){var o,s,c=l.type,h=l.drawDescendants,x=_._fullLayout,m=x["_"+c+"layer"],g=!r;e(c,x),(o=m.selectAll("g.trace."+c).data(u,function(k){return k[0].trace.uid})).enter().append("g").classed("trace",!0).classed(c,!0),o.order(),!x.uniformtext.mode&&d.hasTransition(r)?(n&&(s=n()),b.transition().duration(r.duration).ease(r.easing).each("end",function(){s&&s()}).each("interrupt",function(){s&&s()}).each(function(){m.selectAll("g.trace").each(function(k){y(_,k,this,r,h)})})):(o.each(function(k){y(_,k,this,r,h)}),x.uniformtext.mode&&w(_,m.selectAll(".trace"),c)),g&&o.exit().remove()}},17010:function(D,L,t){var b=t(45568),d=t(34809),e=t(62203),w=t(30635),y=t(11995),_=t(92080).styleOne,u=t(43236),r=t(33108),n=t(44691),l=!0;D.exports=function(o,s,c,h,x){var m=x.barDifY,g=x.width,k=x.height,A=x.viewX,v=x.viewY,S=x.pathSlice,T=x.toMoveInsideSlice,p=x.strTransform,M=x.hasTransition,f=x.handleSlicesExit,E=x.makeUpdateSliceInterpolator,I=x.makeUpdateTextInterpolator,B={},N=o._context.staticPlot,V=o._fullLayout,j=s[0],$=j.trace,ee=j.hierarchy,H=g/$._entryDepth,J=r.listPath(c.data,"id"),Q=y(ee.copy(),[g,k],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(Q=Q.filter(function(K){var ae=J.indexOf(K.data.id);return ae!==-1&&(K.x0=H*ae,K.x1=H*(ae+1),K.y0=m,K.y1=m+k,K.onPathbar=!0,!0)})).reverse(),(h=h.data(Q,r.getPtId)).enter().append("g").classed("pathbar",!0),f(h,l,B,[g,k],S),h.order();var Z=h;M&&(Z=Z.transition().each("end",function(){var K=b.select(this);r.setSliceCursor(K,o,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})})),Z.each(function(K){K._x0=A(K.x0),K._x1=A(K.x1),K._y0=v(K.y0),K._y1=v(K.y1),K._hoverX=A(K.x1-Math.min(g,k)/2),K._hoverY=v(K.y1-k/2);var ae=b.select(this),se=d.ensureSingle(ae,"path","surface",function(oe){oe.style("pointer-events",N?"none":"all")});M?se.transition().attrTween("d",function(oe){var le=E(oe,l,B,[g,k]);return function(ge){return S(le(ge))}}):se.attr("d",S),ae.call(n,c,o,s,{styleOne:_,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(r.setSliceCursor,o,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:o._transitioning}),se.call(_,K,$,o,{hovered:!1}),K._text=(r.getPtLabel(K)||"").split("
").join(" ")||"";var he=d.ensureSingle(ae,"g","slicetext"),fe=d.ensureSingle(he,"text","",function(oe){oe.attr("data-notex",1)}),ie=d.ensureUniformFontSize(o,r.determineTextFont($,K,V.font,{onPathbar:!0}));fe.text(K._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(e.font,ie).call(w.convertToTspans,o),K.textBB=e.bBox(fe.node()),K.transform=T(K,{fontSize:ie.size,onPathbar:!0}),K.transform.fontSize=ie.size,M?fe.transition().attrTween("transform",function(oe){var le=I(oe,l,B,[g,k]);return function(ge){return p(le(ge))}}):fe.attr("transform",p(K))})}},50916:function(D,L,t){var b=t(45568),d=t(34809),e=t(62203),w=t(30635),y=t(11995),_=t(92080).styleOne,u=t(43236),r=t(33108),n=t(44691),l=t(19718).formatSliceLabel,o=!1;D.exports=function(s,c,h,x,m){var g=m.width,k=m.height,A=m.viewX,v=m.viewY,S=m.pathSlice,T=m.toMoveInsideSlice,p=m.strTransform,M=m.hasTransition,f=m.handleSlicesExit,E=m.makeUpdateSliceInterpolator,I=m.makeUpdateTextInterpolator,B=m.prevEntry,N=s._context.staticPlot,V=s._fullLayout,j=c[0].trace,$=j.textposition.indexOf("left")!==-1,ee=j.textposition.indexOf("right")!==-1,H=j.textposition.indexOf("bottom")!==-1,J=!H&&!j.marker.pad.t||H&&!j.marker.pad.b,Q=y(h,[g,k],{packing:j.tiling.packing,squarifyratio:j.tiling.squarifyratio,flipX:j.tiling.flip.indexOf("x")>-1,flipY:j.tiling.flip.indexOf("y")>-1,pad:{inner:j.tiling.pad,top:j.marker.pad.t,left:j.marker.pad.l,right:j.marker.pad.r,bottom:j.marker.pad.b}}).descendants(),Z=1/0,K=-1/0;Q.forEach(function(ie){var oe=ie.depth;oe>=j._maxDepth?(ie.x0=ie.x1=(ie.x0+ie.x1)/2,ie.y0=ie.y1=(ie.y0+ie.y1)/2):(Z=Math.min(Z,oe),K=Math.max(K,oe))}),x=x.data(Q,r.getPtId),j._maxVisibleLayers=isFinite(K)?K-Z+1:0,x.enter().append("g").classed("slice",!0),f(x,o,{},[g,k],S),x.order();var ae=null;if(M&&B){var se=r.getPtId(B);x.each(function(ie){ae===null&&r.getPtId(ie)===se&&(ae={x0:ie.x0,x1:ie.x1,y0:ie.y0,y1:ie.y1})})}var he=function(){return ae||{x0:0,x1:g,y0:0,y1:k}},fe=x;return M&&(fe=fe.transition().each("end",function(){var ie=b.select(this);r.setSliceCursor(ie,s,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),fe.each(function(ie){var oe=r.isHeader(ie,j);ie._x0=A(ie.x0),ie._x1=A(ie.x1),ie._y0=v(ie.y0),ie._y1=v(ie.y1),ie._hoverX=A(ie.x1-j.marker.pad.r),ie._hoverY=v(H?ie.y1-j.marker.pad.b/2:ie.y0+j.marker.pad.t/2);var le=b.select(this),ge=d.ensureSingle(le,"path","surface",function(Ce){Ce.style("pointer-events",N?"none":"all")});M?ge.transition().attrTween("d",function(Ce){var Le=E(Ce,o,he(),[g,k]);return function(Oe){return S(Le(Oe))}}):ge.attr("d",S),le.call(n,h,s,c,{styleOne:_,eventDataKeys:u.eventDataKeys,transitionTime:u.CLICK_TRANSITION_TIME,transitionEasing:u.CLICK_TRANSITION_EASING}).call(r.setSliceCursor,s,{isTransitioning:s._transitioning}),ge.call(_,ie,j,s,{hovered:!1}),ie.x0===ie.x1||ie.y0===ie.y1?ie._text="":ie._text=oe?J?"":r.getPtLabel(ie)||"":l(ie,h,j,c,V)||"";var ye=d.ensureSingle(le,"g","slicetext"),me=d.ensureSingle(ye,"text","",function(Ce){Ce.attr("data-notex",1)}),be=d.ensureUniformFontSize(s,r.determineTextFont(j,ie,V.font)),Se=ie._text||" ",Ee=oe&&Se.indexOf("
")===-1;me.text(Se).classed("slicetext",!0).attr("text-anchor",ee?"end":$||Ee?"start":"middle").call(e.font,be).call(w.convertToTspans,s),ie.textBB=e.bBox(me.node()),ie.transform=T(ie,{fontSize:be.size,isHeader:oe}),ie.transform.fontSize=be.size,M?me.transition().attrTween("transform",function(Ce){var Le=I(Ce,o,he(),[g,k]);return function(Oe){return p(Le(Oe))}}):me.attr("transform",p(ie))}),ae}},36141:function(D){D.exports=function L(t,b,d){var e;d.swapXY&&(e=t.x0,t.x0=t.y0,t.y0=e,e=t.x1,t.x1=t.y1,t.y1=e),d.flipX&&(e=t.x0,t.x0=b[0]-t.x1,t.x1=b[0]-e),d.flipY&&(e=t.y0,t.y0=b[1]-t.y1,t.y1=b[1]-e);var w=t.children;if(w)for(var y=0;y-1?j+H:-(ee+H):0,Q={x0:$,x1:$,y0:J,y1:J+ee},Z=function(_e,De,Be){var Ge=k.tiling.pad,tt=function(kt){return kt-Ge<=De.x0},nt=function(kt){return kt+Ge>=De.x1},ft=function(kt){return kt-Ge<=De.y0},At=function(kt){return kt+Ge>=De.y1};return _e.x0===De.x0&&_e.x1===De.x1&&_e.y0===De.y0&&_e.y1===De.y1?{x0:_e.x0,x1:_e.x1,y0:_e.y0,y1:_e.y1}:{x0:tt(_e.x0-Ge)?0:nt(_e.x0-Ge)?Be[0]:_e.x0,x1:tt(_e.x1+Ge)?0:nt(_e.x1+Ge)?Be[0]:_e.x1,y0:ft(_e.y0-Ge)?0:At(_e.y0-Ge)?Be[1]:_e.y0,y1:ft(_e.y1+Ge)?0:At(_e.y1+Ge)?Be[1]:_e.y1}},K=null,ae={},se={},he=null,fe=function(_e,De){return De?ae[l(_e)]:se[l(_e)]};g.hasMultipleRoots&&f&&I++,k._maxDepth=I,k._backgroundColor=m.paper_bgcolor,k._entryDepth=S.data.depth,k._atRootLevel=f;var ie=-V/2+B.l+B.w*(N.x[1]+N.x[0])/2,oe=-j/2+B.t+B.h*(1-(N.y[1]+N.y[0])/2),le=function(_e){return ie+_e},ge=function(_e){return oe+_e},ye=ge(0),me=le(0),be=function(_e){return me+_e},Se=function(_e){return ye+_e};function Ee(_e,De){return _e+","+De}var Ce=be(0),Le=function(_e){_e.x=Math.max(Ce,_e.x)},Oe=k.pathbar.edgeshape,We=k[A?"tiling":"marker"].pad,Ie=function(_e){return k.textposition.indexOf(_e)!==-1},Ve=Ie("top"),Pe=Ie("left"),de=Ie("right"),Me=Ie("bottom"),ke=function(_e,De){var Be=_e.x0,Ge=_e.x1,tt=_e.y0,nt=_e.y1,ft=_e.textBB,At=Ve||De.isHeader&&!Me?"start":Me?"end":"middle",kt=Ie("right"),Vt=Ie("left")||De.onPathbar?-1:kt?1:0;if(De.isHeader){if((Be+=(A?We:We.l)-y)>=(Ge-=(A?We:We.r)-y)){var Ht=(Be+Ge)/2;Be=Ht,Ge=Ht}var Gt;Me?tt<(Gt=nt-(A?We:We.b))&&Gt"?(kt.x-=nt,Vt.x-=nt,Ht.x-=nt,Gt.x-=nt):Oe==="/"?(Ht.x-=nt,Gt.x-=nt,ft.x-=nt/2,At.x-=nt/2):Oe==="\\"?(kt.x-=nt,Vt.x-=nt,ft.x-=nt/2,At.x-=nt/2):Oe==="<"&&(ft.x-=nt,At.x-=nt),Le(kt),Le(Gt),Le(ft),Le(Vt),Le(Ht),Le(At),"M"+Ee(kt.x,kt.y)+"L"+Ee(Vt.x,Vt.y)+"L"+Ee(At.x,At.y)+"L"+Ee(Ht.x,Ht.y)+"L"+Ee(Gt.x,Gt.y)+"L"+Ee(ft.x,ft.y)+"Z"},toMoveInsideSlice:ke,makeUpdateSliceInterpolator:Fe,makeUpdateTextInterpolator:qe,handleSlicesExit:$e,hasTransition:E,strTransform:Ye}):p.remove()}},92080:function(D,L,t){var b=t(45568),d=t(78766),e=t(34809),w=t(33108),y=t(84102).resizeText,_=t(72043);function u(r,n,l,o,s){var c,h,x=(s||{}).hovered,m=n.data.data,g=m.i,k=m.color,A=w.isHierarchyRoot(n),v=1;if(x)c=l._hovered.marker.line.color,h=l._hovered.marker.line.width;else if(A&&k===l.root.color)v=100,c="rgba(0,0,0,0)",h=0;else if(c=e.castOption(l,g,"marker.line.color")||d.defaultLine,h=e.castOption(l,g,"marker.line.width")||0,!l._hasColorscale&&!n.onPathbar){var S=l.marker.depthfade;if(S){var T,p=d.combine(d.addOpacity(l._backgroundColor,.75),k);if(S===!0){var M=w.getMaxDepth(l);T=isFinite(M)?w.isLeaf(n)?0:l._maxVisibleLayers-(n.data.depth-l._entryDepth):n.data.height+1}else T=n.data.depth-l._entryDepth,l._atRootLevel||T++;if(T>0)for(var f=0;f0){var S,T,p,M,f,E=_.xa,I=_.ya;x.orientation==="h"?(f=u,S="y",p=I,T="x",M=E):(f=r,S="x",p=E,T="y",M=I);var B=h[_.index];if(f>=B.span[0]&&f<=B.span[1]){var N=d.extendFlat({},_),V=M.c2p(f,!0),j=y.getKdeValue(B,x,f),$=y.getPositionOnKdePath(B,x,V),ee=p._offset,H=p._length;N[S+"0"]=$[0],N[S+"1"]=$[1],N[T+"0"]=N[T+"1"]=V,N[T+"Label"]=T+": "+e.hoverLabelText(M,f,x[T+"hoverformat"])+", "+h[0].t.labels.kde+" "+j.toFixed(3);for(var J=0,Q=0;Q")),s.color=function(I,B){var N=I[B.dir].marker,V=N.color,j=N.line.color,$=N.line.width;return d(V)?V:d(j)&&$?j:void 0}(h,k),[s]}function E(I){return b(g,I,h[m+"hoverformat"])}}},38261:function(D,L,t){D.exports={attributes:t(37832),layoutAttributes:t(579),supplyDefaults:t(67199).supplyDefaults,crossTraceDefaults:t(67199).crossTraceDefaults,supplyLayoutDefaults:t(71492),calc:t(15e3),crossTraceCalc:t(9963),plot:t(71130),style:t(57256).style,hoverPoints:t(40943),eventData:t(64932),selectPoints:t(88384),moduleType:"trace",name:"waterfall",basePlotModule:t(37703),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}},579:function(D){D.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"}}},71492:function(D,L,t){var b=t(34809),d=t(579);D.exports=function(e,w,y){var _=!1;function u(l,o){return b.coerce(e,w,d,l,o)}for(var r=0;r0&&(j+=T?"M"+N[0]+","+V[1]+"V"+V[0]:"M"+N[1]+","+V[0]+"H"+N[0]),p!=="between"&&(E.isSum||I path").each(function(x){if(!x.isBlank){var m=h[x.dir].marker;b.select(this).call(e.fill,m.color).call(e.stroke,m.line.color).call(d.dashLine,m.line.dash,m.line.width).style("opacity",h.selectedpoints&&!x.selected?w:1)}}),u(c,h,r),c.selectAll(".lines").each(function(){var x=h.connector.line;d.lineGroupStyle(b.select(this).selectAll("path"),x.width,x.color,x.dash)})})}}},47908:function(D,L,t){var b=t(29714),d=t(34809),e=t(57297),w=t(5086).z,y=t(63821).BADNUM;L.moduleType="transform",L.name="aggregate";var _=L.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},groups:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},aggregations:{_isLinkedToArray:"aggregation",target:{valType:"string",editType:"calc"},func:{valType:"enumerated",values:["count","sum","avg","median","mode","rms","stddev","min","max","first","last","change","range"],dflt:"first",editType:"calc"},funcmode:{valType:"enumerated",values:["sample","population"],dflt:"sample",editType:"calc"},enabled:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},editType:"calc"},u=_.aggregations;function r(s,c,h,x){if(x.enabled){for(var m=x.target,g=d.nestedProperty(c,m),k=g.get(),A=function(T,p){var M=T.func,f=p.d2c,E=p.c2d;switch(M){case"count":return n;case"first":return l;case"last":return o;case"sum":return function(I,B){for(var N=0,V=0;VV&&(V=H,j=ee)}}return V?E(j):y};case"rms":return function(I,B){for(var N=0,V=0,j=0;j":return function(K){return Z(K)>J};case">=":return function(K){return Z(K)>=J};case"[]":return function(K){var ae=Z(K);return ae>=J[0]&&ae<=J[1]};case"()":return function(K){var ae=Z(K);return ae>J[0]&&ae=J[0]&&aeJ[0]&&ae<=J[1]};case"][":return function(K){var ae=Z(K);return ae<=J[0]||ae>=J[1]};case")(":return function(K){var ae=Z(K);return aeJ[1]};case"](":return function(K){var ae=Z(K);return ae<=J[0]||ae>J[1]};case")[":return function(K){var ae=Z(K);return ae=J[1]};case"{}":return function(K){return J.indexOf(Z(K))!==-1};case"}{":return function(K){return J.indexOf(Z(K))===-1}}}(o,e.getDataToCoordFunc(n,l,c,s),x),T={},p={},M=0;g?(A=function(B){T[B.astr]=b.extendDeep([],B.get()),B.set(new Array(h))},v=function(B,N){var V=T[B.astr][N];B.get()[N]=V}):(A=function(B){T[B.astr]=b.extendDeep([],B.get()),B.set([])},v=function(B,N){var V=T[B.astr][N];B.get().push(V)}),I(A);for(var f=w(l.transforms,o),E=0;E1?"%{group} (%{trace})":"%{group}");var s=_.styles,c=l.styles=[];if(s)for(n=0;nA)throw new RangeError('The value "'+_e+'" is invalid for option "size"');var De=new Uint8Array(_e);return Object.setPrototypeOf(De,S.prototype),De}function S(_e,De,Be){if(typeof _e=="number"){if(typeof De=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(_e)}return T(_e,De,Be)}function T(_e,De,Be){if(typeof _e=="string")return function(nt,ft){if(typeof ft=="string"&&ft!==""||(ft="utf8"),!S.isEncoding(ft))throw new TypeError("Unknown encoding: "+ft);var At=0|B(nt,ft),kt=v(At),Vt=kt.write(nt,ft);return Vt!==At&&(kt=kt.slice(0,Vt)),kt}(_e,De);if(ArrayBuffer.isView(_e))return function(nt){if(He(nt,Uint8Array)){var ft=new Uint8Array(nt);return E(ft.buffer,ft.byteOffset,ft.byteLength)}return f(nt)}(_e);if(_e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(_e));if(He(_e,ArrayBuffer)||_e&&He(_e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(He(_e,SharedArrayBuffer)||_e&&He(_e.buffer,SharedArrayBuffer)))return E(_e,De,Be);if(typeof _e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Ge=_e.valueOf&&_e.valueOf();if(Ge!=null&&Ge!==_e)return S.from(Ge,De,Be);var tt=function(nt){if(S.isBuffer(nt)){var ft=0|I(nt.length),At=v(ft);return At.length===0||nt.copy(At,0,0,ft),At}return nt.length!==void 0?typeof nt.length!="number"||Fe(nt.length)?v(0):f(nt):nt.type==="Buffer"&&Array.isArray(nt.data)?f(nt.data):void 0}(_e);if(tt)return tt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _e[Symbol.toPrimitive]=="function")return S.from(_e[Symbol.toPrimitive]("string"),De,Be);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+x(_e))}function p(_e){if(typeof _e!="number")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 M(_e){return p(_e),v(_e<0?0:0|I(_e))}function f(_e){for(var De=_e.length<0?0:0|I(_e.length),Be=v(De),Ge=0;Ge=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return 0|_e}function B(_e,De){if(S.isBuffer(_e))return _e.length;if(ArrayBuffer.isView(_e)||He(_e,ArrayBuffer))return _e.byteLength;if(typeof _e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+x(_e));var Be=_e.length,Ge=arguments.length>2&&arguments[2]===!0;if(!Ge&&Be===0)return 0;for(var tt=!1;;)switch(De){case"ascii":case"latin1":case"binary":return Be;case"utf8":case"utf-8":return de(_e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*Be;case"hex":return Be>>>1;case"base64":return Me(_e).length;default:if(tt)return Ge?-1:de(_e).length;De=(""+De).toLowerCase(),tt=!0}}function N(_e,De,Be){var Ge=!1;if((De===void 0||De<0)&&(De=0),De>this.length||((Be===void 0||Be>this.length)&&(Be=this.length),Be<=0)||(Be>>>=0)<=(De>>>=0))return"";for(_e||(_e="utf8");;)switch(_e){case"hex":return ie(this,De,Be);case"utf8":case"utf-8":return ae(this,De,Be);case"ascii":return he(this,De,Be);case"latin1":case"binary":return fe(this,De,Be);case"base64":return K(this,De,Be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oe(this,De,Be);default:if(Ge)throw new TypeError("Unknown encoding: "+_e);_e=(_e+"").toLowerCase(),Ge=!0}}function V(_e,De,Be){var Ge=_e[De];_e[De]=_e[Be],_e[Be]=Ge}function j(_e,De,Be,Ge,tt){if(_e.length===0)return-1;if(typeof Be=="string"?(Ge=Be,Be=0):Be>2147483647?Be=2147483647:Be<-2147483648&&(Be=-2147483648),Fe(Be=+Be)&&(Be=tt?0:_e.length-1),Be<0&&(Be=_e.length+Be),Be>=_e.length){if(tt)return-1;Be=_e.length-1}else if(Be<0){if(!tt)return-1;Be=0}if(typeof De=="string"&&(De=S.from(De,Ge)),S.isBuffer(De))return De.length===0?-1:$(_e,De,Be,Ge,tt);if(typeof De=="number")return De&=255,typeof Uint8Array.prototype.indexOf=="function"?tt?Uint8Array.prototype.indexOf.call(_e,De,Be):Uint8Array.prototype.lastIndexOf.call(_e,De,Be):$(_e,[De],Be,Ge,tt);throw new TypeError("val must be string, number or Buffer")}function $(_e,De,Be,Ge,tt){var nt,ft=1,At=_e.length,kt=De.length;if(Ge!==void 0&&((Ge=String(Ge).toLowerCase())==="ucs2"||Ge==="ucs-2"||Ge==="utf16le"||Ge==="utf-16le")){if(_e.length<2||De.length<2)return-1;ft=2,At/=2,kt/=2,Be/=2}function Vt(Qe,pt){return ft===1?Qe[pt]:Qe.readUInt16BE(pt*ft)}if(tt){var Ht=-1;for(nt=Be;ntAt&&(Be=At-kt),nt=Be;nt>=0;nt--){for(var Gt=!0,st=0;sttt&&(Ge=tt):Ge=tt;var nt,ft=De.length;for(Ge>ft/2&&(Ge=ft/2),nt=0;nt>8,kt=ft%256,Vt.push(kt),Vt.push(At);return Vt}(De,_e.length-Be),_e,Be,Ge)}function K(_e,De,Be){return De===0&&Be===_e.length?m.fromByteArray(_e):m.fromByteArray(_e.slice(De,Be))}function ae(_e,De,Be){Be=Math.min(_e.length,Be);for(var Ge=[],tt=De;tt239?4:nt>223?3:nt>191?2:1;if(tt+At<=Be){var kt=void 0,Vt=void 0,Ht=void 0,Gt=void 0;switch(At){case 1:nt<128&&(ft=nt);break;case 2:(192&(kt=_e[tt+1]))==128&&(Gt=(31&nt)<<6|63&kt)>127&&(ft=Gt);break;case 3:kt=_e[tt+1],Vt=_e[tt+2],(192&kt)==128&&(192&Vt)==128&&(Gt=(15&nt)<<12|(63&kt)<<6|63&Vt)>2047&&(Gt<55296||Gt>57343)&&(ft=Gt);break;case 4:kt=_e[tt+1],Vt=_e[tt+2],Ht=_e[tt+3],(192&kt)==128&&(192&Vt)==128&&(192&Ht)==128&&(Gt=(15&nt)<<18|(63&kt)<<12|(63&Vt)<<6|63&Ht)>65535&&Gt<1114112&&(ft=Gt)}}ft===null?(ft=65533,At=1):ft>65535&&(ft-=65536,Ge.push(ft>>>10&1023|55296),ft=56320|1023&ft),Ge.push(ft),tt+=At}return function(st){var Qe=st.length;if(Qe<=se)return String.fromCharCode.apply(String,st);for(var pt="",yt=0;yt"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(S.prototype,"parent",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.buffer}}),Object.defineProperty(S.prototype,"offset",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.byteOffset}}),S.poolSize=8192,S.from=function(_e,De,Be){return T(_e,De,Be)},Object.setPrototypeOf(S.prototype,Uint8Array.prototype),Object.setPrototypeOf(S,Uint8Array),S.alloc=function(_e,De,Be){return function(Ge,tt,nt){return p(Ge),Ge<=0?v(Ge):tt!==void 0?typeof nt=="string"?v(Ge).fill(tt,nt):v(Ge).fill(tt):v(Ge)}(_e,De,Be)},S.allocUnsafe=function(_e){return M(_e)},S.allocUnsafeSlow=function(_e){return M(_e)},S.isBuffer=function(_e){return _e!=null&&_e._isBuffer===!0&&_e!==S.prototype},S.compare=function(_e,De){if(He(_e,Uint8Array)&&(_e=S.from(_e,_e.offset,_e.byteLength)),He(De,Uint8Array)&&(De=S.from(De,De.offset,De.byteLength)),!S.isBuffer(_e)||!S.isBuffer(De))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_e===De)return 0;for(var Be=_e.length,Ge=De.length,tt=0,nt=Math.min(Be,Ge);ttGe.length?(S.isBuffer(nt)||(nt=S.from(nt)),nt.copy(Ge,tt)):Uint8Array.prototype.set.call(Ge,nt,tt);else{if(!S.isBuffer(nt))throw new TypeError('"list" argument must be an Array of Buffers');nt.copy(Ge,tt)}tt+=nt.length}return Ge},S.byteLength=B,S.prototype._isBuffer=!0,S.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 De=0;De<_e;De+=2)V(this,De,De+1);return this},S.prototype.swap32=function(){var _e=this.length;if(_e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var De=0;De<_e;De+=4)V(this,De,De+3),V(this,De+1,De+2);return this},S.prototype.swap64=function(){var _e=this.length;if(_e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var De=0;De<_e;De+=8)V(this,De,De+7),V(this,De+1,De+6),V(this,De+2,De+5),V(this,De+3,De+4);return this},S.prototype.toString=function(){var _e=this.length;return _e===0?"":arguments.length===0?ae(this,0,_e):N.apply(this,arguments)},S.prototype.toLocaleString=S.prototype.toString,S.prototype.equals=function(_e){if(!S.isBuffer(_e))throw new TypeError("Argument must be a Buffer");return this===_e||S.compare(this,_e)===0},S.prototype.inspect=function(){var _e="",De=r.IS;return _e=this.toString("hex",0,De).replace(/(.{2})/g,"$1 ").trim(),this.length>De&&(_e+=" ... "),""},k&&(S.prototype[k]=S.prototype.inspect),S.prototype.compare=function(_e,De,Be,Ge,tt){if(He(_e,Uint8Array)&&(_e=S.from(_e,_e.offset,_e.byteLength)),!S.isBuffer(_e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+x(_e));if(De===void 0&&(De=0),Be===void 0&&(Be=_e?_e.length:0),Ge===void 0&&(Ge=0),tt===void 0&&(tt=this.length),De<0||Be>_e.length||Ge<0||tt>this.length)throw new RangeError("out of range index");if(Ge>=tt&&De>=Be)return 0;if(Ge>=tt)return-1;if(De>=Be)return 1;if(this===_e)return 0;for(var nt=(tt>>>=0)-(Ge>>>=0),ft=(Be>>>=0)-(De>>>=0),At=Math.min(nt,ft),kt=this.slice(Ge,tt),Vt=_e.slice(De,Be),Ht=0;Ht>>=0,isFinite(Be)?(Be>>>=0,Ge===void 0&&(Ge="utf8")):(Ge=Be,Be=void 0)}var tt=this.length-De;if((Be===void 0||Be>tt)&&(Be=tt),_e.length>0&&(Be<0||De<0)||De>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ge||(Ge="utf8");for(var nt=!1;;)switch(Ge){case"hex":return ee(this,_e,De,Be);case"utf8":case"utf-8":return H(this,_e,De,Be);case"ascii":case"latin1":case"binary":return J(this,_e,De,Be);case"base64":return Q(this,_e,De,Be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,_e,De,Be);default:if(nt)throw new TypeError("Unknown encoding: "+Ge);Ge=(""+Ge).toLowerCase(),nt=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var se=4096;function he(_e,De,Be){var Ge="";Be=Math.min(_e.length,Be);for(var tt=De;ttGe)&&(Be=Ge);for(var tt="",nt=De;ntBe)throw new RangeError("Trying to access beyond buffer length")}function ge(_e,De,Be,Ge,tt,nt){if(!S.isBuffer(_e))throw new TypeError('"buffer" argument must be a Buffer instance');if(De>tt||De_e.length)throw new RangeError("Index out of range")}function ye(_e,De,Be,Ge,tt){We(De,Ge,tt,_e,Be,7);var nt=Number(De&BigInt(4294967295));_e[Be++]=nt,nt>>=8,_e[Be++]=nt,nt>>=8,_e[Be++]=nt,nt>>=8,_e[Be++]=nt;var ft=Number(De>>BigInt(32)&BigInt(4294967295));return _e[Be++]=ft,ft>>=8,_e[Be++]=ft,ft>>=8,_e[Be++]=ft,ft>>=8,_e[Be++]=ft,Be}function me(_e,De,Be,Ge,tt){We(De,Ge,tt,_e,Be,7);var nt=Number(De&BigInt(4294967295));_e[Be+7]=nt,nt>>=8,_e[Be+6]=nt,nt>>=8,_e[Be+5]=nt,nt>>=8,_e[Be+4]=nt;var ft=Number(De>>BigInt(32)&BigInt(4294967295));return _e[Be+3]=ft,ft>>=8,_e[Be+2]=ft,ft>>=8,_e[Be+1]=ft,ft>>=8,_e[Be]=ft,Be+8}function be(_e,De,Be,Ge,tt,nt){if(Be+Ge>_e.length)throw new RangeError("Index out of range");if(Be<0)throw new RangeError("Index out of range")}function Se(_e,De,Be,Ge,tt){return De=+De,Be>>>=0,tt||be(_e,0,Be,4),g.write(_e,De,Be,Ge,23,4),Be+4}function Ee(_e,De,Be,Ge,tt){return De=+De,Be>>>=0,tt||be(_e,0,Be,8),g.write(_e,De,Be,Ge,52,8),Be+8}S.prototype.slice=function(_e,De){var Be=this.length;(_e=~~_e)<0?(_e+=Be)<0&&(_e=0):_e>Be&&(_e=Be),(De=De===void 0?Be:~~De)<0?(De+=Be)<0&&(De=0):De>Be&&(De=Be),De<_e&&(De=_e);var Ge=this.subarray(_e,De);return Object.setPrototypeOf(Ge,S.prototype),Ge},S.prototype.readUintLE=S.prototype.readUIntLE=function(_e,De,Be){_e>>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=this[_e],tt=1,nt=0;++nt>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=this[_e+--De],tt=1;De>0&&(tt*=256);)Ge+=this[_e+--De]*tt;return Ge},S.prototype.readUint8=S.prototype.readUInt8=function(_e,De){return _e>>>=0,De||le(_e,1,this.length),this[_e]},S.prototype.readUint16LE=S.prototype.readUInt16LE=function(_e,De){return _e>>>=0,De||le(_e,2,this.length),this[_e]|this[_e+1]<<8},S.prototype.readUint16BE=S.prototype.readUInt16BE=function(_e,De){return _e>>>=0,De||le(_e,2,this.length),this[_e]<<8|this[_e+1]},S.prototype.readUint32LE=S.prototype.readUInt32LE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),(this[_e]|this[_e+1]<<8|this[_e+2]<<16)+16777216*this[_e+3]},S.prototype.readUint32BE=S.prototype.readUInt32BE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),16777216*this[_e]+(this[_e+1]<<16|this[_e+2]<<8|this[_e+3])},S.prototype.readBigUInt64LE=$e(function(_e){Ie(_e>>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=De+this[++_e]*Math.pow(2,8)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,24),tt=this[++_e]+this[++_e]*Math.pow(2,8)+this[++_e]*Math.pow(2,16)+Be*Math.pow(2,24);return BigInt(Ge)+(BigInt(tt)<>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=De*Math.pow(2,24)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,8)+this[++_e],tt=this[++_e]*Math.pow(2,24)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,8)+Be;return(BigInt(Ge)<>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=this[_e],tt=1,nt=0;++nt=(tt*=128)&&(Ge-=Math.pow(2,8*De)),Ge},S.prototype.readIntBE=function(_e,De,Be){_e>>>=0,De>>>=0,Be||le(_e,De,this.length);for(var Ge=De,tt=1,nt=this[_e+--Ge];Ge>0&&(tt*=256);)nt+=this[_e+--Ge]*tt;return nt>=(tt*=128)&&(nt-=Math.pow(2,8*De)),nt},S.prototype.readInt8=function(_e,De){return _e>>>=0,De||le(_e,1,this.length),128&this[_e]?-1*(255-this[_e]+1):this[_e]},S.prototype.readInt16LE=function(_e,De){_e>>>=0,De||le(_e,2,this.length);var Be=this[_e]|this[_e+1]<<8;return 32768&Be?4294901760|Be:Be},S.prototype.readInt16BE=function(_e,De){_e>>>=0,De||le(_e,2,this.length);var Be=this[_e+1]|this[_e]<<8;return 32768&Be?4294901760|Be:Be},S.prototype.readInt32LE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),this[_e]|this[_e+1]<<8|this[_e+2]<<16|this[_e+3]<<24},S.prototype.readInt32BE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),this[_e]<<24|this[_e+1]<<16|this[_e+2]<<8|this[_e+3]},S.prototype.readBigInt64LE=$e(function(_e){Ie(_e>>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=this[_e+4]+this[_e+5]*Math.pow(2,8)+this[_e+6]*Math.pow(2,16)+(Be<<24);return(BigInt(Ge)<>>=0,"offset");var De=this[_e],Be=this[_e+7];De!==void 0&&Be!==void 0||Ve(_e,this.length-8);var Ge=(De<<24)+this[++_e]*Math.pow(2,16)+this[++_e]*Math.pow(2,8)+this[++_e];return(BigInt(Ge)<>>=0,De||le(_e,4,this.length),g.read(this,_e,!0,23,4)},S.prototype.readFloatBE=function(_e,De){return _e>>>=0,De||le(_e,4,this.length),g.read(this,_e,!1,23,4)},S.prototype.readDoubleLE=function(_e,De){return _e>>>=0,De||le(_e,8,this.length),g.read(this,_e,!0,52,8)},S.prototype.readDoubleBE=function(_e,De){return _e>>>=0,De||le(_e,8,this.length),g.read(this,_e,!1,52,8)},S.prototype.writeUintLE=S.prototype.writeUIntLE=function(_e,De,Be,Ge){_e=+_e,De>>>=0,Be>>>=0,Ge||ge(this,_e,De,Be,Math.pow(2,8*Be)-1,0);var tt=1,nt=0;for(this[De]=255&_e;++nt>>=0,Be>>>=0,Ge||ge(this,_e,De,Be,Math.pow(2,8*Be)-1,0);var tt=Be-1,nt=1;for(this[De+tt]=255&_e;--tt>=0&&(nt*=256);)this[De+tt]=_e/nt&255;return De+Be},S.prototype.writeUint8=S.prototype.writeUInt8=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,1,255,0),this[De]=255&_e,De+1},S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,65535,0),this[De]=255&_e,this[De+1]=_e>>>8,De+2},S.prototype.writeUint16BE=S.prototype.writeUInt16BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,65535,0),this[De]=_e>>>8,this[De+1]=255&_e,De+2},S.prototype.writeUint32LE=S.prototype.writeUInt32LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,4294967295,0),this[De+3]=_e>>>24,this[De+2]=_e>>>16,this[De+1]=_e>>>8,this[De]=255&_e,De+4},S.prototype.writeUint32BE=S.prototype.writeUInt32BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,4294967295,0),this[De]=_e>>>24,this[De+1]=_e>>>16,this[De+2]=_e>>>8,this[De+3]=255&_e,De+4},S.prototype.writeBigUInt64LE=$e(function(_e){return ye(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),S.prototype.writeBigUInt64BE=$e(function(_e){return me(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),S.prototype.writeIntLE=function(_e,De,Be,Ge){if(_e=+_e,De>>>=0,!Ge){var tt=Math.pow(2,8*Be-1);ge(this,_e,De,Be,tt-1,-tt)}var nt=0,ft=1,At=0;for(this[De]=255&_e;++nt>0)-At&255;return De+Be},S.prototype.writeIntBE=function(_e,De,Be,Ge){if(_e=+_e,De>>>=0,!Ge){var tt=Math.pow(2,8*Be-1);ge(this,_e,De,Be,tt-1,-tt)}var nt=Be-1,ft=1,At=0;for(this[De+nt]=255&_e;--nt>=0&&(ft*=256);)_e<0&&At===0&&this[De+nt+1]!==0&&(At=1),this[De+nt]=(_e/ft>>0)-At&255;return De+Be},S.prototype.writeInt8=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,1,127,-128),_e<0&&(_e=255+_e+1),this[De]=255&_e,De+1},S.prototype.writeInt16LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,32767,-32768),this[De]=255&_e,this[De+1]=_e>>>8,De+2},S.prototype.writeInt16BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,2,32767,-32768),this[De]=_e>>>8,this[De+1]=255&_e,De+2},S.prototype.writeInt32LE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,2147483647,-2147483648),this[De]=255&_e,this[De+1]=_e>>>8,this[De+2]=_e>>>16,this[De+3]=_e>>>24,De+4},S.prototype.writeInt32BE=function(_e,De,Be){return _e=+_e,De>>>=0,Be||ge(this,_e,De,4,2147483647,-2147483648),_e<0&&(_e=4294967295+_e+1),this[De]=_e>>>24,this[De+1]=_e>>>16,this[De+2]=_e>>>8,this[De+3]=255&_e,De+4},S.prototype.writeBigInt64LE=$e(function(_e){return ye(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),S.prototype.writeBigInt64BE=$e(function(_e){return me(this,_e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),S.prototype.writeFloatLE=function(_e,De,Be){return Se(this,_e,De,!0,Be)},S.prototype.writeFloatBE=function(_e,De,Be){return Se(this,_e,De,!1,Be)},S.prototype.writeDoubleLE=function(_e,De,Be){return Ee(this,_e,De,!0,Be)},S.prototype.writeDoubleBE=function(_e,De,Be){return Ee(this,_e,De,!1,Be)},S.prototype.copy=function(_e,De,Be,Ge){if(!S.isBuffer(_e))throw new TypeError("argument should be a Buffer");if(Be||(Be=0),Ge||Ge===0||(Ge=this.length),De>=_e.length&&(De=_e.length),De||(De=0),Ge>0&&Ge=this.length)throw new RangeError("Index out of range");if(Ge<0)throw new RangeError("sourceEnd out of bounds");Ge>this.length&&(Ge=this.length),_e.length-De>>=0,Be=Be===void 0?this.length:Be>>>0,_e||(_e=0),typeof _e=="number")for(nt=De;nt=Ge+4;Be-=3)De="_".concat(_e.slice(Be-3,Be)).concat(De);return"".concat(_e.slice(0,Be)).concat(De)}function We(_e,De,Be,Ge,tt,nt){if(_e>Be||_e3?De===0||De===BigInt(0)?">= 0".concat(At," and < 2").concat(At," ** ").concat(8*(nt+1)).concat(At):">= -(2".concat(At," ** ").concat(8*(nt+1)-1).concat(At,") and < 2 ** ")+"".concat(8*(nt+1)-1).concat(At):">= ".concat(De).concat(At," and <= ").concat(Be).concat(At),new Ce.ERR_OUT_OF_RANGE("value",ft,_e)}(function(kt,Vt,Ht){Ie(Vt,"offset"),kt[Vt]!==void 0&&kt[Vt+Ht]!==void 0||Ve(Vt,kt.length-(Ht+1))})(Ge,tt,nt)}function Ie(_e,De){if(typeof _e!="number")throw new Ce.ERR_INVALID_ARG_TYPE(De,"number",_e)}function Ve(_e,De,Be){throw Math.floor(_e)!==_e?(Ie(_e,Be),new Ce.ERR_OUT_OF_RANGE(Be||"offset","an integer",_e)):De<0?new Ce.ERR_BUFFER_OUT_OF_BOUNDS:new Ce.ERR_OUT_OF_RANGE(Be||"offset",">= ".concat(Be?1:0," and <= ").concat(De),_e)}Le("ERR_BUFFER_OUT_OF_BOUNDS",function(_e){return _e?"".concat(_e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),Le("ERR_INVALID_ARG_TYPE",function(_e,De){return'The "'.concat(_e,'" argument must be of type number. Received type ').concat(x(De))},TypeError),Le("ERR_OUT_OF_RANGE",function(_e,De,Be){var Ge='The value of "'.concat(_e,'" is out of range.'),tt=Be;return Number.isInteger(Be)&&Math.abs(Be)>Math.pow(2,32)?tt=Oe(String(Be)):typeof Be=="bigint"&&(tt=String(Be),(Be>Math.pow(BigInt(2),BigInt(32))||Be<-Math.pow(BigInt(2),BigInt(32)))&&(tt=Oe(tt)),tt+="n"),Ge+" It must be ".concat(De,". Received ").concat(tt)},RangeError);var Pe=/[^+/0-9A-Za-z-_]/g;function de(_e,De){var Be;De=De||1/0;for(var Ge=_e.length,tt=null,nt=[],ft=0;ft55295&&Be<57344){if(!tt){if(Be>56319){(De-=3)>-1&&nt.push(239,191,189);continue}if(ft+1===Ge){(De-=3)>-1&&nt.push(239,191,189);continue}tt=Be;continue}if(Be<56320){(De-=3)>-1&&nt.push(239,191,189),tt=Be;continue}Be=65536+(tt-55296<<10|Be-56320)}else tt&&(De-=3)>-1&&nt.push(239,191,189);if(tt=null,Be<128){if((De-=1)<0)break;nt.push(Be)}else if(Be<2048){if((De-=2)<0)break;nt.push(Be>>6|192,63&Be|128)}else if(Be<65536){if((De-=3)<0)break;nt.push(Be>>12|224,Be>>6&63|128,63&Be|128)}else{if(!(Be<1114112))throw new Error("Invalid code point");if((De-=4)<0)break;nt.push(Be>>18|240,Be>>12&63|128,Be>>6&63|128,63&Be|128)}}return nt}function Me(_e){return m.toByteArray(function(De){if((De=(De=De.split("=")[0]).trim().replace(Pe,"")).length<2)return"";for(;De.length%4!=0;)De+="=";return De}(_e))}function ke(_e,De,Be,Ge){var tt;for(tt=0;tt=De.length||tt>=_e.length);++tt)De[tt+Be]=_e[tt];return tt}function He(_e,De){return _e instanceof De||_e!=null&&_e.constructor!=null&&_e.constructor.name!=null&&_e.constructor.name===De.name}function Fe(_e){return _e!=_e}var qe=function(){for(var _e="0123456789abcdef",De=new Array(256),Be=0;Be<16;++Be)for(var Ge=16*Be,tt=0;tt<16;++tt)De[Ge+tt]=_e[Be]+_e[tt];return De}();function $e(_e){return typeof BigInt>"u"?Ye:_e}function Ye(){throw new Error("BigInt not supported")}},9216:function(u){u.exports=o,u.exports.isMobile=o,u.exports.default=o;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/,l=/android|ipad|playbook|silk/i;function o(s){s||(s={});var c=s.ua;if(c||typeof navigator>"u"||(c=navigator.userAgent),c&&c.headers&&typeof c.headers["user-agent"]=="string"&&(c=c.headers["user-agent"]),typeof c!="string")return!1;var h=r.test(c)&&!n.test(c)||!!s.tablet&&l.test(c);return!h&&s.tablet&&s.featureDetect&&navigator&&navigator.maxTouchPoints>1&&c.indexOf("Macintosh")!==-1&&c.indexOf("Safari")!==-1&&(h=!0),h}},6296:function(u,r,n){u.exports=function(x){var m=(x=x||{}).eye||[0,0,1],g=x.center||[0,0,0],k=x.up||[0,1,0],A=x.distanceLimits||[0,1/0],v=x.mode||"turntable",S=l(),T=o(),p=s();return S.setDistanceLimits(A[0],A[1]),S.lookAt(0,m,g,k),T.setDistanceLimits(A[0],A[1]),T.lookAt(0,m,g,k),p.setDistanceLimits(A[0],A[1]),p.lookAt(0,m,g,k),new c({turntable:S,orbit:T,matrix:p},v)};var l=n(7261),o=n(9977),s=n(4192);function c(x,m){this._controllerNames=Object.keys(x),this._controllerList=this._controllerNames.map(function(g){return x[g]}),this._mode=m,this._active=x[m],this._active||(this._mode="turntable",this._active=x.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 h=c.prototype;h.flush=function(x){for(var m=this._controllerList,g=0;g"u"?n(1538):WeakMap,o=n(2762),s=n(8116),c=new l;u.exports=function(h){var x=c.get(h),m=x&&(x._triangleBuffer.handle||x._triangleBuffer.buffer);if(!m||!h.isBuffer(m)){var g=o(h,new Float32Array([-1,-1,-1,4,4,-1]));(x=s(h,[{buffer:g,type:h.FLOAT,size:2}]))._triangleBuffer=g,c.set(h,x)}x.bind(),h.drawArrays(h.TRIANGLES,0,3),x.unbind()}},1085:function(u,r,n){var l=n(1371);u.exports=function(o,s,c){s=typeof s=="number"?s:1,c=c||": ";var h=o.split(/\r?\n/),x=String(h.length+s-1).length;return h.map(function(m,g){var k=g+s,A=String(k).length;return l(k,x-A)+c+m}).join(` +`)}},3952:function(u,r,n){u.exports=function(s){var c=s.length;if(c===0)return[];if(c===1)return[0];for(var h=s[0].length,x=[s[0]],m=[0],g=1;g0?v-4:v;for(k=0;k>16&255,T[p++]=g>>8&255,T[p++]=255&g;return S===2&&(g=l[m.charCodeAt(k)]<<2|l[m.charCodeAt(k+1)]>>4,T[p++]=255&g),S===1&&(g=l[m.charCodeAt(k)]<<10|l[m.charCodeAt(k+1)]<<4|l[m.charCodeAt(k+2)]>>2,T[p++]=g>>8&255,T[p++]=255&g),T},r.fromByteArray=function(m){for(var g,k=m.length,A=k%3,v=[],S=16383,T=0,p=k-A;Tp?p:T+S));return A===1?(g=m[k-1],v.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(m[k-2]<<8)+m[k-1],v.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),v.join("")};for(var n=[],l=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0;c<64;++c)n[c]=s[c],l[s.charCodeAt(c)]=c;function h(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=m.indexOf("=");return k===-1&&(k=g),[k,k===g?0:4-k%4]}function x(m,g,k){for(var A,v,S=[],T=g;T>18&63]+n[v>>12&63]+n[v>>6&63]+n[63&v]);return S.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},3865:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[1]).add(s[0].mul(o[1])),o[1].mul(s[1]))}},1318:function(u){u.exports=function(r,n){return r[0].mul(n[1]).cmp(n[0].mul(r[1]))}},8697:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[1]),o[1].mul(s[0]))}},7842:function(u,r,n){var l=n(6330),o=n(1533),s=n(2651),c=n(4387),h=n(869),x=n(8697);u.exports=function m(g,k){if(l(g))return k?x(g,m(k)):[g[0].clone(),g[1].clone()];var A,v,S=0;if(o(g))A=g.clone();else if(typeof g=="string")A=c(g);else{if(g===0)return[s(0),s(1)];if(g===Math.floor(g))A=s(g);else{for(;g!==Math.floor(g);)g*=Math.pow(2,256),S-=256;A=s(g)}}if(l(k))A.mul(k[1]),v=k[0].clone();else if(o(k))v=k.clone();else if(typeof k=="string")v=c(k);else if(k)if(k===Math.floor(k))v=s(k);else{for(;k!==Math.floor(k);)k*=Math.pow(2,256),S+=256;v=s(k)}else v=s(1);return S>0?A=A.ushln(S):S<0&&(v=v.ushln(-S)),h(A,v)}},6330:function(u,r,n){var l=n(1533);u.exports=function(o){return Array.isArray(o)&&o.length===2&&l(o[0])&&l(o[1])}},5716:function(u,r,n){var l=n(6859);u.exports=function(o){return o.cmp(new l(0))}},1369:function(u,r,n){var l=n(5716);u.exports=function(o){var s=o.length,c=o.words,h=0;if(s===1)h=c[0];else if(s===2)h=c[0]+67108864*c[1];else for(var x=0;x20?52:h+32}},1533:function(u,r,n){n(6859),u.exports=function(l){return l&&typeof l=="object"&&!!l.words}},2651:function(u,r,n){var l=n(6859),o=n(2361);u.exports=function(s){var c=o.exponent(s);return c<52?new l(s):new l(s*Math.pow(2,52-c)).ushln(c-52)}},869:function(u,r,n){var l=n(2651),o=n(5716);u.exports=function(s,c){var h=o(s),x=o(c);if(h===0)return[l(0),l(1)];if(x===0)return[l(0),l(0)];x<0&&(s=s.neg(),c=c.neg());var m=s.gcd(c);return m.cmpn(1)?[s.div(m),c.div(m)]:[s,c]}},4387:function(u,r,n){var l=n(6859);u.exports=function(o){return new l(o)}},6504:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[0]),o[1].mul(s[1]))}},7721:function(u,r,n){var l=n(5716);u.exports=function(o){return l(o[0])*l(o[1])}},5572:function(u,r,n){var l=n(869);u.exports=function(o,s){return l(o[0].mul(s[1]).sub(o[1].mul(s[0])),o[1].mul(s[1]))}},946:function(u,r,n){var l=n(1369),o=n(4025);u.exports=function(s){var c=s[0],h=s[1];if(c.cmpn(0)===0)return 0;var x=c.abs().divmod(h.abs()),m=x.div,g=l(m),k=x.mod,A=c.negative!==h.negative?-1:1;if(k.cmpn(0)===0)return A*g;if(g){var v=o(g)+4;return A*(g+(T=l(k.ushln(v).divRound(h)))*Math.pow(2,-v))}var S=h.bitLength()-k.bitLength()+53,T=l(k.ushln(S).divRound(h));return S<1023?A*T*Math.pow(2,-S):A*(T*=Math.pow(2,-1023))*Math.pow(2,1023-S)}},2478:function(u){function r(h,x,m,g,k){for(var A=k+1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)>=0?(A=v,k=v-1):g=v+1}return A}function n(h,x,m,g,k){for(var A=k+1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)>0?(A=v,k=v-1):g=v+1}return A}function l(h,x,m,g,k){for(var A=g-1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)<0?(A=v,g=v+1):k=v-1}return A}function o(h,x,m,g,k){for(var A=g-1;g<=k;){var v=g+k>>>1,S=h[v];(m!==void 0?m(S,x):S-x)<=0?(A=v,g=v+1):k=v-1}return A}function s(h,x,m,g,k){for(;g<=k;){var A=g+k>>>1,v=h[A],S=m!==void 0?m(v,x):v-x;if(S===0)return A;S<=0?g=A+1:k=A-1}return-1}function c(h,x,m,g,k,A){return typeof m=="function"?A(h,x,m,g===void 0?0:0|g,k===void 0?h.length-1:0|k):A(h,x,void 0,m===void 0?0:0|m,g===void 0?h.length-1:0|g)}u.exports={ge:function(h,x,m,g,k){return c(h,x,m,g,k,r)},gt:function(h,x,m,g,k){return c(h,x,m,g,k,n)},lt:function(h,x,m,g,k){return c(h,x,m,g,k,l)},le:function(h,x,m,g,k){return c(h,x,m,g,k,o)},eq:function(h,x,m,g,k){return c(h,x,m,g,k,s)}}},8828:function(u,r){function n(o){var s=32;return(o&=-o)&&s--,65535&o&&(s-=16),16711935&o&&(s-=8),252645135&o&&(s-=4),858993459&o&&(s-=2),1431655765&o&&(s-=1),s}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-2147483648,r.sign=function(o){return(o>0)-(o<0)},r.abs=function(o){var s=o>>31;return(o^s)-s},r.min=function(o,s){return s^(o^s)&-(o65535)<<4,s|=c=((o>>>=s)>255)<<3,s|=c=((o>>>=c)>15)<<2,(s|=c=((o>>>=c)>3)<<1)|(o>>>=c)>>1},r.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},r.popCount=function(o){return 16843009*((o=(858993459&(o-=o>>>1&1431655765))+(o>>>2&858993459))+(o>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,1+(o|=o>>>16)},r.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,(o|=o>>>16)-(o>>>1)},r.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,27030>>>(o&=15)&1};var l=new Array(256);(function(o){for(var s=0;s<256;++s){var c=s,h=s,x=7;for(c>>>=1;c;c>>>=1)h<<=1,h|=1&c,--x;o[s]=h<>>8&255]<<16|l[o>>>16&255]<<8|l[o>>>24&255]},r.interleave2=function(o,s){return(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o&=65535)|o<<8))|o<<4))|o<<2))|o<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s&=65535)|s<<8))|s<<4))|s<<2))|s<<1))<<1},r.deinterleave2=function(o,s){return(o=65535&((o=16711935&((o=252645135&((o=858993459&((o=o>>>s&1431655765)|o>>>1))|o>>>2))|o>>>4))|o>>>16))<<16>>16},r.interleave3=function(o,s,c){return o=1227133513&((o=3272356035&((o=251719695&((o=4278190335&((o&=1023)|o<<16))|o<<8))|o<<4))|o<<2),(o|=(s=1227133513&((s=3272356035&((s=251719695&((s=4278190335&((s&=1023)|s<<16))|s<<8))|s<<4))|s<<2))<<1)|(c=1227133513&((c=3272356035&((c=251719695&((c=4278190335&((c&=1023)|c<<16))|c<<8))|c<<4))|c<<2))<<2},r.deinterleave3=function(o,s){return(o=1023&((o=4278190335&((o=251719695&((o=3272356035&((o=o>>>s&1227133513)|o>>>2))|o>>>4))|o>>>8))|o>>>16))<<22>>22},r.nextCombination=function(o){var s=o|o-1;return s+1|(~s&-~s)-1>>>n(o)+1}},6859:function(u,r,n){(function(l,o){function s(H,J){if(!H)throw new Error(J||"Assertion failed")}function c(H,J){H.super_=J;var Q=function(){};Q.prototype=J.prototype,H.prototype=new Q,H.prototype.constructor=H}function h(H,J,Q){if(h.isBN(H))return H;this.negative=0,this.words=null,this.length=0,this.red=null,H!==null&&(J!=="le"&&J!=="be"||(Q=J,J=10),this._init(H||0,J||10,Q||"be"))}var x;typeof l=="object"?l.exports=h:o.BN=h,h.BN=h,h.wordSize=26;try{x=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:n(7790).Buffer}catch{}function m(H,J){var Q=H.charCodeAt(J);return Q>=65&&Q<=70?Q-55:Q>=97&&Q<=102?Q-87:Q-48&15}function g(H,J,Q){var Z=m(H,Q);return Q-1>=J&&(Z|=m(H,Q-1)<<4),Z}function k(H,J,Q,Z){for(var K=0,ae=Math.min(H.length,Q),se=J;se=49?he-49+10:he>=17?he-17+10:he}return K}h.isBN=function(H){return H instanceof h||H!==null&&typeof H=="object"&&H.constructor.wordSize===h.wordSize&&Array.isArray(H.words)},h.max=function(H,J){return H.cmp(J)>0?H:J},h.min=function(H,J){return H.cmp(J)<0?H:J},h.prototype._init=function(H,J,Q){if(typeof H=="number")return this._initNumber(H,J,Q);if(typeof H=="object")return this._initArray(H,J,Q);J==="hex"&&(J=16),s(J===(0|J)&&J>=2&&J<=36);var Z=0;(H=H.toString().replace(/\s+/g,""))[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)ae=H[Z]|H[Z-1]<<8|H[Z-2]<<16,this.words[K]|=ae<>>26-se&67108863,(se+=24)>=26&&(se-=26,K++);else if(Q==="le")for(Z=0,K=0;Z>>26-se&67108863,(se+=24)>=26&&(se-=26,K++);return this.strip()},h.prototype._parseHex=function(H,J,Q){this.length=Math.ceil((H.length-J)/6),this.words=new Array(this.length);for(var Z=0;Z=J;Z-=2)K=g(H,J,Z)<=18?(ae-=18,se+=1,this.words[se]|=K>>>26):ae+=8;else for(Z=(H.length-J)%2==0?J+1:J;Z=18?(ae-=18,se+=1,this.words[se]|=K>>>26):ae+=8;this.strip()},h.prototype._parseBase=function(H,J,Q){this.words=[0],this.length=1;for(var Z=0,K=1;K<=67108863;K*=J)Z++;Z--,K=K/J|0;for(var ae=H.length-Q,se=ae%Z,he=Math.min(ae,ae-se)+Q,fe=0,ie=Q;ie1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},h.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},h.prototype.inspect=function(){return(this.red?""};var A=["","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"],v=[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],S=[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 T(H,J,Q){Q.negative=J.negative^H.negative;var Z=H.length+J.length|0;Q.length=Z,Z=Z-1|0;var K=0|H.words[0],ae=0|J.words[0],se=K*ae,he=67108863&se,fe=se/67108864|0;Q.words[0]=he;for(var ie=1;ie>>26,le=67108863&fe,ge=Math.min(ie,J.length-1),ye=Math.max(0,ie-H.length+1);ye<=ge;ye++){var me=ie-ye|0;oe+=(se=(K=0|H.words[me])*(ae=0|J.words[ye])+le)/67108864|0,le=67108863&se}Q.words[ie]=0|le,fe=0|oe}return fe!==0?Q.words[ie]=0|fe:Q.length--,Q.strip()}h.prototype.toString=function(H,J){var Q;if(J=0|J||1,(H=H||10)===16||H==="hex"){Q="";for(var Z=0,K=0,ae=0;ae>>24-Z&16777215)!=0||ae!==this.length-1?A[6-he.length]+he+Q:he+Q,(Z+=2)>=26&&(Z-=26,ae--)}for(K!==0&&(Q=K.toString(16)+Q);Q.length%J!=0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}if(H===(0|H)&&H>=2&&H<=36){var fe=v[H],ie=S[H];Q="";var oe=this.clone();for(oe.negative=0;!oe.isZero();){var le=oe.modn(ie).toString(H);Q=(oe=oe.idivn(ie)).isZero()?le+Q:A[fe-le.length]+le+Q}for(this.isZero()&&(Q="0"+Q);Q.length%J!=0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}s(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var H=this.words[0];return this.length===2?H+=67108864*this.words[1]:this.length===3&&this.words[2]===1?H+=4503599627370496+67108864*this.words[1]:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-H:H},h.prototype.toJSON=function(){return this.toString(16)},h.prototype.toBuffer=function(H,J){return s(x!==void 0),this.toArrayLike(x,H,J)},h.prototype.toArray=function(H,J){return this.toArrayLike(Array,H,J)},h.prototype.toArrayLike=function(H,J,Q){var Z=this.byteLength(),K=Q||Math.max(1,Z);s(Z<=K,"byte array longer than desired length"),s(K>0,"Requested array length <= 0"),this.strip();var ae,se,he=J==="le",fe=new H(K),ie=this.clone();if(he){for(se=0;!ie.isZero();se++)ae=ie.andln(255),ie.iushrn(8),fe[se]=ae;for(;se=4096&&(Q+=13,J>>>=13),J>=64&&(Q+=7,J>>>=7),J>=8&&(Q+=4,J>>>=4),J>=2&&(Q+=2,J>>>=2),Q+J},h.prototype._zeroBits=function(H){if(H===0)return 26;var J=H,Q=0;return!(8191&J)&&(Q+=13,J>>>=13),!(127&J)&&(Q+=7,J>>>=7),!(15&J)&&(Q+=4,J>>>=4),!(3&J)&&(Q+=2,J>>>=2),!(1&J)&&Q++,Q},h.prototype.bitLength=function(){var H=this.words[this.length-1],J=this._countBits(H);return 26*(this.length-1)+J},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var H=0,J=0;JH.length?this.clone().ior(H):H.clone().ior(this)},h.prototype.uor=function(H){return this.length>H.length?this.clone().iuor(H):H.clone().iuor(this)},h.prototype.iuand=function(H){var J;J=this.length>H.length?H:this;for(var Q=0;QH.length?this.clone().iand(H):H.clone().iand(this)},h.prototype.uand=function(H){return this.length>H.length?this.clone().iuand(H):H.clone().iuand(this)},h.prototype.iuxor=function(H){var J,Q;this.length>H.length?(J=this,Q=H):(J=H,Q=this);for(var Z=0;ZH.length?this.clone().ixor(H):H.clone().ixor(this)},h.prototype.uxor=function(H){return this.length>H.length?this.clone().iuxor(H):H.clone().iuxor(this)},h.prototype.inotn=function(H){s(typeof H=="number"&&H>=0);var J=0|Math.ceil(H/26),Q=H%26;this._expand(J),Q>0&&J--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-Q),this.strip()},h.prototype.notn=function(H){return this.clone().inotn(H)},h.prototype.setn=function(H,J){s(typeof H=="number"&&H>=0);var Q=H/26|0,Z=H%26;return this._expand(Q+1),this.words[Q]=J?this.words[Q]|1<H.length?(Q=this,Z=H):(Q=H,Z=this);for(var K=0,ae=0;ae>>26;for(;K!==0&&ae>>26;if(this.length=Q.length,K!==0)this.words[this.length]=K,this.length++;else if(Q!==this)for(;aeH.length?this.clone().iadd(H):H.clone().iadd(this)},h.prototype.isub=function(H){if(H.negative!==0){H.negative=0;var J=this.iadd(H);return H.negative=1,J._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(H),this.negative=1,this._normSign();var Q,Z,K=this.cmp(H);if(K===0)return this.negative=0,this.length=1,this.words[0]=0,this;K>0?(Q=this,Z=H):(Q=H,Z=this);for(var ae=0,se=0;se>26,this.words[se]=67108863&J;for(;ae!==0&&se>26,this.words[se]=67108863&J;if(ae===0&&se>>13,ye=0|se[1],me=8191&ye,be=ye>>>13,Se=0|se[2],Ee=8191&Se,Ce=Se>>>13,Le=0|se[3],Oe=8191&Le,We=Le>>>13,Ie=0|se[4],Ve=8191&Ie,Pe=Ie>>>13,de=0|se[5],Me=8191&de,ke=de>>>13,He=0|se[6],Fe=8191&He,qe=He>>>13,$e=0|se[7],Ye=8191&$e,_e=$e>>>13,De=0|se[8],Be=8191&De,Ge=De>>>13,tt=0|se[9],nt=8191&tt,ft=tt>>>13,At=0|he[0],kt=8191&At,Vt=At>>>13,Ht=0|he[1],Gt=8191&Ht,st=Ht>>>13,Qe=0|he[2],pt=8191&Qe,yt=Qe>>>13,Ot=0|he[3],Pt=8191&Ot,at=Ot>>>13,lt=0|he[4],Xe=8191<,ut=lt>>>13,wt=0|he[5],vt=8191&wt,Lt=wt>>>13,jt=0|he[6],rt=8191&jt,et=jt>>>13,Et=0|he[7],Bt=8191&Et,Ft=Et>>>13,St=0|he[8],Jt=8191&St,qt=St>>>13,en=0|he[9],Wt=8191&en,Zt=en>>>13;Q.negative=H.negative^J.negative,Q.length=19;var on=(ie+(Z=Math.imul(le,kt))|0)+((8191&(K=(K=Math.imul(le,Vt))+Math.imul(ge,kt)|0))<<13)|0;ie=((ae=Math.imul(ge,Vt))+(K>>>13)|0)+(on>>>26)|0,on&=67108863,Z=Math.imul(me,kt),K=(K=Math.imul(me,Vt))+Math.imul(be,kt)|0,ae=Math.imul(be,Vt);var un=(ie+(Z=Z+Math.imul(le,Gt)|0)|0)+((8191&(K=(K=K+Math.imul(le,st)|0)+Math.imul(ge,Gt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,st)|0)+(K>>>13)|0)+(un>>>26)|0,un&=67108863,Z=Math.imul(Ee,kt),K=(K=Math.imul(Ee,Vt))+Math.imul(Ce,kt)|0,ae=Math.imul(Ce,Vt),Z=Z+Math.imul(me,Gt)|0,K=(K=K+Math.imul(me,st)|0)+Math.imul(be,Gt)|0,ae=ae+Math.imul(be,st)|0;var Pn=(ie+(Z=Z+Math.imul(le,pt)|0)|0)+((8191&(K=(K=K+Math.imul(le,yt)|0)+Math.imul(ge,pt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,yt)|0)+(K>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,Z=Math.imul(Oe,kt),K=(K=Math.imul(Oe,Vt))+Math.imul(We,kt)|0,ae=Math.imul(We,Vt),Z=Z+Math.imul(Ee,Gt)|0,K=(K=K+Math.imul(Ee,st)|0)+Math.imul(Ce,Gt)|0,ae=ae+Math.imul(Ce,st)|0,Z=Z+Math.imul(me,pt)|0,K=(K=K+Math.imul(me,yt)|0)+Math.imul(be,pt)|0,ae=ae+Math.imul(be,yt)|0;var Dn=(ie+(Z=Z+Math.imul(le,Pt)|0)|0)+((8191&(K=(K=K+Math.imul(le,at)|0)+Math.imul(ge,Pt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,at)|0)+(K>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,Z=Math.imul(Ve,kt),K=(K=Math.imul(Ve,Vt))+Math.imul(Pe,kt)|0,ae=Math.imul(Pe,Vt),Z=Z+Math.imul(Oe,Gt)|0,K=(K=K+Math.imul(Oe,st)|0)+Math.imul(We,Gt)|0,ae=ae+Math.imul(We,st)|0,Z=Z+Math.imul(Ee,pt)|0,K=(K=K+Math.imul(Ee,yt)|0)+Math.imul(Ce,pt)|0,ae=ae+Math.imul(Ce,yt)|0,Z=Z+Math.imul(me,Pt)|0,K=(K=K+Math.imul(me,at)|0)+Math.imul(be,Pt)|0,ae=ae+Math.imul(be,at)|0;var In=(ie+(Z=Z+Math.imul(le,Xe)|0)|0)+((8191&(K=(K=K+Math.imul(le,ut)|0)+Math.imul(ge,Xe)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,ut)|0)+(K>>>13)|0)+(In>>>26)|0,In&=67108863,Z=Math.imul(Me,kt),K=(K=Math.imul(Me,Vt))+Math.imul(ke,kt)|0,ae=Math.imul(ke,Vt),Z=Z+Math.imul(Ve,Gt)|0,K=(K=K+Math.imul(Ve,st)|0)+Math.imul(Pe,Gt)|0,ae=ae+Math.imul(Pe,st)|0,Z=Z+Math.imul(Oe,pt)|0,K=(K=K+Math.imul(Oe,yt)|0)+Math.imul(We,pt)|0,ae=ae+Math.imul(We,yt)|0,Z=Z+Math.imul(Ee,Pt)|0,K=(K=K+Math.imul(Ee,at)|0)+Math.imul(Ce,Pt)|0,ae=ae+Math.imul(Ce,at)|0,Z=Z+Math.imul(me,Xe)|0,K=(K=K+Math.imul(me,ut)|0)+Math.imul(be,Xe)|0,ae=ae+Math.imul(be,ut)|0;var mn=(ie+(Z=Z+Math.imul(le,vt)|0)|0)+((8191&(K=(K=K+Math.imul(le,Lt)|0)+Math.imul(ge,vt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,Lt)|0)+(K>>>13)|0)+(mn>>>26)|0,mn&=67108863,Z=Math.imul(Fe,kt),K=(K=Math.imul(Fe,Vt))+Math.imul(qe,kt)|0,ae=Math.imul(qe,Vt),Z=Z+Math.imul(Me,Gt)|0,K=(K=K+Math.imul(Me,st)|0)+Math.imul(ke,Gt)|0,ae=ae+Math.imul(ke,st)|0,Z=Z+Math.imul(Ve,pt)|0,K=(K=K+Math.imul(Ve,yt)|0)+Math.imul(Pe,pt)|0,ae=ae+Math.imul(Pe,yt)|0,Z=Z+Math.imul(Oe,Pt)|0,K=(K=K+Math.imul(Oe,at)|0)+Math.imul(We,Pt)|0,ae=ae+Math.imul(We,at)|0,Z=Z+Math.imul(Ee,Xe)|0,K=(K=K+Math.imul(Ee,ut)|0)+Math.imul(Ce,Xe)|0,ae=ae+Math.imul(Ce,ut)|0,Z=Z+Math.imul(me,vt)|0,K=(K=K+Math.imul(me,Lt)|0)+Math.imul(be,vt)|0,ae=ae+Math.imul(be,Lt)|0;var En=(ie+(Z=Z+Math.imul(le,rt)|0)|0)+((8191&(K=(K=K+Math.imul(le,et)|0)+Math.imul(ge,rt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,et)|0)+(K>>>13)|0)+(En>>>26)|0,En&=67108863,Z=Math.imul(Ye,kt),K=(K=Math.imul(Ye,Vt))+Math.imul(_e,kt)|0,ae=Math.imul(_e,Vt),Z=Z+Math.imul(Fe,Gt)|0,K=(K=K+Math.imul(Fe,st)|0)+Math.imul(qe,Gt)|0,ae=ae+Math.imul(qe,st)|0,Z=Z+Math.imul(Me,pt)|0,K=(K=K+Math.imul(Me,yt)|0)+Math.imul(ke,pt)|0,ae=ae+Math.imul(ke,yt)|0,Z=Z+Math.imul(Ve,Pt)|0,K=(K=K+Math.imul(Ve,at)|0)+Math.imul(Pe,Pt)|0,ae=ae+Math.imul(Pe,at)|0,Z=Z+Math.imul(Oe,Xe)|0,K=(K=K+Math.imul(Oe,ut)|0)+Math.imul(We,Xe)|0,ae=ae+Math.imul(We,ut)|0,Z=Z+Math.imul(Ee,vt)|0,K=(K=K+Math.imul(Ee,Lt)|0)+Math.imul(Ce,vt)|0,ae=ae+Math.imul(Ce,Lt)|0,Z=Z+Math.imul(me,rt)|0,K=(K=K+Math.imul(me,et)|0)+Math.imul(be,rt)|0,ae=ae+Math.imul(be,et)|0;var Kn=(ie+(Z=Z+Math.imul(le,Bt)|0)|0)+((8191&(K=(K=K+Math.imul(le,Ft)|0)+Math.imul(ge,Bt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,Ft)|0)+(K>>>13)|0)+(Kn>>>26)|0,Kn&=67108863,Z=Math.imul(Be,kt),K=(K=Math.imul(Be,Vt))+Math.imul(Ge,kt)|0,ae=Math.imul(Ge,Vt),Z=Z+Math.imul(Ye,Gt)|0,K=(K=K+Math.imul(Ye,st)|0)+Math.imul(_e,Gt)|0,ae=ae+Math.imul(_e,st)|0,Z=Z+Math.imul(Fe,pt)|0,K=(K=K+Math.imul(Fe,yt)|0)+Math.imul(qe,pt)|0,ae=ae+Math.imul(qe,yt)|0,Z=Z+Math.imul(Me,Pt)|0,K=(K=K+Math.imul(Me,at)|0)+Math.imul(ke,Pt)|0,ae=ae+Math.imul(ke,at)|0,Z=Z+Math.imul(Ve,Xe)|0,K=(K=K+Math.imul(Ve,ut)|0)+Math.imul(Pe,Xe)|0,ae=ae+Math.imul(Pe,ut)|0,Z=Z+Math.imul(Oe,vt)|0,K=(K=K+Math.imul(Oe,Lt)|0)+Math.imul(We,vt)|0,ae=ae+Math.imul(We,Lt)|0,Z=Z+Math.imul(Ee,rt)|0,K=(K=K+Math.imul(Ee,et)|0)+Math.imul(Ce,rt)|0,ae=ae+Math.imul(Ce,et)|0,Z=Z+Math.imul(me,Bt)|0,K=(K=K+Math.imul(me,Ft)|0)+Math.imul(be,Bt)|0,ae=ae+Math.imul(be,Ft)|0;var Ln=(ie+(Z=Z+Math.imul(le,Jt)|0)|0)+((8191&(K=(K=K+Math.imul(le,qt)|0)+Math.imul(ge,Jt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,qt)|0)+(K>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,Z=Math.imul(nt,kt),K=(K=Math.imul(nt,Vt))+Math.imul(ft,kt)|0,ae=Math.imul(ft,Vt),Z=Z+Math.imul(Be,Gt)|0,K=(K=K+Math.imul(Be,st)|0)+Math.imul(Ge,Gt)|0,ae=ae+Math.imul(Ge,st)|0,Z=Z+Math.imul(Ye,pt)|0,K=(K=K+Math.imul(Ye,yt)|0)+Math.imul(_e,pt)|0,ae=ae+Math.imul(_e,yt)|0,Z=Z+Math.imul(Fe,Pt)|0,K=(K=K+Math.imul(Fe,at)|0)+Math.imul(qe,Pt)|0,ae=ae+Math.imul(qe,at)|0,Z=Z+Math.imul(Me,Xe)|0,K=(K=K+Math.imul(Me,ut)|0)+Math.imul(ke,Xe)|0,ae=ae+Math.imul(ke,ut)|0,Z=Z+Math.imul(Ve,vt)|0,K=(K=K+Math.imul(Ve,Lt)|0)+Math.imul(Pe,vt)|0,ae=ae+Math.imul(Pe,Lt)|0,Z=Z+Math.imul(Oe,rt)|0,K=(K=K+Math.imul(Oe,et)|0)+Math.imul(We,rt)|0,ae=ae+Math.imul(We,et)|0,Z=Z+Math.imul(Ee,Bt)|0,K=(K=K+Math.imul(Ee,Ft)|0)+Math.imul(Ce,Bt)|0,ae=ae+Math.imul(Ce,Ft)|0,Z=Z+Math.imul(me,Jt)|0,K=(K=K+Math.imul(me,qt)|0)+Math.imul(be,Jt)|0,ae=ae+Math.imul(be,qt)|0;var Tn=(ie+(Z=Z+Math.imul(le,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(le,Zt)|0)+Math.imul(ge,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(ge,Zt)|0)+(K>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,Z=Math.imul(nt,Gt),K=(K=Math.imul(nt,st))+Math.imul(ft,Gt)|0,ae=Math.imul(ft,st),Z=Z+Math.imul(Be,pt)|0,K=(K=K+Math.imul(Be,yt)|0)+Math.imul(Ge,pt)|0,ae=ae+Math.imul(Ge,yt)|0,Z=Z+Math.imul(Ye,Pt)|0,K=(K=K+Math.imul(Ye,at)|0)+Math.imul(_e,Pt)|0,ae=ae+Math.imul(_e,at)|0,Z=Z+Math.imul(Fe,Xe)|0,K=(K=K+Math.imul(Fe,ut)|0)+Math.imul(qe,Xe)|0,ae=ae+Math.imul(qe,ut)|0,Z=Z+Math.imul(Me,vt)|0,K=(K=K+Math.imul(Me,Lt)|0)+Math.imul(ke,vt)|0,ae=ae+Math.imul(ke,Lt)|0,Z=Z+Math.imul(Ve,rt)|0,K=(K=K+Math.imul(Ve,et)|0)+Math.imul(Pe,rt)|0,ae=ae+Math.imul(Pe,et)|0,Z=Z+Math.imul(Oe,Bt)|0,K=(K=K+Math.imul(Oe,Ft)|0)+Math.imul(We,Bt)|0,ae=ae+Math.imul(We,Ft)|0,Z=Z+Math.imul(Ee,Jt)|0,K=(K=K+Math.imul(Ee,qt)|0)+Math.imul(Ce,Jt)|0,ae=ae+Math.imul(Ce,qt)|0;var Fn=(ie+(Z=Z+Math.imul(me,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(me,Zt)|0)+Math.imul(be,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(be,Zt)|0)+(K>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,Z=Math.imul(nt,pt),K=(K=Math.imul(nt,yt))+Math.imul(ft,pt)|0,ae=Math.imul(ft,yt),Z=Z+Math.imul(Be,Pt)|0,K=(K=K+Math.imul(Be,at)|0)+Math.imul(Ge,Pt)|0,ae=ae+Math.imul(Ge,at)|0,Z=Z+Math.imul(Ye,Xe)|0,K=(K=K+Math.imul(Ye,ut)|0)+Math.imul(_e,Xe)|0,ae=ae+Math.imul(_e,ut)|0,Z=Z+Math.imul(Fe,vt)|0,K=(K=K+Math.imul(Fe,Lt)|0)+Math.imul(qe,vt)|0,ae=ae+Math.imul(qe,Lt)|0,Z=Z+Math.imul(Me,rt)|0,K=(K=K+Math.imul(Me,et)|0)+Math.imul(ke,rt)|0,ae=ae+Math.imul(ke,et)|0,Z=Z+Math.imul(Ve,Bt)|0,K=(K=K+Math.imul(Ve,Ft)|0)+Math.imul(Pe,Bt)|0,ae=ae+Math.imul(Pe,Ft)|0,Z=Z+Math.imul(Oe,Jt)|0,K=(K=K+Math.imul(Oe,qt)|0)+Math.imul(We,Jt)|0,ae=ae+Math.imul(We,qt)|0;var wn=(ie+(Z=Z+Math.imul(Ee,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Ee,Zt)|0)+Math.imul(Ce,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(Ce,Zt)|0)+(K>>>13)|0)+(wn>>>26)|0,wn&=67108863,Z=Math.imul(nt,Pt),K=(K=Math.imul(nt,at))+Math.imul(ft,Pt)|0,ae=Math.imul(ft,at),Z=Z+Math.imul(Be,Xe)|0,K=(K=K+Math.imul(Be,ut)|0)+Math.imul(Ge,Xe)|0,ae=ae+Math.imul(Ge,ut)|0,Z=Z+Math.imul(Ye,vt)|0,K=(K=K+Math.imul(Ye,Lt)|0)+Math.imul(_e,vt)|0,ae=ae+Math.imul(_e,Lt)|0,Z=Z+Math.imul(Fe,rt)|0,K=(K=K+Math.imul(Fe,et)|0)+Math.imul(qe,rt)|0,ae=ae+Math.imul(qe,et)|0,Z=Z+Math.imul(Me,Bt)|0,K=(K=K+Math.imul(Me,Ft)|0)+Math.imul(ke,Bt)|0,ae=ae+Math.imul(ke,Ft)|0,Z=Z+Math.imul(Ve,Jt)|0,K=(K=K+Math.imul(Ve,qt)|0)+Math.imul(Pe,Jt)|0,ae=ae+Math.imul(Pe,qt)|0;var zn=(ie+(Z=Z+Math.imul(Oe,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Oe,Zt)|0)+Math.imul(We,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(We,Zt)|0)+(K>>>13)|0)+(zn>>>26)|0,zn&=67108863,Z=Math.imul(nt,Xe),K=(K=Math.imul(nt,ut))+Math.imul(ft,Xe)|0,ae=Math.imul(ft,ut),Z=Z+Math.imul(Be,vt)|0,K=(K=K+Math.imul(Be,Lt)|0)+Math.imul(Ge,vt)|0,ae=ae+Math.imul(Ge,Lt)|0,Z=Z+Math.imul(Ye,rt)|0,K=(K=K+Math.imul(Ye,et)|0)+Math.imul(_e,rt)|0,ae=ae+Math.imul(_e,et)|0,Z=Z+Math.imul(Fe,Bt)|0,K=(K=K+Math.imul(Fe,Ft)|0)+Math.imul(qe,Bt)|0,ae=ae+Math.imul(qe,Ft)|0,Z=Z+Math.imul(Me,Jt)|0,K=(K=K+Math.imul(Me,qt)|0)+Math.imul(ke,Jt)|0,ae=ae+Math.imul(ke,qt)|0;var Jn=(ie+(Z=Z+Math.imul(Ve,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Ve,Zt)|0)+Math.imul(Pe,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(Pe,Zt)|0)+(K>>>13)|0)+(Jn>>>26)|0,Jn&=67108863,Z=Math.imul(nt,vt),K=(K=Math.imul(nt,Lt))+Math.imul(ft,vt)|0,ae=Math.imul(ft,Lt),Z=Z+Math.imul(Be,rt)|0,K=(K=K+Math.imul(Be,et)|0)+Math.imul(Ge,rt)|0,ae=ae+Math.imul(Ge,et)|0,Z=Z+Math.imul(Ye,Bt)|0,K=(K=K+Math.imul(Ye,Ft)|0)+Math.imul(_e,Bt)|0,ae=ae+Math.imul(_e,Ft)|0,Z=Z+Math.imul(Fe,Jt)|0,K=(K=K+Math.imul(Fe,qt)|0)+Math.imul(qe,Jt)|0,ae=ae+Math.imul(qe,qt)|0;var $n=(ie+(Z=Z+Math.imul(Me,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Me,Zt)|0)+Math.imul(ke,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(ke,Zt)|0)+(K>>>13)|0)+($n>>>26)|0,$n&=67108863,Z=Math.imul(nt,rt),K=(K=Math.imul(nt,et))+Math.imul(ft,rt)|0,ae=Math.imul(ft,et),Z=Z+Math.imul(Be,Bt)|0,K=(K=K+Math.imul(Be,Ft)|0)+Math.imul(Ge,Bt)|0,ae=ae+Math.imul(Ge,Ft)|0,Z=Z+Math.imul(Ye,Jt)|0,K=(K=K+Math.imul(Ye,qt)|0)+Math.imul(_e,Jt)|0,ae=ae+Math.imul(_e,qt)|0;var vr=(ie+(Z=Z+Math.imul(Fe,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Fe,Zt)|0)+Math.imul(qe,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(qe,Zt)|0)+(K>>>13)|0)+(vr>>>26)|0,vr&=67108863,Z=Math.imul(nt,Bt),K=(K=Math.imul(nt,Ft))+Math.imul(ft,Bt)|0,ae=Math.imul(ft,Ft),Z=Z+Math.imul(Be,Jt)|0,K=(K=K+Math.imul(Be,qt)|0)+Math.imul(Ge,Jt)|0,ae=ae+Math.imul(Ge,qt)|0;var Qn=(ie+(Z=Z+Math.imul(Ye,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Ye,Zt)|0)+Math.imul(_e,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(_e,Zt)|0)+(K>>>13)|0)+(Qn>>>26)|0,Qn&=67108863,Z=Math.imul(nt,Jt),K=(K=Math.imul(nt,qt))+Math.imul(ft,Jt)|0,ae=Math.imul(ft,qt);var lr=(ie+(Z=Z+Math.imul(Be,Wt)|0)|0)+((8191&(K=(K=K+Math.imul(Be,Zt)|0)+Math.imul(Ge,Wt)|0))<<13)|0;ie=((ae=ae+Math.imul(Ge,Zt)|0)+(K>>>13)|0)+(lr>>>26)|0,lr&=67108863;var hr=(ie+(Z=Math.imul(nt,Wt))|0)+((8191&(K=(K=Math.imul(nt,Zt))+Math.imul(ft,Wt)|0))<<13)|0;return ie=((ae=Math.imul(ft,Zt))+(K>>>13)|0)+(hr>>>26)|0,hr&=67108863,fe[0]=on,fe[1]=un,fe[2]=Pn,fe[3]=Dn,fe[4]=In,fe[5]=mn,fe[6]=En,fe[7]=Kn,fe[8]=Ln,fe[9]=Tn,fe[10]=Fn,fe[11]=wn,fe[12]=zn,fe[13]=Jn,fe[14]=$n,fe[15]=vr,fe[16]=Qn,fe[17]=lr,fe[18]=hr,ie!==0&&(fe[19]=ie,Q.length++),Q};function M(H,J,Q){return new f().mulp(H,J,Q)}function f(H,J){this.x=H,this.y=J}Math.imul||(p=T),h.prototype.mulTo=function(H,J){var Q,Z=this.length+H.length;return Q=this.length===10&&H.length===10?p(this,H,J):Z<63?T(this,H,J):Z<1024?function(K,ae,se){se.negative=ae.negative^K.negative,se.length=K.length+ae.length;for(var he=0,fe=0,ie=0;ie>>26)|0)>>>26,oe&=67108863}se.words[ie]=le,he=oe,oe=fe}return he!==0?se.words[ie]=he:se.length--,se.strip()}(this,H,J):M(this,H,J),Q},f.prototype.makeRBT=function(H){for(var J=new Array(H),Q=h.prototype._countBits(H)-1,Z=0;Z>=1;return Z},f.prototype.permute=function(H,J,Q,Z,K,ae){for(var se=0;se>>=1)K++;return 1<>>=13,Q[2*ae+1]=8191&K,K>>>=13;for(ae=2*J;ae>=26,J+=Z/67108864|0,J+=K>>>26,this.words[Q]=67108863&K}return J!==0&&(this.words[Q]=J,this.length++),this},h.prototype.muln=function(H){return this.clone().imuln(H)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(H){var J=function(ae){for(var se=new Array(ae.bitLength()),he=0;he>>ie}return se}(H);if(J.length===0)return new h(1);for(var Q=this,Z=0;Z=0);var J,Q=H%26,Z=(H-Q)/26,K=67108863>>>26-Q<<26-Q;if(Q!==0){var ae=0;for(J=0;J>>26-Q}ae&&(this.words[J]=ae,this.length++)}if(Z!==0){for(J=this.length-1;J>=0;J--)this.words[J+Z]=this.words[J];for(J=0;J=0),Z=J?(J-J%26)/26:0;var K=H%26,ae=Math.min((H-K)/26,this.length),se=67108863^67108863>>>K<ae)for(this.length-=ae,fe=0;fe=0&&(ie!==0||fe>=Z);fe--){var oe=0|this.words[fe];this.words[fe]=ie<<26-K|oe>>>K,ie=oe&se}return he&&ie!==0&&(he.words[he.length++]=ie),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},h.prototype.ishrn=function(H,J,Q){return s(this.negative===0),this.iushrn(H,J,Q)},h.prototype.shln=function(H){return this.clone().ishln(H)},h.prototype.ushln=function(H){return this.clone().iushln(H)},h.prototype.shrn=function(H){return this.clone().ishrn(H)},h.prototype.ushrn=function(H){return this.clone().iushrn(H)},h.prototype.testn=function(H){s(typeof H=="number"&&H>=0);var J=H%26,Q=(H-J)/26,Z=1<=0);var J=H%26,Q=(H-J)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=Q)return this;if(J!==0&&Q++,this.length=Math.min(Q,this.length),J!==0){var Z=67108863^67108863>>>J<=67108864;J++)this.words[J]-=67108864,J===this.length-1?this.words[J+1]=1:this.words[J+1]++;return this.length=Math.max(this.length,J+1),this},h.prototype.isubn=function(H){if(s(typeof H=="number"),s(H<67108864),H<0)return this.iaddn(-H);if(this.negative!==0)return this.negative=0,this.iaddn(H),this.negative=1,this;if(this.words[0]-=H,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var J=0;J>26)-(he/67108864|0),this.words[Z+Q]=67108863&K}for(;Z>26,this.words[Z+Q]=67108863&K;if(se===0)return this.strip();for(s(se===-1),se=0,Z=0;Z>26,this.words[Z]=67108863&K;return this.negative=1,this.strip()},h.prototype._wordDiv=function(H,J){var Q=(this.length,H.length),Z=this.clone(),K=H,ae=0|K.words[K.length-1];(Q=26-this._countBits(ae))!=0&&(K=K.ushln(Q),Z.iushln(Q),ae=0|K.words[K.length-1]);var se,he=Z.length-K.length;if(J!=="mod"){(se=new h(null)).length=he+1,se.words=new Array(se.length);for(var fe=0;fe=0;oe--){var le=67108864*(0|Z.words[K.length+oe])+(0|Z.words[K.length+oe-1]);for(le=Math.min(le/ae|0,67108863),Z._ishlnsubmul(K,le,oe);Z.negative!==0;)le--,Z.negative=0,Z._ishlnsubmul(K,1,oe),Z.isZero()||(Z.negative^=1);se&&(se.words[oe]=le)}return se&&se.strip(),Z.strip(),J!=="div"&&Q!==0&&Z.iushrn(Q),{div:se||null,mod:Z}},h.prototype.divmod=function(H,J,Q){return s(!H.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:this.negative!==0&&H.negative===0?(ae=this.neg().divmod(H,J),J!=="mod"&&(Z=ae.div.neg()),J!=="div"&&(K=ae.mod.neg(),Q&&K.negative!==0&&K.iadd(H)),{div:Z,mod:K}):this.negative===0&&H.negative!==0?(ae=this.divmod(H.neg(),J),J!=="mod"&&(Z=ae.div.neg()),{div:Z,mod:ae.mod}):this.negative&H.negative?(ae=this.neg().divmod(H.neg(),J),J!=="div"&&(K=ae.mod.neg(),Q&&K.negative!==0&&K.isub(H)),{div:ae.div,mod:K}):H.length>this.length||this.cmp(H)<0?{div:new h(0),mod:this}:H.length===1?J==="div"?{div:this.divn(H.words[0]),mod:null}:J==="mod"?{div:null,mod:new h(this.modn(H.words[0]))}:{div:this.divn(H.words[0]),mod:new h(this.modn(H.words[0]))}:this._wordDiv(H,J);var Z,K,ae},h.prototype.div=function(H){return this.divmod(H,"div",!1).div},h.prototype.mod=function(H){return this.divmod(H,"mod",!1).mod},h.prototype.umod=function(H){return this.divmod(H,"mod",!0).mod},h.prototype.divRound=function(H){var J=this.divmod(H);if(J.mod.isZero())return J.div;var Q=J.div.negative!==0?J.mod.isub(H):J.mod,Z=H.ushrn(1),K=H.andln(1),ae=Q.cmp(Z);return ae<0||K===1&&ae===0?J.div:J.div.negative!==0?J.div.isubn(1):J.div.iaddn(1)},h.prototype.modn=function(H){s(H<=67108863);for(var J=67108864%H,Q=0,Z=this.length-1;Z>=0;Z--)Q=(J*Q+(0|this.words[Z]))%H;return Q},h.prototype.idivn=function(H){s(H<=67108863);for(var J=0,Q=this.length-1;Q>=0;Q--){var Z=(0|this.words[Q])+67108864*J;this.words[Q]=Z/H|0,J=Z%H}return this.strip()},h.prototype.divn=function(H){return this.clone().idivn(H)},h.prototype.egcd=function(H){s(H.negative===0),s(!H.isZero());var J=this,Q=H.clone();J=J.negative!==0?J.umod(H):J.clone();for(var Z=new h(1),K=new h(0),ae=new h(0),se=new h(1),he=0;J.isEven()&&Q.isEven();)J.iushrn(1),Q.iushrn(1),++he;for(var fe=Q.clone(),ie=J.clone();!J.isZero();){for(var oe=0,le=1;!(J.words[0]&le)&&oe<26;++oe,le<<=1);if(oe>0)for(J.iushrn(oe);oe-- >0;)(Z.isOdd()||K.isOdd())&&(Z.iadd(fe),K.isub(ie)),Z.iushrn(1),K.iushrn(1);for(var ge=0,ye=1;!(Q.words[0]&ye)&&ge<26;++ge,ye<<=1);if(ge>0)for(Q.iushrn(ge);ge-- >0;)(ae.isOdd()||se.isOdd())&&(ae.iadd(fe),se.isub(ie)),ae.iushrn(1),se.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),Z.isub(ae),K.isub(se)):(Q.isub(J),ae.isub(Z),se.isub(K))}return{a:ae,b:se,gcd:Q.iushln(he)}},h.prototype._invmp=function(H){s(H.negative===0),s(!H.isZero());var J=this,Q=H.clone();J=J.negative!==0?J.umod(H):J.clone();for(var Z,K=new h(1),ae=new h(0),se=Q.clone();J.cmpn(1)>0&&Q.cmpn(1)>0;){for(var he=0,fe=1;!(J.words[0]&fe)&&he<26;++he,fe<<=1);if(he>0)for(J.iushrn(he);he-- >0;)K.isOdd()&&K.iadd(se),K.iushrn(1);for(var ie=0,oe=1;!(Q.words[0]&oe)&&ie<26;++ie,oe<<=1);if(ie>0)for(Q.iushrn(ie);ie-- >0;)ae.isOdd()&&ae.iadd(se),ae.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),K.isub(ae)):(Q.isub(J),ae.isub(K))}return(Z=J.cmpn(1)===0?K:ae).cmpn(0)<0&&Z.iadd(H),Z},h.prototype.gcd=function(H){if(this.isZero())return H.abs();if(H.isZero())return this.abs();var J=this.clone(),Q=H.clone();J.negative=0,Q.negative=0;for(var Z=0;J.isEven()&&Q.isEven();Z++)J.iushrn(1),Q.iushrn(1);for(;;){for(;J.isEven();)J.iushrn(1);for(;Q.isEven();)Q.iushrn(1);var K=J.cmp(Q);if(K<0){var ae=J;J=Q,Q=ae}else if(K===0||Q.cmpn(1)===0)break;J.isub(Q)}return Q.iushln(Z)},h.prototype.invm=function(H){return this.egcd(H).a.umod(H)},h.prototype.isEven=function(){return(1&this.words[0])==0},h.prototype.isOdd=function(){return(1&this.words[0])==1},h.prototype.andln=function(H){return this.words[0]&H},h.prototype.bincn=function(H){s(typeof H=="number");var J=H%26,Q=(H-J)/26,Z=1<>>26,se&=67108863,this.words[ae]=se}return K!==0&&(this.words[ae]=K,this.length++),this},h.prototype.isZero=function(){return this.length===1&&this.words[0]===0},h.prototype.cmpn=function(H){var J,Q=H<0;if(this.negative!==0&&!Q)return-1;if(this.negative===0&&Q)return 1;if(this.strip(),this.length>1)J=1;else{Q&&(H=-H),s(H<=67108863,"Number is too big");var Z=0|this.words[0];J=Z===H?0:ZH.length)return 1;if(this.length=0;Q--){var Z=0|this.words[Q],K=0|H.words[Q];if(Z!==K){ZK&&(J=1);break}}return J},h.prototype.gtn=function(H){return this.cmpn(H)===1},h.prototype.gt=function(H){return this.cmp(H)===1},h.prototype.gten=function(H){return this.cmpn(H)>=0},h.prototype.gte=function(H){return this.cmp(H)>=0},h.prototype.ltn=function(H){return this.cmpn(H)===-1},h.prototype.lt=function(H){return this.cmp(H)===-1},h.prototype.lten=function(H){return this.cmpn(H)<=0},h.prototype.lte=function(H){return this.cmp(H)<=0},h.prototype.eqn=function(H){return this.cmpn(H)===0},h.prototype.eq=function(H){return this.cmp(H)===0},h.red=function(H){return new $(H)},h.prototype.toRed=function(H){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),H.convertTo(this)._forceRed(H)},h.prototype.fromRed=function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(H){return this.red=H,this},h.prototype.forceRed=function(H){return s(!this.red,"Already a number in reduction context"),this._forceRed(H)},h.prototype.redAdd=function(H){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,H)},h.prototype.redIAdd=function(H){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,H)},h.prototype.redSub=function(H){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,H)},h.prototype.redISub=function(H){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,H)},h.prototype.redShl=function(H){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,H)},h.prototype.redMul=function(H){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,H),this.red.mul(this,H)},h.prototype.redIMul=function(H){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,H),this.red.imul(this,H)},h.prototype.redSqr=function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(H){return s(this.red&&!H.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,H)};var E={k256:null,p224:null,p192:null,p25519:null};function I(H,J){this.name=H,this.p=new h(J,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function B(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function N(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function V(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function j(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function $(H){if(typeof H=="string"){var J=h._prime(H);this.m=J.p,this.prime=J}else s(H.gtn(1),"modulus must be greater than 1"),this.m=H,this.prime=null}function ee(H){$.call(this,H),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(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)}I.prototype._tmp=function(){var H=new h(null);return H.words=new Array(Math.ceil(this.n/13)),H},I.prototype.ireduce=function(H){var J,Q=H;do this.split(Q,this.tmp),J=(Q=(Q=this.imulK(Q)).iadd(this.tmp)).bitLength();while(J>this.n);var Z=J0?Q.isub(this.p):Q.strip!==void 0?Q.strip():Q._strip(),Q},I.prototype.split=function(H,J){H.iushrn(this.n,0,J)},I.prototype.imulK=function(H){return H.imul(this.k)},c(B,I),B.prototype.split=function(H,J){for(var Q=4194303,Z=Math.min(H.length,9),K=0;K>>22,ae=se}ae>>>=22,H.words[K-10]=ae,ae===0&&H.length>10?H.length-=10:H.length-=9},B.prototype.imulK=function(H){H.words[H.length]=0,H.words[H.length+1]=0,H.length+=2;for(var J=0,Q=0;Q>>=26,H.words[Q]=K,J=Z}return J!==0&&(H.words[H.length++]=J),H},h._prime=function(H){if(E[H])return E[H];var J;if(H==="k256")J=new B;else if(H==="p224")J=new N;else if(H==="p192")J=new V;else{if(H!=="p25519")throw new Error("Unknown prime "+H);J=new j}return E[H]=J,J},$.prototype._verify1=function(H){s(H.negative===0,"red works only with positives"),s(H.red,"red works only with red numbers")},$.prototype._verify2=function(H,J){s((H.negative|J.negative)==0,"red works only with positives"),s(H.red&&H.red===J.red,"red works only with red numbers")},$.prototype.imod=function(H){return this.prime?this.prime.ireduce(H)._forceRed(this):H.umod(this.m)._forceRed(this)},$.prototype.neg=function(H){return H.isZero()?H.clone():this.m.sub(H)._forceRed(this)},$.prototype.add=function(H,J){this._verify2(H,J);var Q=H.add(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q._forceRed(this)},$.prototype.iadd=function(H,J){this._verify2(H,J);var Q=H.iadd(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q},$.prototype.sub=function(H,J){this._verify2(H,J);var Q=H.sub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q._forceRed(this)},$.prototype.isub=function(H,J){this._verify2(H,J);var Q=H.isub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q},$.prototype.shl=function(H,J){return this._verify1(H),this.imod(H.ushln(J))},$.prototype.imul=function(H,J){return this._verify2(H,J),this.imod(H.imul(J))},$.prototype.mul=function(H,J){return this._verify2(H,J),this.imod(H.mul(J))},$.prototype.isqr=function(H){return this.imul(H,H.clone())},$.prototype.sqr=function(H){return this.mul(H,H)},$.prototype.sqrt=function(H){if(H.isZero())return H.clone();var J=this.m.andln(3);if(s(J%2==1),J===3){var Q=this.m.add(new h(1)).iushrn(2);return this.pow(H,Q)}for(var Z=this.m.subn(1),K=0;!Z.isZero()&&Z.andln(1)===0;)K++,Z.iushrn(1);s(!Z.isZero());var ae=new h(1).toRed(this),se=ae.redNeg(),he=this.m.subn(1).iushrn(1),fe=this.m.bitLength();for(fe=new h(2*fe*fe).toRed(this);this.pow(fe,he).cmp(se)!==0;)fe.redIAdd(se);for(var ie=this.pow(fe,Z),oe=this.pow(H,Z.addn(1).iushrn(1)),le=this.pow(H,Z),ge=K;le.cmp(ae)!==0;){for(var ye=le,me=0;ye.cmp(ae)!==0;me++)ye=ye.redSqr();s(me=0;Z--){for(var fe=J.words[Z],ie=he-1;ie>=0;ie--){var oe=fe>>ie&1;K!==Q[0]&&(K=this.sqr(K)),oe!==0||ae!==0?(ae<<=1,ae|=oe,(++se==4||Z===0&&ie===0)&&(K=this.mul(K,Q[ae]),se=0,ae=0)):se=0}he=26}return K},$.prototype.convertTo=function(H){var J=H.umod(this.m);return J===H?J.clone():J},$.prototype.convertFrom=function(H){var J=H.clone();return J.red=null,J},h.mont=function(H){return new ee(H)},c(ee,$),ee.prototype.convertTo=function(H){return this.imod(H.ushln(this.shift))},ee.prototype.convertFrom=function(H){var J=this.imod(H.mul(this.rinv));return J.red=null,J},ee.prototype.imul=function(H,J){if(H.isZero()||J.isZero())return H.words[0]=0,H.length=1,H;var Q=H.imul(J),Z=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),K=Q.isub(Z).iushrn(this.shift),ae=K;return K.cmp(this.m)>=0?ae=K.isub(this.m):K.cmpn(0)<0&&(ae=K.iadd(this.m)),ae._forceRed(this)},ee.prototype.mul=function(H,J){if(H.isZero()||J.isZero())return new h(0)._forceRed(this);var Q=H.mul(J),Z=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),K=Q.isub(Z).iushrn(this.shift),ae=K;return K.cmp(this.m)>=0?ae=K.isub(this.m):K.cmpn(0)<0&&(ae=K.iadd(this.m)),ae._forceRed(this)},ee.prototype.invm=function(H){return this.imod(H._invmp(this.m).mul(this.r2))._forceRed(this)}})(u=n.nmd(u),this)},6204:function(u){u.exports=function(r){var n,l,o,s=r.length,c=0;for(n=0;n>>1;if(!(M<=0)){var f,E=o.mallocDouble(2*M*T),I=o.mallocInt32(T);if((T=x(k,M,E,I))>0){if(M===1&&S)s.init(T),f=s.sweepComplete(M,v,0,T,E,I,0,T,E,I);else{var B=o.mallocDouble(2*M*p),N=o.mallocInt32(p);(p=x(A,M,B,N))>0&&(s.init(T+p),f=M===1?s.sweepBipartite(M,v,0,T,E,I,0,p,B,N):c(M,v,S,T,E,I,p,B,N),o.free(B),o.free(N))}o.free(E),o.free(I)}return f}}}function g(k,A){l.push([k,A])}},2455:function(u,r){function n(l){return l?function(o,s,c,h,x,m,g,k,A,v,S){return x-h>A-k?function(T,p,M,f,E,I,B,N,V,j,$){for(var ee=2*T,H=f,J=ee*f;Hv-A?h?function(p,M,f,E,I,B,N,V,j,$,ee){for(var H=2*p,J=E,Q=H*E;J0;){var ge=(oe-=1)*I,ye=N[ge],me=N[ge+1],be=N[ge+2],Se=N[ge+3],Ee=N[ge+4],Ce=N[ge+5],Le=oe*B,Oe=V[Le],We=V[Le+1],Ie=1&Ce,Ve=!!(16&Ce),Pe=K,de=ae,Me=he,ke=fe;if(Ie&&(Pe=he,de=fe,Me=K,ke=ae),!(2&Ce&&me>=(be=p(H,ye,me,be,Pe,de,We))||4&Ce&&(me=M(H,ye,me,be,Pe,de,Oe))>=be)){var He=be-me,Fe=Ee-Se;if(Ve){if(H*He*(He+Fe)=p0)&&!(p1>=hi)"),T=g("lo===p0"),p=g("lo>>1,T=2*c,p=S,M=g[T*S+h];A=N?(p=B,M=N):I>=j?(p=E,M=I):(p=V,M=j):N>=j?(p=B,M=N):j>=I?(p=E,M=I):(p=V,M=j);for(var $=T*(v-1),ee=T*p,H=0;Hx&&g[M+h]>T;--p,M-=A){for(var f=M,E=M+A,I=0;IS;++S,g+=m)if(c[g+v]===x)if(A===S)A+=1,k+=m;else{for(var T=0;m>T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"loS;++S,g+=m)if(c[g+v]T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"lo<=p0":function(n,l,o,s,c,h,x){for(var m=2*n,g=m*o,k=g,A=o,v=n+l,S=o;s>S;++S,g+=m)if(c[g+v]<=x)if(A===S)A+=1,k+=m;else{for(var T=0;m>T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"hi<=p0":function(n,l,o,s,c,h,x){for(var m=2*n,g=m*o,k=g,A=o,v=n+l,S=o;s>S;++S,g+=m)if(c[g+v]<=x)if(A===S)A+=1,k+=m;else{for(var T=0;m>T;++T){var p=c[g+T];c[g+T]=c[k],c[k++]=p}var M=h[S];h[S]=h[A],h[A++]=M}return A},"loT;++T,g+=m){var p=c[g+v],M=c[g+S];if(pf;++f){var E=c[g+f];c[g+f]=c[k],c[k++]=E}var I=h[T];h[T]=h[A],h[A++]=I}}return A},"lo<=p0&&p0<=hi":function(n,l,o,s,c,h,x){for(var m=2*n,g=m*o,k=g,A=o,v=l,S=n+l,T=o;s>T;++T,g+=m){var p=c[g+v],M=c[g+S];if(p<=x&&x<=M)if(A===T)A+=1,k+=m;else{for(var f=0;m>f;++f){var E=c[g+f];c[g+f]=c[k],c[k++]=E}var I=h[T];h[T]=h[A],h[A++]=I}}return A},"!(lo>=p0)&&!(p1>=hi)":function(n,l,o,s,c,h,x,m){for(var g=2*n,k=g*o,A=k,v=o,S=l,T=n+l,p=o;s>p;++p,k+=g){var M=c[k+S],f=c[k+T];if(!(M>=x||m>=f))if(v===p)v+=1,A+=g;else{for(var E=0;g>E;++E){var I=c[k+E];c[k+E]=c[A],c[A++]=I}var B=h[p];h[p]=h[v],h[v++]=B}}return v}}},1811:function(u){u.exports=function(g,k){k<=4*r?n(0,k-1,g):m(0,k-1,g)};var r=32;function n(g,k,A){for(var v=2*(g+1),S=g+1;S<=k;++S){for(var T=A[v++],p=A[v++],M=S,f=v-2;M-- >g;){var E=A[f-2],I=A[f-1];if(EA[k+1])}function x(g,k,A,v){var S=v[g*=2];return S>1,M=p-v,f=p+v,E=S,I=M,B=p,N=f,V=T,j=g+1,$=k-1,ee=0;h(E,I,A)&&(ee=E,E=I,I=ee),h(N,V,A)&&(ee=N,N=V,V=ee),h(E,B,A)&&(ee=E,E=B,B=ee),h(I,B,A)&&(ee=I,I=B,B=ee),h(E,N,A)&&(ee=E,E=N,N=ee),h(B,N,A)&&(ee=B,B=N,N=ee),h(I,V,A)&&(ee=I,I=V,V=ee),h(I,B,A)&&(ee=I,I=B,B=ee),h(N,V,A)&&(ee=N,N=V,V=ee);for(var H=A[2*I],J=A[2*I+1],Q=A[2*N],Z=A[2*N+1],K=2*E,ae=2*B,se=2*V,he=2*S,fe=2*p,ie=2*T,oe=0;oe<2;++oe){var le=A[K+oe],ge=A[ae+oe],ye=A[se+oe];A[he+oe]=le,A[fe+oe]=ge,A[ie+oe]=ye}o(M,g,A),o(f,k,A);for(var me=j;me<=$;++me)if(x(me,H,J,A))me!==j&&l(me,j,A),++j;else if(!x(me,Q,Z,A))for(;;){if(x($,Q,Z,A)){x($,H,J,A)?(s(me,j,$,A),++j,--$):(l(me,$,A),--$);break}if(--$>>1;s(S,fe);var ie=0,oe=0;for(K=0;K=c)T(g,k,oe--,le=le-c|0);else if(le>=0)T(x,m,ie--,le);else if(le<=-c){le=-le-c|0;for(var ge=0;ge>>1;s(S,fe);var ie=0,oe=0,le=0;for(K=0;K>1==S[2*K+3]>>1&&(ye=2,K+=1),ge<0){for(var me=-(ge>>1)-1,be=0;be>1)-1,ye===0?T(x,m,ie--,me):ye===1?T(g,k,oe--,me):ye===2&&T(A,v,le--,me)}},scanBipartite:function(M,f,E,I,B,N,V,j,$,ee,H,J){var Q=0,Z=2*M,K=f,ae=f+M,se=1,he=1;I?he=c:se=c;for(var fe=B;fe>>1;s(S,ge);var ye=0;for(fe=0;fe=c?(be=!I,ie-=c):(be=!!I,ie-=1),be)p(x,m,ye++,ie);else{var Se=J[ie],Ee=Z*ie,Ce=H[Ee+f+1],Le=H[Ee+f+1+M];e:for(var Oe=0;Oe>>1;s(S,ie);var oe=0;for(ae=0;ae=c)x[oe++]=se-c;else{var ge=H[se-=1],ye=Q*se,me=ee[ye+f+1],be=ee[ye+f+1+M];e:for(var Se=0;Se=0;--Se)if(x[Se]===se){for(Oe=Se+1;Oe0;){for(var p=h.pop(),M=(v=-1,S=-1,k=m[g=h.pop()],1);M=0||(c.flip(g,p),o(s,c,h,v,g,S),o(s,c,h,g,S,v),o(s,c,h,S,p,v),o(s,c,h,p,v,S))}}},5023:function(u,r,n){var l,o=n(2478);function s(h,x,m,g,k,A,v){this.cells=h,this.neighbor=x,this.flags=g,this.constraint=m,this.active=k,this.next=A,this.boundary=v}function c(h,x){return h[0]-x[0]||h[1]-x[1]||h[2]-x[2]}u.exports=function(h,x,m){var g=function(V,j){for(var $=V.cells(),ee=$.length,H=0;H0||v.length>0;){for(;A.length>0;){var f=A.pop();if(S[f]!==-k){S[f]=k,T[f];for(var E=0;E<3;++E){var I=M[3*f+E];I>=0&&S[I]===0&&(p[3*f+E]?v.push(I):(A.push(I),S[I]=k))}}}var B=v;v=A,A=B,v.length=0,k=-k}var N=function(V,j,$){for(var ee=0,H=0;H1&&o(T[N[V-2]],T[N[V-1]],p)>0;)v.push([N[V-1],N[V-2],M]),V-=1;N.length=V,N.push(M);var j=B.upperIds;for(V=j.length;V>1&&o(T[j[V-2]],T[j[V-1]],p)<0;)v.push([j[V-2],j[V-1],M]),V-=1;j.length=V,j.push(M)}}function g(v,S){var T;return(T=v.a[0]B[0]&&M.push(new c(B,I,2,f),new c(I,B,1,f))}M.sort(h);for(var N=M[0].a[0]-(1+Math.abs(M[0].a[0]))*Math.pow(2,-52),V=[new s([N,1],[N,0],-1,[],[])],j=[],$=(f=0,M.length);f<$;++f){var ee=M[f],H=ee.type;H===0?m(j,V,v,ee.a,ee.idx):H===2?k(V,0,ee):A(V,0,ee)}return j}},5542:function(u,r,n){var l=n(2478);function o(h,x){this.stars=h,this.edges=x}u.exports=function(h,x){for(var m=new Array(h),g=0;g=0}}(),s.removeTriangle=function(h,x,m){var g=this.stars;c(g[h],x,m),c(g[x],m,h),c(g[m],h,x)},s.addTriangle=function(h,x,m){var g=this.stars;g[h].push(x,m),g[x].push(m,h),g[m].push(h,x)},s.opposite=function(h,x){for(var m=this.stars[x],g=1,k=m.length;gI[2]?1:0)}function M(E,I,B){if(E.length!==0){if(I)for(var N=0;N=0;--ae){var me=J[se=(Ie=Z[ae])[0]],be=me[0],Se=me[1],Ee=H[be],Ce=H[Se];if((Ee[0]-Ce[0]||Ee[1]-Ce[1])<0){var Le=be;be=Se,Se=Le}me[0]=be;var Oe,We=me[1]=Ie[1];for(K&&(Oe=me[2]);ae>0&&Z[ae-1][0]===se;){var Ie,Ve=(Ie=Z[--ae])[1];K?J.push([We,Ve,Oe]):J.push([We,Ve]),We=Ve}K?J.push([We,Se,Oe]):J.push([We,Se])}return he}(E,I,V,j,B),ee=S(E,$);return M(I,ee,B),!!ee||V.length>0||j.length>0}},3637:function(u,r,n){u.exports=function(k,A,v,S){var T=h(A,k),p=h(S,v),M=g(T,p);if(c(M)===0)return null;var f=g(p,h(k,v)),E=o(f,M),I=m(T,E);return x(k,I)};var l=n(6504),o=n(8697),s=n(5572),c=n(7721),h=n(544),x=n(2653),m=n(8987);function g(k,A){return s(l(k[0],A[1]),l(k[1],A[0]))}},3642:function(u){u.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(u,r,n){var l=n(3642),o=n(395);function s(x){return[x[0]/255,x[1]/255,x[2]/255,x[3]]}function c(x){for(var m,g="#",k=0;k<3;++k)g+=("00"+(m=(m=x[k]).toString(16))).substr(m.length);return g}function h(x){return"rgba("+x.join(",")+")"}u.exports=function(x){var m,g,k,A,v,S,T,p,M,f;if(x||(x={}),p=(x.nshades||72)-1,T=x.format||"hex",(S=x.colormap)||(S="jet"),typeof S=="string"){if(S=S.toLowerCase(),!l[S])throw Error(S+" not a supported colorscale");v=l[S]}else{if(!Array.isArray(S))throw Error("unsupported colormap option",S);v=S.slice()}if(v.length>p+1)throw new Error(S+" map requires nshades to be at least size "+v.length);M=Array.isArray(x.alpha)?x.alpha.length!==2?[1,1]:x.alpha.slice():typeof x.alpha=="number"?[x.alpha,x.alpha]:[1,1],m=v.map(function(V){return Math.round(V.index*p)}),M[0]=Math.min(Math.max(M[0],0),1),M[1]=Math.min(Math.max(M[1],0),1);var E=v.map(function(V,j){var $=v[j].index,ee=v[j].rgb.slice();return ee.length===4&&ee[3]>=0&&ee[3]<=1||(ee[3]=M[0]+(M[1]-M[0])*$),ee}),I=[];for(f=0;f0||x(m,g,A)?-1:1:S===0?T>0||x(m,g,k)?1:-1:o(T-S)}var M=l(m,g,k);return M>0?v>0&&l(m,g,A)>0?1:-1:M<0?v>0||l(m,g,A)>0?1:-1:l(m,g,A)>0||x(m,g,k)?1:-1};var l=n(3250),o=n(8572),s=n(9362),c=n(5382),h=n(8210);function x(m,g,k){var A=s(m[0],-g[0]),v=s(m[1],-g[1]),S=s(k[0],-g[0]),T=s(k[1],-g[1]),p=h(c(A,S),c(v,T));return p[p.length-1]>=0}},8572:function(u){u.exports=function(r){return r<0?-1:r>0?1:0}},8507:function(u){u.exports=function(l,o){var s=l.length,c=l.length-o.length;if(c)return c;switch(s){case 0:return 0;case 1:return l[0]-o[0];case 2:return l[0]+l[1]-o[0]-o[1]||r(l[0],l[1])-r(o[0],o[1]);case 3:var h=l[0]+l[1],x=o[0]+o[1];if(c=h+l[2]-(x+o[2]))return c;var m=r(l[0],l[1]),g=r(o[0],o[1]);return r(m,l[2])-r(g,o[2])||r(m+l[2],h)-r(g+o[2],x);case 4:var k=l[0],A=l[1],v=l[2],S=l[3],T=o[0],p=o[1],M=o[2],f=o[3];return k+A+v+S-(T+p+M+f)||r(k,A,v,S)-r(T,p,M,f,T)||r(k+A,k+v,k+S,A+v,A+S,v+S)-r(T+p,T+M,T+f,p+M,p+f,M+f)||r(k+A+v,k+A+S,k+v+S,A+v+S)-r(T+p+M,T+p+f,T+M+f,p+M+f);default:for(var E=l.slice().sort(n),I=o.slice().sort(n),B=0;Br[l][0]&&(l=o);return nl?[[l],[n]]:[[n]]}},4750:function(u,r,n){u.exports=function(o){var s=l(o),c=s.length;if(c<=2)return[];for(var h=new Array(c),x=s[c-1],m=0;m=k[f]&&(M+=1);T[p]=M}}return g}(l(x,!0),h)}};var l=n(8954),o=n(3952)},4769:function(u){u.exports=function(r,n,l,o,s,c){var h=s-1,x=s*s,m=h*h,g=(1+2*s)*m,k=s*m,A=x*(3-2*s),v=x*h;if(r.length){c||(c=new Array(r.length));for(var S=r.length-1;S>=0;--S)c[S]=g*r[S]+k*n[S]+A*l[S]+v*o[S];return c}return g*r+k*n+A*l+v*o},u.exports.derivative=function(r,n,l,o,s,c){var h=6*s*s-6*s,x=3*s*s-4*s+1,m=-6*s*s+6*s,g=3*s*s-2*s;if(r.length){c||(c=new Array(r.length));for(var k=r.length-1;k>=0;--k)c[k]=h*r[k]+x*n[k]+m*l[k]+g*o[k];return c}return h*r+x*n+m*l[k]+g*o}},7642:function(u,r,n){var l=n(8954),o=n(1682);function s(h,x){this.point=h,this.index=x}function c(h,x){for(var m=h.point,g=x.point,k=m.length,A=0;A=2)return!1;$[H]=J}return!0}):j.filter(function($){for(var ee=0;ee<=g;++ee){var H=I[$[ee]];if(H<0)return!1;$[ee]=H}return!0}),1&g)for(v=0;v>>31},u.exports.exponent=function(s){return(u.exports.hi(s)<<1>>>21)-1023},u.exports.fraction=function(s){var c=u.exports.lo(s),h=u.exports.hi(s),x=1048575&h;return 2146435072&h&&(x+=1048576),[c,x]},u.exports.denormalized=function(s){return!(2146435072&u.exports.hi(s))}},1338:function(u){function r(n,l,o){var s=0|n[o];if(s<=0)return[];var c,h=new Array(s);if(o===n.length-1)for(c=0;c0)return function(o,s){var c,h;for(c=new Array(o),h=0;h=k-1){f=S.length-1;var I=m-g[k-1];for(E=0;E=k-1)for(var M=S.length-1,f=(g[k-1],0);f=0;--k)if(m[--g])return!1;return!0},h.jump=function(m){var g=this.lastT(),k=this.dimension;if(!(m0;--E)A.push(s(p[E-1],M[E-1],arguments[E])),v.push(0)}},h.push=function(m){var g=this.lastT(),k=this.dimension;if(!(m1e-6?1/T:0;this._time.push(m);for(var I=k;I>0;--I){var B=s(M[I-1],f[I-1],arguments[I]);A.push(B),v.push((B-A[S++])*E)}}},h.set=function(m){var g=this.dimension;if(!(m0;--p)k.push(s(S[p-1],T[p-1],arguments[p])),A.push(0)}},h.move=function(m){var g=this.lastT(),k=this.dimension;if(!(m<=g||arguments.length!==k+1)){var A=this._state,v=this._velocity,S=A.length-this.dimension,T=this.bounds,p=T[0],M=T[1],f=m-g,E=f>1e-6?1/f:0;this._time.push(m);for(var I=k;I>0;--I){var B=arguments[I];A.push(s(p[I-1],M[I-1],A[S++]+B)),v.push(B*E)}}},h.idle=function(m){var g=this.lastT();if(!(m=0;--E)A.push(s(p[E],M[E],A[S]+f*v[S])),v.push(0),S+=1}}},3840:function(u){function r(S,T,p,M,f,E){this._color=S,this.key=T,this.value=p,this.left=M,this.right=f,this._count=E}function n(S){return new r(S._color,S.key,S.value,S.left,S.right,S._count)}function l(S,T){return new r(S,T.key,T.value,T.left,T.right,T._count)}function o(S){S._count=1+(S.left?S.left._count:0)+(S.right?S.right._count:0)}function s(S,T){this._compare=S,this.root=T}u.exports=function(S){return new s(S||v,null)};var c=s.prototype;function h(S,T){var p;return T.left&&(p=h(S,T.left))?p:(p=S(T.key,T.value))||(T.right?h(S,T.right):void 0)}function x(S,T,p,M){if(T(S,M.key)<=0){var f;if(M.left&&(f=x(S,T,p,M.left))||(f=p(M.key,M.value)))return f}if(M.right)return x(S,T,p,M.right)}function m(S,T,p,M,f){var E,I=p(S,f.key),B=p(T,f.key);if(I<=0&&(f.left&&(E=m(S,T,p,M,f.left))||B>0&&(E=M(f.key,f.value))))return E;if(B>0&&f.right)return m(S,T,p,M,f.right)}function g(S,T){this.tree=S,this._stack=T}Object.defineProperty(c,"keys",{get:function(){var S=[];return this.forEach(function(T,p){S.push(T)}),S}}),Object.defineProperty(c,"values",{get:function(){var S=[];return this.forEach(function(T,p){S.push(p)}),S}}),Object.defineProperty(c,"length",{get:function(){return this.root?this.root._count:0}}),c.insert=function(S,T){for(var p=this._compare,M=this.root,f=[],E=[];M;){var I=p(S,M.key);f.push(M),E.push(I),M=I<=0?M.left:M.right}f.push(new r(0,S,T,null,null,1));for(var B=f.length-2;B>=0;--B)M=f[B],E[B]<=0?f[B]=new r(M._color,M.key,M.value,f[B+1],M.right,M._count+1):f[B]=new r(M._color,M.key,M.value,M.left,f[B+1],M._count+1);for(B=f.length-1;B>1;--B){var N=f[B-1];if(M=f[B],N._color===1||M._color===1)break;var V=f[B-2];if(V.left===N)if(N.left===M){if(!(j=V.right)||j._color!==0){V._color=0,V.left=N.right,N._color=1,N.right=V,f[B-2]=N,f[B-1]=M,o(V),o(N),B>=3&&(($=f[B-3]).left===V?$.left=N:$.right=N);break}N._color=1,V.right=l(1,j),V._color=0,B-=1}else{if(!(j=V.right)||j._color!==0){N.right=M.left,V._color=0,V.left=M.right,M._color=1,M.left=N,M.right=V,f[B-2]=M,f[B-1]=N,o(V),o(N),o(M),B>=3&&(($=f[B-3]).left===V?$.left=M:$.right=M);break}N._color=1,V.right=l(1,j),V._color=0,B-=1}else if(N.right===M){if(!(j=V.left)||j._color!==0){V._color=0,V.right=N.left,N._color=1,N.left=V,f[B-2]=N,f[B-1]=M,o(V),o(N),B>=3&&(($=f[B-3]).right===V?$.right=N:$.left=N);break}N._color=1,V.left=l(1,j),V._color=0,B-=1}else{var j;if(!(j=V.left)||j._color!==0){var $;N.left=M.right,V._color=0,V.right=M.left,M._color=1,M.right=N,M.left=V,f[B-2]=M,f[B-1]=N,o(V),o(N),o(M),B>=3&&(($=f[B-3]).right===V?$.right=M:$.left=M);break}N._color=1,V.left=l(1,j),V._color=0,B-=1}}return f[0]._color=1,new s(p,f[0])},c.forEach=function(S,T,p){if(this.root)switch(arguments.length){case 1:return h(S,this.root);case 2:return x(T,this._compare,S,this.root);case 3:return this._compare(T,p)>=0?void 0:m(T,p,this._compare,S,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var S=[],T=this.root;T;)S.push(T),T=T.left;return new g(this,S)}}),Object.defineProperty(c,"end",{get:function(){for(var S=[],T=this.root;T;)S.push(T),T=T.right;return new g(this,S)}}),c.at=function(S){if(S<0)return new g(this,[]);for(var T=this.root,p=[];;){if(p.push(T),T.left){if(S=T.right._count)break;T=T.right}return new g(this,[])},c.ge=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E<=0&&(f=M.length),p=E<=0?p.left:p.right}return M.length=f,new g(this,M)},c.gt=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E<0&&(f=M.length),p=E<0?p.left:p.right}return M.length=f,new g(this,M)},c.lt=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E>0&&(f=M.length),p=E<=0?p.left:p.right}return M.length=f,new g(this,M)},c.le=function(S){for(var T=this._compare,p=this.root,M=[],f=0;p;){var E=T(S,p.key);M.push(p),E>=0&&(f=M.length),p=E<0?p.left:p.right}return M.length=f,new g(this,M)},c.find=function(S){for(var T=this._compare,p=this.root,M=[];p;){var f=T(S,p.key);if(M.push(p),f===0)return new g(this,M);p=f<=0?p.left:p.right}return new g(this,[])},c.remove=function(S){var T=this.find(S);return T?T.remove():this},c.get=function(S){for(var T=this._compare,p=this.root;p;){var M=T(S,p.key);if(M===0)return p.value;p=M<=0?p.left:p.right}};var k=g.prototype;function A(S,T){S.key=T.key,S.value=T.value,S.left=T.left,S.right=T.right,S._color=T._color,S._count=T._count}function v(S,T){return ST?1:0}Object.defineProperty(k,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(k,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),k.clone=function(){return new g(this.tree,this._stack.slice())},k.remove=function(){var S=this._stack;if(S.length===0)return this.tree;var T=new Array(S.length),p=S[S.length-1];T[T.length-1]=new r(p._color,p.key,p.value,p.left,p.right,p._count);for(var M=S.length-2;M>=0;--M)(p=S[M]).left===S[M+1]?T[M]=new r(p._color,p.key,p.value,T[M+1],p.right,p._count):T[M]=new r(p._color,p.key,p.value,p.left,T[M+1],p._count);if((p=T[T.length-1]).left&&p.right){var f=T.length;for(p=p.left;p.right;)T.push(p),p=p.right;var E=T[f-1];for(T.push(new r(p._color,E.key,E.value,p.left,p.right,p._count)),T[f-1].key=p.key,T[f-1].value=p.value,M=T.length-2;M>=f;--M)p=T[M],T[M]=new r(p._color,p.key,p.value,p.left,T[M+1],p._count);T[f-1].left=T[f]}if((p=T[T.length-1])._color===0){var I=T[T.length-2];for(I.left===p?I.left=null:I.right===p&&(I.right=null),T.pop(),M=0;M=0;--H){if(V=N[H],H===0)return void(V._color=1);if((j=N[H-1]).left===V){if(($=j.right).right&&$.right._color===0)return ee=($=j.right=n($)).right=n($.right),j.right=$.left,$.left=j,$.right=ee,$._color=j._color,V._color=1,j._color=1,ee._color=1,o(j),o($),H>1&&((J=N[H-2]).left===j?J.left=$:J.right=$),void(N[H-1]=$);if($.left&&$.left._color===0)return ee=($=j.right=n($)).left=n($.left),j.right=ee.left,$.left=ee.right,ee.left=j,ee.right=$,ee._color=j._color,j._color=1,$._color=1,V._color=1,o(j),o($),o(ee),H>1&&((J=N[H-2]).left===j?J.left=ee:J.right=ee),void(N[H-1]=ee);if($._color===1){if(j._color===0)return j._color=1,void(j.right=l(0,$));j.right=l(0,$);continue}$=n($),j.right=$.left,$.left=j,$._color=j._color,j._color=0,o(j),o($),H>1&&((J=N[H-2]).left===j?J.left=$:J.right=$),N[H-1]=$,N[H]=j,H+11&&((J=N[H-2]).right===j?J.right=$:J.left=$),void(N[H-1]=$);if($.right&&$.right._color===0)return ee=($=j.left=n($)).right=n($.right),j.left=ee.right,$.right=ee.left,ee.right=j,ee.left=$,ee._color=j._color,j._color=1,$._color=1,V._color=1,o(j),o($),o(ee),H>1&&((J=N[H-2]).right===j?J.right=ee:J.left=ee),void(N[H-1]=ee);if($._color===1){if(j._color===0)return j._color=1,void(j.left=l(0,$));j.left=l(0,$);continue}var J;$=n($),j.left=$.right,$.right=j,$._color=j._color,j._color=0,o(j),o($),H>1&&((J=N[H-2]).right===j?J.right=$:J.left=$),N[H-1]=$,N[H]=j,H+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(k,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(k,"index",{get:function(){var S=0,T=this._stack;if(T.length===0){var p=this.tree.root;return p?p._count:0}T[T.length-1].left&&(S=T[T.length-1].left._count);for(var M=T.length-2;M>=0;--M)T[M+1]===T[M].right&&(++S,T[M].left&&(S+=T[M].left._count));return S},enumerable:!0}),k.next=function(){var S=this._stack;if(S.length!==0){var T=S[S.length-1];if(T.right)for(T=T.right;T;)S.push(T),T=T.left;else for(S.pop();S.length>0&&S[S.length-1].right===T;)T=S[S.length-1],S.pop()}},Object.defineProperty(k,"hasNext",{get:function(){var S=this._stack;if(S.length===0)return!1;if(S[S.length-1].right)return!0;for(var T=S.length-1;T>0;--T)if(S[T-1].left===S[T])return!0;return!1}}),k.update=function(S){var T=this._stack;if(T.length===0)throw new Error("Can't update empty node!");var p=new Array(T.length),M=T[T.length-1];p[p.length-1]=new r(M._color,M.key,S,M.left,M.right,M._count);for(var f=T.length-2;f>=0;--f)(M=T[f]).left===T[f+1]?p[f]=new r(M._color,M.key,M.value,p[f+1],M.right,M._count):p[f]=new r(M._color,M.key,M.value,M.left,p[f+1],M._count);return new s(this.tree._compare,p[0])},k.prev=function(){var S=this._stack;if(S.length!==0){var T=S[S.length-1];if(T.left)for(T=T.left;T;)S.push(T),T=T.right;else for(S.pop();S.length>0&&S[S.length-1].left===T;)T=S[S.length-1],S.pop()}},Object.defineProperty(k,"hasPrev",{get:function(){var S=this._stack;if(S.length===0)return!1;if(S[S.length-1].left)return!0;for(var T=S.length-1;T>0;--T)if(S[T-1].right===S[T])return!0;return!1}})},3837:function(u,r,n){u.exports=function(V,j){var $=new v(V);return $.update(j),$};var l=n(4935),o=n(501),s=n(5304),c=n(6429),h=n(6444),x=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),m=ArrayBuffer,g=DataView;function k(V){return Array.isArray(V)||function(j){return m.isView(j)&&!(j instanceof g)}(V)}function A(V,j){return V[0]=j[0],V[1]=j[1],V[2]=j[2],V}function v(V){this.gl=V,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=s(V)}var S=v.prototype;function T(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}S.update=function(V){function j(le,ge,ye){if(ye in V){var me,be=V[ye],Se=this[ye];(le?k(be)&&k(be[0]):k(be))?this[ye]=me=[ge(be[0]),ge(be[1]),ge(be[2])]:this[ye]=me=[ge(be),ge(be),ge(be)];for(var Ee=0;Ee<3;++Ee)if(me[Ee]!==Se[Ee])return!0}return!1}V=V||{};var $,ee=j.bind(this,!1,Number),H=j.bind(this,!1,Boolean),J=j.bind(this,!1,String),Q=j.bind(this,!0,function(le){if(k(le)){if(le.length===3)return[+le[0],+le[1],+le[2],1];if(le.length===4)return[+le[0],+le[1],+le[2],+le[3]]}return[0,0,0,1]}),Z=!1,K=!1;if("bounds"in V)for(var ae=V.bounds,se=0;se<2;++se)for(var he=0;he<3;++he)ae[se][he]!==this.bounds[se][he]&&(K=!0),this.bounds[se][he]=ae[se][he];if("ticks"in V)for($=V.ticks,Z=!0,this.autoTicks=!1,se=0;se<3;++se)this.tickSpacing[se]=0;else ee("tickSpacing")&&(this.autoTicks=!0,K=!0);if(this._firstInit&&("ticks"in V||"tickSpacing"in V||(this.autoTicks=!0),K=!0,Z=!0,this._firstInit=!1),K&&this.autoTicks&&($=h.create(this.bounds,this.tickSpacing),Z=!0),Z){for(se=0;se<3;++se)$[se].sort(function(le,ge){return le.x-ge.x});h.equal($,this.ticks)?Z=!1:this.ticks=$}H("tickEnable"),J("tickFont")&&(Z=!0),J("tickFontStyle")&&(Z=!0),J("tickFontWeight")&&(Z=!0),J("tickFontVariant")&&(Z=!0),ee("tickSize"),ee("tickAngle"),ee("tickPad"),Q("tickColor");var fe=J("labels");J("labelFont")&&(fe=!0),J("labelFontStyle")&&(fe=!0),J("labelFontWeight")&&(fe=!0),J("labelFontVariant")&&(fe=!0),H("labelEnable"),ee("labelSize"),ee("labelPad"),Q("labelColor"),H("lineEnable"),H("lineMirror"),ee("lineWidth"),Q("lineColor"),H("lineTickEnable"),H("lineTickMirror"),ee("lineTickLength"),ee("lineTickWidth"),Q("lineTickColor"),H("gridEnable"),ee("gridWidth"),Q("gridColor"),H("zeroEnable"),Q("zeroLineColor"),ee("zeroLineWidth"),H("backgroundEnable"),Q("backgroundColor");var ie=[{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]}],oe=[{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&&(fe||Z)&&this._text.update(this.bounds,this.labels,ie,this.ticks,oe):this._text=l(this.gl,this.bounds,this.labels,ie,this.ticks,oe),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=o(this.gl,this.bounds,this.ticks))};var p=[new T,new T,new T];function M(V,j,$,ee,H){for(var J=V.primalOffset,Q=V.primalMinor,Z=V.mirrorOffset,K=V.mirrorMinor,ae=ee[j],se=0;se<3;++se)if(j!==se){var he=J,fe=Z,ie=Q,oe=K;ae&1<0?(ie[se]=-1,oe[se]=0):(ie[se]=0,oe[se]=1)}}var f=[0,0,0],E={model:x,view:x,projection:x,_ortho:!1};S.isOpaque=function(){return!0},S.isTransparent=function(){return!1},S.drawTransparent=function(V){};var I=[0,0,0],B=[0,0,0],N=[0,0,0];S.draw=function(V){V=V||E;for(var j=this.gl,$=V.model||x,ee=V.view||x,H=V.projection||x,J=this.bounds,Q=V._ortho||!1,Z=c($,ee,H,J,Q),K=Z.cubeEdges,ae=Z.axis,se=ee[12],he=ee[13],fe=ee[14],ie=ee[15],oe=(Q?2:1)*this.pixelRatio*(H[3]*se+H[7]*he+H[11]*fe+H[15]*ie)/j.drawingBufferHeight,le=0;le<3;++le)this.lastCubeProps.cubeEdges[le]=K[le],this.lastCubeProps.axis[le]=ae[le];var ge=p;for(le=0;le<3;++le)M(p[le],le,this.bounds,K,ae);j=this.gl;var ye,me,be,Se=f;for(le=0;le<3;++le)this.backgroundEnable[le]?Se[le]=ae[le]:Se[le]=0;for(this._background.draw($,ee,H,J,Se,this.backgroundColor),this._lines.bind($,ee,H,this),le=0;le<3;++le){var Ee=[0,0,0];ae[le]>0?Ee[le]=J[1][le]:Ee[le]=J[0][le];for(var Ce=0;Ce<2;++Ce){var Le=(le+1+Ce)%3,Oe=(le+1+(1^Ce))%3;this.gridEnable[Le]&&this._lines.drawGrid(Le,Oe,this.bounds,Ee,this.gridColor[Le],this.gridWidth[Le]*this.pixelRatio)}for(Ce=0;Ce<2;++Ce)Le=(le+1+Ce)%3,Oe=(le+1+(1^Ce))%3,this.zeroEnable[Oe]&&Math.min(J[0][Oe],J[1][Oe])<=0&&Math.max(J[0][Oe],J[1][Oe])>=0&&this._lines.drawZero(Le,Oe,this.bounds,Ee,this.zeroLineColor[Oe],this.zeroLineWidth[Oe]*this.pixelRatio)}for(le=0;le<3;++le){this.lineEnable[le]&&this._lines.drawAxisLine(le,this.bounds,ge[le].primalOffset,this.lineColor[le],this.lineWidth[le]*this.pixelRatio),this.lineMirror[le]&&this._lines.drawAxisLine(le,this.bounds,ge[le].mirrorOffset,this.lineColor[le],this.lineWidth[le]*this.pixelRatio);var We=A(I,ge[le].primalMinor),Ie=A(B,ge[le].mirrorMinor),Ve=this.lineTickLength;for(Ce=0;Ce<3;++Ce){var Pe=oe/$[5*Ce];We[Ce]*=Ve[Ce]*Pe,Ie[Ce]*=Ve[Ce]*Pe}this.lineTickEnable[le]&&this._lines.drawAxisTicks(le,ge[le].primalOffset,We,this.lineTickColor[le],this.lineTickWidth[le]*this.pixelRatio),this.lineTickMirror[le]&&this._lines.drawAxisTicks(le,ge[le].mirrorOffset,Ie,this.lineTickColor[le],this.lineTickWidth[le]*this.pixelRatio)}function de($e){(be=[0,0,0])[$e]=1}function Me($e,Ye,_e){var De=($e+1)%3,Be=($e+2)%3,Ge=Ye[De],tt=Ye[Be],nt=_e[De],ft=_e[Be];Ge>0&&ft>0||Ge>0&&ft<0||Ge<0&&ft>0||Ge<0&&ft<0?de(De):(tt>0&&nt>0||tt>0&&nt<0||tt<0&&nt>0||tt<0&&nt<0)&&de(Be)}for(this._lines.unbind(),this._text.bind($,ee,H,this.pixelRatio),le=0;le<3;++le){var ke=ge[le].primalMinor,He=ge[le].mirrorMinor,Fe=A(N,ge[le].primalOffset);for(Ce=0;Ce<3;++Ce)this.lineTickEnable[le]&&(Fe[Ce]+=oe*ke[Ce]*Math.max(this.lineTickLength[Ce],0)/$[5*Ce]);var qe=[0,0,0];if(qe[le]=1,this.tickEnable[le]){for(this.tickAngle[le]===-3600?(this.tickAngle[le]=0,this.tickAlign[le]="auto"):this.tickAlign[le]=-1,me=1,(ye=[this.tickAlign[le],.5,me])[0]==="auto"?ye[0]=0:ye[0]=parseInt(""+ye[0]),be=[0,0,0],Me(le,ke,He),Ce=0;Ce<3;++Ce)Fe[Ce]+=oe*ke[Ce]*this.tickPad[Ce]/$[5*Ce];this._text.drawTicks(le,this.tickSize[le],this.tickAngle[le],Fe,this.tickColor[le],qe,be,ye)}if(this.labelEnable[le]){for(me=0,be=[0,0,0],this.labels[le].length>4&&(de(le),me=1),(ye=[this.labelAlign[le],.5,me])[0]==="auto"?ye[0]=0:ye[0]=parseInt(""+ye[0]),Ce=0;Ce<3;++Ce)Fe[Ce]+=oe*ke[Ce]*this.labelPad[Ce]/$[5*Ce];Fe[le]+=.5*(J[0][le]+J[1][le]),this._text.drawLabel(le,this.labelSize[le],this.labelAngle[le],Fe,this.labelColor[le],[0,0,0],be,ye)}}this._text.unbind()},S.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(u,r,n){u.exports=function(x){for(var m=[],g=[],k=0,A=0;A<3;++A)for(var v=(A+1)%3,S=(A+2)%3,T=[0,0,0],p=[0,0,0],M=-1;M<=1;M+=2){g.push(k,k+2,k+1,k+1,k+2,k+3),T[A]=M,p[A]=M;for(var f=-1;f<=1;f+=2){T[v]=f;for(var E=-1;E<=1;E+=2)T[S]=E,m.push(T[0],T[1],T[2],p[0],p[1],p[2]),k+=1}var I=v;v=S,S=I}var B=l(x,new Float32Array(m)),N=l(x,new Uint16Array(g),x.ELEMENT_ARRAY_BUFFER),V=o(x,[{buffer:B,type:x.FLOAT,size:3,offset:0,stride:24},{buffer:B,type:x.FLOAT,size:3,offset:12,stride:24}],N),j=s(x);return j.attributes.position.location=0,j.attributes.normal.location=1,new c(x,B,V,j)};var l=n(2762),o=n(8116),s=n(1879).bg;function c(x,m,g,k){this.gl=x,this.buffer=m,this.vao=g,this.shader=k}var h=c.prototype;h.draw=function(x,m,g,k,A,v){for(var S=!1,T=0;T<3;++T)S=S||A[T];if(S){var p=this.gl;p.enable(p.POLYGON_OFFSET_FILL),p.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:x,view:m,projection:g,bounds:k,enable:A,colors:v},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),p.disable(p.POLYGON_OFFSET_FILL)}},h.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(u,r,n){u.exports=function(f,E,I,B,N){o(h,E,f),o(h,I,h);for(var V=0,j=0;j<2;++j){g[2]=B[j][2];for(var $=0;$<2;++$){g[1]=B[$][1];for(var ee=0;ee<2;++ee)g[0]=B[ee][0],A(x[V],g,h),V+=1}}var H=-1;for(j=0;j<8;++j){for(var J=x[j][3],Q=0;Q<3;++Q)m[j][Q]=x[j][Q]/J;N&&(m[j][2]*=-1),J<0&&(H<0||m[j][2]se&&(H|=1<se&&(H|=1<m[j][1])&&(me=j);var be=-1;for(j=0;j<3;++j)(Ee=me^1<m[Se][0]&&(Se=Ee))}var Ce=T;Ce[0]=Ce[1]=Ce[2]=0,Ce[l.log2(be^me)]=me&be,Ce[l.log2(me^Se)]=me&Se;var Le=7^Se;Le===H||Le===ye?(Le=7^be,Ce[l.log2(Se^Le)]=Le&Se):Ce[l.log2(be^Le)]=Le&be;var Oe=p,We=H;for(Z=0;Z<3;++Z)Oe[Z]=We&1<Z&&ae>0){var se=(K[ae][0]-Z)/(K[ae][0]-K[ae-1][0]);return K[ae][1]*(1-se)+se*K[ae-1][1]}}return 1}function ee(Z){var K=l(Z,f.vertex,f.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K.attributes.pointSize.location=4,K}function H(Z){var K=l(Z,E.vertex,E.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K}function J(Z){var K=l(Z,I.vertex,I.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K.attributes.pointSize.location=4,K}function Q(Z){var K=l(Z,B.vertex,B.fragment);return K.attributes.position.location=0,K}j.isOpaque=function(){return!this.hasAlpha},j.isTransparent=function(){return this.hasAlpha},j.pickSlots=1,j.setPickBase=function(Z){this.pickId=Z},j.highlight=function(Z){if(Z&&this.contourEnable){for(var K=A(this.cells,this.intensity,Z.intensity),ae=K.cells,se=K.vertexIds,he=K.vertexWeights,fe=ae.length,ie=v.mallocFloat32(6*fe),oe=0,le=0;le0&&((ge=this.triShader).bind(),ge.uniforms=oe,this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((ge=this.lineShader).bind(),ge.uniforms=oe,this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((ge=this.pointShader).bind(),ge.uniforms=oe,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((ge=this.contourShader).bind(),ge.uniforms=oe,this.contourVAO.bind(),K.drawArrays(K.LINES,0,this.contourCount),this.contourVAO.unbind())},j.drawPick=function(Z){Z=Z||{};for(var K=this.gl,ae=Z.model||N,se=Z.view||N,he=Z.projection||N,fe=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ie=0;ie<3;++ie)fe[0][ie]=Math.max(fe[0][ie],this.clipBounds[0][ie]),fe[1][ie]=Math.min(fe[1][ie],this.clipBounds[1][ie]);this._model=[].slice.call(ae),this._view=[].slice.call(se),this._projection=[].slice.call(he),this._resolution=[K.drawingBufferWidth,K.drawingBufferHeight];var oe,le={model:ae,view:se,projection:he,clipBounds:fe,pickId:this.pickId/255};(oe=this.pickShader).bind(),oe.uniforms=le,this.triangleCount>0&&(this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((oe=this.pointPickShader).bind(),oe.uniforms=le,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind())},j.pick=function(Z){if(!Z||Z.id!==this.pickId)return null;for(var K=Z.value[0]+256*Z.value[1]+65536*Z.value[2],ae=this.cells[K],se=this.positions,he=new Array(ae.length),fe=0;feZ&&ae>0){var se=(K[ae][0]-Z)/(K[ae][0]-K[ae-1][0]);return K[ae][1]*(1-se)+se*K[ae-1][1]}}return 1}function ee(Z){var K=l(Z,f.vertex,f.fragment);return K.attributes.position.location=0,K.attributes.color.location=2,K.attributes.uv.location=3,K.attributes.pointSize.location=4,K}function H(Z){var K=l(Z,E.vertex,E.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K}function J(Z){var K=l(Z,I.vertex,I.fragment);return K.attributes.position.location=0,K.attributes.id.location=1,K.attributes.pointSize.location=4,K}function Q(Z){var K=l(Z,B.vertex,B.fragment);return K.attributes.position.location=0,K}j.isOpaque=function(){return!this.hasAlpha},j.isTransparent=function(){return this.hasAlpha},j.pickSlots=1,j.setPickBase=function(Z){this.pickId=Z},j.highlight=function(Z){if(Z&&this.contourEnable){for(var K=A(this.cells,this.intensity,Z.intensity),ae=K.cells,se=K.vertexIds,he=K.vertexWeights,fe=ae.length,ie=v.mallocFloat32(6*fe),oe=0,le=0;le0&&((ge=this.triShader).bind(),ge.uniforms=oe,this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((ge=this.lineShader).bind(),ge.uniforms=oe,this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((ge=this.pointShader).bind(),ge.uniforms=oe,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((ge=this.contourShader).bind(),ge.uniforms=oe,this.contourVAO.bind(),K.drawArrays(K.LINES,0,this.contourCount),this.contourVAO.unbind())},j.drawPick=function(Z){Z=Z||{};for(var K=this.gl,ae=Z.model||N,se=Z.view||N,he=Z.projection||N,fe=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ie=0;ie<3;++ie)fe[0][ie]=Math.max(fe[0][ie],this.clipBounds[0][ie]),fe[1][ie]=Math.min(fe[1][ie],this.clipBounds[1][ie]);this._model=[].slice.call(ae),this._view=[].slice.call(se),this._projection=[].slice.call(he),this._resolution=[K.drawingBufferWidth,K.drawingBufferHeight];var oe,le={model:ae,view:se,projection:he,clipBounds:fe,pickId:this.pickId/255};(oe=this.pickShader).bind(),oe.uniforms=le,this.triangleCount>0&&(this.triangleVAO.bind(),K.drawArrays(K.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),K.lineWidth(this.lineWidth*this.pixelRatio),K.drawArrays(K.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((oe=this.pointPickShader).bind(),oe.uniforms=le,this.pointVAO.bind(),K.drawArrays(K.POINTS,0,this.pointCount),this.pointVAO.unbind())},j.pick=function(Z){if(!Z||Z.id!==this.pickId)return null;for(var K=Z.value[0]+256*Z.value[1]+65536*Z.value[2],ae=this.cells[K],se=this.positions,he=new Array(ae.length),fe=0;fe0?(I=Math.round(Math.pow(10,E)),Math.ceil(f/I)*I):Math.ceil(f)}function M(f){return typeof f!="boolean"||f}u.exports={createScene:function(f){(f=f||{}).camera=f.camera||{};var E=f.canvas;E||(E=document.createElement("canvas"),f.container?f.container.appendChild(E):document.body.appendChild(E));var I=f.gl;if(I||(f.glOptions&&(S=!!f.glOptions.preserveDrawingBuffer),I=function(We,Ie){var Ve=null;try{(Ve=We.getContext("webgl",Ie))||(Ve=We.getContext("experimental-webgl",Ie))}catch{return null}return Ve}(E,f.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:S})),!I)throw new Error("webgl not supported");var B=f.bounds||[[-10,-10,-10],[10,10,10]],N=new T,V=x(I,I.drawingBufferWidth,I.drawingBufferHeight,{preferFloat:!S}),j=v(I),$=f.cameraObject&&f.cameraObject._ortho===!0||f.camera.projection&&f.camera.projection.type==="orthographic"||!1,ee={eye:f.camera.eye||[2,0,0],center:f.camera.center||[0,0,0],up:f.camera.up||[0,1,0],zoomMin:f.camera.zoomMax||.1,zoomMax:f.camera.zoomMin||100,mode:f.camera.mode||"turntable",_ortho:$},H=f.axes||{},J=o(I,H);J.enable=!H.disable;var Q=f.spikes||{},Z=c(I,Q),K=[],ae=[],se=[],he=[],fe=!0,ie=!0,oe={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},le=(ie=!0,[I.drawingBufferWidth,I.drawingBufferHeight]),ge=f.cameraObject||l(E,ee),ye={gl:I,contextLost:!1,pixelRatio:f.pixelRatio||1,canvas:E,selection:N,camera:ge,axes:J,axesPixels:null,spikes:Z,bounds:B,objects:K,shape:le,aspect:f.aspectRatio||[1,1,1],pickRadius:f.pickRadius||10,zNear:f.zNear||.01,zFar:f.zFar||1e3,fovy:f.fovy||Math.PI/4,clearColor:f.clearColor||[0,0,0,0],autoResize:M(f.autoResize),autoBounds:M(f.autoBounds),autoScale:!!f.autoScale,autoCenter:M(f.autoCenter),clipToBounds:M(f.clipToBounds),snapToData:!!f.snapToData,onselect:f.onselect||null,onrender:f.onrender||null,onclick:f.onclick||null,cameraParams:oe,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(We){this.aspect[0]=We.x,this.aspect[1]=We.y,this.aspect[2]=We.z,ie=!0},setBounds:function(We,Ie){this.bounds[0][We]=Ie.min,this.bounds[1][We]=Ie.max},setClearColor:function(We){this.clearColor=We},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)}},me=[I.drawingBufferWidth/ye.pixelRatio|0,I.drawingBufferHeight/ye.pixelRatio|0];function be(){if(!ye._stopped&&ye.autoResize){var We=E.parentNode,Ie=1,Ve=1;We&&We!==document.body?(Ie=We.clientWidth,Ve=We.clientHeight):(Ie=window.innerWidth,Ve=window.innerHeight);var Pe=0|Math.ceil(Ie*ye.pixelRatio),de=0|Math.ceil(Ve*ye.pixelRatio);if(Pe!==E.width||de!==E.height){E.width=Pe,E.height=de;var Me=E.style;Me.position=Me.position||"absolute",Me.left="0px",Me.top="0px",Me.width=Ie+"px",Me.height=Ve+"px",fe=!0}}}function Se(){for(var We=K.length,Ie=he.length,Ve=0;Ve0&&se[Ie-1]===0;)se.pop(),he.pop().dispose()}function Ee(){if(ye.contextLost)return!0;I.isContextLost()&&(ye.contextLost=!0,ye.mouseListener.enabled=!1,ye.selection.object=null,ye.oncontextloss&&ye.oncontextloss())}ye.autoResize&&be(),window.addEventListener("resize",be),ye.update=function(We){ye._stopped||(fe=!0,ie=!0)},ye.add=function(We){ye._stopped||(We.axes=J,K.push(We),ae.push(-1),fe=!0,ie=!0,Se())},ye.remove=function(We){if(!ye._stopped){var Ie=K.indexOf(We);Ie<0||(K.splice(Ie,1),ae.pop(),fe=!0,ie=!0,Se())}},ye.dispose=function(){if(!ye._stopped&&(ye._stopped=!0,window.removeEventListener("resize",be),E.removeEventListener("webglcontextlost",Ee),ye.mouseListener.enabled=!1,!ye.contextLost)){J.dispose(),Z.dispose();for(var We=0;WeN.distance)continue;for(var qe=0;qe0?(I=Math.round(Math.pow(10,E)),Math.ceil(f/I)*I):Math.ceil(f)}function M(f){return typeof f!="boolean"||f}u.exports={createScene:function(f){(f=f||{}).camera=f.camera||{};var E=f.canvas;E||(E=document.createElement("canvas"),f.container?f.container.appendChild(E):document.body.appendChild(E));var I=f.gl;if(I||(f.glOptions&&(S=!!f.glOptions.preserveDrawingBuffer),I=function(We,Ie){var Ve=null;try{(Ve=We.getContext("webgl",Ie))||(Ve=We.getContext("experimental-webgl",Ie))}catch{return null}return Ve}(E,f.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:S})),!I)throw new Error("webgl not supported");var B=f.bounds||[[-10,-10,-10],[10,10,10]],N=new T,V=x(I,I.drawingBufferWidth,I.drawingBufferHeight,{preferFloat:!S}),j=v(I),$=f.cameraObject&&f.cameraObject._ortho===!0||f.camera.projection&&f.camera.projection.type==="orthographic"||!1,ee={eye:f.camera.eye||[2,0,0],center:f.camera.center||[0,0,0],up:f.camera.up||[0,1,0],zoomMin:f.camera.zoomMax||.1,zoomMax:f.camera.zoomMin||100,mode:f.camera.mode||"turntable",_ortho:$},H=f.axes||{},J=o(I,H);J.enable=!H.disable;var Q=f.spikes||{},Z=c(I,Q),K=[],ae=[],se=[],he=[],fe=!0,ie=!0,oe={view:null,projection:new Array(16),model:new Array(16),_ortho:!1},le=(ie=!0,[I.drawingBufferWidth,I.drawingBufferHeight]),ge=f.cameraObject||l(E,ee),ye={gl:I,contextLost:!1,pixelRatio:f.pixelRatio||1,canvas:E,selection:N,camera:ge,axes:J,axesPixels:null,spikes:Z,bounds:B,objects:K,shape:le,aspect:f.aspectRatio||[1,1,1],pickRadius:f.pickRadius||10,zNear:f.zNear||.01,zFar:f.zFar||1e3,fovy:f.fovy||Math.PI/4,clearColor:f.clearColor||[0,0,0,0],autoResize:M(f.autoResize),autoBounds:M(f.autoBounds),autoScale:!!f.autoScale,autoCenter:M(f.autoCenter),clipToBounds:M(f.clipToBounds),snapToData:!!f.snapToData,onselect:f.onselect||null,onrender:f.onrender||null,onclick:f.onclick||null,cameraParams:oe,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(We){this.aspect[0]=We.x,this.aspect[1]=We.y,this.aspect[2]=We.z,ie=!0},setBounds:function(We,Ie){this.bounds[0][We]=Ie.min,this.bounds[1][We]=Ie.max},setClearColor:function(We){this.clearColor=We},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)}},me=[I.drawingBufferWidth/ye.pixelRatio|0,I.drawingBufferHeight/ye.pixelRatio|0];function be(){if(!ye._stopped&&ye.autoResize){var We=E.parentNode,Ie=1,Ve=1;We&&We!==document.body?(Ie=We.clientWidth,Ve=We.clientHeight):(Ie=window.innerWidth,Ve=window.innerHeight);var Pe=0|Math.ceil(Ie*ye.pixelRatio),de=0|Math.ceil(Ve*ye.pixelRatio);if(Pe!==E.width||de!==E.height){E.width=Pe,E.height=de;var Me=E.style;Me.position=Me.position||"absolute",Me.left="0px",Me.top="0px",Me.width=Ie+"px",Me.height=Ve+"px",fe=!0}}}function Se(){for(var We=K.length,Ie=he.length,Ve=0;Ve0&&se[Ie-1]===0;)se.pop(),he.pop().dispose()}function Ee(){if(ye.contextLost)return!0;I.isContextLost()&&(ye.contextLost=!0,ye.mouseListener.enabled=!1,ye.selection.object=null,ye.oncontextloss&&ye.oncontextloss())}ye.autoResize&&be(),window.addEventListener("resize",be),ye.update=function(We){ye._stopped||(fe=!0,ie=!0)},ye.add=function(We){ye._stopped||(We.axes=J,K.push(We),ae.push(-1),fe=!0,ie=!0,Se())},ye.remove=function(We){if(!ye._stopped){var Ie=K.indexOf(We);Ie<0||(K.splice(Ie,1),ae.pop(),fe=!0,ie=!0,Se())}},ye.dispose=function(){if(!ye._stopped&&(ye._stopped=!0,window.removeEventListener("resize",be),E.removeEventListener("webglcontextlost",Ee),ye.mouseListener.enabled=!1,!ye.contextLost)){J.dispose(),Z.dispose();for(var We=0;WeN.distance)continue;for(var qe=0;qe1?1:fe}function E(fe,ie,oe,le,ge,ye,me,be,Se,Ee,Ce,Le){this.gl=fe,this.pixelRatio=1,this.shader=ie,this.orthoShader=oe,this.projectShader=le,this.pointBuffer=ge,this.colorBuffer=ye,this.glyphBuffer=me,this.idBuffer=be,this.vao=Se,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ee,this.pickOrthoShader=Ce,this.pickProjectShader=Le,this.points=[],this._selectResult=new M(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}u.exports=function(fe){var ie=fe.gl,oe=x.createPerspective(ie),le=x.createOrtho(ie),ge=x.createProject(ie),ye=x.createPickPerspective(ie),me=x.createPickOrtho(ie),be=x.createPickProject(ie),Se=o(ie),Ee=o(ie),Ce=o(ie),Le=o(ie),Oe=new E(ie,oe,le,ge,Se,Ee,Ce,Le,s(ie,[{buffer:Se,size:3,type:ie.FLOAT},{buffer:Ee,size:4,type:ie.FLOAT},{buffer:Ce,size:2,type:ie.FLOAT},{buffer:Le,size:4,type:ie.UNSIGNED_BYTE,normalized:!0}]),ye,me,be);return Oe.update(fe),Oe};var I=E.prototype;I.pickSlots=1,I.setPickBase=function(fe){this.pickId=fe},I.isTransparent=function(){if(this.hasAlpha)return!0;for(var fe=0;fe<3;++fe)if(this.axesProject[fe]&&this.projectHasAlpha)return!0;return!1},I.isOpaque=function(){if(!this.hasAlpha)return!0;for(var fe=0;fe<3;++fe)if(this.axesProject[fe]&&!this.projectHasAlpha)return!0;return!1};var B=[0,0],N=[0,0,0],V=[0,0,0],j=[0,0,0,1],$=[0,0,0,1],ee=k.slice(),H=[0,0,0],J=[[0,0,0],[0,0,0]];function Q(fe){return fe[0]=fe[1]=fe[2]=0,fe}function Z(fe,ie){return fe[0]=ie[0],fe[1]=ie[1],fe[2]=ie[2],fe[3]=1,fe}function K(fe,ie,oe,le){return fe[0]=ie[0],fe[1]=ie[1],fe[2]=ie[2],fe[oe]=le,fe}var ae=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function se(fe,ie,oe,le,ge,ye,me){var be=oe.gl;if((ye===oe.projectHasAlpha||me)&&function(Ee,Ce,Le,Oe){var We,Ie=Ce.axesProject,Ve=Ce.gl,Pe=Ee.uniforms,de=Le.model||k,Me=Le.view||k,ke=Le.projection||k,He=Ce.axesBounds,Fe=function(Ht){for(var Gt=J,st=0;st<2;++st)for(var Qe=0;Qe<3;++Qe)Gt[st][Qe]=Math.max(Math.min(Ht[st][Qe],1e8),-1e8);return Gt}(Ce.clipBounds);We=Ce.axes&&Ce.axes.lastCubeProps?Ce.axes.lastCubeProps.axis:[1,1,1],B[0]=2/Ve.drawingBufferWidth,B[1]=2/Ve.drawingBufferHeight,Ee.bind(),Pe.view=Me,Pe.projection=ke,Pe.screenSize=B,Pe.highlightId=Ce.highlightId,Pe.highlightScale=Ce.highlightScale,Pe.clipBounds=Fe,Pe.pickGroup=Ce.pickId/255,Pe.pixelRatio=Oe;for(var qe=0;qe<3;++qe)if(Ie[qe]){Pe.scale=Ce.projectScale[qe],Pe.opacity=Ce.projectOpacity[qe];for(var $e=ee,Ye=0;Ye<16;++Ye)$e[Ye]=0;for(Ye=0;Ye<4;++Ye)$e[5*Ye]=1;$e[5*qe]=0,We[qe]<0?$e[12+qe]=He[0][qe]:$e[12+qe]=He[1][qe],h($e,de,$e),Pe.model=$e;var _e=(qe+1)%3,De=(qe+2)%3,Be=Q(N),Ge=Q(V);Be[_e]=1,Ge[De]=1;var tt=p(0,0,0,Z(j,Be)),nt=p(0,0,0,Z($,Ge));if(Math.abs(tt[1])>Math.abs(nt[1])){var pt=tt;tt=nt,nt=pt,pt=Be,Be=Ge,Ge=pt;var At=_e;_e=De,De=At}tt[0]<0&&(Be[_e]=-1),nt[1]>0&&(Ge[De]=-1);var wt=0,Nt=0;for(Ye=0;Ye<4;++Ye)wt+=Math.pow(de[4*_e+Ye],2),Nt+=Math.pow(de[4*De+Ye],2);Be[_e]/=Math.sqrt(wt),Ge[De]/=Math.sqrt(Nt),Pe.axes[0]=Be,Pe.axes[1]=Ge,Pe.fragClipBounds[0]=K(H,Fe[0],qe,-1e8),Pe.fragClipBounds[1]=K(H,Fe[1],qe,1e8),Ce.vao.bind(),Ce.vao.draw(Ve.TRIANGLES,Ce.vertexCount),Ce.lineWidth>0&&(Ve.lineWidth(Ce.lineWidth*Oe),Ce.vao.draw(Ve.LINES,Ce.lineVertexCount,Ce.vertexCount)),Ce.vao.unbind()}}(ie,oe,le,ge),ye===oe.hasAlpha||me){fe.bind();var Se=fe.uniforms;Se.model=le.model||k,Se.view=le.view||k,Se.projection=le.projection||k,B[0]=2/be.drawingBufferWidth,B[1]=2/be.drawingBufferHeight,Se.screenSize=B,Se.highlightId=oe.highlightId,Se.highlightScale=oe.highlightScale,Se.fragClipBounds=ae,Se.clipBounds=oe.axes.bounds,Se.opacity=oe.opacity,Se.pickGroup=oe.pickId/255,Se.pixelRatio=ge,oe.vao.bind(),oe.vao.draw(be.TRIANGLES,oe.vertexCount),oe.lineWidth>0&&(be.lineWidth(oe.lineWidth*ge),oe.vao.draw(be.LINES,oe.lineVertexCount,oe.vertexCount)),oe.vao.unbind()}}function he(fe,ie,oe,le){var ge;ge=S(fe)?ie=this.pointCount||ie<0)return null;var oe=this.points[ie],le=this._selectResult;le.index=ie;for(var ge=0;ge<3;++ge)le.position[ge]=le.dataCoordinate[ge]=oe[ge];return le},I.highlight=function(fe){if(fe){var ie=fe.index,oe=255&ie,le=ie>>8&255,ge=ie>>16&255;this.highlightId=[oe/255,le/255,ge/255,0]}else this.highlightId=[1,1,1,1]},I.update=function(fe){if("perspective"in(fe=fe||{})&&(this.useOrtho=!fe.perspective),"orthographic"in fe&&(this.useOrtho=!!fe.orthographic),"lineWidth"in fe&&(this.lineWidth=fe.lineWidth),"project"in fe)if(S(fe.project))this.axesProject=fe.project;else{var ie=!!fe.project;this.axesProject=[ie,ie,ie]}if("projectScale"in fe)if(S(fe.projectScale))this.projectScale=fe.projectScale.slice();else{var oe=+fe.projectScale;this.projectScale=[oe,oe,oe]}if(this.projectHasAlpha=!1,"projectOpacity"in fe){S(fe.projectOpacity)?this.projectOpacity=fe.projectOpacity.slice():(oe=+fe.projectOpacity,this.projectOpacity=[oe,oe,oe]);for(var le=0;le<3;++le)this.projectOpacity[le]=f(this.projectOpacity[le]),this.projectOpacity[le]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in fe&&(this.opacity=f(fe.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var ge,ye,me=fe.position,be={family:fe.font||"normal",style:fe.fontStyle||"normal",weight:fe.fontWeight||"normal",variant:fe.fontVariant||"normal"},Se=fe.alignment||[0,0];if(Se.length===2)ge=Se[0],ye=Se[1];else for(ge=[],ye=[],le=0;le0){var nt=0,pt=de,At=[0,0,0,1],wt=[0,0,0,1],Nt=S(Oe)&&S(Oe[0]),Ht=S(Ve)&&S(Ve[0]);e:for(le=0;le0?1-Ye[0][0]:at<0?1+Ye[1][0]:1,lt*=lt>0?1-Ye[0][1]:lt<0?1+Ye[1][1]:1],ut=qe.cells||[],Tt=qe.positions||[];for(Fe=0;Fe1?1:fe}function E(fe,ie,oe,le,ge,ye,me,be,Se,Ee,Ce,Le){this.gl=fe,this.pixelRatio=1,this.shader=ie,this.orthoShader=oe,this.projectShader=le,this.pointBuffer=ge,this.colorBuffer=ye,this.glyphBuffer=me,this.idBuffer=be,this.vao=Se,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Ee,this.pickOrthoShader=Ce,this.pickProjectShader=Le,this.points=[],this._selectResult=new M(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}u.exports=function(fe){var ie=fe.gl,oe=x.createPerspective(ie),le=x.createOrtho(ie),ge=x.createProject(ie),ye=x.createPickPerspective(ie),me=x.createPickOrtho(ie),be=x.createPickProject(ie),Se=o(ie),Ee=o(ie),Ce=o(ie),Le=o(ie),Oe=new E(ie,oe,le,ge,Se,Ee,Ce,Le,s(ie,[{buffer:Se,size:3,type:ie.FLOAT},{buffer:Ee,size:4,type:ie.FLOAT},{buffer:Ce,size:2,type:ie.FLOAT},{buffer:Le,size:4,type:ie.UNSIGNED_BYTE,normalized:!0}]),ye,me,be);return Oe.update(fe),Oe};var I=E.prototype;I.pickSlots=1,I.setPickBase=function(fe){this.pickId=fe},I.isTransparent=function(){if(this.hasAlpha)return!0;for(var fe=0;fe<3;++fe)if(this.axesProject[fe]&&this.projectHasAlpha)return!0;return!1},I.isOpaque=function(){if(!this.hasAlpha)return!0;for(var fe=0;fe<3;++fe)if(this.axesProject[fe]&&!this.projectHasAlpha)return!0;return!1};var B=[0,0],N=[0,0,0],V=[0,0,0],j=[0,0,0,1],$=[0,0,0,1],ee=k.slice(),H=[0,0,0],J=[[0,0,0],[0,0,0]];function Q(fe){return fe[0]=fe[1]=fe[2]=0,fe}function Z(fe,ie){return fe[0]=ie[0],fe[1]=ie[1],fe[2]=ie[2],fe[3]=1,fe}function K(fe,ie,oe,le){return fe[0]=ie[0],fe[1]=ie[1],fe[2]=ie[2],fe[oe]=le,fe}var ae=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function se(fe,ie,oe,le,ge,ye,me){var be=oe.gl;if((ye===oe.projectHasAlpha||me)&&function(Ee,Ce,Le,Oe){var We,Ie=Ce.axesProject,Ve=Ce.gl,Pe=Ee.uniforms,de=Le.model||k,Me=Le.view||k,ke=Le.projection||k,He=Ce.axesBounds,Fe=function(Ht){for(var Gt=J,st=0;st<2;++st)for(var Qe=0;Qe<3;++Qe)Gt[st][Qe]=Math.max(Math.min(Ht[st][Qe],1e8),-1e8);return Gt}(Ce.clipBounds);We=Ce.axes&&Ce.axes.lastCubeProps?Ce.axes.lastCubeProps.axis:[1,1,1],B[0]=2/Ve.drawingBufferWidth,B[1]=2/Ve.drawingBufferHeight,Ee.bind(),Pe.view=Me,Pe.projection=ke,Pe.screenSize=B,Pe.highlightId=Ce.highlightId,Pe.highlightScale=Ce.highlightScale,Pe.clipBounds=Fe,Pe.pickGroup=Ce.pickId/255,Pe.pixelRatio=Oe;for(var qe=0;qe<3;++qe)if(Ie[qe]){Pe.scale=Ce.projectScale[qe],Pe.opacity=Ce.projectOpacity[qe];for(var $e=ee,Ye=0;Ye<16;++Ye)$e[Ye]=0;for(Ye=0;Ye<4;++Ye)$e[5*Ye]=1;$e[5*qe]=0,We[qe]<0?$e[12+qe]=He[0][qe]:$e[12+qe]=He[1][qe],h($e,de,$e),Pe.model=$e;var _e=(qe+1)%3,De=(qe+2)%3,Be=Q(N),Ge=Q(V);Be[_e]=1,Ge[De]=1;var tt=p(0,0,0,Z(j,Be)),nt=p(0,0,0,Z($,Ge));if(Math.abs(tt[1])>Math.abs(nt[1])){var ft=tt;tt=nt,nt=ft,ft=Be,Be=Ge,Ge=ft;var At=_e;_e=De,De=At}tt[0]<0&&(Be[_e]=-1),nt[1]>0&&(Ge[De]=-1);var kt=0,Vt=0;for(Ye=0;Ye<4;++Ye)kt+=Math.pow(de[4*_e+Ye],2),Vt+=Math.pow(de[4*De+Ye],2);Be[_e]/=Math.sqrt(kt),Ge[De]/=Math.sqrt(Vt),Pe.axes[0]=Be,Pe.axes[1]=Ge,Pe.fragClipBounds[0]=K(H,Fe[0],qe,-1e8),Pe.fragClipBounds[1]=K(H,Fe[1],qe,1e8),Ce.vao.bind(),Ce.vao.draw(Ve.TRIANGLES,Ce.vertexCount),Ce.lineWidth>0&&(Ve.lineWidth(Ce.lineWidth*Oe),Ce.vao.draw(Ve.LINES,Ce.lineVertexCount,Ce.vertexCount)),Ce.vao.unbind()}}(ie,oe,le,ge),ye===oe.hasAlpha||me){fe.bind();var Se=fe.uniforms;Se.model=le.model||k,Se.view=le.view||k,Se.projection=le.projection||k,B[0]=2/be.drawingBufferWidth,B[1]=2/be.drawingBufferHeight,Se.screenSize=B,Se.highlightId=oe.highlightId,Se.highlightScale=oe.highlightScale,Se.fragClipBounds=ae,Se.clipBounds=oe.axes.bounds,Se.opacity=oe.opacity,Se.pickGroup=oe.pickId/255,Se.pixelRatio=ge,oe.vao.bind(),oe.vao.draw(be.TRIANGLES,oe.vertexCount),oe.lineWidth>0&&(be.lineWidth(oe.lineWidth*ge),oe.vao.draw(be.LINES,oe.lineVertexCount,oe.vertexCount)),oe.vao.unbind()}}function he(fe,ie,oe,le){var ge;ge=S(fe)?ie=this.pointCount||ie<0)return null;var oe=this.points[ie],le=this._selectResult;le.index=ie;for(var ge=0;ge<3;++ge)le.position[ge]=le.dataCoordinate[ge]=oe[ge];return le},I.highlight=function(fe){if(fe){var ie=fe.index,oe=255&ie,le=ie>>8&255,ge=ie>>16&255;this.highlightId=[oe/255,le/255,ge/255,0]}else this.highlightId=[1,1,1,1]},I.update=function(fe){if("perspective"in(fe=fe||{})&&(this.useOrtho=!fe.perspective),"orthographic"in fe&&(this.useOrtho=!!fe.orthographic),"lineWidth"in fe&&(this.lineWidth=fe.lineWidth),"project"in fe)if(S(fe.project))this.axesProject=fe.project;else{var ie=!!fe.project;this.axesProject=[ie,ie,ie]}if("projectScale"in fe)if(S(fe.projectScale))this.projectScale=fe.projectScale.slice();else{var oe=+fe.projectScale;this.projectScale=[oe,oe,oe]}if(this.projectHasAlpha=!1,"projectOpacity"in fe){S(fe.projectOpacity)?this.projectOpacity=fe.projectOpacity.slice():(oe=+fe.projectOpacity,this.projectOpacity=[oe,oe,oe]);for(var le=0;le<3;++le)this.projectOpacity[le]=f(this.projectOpacity[le]),this.projectOpacity[le]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in fe&&(this.opacity=f(fe.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var ge,ye,me=fe.position,be={family:fe.font||"normal",style:fe.fontStyle||"normal",weight:fe.fontWeight||"normal",variant:fe.fontVariant||"normal"},Se=fe.alignment||[0,0];if(Se.length===2)ge=Se[0],ye=Se[1];else for(ge=[],ye=[],le=0;le0){var nt=0,ft=de,At=[0,0,0,1],kt=[0,0,0,1],Vt=S(Oe)&&S(Oe[0]),Ht=S(Ve)&&S(Ve[0]);e:for(le=0;le0?1-Ye[0][0]:at<0?1+Ye[1][0]:1,lt*=lt>0?1-Ye[0][1]:lt<0?1+Ye[1][1]:1],ut=qe.cells||[],wt=qe.positions||[];for(Fe=0;FeA)return v-1}return v},h=function(k,A,v){return kv?v:k},x=function(k){var A=1/0;k.sort(function(p,M){return p-M});for(var v=k.length,S=1;SFe-1||Ge>qe-1||tt>$e-1)return l.create();var nt,pt,At,wt,Nt,Ht,Gt=de[0][Ye],st=de[0][Be],Qe=de[1][_e],ft=de[1][Ge],yt=de[2][De],Ot=(Me-Gt)/(st-Gt),Pt=(ke-Qe)/(ft-Qe),at=(He-yt)/(de[2][tt]-yt);switch(isFinite(Ot)||(Ot=.5),isFinite(Pt)||(Pt=.5),isFinite(at)||(at=.5),Ve.reversedX&&(Ye=Fe-1-Ye,Be=Fe-1-Be),Ve.reversedY&&(_e=qe-1-_e,Ge=qe-1-Ge),Ve.reversedZ&&(De=$e-1-De,tt=$e-1-tt),Ve.filled){case 5:Nt=De,Ht=tt,At=_e*$e,wt=Ge*$e,nt=Ye*$e*qe,pt=Be*$e*qe;break;case 4:Nt=De,Ht=tt,nt=Ye*$e,pt=Be*$e,At=_e*$e*Fe,wt=Ge*$e*Fe;break;case 3:At=_e,wt=Ge,Nt=De*qe,Ht=tt*qe,nt=Ye*qe*$e,pt=Be*qe*$e;break;case 2:At=_e,wt=Ge,nt=Ye*qe,pt=Be*qe,Nt=De*qe*Fe,Ht=tt*qe*Fe;break;case 1:nt=Ye,pt=Be,Nt=De*Fe,Ht=tt*Fe,At=_e*Fe*$e,wt=Ge*Fe*$e;break;default:nt=Ye,pt=Be,At=_e*Fe,wt=Ge*Fe,Nt=De*Fe*qe,Ht=tt*Fe*qe}var lt=Pe[nt+At+Nt],Xe=Pe[nt+At+Ht],ut=Pe[nt+wt+Nt],Tt=Pe[nt+wt+Ht],vt=Pe[pt+At+Nt],Lt=Pe[pt+At+Ht],Ut=Pe[pt+wt+Nt],rt=Pe[pt+wt+Ht],et=l.create(),Et=l.create(),Bt=l.create(),Ft=l.create();l.lerp(et,lt,vt,Ot),l.lerp(Et,Xe,Lt,Ot),l.lerp(Bt,ut,Ut,Ot),l.lerp(Ft,Tt,rt,Ot);var St=l.create(),Jt=l.create();l.lerp(St,et,Bt,Pt),l.lerp(Jt,Et,Ft,Pt);var qt=l.create();return l.lerp(qt,St,Jt,at),qt}(Oe,k,f)},I=k.getDivergence||function(Oe,We){var Ie=l.create(),Ve=1e-4;l.add(Ie,Oe,[Ve,0,0]);var Pe=E(Ie);l.subtract(Pe,Pe,We),l.scale(Pe,Pe,1/Ve),l.add(Ie,Oe,[0,Ve,0]);var de=E(Ie);l.subtract(de,de,We),l.scale(de,de,1/Ve),l.add(Ie,Oe,[0,0,Ve]);var Me=E(Ie);return l.subtract(Me,Me,We),l.scale(Me,Me,1/Ve),l.add(Ie,Pe,de),l.add(Ie,Ie,Me),Ie},B=[],N=A[0][0],V=A[0][1],j=A[0][2],$=A[1][0],ee=A[1][1],H=A[1][2],J=function(Oe){var We=Oe[0],Ie=Oe[1],Ve=Oe[2];return!(We$||Ieee||VeH)},Q=10*l.distance(A[0],A[1])/S,Z=Q*Q,K=1,ae=0,se=v.length;se>1&&(K=function(Oe){for(var We=[],Ie=[],Ve=[],Pe={},de={},Me={},ke=Oe.length,He=0;Heae&&(ae=be),ye.push(be),B.push({points:ie,velocities:oe,divergences:ye});for(var Se=0;Se<100*S&&ie.lengthZ&&l.scale(Ee,Ee,Q/Math.sqrt(Ce)),l.add(Ee,Ee,fe),le=E(Ee),l.squaredDistance(ge,Ee)-Z>-1e-4*Z&&(ie.push(Ee),ge=Ee,oe.push(le),me=I(Ee,le),be=l.length(me),isFinite(be)&&be>ae&&(ae=be),ye.push(be)),fe=Ee}}var Le=function(Oe,We,Ie,Ve){for(var Pe=0,de=0;de0)for(et=0;et<8;et++){var Et=(et+1)%8;Qe.push(Ot[et],Pt[et],Pt[Et],Pt[Et],Ot[Et],Ot[et]),yt.push(Tt,ut,ut,ut,Tt,Tt),at.push(lt,Xe,Xe,Xe,lt,lt);var Bt=Qe.length;ft.push([Bt-6,Bt-5,Bt-4],[Bt-3,Bt-2,Bt-1])}var Ft=Ot;Ot=Pt,Pt=Ft;var St=Tt;Tt=ut,ut=St;var Jt=lt;lt=Xe,Xe=Jt}return{positions:Qe,cells:ft,vectors:yt,vertexIntensity:at}}(nt,Ie,Ve,Pe)}),Fe=[],qe=[],$e=[],Ye=[];for(de=0;deA)return v-1}return v},h=function(k,A,v){return kv?v:k},x=function(k){var A=1/0;k.sort(function(p,M){return p-M});for(var v=k.length,S=1;SFe-1||Ge>qe-1||tt>$e-1)return l.create();var nt,ft,At,kt,Vt,Ht,Gt=de[0][Ye],st=de[0][Be],Qe=de[1][_e],pt=de[1][Ge],yt=de[2][De],Ot=(Me-Gt)/(st-Gt),Pt=(ke-Qe)/(pt-Qe),at=(He-yt)/(de[2][tt]-yt);switch(isFinite(Ot)||(Ot=.5),isFinite(Pt)||(Pt=.5),isFinite(at)||(at=.5),Ve.reversedX&&(Ye=Fe-1-Ye,Be=Fe-1-Be),Ve.reversedY&&(_e=qe-1-_e,Ge=qe-1-Ge),Ve.reversedZ&&(De=$e-1-De,tt=$e-1-tt),Ve.filled){case 5:Vt=De,Ht=tt,At=_e*$e,kt=Ge*$e,nt=Ye*$e*qe,ft=Be*$e*qe;break;case 4:Vt=De,Ht=tt,nt=Ye*$e,ft=Be*$e,At=_e*$e*Fe,kt=Ge*$e*Fe;break;case 3:At=_e,kt=Ge,Vt=De*qe,Ht=tt*qe,nt=Ye*qe*$e,ft=Be*qe*$e;break;case 2:At=_e,kt=Ge,nt=Ye*qe,ft=Be*qe,Vt=De*qe*Fe,Ht=tt*qe*Fe;break;case 1:nt=Ye,ft=Be,Vt=De*Fe,Ht=tt*Fe,At=_e*Fe*$e,kt=Ge*Fe*$e;break;default:nt=Ye,ft=Be,At=_e*Fe,kt=Ge*Fe,Vt=De*Fe*qe,Ht=tt*Fe*qe}var lt=Pe[nt+At+Vt],Xe=Pe[nt+At+Ht],ut=Pe[nt+kt+Vt],wt=Pe[nt+kt+Ht],vt=Pe[ft+At+Vt],Lt=Pe[ft+At+Ht],jt=Pe[ft+kt+Vt],rt=Pe[ft+kt+Ht],et=l.create(),Et=l.create(),Bt=l.create(),Ft=l.create();l.lerp(et,lt,vt,Ot),l.lerp(Et,Xe,Lt,Ot),l.lerp(Bt,ut,jt,Ot),l.lerp(Ft,wt,rt,Ot);var St=l.create(),Jt=l.create();l.lerp(St,et,Bt,Pt),l.lerp(Jt,Et,Ft,Pt);var qt=l.create();return l.lerp(qt,St,Jt,at),qt}(Oe,k,f)},I=k.getDivergence||function(Oe,We){var Ie=l.create(),Ve=1e-4;l.add(Ie,Oe,[Ve,0,0]);var Pe=E(Ie);l.subtract(Pe,Pe,We),l.scale(Pe,Pe,1/Ve),l.add(Ie,Oe,[0,Ve,0]);var de=E(Ie);l.subtract(de,de,We),l.scale(de,de,1/Ve),l.add(Ie,Oe,[0,0,Ve]);var Me=E(Ie);return l.subtract(Me,Me,We),l.scale(Me,Me,1/Ve),l.add(Ie,Pe,de),l.add(Ie,Ie,Me),Ie},B=[],N=A[0][0],V=A[0][1],j=A[0][2],$=A[1][0],ee=A[1][1],H=A[1][2],J=function(Oe){var We=Oe[0],Ie=Oe[1],Ve=Oe[2];return!(We$||Ieee||VeH)},Q=10*l.distance(A[0],A[1])/S,Z=Q*Q,K=1,ae=0,se=v.length;se>1&&(K=function(Oe){for(var We=[],Ie=[],Ve=[],Pe={},de={},Me={},ke=Oe.length,He=0;Heae&&(ae=be),ye.push(be),B.push({points:ie,velocities:oe,divergences:ye});for(var Se=0;Se<100*S&&ie.lengthZ&&l.scale(Ee,Ee,Q/Math.sqrt(Ce)),l.add(Ee,Ee,fe),le=E(Ee),l.squaredDistance(ge,Ee)-Z>-1e-4*Z&&(ie.push(Ee),ge=Ee,oe.push(le),me=I(Ee,le),be=l.length(me),isFinite(be)&&be>ae&&(ae=be),ye.push(be)),fe=Ee}}var Le=function(Oe,We,Ie,Ve){for(var Pe=0,de=0;de0)for(et=0;et<8;et++){var Et=(et+1)%8;Qe.push(Ot[et],Pt[et],Pt[Et],Pt[Et],Ot[Et],Ot[et]),yt.push(wt,ut,ut,ut,wt,wt),at.push(lt,Xe,Xe,Xe,lt,lt);var Bt=Qe.length;pt.push([Bt-6,Bt-5,Bt-4],[Bt-3,Bt-2,Bt-1])}var Ft=Ot;Ot=Pt,Pt=Ft;var St=wt;wt=ut,ut=St;var Jt=lt;lt=Xe,Xe=Jt}return{positions:Qe,cells:pt,vectors:yt,vertexIntensity:at}}(nt,Ie,Ve,Pe)}),Fe=[],qe=[],$e=[],Ye=[];for(de=0;deWe&&Ve>0){var Pe=(Ie[Ve][0]-We)/(Ie[Ve][0]-Ie[Ve-1][0]);return Ie[Ve][1]*(1-Pe)+Pe*Ie[Ve-1][1]}}return 1}(Le/255,be):Ce[3];return Oe<1&&(Se=!0),[Ce[0],Ce[1],Ce[2],255*Oe]})]);return m.divseq(Ee,255),this.hasAlphaScale=Se,Ee},Q.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},Q.isOpaque=function(){return!this.isTransparent()},Q.pickSlots=1,Q.setPickBase=function(me){this.pickId=me};var Z=[0,0,0],K={showSurface:!1,showContour:!1,projections:[V.slice(),V.slice(),V.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function ae(me,be){var Se,Ee,Ce,Le=be.axes&&be.axes.lastCubeProps.axis||Z,Oe=be.showSurface,We=be.showContour;for(Se=0;Se<3;++Se)for(Oe=Oe||be.surfaceProject[Se],Ee=0;Ee<3;++Ee)We=We||be.contourProject[Se][Ee];for(Se=0;Se<3;++Se){var Ie=K.projections[Se];for(Ee=0;Ee<16;++Ee)Ie[Ee]=0;for(Ee=0;Ee<4;++Ee)Ie[5*Ee]=1;Ie[5*Se]=0,Ie[12+Se]=be.axesBounds[+(Le[Se]>0)][Se],v(Ie,me.model,Ie);var Ve=K.clipBounds[Se];for(Ce=0;Ce<2;++Ce)for(Ee=0;Ee<3;++Ee)Ve[Ce][Ee]=me.clipBounds[Ce][Ee];Ve[0][Se]=-1e8,Ve[1][Se]=1e8}return K.showSurface=Oe,K.showContour=We,K}var se={model:V,view:V,projection:V,inverseModel:V.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},he=V.slice(),fe=[1,0,0,0,1,0,0,0,1];function ie(me,be){me=me||{};var Se=this.gl;Se.disable(Se.CULL_FACE),this._colorMap.bind(0);var Ee=se;Ee.model=me.model||V,Ee.view=me.view||V,Ee.projection=me.projection||V,Ee.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],Ee.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],Ee.objectOffset=this.objectOffset,Ee.contourColor=this.contourColor[0],Ee.inverseModel=S(Ee.inverseModel,Ee.model);for(var Ce=0;Ce<2;++Ce)for(var Le=Ee.clipBounds[Ce],Oe=0;Oe<3;++Oe)Le[Oe]=Math.min(Math.max(this.clipBounds[Ce][Oe],-1e8),1e8);Ee.kambient=this.ambientLight,Ee.kdiffuse=this.diffuseLight,Ee.kspecular=this.specularLight,Ee.roughness=this.roughness,Ee.fresnel=this.fresnel,Ee.opacity=this.opacity,Ee.height=0,Ee.permutation=fe,Ee.vertexColor=this.vertexColor;var We=he;for(v(We,Ee.view,Ee.model),v(We,Ee.projection,We),S(We,We),Ce=0;Ce<3;++Ce)Ee.eyePosition[Ce]=We[12+Ce]/We[15];var Ie=We[15];for(Ce=0;Ce<3;++Ce)Ie+=this.lightPosition[Ce]*We[4*Ce+3];for(Ce=0;Ce<3;++Ce){var Ve=We[12+Ce];for(Oe=0;Oe<3;++Oe)Ve+=We[4*Oe+Ce]*this.lightPosition[Oe];Ee.lightPosition[Ce]=Ve/Ie}var Pe=ae(Ee,this);if(Pe.showSurface){for(this._shader.bind(),this._shader.uniforms=Ee,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(Se.TRIANGLES,this._vertexCount),Ce=0;Ce<3;++Ce)this.surfaceProject[Ce]&&this.vertexCount&&(this._shader.uniforms.model=Pe.projections[Ce],this._shader.uniforms.clipBounds=Pe.clipBounds[Ce],this._vao.draw(Se.TRIANGLES,this._vertexCount));this._vao.unbind()}if(Pe.showContour){var de=this._contourShader;Ee.kambient=1,Ee.kdiffuse=0,Ee.kspecular=0,Ee.opacity=1,de.bind(),de.uniforms=Ee;var Me=this._contourVAO;for(Me.bind(),Ce=0;Ce<3;++Ce)for(de.uniforms.permutation=$[Ce],Se.lineWidth(this.contourWidth[Ce]*this.pixelRatio),Oe=0;Oe>4)/16)/255,Ce=Math.floor(Ee),Le=Ee-Ce,Oe=be[1]*(me.value[1]+(15&me.value[2])/16)/255,We=Math.floor(Oe),Ie=Oe-We;Ce+=1,We+=1;var Ve=Se.position;Ve[0]=Ve[1]=Ve[2]=0;for(var Pe=0;Pe<2;++Pe)for(var de=Pe?Le:1-Le,Me=0;Me<2;++Me)for(var ke=Ce+Pe,He=We+Me,Fe=de*(Me?Ie:1-Ie),qe=0;qe<3;++qe)Ve[qe]+=this._field[qe].get(ke,He)*Fe;for(var $e=this._pickResult.level,Ye=0;Ye<3;++Ye)if($e[Ye]=T.le(this.contourLevels[Ye],Ve[Ye]),$e[Ye]<0)this.contourLevels[Ye].length>0&&($e[Ye]=0);else if($e[Ye]Math.abs(De-Ve[Ye])&&($e[Ye]+=1)}for(Se.index[0]=Le<.5?Ce:Ce+1,Se.index[1]=Ie<.5?We:We+1,Se.uv[0]=Ee/be[0],Se.uv[1]=Oe/be[1],qe=0;qe<3;++qe)Se.dataCoordinate[qe]=this._field[qe].get(Se.index[0],Se.index[1]);return Se},Q.padField=function(me,be){var Se=be.shape.slice(),Ee=me.shape.slice();m.assign(me.lo(1,1).hi(Se[0],Se[1]),be),m.assign(me.lo(1).hi(Se[0],1),be.hi(Se[0],1)),m.assign(me.lo(1,Ee[1]-1).hi(Se[0],1),be.lo(0,Se[1]-1).hi(Se[0],1)),m.assign(me.lo(0,1).hi(1,Se[1]),be.hi(1)),m.assign(me.lo(Ee[0]-1,1).hi(1,Se[1]),be.lo(Se[0]-1)),me.set(0,0,be.get(0,0)),me.set(0,Ee[1]-1,be.get(0,Se[1]-1)),me.set(Ee[0]-1,0,be.get(Se[0]-1,0)),me.set(Ee[0]-1,Ee[1]-1,be.get(Se[0]-1,Se[1]-1))},Q.update=function(me){me=me||{},this.objectOffset=me.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in me&&(this.contourWidth=le(me.contourWidth,Number)),"showContour"in me&&(this.showContour=le(me.showContour,Boolean)),"showSurface"in me&&(this.showSurface=!!me.showSurface),"contourTint"in me&&(this.contourTint=le(me.contourTint,Boolean)),"contourColor"in me&&(this.contourColor=ye(me.contourColor)),"contourProject"in me&&(this.contourProject=le(me.contourProject,function(wn){return le(wn,Boolean)})),"surfaceProject"in me&&(this.surfaceProject=me.surfaceProject),"dynamicColor"in me&&(this.dynamicColor=ye(me.dynamicColor)),"dynamicTint"in me&&(this.dynamicTint=le(me.dynamicTint,Number)),"dynamicWidth"in me&&(this.dynamicWidth=le(me.dynamicWidth,Number)),"opacity"in me&&(this.opacity=me.opacity),"opacityscale"in me&&(this.opacityscale=me.opacityscale),"colorBounds"in me&&(this.colorBounds=me.colorBounds),"vertexColor"in me&&(this.vertexColor=me.vertexColor?1:0),"colormap"in me&&this._colorMap.setPixels(this.genColormap(me.colormap,this.opacityscale));var be=me.field||me.coords&&me.coords[2]||null,Se=!1;if(be||(be=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 me||"coords"in me){var Ee=(be.shape[0]+2)*(be.shape[1]+2);Ee>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(l.nextPow2(Ee))),this._field[2]=k(this._field[2].data,[be.shape[0]+2,be.shape[1]+2]),this.padField(this._field[2],be),this.shape=be.shape.slice();for(var Ce=this.shape,Le=0;Le<2;++Le)this._field[2].size>this._field[Le].data.length&&(h.freeFloat(this._field[Le].data),this._field[Le].data=h.mallocFloat(this._field[2].size)),this._field[Le]=k(this._field[Le].data,[Ce[0]+2,Ce[1]+2]);if(me.coords){var Oe=me.coords;if(!Array.isArray(Oe)||Oe.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Le=0;Le<2;++Le){var We=Oe[Le];for(Me=0;Me<2;++Me)if(We.shape[Me]!==Ce[Me])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Le],We)}}else if(me.ticks){var Ie=me.ticks;if(!Array.isArray(Ie)||Ie.length!==2)throw new Error("gl-surface: invalid ticks");for(Le=0;Le<2;++Le){var Ve=Ie[Le];if((Array.isArray(Ve)||Ve.length)&&(Ve=k(Ve)),Ve.shape[0]!==Ce[Le])throw new Error("gl-surface: invalid tick length");var Pe=k(Ve.data,Ce);Pe.stride[Le]=Ve.stride[0],Pe.stride[1^Le]=0,this.padField(this._field[Le],Pe)}}else{for(Le=0;Le<2;++Le){var de=[0,0];de[Le]=1,this._field[Le]=k(this._field[Le].data,[Ce[0]+2,Ce[1]+2],de,0)}this._field[0].set(0,0,0);for(var Me=0;Me0){for(var Tn=0;Tn<5;++Tn)Ut.pop();ft-=1}continue e}Ut.push(Ft[0],Ft[1],qt[0],qt[1],Ft[2]),ft+=1}}Bt.push(ft)}this._contourOffsets[rt]=Et,this._contourCounts[rt]=Bt}var Fn=h.mallocFloat(Ut.length);for(Le=0;Lej||V[1]<0||V[1]>j)throw new Error("gl-texture2d: Invalid texture size");var $=S(V,B.stride.slice()),ee=0;N==="float32"?ee=I.FLOAT:N==="float64"?(ee=I.FLOAT,$=!1,N="float32"):N==="uint8"?ee=I.UNSIGNED_BYTE:(ee=I.UNSIGNED_BYTE,$=!1,N="uint8");var H,J,Q=0;if(V.length===2)Q=I.LUMINANCE,V=[V[0],V[1],1],B=l(B.data,V,[B.stride[0],B.stride[1],1],B.offset);else{if(V.length!==3)throw new Error("gl-texture2d: Invalid shape for texture");if(V[2]===1)Q=I.ALPHA;else if(V[2]===2)Q=I.LUMINANCE_ALPHA;else if(V[2]===3)Q=I.RGB;else{if(V[2]!==4)throw new Error("gl-texture2d: Invalid shape for pixel coords");Q=I.RGBA}}ee!==I.FLOAT||I.getExtension("OES_texture_float")||(ee=I.UNSIGNED_BYTE,$=!1);var Z=B.size;if($)H=B.offset===0&&B.data.length===Z?B.data:B.data.subarray(B.offset,B.offset+Z);else{var K=[V[2],V[2]*V[0],1];J=s.malloc(Z,N);var ae=l(J,V,K,0);N!=="float32"&&N!=="float64"||ee!==I.UNSIGNED_BYTE?o.assign(ae,B):g(ae,B),H=J.subarray(0,Z)}var se=T(I);return I.texImage2D(I.TEXTURE_2D,0,Q,V[0],V[1],0,Q,ee,H),$||s.free(J),new A(I,se,V[0],V[1],Q,ee)}(M,f)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var c=null,h=null,x=null;function m(M){return typeof HTMLCanvasElement<"u"&&M instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&M instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&M instanceof HTMLVideoElement||typeof ImageData<"u"&&M instanceof ImageData}var g=function(M,f){o.muls(M,f,255)};function k(M,f,E){var I=M.gl,B=I.getParameter(I.MAX_TEXTURE_SIZE);if(f<0||f>B||E<0||E>B)throw new Error("gl-texture2d: Invalid texture size");return M._shape=[f,E],M.bind(),I.texImage2D(I.TEXTURE_2D,0,M.format,f,E,0,M.format,M.type,null),M._mipLevels=[0],M}function A(M,f,E,I,B,N){this.gl=M,this.handle=f,this.format=B,this.type=N,this._shape=[E,I],this._mipLevels=[0],this._magFilter=M.NEAREST,this._minFilter=M.NEAREST,this._wrapS=M.CLAMP_TO_EDGE,this._wrapT=M.CLAMP_TO_EDGE,this._anisoSamples=1;var V=this,j=[this._wrapS,this._wrapT];Object.defineProperties(j,[{get:function(){return V._wrapS},set:function(ee){return V.wrapS=ee}},{get:function(){return V._wrapT},set:function(ee){return V.wrapT=ee}}]),this._wrapVector=j;var $=[this._shape[0],this._shape[1]];Object.defineProperties($,[{get:function(){return V._shape[0]},set:function(ee){return V.width=ee}},{get:function(){return V._shape[1]},set:function(ee){return V.height=ee}}]),this._shapeVector=$}var v=A.prototype;function S(M,f){return M.length===3?f[2]===1&&f[1]===M[0]*M[2]&&f[0]===M[2]:f[0]===1&&f[1]===M[0]}function T(M){var f=M.createTexture();return M.bindTexture(M.TEXTURE_2D,f),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MIN_FILTER,M.NEAREST),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MAG_FILTER,M.NEAREST),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_S,M.CLAMP_TO_EDGE),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_T,M.CLAMP_TO_EDGE),f}function p(M,f,E,I,B){var N=M.getParameter(M.MAX_TEXTURE_SIZE);if(f<0||f>N||E<0||E>N)throw new Error("gl-texture2d: Invalid texture shape");if(B===M.FLOAT&&!M.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var V=T(M);return M.texImage2D(M.TEXTURE_2D,0,I,f,E,0,I,B,null),new A(M,V,f,E,I,B)}Object.defineProperties(v,{minFilter:{get:function(){return this._minFilter},set:function(M){this.bind();var f=this.gl;if(this.type===f.FLOAT&&c.indexOf(M)>=0&&(f.getExtension("OES_texture_float_linear")||(M=f.NEAREST)),h.indexOf(M)<0)throw new Error("gl-texture2d: Unknown filter mode "+M);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,M),this._minFilter=M}},magFilter:{get:function(){return this._magFilter},set:function(M){this.bind();var f=this.gl;if(this.type===f.FLOAT&&c.indexOf(M)>=0&&(f.getExtension("OES_texture_float_linear")||(M=f.NEAREST)),h.indexOf(M)<0)throw new Error("gl-texture2d: Unknown filter mode "+M);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,M),this._magFilter=M}},mipSamples:{get:function(){return this._anisoSamples},set:function(M){var f=this._anisoSamples;if(this._anisoSamples=0|Math.max(M,1),f!==this._anisoSamples){var E=this.gl.getExtension("EXT_texture_filter_anisotropic");E&&this.gl.texParameterf(this.gl.TEXTURE_2D,E.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(M){if(this.bind(),x.indexOf(M)<0)throw new Error("gl-texture2d: Unknown wrap mode "+M);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,M),this._wrapS=M}},wrapT:{get:function(){return this._wrapT},set:function(M){if(this.bind(),x.indexOf(M)<0)throw new Error("gl-texture2d: Unknown wrap mode "+M);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,M),this._wrapT=M}},wrap:{get:function(){return this._wrapVector},set:function(M){if(Array.isArray(M)||(M=[M,M]),M.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var f=0;f<2;++f)if(x.indexOf(M[f])<0)throw new Error("gl-texture2d: Unknown wrap mode "+M);this._wrapS=M[0],this._wrapT=M[1];var E=this.gl;return this.bind(),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,this._wrapS),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,this._wrapT),M}},shape:{get:function(){return this._shapeVector},set:function(M){if(Array.isArray(M)){if(M.length!==2)throw new Error("gl-texture2d: Invalid texture shape")}else M=[0|M,0|M];return k(this,0|M[0],0|M[1]),[0|M[0],0|M[1]]}},width:{get:function(){return this._shape[0]},set:function(M){return k(this,M|=0,this._shape[1]),M}},height:{get:function(){return this._shape[1]},set:function(M){return M|=0,k(this,this._shape[0],M),M}}}),v.bind=function(M){var f=this.gl;return M!==void 0&&f.activeTexture(f.TEXTURE0+(0|M)),f.bindTexture(f.TEXTURE_2D,this.handle),M!==void 0?0|M:f.getParameter(f.ACTIVE_TEXTURE)-f.TEXTURE0},v.dispose=function(){this.gl.deleteTexture(this.handle)},v.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var M=Math.min(this._shape[0],this._shape[1]),f=0;M>0;++f,M>>>=1)this._mipLevels.indexOf(f)<0&&this._mipLevels.push(f)},v.setPixels=function(M,f,E,I){var B=this.gl;this.bind(),Array.isArray(f)?(I=E,E=0|f[1],f=0|f[0]):(f=f||0,E=E||0),I=I||0;var N=m(M)?M:M.raw;if(N)this._mipLevels.indexOf(I)<0?(B.texImage2D(B.TEXTURE_2D,0,this.format,this.format,this.type,N),this._mipLevels.push(I)):B.texSubImage2D(B.TEXTURE_2D,I,f,E,this.format,this.type,N);else{if(!(M.shape&&M.stride&&M.data))throw new Error("gl-texture2d: Unsupported data type");if(M.shape.length<2||f+M.shape[1]>this._shape[1]>>>I||E+M.shape[0]>this._shape[0]>>>I||f<0||E<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");(function(V,j,$,ee,H,J,Q,Z){var K=Z.dtype,ae=Z.shape.slice();if(ae.length<2||ae.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var se=0,he=0,fe=S(ae,Z.stride.slice());if(K==="float32"?se=V.FLOAT:K==="float64"?(se=V.FLOAT,fe=!1,K="float32"):K==="uint8"?se=V.UNSIGNED_BYTE:(se=V.UNSIGNED_BYTE,fe=!1,K="uint8"),ae.length===2)he=V.LUMINANCE,ae=[ae[0],ae[1],1],Z=l(Z.data,ae,[Z.stride[0],Z.stride[1],1],Z.offset);else{if(ae.length!==3)throw new Error("gl-texture2d: Invalid shape for texture");if(ae[2]===1)he=V.ALPHA;else if(ae[2]===2)he=V.LUMINANCE_ALPHA;else if(ae[2]===3)he=V.RGB;else{if(ae[2]!==4)throw new Error("gl-texture2d: Invalid shape for pixel coords");he=V.RGBA}ae[2]}if(he!==V.LUMINANCE&&he!==V.ALPHA||H!==V.LUMINANCE&&H!==V.ALPHA||(he=H),he!==H)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ie=Z.size,oe=Q.indexOf(ee)<0;if(oe&&Q.push(ee),se===J&&fe)Z.offset===0&&Z.data.length===ie?oe?V.texImage2D(V.TEXTURE_2D,ee,H,ae[0],ae[1],0,H,J,Z.data):V.texSubImage2D(V.TEXTURE_2D,ee,j,$,ae[0],ae[1],H,J,Z.data):oe?V.texImage2D(V.TEXTURE_2D,ee,H,ae[0],ae[1],0,H,J,Z.data.subarray(Z.offset,Z.offset+ie)):V.texSubImage2D(V.TEXTURE_2D,ee,j,$,ae[0],ae[1],H,J,Z.data.subarray(Z.offset,Z.offset+ie));else{var le;le=J===V.FLOAT?s.mallocFloat32(ie):s.mallocUint8(ie);var ge=l(le,ae,[ae[2],ae[2]*ae[0],1]);se===V.FLOAT&&J===V.UNSIGNED_BYTE?g(ge,Z):o.assign(ge,Z),oe?V.texImage2D(V.TEXTURE_2D,ee,H,ae[0],ae[1],0,H,J,le.subarray(0,ie)):V.texSubImage2D(V.TEXTURE_2D,ee,j,$,ae[0],ae[1],H,J,le.subarray(0,ie)),J===V.FLOAT?s.freeFloat32(le):s.freeUint8(le)}})(B,f,E,I,this.format,this.type,this._mipLevels,M)}}},1433:function(u){u.exports=function(r,n,l){n?n.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var o=0|r.getParameter(r.MAX_VERTEX_ATTRIBS);if(l){if(l.length>o)throw new Error("gl-vao: Too many vertex attributes");for(var s=0;s1?0:Math.acos(g)};var l=n(2825),o=n(3536),s=n(244)},9226:function(u){u.exports=function(r,n){return r[0]=Math.ceil(n[0]),r[1]=Math.ceil(n[1]),r[2]=Math.ceil(n[2]),r}},3126:function(u){u.exports=function(r){var n=new Float32Array(3);return n[0]=r[0],n[1]=r[1],n[2]=r[2],n}},3990:function(u){u.exports=function(r,n){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r}},1091:function(u){u.exports=function(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[0],x=l[1],m=l[2];return r[0]=s*m-c*x,r[1]=c*h-o*m,r[2]=o*x-s*h,r}},5455:function(u,r,n){u.exports=n(7056)},7056:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2];return Math.sqrt(l*l+o*o+s*s)}},4008:function(u,r,n){u.exports=n(6690)},6690:function(u){u.exports=function(r,n,l){return r[0]=n[0]/l[0],r[1]=n[1]/l[1],r[2]=n[2]/l[2],r}},244:function(u){u.exports=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]}},2613:function(u){u.exports=1e-6},9922:function(u,r,n){u.exports=function(o,s){var c=o[0],h=o[1],x=o[2],m=s[0],g=s[1],k=s[2];return Math.abs(c-m)<=l*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-g)<=l*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(x-k)<=l*Math.max(1,Math.abs(x),Math.abs(k))};var l=n(2613)},9265:function(u){u.exports=function(r,n){return r[0]===n[0]&&r[1]===n[1]&&r[2]===n[2]}},2681:function(u){u.exports=function(r,n){return r[0]=Math.floor(n[0]),r[1]=Math.floor(n[1]),r[2]=Math.floor(n[2]),r}},5137:function(u,r,n){u.exports=function(o,s,c,h,x,m){var g,k;for(s||(s=3),c||(c=0),k=h?Math.min(h*s+c,o.length):o.length,g=c;g0&&(c=1/Math.sqrt(c),r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c),r}},7636:function(u){u.exports=function(r,n){n=n||1;var l=2*Math.random()*Math.PI,o=2*Math.random()-1,s=Math.sqrt(1-o*o)*n;return r[0]=Math.cos(l)*s,r[1]=Math.sin(l)*s,r[2]=o*n,r}},6894:function(u){u.exports=function(r,n,l,o){var s=l[1],c=l[2],h=n[1]-s,x=n[2]-c,m=Math.sin(o),g=Math.cos(o);return r[0]=n[0],r[1]=s+h*g-x*m,r[2]=c+h*m+x*g,r}},109:function(u){u.exports=function(r,n,l,o){var s=l[0],c=l[2],h=n[0]-s,x=n[2]-c,m=Math.sin(o),g=Math.cos(o);return r[0]=s+x*m+h*g,r[1]=n[1],r[2]=c+x*g-h*m,r}},8692:function(u){u.exports=function(r,n,l,o){var s=l[0],c=l[1],h=n[0]-s,x=n[1]-c,m=Math.sin(o),g=Math.cos(o);return r[0]=s+h*g-x*m,r[1]=c+h*m+x*g,r[2]=n[2],r}},2447:function(u){u.exports=function(r,n){return r[0]=Math.round(n[0]),r[1]=Math.round(n[1]),r[2]=Math.round(n[2]),r}},6621:function(u){u.exports=function(r,n,l){return r[0]=n[0]*l,r[1]=n[1]*l,r[2]=n[2]*l,r}},8489:function(u){u.exports=function(r,n,l,o){return r[0]=n[0]+l[0]*o,r[1]=n[1]+l[1]*o,r[2]=n[2]+l[2]*o,r}},1463:function(u){u.exports=function(r,n,l,o){return r[0]=n,r[1]=l,r[2]=o,r}},6141:function(u,r,n){u.exports=n(2953)},5486:function(u,r,n){u.exports=n(3066)},2953:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2];return l*l+o*o+s*s}},3066:function(u){u.exports=function(r){var n=r[0],l=r[1],o=r[2];return n*n+l*l+o*o}},2229:function(u,r,n){u.exports=n(6843)},6843:function(u){u.exports=function(r,n,l){return r[0]=n[0]-l[0],r[1]=n[1]-l[1],r[2]=n[2]-l[2],r}},492:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2];return r[0]=o*l[0]+s*l[3]+c*l[6],r[1]=o*l[1]+s*l[4]+c*l[7],r[2]=o*l[2]+s*l[5]+c*l[8],r}},5673:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[3]*o+l[7]*s+l[11]*c+l[15];return h=h||1,r[0]=(l[0]*o+l[4]*s+l[8]*c+l[12])/h,r[1]=(l[1]*o+l[5]*s+l[9]*c+l[13])/h,r[2]=(l[2]*o+l[6]*s+l[10]*c+l[14])/h,r}},264:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[0],x=l[1],m=l[2],g=l[3],k=g*o+x*c-m*s,A=g*s+m*o-h*c,v=g*c+h*s-x*o,S=-h*o-x*s-m*c;return r[0]=k*g+S*-h+A*-m-v*-x,r[1]=A*g+S*-x+v*-h-k*-m,r[2]=v*g+S*-m+k*-x-A*-h,r}},4361:function(u){u.exports=function(r,n,l){return r[0]=n[0]+l[0],r[1]=n[1]+l[1],r[2]=n[2]+l[2],r[3]=n[3]+l[3],r}},2335:function(u){u.exports=function(r){var n=new Float32Array(4);return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n}},2933:function(u){u.exports=function(r,n){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r}},7536:function(u){u.exports=function(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2],c=n[3]-r[3];return Math.sqrt(l*l+o*o+s*s+c*c)}},1373:function(u){u.exports=function(r,n,l){return r[0]=n[0]/l[0],r[1]=n[1]/l[1],r[2]=n[2]/l[2],r[3]=n[3]/l[3],r}},3750:function(u){u.exports=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]+r[3]*n[3]}},3390:function(u){u.exports=function(r,n,l,o){var s=new Float32Array(4);return s[0]=r,s[1]=n,s[2]=l,s[3]=o,s}},9970:function(u,r,n){u.exports={create:n(7536),clone:n(2335),fromValues:n(3390),copy:n(2933),set:n(4578),add:n(4361),subtract:n(6860),multiply:n(3576),divide:n(1373),min:n(2334),max:n(160),scale:n(9288),scaleAndAdd:n(4844),distance:n(4691),squaredDistance:n(7960),length:n(6808),squaredLength:n(483),negate:n(1498),inverse:n(4494),normalize:n(5177),dot:n(3750),lerp:n(2573),random:n(9131),transformMat4:n(5352),transformQuat:n(4041)}},4494:function(u){u.exports=function(r,n){return r[0]=1/n[0],r[1]=1/n[1],r[2]=1/n[2],r[3]=1/n[3],r}},6808:function(u){u.exports=function(r){var n=r[0],l=r[1],o=r[2],s=r[3];return Math.sqrt(n*n+l*l+o*o+s*s)}},2573:function(u){u.exports=function(r,n,l,o){var s=n[0],c=n[1],h=n[2],x=n[3];return r[0]=s+o*(l[0]-s),r[1]=c+o*(l[1]-c),r[2]=h+o*(l[2]-h),r[3]=x+o*(l[3]-x),r}},160:function(u){u.exports=function(r,n,l){return r[0]=Math.max(n[0],l[0]),r[1]=Math.max(n[1],l[1]),r[2]=Math.max(n[2],l[2]),r[3]=Math.max(n[3],l[3]),r}},2334:function(u){u.exports=function(r,n,l){return r[0]=Math.min(n[0],l[0]),r[1]=Math.min(n[1],l[1]),r[2]=Math.min(n[2],l[2]),r[3]=Math.min(n[3],l[3]),r}},3576:function(u){u.exports=function(r,n,l){return r[0]=n[0]*l[0],r[1]=n[1]*l[1],r[2]=n[2]*l[2],r[3]=n[3]*l[3],r}},1498:function(u){u.exports=function(r,n){return r[0]=-n[0],r[1]=-n[1],r[2]=-n[2],r[3]=-n[3],r}},5177:function(u){u.exports=function(r,n){var l=n[0],o=n[1],s=n[2],c=n[3],h=l*l+o*o+s*s+c*c;return h>0&&(h=1/Math.sqrt(h),r[0]=l*h,r[1]=o*h,r[2]=s*h,r[3]=c*h),r}},9131:function(u,r,n){var l=n(5177),o=n(9288);u.exports=function(s,c){return c=c||1,s[0]=Math.random(),s[1]=Math.random(),s[2]=Math.random(),s[3]=Math.random(),l(s,s),o(s,s,c),s}},9288:function(u){u.exports=function(r,n,l){return r[0]=n[0]*l,r[1]=n[1]*l,r[2]=n[2]*l,r[3]=n[3]*l,r}},4844:function(u){u.exports=function(r,n,l,o){return r[0]=n[0]+l[0]*o,r[1]=n[1]+l[1]*o,r[2]=n[2]+l[2]*o,r[3]=n[3]+l[3]*o,r}},4578:function(u){u.exports=function(r,n,l,o,s){return r[0]=n,r[1]=l,r[2]=o,r[3]=s,r}},7960:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2],c=n[3]-r[3];return l*l+o*o+s*s+c*c}},483:function(u){u.exports=function(r){var n=r[0],l=r[1],o=r[2],s=r[3];return n*n+l*l+o*o+s*s}},6860:function(u){u.exports=function(r,n,l){return r[0]=n[0]-l[0],r[1]=n[1]-l[1],r[2]=n[2]-l[2],r[3]=n[3]-l[3],r}},5352:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=n[3];return r[0]=l[0]*o+l[4]*s+l[8]*c+l[12]*h,r[1]=l[1]*o+l[5]*s+l[9]*c+l[13]*h,r[2]=l[2]*o+l[6]*s+l[10]*c+l[14]*h,r[3]=l[3]*o+l[7]*s+l[11]*c+l[15]*h,r}},4041:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[0],x=l[1],m=l[2],g=l[3],k=g*o+x*c-m*s,A=g*s+m*o-h*c,v=g*c+h*s-x*o,S=-h*o-x*s-m*c;return r[0]=k*g+S*-h+A*-m-v*-x,r[1]=A*g+S*-x+v*-h-k*-m,r[2]=v*g+S*-m+k*-x-A*-h,r[3]=n[3],r}},1848:function(u,r,n){var l=n(4905),o=n(6468);u.exports=function(s){for(var c=Array.isArray(s)?s:l(s),h=0;hWe&&Ve>0){var Pe=(Ie[Ve][0]-We)/(Ie[Ve][0]-Ie[Ve-1][0]);return Ie[Ve][1]*(1-Pe)+Pe*Ie[Ve-1][1]}}return 1}(Le/255,be):Ce[3];return Oe<1&&(Se=!0),[Ce[0],Ce[1],Ce[2],255*Oe]})]);return m.divseq(Ee,255),this.hasAlphaScale=Se,Ee},Q.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},Q.isOpaque=function(){return!this.isTransparent()},Q.pickSlots=1,Q.setPickBase=function(me){this.pickId=me};var Z=[0,0,0],K={showSurface:!1,showContour:!1,projections:[V.slice(),V.slice(),V.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function ae(me,be){var Se,Ee,Ce,Le=be.axes&&be.axes.lastCubeProps.axis||Z,Oe=be.showSurface,We=be.showContour;for(Se=0;Se<3;++Se)for(Oe=Oe||be.surfaceProject[Se],Ee=0;Ee<3;++Ee)We=We||be.contourProject[Se][Ee];for(Se=0;Se<3;++Se){var Ie=K.projections[Se];for(Ee=0;Ee<16;++Ee)Ie[Ee]=0;for(Ee=0;Ee<4;++Ee)Ie[5*Ee]=1;Ie[5*Se]=0,Ie[12+Se]=be.axesBounds[+(Le[Se]>0)][Se],v(Ie,me.model,Ie);var Ve=K.clipBounds[Se];for(Ce=0;Ce<2;++Ce)for(Ee=0;Ee<3;++Ee)Ve[Ce][Ee]=me.clipBounds[Ce][Ee];Ve[0][Se]=-1e8,Ve[1][Se]=1e8}return K.showSurface=Oe,K.showContour=We,K}var se={model:V,view:V,projection:V,inverseModel:V.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},he=V.slice(),fe=[1,0,0,0,1,0,0,0,1];function ie(me,be){me=me||{};var Se=this.gl;Se.disable(Se.CULL_FACE),this._colorMap.bind(0);var Ee=se;Ee.model=me.model||V,Ee.view=me.view||V,Ee.projection=me.projection||V,Ee.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],Ee.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],Ee.objectOffset=this.objectOffset,Ee.contourColor=this.contourColor[0],Ee.inverseModel=S(Ee.inverseModel,Ee.model);for(var Ce=0;Ce<2;++Ce)for(var Le=Ee.clipBounds[Ce],Oe=0;Oe<3;++Oe)Le[Oe]=Math.min(Math.max(this.clipBounds[Ce][Oe],-1e8),1e8);Ee.kambient=this.ambientLight,Ee.kdiffuse=this.diffuseLight,Ee.kspecular=this.specularLight,Ee.roughness=this.roughness,Ee.fresnel=this.fresnel,Ee.opacity=this.opacity,Ee.height=0,Ee.permutation=fe,Ee.vertexColor=this.vertexColor;var We=he;for(v(We,Ee.view,Ee.model),v(We,Ee.projection,We),S(We,We),Ce=0;Ce<3;++Ce)Ee.eyePosition[Ce]=We[12+Ce]/We[15];var Ie=We[15];for(Ce=0;Ce<3;++Ce)Ie+=this.lightPosition[Ce]*We[4*Ce+3];for(Ce=0;Ce<3;++Ce){var Ve=We[12+Ce];for(Oe=0;Oe<3;++Oe)Ve+=We[4*Oe+Ce]*this.lightPosition[Oe];Ee.lightPosition[Ce]=Ve/Ie}var Pe=ae(Ee,this);if(Pe.showSurface){for(this._shader.bind(),this._shader.uniforms=Ee,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(Se.TRIANGLES,this._vertexCount),Ce=0;Ce<3;++Ce)this.surfaceProject[Ce]&&this.vertexCount&&(this._shader.uniforms.model=Pe.projections[Ce],this._shader.uniforms.clipBounds=Pe.clipBounds[Ce],this._vao.draw(Se.TRIANGLES,this._vertexCount));this._vao.unbind()}if(Pe.showContour){var de=this._contourShader;Ee.kambient=1,Ee.kdiffuse=0,Ee.kspecular=0,Ee.opacity=1,de.bind(),de.uniforms=Ee;var Me=this._contourVAO;for(Me.bind(),Ce=0;Ce<3;++Ce)for(de.uniforms.permutation=$[Ce],Se.lineWidth(this.contourWidth[Ce]*this.pixelRatio),Oe=0;Oe>4)/16)/255,Ce=Math.floor(Ee),Le=Ee-Ce,Oe=be[1]*(me.value[1]+(15&me.value[2])/16)/255,We=Math.floor(Oe),Ie=Oe-We;Ce+=1,We+=1;var Ve=Se.position;Ve[0]=Ve[1]=Ve[2]=0;for(var Pe=0;Pe<2;++Pe)for(var de=Pe?Le:1-Le,Me=0;Me<2;++Me)for(var ke=Ce+Pe,He=We+Me,Fe=de*(Me?Ie:1-Ie),qe=0;qe<3;++qe)Ve[qe]+=this._field[qe].get(ke,He)*Fe;for(var $e=this._pickResult.level,Ye=0;Ye<3;++Ye)if($e[Ye]=T.le(this.contourLevels[Ye],Ve[Ye]),$e[Ye]<0)this.contourLevels[Ye].length>0&&($e[Ye]=0);else if($e[Ye]Math.abs(De-Ve[Ye])&&($e[Ye]+=1)}for(Se.index[0]=Le<.5?Ce:Ce+1,Se.index[1]=Ie<.5?We:We+1,Se.uv[0]=Ee/be[0],Se.uv[1]=Oe/be[1],qe=0;qe<3;++qe)Se.dataCoordinate[qe]=this._field[qe].get(Se.index[0],Se.index[1]);return Se},Q.padField=function(me,be){var Se=be.shape.slice(),Ee=me.shape.slice();m.assign(me.lo(1,1).hi(Se[0],Se[1]),be),m.assign(me.lo(1).hi(Se[0],1),be.hi(Se[0],1)),m.assign(me.lo(1,Ee[1]-1).hi(Se[0],1),be.lo(0,Se[1]-1).hi(Se[0],1)),m.assign(me.lo(0,1).hi(1,Se[1]),be.hi(1)),m.assign(me.lo(Ee[0]-1,1).hi(1,Se[1]),be.lo(Se[0]-1)),me.set(0,0,be.get(0,0)),me.set(0,Ee[1]-1,be.get(0,Se[1]-1)),me.set(Ee[0]-1,0,be.get(Se[0]-1,0)),me.set(Ee[0]-1,Ee[1]-1,be.get(Se[0]-1,Se[1]-1))},Q.update=function(me){me=me||{},this.objectOffset=me.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in me&&(this.contourWidth=le(me.contourWidth,Number)),"showContour"in me&&(this.showContour=le(me.showContour,Boolean)),"showSurface"in me&&(this.showSurface=!!me.showSurface),"contourTint"in me&&(this.contourTint=le(me.contourTint,Boolean)),"contourColor"in me&&(this.contourColor=ye(me.contourColor)),"contourProject"in me&&(this.contourProject=le(me.contourProject,function(wn){return le(wn,Boolean)})),"surfaceProject"in me&&(this.surfaceProject=me.surfaceProject),"dynamicColor"in me&&(this.dynamicColor=ye(me.dynamicColor)),"dynamicTint"in me&&(this.dynamicTint=le(me.dynamicTint,Number)),"dynamicWidth"in me&&(this.dynamicWidth=le(me.dynamicWidth,Number)),"opacity"in me&&(this.opacity=me.opacity),"opacityscale"in me&&(this.opacityscale=me.opacityscale),"colorBounds"in me&&(this.colorBounds=me.colorBounds),"vertexColor"in me&&(this.vertexColor=me.vertexColor?1:0),"colormap"in me&&this._colorMap.setPixels(this.genColormap(me.colormap,this.opacityscale));var be=me.field||me.coords&&me.coords[2]||null,Se=!1;if(be||(be=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 me||"coords"in me){var Ee=(be.shape[0]+2)*(be.shape[1]+2);Ee>this._field[2].data.length&&(h.freeFloat(this._field[2].data),this._field[2].data=h.mallocFloat(l.nextPow2(Ee))),this._field[2]=k(this._field[2].data,[be.shape[0]+2,be.shape[1]+2]),this.padField(this._field[2],be),this.shape=be.shape.slice();for(var Ce=this.shape,Le=0;Le<2;++Le)this._field[2].size>this._field[Le].data.length&&(h.freeFloat(this._field[Le].data),this._field[Le].data=h.mallocFloat(this._field[2].size)),this._field[Le]=k(this._field[Le].data,[Ce[0]+2,Ce[1]+2]);if(me.coords){var Oe=me.coords;if(!Array.isArray(Oe)||Oe.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Le=0;Le<2;++Le){var We=Oe[Le];for(Me=0;Me<2;++Me)if(We.shape[Me]!==Ce[Me])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Le],We)}}else if(me.ticks){var Ie=me.ticks;if(!Array.isArray(Ie)||Ie.length!==2)throw new Error("gl-surface: invalid ticks");for(Le=0;Le<2;++Le){var Ve=Ie[Le];if((Array.isArray(Ve)||Ve.length)&&(Ve=k(Ve)),Ve.shape[0]!==Ce[Le])throw new Error("gl-surface: invalid tick length");var Pe=k(Ve.data,Ce);Pe.stride[Le]=Ve.stride[0],Pe.stride[1^Le]=0,this.padField(this._field[Le],Pe)}}else{for(Le=0;Le<2;++Le){var de=[0,0];de[Le]=1,this._field[Le]=k(this._field[Le].data,[Ce[0]+2,Ce[1]+2],de,0)}this._field[0].set(0,0,0);for(var Me=0;Me0){for(var Tn=0;Tn<5;++Tn)jt.pop();pt-=1}continue e}jt.push(Ft[0],Ft[1],qt[0],qt[1],Ft[2]),pt+=1}}Bt.push(pt)}this._contourOffsets[rt]=Et,this._contourCounts[rt]=Bt}var Fn=h.mallocFloat(jt.length);for(Le=0;Lej||V[1]<0||V[1]>j)throw new Error("gl-texture2d: Invalid texture size");var $=S(V,B.stride.slice()),ee=0;N==="float32"?ee=I.FLOAT:N==="float64"?(ee=I.FLOAT,$=!1,N="float32"):N==="uint8"?ee=I.UNSIGNED_BYTE:(ee=I.UNSIGNED_BYTE,$=!1,N="uint8");var H,J,Q=0;if(V.length===2)Q=I.LUMINANCE,V=[V[0],V[1],1],B=l(B.data,V,[B.stride[0],B.stride[1],1],B.offset);else{if(V.length!==3)throw new Error("gl-texture2d: Invalid shape for texture");if(V[2]===1)Q=I.ALPHA;else if(V[2]===2)Q=I.LUMINANCE_ALPHA;else if(V[2]===3)Q=I.RGB;else{if(V[2]!==4)throw new Error("gl-texture2d: Invalid shape for pixel coords");Q=I.RGBA}}ee!==I.FLOAT||I.getExtension("OES_texture_float")||(ee=I.UNSIGNED_BYTE,$=!1);var Z=B.size;if($)H=B.offset===0&&B.data.length===Z?B.data:B.data.subarray(B.offset,B.offset+Z);else{var K=[V[2],V[2]*V[0],1];J=s.malloc(Z,N);var ae=l(J,V,K,0);N!=="float32"&&N!=="float64"||ee!==I.UNSIGNED_BYTE?o.assign(ae,B):g(ae,B),H=J.subarray(0,Z)}var se=T(I);return I.texImage2D(I.TEXTURE_2D,0,Q,V[0],V[1],0,Q,ee,H),$||s.free(J),new A(I,se,V[0],V[1],Q,ee)}(M,f)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var c=null,h=null,x=null;function m(M){return typeof HTMLCanvasElement<"u"&&M instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&M instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&M instanceof HTMLVideoElement||typeof ImageData<"u"&&M instanceof ImageData}var g=function(M,f){o.muls(M,f,255)};function k(M,f,E){var I=M.gl,B=I.getParameter(I.MAX_TEXTURE_SIZE);if(f<0||f>B||E<0||E>B)throw new Error("gl-texture2d: Invalid texture size");return M._shape=[f,E],M.bind(),I.texImage2D(I.TEXTURE_2D,0,M.format,f,E,0,M.format,M.type,null),M._mipLevels=[0],M}function A(M,f,E,I,B,N){this.gl=M,this.handle=f,this.format=B,this.type=N,this._shape=[E,I],this._mipLevels=[0],this._magFilter=M.NEAREST,this._minFilter=M.NEAREST,this._wrapS=M.CLAMP_TO_EDGE,this._wrapT=M.CLAMP_TO_EDGE,this._anisoSamples=1;var V=this,j=[this._wrapS,this._wrapT];Object.defineProperties(j,[{get:function(){return V._wrapS},set:function(ee){return V.wrapS=ee}},{get:function(){return V._wrapT},set:function(ee){return V.wrapT=ee}}]),this._wrapVector=j;var $=[this._shape[0],this._shape[1]];Object.defineProperties($,[{get:function(){return V._shape[0]},set:function(ee){return V.width=ee}},{get:function(){return V._shape[1]},set:function(ee){return V.height=ee}}]),this._shapeVector=$}var v=A.prototype;function S(M,f){return M.length===3?f[2]===1&&f[1]===M[0]*M[2]&&f[0]===M[2]:f[0]===1&&f[1]===M[0]}function T(M){var f=M.createTexture();return M.bindTexture(M.TEXTURE_2D,f),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MIN_FILTER,M.NEAREST),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MAG_FILTER,M.NEAREST),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_S,M.CLAMP_TO_EDGE),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_T,M.CLAMP_TO_EDGE),f}function p(M,f,E,I,B){var N=M.getParameter(M.MAX_TEXTURE_SIZE);if(f<0||f>N||E<0||E>N)throw new Error("gl-texture2d: Invalid texture shape");if(B===M.FLOAT&&!M.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var V=T(M);return M.texImage2D(M.TEXTURE_2D,0,I,f,E,0,I,B,null),new A(M,V,f,E,I,B)}Object.defineProperties(v,{minFilter:{get:function(){return this._minFilter},set:function(M){this.bind();var f=this.gl;if(this.type===f.FLOAT&&c.indexOf(M)>=0&&(f.getExtension("OES_texture_float_linear")||(M=f.NEAREST)),h.indexOf(M)<0)throw new Error("gl-texture2d: Unknown filter mode "+M);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,M),this._minFilter=M}},magFilter:{get:function(){return this._magFilter},set:function(M){this.bind();var f=this.gl;if(this.type===f.FLOAT&&c.indexOf(M)>=0&&(f.getExtension("OES_texture_float_linear")||(M=f.NEAREST)),h.indexOf(M)<0)throw new Error("gl-texture2d: Unknown filter mode "+M);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,M),this._magFilter=M}},mipSamples:{get:function(){return this._anisoSamples},set:function(M){var f=this._anisoSamples;if(this._anisoSamples=0|Math.max(M,1),f!==this._anisoSamples){var E=this.gl.getExtension("EXT_texture_filter_anisotropic");E&&this.gl.texParameterf(this.gl.TEXTURE_2D,E.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(M){if(this.bind(),x.indexOf(M)<0)throw new Error("gl-texture2d: Unknown wrap mode "+M);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,M),this._wrapS=M}},wrapT:{get:function(){return this._wrapT},set:function(M){if(this.bind(),x.indexOf(M)<0)throw new Error("gl-texture2d: Unknown wrap mode "+M);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,M),this._wrapT=M}},wrap:{get:function(){return this._wrapVector},set:function(M){if(Array.isArray(M)||(M=[M,M]),M.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var f=0;f<2;++f)if(x.indexOf(M[f])<0)throw new Error("gl-texture2d: Unknown wrap mode "+M);this._wrapS=M[0],this._wrapT=M[1];var E=this.gl;return this.bind(),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,this._wrapS),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,this._wrapT),M}},shape:{get:function(){return this._shapeVector},set:function(M){if(Array.isArray(M)){if(M.length!==2)throw new Error("gl-texture2d: Invalid texture shape")}else M=[0|M,0|M];return k(this,0|M[0],0|M[1]),[0|M[0],0|M[1]]}},width:{get:function(){return this._shape[0]},set:function(M){return k(this,M|=0,this._shape[1]),M}},height:{get:function(){return this._shape[1]},set:function(M){return M|=0,k(this,this._shape[0],M),M}}}),v.bind=function(M){var f=this.gl;return M!==void 0&&f.activeTexture(f.TEXTURE0+(0|M)),f.bindTexture(f.TEXTURE_2D,this.handle),M!==void 0?0|M:f.getParameter(f.ACTIVE_TEXTURE)-f.TEXTURE0},v.dispose=function(){this.gl.deleteTexture(this.handle)},v.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var M=Math.min(this._shape[0],this._shape[1]),f=0;M>0;++f,M>>>=1)this._mipLevels.indexOf(f)<0&&this._mipLevels.push(f)},v.setPixels=function(M,f,E,I){var B=this.gl;this.bind(),Array.isArray(f)?(I=E,E=0|f[1],f=0|f[0]):(f=f||0,E=E||0),I=I||0;var N=m(M)?M:M.raw;if(N)this._mipLevels.indexOf(I)<0?(B.texImage2D(B.TEXTURE_2D,0,this.format,this.format,this.type,N),this._mipLevels.push(I)):B.texSubImage2D(B.TEXTURE_2D,I,f,E,this.format,this.type,N);else{if(!(M.shape&&M.stride&&M.data))throw new Error("gl-texture2d: Unsupported data type");if(M.shape.length<2||f+M.shape[1]>this._shape[1]>>>I||E+M.shape[0]>this._shape[0]>>>I||f<0||E<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");(function(V,j,$,ee,H,J,Q,Z){var K=Z.dtype,ae=Z.shape.slice();if(ae.length<2||ae.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var se=0,he=0,fe=S(ae,Z.stride.slice());if(K==="float32"?se=V.FLOAT:K==="float64"?(se=V.FLOAT,fe=!1,K="float32"):K==="uint8"?se=V.UNSIGNED_BYTE:(se=V.UNSIGNED_BYTE,fe=!1,K="uint8"),ae.length===2)he=V.LUMINANCE,ae=[ae[0],ae[1],1],Z=l(Z.data,ae,[Z.stride[0],Z.stride[1],1],Z.offset);else{if(ae.length!==3)throw new Error("gl-texture2d: Invalid shape for texture");if(ae[2]===1)he=V.ALPHA;else if(ae[2]===2)he=V.LUMINANCE_ALPHA;else if(ae[2]===3)he=V.RGB;else{if(ae[2]!==4)throw new Error("gl-texture2d: Invalid shape for pixel coords");he=V.RGBA}ae[2]}if(he!==V.LUMINANCE&&he!==V.ALPHA||H!==V.LUMINANCE&&H!==V.ALPHA||(he=H),he!==H)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ie=Z.size,oe=Q.indexOf(ee)<0;if(oe&&Q.push(ee),se===J&&fe)Z.offset===0&&Z.data.length===ie?oe?V.texImage2D(V.TEXTURE_2D,ee,H,ae[0],ae[1],0,H,J,Z.data):V.texSubImage2D(V.TEXTURE_2D,ee,j,$,ae[0],ae[1],H,J,Z.data):oe?V.texImage2D(V.TEXTURE_2D,ee,H,ae[0],ae[1],0,H,J,Z.data.subarray(Z.offset,Z.offset+ie)):V.texSubImage2D(V.TEXTURE_2D,ee,j,$,ae[0],ae[1],H,J,Z.data.subarray(Z.offset,Z.offset+ie));else{var le;le=J===V.FLOAT?s.mallocFloat32(ie):s.mallocUint8(ie);var ge=l(le,ae,[ae[2],ae[2]*ae[0],1]);se===V.FLOAT&&J===V.UNSIGNED_BYTE?g(ge,Z):o.assign(ge,Z),oe?V.texImage2D(V.TEXTURE_2D,ee,H,ae[0],ae[1],0,H,J,le.subarray(0,ie)):V.texSubImage2D(V.TEXTURE_2D,ee,j,$,ae[0],ae[1],H,J,le.subarray(0,ie)),J===V.FLOAT?s.freeFloat32(le):s.freeUint8(le)}})(B,f,E,I,this.format,this.type,this._mipLevels,M)}}},1433:function(u){u.exports=function(r,n,l){n?n.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var o=0|r.getParameter(r.MAX_VERTEX_ATTRIBS);if(l){if(l.length>o)throw new Error("gl-vao: Too many vertex attributes");for(var s=0;s1?0:Math.acos(g)};var l=n(2825),o=n(3536),s=n(244)},9226:function(u){u.exports=function(r,n){return r[0]=Math.ceil(n[0]),r[1]=Math.ceil(n[1]),r[2]=Math.ceil(n[2]),r}},3126:function(u){u.exports=function(r){var n=new Float32Array(3);return n[0]=r[0],n[1]=r[1],n[2]=r[2],n}},3990:function(u){u.exports=function(r,n){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r}},1091:function(u){u.exports=function(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[0],x=l[1],m=l[2];return r[0]=s*m-c*x,r[1]=c*h-o*m,r[2]=o*x-s*h,r}},5455:function(u,r,n){u.exports=n(7056)},7056:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2];return Math.sqrt(l*l+o*o+s*s)}},4008:function(u,r,n){u.exports=n(6690)},6690:function(u){u.exports=function(r,n,l){return r[0]=n[0]/l[0],r[1]=n[1]/l[1],r[2]=n[2]/l[2],r}},244:function(u){u.exports=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]}},2613:function(u){u.exports=1e-6},9922:function(u,r,n){u.exports=function(o,s){var c=o[0],h=o[1],x=o[2],m=s[0],g=s[1],k=s[2];return Math.abs(c-m)<=l*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-g)<=l*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(x-k)<=l*Math.max(1,Math.abs(x),Math.abs(k))};var l=n(2613)},9265:function(u){u.exports=function(r,n){return r[0]===n[0]&&r[1]===n[1]&&r[2]===n[2]}},2681:function(u){u.exports=function(r,n){return r[0]=Math.floor(n[0]),r[1]=Math.floor(n[1]),r[2]=Math.floor(n[2]),r}},5137:function(u,r,n){u.exports=function(o,s,c,h,x,m){var g,k;for(s||(s=3),c||(c=0),k=h?Math.min(h*s+c,o.length):o.length,g=c;g0&&(c=1/Math.sqrt(c),r[0]=n[0]*c,r[1]=n[1]*c,r[2]=n[2]*c),r}},7636:function(u){u.exports=function(r,n){n=n||1;var l=2*Math.random()*Math.PI,o=2*Math.random()-1,s=Math.sqrt(1-o*o)*n;return r[0]=Math.cos(l)*s,r[1]=Math.sin(l)*s,r[2]=o*n,r}},6894:function(u){u.exports=function(r,n,l,o){var s=l[1],c=l[2],h=n[1]-s,x=n[2]-c,m=Math.sin(o),g=Math.cos(o);return r[0]=n[0],r[1]=s+h*g-x*m,r[2]=c+h*m+x*g,r}},109:function(u){u.exports=function(r,n,l,o){var s=l[0],c=l[2],h=n[0]-s,x=n[2]-c,m=Math.sin(o),g=Math.cos(o);return r[0]=s+x*m+h*g,r[1]=n[1],r[2]=c+x*g-h*m,r}},8692:function(u){u.exports=function(r,n,l,o){var s=l[0],c=l[1],h=n[0]-s,x=n[1]-c,m=Math.sin(o),g=Math.cos(o);return r[0]=s+h*g-x*m,r[1]=c+h*m+x*g,r[2]=n[2],r}},2447:function(u){u.exports=function(r,n){return r[0]=Math.round(n[0]),r[1]=Math.round(n[1]),r[2]=Math.round(n[2]),r}},6621:function(u){u.exports=function(r,n,l){return r[0]=n[0]*l,r[1]=n[1]*l,r[2]=n[2]*l,r}},8489:function(u){u.exports=function(r,n,l,o){return r[0]=n[0]+l[0]*o,r[1]=n[1]+l[1]*o,r[2]=n[2]+l[2]*o,r}},1463:function(u){u.exports=function(r,n,l,o){return r[0]=n,r[1]=l,r[2]=o,r}},6141:function(u,r,n){u.exports=n(2953)},5486:function(u,r,n){u.exports=n(3066)},2953:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2];return l*l+o*o+s*s}},3066:function(u){u.exports=function(r){var n=r[0],l=r[1],o=r[2];return n*n+l*l+o*o}},2229:function(u,r,n){u.exports=n(6843)},6843:function(u){u.exports=function(r,n,l){return r[0]=n[0]-l[0],r[1]=n[1]-l[1],r[2]=n[2]-l[2],r}},492:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2];return r[0]=o*l[0]+s*l[3]+c*l[6],r[1]=o*l[1]+s*l[4]+c*l[7],r[2]=o*l[2]+s*l[5]+c*l[8],r}},5673:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[3]*o+l[7]*s+l[11]*c+l[15];return h=h||1,r[0]=(l[0]*o+l[4]*s+l[8]*c+l[12])/h,r[1]=(l[1]*o+l[5]*s+l[9]*c+l[13])/h,r[2]=(l[2]*o+l[6]*s+l[10]*c+l[14])/h,r}},264:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[0],x=l[1],m=l[2],g=l[3],k=g*o+x*c-m*s,A=g*s+m*o-h*c,v=g*c+h*s-x*o,S=-h*o-x*s-m*c;return r[0]=k*g+S*-h+A*-m-v*-x,r[1]=A*g+S*-x+v*-h-k*-m,r[2]=v*g+S*-m+k*-x-A*-h,r}},4361:function(u){u.exports=function(r,n,l){return r[0]=n[0]+l[0],r[1]=n[1]+l[1],r[2]=n[2]+l[2],r[3]=n[3]+l[3],r}},2335:function(u){u.exports=function(r){var n=new Float32Array(4);return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n}},2933:function(u){u.exports=function(r,n){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r}},7536:function(u){u.exports=function(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2],c=n[3]-r[3];return Math.sqrt(l*l+o*o+s*s+c*c)}},1373:function(u){u.exports=function(r,n,l){return r[0]=n[0]/l[0],r[1]=n[1]/l[1],r[2]=n[2]/l[2],r[3]=n[3]/l[3],r}},3750:function(u){u.exports=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]+r[3]*n[3]}},3390:function(u){u.exports=function(r,n,l,o){var s=new Float32Array(4);return s[0]=r,s[1]=n,s[2]=l,s[3]=o,s}},9970:function(u,r,n){u.exports={create:n(7536),clone:n(2335),fromValues:n(3390),copy:n(2933),set:n(4578),add:n(4361),subtract:n(6860),multiply:n(3576),divide:n(1373),min:n(2334),max:n(160),scale:n(9288),scaleAndAdd:n(4844),distance:n(4691),squaredDistance:n(7960),length:n(6808),squaredLength:n(483),negate:n(1498),inverse:n(4494),normalize:n(5177),dot:n(3750),lerp:n(2573),random:n(9131),transformMat4:n(5352),transformQuat:n(4041)}},4494:function(u){u.exports=function(r,n){return r[0]=1/n[0],r[1]=1/n[1],r[2]=1/n[2],r[3]=1/n[3],r}},6808:function(u){u.exports=function(r){var n=r[0],l=r[1],o=r[2],s=r[3];return Math.sqrt(n*n+l*l+o*o+s*s)}},2573:function(u){u.exports=function(r,n,l,o){var s=n[0],c=n[1],h=n[2],x=n[3];return r[0]=s+o*(l[0]-s),r[1]=c+o*(l[1]-c),r[2]=h+o*(l[2]-h),r[3]=x+o*(l[3]-x),r}},160:function(u){u.exports=function(r,n,l){return r[0]=Math.max(n[0],l[0]),r[1]=Math.max(n[1],l[1]),r[2]=Math.max(n[2],l[2]),r[3]=Math.max(n[3],l[3]),r}},2334:function(u){u.exports=function(r,n,l){return r[0]=Math.min(n[0],l[0]),r[1]=Math.min(n[1],l[1]),r[2]=Math.min(n[2],l[2]),r[3]=Math.min(n[3],l[3]),r}},3576:function(u){u.exports=function(r,n,l){return r[0]=n[0]*l[0],r[1]=n[1]*l[1],r[2]=n[2]*l[2],r[3]=n[3]*l[3],r}},1498:function(u){u.exports=function(r,n){return r[0]=-n[0],r[1]=-n[1],r[2]=-n[2],r[3]=-n[3],r}},5177:function(u){u.exports=function(r,n){var l=n[0],o=n[1],s=n[2],c=n[3],h=l*l+o*o+s*s+c*c;return h>0&&(h=1/Math.sqrt(h),r[0]=l*h,r[1]=o*h,r[2]=s*h,r[3]=c*h),r}},9131:function(u,r,n){var l=n(5177),o=n(9288);u.exports=function(s,c){return c=c||1,s[0]=Math.random(),s[1]=Math.random(),s[2]=Math.random(),s[3]=Math.random(),l(s,s),o(s,s,c),s}},9288:function(u){u.exports=function(r,n,l){return r[0]=n[0]*l,r[1]=n[1]*l,r[2]=n[2]*l,r[3]=n[3]*l,r}},4844:function(u){u.exports=function(r,n,l,o){return r[0]=n[0]+l[0]*o,r[1]=n[1]+l[1]*o,r[2]=n[2]+l[2]*o,r[3]=n[3]+l[3]*o,r}},4578:function(u){u.exports=function(r,n,l,o,s){return r[0]=n,r[1]=l,r[2]=o,r[3]=s,r}},7960:function(u){u.exports=function(r,n){var l=n[0]-r[0],o=n[1]-r[1],s=n[2]-r[2],c=n[3]-r[3];return l*l+o*o+s*s+c*c}},483:function(u){u.exports=function(r){var n=r[0],l=r[1],o=r[2],s=r[3];return n*n+l*l+o*o+s*s}},6860:function(u){u.exports=function(r,n,l){return r[0]=n[0]-l[0],r[1]=n[1]-l[1],r[2]=n[2]-l[2],r[3]=n[3]-l[3],r}},5352:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=n[3];return r[0]=l[0]*o+l[4]*s+l[8]*c+l[12]*h,r[1]=l[1]*o+l[5]*s+l[9]*c+l[13]*h,r[2]=l[2]*o+l[6]*s+l[10]*c+l[14]*h,r[3]=l[3]*o+l[7]*s+l[11]*c+l[15]*h,r}},4041:function(u){u.exports=function(r,n,l){var o=n[0],s=n[1],c=n[2],h=l[0],x=l[1],m=l[2],g=l[3],k=g*o+x*c-m*s,A=g*s+m*o-h*c,v=g*c+h*s-x*o,S=-h*o-x*s-m*c;return r[0]=k*g+S*-h+A*-m-v*-x,r[1]=A*g+S*-x+v*-h-k*-m,r[2]=v*g+S*-m+k*-x-A*-h,r[3]=n[3],r}},1848:function(u,r,n){var l=n(4905),o=n(6468);u.exports=function(s){for(var c=Array.isArray(s)?s:l(s),h=0;h0)continue;He=Me.slice(0,1).join("")}return be(He),he+=He.length,(Z=Z.slice(He.length)).length}}function Ie(){return/[^a-fA-F0-9]/.test(j)?(be(Z.join("")),Q=x,H):(Z.push(j),$=j,H+1)}function Ve(){return j==="."||/[eE]/.test(j)?(Z.push(j),Q=T,$=j,H+1):j==="x"&&Z.length===1&&Z[0]==="0"?(Q=B,Z.push(j),$=j,H+1):/[^\d]/.test(j)?(be(Z.join("")),Q=x,H):(Z.push(j),$=j,H+1)}function Pe(){return j==="f"&&(Z.push(j),$=j,H+=1),/[eE]/.test(j)?(Z.push(j),$=j,H+1):(j!=="-"&&j!=="+"||!/[eE]/.test($))&&/[^\d]/.test(j)?(be(Z.join("")),Q=x,H):(Z.push(j),$=j,H+1)}function de(){if(/[^\d\w_]/.test(j)){var Me=Z.join("");return Q=me[Me]?f:ye[Me]?M:p,be(Z.join("")),Q=x,H}return Z.push(j),$=j,H+1}};var l=n(620),o=n(7827),s=n(6852),c=n(7932),h=n(3508),x=999,m=9999,g=0,k=1,A=2,v=3,S=4,T=5,p=6,M=7,f=8,E=9,I=10,B=11,N=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(u,r,n){var l=n(6852);l=l.slice().filter(function(o){return!/^(gl\_|texture)/.test(o)}),u.exports=l.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(u){u.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(u,r,n){var l=n(620);u.exports=l.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(u){u.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(u){u.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(u,r,n){var l=n(5874);u.exports=function(o,s){var c=l(s),h=[];return(h=h.concat(c(o))).concat(c(null))}},3236:function(u){u.exports=function(r){typeof r=="string"&&(r=[r]);for(var n=[].slice.call(arguments,1),l=[],o=0;o>1,A=-7,v=o?c-1:0,S=o?-1:1,T=n[l+v];for(v+=S,h=T&(1<<-A)-1,T>>=-A,A+=m;A>0;h=256*h+n[l+v],v+=S,A-=8);for(x=h&(1<<-A)-1,h>>=-A,A+=s;A>0;x=256*x+n[l+v],v+=S,A-=8);if(h===0)h=1-k;else{if(h===g)return x?NaN:1/0*(T?-1:1);x+=Math.pow(2,s),h-=k}return(T?-1:1)*x*Math.pow(2,h-s)},r.write=function(n,l,o,s,c,h){var x,m,g,k=8*h-c-1,A=(1<>1,S=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=s?0:h-1,p=s?1:-1,M=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(m=isNaN(l)?1:0,x=A):(x=Math.floor(Math.log(l)/Math.LN2),l*(g=Math.pow(2,-x))<1&&(x--,g*=2),(l+=x+v>=1?S/g:S*Math.pow(2,1-v))*g>=2&&(x++,g/=2),x+v>=A?(m=0,x=A):x+v>=1?(m=(l*g-1)*Math.pow(2,c),x+=v):(m=l*Math.pow(2,v-1)*Math.pow(2,c),x=0));c>=8;n[o+T]=255&m,T+=p,m/=256,c-=8);for(x=x<0;n[o+T]=255&x,T+=p,x/=256,k-=8);n[o+T-p]|=128*M}},8954:function(u,r,n){u.exports=function(k,A){var v=k.length;if(v===0)throw new Error("Must have at least d+1 points");var S=k[0].length;if(v<=S)throw new Error("Must input at least d+1 points");var T=k.slice(0,S+1),p=l.apply(void 0,T);if(p===0)throw new Error("Input not in general position");for(var M=new Array(S+1),f=0;f<=S;++f)M[f]=f;p<0&&(M[0]=1,M[1]=0);var E=new s(M,new Array(S+1),!1),I=E.adjacent,B=new Array(S+2);for(f=0;f<=S;++f){for(var N=M.slice(),V=0;V<=S;++V)V===f&&(N[V]=-1);var j=N[0];N[0]=N[1],N[1]=j;var $=new s(N,new Array(S+1),!0);I[f]=$,B[f]=$}for(B[S+1]=E,f=0;f<=S;++f){N=I[f].vertices;var ee=I[f].adjacent;for(V=0;V<=S;++V){var H=N[V];if(H<0)ee[V]=E;else for(var J=0;J<=S;++J)I[J].vertices.indexOf(H)<0&&(ee[V]=I[J])}}var Q=new m(S,T,B),Z=!!A;for(f=S+1;f0;)for(var f=(k=M.pop()).adjacent,E=0;E<=v;++E){var I=f[E];if(I.boundary&&!(I.lastVisited<=-S)){for(var B=I.vertices,N=0;N<=v;++N){var V=B[N];T[N]=V<0?A:p[V]}var j=this.orient();if(j>0)return I;I.lastVisited=-S,j===0&&M.push(I)}}return null},g.walk=function(k,A){var v=this.vertices.length-1,S=this.dimension,T=this.vertices,p=this.tuple,M=A?this.interior.length*Math.random()|0:this.interior.length-1,f=this.interior[M];e:for(;!f.boundary;){for(var E=f.vertices,I=f.adjacent,B=0;B<=S;++B)p[B]=T[E[B]];for(f.lastVisited=v,B=0;B<=S;++B){var N=I[B];if(!(N.lastVisited>=v)){var V=p[B];p[B]=k;var j=this.orient();if(p[B]=V,j<0){f=N;continue e}N.boundary?N.lastVisited=-v:N.lastVisited=v}}return}return f},g.addPeaks=function(k,A){var v=this.vertices.length-1,S=this.dimension,T=this.vertices,p=this.tuple,M=this.interior,f=this.simplices,E=[A];A.lastVisited=v,A.vertices[A.vertices.indexOf(-1)]=v,A.boundary=!1,M.push(A);for(var I=[];E.length>0;){var B=(A=E.pop()).vertices,N=A.adjacent,V=B.indexOf(v);if(!(V<0)){for(var j=0;j<=S;++j)if(j!==V){var $=N[j];if($.boundary&&!($.lastVisited>=v)){var ee=$.vertices;if($.lastVisited!==-v){for(var H=0,J=0;J<=S;++J)ee[J]<0?(H=J,p[J]=k):p[J]=T[ee[J]];if(this.orient()>0){ee[H]=v,$.boundary=!1,M.push($),E.push($),$.lastVisited=v;continue}$.lastVisited=-v}var Q=$.adjacent,Z=B.slice(),K=N.slice(),ae=new s(Z,K,!0);f.push(ae);var se=Q.indexOf(A);if(!(se<0))for(Q[se]=ae,K[V]=$,Z[j]=-1,K[j]=A,N[j]=ae,ae.flip(),J=0;J<=S;++J){var he=Z[J];if(!(he<0||he===v)){for(var fe=new Array(S-1),ie=0,oe=0;oe<=S;++oe){var le=Z[oe];le<0||oe===J||(fe[ie++]=le)}I.push(new c(fe,ae,J))}}}}}}for(I.sort(h),j=0;j+1=0?M[E++]=f[B]:I=1&B;if(I===(1&k)){var N=M[0];M[0]=M[1],M[1]=N}A.push(M)}}return A}},3352:function(u,r,n){var l=n(2478);function o(E,I,B,N,V){this.mid=E,this.left=I,this.right=B,this.leftPoints=N,this.rightPoints=V,this.count=(I?I.count:0)+(B?B.count:0)+N.length}u.exports=function(E){return E&&E.length!==0?new M(p(E)):new M(null)};var s=o.prototype;function c(E,I){E.mid=I.mid,E.left=I.left,E.right=I.right,E.leftPoints=I.leftPoints,E.rightPoints=I.rightPoints,E.count=I.count}function h(E,I){var B=p(I);E.mid=B.mid,E.left=B.left,E.right=B.right,E.leftPoints=B.leftPoints,E.rightPoints=B.rightPoints,E.count=B.count}function x(E,I){var B=E.intervals([]);B.push(I),h(E,B)}function m(E,I){var B=E.intervals([]),N=B.indexOf(I);return N<0?0:(B.splice(N,1),h(E,B),1)}function g(E,I,B){for(var N=0;N=0&&E[N][1]>=I;--N){var V=B(E[N]);if(V)return V}}function A(E,I){for(var B=0;B>1],V=[],j=[],$=[];for(B=0;B3*(I+1)?x(this,E):this.left.insert(E):this.left=p([E]);else if(E[0]>this.mid)this.right?4*(this.right.count+1)>3*(I+1)?x(this,E):this.right.insert(E):this.right=p([E]);else{var B=l.ge(this.leftPoints,E,S),N=l.ge(this.rightPoints,E,T);this.leftPoints.splice(B,0,E),this.rightPoints.splice(N,0,E)}},s.remove=function(E){var I=this.count-this.leftPoints;if(E[1]3*(I-1)?m(this,E):(j=this.left.remove(E))===2?(this.left=null,this.count-=1,1):(j===1&&(this.count-=1),j):0;if(E[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(I-1)?m(this,E):(j=this.right.remove(E))===2?(this.right=null,this.count-=1,1):(j===1&&(this.count-=1),j):0;if(this.count===1)return this.leftPoints[0]===E?2:0;if(this.leftPoints.length===1&&this.leftPoints[0]===E){if(this.left&&this.right){for(var B=this,N=this.left;N.right;)B=N,N=N.right;if(B===this)N.right=this.right;else{var V=this.left,j=this.right;B.count-=N.count,B.right=N.left,N.left=V,N.right=j}c(this,N),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return 1}for(V=l.ge(this.leftPoints,E,S);Vthis.mid?this.right&&(B=this.right.queryPoint(E,I))?B:k(this.rightPoints,E,I):A(this.leftPoints,I);var B},s.queryInterval=function(E,I,B){var N;return Ethis.mid&&this.right&&(N=this.right.queryInterval(E,I,B))?N:Ithis.mid?k(this.rightPoints,E,B):A(this.leftPoints,B)};var f=M.prototype;f.insert=function(E){this.root?this.root.insert(E):this.root=new o(E[0],null,null,[E],[E])},f.remove=function(E){if(this.root){var I=this.root.remove(E);return I===2&&(this.root=null),I!==0}return!1},f.queryPoint=function(E,I){if(this.root)return this.root.queryPoint(E,I)},f.queryInterval=function(E,I,B){if(E<=I&&this.root)return this.root.queryInterval(E,I,B)},Object.defineProperty(f,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(f,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},7762:function(u){u.exports=function(r){for(var n=new Array(r),l=0;l13)&&n!==32&&n!==133&&n!==160&&n!==5760&&n!==6158&&(n<8192||n>8205)&&n!==8232&&n!==8233&&n!==8239&&n!==8287&&n!==8288&&n!==12288&&n!==65279)return!1;return!0}},395:function(u){u.exports=function(r,n,l){return r*(1-l)+n*l}},2652:function(u,r,n){var l=n(4335),o=n(6864),s=n(1903),c=n(9921),h=n(7608),x=n(5665),m={length:n(1387),normalize:n(3536),dot:n(244),cross:n(5911)},g=o(),k=o(),A=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],S=[0,0,0];function T(p,M,f,E,I){p[0]=M[0]*E+f[0]*I,p[1]=M[1]*E+f[1]*I,p[2]=M[2]*E+f[2]*I}u.exports=function(p,M,f,E,I,B){if(M||(M=[0,0,0]),f||(f=[0,0,0]),E||(E=[0,0,0]),I||(I=[0,0,0,1]),B||(B=[0,0,0,1]),!l(g,p)||(s(k,g),k[3]=0,k[7]=0,k[11]=0,k[15]=1,Math.abs(c(k)<1e-8)))return!1;var N,V,j,$,ee,H,J,Q=g[3],Z=g[7],K=g[11],ae=g[12],se=g[13],he=g[14],fe=g[15];if(Q!==0||Z!==0||K!==0){if(A[0]=Q,A[1]=Z,A[2]=K,A[3]=fe,!h(k,k))return!1;x(k,k),N=I,j=k,$=(V=A)[0],ee=V[1],H=V[2],J=V[3],N[0]=j[0]*$+j[4]*ee+j[8]*H+j[12]*J,N[1]=j[1]*$+j[5]*ee+j[9]*H+j[13]*J,N[2]=j[2]*$+j[6]*ee+j[10]*H+j[14]*J,N[3]=j[3]*$+j[7]*ee+j[11]*H+j[15]*J}else I[0]=I[1]=I[2]=0,I[3]=1;if(M[0]=ae,M[1]=se,M[2]=he,function(oe,le){oe[0][0]=le[0],oe[0][1]=le[1],oe[0][2]=le[2],oe[1][0]=le[4],oe[1][1]=le[5],oe[1][2]=le[6],oe[2][0]=le[8],oe[2][1]=le[9],oe[2][2]=le[10]}(v,g),f[0]=m.length(v[0]),m.normalize(v[0],v[0]),E[0]=m.dot(v[0],v[1]),T(v[1],v[1],v[0],1,-E[0]),f[1]=m.length(v[1]),m.normalize(v[1],v[1]),E[0]/=f[1],E[1]=m.dot(v[0],v[2]),T(v[2],v[2],v[0],1,-E[1]),E[2]=m.dot(v[1],v[2]),T(v[2],v[2],v[1],1,-E[2]),f[2]=m.length(v[2]),m.normalize(v[2],v[2]),E[1]/=f[2],E[2]/=f[2],m.cross(S,v[1],v[2]),m.dot(v[0],S)<0)for(var ie=0;ie<3;ie++)f[ie]*=-1,v[ie][0]*=-1,v[ie][1]*=-1,v[ie][2]*=-1;return B[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),B[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),B[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),B[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(B[0]=-B[0]),v[0][2]>v[2][0]&&(B[1]=-B[1]),v[1][0]>v[0][1]&&(B[2]=-B[2]),!0}},4335:function(u){u.exports=function(r,n){var l=n[15];if(l===0)return!1;for(var o=1/l,s=0;s<16;s++)r[s]=n[s]*o;return!0}},7442:function(u,r,n){var l=n(6658),o=n(7182),s=n(2652),c=n(9921),h=n(8648),x=k(),m=k(),g=k();function k(){return{translate:A(),scale:A(1),skew:A(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function A(v){return[v||0,v||0,v||0]}u.exports=function(v,S,T,p){if(c(S)===0||c(T)===0)return!1;var M=s(S,x.translate,x.scale,x.skew,x.perspective,x.quaternion),f=s(T,m.translate,m.scale,m.skew,m.perspective,m.quaternion);return!(!M||!f||(l(g.translate,x.translate,m.translate,p),l(g.skew,x.skew,m.skew,p),l(g.scale,x.scale,m.scale,p),l(g.perspective,x.perspective,m.perspective,p),h(g.quaternion,x.quaternion,m.quaternion,p),o(v,g.translate,g.scale,g.skew,g.perspective,g.quaternion),0))}},7182:function(u,r,n){var l={identity:n(7894),translate:n(7656),multiply:n(6760),create:n(6864),scale:n(2504),fromRotationTranslation:n(6743)},o=(l.create(),l.create());u.exports=function(s,c,h,x,m,g){return l.identity(s),l.fromRotationTranslation(s,g,c),s[3]=m[0],s[7]=m[1],s[11]=m[2],s[15]=m[3],l.identity(o),x[2]!==0&&(o[9]=x[2],l.multiply(s,s,o)),x[1]!==0&&(o[9]=0,o[8]=x[1],l.multiply(s,s,o)),x[0]!==0&&(o[8]=0,o[4]=x[0],l.multiply(s,s,o)),l.scale(s,s,h),s}},4192:function(u,r,n){var l=n(2478),o=n(7442),s=n(7608),c=n(5567),h=n(2408),x=n(7089),m=n(6582),g=n(7656),k=(n(2504),n(3536)),A=[0,0,0];function v(p){this._components=p.slice(),this._time=[0],this.prevMatrix=p.slice(),this.nextMatrix=p.slice(),this.computedMatrix=p.slice(),this.computedInverse=p.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]}u.exports=function(p){return new v((p=p||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var S=v.prototype;S.recalcMatrix=function(p){var M=this._time,f=l.le(M,p),E=this.computedMatrix;if(!(f<0)){var I=this._components;if(f===M.length-1)for(var B=16*f,N=0;N<16;++N)E[N]=I[B++];else{var V=M[f+1]-M[f],j=(B=16*f,this.prevMatrix),$=!0;for(N=0;N<16;++N)j[N]=I[B++];var ee=this.nextMatrix;for(N=0;N<16;++N)ee[N]=I[B++],$=$&&j[N]===ee[N];if(V<1e-6||$)for(N=0;N<16;++N)E[N]=j[N];else o(E,j,ee,(p-M[f])/V)}var H=this.computedUp;H[0]=E[1],H[1]=E[5],H[2]=E[9],k(H,H);var J=this.computedInverse;s(J,E);var Q=this.computedEye,Z=J[15];Q[0]=J[12]/Z,Q[1]=J[13]/Z,Q[2]=J[14]/Z;var K=this.computedCenter,ae=Math.exp(this.computedRadius[0]);for(N=0;N<3;++N)K[N]=Q[N]-E[2+4*N]*ae}},S.idle=function(p){if(!(p1&&l(o[m[v-2]],o[m[v-1]],A)<=0;)v-=1,m.pop();for(m.push(k),v=g.length;v>1&&l(o[g[v-2]],o[g[v-1]],A)>=0;)v-=1,g.pop();g.push(k)}c=new Array(g.length+m.length-2);for(var S=0,T=(h=0,m.length);h0;--p)c[S++]=g[p];return c};var l=n(3250)[3]},351:function(u,r,n){u.exports=function(o,s){s||(s=o,o=window);var c=0,h=0,x=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;function k(B){var N=!1;return"altKey"in B&&(N=N||B.altKey!==m.alt,m.alt=!!B.altKey),"shiftKey"in B&&(N=N||B.shiftKey!==m.shift,m.shift=!!B.shiftKey),"ctrlKey"in B&&(N=N||B.ctrlKey!==m.control,m.control=!!B.ctrlKey),"metaKey"in B&&(N=N||B.metaKey!==m.meta,m.meta=!!B.metaKey),N}function A(B,N){var V=l.x(N),j=l.y(N);"buttons"in N&&(B=0|N.buttons),(B!==c||V!==h||j!==x||k(N))&&(c=0|B,h=V||0,x=j||0,s&&s(c,h,x,m))}function v(B){A(0,B)}function S(){(c||h||x||m.shift||m.alt||m.meta||m.control)&&(h=x=0,c=0,m.shift=m.alt=m.control=m.meta=!1,s&&s(0,0,0,m))}function T(B){k(B)&&s&&s(c,h,x,m)}function p(B){l.buttons(B)===0?A(0,B):A(c,B)}function M(B){A(c|l.buttons(B),B)}function f(B){A(c&~l.buttons(B),B)}function E(){g||(g=!0,o.addEventListener("mousemove",p),o.addEventListener("mousedown",M),o.addEventListener("mouseup",f),o.addEventListener("mouseleave",v),o.addEventListener("mouseenter",v),o.addEventListener("mouseout",v),o.addEventListener("mouseover",v),o.addEventListener("blur",S),o.addEventListener("keyup",T),o.addEventListener("keydown",T),o.addEventListener("keypress",T),o!==window&&(window.addEventListener("blur",S),window.addEventListener("keyup",T),window.addEventListener("keydown",T),window.addEventListener("keypress",T)))}E();var I={element:o};return Object.defineProperties(I,{enabled:{get:function(){return g},set:function(B){B?E():g&&(g=!1,o.removeEventListener("mousemove",p),o.removeEventListener("mousedown",M),o.removeEventListener("mouseup",f),o.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",v),o.removeEventListener("mouseout",v),o.removeEventListener("mouseover",v),o.removeEventListener("blur",S),o.removeEventListener("keyup",T),o.removeEventListener("keydown",T),o.removeEventListener("keypress",T),o!==window&&(window.removeEventListener("blur",S),window.removeEventListener("keyup",T),window.removeEventListener("keydown",T),window.removeEventListener("keypress",T)))},enumerable:!0},buttons:{get:function(){return c},enumerable:!0},x:{get:function(){return h},enumerable:!0},y:{get:function(){return x},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),I};var l=n(4687)},24:function(u){var r={left:0,top:0};u.exports=function(n,l,o){l=l||n.currentTarget||n.srcElement,Array.isArray(o)||(o=[0,0]);var s,c=n.clientX||0,h=n.clientY||0,x=(s=l)===window||s===document||s===document.body?r:s.getBoundingClientRect();return o[0]=c-x.left,o[1]=h-x.top,o}},4687:function(u,r){function n(l){return l.target||l.srcElement||window}r.buttons=function(l){if(typeof l=="object"){if("buttons"in l)return l.buttons;if("which"in l){if((o=l.which)===2)return 4;if(o===3)return 2;if(o>0)return 1<=0)return 1< 0"),typeof s.vertex!="function"&&c("Must specify vertex creation function"),typeof s.cell!="function"&&c("Must specify cell creation function"),typeof s.phase!="function"&&c("Must specify phase function");for(var m=s.getters||[],g=new Array(x),k=0;k=0?g[k]=!0:g[k]=!1;return function(A,v,S,T,p,M){var f=[M,p].join(",");return(0,o[f])(A,v,S,l.mallocUint32,l.freeUint32)}(s.vertex,s.cell,s.phase,0,h,g)};var o={"false,0,1":function(s,c,h,x,m){return function(g,k,A,v){var S,T=0|g.shape[0],p=0|g.shape[1],M=g.data,f=0|g.offset,E=0|g.stride[0],I=0|g.stride[1],B=f,N=0|-E,V=0,j=0|-I,$=0,ee=-E-I|0,H=0,J=0|E,Q=I-E*T|0,Z=0,K=0,ae=0,se=2*T|0,he=x(se),fe=x(se),ie=0,oe=0,le=-1,ge=-1,ye=0,me=0|-T,be=0|T,Se=0,Ee=-T-1|0,Ce=T-1|0,Le=0,Oe=0,We=0;for(Z=0;Z0){if(K=1,he[ie++]=h(M[B],k,A,v),B+=J,T>0)for(Z=1,S=M[B],oe=he[ie]=h(S,k,A,v),ye=he[ie+le],Se=he[ie+me],Le=he[ie+Ee],oe===ye&&oe===Se&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,ye,Se,Le,k,A,v),Oe=fe[ie]=ae++),ie+=1,B+=J,Z=2;Z0)for(Z=1,S=M[B],oe=he[ie]=h(S,k,A,v),ye=he[ie+le],Se=he[ie+me],Le=he[ie+Ee],oe===ye&&oe===Se&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,ye,Se,Le,k,A,v),Oe=fe[ie]=ae++,Le!==Se&&c(fe[ie+me],Oe,$,H,Se,Le,k,A,v)),ie+=1,B+=J,Z=2;Z0){if(Z=1,he[ie++]=h(M[B],k,A,v),B+=J,p>0)for(K=1,S=M[B],oe=he[ie]=h(S,k,A,v),Se=he[ie+me],ye=he[ie+le],Le=he[ie+Ee],oe===Se&&oe===ye&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,Se,ye,Le,k,A,v),Oe=fe[ie]=ae++),ie+=1,B+=J,K=2;K0)for(K=1,S=M[B],oe=he[ie]=h(S,k,A,v),Se=he[ie+me],ye=he[ie+le],Le=he[ie+Ee],oe===Se&&oe===ye&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,Se,ye,Le,k,A,v),Oe=fe[ie]=ae++,Le!==Se&&c(fe[ie+me],Oe,H,V,Le,Se,k,A,v)),ie+=1,B+=J,K=2;K2&&B[1]>2&&f(I.pick(-1,-1).lo(1,1).hi(B[0]-2,B[1]-2),E.pick(-1,-1,0).lo(1,1).hi(B[0]-2,B[1]-2),E.pick(-1,-1,1).lo(1,1).hi(B[0]-2,B[1]-2)),B[1]>2&&(M(I.pick(0,-1).lo(1).hi(B[1]-2),E.pick(0,-1,1).lo(1).hi(B[1]-2)),p(E.pick(0,-1,0).lo(1).hi(B[1]-2))),B[1]>2&&(M(I.pick(B[0]-1,-1).lo(1).hi(B[1]-2),E.pick(B[0]-1,-1,1).lo(1).hi(B[1]-2)),p(E.pick(B[0]-1,-1,0).lo(1).hi(B[1]-2))),B[0]>2&&(M(I.pick(-1,0).lo(1).hi(B[0]-2),E.pick(-1,0,0).lo(1).hi(B[0]-2)),p(E.pick(-1,0,1).lo(1).hi(B[0]-2))),B[0]>2&&(M(I.pick(-1,B[1]-1).lo(1).hi(B[0]-2),E.pick(-1,B[1]-1,0).lo(1).hi(B[0]-2)),p(E.pick(-1,B[1]-1,1).lo(1).hi(B[0]-2))),E.set(0,0,0,0),E.set(0,0,1,0),E.set(B[0]-1,0,0,0),E.set(B[0]-1,0,1,0),E.set(0,B[1]-1,0,0),E.set(0,B[1]-1,1,0),E.set(B[0]-1,B[1]-1,0,0),E.set(B[0]-1,B[1]-1,1,0),E}}u.exports=function(T,p,M){return Array.isArray(M)||(M=l(p.dimension,typeof M=="string"?M:"clamp")),p.size===0?T:p.dimension===0?(T.set(0),T):function(f){var E=f.join();if(V=g[E])return V;for(var I=f.length,B=[k,A],N=1;N<=I;++N)B.push(v(N));var V=S.apply(void 0,B);return g[E]=V,V}(M)(T,p)}},4317:function(u){function r(s,c){var h=Math.floor(c),x=c-h,m=0<=h&&h0;){ee<64?(T=ee,ee=0):(T=64,ee-=64);for(var H=0|h[1];H>0;){H<64?(p=H,H=0):(p=64,H-=64),g=j+ee*f+H*E,v=$+ee*B+H*N;var J=0,Q=0,Z=0,K=I,ae=f-M*I,se=E-T*f,he=V,fe=B-M*V,ie=N-T*B;for(Z=0;Z0;){N<64?(T=N,N=0):(T=64,N-=64);for(var V=0|h[0];V>0;){V<64?(S=V,V=0):(S=64,V-=64),g=I+N*M+V*p,v=B+N*E+V*f;var j=0,$=0,ee=M,H=p-T*M,J=E,Q=f-T*E;for($=0;$0;){$<64?(p=$,$=0):(p=64,$-=64);for(var ee=0|h[0];ee>0;){ee<64?(S=ee,ee=0):(S=64,ee-=64);for(var H=0|h[1];H>0;){H<64?(T=H,H=0):(T=64,H-=64),g=V+$*E+ee*M+H*f,v=j+$*N+ee*I+H*B;var J=0,Q=0,Z=0,K=E,ae=M-p*E,se=f-S*M,he=N,fe=I-p*N,ie=B-S*I;for(Z=0;Zg;){$=0,ee=V-S;t:for(j=0;jJ)break t;ee+=E,$+=I}for($=V,ee=V-S,j=0;j>1,de=Pe-We,Me=Pe+We,ke=Ie,He=de,Fe=Pe,qe=Me,$e=Ve,Ye=A+1,_e=v-1,De=!0,Be=0,Ge=0,tt=0,nt=E,pt=m(nt),At=m(nt);se=p*ke,he=p*He,Oe=T;e:for(ae=0;ae0){j=ke,ke=He,He=j;break e}if(tt<0)break e;Oe+=B}se=p*qe,he=p*$e,Oe=T;e:for(ae=0;ae0){j=qe,qe=$e,$e=j;break e}if(tt<0)break e;Oe+=B}se=p*ke,he=p*Fe,Oe=T;e:for(ae=0;ae0){j=ke,ke=Fe,Fe=j;break e}if(tt<0)break e;Oe+=B}se=p*He,he=p*Fe,Oe=T;e:for(ae=0;ae0){j=He,He=Fe,Fe=j;break e}if(tt<0)break e;Oe+=B}se=p*ke,he=p*qe,Oe=T;e:for(ae=0;ae0){j=ke,ke=qe,qe=j;break e}if(tt<0)break e;Oe+=B}se=p*Fe,he=p*qe,Oe=T;e:for(ae=0;ae0){j=Fe,Fe=qe,qe=j;break e}if(tt<0)break e;Oe+=B}se=p*He,he=p*$e,Oe=T;e:for(ae=0;ae0){j=He,He=$e,$e=j;break e}if(tt<0)break e;Oe+=B}se=p*He,he=p*Fe,Oe=T;e:for(ae=0;ae0){j=He,He=Fe,Fe=j;break e}if(tt<0)break e;Oe+=B}se=p*qe,he=p*$e,Oe=T;e:for(ae=0;ae0){j=qe,qe=$e,$e=j;break e}if(tt<0)break e;Oe+=B}for(se=p*ke,he=p*He,fe=p*Fe,ie=p*qe,oe=p*$e,le=p*Ie,ge=p*Pe,ye=p*Ve,Le=0,Oe=T,ae=0;ae0)){if(tt<0){for(se=p*J,he=p*Ye,fe=p*_e,Oe=T,ae=0;ae0)for(;;){for(Q=T+_e*p,Le=0,ae=0;ae0)){for(Q=T+_e*p,Le=0,ae=0;aeVe){e:for(;;){for(Q=T+Ye*p,Le=0,Oe=T,ae=0;ae1&&M?E(p,M[0],M[1]):E(p)}(x,m,A);return k(A,v)}},446:function(u,r,n){var l=n(7640),o={};u.exports=function(s){var c=s.order,h=s.dtype,x=[c,h].join(":"),m=o[x];return m||(o[x]=m=l(c,h)),m(s),s}},9618:function(u,r,n){var l=n(7163),o=typeof Float64Array<"u";function s(g,k){return g[0]-k[0]}function c(){var g,k=this.stride,A=new Array(k.length);for(g=0;g=0&&(p+=E*(M=0|T),f-=M),new v(this.data,f,E,p)},S.step=function(T){var p=this.shape[0],M=this.stride[0],f=this.offset,E=0,I=Math.ceil;return typeof T=="number"&&((E=0|T)<0?(f+=M*(p-1),p=I(-p/E)):p=I(p/E),M*=E),new v(this.data,p,M,f)},S.transpose=function(T){T=T===void 0?0:0|T;var p=this.shape,M=this.stride;return new v(this.data,p[T],M[T],this.offset)},S.pick=function(T){var p=[],M=[],f=this.offset;return typeof T=="number"&&T>=0?f=f+this.stride[0]*T|0:(p.push(this.shape[0]),M.push(this.stride[0])),(0,k[p.length+1])(this.data,p,M,f)},function(T,p,M,f){return new v(T,p[0],M[0],f)}},2:function(g,k,A){function v(T,p,M,f,E,I){this.data=T,this.shape=[p,M],this.stride=[f,E],this.offset=0|I}var S=v.prototype;return S.dtype=g,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(T,p,M){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p,M):this.data[this.offset+this.stride[0]*T+this.stride[1]*p]=M},S.get=function(T,p){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p):this.data[this.offset+this.stride[0]*T+this.stride[1]*p]},S.index=function(T,p){return this.offset+this.stride[0]*T+this.stride[1]*p},S.hi=function(T,p){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,this.stride[0],this.stride[1],this.offset)},S.lo=function(T,p){var M=this.offset,f=0,E=this.shape[0],I=this.shape[1],B=this.stride[0],N=this.stride[1];return typeof T=="number"&&T>=0&&(M+=B*(f=0|T),E-=f),typeof p=="number"&&p>=0&&(M+=N*(f=0|p),I-=f),new v(this.data,E,I,B,N,M)},S.step=function(T,p){var M=this.shape[0],f=this.shape[1],E=this.stride[0],I=this.stride[1],B=this.offset,N=0,V=Math.ceil;return typeof T=="number"&&((N=0|T)<0?(B+=E*(M-1),M=V(-M/N)):M=V(M/N),E*=N),typeof p=="number"&&((N=0|p)<0?(B+=I*(f-1),f=V(-f/N)):f=V(f/N),I*=N),new v(this.data,M,f,E,I,B)},S.transpose=function(T,p){T=T===void 0?0:0|T,p=p===void 0?1:0|p;var M=this.shape,f=this.stride;return new v(this.data,M[T],M[p],f[T],f[p],this.offset)},S.pick=function(T,p){var M=[],f=[],E=this.offset;return typeof T=="number"&&T>=0?E=E+this.stride[0]*T|0:(M.push(this.shape[0]),f.push(this.stride[0])),typeof p=="number"&&p>=0?E=E+this.stride[1]*p|0:(M.push(this.shape[1]),f.push(this.stride[1])),(0,k[M.length+1])(this.data,M,f,E)},function(T,p,M,f){return new v(T,p[0],p[1],M[0],M[1],f)}},3:function(g,k,A){function v(T,p,M,f,E,I,B,N){this.data=T,this.shape=[p,M,f],this.stride=[E,I,B],this.offset=0|N}var S=v.prototype;return S.dtype=g,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var T=Math.abs(this.stride[0]),p=Math.abs(this.stride[1]),M=Math.abs(this.stride[2]);return T>p?p>M?[2,1,0]:T>M?[1,2,0]:[1,0,2]:T>M?[2,0,1]:M>p?[0,1,2]:[0,2,1]}}),S.set=function(T,p,M,f){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M,f):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M]=f},S.get=function(T,p,M){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M]},S.index=function(T,p,M){return this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M},S.hi=function(T,p,M){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,typeof M!="number"||M<0?this.shape[2]:0|M,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(T,p,M){var f=this.offset,E=0,I=this.shape[0],B=this.shape[1],N=this.shape[2],V=this.stride[0],j=this.stride[1],$=this.stride[2];return typeof T=="number"&&T>=0&&(f+=V*(E=0|T),I-=E),typeof p=="number"&&p>=0&&(f+=j*(E=0|p),B-=E),typeof M=="number"&&M>=0&&(f+=$*(E=0|M),N-=E),new v(this.data,I,B,N,V,j,$,f)},S.step=function(T,p,M){var f=this.shape[0],E=this.shape[1],I=this.shape[2],B=this.stride[0],N=this.stride[1],V=this.stride[2],j=this.offset,$=0,ee=Math.ceil;return typeof T=="number"&&(($=0|T)<0?(j+=B*(f-1),f=ee(-f/$)):f=ee(f/$),B*=$),typeof p=="number"&&(($=0|p)<0?(j+=N*(E-1),E=ee(-E/$)):E=ee(E/$),N*=$),typeof M=="number"&&(($=0|M)<0?(j+=V*(I-1),I=ee(-I/$)):I=ee(I/$),V*=$),new v(this.data,f,E,I,B,N,V,j)},S.transpose=function(T,p,M){T=T===void 0?0:0|T,p=p===void 0?1:0|p,M=M===void 0?2:0|M;var f=this.shape,E=this.stride;return new v(this.data,f[T],f[p],f[M],E[T],E[p],E[M],this.offset)},S.pick=function(T,p,M){var f=[],E=[],I=this.offset;return typeof T=="number"&&T>=0?I=I+this.stride[0]*T|0:(f.push(this.shape[0]),E.push(this.stride[0])),typeof p=="number"&&p>=0?I=I+this.stride[1]*p|0:(f.push(this.shape[1]),E.push(this.stride[1])),typeof M=="number"&&M>=0?I=I+this.stride[2]*M|0:(f.push(this.shape[2]),E.push(this.stride[2])),(0,k[f.length+1])(this.data,f,E,I)},function(T,p,M,f){return new v(T,p[0],p[1],p[2],M[0],M[1],M[2],f)}},4:function(g,k,A){function v(T,p,M,f,E,I,B,N,V,j){this.data=T,this.shape=[p,M,f,E],this.stride=[I,B,N,V],this.offset=0|j}var S=v.prototype;return S.dtype=g,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:A}),S.set=function(T,p,M,f,E){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f,E):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f]=E},S.get=function(T,p,M,f){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f]},S.index=function(T,p,M,f){return this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f},S.hi=function(T,p,M,f){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,typeof M!="number"||M<0?this.shape[2]:0|M,typeof f!="number"||f<0?this.shape[3]:0|f,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(T,p,M,f){var E=this.offset,I=0,B=this.shape[0],N=this.shape[1],V=this.shape[2],j=this.shape[3],$=this.stride[0],ee=this.stride[1],H=this.stride[2],J=this.stride[3];return typeof T=="number"&&T>=0&&(E+=$*(I=0|T),B-=I),typeof p=="number"&&p>=0&&(E+=ee*(I=0|p),N-=I),typeof M=="number"&&M>=0&&(E+=H*(I=0|M),V-=I),typeof f=="number"&&f>=0&&(E+=J*(I=0|f),j-=I),new v(this.data,B,N,V,j,$,ee,H,J,E)},S.step=function(T,p,M,f){var E=this.shape[0],I=this.shape[1],B=this.shape[2],N=this.shape[3],V=this.stride[0],j=this.stride[1],$=this.stride[2],ee=this.stride[3],H=this.offset,J=0,Q=Math.ceil;return typeof T=="number"&&((J=0|T)<0?(H+=V*(E-1),E=Q(-E/J)):E=Q(E/J),V*=J),typeof p=="number"&&((J=0|p)<0?(H+=j*(I-1),I=Q(-I/J)):I=Q(I/J),j*=J),typeof M=="number"&&((J=0|M)<0?(H+=$*(B-1),B=Q(-B/J)):B=Q(B/J),$*=J),typeof f=="number"&&((J=0|f)<0?(H+=ee*(N-1),N=Q(-N/J)):N=Q(N/J),ee*=J),new v(this.data,E,I,B,N,V,j,$,ee,H)},S.transpose=function(T,p,M,f){T=T===void 0?0:0|T,p=p===void 0?1:0|p,M=M===void 0?2:0|M,f=f===void 0?3:0|f;var E=this.shape,I=this.stride;return new v(this.data,E[T],E[p],E[M],E[f],I[T],I[p],I[M],I[f],this.offset)},S.pick=function(T,p,M,f){var E=[],I=[],B=this.offset;return typeof T=="number"&&T>=0?B=B+this.stride[0]*T|0:(E.push(this.shape[0]),I.push(this.stride[0])),typeof p=="number"&&p>=0?B=B+this.stride[1]*p|0:(E.push(this.shape[1]),I.push(this.stride[1])),typeof M=="number"&&M>=0?B=B+this.stride[2]*M|0:(E.push(this.shape[2]),I.push(this.stride[2])),typeof f=="number"&&f>=0?B=B+this.stride[3]*f|0:(E.push(this.shape[3]),I.push(this.stride[3])),(0,k[E.length+1])(this.data,E,I,B)},function(T,p,M,f){return new v(T,p[0],p[1],p[2],p[3],M[0],M[1],M[2],M[3],f)}},5:function(g,k,A){function v(T,p,M,f,E,I,B,N,V,j,$,ee){this.data=T,this.shape=[p,M,f,E,I],this.stride=[B,N,V,j,$],this.offset=0|ee}var S=v.prototype;return S.dtype=g,S.dimension=5,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(S,"order",{get:A}),S.set=function(T,p,M,f,E,I){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E,I):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E]=I},S.get=function(T,p,M,f,E){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E]},S.index=function(T,p,M,f,E){return this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E},S.hi=function(T,p,M,f,E){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,typeof M!="number"||M<0?this.shape[2]:0|M,typeof f!="number"||f<0?this.shape[3]:0|f,typeof E!="number"||E<0?this.shape[4]:0|E,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},S.lo=function(T,p,M,f,E){var I=this.offset,B=0,N=this.shape[0],V=this.shape[1],j=this.shape[2],$=this.shape[3],ee=this.shape[4],H=this.stride[0],J=this.stride[1],Q=this.stride[2],Z=this.stride[3],K=this.stride[4];return typeof T=="number"&&T>=0&&(I+=H*(B=0|T),N-=B),typeof p=="number"&&p>=0&&(I+=J*(B=0|p),V-=B),typeof M=="number"&&M>=0&&(I+=Q*(B=0|M),j-=B),typeof f=="number"&&f>=0&&(I+=Z*(B=0|f),$-=B),typeof E=="number"&&E>=0&&(I+=K*(B=0|E),ee-=B),new v(this.data,N,V,j,$,ee,H,J,Q,Z,K,I)},S.step=function(T,p,M,f,E){var I=this.shape[0],B=this.shape[1],N=this.shape[2],V=this.shape[3],j=this.shape[4],$=this.stride[0],ee=this.stride[1],H=this.stride[2],J=this.stride[3],Q=this.stride[4],Z=this.offset,K=0,ae=Math.ceil;return typeof T=="number"&&((K=0|T)<0?(Z+=$*(I-1),I=ae(-I/K)):I=ae(I/K),$*=K),typeof p=="number"&&((K=0|p)<0?(Z+=ee*(B-1),B=ae(-B/K)):B=ae(B/K),ee*=K),typeof M=="number"&&((K=0|M)<0?(Z+=H*(N-1),N=ae(-N/K)):N=ae(N/K),H*=K),typeof f=="number"&&((K=0|f)<0?(Z+=J*(V-1),V=ae(-V/K)):V=ae(V/K),J*=K),typeof E=="number"&&((K=0|E)<0?(Z+=Q*(j-1),j=ae(-j/K)):j=ae(j/K),Q*=K),new v(this.data,I,B,N,V,j,$,ee,H,J,Q,Z)},S.transpose=function(T,p,M,f,E){T=T===void 0?0:0|T,p=p===void 0?1:0|p,M=M===void 0?2:0|M,f=f===void 0?3:0|f,E=E===void 0?4:0|E;var I=this.shape,B=this.stride;return new v(this.data,I[T],I[p],I[M],I[f],I[E],B[T],B[p],B[M],B[f],B[E],this.offset)},S.pick=function(T,p,M,f,E){var I=[],B=[],N=this.offset;return typeof T=="number"&&T>=0?N=N+this.stride[0]*T|0:(I.push(this.shape[0]),B.push(this.stride[0])),typeof p=="number"&&p>=0?N=N+this.stride[1]*p|0:(I.push(this.shape[1]),B.push(this.stride[1])),typeof M=="number"&&M>=0?N=N+this.stride[2]*M|0:(I.push(this.shape[2]),B.push(this.stride[2])),typeof f=="number"&&f>=0?N=N+this.stride[3]*f|0:(I.push(this.shape[3]),B.push(this.stride[3])),typeof E=="number"&&E>=0?N=N+this.stride[4]*E|0:(I.push(this.shape[4]),B.push(this.stride[4])),(0,k[I.length+1])(this.data,I,B,N)},function(T,p,M,f){return new v(T,p[0],p[1],p[2],p[3],p[4],M[0],M[1],M[2],M[3],M[4],f)}}};function x(g,k){var A=k===-1?"T":String(k),v=h[A];return k===-1?v(g):k===0?v(g,m[g][0]):v(g,m[g],c)}var m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};u.exports=function(g,k,A,v){if(g===void 0)return(0,m.array[0])([]);typeof g=="number"&&(g=[g]),k===void 0&&(k=[g.length]);var S=k.length;if(A===void 0){A=new Array(S);for(var T=S-1,p=1;T>=0;--T)A[T]=p,p*=k[T]}if(v===void 0)for(v=0,T=0;T>>0;u.exports=function(c,h){if(isNaN(c)||isNaN(h))return NaN;if(c===h)return c;if(c===0)return h<0?-o:o;var x=l.hi(c),m=l.lo(c);return h>c==c>0?m===s?(x+=1,m=0):m+=1:m===0?(m=s,x-=1):m-=1,l.pack(m,x)}},8406:function(u,r){r.vertexNormals=function(n,l,o){for(var s=l.length,c=new Array(s),h=o===void 0?1e-6:o,x=0;xh){var N=c[k],V=1/Math.sqrt(f*I);for(B=0;B<3;++B){var j=(B+1)%3,$=(B+2)%3;N[B]+=V*(E[j]*M[$]-E[$]*M[j])}}}for(x=0;xh)for(V=1/Math.sqrt(ee),B=0;B<3;++B)N[B]*=V;else for(B=0;B<3;++B)N[B]=0}return c},r.faceNormals=function(n,l,o){for(var s=n.length,c=new Array(s),h=o===void 0?1e-6:o,x=0;xh?1/Math.sqrt(T):0,k=0;k<3;++k)S[k]*=T;c[x]=S}return c}},4081:function(u){u.exports=function(r,n,l,o,s,c,h,x,m,g){var k=n+c+g;if(A>0){var A=Math.sqrt(k+1);r[0]=.5*(h-m)/A,r[1]=.5*(x-o)/A,r[2]=.5*(l-c)/A,r[3]=.5*A}else{var v=Math.max(n,c,g);A=Math.sqrt(2*v-k+1),n>=v?(r[0]=.5*A,r[1]=.5*(s+l)/A,r[2]=.5*(x+o)/A,r[3]=.5*(h-m)/A):c>=v?(r[0]=.5*(l+s)/A,r[1]=.5*A,r[2]=.5*(m+h)/A,r[3]=.5*(x-o)/A):(r[0]=.5*(o+x)/A,r[1]=.5*(h+m)/A,r[2]=.5*A,r[3]=.5*(l-s)/A)}return r}},9977:function(u,r,n){u.exports=function(v){var S=(v=v||{}).center||[0,0,0],T=v.rotation||[0,0,0,1],p=v.radius||1;S=[].slice.call(S,0,3),g(T=[].slice.call(T,0,4),T);var M=new k(T,S,Math.log(p));return M.setDistanceLimits(v.zoomMin,v.zoomMax),("eye"in v||"up"in v)&&M.lookAt(0,v.eye,v.center,v.up),M};var l=n(9215),o=n(6582),s=n(7399),c=n(7608),h=n(4081);function x(v,S,T){return Math.sqrt(Math.pow(v,2)+Math.pow(S,2)+Math.pow(T,2))}function m(v,S,T,p){return Math.sqrt(Math.pow(v,2)+Math.pow(S,2)+Math.pow(T,2)+Math.pow(p,2))}function g(v,S){var T=S[0],p=S[1],M=S[2],f=S[3],E=m(T,p,M,f);E>1e-6?(v[0]=T/E,v[1]=p/E,v[2]=M/E,v[3]=f/E):(v[0]=v[1]=v[2]=0,v[3]=1)}function k(v,S,T){this.radius=l([T]),this.center=l(S),this.rotation=l(v),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 A=k.prototype;A.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},A.recalcMatrix=function(v){this.radius.curve(v),this.center.curve(v),this.rotation.curve(v);var S=this.computedRotation;g(S,S);var T=this.computedMatrix;s(T,S);var p=this.computedCenter,M=this.computedEye,f=this.computedUp,E=Math.exp(this.computedRadius[0]);M[0]=p[0]+E*T[2],M[1]=p[1]+E*T[6],M[2]=p[2]+E*T[10],f[0]=T[1],f[1]=T[5],f[2]=T[9];for(var I=0;I<3;++I){for(var B=0,N=0;N<3;++N)B+=T[I+4*N]*M[N];T[12+I]=-B}},A.getMatrix=function(v,S){this.recalcMatrix(v);var T=this.computedMatrix;if(S){for(var p=0;p<16;++p)S[p]=T[p];return S}return T},A.idle=function(v){this.center.idle(v),this.radius.idle(v),this.rotation.idle(v)},A.flush=function(v){this.center.flush(v),this.radius.flush(v),this.rotation.flush(v)},A.pan=function(v,S,T,p){S=S||0,T=T||0,p=p||0,this.recalcMatrix(v);var M=this.computedMatrix,f=M[1],E=M[5],I=M[9],B=x(f,E,I);f/=B,E/=B,I/=B;var N=M[0],V=M[4],j=M[8],$=N*f+V*E+j*I,ee=x(N-=f*$,V-=E*$,j-=I*$);N/=ee,V/=ee,j/=ee,M[2],M[6],M[10];var H=N*S+f*T,J=V*S+E*T,Q=j*S+I*T;this.center.move(v,H,J,Q);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+p),this.radius.set(v,Math.log(Z))},A.rotate=function(v,S,T,p){this.recalcMatrix(v),S=S||0,T=T||0;var M=this.computedMatrix,f=M[0],E=M[4],I=M[8],B=M[1],N=M[5],V=M[9],j=M[2],$=M[6],ee=M[10],H=S*f+T*B,J=S*E+T*N,Q=S*I+T*V,Z=-($*Q-ee*J),K=-(ee*H-j*Q),ae=-(j*J-$*H),se=Math.sqrt(Math.max(0,1-Math.pow(Z,2)-Math.pow(K,2)-Math.pow(ae,2))),he=m(Z,K,ae,se);he>1e-6?(Z/=he,K/=he,ae/=he,se/=he):(Z=K=ae=0,se=1);var fe=this.computedRotation,ie=fe[0],oe=fe[1],le=fe[2],ge=fe[3],ye=ie*se+ge*Z+oe*ae-le*K,me=oe*se+ge*K+le*Z-ie*ae,be=le*se+ge*ae+ie*K-oe*Z,Se=ge*se-ie*Z-oe*K-le*ae;if(p){Z=j,K=$,ae=ee;var Ee=Math.sin(p)/x(Z,K,ae);Z*=Ee,K*=Ee,ae*=Ee,Se=Se*(se=Math.cos(S))-(ye=ye*se+Se*Z+me*ae-be*K)*Z-(me=me*se+Se*K+be*Z-ye*ae)*K-(be=be*se+Se*ae+ye*K-me*Z)*ae}var Ce=m(ye,me,be,Se);Ce>1e-6?(ye/=Ce,me/=Ce,be/=Ce,Se/=Ce):(ye=me=be=0,Se=1),this.rotation.set(v,ye,me,be,Se)},A.lookAt=function(v,S,T,p){this.recalcMatrix(v),T=T||this.computedCenter,S=S||this.computedEye,p=p||this.computedUp;var M=this.computedMatrix;o(M,S,T,p);var f=this.computedRotation;h(f,M[0],M[1],M[2],M[4],M[5],M[6],M[8],M[9],M[10]),g(f,f),this.rotation.set(v,f[0],f[1],f[2],f[3]);for(var E=0,I=0;I<3;++I)E+=Math.pow(T[I]-S[I],2);this.radius.set(v,.5*Math.log(Math.max(E,1e-6))),this.center.set(v,T[0],T[1],T[2])},A.translate=function(v,S,T,p){this.center.move(v,S||0,T||0,p||0)},A.setMatrix=function(v,S){var T=this.computedRotation;h(T,S[0],S[1],S[2],S[4],S[5],S[6],S[8],S[9],S[10]),g(T,T),this.rotation.set(v,T[0],T[1],T[2],T[3]);var p=this.computedMatrix;c(p,S);var M=p[15];if(Math.abs(M)>1e-6){var f=p[12]/M,E=p[13]/M,I=p[14]/M;this.recalcMatrix(v);var B=Math.exp(this.computedRadius[0]);this.center.set(v,f-p[2]*B,E-p[6]*B,I-p[10]*B),this.radius.idle(v)}else this.center.idle(v),this.radius.idle(v)},A.setDistance=function(v,S){S>0&&this.radius.set(v,Math.log(S))},A.setDistanceLimits=function(v,S){v=v>0?Math.log(v):-1/0,S=S>0?Math.log(S):1/0,S=Math.max(S,v),this.radius.bounds[0][0]=v,this.radius.bounds[1][0]=S},A.getDistanceLimits=function(v){var S=this.radius.bounds;return v?(v[0]=Math.exp(S[0][0]),v[1]=Math.exp(S[1][0]),v):[Math.exp(S[0][0]),Math.exp(S[1][0])]},A.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]}},A.fromJSON=function(v){var S=this.lastT(),T=v.center;T&&this.center.set(S,T[0],T[1],T[2]);var p=v.rotation;p&&this.rotation.set(S,p[0],p[1],p[2],p[3]);var M=v.distance;M&&M>0&&this.radius.set(S,Math.log(M)),this.setDistanceLimits(v.zoomMin,v.zoomMax)}},1371:function(u,r,n){var l=n(3233);u.exports=function(o,s,c){return l(c=c!==void 0?c+"":" ",s)+o}},3202:function(u){u.exports=function(r,n){n||(n=[0,""]),r=String(r);var l=parseFloat(r,10);return n[0]=l,n[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",n}},3088:function(u,r,n){u.exports=function(o,s){for(var c=0|s.length,h=o.length,x=[new Array(c),new Array(c)],m=0;m0){N=x[$][I][0],j=$;break}V=N[1^j];for(var ee=0;ee<2;++ee)for(var H=x[ee][I],J=0;J0&&(N=Q,V=Z,j=ee)}return B||N&&A(N,j),V}function S(E,I){var B=x[I][E][0],N=[E];A(B,I);for(var V=B[1^I];;){for(;V!==E;)N.push(V),V=v(N[N.length-2],V,!1);if(x[0][E].length+x[1][E].length===0)break;var j=N[N.length-1],$=E,ee=N[1],H=v(j,$,!0);if(l(s[j],s[$],s[ee],s[H])<0)break;N.push(E),V=v(j,$)}return N}function T(E,I){return I[1]===I[I.length-1]}for(m=0;m0;){x[0][m].length;var f=S(m,p);T(0,f)?M.push.apply(M,f):(M.length>0&&k.push(M),M=f)}M.length>0&&k.push(M)}return k};var l=n(3140)},5609:function(u,r,n){u.exports=function(o,s){for(var c=l(o,s.length),h=new Array(s.length),x=new Array(s.length),m=[],g=0;g0;){h[p=m.pop()]=!1;var A=c[p];for(g=0;g0})).length,E=new Array(f),I=new Array(f);for(p=0;p0;){var me=ge.pop(),be=K[me];x(be,function(We,Ie){return We-Ie});var Se,Ee=be.length,Ce=ye[me];for(Ce===0&&(Se=[Le=M[me]]),p=0;p=0||(ye[Oe]=1^Ce,ge.push(Oe),Ce===0&&(le(Le=M[Oe])||(Le.reverse(),Se.push(Le))))}Ce===0&&v.push(Se)}return v};var l=n(3134),o=n(3088),s=n(5085),c=n(5250),h=n(8210),x=n(1682),m=n(5609);function g(k,A){for(var v=new Array(k),S=0;S0&&$[H]===ee[0]))return 1;J=j[H-1]}for(var Q=1;J;){var Z=J.key,K=l(ee,Z[0],Z[1]);if(Z[0][0]0))return 0;Q=-1,J=J.right}else if(K>0)J=J.left;else{if(!(K<0))return 0;Q=1,J=J.right}}return Q}}(N.slabs,N.coordinates);return v.length===0?V:function(j,$){return function(ee){return j(ee[0],ee[1])?0:$(ee)}}(x(v),V)};var l=n(3250)[3],o=n(4209),s=n(3352),c=n(2478);function h(){return!0}function x(g){for(var k={},A=0;A=g?($=1,E=g+2*v+T):E=v*($=-v/g)+T):($=0,S>=0?(ee=0,E=T):-S>=A?(ee=1,E=A+2*S+T):E=S*(ee=-S/A)+T);else if(ee<0)ee=0,v>=0?($=0,E=T):-v>=g?($=1,E=g+2*v+T):E=v*($=-v/g)+T;else{var H=1/j;E=($*=H)*(g*$+k*(ee*=H)+2*v)+ee*(k*$+A*ee+2*S)+T}else $<0?(B=A+S)>(I=k+v)?(N=B-I)>=(V=g-2*k+A)?($=1,ee=0,E=g+2*v+T):E=($=N/V)*(g*$+k*(ee=1-$)+2*v)+ee*(k*$+A*ee+2*S)+T:($=0,B<=0?(ee=1,E=A+2*S+T):S>=0?(ee=0,E=T):E=S*(ee=-S/A)+T):ee<0?(B=g+v)>(I=k+S)?(N=B-I)>=(V=g-2*k+A)?(ee=1,$=0,E=A+2*S+T):E=($=1-(ee=N/V))*(g*$+k*ee+2*v)+ee*(k*$+A*ee+2*S)+T:(ee=0,B<=0?($=1,E=g+2*v+T):v>=0?($=0,E=T):E=v*($=-v/g)+T):(N=A+S-k-v)<=0?($=0,ee=1,E=A+2*S+T):N>=(V=g-2*k+A)?($=1,ee=0,E=g+2*v+T):E=($=N/V)*(g*$+k*(ee=1-$)+2*v)+ee*(k*$+A*ee+2*S)+T;var J=1-$-ee;for(m=0;m0){var A=c[x-1];if(l(g,A)===0&&s(A)!==k){x-=1;continue}}c[x++]=g}}return c.length=x,c}},3233:function(u){var r,n="";u.exports=function(l,o){if(typeof l!="string")throw new TypeError("expected a string");if(o===1)return l;if(o===2)return l+l;var s=l.length*o;if(r!==l||r===void 0)r=l,n="";else if(n.length>=s)return n.substr(0,s);for(;s>n.length&&o>1;)1&o&&(n+=l),o>>=1,l+=l;return n=(n+=l).substr(0,s)}},3025:function(u,r,n){u.exports=n.g.performance&&n.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(u){u.exports=function(r){for(var n=r.length,l=r[r.length-1],o=n,s=n-2;s>=0;--s){var c=l;(m=(x=r[s])-((l=c+x)-c))&&(r[--o]=l,l=m)}var h=0;for(s=o;s0){if(B<=0)return N;E=I+B}else{if(!(I<0)||B>=0)return N;E=-(I+B)}var V=33306690738754716e-32*E;return N>=V||N<=-V?N:k(p,M,f)},function(p,M,f,E){var I=p[0]-E[0],B=M[0]-E[0],N=f[0]-E[0],V=p[1]-E[1],j=M[1]-E[1],$=f[1]-E[1],ee=p[2]-E[2],H=M[2]-E[2],J=f[2]-E[2],Q=B*$,Z=N*j,K=N*V,ae=I*$,se=I*j,he=B*V,fe=ee*(Q-Z)+H*(K-ae)+J*(se-he),ie=7771561172376103e-31*((Math.abs(Q)+Math.abs(Z))*Math.abs(ee)+(Math.abs(K)+Math.abs(ae))*Math.abs(H)+(Math.abs(se)+Math.abs(he))*Math.abs(J));return fe>ie||-fe>ie?fe:A(p,M,f,E)}];function S(p){var M=v[p.length];return M||(M=v[p.length]=g(p.length)),M.apply(void 0,p)}function T(p,M,f,E,I,B,N){return function(V,j,$,ee,H){switch(arguments.length){case 0:case 1:return 0;case 2:return E(V,j);case 3:return I(V,j,$);case 4:return B(V,j,$,ee);case 5:return N(V,j,$,ee,H)}for(var J=new Array(arguments.length),Q=0;Q0&&m>0||x<0&&m<0)return!1;var g=l(c,o,s),k=l(h,o,s);return!(g>0&&k>0||g<0&&k<0)&&(x!==0||m!==0||g!==0||k!==0||function(A,v,S,T){for(var p=0;p<2;++p){var M=A[p],f=v[p],E=Math.min(M,f),I=Math.max(M,f),B=S[p],N=T[p],V=Math.min(B,N);if(Math.max(B,N)=o?(s=A,(m+=1)=o?(s=A,(m+=1)>1,A=o[2*k+1];if(A===x)return k;x>1,A=o[2*k+1];if(A===x)return k;x>1,A=o[2*k+1];if(A===x)return k;x0)-(o<0)},r.abs=function(o){var s=o>>31;return(o^s)-s},r.min=function(o,s){return s^(o^s)&-(o65535)<<4,s|=c=((o>>>=s)>255)<<3,s|=c=((o>>>=c)>15)<<2,(s|=c=((o>>>=c)>3)<<1)|(o>>>=c)>>1},r.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},r.popCount=function(o){return 16843009*((o=(858993459&(o-=o>>>1&1431655765))+(o>>>2&858993459))+(o>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,1+(o|=o>>>16)},r.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,(o|=o>>>16)-(o>>>1)},r.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,27030>>>(o&=15)&1};var l=new Array(256);(function(o){for(var s=0;s<256;++s){var c=s,h=s,x=7;for(c>>>=1;c;c>>>=1)h<<=1,h|=1&c,--x;o[s]=h<>>8&255]<<16|l[o>>>16&255]<<8|l[o>>>24&255]},r.interleave2=function(o,s){return(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o&=65535)|o<<8))|o<<4))|o<<2))|o<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s&=65535)|s<<8))|s<<4))|s<<2))|s<<1))<<1},r.deinterleave2=function(o,s){return(o=65535&((o=16711935&((o=252645135&((o=858993459&((o=o>>>s&1431655765)|o>>>1))|o>>>2))|o>>>4))|o>>>16))<<16>>16},r.interleave3=function(o,s,c){return o=1227133513&((o=3272356035&((o=251719695&((o=4278190335&((o&=1023)|o<<16))|o<<8))|o<<4))|o<<2),(o|=(s=1227133513&((s=3272356035&((s=251719695&((s=4278190335&((s&=1023)|s<<16))|s<<8))|s<<4))|s<<2))<<1)|(c=1227133513&((c=3272356035&((c=251719695&((c=4278190335&((c&=1023)|c<<16))|c<<8))|c<<4))|c<<2))<<2},r.deinterleave3=function(o,s){return(o=1023&((o=4278190335&((o=251719695&((o=3272356035&((o=o>>>s&1227133513)|o>>>2))|o>>>4))|o>>>8))|o>>>16))<<22>>22},r.nextCombination=function(o){var s=o|o-1;return s+1|(~s&-~s)-1>>>n(o)+1}},2014:function(u,r,n){var l=n(3105),o=n(4623);function s(A,v){var S=A.length,T=A.length-v.length,p=Math.min;if(T)return T;switch(S){case 0:return 0;case 1:return A[0]-v[0];case 2:return(E=A[0]+A[1]-v[0]-v[1])||p(A[0],A[1])-p(v[0],v[1]);case 3:var M=A[0]+A[1],f=v[0]+v[1];if(E=M+A[2]-(f+v[2]))return E;var E,I=p(A[0],A[1]),B=p(v[0],v[1]);return(E=p(I,A[2])-p(B,v[2]))||p(I+A[2],M)-p(B+v[2],f);default:var N=A.slice(0);N.sort();var V=v.slice(0);V.sort();for(var j=0;j>1,f=s(A[M],v);f<=0?(f===0&&(p=M),S=M+1):f>0&&(T=M-1)}return p}function g(A,v){for(var S=new Array(A.length),T=0,p=S.length;T=A.length||s(A[$],M)!==0););}return S}function k(A,v){if(v<0)return[];for(var S=[],T=(1<>>B&1&&I.push(p[B]);v.push(I)}return h(v)},r.skeleton=k,r.boundary=function(A){for(var v=[],S=0,T=A.length;S>1:(he>>1)-1}function N(he){for(var fe=I(he);;){var ie=fe,oe=2*he+1,le=2*(he+1),ge=he;if(oe0;){var ie=B(he);if(!(ie>=0&&fe0){var he=H[0];return E(0,Q-1),Q-=1,N(0),he}return-1}function $(he,fe){var ie=H[he];return A[ie]===fe?he:(A[ie]=-1/0,V(he),j(),A[ie]=fe,V((Q+=1)-1))}function ee(he){if(!v[he]){v[he]=!0;var fe=g[he],ie=k[he];g[ie]>=0&&(g[ie]=fe),k[fe]>=0&&(k[fe]=ie),J[fe]>=0&&$(J[fe],f(fe)),J[ie]>=0&&$(J[ie],f(ie))}}var H=[],J=new Array(x);for(S=0;S>1;S>=0;--S)N(S);for(;;){var Z=j();if(Z<0||A[Z]>h)break;ee(Z)}var K=[];for(S=0;S=0&&ie>=0&&fe!==ie){var oe=J[fe],le=J[ie];oe!==le&&se.push([oe,le])}}),o.unique(o.normalize(se)),{positions:K,edges:se}};var l=n(3250),o=n(2014)},1303:function(u,r,n){u.exports=function(s,c){var h,x,m,g;if(c[0][0]c[1][0]))return o(c,s);h=c[1],x=c[0]}if(s[0][0]s[1][0]))return-o(s,c);m=s[1],g=s[0]}var k=l(h,x,g),A=l(h,x,m);if(k<0){if(A<=0)return k}else if(k>0){if(A>=0)return k}else if(A)return A;if(k=l(g,m,x),A=l(g,m,h),k<0){if(A<=0)return k}else if(k>0){if(A>=0)return k}else if(A)return A;return x[0]-g[0]};var l=n(3250);function o(s,c){var h,x,m,g;if(c[0][0]c[1][0])){var k=Math.min(s[0][1],s[1][1]),A=Math.max(s[0][1],s[1][1]),v=Math.min(c[0][1],c[1][1]),S=Math.max(c[0][1],c[1][1]);return AS?k-S:A-S}h=c[1],x=c[0]}s[0][1]0)if(v[0]!==M[1][0])S=A,A=A.right;else{if(E=m(A.right,v))return E;A=A.left}else{if(v[0]!==M[1][0])return A;var E;if(E=m(A.right,v))return E;A=A.left}}return S}function g(A,v,S,T){this.y=A,this.index=v,this.start=S,this.closed=T}function k(A,v,S,T){this.x=A,this.segment=v,this.create=S,this.index=T}h.prototype.castUp=function(A){var v=l.le(this.coordinates,A[0]);if(v<0)return-1;this.slabs[v];var S=m(this.slabs[v],A),T=-1;if(S&&(T=S.value),this.coordinates[v]===A[0]){var p=null;if(S&&(p=S.key),v>0){var M=m(this.slabs[v-1],A);M&&(p?c(M.key,p)>0&&(p=M.key,T=M.value):(T=M.value,p=M.key))}var f=this.horizontal[v];if(f.length>0){var E=l.ge(f,A[1],x);if(E=f.length)return T;I=f[E]}}if(I.start)if(p){var B=s(p[0],p[1],[A[0],I.y]);p[0][0]>p[1][0]&&(B=-B),B>0&&(T=I.index)}else T=I.index;else I.y!==A[1]&&(T=I.index)}}}return T}},5202:function(u,r,n){var l=n(1944),o=n(8210);function s(h,x){var m=o(l(h,x),[x[x.length-1]]);return m[m.length-1]}function c(h,x,m,g){var k=-x/(g-x);k<0?k=0:k>1&&(k=1);for(var A=1-k,v=h.length,S=new Array(v),T=0;T0||k>0&&T<0){var p=c(A,T,v,k);m.push(p),g.push(p.slice())}T<0?g.push(v.slice()):T>0?m.push(v.slice()):(m.push(v.slice()),g.push(v.slice())),k=T}return{positive:m,negative:g}},u.exports.positive=function(h,x){for(var m=[],g=s(h[h.length-1],x),k=h[h.length-1],A=h[0],v=0;v0||g>0&&S<0)&&m.push(c(k,S,A,g)),S>=0&&m.push(A.slice()),g=S}return m},u.exports.negative=function(h,x){for(var m=[],g=s(h[h.length-1],x),k=h[h.length-1],A=h[0],v=0;v0||g>0&&S<0)&&m.push(c(k,S,A,g)),S<=0&&m.push(A.slice()),g=S}return m}},3387:function(u,r,n){var l;(function(){var o={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 s(x){return function(m,g){var k,A,v,S,T,p,M,f,E,I=1,B=m.length,N="";for(A=0;A=0),S.type){case"b":k=parseInt(k,10).toString(2);break;case"c":k=String.fromCharCode(parseInt(k,10));break;case"d":case"i":k=parseInt(k,10);break;case"j":k=JSON.stringify(k,null,S.width?parseInt(S.width):0);break;case"e":k=S.precision?parseFloat(k).toExponential(S.precision):parseFloat(k).toExponential();break;case"f":k=S.precision?parseFloat(k).toFixed(S.precision):parseFloat(k);break;case"g":k=S.precision?String(Number(k.toPrecision(S.precision))):parseFloat(k);break;case"o":k=(parseInt(k,10)>>>0).toString(8);break;case"s":k=String(k),k=S.precision?k.substring(0,S.precision):k;break;case"t":k=String(!!k),k=S.precision?k.substring(0,S.precision):k;break;case"T":k=Object.prototype.toString.call(k).slice(8,-1).toLowerCase(),k=S.precision?k.substring(0,S.precision):k;break;case"u":k=parseInt(k,10)>>>0;break;case"v":k=k.valueOf(),k=S.precision?k.substring(0,S.precision):k;break;case"x":k=(parseInt(k,10)>>>0).toString(16);break;case"X":k=(parseInt(k,10)>>>0).toString(16).toUpperCase()}o.json.test(S.type)?N+=k:(!o.number.test(S.type)||f&&!S.sign?E="":(E=f?"+":"-",k=k.toString().replace(o.sign,"")),p=S.pad_char?S.pad_char==="0"?"0":S.pad_char.charAt(1):" ",M=S.width-(E+k).length,T=S.width&&M>0?p.repeat(M):"",N+=S.align?E+k+T:p==="0"?E+T+k:T+E+k)}return N}(function(m){if(h[m])return h[m];for(var g,k=m,A=[],v=0;k;){if((g=o.text.exec(k))!==null)A.push(g[0]);else if((g=o.modulo.exec(k))!==null)A.push("%");else{if((g=o.placeholder.exec(k))===null)throw new SyntaxError("[sprintf] unexpected placeholder");if(g[2]){v|=1;var S=[],T=g[2],p=[];if((p=o.key.exec(T))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");for(S.push(p[1]);(T=T.substring(p[0].length))!=="";)if((p=o.key_access.exec(T))!==null)S.push(p[1]);else{if((p=o.index_access.exec(T))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");S.push(p[1])}g[2]=S}else v|=2;if(v===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");A.push({placeholder:g[0],param_no:g[1],keys:g[2],sign:g[3],pad_char:g[4],align:g[5],width:g[6],precision:g[7],type:g[8]})}k=k.substring(g[0].length)}return h[m]=A}(x),arguments)}function c(x,m){return s.apply(null,[x].concat(m||[]))}var h=Object.create(null);r.sprintf=s,r.vsprintf=c,typeof window<"u"&&(window.sprintf=s,window.vsprintf=c,(l=(function(){return{sprintf:s,vsprintf:c}}).call(r,n,r,u))===void 0||(u.exports=l))})()},3711:function(u,r,n){u.exports=function(h,x){if(h.dimension<=0)return{positions:[],cells:[]};if(h.dimension===1)return function(k,A){for(var v=o(k,A),S=v.length,T=new Array(S),p=new Array(S),M=0;MS|0},vertex:function(k,A,v,S,T,p,M,f,E,I,B,N,V){var j=(M<<0)+(f<<1)+(E<<2)+(I<<3)|0;if(j!==0&&j!==15)switch(j){case 0:case 15:B.push([k-.5,A-.5]);break;case 1:B.push([k-.25-.25*(S+v-2*V)/(v-S),A-.25-.25*(T+v-2*V)/(v-T)]);break;case 2:B.push([k-.75-.25*(-S-v+2*V)/(S-v),A-.25-.25*(p+S-2*V)/(S-p)]);break;case 3:B.push([k-.5,A-.5-.5*(T+v+p+S-4*V)/(v-T+S-p)]);break;case 4:B.push([k-.25-.25*(p+T-2*V)/(T-p),A-.75-.25*(-T-v+2*V)/(T-v)]);break;case 5:B.push([k-.5-.5*(S+v+p+T-4*V)/(v-S+T-p),A-.5]);break;case 6:B.push([k-.5-.25*(-S-v+p+T)/(S-v+T-p),A-.5-.25*(-T-v+p+S)/(T-v+S-p)]);break;case 7:B.push([k-.75-.25*(p+T-2*V)/(T-p),A-.75-.25*(p+S-2*V)/(S-p)]);break;case 8:B.push([k-.75-.25*(-p-T+2*V)/(p-T),A-.75-.25*(-p-S+2*V)/(p-S)]);break;case 9:B.push([k-.5-.25*(S+v+-p-T)/(v-S+p-T),A-.5-.25*(T+v+-p-S)/(v-T+p-S)]);break;case 10:B.push([k-.5-.5*(-S-v-p-T+4*V)/(S-v+p-T),A-.5]);break;case 11:B.push([k-.25-.25*(-p-T+2*V)/(p-T),A-.75-.25*(T+v-2*V)/(v-T)]);break;case 12:B.push([k-.5,A-.5-.5*(-T-v-p-S+4*V)/(T-v+p-S)]);break;case 13:B.push([k-.75-.25*(S+v-2*V)/(v-S),A-.25-.25*(-p-S+2*V)/(p-S)]);break;case 14:B.push([k-.25-.25*(-S-v+2*V)/(S-v),A-.25-.25*(-T-v+2*V)/(T-v)])}},cell:function(k,A,v,S,T,p,M,f,E){T?f.push([k,A]):f.push([A,k])}});return function(k,A){var v=[],S=[];return g(k,v,S,A),{positions:v,cells:S}}}},c={}},529:function(u,r,n){u.exports=function c(h,x,m){var g=(m=m||{}).fontStyle||"normal",k=m.fontWeight||"normal",A=m.fontVariant||"normal",v=[g,k,A,h].join("_"),S=s[v];S||(S=s[v]={" ":{data:new Float32Array(0),shape:.2}});var T=S[x];if(!T)if(x.length<=1||!/\d/.test(x))T=S[x]=function(ee){for(var H=ee.cells,J=ee.positions,Q=new Float32Array(6*H.length),Z=0,K=0,ae=0;ae0&&(E+=.02);var B=new Float32Array(f),N=0,V=-.5*E;for(I=0;IMath.max(M,f)?E[2]=1:M>Math.max(p,f)?E[0]=1:E[1]=1;for(var I=0,B=0,N=0;N<3;++N)I+=T[N]*T[N],B+=E[N]*T[N];for(N=0;N<3;++N)E[N]-=B/I*T[N];return h(E,E),E}function A(T,p,M,f,E,I,B,N){this.center=l(M),this.up=l(f),this.right=l(E),this.radius=l([I]),this.angle=l([B,N]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(T,p),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 V=0;V<16;++V)this.computedMatrix[V]=.5;this.recalcMatrix(0)}var v=A.prototype;v.setDistanceLimits=function(T,p){T=T>0?Math.log(T):-1/0,p=p>0?Math.log(p):1/0,p=Math.max(p,T),this.radius.bounds[0][0]=T,this.radius.bounds[1][0]=p},v.getDistanceLimits=function(T){var p=this.radius.bounds[0];return T?(T[0]=Math.exp(p[0][0]),T[1]=Math.exp(p[1][0]),T):[Math.exp(p[0][0]),Math.exp(p[1][0])]},v.recalcMatrix=function(T){this.center.curve(T),this.up.curve(T),this.right.curve(T),this.radius.curve(T),this.angle.curve(T);for(var p=this.computedUp,M=this.computedRight,f=0,E=0,I=0;I<3;++I)E+=p[I]*M[I],f+=p[I]*p[I];var B=Math.sqrt(f),N=0;for(I=0;I<3;++I)M[I]-=p[I]*E/f,N+=M[I]*M[I],p[I]/=B;var V=Math.sqrt(N);for(I=0;I<3;++I)M[I]/=V;var j=this.computedToward;c(j,p,M),h(j,j);var $=Math.exp(this.computedRadius[0]),ee=this.computedAngle[0],H=this.computedAngle[1],J=Math.cos(ee),Q=Math.sin(ee),Z=Math.cos(H),K=Math.sin(H),ae=this.computedCenter,se=J*Z,he=Q*Z,fe=K,ie=-J*K,oe=-Q*K,le=Z,ge=this.computedEye,ye=this.computedMatrix;for(I=0;I<3;++I){var me=se*M[I]+he*j[I]+fe*p[I];ye[4*I+1]=ie*M[I]+oe*j[I]+le*p[I],ye[4*I+2]=me,ye[4*I+3]=0}var be=ye[1],Se=ye[5],Ee=ye[9],Ce=ye[2],Le=ye[6],Oe=ye[10],We=Se*Oe-Ee*Le,Ie=Ee*Ce-be*Oe,Ve=be*Le-Se*Ce,Pe=m(We,Ie,Ve);for(We/=Pe,Ie/=Pe,Ve/=Pe,ye[0]=We,ye[4]=Ie,ye[8]=Ve,I=0;I<3;++I)ge[I]=ae[I]+ye[2+4*I]*$;for(I=0;I<3;++I){N=0;for(var de=0;de<3;++de)N+=ye[I+4*de]*ge[de];ye[12+I]=-N}ye[15]=1},v.getMatrix=function(T,p){this.recalcMatrix(T);var M=this.computedMatrix;if(p){for(var f=0;f<16;++f)p[f]=M[f];return p}return M};var S=[0,0,0];v.rotate=function(T,p,M,f){if(this.angle.move(T,p,M),f){this.recalcMatrix(T);var E=this.computedMatrix;S[0]=E[2],S[1]=E[6],S[2]=E[10];for(var I=this.computedUp,B=this.computedRight,N=this.computedToward,V=0;V<3;++V)E[4*V]=I[V],E[4*V+1]=B[V],E[4*V+2]=N[V];for(s(E,E,f,S),V=0;V<3;++V)I[V]=E[4*V],B[V]=E[4*V+1];this.up.set(T,I[0],I[1],I[2]),this.right.set(T,B[0],B[1],B[2])}},v.pan=function(T,p,M,f){p=p||0,M=M||0,f=f||0,this.recalcMatrix(T);var E=this.computedMatrix,I=(Math.exp(this.computedRadius[0]),E[1]),B=E[5],N=E[9],V=m(I,B,N);I/=V,B/=V,N/=V;var j=E[0],$=E[4],ee=E[8],H=j*I+$*B+ee*N,J=m(j-=I*H,$-=B*H,ee-=N*H),Q=(j/=J)*p+I*M,Z=($/=J)*p+B*M,K=(ee/=J)*p+N*M;this.center.move(T,Q,Z,K);var ae=Math.exp(this.computedRadius[0]);ae=Math.max(1e-4,ae+f),this.radius.set(T,Math.log(ae))},v.translate=function(T,p,M,f){this.center.move(T,p||0,M||0,f||0)},v.setMatrix=function(T,p,M,f){var E=1;typeof M=="number"&&(E=0|M),(E<0||E>3)&&(E=1);var I=(E+2)%3;p||(this.recalcMatrix(T),p=this.computedMatrix);var B=p[E],N=p[E+4],V=p[E+8];if(f){var j=Math.abs(B),$=Math.abs(N),ee=Math.abs(V),H=Math.max(j,$,ee);j===H?(B=B<0?-1:1,N=V=0):ee===H?(V=V<0?-1:1,B=N=0):(N=N<0?-1:1,B=V=0)}else{var J=m(B,N,V);B/=J,N/=J,V/=J}var Q,Z,K=p[I],ae=p[I+4],se=p[I+8],he=K*B+ae*N+se*V,fe=m(K-=B*he,ae-=N*he,se-=V*he),ie=N*(se/=fe)-V*(ae/=fe),oe=V*(K/=fe)-B*se,le=B*ae-N*K,ge=m(ie,oe,le);if(ie/=ge,oe/=ge,le/=ge,this.center.jump(T,Fe,qe,$e),this.radius.idle(T),this.up.jump(T,B,N,V),this.right.jump(T,K,ae,se),E===2){var ye=p[1],me=p[5],be=p[9],Se=ye*K+me*ae+be*se,Ee=ye*ie+me*oe+be*le;Q=We<0?-Math.PI/2:Math.PI/2,Z=Math.atan2(Ee,Se)}else{var Ce=p[2],Le=p[6],Oe=p[10],We=Ce*B+Le*N+Oe*V,Ie=Ce*K+Le*ae+Oe*se,Ve=Ce*ie+Le*oe+Oe*le;Q=Math.asin(g(We)),Z=Math.atan2(Ve,Ie)}this.angle.jump(T,Z,Q),this.recalcMatrix(T);var Pe=p[2],de=p[6],Me=p[10],ke=this.computedMatrix;o(ke,p);var He=ke[15],Fe=ke[12]/He,qe=ke[13]/He,$e=ke[14]/He,Ye=Math.exp(this.computedRadius[0]);this.center.jump(T,Fe-Pe*Ye,qe-de*Ye,$e-Me*Ye)},v.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},v.idle=function(T){this.center.idle(T),this.up.idle(T),this.right.idle(T),this.radius.idle(T),this.angle.idle(T)},v.flush=function(T){this.center.flush(T),this.up.flush(T),this.right.flush(T),this.radius.flush(T),this.angle.flush(T)},v.setDistance=function(T,p){p>0&&this.radius.set(T,Math.log(p))},v.lookAt=function(T,p,M,f){this.recalcMatrix(T),p=p||this.computedEye,M=M||this.computedCenter;var E=(f=f||this.computedUp)[0],I=f[1],B=f[2],N=m(E,I,B);if(!(N<1e-6)){E/=N,I/=N,B/=N;var V=p[0]-M[0],j=p[1]-M[1],$=p[2]-M[2],ee=m(V,j,$);if(!(ee<1e-6)){V/=ee,j/=ee,$/=ee;var H=this.computedRight,J=H[0],Q=H[1],Z=H[2],K=E*J+I*Q+B*Z,ae=m(J-=K*E,Q-=K*I,Z-=K*B);if(!(ae<.01&&(ae=m(J=I*$-B*j,Q=B*V-E*$,Z=E*j-I*V))<1e-6)){J/=ae,Q/=ae,Z/=ae,this.up.set(T,E,I,B),this.right.set(T,J,Q,Z),this.center.set(T,M[0],M[1],M[2]),this.radius.set(T,Math.log(ee));var se=I*Z-B*Q,he=B*J-E*Z,fe=E*Q-I*J,ie=m(se,he,fe),oe=E*V+I*j+B*$,le=J*V+Q*j+Z*$,ge=(se/=ie)*V+(he/=ie)*j+(fe/=ie)*$,ye=Math.asin(g(oe)),me=Math.atan2(ge,le),be=this.angle._state,Se=be[be.length-1],Ee=be[be.length-2];Se%=2*Math.PI;var Ce=Math.abs(Se+2*Math.PI-me),Le=Math.abs(Se-me),Oe=Math.abs(Se-2*Math.PI-me);Ce0?Q.pop():new ArrayBuffer(H)}function S(H){return new Uint8Array(v(H),0,H)}function T(H){return new Uint16Array(v(2*H),0,H)}function p(H){return new Uint32Array(v(4*H),0,H)}function M(H){return new Int8Array(v(H),0,H)}function f(H){return new Int16Array(v(2*H),0,H)}function E(H){return new Int32Array(v(4*H),0,H)}function I(H){return new Float32Array(v(4*H),0,H)}function B(H){return new Float64Array(v(8*H),0,H)}function N(H){return c?new Uint8ClampedArray(v(H),0,H):S(H)}function V(H){return h?new BigUint64Array(v(8*H),0,H):null}function j(H){return x?new BigInt64Array(v(8*H),0,H):null}function $(H){return new DataView(v(H),0,H)}function ee(H){H=l.nextPow2(H);var J=l.log2(H),Q=k[J];return Q.length>0?Q.pop():new s(H)}r.free=function(H){if(s.isBuffer(H))k[l.log2(H.length)].push(H);else{if(Object.prototype.toString.call(H)!=="[object ArrayBuffer]"&&(H=H.buffer),!H)return;var J=H.length||H.byteLength,Q=0|l.log2(J);g[Q].push(H)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(H){A(H.buffer)},r.freeArrayBuffer=A,r.freeBuffer=function(H){k[l.log2(H.length)].push(H)},r.malloc=function(H,J){if(J===void 0||J==="arraybuffer")return v(H);switch(J){case"uint8":return S(H);case"uint16":return T(H);case"uint32":return p(H);case"int8":return M(H);case"int16":return f(H);case"int32":return E(H);case"float":case"float32":return I(H);case"double":case"float64":return B(H);case"uint8_clamped":return N(H);case"bigint64":return j(H);case"biguint64":return V(H);case"buffer":return ee(H);case"data":case"dataview":return $(H);default:return null}return null},r.mallocArrayBuffer=v,r.mallocUint8=S,r.mallocUint16=T,r.mallocUint32=p,r.mallocInt8=M,r.mallocInt16=f,r.mallocInt32=E,r.mallocFloat32=r.mallocFloat=I,r.mallocFloat64=r.mallocDouble=B,r.mallocUint8Clamped=N,r.mallocBigUint64=V,r.mallocBigInt64=j,r.mallocDataView=$,r.mallocBuffer=ee,r.clearCache=function(){for(var H=0;H<32;++H)m.UINT8[H].length=0,m.UINT16[H].length=0,m.UINT32[H].length=0,m.INT8[H].length=0,m.INT16[H].length=0,m.INT32[H].length=0,m.FLOAT[H].length=0,m.DOUBLE[H].length=0,m.BIGUINT64[H].length=0,m.BIGINT64[H].length=0,m.UINT8C[H].length=0,g[H].length=0,k[H].length=0}},1755:function(u){function r(l){this.roots=new Array(l),this.ranks=new Array(l);for(var o=0;o0&&(H=ee.size),ee.lineSpacing&&ee.lineSpacing>0&&(J=ee.lineSpacing),ee.styletags&&ee.styletags.breaklines&&(Q.breaklines=!!ee.styletags.breaklines),ee.styletags&&ee.styletags.bolds&&(Q.bolds=!!ee.styletags.bolds),ee.styletags&&ee.styletags.italics&&(Q.italics=!!ee.styletags.italics),ee.styletags&&ee.styletags.subscripts&&(Q.subscripts=!!ee.styletags.subscripts),ee.styletags&&ee.styletags.superscripts&&(Q.superscripts=!!ee.styletags.superscripts)),$.font=[ee.fontStyle,ee.fontVariant,ee.fontWeight,H+"px",ee.font].filter(function(Z){return Z}).join(" "),$.textAlign="start",$.textBaseline="alphabetic",$.direction="ltr",N(function(Z,K,ae,se,he,fe){ae=ae.replace(/\n/g,""),ae=fe.breaklines===!0?ae.replace(/\/g,` +`||$==="\\"?(Z.push(j),$=j,H+1):(be(Z.join("")),Q=x,H)}function Le(){return j==="/"&&$==="*"?(Z.push(j),be(Z.join("")),Q=x,H+1):(Z.push(j),$=j,H+1)}function Oe(){if($==="."&&/\d/.test(j))return Q=T,H;if($==="/"&&j==="*")return Q=g,H;if($==="/"&&j==="/")return Q=k,H;if(j==="."&&Z.length){for(;We(Z););return Q=T,H}if(j===";"||j===")"||j==="("){if(Z.length)for(;We(Z););return be(j),Q=x,H+1}var Me=Z.length===2&&j!=="=";if(/[\w_\d\s]/.test(j)||Me){for(;We(Z););return Q=x,H}return Z.push(j),$=j,H+1}function We(Me){for(var ke,He,Fe=0;;){if(ke=o.indexOf(Me.slice(0,Me.length+Fe).join("")),He=o[ke],ke===-1){if(Fe--+Me.length>0)continue;He=Me.slice(0,1).join("")}return be(He),he+=He.length,(Z=Z.slice(He.length)).length}}function Ie(){return/[^a-fA-F0-9]/.test(j)?(be(Z.join("")),Q=x,H):(Z.push(j),$=j,H+1)}function Ve(){return j==="."||/[eE]/.test(j)?(Z.push(j),Q=T,$=j,H+1):j==="x"&&Z.length===1&&Z[0]==="0"?(Q=B,Z.push(j),$=j,H+1):/[^\d]/.test(j)?(be(Z.join("")),Q=x,H):(Z.push(j),$=j,H+1)}function Pe(){return j==="f"&&(Z.push(j),$=j,H+=1),/[eE]/.test(j)?(Z.push(j),$=j,H+1):(j!=="-"&&j!=="+"||!/[eE]/.test($))&&/[^\d]/.test(j)?(be(Z.join("")),Q=x,H):(Z.push(j),$=j,H+1)}function de(){if(/[^\d\w_]/.test(j)){var Me=Z.join("");return Q=me[Me]?f:ye[Me]?M:p,be(Z.join("")),Q=x,H}return Z.push(j),$=j,H+1}};var l=n(620),o=n(7827),s=n(6852),c=n(7932),h=n(3508),x=999,m=9999,g=0,k=1,A=2,v=3,S=4,T=5,p=6,M=7,f=8,E=9,I=10,B=11,N=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(u,r,n){var l=n(6852);l=l.slice().filter(function(o){return!/^(gl\_|texture)/.test(o)}),u.exports=l.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(u){u.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(u,r,n){var l=n(620);u.exports=l.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(u){u.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(u){u.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(u,r,n){var l=n(5874);u.exports=function(o,s){var c=l(s),h=[];return(h=h.concat(c(o))).concat(c(null))}},3236:function(u){u.exports=function(r){typeof r=="string"&&(r=[r]);for(var n=[].slice.call(arguments,1),l=[],o=0;o>1,A=-7,v=o?c-1:0,S=o?-1:1,T=n[l+v];for(v+=S,h=T&(1<<-A)-1,T>>=-A,A+=m;A>0;h=256*h+n[l+v],v+=S,A-=8);for(x=h&(1<<-A)-1,h>>=-A,A+=s;A>0;x=256*x+n[l+v],v+=S,A-=8);if(h===0)h=1-k;else{if(h===g)return x?NaN:1/0*(T?-1:1);x+=Math.pow(2,s),h-=k}return(T?-1:1)*x*Math.pow(2,h-s)},r.write=function(n,l,o,s,c,h){var x,m,g,k=8*h-c-1,A=(1<>1,S=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,T=s?0:h-1,p=s?1:-1,M=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(m=isNaN(l)?1:0,x=A):(x=Math.floor(Math.log(l)/Math.LN2),l*(g=Math.pow(2,-x))<1&&(x--,g*=2),(l+=x+v>=1?S/g:S*Math.pow(2,1-v))*g>=2&&(x++,g/=2),x+v>=A?(m=0,x=A):x+v>=1?(m=(l*g-1)*Math.pow(2,c),x+=v):(m=l*Math.pow(2,v-1)*Math.pow(2,c),x=0));c>=8;n[o+T]=255&m,T+=p,m/=256,c-=8);for(x=x<0;n[o+T]=255&x,T+=p,x/=256,k-=8);n[o+T-p]|=128*M}},8954:function(u,r,n){u.exports=function(k,A){var v=k.length;if(v===0)throw new Error("Must have at least d+1 points");var S=k[0].length;if(v<=S)throw new Error("Must input at least d+1 points");var T=k.slice(0,S+1),p=l.apply(void 0,T);if(p===0)throw new Error("Input not in general position");for(var M=new Array(S+1),f=0;f<=S;++f)M[f]=f;p<0&&(M[0]=1,M[1]=0);var E=new s(M,new Array(S+1),!1),I=E.adjacent,B=new Array(S+2);for(f=0;f<=S;++f){for(var N=M.slice(),V=0;V<=S;++V)V===f&&(N[V]=-1);var j=N[0];N[0]=N[1],N[1]=j;var $=new s(N,new Array(S+1),!0);I[f]=$,B[f]=$}for(B[S+1]=E,f=0;f<=S;++f){N=I[f].vertices;var ee=I[f].adjacent;for(V=0;V<=S;++V){var H=N[V];if(H<0)ee[V]=E;else for(var J=0;J<=S;++J)I[J].vertices.indexOf(H)<0&&(ee[V]=I[J])}}var Q=new m(S,T,B),Z=!!A;for(f=S+1;f0;)for(var f=(k=M.pop()).adjacent,E=0;E<=v;++E){var I=f[E];if(I.boundary&&!(I.lastVisited<=-S)){for(var B=I.vertices,N=0;N<=v;++N){var V=B[N];T[N]=V<0?A:p[V]}var j=this.orient();if(j>0)return I;I.lastVisited=-S,j===0&&M.push(I)}}return null},g.walk=function(k,A){var v=this.vertices.length-1,S=this.dimension,T=this.vertices,p=this.tuple,M=A?this.interior.length*Math.random()|0:this.interior.length-1,f=this.interior[M];e:for(;!f.boundary;){for(var E=f.vertices,I=f.adjacent,B=0;B<=S;++B)p[B]=T[E[B]];for(f.lastVisited=v,B=0;B<=S;++B){var N=I[B];if(!(N.lastVisited>=v)){var V=p[B];p[B]=k;var j=this.orient();if(p[B]=V,j<0){f=N;continue e}N.boundary?N.lastVisited=-v:N.lastVisited=v}}return}return f},g.addPeaks=function(k,A){var v=this.vertices.length-1,S=this.dimension,T=this.vertices,p=this.tuple,M=this.interior,f=this.simplices,E=[A];A.lastVisited=v,A.vertices[A.vertices.indexOf(-1)]=v,A.boundary=!1,M.push(A);for(var I=[];E.length>0;){var B=(A=E.pop()).vertices,N=A.adjacent,V=B.indexOf(v);if(!(V<0)){for(var j=0;j<=S;++j)if(j!==V){var $=N[j];if($.boundary&&!($.lastVisited>=v)){var ee=$.vertices;if($.lastVisited!==-v){for(var H=0,J=0;J<=S;++J)ee[J]<0?(H=J,p[J]=k):p[J]=T[ee[J]];if(this.orient()>0){ee[H]=v,$.boundary=!1,M.push($),E.push($),$.lastVisited=v;continue}$.lastVisited=-v}var Q=$.adjacent,Z=B.slice(),K=N.slice(),ae=new s(Z,K,!0);f.push(ae);var se=Q.indexOf(A);if(!(se<0))for(Q[se]=ae,K[V]=$,Z[j]=-1,K[j]=A,N[j]=ae,ae.flip(),J=0;J<=S;++J){var he=Z[J];if(!(he<0||he===v)){for(var fe=new Array(S-1),ie=0,oe=0;oe<=S;++oe){var le=Z[oe];le<0||oe===J||(fe[ie++]=le)}I.push(new c(fe,ae,J))}}}}}}for(I.sort(h),j=0;j+1=0?M[E++]=f[B]:I=1&B;if(I===(1&k)){var N=M[0];M[0]=M[1],M[1]=N}A.push(M)}}return A}},3352:function(u,r,n){var l=n(2478);function o(E,I,B,N,V){this.mid=E,this.left=I,this.right=B,this.leftPoints=N,this.rightPoints=V,this.count=(I?I.count:0)+(B?B.count:0)+N.length}u.exports=function(E){return E&&E.length!==0?new M(p(E)):new M(null)};var s=o.prototype;function c(E,I){E.mid=I.mid,E.left=I.left,E.right=I.right,E.leftPoints=I.leftPoints,E.rightPoints=I.rightPoints,E.count=I.count}function h(E,I){var B=p(I);E.mid=B.mid,E.left=B.left,E.right=B.right,E.leftPoints=B.leftPoints,E.rightPoints=B.rightPoints,E.count=B.count}function x(E,I){var B=E.intervals([]);B.push(I),h(E,B)}function m(E,I){var B=E.intervals([]),N=B.indexOf(I);return N<0?0:(B.splice(N,1),h(E,B),1)}function g(E,I,B){for(var N=0;N=0&&E[N][1]>=I;--N){var V=B(E[N]);if(V)return V}}function A(E,I){for(var B=0;B>1],V=[],j=[],$=[];for(B=0;B3*(I+1)?x(this,E):this.left.insert(E):this.left=p([E]);else if(E[0]>this.mid)this.right?4*(this.right.count+1)>3*(I+1)?x(this,E):this.right.insert(E):this.right=p([E]);else{var B=l.ge(this.leftPoints,E,S),N=l.ge(this.rightPoints,E,T);this.leftPoints.splice(B,0,E),this.rightPoints.splice(N,0,E)}},s.remove=function(E){var I=this.count-this.leftPoints;if(E[1]3*(I-1)?m(this,E):(j=this.left.remove(E))===2?(this.left=null,this.count-=1,1):(j===1&&(this.count-=1),j):0;if(E[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(I-1)?m(this,E):(j=this.right.remove(E))===2?(this.right=null,this.count-=1,1):(j===1&&(this.count-=1),j):0;if(this.count===1)return this.leftPoints[0]===E?2:0;if(this.leftPoints.length===1&&this.leftPoints[0]===E){if(this.left&&this.right){for(var B=this,N=this.left;N.right;)B=N,N=N.right;if(B===this)N.right=this.right;else{var V=this.left,j=this.right;B.count-=N.count,B.right=N.left,N.left=V,N.right=j}c(this,N),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return 1}for(V=l.ge(this.leftPoints,E,S);Vthis.mid?this.right&&(B=this.right.queryPoint(E,I))?B:k(this.rightPoints,E,I):A(this.leftPoints,I);var B},s.queryInterval=function(E,I,B){var N;return Ethis.mid&&this.right&&(N=this.right.queryInterval(E,I,B))?N:Ithis.mid?k(this.rightPoints,E,B):A(this.leftPoints,B)};var f=M.prototype;f.insert=function(E){this.root?this.root.insert(E):this.root=new o(E[0],null,null,[E],[E])},f.remove=function(E){if(this.root){var I=this.root.remove(E);return I===2&&(this.root=null),I!==0}return!1},f.queryPoint=function(E,I){if(this.root)return this.root.queryPoint(E,I)},f.queryInterval=function(E,I,B){if(E<=I&&this.root)return this.root.queryInterval(E,I,B)},Object.defineProperty(f,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(f,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},7762:function(u){u.exports=function(r){for(var n=new Array(r),l=0;l13)&&n!==32&&n!==133&&n!==160&&n!==5760&&n!==6158&&(n<8192||n>8205)&&n!==8232&&n!==8233&&n!==8239&&n!==8287&&n!==8288&&n!==12288&&n!==65279)return!1;return!0}},395:function(u){u.exports=function(r,n,l){return r*(1-l)+n*l}},2652:function(u,r,n){var l=n(4335),o=n(6864),s=n(1903),c=n(9921),h=n(7608),x=n(5665),m={length:n(1387),normalize:n(3536),dot:n(244),cross:n(5911)},g=o(),k=o(),A=[0,0,0,0],v=[[0,0,0],[0,0,0],[0,0,0]],S=[0,0,0];function T(p,M,f,E,I){p[0]=M[0]*E+f[0]*I,p[1]=M[1]*E+f[1]*I,p[2]=M[2]*E+f[2]*I}u.exports=function(p,M,f,E,I,B){if(M||(M=[0,0,0]),f||(f=[0,0,0]),E||(E=[0,0,0]),I||(I=[0,0,0,1]),B||(B=[0,0,0,1]),!l(g,p)||(s(k,g),k[3]=0,k[7]=0,k[11]=0,k[15]=1,Math.abs(c(k)<1e-8)))return!1;var N,V,j,$,ee,H,J,Q=g[3],Z=g[7],K=g[11],ae=g[12],se=g[13],he=g[14],fe=g[15];if(Q!==0||Z!==0||K!==0){if(A[0]=Q,A[1]=Z,A[2]=K,A[3]=fe,!h(k,k))return!1;x(k,k),N=I,j=k,$=(V=A)[0],ee=V[1],H=V[2],J=V[3],N[0]=j[0]*$+j[4]*ee+j[8]*H+j[12]*J,N[1]=j[1]*$+j[5]*ee+j[9]*H+j[13]*J,N[2]=j[2]*$+j[6]*ee+j[10]*H+j[14]*J,N[3]=j[3]*$+j[7]*ee+j[11]*H+j[15]*J}else I[0]=I[1]=I[2]=0,I[3]=1;if(M[0]=ae,M[1]=se,M[2]=he,function(oe,le){oe[0][0]=le[0],oe[0][1]=le[1],oe[0][2]=le[2],oe[1][0]=le[4],oe[1][1]=le[5],oe[1][2]=le[6],oe[2][0]=le[8],oe[2][1]=le[9],oe[2][2]=le[10]}(v,g),f[0]=m.length(v[0]),m.normalize(v[0],v[0]),E[0]=m.dot(v[0],v[1]),T(v[1],v[1],v[0],1,-E[0]),f[1]=m.length(v[1]),m.normalize(v[1],v[1]),E[0]/=f[1],E[1]=m.dot(v[0],v[2]),T(v[2],v[2],v[0],1,-E[1]),E[2]=m.dot(v[1],v[2]),T(v[2],v[2],v[1],1,-E[2]),f[2]=m.length(v[2]),m.normalize(v[2],v[2]),E[1]/=f[2],E[2]/=f[2],m.cross(S,v[1],v[2]),m.dot(v[0],S)<0)for(var ie=0;ie<3;ie++)f[ie]*=-1,v[ie][0]*=-1,v[ie][1]*=-1,v[ie][2]*=-1;return B[0]=.5*Math.sqrt(Math.max(1+v[0][0]-v[1][1]-v[2][2],0)),B[1]=.5*Math.sqrt(Math.max(1-v[0][0]+v[1][1]-v[2][2],0)),B[2]=.5*Math.sqrt(Math.max(1-v[0][0]-v[1][1]+v[2][2],0)),B[3]=.5*Math.sqrt(Math.max(1+v[0][0]+v[1][1]+v[2][2],0)),v[2][1]>v[1][2]&&(B[0]=-B[0]),v[0][2]>v[2][0]&&(B[1]=-B[1]),v[1][0]>v[0][1]&&(B[2]=-B[2]),!0}},4335:function(u){u.exports=function(r,n){var l=n[15];if(l===0)return!1;for(var o=1/l,s=0;s<16;s++)r[s]=n[s]*o;return!0}},7442:function(u,r,n){var l=n(6658),o=n(7182),s=n(2652),c=n(9921),h=n(8648),x=k(),m=k(),g=k();function k(){return{translate:A(),scale:A(1),skew:A(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function A(v){return[v||0,v||0,v||0]}u.exports=function(v,S,T,p){if(c(S)===0||c(T)===0)return!1;var M=s(S,x.translate,x.scale,x.skew,x.perspective,x.quaternion),f=s(T,m.translate,m.scale,m.skew,m.perspective,m.quaternion);return!(!M||!f||(l(g.translate,x.translate,m.translate,p),l(g.skew,x.skew,m.skew,p),l(g.scale,x.scale,m.scale,p),l(g.perspective,x.perspective,m.perspective,p),h(g.quaternion,x.quaternion,m.quaternion,p),o(v,g.translate,g.scale,g.skew,g.perspective,g.quaternion),0))}},7182:function(u,r,n){var l={identity:n(7894),translate:n(7656),multiply:n(6760),create:n(6864),scale:n(2504),fromRotationTranslation:n(6743)},o=(l.create(),l.create());u.exports=function(s,c,h,x,m,g){return l.identity(s),l.fromRotationTranslation(s,g,c),s[3]=m[0],s[7]=m[1],s[11]=m[2],s[15]=m[3],l.identity(o),x[2]!==0&&(o[9]=x[2],l.multiply(s,s,o)),x[1]!==0&&(o[9]=0,o[8]=x[1],l.multiply(s,s,o)),x[0]!==0&&(o[8]=0,o[4]=x[0],l.multiply(s,s,o)),l.scale(s,s,h),s}},4192:function(u,r,n){var l=n(2478),o=n(7442),s=n(7608),c=n(5567),h=n(2408),x=n(7089),m=n(6582),g=n(7656),k=(n(2504),n(3536)),A=[0,0,0];function v(p){this._components=p.slice(),this._time=[0],this.prevMatrix=p.slice(),this.nextMatrix=p.slice(),this.computedMatrix=p.slice(),this.computedInverse=p.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]}u.exports=function(p){return new v((p=p||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var S=v.prototype;S.recalcMatrix=function(p){var M=this._time,f=l.le(M,p),E=this.computedMatrix;if(!(f<0)){var I=this._components;if(f===M.length-1)for(var B=16*f,N=0;N<16;++N)E[N]=I[B++];else{var V=M[f+1]-M[f],j=(B=16*f,this.prevMatrix),$=!0;for(N=0;N<16;++N)j[N]=I[B++];var ee=this.nextMatrix;for(N=0;N<16;++N)ee[N]=I[B++],$=$&&j[N]===ee[N];if(V<1e-6||$)for(N=0;N<16;++N)E[N]=j[N];else o(E,j,ee,(p-M[f])/V)}var H=this.computedUp;H[0]=E[1],H[1]=E[5],H[2]=E[9],k(H,H);var J=this.computedInverse;s(J,E);var Q=this.computedEye,Z=J[15];Q[0]=J[12]/Z,Q[1]=J[13]/Z,Q[2]=J[14]/Z;var K=this.computedCenter,ae=Math.exp(this.computedRadius[0]);for(N=0;N<3;++N)K[N]=Q[N]-E[2+4*N]*ae}},S.idle=function(p){if(!(p1&&l(o[m[v-2]],o[m[v-1]],A)<=0;)v-=1,m.pop();for(m.push(k),v=g.length;v>1&&l(o[g[v-2]],o[g[v-1]],A)>=0;)v-=1,g.pop();g.push(k)}c=new Array(g.length+m.length-2);for(var S=0,T=(h=0,m.length);h0;--p)c[S++]=g[p];return c};var l=n(3250)[3]},351:function(u,r,n){u.exports=function(o,s){s||(s=o,o=window);var c=0,h=0,x=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;function k(B){var N=!1;return"altKey"in B&&(N=N||B.altKey!==m.alt,m.alt=!!B.altKey),"shiftKey"in B&&(N=N||B.shiftKey!==m.shift,m.shift=!!B.shiftKey),"ctrlKey"in B&&(N=N||B.ctrlKey!==m.control,m.control=!!B.ctrlKey),"metaKey"in B&&(N=N||B.metaKey!==m.meta,m.meta=!!B.metaKey),N}function A(B,N){var V=l.x(N),j=l.y(N);"buttons"in N&&(B=0|N.buttons),(B!==c||V!==h||j!==x||k(N))&&(c=0|B,h=V||0,x=j||0,s&&s(c,h,x,m))}function v(B){A(0,B)}function S(){(c||h||x||m.shift||m.alt||m.meta||m.control)&&(h=x=0,c=0,m.shift=m.alt=m.control=m.meta=!1,s&&s(0,0,0,m))}function T(B){k(B)&&s&&s(c,h,x,m)}function p(B){l.buttons(B)===0?A(0,B):A(c,B)}function M(B){A(c|l.buttons(B),B)}function f(B){A(c&~l.buttons(B),B)}function E(){g||(g=!0,o.addEventListener("mousemove",p),o.addEventListener("mousedown",M),o.addEventListener("mouseup",f),o.addEventListener("mouseleave",v),o.addEventListener("mouseenter",v),o.addEventListener("mouseout",v),o.addEventListener("mouseover",v),o.addEventListener("blur",S),o.addEventListener("keyup",T),o.addEventListener("keydown",T),o.addEventListener("keypress",T),o!==window&&(window.addEventListener("blur",S),window.addEventListener("keyup",T),window.addEventListener("keydown",T),window.addEventListener("keypress",T)))}E();var I={element:o};return Object.defineProperties(I,{enabled:{get:function(){return g},set:function(B){B?E():g&&(g=!1,o.removeEventListener("mousemove",p),o.removeEventListener("mousedown",M),o.removeEventListener("mouseup",f),o.removeEventListener("mouseleave",v),o.removeEventListener("mouseenter",v),o.removeEventListener("mouseout",v),o.removeEventListener("mouseover",v),o.removeEventListener("blur",S),o.removeEventListener("keyup",T),o.removeEventListener("keydown",T),o.removeEventListener("keypress",T),o!==window&&(window.removeEventListener("blur",S),window.removeEventListener("keyup",T),window.removeEventListener("keydown",T),window.removeEventListener("keypress",T)))},enumerable:!0},buttons:{get:function(){return c},enumerable:!0},x:{get:function(){return h},enumerable:!0},y:{get:function(){return x},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),I};var l=n(4687)},24:function(u){var r={left:0,top:0};u.exports=function(n,l,o){l=l||n.currentTarget||n.srcElement,Array.isArray(o)||(o=[0,0]);var s,c=n.clientX||0,h=n.clientY||0,x=(s=l)===window||s===document||s===document.body?r:s.getBoundingClientRect();return o[0]=c-x.left,o[1]=h-x.top,o}},4687:function(u,r){function n(l){return l.target||l.srcElement||window}r.buttons=function(l){if(typeof l=="object"){if("buttons"in l)return l.buttons;if("which"in l){if((o=l.which)===2)return 4;if(o===3)return 2;if(o>0)return 1<=0)return 1< 0"),typeof s.vertex!="function"&&c("Must specify vertex creation function"),typeof s.cell!="function"&&c("Must specify cell creation function"),typeof s.phase!="function"&&c("Must specify phase function");for(var m=s.getters||[],g=new Array(x),k=0;k=0?g[k]=!0:g[k]=!1;return function(A,v,S,T,p,M){var f=[M,p].join(",");return(0,o[f])(A,v,S,l.mallocUint32,l.freeUint32)}(s.vertex,s.cell,s.phase,0,h,g)};var o={"false,0,1":function(s,c,h,x,m){return function(g,k,A,v){var S,T=0|g.shape[0],p=0|g.shape[1],M=g.data,f=0|g.offset,E=0|g.stride[0],I=0|g.stride[1],B=f,N=0|-E,V=0,j=0|-I,$=0,ee=-E-I|0,H=0,J=0|E,Q=I-E*T|0,Z=0,K=0,ae=0,se=2*T|0,he=x(se),fe=x(se),ie=0,oe=0,le=-1,ge=-1,ye=0,me=0|-T,be=0|T,Se=0,Ee=-T-1|0,Ce=T-1|0,Le=0,Oe=0,We=0;for(Z=0;Z0){if(K=1,he[ie++]=h(M[B],k,A,v),B+=J,T>0)for(Z=1,S=M[B],oe=he[ie]=h(S,k,A,v),ye=he[ie+le],Se=he[ie+me],Le=he[ie+Ee],oe===ye&&oe===Se&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,ye,Se,Le,k,A,v),Oe=fe[ie]=ae++),ie+=1,B+=J,Z=2;Z0)for(Z=1,S=M[B],oe=he[ie]=h(S,k,A,v),ye=he[ie+le],Se=he[ie+me],Le=he[ie+Ee],oe===ye&&oe===Se&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,ye,Se,Le,k,A,v),Oe=fe[ie]=ae++,Le!==Se&&c(fe[ie+me],Oe,$,H,Se,Le,k,A,v)),ie+=1,B+=J,Z=2;Z0){if(Z=1,he[ie++]=h(M[B],k,A,v),B+=J,p>0)for(K=1,S=M[B],oe=he[ie]=h(S,k,A,v),Se=he[ie+me],ye=he[ie+le],Le=he[ie+Ee],oe===Se&&oe===ye&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,Se,ye,Le,k,A,v),Oe=fe[ie]=ae++),ie+=1,B+=J,K=2;K0)for(K=1,S=M[B],oe=he[ie]=h(S,k,A,v),Se=he[ie+me],ye=he[ie+le],Le=he[ie+Ee],oe===Se&&oe===ye&&oe===Le||(V=M[B+N],$=M[B+j],H=M[B+ee],s(Z,K,S,V,$,H,oe,Se,ye,Le,k,A,v),Oe=fe[ie]=ae++,Le!==Se&&c(fe[ie+me],Oe,H,V,Le,Se,k,A,v)),ie+=1,B+=J,K=2;K2&&B[1]>2&&f(I.pick(-1,-1).lo(1,1).hi(B[0]-2,B[1]-2),E.pick(-1,-1,0).lo(1,1).hi(B[0]-2,B[1]-2),E.pick(-1,-1,1).lo(1,1).hi(B[0]-2,B[1]-2)),B[1]>2&&(M(I.pick(0,-1).lo(1).hi(B[1]-2),E.pick(0,-1,1).lo(1).hi(B[1]-2)),p(E.pick(0,-1,0).lo(1).hi(B[1]-2))),B[1]>2&&(M(I.pick(B[0]-1,-1).lo(1).hi(B[1]-2),E.pick(B[0]-1,-1,1).lo(1).hi(B[1]-2)),p(E.pick(B[0]-1,-1,0).lo(1).hi(B[1]-2))),B[0]>2&&(M(I.pick(-1,0).lo(1).hi(B[0]-2),E.pick(-1,0,0).lo(1).hi(B[0]-2)),p(E.pick(-1,0,1).lo(1).hi(B[0]-2))),B[0]>2&&(M(I.pick(-1,B[1]-1).lo(1).hi(B[0]-2),E.pick(-1,B[1]-1,0).lo(1).hi(B[0]-2)),p(E.pick(-1,B[1]-1,1).lo(1).hi(B[0]-2))),E.set(0,0,0,0),E.set(0,0,1,0),E.set(B[0]-1,0,0,0),E.set(B[0]-1,0,1,0),E.set(0,B[1]-1,0,0),E.set(0,B[1]-1,1,0),E.set(B[0]-1,B[1]-1,0,0),E.set(B[0]-1,B[1]-1,1,0),E}}u.exports=function(T,p,M){return Array.isArray(M)||(M=l(p.dimension,typeof M=="string"?M:"clamp")),p.size===0?T:p.dimension===0?(T.set(0),T):function(f){var E=f.join();if(V=g[E])return V;for(var I=f.length,B=[k,A],N=1;N<=I;++N)B.push(v(N));var V=S.apply(void 0,B);return g[E]=V,V}(M)(T,p)}},4317:function(u){function r(s,c){var h=Math.floor(c),x=c-h,m=0<=h&&h0;){ee<64?(T=ee,ee=0):(T=64,ee-=64);for(var H=0|h[1];H>0;){H<64?(p=H,H=0):(p=64,H-=64),g=j+ee*f+H*E,v=$+ee*B+H*N;var J=0,Q=0,Z=0,K=I,ae=f-M*I,se=E-T*f,he=V,fe=B-M*V,ie=N-T*B;for(Z=0;Z0;){N<64?(T=N,N=0):(T=64,N-=64);for(var V=0|h[0];V>0;){V<64?(S=V,V=0):(S=64,V-=64),g=I+N*M+V*p,v=B+N*E+V*f;var j=0,$=0,ee=M,H=p-T*M,J=E,Q=f-T*E;for($=0;$0;){$<64?(p=$,$=0):(p=64,$-=64);for(var ee=0|h[0];ee>0;){ee<64?(S=ee,ee=0):(S=64,ee-=64);for(var H=0|h[1];H>0;){H<64?(T=H,H=0):(T=64,H-=64),g=V+$*E+ee*M+H*f,v=j+$*N+ee*I+H*B;var J=0,Q=0,Z=0,K=E,ae=M-p*E,se=f-S*M,he=N,fe=I-p*N,ie=B-S*I;for(Z=0;Zg;){$=0,ee=V-S;t:for(j=0;jJ)break t;ee+=E,$+=I}for($=V,ee=V-S,j=0;j>1,de=Pe-We,Me=Pe+We,ke=Ie,He=de,Fe=Pe,qe=Me,$e=Ve,Ye=A+1,_e=v-1,De=!0,Be=0,Ge=0,tt=0,nt=E,ft=m(nt),At=m(nt);se=p*ke,he=p*He,Oe=T;e:for(ae=0;ae0){j=ke,ke=He,He=j;break e}if(tt<0)break e;Oe+=B}se=p*qe,he=p*$e,Oe=T;e:for(ae=0;ae0){j=qe,qe=$e,$e=j;break e}if(tt<0)break e;Oe+=B}se=p*ke,he=p*Fe,Oe=T;e:for(ae=0;ae0){j=ke,ke=Fe,Fe=j;break e}if(tt<0)break e;Oe+=B}se=p*He,he=p*Fe,Oe=T;e:for(ae=0;ae0){j=He,He=Fe,Fe=j;break e}if(tt<0)break e;Oe+=B}se=p*ke,he=p*qe,Oe=T;e:for(ae=0;ae0){j=ke,ke=qe,qe=j;break e}if(tt<0)break e;Oe+=B}se=p*Fe,he=p*qe,Oe=T;e:for(ae=0;ae0){j=Fe,Fe=qe,qe=j;break e}if(tt<0)break e;Oe+=B}se=p*He,he=p*$e,Oe=T;e:for(ae=0;ae0){j=He,He=$e,$e=j;break e}if(tt<0)break e;Oe+=B}se=p*He,he=p*Fe,Oe=T;e:for(ae=0;ae0){j=He,He=Fe,Fe=j;break e}if(tt<0)break e;Oe+=B}se=p*qe,he=p*$e,Oe=T;e:for(ae=0;ae0){j=qe,qe=$e,$e=j;break e}if(tt<0)break e;Oe+=B}for(se=p*ke,he=p*He,fe=p*Fe,ie=p*qe,oe=p*$e,le=p*Ie,ge=p*Pe,ye=p*Ve,Le=0,Oe=T,ae=0;ae0)){if(tt<0){for(se=p*J,he=p*Ye,fe=p*_e,Oe=T,ae=0;ae0)for(;;){for(Q=T+_e*p,Le=0,ae=0;ae0)){for(Q=T+_e*p,Le=0,ae=0;aeVe){e:for(;;){for(Q=T+Ye*p,Le=0,Oe=T,ae=0;ae1&&M?E(p,M[0],M[1]):E(p)}(x,m,A);return k(A,v)}},446:function(u,r,n){var l=n(7640),o={};u.exports=function(s){var c=s.order,h=s.dtype,x=[c,h].join(":"),m=o[x];return m||(o[x]=m=l(c,h)),m(s),s}},9618:function(u,r,n){var l=n(7163),o=typeof Float64Array<"u";function s(g,k){return g[0]-k[0]}function c(){var g,k=this.stride,A=new Array(k.length);for(g=0;g=0&&(p+=E*(M=0|T),f-=M),new v(this.data,f,E,p)},S.step=function(T){var p=this.shape[0],M=this.stride[0],f=this.offset,E=0,I=Math.ceil;return typeof T=="number"&&((E=0|T)<0?(f+=M*(p-1),p=I(-p/E)):p=I(p/E),M*=E),new v(this.data,p,M,f)},S.transpose=function(T){T=T===void 0?0:0|T;var p=this.shape,M=this.stride;return new v(this.data,p[T],M[T],this.offset)},S.pick=function(T){var p=[],M=[],f=this.offset;return typeof T=="number"&&T>=0?f=f+this.stride[0]*T|0:(p.push(this.shape[0]),M.push(this.stride[0])),(0,k[p.length+1])(this.data,p,M,f)},function(T,p,M,f){return new v(T,p[0],M[0],f)}},2:function(g,k,A){function v(T,p,M,f,E,I){this.data=T,this.shape=[p,M],this.stride=[f,E],this.offset=0|I}var S=v.prototype;return S.dtype=g,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(T,p,M){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p,M):this.data[this.offset+this.stride[0]*T+this.stride[1]*p]=M},S.get=function(T,p){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p):this.data[this.offset+this.stride[0]*T+this.stride[1]*p]},S.index=function(T,p){return this.offset+this.stride[0]*T+this.stride[1]*p},S.hi=function(T,p){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,this.stride[0],this.stride[1],this.offset)},S.lo=function(T,p){var M=this.offset,f=0,E=this.shape[0],I=this.shape[1],B=this.stride[0],N=this.stride[1];return typeof T=="number"&&T>=0&&(M+=B*(f=0|T),E-=f),typeof p=="number"&&p>=0&&(M+=N*(f=0|p),I-=f),new v(this.data,E,I,B,N,M)},S.step=function(T,p){var M=this.shape[0],f=this.shape[1],E=this.stride[0],I=this.stride[1],B=this.offset,N=0,V=Math.ceil;return typeof T=="number"&&((N=0|T)<0?(B+=E*(M-1),M=V(-M/N)):M=V(M/N),E*=N),typeof p=="number"&&((N=0|p)<0?(B+=I*(f-1),f=V(-f/N)):f=V(f/N),I*=N),new v(this.data,M,f,E,I,B)},S.transpose=function(T,p){T=T===void 0?0:0|T,p=p===void 0?1:0|p;var M=this.shape,f=this.stride;return new v(this.data,M[T],M[p],f[T],f[p],this.offset)},S.pick=function(T,p){var M=[],f=[],E=this.offset;return typeof T=="number"&&T>=0?E=E+this.stride[0]*T|0:(M.push(this.shape[0]),f.push(this.stride[0])),typeof p=="number"&&p>=0?E=E+this.stride[1]*p|0:(M.push(this.shape[1]),f.push(this.stride[1])),(0,k[M.length+1])(this.data,M,f,E)},function(T,p,M,f){return new v(T,p[0],p[1],M[0],M[1],f)}},3:function(g,k,A){function v(T,p,M,f,E,I,B,N){this.data=T,this.shape=[p,M,f],this.stride=[E,I,B],this.offset=0|N}var S=v.prototype;return S.dtype=g,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var T=Math.abs(this.stride[0]),p=Math.abs(this.stride[1]),M=Math.abs(this.stride[2]);return T>p?p>M?[2,1,0]:T>M?[1,2,0]:[1,0,2]:T>M?[2,0,1]:M>p?[0,1,2]:[0,2,1]}}),S.set=function(T,p,M,f){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M,f):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M]=f},S.get=function(T,p,M){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M]},S.index=function(T,p,M){return this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M},S.hi=function(T,p,M){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,typeof M!="number"||M<0?this.shape[2]:0|M,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(T,p,M){var f=this.offset,E=0,I=this.shape[0],B=this.shape[1],N=this.shape[2],V=this.stride[0],j=this.stride[1],$=this.stride[2];return typeof T=="number"&&T>=0&&(f+=V*(E=0|T),I-=E),typeof p=="number"&&p>=0&&(f+=j*(E=0|p),B-=E),typeof M=="number"&&M>=0&&(f+=$*(E=0|M),N-=E),new v(this.data,I,B,N,V,j,$,f)},S.step=function(T,p,M){var f=this.shape[0],E=this.shape[1],I=this.shape[2],B=this.stride[0],N=this.stride[1],V=this.stride[2],j=this.offset,$=0,ee=Math.ceil;return typeof T=="number"&&(($=0|T)<0?(j+=B*(f-1),f=ee(-f/$)):f=ee(f/$),B*=$),typeof p=="number"&&(($=0|p)<0?(j+=N*(E-1),E=ee(-E/$)):E=ee(E/$),N*=$),typeof M=="number"&&(($=0|M)<0?(j+=V*(I-1),I=ee(-I/$)):I=ee(I/$),V*=$),new v(this.data,f,E,I,B,N,V,j)},S.transpose=function(T,p,M){T=T===void 0?0:0|T,p=p===void 0?1:0|p,M=M===void 0?2:0|M;var f=this.shape,E=this.stride;return new v(this.data,f[T],f[p],f[M],E[T],E[p],E[M],this.offset)},S.pick=function(T,p,M){var f=[],E=[],I=this.offset;return typeof T=="number"&&T>=0?I=I+this.stride[0]*T|0:(f.push(this.shape[0]),E.push(this.stride[0])),typeof p=="number"&&p>=0?I=I+this.stride[1]*p|0:(f.push(this.shape[1]),E.push(this.stride[1])),typeof M=="number"&&M>=0?I=I+this.stride[2]*M|0:(f.push(this.shape[2]),E.push(this.stride[2])),(0,k[f.length+1])(this.data,f,E,I)},function(T,p,M,f){return new v(T,p[0],p[1],p[2],M[0],M[1],M[2],f)}},4:function(g,k,A){function v(T,p,M,f,E,I,B,N,V,j){this.data=T,this.shape=[p,M,f,E],this.stride=[I,B,N,V],this.offset=0|j}var S=v.prototype;return S.dtype=g,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:A}),S.set=function(T,p,M,f,E){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f,E):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f]=E},S.get=function(T,p,M,f){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f]},S.index=function(T,p,M,f){return this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f},S.hi=function(T,p,M,f){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,typeof M!="number"||M<0?this.shape[2]:0|M,typeof f!="number"||f<0?this.shape[3]:0|f,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(T,p,M,f){var E=this.offset,I=0,B=this.shape[0],N=this.shape[1],V=this.shape[2],j=this.shape[3],$=this.stride[0],ee=this.stride[1],H=this.stride[2],J=this.stride[3];return typeof T=="number"&&T>=0&&(E+=$*(I=0|T),B-=I),typeof p=="number"&&p>=0&&(E+=ee*(I=0|p),N-=I),typeof M=="number"&&M>=0&&(E+=H*(I=0|M),V-=I),typeof f=="number"&&f>=0&&(E+=J*(I=0|f),j-=I),new v(this.data,B,N,V,j,$,ee,H,J,E)},S.step=function(T,p,M,f){var E=this.shape[0],I=this.shape[1],B=this.shape[2],N=this.shape[3],V=this.stride[0],j=this.stride[1],$=this.stride[2],ee=this.stride[3],H=this.offset,J=0,Q=Math.ceil;return typeof T=="number"&&((J=0|T)<0?(H+=V*(E-1),E=Q(-E/J)):E=Q(E/J),V*=J),typeof p=="number"&&((J=0|p)<0?(H+=j*(I-1),I=Q(-I/J)):I=Q(I/J),j*=J),typeof M=="number"&&((J=0|M)<0?(H+=$*(B-1),B=Q(-B/J)):B=Q(B/J),$*=J),typeof f=="number"&&((J=0|f)<0?(H+=ee*(N-1),N=Q(-N/J)):N=Q(N/J),ee*=J),new v(this.data,E,I,B,N,V,j,$,ee,H)},S.transpose=function(T,p,M,f){T=T===void 0?0:0|T,p=p===void 0?1:0|p,M=M===void 0?2:0|M,f=f===void 0?3:0|f;var E=this.shape,I=this.stride;return new v(this.data,E[T],E[p],E[M],E[f],I[T],I[p],I[M],I[f],this.offset)},S.pick=function(T,p,M,f){var E=[],I=[],B=this.offset;return typeof T=="number"&&T>=0?B=B+this.stride[0]*T|0:(E.push(this.shape[0]),I.push(this.stride[0])),typeof p=="number"&&p>=0?B=B+this.stride[1]*p|0:(E.push(this.shape[1]),I.push(this.stride[1])),typeof M=="number"&&M>=0?B=B+this.stride[2]*M|0:(E.push(this.shape[2]),I.push(this.stride[2])),typeof f=="number"&&f>=0?B=B+this.stride[3]*f|0:(E.push(this.shape[3]),I.push(this.stride[3])),(0,k[E.length+1])(this.data,E,I,B)},function(T,p,M,f){return new v(T,p[0],p[1],p[2],p[3],M[0],M[1],M[2],M[3],f)}},5:function(g,k,A){function v(T,p,M,f,E,I,B,N,V,j,$,ee){this.data=T,this.shape=[p,M,f,E,I],this.stride=[B,N,V,j,$],this.offset=0|ee}var S=v.prototype;return S.dtype=g,S.dimension=5,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(S,"order",{get:A}),S.set=function(T,p,M,f,E,I){return g==="generic"?this.data.set(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E,I):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E]=I},S.get=function(T,p,M,f,E){return g==="generic"?this.data.get(this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E):this.data[this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E]},S.index=function(T,p,M,f,E){return this.offset+this.stride[0]*T+this.stride[1]*p+this.stride[2]*M+this.stride[3]*f+this.stride[4]*E},S.hi=function(T,p,M,f,E){return new v(this.data,typeof T!="number"||T<0?this.shape[0]:0|T,typeof p!="number"||p<0?this.shape[1]:0|p,typeof M!="number"||M<0?this.shape[2]:0|M,typeof f!="number"||f<0?this.shape[3]:0|f,typeof E!="number"||E<0?this.shape[4]:0|E,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},S.lo=function(T,p,M,f,E){var I=this.offset,B=0,N=this.shape[0],V=this.shape[1],j=this.shape[2],$=this.shape[3],ee=this.shape[4],H=this.stride[0],J=this.stride[1],Q=this.stride[2],Z=this.stride[3],K=this.stride[4];return typeof T=="number"&&T>=0&&(I+=H*(B=0|T),N-=B),typeof p=="number"&&p>=0&&(I+=J*(B=0|p),V-=B),typeof M=="number"&&M>=0&&(I+=Q*(B=0|M),j-=B),typeof f=="number"&&f>=0&&(I+=Z*(B=0|f),$-=B),typeof E=="number"&&E>=0&&(I+=K*(B=0|E),ee-=B),new v(this.data,N,V,j,$,ee,H,J,Q,Z,K,I)},S.step=function(T,p,M,f,E){var I=this.shape[0],B=this.shape[1],N=this.shape[2],V=this.shape[3],j=this.shape[4],$=this.stride[0],ee=this.stride[1],H=this.stride[2],J=this.stride[3],Q=this.stride[4],Z=this.offset,K=0,ae=Math.ceil;return typeof T=="number"&&((K=0|T)<0?(Z+=$*(I-1),I=ae(-I/K)):I=ae(I/K),$*=K),typeof p=="number"&&((K=0|p)<0?(Z+=ee*(B-1),B=ae(-B/K)):B=ae(B/K),ee*=K),typeof M=="number"&&((K=0|M)<0?(Z+=H*(N-1),N=ae(-N/K)):N=ae(N/K),H*=K),typeof f=="number"&&((K=0|f)<0?(Z+=J*(V-1),V=ae(-V/K)):V=ae(V/K),J*=K),typeof E=="number"&&((K=0|E)<0?(Z+=Q*(j-1),j=ae(-j/K)):j=ae(j/K),Q*=K),new v(this.data,I,B,N,V,j,$,ee,H,J,Q,Z)},S.transpose=function(T,p,M,f,E){T=T===void 0?0:0|T,p=p===void 0?1:0|p,M=M===void 0?2:0|M,f=f===void 0?3:0|f,E=E===void 0?4:0|E;var I=this.shape,B=this.stride;return new v(this.data,I[T],I[p],I[M],I[f],I[E],B[T],B[p],B[M],B[f],B[E],this.offset)},S.pick=function(T,p,M,f,E){var I=[],B=[],N=this.offset;return typeof T=="number"&&T>=0?N=N+this.stride[0]*T|0:(I.push(this.shape[0]),B.push(this.stride[0])),typeof p=="number"&&p>=0?N=N+this.stride[1]*p|0:(I.push(this.shape[1]),B.push(this.stride[1])),typeof M=="number"&&M>=0?N=N+this.stride[2]*M|0:(I.push(this.shape[2]),B.push(this.stride[2])),typeof f=="number"&&f>=0?N=N+this.stride[3]*f|0:(I.push(this.shape[3]),B.push(this.stride[3])),typeof E=="number"&&E>=0?N=N+this.stride[4]*E|0:(I.push(this.shape[4]),B.push(this.stride[4])),(0,k[I.length+1])(this.data,I,B,N)},function(T,p,M,f){return new v(T,p[0],p[1],p[2],p[3],p[4],M[0],M[1],M[2],M[3],M[4],f)}}};function x(g,k){var A=k===-1?"T":String(k),v=h[A];return k===-1?v(g):k===0?v(g,m[g][0]):v(g,m[g],c)}var m={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};u.exports=function(g,k,A,v){if(g===void 0)return(0,m.array[0])([]);typeof g=="number"&&(g=[g]),k===void 0&&(k=[g.length]);var S=k.length;if(A===void 0){A=new Array(S);for(var T=S-1,p=1;T>=0;--T)A[T]=p,p*=k[T]}if(v===void 0)for(v=0,T=0;T>>0;u.exports=function(c,h){if(isNaN(c)||isNaN(h))return NaN;if(c===h)return c;if(c===0)return h<0?-o:o;var x=l.hi(c),m=l.lo(c);return h>c==c>0?m===s?(x+=1,m=0):m+=1:m===0?(m=s,x-=1):m-=1,l.pack(m,x)}},8406:function(u,r){r.vertexNormals=function(n,l,o){for(var s=l.length,c=new Array(s),h=o===void 0?1e-6:o,x=0;xh){var N=c[k],V=1/Math.sqrt(f*I);for(B=0;B<3;++B){var j=(B+1)%3,$=(B+2)%3;N[B]+=V*(E[j]*M[$]-E[$]*M[j])}}}for(x=0;xh)for(V=1/Math.sqrt(ee),B=0;B<3;++B)N[B]*=V;else for(B=0;B<3;++B)N[B]=0}return c},r.faceNormals=function(n,l,o){for(var s=n.length,c=new Array(s),h=o===void 0?1e-6:o,x=0;xh?1/Math.sqrt(T):0,k=0;k<3;++k)S[k]*=T;c[x]=S}return c}},4081:function(u){u.exports=function(r,n,l,o,s,c,h,x,m,g){var k=n+c+g;if(A>0){var A=Math.sqrt(k+1);r[0]=.5*(h-m)/A,r[1]=.5*(x-o)/A,r[2]=.5*(l-c)/A,r[3]=.5*A}else{var v=Math.max(n,c,g);A=Math.sqrt(2*v-k+1),n>=v?(r[0]=.5*A,r[1]=.5*(s+l)/A,r[2]=.5*(x+o)/A,r[3]=.5*(h-m)/A):c>=v?(r[0]=.5*(l+s)/A,r[1]=.5*A,r[2]=.5*(m+h)/A,r[3]=.5*(x-o)/A):(r[0]=.5*(o+x)/A,r[1]=.5*(h+m)/A,r[2]=.5*A,r[3]=.5*(l-s)/A)}return r}},9977:function(u,r,n){u.exports=function(v){var S=(v=v||{}).center||[0,0,0],T=v.rotation||[0,0,0,1],p=v.radius||1;S=[].slice.call(S,0,3),g(T=[].slice.call(T,0,4),T);var M=new k(T,S,Math.log(p));return M.setDistanceLimits(v.zoomMin,v.zoomMax),("eye"in v||"up"in v)&&M.lookAt(0,v.eye,v.center,v.up),M};var l=n(9215),o=n(6582),s=n(7399),c=n(7608),h=n(4081);function x(v,S,T){return Math.sqrt(Math.pow(v,2)+Math.pow(S,2)+Math.pow(T,2))}function m(v,S,T,p){return Math.sqrt(Math.pow(v,2)+Math.pow(S,2)+Math.pow(T,2)+Math.pow(p,2))}function g(v,S){var T=S[0],p=S[1],M=S[2],f=S[3],E=m(T,p,M,f);E>1e-6?(v[0]=T/E,v[1]=p/E,v[2]=M/E,v[3]=f/E):(v[0]=v[1]=v[2]=0,v[3]=1)}function k(v,S,T){this.radius=l([T]),this.center=l(S),this.rotation=l(v),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 A=k.prototype;A.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},A.recalcMatrix=function(v){this.radius.curve(v),this.center.curve(v),this.rotation.curve(v);var S=this.computedRotation;g(S,S);var T=this.computedMatrix;s(T,S);var p=this.computedCenter,M=this.computedEye,f=this.computedUp,E=Math.exp(this.computedRadius[0]);M[0]=p[0]+E*T[2],M[1]=p[1]+E*T[6],M[2]=p[2]+E*T[10],f[0]=T[1],f[1]=T[5],f[2]=T[9];for(var I=0;I<3;++I){for(var B=0,N=0;N<3;++N)B+=T[I+4*N]*M[N];T[12+I]=-B}},A.getMatrix=function(v,S){this.recalcMatrix(v);var T=this.computedMatrix;if(S){for(var p=0;p<16;++p)S[p]=T[p];return S}return T},A.idle=function(v){this.center.idle(v),this.radius.idle(v),this.rotation.idle(v)},A.flush=function(v){this.center.flush(v),this.radius.flush(v),this.rotation.flush(v)},A.pan=function(v,S,T,p){S=S||0,T=T||0,p=p||0,this.recalcMatrix(v);var M=this.computedMatrix,f=M[1],E=M[5],I=M[9],B=x(f,E,I);f/=B,E/=B,I/=B;var N=M[0],V=M[4],j=M[8],$=N*f+V*E+j*I,ee=x(N-=f*$,V-=E*$,j-=I*$);N/=ee,V/=ee,j/=ee,M[2],M[6],M[10];var H=N*S+f*T,J=V*S+E*T,Q=j*S+I*T;this.center.move(v,H,J,Q);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+p),this.radius.set(v,Math.log(Z))},A.rotate=function(v,S,T,p){this.recalcMatrix(v),S=S||0,T=T||0;var M=this.computedMatrix,f=M[0],E=M[4],I=M[8],B=M[1],N=M[5],V=M[9],j=M[2],$=M[6],ee=M[10],H=S*f+T*B,J=S*E+T*N,Q=S*I+T*V,Z=-($*Q-ee*J),K=-(ee*H-j*Q),ae=-(j*J-$*H),se=Math.sqrt(Math.max(0,1-Math.pow(Z,2)-Math.pow(K,2)-Math.pow(ae,2))),he=m(Z,K,ae,se);he>1e-6?(Z/=he,K/=he,ae/=he,se/=he):(Z=K=ae=0,se=1);var fe=this.computedRotation,ie=fe[0],oe=fe[1],le=fe[2],ge=fe[3],ye=ie*se+ge*Z+oe*ae-le*K,me=oe*se+ge*K+le*Z-ie*ae,be=le*se+ge*ae+ie*K-oe*Z,Se=ge*se-ie*Z-oe*K-le*ae;if(p){Z=j,K=$,ae=ee;var Ee=Math.sin(p)/x(Z,K,ae);Z*=Ee,K*=Ee,ae*=Ee,Se=Se*(se=Math.cos(S))-(ye=ye*se+Se*Z+me*ae-be*K)*Z-(me=me*se+Se*K+be*Z-ye*ae)*K-(be=be*se+Se*ae+ye*K-me*Z)*ae}var Ce=m(ye,me,be,Se);Ce>1e-6?(ye/=Ce,me/=Ce,be/=Ce,Se/=Ce):(ye=me=be=0,Se=1),this.rotation.set(v,ye,me,be,Se)},A.lookAt=function(v,S,T,p){this.recalcMatrix(v),T=T||this.computedCenter,S=S||this.computedEye,p=p||this.computedUp;var M=this.computedMatrix;o(M,S,T,p);var f=this.computedRotation;h(f,M[0],M[1],M[2],M[4],M[5],M[6],M[8],M[9],M[10]),g(f,f),this.rotation.set(v,f[0],f[1],f[2],f[3]);for(var E=0,I=0;I<3;++I)E+=Math.pow(T[I]-S[I],2);this.radius.set(v,.5*Math.log(Math.max(E,1e-6))),this.center.set(v,T[0],T[1],T[2])},A.translate=function(v,S,T,p){this.center.move(v,S||0,T||0,p||0)},A.setMatrix=function(v,S){var T=this.computedRotation;h(T,S[0],S[1],S[2],S[4],S[5],S[6],S[8],S[9],S[10]),g(T,T),this.rotation.set(v,T[0],T[1],T[2],T[3]);var p=this.computedMatrix;c(p,S);var M=p[15];if(Math.abs(M)>1e-6){var f=p[12]/M,E=p[13]/M,I=p[14]/M;this.recalcMatrix(v);var B=Math.exp(this.computedRadius[0]);this.center.set(v,f-p[2]*B,E-p[6]*B,I-p[10]*B),this.radius.idle(v)}else this.center.idle(v),this.radius.idle(v)},A.setDistance=function(v,S){S>0&&this.radius.set(v,Math.log(S))},A.setDistanceLimits=function(v,S){v=v>0?Math.log(v):-1/0,S=S>0?Math.log(S):1/0,S=Math.max(S,v),this.radius.bounds[0][0]=v,this.radius.bounds[1][0]=S},A.getDistanceLimits=function(v){var S=this.radius.bounds;return v?(v[0]=Math.exp(S[0][0]),v[1]=Math.exp(S[1][0]),v):[Math.exp(S[0][0]),Math.exp(S[1][0])]},A.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]}},A.fromJSON=function(v){var S=this.lastT(),T=v.center;T&&this.center.set(S,T[0],T[1],T[2]);var p=v.rotation;p&&this.rotation.set(S,p[0],p[1],p[2],p[3]);var M=v.distance;M&&M>0&&this.radius.set(S,Math.log(M)),this.setDistanceLimits(v.zoomMin,v.zoomMax)}},1371:function(u,r,n){var l=n(3233);u.exports=function(o,s,c){return l(c=c!==void 0?c+"":" ",s)+o}},3202:function(u){u.exports=function(r,n){n||(n=[0,""]),r=String(r);var l=parseFloat(r,10);return n[0]=l,n[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",n}},3088:function(u,r,n){u.exports=function(o,s){for(var c=0|s.length,h=o.length,x=[new Array(c),new Array(c)],m=0;m0){N=x[$][I][0],j=$;break}V=N[1^j];for(var ee=0;ee<2;++ee)for(var H=x[ee][I],J=0;J0&&(N=Q,V=Z,j=ee)}return B||N&&A(N,j),V}function S(E,I){var B=x[I][E][0],N=[E];A(B,I);for(var V=B[1^I];;){for(;V!==E;)N.push(V),V=v(N[N.length-2],V,!1);if(x[0][E].length+x[1][E].length===0)break;var j=N[N.length-1],$=E,ee=N[1],H=v(j,$,!0);if(l(s[j],s[$],s[ee],s[H])<0)break;N.push(E),V=v(j,$)}return N}function T(E,I){return I[1]===I[I.length-1]}for(m=0;m0;){x[0][m].length;var f=S(m,p);T(0,f)?M.push.apply(M,f):(M.length>0&&k.push(M),M=f)}M.length>0&&k.push(M)}return k};var l=n(3140)},5609:function(u,r,n){u.exports=function(o,s){for(var c=l(o,s.length),h=new Array(s.length),x=new Array(s.length),m=[],g=0;g0;){h[p=m.pop()]=!1;var A=c[p];for(g=0;g0})).length,E=new Array(f),I=new Array(f);for(p=0;p0;){var me=ge.pop(),be=K[me];x(be,function(We,Ie){return We-Ie});var Se,Ee=be.length,Ce=ye[me];for(Ce===0&&(Se=[Le=M[me]]),p=0;p=0||(ye[Oe]=1^Ce,ge.push(Oe),Ce===0&&(le(Le=M[Oe])||(Le.reverse(),Se.push(Le))))}Ce===0&&v.push(Se)}return v};var l=n(3134),o=n(3088),s=n(5085),c=n(5250),h=n(8210),x=n(1682),m=n(5609);function g(k,A){for(var v=new Array(k),S=0;S0&&$[H]===ee[0]))return 1;J=j[H-1]}for(var Q=1;J;){var Z=J.key,K=l(ee,Z[0],Z[1]);if(Z[0][0]0))return 0;Q=-1,J=J.right}else if(K>0)J=J.left;else{if(!(K<0))return 0;Q=1,J=J.right}}return Q}}(N.slabs,N.coordinates);return v.length===0?V:function(j,$){return function(ee){return j(ee[0],ee[1])?0:$(ee)}}(x(v),V)};var l=n(3250)[3],o=n(4209),s=n(3352),c=n(2478);function h(){return!0}function x(g){for(var k={},A=0;A=g?($=1,E=g+2*v+T):E=v*($=-v/g)+T):($=0,S>=0?(ee=0,E=T):-S>=A?(ee=1,E=A+2*S+T):E=S*(ee=-S/A)+T);else if(ee<0)ee=0,v>=0?($=0,E=T):-v>=g?($=1,E=g+2*v+T):E=v*($=-v/g)+T;else{var H=1/j;E=($*=H)*(g*$+k*(ee*=H)+2*v)+ee*(k*$+A*ee+2*S)+T}else $<0?(B=A+S)>(I=k+v)?(N=B-I)>=(V=g-2*k+A)?($=1,ee=0,E=g+2*v+T):E=($=N/V)*(g*$+k*(ee=1-$)+2*v)+ee*(k*$+A*ee+2*S)+T:($=0,B<=0?(ee=1,E=A+2*S+T):S>=0?(ee=0,E=T):E=S*(ee=-S/A)+T):ee<0?(B=g+v)>(I=k+S)?(N=B-I)>=(V=g-2*k+A)?(ee=1,$=0,E=A+2*S+T):E=($=1-(ee=N/V))*(g*$+k*ee+2*v)+ee*(k*$+A*ee+2*S)+T:(ee=0,B<=0?($=1,E=g+2*v+T):v>=0?($=0,E=T):E=v*($=-v/g)+T):(N=A+S-k-v)<=0?($=0,ee=1,E=A+2*S+T):N>=(V=g-2*k+A)?($=1,ee=0,E=g+2*v+T):E=($=N/V)*(g*$+k*(ee=1-$)+2*v)+ee*(k*$+A*ee+2*S)+T;var J=1-$-ee;for(m=0;m0){var A=c[x-1];if(l(g,A)===0&&s(A)!==k){x-=1;continue}}c[x++]=g}}return c.length=x,c}},3233:function(u){var r,n="";u.exports=function(l,o){if(typeof l!="string")throw new TypeError("expected a string");if(o===1)return l;if(o===2)return l+l;var s=l.length*o;if(r!==l||r===void 0)r=l,n="";else if(n.length>=s)return n.substr(0,s);for(;s>n.length&&o>1;)1&o&&(n+=l),o>>=1,l+=l;return n=(n+=l).substr(0,s)}},3025:function(u,r,n){u.exports=n.g.performance&&n.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(u){u.exports=function(r){for(var n=r.length,l=r[r.length-1],o=n,s=n-2;s>=0;--s){var c=l;(m=(x=r[s])-((l=c+x)-c))&&(r[--o]=l,l=m)}var h=0;for(s=o;s0){if(B<=0)return N;E=I+B}else{if(!(I<0)||B>=0)return N;E=-(I+B)}var V=33306690738754716e-32*E;return N>=V||N<=-V?N:k(p,M,f)},function(p,M,f,E){var I=p[0]-E[0],B=M[0]-E[0],N=f[0]-E[0],V=p[1]-E[1],j=M[1]-E[1],$=f[1]-E[1],ee=p[2]-E[2],H=M[2]-E[2],J=f[2]-E[2],Q=B*$,Z=N*j,K=N*V,ae=I*$,se=I*j,he=B*V,fe=ee*(Q-Z)+H*(K-ae)+J*(se-he),ie=7771561172376103e-31*((Math.abs(Q)+Math.abs(Z))*Math.abs(ee)+(Math.abs(K)+Math.abs(ae))*Math.abs(H)+(Math.abs(se)+Math.abs(he))*Math.abs(J));return fe>ie||-fe>ie?fe:A(p,M,f,E)}];function S(p){var M=v[p.length];return M||(M=v[p.length]=g(p.length)),M.apply(void 0,p)}function T(p,M,f,E,I,B,N){return function(V,j,$,ee,H){switch(arguments.length){case 0:case 1:return 0;case 2:return E(V,j);case 3:return I(V,j,$);case 4:return B(V,j,$,ee);case 5:return N(V,j,$,ee,H)}for(var J=new Array(arguments.length),Q=0;Q0&&m>0||x<0&&m<0)return!1;var g=l(c,o,s),k=l(h,o,s);return!(g>0&&k>0||g<0&&k<0)&&(x!==0||m!==0||g!==0||k!==0||function(A,v,S,T){for(var p=0;p<2;++p){var M=A[p],f=v[p],E=Math.min(M,f),I=Math.max(M,f),B=S[p],N=T[p],V=Math.min(B,N);if(Math.max(B,N)=o?(s=A,(m+=1)=o?(s=A,(m+=1)>1,A=o[2*k+1];if(A===x)return k;x>1,A=o[2*k+1];if(A===x)return k;x>1,A=o[2*k+1];if(A===x)return k;x0)-(o<0)},r.abs=function(o){var s=o>>31;return(o^s)-s},r.min=function(o,s){return s^(o^s)&-(o65535)<<4,s|=c=((o>>>=s)>255)<<3,s|=c=((o>>>=c)>15)<<2,(s|=c=((o>>>=c)>3)<<1)|(o>>>=c)>>1},r.log10=function(o){return o>=1e9?9:o>=1e8?8:o>=1e7?7:o>=1e6?6:o>=1e5?5:o>=1e4?4:o>=1e3?3:o>=100?2:o>=10?1:0},r.popCount=function(o){return 16843009*((o=(858993459&(o-=o>>>1&1431655765))+(o>>>2&858993459))+(o>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(o){return o+=o===0,--o,o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,1+(o|=o>>>16)},r.prevPow2=function(o){return o|=o>>>1,o|=o>>>2,o|=o>>>4,o|=o>>>8,(o|=o>>>16)-(o>>>1)},r.parity=function(o){return o^=o>>>16,o^=o>>>8,o^=o>>>4,27030>>>(o&=15)&1};var l=new Array(256);(function(o){for(var s=0;s<256;++s){var c=s,h=s,x=7;for(c>>>=1;c;c>>>=1)h<<=1,h|=1&c,--x;o[s]=h<>>8&255]<<16|l[o>>>16&255]<<8|l[o>>>24&255]},r.interleave2=function(o,s){return(o=1431655765&((o=858993459&((o=252645135&((o=16711935&((o&=65535)|o<<8))|o<<4))|o<<2))|o<<1))|(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s&=65535)|s<<8))|s<<4))|s<<2))|s<<1))<<1},r.deinterleave2=function(o,s){return(o=65535&((o=16711935&((o=252645135&((o=858993459&((o=o>>>s&1431655765)|o>>>1))|o>>>2))|o>>>4))|o>>>16))<<16>>16},r.interleave3=function(o,s,c){return o=1227133513&((o=3272356035&((o=251719695&((o=4278190335&((o&=1023)|o<<16))|o<<8))|o<<4))|o<<2),(o|=(s=1227133513&((s=3272356035&((s=251719695&((s=4278190335&((s&=1023)|s<<16))|s<<8))|s<<4))|s<<2))<<1)|(c=1227133513&((c=3272356035&((c=251719695&((c=4278190335&((c&=1023)|c<<16))|c<<8))|c<<4))|c<<2))<<2},r.deinterleave3=function(o,s){return(o=1023&((o=4278190335&((o=251719695&((o=3272356035&((o=o>>>s&1227133513)|o>>>2))|o>>>4))|o>>>8))|o>>>16))<<22>>22},r.nextCombination=function(o){var s=o|o-1;return s+1|(~s&-~s)-1>>>n(o)+1}},2014:function(u,r,n){var l=n(3105),o=n(4623);function s(A,v){var S=A.length,T=A.length-v.length,p=Math.min;if(T)return T;switch(S){case 0:return 0;case 1:return A[0]-v[0];case 2:return(E=A[0]+A[1]-v[0]-v[1])||p(A[0],A[1])-p(v[0],v[1]);case 3:var M=A[0]+A[1],f=v[0]+v[1];if(E=M+A[2]-(f+v[2]))return E;var E,I=p(A[0],A[1]),B=p(v[0],v[1]);return(E=p(I,A[2])-p(B,v[2]))||p(I+A[2],M)-p(B+v[2],f);default:var N=A.slice(0);N.sort();var V=v.slice(0);V.sort();for(var j=0;j>1,f=s(A[M],v);f<=0?(f===0&&(p=M),S=M+1):f>0&&(T=M-1)}return p}function g(A,v){for(var S=new Array(A.length),T=0,p=S.length;T=A.length||s(A[$],M)!==0););}return S}function k(A,v){if(v<0)return[];for(var S=[],T=(1<>>B&1&&I.push(p[B]);v.push(I)}return h(v)},r.skeleton=k,r.boundary=function(A){for(var v=[],S=0,T=A.length;S>1:(he>>1)-1}function N(he){for(var fe=I(he);;){var ie=fe,oe=2*he+1,le=2*(he+1),ge=he;if(oe0;){var ie=B(he);if(!(ie>=0&&fe0){var he=H[0];return E(0,Q-1),Q-=1,N(0),he}return-1}function $(he,fe){var ie=H[he];return A[ie]===fe?he:(A[ie]=-1/0,V(he),j(),A[ie]=fe,V((Q+=1)-1))}function ee(he){if(!v[he]){v[he]=!0;var fe=g[he],ie=k[he];g[ie]>=0&&(g[ie]=fe),k[fe]>=0&&(k[fe]=ie),J[fe]>=0&&$(J[fe],f(fe)),J[ie]>=0&&$(J[ie],f(ie))}}var H=[],J=new Array(x);for(S=0;S>1;S>=0;--S)N(S);for(;;){var Z=j();if(Z<0||A[Z]>h)break;ee(Z)}var K=[];for(S=0;S=0&&ie>=0&&fe!==ie){var oe=J[fe],le=J[ie];oe!==le&&se.push([oe,le])}}),o.unique(o.normalize(se)),{positions:K,edges:se}};var l=n(3250),o=n(2014)},1303:function(u,r,n){u.exports=function(s,c){var h,x,m,g;if(c[0][0]c[1][0]))return o(c,s);h=c[1],x=c[0]}if(s[0][0]s[1][0]))return-o(s,c);m=s[1],g=s[0]}var k=l(h,x,g),A=l(h,x,m);if(k<0){if(A<=0)return k}else if(k>0){if(A>=0)return k}else if(A)return A;if(k=l(g,m,x),A=l(g,m,h),k<0){if(A<=0)return k}else if(k>0){if(A>=0)return k}else if(A)return A;return x[0]-g[0]};var l=n(3250);function o(s,c){var h,x,m,g;if(c[0][0]c[1][0])){var k=Math.min(s[0][1],s[1][1]),A=Math.max(s[0][1],s[1][1]),v=Math.min(c[0][1],c[1][1]),S=Math.max(c[0][1],c[1][1]);return AS?k-S:A-S}h=c[1],x=c[0]}s[0][1]0)if(v[0]!==M[1][0])S=A,A=A.right;else{if(E=m(A.right,v))return E;A=A.left}else{if(v[0]!==M[1][0])return A;var E;if(E=m(A.right,v))return E;A=A.left}}return S}function g(A,v,S,T){this.y=A,this.index=v,this.start=S,this.closed=T}function k(A,v,S,T){this.x=A,this.segment=v,this.create=S,this.index=T}h.prototype.castUp=function(A){var v=l.le(this.coordinates,A[0]);if(v<0)return-1;this.slabs[v];var S=m(this.slabs[v],A),T=-1;if(S&&(T=S.value),this.coordinates[v]===A[0]){var p=null;if(S&&(p=S.key),v>0){var M=m(this.slabs[v-1],A);M&&(p?c(M.key,p)>0&&(p=M.key,T=M.value):(T=M.value,p=M.key))}var f=this.horizontal[v];if(f.length>0){var E=l.ge(f,A[1],x);if(E=f.length)return T;I=f[E]}}if(I.start)if(p){var B=s(p[0],p[1],[A[0],I.y]);p[0][0]>p[1][0]&&(B=-B),B>0&&(T=I.index)}else T=I.index;else I.y!==A[1]&&(T=I.index)}}}return T}},5202:function(u,r,n){var l=n(1944),o=n(8210);function s(h,x){var m=o(l(h,x),[x[x.length-1]]);return m[m.length-1]}function c(h,x,m,g){var k=-x/(g-x);k<0?k=0:k>1&&(k=1);for(var A=1-k,v=h.length,S=new Array(v),T=0;T0||k>0&&T<0){var p=c(A,T,v,k);m.push(p),g.push(p.slice())}T<0?g.push(v.slice()):T>0?m.push(v.slice()):(m.push(v.slice()),g.push(v.slice())),k=T}return{positive:m,negative:g}},u.exports.positive=function(h,x){for(var m=[],g=s(h[h.length-1],x),k=h[h.length-1],A=h[0],v=0;v0||g>0&&S<0)&&m.push(c(k,S,A,g)),S>=0&&m.push(A.slice()),g=S}return m},u.exports.negative=function(h,x){for(var m=[],g=s(h[h.length-1],x),k=h[h.length-1],A=h[0],v=0;v0||g>0&&S<0)&&m.push(c(k,S,A,g)),S<=0&&m.push(A.slice()),g=S}return m}},3387:function(u,r,n){var l;(function(){var o={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 s(x){return function(m,g){var k,A,v,S,T,p,M,f,E,I=1,B=m.length,N="";for(A=0;A=0),S.type){case"b":k=parseInt(k,10).toString(2);break;case"c":k=String.fromCharCode(parseInt(k,10));break;case"d":case"i":k=parseInt(k,10);break;case"j":k=JSON.stringify(k,null,S.width?parseInt(S.width):0);break;case"e":k=S.precision?parseFloat(k).toExponential(S.precision):parseFloat(k).toExponential();break;case"f":k=S.precision?parseFloat(k).toFixed(S.precision):parseFloat(k);break;case"g":k=S.precision?String(Number(k.toPrecision(S.precision))):parseFloat(k);break;case"o":k=(parseInt(k,10)>>>0).toString(8);break;case"s":k=String(k),k=S.precision?k.substring(0,S.precision):k;break;case"t":k=String(!!k),k=S.precision?k.substring(0,S.precision):k;break;case"T":k=Object.prototype.toString.call(k).slice(8,-1).toLowerCase(),k=S.precision?k.substring(0,S.precision):k;break;case"u":k=parseInt(k,10)>>>0;break;case"v":k=k.valueOf(),k=S.precision?k.substring(0,S.precision):k;break;case"x":k=(parseInt(k,10)>>>0).toString(16);break;case"X":k=(parseInt(k,10)>>>0).toString(16).toUpperCase()}o.json.test(S.type)?N+=k:(!o.number.test(S.type)||f&&!S.sign?E="":(E=f?"+":"-",k=k.toString().replace(o.sign,"")),p=S.pad_char?S.pad_char==="0"?"0":S.pad_char.charAt(1):" ",M=S.width-(E+k).length,T=S.width&&M>0?p.repeat(M):"",N+=S.align?E+k+T:p==="0"?E+T+k:T+E+k)}return N}(function(m){if(h[m])return h[m];for(var g,k=m,A=[],v=0;k;){if((g=o.text.exec(k))!==null)A.push(g[0]);else if((g=o.modulo.exec(k))!==null)A.push("%");else{if((g=o.placeholder.exec(k))===null)throw new SyntaxError("[sprintf] unexpected placeholder");if(g[2]){v|=1;var S=[],T=g[2],p=[];if((p=o.key.exec(T))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");for(S.push(p[1]);(T=T.substring(p[0].length))!=="";)if((p=o.key_access.exec(T))!==null)S.push(p[1]);else{if((p=o.index_access.exec(T))===null)throw new SyntaxError("[sprintf] failed to parse named argument key");S.push(p[1])}g[2]=S}else v|=2;if(v===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");A.push({placeholder:g[0],param_no:g[1],keys:g[2],sign:g[3],pad_char:g[4],align:g[5],width:g[6],precision:g[7],type:g[8]})}k=k.substring(g[0].length)}return h[m]=A}(x),arguments)}function c(x,m){return s.apply(null,[x].concat(m||[]))}var h=Object.create(null);r.sprintf=s,r.vsprintf=c,typeof window<"u"&&(window.sprintf=s,window.vsprintf=c,(l=(function(){return{sprintf:s,vsprintf:c}}).call(r,n,r,u))===void 0||(u.exports=l))})()},3711:function(u,r,n){u.exports=function(h,x){if(h.dimension<=0)return{positions:[],cells:[]};if(h.dimension===1)return function(k,A){for(var v=o(k,A),S=v.length,T=new Array(S),p=new Array(S),M=0;MS|0},vertex:function(k,A,v,S,T,p,M,f,E,I,B,N,V){var j=(M<<0)+(f<<1)+(E<<2)+(I<<3)|0;if(j!==0&&j!==15)switch(j){case 0:case 15:B.push([k-.5,A-.5]);break;case 1:B.push([k-.25-.25*(S+v-2*V)/(v-S),A-.25-.25*(T+v-2*V)/(v-T)]);break;case 2:B.push([k-.75-.25*(-S-v+2*V)/(S-v),A-.25-.25*(p+S-2*V)/(S-p)]);break;case 3:B.push([k-.5,A-.5-.5*(T+v+p+S-4*V)/(v-T+S-p)]);break;case 4:B.push([k-.25-.25*(p+T-2*V)/(T-p),A-.75-.25*(-T-v+2*V)/(T-v)]);break;case 5:B.push([k-.5-.5*(S+v+p+T-4*V)/(v-S+T-p),A-.5]);break;case 6:B.push([k-.5-.25*(-S-v+p+T)/(S-v+T-p),A-.5-.25*(-T-v+p+S)/(T-v+S-p)]);break;case 7:B.push([k-.75-.25*(p+T-2*V)/(T-p),A-.75-.25*(p+S-2*V)/(S-p)]);break;case 8:B.push([k-.75-.25*(-p-T+2*V)/(p-T),A-.75-.25*(-p-S+2*V)/(p-S)]);break;case 9:B.push([k-.5-.25*(S+v+-p-T)/(v-S+p-T),A-.5-.25*(T+v+-p-S)/(v-T+p-S)]);break;case 10:B.push([k-.5-.5*(-S-v-p-T+4*V)/(S-v+p-T),A-.5]);break;case 11:B.push([k-.25-.25*(-p-T+2*V)/(p-T),A-.75-.25*(T+v-2*V)/(v-T)]);break;case 12:B.push([k-.5,A-.5-.5*(-T-v-p-S+4*V)/(T-v+p-S)]);break;case 13:B.push([k-.75-.25*(S+v-2*V)/(v-S),A-.25-.25*(-p-S+2*V)/(p-S)]);break;case 14:B.push([k-.25-.25*(-S-v+2*V)/(S-v),A-.25-.25*(-T-v+2*V)/(T-v)])}},cell:function(k,A,v,S,T,p,M,f,E){T?f.push([k,A]):f.push([A,k])}});return function(k,A){var v=[],S=[];return g(k,v,S,A),{positions:v,cells:S}}}},c={}},529:function(u,r,n){u.exports=function c(h,x,m){var g=(m=m||{}).fontStyle||"normal",k=m.fontWeight||"normal",A=m.fontVariant||"normal",v=[g,k,A,h].join("_"),S=s[v];S||(S=s[v]={" ":{data:new Float32Array(0),shape:.2}});var T=S[x];if(!T)if(x.length<=1||!/\d/.test(x))T=S[x]=function(ee){for(var H=ee.cells,J=ee.positions,Q=new Float32Array(6*H.length),Z=0,K=0,ae=0;ae0&&(E+=.02);var B=new Float32Array(f),N=0,V=-.5*E;for(I=0;IMath.max(M,f)?E[2]=1:M>Math.max(p,f)?E[0]=1:E[1]=1;for(var I=0,B=0,N=0;N<3;++N)I+=T[N]*T[N],B+=E[N]*T[N];for(N=0;N<3;++N)E[N]-=B/I*T[N];return h(E,E),E}function A(T,p,M,f,E,I,B,N){this.center=l(M),this.up=l(f),this.right=l(E),this.radius=l([I]),this.angle=l([B,N]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(T,p),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 V=0;V<16;++V)this.computedMatrix[V]=.5;this.recalcMatrix(0)}var v=A.prototype;v.setDistanceLimits=function(T,p){T=T>0?Math.log(T):-1/0,p=p>0?Math.log(p):1/0,p=Math.max(p,T),this.radius.bounds[0][0]=T,this.radius.bounds[1][0]=p},v.getDistanceLimits=function(T){var p=this.radius.bounds[0];return T?(T[0]=Math.exp(p[0][0]),T[1]=Math.exp(p[1][0]),T):[Math.exp(p[0][0]),Math.exp(p[1][0])]},v.recalcMatrix=function(T){this.center.curve(T),this.up.curve(T),this.right.curve(T),this.radius.curve(T),this.angle.curve(T);for(var p=this.computedUp,M=this.computedRight,f=0,E=0,I=0;I<3;++I)E+=p[I]*M[I],f+=p[I]*p[I];var B=Math.sqrt(f),N=0;for(I=0;I<3;++I)M[I]-=p[I]*E/f,N+=M[I]*M[I],p[I]/=B;var V=Math.sqrt(N);for(I=0;I<3;++I)M[I]/=V;var j=this.computedToward;c(j,p,M),h(j,j);var $=Math.exp(this.computedRadius[0]),ee=this.computedAngle[0],H=this.computedAngle[1],J=Math.cos(ee),Q=Math.sin(ee),Z=Math.cos(H),K=Math.sin(H),ae=this.computedCenter,se=J*Z,he=Q*Z,fe=K,ie=-J*K,oe=-Q*K,le=Z,ge=this.computedEye,ye=this.computedMatrix;for(I=0;I<3;++I){var me=se*M[I]+he*j[I]+fe*p[I];ye[4*I+1]=ie*M[I]+oe*j[I]+le*p[I],ye[4*I+2]=me,ye[4*I+3]=0}var be=ye[1],Se=ye[5],Ee=ye[9],Ce=ye[2],Le=ye[6],Oe=ye[10],We=Se*Oe-Ee*Le,Ie=Ee*Ce-be*Oe,Ve=be*Le-Se*Ce,Pe=m(We,Ie,Ve);for(We/=Pe,Ie/=Pe,Ve/=Pe,ye[0]=We,ye[4]=Ie,ye[8]=Ve,I=0;I<3;++I)ge[I]=ae[I]+ye[2+4*I]*$;for(I=0;I<3;++I){N=0;for(var de=0;de<3;++de)N+=ye[I+4*de]*ge[de];ye[12+I]=-N}ye[15]=1},v.getMatrix=function(T,p){this.recalcMatrix(T);var M=this.computedMatrix;if(p){for(var f=0;f<16;++f)p[f]=M[f];return p}return M};var S=[0,0,0];v.rotate=function(T,p,M,f){if(this.angle.move(T,p,M),f){this.recalcMatrix(T);var E=this.computedMatrix;S[0]=E[2],S[1]=E[6],S[2]=E[10];for(var I=this.computedUp,B=this.computedRight,N=this.computedToward,V=0;V<3;++V)E[4*V]=I[V],E[4*V+1]=B[V],E[4*V+2]=N[V];for(s(E,E,f,S),V=0;V<3;++V)I[V]=E[4*V],B[V]=E[4*V+1];this.up.set(T,I[0],I[1],I[2]),this.right.set(T,B[0],B[1],B[2])}},v.pan=function(T,p,M,f){p=p||0,M=M||0,f=f||0,this.recalcMatrix(T);var E=this.computedMatrix,I=(Math.exp(this.computedRadius[0]),E[1]),B=E[5],N=E[9],V=m(I,B,N);I/=V,B/=V,N/=V;var j=E[0],$=E[4],ee=E[8],H=j*I+$*B+ee*N,J=m(j-=I*H,$-=B*H,ee-=N*H),Q=(j/=J)*p+I*M,Z=($/=J)*p+B*M,K=(ee/=J)*p+N*M;this.center.move(T,Q,Z,K);var ae=Math.exp(this.computedRadius[0]);ae=Math.max(1e-4,ae+f),this.radius.set(T,Math.log(ae))},v.translate=function(T,p,M,f){this.center.move(T,p||0,M||0,f||0)},v.setMatrix=function(T,p,M,f){var E=1;typeof M=="number"&&(E=0|M),(E<0||E>3)&&(E=1);var I=(E+2)%3;p||(this.recalcMatrix(T),p=this.computedMatrix);var B=p[E],N=p[E+4],V=p[E+8];if(f){var j=Math.abs(B),$=Math.abs(N),ee=Math.abs(V),H=Math.max(j,$,ee);j===H?(B=B<0?-1:1,N=V=0):ee===H?(V=V<0?-1:1,B=N=0):(N=N<0?-1:1,B=V=0)}else{var J=m(B,N,V);B/=J,N/=J,V/=J}var Q,Z,K=p[I],ae=p[I+4],se=p[I+8],he=K*B+ae*N+se*V,fe=m(K-=B*he,ae-=N*he,se-=V*he),ie=N*(se/=fe)-V*(ae/=fe),oe=V*(K/=fe)-B*se,le=B*ae-N*K,ge=m(ie,oe,le);if(ie/=ge,oe/=ge,le/=ge,this.center.jump(T,Fe,qe,$e),this.radius.idle(T),this.up.jump(T,B,N,V),this.right.jump(T,K,ae,se),E===2){var ye=p[1],me=p[5],be=p[9],Se=ye*K+me*ae+be*se,Ee=ye*ie+me*oe+be*le;Q=We<0?-Math.PI/2:Math.PI/2,Z=Math.atan2(Ee,Se)}else{var Ce=p[2],Le=p[6],Oe=p[10],We=Ce*B+Le*N+Oe*V,Ie=Ce*K+Le*ae+Oe*se,Ve=Ce*ie+Le*oe+Oe*le;Q=Math.asin(g(We)),Z=Math.atan2(Ve,Ie)}this.angle.jump(T,Z,Q),this.recalcMatrix(T);var Pe=p[2],de=p[6],Me=p[10],ke=this.computedMatrix;o(ke,p);var He=ke[15],Fe=ke[12]/He,qe=ke[13]/He,$e=ke[14]/He,Ye=Math.exp(this.computedRadius[0]);this.center.jump(T,Fe-Pe*Ye,qe-de*Ye,$e-Me*Ye)},v.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},v.idle=function(T){this.center.idle(T),this.up.idle(T),this.right.idle(T),this.radius.idle(T),this.angle.idle(T)},v.flush=function(T){this.center.flush(T),this.up.flush(T),this.right.flush(T),this.radius.flush(T),this.angle.flush(T)},v.setDistance=function(T,p){p>0&&this.radius.set(T,Math.log(p))},v.lookAt=function(T,p,M,f){this.recalcMatrix(T),p=p||this.computedEye,M=M||this.computedCenter;var E=(f=f||this.computedUp)[0],I=f[1],B=f[2],N=m(E,I,B);if(!(N<1e-6)){E/=N,I/=N,B/=N;var V=p[0]-M[0],j=p[1]-M[1],$=p[2]-M[2],ee=m(V,j,$);if(!(ee<1e-6)){V/=ee,j/=ee,$/=ee;var H=this.computedRight,J=H[0],Q=H[1],Z=H[2],K=E*J+I*Q+B*Z,ae=m(J-=K*E,Q-=K*I,Z-=K*B);if(!(ae<.01&&(ae=m(J=I*$-B*j,Q=B*V-E*$,Z=E*j-I*V))<1e-6)){J/=ae,Q/=ae,Z/=ae,this.up.set(T,E,I,B),this.right.set(T,J,Q,Z),this.center.set(T,M[0],M[1],M[2]),this.radius.set(T,Math.log(ee));var se=I*Z-B*Q,he=B*J-E*Z,fe=E*Q-I*J,ie=m(se,he,fe),oe=E*V+I*j+B*$,le=J*V+Q*j+Z*$,ge=(se/=ie)*V+(he/=ie)*j+(fe/=ie)*$,ye=Math.asin(g(oe)),me=Math.atan2(ge,le),be=this.angle._state,Se=be[be.length-1],Ee=be[be.length-2];Se%=2*Math.PI;var Ce=Math.abs(Se+2*Math.PI-me),Le=Math.abs(Se-me),Oe=Math.abs(Se-2*Math.PI-me);Ce0?Q.pop():new ArrayBuffer(H)}function S(H){return new Uint8Array(v(H),0,H)}function T(H){return new Uint16Array(v(2*H),0,H)}function p(H){return new Uint32Array(v(4*H),0,H)}function M(H){return new Int8Array(v(H),0,H)}function f(H){return new Int16Array(v(2*H),0,H)}function E(H){return new Int32Array(v(4*H),0,H)}function I(H){return new Float32Array(v(4*H),0,H)}function B(H){return new Float64Array(v(8*H),0,H)}function N(H){return c?new Uint8ClampedArray(v(H),0,H):S(H)}function V(H){return h?new BigUint64Array(v(8*H),0,H):null}function j(H){return x?new BigInt64Array(v(8*H),0,H):null}function $(H){return new DataView(v(H),0,H)}function ee(H){H=l.nextPow2(H);var J=l.log2(H),Q=k[J];return Q.length>0?Q.pop():new s(H)}r.free=function(H){if(s.isBuffer(H))k[l.log2(H.length)].push(H);else{if(Object.prototype.toString.call(H)!=="[object ArrayBuffer]"&&(H=H.buffer),!H)return;var J=H.length||H.byteLength,Q=0|l.log2(J);g[Q].push(H)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeBigUint64=r.freeInt8=r.freeInt16=r.freeInt32=r.freeBigInt64=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(H){A(H.buffer)},r.freeArrayBuffer=A,r.freeBuffer=function(H){k[l.log2(H.length)].push(H)},r.malloc=function(H,J){if(J===void 0||J==="arraybuffer")return v(H);switch(J){case"uint8":return S(H);case"uint16":return T(H);case"uint32":return p(H);case"int8":return M(H);case"int16":return f(H);case"int32":return E(H);case"float":case"float32":return I(H);case"double":case"float64":return B(H);case"uint8_clamped":return N(H);case"bigint64":return j(H);case"biguint64":return V(H);case"buffer":return ee(H);case"data":case"dataview":return $(H);default:return null}return null},r.mallocArrayBuffer=v,r.mallocUint8=S,r.mallocUint16=T,r.mallocUint32=p,r.mallocInt8=M,r.mallocInt16=f,r.mallocInt32=E,r.mallocFloat32=r.mallocFloat=I,r.mallocFloat64=r.mallocDouble=B,r.mallocUint8Clamped=N,r.mallocBigUint64=V,r.mallocBigInt64=j,r.mallocDataView=$,r.mallocBuffer=ee,r.clearCache=function(){for(var H=0;H<32;++H)m.UINT8[H].length=0,m.UINT16[H].length=0,m.UINT32[H].length=0,m.INT8[H].length=0,m.INT16[H].length=0,m.INT32[H].length=0,m.FLOAT[H].length=0,m.DOUBLE[H].length=0,m.BIGUINT64[H].length=0,m.BIGINT64[H].length=0,m.UINT8C[H].length=0,g[H].length=0,k[H].length=0}},1755:function(u){function r(l){this.roots=new Array(l),this.ranks=new Array(l);for(var o=0;o0&&(H=ee.size),ee.lineSpacing&&ee.lineSpacing>0&&(J=ee.lineSpacing),ee.styletags&&ee.styletags.breaklines&&(Q.breaklines=!!ee.styletags.breaklines),ee.styletags&&ee.styletags.bolds&&(Q.bolds=!!ee.styletags.bolds),ee.styletags&&ee.styletags.italics&&(Q.italics=!!ee.styletags.italics),ee.styletags&&ee.styletags.subscripts&&(Q.subscripts=!!ee.styletags.subscripts),ee.styletags&&ee.styletags.superscripts&&(Q.superscripts=!!ee.styletags.superscripts)),$.font=[ee.fontStyle,ee.fontVariant,ee.fontWeight,H+"px",ee.font].filter(function(Z){return Z}).join(" "),$.textAlign="start",$.textBaseline="alphabetic",$.direction="ltr",N(function(Z,K,ae,se,he,fe){ae=ae.replace(/\n/g,""),ae=fe.breaklines===!0?ae.replace(/\/g,` `):ae.replace(/\/g," ");var ie="",oe=[];for(me=0;me-1?parseInt(Be[1+nt]):0,wt=pt>-1?parseInt(Ge[1+pt]):0;At!==wt&&(tt=tt.replace(He(),"?px "),Ee*=Math.pow(.75,wt-At),tt=tt.replace("?px ",He())),Se+=.25*Oe*(wt-At)}if(fe.superscripts===!0){var Nt=Be.indexOf(S),Ht=Ge.indexOf(S),Gt=Nt>-1?parseInt(Be[1+Nt]):0,st=Ht>-1?parseInt(Ge[1+Ht]):0;Gt!==st&&(tt=tt.replace(He(),"?px "),Ee*=Math.pow(.75,st-Gt),tt=tt.replace("?px ",He())),Se-=.25*Oe*(st-Gt)}if(fe.bolds===!0){var Qe=Be.indexOf(g)>-1,ft=Ge.indexOf(g)>-1;!Qe&&ft&&(tt=yt?tt.replace("italic ","italic bold "):"bold "+tt),Qe&&!ft&&(tt=tt.replace("bold ",""))}if(fe.italics===!0){var yt=Be.indexOf(A)>-1,Ot=Ge.indexOf(A)>-1;!yt&&Ot&&(tt="italic "+tt),yt&&!Ot&&(tt=tt.replace("italic ",""))}K.font=tt}for(ye=0;ye",J="",Q=H.length,Z=J.length,K=j[0]===S||j[0]===M,ae=0,se=-Z;ae>-1&&(ae=$.indexOf(H,ae))!==-1&&(se=$.indexOf(J,ae+Q))!==-1&&!(se<=ae);){for(var he=ae;he=se)ee[he]=null,$=$.substr(0,he)+" "+$.substr(he+1);else if(ee[he]!==null){var fe=ee[he].indexOf(j[0]);fe===-1?ee[he]+=j:K&&(ee[he]=ee[he].substr(0,fe+1)+(1+parseInt(ee[he][fe+1]))+ee[he].substr(fe+2))}var ie=ae+Q,oe=$.substr(ie,se-ie).indexOf(H);ae=oe!==-1?oe:se+Z}return ee}function I(V,j){var $=l(V,128);return j?s($.cells,$.positions,.25):{edges:$.cells,positions:$.positions}}function B(V,j,$,ee){var H=I(V,ee),J=function(ye,me,be){for(var Se=me.textAlign||"start",Ee=me.textBaseline||"alphabetic",Ce=[1<<30,1<<30],Le=[0,0],Oe=ye.length,We=0;We"u"||!ses.ok||ses.ok()){typeof ses<"u"&&(ses.weakMapPermitHostObjects=p);var r=!1;if(typeof WeakMap=="function"){var n=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var l=new n,o=Object.freeze({});if(l.set(o,1),l.get(o)===1)return void(u.exports=WeakMap);r=!0}}var s=Object.getOwnPropertyNames,c=Object.defineProperty,h=Object.isExtensible,x="weakmap:",m=x+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var g=new ArrayBuffer(25),k=new Uint8Array(g);crypto.getRandomValues(k),m=x+"rand:"+Array.prototype.map.call(k,function(B){return(B%36).toString(36)}).join("")+"___"}if(c(Object,"getOwnPropertyNames",{value:function(B){return s(B).filter(M)}}),"getPropertyNames"in Object){var A=Object.getPropertyNames;c(Object,"getPropertyNames",{value:function(B){return A(B).filter(M)}})}(function(){var B=Object.freeze;c(Object,"freeze",{value:function(j){return f(j),B(j)}});var N=Object.seal;c(Object,"seal",{value:function(j){return f(j),N(j)}});var V=Object.preventExtensions;c(Object,"preventExtensions",{value:function(j){return f(j),V(j)}})})();var v=!1,S=0,T=function(){this instanceof T||I();var B=[],N=[],V=S++;return Object.create(T.prototype,{get___:{value:E(function(j,$){var ee,H=f(j);return H?V in H?H[V]:$:(ee=B.indexOf(j))>=0?N[ee]:$})},has___:{value:E(function(j){var $=f(j);return $?V in $:B.indexOf(j)>=0})},set___:{value:E(function(j,$){var ee,H=f(j);return H?H[V]=$:(ee=B.indexOf(j))>=0?N[ee]=$:(ee=B.length,N[ee]=$,B[ee]=j),this})},delete___:{value:E(function(j){var $,ee,H=f(j);return H?V in H&&delete H[V]:!(($=B.indexOf(j))<0||(ee=B.length-1,B[$]=void 0,N[$]=N[ee],B[$]=B[ee],B.length=ee,N.length=ee,0))})}})};T.prototype=Object.create(Object.prototype,{get:{value:function(B,N){return this.get___(B,N)},writable:!0,configurable:!0},has:{value:function(B){return this.has___(B)},writable:!0,configurable:!0},set:{value:function(B,N){return this.set___(B,N)},writable:!0,configurable:!0},delete:{value:function(B){return this.delete___(B)},writable:!0,configurable:!0}}),typeof n=="function"?function(){function B(){this instanceof T||I();var N,V=new n,j=void 0,$=!1;return N=r?function(ee,H){return V.set(ee,H),V.has(ee)||(j||(j=new T),j.set(ee,H)),this}:function(ee,H){if($)try{V.set(ee,H)}catch{j||(j=new T),j.set___(ee,H)}else V.set(ee,H);return this},Object.create(T.prototype,{get___:{value:E(function(ee,H){return j?V.has(ee)?V.get(ee):j.get___(ee,H):V.get(ee,H)})},has___:{value:E(function(ee){return V.has(ee)||!!j&&j.has___(ee)})},set___:{value:E(N)},delete___:{value:E(function(ee){var H=!!V.delete(ee);return j&&j.delete___(ee)||H})},permitHostObjects___:{value:E(function(ee){if(ee!==p)throw new Error("bogus call to permitHostObjects___");$=!0})}})}r&&typeof Proxy<"u"&&(Proxy=void 0),B.prototype=T.prototype,u.exports=B,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),u.exports=T)}function p(B){B.permitHostObjects___&&B.permitHostObjects___(p)}function M(B){return!(B.substr(0,8)==x&&B.substr(B.length-3)==="___")}function f(B){if(B!==Object(B))throw new TypeError("Not an object: "+B);var N=B[m];if(N&&N.key===B)return N;if(h(B)){N={key:B};try{return c(B,m,{value:N,writable:!1,enumerable:!1,configurable:!1}),N}catch{return}}}function E(B){return B.prototype=null,Object.freeze(B)}function I(){v||typeof console>"u"||(v=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}})()},236:function(u,r,n){var l=n(8284);u.exports=function(){var o={};return function(s){if((typeof s!="object"||s===null)&&typeof s!="function")throw new Error("Weakmap-shim: Key must be object");var c=s.valueOf(o);return c&&c.identity===o?c:l(s,o)}}},8284:function(u){u.exports=function(r,n){var l={identity:n},o=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(s){return s!==n?o.apply(this,arguments):l},writable:!0}),l}},606:function(u,r,n){var l=n(236);u.exports=function(){var o=l();return{get:function(s,c){var h=o(s);return h.hasOwnProperty("value")?h.value:c},set:function(s,c){return o(s).value=c,this},has:function(s){return"value"in o(s)},delete:function(s){return delete o(s).value}}}},3349:function(u){u.exports=function(r){var n={};return function(l,o,s){var c=l.dtype,h=l.order,x=[c,h.join()].join(),m=n[x];return m||(n[x]=m=r([c,h])),m(l.shape.slice(0),l.data,l.stride,0|l.offset,o,s)}}((function(){return function(r,n,l,o,s,c){var h=r[0],x=l[0],m=[0],g=x;o|=0;var k=0,A=x;for(k=0;k=0!=S>=0&&s.push(m[0]+.5+.5*(v+S)/(v-S)),o+=A,++m[0]}}}).bind(void 0,{funcName:"zeroCrossings"}))},781:function(u,r,n){u.exports=function(o,s){var c=[];return s=+s||0,l(o.hi(o.shape[0]-1),c,s),c};var l=n(3349)},7790:function(){}},w={};function y(u){var r=w[u];if(r!==void 0)return r.exports;var n=w[u]={id:u,loaded:!1,exports:{}};return e[u].call(n.exports,n,n.exports,y),n.loaded=!0,n.exports}y.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),y.nmd=function(u){return u.paths=[],u.children||(u.children=[]),u};var _=y(1964);D.exports=_})()},45708:function(D,L,t){function b(de,Me){for(var ke=0;keo)throw new RangeError('The value "'+de+'" is invalid for option "size"');var Me=new Uint8Array(de);return Object.setPrototypeOf(Me,c.prototype),Me}function c(de,Me,ke){if(typeof de=="number"){if(typeof Me=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(de)}return h(de,Me,ke)}function h(de,Me,ke){if(typeof de=="string")return function(qe,$e){if(typeof $e=="string"&&$e!==""||($e="utf8"),!c.isEncoding($e))throw new TypeError("Unknown encoding: "+$e);var Ye=0|v(qe,$e),_e=s(Ye),De=_e.write(qe,$e);return De!==Ye&&(_e=_e.slice(0,De)),_e}(de,Me);if(ArrayBuffer.isView(de))return function(qe){if(Oe(qe,Uint8Array)){var $e=new Uint8Array(qe);return k($e.buffer,$e.byteOffset,$e.byteLength)}return g(qe)}(de);if(de==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(de));if(Oe(de,ArrayBuffer)||de&&Oe(de.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(de,SharedArrayBuffer)||de&&Oe(de.buffer,SharedArrayBuffer)))return k(de,Me,ke);if(typeof de=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var He=de.valueOf&&de.valueOf();if(He!=null&&He!==de)return c.from(He,Me,ke);var Fe=function(qe){if(c.isBuffer(qe)){var $e=0|A(qe.length),Ye=s($e);return Ye.length===0||qe.copy(Ye,0,0,$e),Ye}return qe.length!==void 0?typeof qe.length!="number"||We(qe.length)?s(0):g(qe):qe.type==="Buffer"&&Array.isArray(qe.data)?g(qe.data):void 0}(de);if(Fe)return Fe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof de[Symbol.toPrimitive]=="function")return c.from(de[Symbol.toPrimitive]("string"),Me,ke);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(de))}function x(de){if(typeof de!="number")throw new TypeError('"size" argument must be of type number');if(de<0)throw new RangeError('The value "'+de+'" is invalid for option "size"')}function m(de){return x(de),s(de<0?0:0|A(de))}function g(de){for(var Me=de.length<0?0:0|A(de.length),ke=s(Me),He=0;He=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|de}function v(de,Me){if(c.isBuffer(de))return de.length;if(ArrayBuffer.isView(de)||Oe(de,ArrayBuffer))return de.byteLength;if(typeof de!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(de));var ke=de.length,He=arguments.length>2&&arguments[2]===!0;if(!He&&ke===0)return 0;for(var Fe=!1;;)switch(Me){case"ascii":case"latin1":case"binary":return ke;case"utf8":case"utf-8":return Ee(de).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*ke;case"hex":return ke>>>1;case"base64":return Ce(de).length;default:if(Fe)return He?-1:Ee(de).length;Me=(""+Me).toLowerCase(),Fe=!0}}function S(de,Me,ke){var He=!1;if((Me===void 0||Me<0)&&(Me=0),Me>this.length||((ke===void 0||ke>this.length)&&(ke=this.length),ke<=0)||(ke>>>=0)<=(Me>>>=0))return"";for(de||(de="utf8");;)switch(de){case"hex":return J(this,Me,ke);case"utf8":case"utf-8":return j(this,Me,ke);case"ascii":return ee(this,Me,ke);case"latin1":case"binary":return H(this,Me,ke);case"base64":return V(this,Me,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,Me,ke);default:if(He)throw new TypeError("Unknown encoding: "+de);de=(de+"").toLowerCase(),He=!0}}function T(de,Me,ke){var He=de[Me];de[Me]=de[ke],de[ke]=He}function p(de,Me,ke,He,Fe){if(de.length===0)return-1;if(typeof ke=="string"?(He=ke,ke=0):ke>2147483647?ke=2147483647:ke<-2147483648&&(ke=-2147483648),We(ke=+ke)&&(ke=Fe?0:de.length-1),ke<0&&(ke=de.length+ke),ke>=de.length){if(Fe)return-1;ke=de.length-1}else if(ke<0){if(!Fe)return-1;ke=0}if(typeof Me=="string"&&(Me=c.from(Me,He)),c.isBuffer(Me))return Me.length===0?-1:M(de,Me,ke,He,Fe);if(typeof Me=="number")return Me&=255,typeof Uint8Array.prototype.indexOf=="function"?Fe?Uint8Array.prototype.indexOf.call(de,Me,ke):Uint8Array.prototype.lastIndexOf.call(de,Me,ke):M(de,[Me],ke,He,Fe);throw new TypeError("val must be string, number or Buffer")}function M(de,Me,ke,He,Fe){var qe,$e=1,Ye=de.length,_e=Me.length;if(He!==void 0&&((He=String(He).toLowerCase())==="ucs2"||He==="ucs-2"||He==="utf16le"||He==="utf-16le")){if(de.length<2||Me.length<2)return-1;$e=2,Ye/=2,_e/=2,ke/=2}function De(nt,pt){return $e===1?nt[pt]:nt.readUInt16BE(pt*$e)}if(Fe){var Be=-1;for(qe=ke;qeYe&&(ke=Ye-_e),qe=ke;qe>=0;qe--){for(var Ge=!0,tt=0;tt<_e;tt++)if(De(de,qe+tt)!==De(Me,tt)){Ge=!1;break}if(Ge)return qe}return-1}function f(de,Me,ke,He){ke=Number(ke)||0;var Fe=de.length-ke;He?(He=Number(He))>Fe&&(He=Fe):He=Fe;var qe,$e=Me.length;for(He>$e/2&&(He=$e/2),qe=0;qe>8,_e=$e%256,De.push(_e),De.push(Ye);return De}(Me,de.length-ke),de,ke,He)}function V(de,Me,ke){return Me===0&&ke===de.length?r.fromByteArray(de):r.fromByteArray(de.slice(Me,ke))}function j(de,Me,ke){ke=Math.min(de.length,ke);for(var He=[],Fe=Me;Fe239?4:qe>223?3:qe>191?2:1;if(Fe+Ye<=ke){var _e=void 0,De=void 0,Be=void 0,Ge=void 0;switch(Ye){case 1:qe<128&&($e=qe);break;case 2:(192&(_e=de[Fe+1]))==128&&(Ge=(31&qe)<<6|63&_e)>127&&($e=Ge);break;case 3:_e=de[Fe+1],De=de[Fe+2],(192&_e)==128&&(192&De)==128&&(Ge=(15&qe)<<12|(63&_e)<<6|63&De)>2047&&(Ge<55296||Ge>57343)&&($e=Ge);break;case 4:_e=de[Fe+1],De=de[Fe+2],Be=de[Fe+3],(192&_e)==128&&(192&De)==128&&(192&Be)==128&&(Ge=(15&qe)<<18|(63&_e)<<12|(63&De)<<6|63&Be)>65535&&Ge<1114112&&($e=Ge)}}$e===null?($e=65533,Ye=1):$e>65535&&($e-=65536,He.push($e>>>10&1023|55296),$e=56320|1023&$e),He.push($e),Fe+=Ye}return function(tt){var nt=tt.length;if(nt<=$)return String.fromCharCode.apply(String,tt);for(var pt="",At=0;At"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(de,Me,ke){return h(de,Me,ke)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(de,Me,ke){return function(He,Fe,qe){return x(He),He<=0?s(He):Fe!==void 0?typeof qe=="string"?s(He).fill(Fe,qe):s(He).fill(Fe):s(He)}(de,Me,ke)},c.allocUnsafe=function(de){return m(de)},c.allocUnsafeSlow=function(de){return m(de)},c.isBuffer=function(de){return de!=null&&de._isBuffer===!0&&de!==c.prototype},c.compare=function(de,Me){if(Oe(de,Uint8Array)&&(de=c.from(de,de.offset,de.byteLength)),Oe(Me,Uint8Array)&&(Me=c.from(Me,Me.offset,Me.byteLength)),!c.isBuffer(de)||!c.isBuffer(Me))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(de===Me)return 0;for(var ke=de.length,He=Me.length,Fe=0,qe=Math.min(ke,He);FeHe.length?(c.isBuffer(qe)||(qe=c.from(qe)),qe.copy(He,Fe)):Uint8Array.prototype.set.call(He,qe,Fe);else{if(!c.isBuffer(qe))throw new TypeError('"list" argument must be an Array of Buffers');qe.copy(He,Fe)}Fe+=qe.length}return He},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var de=this.length;if(de%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Me=0;MeMe&&(de+=" ... "),""},l&&(c.prototype[l]=c.prototype.inspect),c.prototype.compare=function(de,Me,ke,He,Fe){if(Oe(de,Uint8Array)&&(de=c.from(de,de.offset,de.byteLength)),!c.isBuffer(de))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(de));if(Me===void 0&&(Me=0),ke===void 0&&(ke=de?de.length:0),He===void 0&&(He=0),Fe===void 0&&(Fe=this.length),Me<0||ke>de.length||He<0||Fe>this.length)throw new RangeError("out of range index");if(He>=Fe&&Me>=ke)return 0;if(He>=Fe)return-1;if(Me>=ke)return 1;if(this===de)return 0;for(var qe=(Fe>>>=0)-(He>>>=0),$e=(ke>>>=0)-(Me>>>=0),Ye=Math.min(qe,$e),_e=this.slice(He,Fe),De=de.slice(Me,ke),Be=0;Be>>=0,isFinite(ke)?(ke>>>=0,He===void 0&&(He="utf8")):(He=ke,ke=void 0)}var Fe=this.length-Me;if((ke===void 0||ke>Fe)&&(ke=Fe),de.length>0&&(ke<0||Me<0)||Me>this.length)throw new RangeError("Attempt to write outside buffer bounds");He||(He="utf8");for(var qe=!1;;)switch(He){case"hex":return f(this,de,Me,ke);case"utf8":case"utf-8":return E(this,de,Me,ke);case"ascii":case"latin1":case"binary":return I(this,de,Me,ke);case"base64":return B(this,de,Me,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,de,Me,ke);default:if(qe)throw new TypeError("Unknown encoding: "+He);He=(""+He).toLowerCase(),qe=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;function ee(de,Me,ke){var He="";ke=Math.min(de.length,ke);for(var Fe=Me;FeHe)&&(ke=He);for(var Fe="",qe=Me;qeke)throw new RangeError("Trying to access beyond buffer length")}function K(de,Me,ke,He,Fe,qe){if(!c.isBuffer(de))throw new TypeError('"buffer" argument must be a Buffer instance');if(Me>Fe||Mede.length)throw new RangeError("Index out of range")}function ae(de,Me,ke,He,Fe){ye(Me,He,Fe,de,ke,7);var qe=Number(Me&BigInt(4294967295));de[ke++]=qe,qe>>=8,de[ke++]=qe,qe>>=8,de[ke++]=qe,qe>>=8,de[ke++]=qe;var $e=Number(Me>>BigInt(32)&BigInt(4294967295));return de[ke++]=$e,$e>>=8,de[ke++]=$e,$e>>=8,de[ke++]=$e,$e>>=8,de[ke++]=$e,ke}function se(de,Me,ke,He,Fe){ye(Me,He,Fe,de,ke,7);var qe=Number(Me&BigInt(4294967295));de[ke+7]=qe,qe>>=8,de[ke+6]=qe,qe>>=8,de[ke+5]=qe,qe>>=8,de[ke+4]=qe;var $e=Number(Me>>BigInt(32)&BigInt(4294967295));return de[ke+3]=$e,$e>>=8,de[ke+2]=$e,$e>>=8,de[ke+1]=$e,$e>>=8,de[ke]=$e,ke+8}function he(de,Me,ke,He,Fe,qe){if(ke+He>de.length)throw new RangeError("Index out of range");if(ke<0)throw new RangeError("Index out of range")}function fe(de,Me,ke,He,Fe){return Me=+Me,ke>>>=0,Fe||he(de,0,ke,4),n.write(de,Me,ke,He,23,4),ke+4}function ie(de,Me,ke,He,Fe){return Me=+Me,ke>>>=0,Fe||he(de,0,ke,8),n.write(de,Me,ke,He,52,8),ke+8}c.prototype.slice=function(de,Me){var ke=this.length;(de=~~de)<0?(de+=ke)<0&&(de=0):de>ke&&(de=ke),(Me=Me===void 0?ke:~~Me)<0?(Me+=ke)<0&&(Me=0):Me>ke&&(Me=ke),Me>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=this[de],Fe=1,qe=0;++qe>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=this[de+--Me],Fe=1;Me>0&&(Fe*=256);)He+=this[de+--Me]*Fe;return He},c.prototype.readUint8=c.prototype.readUInt8=function(de,Me){return de>>>=0,Me||Z(de,1,this.length),this[de]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(de,Me){return de>>>=0,Me||Z(de,2,this.length),this[de]|this[de+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(de,Me){return de>>>=0,Me||Z(de,2,this.length),this[de]<<8|this[de+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),(this[de]|this[de+1]<<8|this[de+2]<<16)+16777216*this[de+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),16777216*this[de]+(this[de+1]<<16|this[de+2]<<8|this[de+3])},c.prototype.readBigUInt64LE=Ve(function(de){me(de>>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=Me+this[++de]*Math.pow(2,8)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,24),Fe=this[++de]+this[++de]*Math.pow(2,8)+this[++de]*Math.pow(2,16)+ke*Math.pow(2,24);return BigInt(He)+(BigInt(Fe)<>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=Me*Math.pow(2,24)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,8)+this[++de],Fe=this[++de]*Math.pow(2,24)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,8)+ke;return(BigInt(He)<>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=this[de],Fe=1,qe=0;++qe=(Fe*=128)&&(He-=Math.pow(2,8*Me)),He},c.prototype.readIntBE=function(de,Me,ke){de>>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=Me,Fe=1,qe=this[de+--He];He>0&&(Fe*=256);)qe+=this[de+--He]*Fe;return qe>=(Fe*=128)&&(qe-=Math.pow(2,8*Me)),qe},c.prototype.readInt8=function(de,Me){return de>>>=0,Me||Z(de,1,this.length),128&this[de]?-1*(255-this[de]+1):this[de]},c.prototype.readInt16LE=function(de,Me){de>>>=0,Me||Z(de,2,this.length);var ke=this[de]|this[de+1]<<8;return 32768&ke?4294901760|ke:ke},c.prototype.readInt16BE=function(de,Me){de>>>=0,Me||Z(de,2,this.length);var ke=this[de+1]|this[de]<<8;return 32768&ke?4294901760|ke:ke},c.prototype.readInt32LE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),this[de]|this[de+1]<<8|this[de+2]<<16|this[de+3]<<24},c.prototype.readInt32BE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),this[de]<<24|this[de+1]<<16|this[de+2]<<8|this[de+3]},c.prototype.readBigInt64LE=Ve(function(de){me(de>>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=this[de+4]+this[de+5]*Math.pow(2,8)+this[de+6]*Math.pow(2,16)+(ke<<24);return(BigInt(He)<>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=(Me<<24)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,8)+this[++de];return(BigInt(He)<>>=0,Me||Z(de,4,this.length),n.read(this,de,!0,23,4)},c.prototype.readFloatBE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),n.read(this,de,!1,23,4)},c.prototype.readDoubleLE=function(de,Me){return de>>>=0,Me||Z(de,8,this.length),n.read(this,de,!0,52,8)},c.prototype.readDoubleBE=function(de,Me){return de>>>=0,Me||Z(de,8,this.length),n.read(this,de,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(de,Me,ke,He){de=+de,Me>>>=0,ke>>>=0,He||K(this,de,Me,ke,Math.pow(2,8*ke)-1,0);var Fe=1,qe=0;for(this[Me]=255&de;++qe>>=0,ke>>>=0,He||K(this,de,Me,ke,Math.pow(2,8*ke)-1,0);var Fe=ke-1,qe=1;for(this[Me+Fe]=255&de;--Fe>=0&&(qe*=256);)this[Me+Fe]=de/qe&255;return Me+ke},c.prototype.writeUint8=c.prototype.writeUInt8=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,1,255,0),this[Me]=255&de,Me+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,65535,0),this[Me]=255&de,this[Me+1]=de>>>8,Me+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,65535,0),this[Me]=de>>>8,this[Me+1]=255&de,Me+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,4294967295,0),this[Me+3]=de>>>24,this[Me+2]=de>>>16,this[Me+1]=de>>>8,this[Me]=255&de,Me+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,4294967295,0),this[Me]=de>>>24,this[Me+1]=de>>>16,this[Me+2]=de>>>8,this[Me+3]=255&de,Me+4},c.prototype.writeBigUInt64LE=Ve(function(de){return ae(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Ve(function(de){return se(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(de,Me,ke,He){if(de=+de,Me>>>=0,!He){var Fe=Math.pow(2,8*ke-1);K(this,de,Me,ke,Fe-1,-Fe)}var qe=0,$e=1,Ye=0;for(this[Me]=255&de;++qe>0)-Ye&255;return Me+ke},c.prototype.writeIntBE=function(de,Me,ke,He){if(de=+de,Me>>>=0,!He){var Fe=Math.pow(2,8*ke-1);K(this,de,Me,ke,Fe-1,-Fe)}var qe=ke-1,$e=1,Ye=0;for(this[Me+qe]=255&de;--qe>=0&&($e*=256);)de<0&&Ye===0&&this[Me+qe+1]!==0&&(Ye=1),this[Me+qe]=(de/$e>>0)-Ye&255;return Me+ke},c.prototype.writeInt8=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,1,127,-128),de<0&&(de=255+de+1),this[Me]=255&de,Me+1},c.prototype.writeInt16LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,32767,-32768),this[Me]=255&de,this[Me+1]=de>>>8,Me+2},c.prototype.writeInt16BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,32767,-32768),this[Me]=de>>>8,this[Me+1]=255&de,Me+2},c.prototype.writeInt32LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,2147483647,-2147483648),this[Me]=255&de,this[Me+1]=de>>>8,this[Me+2]=de>>>16,this[Me+3]=de>>>24,Me+4},c.prototype.writeInt32BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,2147483647,-2147483648),de<0&&(de=4294967295+de+1),this[Me]=de>>>24,this[Me+1]=de>>>16,this[Me+2]=de>>>8,this[Me+3]=255&de,Me+4},c.prototype.writeBigInt64LE=Ve(function(de){return ae(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Ve(function(de){return se(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(de,Me,ke){return fe(this,de,Me,!0,ke)},c.prototype.writeFloatBE=function(de,Me,ke){return fe(this,de,Me,!1,ke)},c.prototype.writeDoubleLE=function(de,Me,ke){return ie(this,de,Me,!0,ke)},c.prototype.writeDoubleBE=function(de,Me,ke){return ie(this,de,Me,!1,ke)},c.prototype.copy=function(de,Me,ke,He){if(!c.isBuffer(de))throw new TypeError("argument should be a Buffer");if(ke||(ke=0),He||He===0||(He=this.length),Me>=de.length&&(Me=de.length),Me||(Me=0),He>0&&He=this.length)throw new RangeError("Index out of range");if(He<0)throw new RangeError("sourceEnd out of bounds");He>this.length&&(He=this.length),de.length-Me>>=0,ke=ke===void 0?this.length:ke>>>0,de||(de=0),typeof de=="number")for(qe=Me;qe=He+4;ke-=3)Me="_".concat(de.slice(ke-3,ke)).concat(Me);return"".concat(de.slice(0,ke)).concat(Me)}function ye(de,Me,ke,He,Fe,qe){if(de>ke||de3?Me===0||Me===BigInt(0)?">= 0".concat(Ye," and < 2").concat(Ye," ** ").concat(8*(qe+1)).concat(Ye):">= -(2".concat(Ye," ** ").concat(8*(qe+1)-1).concat(Ye,") and < 2 ** ")+"".concat(8*(qe+1)-1).concat(Ye):">= ".concat(Me).concat(Ye," and <= ").concat(ke).concat(Ye),new oe.ERR_OUT_OF_RANGE("value",$e,de)}(function(_e,De,Be){me(De,"offset"),_e[De]!==void 0&&_e[De+Be]!==void 0||be(De,_e.length-(Be+1))})(He,Fe,qe)}function me(de,Me){if(typeof de!="number")throw new oe.ERR_INVALID_ARG_TYPE(Me,"number",de)}function be(de,Me,ke){throw Math.floor(de)!==de?(me(de,ke),new oe.ERR_OUT_OF_RANGE(ke||"offset","an integer",de)):Me<0?new oe.ERR_BUFFER_OUT_OF_BOUNDS:new oe.ERR_OUT_OF_RANGE(ke||"offset",">= ".concat(ke?1:0," and <= ").concat(Me),de)}le("ERR_BUFFER_OUT_OF_BOUNDS",function(de){return de?"".concat(de," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),le("ERR_INVALID_ARG_TYPE",function(de,Me){return'The "'.concat(de,'" argument must be of type number. Received type ').concat(u(Me))},TypeError),le("ERR_OUT_OF_RANGE",function(de,Me,ke){var He='The value of "'.concat(de,'" is out of range.'),Fe=ke;return Number.isInteger(ke)&&Math.abs(ke)>Math.pow(2,32)?Fe=ge(String(ke)):typeof ke=="bigint"&&(Fe=String(ke),(ke>Math.pow(BigInt(2),BigInt(32))||ke<-Math.pow(BigInt(2),BigInt(32)))&&(Fe=ge(Fe)),Fe+="n"),He+" It must be ".concat(Me,". Received ").concat(Fe)},RangeError);var Se=/[^+/0-9A-Za-z-_]/g;function Ee(de,Me){var ke;Me=Me||1/0;for(var He=de.length,Fe=null,qe=[],$e=0;$e55295&&ke<57344){if(!Fe){if(ke>56319){(Me-=3)>-1&&qe.push(239,191,189);continue}if($e+1===He){(Me-=3)>-1&&qe.push(239,191,189);continue}Fe=ke;continue}if(ke<56320){(Me-=3)>-1&&qe.push(239,191,189),Fe=ke;continue}ke=65536+(Fe-55296<<10|ke-56320)}else Fe&&(Me-=3)>-1&&qe.push(239,191,189);if(Fe=null,ke<128){if((Me-=1)<0)break;qe.push(ke)}else if(ke<2048){if((Me-=2)<0)break;qe.push(ke>>6|192,63&ke|128)}else if(ke<65536){if((Me-=3)<0)break;qe.push(ke>>12|224,ke>>6&63|128,63&ke|128)}else{if(!(ke<1114112))throw new Error("Invalid code point");if((Me-=4)<0)break;qe.push(ke>>18|240,ke>>12&63|128,ke>>6&63|128,63&ke|128)}}return qe}function Ce(de){return r.toByteArray(function(Me){if((Me=(Me=Me.split("=")[0]).trim().replace(Se,"")).length<2)return"";for(;Me.length%4!=0;)Me+="=";return Me}(de))}function Le(de,Me,ke,He){var Fe;for(Fe=0;Fe=Me.length||Fe>=de.length);++Fe)Me[Fe+ke]=de[Fe];return Fe}function Oe(de,Me){return de instanceof Me||de!=null&&de.constructor!=null&&de.constructor.name!=null&&de.constructor.name===Me.name}function We(de){return de!=de}var Ie=function(){for(var de="0123456789abcdef",Me=new Array(256),ke=0;ke<16;++ke)for(var He=16*ke,Fe=0;Fe<16;++Fe)Me[He+Fe]=de[ke]+de[Fe];return Me}();function Ve(de){return typeof BigInt>"u"?Pe:de}function Pe(){throw new Error("BigInt not supported")}},13087:function(D){D.exports=d,D.exports.isMobile=d,D.exports.default=d;var L=/(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,t=/CrOS/,b=/android|ipad|playbook|silk/i;function d(e){e||(e={});var w=e.ua;if(w||typeof navigator>"u"||(w=navigator.userAgent),w&&w.headers&&typeof w.headers["user-agent"]=="string"&&(w=w.headers["user-agent"]),typeof w!="string")return!1;var y=L.test(w)&&!t.test(w)||!!e.tablet&&b.test(w);return!y&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&w.indexOf("Macintosh")!==-1&&w.indexOf("Safari")!==-1&&(y=!0),y}},5955:function(D,L,t){var b=t(22413),d=t.n(b),e=t(51070),w=t.n(e),y=t(62133),_=t.n(y),u=new URL(t(77035),t.b),r=new URL(t(43470),t.b),n=new URL(t(68164),t.b),l=new URL(t(64665),t.b),o=new URL(t(4890),t.b),s=new URL(t(13363),t.b),c=new URL(t(13490),t.b),h=new URL(t(47603),t.b),x=new URL(t(13913),t.b),m=new URL(t(91413),t.b),g=new URL(t(64643),t.b),k=new URL(t(80216),t.b),A=new URL(t(61907),t.b),v=new URL(t(68605),t.b),S=new URL(t(25446),t.b),T=new URL(t(56694),t.b),p=new URL(t(24420),t.b),M=new URL(t(75796),t.b),f=new URL(t(92228),t.b),E=new URL(t(9819),t.b),I=new URL(t(47695),t.b),B=new URL(t(28869),t.b),N=new URL(t(30557),t.b),V=new URL(t(48460),t.b),j=new URL(t(56539),t.b),$=new URL(t(43737),t.b),ee=new URL(t(47914),t.b),H=new URL(t(26117),t.b),J=new URL(t(66311),t.b),Q=w()(d()),Z=_()(u),K=_()(r),ae=_()(n),se=_()(l),he=_()(o),fe=_()(s),ie=_()(c),oe=_()(h),le=_()(x),ge=_()(m),ye=_()(g),me=_()(k),be=_()(A),Se=_()(v),Ee=_()(S),Ce=_()(T),Le=_()(p),Oe=_()(M),We=_()(f),Ie=_()(E),Ve=_()(I),Pe=_()(B),de=_()(N),Me=_()(V),ke=_()(j),He=_()($),Fe=_()(ee),qe=_()(H),$e=_()(J);Q.push([D.id,".maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("+Z+")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("+K+")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("+ae+")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("+se+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("+he+")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("+fe+")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("+ie+")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("+oe+")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("+le+")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("+ge+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("+ye+")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("+oe+")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("+me+")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("+be+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("+Se+")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("+Ee+")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("+Ce+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("+Le+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("+Oe+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("+We+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("+Ie+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("+Ve+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("+Pe+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("+de+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("+Me+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("+We+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("+Ie+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("+Ve+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("+Pe+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("+ke+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("+He+")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("+Fe+");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("+Fe+")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("+Fe+")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("+qe+");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("+$e+")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("+qe+')}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}',""]),L.A=Q},68735:function(D,L,t){t.r(L),t.d(L,{sankeyCenter:function(){return l},sankeyCircular:function(){return B},sankeyJustify:function(){return n},sankeyLeft:function(){return u},sankeyRight:function(){return r}});var b=t(29725),d=t(4575),e=t(48544),w=t(96143),y=t.n(w);function _(Ee){return Ee.target.depth}function u(Ee){return Ee.depth}function r(Ee,Ce){return Ce-1-Ee.height}function n(Ee,Ce){return Ee.sourceLinks.length?Ee.depth:Ce-1}function l(Ee){return Ee.targetLinks.length?Ee.depth:Ee.sourceLinks.length?(0,b.jk)(Ee.sourceLinks,_)-1:0}function o(Ee){return function(){return Ee}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ee){return typeof Ee}:function(Ee){return Ee&&typeof Symbol=="function"&&Ee.constructor===Symbol&&Ee!==Symbol.prototype?"symbol":typeof Ee};function c(Ee,Ce){return x(Ee.source,Ce.source)||Ee.index-Ce.index}function h(Ee,Ce){return x(Ee.target,Ce.target)||Ee.index-Ce.index}function x(Ee,Ce){return Ee.partOfCycle===Ce.partOfCycle?Ee.y0-Ce.y0:Ee.circularLinkType==="top"||Ce.circularLinkType==="bottom"?-1:1}function m(Ee){return Ee.value}function g(Ee){return(Ee.y0+Ee.y1)/2}function k(Ee){return g(Ee.source)}function A(Ee){return g(Ee.target)}function v(Ee){return Ee.index}function S(Ee){return Ee.nodes}function T(Ee){return Ee.links}function p(Ee,Ce){var Le=Ee.get(Ce);if(!Le)throw new Error("missing: "+Ce);return Le}function M(Ee,Ce){return Ce(Ee)}var f=25,E=10,I=.3;function B(){var Ee,Ce,Le=0,Oe=0,We=1,Ie=1,Ve=24,Pe=v,de=n,Me=S,ke=T,He=32,Fe=2,qe=null;function $e(){var _e={nodes:Me.apply(null,arguments),links:ke.apply(null,arguments)};(function(Be){Be.nodes.forEach(function(tt,nt){tt.index=nt,tt.sourceLinks=[],tt.targetLinks=[]});var Ge=(0,d.Tj)(Be.nodes,Pe);Be.links.forEach(function(tt,nt){tt.index=nt;var pt=tt.source,At=tt.target;(pt===void 0?"undefined":s(pt))!=="object"&&(pt=tt.source=p(Ge,pt)),(At===void 0?"undefined":s(At))!=="object"&&(At=tt.target=p(Ge,At)),pt.sourceLinks.push(tt),At.targetLinks.push(tt)})})(_e),function(Be,Ge,tt){var nt=0;if(tt===null){for(var pt=[],At=0;At0?Ot+f+E:Ot,bottom:Pt=Pt>0?Pt+f+E:Pt,left:lt=lt>0?lt+f+E:lt,right:at=at>0?at+f+E:at}}(Be),ft=function(yt,Ot){var Pt=(0,b.T9)(yt.nodes,function(Tt){return Tt.column}),at=We-Le,lt=Ie-Oe,Xe=at/(at+Ot.right+Ot.left),ut=lt/(lt+Ot.top+Ot.bottom);return Le=Le*Xe+Ot.left,We=Ot.right==0?We:We*Xe,Oe=Oe*ut+Ot.top,Ie*=ut,yt.nodes.forEach(function(Tt){Tt.x0=Le+Tt.column*((We-Le-Ve)/Pt),Tt.x1=Tt.x0+Ve}),ut}(Be,Qe);st*=ft,Be.links.forEach(function(yt){yt.width=yt.value*st}),nt.forEach(function(yt){var Ot=yt.length;yt.forEach(function(Pt,at){Pt.depth==nt.length-1&&Ot==1||Pt.depth==0&&Ot==1?(Pt.y0=Ie/2-Pt.value*st,Pt.y1=Pt.y0+Pt.value*st):Pt.partOfCycle?j(Pt,Ht)==0?(Pt.y0=Ie/2+at,Pt.y1=Pt.y0+Pt.value*st):Pt.circularLinkType=="top"?(Pt.y0=Oe+at,Pt.y1=Pt.y0+Pt.value*st):(Pt.y0=Ie-Pt.value*st-at,Pt.y1=Pt.y0+Pt.value*st):Qe.top==0||Qe.bottom==0?(Pt.y0=(Ie-Oe)/Ot*at,Pt.y1=Pt.y0+Pt.value*st):(Pt.y0=(Ie-Oe)/2-Ot/2+at,Pt.y1=Pt.y0+Pt.value*st)})})})(tt),Nt();for(var pt=1,At=Ge;At>0;--At)wt(pt*=.99,tt),Nt();function wt(Ht,Gt){var st=nt.length;nt.forEach(function(Qe){var ft=Qe.length,yt=Qe[0].depth;Qe.forEach(function(Ot){var Pt;if((Ot.sourceLinks.length||Ot.targetLinks.length)&&!(Ot.partOfCycle&&j(Ot,Gt)>0))if(yt==0&&ft==1)Pt=Ot.y1-Ot.y0,Ot.y0=Ie/2-Pt/2,Ot.y1=Ie/2+Pt/2;else if(yt==st-1&&ft==1)Pt=Ot.y1-Ot.y0,Ot.y0=Ie/2-Pt/2,Ot.y1=Ie/2+Pt/2;else{var at=(0,b.i2)(Ot.sourceLinks,A),lt=(0,b.i2)(Ot.targetLinks,k),Xe=((at&<?(at+lt)/2:at||lt)-g(Ot))*Ht;Ot.y0+=Xe,Ot.y1+=Xe}})})}function Nt(){nt.forEach(function(Ht){var Gt,st,Qe,ft=Oe,yt=Ht.length;for(Ht.sort(x),Qe=0;Qe0&&(Gt.y0+=st,Gt.y1+=st),ft=Gt.y1+Ee;if((st=ft-Ee-Ie)>0)for(ft=Gt.y0-=st,Gt.y1-=st,Qe=yt-2;Qe>=0;--Qe)(st=(Gt=Ht[Qe]).y1+Ee-ft)>0&&(Gt.y0-=st,Gt.y1-=st),ft=Gt.y0})}}(_e,He,Pe),Ye(_e);for(var De=0;De<4;De++)ge(_e,Ie,Pe),ye(_e,0,Pe),oe(_e,Oe,Ie,Pe),ge(_e,Ie,Pe),ye(_e,0,Pe);return function(Be,Ge,tt){var nt=Be.nodes,pt=Be.links,At=!1,wt=!1;if(pt.forEach(function(Gt){Gt.circularLinkType=="top"?At=!0:Gt.circularLinkType=="bottom"&&(wt=!0)}),At==0||wt==0){var Nt=(0,b.jk)(nt,function(Gt){return Gt.y0}),Ht=(tt-Ge)/((0,b.T9)(nt,function(Gt){return Gt.y1})-Nt);nt.forEach(function(Gt){var st=(Gt.y1-Gt.y0)*Ht;Gt.y0=(Gt.y0-Nt)*Ht,Gt.y1=Gt.y0+st}),pt.forEach(function(Gt){Gt.y0=(Gt.y0-Nt)*Ht,Gt.y1=(Gt.y1-Nt)*Ht,Gt.width=Gt.width*Ht})}}(_e,Oe,Ie),H(_e,Fe,Ie,Pe),_e}function Ye(_e){_e.nodes.forEach(function(De){De.sourceLinks.sort(h),De.targetLinks.sort(c)}),_e.nodes.forEach(function(De){var Be=De.y0,Ge=Be,tt=De.y1,nt=tt;De.sourceLinks.forEach(function(pt){pt.circular?(pt.y0=tt-pt.width/2,tt-=pt.width):(pt.y0=Be+pt.width/2,Be+=pt.width)}),De.targetLinks.forEach(function(pt){pt.circular?(pt.y1=nt-pt.width/2,nt-=pt.width):(pt.y1=Ge+pt.width/2,Ge+=pt.width)})})}return $e.nodeId=function(_e){return arguments.length?(Pe=typeof _e=="function"?_e:o(_e),$e):Pe},$e.nodeAlign=function(_e){return arguments.length?(de=typeof _e=="function"?_e:o(_e),$e):de},$e.nodeWidth=function(_e){return arguments.length?(Ve=+_e,$e):Ve},$e.nodePadding=function(_e){return arguments.length?(Ee=+_e,$e):Ee},$e.nodes=function(_e){return arguments.length?(Me=typeof _e=="function"?_e:o(_e),$e):Me},$e.links=function(_e){return arguments.length?(ke=typeof _e=="function"?_e:o(_e),$e):ke},$e.size=function(_e){return arguments.length?(Le=Oe=0,We=+_e[0],Ie=+_e[1],$e):[We-Le,Ie-Oe]},$e.extent=function(_e){return arguments.length?(Le=+_e[0][0],We=+_e[1][0],Oe=+_e[0][1],Ie=+_e[1][1],$e):[[Le,Oe],[We,Ie]]},$e.iterations=function(_e){return arguments.length?(He=+_e,$e):He},$e.circularLinkGap=function(_e){return arguments.length?(Fe=+_e,$e):Fe},$e.nodePaddingRatio=function(_e){return arguments.length?(Ce=+_e,$e):Ce},$e.sortNodes=function(_e){return arguments.length?(qe=_e,$e):qe},$e.update=function(_e){return N(_e,Pe),Ye(_e),_e.links.forEach(function(De){De.circular&&(De.circularLinkType=De.y0+De.y11||We>1)}function ee(Ee,Ce,Le){return Ee.sort(J),Ee.forEach(function(Oe,We){var Ie,Ve,Pe=0;if(Se(Oe,Le)&&$(Oe))Oe.circularPathData.verticalBuffer=Pe+Oe.width/2;else{for(var de=0;deVe.source.column)){var Me=Ee[de].circularPathData.verticalBuffer+Ee[de].width/2+Ce;Pe=Me>Pe?Me:Pe}Oe.circularPathData.verticalBuffer=Pe+Oe.width/2}}),Ee}function H(Ee,Ce,Le,Oe){var We=(0,b.jk)(Ee.links,function(Ie){return Ie.source.y0});Ee.links.forEach(function(Ie){Ie.circular&&(Ie.circularPathData={})}),ee(Ee.links.filter(function(Ie){return Ie.circularLinkType=="top"}),Ce,Oe),ee(Ee.links.filter(function(Ie){return Ie.circularLinkType=="bottom"}),Ce,Oe),Ee.links.forEach(function(Ie){if(Ie.circular){if(Ie.circularPathData.arcRadius=Ie.width+E,Ie.circularPathData.leftNodeBuffer=5,Ie.circularPathData.rightNodeBuffer=5,Ie.circularPathData.sourceWidth=Ie.source.x1-Ie.source.x0,Ie.circularPathData.sourceX=Ie.source.x0+Ie.circularPathData.sourceWidth,Ie.circularPathData.targetX=Ie.target.x0,Ie.circularPathData.sourceY=Ie.y0,Ie.circularPathData.targetY=Ie.y1,Se(Ie,Oe)&&$(Ie))Ie.circularPathData.leftSmallArcRadius=E+Ie.width/2,Ie.circularPathData.leftLargeArcRadius=E+Ie.width/2,Ie.circularPathData.rightSmallArcRadius=E+Ie.width/2,Ie.circularPathData.rightLargeArcRadius=E+Ie.width/2,Ie.circularLinkType=="bottom"?(Ie.circularPathData.verticalFullExtent=Ie.source.y1+f+Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.rightLargeArcRadius):(Ie.circularPathData.verticalFullExtent=Ie.source.y0-f-Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.rightLargeArcRadius);else{var Ve=Ie.source.column,Pe=Ie.circularLinkType,de=Ee.links.filter(function(He){return He.source.column==Ve&&He.circularLinkType==Pe});Ie.circularLinkType=="bottom"?de.sort(Z):de.sort(Q);var Me=0;de.forEach(function(He,Fe){He.circularLinkID==Ie.circularLinkID&&(Ie.circularPathData.leftSmallArcRadius=E+Ie.width/2+Me,Ie.circularPathData.leftLargeArcRadius=E+Ie.width/2+Fe*Ce+Me),Me+=He.width}),Ve=Ie.target.column,de=Ee.links.filter(function(He){return He.target.column==Ve&&He.circularLinkType==Pe}),Ie.circularLinkType=="bottom"?de.sort(ae):de.sort(K),Me=0,de.forEach(function(He,Fe){He.circularLinkID==Ie.circularLinkID&&(Ie.circularPathData.rightSmallArcRadius=E+Ie.width/2+Me,Ie.circularPathData.rightLargeArcRadius=E+Ie.width/2+Fe*Ce+Me),Me+=He.width}),Ie.circularLinkType=="bottom"?(Ie.circularPathData.verticalFullExtent=Math.max(Le,Ie.source.y1,Ie.target.y1)+f+Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.rightLargeArcRadius):(Ie.circularPathData.verticalFullExtent=We-f-Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.rightLargeArcRadius)}Ie.circularPathData.leftInnerExtent=Ie.circularPathData.sourceX+Ie.circularPathData.leftNodeBuffer,Ie.circularPathData.rightInnerExtent=Ie.circularPathData.targetX-Ie.circularPathData.rightNodeBuffer,Ie.circularPathData.leftFullExtent=Ie.circularPathData.sourceX+Ie.circularPathData.leftLargeArcRadius+Ie.circularPathData.leftNodeBuffer,Ie.circularPathData.rightFullExtent=Ie.circularPathData.targetX-Ie.circularPathData.rightLargeArcRadius-Ie.circularPathData.rightNodeBuffer}if(Ie.circular)Ie.path=function(He){return He.circularLinkType=="top"?"M"+He.circularPathData.sourceX+" "+He.circularPathData.sourceY+" L"+He.circularPathData.leftInnerExtent+" "+He.circularPathData.sourceY+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftSmallArcRadius+" 0 0 0 "+He.circularPathData.leftFullExtent+" "+(He.circularPathData.sourceY-He.circularPathData.leftSmallArcRadius)+" L"+He.circularPathData.leftFullExtent+" "+He.circularPathData.verticalLeftInnerExtent+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftLargeArcRadius+" 0 0 0 "+He.circularPathData.leftInnerExtent+" "+He.circularPathData.verticalFullExtent+" L"+He.circularPathData.rightInnerExtent+" "+He.circularPathData.verticalFullExtent+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightLargeArcRadius+" 0 0 0 "+He.circularPathData.rightFullExtent+" "+He.circularPathData.verticalRightInnerExtent+" L"+He.circularPathData.rightFullExtent+" "+(He.circularPathData.targetY-He.circularPathData.rightSmallArcRadius)+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightSmallArcRadius+" 0 0 0 "+He.circularPathData.rightInnerExtent+" "+He.circularPathData.targetY+" L"+He.circularPathData.targetX+" "+He.circularPathData.targetY:"M"+He.circularPathData.sourceX+" "+He.circularPathData.sourceY+" L"+He.circularPathData.leftInnerExtent+" "+He.circularPathData.sourceY+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftSmallArcRadius+" 0 0 1 "+He.circularPathData.leftFullExtent+" "+(He.circularPathData.sourceY+He.circularPathData.leftSmallArcRadius)+" L"+He.circularPathData.leftFullExtent+" "+He.circularPathData.verticalLeftInnerExtent+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftLargeArcRadius+" 0 0 1 "+He.circularPathData.leftInnerExtent+" "+He.circularPathData.verticalFullExtent+" L"+He.circularPathData.rightInnerExtent+" "+He.circularPathData.verticalFullExtent+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightLargeArcRadius+" 0 0 1 "+He.circularPathData.rightFullExtent+" "+He.circularPathData.verticalRightInnerExtent+" L"+He.circularPathData.rightFullExtent+" "+(He.circularPathData.targetY+He.circularPathData.rightSmallArcRadius)+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightSmallArcRadius+" 0 0 1 "+He.circularPathData.rightInnerExtent+" "+He.circularPathData.targetY+" L"+He.circularPathData.targetX+" "+He.circularPathData.targetY}(Ie);else{var ke=(0,e.pq)().source(function(He){return[He.source.x0+(He.source.x1-He.source.x0),He.y0]}).target(function(He){return[He.target.x0,He.y1]});Ie.path=ke(Ie)}})}function J(Ee,Ce){return se(Ee)==se(Ce)?Ee.circularLinkType=="bottom"?Z(Ee,Ce):Q(Ee,Ce):se(Ce)-se(Ee)}function Q(Ee,Ce){return Ee.y0-Ce.y0}function Z(Ee,Ce){return Ce.y0-Ee.y0}function K(Ee,Ce){return Ee.y1-Ce.y1}function ae(Ee,Ce){return Ce.y1-Ee.y1}function se(Ee){return Ee.target.column-Ee.source.column}function he(Ee){return Ee.target.x0-Ee.source.x1}function fe(Ee,Ce){var Le=V(Ee),Oe=he(Ce)/Math.tan(Le);return be(Ee)=="up"?Ee.y1+Oe:Ee.y1-Oe}function ie(Ee,Ce){var Le=V(Ee),Oe=he(Ce)/Math.tan(Le);return be(Ee)=="up"?Ee.y1-Oe:Ee.y1+Oe}function oe(Ee,Ce,Le,Oe){Ee.links.forEach(function(We){if(!We.circular&&We.target.column-We.source.column>1){var Ie=We.source.column+1,Ve=We.target.column-1,Pe=1,de=Ve-Ie+1;for(Pe=1;Ie<=Ve;Ie++,Pe++)Ee.nodes.forEach(function(Me){if(Me.column==Ie){var ke,He=Pe/(de+1),Fe=Math.pow(1-He,3),qe=3*He*Math.pow(1-He,2),$e=3*Math.pow(He,2)*(1-He),Ye=Math.pow(He,3),_e=Fe*We.y0+qe*We.y0+$e*We.y1+Ye*We.y1,De=_e-We.width/2,Be=_e+We.width/2;De>Me.y0&&Dent.y0&&tt.y0nt.y0&&tt.y1nt.y1)&&le(Ge,ke,Ce,Le)})):(Be>Me.y0&&BeMe.y1)&&(ke=Be-Me.y0+10,Me=le(Me,ke,Ce,Le),Ee.nodes.forEach(function(Ge){M(Ge,Oe)!=M(Me,Oe)&&Ge.column==Me.column&&Ge.y0Me.y1&&le(Ge,ke,Ce,Le)}))}})}})}function le(Ee,Ce,Le,Oe){return Ee.y0+Ce>=Le&&Ee.y1+Ce<=Oe&&(Ee.y0=Ee.y0+Ce,Ee.y1=Ee.y1+Ce,Ee.targetLinks.forEach(function(We){We.y1=We.y1+Ce}),Ee.sourceLinks.forEach(function(We){We.y0=We.y0+Ce})),Ee}function ge(Ee,Ce,Le,Oe){Ee.nodes.forEach(function(We){Oe&&We.y+(We.y1-We.y0)>Ce&&(We.y=We.y-(We.y+(We.y1-We.y0)-Ce));var Ie=Ee.links.filter(function(de){return M(de.source,Le)==M(We,Le)}),Ve=Ie.length;Ve>1&&Ie.sort(function(de,Me){if(!de.circular&&!Me.circular){if(de.target.column==Me.target.column||!me(de,Me))return de.y1-Me.y1;if(de.target.column>Me.target.column){var ke=ie(Me,de);return de.y1-ke}if(Me.target.column>de.target.column)return ie(de,Me)-Me.y1}return de.circular&&!Me.circular?de.circularLinkType=="top"?-1:1:Me.circular&&!de.circular?Me.circularLinkType=="top"?1:-1:de.circular&&Me.circular?de.circularLinkType===Me.circularLinkType&&de.circularLinkType=="top"?de.target.column===Me.target.column?de.target.y1-Me.target.y1:Me.target.column-de.target.column:de.circularLinkType===Me.circularLinkType&&de.circularLinkType=="bottom"?de.target.column===Me.target.column?Me.target.y1-de.target.y1:de.target.column-Me.target.column:de.circularLinkType=="top"?-1:1:void 0});var Pe=We.y0;Ie.forEach(function(de){de.y0=Pe+de.width/2,Pe+=de.width}),Ie.forEach(function(de,Me){if(de.circularLinkType=="bottom"){for(var ke=Me+1,He=0;ke1&&We.sort(function(Pe,de){if(!Pe.circular&&!de.circular){if(Pe.source.column==de.source.column||!me(Pe,de))return Pe.y0-de.y0;if(de.source.column0?"up":"down"}function Se(Ee,Ce){return M(Ee.source,Ce)==M(Ee.target,Ce)}},62369:function(D,L,t){t.r(L),t.d(L,{sankey:function(){return v},sankeyCenter:function(){return u},sankeyJustify:function(){return _},sankeyLeft:function(){return w},sankeyLinkHorizontal:function(){return M},sankeyRight:function(){return y}});var b=t(29725),d=t(4575);function e(f){return f.target.depth}function w(f){return f.depth}function y(f,E){return E-1-f.height}function _(f,E){return f.sourceLinks.length?f.depth:E-1}function u(f){return f.targetLinks.length?f.depth:f.sourceLinks.length?(0,b.jk)(f.sourceLinks,e)-1:0}function r(f){return function(){return f}}function n(f,E){return o(f.source,E.source)||f.index-E.index}function l(f,E){return o(f.target,E.target)||f.index-E.index}function o(f,E){return f.y0-E.y0}function s(f){return f.value}function c(f){return(f.y0+f.y1)/2}function h(f){return c(f.source)*f.value}function x(f){return c(f.target)*f.value}function m(f){return f.index}function g(f){return f.nodes}function k(f){return f.links}function A(f,E){var I=f.get(E);if(!I)throw new Error("missing: "+E);return I}function v(){var f=0,E=0,I=1,B=1,N=24,V=8,j=m,$=_,ee=g,H=k,J=32;function Q(){var K={nodes:ee.apply(null,arguments),links:H.apply(null,arguments)};return function(ae){ae.nodes.forEach(function(he,fe){he.index=fe,he.sourceLinks=[],he.targetLinks=[]});var se=(0,d.Tj)(ae.nodes,j);ae.links.forEach(function(he,fe){he.index=fe;var ie=he.source,oe=he.target;typeof ie!="object"&&(ie=he.source=A(se,ie)),typeof oe!="object"&&(oe=he.target=A(se,oe)),ie.sourceLinks.push(he),oe.targetLinks.push(he)})}(K),function(ae){ae.nodes.forEach(function(se){se.value=Math.max((0,b.cz)(se.sourceLinks,s),(0,b.cz)(se.targetLinks,s))})}(K),function(ae){var se,he,fe;for(se=ae.nodes,he=[],fe=0;se.length;++fe,se=he,he=[])se.forEach(function(oe){oe.depth=fe,oe.sourceLinks.forEach(function(le){he.indexOf(le.target)<0&&he.push(le.target)})});for(se=ae.nodes,he=[],fe=0;se.length;++fe,se=he,he=[])se.forEach(function(oe){oe.height=fe,oe.targetLinks.forEach(function(le){he.indexOf(le.source)<0&&he.push(le.source)})});var ie=(I-f-N)/(fe-1);ae.nodes.forEach(function(oe){oe.x1=(oe.x0=f+Math.max(0,Math.min(fe-1,Math.floor($.call(null,oe,fe))))*ie)+N})}(K),function(ae){var se=(0,d.$I)().key(function(ge){return ge.x0}).sortKeys(b.V_).entries(ae.nodes).map(function(ge){return ge.values});(function(){var ge=(0,b.T9)(se,function(be){return be.length}),ye=.6666666666666666*(B-E)/(ge-1);V>ye&&(V=ye);var me=(0,b.jk)(se,function(be){return(B-E-(be.length-1)*V)/(0,b.cz)(be,s)});se.forEach(function(be){be.forEach(function(Se,Ee){Se.y1=(Se.y0=Ee)+Se.value*me})}),ae.links.forEach(function(be){be.width=be.value*me})})(),le();for(var he=1,fe=J;fe>0;--fe)oe(he*=.99),le(),ie(he),le();function ie(ge){se.forEach(function(ye){ye.forEach(function(me){if(me.targetLinks.length){var be=((0,b.cz)(me.targetLinks,h)/(0,b.cz)(me.targetLinks,s)-c(me))*ge;me.y0+=be,me.y1+=be}})})}function oe(ge){se.slice().reverse().forEach(function(ye){ye.forEach(function(me){if(me.sourceLinks.length){var be=((0,b.cz)(me.sourceLinks,x)/(0,b.cz)(me.sourceLinks,s)-c(me))*ge;me.y0+=be,me.y1+=be}})})}function le(){se.forEach(function(ge){var ye,me,be,Se=E,Ee=ge.length;for(ge.sort(o),be=0;be0&&(ye.y0+=me,ye.y1+=me),Se=ye.y1+V;if((me=Se-V-B)>0)for(Se=ye.y0-=me,ye.y1-=me,be=Ee-2;be>=0;--be)(me=(ye=ge[be]).y1+V-Se)>0&&(ye.y0-=me,ye.y1-=me),Se=ye.y0})}}(K),Z(K),K}function Z(K){K.nodes.forEach(function(ae){ae.sourceLinks.sort(l),ae.targetLinks.sort(n)}),K.nodes.forEach(function(ae){var se=ae.y0,he=se;ae.sourceLinks.forEach(function(fe){fe.y0=se+fe.width/2,se+=fe.width}),ae.targetLinks.forEach(function(fe){fe.y1=he+fe.width/2,he+=fe.width})})}return Q.update=function(K){return Z(K),K},Q.nodeId=function(K){return arguments.length?(j=typeof K=="function"?K:r(K),Q):j},Q.nodeAlign=function(K){return arguments.length?($=typeof K=="function"?K:r(K),Q):$},Q.nodeWidth=function(K){return arguments.length?(N=+K,Q):N},Q.nodePadding=function(K){return arguments.length?(V=+K,Q):V},Q.nodes=function(K){return arguments.length?(ee=typeof K=="function"?K:r(K),Q):ee},Q.links=function(K){return arguments.length?(H=typeof K=="function"?K:r(K),Q):H},Q.size=function(K){return arguments.length?(f=E=0,I=+K[0],B=+K[1],Q):[I-f,B-E]},Q.extent=function(K){return arguments.length?(f=+K[0][0],I=+K[1][0],E=+K[0][1],B=+K[1][1],Q):[[f,E],[I,B]]},Q.iterations=function(K){return arguments.length?(J=+K,Q):J},Q}var S=t(48544);function T(f){return[f.source.x1,f.y0]}function p(f){return[f.target.x0,f.y1]}function M(){return(0,S.pq)().source(T).target(p)}},45568:function(D,L,t){var b,d;(function(){var e={version:"3.8.2"},w=[].slice,y=function(a){return w.call(a)},_=self.document;function u(a){return a&&(a.ownerDocument||a.document||a).documentElement}function r(a){return a&&(a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView)}if(_)try{y(_.documentElement.childNodes)[0].nodeType}catch{y=function(C){for(var F=C.length,q=new Array(F);F--;)q[F]=C[F];return q}}if(Date.now||(Date.now=function(){return+new Date}),_)try{_.createElement("DIV").style.setProperty("opacity",0,"")}catch{var n=this.Element.prototype,l=n.setAttribute,o=n.setAttributeNS,s=this.CSSStyleDeclaration.prototype,c=s.setProperty;n.setAttribute=function(C,F){l.call(this,C,F+"")},n.setAttributeNS=function(C,F,q){o.call(this,C,F,q+"")},s.setProperty=function(C,F,q){c.call(this,C,F+"",q)}}function h(a,C){return aC?1:a>=C?0:NaN}function x(a){return a===null?NaN:+a}function m(a){return!isNaN(a)}function g(a){return{left:function(C,F,q,te){for(arguments.length<3&&(q=0),arguments.length<4&&(te=C.length);q>>1;a(C[ue],F)<0?q=ue+1:te=ue}return q},right:function(C,F,q,te){for(arguments.length<3&&(q=0),arguments.length<4&&(te=C.length);q>>1;a(C[ue],F)>0?te=ue:q=ue+1}return q}}}e.ascending=h,e.descending=function(a,C){return Ca?1:C>=a?0:NaN},e.min=function(a,C){var F,q,te=-1,ue=a.length;if(arguments.length===1){for(;++te=q){F=q;break}for(;++teq&&(F=q)}else{for(;++te=q){F=q;break}for(;++teq&&(F=q)}return F},e.max=function(a,C){var F,q,te=-1,ue=a.length;if(arguments.length===1){for(;++te=q){F=q;break}for(;++teF&&(F=q)}else{for(;++te=q){F=q;break}for(;++teF&&(F=q)}return F},e.extent=function(a,C){var F,q,te,ue=-1,ve=a.length;if(arguments.length===1){for(;++ue=q){F=te=q;break}for(;++ueq&&(F=q),te=q){F=te=q;break}for(;++ueq&&(F=q),te1)return ve/(Re-1)},e.deviation=function(){var a=e.variance.apply(this,arguments);return a&&Math.sqrt(a)};var k=g(h);function A(a){return a.length}e.bisectLeft=k.left,e.bisect=e.bisectRight=k.right,e.bisector=function(a){return g(a.length===1?function(C,F){return h(a(C),F)}:a)},e.shuffle=function(a,C,F){(ue=arguments.length)<3&&(F=a.length,ue<2&&(C=0));for(var q,te,ue=F-C;ue;)te=Math.random()*ue--|0,q=a[ue+C],a[ue+C]=a[te+C],a[te+C]=q;return a},e.permute=function(a,C){for(var F=C.length,q=new Array(F);F--;)q[F]=a[C[F]];return q},e.pairs=function(a){for(var C=0,F=a.length-1,q=a[0],te=new Array(F<0?0:F);C=0;)for(C=(q=a[te]).length;--C>=0;)F[--ve]=q[C];return F};var v=Math.abs;function S(a,C){for(var F in C)Object.defineProperty(a.prototype,F,{value:C[F],enumerable:!1})}function T(){this._=Object.create(null)}e.range=function(a,C,F){if(arguments.length<3&&(F=1,arguments.length<2&&(C=a,a=0)),(C-a)/F==1/0)throw new Error("infinite range");var q,te=[],ue=function(Ae){for(var Re=1;Ae*Re%1;)Re*=10;return Re}(v(F)),ve=-1;if(a*=ue,C*=ue,(F*=ue)<0)for(;(q=a+F*++ve)>C;)te.push(q/ue);else for(;(q=a+F*++ve)=q.length)return C?C.call(F,Re):a?Re.sort(a):Re;for(var it,ct,dt,bt,Ct=-1,Mt=Re.length,Vt=q[Ue++],It=new T;++Ct=q.length)return Ae;var Ue=[],it=te[Re++];return Ae.forEach(function(ct,dt){Ue.push({key:ct,values:ve(dt,Re)})}),it?Ue.sort(function(ct,dt){return it(ct.key,dt.key)}):Ue}return F.map=function(Ae,Re){return ue(Re,Ae,0)},F.entries=function(Ae){return ve(ue(e.map,Ae,0),0)},F.key=function(Ae){return q.push(Ae),F},F.sortKeys=function(Ae){return te[q.length-1]=Ae,F},F.sortValues=function(Ae){return a=Ae,F},F.rollup=function(Ae){return C=Ae,F},F},e.set=function(a){var C=new $;if(a)for(var F=0,q=a.length;F=0&&(q=a.slice(F+1),a=a.slice(0,F)),a)return arguments.length<2?this[a].on(q):this[a].on(q,C);if(arguments.length===2){if(C==null)for(a in this)this.hasOwnProperty(a)&&this[a].on(q,null);return this}},e.event=null,e.requote=function(a){return a.replace(ie,"\\$&")};var ie=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,oe={}.__proto__?function(a,C){a.__proto__=C}:function(a,C){for(var F in C)a[F]=C[F]};function le(a){return oe(a,be),a}var ge=function(a,C){return C.querySelector(a)},ye=function(a,C){return C.querySelectorAll(a)},me=function(a,C){var F=a.matches||a[J(a,"matchesSelector")];return me=function(q,te){return F.call(q,te)},me(a,C)};typeof Sizzle=="function"&&(ge=function(a,C){return Sizzle(a,C)[0]||null},ye=Sizzle,me=Sizzle.matchesSelector),e.selection=function(){return e.select(_.documentElement)};var be=e.selection.prototype=[];function Se(a){return typeof a=="function"?a:function(){return ge(a,this)}}function Ee(a){return typeof a=="function"?a:function(){return ye(a,this)}}be.select=function(a){var C,F,q,te,ue=[];a=Se(a);for(var ve=-1,Ae=this.length;++ve=0&&(F=a.slice(0,C))!=="xmlns"&&(a=a.slice(C+1)),Le.hasOwnProperty(F)?{space:Le[F],local:a}:a}},be.attr=function(a,C){if(arguments.length<2){if(typeof a=="string"){var F=this.node();return(a=e.ns.qualify(a)).local?F.getAttributeNS(a.space,a.local):F.getAttribute(a)}for(C in a)this.each(Oe(C,a[C]));return this}return this.each(Oe(a,C))},be.classed=function(a,C){if(arguments.length<2){if(typeof a=="string"){var F=this.node(),q=(a=Ve(a)).length,te=-1;if(C=F.classList){for(;++te=0;)(F=q[te])&&(ue&&ue!==F.nextSibling&&ue.parentNode.insertBefore(F,ue),ue=F);return this},be.sort=function(a){a=Ye.apply(this,arguments);for(var C=-1,F=this.length;++C0&&(a=a.slice(0,te));var ve=tt.get(a);function Ae(){var Re=this[q];Re&&(this.removeEventListener(a,Re,Re.$),delete this[q])}return ve&&(a=ve,ue=pt),te?C?function(){var Re=ue(C,y(arguments));Ae.call(this),this.addEventListener(a,this[q]=Re,Re.$=F),Re._=C}:Ae:C?Z:function(){var Re,Ue=new RegExp("^__on([^.]+)"+e.requote(a)+"$");for(var it in this)if(Re=it.match(Ue)){var ct=this[it];this.removeEventListener(Re[1],ct,ct.$),delete this[it]}}}e.selection.enter=De,e.selection.enter.prototype=Be,Be.append=be.append,Be.empty=be.empty,Be.node=be.node,Be.call=be.call,Be.size=be.size,Be.select=function(a){for(var C,F,q,te,ue,ve=[],Ae=-1,Re=this.length;++Ae=q&&(q=ve+1);!(Re=Ue[q])&&++q1?at:a<-1?-at:Math.asin(a)}function Tt(a){return((a=Math.exp(a))+1/a)/2}var vt=Math.SQRT2;e.interpolateZoom=function(a,C){var F,q,te=a[0],ue=a[1],ve=a[2],Ae=C[0],Re=C[1],Ue=C[2],it=Ae-te,ct=Re-ue,dt=it*it+ct*ct;if(dt0&&(Sr=Sr.transition().duration(dt)),Sr.call(tn.event)}function Hn(){ve&&ve.domain(ue.range().map(function(Sr){return(Sr-Ue.x)/Ue.k}).map(ue.invert)),Re&&Re.domain(Ae.range().map(function(Sr){return(Sr-Ue.y)/Ue.k}).map(Ae.invert))}function Xn(Sr){bt++||Sr({type:"zoomstart"})}function rr(Sr){Hn(),Sr({type:"zoom",scale:Ue.k,translate:[Ue.x,Ue.y]})}function Mr(Sr){--bt||(Sr({type:"zoomend"}),C=null)}function nr(){var Sr=this,Vr=Qt.of(Sr,arguments),fi=0,Nr=e.select(r(Sr)).on(Mt,function(){fi=1,Mn(e.mouse(Sr),si),rr(Vr)}).on(Vt,function(){Nr.on(Mt,null).on(Vt,null),_i(fi),Mr(Vr)}),si=Yt(e.mouse(Sr)),_i=Nt(Sr);Mo.call(Sr),Xn(Vr)}function Lr(){var Sr,Vr=this,fi=Qt.of(Vr,arguments),Nr={},si=0,_i=".zoom-"+e.event.changedTouches[0].identifier,Gi="touchmove"+_i,Pi="touchend"+_i,Ji=[],Yi=e.select(Vr),na=Nt(Vr);function Ma(){var Da=e.touches(Vr);return Sr=Ue.k,Da.forEach(function(ca){ca.identifier in Nr&&(Nr[ca.identifier]=Yt(ca))}),Da}function go(){var Da=e.event.target;e.select(Da).on(Gi,uo).on(Pi,Go),Ji.push(Da);for(var ca=e.event.changedTouches,Qa=0,Ra=ca.length;Qa1){qa=wa[0];var fa=wa[1],Pl=qa[0]-fa[0],mo=qa[1]-fa[1];si=Pl*Pl+mo*mo}}function uo(){var Da,ca,Qa,Ra,wa=e.touches(Vr);Mo.call(Vr);for(var Fa=0,qa=wa.length;Fa360?Ae-=360:Ae<0&&(Ae+=360),Ae<60?q+(te-q)*Ae/60:Ae<180?te:Ae<240?q+(te-q)*(240-Ae)/60:q}(ve))}return a=isNaN(a)?0:(a%=360)<0?a+360:a,C=isNaN(C)||C<0?0:C>1?1:C,q=2*(F=F<0?0:F>1?1:F)-(te=F<=.5?F*(1+C):F+C-F*C),new Kn(ue(a+120),ue(a),ue(a-120))}function St(a,C,F){return this instanceof St?(this.h=+a,this.c=+C,void(this.l=+F)):arguments.length<2?a instanceof St?new St(a.h,a.c,a.l):function(q,te,ue){return q>0?new St(Math.atan2(ue,te)*Xe,Math.sqrt(te*te+ue*ue),q):new St(NaN,NaN,q)}(a instanceof en?a.l:(a=$n((a=e.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new St(a,C,F)}Bt.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new Et(this.h,this.s,this.l/a)},Bt.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new Et(this.h,this.s,a*this.l)},Bt.rgb=function(){return Ft(this.h,this.s,this.l)},e.hcl=St;var Jt=St.prototype=new et;function qt(a,C,F){return isNaN(a)&&(a=0),isNaN(C)&&(C=0),new en(F,Math.cos(a*=lt)*C,Math.sin(a)*C)}function en(a,C,F){return this instanceof en?(this.l=+a,this.a=+C,void(this.b=+F)):arguments.length<2?a instanceof en?new en(a.l,a.a,a.b):a instanceof St?qt(a.h,a.c,a.l):$n((a=Kn(a)).r,a.g,a.b):new en(a,C,F)}Jt.brighter=function(a){return new St(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?a:1)))},Jt.darker=function(a){return new St(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?a:1)))},Jt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},e.lab=en;var Wt=18,Zt=.95047,on=1,un=1.08883,Pn=en.prototype=new et;function Dn(a,C,F){var q=(a+16)/116,te=q+C/500,ue=q-F/200;return new Kn(En(3.2404542*(te=In(te)*Zt)-1.5371385*(q=In(q)*on)-.4985314*(ue=In(ue)*un)),En(-.969266*te+1.8760108*q+.041556*ue),En(.0556434*te-.2040259*q+1.0572252*ue))}function In(a){return a>.206893034?a*a*a:(a-.13793103448275862)/7.787037}function mn(a){return a>.008856?Math.pow(a,.3333333333333333):7.787037*a+.13793103448275862}function En(a){return Math.round(255*(a<=.00304?12.92*a:1.055*Math.pow(a,.4166666666666667)-.055))}function Kn(a,C,F){return this instanceof Kn?(this.r=~~a,this.g=~~C,void(this.b=~~F)):arguments.length<2?a instanceof Kn?new Kn(a.r,a.g,a.b):zn(""+a,Kn,Ft):new Kn(a,C,F)}function Ln(a){return new Kn(a>>16,a>>8&255,255&a)}function Tn(a){return Ln(a)+""}Pn.brighter=function(a){return new en(Math.min(100,this.l+Wt*(arguments.length?a:1)),this.a,this.b)},Pn.darker=function(a){return new en(Math.max(0,this.l-Wt*(arguments.length?a:1)),this.a,this.b)},Pn.rgb=function(){return Dn(this.l,this.a,this.b)},e.rgb=Kn;var Fn=Kn.prototype=new et;function wn(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function zn(a,C,F){var q,te,ue,ve=0,Ae=0,Re=0;if(q=/([a-z]+)\((.*)\)/.exec(a=a.toLowerCase()))switch(te=q[2].split(","),q[1]){case"hsl":return F(parseFloat(te[0]),parseFloat(te[1])/100,parseFloat(te[2])/100);case"rgb":return C(Qn(te[0]),Qn(te[1]),Qn(te[2]))}return(ue=lr.get(a))?C(ue.r,ue.g,ue.b):(a==null||a.charAt(0)!=="#"||isNaN(ue=parseInt(a.slice(1),16))||(a.length===4?(ve=(3840&ue)>>4,ve|=ve>>4,Ae=240&ue,Ae|=Ae>>4,Re=15&ue,Re|=Re<<4):a.length===7&&(ve=(16711680&ue)>>16,Ae=(65280&ue)>>8,Re=255&ue)),C(ve,Ae,Re))}function Jn(a,C,F){var q,te,ue=Math.min(a/=255,C/=255,F/=255),ve=Math.max(a,C,F),Ae=ve-ue,Re=(ve+ue)/2;return Ae?(te=Re<.5?Ae/(ve+ue):Ae/(2-ve-ue),q=a==ve?(C-F)/Ae+(C0&&Re<1?0:q),new Et(q,te,Re)}function $n(a,C,F){var q=mn((.4124564*(a=vr(a))+.3575761*(C=vr(C))+.1804375*(F=vr(F)))/Zt),te=mn((.2126729*a+.7151522*C+.072175*F)/on);return en(116*te-16,500*(q-te),200*(te-mn((.0193339*a+.119192*C+.9503041*F)/un)))}function vr(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Qn(a){var C=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(2.55*C):C}Fn.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var C=this.r,F=this.g,q=this.b,te=30;return C||F||q?(C&&C=200&&ct<300||ct===304){try{it=F.call(te,Ae)}catch(dt){return void ue.error.call(te,dt)}ue.load.call(te,it)}else ue.error.call(te,Ae)}return self.XDomainRequest&&!("withCredentials"in Ae)&&/^(http(s)?:)?\/\//.test(a)&&(Ae=new XDomainRequest),"onload"in Ae?Ae.onload=Ae.onerror=Ue:Ae.onreadystatechange=function(){Ae.readyState>3&&Ue()},Ae.onprogress=function(it){var ct=e.event;e.event=it;try{ue.progress.call(te,Ae)}finally{e.event=ct}},te.header=function(it,ct){return it=(it+"").toLowerCase(),arguments.length<2?ve[it]:(ct==null?delete ve[it]:ve[it]=ct+"",te)},te.mimeType=function(it){return arguments.length?(C=it==null?null:it+"",te):C},te.responseType=function(it){return arguments.length?(Re=it,te):Re},te.response=function(it){return F=it,te},["get","post"].forEach(function(it){te[it]=function(){return te.send.apply(te,[it].concat(y(arguments)))}}),te.send=function(it,ct,dt){if(arguments.length===2&&typeof ct=="function"&&(dt=ct,ct=null),Ae.open(it,a,!0),C==null||"accept"in ve||(ve.accept=C+",*/*"),Ae.setRequestHeader)for(var bt in ve)Ae.setRequestHeader(bt,ve[bt]);return C!=null&&Ae.overrideMimeType&&Ae.overrideMimeType(C),Re!=null&&(Ae.responseType=Re),dt!=null&&te.on("error",dt).on("load",function(Ct){dt(null,Ct)}),ue.beforesend.call(te,Ae),Ae.send(ct??null),te},te.abort=function(){return Ae.abort(),te},e.rebind(te,ue,"on"),q==null?te:te.get(function(it){return it.length===1?function(ct,dt){it(ct==null?dt:null)}:it}(q))}lr.forEach(function(a,C){lr.set(a,Ln(C))}),e.functor=hr,e.xhr=jr(ee),e.dsv=function(a,C){var F=new RegExp('["'+a+` -]`),q=a.charCodeAt(0);function te(Ue,it,ct){arguments.length<3&&(ct=it,it=null);var dt=ni(Ue,C,it==null?ue:ve(it),ct);return dt.row=function(bt){return arguments.length?dt.response((it=bt)==null?ue:ve(bt)):it},dt}function ue(Ue){return te.parse(Ue.responseText)}function ve(Ue){return function(it){return te.parse(it.responseText,Ue)}}function Ae(Ue){return Ue.map(Re).join(a)}function Re(Ue){return F.test(Ue)?'"'+Ue.replace(/\"/g,'""')+'"':Ue}return te.parse=function(Ue,it){var ct;return te.parseRows(Ue,function(dt,bt){if(ct)return ct(dt,bt-1);var Ct=function(Mt){for(var Vt={},It=dt.length,Qt=0;Qt=Vt)return Ct;if(dt)return dt=!1,bt;var vn=It;if(Ue.charCodeAt(vn)===34){for(var Mn=vn;Mn++-1?parseInt(Be[1+nt]):0,kt=ft>-1?parseInt(Ge[1+ft]):0;At!==kt&&(tt=tt.replace(He(),"?px "),Ee*=Math.pow(.75,kt-At),tt=tt.replace("?px ",He())),Se+=.25*Oe*(kt-At)}if(fe.superscripts===!0){var Vt=Be.indexOf(S),Ht=Ge.indexOf(S),Gt=Vt>-1?parseInt(Be[1+Vt]):0,st=Ht>-1?parseInt(Ge[1+Ht]):0;Gt!==st&&(tt=tt.replace(He(),"?px "),Ee*=Math.pow(.75,st-Gt),tt=tt.replace("?px ",He())),Se-=.25*Oe*(st-Gt)}if(fe.bolds===!0){var Qe=Be.indexOf(g)>-1,pt=Ge.indexOf(g)>-1;!Qe&&pt&&(tt=yt?tt.replace("italic ","italic bold "):"bold "+tt),Qe&&!pt&&(tt=tt.replace("bold ",""))}if(fe.italics===!0){var yt=Be.indexOf(A)>-1,Ot=Ge.indexOf(A)>-1;!yt&&Ot&&(tt="italic "+tt),yt&&!Ot&&(tt=tt.replace("italic ",""))}K.font=tt}for(ye=0;ye",J="",Q=H.length,Z=J.length,K=j[0]===S||j[0]===M,ae=0,se=-Z;ae>-1&&(ae=$.indexOf(H,ae))!==-1&&(se=$.indexOf(J,ae+Q))!==-1&&!(se<=ae);){for(var he=ae;he=se)ee[he]=null,$=$.substr(0,he)+" "+$.substr(he+1);else if(ee[he]!==null){var fe=ee[he].indexOf(j[0]);fe===-1?ee[he]+=j:K&&(ee[he]=ee[he].substr(0,fe+1)+(1+parseInt(ee[he][fe+1]))+ee[he].substr(fe+2))}var ie=ae+Q,oe=$.substr(ie,se-ie).indexOf(H);ae=oe!==-1?oe:se+Z}return ee}function I(V,j){var $=l(V,128);return j?s($.cells,$.positions,.25):{edges:$.cells,positions:$.positions}}function B(V,j,$,ee){var H=I(V,ee),J=function(ye,me,be){for(var Se=me.textAlign||"start",Ee=me.textBaseline||"alphabetic",Ce=[1<<30,1<<30],Le=[0,0],Oe=ye.length,We=0;We"u"||!ses.ok||ses.ok()){typeof ses<"u"&&(ses.weakMapPermitHostObjects=p);var r=!1;if(typeof WeakMap=="function"){var n=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var l=new n,o=Object.freeze({});if(l.set(o,1),l.get(o)===1)return void(u.exports=WeakMap);r=!0}}var s=Object.getOwnPropertyNames,c=Object.defineProperty,h=Object.isExtensible,x="weakmap:",m=x+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var g=new ArrayBuffer(25),k=new Uint8Array(g);crypto.getRandomValues(k),m=x+"rand:"+Array.prototype.map.call(k,function(B){return(B%36).toString(36)}).join("")+"___"}if(c(Object,"getOwnPropertyNames",{value:function(B){return s(B).filter(M)}}),"getPropertyNames"in Object){var A=Object.getPropertyNames;c(Object,"getPropertyNames",{value:function(B){return A(B).filter(M)}})}(function(){var B=Object.freeze;c(Object,"freeze",{value:function(j){return f(j),B(j)}});var N=Object.seal;c(Object,"seal",{value:function(j){return f(j),N(j)}});var V=Object.preventExtensions;c(Object,"preventExtensions",{value:function(j){return f(j),V(j)}})})();var v=!1,S=0,T=function(){this instanceof T||I();var B=[],N=[],V=S++;return Object.create(T.prototype,{get___:{value:E(function(j,$){var ee,H=f(j);return H?V in H?H[V]:$:(ee=B.indexOf(j))>=0?N[ee]:$})},has___:{value:E(function(j){var $=f(j);return $?V in $:B.indexOf(j)>=0})},set___:{value:E(function(j,$){var ee,H=f(j);return H?H[V]=$:(ee=B.indexOf(j))>=0?N[ee]=$:(ee=B.length,N[ee]=$,B[ee]=j),this})},delete___:{value:E(function(j){var $,ee,H=f(j);return H?V in H&&delete H[V]:!(($=B.indexOf(j))<0||(ee=B.length-1,B[$]=void 0,N[$]=N[ee],B[$]=B[ee],B.length=ee,N.length=ee,0))})}})};T.prototype=Object.create(Object.prototype,{get:{value:function(B,N){return this.get___(B,N)},writable:!0,configurable:!0},has:{value:function(B){return this.has___(B)},writable:!0,configurable:!0},set:{value:function(B,N){return this.set___(B,N)},writable:!0,configurable:!0},delete:{value:function(B){return this.delete___(B)},writable:!0,configurable:!0}}),typeof n=="function"?function(){function B(){this instanceof T||I();var N,V=new n,j=void 0,$=!1;return N=r?function(ee,H){return V.set(ee,H),V.has(ee)||(j||(j=new T),j.set(ee,H)),this}:function(ee,H){if($)try{V.set(ee,H)}catch{j||(j=new T),j.set___(ee,H)}else V.set(ee,H);return this},Object.create(T.prototype,{get___:{value:E(function(ee,H){return j?V.has(ee)?V.get(ee):j.get___(ee,H):V.get(ee,H)})},has___:{value:E(function(ee){return V.has(ee)||!!j&&j.has___(ee)})},set___:{value:E(N)},delete___:{value:E(function(ee){var H=!!V.delete(ee);return j&&j.delete___(ee)||H})},permitHostObjects___:{value:E(function(ee){if(ee!==p)throw new Error("bogus call to permitHostObjects___");$=!0})}})}r&&typeof Proxy<"u"&&(Proxy=void 0),B.prototype=T.prototype,u.exports=B,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),u.exports=T)}function p(B){B.permitHostObjects___&&B.permitHostObjects___(p)}function M(B){return!(B.substr(0,8)==x&&B.substr(B.length-3)==="___")}function f(B){if(B!==Object(B))throw new TypeError("Not an object: "+B);var N=B[m];if(N&&N.key===B)return N;if(h(B)){N={key:B};try{return c(B,m,{value:N,writable:!1,enumerable:!1,configurable:!1}),N}catch{return}}}function E(B){return B.prototype=null,Object.freeze(B)}function I(){v||typeof console>"u"||(v=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}})()},236:function(u,r,n){var l=n(8284);u.exports=function(){var o={};return function(s){if((typeof s!="object"||s===null)&&typeof s!="function")throw new Error("Weakmap-shim: Key must be object");var c=s.valueOf(o);return c&&c.identity===o?c:l(s,o)}}},8284:function(u){u.exports=function(r,n){var l={identity:n},o=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(s){return s!==n?o.apply(this,arguments):l},writable:!0}),l}},606:function(u,r,n){var l=n(236);u.exports=function(){var o=l();return{get:function(s,c){var h=o(s);return h.hasOwnProperty("value")?h.value:c},set:function(s,c){return o(s).value=c,this},has:function(s){return"value"in o(s)},delete:function(s){return delete o(s).value}}}},3349:function(u){u.exports=function(r){var n={};return function(l,o,s){var c=l.dtype,h=l.order,x=[c,h.join()].join(),m=n[x];return m||(n[x]=m=r([c,h])),m(l.shape.slice(0),l.data,l.stride,0|l.offset,o,s)}}((function(){return function(r,n,l,o,s,c){var h=r[0],x=l[0],m=[0],g=x;o|=0;var k=0,A=x;for(k=0;k=0!=S>=0&&s.push(m[0]+.5+.5*(v+S)/(v-S)),o+=A,++m[0]}}}).bind(void 0,{funcName:"zeroCrossings"}))},781:function(u,r,n){u.exports=function(o,s){var c=[];return s=+s||0,l(o.hi(o.shape[0]-1),c,s),c};var l=n(3349)},7790:function(){}},w={};function y(u){var r=w[u];if(r!==void 0)return r.exports;var n=w[u]={id:u,loaded:!1,exports:{}};return e[u].call(n.exports,n,n.exports,y),n.loaded=!0,n.exports}y.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),y.nmd=function(u){return u.paths=[],u.children||(u.children=[]),u};var _=y(1964);D.exports=_})()},45708:function(D,L,t){function b(de,Me){for(var ke=0;keo)throw new RangeError('The value "'+de+'" is invalid for option "size"');var Me=new Uint8Array(de);return Object.setPrototypeOf(Me,c.prototype),Me}function c(de,Me,ke){if(typeof de=="number"){if(typeof Me=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(de)}return h(de,Me,ke)}function h(de,Me,ke){if(typeof de=="string")return function(qe,$e){if(typeof $e=="string"&&$e!==""||($e="utf8"),!c.isEncoding($e))throw new TypeError("Unknown encoding: "+$e);var Ye=0|v(qe,$e),_e=s(Ye),De=_e.write(qe,$e);return De!==Ye&&(_e=_e.slice(0,De)),_e}(de,Me);if(ArrayBuffer.isView(de))return function(qe){if(Oe(qe,Uint8Array)){var $e=new Uint8Array(qe);return k($e.buffer,$e.byteOffset,$e.byteLength)}return g(qe)}(de);if(de==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(de));if(Oe(de,ArrayBuffer)||de&&Oe(de.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(de,SharedArrayBuffer)||de&&Oe(de.buffer,SharedArrayBuffer)))return k(de,Me,ke);if(typeof de=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var He=de.valueOf&&de.valueOf();if(He!=null&&He!==de)return c.from(He,Me,ke);var Fe=function(qe){if(c.isBuffer(qe)){var $e=0|A(qe.length),Ye=s($e);return Ye.length===0||qe.copy(Ye,0,0,$e),Ye}return qe.length!==void 0?typeof qe.length!="number"||We(qe.length)?s(0):g(qe):qe.type==="Buffer"&&Array.isArray(qe.data)?g(qe.data):void 0}(de);if(Fe)return Fe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof de[Symbol.toPrimitive]=="function")return c.from(de[Symbol.toPrimitive]("string"),Me,ke);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(de))}function x(de){if(typeof de!="number")throw new TypeError('"size" argument must be of type number');if(de<0)throw new RangeError('The value "'+de+'" is invalid for option "size"')}function m(de){return x(de),s(de<0?0:0|A(de))}function g(de){for(var Me=de.length<0?0:0|A(de.length),ke=s(Me),He=0;He=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|de}function v(de,Me){if(c.isBuffer(de))return de.length;if(ArrayBuffer.isView(de)||Oe(de,ArrayBuffer))return de.byteLength;if(typeof de!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(de));var ke=de.length,He=arguments.length>2&&arguments[2]===!0;if(!He&&ke===0)return 0;for(var Fe=!1;;)switch(Me){case"ascii":case"latin1":case"binary":return ke;case"utf8":case"utf-8":return Ee(de).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*ke;case"hex":return ke>>>1;case"base64":return Ce(de).length;default:if(Fe)return He?-1:Ee(de).length;Me=(""+Me).toLowerCase(),Fe=!0}}function S(de,Me,ke){var He=!1;if((Me===void 0||Me<0)&&(Me=0),Me>this.length||((ke===void 0||ke>this.length)&&(ke=this.length),ke<=0)||(ke>>>=0)<=(Me>>>=0))return"";for(de||(de="utf8");;)switch(de){case"hex":return J(this,Me,ke);case"utf8":case"utf-8":return j(this,Me,ke);case"ascii":return ee(this,Me,ke);case"latin1":case"binary":return H(this,Me,ke);case"base64":return V(this,Me,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,Me,ke);default:if(He)throw new TypeError("Unknown encoding: "+de);de=(de+"").toLowerCase(),He=!0}}function T(de,Me,ke){var He=de[Me];de[Me]=de[ke],de[ke]=He}function p(de,Me,ke,He,Fe){if(de.length===0)return-1;if(typeof ke=="string"?(He=ke,ke=0):ke>2147483647?ke=2147483647:ke<-2147483648&&(ke=-2147483648),We(ke=+ke)&&(ke=Fe?0:de.length-1),ke<0&&(ke=de.length+ke),ke>=de.length){if(Fe)return-1;ke=de.length-1}else if(ke<0){if(!Fe)return-1;ke=0}if(typeof Me=="string"&&(Me=c.from(Me,He)),c.isBuffer(Me))return Me.length===0?-1:M(de,Me,ke,He,Fe);if(typeof Me=="number")return Me&=255,typeof Uint8Array.prototype.indexOf=="function"?Fe?Uint8Array.prototype.indexOf.call(de,Me,ke):Uint8Array.prototype.lastIndexOf.call(de,Me,ke):M(de,[Me],ke,He,Fe);throw new TypeError("val must be string, number or Buffer")}function M(de,Me,ke,He,Fe){var qe,$e=1,Ye=de.length,_e=Me.length;if(He!==void 0&&((He=String(He).toLowerCase())==="ucs2"||He==="ucs-2"||He==="utf16le"||He==="utf-16le")){if(de.length<2||Me.length<2)return-1;$e=2,Ye/=2,_e/=2,ke/=2}function De(nt,ft){return $e===1?nt[ft]:nt.readUInt16BE(ft*$e)}if(Fe){var Be=-1;for(qe=ke;qeYe&&(ke=Ye-_e),qe=ke;qe>=0;qe--){for(var Ge=!0,tt=0;tt<_e;tt++)if(De(de,qe+tt)!==De(Me,tt)){Ge=!1;break}if(Ge)return qe}return-1}function f(de,Me,ke,He){ke=Number(ke)||0;var Fe=de.length-ke;He?(He=Number(He))>Fe&&(He=Fe):He=Fe;var qe,$e=Me.length;for(He>$e/2&&(He=$e/2),qe=0;qe>8,_e=$e%256,De.push(_e),De.push(Ye);return De}(Me,de.length-ke),de,ke,He)}function V(de,Me,ke){return Me===0&&ke===de.length?r.fromByteArray(de):r.fromByteArray(de.slice(Me,ke))}function j(de,Me,ke){ke=Math.min(de.length,ke);for(var He=[],Fe=Me;Fe239?4:qe>223?3:qe>191?2:1;if(Fe+Ye<=ke){var _e=void 0,De=void 0,Be=void 0,Ge=void 0;switch(Ye){case 1:qe<128&&($e=qe);break;case 2:(192&(_e=de[Fe+1]))==128&&(Ge=(31&qe)<<6|63&_e)>127&&($e=Ge);break;case 3:_e=de[Fe+1],De=de[Fe+2],(192&_e)==128&&(192&De)==128&&(Ge=(15&qe)<<12|(63&_e)<<6|63&De)>2047&&(Ge<55296||Ge>57343)&&($e=Ge);break;case 4:_e=de[Fe+1],De=de[Fe+2],Be=de[Fe+3],(192&_e)==128&&(192&De)==128&&(192&Be)==128&&(Ge=(15&qe)<<18|(63&_e)<<12|(63&De)<<6|63&Be)>65535&&Ge<1114112&&($e=Ge)}}$e===null?($e=65533,Ye=1):$e>65535&&($e-=65536,He.push($e>>>10&1023|55296),$e=56320|1023&$e),He.push($e),Fe+=Ye}return function(tt){var nt=tt.length;if(nt<=$)return String.fromCharCode.apply(String,tt);for(var ft="",At=0;At"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(de,Me,ke){return h(de,Me,ke)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(de,Me,ke){return function(He,Fe,qe){return x(He),He<=0?s(He):Fe!==void 0?typeof qe=="string"?s(He).fill(Fe,qe):s(He).fill(Fe):s(He)}(de,Me,ke)},c.allocUnsafe=function(de){return m(de)},c.allocUnsafeSlow=function(de){return m(de)},c.isBuffer=function(de){return de!=null&&de._isBuffer===!0&&de!==c.prototype},c.compare=function(de,Me){if(Oe(de,Uint8Array)&&(de=c.from(de,de.offset,de.byteLength)),Oe(Me,Uint8Array)&&(Me=c.from(Me,Me.offset,Me.byteLength)),!c.isBuffer(de)||!c.isBuffer(Me))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(de===Me)return 0;for(var ke=de.length,He=Me.length,Fe=0,qe=Math.min(ke,He);FeHe.length?(c.isBuffer(qe)||(qe=c.from(qe)),qe.copy(He,Fe)):Uint8Array.prototype.set.call(He,qe,Fe);else{if(!c.isBuffer(qe))throw new TypeError('"list" argument must be an Array of Buffers');qe.copy(He,Fe)}Fe+=qe.length}return He},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var de=this.length;if(de%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Me=0;MeMe&&(de+=" ... "),""},l&&(c.prototype[l]=c.prototype.inspect),c.prototype.compare=function(de,Me,ke,He,Fe){if(Oe(de,Uint8Array)&&(de=c.from(de,de.offset,de.byteLength)),!c.isBuffer(de))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(de));if(Me===void 0&&(Me=0),ke===void 0&&(ke=de?de.length:0),He===void 0&&(He=0),Fe===void 0&&(Fe=this.length),Me<0||ke>de.length||He<0||Fe>this.length)throw new RangeError("out of range index");if(He>=Fe&&Me>=ke)return 0;if(He>=Fe)return-1;if(Me>=ke)return 1;if(this===de)return 0;for(var qe=(Fe>>>=0)-(He>>>=0),$e=(ke>>>=0)-(Me>>>=0),Ye=Math.min(qe,$e),_e=this.slice(He,Fe),De=de.slice(Me,ke),Be=0;Be>>=0,isFinite(ke)?(ke>>>=0,He===void 0&&(He="utf8")):(He=ke,ke=void 0)}var Fe=this.length-Me;if((ke===void 0||ke>Fe)&&(ke=Fe),de.length>0&&(ke<0||Me<0)||Me>this.length)throw new RangeError("Attempt to write outside buffer bounds");He||(He="utf8");for(var qe=!1;;)switch(He){case"hex":return f(this,de,Me,ke);case"utf8":case"utf-8":return E(this,de,Me,ke);case"ascii":case"latin1":case"binary":return I(this,de,Me,ke);case"base64":return B(this,de,Me,ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,de,Me,ke);default:if(qe)throw new TypeError("Unknown encoding: "+He);He=(""+He).toLowerCase(),qe=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;function ee(de,Me,ke){var He="";ke=Math.min(de.length,ke);for(var Fe=Me;FeHe)&&(ke=He);for(var Fe="",qe=Me;qeke)throw new RangeError("Trying to access beyond buffer length")}function K(de,Me,ke,He,Fe,qe){if(!c.isBuffer(de))throw new TypeError('"buffer" argument must be a Buffer instance');if(Me>Fe||Mede.length)throw new RangeError("Index out of range")}function ae(de,Me,ke,He,Fe){ye(Me,He,Fe,de,ke,7);var qe=Number(Me&BigInt(4294967295));de[ke++]=qe,qe>>=8,de[ke++]=qe,qe>>=8,de[ke++]=qe,qe>>=8,de[ke++]=qe;var $e=Number(Me>>BigInt(32)&BigInt(4294967295));return de[ke++]=$e,$e>>=8,de[ke++]=$e,$e>>=8,de[ke++]=$e,$e>>=8,de[ke++]=$e,ke}function se(de,Me,ke,He,Fe){ye(Me,He,Fe,de,ke,7);var qe=Number(Me&BigInt(4294967295));de[ke+7]=qe,qe>>=8,de[ke+6]=qe,qe>>=8,de[ke+5]=qe,qe>>=8,de[ke+4]=qe;var $e=Number(Me>>BigInt(32)&BigInt(4294967295));return de[ke+3]=$e,$e>>=8,de[ke+2]=$e,$e>>=8,de[ke+1]=$e,$e>>=8,de[ke]=$e,ke+8}function he(de,Me,ke,He,Fe,qe){if(ke+He>de.length)throw new RangeError("Index out of range");if(ke<0)throw new RangeError("Index out of range")}function fe(de,Me,ke,He,Fe){return Me=+Me,ke>>>=0,Fe||he(de,0,ke,4),n.write(de,Me,ke,He,23,4),ke+4}function ie(de,Me,ke,He,Fe){return Me=+Me,ke>>>=0,Fe||he(de,0,ke,8),n.write(de,Me,ke,He,52,8),ke+8}c.prototype.slice=function(de,Me){var ke=this.length;(de=~~de)<0?(de+=ke)<0&&(de=0):de>ke&&(de=ke),(Me=Me===void 0?ke:~~Me)<0?(Me+=ke)<0&&(Me=0):Me>ke&&(Me=ke),Me>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=this[de],Fe=1,qe=0;++qe>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=this[de+--Me],Fe=1;Me>0&&(Fe*=256);)He+=this[de+--Me]*Fe;return He},c.prototype.readUint8=c.prototype.readUInt8=function(de,Me){return de>>>=0,Me||Z(de,1,this.length),this[de]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(de,Me){return de>>>=0,Me||Z(de,2,this.length),this[de]|this[de+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(de,Me){return de>>>=0,Me||Z(de,2,this.length),this[de]<<8|this[de+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),(this[de]|this[de+1]<<8|this[de+2]<<16)+16777216*this[de+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),16777216*this[de]+(this[de+1]<<16|this[de+2]<<8|this[de+3])},c.prototype.readBigUInt64LE=Ve(function(de){me(de>>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=Me+this[++de]*Math.pow(2,8)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,24),Fe=this[++de]+this[++de]*Math.pow(2,8)+this[++de]*Math.pow(2,16)+ke*Math.pow(2,24);return BigInt(He)+(BigInt(Fe)<>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=Me*Math.pow(2,24)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,8)+this[++de],Fe=this[++de]*Math.pow(2,24)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,8)+ke;return(BigInt(He)<>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=this[de],Fe=1,qe=0;++qe=(Fe*=128)&&(He-=Math.pow(2,8*Me)),He},c.prototype.readIntBE=function(de,Me,ke){de>>>=0,Me>>>=0,ke||Z(de,Me,this.length);for(var He=Me,Fe=1,qe=this[de+--He];He>0&&(Fe*=256);)qe+=this[de+--He]*Fe;return qe>=(Fe*=128)&&(qe-=Math.pow(2,8*Me)),qe},c.prototype.readInt8=function(de,Me){return de>>>=0,Me||Z(de,1,this.length),128&this[de]?-1*(255-this[de]+1):this[de]},c.prototype.readInt16LE=function(de,Me){de>>>=0,Me||Z(de,2,this.length);var ke=this[de]|this[de+1]<<8;return 32768&ke?4294901760|ke:ke},c.prototype.readInt16BE=function(de,Me){de>>>=0,Me||Z(de,2,this.length);var ke=this[de+1]|this[de]<<8;return 32768&ke?4294901760|ke:ke},c.prototype.readInt32LE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),this[de]|this[de+1]<<8|this[de+2]<<16|this[de+3]<<24},c.prototype.readInt32BE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),this[de]<<24|this[de+1]<<16|this[de+2]<<8|this[de+3]},c.prototype.readBigInt64LE=Ve(function(de){me(de>>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=this[de+4]+this[de+5]*Math.pow(2,8)+this[de+6]*Math.pow(2,16)+(ke<<24);return(BigInt(He)<>>=0,"offset");var Me=this[de],ke=this[de+7];Me!==void 0&&ke!==void 0||be(de,this.length-8);var He=(Me<<24)+this[++de]*Math.pow(2,16)+this[++de]*Math.pow(2,8)+this[++de];return(BigInt(He)<>>=0,Me||Z(de,4,this.length),n.read(this,de,!0,23,4)},c.prototype.readFloatBE=function(de,Me){return de>>>=0,Me||Z(de,4,this.length),n.read(this,de,!1,23,4)},c.prototype.readDoubleLE=function(de,Me){return de>>>=0,Me||Z(de,8,this.length),n.read(this,de,!0,52,8)},c.prototype.readDoubleBE=function(de,Me){return de>>>=0,Me||Z(de,8,this.length),n.read(this,de,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(de,Me,ke,He){de=+de,Me>>>=0,ke>>>=0,He||K(this,de,Me,ke,Math.pow(2,8*ke)-1,0);var Fe=1,qe=0;for(this[Me]=255&de;++qe>>=0,ke>>>=0,He||K(this,de,Me,ke,Math.pow(2,8*ke)-1,0);var Fe=ke-1,qe=1;for(this[Me+Fe]=255&de;--Fe>=0&&(qe*=256);)this[Me+Fe]=de/qe&255;return Me+ke},c.prototype.writeUint8=c.prototype.writeUInt8=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,1,255,0),this[Me]=255&de,Me+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,65535,0),this[Me]=255&de,this[Me+1]=de>>>8,Me+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,65535,0),this[Me]=de>>>8,this[Me+1]=255&de,Me+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,4294967295,0),this[Me+3]=de>>>24,this[Me+2]=de>>>16,this[Me+1]=de>>>8,this[Me]=255&de,Me+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,4294967295,0),this[Me]=de>>>24,this[Me+1]=de>>>16,this[Me+2]=de>>>8,this[Me+3]=255&de,Me+4},c.prototype.writeBigUInt64LE=Ve(function(de){return ae(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Ve(function(de){return se(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(de,Me,ke,He){if(de=+de,Me>>>=0,!He){var Fe=Math.pow(2,8*ke-1);K(this,de,Me,ke,Fe-1,-Fe)}var qe=0,$e=1,Ye=0;for(this[Me]=255&de;++qe>0)-Ye&255;return Me+ke},c.prototype.writeIntBE=function(de,Me,ke,He){if(de=+de,Me>>>=0,!He){var Fe=Math.pow(2,8*ke-1);K(this,de,Me,ke,Fe-1,-Fe)}var qe=ke-1,$e=1,Ye=0;for(this[Me+qe]=255&de;--qe>=0&&($e*=256);)de<0&&Ye===0&&this[Me+qe+1]!==0&&(Ye=1),this[Me+qe]=(de/$e>>0)-Ye&255;return Me+ke},c.prototype.writeInt8=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,1,127,-128),de<0&&(de=255+de+1),this[Me]=255&de,Me+1},c.prototype.writeInt16LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,32767,-32768),this[Me]=255&de,this[Me+1]=de>>>8,Me+2},c.prototype.writeInt16BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,2,32767,-32768),this[Me]=de>>>8,this[Me+1]=255&de,Me+2},c.prototype.writeInt32LE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,2147483647,-2147483648),this[Me]=255&de,this[Me+1]=de>>>8,this[Me+2]=de>>>16,this[Me+3]=de>>>24,Me+4},c.prototype.writeInt32BE=function(de,Me,ke){return de=+de,Me>>>=0,ke||K(this,de,Me,4,2147483647,-2147483648),de<0&&(de=4294967295+de+1),this[Me]=de>>>24,this[Me+1]=de>>>16,this[Me+2]=de>>>8,this[Me+3]=255&de,Me+4},c.prototype.writeBigInt64LE=Ve(function(de){return ae(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Ve(function(de){return se(this,de,arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(de,Me,ke){return fe(this,de,Me,!0,ke)},c.prototype.writeFloatBE=function(de,Me,ke){return fe(this,de,Me,!1,ke)},c.prototype.writeDoubleLE=function(de,Me,ke){return ie(this,de,Me,!0,ke)},c.prototype.writeDoubleBE=function(de,Me,ke){return ie(this,de,Me,!1,ke)},c.prototype.copy=function(de,Me,ke,He){if(!c.isBuffer(de))throw new TypeError("argument should be a Buffer");if(ke||(ke=0),He||He===0||(He=this.length),Me>=de.length&&(Me=de.length),Me||(Me=0),He>0&&He=this.length)throw new RangeError("Index out of range");if(He<0)throw new RangeError("sourceEnd out of bounds");He>this.length&&(He=this.length),de.length-Me>>=0,ke=ke===void 0?this.length:ke>>>0,de||(de=0),typeof de=="number")for(qe=Me;qe=He+4;ke-=3)Me="_".concat(de.slice(ke-3,ke)).concat(Me);return"".concat(de.slice(0,ke)).concat(Me)}function ye(de,Me,ke,He,Fe,qe){if(de>ke||de3?Me===0||Me===BigInt(0)?">= 0".concat(Ye," and < 2").concat(Ye," ** ").concat(8*(qe+1)).concat(Ye):">= -(2".concat(Ye," ** ").concat(8*(qe+1)-1).concat(Ye,") and < 2 ** ")+"".concat(8*(qe+1)-1).concat(Ye):">= ".concat(Me).concat(Ye," and <= ").concat(ke).concat(Ye),new oe.ERR_OUT_OF_RANGE("value",$e,de)}(function(_e,De,Be){me(De,"offset"),_e[De]!==void 0&&_e[De+Be]!==void 0||be(De,_e.length-(Be+1))})(He,Fe,qe)}function me(de,Me){if(typeof de!="number")throw new oe.ERR_INVALID_ARG_TYPE(Me,"number",de)}function be(de,Me,ke){throw Math.floor(de)!==de?(me(de,ke),new oe.ERR_OUT_OF_RANGE(ke||"offset","an integer",de)):Me<0?new oe.ERR_BUFFER_OUT_OF_BOUNDS:new oe.ERR_OUT_OF_RANGE(ke||"offset",">= ".concat(ke?1:0," and <= ").concat(Me),de)}le("ERR_BUFFER_OUT_OF_BOUNDS",function(de){return de?"".concat(de," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),le("ERR_INVALID_ARG_TYPE",function(de,Me){return'The "'.concat(de,'" argument must be of type number. Received type ').concat(u(Me))},TypeError),le("ERR_OUT_OF_RANGE",function(de,Me,ke){var He='The value of "'.concat(de,'" is out of range.'),Fe=ke;return Number.isInteger(ke)&&Math.abs(ke)>Math.pow(2,32)?Fe=ge(String(ke)):typeof ke=="bigint"&&(Fe=String(ke),(ke>Math.pow(BigInt(2),BigInt(32))||ke<-Math.pow(BigInt(2),BigInt(32)))&&(Fe=ge(Fe)),Fe+="n"),He+" It must be ".concat(Me,". Received ").concat(Fe)},RangeError);var Se=/[^+/0-9A-Za-z-_]/g;function Ee(de,Me){var ke;Me=Me||1/0;for(var He=de.length,Fe=null,qe=[],$e=0;$e55295&&ke<57344){if(!Fe){if(ke>56319){(Me-=3)>-1&&qe.push(239,191,189);continue}if($e+1===He){(Me-=3)>-1&&qe.push(239,191,189);continue}Fe=ke;continue}if(ke<56320){(Me-=3)>-1&&qe.push(239,191,189),Fe=ke;continue}ke=65536+(Fe-55296<<10|ke-56320)}else Fe&&(Me-=3)>-1&&qe.push(239,191,189);if(Fe=null,ke<128){if((Me-=1)<0)break;qe.push(ke)}else if(ke<2048){if((Me-=2)<0)break;qe.push(ke>>6|192,63&ke|128)}else if(ke<65536){if((Me-=3)<0)break;qe.push(ke>>12|224,ke>>6&63|128,63&ke|128)}else{if(!(ke<1114112))throw new Error("Invalid code point");if((Me-=4)<0)break;qe.push(ke>>18|240,ke>>12&63|128,ke>>6&63|128,63&ke|128)}}return qe}function Ce(de){return r.toByteArray(function(Me){if((Me=(Me=Me.split("=")[0]).trim().replace(Se,"")).length<2)return"";for(;Me.length%4!=0;)Me+="=";return Me}(de))}function Le(de,Me,ke,He){var Fe;for(Fe=0;Fe=Me.length||Fe>=de.length);++Fe)Me[Fe+ke]=de[Fe];return Fe}function Oe(de,Me){return de instanceof Me||de!=null&&de.constructor!=null&&de.constructor.name!=null&&de.constructor.name===Me.name}function We(de){return de!=de}var Ie=function(){for(var de="0123456789abcdef",Me=new Array(256),ke=0;ke<16;++ke)for(var He=16*ke,Fe=0;Fe<16;++Fe)Me[He+Fe]=de[ke]+de[Fe];return Me}();function Ve(de){return typeof BigInt>"u"?Pe:de}function Pe(){throw new Error("BigInt not supported")}},13087:function(D){D.exports=d,D.exports.isMobile=d,D.exports.default=d;var L=/(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,t=/CrOS/,b=/android|ipad|playbook|silk/i;function d(e){e||(e={});var w=e.ua;if(w||typeof navigator>"u"||(w=navigator.userAgent),w&&w.headers&&typeof w.headers["user-agent"]=="string"&&(w=w.headers["user-agent"]),typeof w!="string")return!1;var y=L.test(w)&&!t.test(w)||!!e.tablet&&b.test(w);return!y&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&w.indexOf("Macintosh")!==-1&&w.indexOf("Safari")!==-1&&(y=!0),y}},5955:function(D,L,t){var b=t(22413),d=t.n(b),e=t(51070),w=t.n(e),y=t(62133),_=t.n(y),u=new URL(t(77035),t.b),r=new URL(t(43470),t.b),n=new URL(t(68164),t.b),l=new URL(t(64665),t.b),o=new URL(t(4890),t.b),s=new URL(t(13363),t.b),c=new URL(t(13490),t.b),h=new URL(t(47603),t.b),x=new URL(t(13913),t.b),m=new URL(t(91413),t.b),g=new URL(t(64643),t.b),k=new URL(t(80216),t.b),A=new URL(t(61907),t.b),v=new URL(t(68605),t.b),S=new URL(t(25446),t.b),T=new URL(t(56694),t.b),p=new URL(t(24420),t.b),M=new URL(t(75796),t.b),f=new URL(t(92228),t.b),E=new URL(t(9819),t.b),I=new URL(t(47695),t.b),B=new URL(t(28869),t.b),N=new URL(t(30557),t.b),V=new URL(t(48460),t.b),j=new URL(t(56539),t.b),$=new URL(t(43737),t.b),ee=new URL(t(47914),t.b),H=new URL(t(26117),t.b),J=new URL(t(66311),t.b),Q=w()(d()),Z=_()(u),K=_()(r),ae=_()(n),se=_()(l),he=_()(o),fe=_()(s),ie=_()(c),oe=_()(h),le=_()(x),ge=_()(m),ye=_()(g),me=_()(k),be=_()(A),Se=_()(v),Ee=_()(S),Ce=_()(T),Le=_()(p),Oe=_()(M),We=_()(f),Ie=_()(E),Ve=_()(I),Pe=_()(B),de=_()(N),Me=_()(V),ke=_()(j),He=_()($),Fe=_()(ee),qe=_()(H),$e=_()(J);Q.push([D.id,".maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("+Z+")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("+K+")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("+ae+")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("+se+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("+he+")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("+fe+")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("+ie+")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("+oe+")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("+le+")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("+ge+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("+ye+")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("+oe+")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("+me+")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("+be+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("+Se+")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("+Ee+")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("+Ce+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("+Le+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("+Oe+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("+We+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("+Ie+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("+Ve+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("+Pe+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("+de+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("+Me+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("+We+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("+Ie+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("+Ve+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("+Pe+")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("+ke+")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("+He+")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("+Fe+");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("+Fe+")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("+Fe+")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("+qe+");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgb(0 0 0/5%)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("+$e+")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("+qe+')}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:rgb(0 0 0/5%)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}',""]),L.A=Q},68735:function(D,L,t){t.r(L),t.d(L,{sankeyCenter:function(){return l},sankeyCircular:function(){return B},sankeyJustify:function(){return n},sankeyLeft:function(){return u},sankeyRight:function(){return r}});var b=t(29725),d=t(4575),e=t(48544),w=t(96143),y=t.n(w);function _(Ee){return Ee.target.depth}function u(Ee){return Ee.depth}function r(Ee,Ce){return Ce-1-Ee.height}function n(Ee,Ce){return Ee.sourceLinks.length?Ee.depth:Ce-1}function l(Ee){return Ee.targetLinks.length?Ee.depth:Ee.sourceLinks.length?(0,b.jk)(Ee.sourceLinks,_)-1:0}function o(Ee){return function(){return Ee}}var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ee){return typeof Ee}:function(Ee){return Ee&&typeof Symbol=="function"&&Ee.constructor===Symbol&&Ee!==Symbol.prototype?"symbol":typeof Ee};function c(Ee,Ce){return x(Ee.source,Ce.source)||Ee.index-Ce.index}function h(Ee,Ce){return x(Ee.target,Ce.target)||Ee.index-Ce.index}function x(Ee,Ce){return Ee.partOfCycle===Ce.partOfCycle?Ee.y0-Ce.y0:Ee.circularLinkType==="top"||Ce.circularLinkType==="bottom"?-1:1}function m(Ee){return Ee.value}function g(Ee){return(Ee.y0+Ee.y1)/2}function k(Ee){return g(Ee.source)}function A(Ee){return g(Ee.target)}function v(Ee){return Ee.index}function S(Ee){return Ee.nodes}function T(Ee){return Ee.links}function p(Ee,Ce){var Le=Ee.get(Ce);if(!Le)throw new Error("missing: "+Ce);return Le}function M(Ee,Ce){return Ce(Ee)}var f=25,E=10,I=.3;function B(){var Ee,Ce,Le=0,Oe=0,We=1,Ie=1,Ve=24,Pe=v,de=n,Me=S,ke=T,He=32,Fe=2,qe=null;function $e(){var _e={nodes:Me.apply(null,arguments),links:ke.apply(null,arguments)};(function(Be){Be.nodes.forEach(function(tt,nt){tt.index=nt,tt.sourceLinks=[],tt.targetLinks=[]});var Ge=(0,d.Tj)(Be.nodes,Pe);Be.links.forEach(function(tt,nt){tt.index=nt;var ft=tt.source,At=tt.target;(ft===void 0?"undefined":s(ft))!=="object"&&(ft=tt.source=p(Ge,ft)),(At===void 0?"undefined":s(At))!=="object"&&(At=tt.target=p(Ge,At)),ft.sourceLinks.push(tt),At.targetLinks.push(tt)})})(_e),function(Be,Ge,tt){var nt=0;if(tt===null){for(var ft=[],At=0;At0?Ot+f+E:Ot,bottom:Pt=Pt>0?Pt+f+E:Pt,left:lt=lt>0?lt+f+E:lt,right:at=at>0?at+f+E:at}}(Be),pt=function(yt,Ot){var Pt=(0,b.T9)(yt.nodes,function(wt){return wt.column}),at=We-Le,lt=Ie-Oe,Xe=at/(at+Ot.right+Ot.left),ut=lt/(lt+Ot.top+Ot.bottom);return Le=Le*Xe+Ot.left,We=Ot.right==0?We:We*Xe,Oe=Oe*ut+Ot.top,Ie*=ut,yt.nodes.forEach(function(wt){wt.x0=Le+wt.column*((We-Le-Ve)/Pt),wt.x1=wt.x0+Ve}),ut}(Be,Qe);st*=pt,Be.links.forEach(function(yt){yt.width=yt.value*st}),nt.forEach(function(yt){var Ot=yt.length;yt.forEach(function(Pt,at){Pt.depth==nt.length-1&&Ot==1||Pt.depth==0&&Ot==1?(Pt.y0=Ie/2-Pt.value*st,Pt.y1=Pt.y0+Pt.value*st):Pt.partOfCycle?j(Pt,Ht)==0?(Pt.y0=Ie/2+at,Pt.y1=Pt.y0+Pt.value*st):Pt.circularLinkType=="top"?(Pt.y0=Oe+at,Pt.y1=Pt.y0+Pt.value*st):(Pt.y0=Ie-Pt.value*st-at,Pt.y1=Pt.y0+Pt.value*st):Qe.top==0||Qe.bottom==0?(Pt.y0=(Ie-Oe)/Ot*at,Pt.y1=Pt.y0+Pt.value*st):(Pt.y0=(Ie-Oe)/2-Ot/2+at,Pt.y1=Pt.y0+Pt.value*st)})})})(tt),Vt();for(var ft=1,At=Ge;At>0;--At)kt(ft*=.99,tt),Vt();function kt(Ht,Gt){var st=nt.length;nt.forEach(function(Qe){var pt=Qe.length,yt=Qe[0].depth;Qe.forEach(function(Ot){var Pt;if((Ot.sourceLinks.length||Ot.targetLinks.length)&&!(Ot.partOfCycle&&j(Ot,Gt)>0))if(yt==0&&pt==1)Pt=Ot.y1-Ot.y0,Ot.y0=Ie/2-Pt/2,Ot.y1=Ie/2+Pt/2;else if(yt==st-1&&pt==1)Pt=Ot.y1-Ot.y0,Ot.y0=Ie/2-Pt/2,Ot.y1=Ie/2+Pt/2;else{var at=(0,b.i2)(Ot.sourceLinks,A),lt=(0,b.i2)(Ot.targetLinks,k),Xe=((at&<?(at+lt)/2:at||lt)-g(Ot))*Ht;Ot.y0+=Xe,Ot.y1+=Xe}})})}function Vt(){nt.forEach(function(Ht){var Gt,st,Qe,pt=Oe,yt=Ht.length;for(Ht.sort(x),Qe=0;Qe0&&(Gt.y0+=st,Gt.y1+=st),pt=Gt.y1+Ee;if((st=pt-Ee-Ie)>0)for(pt=Gt.y0-=st,Gt.y1-=st,Qe=yt-2;Qe>=0;--Qe)(st=(Gt=Ht[Qe]).y1+Ee-pt)>0&&(Gt.y0-=st,Gt.y1-=st),pt=Gt.y0})}}(_e,He,Pe),Ye(_e);for(var De=0;De<4;De++)ge(_e,Ie,Pe),ye(_e,0,Pe),oe(_e,Oe,Ie,Pe),ge(_e,Ie,Pe),ye(_e,0,Pe);return function(Be,Ge,tt){var nt=Be.nodes,ft=Be.links,At=!1,kt=!1;if(ft.forEach(function(Gt){Gt.circularLinkType=="top"?At=!0:Gt.circularLinkType=="bottom"&&(kt=!0)}),At==0||kt==0){var Vt=(0,b.jk)(nt,function(Gt){return Gt.y0}),Ht=(tt-Ge)/((0,b.T9)(nt,function(Gt){return Gt.y1})-Vt);nt.forEach(function(Gt){var st=(Gt.y1-Gt.y0)*Ht;Gt.y0=(Gt.y0-Vt)*Ht,Gt.y1=Gt.y0+st}),ft.forEach(function(Gt){Gt.y0=(Gt.y0-Vt)*Ht,Gt.y1=(Gt.y1-Vt)*Ht,Gt.width=Gt.width*Ht})}}(_e,Oe,Ie),H(_e,Fe,Ie,Pe),_e}function Ye(_e){_e.nodes.forEach(function(De){De.sourceLinks.sort(h),De.targetLinks.sort(c)}),_e.nodes.forEach(function(De){var Be=De.y0,Ge=Be,tt=De.y1,nt=tt;De.sourceLinks.forEach(function(ft){ft.circular?(ft.y0=tt-ft.width/2,tt-=ft.width):(ft.y0=Be+ft.width/2,Be+=ft.width)}),De.targetLinks.forEach(function(ft){ft.circular?(ft.y1=nt-ft.width/2,nt-=ft.width):(ft.y1=Ge+ft.width/2,Ge+=ft.width)})})}return $e.nodeId=function(_e){return arguments.length?(Pe=typeof _e=="function"?_e:o(_e),$e):Pe},$e.nodeAlign=function(_e){return arguments.length?(de=typeof _e=="function"?_e:o(_e),$e):de},$e.nodeWidth=function(_e){return arguments.length?(Ve=+_e,$e):Ve},$e.nodePadding=function(_e){return arguments.length?(Ee=+_e,$e):Ee},$e.nodes=function(_e){return arguments.length?(Me=typeof _e=="function"?_e:o(_e),$e):Me},$e.links=function(_e){return arguments.length?(ke=typeof _e=="function"?_e:o(_e),$e):ke},$e.size=function(_e){return arguments.length?(Le=Oe=0,We=+_e[0],Ie=+_e[1],$e):[We-Le,Ie-Oe]},$e.extent=function(_e){return arguments.length?(Le=+_e[0][0],We=+_e[1][0],Oe=+_e[0][1],Ie=+_e[1][1],$e):[[Le,Oe],[We,Ie]]},$e.iterations=function(_e){return arguments.length?(He=+_e,$e):He},$e.circularLinkGap=function(_e){return arguments.length?(Fe=+_e,$e):Fe},$e.nodePaddingRatio=function(_e){return arguments.length?(Ce=+_e,$e):Ce},$e.sortNodes=function(_e){return arguments.length?(qe=_e,$e):qe},$e.update=function(_e){return N(_e,Pe),Ye(_e),_e.links.forEach(function(De){De.circular&&(De.circularLinkType=De.y0+De.y11||We>1)}function ee(Ee,Ce,Le){return Ee.sort(J),Ee.forEach(function(Oe,We){var Ie,Ve,Pe=0;if(Se(Oe,Le)&&$(Oe))Oe.circularPathData.verticalBuffer=Pe+Oe.width/2;else{for(var de=0;deVe.source.column)){var Me=Ee[de].circularPathData.verticalBuffer+Ee[de].width/2+Ce;Pe=Me>Pe?Me:Pe}Oe.circularPathData.verticalBuffer=Pe+Oe.width/2}}),Ee}function H(Ee,Ce,Le,Oe){var We=(0,b.jk)(Ee.links,function(Ie){return Ie.source.y0});Ee.links.forEach(function(Ie){Ie.circular&&(Ie.circularPathData={})}),ee(Ee.links.filter(function(Ie){return Ie.circularLinkType=="top"}),Ce,Oe),ee(Ee.links.filter(function(Ie){return Ie.circularLinkType=="bottom"}),Ce,Oe),Ee.links.forEach(function(Ie){if(Ie.circular){if(Ie.circularPathData.arcRadius=Ie.width+E,Ie.circularPathData.leftNodeBuffer=5,Ie.circularPathData.rightNodeBuffer=5,Ie.circularPathData.sourceWidth=Ie.source.x1-Ie.source.x0,Ie.circularPathData.sourceX=Ie.source.x0+Ie.circularPathData.sourceWidth,Ie.circularPathData.targetX=Ie.target.x0,Ie.circularPathData.sourceY=Ie.y0,Ie.circularPathData.targetY=Ie.y1,Se(Ie,Oe)&&$(Ie))Ie.circularPathData.leftSmallArcRadius=E+Ie.width/2,Ie.circularPathData.leftLargeArcRadius=E+Ie.width/2,Ie.circularPathData.rightSmallArcRadius=E+Ie.width/2,Ie.circularPathData.rightLargeArcRadius=E+Ie.width/2,Ie.circularLinkType=="bottom"?(Ie.circularPathData.verticalFullExtent=Ie.source.y1+f+Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.rightLargeArcRadius):(Ie.circularPathData.verticalFullExtent=Ie.source.y0-f-Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.rightLargeArcRadius);else{var Ve=Ie.source.column,Pe=Ie.circularLinkType,de=Ee.links.filter(function(He){return He.source.column==Ve&&He.circularLinkType==Pe});Ie.circularLinkType=="bottom"?de.sort(Z):de.sort(Q);var Me=0;de.forEach(function(He,Fe){He.circularLinkID==Ie.circularLinkID&&(Ie.circularPathData.leftSmallArcRadius=E+Ie.width/2+Me,Ie.circularPathData.leftLargeArcRadius=E+Ie.width/2+Fe*Ce+Me),Me+=He.width}),Ve=Ie.target.column,de=Ee.links.filter(function(He){return He.target.column==Ve&&He.circularLinkType==Pe}),Ie.circularLinkType=="bottom"?de.sort(ae):de.sort(K),Me=0,de.forEach(function(He,Fe){He.circularLinkID==Ie.circularLinkID&&(Ie.circularPathData.rightSmallArcRadius=E+Ie.width/2+Me,Ie.circularPathData.rightLargeArcRadius=E+Ie.width/2+Fe*Ce+Me),Me+=He.width}),Ie.circularLinkType=="bottom"?(Ie.circularPathData.verticalFullExtent=Math.max(Le,Ie.source.y1,Ie.target.y1)+f+Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent-Ie.circularPathData.rightLargeArcRadius):(Ie.circularPathData.verticalFullExtent=We-f-Ie.circularPathData.verticalBuffer,Ie.circularPathData.verticalLeftInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.leftLargeArcRadius,Ie.circularPathData.verticalRightInnerExtent=Ie.circularPathData.verticalFullExtent+Ie.circularPathData.rightLargeArcRadius)}Ie.circularPathData.leftInnerExtent=Ie.circularPathData.sourceX+Ie.circularPathData.leftNodeBuffer,Ie.circularPathData.rightInnerExtent=Ie.circularPathData.targetX-Ie.circularPathData.rightNodeBuffer,Ie.circularPathData.leftFullExtent=Ie.circularPathData.sourceX+Ie.circularPathData.leftLargeArcRadius+Ie.circularPathData.leftNodeBuffer,Ie.circularPathData.rightFullExtent=Ie.circularPathData.targetX-Ie.circularPathData.rightLargeArcRadius-Ie.circularPathData.rightNodeBuffer}if(Ie.circular)Ie.path=function(He){return He.circularLinkType=="top"?"M"+He.circularPathData.sourceX+" "+He.circularPathData.sourceY+" L"+He.circularPathData.leftInnerExtent+" "+He.circularPathData.sourceY+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftSmallArcRadius+" 0 0 0 "+He.circularPathData.leftFullExtent+" "+(He.circularPathData.sourceY-He.circularPathData.leftSmallArcRadius)+" L"+He.circularPathData.leftFullExtent+" "+He.circularPathData.verticalLeftInnerExtent+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftLargeArcRadius+" 0 0 0 "+He.circularPathData.leftInnerExtent+" "+He.circularPathData.verticalFullExtent+" L"+He.circularPathData.rightInnerExtent+" "+He.circularPathData.verticalFullExtent+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightLargeArcRadius+" 0 0 0 "+He.circularPathData.rightFullExtent+" "+He.circularPathData.verticalRightInnerExtent+" L"+He.circularPathData.rightFullExtent+" "+(He.circularPathData.targetY-He.circularPathData.rightSmallArcRadius)+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightSmallArcRadius+" 0 0 0 "+He.circularPathData.rightInnerExtent+" "+He.circularPathData.targetY+" L"+He.circularPathData.targetX+" "+He.circularPathData.targetY:"M"+He.circularPathData.sourceX+" "+He.circularPathData.sourceY+" L"+He.circularPathData.leftInnerExtent+" "+He.circularPathData.sourceY+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftSmallArcRadius+" 0 0 1 "+He.circularPathData.leftFullExtent+" "+(He.circularPathData.sourceY+He.circularPathData.leftSmallArcRadius)+" L"+He.circularPathData.leftFullExtent+" "+He.circularPathData.verticalLeftInnerExtent+" A"+He.circularPathData.leftLargeArcRadius+" "+He.circularPathData.leftLargeArcRadius+" 0 0 1 "+He.circularPathData.leftInnerExtent+" "+He.circularPathData.verticalFullExtent+" L"+He.circularPathData.rightInnerExtent+" "+He.circularPathData.verticalFullExtent+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightLargeArcRadius+" 0 0 1 "+He.circularPathData.rightFullExtent+" "+He.circularPathData.verticalRightInnerExtent+" L"+He.circularPathData.rightFullExtent+" "+(He.circularPathData.targetY+He.circularPathData.rightSmallArcRadius)+" A"+He.circularPathData.rightLargeArcRadius+" "+He.circularPathData.rightSmallArcRadius+" 0 0 1 "+He.circularPathData.rightInnerExtent+" "+He.circularPathData.targetY+" L"+He.circularPathData.targetX+" "+He.circularPathData.targetY}(Ie);else{var ke=(0,e.pq)().source(function(He){return[He.source.x0+(He.source.x1-He.source.x0),He.y0]}).target(function(He){return[He.target.x0,He.y1]});Ie.path=ke(Ie)}})}function J(Ee,Ce){return se(Ee)==se(Ce)?Ee.circularLinkType=="bottom"?Z(Ee,Ce):Q(Ee,Ce):se(Ce)-se(Ee)}function Q(Ee,Ce){return Ee.y0-Ce.y0}function Z(Ee,Ce){return Ce.y0-Ee.y0}function K(Ee,Ce){return Ee.y1-Ce.y1}function ae(Ee,Ce){return Ce.y1-Ee.y1}function se(Ee){return Ee.target.column-Ee.source.column}function he(Ee){return Ee.target.x0-Ee.source.x1}function fe(Ee,Ce){var Le=V(Ee),Oe=he(Ce)/Math.tan(Le);return be(Ee)=="up"?Ee.y1+Oe:Ee.y1-Oe}function ie(Ee,Ce){var Le=V(Ee),Oe=he(Ce)/Math.tan(Le);return be(Ee)=="up"?Ee.y1-Oe:Ee.y1+Oe}function oe(Ee,Ce,Le,Oe){Ee.links.forEach(function(We){if(!We.circular&&We.target.column-We.source.column>1){var Ie=We.source.column+1,Ve=We.target.column-1,Pe=1,de=Ve-Ie+1;for(Pe=1;Ie<=Ve;Ie++,Pe++)Ee.nodes.forEach(function(Me){if(Me.column==Ie){var ke,He=Pe/(de+1),Fe=Math.pow(1-He,3),qe=3*He*Math.pow(1-He,2),$e=3*Math.pow(He,2)*(1-He),Ye=Math.pow(He,3),_e=Fe*We.y0+qe*We.y0+$e*We.y1+Ye*We.y1,De=_e-We.width/2,Be=_e+We.width/2;De>Me.y0&&Dent.y0&&tt.y0nt.y0&&tt.y1nt.y1)&&le(Ge,ke,Ce,Le)})):(Be>Me.y0&&BeMe.y1)&&(ke=Be-Me.y0+10,Me=le(Me,ke,Ce,Le),Ee.nodes.forEach(function(Ge){M(Ge,Oe)!=M(Me,Oe)&&Ge.column==Me.column&&Ge.y0Me.y1&&le(Ge,ke,Ce,Le)}))}})}})}function le(Ee,Ce,Le,Oe){return Ee.y0+Ce>=Le&&Ee.y1+Ce<=Oe&&(Ee.y0=Ee.y0+Ce,Ee.y1=Ee.y1+Ce,Ee.targetLinks.forEach(function(We){We.y1=We.y1+Ce}),Ee.sourceLinks.forEach(function(We){We.y0=We.y0+Ce})),Ee}function ge(Ee,Ce,Le,Oe){Ee.nodes.forEach(function(We){Oe&&We.y+(We.y1-We.y0)>Ce&&(We.y=We.y-(We.y+(We.y1-We.y0)-Ce));var Ie=Ee.links.filter(function(de){return M(de.source,Le)==M(We,Le)}),Ve=Ie.length;Ve>1&&Ie.sort(function(de,Me){if(!de.circular&&!Me.circular){if(de.target.column==Me.target.column||!me(de,Me))return de.y1-Me.y1;if(de.target.column>Me.target.column){var ke=ie(Me,de);return de.y1-ke}if(Me.target.column>de.target.column)return ie(de,Me)-Me.y1}return de.circular&&!Me.circular?de.circularLinkType=="top"?-1:1:Me.circular&&!de.circular?Me.circularLinkType=="top"?1:-1:de.circular&&Me.circular?de.circularLinkType===Me.circularLinkType&&de.circularLinkType=="top"?de.target.column===Me.target.column?de.target.y1-Me.target.y1:Me.target.column-de.target.column:de.circularLinkType===Me.circularLinkType&&de.circularLinkType=="bottom"?de.target.column===Me.target.column?Me.target.y1-de.target.y1:de.target.column-Me.target.column:de.circularLinkType=="top"?-1:1:void 0});var Pe=We.y0;Ie.forEach(function(de){de.y0=Pe+de.width/2,Pe+=de.width}),Ie.forEach(function(de,Me){if(de.circularLinkType=="bottom"){for(var ke=Me+1,He=0;ke1&&We.sort(function(Pe,de){if(!Pe.circular&&!de.circular){if(Pe.source.column==de.source.column||!me(Pe,de))return Pe.y0-de.y0;if(de.source.column0?"up":"down"}function Se(Ee,Ce){return M(Ee.source,Ce)==M(Ee.target,Ce)}},62369:function(D,L,t){t.r(L),t.d(L,{sankey:function(){return v},sankeyCenter:function(){return u},sankeyJustify:function(){return _},sankeyLeft:function(){return w},sankeyLinkHorizontal:function(){return M},sankeyRight:function(){return y}});var b=t(29725),d=t(4575);function e(f){return f.target.depth}function w(f){return f.depth}function y(f,E){return E-1-f.height}function _(f,E){return f.sourceLinks.length?f.depth:E-1}function u(f){return f.targetLinks.length?f.depth:f.sourceLinks.length?(0,b.jk)(f.sourceLinks,e)-1:0}function r(f){return function(){return f}}function n(f,E){return o(f.source,E.source)||f.index-E.index}function l(f,E){return o(f.target,E.target)||f.index-E.index}function o(f,E){return f.y0-E.y0}function s(f){return f.value}function c(f){return(f.y0+f.y1)/2}function h(f){return c(f.source)*f.value}function x(f){return c(f.target)*f.value}function m(f){return f.index}function g(f){return f.nodes}function k(f){return f.links}function A(f,E){var I=f.get(E);if(!I)throw new Error("missing: "+E);return I}function v(){var f=0,E=0,I=1,B=1,N=24,V=8,j=m,$=_,ee=g,H=k,J=32;function Q(){var K={nodes:ee.apply(null,arguments),links:H.apply(null,arguments)};return function(ae){ae.nodes.forEach(function(he,fe){he.index=fe,he.sourceLinks=[],he.targetLinks=[]});var se=(0,d.Tj)(ae.nodes,j);ae.links.forEach(function(he,fe){he.index=fe;var ie=he.source,oe=he.target;typeof ie!="object"&&(ie=he.source=A(se,ie)),typeof oe!="object"&&(oe=he.target=A(se,oe)),ie.sourceLinks.push(he),oe.targetLinks.push(he)})}(K),function(ae){ae.nodes.forEach(function(se){se.value=Math.max((0,b.cz)(se.sourceLinks,s),(0,b.cz)(se.targetLinks,s))})}(K),function(ae){var se,he,fe;for(se=ae.nodes,he=[],fe=0;se.length;++fe,se=he,he=[])se.forEach(function(oe){oe.depth=fe,oe.sourceLinks.forEach(function(le){he.indexOf(le.target)<0&&he.push(le.target)})});for(se=ae.nodes,he=[],fe=0;se.length;++fe,se=he,he=[])se.forEach(function(oe){oe.height=fe,oe.targetLinks.forEach(function(le){he.indexOf(le.source)<0&&he.push(le.source)})});var ie=(I-f-N)/(fe-1);ae.nodes.forEach(function(oe){oe.x1=(oe.x0=f+Math.max(0,Math.min(fe-1,Math.floor($.call(null,oe,fe))))*ie)+N})}(K),function(ae){var se=(0,d.$I)().key(function(ge){return ge.x0}).sortKeys(b.V_).entries(ae.nodes).map(function(ge){return ge.values});(function(){var ge=(0,b.T9)(se,function(be){return be.length}),ye=.6666666666666666*(B-E)/(ge-1);V>ye&&(V=ye);var me=(0,b.jk)(se,function(be){return(B-E-(be.length-1)*V)/(0,b.cz)(be,s)});se.forEach(function(be){be.forEach(function(Se,Ee){Se.y1=(Se.y0=Ee)+Se.value*me})}),ae.links.forEach(function(be){be.width=be.value*me})})(),le();for(var he=1,fe=J;fe>0;--fe)oe(he*=.99),le(),ie(he),le();function ie(ge){se.forEach(function(ye){ye.forEach(function(me){if(me.targetLinks.length){var be=((0,b.cz)(me.targetLinks,h)/(0,b.cz)(me.targetLinks,s)-c(me))*ge;me.y0+=be,me.y1+=be}})})}function oe(ge){se.slice().reverse().forEach(function(ye){ye.forEach(function(me){if(me.sourceLinks.length){var be=((0,b.cz)(me.sourceLinks,x)/(0,b.cz)(me.sourceLinks,s)-c(me))*ge;me.y0+=be,me.y1+=be}})})}function le(){se.forEach(function(ge){var ye,me,be,Se=E,Ee=ge.length;for(ge.sort(o),be=0;be0&&(ye.y0+=me,ye.y1+=me),Se=ye.y1+V;if((me=Se-V-B)>0)for(Se=ye.y0-=me,ye.y1-=me,be=Ee-2;be>=0;--be)(me=(ye=ge[be]).y1+V-Se)>0&&(ye.y0-=me,ye.y1-=me),Se=ye.y0})}}(K),Z(K),K}function Z(K){K.nodes.forEach(function(ae){ae.sourceLinks.sort(l),ae.targetLinks.sort(n)}),K.nodes.forEach(function(ae){var se=ae.y0,he=se;ae.sourceLinks.forEach(function(fe){fe.y0=se+fe.width/2,se+=fe.width}),ae.targetLinks.forEach(function(fe){fe.y1=he+fe.width/2,he+=fe.width})})}return Q.update=function(K){return Z(K),K},Q.nodeId=function(K){return arguments.length?(j=typeof K=="function"?K:r(K),Q):j},Q.nodeAlign=function(K){return arguments.length?($=typeof K=="function"?K:r(K),Q):$},Q.nodeWidth=function(K){return arguments.length?(N=+K,Q):N},Q.nodePadding=function(K){return arguments.length?(V=+K,Q):V},Q.nodes=function(K){return arguments.length?(ee=typeof K=="function"?K:r(K),Q):ee},Q.links=function(K){return arguments.length?(H=typeof K=="function"?K:r(K),Q):H},Q.size=function(K){return arguments.length?(f=E=0,I=+K[0],B=+K[1],Q):[I-f,B-E]},Q.extent=function(K){return arguments.length?(f=+K[0][0],I=+K[1][0],E=+K[0][1],B=+K[1][1],Q):[[f,E],[I,B]]},Q.iterations=function(K){return arguments.length?(J=+K,Q):J},Q}var S=t(48544);function T(f){return[f.source.x1,f.y0]}function p(f){return[f.target.x0,f.y1]}function M(){return(0,S.pq)().source(T).target(p)}},45568:function(D,L,t){var b,d;(function(){var e={version:"3.8.2"},w=[].slice,y=function(a){return w.call(a)},_=self.document;function u(a){return a&&(a.ownerDocument||a.document||a).documentElement}function r(a){return a&&(a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView)}if(_)try{y(_.documentElement.childNodes)[0].nodeType}catch{y=function(C){for(var F=C.length,q=new Array(F);F--;)q[F]=C[F];return q}}if(Date.now||(Date.now=function(){return+new Date}),_)try{_.createElement("DIV").style.setProperty("opacity",0,"")}catch{var n=this.Element.prototype,l=n.setAttribute,o=n.setAttributeNS,s=this.CSSStyleDeclaration.prototype,c=s.setProperty;n.setAttribute=function(C,F){l.call(this,C,F+"")},n.setAttributeNS=function(C,F,q){o.call(this,C,F,q+"")},s.setProperty=function(C,F,q){c.call(this,C,F+"",q)}}function h(a,C){return aC?1:a>=C?0:NaN}function x(a){return a===null?NaN:+a}function m(a){return!isNaN(a)}function g(a){return{left:function(C,F,q,te){for(arguments.length<3&&(q=0),arguments.length<4&&(te=C.length);q>>1;a(C[ue],F)<0?q=ue+1:te=ue}return q},right:function(C,F,q,te){for(arguments.length<3&&(q=0),arguments.length<4&&(te=C.length);q>>1;a(C[ue],F)>0?te=ue:q=ue+1}return q}}}e.ascending=h,e.descending=function(a,C){return Ca?1:C>=a?0:NaN},e.min=function(a,C){var F,q,te=-1,ue=a.length;if(arguments.length===1){for(;++te=q){F=q;break}for(;++teq&&(F=q)}else{for(;++te=q){F=q;break}for(;++teq&&(F=q)}return F},e.max=function(a,C){var F,q,te=-1,ue=a.length;if(arguments.length===1){for(;++te=q){F=q;break}for(;++teF&&(F=q)}else{for(;++te=q){F=q;break}for(;++teF&&(F=q)}return F},e.extent=function(a,C){var F,q,te,ue=-1,ve=a.length;if(arguments.length===1){for(;++ue=q){F=te=q;break}for(;++ueq&&(F=q),te=q){F=te=q;break}for(;++ueq&&(F=q),te1)return ve/(Re-1)},e.deviation=function(){var a=e.variance.apply(this,arguments);return a&&Math.sqrt(a)};var k=g(h);function A(a){return a.length}e.bisectLeft=k.left,e.bisect=e.bisectRight=k.right,e.bisector=function(a){return g(a.length===1?function(C,F){return h(a(C),F)}:a)},e.shuffle=function(a,C,F){(ue=arguments.length)<3&&(F=a.length,ue<2&&(C=0));for(var q,te,ue=F-C;ue;)te=Math.random()*ue--|0,q=a[ue+C],a[ue+C]=a[te+C],a[te+C]=q;return a},e.permute=function(a,C){for(var F=C.length,q=new Array(F);F--;)q[F]=a[C[F]];return q},e.pairs=function(a){for(var C=0,F=a.length-1,q=a[0],te=new Array(F<0?0:F);C=0;)for(C=(q=a[te]).length;--C>=0;)F[--ve]=q[C];return F};var v=Math.abs;function S(a,C){for(var F in C)Object.defineProperty(a.prototype,F,{value:C[F],enumerable:!1})}function T(){this._=Object.create(null)}e.range=function(a,C,F){if(arguments.length<3&&(F=1,arguments.length<2&&(C=a,a=0)),(C-a)/F==1/0)throw new Error("infinite range");var q,te=[],ue=function(Ae){for(var Re=1;Ae*Re%1;)Re*=10;return Re}(v(F)),ve=-1;if(a*=ue,C*=ue,(F*=ue)<0)for(;(q=a+F*++ve)>C;)te.push(q/ue);else for(;(q=a+F*++ve)=q.length)return C?C.call(F,Re):a?Re.sort(a):Re;for(var it,ct,dt,bt,Ct=-1,Mt=Re.length,Ut=q[Ue++],It=new T;++Ct=q.length)return Ae;var Ue=[],it=te[Re++];return Ae.forEach(function(ct,dt){Ue.push({key:ct,values:ve(dt,Re)})}),it?Ue.sort(function(ct,dt){return it(ct.key,dt.key)}):Ue}return F.map=function(Ae,Re){return ue(Re,Ae,0)},F.entries=function(Ae){return ve(ue(e.map,Ae,0),0)},F.key=function(Ae){return q.push(Ae),F},F.sortKeys=function(Ae){return te[q.length-1]=Ae,F},F.sortValues=function(Ae){return a=Ae,F},F.rollup=function(Ae){return C=Ae,F},F},e.set=function(a){var C=new $;if(a)for(var F=0,q=a.length;F=0&&(q=a.slice(F+1),a=a.slice(0,F)),a)return arguments.length<2?this[a].on(q):this[a].on(q,C);if(arguments.length===2){if(C==null)for(a in this)this.hasOwnProperty(a)&&this[a].on(q,null);return this}},e.event=null,e.requote=function(a){return a.replace(ie,"\\$&")};var ie=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,oe={}.__proto__?function(a,C){a.__proto__=C}:function(a,C){for(var F in C)a[F]=C[F]};function le(a){return oe(a,be),a}var ge=function(a,C){return C.querySelector(a)},ye=function(a,C){return C.querySelectorAll(a)},me=function(a,C){var F=a.matches||a[J(a,"matchesSelector")];return me=function(q,te){return F.call(q,te)},me(a,C)};typeof Sizzle=="function"&&(ge=function(a,C){return Sizzle(a,C)[0]||null},ye=Sizzle,me=Sizzle.matchesSelector),e.selection=function(){return e.select(_.documentElement)};var be=e.selection.prototype=[];function Se(a){return typeof a=="function"?a:function(){return ge(a,this)}}function Ee(a){return typeof a=="function"?a:function(){return ye(a,this)}}be.select=function(a){var C,F,q,te,ue=[];a=Se(a);for(var ve=-1,Ae=this.length;++ve=0&&(F=a.slice(0,C))!=="xmlns"&&(a=a.slice(C+1)),Le.hasOwnProperty(F)?{space:Le[F],local:a}:a}},be.attr=function(a,C){if(arguments.length<2){if(typeof a=="string"){var F=this.node();return(a=e.ns.qualify(a)).local?F.getAttributeNS(a.space,a.local):F.getAttribute(a)}for(C in a)this.each(Oe(C,a[C]));return this}return this.each(Oe(a,C))},be.classed=function(a,C){if(arguments.length<2){if(typeof a=="string"){var F=this.node(),q=(a=Ve(a)).length,te=-1;if(C=F.classList){for(;++te=0;)(F=q[te])&&(ue&&ue!==F.nextSibling&&ue.parentNode.insertBefore(F,ue),ue=F);return this},be.sort=function(a){a=Ye.apply(this,arguments);for(var C=-1,F=this.length;++C0&&(a=a.slice(0,te));var ve=tt.get(a);function Ae(){var Re=this[q];Re&&(this.removeEventListener(a,Re,Re.$),delete this[q])}return ve&&(a=ve,ue=ft),te?C?function(){var Re=ue(C,y(arguments));Ae.call(this),this.addEventListener(a,this[q]=Re,Re.$=F),Re._=C}:Ae:C?Z:function(){var Re,Ue=new RegExp("^__on([^.]+)"+e.requote(a)+"$");for(var it in this)if(Re=it.match(Ue)){var ct=this[it];this.removeEventListener(Re[1],ct,ct.$),delete this[it]}}}e.selection.enter=De,e.selection.enter.prototype=Be,Be.append=be.append,Be.empty=be.empty,Be.node=be.node,Be.call=be.call,Be.size=be.size,Be.select=function(a){for(var C,F,q,te,ue,ve=[],Ae=-1,Re=this.length;++Ae=q&&(q=ve+1);!(Re=Ue[q])&&++q1?at:a<-1?-at:Math.asin(a)}function wt(a){return((a=Math.exp(a))+1/a)/2}var vt=Math.SQRT2;e.interpolateZoom=function(a,C){var F,q,te=a[0],ue=a[1],ve=a[2],Ae=C[0],Re=C[1],Ue=C[2],it=Ae-te,ct=Re-ue,dt=it*it+ct*ct;if(dt0&&(Sr=Sr.transition().duration(dt)),Sr.call(tn.event)}function Hn(){ve&&ve.domain(ue.range().map(function(Sr){return(Sr-Ue.x)/Ue.k}).map(ue.invert)),Re&&Re.domain(Ae.range().map(function(Sr){return(Sr-Ue.y)/Ue.k}).map(Ae.invert))}function Xn(Sr){bt++||Sr({type:"zoomstart"})}function rr(Sr){Hn(),Sr({type:"zoom",scale:Ue.k,translate:[Ue.x,Ue.y]})}function Mr(Sr){--bt||(Sr({type:"zoomend"}),C=null)}function nr(){var Sr=this,Vr=Qt.of(Sr,arguments),fi=0,Nr=e.select(r(Sr)).on(Mt,function(){fi=1,Mn(e.mouse(Sr),si),rr(Vr)}).on(Ut,function(){Nr.on(Mt,null).on(Ut,null),_i(fi),Mr(Vr)}),si=Yt(e.mouse(Sr)),_i=Vt(Sr);Mo.call(Sr),Xn(Vr)}function Lr(){var Sr,Vr=this,fi=Qt.of(Vr,arguments),Nr={},si=0,_i=".zoom-"+e.event.changedTouches[0].identifier,Gi="touchmove"+_i,Pi="touchend"+_i,Ji=[],Yi=e.select(Vr),na=Vt(Vr);function Ma(){var Da=e.touches(Vr);return Sr=Ue.k,Da.forEach(function(ca){ca.identifier in Nr&&(Nr[ca.identifier]=Yt(ca))}),Da}function go(){var Da=e.event.target;e.select(Da).on(Gi,uo).on(Pi,Go),Ji.push(Da);for(var ca=e.event.changedTouches,Qa=0,Ra=ca.length;Qa1){qa=wa[0];var fa=wa[1],Pl=qa[0]-fa[0],mo=qa[1]-fa[1];si=Pl*Pl+mo*mo}}function uo(){var Da,ca,Qa,Ra,wa=e.touches(Vr);Mo.call(Vr);for(var Fa=0,qa=wa.length;Fa360?Ae-=360:Ae<0&&(Ae+=360),Ae<60?q+(te-q)*Ae/60:Ae<180?te:Ae<240?q+(te-q)*(240-Ae)/60:q}(ve))}return a=isNaN(a)?0:(a%=360)<0?a+360:a,C=isNaN(C)||C<0?0:C>1?1:C,q=2*(F=F<0?0:F>1?1:F)-(te=F<=.5?F*(1+C):F+C-F*C),new Kn(ue(a+120),ue(a),ue(a-120))}function St(a,C,F){return this instanceof St?(this.h=+a,this.c=+C,void(this.l=+F)):arguments.length<2?a instanceof St?new St(a.h,a.c,a.l):function(q,te,ue){return q>0?new St(Math.atan2(ue,te)*Xe,Math.sqrt(te*te+ue*ue),q):new St(NaN,NaN,q)}(a instanceof en?a.l:(a=$n((a=e.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new St(a,C,F)}Bt.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),new Et(this.h,this.s,this.l/a)},Bt.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),new Et(this.h,this.s,a*this.l)},Bt.rgb=function(){return Ft(this.h,this.s,this.l)},e.hcl=St;var Jt=St.prototype=new et;function qt(a,C,F){return isNaN(a)&&(a=0),isNaN(C)&&(C=0),new en(F,Math.cos(a*=lt)*C,Math.sin(a)*C)}function en(a,C,F){return this instanceof en?(this.l=+a,this.a=+C,void(this.b=+F)):arguments.length<2?a instanceof en?new en(a.l,a.a,a.b):a instanceof St?qt(a.h,a.c,a.l):$n((a=Kn(a)).r,a.g,a.b):new en(a,C,F)}Jt.brighter=function(a){return new St(this.h,this.c,Math.min(100,this.l+Wt*(arguments.length?a:1)))},Jt.darker=function(a){return new St(this.h,this.c,Math.max(0,this.l-Wt*(arguments.length?a:1)))},Jt.rgb=function(){return qt(this.h,this.c,this.l).rgb()},e.lab=en;var Wt=18,Zt=.95047,on=1,un=1.08883,Pn=en.prototype=new et;function Dn(a,C,F){var q=(a+16)/116,te=q+C/500,ue=q-F/200;return new Kn(En(3.2404542*(te=In(te)*Zt)-1.5371385*(q=In(q)*on)-.4985314*(ue=In(ue)*un)),En(-.969266*te+1.8760108*q+.041556*ue),En(.0556434*te-.2040259*q+1.0572252*ue))}function In(a){return a>.206893034?a*a*a:(a-.13793103448275862)/7.787037}function mn(a){return a>.008856?Math.pow(a,.3333333333333333):7.787037*a+.13793103448275862}function En(a){return Math.round(255*(a<=.00304?12.92*a:1.055*Math.pow(a,.4166666666666667)-.055))}function Kn(a,C,F){return this instanceof Kn?(this.r=~~a,this.g=~~C,void(this.b=~~F)):arguments.length<2?a instanceof Kn?new Kn(a.r,a.g,a.b):zn(""+a,Kn,Ft):new Kn(a,C,F)}function Ln(a){return new Kn(a>>16,a>>8&255,255&a)}function Tn(a){return Ln(a)+""}Pn.brighter=function(a){return new en(Math.min(100,this.l+Wt*(arguments.length?a:1)),this.a,this.b)},Pn.darker=function(a){return new en(Math.max(0,this.l-Wt*(arguments.length?a:1)),this.a,this.b)},Pn.rgb=function(){return Dn(this.l,this.a,this.b)},e.rgb=Kn;var Fn=Kn.prototype=new et;function wn(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function zn(a,C,F){var q,te,ue,ve=0,Ae=0,Re=0;if(q=/([a-z]+)\((.*)\)/.exec(a=a.toLowerCase()))switch(te=q[2].split(","),q[1]){case"hsl":return F(parseFloat(te[0]),parseFloat(te[1])/100,parseFloat(te[2])/100);case"rgb":return C(Qn(te[0]),Qn(te[1]),Qn(te[2]))}return(ue=lr.get(a))?C(ue.r,ue.g,ue.b):(a==null||a.charAt(0)!=="#"||isNaN(ue=parseInt(a.slice(1),16))||(a.length===4?(ve=(3840&ue)>>4,ve|=ve>>4,Ae=240&ue,Ae|=Ae>>4,Re=15&ue,Re|=Re<<4):a.length===7&&(ve=(16711680&ue)>>16,Ae=(65280&ue)>>8,Re=255&ue)),C(ve,Ae,Re))}function Jn(a,C,F){var q,te,ue=Math.min(a/=255,C/=255,F/=255),ve=Math.max(a,C,F),Ae=ve-ue,Re=(ve+ue)/2;return Ae?(te=Re<.5?Ae/(ve+ue):Ae/(2-ve-ue),q=a==ve?(C-F)/Ae+(C0&&Re<1?0:q),new Et(q,te,Re)}function $n(a,C,F){var q=mn((.4124564*(a=vr(a))+.3575761*(C=vr(C))+.1804375*(F=vr(F)))/Zt),te=mn((.2126729*a+.7151522*C+.072175*F)/on);return en(116*te-16,500*(q-te),200*(te-mn((.0193339*a+.119192*C+.9503041*F)/un)))}function vr(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Qn(a){var C=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(2.55*C):C}Fn.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var C=this.r,F=this.g,q=this.b,te=30;return C||F||q?(C&&C=200&&ct<300||ct===304){try{it=F.call(te,Ae)}catch(dt){return void ue.error.call(te,dt)}ue.load.call(te,it)}else ue.error.call(te,Ae)}return self.XDomainRequest&&!("withCredentials"in Ae)&&/^(http(s)?:)?\/\//.test(a)&&(Ae=new XDomainRequest),"onload"in Ae?Ae.onload=Ae.onerror=Ue:Ae.onreadystatechange=function(){Ae.readyState>3&&Ue()},Ae.onprogress=function(it){var ct=e.event;e.event=it;try{ue.progress.call(te,Ae)}finally{e.event=ct}},te.header=function(it,ct){return it=(it+"").toLowerCase(),arguments.length<2?ve[it]:(ct==null?delete ve[it]:ve[it]=ct+"",te)},te.mimeType=function(it){return arguments.length?(C=it==null?null:it+"",te):C},te.responseType=function(it){return arguments.length?(Re=it,te):Re},te.response=function(it){return F=it,te},["get","post"].forEach(function(it){te[it]=function(){return te.send.apply(te,[it].concat(y(arguments)))}}),te.send=function(it,ct,dt){if(arguments.length===2&&typeof ct=="function"&&(dt=ct,ct=null),Ae.open(it,a,!0),C==null||"accept"in ve||(ve.accept=C+",*/*"),Ae.setRequestHeader)for(var bt in ve)Ae.setRequestHeader(bt,ve[bt]);return C!=null&&Ae.overrideMimeType&&Ae.overrideMimeType(C),Re!=null&&(Ae.responseType=Re),dt!=null&&te.on("error",dt).on("load",function(Ct){dt(null,Ct)}),ue.beforesend.call(te,Ae),Ae.send(ct??null),te},te.abort=function(){return Ae.abort(),te},e.rebind(te,ue,"on"),q==null?te:te.get(function(it){return it.length===1?function(ct,dt){it(ct==null?dt:null)}:it}(q))}lr.forEach(function(a,C){lr.set(a,Ln(C))}),e.functor=hr,e.xhr=jr(ee),e.dsv=function(a,C){var F=new RegExp('["'+a+` +]`),q=a.charCodeAt(0);function te(Ue,it,ct){arguments.length<3&&(ct=it,it=null);var dt=ni(Ue,C,it==null?ue:ve(it),ct);return dt.row=function(bt){return arguments.length?dt.response((it=bt)==null?ue:ve(bt)):it},dt}function ue(Ue){return te.parse(Ue.responseText)}function ve(Ue){return function(it){return te.parse(it.responseText,Ue)}}function Ae(Ue){return Ue.map(Re).join(a)}function Re(Ue){return F.test(Ue)?'"'+Ue.replace(/\"/g,'""')+'"':Ue}return te.parse=function(Ue,it){var ct;return te.parseRows(Ue,function(dt,bt){if(ct)return ct(dt,bt-1);var Ct=function(Mt){for(var Ut={},It=dt.length,Qt=0;Qt=Ut)return Ct;if(dt)return dt=!1,bt;var vn=It;if(Ue.charCodeAt(vn)===34){for(var Mn=vn;Mn++24?(isFinite(C)&&(clearTimeout(Qr),Qr=setTimeout(ur,C)),xr=0):(xr=1,kn(ur))}function Zn(){for(var a=Date.now(),C=Or;C;)a>=C.t&&C.c(a-C.t)&&(C.c=null),C=C.n;return a}function cr(){for(var a,C=Or,F=1/0;C;)C.c?(C.t1&&(C=a[ue[ve-2]],F=a[ue[ve-1]],q=a[Ae],(F[0]-C[0])*(q[1]-C[1])-(F[1]-C[1])*(q[0]-C[0])<=0);)--ve;ue[ve++]=Ae}return ue.slice(0,ve)}function ai(a,C){return a[0]-C[0]||a[1]-C[1]}e.timer=function(){Cn.apply(this,arguments)},e.timer.flush=function(){Zn(),cr()},e.round=function(a,C){return C?Math.round(a*(C=Math.pow(10,C)))/C:Math.round(a)},e.geom={},e.geom.hull=function(a){var C=Ir,F=Er;if(arguments.length)return q(a);function q(te){if(te.length<3)return[];var ue,ve=hr(C),Ae=hr(F),Re=te.length,Ue=[],it=[];for(ue=0;ue=0;--ue)Mt.push(te[Ue[ct[ue]][2]]);for(ue=+bt;ueQe)Ae=Ae.L;else{if(!((te=ue-Ur(Ae,ve))>Qe)){q>-Qe?(C=Ae.P,F=Ae):te>-Qe?(C=Ae,F=Ae.N):C=F=Ae;break}if(!Ae.R){C=Ae;break}Ae=Ae.R}var Re=An(a);if(Un.insert(C,Re),C||F){if(C===F)return Jr(C),F=An(C.site),Un.insert(Re,F),Re.edge=F.edge=Yr(C.site,Re.site),Cr(C),void Cr(F);if(F){Jr(C),Jr(F);var Ue=C.site,it=Ue.x,ct=Ue.y,dt=a.x-it,bt=a.y-ct,Ct=F.site,Mt=Ct.x-it,Vt=Ct.y-ct,It=2*(dt*Vt-bt*Mt),Qt=dt*dt+bt*bt,tn=Mt*Mt+Vt*Vt,Yt={x:(Vt*Qt-bt*tn)/It+it,y:(dt*tn-Mt*Qt)/It+ct};oi(F.edge,Ue,Ct,Yt),Re.edge=Yr(Ue,a,null,Yt),F.edge=Yr(a,Ct,null,Yt),Cr(C),Cr(F)}else Re.edge=Yr(C.site,Re.site)}}function yr(a,C){var F=a.site,q=F.x,te=F.y,ue=te-C;if(!ue)return q;var ve=a.P;if(!ve)return-1/0;var Ae=(F=ve.site).x,Re=F.y,Ue=Re-C;if(!Ue)return Ae;var it=Ae-q,ct=1/ue-1/Ue,dt=it/Ue;return ct?(-dt+Math.sqrt(dt*dt-2*ct*(it*it/(-2*Ue)-Re+Ue/2+te-ue/2)))/ct+q:(q+Ae)/2}function Ur(a,C){var F=a.N;if(F)return yr(F,C);var q=a.site;return q.y===C?q.x:1/0}function Rr(a){this.site=a,this.edges=[]}function $r(a,C){return C.angle-a.angle}function Pr(){Pa(this),this.x=this.y=this.arc=this.site=this.cy=null}function Cr(a){var C=a.P,F=a.N;if(C&&F){var q=C.site,te=a.site,ue=F.site;if(q!==ue){var ve=te.x,Ae=te.y,Re=q.x-ve,Ue=q.y-Ae,it=ue.x-ve,ct=2*(Re*(Vt=ue.y-Ae)-Ue*it);if(!(ct>=-ft)){var dt=Re*Re+Ue*Ue,bt=it*it+Vt*Vt,Ct=(Vt*dt-Ue*bt)/ct,Mt=(Re*bt-it*dt)/ct,Vt=Mt+Ae,It=dn.pop()||new Pr;It.arc=a,It.site=te,It.x=Ct+ve,It.y=Vt+Math.sqrt(Ct*Ct+Mt*Mt),It.cy=Vt,a.circle=It;for(var Qt=null,tn=Wn._;tn;)if(It.y=Ae)return;if(dt>Ct){if(ue){if(ue.y>=Ue)return}else ue={x:Vt,y:Re};F={x:Vt,y:Ue}}else{if(ue){if(ue.y1)if(dt>Ct){if(ue){if(ue.y>=Ue)return}else ue={x:(Re-te)/q,y:Re};F={x:(Ue-te)/q,y:Ue}}else{if(ue){if(ue.y=Ae)return}else ue={x:ve,y:q*ve+te};F={x:Ae,y:q*Ae+te}}else{if(ue){if(ue.x0)){if(It/=Hn,Hn<0){if(It0){if(It>Vn)return;It>Mn&&(Mn=It)}if(It=ct-Yt,Hn||!(It<0)){if(It/=Hn,Hn<0){if(It>Vn)return;It>Mn&&(Mn=It)}else if(Hn>0){if(It0)){if(It/=Xn,Xn<0){if(It0){if(It>Vn)return;It>Mn&&(Mn=It)}if(It=dt-vn,Xn||!(It<0)){if(It/=Xn,Xn<0){if(It>Vn)return;It>Mn&&(Mn=It)}else if(Xn>0){if(It0&&(Vt.a={x:Yt+Mn*Hn,y:vn+Mn*Xn}),Vn<1&&(Vt.b={x:Yt+Vn*Hn,y:vn+Vn*Xn}),Vt}}}}}),Mt=bt.length;Mt--;)(!gi(Re=bt[Mt],Ae)||!Ct(Re)||v(Re.a.x-Re.b.x)Qe||v(ct-Ue)>Qe)&&(Ct.splice(bt,0,new Ti((Hn=dt.site,Xn=It,rr=v(it-Qt)Qe?{x:Qt,y:v(Re-Qt)Qe?{x:v(Ue-vn)Qe?{x:tn,y:v(Re-tn)Qe?{x:v(Ue-Yt)=it&&It.x<=dt&&It.y>=ct&&It.y<=bt?[[it,bt],[dt,bt],[dt,ct],[it,ct]]:[]).point=Re[Mt]}),Ue}function Ae(Re){return Re.map(function(Ue,it){return{x:Math.round(q(Ue,it)/Qe)*Qe,y:Math.round(te(Ue,it)/Qe)*Qe,i:it}})}return ve.links=function(Re){return Oa(Ae(Re)).edges.filter(function(Ue){return Ue.l&&Ue.r}).map(function(Ue){return{source:Re[Ue.l.i],target:Re[Ue.r.i]}})},ve.triangles=function(Re){var Ue=[];return Oa(Ae(Re)).cells.forEach(function(it,ct){for(var dt,bt,Ct,Mt,Vt=it.site,It=it.edges.sort($r),Qt=-1,tn=It.length,Yt=It[tn-1].edge,vn=Yt.l===Vt?Yt.r:Yt.l;++Qtue&&(te=C.slice(ue,te),Ae[ve]?Ae[ve]+=te:Ae[++ve]=te),(F=F[0])===(q=q[0])?Ae[ve]?Ae[ve]+=q:Ae[++ve]=q:(Ae[++ve]=null,Re.push({i:ve,x:Ta(F,q)})),ue=Ql.lastIndex;return ueIt&&(It=it.x),it.y>Qt&&(Qt=it.y),ct.push(it.x),dt.push(it.y);else for(bt=0;btIt&&(It=vn),Mn>Qt&&(Qt=Mn),ct.push(vn),dt.push(Mn)}var Vn=It-Mt,Hn=Qt-Vt;function Xn(nr,Lr,dr,Br,Sr,Vr,fi,Nr){if(!isNaN(dr)&&!isNaN(Br))if(nr.leaf){var si=nr.x,_i=nr.y;if(si!=null)if(v(si-dr)+v(_i-Br)<.01)rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr);else{var Gi=nr.point;nr.x=nr.y=nr.point=null,rr(nr,Gi,si,_i,Sr,Vr,fi,Nr),rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr)}else nr.x=dr,nr.y=Br,nr.point=Lr}else rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr)}function rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr){var si=.5*(Sr+fi),_i=.5*(Vr+Nr),Gi=dr>=si,Pi=Br>=_i,Ji=Pi<<1|Gi;nr.leaf=!1,Gi?Sr=si:fi=si,Pi?Vr=_i:Nr=_i,Xn(nr=nr.nodes[Ji]||(nr.nodes[Ji]={leaf:!0,nodes:[],point:null,x:null,y:null}),Lr,dr,Br,Sr,Vr,fi,Nr)}Vn>Hn?Qt=Vt+Vn:It=Mt+Hn;var Mr={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(nr){Xn(Mr,nr,+tn(nr,++bt),+Yt(nr,bt),Mt,Vt,It,Qt)}};if(Mr.visit=function(nr){To(nr,Mr,Mt,Vt,It,Qt)},Mr.find=function(nr){return function(Lr,dr,Br,Sr,Vr,fi,Nr){var si,_i=1/0;return function Gi(Pi,Ji,Yi,na,Ma){if(!(Ji>fi||Yi>Nr||na=wa)<<1|dr>=Ra,qa=Fa+4;Fa=0&&!(F=e.interpolators[q](a,C)););return F}function eu(a,C){var F,q=[],te=[],ue=a.length,ve=C.length,Ae=Math.min(a.length,C.length);for(F=0;F=1)return 1;var C=a*a,F=C*a;return 4*(a<.5?F:3*(a-C)+F-.75)}function jl(a){return 1-Math.cos(a*at)}function Ul(a){return Math.pow(2,10*(a-1))}function Vl(a){return 1-Math.sqrt(1-a*a)}function vs(a){return a<.36363636363636365?7.5625*a*a:a<.7272727272727273?7.5625*(a-=.5454545454545454)*a+.75:a<.9090909090909091?7.5625*(a-=.8181818181818182)*a+.9375:7.5625*(a-=.9545454545454546)*a+.984375}function Ju(a,C){return C-=a,function(F){return Math.round(a+C*F)}}function ju(a){var C,F,q,te=[a.a,a.b],ue=[a.c,a.d],ve=pc(te),Ae=Su(te,ue),Re=pc(((C=ue)[0]+=(q=-Ae)*(F=te)[0],C[1]+=q*F[1],C))||0;te[0]*ue[1]=0?a.slice(0,F):a,te=F>=0?a.slice(F+1):"in";return q=Za.get(q)||vl,te=ko.get(te)||ee,C=te(q.apply(null,w.call(arguments,1))),function(ue){return ue<=0?0:ue>=1?1:C(ue)}},e.interpolateHcl=function(a,C){a=e.hcl(a),C=e.hcl(C);var F=a.h,q=a.c,te=a.l,ue=C.h-F,ve=C.c-q,Ae=C.l-te;return isNaN(ve)&&(ve=0,q=isNaN(q)?C.c:q),isNaN(ue)?(ue=0,F=isNaN(F)?C.h:F):ue>180?ue-=360:ue<-180&&(ue+=360),function(Re){return qt(F+ue*Re,q+ve*Re,te+Ae*Re)+""}},e.interpolateHsl=function(a,C){a=e.hsl(a),C=e.hsl(C);var F=a.h,q=a.s,te=a.l,ue=C.h-F,ve=C.s-q,Ae=C.l-te;return isNaN(ve)&&(ve=0,q=isNaN(q)?C.s:q),isNaN(ue)?(ue=0,F=isNaN(F)?C.h:F):ue>180?ue-=360:ue<-180&&(ue+=360),function(Re){return Ft(F+ue*Re,q+ve*Re,te+Ae*Re)+""}},e.interpolateLab=function(a,C){a=e.lab(a),C=e.lab(C);var F=a.l,q=a.a,te=a.b,ue=C.l-F,ve=C.a-q,Ae=C.b-te;return function(Re){return Dn(F+ue*Re,q+ve*Re,te+Ae*Re)+""}},e.interpolateRound=Ju,e.transform=function(a){var C=_.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(F){if(F!=null){C.setAttribute("transform",F);var q=C.transform.baseVal.consolidate()}return new ju(q?q.matrix:Rs)})(a)},ju.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Rs={a:1,b:0,c:0,d:1,e:0,f:0};function Vs(a){return a.length?a.pop()+",":""}function Uu(a,C){var F=[],q=[];return a=e.transform(a),C=e.transform(C),function(te,ue,ve,Ae){if(te[0]!==ue[0]||te[1]!==ue[1]){var Re=ve.push("translate(",null,",",null,")");Ae.push({i:Re-4,x:Ta(te[0],ue[0])},{i:Re-2,x:Ta(te[1],ue[1])})}else(ue[0]||ue[1])&&ve.push("translate("+ue+")")}(a.translate,C.translate,F,q),function(te,ue,ve,Ae){te!==ue?(te-ue>180?ue+=360:ue-te>180&&(te+=360),Ae.push({i:ve.push(Vs(ve)+"rotate(",null,")")-2,x:Ta(te,ue)})):ue&&ve.push(Vs(ve)+"rotate("+ue+")")}(a.rotate,C.rotate,F,q),function(te,ue,ve,Ae){te!==ue?Ae.push({i:ve.push(Vs(ve)+"skewX(",null,")")-2,x:Ta(te,ue)}):ue&&ve.push(Vs(ve)+"skewX("+ue+")")}(a.skew,C.skew,F,q),function(te,ue,ve,Ae){if(te[0]!==ue[0]||te[1]!==ue[1]){var Re=ve.push(Vs(ve)+"scale(",null,",",null,")");Ae.push({i:Re-4,x:Ta(te[0],ue[0])},{i:Re-2,x:Ta(te[1],ue[1])})}else ue[0]===1&&ue[1]===1||ve.push(Vs(ve)+"scale("+ue+")")}(a.scale,C.scale,F,q),a=C=null,function(te){for(var ue,ve=-1,Ae=q.length;++ve0?F=Yt:(a.c=null,a.t=NaN,a=null,Ae.end({type:"end",alpha:F=0})):Yt>0&&(Ae.start({type:"start",alpha:F=Yt}),a=Cn(ve.tick)),ve):F},ve.start=function(){var Yt,vn,Mn,Vn=Vt.length,Hn=It.length,Xn=Re[0],rr=Re[1];for(Yt=0;Yt=0;)F.push(te[q])}function _a(a,C){for(var F=[a],q=[];(a=F.pop())!=null;)if(q.push(a),(ue=a.children)&&(te=ue.length))for(var te,ue,ve=-1;++ve=0;)ve.push(it=Ue[Re]),it.parent=ue,it.depth=ue.depth+1;F&&(ue.value=0),ue.children=Ue}else F&&(ue.value=+F.call(q,ue,ue.depth)||0),delete ue.children;return _a(te,function(ct){var dt,bt;a&&(dt=ct.children)&&dt.sort(a),F&&(bt=ct.parent)&&(bt.value+=ct.value)}),Ae}return q.sort=function(te){return arguments.length?(a=te,q):a},q.children=function(te){return arguments.length?(C=te,q):C},q.value=function(te){return arguments.length?(F=te,q):F},q.revalue=function(te){return F&&(Bo(te,function(ue){ue.children&&(ue.value=0)}),_a(te,function(ue){var ve;ue.children||(ue.value=+F.call(q,ue,ue.depth)||0),(ve=ue.parent)&&(ve.value+=ue.value)})),te},q},e.layout.partition=function(){var a=e.layout.hierarchy(),C=[1,1];function F(ue,ve,Ae,Re){var Ue=ue.children;if(ue.x=ve,ue.y=ue.depth*Re,ue.dx=Ae,ue.dy=Re,Ue&&(it=Ue.length)){var it,ct,dt,bt=-1;for(Ae=ue.value?Ae/ue.value:0;++btAe&&(Ae=q),ve.push(q)}for(F=0;Fte&&(q=F,te=C);return q}function Zr(a){return a.reduce(Li,0)}function Li(a,C){return a+C[1]}function ia(a,C){return sa(a,Math.ceil(Math.log(C.length)/Math.LN2+1))}function sa(a,C){for(var F=-1,q=+a[0],te=(a[1]-q)/C,ue=[];++F<=C;)ue[F]=te*F+q;return ue}function po(a){return[e.min(a),e.max(a)]}function ro(a,C){return a.value-C.value}function mu(a,C){var F=a._pack_next;a._pack_next=C,C._pack_prev=a,C._pack_next=F,F._pack_prev=C}function qu(a,C){a._pack_next=C,C._pack_prev=a}function ls(a,C){var F=C.x-a.x,q=C.y-a.y,te=a.r+C.r;return .999*te*te>F*F+q*q}function Ws(a){if((C=a.children)&&(Re=C.length)){var C,F,q,te,ue,ve,Ae,Re,Ue=1/0,it=-1/0,ct=1/0,dt=-1/0;if(C.forEach(bl),(F=C[0]).x=-F.r,F.y=0,tn(F),Re>1&&((q=C[1]).x=q.r,q.y=0,tn(q),Re>2))for(La(F,q,te=C[2]),tn(te),mu(F,te),F._pack_prev=te,mu(te,q),q=F._pack_next,ue=3;ue0)for(ve=-1;++ve=ct[0]&&Re<=ct[1]&&((Ae=Ue[e.bisect(dt,Re,1,Ct)-1]).y+=Mt,Ae.push(ue[ve]));return Ue}return te.value=function(ue){return arguments.length?(C=ue,te):C},te.range=function(ue){return arguments.length?(F=hr(ue),te):F},te.bins=function(ue){return arguments.length?(q=typeof ue=="number"?function(ve){return sa(ve,ue)}:hr(ue),te):q},te.frequency=function(ue){return arguments.length?(a=!!ue,te):a},te},e.layout.pack=function(){var a,C=e.layout.hierarchy().sort(ro),F=0,q=[1,1];function te(ue,ve){var Ae=C.call(this,ue,ve),Re=Ae[0],Ue=q[0],it=q[1],ct=a==null?Math.sqrt:typeof a=="function"?a:function(){return a};if(Re.x=Re.y=0,_a(Re,function(bt){bt.r=+ct(bt.value)}),_a(Re,Ws),F){var dt=F*(a?1:Math.max(2*Re.r/Ue,2*Re.r/it))/2;_a(Re,function(bt){bt.r+=dt}),_a(Re,Ws),_a(Re,function(bt){bt.r-=dt})}return vu(Re,Ue/2,it/2,a?1:1/Math.max(2*Re.r/Ue,2*Re.r/it)),Ae}return te.size=function(ue){return arguments.length?(q=ue,te):q},te.radius=function(ue){return arguments.length?(a=ue==null||typeof ue=="function"?ue:+ue,te):a},te.padding=function(ue){return arguments.length?(F=+ue,te):F},qo(te,C)},e.layout.tree=function(){var a=e.layout.hierarchy().sort(null).value(null),C=ba,F=[1,1],q=null;function te(Re,Ue){var it=a.call(this,Re,Ue),ct=it[0],dt=function(tn){for(var Yt,vn={A:null,children:[tn]},Mn=[vn];(Yt=Mn.pop())!=null;)for(var Vn,Hn=Yt.children,Xn=0,rr=Hn.length;XnCt.x&&(Ct=tn),tn.depth>Mt.depth&&(Mt=tn)});var Vt=C(bt,Ct)/2-bt.x,It=F[0]/(Ct.x+C(Ct,bt)/2+Vt),Qt=F[1]/(Mt.depth||1);Bo(ct,function(tn){tn.x=(tn.x+Vt)*It,tn.y=tn.depth*Qt})}return it}function ue(Re){var Ue=Re.children,it=Re.parent.children,ct=Re.i?it[Re.i-1]:null;if(Ue.length){(function(bt){for(var Ct,Mt=0,Vt=0,It=bt.children,Qt=It.length;--Qt>=0;)(Ct=It[Qt]).z+=Mt,Ct.m+=Mt,Mt+=Ct.s+(Vt+=Ct.c)})(Re);var dt=(Ue[0].z+Ue[Ue.length-1].z)/2;ct?(Re.z=ct.z+C(Re._,ct._),Re.m=Re.z-dt):Re.z=dt}else ct&&(Re.z=ct.z+C(Re._,ct._));Re.parent.A=function(bt,Ct,Mt){if(Ct){for(var Vt,It=bt,Qt=bt,tn=Ct,Yt=It.parent.children[0],vn=It.m,Mn=Qt.m,Vn=tn.m,Hn=Yt.m;tn=Ts(tn),It=Ho(It),tn&&It;)Yt=Ho(Yt),(Qt=Ts(Qt)).a=bt,(Vt=tn.z+Vn-It.z-vn+C(tn._,It._))>0&&(Aa(Ua(tn,bt,Mt),bt,Vt),vn+=Vt,Mn+=Vt),Vn+=tn.m,vn+=It.m,Hn+=Yt.m,Mn+=Qt.m;tn&&!Ts(Qt)&&(Qt.t=tn,Qt.m+=Vn-Mn),It&&!Ho(Yt)&&(Yt.t=It,Yt.m+=vn-Hn,Mt=bt)}return Mt}(Re,ct,Re.parent.A||it[0])}function ve(Re){Re._.x=Re.z+Re.parent.m,Re.m+=Re.parent.m}function Ae(Re){Re.x*=F[0],Re.y=Re.depth*F[1]}return te.separation=function(Re){return arguments.length?(C=Re,te):C},te.size=function(Re){return arguments.length?(q=(F=Re)==null?Ae:null,te):q?null:F},te.nodeSize=function(Re){return arguments.length?(q=(F=Re)==null?null:Ae,te):q?F:null},qo(te,a)},e.layout.cluster=function(){var a=e.layout.hierarchy().sort(null).value(null),C=ba,F=[1,1],q=!1;function te(ue,ve){var Ae,Re=a.call(this,ue,ve),Ue=Re[0],it=0;_a(Ue,function(Mt){var Vt=Mt.children;Vt&&Vt.length?(Mt.x=function(It){return It.reduce(function(Qt,tn){return Qt+tn.x},0)/It.length}(Vt),Mt.y=function(It){return 1+e.max(It,function(Qt){return Qt.y})}(Vt)):(Mt.x=Ae?it+=C(Mt,Ae):0,Mt.y=0,Ae=Mt)});var ct=wl(Ue),dt=ic(Ue),bt=ct.x-C(ct,dt)/2,Ct=dt.x+C(dt,ct)/2;return _a(Ue,q?function(Mt){Mt.x=(Mt.x-Ue.x)*F[0],Mt.y=(Ue.y-Mt.y)*F[1]}:function(Mt){Mt.x=(Mt.x-bt)/(Ct-bt)*F[0],Mt.y=(1-(Ue.y?Mt.y/Ue.y:1))*F[1]}),Re}return te.separation=function(ue){return arguments.length?(C=ue,te):C},te.size=function(ue){return arguments.length?(q=(F=ue)==null,te):q?null:F},te.nodeSize=function(ue){return arguments.length?(q=(F=ue)!=null,te):q?F:null},qo(te,a)},e.layout.treemap=function(){var a,C=e.layout.hierarchy(),F=Math.round,q=[1,1],te=null,ue=nu,ve=!1,Ae="squarify",Re=.5*(1+Math.sqrt(5));function Ue(Mt,Vt){for(var It,Qt,tn=-1,Yt=Mt.length;++tn0;)vn.push(It=Mn[tn-1]),vn.area+=It.area,Ae!=="squarify"||(Qt=dt(vn,Hn))<=Vn?(Mn.pop(),Vn=Qt):(vn.area-=vn.pop().area,bt(vn,Hn,Yt,!1),Hn=Math.min(Yt.dx,Yt.dy),vn.length=vn.area=0,Vn=1/0);vn.length&&(bt(vn,Hn,Yt,!0),vn.length=vn.area=0),Vt.forEach(it)}}function ct(Mt){var Vt=Mt.children;if(Vt&&Vt.length){var It,Qt=ue(Mt),tn=Vt.slice(),Yt=[];for(Ue(tn,Qt.dx*Qt.dy/Mt.value),Yt.area=0;It=tn.pop();)Yt.push(It),Yt.area+=It.area,It.z!=null&&(bt(Yt,It.z?Qt.dx:Qt.dy,Qt,!tn.length),Yt.length=Yt.area=0);Vt.forEach(ct)}}function dt(Mt,Vt){for(var It,Qt=Mt.area,tn=0,Yt=1/0,vn=-1,Mn=Mt.length;++vntn&&(tn=It));return Vt*=Vt,(Qt*=Qt)?Math.max(Vt*tn*Re/Qt,Qt/(Vt*Yt*Re)):1/0}function bt(Mt,Vt,It,Qt){var tn,Yt=-1,vn=Mt.length,Mn=It.x,Vn=It.y,Hn=Vt?F(Mt.area/Vt):0;if(Vt==It.dx){for((Qt||Hn>It.dy)&&(Hn=It.dy);++YtIt.dx)&&(Hn=It.dx);++Yt1);return a+C*q*Math.sqrt(-2*Math.log(ue)/ue)}},logNormal:function(){var a=e.random.normal.apply(e,arguments);return function(){return Math.exp(a())}},bates:function(a){var C=e.random.irwinHall(a);return function(){return C()/a}},irwinHall:function(a){return function(){for(var C=0,F=0;F2?Xa:No,Ue=q?Fo:gh;return te=Re(a,C,Ue,F),ue=Re(C,a,Ue,ss),Ae}function Ae(Re){return te(Re)}return Ae.invert=function(Re){return ue(Re)},Ae.domain=function(Re){return arguments.length?(a=Re.map(Number),ve()):a},Ae.range=function(Re){return arguments.length?(C=Re,ve()):C},Ae.rangeRound=function(Re){return Ae.range(Re).interpolate(Ju)},Ae.clamp=function(Re){return arguments.length?(q=Re,ve()):q},Ae.interpolate=function(Re){return arguments.length?(F=Re,ve()):F},Ae.ticks=function(Re){return Ko(a,Re)},Ae.tickFormat=function(Re,Ue){return d3_scale_linearTickFormat(a,Re,Ue)},Ae.nice=function(Re){return Ao(a,Re),ve()},Ae.copy=function(){return Co(a,C,F,q)},ve()}function ka(a,C){return e.rebind(a,C,"range","rangeRound","interpolate","clamp")}function Ao(a,C){return Wl(a,Eu(Va(a,C)[2])),Wl(a,Eu(Va(a,C)[2])),a}function Va(a,C){C==null&&(C=10);var F=Gl(a),q=F[1]-F[0],te=Math.pow(10,Math.floor(Math.log(q/C)/Math.LN10)),ue=C/q*te;return ue<=.15?te*=10:ue<=.35?te*=5:ue<=.75&&(te*=2),F[0]=Math.ceil(F[0]/te)*te,F[1]=Math.floor(F[1]/te)*te+.5*te,F[2]=te,F}function Ko(a,C){return e.range.apply(e,Va(a,C))}function cs(a,C,F,q){function te(Ae){return(F?Math.log(Ae<0?0:Ae):-Math.log(Ae>0?0:-Ae))/Math.log(C)}function ue(Ae){return F?Math.pow(C,Ae):-Math.pow(C,-Ae)}function ve(Ae){return a(te(Ae))}return ve.invert=function(Ae){return ue(a.invert(Ae))},ve.domain=function(Ae){return arguments.length?(F=Ae[0]>=0,a.domain((q=Ae.map(Number)).map(te)),ve):q},ve.base=function(Ae){return arguments.length?(C=+Ae,a.domain(q.map(te)),ve):C},ve.nice=function(){var Ae=Wl(q.map(te),F?Math:rl);return a.domain(Ae),q=Ae.map(ue),ve},ve.ticks=function(){var Ae=Gl(q),Re=[],Ue=Ae[0],it=Ae[1],ct=Math.floor(te(Ue)),dt=Math.ceil(te(it)),bt=C%1?2:C;if(isFinite(dt-ct)){if(F){for(;ct0;Ct--)Re.push(ue(ct)*Ct);for(ct=0;Re[ct]it;dt--);Re=Re.slice(ct,dt)}return Re},ve.copy=function(){return cs(a.copy(),C,F,q)},ka(ve,a)}e.scale.linear=function(){return Co([0,1],[0,1],ss,!1)},e.scale.log=function(){return cs(e.scale.linear().domain([0,1]),10,!0,[1,10])};var rl={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};function xs(a,C,F){var q=Zl(C),te=Zl(1/C);function ue(ve){return a(q(ve))}return ue.invert=function(ve){return te(a.invert(ve))},ue.domain=function(ve){return arguments.length?(a.domain((F=ve.map(Number)).map(q)),ue):F},ue.ticks=function(ve){return Ko(F,ve)},ue.tickFormat=function(ve,Ae){return d3_scale_linearTickFormat(F,ve,Ae)},ue.nice=function(ve){return ue.domain(Ao(F,ve))},ue.exponent=function(ve){return arguments.length?(q=Zl(C=ve),te=Zl(1/C),a.domain(F.map(q)),ue):C},ue.copy=function(){return xs(a.copy(),C,F)},ka(ue,a)}function Zl(a){return function(C){return C<0?-Math.pow(-C,a):Math.pow(C,a)}}function _s(a,C){var F,q,te;function ue(Ae){return q[((F.get(Ae)||(C.t==="range"?F.set(Ae,a.push(Ae)):NaN))-1)%q.length]}function ve(Ae,Re){return e.range(a.length).map(function(Ue){return Ae+Re*Ue})}return ue.domain=function(Ae){if(!arguments.length)return a;a=[],F=new T;for(var Re,Ue=-1,it=Ae.length;++Ue0?F[ue-1]:a[0],uedt?0:1;if(it=Pt)return Re(it,Ct)+(Ue?Re(Ue,1-Ct):"")+"Z";var Mt,Vt,It,Qt,tn,Yt,vn,Mn,Vn,Hn,Xn,rr,Mr=0,nr=0,Lr=[];if((Qt=(+ve.apply(this,arguments)||0)/2)&&(It=q===Al?Math.sqrt(Ue*Ue+it*it):+q.apply(this,arguments),Ct||(nr*=-1),it&&(nr=ut(It/it*Math.sin(Qt))),Ue&&(Mr=ut(It/Ue*Math.sin(Qt)))),it){tn=it*Math.cos(ct+nr),Yt=it*Math.sin(ct+nr),vn=it*Math.cos(dt-nr),Mn=it*Math.sin(dt-nr);var dr=Math.abs(dt-ct-2*nr)<=yt?0:1;if(nr&&al(tn,Yt,vn,Mn)===Ct^dr){var Br=(ct+dt)/2;tn=it*Math.cos(Br),Yt=it*Math.sin(Br),vn=Mn=null}}else tn=Yt=0;if(Ue){Vn=Ue*Math.cos(dt-Mr),Hn=Ue*Math.sin(dt-Mr),Xn=Ue*Math.cos(ct+Mr),rr=Ue*Math.sin(ct+Mr);var Sr=Math.abs(ct-dt+2*Mr)<=yt?0:1;if(Mr&&al(Vn,Hn,Xn,rr)===1-Ct^Sr){var Vr=(ct+dt)/2;Vn=Ue*Math.cos(Vr),Hn=Ue*Math.sin(Vr),Xn=rr=null}}else Vn=Hn=0;if(bt>Qe&&(Mt=Math.min(Math.abs(it-Ue)/2,+F.apply(this,arguments)))>.001){Vt=Ue0?0:1}function Na(a,C,F,q,te){var ue=a[0]-C[0],ve=a[1]-C[1],Ae=(te?q:-q)/Math.sqrt(ue*ue+ve*ve),Re=Ae*ve,Ue=-Ae*ue,it=a[0]+Re,ct=a[1]+Ue,dt=C[0]+Re,bt=C[1]+Ue,Ct=(it+dt)/2,Mt=(ct+bt)/2,Vt=dt-it,It=bt-ct,Qt=Vt*Vt+It*It,tn=F-q,Yt=it*bt-dt*ct,vn=(It<0?-1:1)*Math.sqrt(Math.max(0,tn*tn*Qt-Yt*Yt)),Mn=(Yt*It-Vt*vn)/Qt,Vn=(-Yt*Vt-It*vn)/Qt,Hn=(Yt*It+Vt*vn)/Qt,Xn=(-Yt*Vt+It*vn)/Qt,rr=Mn-Ct,Mr=Vn-Mt,nr=Hn-Ct,Lr=Xn-Mt;return rr*rr+Mr*Mr>nr*nr+Lr*Lr&&(Mn=Hn,Vn=Xn),[[Mn-Re,Vn-Ue],[Mn*F/tn,Vn*F/tn]]}function Ns(){return!0}function iu(a){var C=Ir,F=Er,q=Ns,te=ks,ue=te.key,ve=.7;function Ae(Re){var Ue,it=[],ct=[],dt=-1,bt=Re.length,Ct=hr(C),Mt=hr(F);function Vt(){it.push("M",te(a(ct),ve))}for(;++dt1&&te.push("H",q[0]),te.join("")},"step-before":As,"step-after":Jo,basis:ya,"basis-open":function(a){if(a.length<4)return ks(a);for(var C,F=[],q=-1,te=a.length,ue=[0],ve=[0];++q<3;)C=a[q],ue.push(C[0]),ve.push(C[1]);for(F.push(So(Qo,ue)+","+So(Qo,ve)),--q;++q9&&(ue=3*F/Math.sqrt(ue),Ae[Re]=ue*q,Ae[Re+1]=ue*te);for(Re=-1;++Re<=Ue;)ue=(C[Math.min(Ue,Re+1)][0]-C[Math.max(0,Re-1)][0])/(6*(1+Ae[Re]*Ae[Re])),ve.push([ue||0,Ae[Re]*ue||0]);return ve}(a))}});function ks(a){return a.length>1?a.join("L"):a+"Z"}function au(a){return a.join("L")+"Z"}function As(a){for(var C=0,F=a.length,q=a[0],te=[q[0],",",q[1]];++C1){Ae=C[1],ue=a[Re],Re++,q+="C"+(te[0]+ve[0])+","+(te[1]+ve[1])+","+(ue[0]-Ae[0])+","+(ue[1]-Ae[1])+","+ue[0]+","+ue[1];for(var Ue=2;Ueyt)+",1 "+it}function Re(Ue,it,ct,dt){return"Q 0,0 "+dt}return ue.radius=function(Ue){return arguments.length?(F=hr(Ue),ue):F},ue.source=function(Ue){return arguments.length?(a=hr(Ue),ue):a},ue.target=function(Ue){return arguments.length?(C=hr(Ue),ue):C},ue.startAngle=function(Ue){return arguments.length?(q=hr(Ue),ue):q},ue.endAngle=function(Ue){return arguments.length?(te=hr(Ue),ue):te},ue},e.svg.diagonal=function(){var a=xu,C=sl,F=dc;function q(te,ue){var ve=a.call(this,te,ue),Ae=C.call(this,te,ue),Re=(ve.y+Ae.y)/2,Ue=[ve,{x:ve.x,y:Re},{x:Ae.x,y:Re},Ae];return"M"+(Ue=Ue.map(F))[0]+"C"+Ue[1]+" "+Ue[2]+" "+Ue[3]}return q.source=function(te){return arguments.length?(a=hr(te),q):a},q.target=function(te){return arguments.length?(C=hr(te),q):C},q.projection=function(te){return arguments.length?(F=te,q):F},q},e.svg.diagonal.radial=function(){var a=e.svg.diagonal(),C=dc,F=a.projection;return a.projection=function(q){return arguments.length?F(function(te){return function(){var ue=te.apply(this,arguments),ve=ue[0],Ae=ue[1]-at;return[ve*Math.cos(Ae),ve*Math.sin(Ae)]}}(C=q)):C},a},e.svg.symbol=function(){var a=ou,C=$s;function F(q,te){return(Cl.get(a.call(this,q,te))||eo)(C.call(this,q,te))}return F.type=function(q){return arguments.length?(a=hr(q),F):a},F.size=function(q){return arguments.length?(C=hr(q),F):C},F};var Cl=e.map({circle:eo,cross:function(a){var C=Math.sqrt(a/5)/2;return"M"+-3*C+","+-C+"H"+-C+"V"+-3*C+"H"+C+"V"+-C+"H"+3*C+"V"+C+"H"+C+"V"+3*C+"H"+-C+"V"+C+"H"+-3*C+"Z"},diamond:function(a){var C=Math.sqrt(a/(2*Fi)),F=C*Fi;return"M0,"+-C+"L"+F+",0 0,"+C+" "+-F+",0Z"},square:function(a){var C=Math.sqrt(a)/2;return"M"+-C+","+-C+"L"+C+","+-C+" "+C+","+C+" "+-C+","+C+"Z"},"triangle-down":function(a){var C=Math.sqrt(a/di),F=C*di/2;return"M0,"+F+"L"+C+","+-F+" "+-C+","+-F+"Z"},"triangle-up":function(a){var C=Math.sqrt(a/di),F=C*di/2;return"M0,"+-F+"L"+C+","+F+" "+-C+","+F+"Z"}});e.svg.symbolTypes=Cl.keys();var di=Math.sqrt(3),Fi=Math.tan(30*lt);be.transition=function(a){for(var C,F,q=ho||++Ys,te=xa(a),ue=[],ve=_u||{time:Date.now(),ease:xl,delay:0,duration:250},Ae=-1,Re=this.length;++Ae0;)Ue[--It].call(a,Vt);if(Mt>=1)return ct.event&&ct.event.end.call(a,a.__data__,C),--it.count?delete it[q]:delete a[F],1}ct||(ue=te.time,ve=Cn(function(Ct){var Mt=ct.delay;if(ve.t=Mt+ue,Mt<=Ct)return dt(Ct-Mt);ve.c=dt},0,ue),ct=it[q]={tween:new T,time:ue,timer:ve,delay:te.delay,duration:te.duration,ease:te.ease,index:C},te=null,++it.count)}da.call=be.call,da.empty=be.empty,da.node=be.node,da.size=be.size,e.transition=function(a,C){return a&&a.transition?ho?a.transition(C):a:e.selection().transition(a)},e.transition.prototype=da,da.select=function(a){var C,F,q,te=this.id,ue=this.namespace,ve=[];a=Se(a);for(var Ae=-1,Re=this.length;++Aerect,.s>rect").attr("width",ue[1]-ue[0])}function bt(Mt){Mt.select(".extent").attr("y",ve[0]),Mt.selectAll(".extent,.e>rect,.w>rect").attr("height",ve[1]-ve[0])}function Ct(){var Mt,Vt,It=this,Qt=e.select(e.event.target),tn=F.of(It,arguments),Yt=e.select(It),vn=Qt.datum(),Mn=!/^(n|s)$/.test(vn)&&q,Vn=!/^(e|w)$/.test(vn)&&te,Hn=Qt.classed("extent"),Xn=Nt(It),rr=e.mouse(It),Mr=e.select(r(It)).on("keydown.brush",function(){e.event.keyCode==32&&(Hn||(Mt=null,rr[0]-=ue[1],rr[1]-=ve[1],Hn=2),se())}).on("keyup.brush",function(){e.event.keyCode==32&&Hn==2&&(rr[0]+=ue[1],rr[1]+=ve[1],Hn=0,se())});if(e.event.changedTouches?Mr.on("touchmove.brush",dr).on("touchend.brush",Sr):Mr.on("mousemove.brush",dr).on("mouseup.brush",Sr),Yt.interrupt().selectAll("*").interrupt(),Hn)rr[0]=ue[0]-rr[0],rr[1]=ve[0]-rr[1];else if(vn){var nr=+/w$/.test(vn),Lr=+/^n/.test(vn);Vt=[ue[1-nr]-rr[0],ve[1-Lr]-rr[1]],rr[0]=ue[nr],rr[1]=ve[Lr]}else e.event.altKey&&(Mt=rr.slice());function dr(){var Vr=e.mouse(It),fi=!1;Vt&&(Vr[0]+=Vt[0],Vr[1]+=Vt[1]),Hn||(e.event.altKey?(Mt||(Mt=[(ue[0]+ue[1])/2,(ve[0]+ve[1])/2]),rr[0]=ue[+(Vr[0](we=1))return we;for(;reKe?re=je:we=je,je=.5*(we-re)+re}return je},u.prototype.solve=function(P,G){return this.sampleCurveY(this.solveCurveX(P,G))};var r=n;function n(P,G){this.x=P,this.y=G}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(P){return this.clone()._add(P)},sub:function(P){return this.clone()._sub(P)},multByPoint:function(P){return this.clone()._multByPoint(P)},divByPoint:function(P){return this.clone()._divByPoint(P)},mult:function(P){return this.clone()._mult(P)},div:function(P){return this.clone()._div(P)},rotate:function(P){return this.clone()._rotate(P)},rotateAround:function(P,G){return this.clone()._rotateAround(P,G)},matMult:function(P){return this.clone()._matMult(P)},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(P){return this.x===P.x&&this.y===P.y},dist:function(P){return Math.sqrt(this.distSqr(P))},distSqr:function(P){var G=P.x-this.x,re=P.y-this.y;return G*G+re*re},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(P){return Math.atan2(this.y-P.y,this.x-P.x)},angleWith:function(P){return this.angleWithSep(P.x,P.y)},angleWithSep:function(P,G){return Math.atan2(this.x*G-this.y*P,this.x*P+this.y*G)},_matMult:function(P){var G=P[0]*this.x+P[1]*this.y,re=P[2]*this.x+P[3]*this.y;return this.x=G,this.y=re,this},_add:function(P){return this.x+=P.x,this.y+=P.y,this},_sub:function(P){return this.x-=P.x,this.y-=P.y,this},_mult:function(P){return this.x*=P,this.y*=P,this},_div:function(P){return this.x/=P,this.y/=P,this},_multByPoint:function(P){return this.x*=P.x,this.y*=P.y,this},_divByPoint:function(P){return this.x/=P.x,this.y/=P.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var P=this.y;return this.y=this.x,this.x=-P,this},_rotate:function(P){var G=Math.cos(P),re=Math.sin(P),we=G*this.x-re*this.y,je=re*this.x+G*this.y;return this.x=we,this.y=je,this},_rotateAround:function(P,G){var re=Math.cos(P),we=Math.sin(P),je=G.x+re*(this.x-G.x)-we*(this.y-G.y),Ke=G.y+we*(this.x-G.x)+re*(this.y-G.y);return this.x=je,this.y=Ke,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(P){return P instanceof n?P:Array.isArray(P)?new n(P[0],P[1]):P};var l=typeof self<"u"?self:{},o=Math.pow(2,53)-1;function s(P,G,re,we){var je=new _(P,G,re,we);return function(Ke){return je.solve(Ke)}}var c=s(.25,.1,.25,1);function h(P,G,re){return Math.min(re,Math.max(G,P))}function x(P,G,re){var we=re-G,je=((P-G)%we+we)%we+G;return je===G?re:je}function m(P){for(var G=[],re=arguments.length-1;re-- >0;)G[re]=arguments[re+1];for(var we=0,je=G;we>G/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,P)}()}function v(P){return!!P&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(P)}function S(P,G){P.forEach(function(re){G[re]&&(G[re]=G[re].bind(G))})}function T(P,G){return P.indexOf(G,P.length-G.length)!==-1}function p(P,G,re){var we={};for(var je in P)we[je]=G.call(re||this,P[je],je,P);return we}function M(P,G,re){var we={};for(var je in P)G.call(re||this,P[je],je,P)&&(we[je]=P[je]);return we}function f(P){return Array.isArray(P)?P.map(f):typeof P=="object"&&P?p(P,f):P}var E={};function I(P){E[P]||(typeof console<"u"&&console.warn(P),E[P]=!0)}function B(P,G,re){return(re.y-P.y)*(G.x-P.x)>(G.y-P.y)*(re.x-P.x)}function N(P){for(var G=0,re=0,we=P.length,je=we-1,Ke=void 0,ot=void 0;re@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(we,je,Ke,ot){var _t=Ke||ot;return G[je]=!_t||_t.toLowerCase(),""}),G["max-age"]){var re=parseInt(G["max-age"],10);isNaN(re)?delete G["max-age"]:G["max-age"]=re}return G}var $=null;function ee(P){if($==null){var G=P.navigator?P.navigator.userAgent:null;$=!!P.safari||!(!G||!(/\b(iPad|iPhone|iPod)\b/.test(G)||G.match("Safari")&&!G.match("Chrome")))}return $}function H(P){try{var G=l[P];return G.setItem("_mapbox_test_",1),G.removeItem("_mapbox_test_"),!0}catch{return!1}}var J,Q,Z,K,ae=l.performance&&l.performance.now?l.performance.now.bind(l.performance):Date.now.bind(Date),se=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame,he=l.cancelAnimationFrame||l.mozCancelAnimationFrame||l.webkitCancelAnimationFrame||l.msCancelAnimationFrame,fe={now:ae,frame:function(P){var G=se(P);return{cancel:function(){return he(G)}}},getImageData:function(P,G){G===void 0&&(G=0);var re=l.document.createElement("canvas"),we=re.getContext("2d");if(!we)throw new Error("failed to create canvas 2d context");return re.width=P.width,re.height=P.height,we.drawImage(P,0,0,P.width,P.height),we.getImageData(-G,-G,P.width+2*G,P.height+2*G)},resolveURL:function(P){return J||(J=l.document.createElement("a")),J.href=P,J.href},hardwareConcurrency:l.navigator&&l.navigator.hardwareConcurrency||4,get devicePixelRatio(){return l.devicePixelRatio},get prefersReducedMotion(){return!!l.matchMedia&&(Q==null&&(Q=l.matchMedia("(prefers-reduced-motion: reduce)")),Q.matches)}},ie={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},oe={supported:!1,testSupport:function(P){!le&&K&&(ge?ye(P):Z=P)}},le=!1,ge=!1;function ye(P){var G=P.createTexture();P.bindTexture(P.TEXTURE_2D,G);try{if(P.texImage2D(P.TEXTURE_2D,0,P.RGBA,P.RGBA,P.UNSIGNED_BYTE,K),P.isContextLost())return;oe.supported=!0}catch{}P.deleteTexture(G),le=!0}l.document&&((K=l.document.createElement("img")).onload=function(){Z&&ye(Z),Z=null,ge=!0},K.onerror=function(){le=!0,Z=null},K.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var me="01",be=function(P,G){this._transformRequestFn=P,this._customAccessToken=G,this._createSkuToken()};function Se(P){return P.indexOf("mapbox:")===0}be.prototype._createSkuToken=function(){var P=function(){for(var G="",re=0;re<10;re++)G+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",me,G].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=P.token,this._skuTokenExpiresAt=P.tokenExpiresAt},be.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},be.prototype.transformRequest=function(P,G){return this._transformRequestFn&&this._transformRequestFn(P,G)||{url:P}},be.prototype.normalizeStyleURL=function(P,G){if(!Se(P))return P;var re=Oe(P);return re.path="/styles/v1"+re.path,this._makeAPIURL(re,this._customAccessToken||G)},be.prototype.normalizeGlyphsURL=function(P,G){if(!Se(P))return P;var re=Oe(P);return re.path="/fonts/v1"+re.path,this._makeAPIURL(re,this._customAccessToken||G)},be.prototype.normalizeSourceURL=function(P,G){if(!Se(P))return P;var re=Oe(P);return re.path="/v4/"+re.authority+".json",re.params.push("secure"),this._makeAPIURL(re,this._customAccessToken||G)},be.prototype.normalizeSpriteURL=function(P,G,re,we){var je=Oe(P);return Se(P)?(je.path="/styles/v1"+je.path+"/sprite"+G+re,this._makeAPIURL(je,this._customAccessToken||we)):(je.path+=""+G+re,We(je))},be.prototype.normalizeTileURL=function(P,G){if(this._isSkuTokenExpired()&&this._createSkuToken(),P&&!Se(P))return P;var re=Oe(P),we=fe.devicePixelRatio>=2||G===512?"@2x":"",je=oe.supported?".webp":"$1";re.path=re.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+we+je),re.path=re.path.replace(/^.+\/v4\//,"/"),re.path="/v4"+re.path;var Ke=this._customAccessToken||function(ot){for(var _t=0,Rt=ot;_t=0&&P.params.splice(je,1)}if(we.path!=="/"&&(P.path=""+we.path+P.path),!ie.REQUIRE_ACCESS_TOKEN)return We(P);if(!(G=G||ie.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+re);if(G[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+re);return P.params=P.params.filter(function(Ke){return Ke.indexOf("access_token")===-1}),P.params.push("access_token="+G),We(P)};var Ee=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Ce(P){return Ee.test(P)}var Le=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Oe(P){var G=P.match(Le);if(!G)throw new Error("Unable to parse URL object");return{protocol:G[1],authority:G[2],path:G[3]||"/",params:G[4]?G[4].split("&"):[]}}function We(P){var G=P.params.length?"?"+P.params.join("&"):"";return P.protocol+"://"+P.authority+P.path+G}var Ie="mapbox.eventData";function Ve(P){if(!P)return null;var G,re=P.split(".");if(!re||re.length!==3)return null;try{return JSON.parse((G=re[1],decodeURIComponent(l.atob(G).split("").map(function(we){return"%"+("00"+we.charCodeAt(0).toString(16)).slice(-2)}).join(""))))}catch{return null}}var Pe=function(P){this.type=P,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Pe.prototype.getStorageKey=function(P){var G,re,we=Ve(ie.ACCESS_TOKEN);return G=we&&we.u?(re=we.u,l.btoa(encodeURIComponent(re).replace(/%([0-9A-F]{2})/g,function(je,Ke){return String.fromCharCode(+("0x"+Ke))}))):ie.ACCESS_TOKEN||"",P?Ie+"."+P+":"+G:Ie+":"+G},Pe.prototype.fetchEventData=function(){var P=H("localStorage"),G=this.getStorageKey(),re=this.getStorageKey("uuid");if(P)try{var we=l.localStorage.getItem(G);we&&(this.eventData=JSON.parse(we));var je=l.localStorage.getItem(re);je&&(this.anonId=je)}catch{I("Unable to read from LocalStorage")}},Pe.prototype.saveEventData=function(){var P=H("localStorage"),G=this.getStorageKey(),re=this.getStorageKey("uuid");if(P)try{l.localStorage.setItem(re,this.anonId),Object.keys(this.eventData).length>=1&&l.localStorage.setItem(G,JSON.stringify(this.eventData))}catch{I("Unable to write to LocalStorage")}},Pe.prototype.processRequests=function(P){},Pe.prototype.postEvent=function(P,G,re,we){var je=this;if(ie.EVENTS_URL){var Ke=Oe(ie.EVENTS_URL);Ke.params.push("access_token="+(we||ie.ACCESS_TOKEN||""));var ot={event:this.type,created:new Date(P).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:y,skuId:me,userId:this.anonId},_t=G?m(ot,G):ot,Rt={url:We(Ke),headers:{"Content-Type":"text/plain"},body:JSON.stringify([_t])};this.pendingRequest=Pt(Rt,function(Kt){je.pendingRequest=null,re(Kt),je.saveEventData(),je.processRequests(we)})}},Pe.prototype.queueRequest=function(P,G){this.queue.push(P),this.processRequests(G)};var de,Me,ke=function(P){function G(){P.call(this,"map.load"),this.success={},this.skuToken=""}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.postMapLoadEvent=function(re,we,je,Ke){this.skuToken=je,(ie.EVENTS_URL&&Ke||ie.ACCESS_TOKEN&&Array.isArray(re)&&re.some(function(ot){return Se(ot)||Ce(ot)}))&&this.queueRequest({id:we,timestamp:Date.now()},Ke)},G.prototype.processRequests=function(re){var we=this;if(!this.pendingRequest&&this.queue.length!==0){var je=this.queue.shift(),Ke=je.id,ot=je.timestamp;Ke&&this.success[Ke]||(this.anonId||this.fetchEventData(),v(this.anonId)||(this.anonId=A()),this.postEvent(ot,{skuToken:this.skuToken},function(_t){_t||Ke&&(we.success[Ke]=!0)},re))}},G}(Pe),He=function(P){function G(re){P.call(this,"appUserTurnstile"),this._customAccessToken=re}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.postTurnstileEvent=function(re,we){ie.EVENTS_URL&&ie.ACCESS_TOKEN&&Array.isArray(re)&&re.some(function(je){return Se(je)||Ce(je)})&&this.queueRequest(Date.now(),we)},G.prototype.processRequests=function(re){var we=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var je=Ve(ie.ACCESS_TOKEN),Ke=je?je.u:ie.ACCESS_TOKEN,ot=Ke!==this.eventData.tokenU;v(this.anonId)||(this.anonId=A(),ot=!0);var _t=this.queue.shift();if(this.eventData.lastSuccess){var Rt=new Date(this.eventData.lastSuccess),Kt=new Date(_t),nn=(_t-this.eventData.lastSuccess)/864e5;ot=ot||nn>=1||nn<-1||Rt.getDate()!==Kt.getDate()}else ot=!0;if(!ot)return this.processRequests();this.postEvent(_t,{"enabled.telemetry":!1},function(sn){sn||(we.eventData.lastSuccess=_t,we.eventData.tokenU=Ke)},re)}},G}(Pe),Fe=new He,qe=Fe.postTurnstileEvent.bind(Fe),$e=new ke,Ye=$e.postMapLoadEvent.bind($e),_e="mapbox-tiles",De=500,Be=50,Ge=42e4;function tt(){l.caches&&!de&&(de=l.caches.open(_e))}function nt(P,G,re){if(tt(),de){var we={status:G.status,statusText:G.statusText,headers:new l.Headers};G.headers.forEach(function(Ke,ot){return we.headers.set(ot,Ke)});var je=j(G.headers.get("Cache-Control")||"");je["no-store"]||(je["max-age"]&&we.headers.set("Expires",new Date(re+1e3*je["max-age"]).toUTCString()),new Date(we.headers.get("Expires")).getTime()-reDate.now()&&!Rt["no-cache"]}(je);we.delete(re),Ke&&we.put(re,je.clone()),G(null,je,Ke)}).catch(G)}).catch(G)}var wt,Nt=1/0;function Ht(){return wt==null&&(wt=l.OffscreenCanvas&&new l.OffscreenCanvas(1,1).getContext("2d")&&typeof l.createImageBitmap=="function"),wt}var Gt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Gt);var st=function(P){function G(re,we,je){we===401&&Ce(je)&&(re+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),P.call(this,re),this.status=we,this.url=je,this.name=this.constructor.name,this.message=re}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},G}(Error),Qe=V()?function(){return self.worker&&self.worker.referrer}:function(){return(l.location.protocol==="blob:"?l.parent:l).location.href};function ft(P,G){var re,we=new l.AbortController,je=new l.Request(P.url,{method:P.method||"GET",body:P.body,credentials:P.credentials,headers:P.headers,referrer:Qe(),signal:we.signal}),Ke=!1,ot=!1,_t=(re=je.url).indexOf("sku=")>0&&Ce(re);P.type==="json"&&je.headers.set("Accept","application/json");var Rt=function(nn,sn,yn){if(!ot){if(nn&&nn.message!=="SecurityError"&&I(nn),sn&&yn)return Kt(sn);var fn=Date.now();l.fetch(je).then(function(On){if(On.ok){var jn=_t?On.clone():null;return Kt(On,jn,fn)}return G(new st(On.statusText,On.status,P.url))}).catch(function(On){On.code!==20&&G(new Error(On.message))})}},Kt=function(nn,sn,yn){(P.type==="arrayBuffer"?nn.arrayBuffer():P.type==="json"?nn.json():nn.text()).then(function(fn){ot||(sn&&yn&&nt(je,sn,yn),Ke=!0,G(null,fn,nn.headers.get("Cache-Control"),nn.headers.get("Expires")))}).catch(function(fn){ot||G(new Error(fn.message))})};return _t?At(je,Rt):Rt(null,null),{cancel:function(){ot=!0,Ke||we.abort()}}}var yt=function(P,G){if(re=P.url,!(/^file:/.test(re)||/^file:/.test(Qe())&&!/^\w+:/.test(re))){if(l.fetch&&l.Request&&l.AbortController&&l.Request.prototype.hasOwnProperty("signal"))return ft(P,G);if(V()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",P,G,void 0,!0)}var re;return function(we,je){var Ke=new l.XMLHttpRequest;for(var ot in Ke.open(we.method||"GET",we.url,!0),we.type==="arrayBuffer"&&(Ke.responseType="arraybuffer"),we.headers)Ke.setRequestHeader(ot,we.headers[ot]);return we.type==="json"&&(Ke.responseType="text",Ke.setRequestHeader("Accept","application/json")),Ke.withCredentials=we.credentials==="include",Ke.onerror=function(){je(new Error(Ke.statusText))},Ke.onload=function(){if((Ke.status>=200&&Ke.status<300||Ke.status===0)&&Ke.response!==null){var _t=Ke.response;if(we.type==="json")try{_t=JSON.parse(Ke.response)}catch(Rt){return je(Rt)}je(null,_t,Ke.getResponseHeader("Cache-Control"),Ke.getResponseHeader("Expires"))}else je(new st(Ke.statusText,Ke.status,we.url))},Ke.send(we.body),{cancel:function(){return Ke.abort()}}}(P,G)},Ot=function(P,G){return yt(m(P,{type:"arrayBuffer"}),G)},Pt=function(P,G){return yt(m(P,{method:"POST"}),G)},at,lt,Xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";at=[],lt=0;var ut=function(P,G){if(oe.supported&&(P.headers||(P.headers={}),P.headers.accept="image/webp,*/*"),lt>=ie.MAX_PARALLEL_IMAGE_REQUESTS){var re={requestParameters:P,callback:G,cancelled:!1,cancel:function(){this.cancelled=!0}};return at.push(re),re}lt++;var we=!1,je=function(){if(!we)for(we=!0,lt--;at.length&<0||this._oneTimeListeners&&this._oneTimeListeners[P]&&this._oneTimeListeners[P].length>0||this._eventedParent&&this._eventedParent.listens(P)},rt.prototype.setEventedParent=function(P,G){return this._eventedParent=P,this._eventedParentData=G,this};var et={$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"}}},Et=function(P,G,re,we){this.message=(P?P+": ":"")+re,we&&(this.identifier=we),G!=null&&G.__line__&&(this.line=G.__line__)};function Bt(P){var G=P.key,re=P.value;return re?[new Et(G,re,"constants have been deprecated as of v8")]:[]}function Ft(P){for(var G=[],re=arguments.length-1;re-- >0;)G[re]=arguments[re+1];for(var we=0,je=G;we":P.itemType.kind==="value"?"array":"array<"+G+">"}return P.kind}var Fn=[Wt,Zt,on,un,Pn,En,Dn,Ln(In),Kn];function wn(P,G){if(G.kind==="error")return null;if(P.kind==="array"){if(G.kind==="array"&&(G.N===0&&G.itemType.kind==="value"||!wn(P.itemType,G.itemType))&&(typeof P.N!="number"||P.N===G.N))return null}else{if(P.kind===G.kind)return null;if(P.kind==="value"){for(var re=0,we=Fn;re255?255:Rt}function je(Rt){return Rt<0?0:Rt>1?1:Rt}function Ke(Rt){return Rt[Rt.length-1]==="%"?we(parseFloat(Rt)/100*255):we(parseInt(Rt))}function ot(Rt){return Rt[Rt.length-1]==="%"?je(parseFloat(Rt)/100):je(parseFloat(Rt))}function _t(Rt,Kt,nn){return nn<0?nn+=1:nn>1&&(nn-=1),6*nn<1?Rt+(Kt-Rt)*nn*6:2*nn<1?Kt:3*nn<2?Rt+(Kt-Rt)*(2/3-nn)*6:Rt}try{G.parseCSSColor=function(Rt){var Kt,nn=Rt.replace(/ /g,"").toLowerCase();if(nn in re)return re[nn].slice();if(nn[0]==="#")return nn.length===4?(Kt=parseInt(nn.substr(1),16))>=0&&Kt<=4095?[(3840&Kt)>>4|(3840&Kt)>>8,240&Kt|(240&Kt)>>4,15&Kt|(15&Kt)<<4,1]:null:nn.length===7&&(Kt=parseInt(nn.substr(1),16))>=0&&Kt<=16777215?[(16711680&Kt)>>16,(65280&Kt)>>8,255&Kt,1]:null;var sn=nn.indexOf("("),yn=nn.indexOf(")");if(sn!==-1&&yn+1===nn.length){var fn=nn.substr(0,sn),On=nn.substr(sn+1,yn-(sn+1)).split(","),jn=1;switch(fn){case"rgba":if(On.length!==4)return null;jn=ot(On.pop());case"rgb":return On.length!==3?null:[Ke(On[0]),Ke(On[1]),Ke(On[2]),jn];case"hsla":if(On.length!==4)return null;jn=ot(On.pop());case"hsl":if(On.length!==3)return null;var sr=(parseFloat(On[0])%360+360)%360/360,ir=ot(On[1]),kr=ot(On[2]),_r=kr<=.5?kr*(ir+1):kr+ir-kr*ir,Fr=2*kr-_r;return[we(255*_t(Fr,_r,sr+1/3)),we(255*_t(Fr,_r,sr)),we(255*_t(Fr,_r,sr-1/3)),jn];default:return null}}return null}}catch{}}),vr=$n.parseCSSColor,Qn=function(P,G,re,we){we===void 0&&(we=1),this.r=P,this.g=G,this.b=re,this.a=we};Qn.parse=function(P){if(P){if(P instanceof Qn)return P;if(typeof P=="string"){var G=vr(P);if(G)return new Qn(G[0]/255*G[3],G[1]/255*G[3],G[2]/255*G[3],G[3])}}},Qn.prototype.toString=function(){var P=this.toArray(),G=P[0],re=P[1],we=P[2],je=P[3];return"rgba("+Math.round(G)+","+Math.round(re)+","+Math.round(we)+","+je+")"},Qn.prototype.toArray=function(){var P=this,G=P.r,re=P.g,we=P.b,je=P.a;return je===0?[0,0,0,0]:[255*G/je,255*re/je,255*we/je,je]},Qn.black=new Qn(0,0,0,1),Qn.white=new Qn(1,1,1,1),Qn.transparent=new Qn(0,0,0,0),Qn.red=new Qn(1,0,0,1);var lr=function(P,G,re){this.sensitivity=P?G?"variant":"case":G?"accent":"base",this.locale=re,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};lr.prototype.compare=function(P,G){return this.collator.compare(P,G)},lr.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var hr=function(P,G,re,we,je){this.text=P,this.image=G,this.scale=re,this.fontStack=we,this.textColor=je},jr=function(P){this.sections=P};jr.fromString=function(P){return new jr([new hr(P,null,null,null,null)])},jr.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(P){return P.text.length!==0||P.image&&P.image.name.length!==0})},jr.factory=function(P){return P instanceof jr?P:jr.fromString(P)},jr.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(P){return P.text}).join("")},jr.prototype.serialize=function(){for(var P=["format"],G=0,re=this.sections;G=0&&P<=255&&typeof G=="number"&&G>=0&&G<=255&&typeof re=="number"&&re>=0&&re<=255?we===void 0||typeof we=="number"&&we>=0&&we<=1?null:"Invalid rgba value ["+[P,G,re,we].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof we=="number"?[P,G,re,we]:[P,G,re]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Ar(P){if(P===null||typeof P=="string"||typeof P=="boolean"||typeof P=="number"||P instanceof Qn||P instanceof lr||P instanceof jr||P instanceof ni)return!0;if(Array.isArray(P)){for(var G=0,re=P;G2){var _t=P[1];if(typeof _t!="string"||!(_t in ur)||_t==="object")return G.error('The item type argument of "array" must be one of string, number, boolean',1);Ke=ur[_t],we++}else Ke=In;if(P.length>3){if(P[2]!==null&&(typeof P[2]!="number"||P[2]<0||P[2]!==Math.floor(P[2])))return G.error('The length argument to "array" must be a positive integer literal',2);ot=P[2],we++}re=Ln(Ke,ot)}else re=ur[je];for(var Rt=[];we1)&&G.push(we)}}return G.concat(this.args.map(function(je){return je.serialize()}))};var cr=function(P){this.type=En,this.sections=P};cr.parse=function(P,G){if(P.length<2)return G.error("Expected at least one argument.");var re=P[1];if(!Array.isArray(re)&&typeof re=="object")return G.error("First argument must be an image or text section.");for(var we=[],je=!1,Ke=1;Ke<=P.length-1;++Ke){var ot=P[Ke];if(je&&typeof ot=="object"&&!Array.isArray(ot)){je=!1;var _t=null;if(ot["font-scale"]&&!(_t=G.parse(ot["font-scale"],1,Zt)))return null;var Rt=null;if(ot["text-font"]&&!(Rt=G.parse(ot["text-font"],1,Ln(on))))return null;var Kt=null;if(ot["text-color"]&&!(Kt=G.parse(ot["text-color"],1,Pn)))return null;var nn=we[we.length-1];nn.scale=_t,nn.font=Rt,nn.textColor=Kt}else{var sn=G.parse(P[Ke],1,In);if(!sn)return null;var yn=sn.type.kind;if(yn!=="string"&&yn!=="value"&&yn!=="null"&&yn!=="resolvedImage")return G.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");je=!0,we.push({content:sn,scale:null,font:null,textColor:null})}}return new cr(we)},cr.prototype.evaluate=function(P){return new jr(this.sections.map(function(G){var re=G.content.evaluate(P);return xr(re)===Kn?new hr("",re,null,null,null):new hr(Qr(re),null,G.scale?G.scale.evaluate(P):null,G.font?G.font.evaluate(P).join(","):null,G.textColor?G.textColor.evaluate(P):null)}))},cr.prototype.eachChild=function(P){for(var G=0,re=this.sections;G-1),re},Ir.prototype.eachChild=function(P){P(this.input)},Ir.prototype.outputDefined=function(){return!1},Ir.prototype.serialize=function(){return["image",this.input.serialize()]};var Er={"to-boolean":un,"to-color":Pn,"to-number":Zt,"to-string":on},Xr=function(P,G){this.type=P,this.args=G};Xr.parse=function(P,G){if(P.length<2)return G.error("Expected at least one argument.");var re=P[0];if((re==="to-boolean"||re==="to-string")&&P.length!==2)return G.error("Expected one argument.");for(var we=Er[re],je=[],Ke=1;Ke4?"Invalid rbga value "+JSON.stringify(G)+": expected an array containing either three or four numeric values.":Or(G[0],G[1],G[2],G[3])))return new Qn(G[0]/255,G[1]/255,G[2]/255,G[3])}throw new Cn(re||"Could not parse color from value '"+(typeof G=="string"?G:String(JSON.stringify(G)))+"'")}if(this.type.kind==="number"){for(var ot=null,_t=0,Rt=this.args;_t=G[2]||P[1]<=G[1]||P[3]>=G[3])}function Un(P,G){var re,we=(180+P[0])/360,je=(re=P[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+re*Math.PI/360)))/360),Ke=Math.pow(2,G.z);return[Math.round(we*Ke*_n),Math.round(je*Ke*_n)]}function tr(P,G,re){return G[1]>P[1]!=re[1]>P[1]&&P[0]<(re[0]-G[0])*(P[1]-G[1])/(re[1]-G[1])+G[0]}function Wn(P,G){for(var re=!1,we=0,je=G.length;we0&&sn<0||nn<0&&sn>0}function ln(P,G,re){for(var we=0,je=re;were[2]){var je=.5*we,Ke=P[0]-re[0]>je?-we:re[0]-P[0]>je?we:0;Ke===0&&(Ke=P[0]-re[2]>je?-we:re[2]-P[0]>je?we:0),P[0]+=Ke}gn(G,P)}function Ur(P,G,re,we){for(var je=Math.pow(2,we.z)*_n,Ke=[we.x*_n,we.y*_n],ot=[],_t=0,Rt=P;_t=0)return!1;var re=!0;return P.eachChild(function(we){re&&!Jr(we,G)&&(re=!1)}),re}$r.parse=function(P,G){if(P.length!==2)return G.error("'within' expression requires exactly one argument, but found "+(P.length-1)+" instead.");if(Ar(P[1])){var re=P[1];if(re.type==="FeatureCollection")for(var we=0;weG))throw new Cn("Input is not a number.");ot=_t-1}return 0}ii.prototype.parse=function(P,G,re,we,je){return je===void 0&&(je={}),G?this.concat(G,re,we)._parse(P,je):this._parse(P,je)},ii.prototype._parse=function(P,G){function re(Kt,nn,sn){return sn==="assert"?new Zn(nn,[Kt]):sn==="coerce"?new Xr(nn,[Kt]):Kt}if(P!==null&&typeof P!="string"&&typeof P!="boolean"&&typeof P!="number"||(P=["literal",P]),Array.isArray(P)){if(P.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var we=P[0];if(typeof we!="string")return this.error("Expression name must be a string, but found "+typeof we+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var je=this.registry[we];if(je){var Ke=je.parse(P,this);if(!Ke)return null;if(this.expectedType){var ot=this.expectedType,_t=Ke.type;if(ot.kind!=="string"&&ot.kind!=="number"&&ot.kind!=="boolean"&&ot.kind!=="object"&&ot.kind!=="array"||_t.kind!=="value")if(ot.kind!=="color"&&ot.kind!=="formatted"&&ot.kind!=="resolvedImage"||_t.kind!=="value"&&_t.kind!=="string"){if(this.checkSubtype(ot,_t))return null}else Ke=re(Ke,ot,G.typeAnnotation||"coerce");else Ke=re(Ke,ot,G.typeAnnotation||"assert")}if(!(Ke instanceof kn)&&Ke.type.kind!=="resolvedImage"&&Yr(Ke)){var Rt=new bn;try{Ke=new kn(Ke.type,Ke.evaluate(Rt))}catch(Kt){return this.error(Kt.message),null}}return Ke}return this.error('Unknown expression "'+we+'". If you wanted a literal array, use ["literal", [...]].',0)}return P===void 0?this.error("'undefined' value invalid. Use null instead."):typeof P=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof P+" instead.")},ii.prototype.concat=function(P,G,re){var we=typeof P=="number"?this.path.concat(P):this.path,je=re?this.scope.concat(re):this.scope;return new ii(this.registry,we,G||null,je,this.errors)},ii.prototype.error=function(P){for(var G=[],re=arguments.length-1;re-- >0;)G[re]=arguments[re+1];var we=""+this.key+G.map(function(je){return"["+je+"]"}).join("");this.errors.push(new qt(we,P))},ii.prototype.checkSubtype=function(P,G){var re=wn(P,G);return re&&this.error(re),re};var Ti=function(P,G,re){this.type=P,this.input=G,this.labels=[],this.outputs=[];for(var we=0,je=re;we=ot)return G.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Rt);var nn=G.parse(_t,Kt,je);if(!nn)return null;je=je||nn.type,we.push([ot,nn])}return new Ti(je,re,we)},Ti.prototype.evaluate=function(P){var G=this.labels,re=this.outputs;if(G.length===1)return re[0].evaluate(P);var we=this.input.evaluate(P);if(we<=G[0])return re[0].evaluate(P);var je=G.length;return we>=G[je-1]?re[je-1].evaluate(P):re[oi(G,we)].evaluate(P)},Ti.prototype.eachChild=function(P){P(this.input);for(var G=0,re=this.outputs;G0&&P.push(this.labels[G]),P.push(this.outputs[G].serialize());return P};var Pa=Object.freeze({__proto__:null,number:Wi,color:function(P,G,re){return new Qn(Wi(P.r,G.r,re),Wi(P.g,G.g,re),Wi(P.b,G.b,re),Wi(P.a,G.a,re))},array:function(P,G,re){return P.map(function(we,je){return Wi(we,G[je],re)})}}),ji=.95047,Vo=1,Ha=1.08883,Oa=4/29,bs=6/29,lo=3*bs*bs,Ki=bs*bs*bs,os=Math.PI/180,To=180/Math.PI;function fo(P){return P>Ki?Math.pow(P,.3333333333333333):P/lo+Oa}function Os(P){return P>bs?P*P*P:lo*(P-Oa)}function Ta(P){return 255*(P<=.0031308?12.92*P:1.055*Math.pow(P,.4166666666666667)-.055)}function ws(P){return(P/=255)<=.04045?P/12.92:Math.pow((P+.055)/1.055,2.4)}function Bl(P){var G=ws(P.r),re=ws(P.g),we=ws(P.b),je=fo((.4124564*G+.3575761*re+.1804375*we)/ji),Ke=fo((.2126729*G+.7151522*re+.072175*we)/Vo);return{l:116*Ke-16,a:500*(je-Ke),b:200*(Ke-fo((.0193339*G+.119192*re+.9503041*we)/Ha)),alpha:P.a}}function Ql(P){var G=(P.l+16)/116,re=isNaN(P.a)?G:G+P.a/500,we=isNaN(P.b)?G:G-P.b/200;return G=Vo*Os(G),re=ji*Os(re),we=Ha*Os(we),new Qn(Ta(3.2404542*re-1.5371385*G-.4985314*we),Ta(-.969266*re+1.8760108*G+.041556*we),Ta(.0556434*re-.2040259*G+1.0572252*we),P.alpha)}function ss(P,G,re){var we=G-P;return P+re*(we>180||we<-180?we-360*Math.round(we/360):we)}var eu={forward:Bl,reverse:Ql,interpolate:function(P,G,re){return{l:Wi(P.l,G.l,re),a:Wi(P.a,G.a,re),b:Wi(P.b,G.b,re),alpha:Wi(P.alpha,G.alpha,re)}}},vl={forward:function(P){var G=Bl(P),re=G.l,we=G.a,je=G.b,Ke=Math.atan2(je,we)*To;return{h:Ke<0?Ke+360:Ke,c:Math.sqrt(we*we+je*je),l:re,alpha:P.a}},reverse:function(P){var G=P.h*os,re=P.c;return Ql({l:P.l,a:Math.cos(G)*re,b:Math.sin(G)*re,alpha:P.alpha})},interpolate:function(P,G,re){return{h:ss(P.h,G.h,re),c:Wi(P.c,G.c,re),l:Wi(P.l,G.l,re),alpha:Wi(P.alpha,G.alpha,re)}}},Za=Object.freeze({__proto__:null,lab:eu,hcl:vl}),ko=function(P,G,re,we,je){this.type=P,this.operator=G,this.interpolation=re,this.input=we,this.labels=[],this.outputs=[];for(var Ke=0,ot=je;Ke1}))return G.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);we={name:"cubic-bezier",controlPoints:_t}}if(P.length-1<4)return G.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if((P.length-1)%2!=0)return G.error("Expected an even number of arguments.");if(!(je=G.parse(je,2,Zt)))return null;var Rt=[],Kt=null;re==="interpolate-hcl"||re==="interpolate-lab"?Kt=Pn:G.expectedType&&G.expectedType.kind!=="value"&&(Kt=G.expectedType);for(var nn=0;nn=sn)return G.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',fn);var jn=G.parse(yn,On,Kt);if(!jn)return null;Kt=Kt||jn.type,Rt.push([sn,jn])}return Kt.kind==="number"||Kt.kind==="color"||Kt.kind==="array"&&Kt.itemType.kind==="number"&&typeof Kt.N=="number"?new ko(Kt,re,we,je,Rt):G.error("Type "+Tn(Kt)+" is not interpolatable.")},ko.prototype.evaluate=function(P){var G=this.labels,re=this.outputs;if(G.length===1)return re[0].evaluate(P);var we=this.input.evaluate(P);if(we<=G[0])return re[0].evaluate(P);var je=G.length;if(we>=G[je-1])return re[je-1].evaluate(P);var Ke=oi(G,we),ot=G[Ke],_t=G[Ke+1],Rt=ko.interpolationFactor(this.interpolation,we,ot,_t),Kt=re[Ke].evaluate(P),nn=re[Ke+1].evaluate(P);return this.operator==="interpolate"?Pa[this.type.kind.toLowerCase()](Kt,nn,Rt):this.operator==="interpolate-hcl"?vl.reverse(vl.interpolate(vl.forward(Kt),vl.forward(nn),Rt)):eu.reverse(eu.interpolate(eu.forward(Kt),eu.forward(nn),Rt))},ko.prototype.eachChild=function(P){P(this.input);for(var G=0,re=this.outputs;G=re.length)throw new Cn("Array index out of bounds: "+G+" > "+(re.length-1)+".");if(G!==Math.floor(G))throw new Cn("Array index must be an integer, but found "+G+" instead.");return re[G]},tu.prototype.eachChild=function(P){P(this.index),P(this.input)},tu.prototype.outputDefined=function(){return!1},tu.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xl=function(P,G){this.type=un,this.needle=P,this.haystack=G};xl.parse=function(P,G){if(P.length!==3)return G.error("Expected 2 arguments, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1,In),we=G.parse(P[2],2,In);return re&&we?zn(re.type,[un,on,Zt,Wt,In])?new xl(re,we):G.error("Expected first argument to be of type boolean, string, number or null, but found "+Tn(re.type)+" instead"):null},xl.prototype.evaluate=function(P){var G=this.needle.evaluate(P),re=this.haystack.evaluate(P);if(!re)return!1;if(!Jn(G,["boolean","string","number","null"]))throw new Cn("Expected first argument to be of type boolean, string, number or null, but found "+Tn(xr(G))+" instead.");if(!Jn(re,["string","array"]))throw new Cn("Expected second argument to be of type array or string, but found "+Tn(xr(re))+" instead.");return re.indexOf(G)>=0},xl.prototype.eachChild=function(P){P(this.needle),P(this.haystack)},xl.prototype.outputDefined=function(){return!0},xl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var jl=function(P,G,re){this.type=Zt,this.needle=P,this.haystack=G,this.fromIndex=re};jl.parse=function(P,G){if(P.length<=2||P.length>=5)return G.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1,In),we=G.parse(P[2],2,In);if(!re||!we)return null;if(!zn(re.type,[un,on,Zt,Wt,In]))return G.error("Expected first argument to be of type boolean, string, number or null, but found "+Tn(re.type)+" instead");if(P.length===4){var je=G.parse(P[3],3,Zt);return je?new jl(re,we,je):null}return new jl(re,we)},jl.prototype.evaluate=function(P){var G=this.needle.evaluate(P),re=this.haystack.evaluate(P);if(!Jn(G,["boolean","string","number","null"]))throw new Cn("Expected first argument to be of type boolean, string, number or null, but found "+Tn(xr(G))+" instead.");if(!Jn(re,["string","array"]))throw new Cn("Expected second argument to be of type array or string, but found "+Tn(xr(re))+" instead.");if(this.fromIndex){var we=this.fromIndex.evaluate(P);return re.indexOf(G,we)}return re.indexOf(G)},jl.prototype.eachChild=function(P){P(this.needle),P(this.haystack),this.fromIndex&&P(this.fromIndex)},jl.prototype.outputDefined=function(){return!1},jl.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var P=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),P]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ul=function(P,G,re,we,je,Ke){this.inputType=P,this.type=G,this.input=re,this.cases=we,this.outputs=je,this.otherwise=Ke};Ul.parse=function(P,G){if(P.length<5)return G.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if(P.length%2!=1)return G.error("Expected an even number of arguments.");var re,we;G.expectedType&&G.expectedType.kind!=="value"&&(we=G.expectedType);for(var je={},Ke=[],ot=2;otNumber.MAX_SAFE_INTEGER)return Kt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof yn=="number"&&Math.floor(yn)!==yn)return Kt.error("Numeric branch labels must be integer values.");if(re){if(Kt.checkSubtype(re,xr(yn)))return null}else re=xr(yn);if(je[String(yn)]!==void 0)return Kt.error("Branch labels must be unique.");je[String(yn)]=Ke.length}var fn=G.parse(Rt,ot,we);if(!fn)return null;we=we||fn.type,Ke.push(fn)}var On=G.parse(P[1],1,In);if(!On)return null;var jn=G.parse(P[P.length-1],P.length-1,we);return jn?On.type.kind!=="value"&&G.concat(1).checkSubtype(re,On.type)?null:new Ul(re,we,On,je,Ke,jn):null},Ul.prototype.evaluate=function(P){var G=this.input.evaluate(P);return(xr(G)===this.inputType&&this.outputs[this.cases[G]]||this.otherwise).evaluate(P)},Ul.prototype.eachChild=function(P){P(this.input),this.outputs.forEach(P),P(this.otherwise)},Ul.prototype.outputDefined=function(){return this.outputs.every(function(P){return P.outputDefined()})&&this.otherwise.outputDefined()},Ul.prototype.serialize=function(){for(var P=this,G=["match",this.input.serialize()],re=[],we={},je=0,Ke=Object.keys(this.cases).sort();je=5)return G.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1,In),we=G.parse(P[2],2,Zt);if(!re||!we)return null;if(!zn(re.type,[Ln(In),on,In]))return G.error("Expected first argument to be of type array or string, but found "+Tn(re.type)+" instead");if(P.length===4){var je=G.parse(P[3],3,Zt);return je?new vs(re.type,re,we,je):null}return new vs(re.type,re,we)},vs.prototype.evaluate=function(P){var G=this.input.evaluate(P),re=this.beginIndex.evaluate(P);if(!Jn(G,["string","array"]))throw new Cn("Expected first argument to be of type array or string, but found "+Tn(xr(G))+" instead.");if(this.endIndex){var we=this.endIndex.evaluate(P);return G.slice(re,we)}return G.slice(re)},vs.prototype.eachChild=function(P){P(this.input),P(this.beginIndex),this.endIndex&&P(this.endIndex)},vs.prototype.outputDefined=function(){return!1},vs.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var P=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),P]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var pc=Su("==",function(P,G,re){return G===re},ju),Rs=Su("!=",function(P,G,re){return G!==re},function(P,G,re,we){return!ju(0,G,re,we)}),Vs=Su("<",function(P,G,re){return G",function(P,G,re){return G>re},function(P,G,re,we){return we.compare(G,re)>0}),gh=Su("<=",function(P,G,re){return G<=re},function(P,G,re,we){return we.compare(G,re)<=0}),Fo=Su(">=",function(P,G,re){return G>=re},function(P,G,re,we){return we.compare(G,re)>=0}),Qu=function(P,G,re,we,je){this.type=on,this.number=P,this.locale=G,this.currency=re,this.minFractionDigits=we,this.maxFractionDigits=je};Qu.parse=function(P,G){if(P.length!==3)return G.error("Expected two arguments.");var re=G.parse(P[1],1,Zt);if(!re)return null;var we=P[2];if(typeof we!="object"||Array.isArray(we))return G.error("NumberFormat options argument must be an object.");var je=null;if(we.locale&&!(je=G.parse(we.locale,1,on)))return null;var Ke=null;if(we.currency&&!(Ke=G.parse(we.currency,1,on)))return null;var ot=null;if(we["min-fraction-digits"]&&!(ot=G.parse(we["min-fraction-digits"],1,Zt)))return null;var _t=null;return we["max-fraction-digits"]&&!(_t=G.parse(we["max-fraction-digits"],1,Zt))?null:new Qu(re,je,Ke,ot,_t)},Qu.prototype.evaluate=function(P){return new Intl.NumberFormat(this.locale?this.locale.evaluate(P):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(P):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(P):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(P):void 0}).format(this.number.evaluate(P))},Qu.prototype.eachChild=function(P){P(this.number),this.locale&&P(this.locale),this.currency&&P(this.currency),this.minFractionDigits&&P(this.minFractionDigits),this.maxFractionDigits&&P(this.maxFractionDigits)},Qu.prototype.outputDefined=function(){return!1},Qu.prototype.serialize=function(){var P={};return this.locale&&(P.locale=this.locale.serialize()),this.currency&&(P.currency=this.currency.serialize()),this.minFractionDigits&&(P["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(P["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),P]};var oa=function(P){this.type=Zt,this.input=P};oa.parse=function(P,G){if(P.length!==2)return G.error("Expected 1 argument, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1);return re?re.type.kind!=="array"&&re.type.kind!=="string"&&re.type.kind!=="value"?G.error("Expected argument of type string or array, but found "+Tn(re.type)+" instead."):new oa(re):null},oa.prototype.evaluate=function(P){var G=this.input.evaluate(P);if(typeof G=="string"||Array.isArray(G))return G.length;throw new Cn("Expected value to be of type string or array, but found "+Tn(xr(G))+" instead.")},oa.prototype.eachChild=function(P){P(this.input)},oa.prototype.outputDefined=function(){return!1},oa.prototype.serialize=function(){var P=["length"];return this.eachChild(function(G){P.push(G.serialize())}),P};var Mu={"==":pc,"!=":Rs,">":Uu,"<":Vs,">=":Fo,"<=":gh,array:Zn,at:tu,boolean:Zn,case:Vl,coalesce:Ds,collator:an,format:cr,image:Ir,in:xl,"index-of":jl,interpolate:ko,"interpolate-hcl":ko,"interpolate-lab":ko,length:oa,let:Nl,literal:kn,match:Ul,number:Zn,"number-format":Qu,object:Zn,slice:vs,step:Ti,string:Zn,"to-boolean":Xr,"to-color":Xr,"to-number":Xr,"to-string":Xr,var:gi,within:$r};function $a(P,G){var re=G[0],we=G[1],je=G[2],Ke=G[3];re=re.evaluate(P),we=we.evaluate(P),je=je.evaluate(P);var ot=Ke?Ke.evaluate(P):1,_t=Or(re,we,je,ot);if(_t)throw new Cn(_t);return new Qn(re/255*ot,we/255*ot,je/255*ot,ot)}function Ya(P,G){return P in G}function ys(P,G){var re=G[P];return re===void 0?null:re}function qs(P){return{type:P}}function ec(P){return{result:"success",value:P}}function ql(P){return{result:"error",value:P}}function Fs(P){return P["property-type"]==="data-driven"||P["property-type"]==="cross-faded-data-driven"}function qo(P){return!!P.expression&&P.expression.parameters.indexOf("zoom")>-1}function Bo(P){return!!P.expression&&P.expression.interpolated}function _a(P){return P instanceof Number?"number":P instanceof String?"string":P instanceof Boolean?"boolean":Array.isArray(P)?"array":P===null?"null":typeof P}function Vu(P){return typeof P=="object"&&P!==null&&!Array.isArray(P)}function Fc(P){return P}function Hs(P,G){var re,we,je,Ke=G.type==="color",ot=P.stops&&typeof P.stops[0][0]=="object",_t=ot||P.property!==void 0,Rt=ot||!_t,Kt=P.type||(Bo(G)?"exponential":"interval");if(Ke&&((P=Ft({},P)).stops&&(P.stops=P.stops.map(function(ei){return[ei[0],Qn.parse(ei[1])]})),P.default?P.default=Qn.parse(P.default):P.default=Qn.parse(G.default)),P.colorSpace&&P.colorSpace!=="rgb"&&!Za[P.colorSpace])throw new Error("Unknown color space: "+P.colorSpace);if(Kt==="exponential")re=rc;else if(Kt==="interval")re=nc;else if(Kt==="categorical"){re=tc,we=Object.create(null);for(var nn=0,sn=P.stops;nn=P.stops[we-1][0])return P.stops[we-1][1];var je=oi(P.stops.map(function(Ke){return Ke[0]}),re);return P.stops[je][1]}function rc(P,G,re){var we=P.base!==void 0?P.base:1;if(_a(re)!=="number")return Yo(P.default,G.default);var je=P.stops.length;if(je===1||re<=P.stops[0][0])return P.stops[0][1];if(re>=P.stops[je-1][0])return P.stops[je-1][1];var Ke=oi(P.stops.map(function(sn){return sn[0]}),re),ot=function(sn,yn,fn,On){var jn=On-fn,sr=sn-fn;return jn===0?0:yn===1?sr/jn:(Math.pow(yn,sr)-1)/(Math.pow(yn,jn)-1)}(re,we,P.stops[Ke][0],P.stops[Ke+1][0]),_t=P.stops[Ke][1],Rt=P.stops[Ke+1][1],Kt=Pa[G.type]||Fc;if(P.colorSpace&&P.colorSpace!=="rgb"){var nn=Za[P.colorSpace];Kt=function(sn,yn){return nn.reverse(nn.interpolate(nn.forward(sn),nn.forward(yn),ot))}}return typeof _t.evaluate=="function"?{evaluate:function(){for(var sn=[],yn=arguments.length;yn--;)sn[yn]=arguments[yn];var fn=_t.evaluate.apply(void 0,sn),On=Rt.evaluate.apply(void 0,sn);if(fn!==void 0&&On!==void 0)return Kt(fn,On,ot)}}:Kt(_t,Rt,ot)}function Qc(P,G,re){return G.type==="color"?re=Qn.parse(re):G.type==="formatted"?re=jr.fromString(re.toString()):G.type==="resolvedImage"?re=ni.fromString(re.toString()):_a(re)===G.type||G.type==="enum"&&G.values[re]||(re=void 0),Yo(re,P.default,G.default)}Yn.register(Mu,{error:[{kind:"error"},[on],function(P,G){var re=G[0];throw new Cn(re.evaluate(P))}],typeof:[on,[In],function(P,G){return Tn(xr(G[0].evaluate(P)))}],"to-rgba":[Ln(Zt,4),[Pn],function(P,G){return G[0].evaluate(P).toArray()}],rgb:[Pn,[Zt,Zt,Zt],$a],rgba:[Pn,[Zt,Zt,Zt,Zt],$a],has:{type:un,overloads:[[[on],function(P,G){return Ya(G[0].evaluate(P),P.properties())}],[[on,Dn],function(P,G){var re=G[0],we=G[1];return Ya(re.evaluate(P),we.evaluate(P))}]]},get:{type:In,overloads:[[[on],function(P,G){return ys(G[0].evaluate(P),P.properties())}],[[on,Dn],function(P,G){var re=G[0],we=G[1];return ys(re.evaluate(P),we.evaluate(P))}]]},"feature-state":[In,[on],function(P,G){return ys(G[0].evaluate(P),P.featureState||{})}],properties:[Dn,[],function(P){return P.properties()}],"geometry-type":[on,[],function(P){return P.geometryType()}],id:[In,[],function(P){return P.id()}],zoom:[Zt,[],function(P){return P.globals.zoom}],"heatmap-density":[Zt,[],function(P){return P.globals.heatmapDensity||0}],"line-progress":[Zt,[],function(P){return P.globals.lineProgress||0}],accumulated:[In,[],function(P){return P.globals.accumulated===void 0?null:P.globals.accumulated}],"+":[Zt,qs(Zt),function(P,G){for(var re=0,we=0,je=G;we":[un,[on,In],function(P,G){var re=G[0],we=G[1],je=P.properties()[re.value],Ke=we.value;return typeof je==typeof Ke&&je>Ke}],"filter-id->":[un,[In],function(P,G){var re=G[0],we=P.id(),je=re.value;return typeof we==typeof je&&we>je}],"filter-<=":[un,[on,In],function(P,G){var re=G[0],we=G[1],je=P.properties()[re.value],Ke=we.value;return typeof je==typeof Ke&&je<=Ke}],"filter-id-<=":[un,[In],function(P,G){var re=G[0],we=P.id(),je=re.value;return typeof we==typeof je&&we<=je}],"filter->=":[un,[on,In],function(P,G){var re=G[0],we=G[1],je=P.properties()[re.value],Ke=we.value;return typeof je==typeof Ke&&je>=Ke}],"filter-id->=":[un,[In],function(P,G){var re=G[0],we=P.id(),je=re.value;return typeof we==typeof je&&we>=je}],"filter-has":[un,[In],function(P,G){return G[0].value in P.properties()}],"filter-has-id":[un,[],function(P){return P.id()!==null&&P.id()!==void 0}],"filter-type-in":[un,[Ln(on)],function(P,G){return G[0].value.indexOf(P.geometryType())>=0}],"filter-id-in":[un,[Ln(In)],function(P,G){return G[0].value.indexOf(P.id())>=0}],"filter-in-small":[un,[on,Ln(In)],function(P,G){var re=G[0];return G[1].value.indexOf(P.properties()[re.value])>=0}],"filter-in-large":[un,[on,Ln(In)],function(P,G){var re=G[0],we=G[1];return function(je,Ke,ot,_t){for(;ot<=_t;){var Rt=ot+_t>>1;if(Ke[Rt]===je)return!0;Ke[Rt]>je?_t=Rt-1:ot=Rt+1}return!1}(P.properties()[re.value],we.value,0,we.value.length-1)}],all:{type:un,overloads:[[[un,un],function(P,G){var re=G[0],we=G[1];return re.evaluate(P)&&we.evaluate(P)}],[qs(un),function(P,G){for(var re=0,we=G;re0&&typeof P[0]=="string"&&P[0]in Mu}function Gs(P,G){var re=new ii(Mu,[],G?function(je){var Ke={color:Pn,string:on,number:Zt,enum:on,boolean:un,formatted:En,resolvedImage:Kn};return je.type==="array"?Ln(Ke[je.value]||In,je.length):Ke[je.type]}(G):void 0),we=re.parse(P,void 0,void 0,void 0,G&&G.type==="string"?{typeAnnotation:"coerce"}:void 0);return we?ec(new _l(we,G)):ql(re.errors)}_l.prototype.evaluateWithoutErrorHandling=function(P,G,re,we,je,Ke){return this._evaluator.globals=P,this._evaluator.feature=G,this._evaluator.featureState=re,this._evaluator.canonical=we,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ke,this.expression.evaluate(this._evaluator)},_l.prototype.evaluate=function(P,G,re,we,je,Ke){this._evaluator.globals=P,this._evaluator.feature=G||null,this._evaluator.featureState=re||null,this._evaluator.canonical=we,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ke||null;try{var ot=this.expression.evaluate(this._evaluator);if(ot==null||typeof ot=="number"&&ot!=ot)return this._defaultValue;if(this._enumValues&&!(ot in this._enumValues))throw new Cn("Expected value to be one of "+Object.keys(this._enumValues).map(function(_t){return JSON.stringify(_t)}).join(", ")+", but found "+JSON.stringify(ot)+" instead.");return ot}catch(_t){return this._warningHistory[_t.message]||(this._warningHistory[_t.message]=!0,typeof console<"u"&&console.warn(_t.message)),this._defaultValue}};var pr=function(P,G){this.kind=P,this._styleExpression=G,this.isStateDependent=P!=="constant"&&!Cr(G.expression)};pr.prototype.evaluateWithoutErrorHandling=function(P,G,re,we,je,Ke){return this._styleExpression.evaluateWithoutErrorHandling(P,G,re,we,je,Ke)},pr.prototype.evaluate=function(P,G,re,we,je,Ke){return this._styleExpression.evaluate(P,G,re,we,je,Ke)};var Dr=function(P,G,re,we){this.kind=P,this.zoomStops=re,this._styleExpression=G,this.isStateDependent=P!=="camera"&&!Cr(G.expression),this.interpolationType=we};function Zr(P,G){if((P=Gs(P,G)).result==="error")return P;var re=P.value.expression,we=Pr(re);if(!we&&!Fs(G))return ql([new qt("","data expressions not supported")]);var je=Jr(re,["zoom"]);if(!je&&!qo(G))return ql([new qt("","zoom expressions not supported")]);var Ke=ia(re);if(!Ke&&!je)return ql([new qt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ke instanceof qt)return ql([Ke]);if(Ke instanceof ko&&!Bo(G))return ql([new qt("",'"interpolate" expressions cannot be used with this property')]);if(!Ke)return ec(new pr(we?"constant":"source",P.value));var ot=Ke instanceof ko?Ke.interpolation:void 0;return ec(new Dr(we?"camera":"composite",P.value,Ke.labels,ot))}Dr.prototype.evaluateWithoutErrorHandling=function(P,G,re,we,je,Ke){return this._styleExpression.evaluateWithoutErrorHandling(P,G,re,we,je,Ke)},Dr.prototype.evaluate=function(P,G,re,we,je,Ke){return this._styleExpression.evaluate(P,G,re,we,je,Ke)},Dr.prototype.interpolationFactor=function(P,G,re){return this.interpolationType?ko.interpolationFactor(this.interpolationType,P,G,re):0};var Li=function(P,G){this._parameters=P,this._specification=G,Ft(this,Hs(this._parameters,this._specification))};function ia(P){var G=null;if(P instanceof Nl)G=ia(P.result);else if(P instanceof Ds)for(var re=0,we=P.args;rewe.maximum?[new Et(G,re,re+" is greater than the maximum value "+we.maximum)]:[]}function mu(P){var G,re,we,je=P.valueSpec,Ke=St(P.value.type),ot={},_t=Ke!=="categorical"&&P.value.property===void 0,Rt=!_t,Kt=_a(P.value.stops)==="array"&&_a(P.value.stops[0])==="array"&&_a(P.value.stops[0][0])==="object",nn=sa({key:P.key,value:P.value,valueSpec:P.styleSpec.function,style:P.style,styleSpec:P.styleSpec,objectElementValidators:{stops:function(fn){if(Ke==="identity")return[new Et(fn.key,fn.value,'identity function may not have a "stops" property')];var On=[],jn=fn.value;return On=On.concat(po({key:fn.key,value:jn,valueSpec:fn.valueSpec,style:fn.style,styleSpec:fn.styleSpec,arrayElementValidator:sn})),_a(jn)==="array"&&jn.length===0&&On.push(new Et(fn.key,jn,"array must have at least one stop")),On},default:function(fn){return Co({key:fn.key,value:fn.value,valueSpec:je,style:fn.style,styleSpec:fn.styleSpec})}}});return Ke==="identity"&&_t&&nn.push(new Et(P.key,P.value,'missing required property "property"')),Ke==="identity"||P.value.stops||nn.push(new Et(P.key,P.value,'missing required property "stops"')),Ke==="exponential"&&P.valueSpec.expression&&!Bo(P.valueSpec)&&nn.push(new Et(P.key,P.value,"exponential functions not supported")),P.styleSpec.$version>=8&&(Rt&&!Fs(P.valueSpec)?nn.push(new Et(P.key,P.value,"property functions not supported")):_t&&!qo(P.valueSpec)&&nn.push(new Et(P.key,P.value,"zoom functions not supported"))),Ke!=="categorical"&&!Kt||P.value.property!==void 0||nn.push(new Et(P.key,P.value,'"property" property is required')),nn;function sn(fn){var On=[],jn=fn.value,sr=fn.key;if(_a(jn)!=="array")return[new Et(sr,jn,"array expected, "+_a(jn)+" found")];if(jn.length!==2)return[new Et(sr,jn,"array length 2 expected, length "+jn.length+" found")];if(Kt){if(_a(jn[0])!=="object")return[new Et(sr,jn,"object expected, "+_a(jn[0])+" found")];if(jn[0].zoom===void 0)return[new Et(sr,jn,"object stop key must have zoom")];if(jn[0].value===void 0)return[new Et(sr,jn,"object stop key must have value")];if(we&&we>St(jn[0].zoom))return[new Et(sr,jn[0].zoom,"stop zoom values must appear in ascending order")];St(jn[0].zoom)!==we&&(we=St(jn[0].zoom),re=void 0,ot={}),On=On.concat(sa({key:sr+"[0]",value:jn[0],valueSpec:{zoom:{}},style:fn.style,styleSpec:fn.styleSpec,objectElementValidators:{zoom:ro,value:yn}}))}else On=On.concat(yn({key:sr+"[0]",value:jn[0],valueSpec:{},style:fn.style,styleSpec:fn.styleSpec},jn));return Hl(Jt(jn[1]))?On.concat([new Et(sr+"[1]",jn[1],"expressions are not allowed in function stops.")]):On.concat(Co({key:sr+"[1]",value:jn[1],valueSpec:je,style:fn.style,styleSpec:fn.styleSpec}))}function yn(fn,On){var jn=_a(fn.value),sr=St(fn.value),ir=fn.value!==null?fn.value:On;if(G){if(jn!==G)return[new Et(fn.key,ir,jn+" stop domain type must match previous stop domain type "+G)]}else G=jn;if(jn!=="number"&&jn!=="string"&&jn!=="boolean")return[new Et(fn.key,ir,"stop domain value must be a number, string, or boolean")];if(jn!=="number"&&Ke!=="categorical"){var kr="number expected, "+jn+" found";return Fs(je)&&Ke===void 0&&(kr+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Et(fn.key,ir,kr)]}return Ke!=="categorical"||jn!=="number"||isFinite(sr)&&Math.floor(sr)===sr?Ke!=="categorical"&&jn==="number"&&re!==void 0&&sr=2&&P[1]!=="$id"&&P[1]!=="$type";case"in":return P.length>=3&&(typeof P[1]!="string"||Array.isArray(P[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return P.length!==3||Array.isArray(P[1])||Array.isArray(P[2]);case"any":case"all":for(var G=0,re=P.slice(1);GG?1:0}function La(P){if(!Array.isArray(P))return!1;if(P[0]==="within")return!0;for(var G=1;G"||re==="<="||re===">="?Ho(P[1],P[2],re):re==="any"?(G=P.slice(1),["any"].concat(G.map(ba))):re==="all"?["all"].concat(P.slice(1).map(ba)):re==="none"?["all"].concat(P.slice(1).map(ba).map(Ua)):re==="in"?Ts(P[1],P.slice(2)):re==="!in"?Ua(Ts(P[1],P.slice(2))):re==="has"?Aa(P[1]):re==="!has"?Ua(Aa(P[1])):re!=="within"||P}function Ho(P,G,re){switch(P){case"$type":return["filter-type-"+re,G];case"$id":return["filter-id-"+re,G];default:return["filter-"+re,P,G]}}function Ts(P,G){if(G.length===0)return!1;switch(P){case"$type":return["filter-type-in",["literal",G]];case"$id":return["filter-id-in",["literal",G]];default:return G.length>200&&!G.some(function(re){return typeof re!=typeof G[0]})?["filter-in-large",P,["literal",G.sort(vu)]]:["filter-in-small",P,["literal",G]]}}function Aa(P){switch(P){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",P]}}function Ua(P){return["!",P]}function wl(P){return Ws(Jt(P.value))?qu(Ft({},P,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ic(P)}function ic(P){var G=P.value,re=P.key;if(_a(G)!=="array")return[new Et(re,G,"array expected, "+_a(G)+" found")];var we,je=P.styleSpec,Ke=[];if(G.length<1)return[new Et(re,G,"filter array must have at least 1 element")];switch(Ke=Ke.concat(ls({key:re+"[0]",value:G[0],valueSpec:je.filter_operator,style:P.style,styleSpec:P.styleSpec})),St(G[0])){case"<":case"<=":case">":case">=":G.length>=2&&St(G[1])==="$type"&&Ke.push(new Et(re,G,'"$type" cannot be use with operator "'+G[0]+'"'));case"==":case"!=":G.length!==3&&Ke.push(new Et(re,G,'filter array for operator "'+G[0]+'" must have 3 elements'));case"in":case"!in":G.length>=2&&(we=_a(G[1]))!=="string"&&Ke.push(new Et(re+"[1]",G[1],"string expected, "+we+" found"));for(var ot=2;ot=nn[fn+0]&&we>=nn[fn+1])?(ot[yn]=!0,Ke.push(Kt[yn])):ot[yn]=!1}}},Tl.prototype._forEachCell=function(P,G,re,we,je,Ke,ot,_t){for(var Rt=this._convertToCellCoord(P),Kt=this._convertToCellCoord(G),nn=this._convertToCellCoord(re),sn=this._convertToCellCoord(we),yn=Rt;yn<=nn;yn++)for(var fn=Kt;fn<=sn;fn++){var On=this.d*fn+yn;if((!_t||_t(this._convertFromCellCoord(yn),this._convertFromCellCoord(fn),this._convertFromCellCoord(yn+1),this._convertFromCellCoord(fn+1)))&&je.call(this,P,G,re,we,On,Ke,ot,_t))return}},Tl.prototype._convertFromCellCoord=function(P){return(P-this.padding)/this.scale},Tl.prototype._convertToCellCoord=function(P){return Math.max(0,Math.min(this.d-1,Math.floor(P*this.scale)+this.padding))},Tl.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var P=this.cells,G=ru+this.cells.length+1+1,re=0,we=0;we=0)){var sn=P[nn];Kt[nn]=kl[Rt].shallow.indexOf(nn)>=0?sn:il(sn,G)}P instanceof Error&&(Kt.message=P.message)}if(Kt.$name)throw new Error("$name property is reserved for worker serialization logic.");return Rt!=="Object"&&(Kt.$name=Rt),Kt}throw new Error("can't serialize object of type "+typeof P)}function Sl(P){if(P==null||typeof P=="boolean"||typeof P=="number"||typeof P=="string"||P instanceof Boolean||P instanceof Number||P instanceof String||P instanceof Date||P instanceof RegExp||Ac(P)||Al(P)||ArrayBuffer.isView(P)||P instanceof Sa)return P;if(Array.isArray(P))return P.map(Sl);if(typeof P=="object"){var G=P.$name||"Object",re=kl[G].klass;if(!re)throw new Error("can't deserialize unregistered class "+G);if(re.deserialize)return re.deserialize(P);for(var we=Object.create(re.prototype),je=0,Ke=Object.keys(P);je=0?_t:Sl(_t)}}return we}throw new Error("can't deserialize object of type "+typeof P)}var Ml=function(){this.first=!0};Ml.prototype.update=function(P,G){var re=Math.floor(P);return this.first?(this.first=!1,this.lastIntegerZoom=re,this.lastIntegerZoomTime=0,this.lastZoom=P,this.lastFloorZoom=re,!0):(this.lastFloorZoom>re?(this.lastIntegerZoom=re+1,this.lastIntegerZoomTime=G):this.lastFloorZoom=128&&P<=255},Arabic:function(P){return P>=1536&&P<=1791},"Arabic Supplement":function(P){return P>=1872&&P<=1919},"Arabic Extended-A":function(P){return P>=2208&&P<=2303},"Hangul Jamo":function(P){return P>=4352&&P<=4607},"Unified Canadian Aboriginal Syllabics":function(P){return P>=5120&&P<=5759},Khmer:function(P){return P>=6016&&P<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(P){return P>=6320&&P<=6399},"General Punctuation":function(P){return P>=8192&&P<=8303},"Letterlike Symbols":function(P){return P>=8448&&P<=8527},"Number Forms":function(P){return P>=8528&&P<=8591},"Miscellaneous Technical":function(P){return P>=8960&&P<=9215},"Control Pictures":function(P){return P>=9216&&P<=9279},"Optical Character Recognition":function(P){return P>=9280&&P<=9311},"Enclosed Alphanumerics":function(P){return P>=9312&&P<=9471},"Geometric Shapes":function(P){return P>=9632&&P<=9727},"Miscellaneous Symbols":function(P){return P>=9728&&P<=9983},"Miscellaneous Symbols and Arrows":function(P){return P>=11008&&P<=11263},"CJK Radicals Supplement":function(P){return P>=11904&&P<=12031},"Kangxi Radicals":function(P){return P>=12032&&P<=12255},"Ideographic Description Characters":function(P){return P>=12272&&P<=12287},"CJK Symbols and Punctuation":function(P){return P>=12288&&P<=12351},Hiragana:function(P){return P>=12352&&P<=12447},Katakana:function(P){return P>=12448&&P<=12543},Bopomofo:function(P){return P>=12544&&P<=12591},"Hangul Compatibility Jamo":function(P){return P>=12592&&P<=12687},Kanbun:function(P){return P>=12688&&P<=12703},"Bopomofo Extended":function(P){return P>=12704&&P<=12735},"CJK Strokes":function(P){return P>=12736&&P<=12783},"Katakana Phonetic Extensions":function(P){return P>=12784&&P<=12799},"Enclosed CJK Letters and Months":function(P){return P>=12800&&P<=13055},"CJK Compatibility":function(P){return P>=13056&&P<=13311},"CJK Unified Ideographs Extension A":function(P){return P>=13312&&P<=19903},"Yijing Hexagram Symbols":function(P){return P>=19904&&P<=19967},"CJK Unified Ideographs":function(P){return P>=19968&&P<=40959},"Yi Syllables":function(P){return P>=40960&&P<=42127},"Yi Radicals":function(P){return P>=42128&&P<=42191},"Hangul Jamo Extended-A":function(P){return P>=43360&&P<=43391},"Hangul Syllables":function(P){return P>=44032&&P<=55215},"Hangul Jamo Extended-B":function(P){return P>=55216&&P<=55295},"Private Use Area":function(P){return P>=57344&&P<=63743},"CJK Compatibility Ideographs":function(P){return P>=63744&&P<=64255},"Arabic Presentation Forms-A":function(P){return P>=64336&&P<=65023},"Vertical Forms":function(P){return P>=65040&&P<=65055},"CJK Compatibility Forms":function(P){return P>=65072&&P<=65103},"Small Form Variants":function(P){return P>=65104&&P<=65135},"Arabic Presentation Forms-B":function(P){return P>=65136&&P<=65279},"Halfwidth and Fullwidth Forms":function(P){return P>=65280&&P<=65519}};function hs(P){for(var G=0,re=P;G=65097&&P<=65103)||li["CJK Compatibility Ideographs"](P)||li["CJK Compatibility"](P)||li["CJK Radicals Supplement"](P)||li["CJK Strokes"](P)||!(!li["CJK Symbols and Punctuation"](P)||P>=12296&&P<=12305||P>=12308&&P<=12319||P===12336)||li["CJK Unified Ideographs Extension A"](P)||li["CJK Unified Ideographs"](P)||li["Enclosed CJK Letters and Months"](P)||li["Hangul Compatibility Jamo"](P)||li["Hangul Jamo Extended-A"](P)||li["Hangul Jamo Extended-B"](P)||li["Hangul Jamo"](P)||li["Hangul Syllables"](P)||li.Hiragana(P)||li["Ideographic Description Characters"](P)||li.Kanbun(P)||li["Kangxi Radicals"](P)||li["Katakana Phonetic Extensions"](P)||li.Katakana(P)&&P!==12540||!(!li["Halfwidth and Fullwidth Forms"](P)||P===65288||P===65289||P===65293||P>=65306&&P<=65310||P===65339||P===65341||P===65343||P>=65371&&P<=65503||P===65507||P>=65512&&P<=65519)||!(!li["Small Form Variants"](P)||P>=65112&&P<=65118||P>=65123&&P<=65126)||li["Unified Canadian Aboriginal Syllabics"](P)||li["Unified Canadian Aboriginal Syllabics Extended"](P)||li["Vertical Forms"](P)||li["Yijing Hexagram Symbols"](P)||li["Yi Syllables"](P)||li["Yi Radicals"](P))))}function Na(P){return!(al(P)||function(G){return!!(li["Latin-1 Supplement"](G)&&(G===167||G===169||G===174||G===177||G===188||G===189||G===190||G===215||G===247)||li["General Punctuation"](G)&&(G===8214||G===8224||G===8225||G===8240||G===8241||G===8251||G===8252||G===8258||G===8263||G===8264||G===8265||G===8273)||li["Letterlike Symbols"](G)||li["Number Forms"](G)||li["Miscellaneous Technical"](G)&&(G>=8960&&G<=8967||G>=8972&&G<=8991||G>=8996&&G<=9e3||G===9003||G>=9085&&G<=9114||G>=9150&&G<=9165||G===9167||G>=9169&&G<=9179||G>=9186&&G<=9215)||li["Control Pictures"](G)&&G!==9251||li["Optical Character Recognition"](G)||li["Enclosed Alphanumerics"](G)||li["Geometric Shapes"](G)||li["Miscellaneous Symbols"](G)&&!(G>=9754&&G<=9759)||li["Miscellaneous Symbols and Arrows"](G)&&(G>=11026&&G<=11055||G>=11088&&G<=11097||G>=11192&&G<=11243)||li["CJK Symbols and Punctuation"](G)||li.Katakana(G)||li["Private Use Area"](G)||li["CJK Compatibility Forms"](G)||li["Small Form Variants"](G)||li["Halfwidth and Fullwidth Forms"](G)||G===8734||G===8756||G===8757||G>=9984&&G<=10087||G>=10102&&G<=10131||G===65532||G===65533)}(P))}function Ns(P){return li.Arabic(P)||li["Arabic Supplement"](P)||li["Arabic Extended-A"](P)||li["Arabic Presentation Forms-A"](P)||li["Arabic Presentation Forms-B"](P)}function iu(P){return P>=1424&&P<=2303||li["Arabic Presentation Forms-A"](P)||li["Arabic Presentation Forms-B"](P)}function El(P,G){return!(!G&&iu(P)||P>=2304&&P<=3583||P>=3840&&P<=4255||li.Khmer(P))}function ks(P){for(var G=0,re=P;G-1&&(ya=ol),cn&&cn(P)};function ta(){Qo.fire(new Lt("pluginStateChange",{pluginStatus:ya,pluginURL:So}))}var Qo=new rt,ac=function(){return ya},yi=function(){if(ya!==au||!So)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ya=As,ta(),So&&Ot({url:So},function(P){P?io(P):(ya=Jo,ta())})},Io={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ya===Jo||Io.applyArabicShaping!=null},isLoading:function(){return ya===As},setState:function(P){ya=P.pluginStatus,So=P.pluginURL},isParsed:function(){return Io.applyArabicShaping!=null&&Io.processBidirectionalText!=null&&Io.processStyledBidirectionalText!=null},getPluginURL:function(){return So}},za=function(P,G){this.zoom=P,G?(this.now=G.now,this.fadeDuration=G.fadeDuration,this.zoomHistory=G.zoomHistory,this.transition=G.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ml,this.transition={})};za.prototype.isSupportedScript=function(P){return function(G,re){for(var we=0,je=G;wethis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:G+(1-G)*re}:{fromScale:.5,toScale:1,t:1-(1-re)*G}};var xu=function(P,G){this.property=P,this.value=G,this.expression=function(re,we){if(Vu(re))return new Li(re,we);if(Hl(re)){var je=Zr(re,we);if(je.result==="error")throw new Error(je.value.map(function(ot){return ot.key+": "+ot.message}).join(", "));return je.value}var Ke=re;return typeof re=="string"&&we.type==="color"&&(Ke=Qn.parse(re)),{kind:"constant",evaluate:function(){return Ke}}}(G===void 0?P.specification.default:G,P.specification)};xu.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},xu.prototype.possiblyEvaluate=function(P,G,re){return this.property.possiblyEvaluate(this,P,G,re)};var sl=function(P){this.property=P,this.value=new xu(P,void 0)};sl.prototype.transitioned=function(P,G){return new dc(this.property,this.value,G,m({},P.transition,this.transition),P.now)},sl.prototype.untransitioned=function(){return new dc(this.property,this.value,null,{},0)};var $l=function(P){this._properties=P,this._values=Object.create(P.defaultTransitionablePropertyValues)};$l.prototype.getValue=function(P){return f(this._values[P].value.value)},$l.prototype.setValue=function(P,G){this._values.hasOwnProperty(P)||(this._values[P]=new sl(this._values[P].property)),this._values[P].value=new xu(this._values[P].property,G===null?void 0:f(G))},$l.prototype.getTransition=function(P){return f(this._values[P].transition)},$l.prototype.setTransition=function(P,G){this._values.hasOwnProperty(P)||(this._values[P]=new sl(this._values[P].property)),this._values[P].transition=f(G)||void 0},$l.prototype.serialize=function(){for(var P={},G=0,re=Object.keys(this._values);Gthis.end)return this.prior=null,je;if(this.value.isDataDriven())return this.prior=null,je;if(we=1)return 1;var Rt=_t*_t,Kt=Rt*_t;return 4*(_t<.5?Kt:3*(_t-Rt)+Kt-.75)}(ot))}return je};var $s=function(P){this._properties=P,this._values=Object.create(P.defaultTransitioningPropertyValues)};$s.prototype.possiblyEvaluate=function(P,G,re){for(var we=new Cl(this._properties),je=0,Ke=Object.keys(this._values);jeKe.zoomHistory.lastIntegerZoom?{from:re,to:we}:{from:je,to:we}},G.prototype.interpolate=function(re){return re},G}(Fi),Il=function(P){this.specification=P};Il.prototype.possiblyEvaluate=function(P,G,re,we){if(P.value!==void 0){if(P.expression.kind==="constant"){var je=P.expression.evaluate(G,null,{},re,we);return this._calculate(je,je,je,G)}return this._calculate(P.expression.evaluate(new za(Math.floor(G.zoom-1),G)),P.expression.evaluate(new za(Math.floor(G.zoom),G)),P.expression.evaluate(new za(Math.floor(G.zoom+1),G)),G)}},Il.prototype._calculate=function(P,G,re,we){return we.zoom>we.zoomHistory.lastIntegerZoom?{from:P,to:G}:{from:re,to:G}},Il.prototype.interpolate=function(P){return P};var su=function(P){this.specification=P};su.prototype.possiblyEvaluate=function(P,G,re,we){return!!P.expression.evaluate(G,null,{},re,we)},su.prototype.interpolate=function(){return!1};var ho=function(P){for(var G in this.properties=P,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],P){var re=P[G];re.specification.overridable&&this.overridableProperties.push(G);var we=this.defaultPropertyValues[G]=new xu(re,void 0),je=this.defaultTransitionablePropertyValues[G]=new sl(re);this.defaultTransitioningPropertyValues[G]=je.untransitioned(),this.defaultPossiblyEvaluatedValues[G]=we.possiblyEvaluate({})}};Mi("DataDrivenProperty",Fi),Mi("DataConstantProperty",di),Mi("CrossFadedDataDrivenProperty",Mo),Mi("CrossFadedProperty",Il),Mi("ColorRampProperty",su);var _u="-transition",da=function(P){function G(re,we){if(P.call(this),this.id=re.id,this.type=re.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},re.type!=="custom"&&(this.metadata=re.metadata,this.minzoom=re.minzoom,this.maxzoom=re.maxzoom,re.type!=="background"&&(this.source=re.source,this.sourceLayer=re["source-layer"],this.filter=re.filter),we.layout&&(this._unevaluatedLayout=new ou(we.layout)),we.paint)){for(var je in this._transitionablePaint=new $l(we.paint),re.paint)this.setPaintProperty(je,re.paint[je],{validate:!1});for(var Ke in re.layout)this.setLayoutProperty(Ke,re.layout[Ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Cl(we.paint)}}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},G.prototype.getLayoutProperty=function(re){return re==="visibility"?this.visibility:this._unevaluatedLayout.getValue(re)},G.prototype.setLayoutProperty=function(re,we,je){if(je===void 0&&(je={}),we!=null){var Ke="layers."+this.id+".layout."+re;if(this._validate(Zl,Ke,re,we,je))return}re!=="visibility"?this._unevaluatedLayout.setValue(re,we):this.visibility=we},G.prototype.getPaintProperty=function(re){return T(re,_u)?this._transitionablePaint.getTransition(re.slice(0,-11)):this._transitionablePaint.getValue(re)},G.prototype.setPaintProperty=function(re,we,je){if(je===void 0&&(je={}),we!=null){var Ke="layers."+this.id+".paint."+re;if(this._validate(xs,Ke,re,we,je))return!1}if(T(re,_u))return this._transitionablePaint.setTransition(re.slice(0,-11),we||void 0),!1;var ot=this._transitionablePaint._values[re],_t=ot.property.specification["property-type"]==="cross-faded-data-driven",Rt=ot.value.isDataDriven(),Kt=ot.value;this._transitionablePaint.setValue(re,we),this._handleSpecialPaintPropertyUpdate(re);var nn=this._transitionablePaint._values[re].value;return nn.isDataDriven()||Rt||_t||this._handleOverridablePaintPropertyUpdate(re,Kt,nn)},G.prototype._handleSpecialPaintPropertyUpdate=function(re){},G.prototype._handleOverridablePaintPropertyUpdate=function(re,we,je){return!1},G.prototype.isHidden=function(re){return!!(this.minzoom&&re=this.maxzoom)||this.visibility==="none"},G.prototype.updateTransitions=function(re){this._transitioningPaint=this._transitionablePaint.transitioned(re,this._transitioningPaint)},G.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},G.prototype.recalculate=function(re,we){re.getCrossfadeParameters&&(this._crossfadeParameters=re.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(re,void 0,we)),this.paint=this._transitioningPaint.possiblyEvaluate(re,void 0,we)},G.prototype.serialize=function(){var re={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&&(re.layout=re.layout||{},re.layout.visibility=this.visibility),M(re,function(we,je){return!(we===void 0||je==="layout"&&!Object.keys(we).length||je==="paint"&&!Object.keys(we).length)})},G.prototype._validate=function(re,we,je,Ke,ot){return ot===void 0&&(ot={}),(!ot||ot.validate!==!1)&&_s(this,re.call(cs,{key:we,layerType:this.type,objectKey:je,value:Ke,styleSpec:et,style:{glyphs:!0,sprite:!0}}))},G.prototype.is3D=function(){return!1},G.prototype.isTileClipped=function(){return!1},G.prototype.hasOffscreenPass=function(){return!1},G.prototype.resize=function(){},G.prototype.isStateDependent=function(){for(var re in this.paint._values){var we=this.paint.get(re);if(we instanceof eo&&Fs(we.property.specification)&&(we.value.kind==="source"||we.value.kind==="composite")&&we.value.isStateDependent)return!0}return!1},G}(rt),Ys={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ai=function(P,G){this._structArray=P,this._pos1=G*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},xi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function xa(P,G){G===void 0&&(G=1);var re=0,we=0;return{members:P.map(function(je){var Ke,ot=(Ke=je.type,Ys[Ke].BYTES_PER_ELEMENT),_t=re=es(re,Math.max(G,ot)),Rt=je.components||1;return we=Math.max(we,ot),re+=ot*Rt,{name:je.name,type:je.type,components:Rt,offset:_t}}),size:es(re,Math.max(we,G)),alignment:G}}function es(P,G){return Math.ceil(P/G)*G}xi.serialize=function(P,G){return P._trim(),G&&(P.isTransferred=!0,G.push(P.arrayBuffer)),{length:P.length,arrayBuffer:P.arrayBuffer}},xi.deserialize=function(P){var G=Object.create(this.prototype);return G.arrayBuffer=P.arrayBuffer,G.length=P.length,G.capacity=P.arrayBuffer.byteLength/G.bytesPerElement,G._refreshViews(),G},xi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},xi.prototype.clear=function(){this.length=0},xi.prototype.resize=function(P){this.reserve(P),this.length=P},xi.prototype.reserve=function(P){if(P>this.capacity){this.capacity=Math.max(P,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var G=this.uint8;this._refreshViews(),G&&this.uint8.set(G)}},xi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var bu=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we){var je=this.length;return this.resize(je+1),this.emplace(je,re,we)},G.prototype.emplace=function(re,we,je){var Ke=2*re;return this.int16[Ke+0]=we,this.int16[Ke+1]=je,re},G}(xi);bu.prototype.bytesPerElement=4,Mi("StructArrayLayout2i4",bu);var js=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke){var ot=this.length;return this.resize(ot+1),this.emplace(ot,re,we,je,Ke)},G.prototype.emplace=function(re,we,je,Ke,ot){var _t=4*re;return this.int16[_t+0]=we,this.int16[_t+1]=je,this.int16[_t+2]=Ke,this.int16[_t+3]=ot,re},G}(xi);js.prototype.bytesPerElement=8,Mi("StructArrayLayout4i8",js);var xt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,re,we,je,Ke,ot,_t)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt){var Kt=6*re;return this.int16[Kt+0]=we,this.int16[Kt+1]=je,this.int16[Kt+2]=Ke,this.int16[Kt+3]=ot,this.int16[Kt+4]=_t,this.int16[Kt+5]=Rt,re},G}(xi);xt.prototype.bytesPerElement=12,Mi("StructArrayLayout2i4i12",xt);var kt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,re,we,je,Ke,ot,_t)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt){var Kt=4*re,nn=8*re;return this.int16[Kt+0]=we,this.int16[Kt+1]=je,this.uint8[nn+4]=Ke,this.uint8[nn+5]=ot,this.uint8[nn+6]=_t,this.uint8[nn+7]=Rt,re},G}(xi);kt.prototype.bytesPerElement=8,Mi("StructArrayLayout2i4ub8",kt);var Dt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we){var je=this.length;return this.resize(je+1),this.emplace(je,re,we)},G.prototype.emplace=function(re,we,je){var Ke=2*re;return this.float32[Ke+0]=we,this.float32[Ke+1]=je,re},G}(xi);Dt.prototype.bytesPerElement=8,Mi("StructArrayLayout2f8",Dt);var X=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn){var yn=this.length;return this.resize(yn+1),this.emplace(yn,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn){var fn=10*re;return this.uint16[fn+0]=we,this.uint16[fn+1]=je,this.uint16[fn+2]=Ke,this.uint16[fn+3]=ot,this.uint16[fn+4]=_t,this.uint16[fn+5]=Rt,this.uint16[fn+6]=Kt,this.uint16[fn+7]=nn,this.uint16[fn+8]=sn,this.uint16[fn+9]=yn,re},G}(xi);X.prototype.bytesPerElement=20,Mi("StructArrayLayout10ui20",X);var R=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn){var On=this.length;return this.resize(On+1),this.emplace(On,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On){var jn=12*re;return this.int16[jn+0]=we,this.int16[jn+1]=je,this.int16[jn+2]=Ke,this.int16[jn+3]=ot,this.uint16[jn+4]=_t,this.uint16[jn+5]=Rt,this.uint16[jn+6]=Kt,this.uint16[jn+7]=nn,this.int16[jn+8]=sn,this.int16[jn+9]=yn,this.int16[jn+10]=fn,this.int16[jn+11]=On,re},G}(xi);R.prototype.bytesPerElement=24,Mi("StructArrayLayout4i4ui4i24",R);var i=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=3*re;return this.float32[ot+0]=we,this.float32[ot+1]=je,this.float32[ot+2]=Ke,re},G}(xi);i.prototype.bytesPerElement=12,Mi("StructArrayLayout3f12",i);var a=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re){var we=this.length;return this.resize(we+1),this.emplace(we,re)},G.prototype.emplace=function(re,we){var je=1*re;return this.uint32[je+0]=we,re},G}(xi);a.prototype.bytesPerElement=4,Mi("StructArrayLayout1ul4",a);var C=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.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)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn){var sn=this.length;return this.resize(sn+1),this.emplace(sn,re,we,je,Ke,ot,_t,Rt,Kt,nn)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn){var yn=10*re,fn=5*re;return this.int16[yn+0]=we,this.int16[yn+1]=je,this.int16[yn+2]=Ke,this.int16[yn+3]=ot,this.int16[yn+4]=_t,this.int16[yn+5]=Rt,this.uint32[fn+3]=Kt,this.uint16[yn+8]=nn,this.uint16[yn+9]=sn,re},G}(xi);C.prototype.bytesPerElement=20,Mi("StructArrayLayout6i1ul2ui20",C);var F=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,re,we,je,Ke,ot,_t)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt){var Kt=6*re;return this.int16[Kt+0]=we,this.int16[Kt+1]=je,this.int16[Kt+2]=Ke,this.int16[Kt+3]=ot,this.int16[Kt+4]=_t,this.int16[Kt+5]=Rt,re},G}(xi);F.prototype.bytesPerElement=12,Mi("StructArrayLayout2i2i2i12",F);var q=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot){var _t=this.length;return this.resize(_t+1),this.emplace(_t,re,we,je,Ke,ot)},G.prototype.emplace=function(re,we,je,Ke,ot,_t){var Rt=4*re,Kt=8*re;return this.float32[Rt+0]=we,this.float32[Rt+1]=je,this.float32[Rt+2]=Ke,this.int16[Kt+6]=ot,this.int16[Kt+7]=_t,re},G}(xi);q.prototype.bytesPerElement=16,Mi("StructArrayLayout2f1f2i16",q);var te=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke){var ot=this.length;return this.resize(ot+1),this.emplace(ot,re,we,je,Ke)},G.prototype.emplace=function(re,we,je,Ke,ot){var _t=12*re,Rt=3*re;return this.uint8[_t+0]=we,this.uint8[_t+1]=je,this.float32[Rt+1]=Ke,this.float32[Rt+2]=ot,re},G}(xi);te.prototype.bytesPerElement=12,Mi("StructArrayLayout2ub2f12",te);var ue=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=3*re;return this.uint16[ot+0]=we,this.uint16[ot+1]=je,this.uint16[ot+2]=Ke,re},G}(xi);ue.prototype.bytesPerElement=6,Mi("StructArrayLayout3ui6",ue);var ve=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.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)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr){var _r=this.length;return this.resize(_r+1),this.emplace(_r,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r){var Fr=24*re,Gr=12*re,qr=48*re;return this.int16[Fr+0]=we,this.int16[Fr+1]=je,this.uint16[Fr+2]=Ke,this.uint16[Fr+3]=ot,this.uint32[Gr+2]=_t,this.uint32[Gr+3]=Rt,this.uint32[Gr+4]=Kt,this.uint16[Fr+10]=nn,this.uint16[Fr+11]=sn,this.uint16[Fr+12]=yn,this.float32[Gr+7]=fn,this.float32[Gr+8]=On,this.uint8[qr+36]=jn,this.uint8[qr+37]=sr,this.uint8[qr+38]=ir,this.uint32[Gr+10]=kr,this.int16[Fr+22]=_r,re},G}(xi);ve.prototype.bytesPerElement=48,Mi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ve);var Ae=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.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)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r,Fr,Gr,qr,ri,ei,vi,Ei,aa,Ni,Qi){var qi=this.length;return this.resize(qi+1),this.emplace(qi,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r,Fr,Gr,qr,ri,ei,vi,Ei,aa,Ni,Qi)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r,Fr,Gr,qr,ri,ei,vi,Ei,aa,Ni,Qi,qi){var zi=34*re,Ea=17*re;return this.int16[zi+0]=we,this.int16[zi+1]=je,this.int16[zi+2]=Ke,this.int16[zi+3]=ot,this.int16[zi+4]=_t,this.int16[zi+5]=Rt,this.int16[zi+6]=Kt,this.int16[zi+7]=nn,this.uint16[zi+8]=sn,this.uint16[zi+9]=yn,this.uint16[zi+10]=fn,this.uint16[zi+11]=On,this.uint16[zi+12]=jn,this.uint16[zi+13]=sr,this.uint16[zi+14]=ir,this.uint16[zi+15]=kr,this.uint16[zi+16]=_r,this.uint16[zi+17]=Fr,this.uint16[zi+18]=Gr,this.uint16[zi+19]=qr,this.uint16[zi+20]=ri,this.uint16[zi+21]=ei,this.uint16[zi+22]=vi,this.uint32[Ea+12]=Ei,this.float32[Ea+13]=aa,this.float32[Ea+14]=Ni,this.float32[Ea+15]=Qi,this.float32[Ea+16]=qi,re},G}(xi);Ae.prototype.bytesPerElement=68,Mi("StructArrayLayout8i15ui1ul4f68",Ae);var Re=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re){var we=this.length;return this.resize(we+1),this.emplace(we,re)},G.prototype.emplace=function(re,we){var je=1*re;return this.float32[je+0]=we,re},G}(xi);Re.prototype.bytesPerElement=4,Mi("StructArrayLayout1f4",Re);var Ue=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=3*re;return this.int16[ot+0]=we,this.int16[ot+1]=je,this.int16[ot+2]=Ke,re},G}(xi);Ue.prototype.bytesPerElement=6,Mi("StructArrayLayout3i6",Ue);var it=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=2*re,_t=4*re;return this.uint32[ot+0]=we,this.uint16[_t+2]=je,this.uint16[_t+3]=Ke,re},G}(xi);it.prototype.bytesPerElement=8,Mi("StructArrayLayout1ul2ui8",it);var ct=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we){var je=this.length;return this.resize(je+1),this.emplace(je,re,we)},G.prototype.emplace=function(re,we,je){var Ke=2*re;return this.uint16[Ke+0]=we,this.uint16[Ke+1]=je,re},G}(xi);ct.prototype.bytesPerElement=4,Mi("StructArrayLayout2ui4",ct);var dt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re){var we=this.length;return this.resize(we+1),this.emplace(we,re)},G.prototype.emplace=function(re,we){var je=1*re;return this.uint16[je+0]=we,re},G}(xi);dt.prototype.bytesPerElement=2,Mi("StructArrayLayout1ui2",dt);var bt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke){var ot=this.length;return this.resize(ot+1),this.emplace(ot,re,we,je,Ke)},G.prototype.emplace=function(re,we,je,Ke,ot){var _t=4*re;return this.float32[_t+0]=we,this.float32[_t+1]=je,this.float32[_t+2]=Ke,this.float32[_t+3]=ot,re},G}(xi);bt.prototype.bytesPerElement=16,Mi("StructArrayLayout4f16",bt);var Ct=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={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 re.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},re.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},re.x1.get=function(){return this._structArray.int16[this._pos2+2]},re.y1.get=function(){return this._structArray.int16[this._pos2+3]},re.x2.get=function(){return this._structArray.int16[this._pos2+4]},re.y2.get=function(){return this._structArray.int16[this._pos2+5]},re.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},re.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},re.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},re.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(G.prototype,re),G}(Ai);Ct.prototype.size=20;var Mt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Ct(this,re)},G}(C);Mi("CollisionBoxArray",Mt);var Vt=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={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 re.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},re.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},re.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},re.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},re.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},re.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},re.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},re.segment.get=function(){return this._structArray.uint16[this._pos2+10]},re.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},re.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},re.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},re.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},re.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},re.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},re.placedOrientation.set=function(we){this._structArray.uint8[this._pos1+37]=we},re.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},re.hidden.set=function(we){this._structArray.uint8[this._pos1+38]=we},re.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},re.crossTileID.set=function(we){this._structArray.uint32[this._pos4+10]=we},re.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(G.prototype,re),G}(Ai);Vt.prototype.size=48;var It=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Vt(this,re)},G}(ve);Mi("PlacedSymbolArray",It);var Qt=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={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 re.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},re.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},re.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},re.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},re.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},re.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},re.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},re.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},re.key.get=function(){return this._structArray.uint16[this._pos2+8]},re.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},re.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},re.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},re.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},re.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},re.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},re.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},re.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},re.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},re.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},re.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},re.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},re.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},re.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},re.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},re.crossTileID.set=function(we){this._structArray.uint32[this._pos4+12]=we},re.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},re.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},re.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},re.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(G.prototype,re),G}(Ai);Qt.prototype.size=68;var tn=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Qt(this,re)},G}(Ae);Mi("SymbolInstanceArray",tn);var Yt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.getoffsetX=function(re){return this.float32[1*re+0]},G}(Re);Mi("GlyphOffsetArray",Yt);var vn=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.getx=function(re){return this.int16[3*re+0]},G.prototype.gety=function(re){return this.int16[3*re+1]},G.prototype.gettileUnitDistanceFromAnchor=function(re){return this.int16[3*re+2]},G}(Ue);Mi("SymbolLineVertexArray",vn);var Mn=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return re.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},re.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},re.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(G.prototype,re),G}(Ai);Mn.prototype.size=8;var Vn=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Mn(this,re)},G}(it);Mi("FeatureIndexArray",Vn);var Hn=xa([{name:"a_pos",components:2,type:"Int16"}],4).members,Xn=function(P){P===void 0&&(P=[]),this.segments=P};function rr(P,G){return 256*(P=h(Math.floor(P),0,255))+h(Math.floor(G),0,255)}Xn.prototype.prepareSegment=function(P,G,re,we){var je=this.segments[this.segments.length-1];return P>Xn.MAX_VERTEX_ARRAY_LENGTH&&I("Max vertices per segment is "+Xn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+P),(!je||je.vertexLength+P>Xn.MAX_VERTEX_ARRAY_LENGTH||je.sortKey!==we)&&(je={vertexOffset:G.length,primitiveOffset:re.length,vertexLength:0,primitiveLength:0},we!==void 0&&(je.sortKey=we),this.segments.push(je)),je},Xn.prototype.get=function(){return this.segments},Xn.prototype.destroy=function(){for(var P=0,G=this.segments;P>>16)*_t&65535)<<16)&4294967295)<<15|Kt>>>17))*Rt+(((Kt>>>16)*Rt&65535)<<16)&4294967295)<<13|Ke>>>19))+((5*(Ke>>>16)&65535)<<16)&4294967295))+((58964+(ot>>>16)&65535)<<16);switch(Kt=0,we){case 3:Kt^=(255&G.charCodeAt(nn+2))<<16;case 2:Kt^=(255&G.charCodeAt(nn+1))<<8;case 1:Ke^=Kt=(65535&(Kt=(Kt=(65535&(Kt^=255&G.charCodeAt(nn)))*_t+(((Kt>>>16)*_t&65535)<<16)&4294967295)<<15|Kt>>>17))*Rt+(((Kt>>>16)*Rt&65535)<<16)&4294967295}return Ke^=G.length,Ke=2246822507*(65535&(Ke^=Ke>>>16))+((2246822507*(Ke>>>16)&65535)<<16)&4294967295,Ke=3266489909*(65535&(Ke^=Ke>>>13))+((3266489909*(Ke>>>16)&65535)<<16)&4294967295,(Ke^=Ke>>>16)>>>0}}),Lr=w(function(P){P.exports=function(G,re){for(var we,je=G.length,Ke=re^je,ot=0;je>=4;)we=1540483477*(65535&(we=255&G.charCodeAt(ot)|(255&G.charCodeAt(++ot))<<8|(255&G.charCodeAt(++ot))<<16|(255&G.charCodeAt(++ot))<<24))+((1540483477*(we>>>16)&65535)<<16),Ke=1540483477*(65535&Ke)+((1540483477*(Ke>>>16)&65535)<<16)^(we=1540483477*(65535&(we^=we>>>24))+((1540483477*(we>>>16)&65535)<<16)),je-=4,++ot;switch(je){case 3:Ke^=(255&G.charCodeAt(ot+2))<<16;case 2:Ke^=(255&G.charCodeAt(ot+1))<<8;case 1:Ke=1540483477*(65535&(Ke^=255&G.charCodeAt(ot)))+((1540483477*(Ke>>>16)&65535)<<16)}return Ke=1540483477*(65535&(Ke^=Ke>>>13))+((1540483477*(Ke>>>16)&65535)<<16),(Ke^=Ke>>>15)>>>0}}),dr=nr,Br=nr,Sr=Lr;dr.murmur3=Br,dr.murmur2=Sr;var Vr=function(){this.ids=[],this.positions=[],this.indexed=!1};Vr.prototype.add=function(P,G,re,we){this.ids.push(Nr(P)),this.positions.push(G,re,we)},Vr.prototype.getPositions=function(P){for(var G=Nr(P),re=0,we=this.ids.length-1;re>1;this.ids[je]>=G?we=je:re=je+1}for(var Ke=[];this.ids[re]===G;){var ot=this.positions[3*re],_t=this.positions[3*re+1],Rt=this.positions[3*re+2];Ke.push({index:ot,start:_t,end:Rt}),re++}return Ke},Vr.serialize=function(P,G){var re=new Float64Array(P.ids),we=new Uint32Array(P.positions);return si(re,we,0,re.length-1),G&&G.push(re.buffer,we.buffer),{ids:re,positions:we}},Vr.deserialize=function(P){var G=new Vr;return G.ids=P.ids,G.positions=P.positions,G.indexed=!0,G};var fi=Math.pow(2,53)-1;function Nr(P){var G=+P;return!isNaN(G)&&G<=fi?G:dr(String(P))}function si(P,G,re,we){for(;re>1],Ke=re-1,ot=we+1;;){do Ke++;while(P[Ke]je);if(Ke>=ot)break;_i(P,Ke,ot),_i(G,3*Ke,3*ot),_i(G,3*Ke+1,3*ot+1),_i(G,3*Ke+2,3*ot+2)}ot-reot.x+1||Rtot.y+1)&&I("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return re}function ao(P,G){return{type:P.type,id:P.id,properties:P.properties,geometry:G?ll(P):[]}}function ul(P,G,re,we,je){P.emplaceBack(2*G+(we+1)/2,2*re+(je+1)/2)}var Lo=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new bu,this.indexArray=new ue,this.segments=new Xn,this.programConfigurations=new fa(P.layers,P.zoom),this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};function Bc(P,G){for(var re=0;re1){if(Cu(P,G))return!0;for(var we=0;we1?P.distSqr(re):P.distSqr(re.sub(G)._mult(je)._add(G))}function nf(P,G){for(var re,we,je,Ke=!1,ot=0;otG.y!=je.y>G.y&&G.x<(je.x-we.x)*(G.y-we.y)/(je.y-we.y)+we.x&&(Ke=!Ke);return Ke}function Xs(P,G){for(var re=!1,we=0,je=P.length-1;weG.y!=ot.y>G.y&&G.x<(ot.x-Ke.x)*(G.y-Ke.y)/(ot.y-Ke.y)+Ke.x&&(re=!re)}return re}function Ap(P,G,re){var we=re[0],je=re[2];if(P.xje.x&&G.x>je.x||P.yje.y&&G.y>je.y)return!1;var Ke=B(P,G,re[0]);return Ke!==B(P,G,re[1])||Ke!==B(P,G,re[2])||Ke!==B(P,G,re[3])}function Mc(P,G,re){var we=G.paint.get(P).value;return we.kind==="constant"?we.value:re.programConfigurations.get(G.id).getMaxValue(P)}function mc(P){return Math.sqrt(P[0]*P[0]+P[1]*P[1])}function oc(P,G,re,we,je){if(!G[0]&&!G[1])return P;var Ke=r.convert(G)._mult(je);re==="viewport"&&Ke._rotate(-we);for(var ot=[],_t=0;_t=Hi||nn<0||nn>=Hi)){var sn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,P.sortKey),yn=sn.vertexLength;ul(this.layoutVertexArray,Kt,nn,-1,-1),ul(this.layoutVertexArray,Kt,nn,1,-1),ul(this.layoutVertexArray,Kt,nn,1,1),ul(this.layoutVertexArray,Kt,nn,-1,1),this.indexArray.emplaceBack(yn,yn+1,yn+2),this.indexArray.emplaceBack(yn,yn+3,yn+2),sn.vertexLength+=4,sn.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,P,re,{},we)},Mi("CircleBucket",Lo,{omit:["layers"]});var Ih=new ho({"circle-sort-key":new Fi(et.layout_circle["circle-sort-key"])}),vc={paint:new ho({"circle-radius":new Fi(et.paint_circle["circle-radius"]),"circle-color":new Fi(et.paint_circle["circle-color"]),"circle-blur":new Fi(et.paint_circle["circle-blur"]),"circle-opacity":new Fi(et.paint_circle["circle-opacity"]),"circle-translate":new di(et.paint_circle["circle-translate"]),"circle-translate-anchor":new di(et.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new di(et.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new di(et.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Fi(et.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Fi(et.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Fi(et.paint_circle["circle-stroke-opacity"])}),layout:Ih},ps=typeof Float32Array<"u"?Float32Array:Array;function Sp(P){return P[0]=1,P[1]=0,P[2]=0,P[3]=0,P[4]=0,P[5]=1,P[6]=0,P[7]=0,P[8]=0,P[9]=0,P[10]=1,P[11]=0,P[12]=0,P[13]=0,P[14]=0,P[15]=1,P}function gd(P,G,re){var we=G[0],je=G[1],Ke=G[2],ot=G[3],_t=G[4],Rt=G[5],Kt=G[6],nn=G[7],sn=G[8],yn=G[9],fn=G[10],On=G[11],jn=G[12],sr=G[13],ir=G[14],kr=G[15],_r=re[0],Fr=re[1],Gr=re[2],qr=re[3];return P[0]=_r*we+Fr*_t+Gr*sn+qr*jn,P[1]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[2]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[3]=_r*ot+Fr*nn+Gr*On+qr*kr,_r=re[4],Fr=re[5],Gr=re[6],qr=re[7],P[4]=_r*we+Fr*_t+Gr*sn+qr*jn,P[5]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[6]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[7]=_r*ot+Fr*nn+Gr*On+qr*kr,_r=re[8],Fr=re[9],Gr=re[10],qr=re[11],P[8]=_r*we+Fr*_t+Gr*sn+qr*jn,P[9]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[10]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[11]=_r*ot+Fr*nn+Gr*On+qr*kr,_r=re[12],Fr=re[13],Gr=re[14],qr=re[15],P[12]=_r*we+Fr*_t+Gr*sn+qr*jn,P[13]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[14]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[15]=_r*ot+Fr*nn+Gr*On+qr*kr,P}Math.hypot||(Math.hypot=function(){for(var P=arguments,G=0,re=arguments.length;re--;)G+=P[re]*P[re];return Math.sqrt(G)});var Ss=gd,Ef,md=function(P,G,re){return P[0]=G[0]-re[0],P[1]=G[1]-re[1],P[2]=G[2]-re[2],P};function eh(P,G,re){var we=G[0],je=G[1],Ke=G[2],ot=G[3];return P[0]=re[0]*we+re[4]*je+re[8]*Ke+re[12]*ot,P[1]=re[1]*we+re[5]*je+re[9]*Ke+re[13]*ot,P[2]=re[2]*we+re[6]*je+re[10]*Ke+re[14]*ot,P[3]=re[3]*we+re[7]*je+re[11]*Ke+re[15]*ot,P}Ef=new ps(3),ps!=Float32Array&&(Ef[0]=0,Ef[1]=0,Ef[2]=0),function(){var P=new ps(4);ps!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0,P[3]=0)}();var Ph=function(P){var G=P[0],re=P[1];return G*G+re*re},ep=(function(){var P=new ps(2);ps!=Float32Array&&(P[0]=0,P[1]=0)}(),function(P){function G(re){P.call(this,re,vc)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.createBucket=function(re){return new Lo(re)},G.prototype.queryRadius=function(re){var we=re;return Mc("circle-radius",this,we)+Mc("circle-stroke-width",this,we)+mc(this.paint.get("circle-translate"))},G.prototype.queryIntersectsFeature=function(re,we,je,Ke,ot,_t,Rt,Kt){for(var nn=oc(re,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),_t.angle,Rt),sn=this.paint.get("circle-radius").evaluate(we,je)+this.paint.get("circle-stroke-width").evaluate(we,je),yn=this.paint.get("circle-pitch-alignment")==="map",fn=yn?nn:function(ri,ei){return ri.map(function(vi){return th(vi,ei)})}(nn,Kt),On=yn?sn*Rt:sn,jn=0,sr=Ke;jnP.width||je.height>P.height||re.x>P.width-je.width||re.y>P.height-je.height)throw new RangeError("out of range source coordinates for image copy");if(je.width>G.width||je.height>G.height||we.x>G.width-je.width||we.y>G.height-je.height)throw new RangeError("out of range destination coordinates for image copy");for(var ot=P.data,_t=G.data,Rt=0;Rt80*re){we=Ke=P[0],je=ot=P[1];for(var On=re;OnKe&&(Ke=_t),Rt>ot&&(ot=Rt);Kt=(Kt=Math.max(Ke-we,ot-je))!==0?1/Kt:0}return Ks(yn,fn,re,we,je,Kt),fn}function P0(P,G,re,we,je){var Ke,ot;if(je===Cp(P,G,re,we)>0)for(Ke=G;Ke=G;Ke-=we)ot=sc(Ke,P[Ke],P[Ke+1],ot);return ot&&of(ot,ot.next)&&(lf(ot),ot=ot.next),ot}function rf(P,G){if(!P)return P;G||(G=P);var re,we=P;do if(re=!1,we.steiner||!of(we,we.next)&&Ms(we.prev,we,we.next)!==0)we=we.next;else{if(lf(we),(we=G=we.prev)===we.next)break;re=!0}while(re||we!==G);return G}function Ks(P,G,re,we,je,Ke,ot){if(P){!ot&&Ke&&function(nn,sn,yn,fn){var On=nn;do On.z===null&&(On.z=Pf(On.x,On.y,sn,yn,fn)),On.prevZ=On.prev,On.nextZ=On.next,On=On.next;while(On!==nn);On.prevZ.nextZ=null,On.prevZ=null,function(jn){var sr,ir,kr,_r,Fr,Gr,qr,ri,ei=1;do{for(ir=jn,jn=null,Fr=null,Gr=0;ir;){for(Gr++,kr=ir,qr=0,sr=0;sr0||ri>0&&kr;)qr!==0&&(ri===0||!kr||ir.z<=kr.z)?(_r=ir,ir=ir.nextZ,qr--):(_r=kr,kr=kr.nextZ,ri--),Fr?Fr.nextZ=_r:jn=_r,_r.prevZ=Fr,Fr=_r;ir=kr}Fr.nextZ=null,ei*=2}while(Gr>1)}(On)}(P,we,je,Ke);for(var _t,Rt,Kt=P;P.prev!==P.next;)if(_t=P.prev,Rt=P.next,Ke?xd(P,we,je,Ke):rh(P))G.push(_t.i/re),G.push(P.i/re),G.push(Rt.i/re),lf(P),P=Rt.next,Kt=Rt.next;else if((P=Rt)===Kt){ot?ot===1?Ks(P=L0(rf(P),G,re),G,re,we,je,Ke,2):ot===2&&xv(P,G,re,we,je,Ke):Ks(rf(P),G,re,we,je,Ke,1);break}}}function rh(P){var G=P.prev,re=P,we=P.next;if(Ms(G,re,we)>=0)return!1;for(var je=P.next.next;je!==P.prev;){if(Lf(G.x,G.y,re.x,re.y,we.x,we.y,je.x,je.y)&&Ms(je.prev,je,je.next)>=0)return!1;je=je.next}return!0}function xd(P,G,re,we){var je=P.prev,Ke=P,ot=P.next;if(Ms(je,Ke,ot)>=0)return!1;for(var _t=je.xKe.x?je.x>ot.x?je.x:ot.x:Ke.x>ot.x?Ke.x:ot.x,nn=je.y>Ke.y?je.y>ot.y?je.y:ot.y:Ke.y>ot.y?Ke.y:ot.y,sn=Pf(_t,Rt,G,re,we),yn=Pf(Kt,nn,G,re,we),fn=P.prevZ,On=P.nextZ;fn&&fn.z>=sn&&On&&On.z<=yn;){if(fn!==P.prev&&fn!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,fn.x,fn.y)&&Ms(fn.prev,fn,fn.next)>=0||(fn=fn.prevZ,On!==P.prev&&On!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,On.x,On.y)&&Ms(On.prev,On,On.next)>=0))return!1;On=On.nextZ}for(;fn&&fn.z>=sn;){if(fn!==P.prev&&fn!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,fn.x,fn.y)&&Ms(fn.prev,fn,fn.next)>=0)return!1;fn=fn.prevZ}for(;On&&On.z<=yn;){if(On!==P.prev&&On!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,On.x,On.y)&&Ms(On.prev,On,On.next)>=0)return!1;On=On.nextZ}return!0}function L0(P,G,re){var we=P;do{var je=we.prev,Ke=we.next.next;!of(je,Ke)&&_d(je,we,we.next,Ke)&&sf(je,Ke)&&sf(Ke,je)&&(G.push(je.i/re),G.push(we.i/re),G.push(Ke.i/re),lf(we),lf(we.next),we=P=Ke),we=we.next}while(we!==P);return rf(we)}function xv(P,G,re,we,je,Ke){var ot=P;do{for(var _t=ot.next.next;_t!==ot.prev;){if(ot.i!==_t.i&&Mp(ot,_t)){var Rt=zh(ot,_t);return ot=rf(ot,ot.next),Rt=rf(Rt,Rt.next),Ks(ot,G,re,we,je,Ke),void Ks(Rt,G,re,we,je,Ke)}_t=_t.next}ot=ot.next}while(ot!==P)}function Vg(P,G){return P.x-G.x}function np(P,G){if(G=function(we,je){var Ke,ot=je,_t=we.x,Rt=we.y,Kt=-1/0;do{if(Rt<=ot.y&&Rt>=ot.next.y&&ot.next.y!==ot.y){var nn=ot.x+(Rt-ot.y)*(ot.next.x-ot.x)/(ot.next.y-ot.y);if(nn<=_t&&nn>Kt){if(Kt=nn,nn===_t){if(Rt===ot.y)return ot;if(Rt===ot.next.y)return ot.next}Ke=ot.x=ot.x&&ot.x>=fn&&_t!==ot.x&&Lf(RtKe.x||ot.x===Ke.x&&af(Ke,ot)))&&(Ke=ot,jn=sn)),ot=ot.next;while(ot!==yn);return Ke}(P,G)){var re=zh(G,P);rf(G,G.next),rf(re,re.next)}}function af(P,G){return Ms(P.prev,P,G.prev)<0&&Ms(G.next,P,P.next)<0}function Pf(P,G,re,we,je){return(P=1431655765&((P=858993459&((P=252645135&((P=16711935&((P=32767*(P-re)*je)|P<<8))|P<<4))|P<<2))|P<<1))|(G=1431655765&((G=858993459&((G=252645135&((G=16711935&((G=32767*(G-we)*je)|G<<8))|G<<4))|G<<2))|G<<1))<<1}function qg(P){var G=P,re=P;do(G.x=0&&(P-ot)*(we-_t)-(re-ot)*(G-_t)>=0&&(re-ot)*(Ke-_t)-(je-ot)*(we-_t)>=0}function Mp(P,G){return P.next.i!==G.i&&P.prev.i!==G.i&&!function(re,we){var je=re;do{if(je.i!==re.i&&je.next.i!==re.i&&je.i!==we.i&&je.next.i!==we.i&&_d(je,je.next,re,we))return!0;je=je.next}while(je!==re);return!1}(P,G)&&(sf(P,G)&&sf(G,P)&&function(re,we){var je=re,Ke=!1,ot=(re.x+we.x)/2,_t=(re.y+we.y)/2;do je.y>_t!=je.next.y>_t&&je.next.y!==je.y&&ot<(je.next.x-je.x)*(_t-je.y)/(je.next.y-je.y)+je.x&&(Ke=!Ke),je=je.next;while(je!==re);return Ke}(P,G)&&(Ms(P.prev,P,G.prev)||Ms(P,G.prev,G))||of(P,G)&&Ms(P.prev,P,P.next)>0&&Ms(G.prev,G,G.next)>0)}function Ms(P,G,re){return(G.y-P.y)*(re.x-G.x)-(G.x-P.x)*(re.y-G.y)}function of(P,G){return P.x===G.x&&P.y===G.y}function _d(P,G,re,we){var je=Ep(Ms(P,G,re)),Ke=Ep(Ms(P,G,we)),ot=Ep(Ms(re,we,P)),_t=Ep(Ms(re,we,G));return je!==Ke&&ot!==_t||!(je!==0||!Lh(P,re,G))||!(Ke!==0||!Lh(P,we,G))||!(ot!==0||!Lh(re,P,we))||!(_t!==0||!Lh(re,G,we))}function Lh(P,G,re){return G.x<=Math.max(P.x,re.x)&&G.x>=Math.min(P.x,re.x)&&G.y<=Math.max(P.y,re.y)&&G.y>=Math.min(P.y,re.y)}function Ep(P){return P>0?1:P<0?-1:0}function sf(P,G){return Ms(P.prev,P,P.next)<0?Ms(P,G,P.next)>=0&&Ms(P,P.prev,G)>=0:Ms(P,G,P.prev)<0||Ms(P,P.next,G)<0}function zh(P,G){var re=new z0(P.i,P.x,P.y),we=new z0(G.i,G.x,G.y),je=P.next,Ke=G.prev;return P.next=G,G.prev=P,re.next=je,je.prev=re,we.next=re,re.prev=we,Ke.next=we,we.prev=Ke,we}function sc(P,G,re,we){var je=new z0(P,G,re);return we?(je.next=we.next,je.prev=we,we.next.prev=je,we.next=je):(je.prev=je,je.next=je),je}function lf(P){P.next.prev=P.prev,P.prev.next=P.next,P.prevZ&&(P.prevZ.nextZ=P.nextZ),P.nextZ&&(P.nextZ.prevZ=P.prevZ)}function z0(P,G,re){this.i=P,this.x=G,this.y=re,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cp(P,G,re,we){for(var je=0,Ke=G,ot=re-we;Kere;){if(we-re>600){var Ke=we-re+1,ot=G-re+1,_t=Math.log(Ke),Rt=.5*Math.exp(2*_t/3),Kt=.5*Math.sqrt(_t*Rt*(Ke-Rt)/Ke)*(ot-Ke/2<0?-1:1);O0(P,G,Math.max(re,Math.floor(G-ot*Rt/Ke+Kt)),Math.min(we,Math.floor(G+(Ke-ot)*Rt/Ke+Kt)),je)}var nn=P[G],sn=re,yn=we;for(rp(P,re,G),je(P[we],nn)>0&&rp(P,re,we);sn0;)yn--}je(P[re],nn)===0?rp(P,re,yn):rp(P,++yn,we),yn<=G&&(re=yn+1),G<=yn&&(we=yn-1)}}function rp(P,G,re){var we=P[G];P[G]=P[re],P[re]=we}function _v(P,G){return PG?1:0}function D0(P,G){var re=P.length;if(re<=1)return[P];for(var we,je,Ke=[],ot=0;ot1)for(var Rt=0;Rt0&&(we+=P[je-1].length,re.holes.push(we))}return re},If.default=Iu;var lu=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=P.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bu,this.indexArray=new ue,this.indexArray2=new ct,this.programConfigurations=new fa(P.layers,P.zoom),this.segments=new Xn,this.segments2=new Xn,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};lu.prototype.populate=function(P,G,re){this.hasPattern=bd("fill",this.layers,G);for(var we=this.layers[0].layout.get("fill-sort-key"),je=[],Ke=0,ot=P;Ke>3}if(je--,we===1||we===2)Ke+=P.readSVarint(),ot+=P.readSVarint(),we===1&&(G&&_t.push(G),G=[]),G.push(new r(Ke,ot));else{if(we!==7)throw new Error("unknown command "+we);G&&G.push(G[0].clone())}}return G&&_t.push(G),_t},Dh.prototype.bbox=function(){var P=this._pbf;P.pos=this._geometry;for(var G=P.readVarint()+P.pos,re=1,we=0,je=0,Ke=0,ot=1/0,_t=-1/0,Rt=1/0,Kt=-1/0;P.pos>3}if(we--,re===1||re===2)(je+=P.readSVarint())_t&&(_t=je),(Ke+=P.readSVarint())Kt&&(Kt=Ke);else if(re!==7)throw new Error("unknown command "+re)}return[ot,Rt,_t,Kt]},Dh.prototype.toGeoJSON=function(P,G,re){var we,je,Ke=this.extent*Math.pow(2,re),ot=this.extent*P,_t=this.extent*G,Rt=this.loadGeometry(),Kt=Dh.types[this.type];function nn(fn){for(var On=0;On>3;je=ot===1?we.readString():ot===2?we.readFloat():ot===3?we.readDouble():ot===4?we.readVarint64():ot===5?we.readVarint():ot===6?we.readSVarint():ot===7?we.readBoolean():null}return je}(re))}function Wu(P,G,re){if(P===3){var we=new Td(re,re.readVarint()+re.pos);we.length&&(G[we.name]=we)}}kd.prototype.feature=function(P){if(P<0||P>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[P];var G=this._pbf.readVarint()+this._pbf.pos;return new ma(this._pbf,G,this.extent,this._keys,this._values)};var ts={VectorTile:function(P,G){this.layers=P.readFields(Wu,{},G)},VectorTileFeature:ma,VectorTileLayer:Td},Ad=ts.VectorTileFeature.types,Ip=Math.pow(2,13);function uf(P,G,re,we,je,Ke,ot,_t){P.emplaceBack(G,re,2*Math.floor(we*Ip)+ot,je*Ip*2,Ke*Ip*2,Math.round(_t))}var lc=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new xt,this.indexArray=new ue,this.programConfigurations=new fa(P.layers,P.zoom),this.segments=new Xn,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};function Pp(P,G){return P.x===G.x&&(P.x<0||P.x>Hi)||P.y===G.y&&(P.y<0||P.y>Hi)}lc.prototype.populate=function(P,G,re){this.features=[],this.hasPattern=bd("fill-extrusion",this.layers,G);for(var we=0,je=P;weHi})||Ea.every(function(va){return va.y<0})||Ea.every(function(va){return va.y>Hi})))for(var jn=0,sr=0;sr=1){var kr=On[sr-1];if(!Pp(ir,kr)){sn.vertexLength+4>Xn.MAX_VERTEX_ARRAY_LENGTH&&(sn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _r=ir.sub(kr)._perp()._unit(),Fr=kr.dist(ir);jn+Fr>32768&&(jn=0),uf(this.layoutVertexArray,ir.x,ir.y,_r.x,_r.y,0,0,jn),uf(this.layoutVertexArray,ir.x,ir.y,_r.x,_r.y,0,1,jn),jn+=Fr,uf(this.layoutVertexArray,kr.x,kr.y,_r.x,_r.y,0,0,jn),uf(this.layoutVertexArray,kr.x,kr.y,_r.x,_r.y,0,1,jn);var Gr=sn.vertexLength;this.indexArray.emplaceBack(Gr,Gr+2,Gr+1),this.indexArray.emplaceBack(Gr+1,Gr+2,Gr+3),sn.vertexLength+=4,sn.primitiveLength+=2}}}}if(sn.vertexLength+Rt>Xn.MAX_VERTEX_ARRAY_LENGTH&&(sn=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),Ad[P.type]==="Polygon"){for(var qr=[],ri=[],ei=sn.vertexLength,vi=0,Ei=_t;vi=2&&P[Rt-1].equals(P[Rt-2]);)Rt--;for(var Kt=0;Kt0;if(ri&&ir>Kt){var vi=nn.dist(fn);if(vi>2*sn){var Ei=nn.sub(nn.sub(fn)._mult(sn/vi)._round());this.updateDistance(fn,Ei),this.addCurrentVertex(Ei,jn,0,0,yn),fn=Ei}}var aa=fn&&On,Ni=aa?re:_t?"butt":we;if(aa&&Ni==="round"&&(Grje&&(Ni="bevel"),Ni==="bevel"&&(Gr>2&&(Ni="flipbevel"),Gr100)kr=sr.mult(-1);else{var Qi=Gr*jn.add(sr).mag()/jn.sub(sr).mag();kr._perp()._mult(Qi*(ei?-1:1))}this.addCurrentVertex(nn,kr,0,0,yn),this.addCurrentVertex(nn,kr.mult(-1),0,0,yn)}else if(Ni==="bevel"||Ni==="fakeround"){var qi=-Math.sqrt(Gr*Gr-1),zi=ei?qi:0,Ea=ei?0:qi;if(fn&&this.addCurrentVertex(nn,jn,zi,Ea,yn),Ni==="fakeround")for(var va=Math.round(180*qr/Math.PI/20),yo=1;yo2*sn){var xo=nn.add(On.sub(nn)._mult(sn/Eo)._round());this.updateDistance(nn,xo),this.addCurrentVertex(xo,sr,0,0,yn),nn=xo}}}}},Ll.prototype.addCurrentVertex=function(P,G,re,we,je,Ke){Ke===void 0&&(Ke=!1);var ot=G.x+G.y*re,_t=G.y-G.x*re,Rt=-G.x+G.y*we,Kt=-G.y-G.x*we;this.addHalfVertex(P,ot,_t,Ke,!1,re,je),this.addHalfVertex(P,Rt,Kt,Ke,!0,-we,je),this.distance>N0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(P,G,re,we,je,Ke))},Ll.prototype.addHalfVertex=function(P,G,re,we,je,Ke,ot){var _t=P.x,Rt=P.y,Kt=.5*(this.lineClips?this.scaledDistance*(N0-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((_t<<1)+(we?1:0),(Rt<<1)+(je?1:0),Math.round(63*G)+128,Math.round(63*re)+128,1+(Ke===0?0:Ke<0?-1:1)|(63&Kt)<<2,Kt>>6),this.lineClips){var nn=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(nn,this.lineClipsArray.length)}var sn=ot.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,sn),ot.primitiveLength++),je?this.e2=sn:this.e1=sn},Ll.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ll.prototype.updateDistance=function(P,G){this.distance+=P.dist(G),this.updateScaledDistance()},Mi("LineBucket",Ll,{omit:["layers","patternFeatures"]});var Zg=new ho({"line-cap":new di(et.layout_line["line-cap"]),"line-join":new Fi(et.layout_line["line-join"]),"line-miter-limit":new di(et.layout_line["line-miter-limit"]),"line-round-limit":new di(et.layout_line["line-round-limit"]),"line-sort-key":new Fi(et.layout_line["line-sort-key"])}),j0={paint:new ho({"line-opacity":new Fi(et.paint_line["line-opacity"]),"line-color":new Fi(et.paint_line["line-color"]),"line-translate":new di(et.paint_line["line-translate"]),"line-translate-anchor":new di(et.paint_line["line-translate-anchor"]),"line-width":new Fi(et.paint_line["line-width"]),"line-gap-width":new Fi(et.paint_line["line-gap-width"]),"line-offset":new Fi(et.paint_line["line-offset"]),"line-blur":new Fi(et.paint_line["line-blur"]),"line-dasharray":new Il(et.paint_line["line-dasharray"]),"line-pattern":new Mo(et.paint_line["line-pattern"]),"line-gradient":new su(et.paint_line["line-gradient"])}),layout:Zg},bv=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.possiblyEvaluate=function(re,we){return we=new za(Math.floor(we.zoom),{now:we.now,fadeDuration:we.fadeDuration,zoomHistory:we.zoomHistory,transition:we.transition}),P.prototype.possiblyEvaluate.call(this,re,we)},G.prototype.evaluate=function(re,we,je,Ke){return we=m({},we,{zoom:Math.floor(we.zoom)}),P.prototype.evaluate.call(this,re,we,je,Ke)},G}(Fi),$g=new bv(j0.paint.properties["line-width"].specification);$g.useIntegerZoom=!0;var ey=function(P){function G(re){P.call(this,re,j0),this.gradientVersion=0}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._handleSpecialPaintPropertyUpdate=function(re){if(re==="line-gradient"){var we=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=we._styleExpression.expression instanceof Ti,this.gradientVersion=(this.gradientVersion+1)%o}},G.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},G.prototype.recalculate=function(re,we){P.prototype.recalculate.call(this,re,we),this.paint._values["line-floorwidth"]=$g.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,re)},G.prototype.createBucket=function(re){return new Ll(re)},G.prototype.queryRadius=function(re){var we=re,je=wv(Mc("line-width",this,we),Mc("line-gap-width",this,we)),Ke=Mc("line-offset",this,we);return je/2+Math.abs(Ke)+mc(this.paint.get("line-translate"))},G.prototype.queryIntersectsFeature=function(re,we,je,Ke,ot,_t,Rt){var Kt=oc(re,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),_t.angle,Rt),nn=Rt/2*wv(this.paint.get("line-width").evaluate(we,je),this.paint.get("line-gap-width").evaluate(we,je)),sn=this.paint.get("line-offset").evaluate(we,je);return sn&&(Ke=function(yn,fn){for(var On=[],jn=new r(0,0),sr=0;sr=3){for(var ir=0;ir0?G+2*P:P}var Rh=xa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Yg=xa([{name:"a_projected_pos",components:3,type:"Float32"}],4),Xg=(xa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),xa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Fh=(xa([{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"}]),xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Kg=xa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Op(P,G,re){return P.sections.forEach(function(we){we.text=function(je,Ke,ot){var _t=Ke.layout.get("text-transform").evaluate(ot,{});return _t==="uppercase"?je=je.toLocaleUpperCase():_t==="lowercase"&&(je=je.toLocaleLowerCase()),Io.applyArabicShaping&&(je=Io.applyArabicShaping(je)),je}(we.text,G,re)}),P}xa([{name:"triangle",components:3,type:"Uint16"}]),xa([{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"}]),xa([{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"}]),xa([{type:"Float32",name:"offsetX"}]),xa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Rf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},cl=24,Sd=function(P,G,re,we,je){var Ke,ot,_t=8*je-we-1,Rt=(1<<_t)-1,Kt=Rt>>1,nn=-7,sn=re?je-1:0,yn=re?-1:1,fn=P[G+sn];for(sn+=yn,Ke=fn&(1<<-nn)-1,fn>>=-nn,nn+=_t;nn>0;Ke=256*Ke+P[G+sn],sn+=yn,nn-=8);for(ot=Ke&(1<<-nn)-1,Ke>>=-nn,nn+=we;nn>0;ot=256*ot+P[G+sn],sn+=yn,nn-=8);if(Ke===0)Ke=1-Kt;else{if(Ke===Rt)return ot?NaN:1/0*(fn?-1:1);ot+=Math.pow(2,we),Ke-=Kt}return(fn?-1:1)*ot*Math.pow(2,Ke-we)},Dp=function(P,G,re,we,je,Ke){var ot,_t,Rt,Kt=8*Ke-je-1,nn=(1<>1,yn=je===23?Math.pow(2,-24)-Math.pow(2,-77):0,fn=we?0:Ke-1,On=we?1:-1,jn=G<0||G===0&&1/G<0?1:0;for(G=Math.abs(G),isNaN(G)||G===1/0?(_t=isNaN(G)?1:0,ot=nn):(ot=Math.floor(Math.log(G)/Math.LN2),G*(Rt=Math.pow(2,-ot))<1&&(ot--,Rt*=2),(G+=ot+sn>=1?yn/Rt:yn*Math.pow(2,1-sn))*Rt>=2&&(ot++,Rt/=2),ot+sn>=nn?(_t=0,ot=nn):ot+sn>=1?(_t=(G*Rt-1)*Math.pow(2,je),ot+=sn):(_t=G*Math.pow(2,sn-1)*Math.pow(2,je),ot=0));je>=8;P[re+fn]=255&_t,fn+=On,_t/=256,je-=8);for(ot=ot<0;P[re+fn]=255&ot,fn+=On,ot/=256,Kt-=8);P[re+fn-On]|=128*jn},Rp=Ga;function Ga(P){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(P)?P:new Uint8Array(P||0),this.pos=0,this.type=0,this.length=this.buf.length}Ga.Varint=0,Ga.Fixed64=1,Ga.Bytes=2,Ga.Fixed32=5;var Bh=4294967296,Jg=1/Bh,Fp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ec(P){return P.type===Ga.Bytes?P.readVarint()+P.pos:P.pos+1}function cf(P,G,re){return re?4294967296*G+(P>>>0):4294967296*(G>>>0)+(P>>>0)}function Qg(P,G,re){var we=G<=16383?1:G<=2097151?2:G<=268435455?3:Math.floor(Math.log(G)/(7*Math.LN2));re.realloc(we);for(var je=re.pos-1;je>=P;je--)re.buf[je+we]=re.buf[je]}function Tv(P,G){for(var re=0;re>>8,P[re+2]=G>>>16,P[re+3]=G>>>24}function nm(P,G){return(P[G]|P[G+1]<<8|P[G+2]<<16)+(P[G+3]<<24)}Ga.prototype={destroy:function(){this.buf=null},readFields:function(P,G,re){for(re=re||this.length;this.pos>3,Ke=this.pos;this.type=7&we,P(je,G,this),this.pos===Ke&&this.skip(we)}return G},readMessage:function(P,G){return this.readFields(P,G,this.readVarint()+this.pos)},readFixed32:function(){var P=Md(this.buf,this.pos);return this.pos+=4,P},readSFixed32:function(){var P=nm(this.buf,this.pos);return this.pos+=4,P},readFixed64:function(){var P=Md(this.buf,this.pos)+Md(this.buf,this.pos+4)*Bh;return this.pos+=8,P},readSFixed64:function(){var P=Md(this.buf,this.pos)+nm(this.buf,this.pos+4)*Bh;return this.pos+=8,P},readFloat:function(){var P=Sd(this.buf,this.pos,!0,23,4);return this.pos+=4,P},readDouble:function(){var P=Sd(this.buf,this.pos,!0,52,8);return this.pos+=8,P},readVarint:function(P){var G,re,we=this.buf;return G=127&(re=we[this.pos++]),re<128?G:(G|=(127&(re=we[this.pos++]))<<7,re<128?G:(G|=(127&(re=we[this.pos++]))<<14,re<128?G:(G|=(127&(re=we[this.pos++]))<<21,re<128?G:function(je,Ke,ot){var _t,Rt,Kt=ot.buf;if(_t=(112&(Rt=Kt[ot.pos++]))>>4,Rt<128||(_t|=(127&(Rt=Kt[ot.pos++]))<<3,Rt<128)||(_t|=(127&(Rt=Kt[ot.pos++]))<<10,Rt<128)||(_t|=(127&(Rt=Kt[ot.pos++]))<<17,Rt<128)||(_t|=(127&(Rt=Kt[ot.pos++]))<<24,Rt<128)||(_t|=(1&(Rt=Kt[ot.pos++]))<<31,Rt<128))return cf(je,_t,Ke);throw new Error("Expected varint not more than 10 bytes")}(G|=(15&(re=we[this.pos]))<<28,P,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var P=this.readVarint();return P%2==1?(P+1)/-2:P/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var P=this.readVarint()+this.pos,G=this.pos;return this.pos=P,P-G>=12&&Fp?function(re,we,je){return Fp.decode(re.subarray(we,je))}(this.buf,G,P):function(re,we,je){for(var Ke="",ot=we;ot239?4:nn>223?3:nn>191?2:1;if(ot+yn>je)break;yn===1?nn<128&&(sn=nn):yn===2?(192&(_t=re[ot+1]))==128&&(sn=(31&nn)<<6|63&_t)<=127&&(sn=null):yn===3?(_t=re[ot+1],Rt=re[ot+2],(192&_t)==128&&(192&Rt)==128&&((sn=(15&nn)<<12|(63&_t)<<6|63&Rt)<=2047||sn>=55296&&sn<=57343)&&(sn=null)):yn===4&&(_t=re[ot+1],Rt=re[ot+2],Kt=re[ot+3],(192&_t)==128&&(192&Rt)==128&&(192&Kt)==128&&((sn=(15&nn)<<18|(63&_t)<<12|(63&Rt)<<6|63&Kt)<=65535||sn>=1114112)&&(sn=null)),sn===null?(sn=65533,yn=1):sn>65535&&(sn-=65536,Ke+=String.fromCharCode(sn>>>10&1023|55296),sn=56320|1023&sn),Ke+=String.fromCharCode(sn),ot+=yn}return Ke}(this.buf,G,P)},readBytes:function(){var P=this.readVarint()+this.pos,G=this.buf.subarray(this.pos,P);return this.pos=P,G},readPackedVarint:function(P,G){if(this.type!==Ga.Bytes)return P.push(this.readVarint(G));var re=Ec(this);for(P=P||[];this.pos127;);else if(G===Ga.Bytes)this.pos=this.readVarint()+this.pos;else if(G===Ga.Fixed32)this.pos+=4;else{if(G!==Ga.Fixed64)throw new Error("Unimplemented type: "+G);this.pos+=8}},writeTag:function(P,G){this.writeVarint(P<<3|G)},realloc:function(P){for(var G=this.length||16;G268435455||P<0?function(G,re){var we,je;if(G>=0?(we=G%4294967296|0,je=G/4294967296|0):(je=~(-G/4294967296),4294967295^(we=~(-G%4294967296))?we=we+1|0:(we=0,je=je+1|0)),G>=18446744073709552e3||G<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");re.realloc(10),function(Ke,ot,_t){_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos]=127&Ke}(we,0,re),function(Ke,ot){var _t=(7&Ke)<<4;ot.buf[ot.pos++]|=_t|((Ke>>>=3)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke)))))}(je,re)}(P,this):(this.realloc(4),this.buf[this.pos++]=127&P|(P>127?128:0),P<=127||(this.buf[this.pos++]=127&(P>>>=7)|(P>127?128:0),P<=127||(this.buf[this.pos++]=127&(P>>>=7)|(P>127?128:0),P<=127||(this.buf[this.pos++]=P>>>7&127))))},writeSVarint:function(P){this.writeVarint(P<0?2*-P-1:2*P)},writeBoolean:function(P){this.writeVarint(!!P)},writeString:function(P){P=String(P),this.realloc(4*P.length),this.pos++;var G=this.pos;this.pos=function(we,je,Ke){for(var ot,_t,Rt=0;Rt55295&&ot<57344){if(!_t){ot>56319||Rt+1===je.length?(we[Ke++]=239,we[Ke++]=191,we[Ke++]=189):_t=ot;continue}if(ot<56320){we[Ke++]=239,we[Ke++]=191,we[Ke++]=189,_t=ot;continue}ot=_t-55296<<10|ot-56320|65536,_t=null}else _t&&(we[Ke++]=239,we[Ke++]=191,we[Ke++]=189,_t=null);ot<128?we[Ke++]=ot:(ot<2048?we[Ke++]=ot>>6|192:(ot<65536?we[Ke++]=ot>>12|224:(we[Ke++]=ot>>18|240,we[Ke++]=ot>>12&63|128),we[Ke++]=ot>>6&63|128),we[Ke++]=63&ot|128)}return Ke}(this.buf,P,this.pos);var re=this.pos-G;re>=128&&Qg(G,re,this),this.pos=G-1,this.writeVarint(re),this.pos+=re},writeFloat:function(P){this.realloc(4),Dp(this.buf,P,this.pos,!0,23,4),this.pos+=4},writeDouble:function(P){this.realloc(8),Dp(this.buf,P,this.pos,!0,52,8),this.pos+=8},writeBytes:function(P){var G=P.length;this.writeVarint(G),this.realloc(G);for(var re=0;re=128&&Qg(re,we,this),this.pos=re-1,this.writeVarint(we),this.pos+=we},writeMessage:function(P,G,re){this.writeTag(P,Ga.Bytes),this.writeRawMessage(G,re)},writePackedVarint:function(P,G){G.length&&this.writeMessage(P,Tv,G)},writePackedSVarint:function(P,G){G.length&&this.writeMessage(P,em,G)},writePackedBoolean:function(P,G){G.length&&this.writeMessage(P,Bp,G)},writePackedFloat:function(P,G){G.length&&this.writeMessage(P,kv,G)},writePackedDouble:function(P,G){G.length&&this.writeMessage(P,Av,G)},writePackedFixed32:function(P,G){G.length&&this.writeMessage(P,tm,G)},writePackedSFixed32:function(P,G){G.length&&this.writeMessage(P,Sv,G)},writePackedFixed64:function(P,G){G.length&&this.writeMessage(P,Mv,G)},writePackedSFixed64:function(P,G){G.length&&this.writeMessage(P,Ev,G)},writeBytesField:function(P,G){this.writeTag(P,Ga.Bytes),this.writeBytes(G)},writeFixed32Field:function(P,G){this.writeTag(P,Ga.Fixed32),this.writeFixed32(G)},writeSFixed32Field:function(P,G){this.writeTag(P,Ga.Fixed32),this.writeSFixed32(G)},writeFixed64Field:function(P,G){this.writeTag(P,Ga.Fixed64),this.writeFixed64(G)},writeSFixed64Field:function(P,G){this.writeTag(P,Ga.Fixed64),this.writeSFixed64(G)},writeVarintField:function(P,G){this.writeTag(P,Ga.Varint),this.writeVarint(G)},writeSVarintField:function(P,G){this.writeTag(P,Ga.Varint),this.writeSVarint(G)},writeStringField:function(P,G){this.writeTag(P,Ga.Bytes),this.writeString(G)},writeFloatField:function(P,G){this.writeTag(P,Ga.Fixed32),this.writeFloat(G)},writeDoubleField:function(P,G){this.writeTag(P,Ga.Fixed64),this.writeDouble(G)},writeBooleanField:function(P,G){this.writeVarintField(P,!!G)}};var rm=3;function ty(P,G,re){P===1&&re.readMessage(im,G)}function im(P,G,re){if(P===3){var we=re.readMessage(Cv,{}),je=we.id,Ke=we.bitmap,ot=we.width,_t=we.height,Rt=we.left,Kt=we.top,nn=we.advance;G.push({id:je,bitmap:new nh({width:ot+2*rm,height:_t+2*rm},Ke),metrics:{width:ot,height:_t,left:Rt,top:Kt,advance:nn}})}}function Cv(P,G,re){P===1?G.id=re.readVarint():P===2?G.bitmap=re.readBytes():P===3?G.width=re.readVarint():P===4?G.height=re.readVarint():P===5?G.left=re.readSVarint():P===6?G.top=re.readSVarint():P===7&&(G.advance=re.readVarint())}var U0=rm;function Ed(P){for(var G=0,re=0,we=0,je=P;we=0;yn--){var fn=ot[yn];if(!(sn.w>fn.w||sn.h>fn.h)){if(sn.x=fn.x,sn.y=fn.y,Rt=Math.max(Rt,sn.y+sn.h),_t=Math.max(_t,sn.x+sn.w),sn.w===fn.w&&sn.h===fn.h){var On=ot.pop();yn0&&Wr>mt&&(mt=Wr)}else{var pi=va[jt.fontStack],Ci=pi&&pi[rn];if(Ci&&Ci.rect)xn=Ci.rect,Sn=Ci.metrics;else{var Vi=Ea[jt.fontStack],ki=Vi&&Vi[rn];if(!ki)continue;Sn=ki.metrics}hn=(ze-jt.scale)*cl}wr?(zi.verticalizable=!0,ht.push({glyph:rn,imageName:Nn,x:Cs,y:pl+hn,vertical:wr,scale:jt.scale,fontStack:jt.fontStack,sectionIndex:Xt,metrics:Sn,rect:xn}),Cs+=Gn*jt.scale+xo):(ht.push({glyph:rn,imageName:Nn,x:Cs,y:pl+hn,vertical:wr,scale:jt.scale,fontStack:jt.fontStack,sectionIndex:Xt,metrics:Sn,rect:xn}),Cs+=Sn.advance*jt.scale+xo)}if(ht.length!==0){var ui=Cs-xo;jo=Math.max(ui,jo),q0(ht,0,ht.length-1,zl,mt)}Cs=0;var Ii=Ka*ze+mt;Je.lineOffset=Math.max(mt,Ze),pl+=Ii,ea=Math.max(Ii,ea),++Y}else pl+=Ka,++Y}var Oi=pl-jp,Si=vo(Ba),ti=Si.horizontalAlign,Di=Si.verticalAlign;(function(Bi,ra,oo,to,Is,Ou,Js,Ps,hu){var Yl=(ra-oo)*Is,gs=0;gs=Ou!==Js?-Ps*to-jp:(-to*hu+.5)*Js;for(var ns=0,Ol=Bi;ns=0&&we>=P&&Id[this.text.charCodeAt(we)];we--)re--;this.text=this.text.substring(P,re),this.sectionIndex=this.sectionIndex.slice(P,re)},uu.prototype.substring=function(P,G){var re=new uu;return re.text=this.text.substring(P,G),re.sectionIndex=this.sectionIndex.slice(P,G),re.sections=this.sections,re},uu.prototype.toString=function(){return this.text},uu.prototype.getMaxScale=function(){var P=this;return this.sectionIndex.reduce(function(G,re){return Math.max(G,P.sections[re].scale)},0)},uu.prototype.addTextSection=function(P,G){this.text+=P.text,this.sections.push(Bf.forText(P.scale,P.fontStack||G));for(var re=this.sections.length-1,we=0;we=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Id={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Yu={};function am(P,G,re,we,je,Ke){if(G.imageName){var ot=we[G.imageName];return ot?ot.displaySize[0]*G.scale*cl/Ke+je:0}var _t=re[G.fontStack],Rt=_t&&_t[P];return Rt?Rt.metrics.advance*G.scale+je:0}function Pd(P,G,re,we){var je=Math.pow(P-G,2);return we?P=0,nn=0,sn=0;sn-re/2;){if(--ot<0)return!1;_t-=P[ot].dist(Ke),Ke=P[ot]}_t+=P[ot].dist(P[ot+1]),ot++;for(var Rt=[],Kt=0;_twe;)Kt-=Rt.shift().angleDelta;if(Kt>je)return!1;ot++,_t+=sn.dist(yn)}return!0}function lm(P){for(var G=0,re=0;reKt){var On=(Kt-Rt)/fn,jn=Wi(sn.x,yn.x,On),sr=Wi(sn.y,yn.y,On),ir=new Nf(jn,sr,yn.angleTo(sn),nn);return ir._round(),!ot||sm(P,ir,_t,ot,G)?ir:void 0}Rt+=fn}}function Lv(P,G,re,we,je,Ke,ot,_t,Rt){var Kt=um(we,Ke,ot),nn=cm(we,je),sn=nn*ot,yn=P[0].x===0||P[0].x===Rt||P[0].y===0||P[0].y===Rt;return G-sn=0&&Fr=0&&Gr=0&&yn+Kt<=nn){var qr=new Nf(Fr,Gr,kr,On);qr._round(),we&&!sm(P,qr,Ke,we,je)||fn.push(qr)}}sn+=ir}return _t||fn.length||ot||(fn=hm(P,sn/2,re,we,je,Ke,ot,!0,Rt)),fn}function jf(P,G,re,we,je){for(var Ke=[],ot=0;ot=we&&sn.x>=we||(nn.x>=we?nn=new r(we,nn.y+(sn.y-nn.y)*((we-nn.x)/(sn.x-nn.x)))._round():sn.x>=we&&(sn=new r(we,nn.y+(sn.y-nn.y)*((we-nn.x)/(sn.x-nn.x)))._round()),nn.y>=je&&sn.y>=je||(nn.y>=je?nn=new r(nn.x+(sn.x-nn.x)*((je-nn.y)/(sn.y-nn.y)),je)._round():sn.y>=je&&(sn=new r(nn.x+(sn.x-nn.x)*((je-nn.y)/(sn.y-nn.y)),je)._round()),Rt&&nn.equals(Rt[Rt.length-1])||(Rt=[nn],Ke.push(Rt)),Rt.push(sn)))))}return Ke}var jc=Zu;function W0(P,G,re,we){var je=[],Ke=P.image,ot=Ke.pixelRatio,_t=Ke.paddedRect.w-2*jc,Rt=Ke.paddedRect.h-2*jc,Kt=P.right-P.left,nn=P.bottom-P.top,sn=Ke.stretchX||[[0,_t]],yn=Ke.stretchY||[[0,Rt]],fn=function(Ka,Ba){return Ka+Ba[1]-Ba[0]},On=sn.reduce(fn,0),jn=yn.reduce(fn,0),sr=_t-On,ir=Rt-jn,kr=0,_r=On,Fr=0,Gr=jn,qr=0,ri=sr,ei=0,vi=ir;if(Ke.content&&we){var Ei=Ke.content;kr=sp(sn,0,Ei[0]),Fr=sp(yn,0,Ei[1]),_r=sp(sn,Ei[0],Ei[2]),Gr=sp(yn,Ei[1],Ei[3]),qr=Ei[0]-kr,ei=Ei[1]-Fr,ri=Ei[2]-Ei[0]-_r,vi=Ei[3]-Ei[1]-Gr}var aa=function(Ka,Ba,Ja,Eo){var xo=zd(Ka.stretch-kr,_r,Kt,P.left),Es=Od(Ka.fixed-qr,ri,Ka.stretch,On),Oo=zd(Ba.stretch-Fr,Gr,nn,P.top),Cs=Od(Ba.fixed-ei,vi,Ba.stretch,jn),pl=zd(Ja.stretch-kr,_r,Kt,P.left),jo=Od(Ja.fixed-qr,ri,Ja.stretch,On),ea=zd(Eo.stretch-Fr,Gr,nn,P.top),zl=Od(Eo.fixed-ei,vi,Eo.stretch,jn),Y=new r(xo,Oo),U=new r(pl,Oo),ne=new r(pl,ea),pe=new r(xo,ea),ze=new r(Es/ot,Cs/ot),Ze=new r(jo/ot,zl/ot),Je=G*Math.PI/180;if(Je){var ht=Math.sin(Je),mt=Math.cos(Je),zt=[mt,-ht,ht,mt];Y._matMult(zt),U._matMult(zt),pe._matMult(zt),ne._matMult(zt)}var jt=Ka.stretch+Ka.fixed,Xt=Ja.stretch+Ja.fixed,rn=Ba.stretch+Ba.fixed,hn=Eo.stretch+Eo.fixed;return{tl:Y,tr:U,bl:pe,br:ne,tex:{x:Ke.paddedRect.x+jc+jt,y:Ke.paddedRect.y+jc+rn,w:Xt-jt,h:hn-rn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ze,pixelOffsetBR:Ze,minFontScaleX:ri/ot/Kt,minFontScaleY:vi/ot/nn,isSDF:re}};if(we&&(Ke.stretchX||Ke.stretchY))for(var Ni=Ld(sn,sr,On),Qi=Ld(yn,ir,jn),qi=0;qi0&&(fn=Math.max(10,fn),this.circleDiameter=fn)}else{var On=Ke.top*ot-_t,jn=Ke.bottom*ot+_t,sr=Ke.left*ot-_t,ir=Ke.right*ot+_t,kr=Ke.collisionPadding;if(kr&&(sr-=kr[0]*ot,On-=kr[1]*ot,ir+=kr[2]*ot,jn+=kr[3]*ot),Kt){var _r=new r(sr,On),Fr=new r(ir,On),Gr=new r(sr,jn),qr=new r(ir,jn),ri=Kt*Math.PI/180;_r._rotate(ri),Fr._rotate(ri),Gr._rotate(ri),qr._rotate(ri),sr=Math.min(_r.x,Fr.x,Gr.x,qr.x),ir=Math.max(_r.x,Fr.x,Gr.x,qr.x),On=Math.min(_r.y,Fr.y,Gr.y,qr.y),jn=Math.max(_r.y,Fr.y,Gr.y,qr.y)}P.emplaceBack(G.x,G.y,sr,On,ir,jn,re,we,je)}this.boxEndIndex=P.length},Uf=function(P,G){if(P===void 0&&(P=[]),G===void 0&&(G=fm),this.data=P,this.length=this.data.length,this.compare=G,this.length>0)for(var re=(this.length>>1)-1;re>=0;re--)this._down(re)};function fm(P,G){return PG?1:0}function Xu(P,G,re){G===void 0&&(G=1),re===void 0&&(re=!1);for(var we=1/0,je=1/0,Ke=-1/0,ot=-1/0,_t=P[0],Rt=0;Rt<_t.length;Rt++){var Kt=_t[Rt];(!Rt||Kt.xKe)&&(Ke=Kt.x),(!Rt||Kt.y>ot)&&(ot=Kt.y)}var nn=Ke-we,sn=ot-je,yn=Math.min(nn,sn),fn=yn/2,On=new Uf([],Z0);if(yn===0)return new r(we,je);for(var jn=we;jnir.d||!ir.d)&&(ir=_r,re&&console.log("found best %d after %d probes",Math.round(1e4*_r.d)/1e4,kr)),_r.max-ir.d<=G||(fn=_r.h/2,On.push(new vh(_r.p.x-fn,_r.p.y-fn,fn,P)),On.push(new vh(_r.p.x+fn,_r.p.y-fn,fn,P)),On.push(new vh(_r.p.x-fn,_r.p.y+fn,fn,P)),On.push(new vh(_r.p.x+fn,_r.p.y+fn,fn,P)),kr+=4)}return re&&(console.log("num probes: "+kr),console.log("best distance: "+ir.d)),ir.p}function Z0(P,G){return G.max-P.max}function vh(P,G,re,we){this.p=new r(P,G),this.h=re,this.d=function(je,Ke){for(var ot=!1,_t=1/0,Rt=0;Rtje.y!=On.y>je.y&&je.x<(On.x-fn.x)*(je.y-fn.y)/(On.y-fn.y)+fn.x&&(ot=!ot),_t=Math.min(_t,tf(je,fn,On))}return(ot?1:-1)*Math.sqrt(_t)}(this.p,we),this.max=this.d+this.h*Math.SQRT2}Uf.prototype.push=function(P){this.data.push(P),this.length++,this._up(this.length-1)},Uf.prototype.pop=function(){if(this.length!==0){var P=this.data[0],G=this.data.pop();return this.length--,this.length>0&&(this.data[0]=G,this._down(0)),P}},Uf.prototype.peek=function(){return this.data[0]},Uf.prototype._up=function(P){for(var G=this.data,re=this.compare,we=G[P];P>0;){var je=P-1>>1,Ke=G[je];if(re(we,Ke)>=0)break;G[P]=Ke,P=je}G[P]=we},Uf.prototype._down=function(P){for(var G=this.data,re=this.compare,we=this.length>>1,je=G[P];P=0)break;G[P]=ot,P=Ke}G[P]=je};var Cc=7,Vf=Number.POSITIVE_INFINITY;function lp(P,G){return G[1]!==Vf?function(re,we,je){var Ke=0,ot=0;switch(we=Math.abs(we),je=Math.abs(je),re){case"top-right":case"top-left":case"top":ot=je-Cc;break;case"bottom-right":case"bottom-left":case"bottom":ot=-je+Cc}switch(re){case"top-right":case"bottom-right":case"right":Ke=-we;break;case"top-left":case"bottom-left":case"left":Ke=we}return[Ke,ot]}(P,G[0],G[1]):function(re,we){var je=0,Ke=0;we<0&&(we=0);var ot=we/Math.sqrt(2);switch(re){case"top-right":case"top-left":Ke=ot-Cc;break;case"bottom-right":case"bottom-left":Ke=-ot+Cc;break;case"bottom":Ke=-we+Cc;break;case"top":Ke=we-Cc}switch(re){case"top-right":case"bottom-right":je=-ot;break;case"top-left":case"bottom-left":je=ot;break;case"left":je=we;break;case"right":je=-we}return[je,Ke]}(P,G[0])}function ff(P){switch(P){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var pf=255,ih=pf*cu;function pm(P,G,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On){var jn=function(Fr,Gr,qr,ri,ei,vi,Ei,aa){for(var Ni=ri.layout.get("text-rotate").evaluate(vi,{})*Math.PI/180,Qi=[],qi=0,zi=Gr.positionedLines;qiih&&I(P.layerIds[0]+': Value for "text-size" is >= '+pf+'. Reduce your "text-size".'):sr.kind==="composite"&&((ir=[cu*fn.compositeTextSizes[0].evaluate(ot,{},On),cu*fn.compositeTextSizes[1].evaluate(ot,{},On)])[0]>ih||ir[1]>ih)&&I(P.layerIds[0]+': Value for "text-size" is >= '+pf+'. Reduce your "text-size".'),P.addSymbols(P.text,jn,ir,_t,Ke,ot,Kt,G,Rt.lineStartIndex,Rt.lineLength,yn,On);for(var kr=0,_r=nn;kr<_r.length;kr+=1)sn[_r[kr]]=P.text.placedSymbolArray.length-1;return 4*jn.length}function dm(P){for(var G in P)return P[G];return null}function gm(P,G,re,we){var je=P.compareText;if(G in je){for(var Ke=je[G],ot=Ke.length-1;ot>=0;ot--)if(we.dist(Ke[ot])0)&&(Ke.value.kind!=="constant"||Ke.value.value.length>0),Kt=_t.value.kind!=="constant"||!!_t.value.value||Object.keys(_t.parameters).length>0,nn=je.get("symbol-sort-key");if(this.features=[],Rt||Kt){for(var sn=G.iconDependencies,yn=G.glyphDependencies,fn=G.availableImages,On=new za(this.zoom),jn=0,sr=P;jn=0;for(var va=0,yo=ei.sections;va=0;_t--)Ke[_t]={x:G[_t].x,y:G[_t].y,tileUnitDistanceFromAnchor:je},_t>0&&(je+=G[_t-1].dist(G[_t]));for(var Rt=0;Rt0},co.prototype.hasIconData=function(){return this.icon.segments.get().length>0},co.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},co.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},co.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},co.prototype.addIndicesForPlacedSymbol=function(P,G){for(var re=P.placedSymbolArray.get(G),we=re.vertexStartIndex+4*re.numGlyphs,je=re.vertexStartIndex;je1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(P),this.sortedAngle=P,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var re=0,we=this.symbolInstanceIndexes;re=0&&Rt.indexOf(ot)===_t&&G.addIndicesForPlacedSymbol(G.text,ot)}),Ke.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ke.verticalPlacedTextSymbolIndex),Ke.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ke.placedIconSymbolIndex),Ke.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ke.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Mi("SymbolBucket",co,{omit:["layers","collisionBoxArray","features","compareText"]}),co.MAX_GLYPHS=65535,co.addDynamicAttributes=Rd;var Y0=new ho({"symbol-placement":new di(et.layout_symbol["symbol-placement"]),"symbol-spacing":new di(et.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new di(et.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Fi(et.layout_symbol["symbol-sort-key"]),"symbol-z-order":new di(et.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new di(et.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new di(et.layout_symbol["icon-ignore-placement"]),"icon-optional":new di(et.layout_symbol["icon-optional"]),"icon-rotation-alignment":new di(et.layout_symbol["icon-rotation-alignment"]),"icon-size":new Fi(et.layout_symbol["icon-size"]),"icon-text-fit":new di(et.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new di(et.layout_symbol["icon-text-fit-padding"]),"icon-image":new Fi(et.layout_symbol["icon-image"]),"icon-rotate":new Fi(et.layout_symbol["icon-rotate"]),"icon-padding":new di(et.layout_symbol["icon-padding"]),"icon-keep-upright":new di(et.layout_symbol["icon-keep-upright"]),"icon-offset":new Fi(et.layout_symbol["icon-offset"]),"icon-anchor":new Fi(et.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new di(et.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new di(et.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new di(et.layout_symbol["text-rotation-alignment"]),"text-field":new Fi(et.layout_symbol["text-field"]),"text-font":new Fi(et.layout_symbol["text-font"]),"text-size":new Fi(et.layout_symbol["text-size"]),"text-max-width":new Fi(et.layout_symbol["text-max-width"]),"text-line-height":new di(et.layout_symbol["text-line-height"]),"text-letter-spacing":new Fi(et.layout_symbol["text-letter-spacing"]),"text-justify":new Fi(et.layout_symbol["text-justify"]),"text-radial-offset":new Fi(et.layout_symbol["text-radial-offset"]),"text-variable-anchor":new di(et.layout_symbol["text-variable-anchor"]),"text-anchor":new Fi(et.layout_symbol["text-anchor"]),"text-max-angle":new di(et.layout_symbol["text-max-angle"]),"text-writing-mode":new di(et.layout_symbol["text-writing-mode"]),"text-rotate":new Fi(et.layout_symbol["text-rotate"]),"text-padding":new di(et.layout_symbol["text-padding"]),"text-keep-upright":new di(et.layout_symbol["text-keep-upright"]),"text-transform":new Fi(et.layout_symbol["text-transform"]),"text-offset":new Fi(et.layout_symbol["text-offset"]),"text-allow-overlap":new di(et.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new di(et.layout_symbol["text-ignore-placement"]),"text-optional":new di(et.layout_symbol["text-optional"])}),Fd={paint:new ho({"icon-opacity":new Fi(et.paint_symbol["icon-opacity"]),"icon-color":new Fi(et.paint_symbol["icon-color"]),"icon-halo-color":new Fi(et.paint_symbol["icon-halo-color"]),"icon-halo-width":new Fi(et.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Fi(et.paint_symbol["icon-halo-blur"]),"icon-translate":new di(et.paint_symbol["icon-translate"]),"icon-translate-anchor":new di(et.paint_symbol["icon-translate-anchor"]),"text-opacity":new Fi(et.paint_symbol["text-opacity"]),"text-color":new Fi(et.paint_symbol["text-color"],{runtimeType:Pn,getOverride:function(P){return P.textColor},hasOverride:function(P){return!!P.textColor}}),"text-halo-color":new Fi(et.paint_symbol["text-halo-color"]),"text-halo-width":new Fi(et.paint_symbol["text-halo-width"]),"text-halo-blur":new Fi(et.paint_symbol["text-halo-blur"]),"text-translate":new di(et.paint_symbol["text-translate"]),"text-translate-anchor":new di(et.paint_symbol["text-translate-anchor"])}),layout:Y0},yh=function(P){this.type=P.property.overrides?P.property.overrides.runtimeType:Wt,this.defaultValue=P};yh.prototype.evaluate=function(P){if(P.formattedSection){var G=this.defaultValue.property.overrides;if(G&&G.hasOverride(P.formattedSection))return G.getOverride(P.formattedSection)}return P.feature&&P.featureState?this.defaultValue.evaluate(P.feature,P.featureState):this.defaultValue.property.specification.default},yh.prototype.eachChild=function(P){this.defaultValue.isConstant()||P(this.defaultValue.value._styleExpression.expression)},yh.prototype.outputDefined=function(){return!1},yh.prototype.serialize=function(){return null},Mi("FormatSectionOverride",yh,{omit:["defaultValue"]});var xh=function(P){function G(re){P.call(this,re,Fd)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.recalculate=function(re,we){if(P.prototype.recalculate.call(this,re,we),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var je=this.layout.get("text-writing-mode");if(je){for(var Ke=[],ot=0,_t=je;ot<_t.length;ot+=1){var Rt=_t[ot];Ke.indexOf(Rt)<0&&Ke.push(Rt)}this.layout._values["text-writing-mode"]=Ke}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},G.prototype.getValueAndResolveTokens=function(re,we,je,Ke){var ot=this.layout.get(re).evaluate(we,{},je,Ke),_t=this._unevaluatedLayout._values[re];return _t.isDataDriven()||Hl(_t.value)||!ot?ot:function(Rt,Kt){return Kt.replace(/{([^{}]+)}/g,function(nn,sn){return sn in Rt?String(Rt[sn]):""})}(we.properties,ot)},G.prototype.createBucket=function(re){return new co(re)},G.prototype.queryRadius=function(){return 0},G.prototype.queryIntersectsFeature=function(){return!1},G.prototype._setPaintOverrides=function(){for(var re=0,we=Fd.paint.overridableProperties;re",targetMapId:we,sourceMapId:Ke.mapId})}}},ah.prototype.receive=function(P){var G=P.data,re=G.id;if(re&&(!G.targetMapId||this.mapId===G.targetMapId))if(G.type===""){delete this.tasks[re];var we=this.cancelCallbacks[re];delete this.cancelCallbacks[re],we&&we()}else V()||G.mustQueue?(this.tasks[re]=G,this.taskQueue.push(re),this.invoker.trigger()):this.processTask(re,G)},ah.prototype.process=function(){if(this.taskQueue.length){var P=this.taskQueue.shift(),G=this.tasks[P];delete this.tasks[P],this.taskQueue.length&&this.invoker.trigger(),G&&this.processTask(P,G)}},ah.prototype.processTask=function(P,G){var re=this;if(G.type===""){var we=this.callbacks[P];delete this.callbacks[P],we&&(G.error?we(Sl(G.error)):we(null,Sl(G.data)))}else{var je=!1,Ke=ee(this.globalScope)?void 0:[],ot=G.hasCallback?function(nn,sn){je=!0,delete re.cancelCallbacks[P],re.target.postMessage({id:P,type:"",sourceMapId:re.mapId,error:nn?il(nn):null,data:il(sn,Ke)},Ke)}:function(nn){je=!0},_t=null,Rt=Sl(G.data);if(this.parent[G.type])_t=this.parent[G.type](G.sourceMapId,Rt,ot);else if(this.parent.getWorkerSource){var Kt=G.type.split(".");_t=this.parent.getWorkerSource(G.sourceMapId,Kt[0],Rt.source)[Kt[1]](Rt,ot)}else ot(new Error("Could not find function "+G.type));!je&&_t&&_t.cancel&&(this.cancelCallbacks[P]=_t.cancel)}},ah.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var ds=function(P,G){P&&(G?this.setSouthWest(P).setNorthEast(G):P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1]))};ds.prototype.setNorthEast=function(P){return this._ne=P instanceof zo?new zo(P.lng,P.lat):zo.convert(P),this},ds.prototype.setSouthWest=function(P){return this._sw=P instanceof zo?new zo(P.lng,P.lat):zo.convert(P),this},ds.prototype.extend=function(P){var G,re,we=this._sw,je=this._ne;if(P instanceof zo)G=P,re=P;else{if(!(P instanceof ds)){if(Array.isArray(P)){if(P.length===4||P.every(Array.isArray)){var Ke=P;return this.extend(ds.convert(Ke))}var ot=P;return this.extend(zo.convert(ot))}return this}if(G=P._sw,re=P._ne,!G||!re)return this}return we||je?(we.lng=Math.min(G.lng,we.lng),we.lat=Math.min(G.lat,we.lat),je.lng=Math.max(re.lng,je.lng),je.lat=Math.max(re.lat,je.lat)):(this._sw=new zo(G.lng,G.lat),this._ne=new zo(re.lng,re.lat)),this},ds.prototype.getCenter=function(){return new zo((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},ds.prototype.getSouthWest=function(){return this._sw},ds.prototype.getNorthEast=function(){return this._ne},ds.prototype.getNorthWest=function(){return new zo(this.getWest(),this.getNorth())},ds.prototype.getSouthEast=function(){return new zo(this.getEast(),this.getSouth())},ds.prototype.getWest=function(){return this._sw.lng},ds.prototype.getSouth=function(){return this._sw.lat},ds.prototype.getEast=function(){return this._ne.lng},ds.prototype.getNorth=function(){return this._ne.lat},ds.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},ds.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},ds.prototype.isEmpty=function(){return!(this._sw&&this._ne)},ds.prototype.contains=function(P){var G=zo.convert(P),re=G.lng,we=G.lat,je=this._sw.lat<=we&&we<=this._ne.lat,Ke=this._sw.lng<=re&&re<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ke=this._sw.lng>=re&&re>=this._ne.lng),je&&Ke},ds.convert=function(P){return!P||P instanceof ds?P:new ds(P)};var qd=63710088e-1,zo=function(P,G){if(isNaN(P)||isNaN(G))throw new Error("Invalid LngLat object: ("+P+", "+G+")");if(this.lng=+P,this.lat=+G,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};zo.prototype.wrap=function(){return new zo(x(this.lng,-180,180),this.lat)},zo.prototype.toArray=function(){return[this.lng,this.lat]},zo.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},zo.prototype.distanceTo=function(P){var G=Math.PI/180,re=this.lat*G,we=P.lat*G,je=Math.sin(re)*Math.sin(we)+Math.cos(re)*Math.cos(we)*Math.cos((P.lng-this.lng)*G);return qd*Math.acos(Math.min(je,1))},zo.prototype.toBounds=function(P){P===void 0&&(P=0);var G=360*P/40075017,re=G/Math.cos(Math.PI/180*this.lat);return new ds(new zo(this.lng-re,this.lat-G),new zo(this.lng+re,this.lat+G))},zo.convert=function(P){if(P instanceof zo)return P;if(Array.isArray(P)&&(P.length===2||P.length===3))return new zo(Number(P[0]),Number(P[1]));if(!Array.isArray(P)&&typeof P=="object"&&P!==null)return new zo(Number("lng"in P?P.lng:P.lon),Number(P.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var J0=2*Math.PI*qd;function Hd(P){return J0*Math.cos(P*Math.PI/180)}function Q0(P){return(180+P)/360}function eg(P){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+P*Math.PI/360)))/360}function ym(P,G){return P/Hd(G)}function tg(P){var G=180-360*P;return 360/Math.PI*Math.atan(Math.exp(G*Math.PI/180))-90}var jh=function(P,G,re){re===void 0&&(re=0),this.x=+P,this.y=+G,this.z=+re};jh.fromLngLat=function(P,G){G===void 0&&(G=0);var re=zo.convert(P);return new jh(Q0(re.lng),eg(re.lat),ym(G,re.lat))},jh.prototype.toLngLat=function(){return new zo(360*this.x-180,tg(this.y))},jh.prototype.toAltitude=function(){return P=this.z,G=this.y,P*Hd(tg(G));var P,G},jh.prototype.meterInMercatorCoordinateUnits=function(){return 1/J0*(P=tg(this.y),1/Math.cos(P*Math.PI/180));var P};var zu=function(P,G,re){this.z=P,this.x=G,this.y=re,this.key=cp(0,P,P,G,re)};zu.prototype.equals=function(P){return this.z===P.z&&this.x===P.x&&this.y===P.y},zu.prototype.url=function(P,G){var re,we,je,Ke,ot,_t=(re=this.x,we=this.y,je=this.z,Ke=K0(256*re,256*(we=Math.pow(2,je)-we-1),je),ot=K0(256*(re+1),256*(we+1),je),Ke[0]+","+Ke[1]+","+ot[0]+","+ot[1]),Rt=function(Kt,nn,sn){for(var yn,fn="",On=Kt;On>0;On--)fn+=(nn&(yn=1<this.canonical.z?new Us(P,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Us(P,this.wrap,P,this.canonical.x>>G,this.canonical.y>>G)},Us.prototype.calculateScaledKey=function(P,G){var re=this.canonical.z-P;return P>this.canonical.z?cp(this.wrap*+G,P,this.canonical.z,this.canonical.x,this.canonical.y):cp(this.wrap*+G,P,P,this.canonical.x>>re,this.canonical.y>>re)},Us.prototype.isChildOf=function(P){if(P.wrap!==this.wrap)return!1;var G=this.canonical.z-P.canonical.z;return P.overscaledZ===0||P.overscaledZ>G&&P.canonical.y===this.canonical.y>>G},Us.prototype.children=function(P){if(this.overscaledZ>=P)return[new Us(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var G=this.canonical.z+1,re=2*this.canonical.x,we=2*this.canonical.y;return[new Us(G,this.wrap,G,re,we),new Us(G,this.wrap,G,re+1,we),new Us(G,this.wrap,G,re,we+1),new Us(G,this.wrap,G,re+1,we+1)]},Us.prototype.isLessThan=function(P){return this.wrapP.wrap)&&(this.overscaledZP.overscaledZ)&&(this.canonical.xP.canonical.x)&&this.canonical.y=this.dim+1||G<-1||G>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(G+1)*this.stride+(P+1)},Uc.prototype._unpackMapbox=function(P,G,re){return(256*P*256+256*G+re)/10-1e4},Uc.prototype._unpackTerrarium=function(P,G,re){return 256*P+G+re/256-32768},Uc.prototype.getPixels=function(){return new Gu({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Uc.prototype.backfillBorder=function(P,G,re){if(this.dim!==P.dim)throw new Error("dem dimension mismatch");var we=G*this.dim,je=G*this.dim+this.dim,Ke=re*this.dim,ot=re*this.dim+this.dim;switch(G){case-1:we=je-1;break;case 1:je=we+1}switch(re){case-1:Ke=ot-1;break;case 1:ot=Ke+1}for(var _t=-G*this.dim,Rt=-re*this.dim,Kt=Ke;Kt=0&&nn[3]>=0&&_t.insert(ot,nn[0],nn[1],nn[2],nn[3])}},oh.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ts.VectorTile(new Rp(this.rawTileData)).layers,this.sourceLayerCoder=new hp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},oh.prototype.query=function(P,G,re,we){var je=this;this.loadVTLayers();for(var Ke=P.params||{},ot=Hi/P.tileSize/P.scale,_t=Zs(Ke.filter),Rt=P.queryGeometry,Kt=P.queryPadding*ot,nn=xc(Rt),sn=this.grid.query(nn.minX-Kt,nn.minY-Kt,nn.maxX+Kt,nn.maxY+Kt),yn=xc(P.cameraQueryGeometry),fn=0,On=this.grid3D.query(yn.minX-Kt,yn.minY-Kt,yn.maxX+Kt,yn.maxY+Kt,function(Fr,Gr,qr,ri){return function(ei,vi,Ei,aa,Ni){for(var Qi=0,qi=ei;Qi=zi.x&&Ni>=zi.y)return!0}var Ea=[new r(vi,Ei),new r(vi,Ni),new r(aa,Ni),new r(aa,Ei)];if(ei.length>2){for(var va=0,yo=Ea;va=0)return!0;return!1}(Ke,sn)){var yn=this.sourceLayerCoder.decode(re),fn=this.vtLayers[yn].feature(we);if(je.needGeometry){var On=ao(fn,!0);if(!je.filter(new za(this.tileID.overscaledZ),On,this.tileID.canonical))return}else if(!je.filter(new za(this.tileID.overscaledZ),fn))return;for(var jn=this.getId(fn,yn),sr=0;srwe)je=!1;else if(G)if(this.expirationTimeBe&&(P.getActor().send("enforceCacheSizeLimit",De),Nt=0)},e.clamp=h,e.clearTileCache=function(P){var G=l.caches.delete(_e);P&&G.catch(P).then(function(){return P()})},e.clipLine=jf,e.clone=function(P){var G=new ps(16);return G[0]=P[0],G[1]=P[1],G[2]=P[2],G[3]=P[3],G[4]=P[4],G[5]=P[5],G[6]=P[6],G[7]=P[7],G[8]=P[8],G[9]=P[9],G[10]=P[10],G[11]=P[11],G[12]=P[12],G[13]=P[13],G[14]=P[14],G[15]=P[15],G},e.clone$1=f,e.clone$2=function(P){var G=new ps(3);return G[0]=P[0],G[1]=P[1],G[2]=P[2],G},e.collisionCircleLayout=Kg,e.config=ie,e.create=function(){var P=new ps(16);return ps!=Float32Array&&(P[1]=0,P[2]=0,P[3]=0,P[4]=0,P[6]=0,P[7]=0,P[8]=0,P[9]=0,P[11]=0,P[12]=0,P[13]=0,P[14]=0),P[0]=1,P[5]=1,P[10]=1,P[15]=1,P},e.create$1=function(){var P=new ps(9);return ps!=Float32Array&&(P[1]=0,P[2]=0,P[3]=0,P[5]=0,P[6]=0,P[7]=0),P[0]=1,P[4]=1,P[8]=1,P},e.create$2=function(){var P=new ps(4);return ps!=Float32Array&&(P[1]=0,P[2]=0),P[0]=1,P[3]=1,P},e.createCommonjsModule=w,e.createExpression=Gs,e.createLayout=xa,e.createStyleLayer=function(P){return P.type==="custom"?new Dv(P):new Bd[P.type](P)},e.cross=function(P,G,re){var we=G[0],je=G[1],Ke=G[2],ot=re[0],_t=re[1],Rt=re[2];return P[0]=je*Rt-Ke*_t,P[1]=Ke*ot-we*Rt,P[2]=we*_t-je*ot,P},e.deepEqual=function P(G,re){if(Array.isArray(G)){if(!Array.isArray(re)||G.length!==re.length)return!1;for(var we=0;we0&&(Ke=1/Math.sqrt(Ke)),P[0]=G[0]*Ke,P[1]=G[1]*Ke,P[2]=G[2]*Ke,P},e.number=Wi,e.offscreenCanvasSupported=Ht,e.ortho=function(P,G,re,we,je,Ke,ot){var _t=1/(G-re),Rt=1/(we-je),Kt=1/(Ke-ot);return P[0]=-2*_t,P[1]=0,P[2]=0,P[3]=0,P[4]=0,P[5]=-2*Rt,P[6]=0,P[7]=0,P[8]=0,P[9]=0,P[10]=2*Kt,P[11]=0,P[12]=(G+re)*_t,P[13]=(je+we)*Rt,P[14]=(ot+Ke)*Kt,P[15]=1,P},e.parseGlyphPBF=function(P){return new Rp(P).readFields(ty,[])},e.pbf=Rp,e.performSymbolLayout=function(P,G,re,we,je,Ke,ot){P.createArrays();var _t=512*P.overscaling;P.tilePixelRatio=Hi/_t,P.compareText={},P.iconsNeedLinear=!1;var Rt=P.layers[0].layout,Kt=P.layers[0]._unevaluatedLayout._values,nn={};if(P.textSizeData.kind==="composite"){var sn=P.textSizeData,yn=sn.minZoom,fn=sn.maxZoom;nn.compositeTextSizes=[Kt["text-size"].possiblyEvaluate(new za(yn),ot),Kt["text-size"].possiblyEvaluate(new za(fn),ot)]}if(P.iconSizeData.kind==="composite"){var On=P.iconSizeData,jn=On.minZoom,sr=On.maxZoom;nn.compositeIconSizes=[Kt["icon-size"].possiblyEvaluate(new za(jn),ot),Kt["icon-size"].possiblyEvaluate(new za(sr),ot)]}nn.layoutTextSize=Kt["text-size"].possiblyEvaluate(new za(P.zoom+1),ot),nn.layoutIconSize=Kt["icon-size"].possiblyEvaluate(new za(P.zoom+1),ot),nn.textMaxSize=Kt["text-size"].possiblyEvaluate(new za(18));for(var ir=Rt.get("text-line-height")*cl,kr=Rt.get("text-rotation-alignment")==="map"&&Rt.get("symbol-placement")!=="point",_r=Rt.get("text-keep-upright"),Fr=Rt.get("text-size"),Gr=function(){var ei=ri[qr],vi=Rt.get("text-font").evaluate(ei,{},ot).join(","),Ei=Fr.evaluate(ei,{},ot),aa=nn.layoutTextSize.evaluate(ei,{},ot),Ni=nn.layoutIconSize.evaluate(ei,{},ot),Qi={horizontal:{},vertical:void 0},qi=ei.text,zi=[0,0];if(qi){var Ea=qi.toString(),va=Rt.get("text-letter-spacing").evaluate(ei,{},ot)*cl,yo=function(ze){for(var Ze=0,Je=ze;Ze=Hi||dl.y<0||dl.y>=Hi||function(no,Wo,Ic,Vc,Gd,ig,Wp,qc,dp,Pc,Zp,$p,ag,xm,Yp,_m,bm,wm,Tm,Wd,Ls,vf,og,_h,Rv){var Zd,el,Kl,Hc,Zo,bc=no.addToLineVertexArray(Wo,Ic),bh=0,sg=0,ny=0,ry=0,lg=-1,Fv=-1,qh={},iy=dr(""),Bv=0,Nv=0;if(qc._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Bv=(Zd=qc.layout.get("text-offset").evaluate(Ls,{},_h).map(function(hg){return hg*cl}))[0],Nv=Zd[1]):(Bv=qc.layout.get("text-radial-offset").evaluate(Ls,{},_h)*cl,Nv=Vf),no.allowVerticalPlacement&&Vc.vertical){var ay=qc.layout.get("text-rotate").evaluate(Ls,{},_h)+90,oy=Vc.vertical;Hc=new Dd(dp,Wo,Pc,Zp,$p,oy,ag,xm,Yp,ay),Wp&&(Zo=new Dd(dp,Wo,Pc,Zp,$p,Wp,bm,wm,Yp,ay))}if(Gd){var jv=qc.layout.get("icon-rotate").evaluate(Ls,{}),sy=qc.layout.get("icon-text-fit")!=="none",ly=W0(Gd,jv,og,sy),ug=Wp?W0(Wp,jv,og,sy):void 0;Kl=new Dd(dp,Wo,Pc,Zp,$p,Gd,bm,wm,!1,jv),bh=4*ly.length;var km=no.iconSizeData,cg=null;km.kind==="source"?(cg=[cu*qc.layout.get("icon-size").evaluate(Ls,{})])[0]>ih&&I(no.layerIds[0]+': Value for "icon-size" is >= '+pf+'. Reduce your "icon-size".'):km.kind==="composite"&&((cg=[cu*vf.compositeIconSizes[0].evaluate(Ls,{},_h),cu*vf.compositeIconSizes[1].evaluate(Ls,{},_h)])[0]>ih||cg[1]>ih)&&I(no.layerIds[0]+': Value for "icon-size" is >= '+pf+'. Reduce your "icon-size".'),no.addSymbols(no.icon,ly,cg,Wd,Tm,Ls,!1,Wo,bc.lineStartIndex,bc.lineLength,-1,_h),lg=no.icon.placedSymbolArray.length-1,ug&&(sg=4*ug.length,no.addSymbols(no.icon,ug,cg,Wd,Tm,Ls,Lu.vertical,Wo,bc.lineStartIndex,bc.lineLength,-1,_h),Fv=no.icon.placedSymbolArray.length-1)}for(var uy in Vc.horizontal){var Am=Vc.horizontal[uy];if(!el){iy=dr(Am.text);var b_=qc.layout.get("text-rotate").evaluate(Ls,{},_h);el=new Dd(dp,Wo,Pc,Zp,$p,Am,ag,xm,Yp,b_)}var cy=Am.positionedLines.length===1;if(ny+=pm(no,Wo,Am,ig,qc,Yp,Ls,_m,bc,Vc.vertical?Lu.horizontal:Lu.horizontalOnly,cy?Object.keys(Vc.horizontal):[uy],qh,lg,vf,_h),cy)break}Vc.vertical&&(ry+=pm(no,Wo,Vc.vertical,ig,qc,Yp,Ls,_m,bc,Lu.vertical,["vertical"],qh,Fv,vf,_h));var w_=el?el.boxStartIndex:no.collisionBoxArray.length,T_=el?el.boxEndIndex:no.collisionBoxArray.length,k_=Hc?Hc.boxStartIndex:no.collisionBoxArray.length,A_=Hc?Hc.boxEndIndex:no.collisionBoxArray.length,S_=Kl?Kl.boxStartIndex:no.collisionBoxArray.length,M_=Kl?Kl.boxEndIndex:no.collisionBoxArray.length,E_=Zo?Zo.boxStartIndex:no.collisionBoxArray.length,C_=Zo?Zo.boxEndIndex:no.collisionBoxArray.length,yf=-1,Sm=function(hg,fy){return hg&&hg.circleDiameter?Math.max(hg.circleDiameter,fy):fy};yf=Sm(el,yf),yf=Sm(Hc,yf),yf=Sm(Kl,yf);var hy=(yf=Sm(Zo,yf))>-1?1:0;hy&&(yf*=Rv/cl),no.glyphOffsetArray.length>=co.MAX_GLYPHS&&I("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ls.sortKey!==void 0&&no.addToSortKeyRanges(no.symbolInstances.length,Ls.sortKey),no.symbolInstances.emplaceBack(Wo.x,Wo.y,qh.right>=0?qh.right:-1,qh.center>=0?qh.center:-1,qh.left>=0?qh.left:-1,qh.vertical||-1,lg,Fv,iy,w_,T_,k_,A_,S_,M_,E_,C_,Pc,ny,ry,bh,sg,hy,0,ag,Bv,Nv,yf)}(ze,dl,_c,Je,ht,mt,Nn,ze.layers[0],ze.collisionBoxArray,Ze.index,Ze.sourceLayerIndex,ze.index,pi,ui,Si,rn,Vi,Ii,ti,wr,Ze,zt,hn,Sn,jt)};if(Di==="line")for(var to=0,Is=jf(Ze.geometry,0,0,Hi,Hi);to1){var Ol=Pv(ns,Oi,Je.vertical||or,ht,gr,Ci);Ol&&oo(ns,Ol)}}else if(Ze.type==="Polygon")for(var Uo=0,Qs=D0(Ze.geometry,0);Uo=En.maxzoom||En.visibility!=="none"&&(n(mn,this.zoom,Xe),(Ft[En.id]=En.createBucket({index:Ut.bucketLayerIDs.length,layers:mn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wt,sourceID:this.source})).populate(Zt,St,this.tileID.canonical),Ut.bucketLayerIDs.push(mn.map(function(wn){return wn.id})))}}}var Kn=e.mapObject(St.glyphDependencies,function(wn){return Object.keys(wn).map(Number)});Object.keys(Kn).length?ut.send("getGlyphs",{uid:this.uid,stacks:Kn},function(wn,zn){rt||(rt=wn,et=zn,Fn.call(vt))}):et={};var Ln=Object.keys(St.iconDependencies);Ln.length?ut.send("getImages",{icons:Ln,source:this.source,tileID:this.tileID,type:"icons"},function(wn,zn){rt||(rt=wn,Et=zn,Fn.call(vt))}):Et={};var Tn=Object.keys(St.patternDependencies);function Fn(){if(rt)return Tt(rt);if(et&&Et&&Bt){var wn=new u(et),zn=new e.ImageAtlas(Et,Bt);for(var Jn in Ft){var $n=Ft[Jn];$n instanceof e.SymbolBucket?(n($n.layers,this.zoom,Xe),e.performSymbolLayout($n,et,wn.positions,Et,zn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):$n.hasPattern&&($n instanceof e.LineBucket||$n instanceof e.FillBucket||$n instanceof e.FillExtrusionBucket)&&(n($n.layers,this.zoom,Xe),$n.addFeatures(St,this.tileID.canonical,zn.patternPositions))}this.status="done",Tt(null,{buckets:e.values(Ft).filter(function(vr){return!vr.isEmpty()}),featureIndex:Ut,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:wn.image,imageAtlas:zn,glyphMap:this.returnDependencies?et:null,iconMap:this.returnDependencies?Et:null,glyphPositions:this.returnDependencies?wn.positions:null})}}Tn.length?ut.send("getImages",{icons:Tn,source:this.source,tileID:this.tileID,type:"patterns"},function(wn,zn){rt||(rt=wn,Bt=zn,Fn.call(vt))}):Bt={},Fn.call(this)};var o=function(at,lt,Xe,ut){this.actor=at,this.layerIndex=lt,this.availableImages=Xe,this.loadVectorData=ut||l,this.loading={},this.loaded={}};o.prototype.loadTile=function(at,lt){var Xe=this,ut=at.uid;this.loading||(this.loading={});var Tt=!!(at&&at.request&&at.request.collectResourceTiming)&&new e.RequestPerformance(at.request),vt=this.loading[ut]=new r(at);vt.abort=this.loadVectorData(at,function(Lt,Ut){if(delete Xe.loading[ut],Lt||!Ut)return vt.status="done",Xe.loaded[ut]=vt,lt(Lt);var rt=Ut.rawData,et={};Ut.expires&&(et.expires=Ut.expires),Ut.cacheControl&&(et.cacheControl=Ut.cacheControl);var Et={};if(Tt){var Bt=Tt.finish();Bt&&(Et.resourceTiming=JSON.parse(JSON.stringify(Bt)))}vt.vectorTile=Ut.vectorTile,vt.parse(Ut.vectorTile,Xe.layerIndex,Xe.availableImages,Xe.actor,function(Ft,St){if(Ft||!St)return lt(Ft);lt(null,e.extend({rawTileData:rt.slice(0)},St,et,Et))}),Xe.loaded=Xe.loaded||{},Xe.loaded[ut]=vt})},o.prototype.reloadTile=function(at,lt){var Xe=this,ut=this.loaded,Tt=at.uid,vt=this;if(ut&&ut[Tt]){var Lt=ut[Tt];Lt.showCollisionBoxes=at.showCollisionBoxes;var Ut=function(rt,et){var Et=Lt.reloadCallback;Et&&(delete Lt.reloadCallback,Lt.parse(Lt.vectorTile,vt.layerIndex,Xe.availableImages,vt.actor,Et)),lt(rt,et)};Lt.status==="parsing"?Lt.reloadCallback=Ut:Lt.status==="done"&&(Lt.vectorTile?Lt.parse(Lt.vectorTile,this.layerIndex,this.availableImages,this.actor,Ut):Ut())}},o.prototype.abortTile=function(at,lt){var Xe=this.loading,ut=at.uid;Xe&&Xe[ut]&&Xe[ut].abort&&(Xe[ut].abort(),delete Xe[ut]),lt()},o.prototype.removeTile=function(at,lt){var Xe=this.loaded,ut=at.uid;Xe&&Xe[ut]&&delete Xe[ut],lt()};var s=e.window.ImageBitmap,c=function(){this.loaded={}};c.prototype.loadTile=function(at,lt){var Xe=at.uid,ut=at.encoding,Tt=at.rawImageData,vt=s&&Tt instanceof s?this.getImageData(Tt):Tt,Lt=new e.DEMData(Xe,vt,ut);this.loaded=this.loaded||{},this.loaded[Xe]=Lt,lt(null,Lt)},c.prototype.getImageData=function(at){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(at.width,at.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=at.width,this.offscreenCanvas.height=at.height,this.offscreenCanvasContext.drawImage(at,0,0,at.width,at.height);var lt=this.offscreenCanvasContext.getImageData(-1,-1,at.width+2,at.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:lt.width,height:lt.height},lt.data)},c.prototype.removeTile=function(at){var lt=this.loaded,Xe=at.uid;lt&<[Xe]&&delete lt[Xe]};var h=function at(lt,Xe){var ut,Tt=lt&<.type;if(Tt==="FeatureCollection")for(ut=0;ut=0!=!!lt&&at.reverse()}var g=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,k=function(at){this._feature=at,this.extent=e.EXTENT,this.type=at.type,this.properties=at.tags,"id"in at&&!isNaN(at.id)&&(this.id=parseInt(at.id,10))};k.prototype.loadGeometry=function(){if(this._feature.type===1){for(var at=[],lt=0,Xe=this._feature.geometry;lt>31}function H(at,lt){for(var Xe=at.loadGeometry(),ut=at.type,Tt=0,vt=0,Lt=Xe.length,Ut=0;Ut>1;Z(at,lt,Lt,ut,Tt,vt%2),Q(at,lt,Xe,ut,Lt-1,vt+1),Q(at,lt,Xe,Lt+1,Tt,vt+1)}}function Z(at,lt,Xe,ut,Tt,vt){for(;Tt>ut;){if(Tt-ut>600){var Lt=Tt-ut+1,Ut=Xe-ut+1,rt=Math.log(Lt),et=.5*Math.exp(2*rt/3),Et=.5*Math.sqrt(rt*et*(Lt-et)/Lt)*(Ut-Lt/2<0?-1:1);Z(at,lt,Xe,Math.max(ut,Math.floor(Xe-Ut*et/Lt+Et)),Math.min(Tt,Math.floor(Xe+(Lt-Ut)*et/Lt+Et)),vt)}var Bt=lt[2*Xe+vt],Ft=ut,St=Tt;for(K(at,lt,ut,Xe),lt[2*Tt+vt]>Bt&&K(at,lt,ut,Tt);FtBt;)St--}lt[2*ut+vt]===Bt?K(at,lt,ut,St):K(at,lt,++St,Tt),St<=Xe&&(ut=St+1),Xe<=St&&(Tt=St-1)}}function K(at,lt,Xe,ut){ae(at,Xe,ut),ae(lt,2*Xe,2*ut),ae(lt,2*Xe+1,2*ut+1)}function ae(at,lt,Xe){var ut=at[lt];at[lt]=at[Xe],at[Xe]=ut}function se(at,lt,Xe,ut){var Tt=at-Xe,vt=lt-ut;return Tt*Tt+vt*vt}M.fromVectorTileJs=f,M.fromGeojsonVt=E,M.GeoJSONWrapper=I;var he=function(at){return at[0]},fe=function(at){return at[1]},ie=function(at,lt,Xe,ut,Tt){lt===void 0&&(lt=he),Xe===void 0&&(Xe=fe),ut===void 0&&(ut=64),Tt===void 0&&(Tt=Float64Array),this.nodeSize=ut,this.points=at;for(var vt=at.length<65536?Uint16Array:Uint32Array,Lt=this.ids=new vt(at.length),Ut=this.coords=new Tt(2*at.length),rt=0;rt=Lt&&Bt<=rt&&Ft>=Ut&&Ft<=et&&Jt.push(Tt[Zt]);else{var on=Math.floor((Wt+en)/2);Bt=vt[2*on],Ft=vt[2*on+1],Bt>=Lt&&Bt<=rt&&Ft>=Ut&&Ft<=et&&Jt.push(Tt[on]);var un=(qt+1)%2;(qt===0?Lt<=Bt:Ut<=Ft)&&(St.push(Wt),St.push(on-1),St.push(un)),(qt===0?rt>=Bt:et>=Ft)&&(St.push(on+1),St.push(en),St.push(un))}}return Jt}(this.ids,this.coords,at,lt,Xe,ut,this.nodeSize)},ie.prototype.within=function(at,lt,Xe){return function(ut,Tt,vt,Lt,Ut,rt){for(var et=[0,ut.length-1,0],Et=[],Bt=Ut*Ut;et.length;){var Ft=et.pop(),St=et.pop(),Jt=et.pop();if(St-Jt<=rt)for(var qt=Jt;qt<=St;qt++)se(Tt[2*qt],Tt[2*qt+1],vt,Lt)<=Bt&&Et.push(ut[qt]);else{var en=Math.floor((Jt+St)/2),Wt=Tt[2*en],Zt=Tt[2*en+1];se(Wt,Zt,vt,Lt)<=Bt&&Et.push(ut[en]);var on=(Ft+1)%2;(Ft===0?vt-Ut<=Wt:Lt-Ut<=Zt)&&(et.push(Jt),et.push(en-1),et.push(on)),(Ft===0?vt+Ut>=Wt:Lt+Ut>=Zt)&&(et.push(en+1),et.push(St),et.push(on))}}return Et}(this.ids,this.coords,at,lt,Xe,this.nodeSize)};var oe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(at){return at}},le=function(at){this.options=Ce(Object.create(oe),at),this.trees=new Array(this.options.maxZoom+1)};function ge(at,lt,Xe,ut,Tt){return{x:at,y:lt,zoom:1/0,id:Xe,parentId:-1,numPoints:ut,properties:Tt}}function ye(at,lt){var Xe=at.geometry.coordinates,ut=Xe[0],Tt=Xe[1];return{x:Se(ut),y:Ee(Tt),zoom:1/0,index:lt,parentId:-1}}function me(at){return{type:"Feature",id:at.id,properties:be(at),geometry:{type:"Point",coordinates:[(ut=at.x,360*(ut-.5)),(lt=at.y,Xe=(180-360*lt)*Math.PI/180,360*Math.atan(Math.exp(Xe))/Math.PI-90)]}};var lt,Xe,ut}function be(at){var lt=at.numPoints,Xe=lt>=1e4?Math.round(lt/1e3)+"k":lt>=1e3?Math.round(lt/100)/10+"k":lt;return Ce(Ce({},at.properties),{cluster:!0,cluster_id:at.id,point_count:lt,point_count_abbreviated:Xe})}function Se(at){return at/360+.5}function Ee(at){var lt=Math.sin(at*Math.PI/180),Xe=.5-.25*Math.log((1+lt)/(1-lt))/Math.PI;return Xe<0?0:Xe>1?1:Xe}function Ce(at,lt){for(var Xe in lt)at[Xe]=lt[Xe];return at}function Le(at){return at.x}function Oe(at){return at.y}function We(at,lt,Xe,ut){for(var Tt,vt=ut,Lt=Xe-lt>>1,Ut=Xe-lt,rt=at[lt],et=at[lt+1],Et=at[Xe],Bt=at[Xe+1],Ft=lt+3;Ftvt)Tt=Ft,vt=St;else if(St===vt){var Jt=Math.abs(Ft-Lt);Jtut&&(Tt-lt>3&&We(at,lt,Tt,ut),at[Tt+2]=vt,Xe-Tt>3&&We(at,Tt,Xe,ut))}function Ie(at,lt,Xe,ut,Tt,vt){var Lt=Tt-Xe,Ut=vt-ut;if(Lt!==0||Ut!==0){var rt=((at-Xe)*Lt+(lt-ut)*Ut)/(Lt*Lt+Ut*Ut);rt>1?(Xe=Tt,ut=vt):rt>0&&(Xe+=Lt*rt,ut+=Ut*rt)}return(Lt=at-Xe)*Lt+(Ut=lt-ut)*Ut}function Ve(at,lt,Xe,ut){var Tt={id:at===void 0?null:at,type:lt,geometry:Xe,tags:ut,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(vt){var Lt=vt.geometry,Ut=vt.type;if(Ut==="Point"||Ut==="MultiPoint"||Ut==="LineString")Pe(vt,Lt);else if(Ut==="Polygon"||Ut==="MultiLineString")for(var rt=0;rt0&&(Lt+=ut?(Tt*et-rt*vt)/2:Math.sqrt(Math.pow(rt-Tt,2)+Math.pow(et-vt,2))),Tt=rt,vt=et}var Et=lt.length-3;lt[2]=1,We(lt,0,Et,Xe),lt[Et+2]=1,lt.size=Math.abs(Lt),lt.start=0,lt.end=lt.size}function He(at,lt,Xe,ut){for(var Tt=0;Tt1?1:Xe}function $e(at,lt,Xe,ut,Tt,vt,Lt,Ut){if(ut/=lt,vt>=(Xe/=lt)&&Lt=ut)return null;for(var rt=[],et=0;et=Xe&&Jt=ut)){var qt=[];if(Ft==="Point"||Ft==="MultiPoint")Ye(Bt,qt,Xe,ut,Tt);else if(Ft==="LineString")_e(Bt,qt,Xe,ut,Tt,!1,Ut.lineMetrics);else if(Ft==="MultiLineString")Be(Bt,qt,Xe,ut,Tt,!1);else if(Ft==="Polygon")Be(Bt,qt,Xe,ut,Tt,!0);else if(Ft==="MultiPolygon")for(var en=0;en=Xe&&Lt<=ut&&(lt.push(at[vt]),lt.push(at[vt+1]),lt.push(at[vt+2]))}}function _e(at,lt,Xe,ut,Tt,vt,Lt){for(var Ut,rt,et=De(at),Et=Tt===0?tt:nt,Bt=at.start,Ft=0;FtXe&&(rt=Et(et,St,Jt,en,Wt,Xe),Lt&&(et.start=Bt+Ut*rt)):Zt>ut?on=Xe&&(rt=Et(et,St,Jt,en,Wt,Xe),un=!0),on>ut&&Zt<=ut&&(rt=Et(et,St,Jt,en,Wt,ut),un=!0),!vt&&un&&(Lt&&(et.end=Bt+Ut*rt),lt.push(et),et=De(at)),Lt&&(Bt+=Ut)}var Pn=at.length-3;St=at[Pn],Jt=at[Pn+1],qt=at[Pn+2],(Zt=Tt===0?St:Jt)>=Xe&&Zt<=ut&&Ge(et,St,Jt,qt),Pn=et.length-3,vt&&Pn>=3&&(et[Pn]!==et[0]||et[Pn+1]!==et[1])&&Ge(et,et[0],et[1],et[2]),et.length&<.push(et)}function De(at){var lt=[];return lt.size=at.size,lt.start=at.start,lt.end=at.end,lt}function Be(at,lt,Xe,ut,Tt,vt){for(var Lt=0;LtLt.maxX&&(Lt.maxX=Et),Bt>Lt.maxY&&(Lt.maxY=Bt)}return Lt}function Gt(at,lt,Xe,ut){var Tt=lt.geometry,vt=lt.type,Lt=[];if(vt==="Point"||vt==="MultiPoint")for(var Ut=0;Ut0&<.size<(Tt?Lt:ut))Xe.numPoints+=lt.length/3;else{for(var Ut=[],rt=0;rtLt)&&(Xe.numSimplified++,Ut.push(lt[rt]),Ut.push(lt[rt+1])),Xe.numPoints++;Tt&&function(et,Et){for(var Bt=0,Ft=0,St=et.length,Jt=St-2;Ft0===Et)for(Ft=0,St=et.length;Ft24)throw new Error("maxZoom should be in the 0-24 range");if(lt.promoteId&<.generateId)throw new Error("promoteId and generateId cannot be used together.");var ut=function(Tt,vt){var Lt=[];if(Tt.type==="FeatureCollection")for(var Ut=0;Ut=ut;et--){var Et=+Date.now();Ut=this._cluster(Ut,et),this.trees[et]=new ie(Ut,Le,Oe,vt,Float32Array),Xe&&console.log("z%d: %d clusters in %dms",et,Ut.length,+Date.now()-Et)}return Xe&&console.timeEnd("total time"),this},le.prototype.getClusters=function(at,lt){var Xe=((at[0]+180)%360+360)%360-180,ut=Math.max(-90,Math.min(90,at[1])),Tt=at[2]===180?180:((at[2]+180)%360+360)%360-180,vt=Math.max(-90,Math.min(90,at[3]));if(at[2]-at[0]>=360)Xe=-180,Tt=180;else if(Xe>Tt){var Lt=this.getClusters([Xe,ut,180,vt],lt),Ut=this.getClusters([-180,ut,Tt,vt],lt);return Lt.concat(Ut)}for(var rt=this.trees[this._limitZoom(lt)],et=[],Et=0,Bt=rt.range(Se(Xe),Ee(vt),Se(Tt),Ee(ut));Etlt&&(Jt+=Zt.numPoints||1)}if(Jt>=Ut){for(var on=Et.x*St,un=Et.y*St,Pn=Lt&&St>1?this._map(Et,!0):null,Dn=(et<<5)+(lt+1)+this.points.length,In=0,mn=Ft;In1)for(var Tn=0,Fn=Ft;Tn>5},le.prototype._getOriginZoom=function(at){return(at-this.points.length)%32},le.prototype._map=function(at,lt){if(at.numPoints)return lt?Ce({},at.properties):at.properties;var Xe=this.points[at.index].properties,ut=this.options.map(Xe);return lt&&ut===Xe?Ce({},ut):ut},Qe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Qe.prototype.splitTile=function(at,lt,Xe,ut,Tt,vt,Lt){for(var Ut=[at,lt,Xe,ut],rt=this.options,et=rt.debug;Ut.length;){ut=Ut.pop(),Xe=Ut.pop(),lt=Ut.pop(),at=Ut.pop();var Et=1<1&&console.time("creation"),Ft=this.tiles[Bt]=Ht(at,lt,Xe,ut,rt),this.tileCoords.push({z:lt,x:Xe,y:ut}),et)){et>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",lt,Xe,ut,Ft.numFeatures,Ft.numPoints,Ft.numSimplified),console.timeEnd("creation"));var St="z"+lt;this.stats[St]=(this.stats[St]||0)+1,this.total++}if(Ft.source=at,Tt){if(lt===rt.maxZoom||lt===Tt)continue;var Jt=1<1&&console.time("clipping");var qt,en,Wt,Zt,on,un,Pn=.5*rt.buffer/rt.extent,Dn=.5-Pn,In=.5+Pn,mn=1+Pn;qt=en=Wt=Zt=null,on=$e(at,Et,Xe-Pn,Xe+In,0,Ft.minX,Ft.maxX,rt),un=$e(at,Et,Xe+Dn,Xe+mn,0,Ft.minX,Ft.maxX,rt),at=null,on&&(qt=$e(on,Et,ut-Pn,ut+In,1,Ft.minY,Ft.maxY,rt),en=$e(on,Et,ut+Dn,ut+mn,1,Ft.minY,Ft.maxY,rt),on=null),un&&(Wt=$e(un,Et,ut-Pn,ut+In,1,Ft.minY,Ft.maxY,rt),Zt=$e(un,Et,ut+Dn,ut+mn,1,Ft.minY,Ft.maxY,rt),un=null),et>1&&console.timeEnd("clipping"),Ut.push(qt||[],lt+1,2*Xe,2*ut),Ut.push(en||[],lt+1,2*Xe,2*ut+1),Ut.push(Wt||[],lt+1,2*Xe+1,2*ut),Ut.push(Zt||[],lt+1,2*Xe+1,2*ut+1)}}},Qe.prototype.getTile=function(at,lt,Xe){var ut=this.options,Tt=ut.extent,vt=ut.debug;if(at<0||at>24)return null;var Lt=1<1&&console.log("drilling down to z%d-%d-%d",at,lt,Xe);for(var rt,et=at,Et=lt,Bt=Xe;!rt&&et>0;)et--,Et=Math.floor(Et/2),Bt=Math.floor(Bt/2),rt=this.tiles[ft(et,Et,Bt)];return rt&&rt.source?(vt>1&&console.log("found parent tile z%d-%d-%d",et,Et,Bt),vt>1&&console.time("drilling down"),this.splitTile(rt.source,et,Et,Bt,at,lt,Xe),vt>1&&console.timeEnd("drilling down"),this.tiles[Ut]?wt(this.tiles[Ut],Tt):null):null};var Ot=function(at){function lt(Xe,ut,Tt,vt){at.call(this,Xe,ut,Tt,yt),vt&&(this.loadGeoJSON=vt)}return at&&(lt.__proto__=at),lt.prototype=Object.create(at&&at.prototype),lt.prototype.constructor=lt,lt.prototype.loadData=function(Xe,ut){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=ut,this._pendingLoadDataParams=Xe,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},lt.prototype._loadData=function(){var Xe=this;if(this._pendingCallback&&this._pendingLoadDataParams){var ut=this._pendingCallback,Tt=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var vt=!!(Tt&&Tt.request&&Tt.request.collectResourceTiming)&&new e.RequestPerformance(Tt.request);this.loadGeoJSON(Tt,function(Lt,Ut){if(Lt||!Ut)return ut(Lt);if(typeof Ut!="object")return ut(new Error("Input data given to '"+Tt.source+"' is not a valid GeoJSON object."));h(Ut,!0);try{if(Tt.filter){var rt=e.createExpression(Tt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(rt.result==="error")throw new Error(rt.value.map(function(Ft){return Ft.key+": "+Ft.message}).join(", "));var et=Ut.features.filter(function(Ft){return rt.value.evaluate({zoom:0},Ft)});Ut={type:"FeatureCollection",features:et}}Xe._geoJSONIndex=Tt.cluster?new le(function(Ft){var St=Ft.superclusterOptions,Jt=Ft.clusterProperties;if(!Jt||!St)return St;for(var qt={},en={},Wt={accumulated:null,zoom:0},Zt={properties:null},on=Object.keys(Jt),un=0,Pn=on;un=0?0:X.button},y.remove=function(X){X.parentNode&&X.parentNode.removeChild(X)};var x=function(X){function R(){X.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 X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.isLoaded=function(){return this.loaded},R.prototype.setLoaded=function(i){if(this.loaded!==i&&(this.loaded=i,i)){for(var a=0,C=this.requestors;a=0?1.2:1))}function v(X,R,i,a,C,F,q){for(var te=0;te65535)ve(new Error("glyphs > 65535 not supported"));else if(Ue.ranges[ct])ve(null,{stack:Ae,id:Re,glyph:it});else{var dt=Ue.requests[ct];dt||(dt=Ue.requests[ct]=[],T.loadGlyphRange(Ae,ct,i.url,i.requestManager,function(bt,Ct){if(Ct){for(var Mt in Ct)i._doesCharSupportLocalGlyph(+Mt)||(Ue.glyphs[+Mt]=Ct[+Mt]);Ue.ranges[ct]=!0}for(var Vt=0,It=dt;Vt1&&(ue=X[++te]);var Ae=Math.abs(ve-ue.left),Re=Math.abs(ve-ue.right),Ue=Math.min(Ae,Re),it=void 0,ct=C/i*(a+1);if(ue.isDash){var dt=a-Math.abs(ct);it=Math.sqrt(Ue*Ue+dt*dt)}else it=a-Math.sqrt(Ue*Ue+ct*ct);this.data[q+ve]=Math.max(0,Math.min(255,it+128))}},I.prototype.addRegularDash=function(X){for(var R=X.length-1;R>=0;--R){var i=X[R],a=X[R+1];i.zeroLength?X.splice(R,1):a&&a.isDash===i.isDash&&(a.left=i.left,X.splice(R,1))}var C=X[0],F=X[X.length-1];C.isDash===F.isDash&&(C.left=F.left-this.width,F.right=C.right+this.width);for(var q=this.width*this.nextRow,te=0,ue=X[te],ve=0;ve1&&(ue=X[++te]);var Ae=Math.abs(ve-ue.left),Re=Math.abs(ve-ue.right),Ue=Math.min(Ae,Re),it=ue.isDash?Ue:-Ue;this.data[q+ve]=Math.max(0,Math.min(255,it+128))}},I.prototype.addDash=function(X,R){var i=R?7:0,a=2*i+1;if(this.nextRow+a>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var C=0,F=0;F=i&&X.x=a&&X.y0&&(ve[new e.OverscaledTileID(i.overscaledZ,q,a.z,F,a.y-1).key]={backfilled:!1},ve[new e.OverscaledTileID(i.overscaledZ,i.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},ve[new e.OverscaledTileID(i.overscaledZ,ue,a.z,te,a.y-1).key]={backfilled:!1}),a.y+10&&(C.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new e.Event("data",C))}})},R.prototype.onAdd=function(i){this.map=i,this.load()},R.prototype.setData=function(i){var a=this;return this._data=i,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(C){if(C)a.fire(new e.ErrorEvent(C));else{var F={dataType:"source",sourceDataType:"content"};a._collectResourceTiming&&a._resourceTiming&&a._resourceTiming.length>0&&(F.resourceTiming=a._resourceTiming,a._resourceTiming=[]),a.fire(new e.Event("data",F))}}),this},R.prototype.getClusterExpansionZoom=function(i,a){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:i,source:this.id},a),this},R.prototype.getClusterChildren=function(i,a){return this.actor.send("geojson.getClusterChildren",{clusterId:i,source:this.id},a),this},R.prototype.getClusterLeaves=function(i,a,C,F){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:i,limit:a,offset:C},F),this},R.prototype._updateWorkerData=function(i){var a=this;this._loaded=!1;var C=e.extend({},this.workerOptions),F=this._data;typeof F=="string"?(C.request=this.map._requestManager.transformRequest(e.browser.resolveURL(F),e.ResourceType.Source),C.request.collectResourceTiming=this._collectResourceTiming):C.data=JSON.stringify(F),this.actor.send(this.type+".loadData",C,function(q,te){a._removed||te&&te.abandoned||(a._loaded=!0,te&&te.resourceTiming&&te.resourceTiming[a.id]&&(a._resourceTiming=te.resourceTiming[a.id].slice(0)),a.actor.send(a.type+".coalesce",{source:C.source},null),i(q))})},R.prototype.loaded=function(){return this._loaded},R.prototype.loadTile=function(i,a){var C=this,F=i.actor?"reloadTile":"loadTile";i.actor=this.actor;var q={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.request=this.actor.send(F,q,function(te,ue){return delete i.request,i.unloadVectorData(),i.aborted?a(null):te?a(te):(i.loadVectorData(ue,C.map.painter,F==="reloadTile"),a(null))})},R.prototype.abortTile=function(i){i.request&&(i.request.cancel(),delete i.request),i.aborted=!0},R.prototype.unloadTile=function(i){i.unloadVectorData(),this.actor.send("removeTile",{uid:i.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),J=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Q=function(X){function R(i,a,C,F){X.call(this),this.id=i,this.dispatcher=C,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(F),this.options=a}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.load=function(i,a){var C=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(F,q){C._loaded=!0,F?C.fire(new e.ErrorEvent(F)):q&&(C.image=q,i&&(C.coordinates=i),a&&a(),C._finishLoading())})},R.prototype.loaded=function(){return this._loaded},R.prototype.updateImage=function(i){var a=this;return this.image&&i.url?(this.options.url=i.url,this.load(i.coordinates,function(){a.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(i){this.map=i,this.load()},R.prototype.setCoordinates=function(i){var a=this;this.coordinates=i;var C=i.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(q){for(var te=1/0,ue=1/0,ve=-1/0,Ae=-1/0,Re=0,Ue=q;Rea.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+a.start(0)+" and "+a.end(0)+"-second mark."))):this.video.currentTime=i}},R.prototype.getVideo=function(){return this.video},R.prototype.onAdd=function(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},R.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var i=this.map.painter.context,a=i.gl;for(var C in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(i,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE)),this.tiles){var F=this.tiles[C];F.state!=="loaded"&&(F.state="loaded",F.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}(Q),K=function(X){function R(i,a,C,F){X.call(this,i,a,C,F),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some(function(q){return!Array.isArray(q)||q.length!==2||q.some(function(te){return typeof te!="number"})})||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,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."+i,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.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(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()},R.prototype.onRemove=function(){this.pause()},R.prototype.prepare=function(){var i=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,i=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,i=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var a=this.map.painter.context,C=a.gl;for(var F in this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(i||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(a,this.canvas,C.RGBA,{premultiply:!0}),this.tiles){var q=this.tiles[F];q.state!=="loaded"&&(q.state="loaded",q.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 i=0,a=[this.canvas.width,this.canvas.height];ithis.max){var q=this._getAndRemoveByKey(this.order[0]);q&&this.onRemove(q)}return this},ie.prototype.has=function(X){return X.wrapped().key in this.data},ie.prototype.getAndRemove=function(X){return this.has(X)?this._getAndRemoveByKey(X.wrapped().key):null},ie.prototype._getAndRemoveByKey=function(X){var R=this.data[X].shift();return R.timeout&&clearTimeout(R.timeout),this.data[X].length===0&&delete this.data[X],this.order.splice(this.order.indexOf(X),1),R.value},ie.prototype.getByKey=function(X){var R=this.data[X];return R?R[0].value:null},ie.prototype.get=function(X){return this.has(X)?this.data[X.wrapped().key][0].value:null},ie.prototype.remove=function(X,R){if(!this.has(X))return this;var i=X.wrapped().key,a=R===void 0?0:this.data[i].indexOf(R),C=this.data[i][a];return this.data[i].splice(a,1),C.timeout&&clearTimeout(C.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(C.value),this.order.splice(this.order.indexOf(i),1),this},ie.prototype.setMaxSize=function(X){for(this.max=X;this.order.length>this.max;){var R=this._getAndRemoveByKey(this.order[0]);R&&this.onRemove(R)}return this},ie.prototype.filter=function(X){var R=[];for(var i in this.data)for(var a=0,C=this.data[i];a1||(Math.abs(Ae)>1&&(Math.abs(Ae+Ue)===1?Ae+=Ue:Math.abs(Ae-Ue)===1&&(Ae-=Ue)),ve.dem&&ue.dem&&(ue.dem.backfillBorder(ve.dem,Ae,Re),ue.neighboringTiles&&ue.neighboringTiles[it]&&(ue.neighboringTiles[it].backfilled=!0)))}},R.prototype.getTile=function(i){return this.getTileByID(i.key)},R.prototype.getTileByID=function(i){return this._tiles[i]},R.prototype._retainLoadedChildren=function(i,a,C,F){for(var q in this._tiles){var te=this._tiles[q];if(!(F[q]||!te.hasData()||te.tileID.overscaledZ<=a||te.tileID.overscaledZ>C)){for(var ue=te.tileID;te&&te.tileID.overscaledZ>a+1;){var ve=te.tileID.scaledTo(te.tileID.overscaledZ-1);(te=this._tiles[ve.key])&&te.hasData()&&(ue=ve)}for(var Ae=ue;Ae.overscaledZ>a;)if(i[(Ae=Ae.scaledTo(Ae.overscaledZ-1)).key]){F[ue.key]=ue;break}}}},R.prototype.findLoadedParent=function(i,a){if(i.key in this._loadedParentTiles){var C=this._loadedParentTiles[i.key];return C&&C.tileID.overscaledZ>=a?C:null}for(var F=i.overscaledZ-1;F>=a;F--){var q=i.scaledTo(F),te=this._getLoadedTile(q);if(te)return te}},R.prototype._getLoadedTile=function(i){var a=this._tiles[i.key];return a&&a.hasData()?a:this._cache.getByKey(i.wrapped().key)},R.prototype.updateCacheSize=function(i){var a=(Math.ceil(i.width/this._source.tileSize)+1)*(Math.ceil(i.height/this._source.tileSize)+1),C=Math.floor(5*a),F=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,C):C;this._cache.setMaxSize(F)},R.prototype.handleWrapJump=function(i){var a=(i-(this._prevLng===void 0?i:this._prevLng))/360,C=Math.round(a);if(this._prevLng=i,C){var F={};for(var q in this._tiles){var te=this._tiles[q];te.tileID=te.tileID.unwrapTo(te.tileID.wrap+C),F[te.tileID.key]=te}for(var ue in this._tiles=F,this._timers)clearTimeout(this._timers[ue]),delete this._timers[ue];for(var ve in this._tiles){var Ae=this._tiles[ve];this._setTileReloadTimer(ve,Ae)}}},R.prototype.update=function(i){var a=this;if(this.transform=i,this._sourceLoaded&&!this._paused){var C;this.updateCacheSize(i),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?C=i.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Yt){return new e.OverscaledTileID(Yt.canonical.z,Yt.wrap,Yt.canonical.z,Yt.canonical.x,Yt.canonical.y)}):(C=i.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(C=C.filter(function(Yt){return a._source.hasTile(Yt)}))):C=[];var F=i.coveringZoomLevel(this._source),q=Math.max(F-R.maxOverzooming,this._source.minzoom),te=Math.max(F+R.maxUnderzooming,this._source.minzoom),ue=this._updateRetainedTiles(C,F);if(Lt(this._source.type)){for(var ve={},Ae={},Re=0,Ue=Object.keys(ue);Rethis._source.maxzoom){var Ct=dt.children(this._source.maxzoom)[0],Mt=this.getTile(Ct);if(Mt&&Mt.hasData()){C[Ct.key]=Ct;continue}}else{var Vt=dt.children(this._source.maxzoom);if(C[Vt[0].key]&&C[Vt[1].key]&&C[Vt[2].key]&&C[Vt[3].key])continue}for(var It=bt.wasRequested(),Qt=dt.overscaledZ-1;Qt>=q;--Qt){var tn=dt.scaledTo(Qt);if(F[tn.key]||(F[tn.key]=!0,!(bt=this.getTile(tn))&&It&&(bt=this._addTile(tn)),bt&&(C[tn.key]=tn,It=bt.wasRequested(),bt.hasData())))break}}}return C},R.prototype._updateLoadedParentTileCache=function(){for(var i in this._loadedParentTiles={},this._tiles){for(var a=[],C=void 0,F=this._tiles[i].tileID;F.overscaledZ>0;){if(F.key in this._loadedParentTiles){C=this._loadedParentTiles[F.key];break}a.push(F.key);var q=F.scaledTo(F.overscaledZ-1);if(C=this._getLoadedTile(q))break;F=q}for(var te=0,ue=a;te0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))},R.prototype.clearTiles=function(){for(var i in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(i);this._cache.reset()},R.prototype.tilesIn=function(i,a,C){var F=this,q=[],te=this.transform;if(!te)return q;for(var ue=C?te.getCameraQueryGeometry(i):i,ve=i.map(function(Qt){return te.pointCoordinate(Qt)}),Ae=ue.map(function(Qt){return te.pointCoordinate(Qt)}),Re=this.getIds(),Ue=1/0,it=1/0,ct=-1/0,dt=-1/0,bt=0,Ct=Ae;bt=0&&Vn[1].y+Mn>=0){var Hn=ve.map(function(rr){return Yt.getTilePoint(rr)}),Xn=Ae.map(function(rr){return Yt.getTilePoint(rr)});q.push({tile:tn,tileID:Yt,queryGeometry:Hn,cameraQueryGeometry:Xn,scale:vn})}}},It=0;It=e.browser.now())return!0}return!1},R.prototype.setFeatureState=function(i,a,C){i=i||"_geojsonTileLayer",this._state.updateState(i,a,C)},R.prototype.removeFeatureState=function(i,a,C){i=i||"_geojsonTileLayer",this._state.removeFeatureState(i,a,C)},R.prototype.getFeatureState=function(i,a){return i=i||"_geojsonTileLayer",this._state.getState(i,a)},R.prototype.setDependencies=function(i,a,C){var F=this._tiles[i];F&&F.setDependencies(a,C)},R.prototype.reloadTilesForDependencies=function(i,a){for(var C in this._tiles)this._tiles[C].hasDependency(i,a)&&this._reloadTile(C,"reloading");this._cache.filter(function(F){return!F.hasDependency(i,a)})},R}(e.Evented);function vt(X,R){var i=Math.abs(2*X.wrap)-+(X.wrap<0),a=Math.abs(2*R.wrap)-+(R.wrap<0);return X.overscaledZ-R.overscaledZ||a-i||R.canonical.y-X.canonical.y||R.canonical.x-X.canonical.x}function Lt(X){return X==="raster"||X==="image"||X==="video"}function Ut(){return new e.window.Worker(Dt.workerUrl)}Tt.maxOverzooming=10,Tt.maxUnderzooming=3;var rt="mapboxgl_preloaded_worker_pool",et=function(){this.active={}};et.prototype.acquire=function(X){if(!this.workers)for(this.workers=[];this.workers.length0?(a-F)/q:0;return this.points[C].mult(1-te).add(this.points[R].mult(te))};var En=function(X,R,i){var a=this.boxCells=[],C=this.circleCells=[];this.xCellCount=Math.ceil(X/i),this.yCellCount=Math.ceil(R/i);for(var F=0;F=-R[0]&&i<=R[0]&&a>=-R[1]&&a<=R[1]}function zn(X,R,i,a,C,F,q,te){var ue=a?X.textSizeData:X.iconSizeData,ve=e.evaluateSizeForZoom(ue,i.transform.zoom),Ae=[256/i.width*2+1,256/i.height*2+1],Re=a?X.text.dynamicLayoutVertexArray:X.icon.dynamicLayoutVertexArray;Re.clear();for(var Ue=X.lineVertexArray,it=a?X.text.placedSymbolArray:X.icon.placedSymbolArray,ct=i.transform.width/i.transform.height,dt=!1,bt=0;btMath.abs(i.x-R.x)*a?{useVertical:!0}:(X===e.WritingMode.vertical?R.yi.x)?{needsFlipping:!0}:null}function vr(X,R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it){var ct,dt=R/24,bt=X.lineOffsetX*dt,Ct=X.lineOffsetY*dt;if(X.numGlyphs>1){var Mt=X.glyphStartIndex+X.numGlyphs,Vt=X.lineStartIndex,It=X.lineStartIndex+X.lineLength,Qt=Jn(dt,te,bt,Ct,i,Ae,Re,X,ue,F,Ue);if(!Qt)return{notEnoughRoom:!0};var tn=Tn(Qt.first.point,q).point,Yt=Tn(Qt.last.point,q).point;if(a&&!i){var vn=$n(X.writingMode,tn,Yt,it);if(vn)return vn}ct=[Qt.first];for(var Mn=X.glyphStartIndex+1;Mn0?rr.point:Qn(Re,Xn,Vn,1,C),nr=$n(X.writingMode,Vn,Mr,it);if(nr)return nr}var Lr=lr(dt*te.getoffsetX(X.glyphStartIndex),bt,Ct,i,Ae,Re,X.segment,X.lineStartIndex,X.lineStartIndex+X.lineLength,ue,F,Ue);if(!Lr)return{notEnoughRoom:!0};ct=[Lr]}for(var dr=0,Br=ct;dr0?1:-1,ct=0;a&&(it*=-1,ct=Math.PI),it<0&&(ct+=Math.PI);for(var dt=it>0?te+q:te+q+1,bt=C,Ct=C,Mt=0,Vt=0,It=Math.abs(Ue),Qt=[];Mt+Vt<=It;){if((dt+=it)=ue)return null;if(Ct=bt,Qt.push(bt),(bt=Re[dt])===void 0){var tn=new e.Point(ve.getx(dt),ve.gety(dt)),Yt=Tn(tn,Ae);if(Yt.signedDistanceFromCamera>0)bt=Re[dt]=Yt.point;else{var vn=dt-it;bt=Qn(Mt===0?F:new e.Point(ve.getx(vn),ve.gety(vn)),tn,Ct,It-Mt+1,Ae)}}Mt+=Vt,Vt=Ct.dist(bt)}var Mn=(It-Mt)/Vt,Vn=bt.sub(Ct),Hn=Vn.mult(Mn)._add(Ct);Hn._add(Vn._unit()._perp()._mult(i*it));var Xn=ct+Math.atan2(bt.y-Ct.y,bt.x-Ct.x);return Qt.push(Hn),{point:Hn,angle:Xn,path:Qt}}En.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},En.prototype.insert=function(X,R,i,a,C){this._forEachCell(R,i,a,C,this._insertBoxCell,this.boxUid++),this.boxKeys.push(X),this.bboxes.push(R),this.bboxes.push(i),this.bboxes.push(a),this.bboxes.push(C)},En.prototype.insertCircle=function(X,R,i,a){this._forEachCell(R-a,i-a,R+a,i+a,this._insertCircleCell,this.circleUid++),this.circleKeys.push(X),this.circles.push(R),this.circles.push(i),this.circles.push(a)},En.prototype._insertBoxCell=function(X,R,i,a,C,F){this.boxCells[C].push(F)},En.prototype._insertCircleCell=function(X,R,i,a,C,F){this.circleCells[C].push(F)},En.prototype._query=function(X,R,i,a,C,F){if(i<0||X>this.width||a<0||R>this.height)return!C&&[];var q=[];if(X<=0&&R<=0&&this.width<=i&&this.height<=a){if(C)return!0;for(var te=0;te0:q},En.prototype._queryCircle=function(X,R,i,a,C){var F=X-i,q=X+i,te=R-i,ue=R+i;if(q<0||F>this.width||ue<0||te>this.height)return!a&&[];var ve=[],Ae={hitTest:a,circle:{x:X,y:R,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(F,te,q,ue,this._queryCellCircle,ve,Ae,C),a?ve.length>0:ve},En.prototype.query=function(X,R,i,a,C){return this._query(X,R,i,a,!1,C)},En.prototype.hitTest=function(X,R,i,a,C){return this._query(X,R,i,a,!0,C)},En.prototype.hitTestCircle=function(X,R,i,a){return this._queryCircle(X,R,i,!0,a)},En.prototype._queryCell=function(X,R,i,a,C,F,q,te){var ue=q.seenUids,ve=this.boxCells[C];if(ve!==null)for(var Ae=this.bboxes,Re=0,Ue=ve;Re=Ae[ct+0]&&a>=Ae[ct+1]&&(!te||te(this.boxKeys[it]))){if(q.hitTest)return F.push(!0),!0;F.push({key:this.boxKeys[it],x1:Ae[ct],y1:Ae[ct+1],x2:Ae[ct+2],y2:Ae[ct+3]})}}}var dt=this.circleCells[C];if(dt!==null)for(var bt=this.circles,Ct=0,Mt=dt;Ctq*q+te*te},En.prototype._circleAndRectCollide=function(X,R,i,a,C,F,q){var te=(F-a)/2,ue=Math.abs(X-(a+te));if(ue>te+i)return!1;var ve=(q-C)/2,Ae=Math.abs(R-(C+ve));if(Ae>ve+i)return!1;if(ue<=te||Ae<=ve)return!0;var Re=ue-te,Ue=Ae-ve;return Re*Re+Ue*Ue<=i*i};var hr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function jr(X,R){for(var i=0;i=1;Mr--)rr.push(Hn.path[Mr]);for(var nr=1;nr0){for(var Sr=rr[0].clone(),Vr=rr[0].clone(),fi=1;fi=vn.x&&Vr.x<=Mn.x&&Sr.y>=vn.y&&Vr.y<=Mn.y?[rr]:Vr.xMn.x||Vr.yMn.y?[]:e.clipLine([rr],vn.x,vn.y,Mn.x,Mn.y)}for(var Nr=0,si=Br;Nr=this.screenRightBoundary||athis.screenBottomBoundary},Ar.prototype.isInsideGrid=function(X,R,i,a){return i>=0&&X=0&&R0?(this.prevPlacement&&this.prevPlacement.variableOffsets[Re.crossTileID]&&this.prevPlacement.placements[Re.crossTileID]&&this.prevPlacement.placements[Re.crossTileID].text&&(dt=this.prevPlacement.variableOffsets[Re.crossTileID].anchor),this.variableOffsets[Re.crossTileID]={textOffset:bt,width:i,height:a,anchor:X,textBoxScale:C,prevAnchor:dt},this.markUsedJustification(Ue,X,Re,it),Ue.allowVerticalPlacement&&(this.markUsedOrientation(Ue,it,Re),this.placedOrientations[Re.crossTileID]=it),{shift:Ct,placedGlyphBoxes:Mt}):void 0},Xr.prototype.placeLayerBucketPart=function(X,R,i){var a=this,C=X.parameters,F=C.bucket,q=C.layout,te=C.posMatrix,ue=C.textLabelPlaneMatrix,ve=C.labelToScreenMatrix,Ae=C.textPixelRatio,Re=C.holdingForFade,Ue=C.collisionBoxArray,it=C.partiallyEvaluatedTextSize,ct=C.collisionGroup,dt=q.get("text-optional"),bt=q.get("icon-optional"),Ct=q.get("text-allow-overlap"),Mt=q.get("icon-allow-overlap"),Vt=q.get("text-rotation-alignment")==="map",It=q.get("text-pitch-alignment")==="map",Qt=q.get("icon-text-fit")!=="none",tn=q.get("symbol-z-order")==="viewport-y",Yt=Ct&&(Mt||!F.hasIconData()||bt),vn=Mt&&(Ct||!F.hasTextData()||dt);!F.collisionArrays&&Ue&&F.deserializeCollisionBoxes(Ue);var Mn=function(nr,Lr){if(!R[nr.crossTileID])if(Re)a.placements[nr.crossTileID]=new Cn(!1,!1,!1);else{var dr,Br=!1,Sr=!1,Vr=!0,fi=null,Nr={box:null,offscreen:null},si={box:null,offscreen:null},_i=null,Gi=null,Pi=0,Ji=0,Yi=0;Lr.textFeatureIndex?Pi=Lr.textFeatureIndex:nr.useRuntimeCollisionCircles&&(Pi=nr.featureIndex),Lr.verticalTextFeatureIndex&&(Ji=Lr.verticalTextFeatureIndex);var na=Lr.textBox;if(na){var Ma=function(ao){var ul=e.WritingMode.horizontal;if(F.allowVerticalPlacement&&!ao&&a.prevPlacement){var Lo=a.prevPlacement.placedOrientations[nr.crossTileID];Lo&&(a.placedOrientations[nr.crossTileID]=Lo,ul=Lo,a.markUsedOrientation(F,ul,nr))}return ul},go=function(ao,ul){if(F.allowVerticalPlacement&&nr.numVerticalGlyphVertices>0&&Lr.verticalTextBox)for(var Lo=0,Bc=F.writingModes;Lo0&&(uo=uo.filter(function(ao){return ao!==Go.anchor})).unshift(Go.anchor)}var Da=function(ao,ul,Lo){for(var Bc=ao.x2-ao.x1,ef=ao.y2-ao.y1,ga=nr.textBoxScale,Ch=Qt&&!Mt?ul:null,Cu={box:[],offscreen:!1},Sc=Ct?2*uo.length:uo.length,gc=0;gc=uo.length,Xs=a.attemptAnchorPlacement(tf,ao,Bc,ef,ga,Vt,It,Ae,te,ct,nf,nr,F,Lo,Ch);if(Xs&&(Cu=Xs.placedGlyphBoxes)&&Cu.box&&Cu.box.length){Br=!0,fi=Xs.shift;break}}return Cu};go(function(){return Da(na,Lr.iconBox,e.WritingMode.horizontal)},function(){var ao=Lr.verticalTextBox,ul=Nr&&Nr.box&&Nr.box.length;return F.allowVerticalPlacement&&!ul&&nr.numVerticalGlyphVertices>0&&ao?Da(ao,Lr.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}}),Nr&&(Br=Nr.box,Vr=Nr.offscreen);var ca=Ma(Nr&&Nr.box);if(!Br&&a.prevPlacement){var Qa=a.prevPlacement.variableOffsets[nr.crossTileID];Qa&&(a.variableOffsets[nr.crossTileID]=Qa,a.markUsedJustification(F,Qa.anchor,nr,ca))}}else{var Ra=function(ao,ul){var Lo=a.collisionIndex.placeCollisionBox(ao,Ct,Ae,te,ct.predicate);return Lo&&Lo.box&&Lo.box.length&&(a.markUsedOrientation(F,ul,nr),a.placedOrientations[nr.crossTileID]=ul),Lo};go(function(){return Ra(na,e.WritingMode.horizontal)},function(){var ao=Lr.verticalTextBox;return F.allowVerticalPlacement&&nr.numVerticalGlyphVertices>0&&ao?Ra(ao,e.WritingMode.vertical):{box:null,offscreen:null}}),Ma(Nr&&Nr.box&&Nr.box.length)}}if(Br=(dr=Nr)&&dr.box&&dr.box.length>0,Vr=dr&&dr.offscreen,nr.useRuntimeCollisionCircles){var wa=F.text.placedSymbolArray.get(nr.centerJustifiedTextSymbolIndex),Fa=e.evaluateSizeForFeature(F.textSizeData,it,wa),qa=q.get("text-padding"),fa=nr.collisionCircleDiameter;_i=a.collisionIndex.placeCollisionCircles(Ct,wa,F.lineVertexArray,F.glyphOffsetArray,Fa,te,ue,ve,i,It,ct.predicate,fa,qa),Br=Ct||_i.circles.length>0&&!_i.collisionDetected,Vr=Vr&&_i.offscreen}if(Lr.iconFeatureIndex&&(Yi=Lr.iconFeatureIndex),Lr.iconBox){var Pl=function(ao){var ul=Qt&&fi?Er(ao,fi.x,fi.y,Vt,It,a.transform.angle):ao;return a.collisionIndex.placeCollisionBox(ul,Mt,Ae,te,ct.predicate)};Sr=si&&si.box&&si.box.length&&Lr.verticalIconBox?(Gi=Pl(Lr.verticalIconBox)).box.length>0:(Gi=Pl(Lr.iconBox)).box.length>0,Vr=Vr&&Gi.offscreen}var mo=dt||nr.numHorizontalGlyphVertices===0&&nr.numVerticalGlyphVertices===0,Hi=bt||nr.numIconVertices===0;if(mo||Hi?Hi?mo||(Sr=Sr&&Br):Br=Sr&&Br:Sr=Br=Sr&&Br,Br&&dr&&dr.box&&(si&&si.box&&Ji?a.collisionIndex.insertCollisionBox(dr.box,q.get("text-ignore-placement"),F.bucketInstanceId,Ji,ct.ID):a.collisionIndex.insertCollisionBox(dr.box,q.get("text-ignore-placement"),F.bucketInstanceId,Pi,ct.ID)),Sr&&Gi&&a.collisionIndex.insertCollisionBox(Gi.box,q.get("icon-ignore-placement"),F.bucketInstanceId,Yi,ct.ID),_i&&(Br&&a.collisionIndex.insertCollisionCircles(_i.circles,q.get("text-ignore-placement"),F.bucketInstanceId,Pi,ct.ID),i)){var fs=F.bucketInstanceId,Po=a.collisionCircleArrays[fs];Po===void 0&&(Po=a.collisionCircleArrays[fs]=new ur);for(var ll=0;ll<_i.circles.length;ll+=4)Po.circles.push(_i.circles[ll+0]),Po.circles.push(_i.circles[ll+1]),Po.circles.push(_i.circles[ll+2]),Po.circles.push(_i.collisionDetected?1:0)}a.placements[nr.crossTileID]=new Cn(Br||Yt,Sr||vn,Vr||F.justReloaded),R[nr.crossTileID]=!0}};if(tn)for(var Vn=F.getSortedSymbolIndexes(this.transform.angle),Hn=Vn.length-1;Hn>=0;--Hn){var Xn=Vn[Hn];Mn(F.symbolInstances.get(Xn),F.collisionArrays[Xn])}else for(var rr=X.symbolInstanceStart;rr=0&&(X.text.placedSymbolArray.get(ue).crossTileID=C>=0&&ue!==C?0:i.crossTileID)}},Xr.prototype.markUsedOrientation=function(X,R,i){for(var a=R===e.WritingMode.horizontal||R===e.WritingMode.horizontalOnly?R:0,C=R===e.WritingMode.vertical?R:0,F=0,q=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];F0||It>0,Mn=Mt.numIconVertices>0,Vn=a.placedOrientations[Mt.crossTileID],Hn=Vn===e.WritingMode.vertical,Xn=Vn===e.WritingMode.horizontal||Vn===e.WritingMode.horizontalOnly;if(vn){var rr=tr(Yt.text),Mr=Hn?Wn:rr;it(X.text,Vt,Mr);var nr=Xn?Wn:rr;it(X.text,It,nr);var Lr=Yt.text.isHidden();[Mt.rightJustifiedTextSymbolIndex,Mt.centerJustifiedTextSymbolIndex,Mt.leftJustifiedTextSymbolIndex].forEach(function(Yi){Yi>=0&&(X.text.placedSymbolArray.get(Yi).hidden=Lr||Hn?1:0)}),Mt.verticalPlacedTextSymbolIndex>=0&&(X.text.placedSymbolArray.get(Mt.verticalPlacedTextSymbolIndex).hidden=Lr||Xn?1:0);var dr=a.variableOffsets[Mt.crossTileID];dr&&a.markUsedJustification(X,dr.anchor,Mt,Vn);var Br=a.placedOrientations[Mt.crossTileID];Br&&(a.markUsedJustification(X,"left",Mt,Br),a.markUsedOrientation(X,Br,Mt))}if(Mn){var Sr=tr(Yt.icon),Vr=!(Re&&Mt.verticalPlacedIconSymbolIndex&&Hn);if(Mt.placedIconSymbolIndex>=0){var fi=Vr?Sr:Wn;it(X.icon,Mt.numIconVertices,fi),X.icon.placedSymbolArray.get(Mt.placedIconSymbolIndex).hidden=Yt.icon.isHidden()}if(Mt.verticalPlacedIconSymbolIndex>=0){var Nr=Vr?Wn:Sr;it(X.icon,Mt.numVerticalIconVertices,Nr),X.icon.placedSymbolArray.get(Mt.verticalPlacedIconSymbolIndex).hidden=Yt.icon.isHidden()}}if(X.hasIconCollisionBoxData()||X.hasTextCollisionBoxData()){var si=X.collisionArrays[Ct];if(si){var _i=new e.Point(0,0);if(si.textBox||si.verticalTextBox){var Gi=!0;if(ue){var Pi=a.variableOffsets[Qt];Pi?(_i=Ir(Pi.anchor,Pi.width,Pi.height,Pi.textOffset,Pi.textBoxScale),ve&&_i._rotate(Ae?a.transform.angle:-a.transform.angle)):Gi=!1}si.textBox&&ai(X.textCollisionBox.collisionVertexArray,Yt.text.placed,!Gi||Hn,_i.x,_i.y),si.verticalTextBox&&ai(X.textCollisionBox.collisionVertexArray,Yt.text.placed,!Gi||Xn,_i.x,_i.y)}var Ji=!!(!Xn&&si.verticalIconBox);si.iconBox&&ai(X.iconCollisionBox.collisionVertexArray,Yt.icon.placed,Ji,Re?_i.x:0,Re?_i.y:0),si.verticalIconBox&&ai(X.iconCollisionBox.collisionVertexArray,Yt.icon.placed,!Ji,Re?_i.x:0,Re?_i.y:0)}}},dt=0;dtX},Xr.prototype.setStale=function(){this.stale=!0};var bn=Math.pow(2,25),Yn=Math.pow(2,24),an=Math.pow(2,17),_n=Math.pow(2,16),gn=Math.pow(2,9),qn=Math.pow(2,8),Un=Math.pow(2,1);function tr(X){if(X.opacity===0&&!X.placed)return 0;if(X.opacity===1&&X.placed)return 4294967295;var R=X.placed?1:0,i=Math.floor(127*X.opacity);return i*bn+R*Yn+i*an+R*_n+i*gn+R*qn+i*Un+R}var Wn=0,Bn=function(X){this._sortAcrossTiles=X.layout.get("symbol-z-order")!=="viewport-y"&&X.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Bn.prototype.continuePlacement=function(X,R,i,a,C){for(var F=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var q=R[X[this._currentPlacementIndex]],te=this.placement.collisionIndex.transform.zoom;if(q.type==="symbol"&&(!q.minzoom||q.minzoom<=te)&&(!q.maxzoom||q.maxzoom>te)){if(this._inProgressLayer||(this._inProgressLayer=new Bn(q)),this._inProgressLayer.continuePlacement(i[q.source],this.placement,this._showCollisionBoxes,q,F))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},dn.prototype.commit=function(X){return this.placement.commit(X),this.placement};var ln=512/e.EXTENT/2,An=function(X,R,i){this.tileID=X,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var a=0;aX.overscaledZ)for(var te in q){var ue=q[te];ue.tileID.isChildOf(X)&&ue.findMatches(R.symbolInstances,X,C)}else{var ve=q[X.scaledTo(Number(F)).key];ve&&ve.findMatches(R.symbolInstances,X,C)}}for(var Ae=0;Ae1?"@2x":"",Re=e.getJSON(F.transformRequest(F.normalizeSpriteURL(C,Ae,".json"),e.ResourceType.SpriteJSON),function(ct,dt){Re=null,ve||(ve=ct,te=dt,it())}),Ue=e.getImage(F.transformRequest(F.normalizeSpriteURL(C,Ae,".png"),e.ResourceType.SpriteImage),function(ct,dt){Ue=null,ve||(ve=ct,ue=dt,it())});function it(){if(ve)q(ve);else if(te&&ue){var ct=e.browser.getImageData(ue),dt={};for(var bt in te){var Ct=te[bt],Mt=Ct.width,Vt=Ct.height,It=Ct.x,Qt=Ct.y,tn=Ct.sdf,Yt=Ct.pixelRatio,vn=Ct.stretchX,Mn=Ct.stretchY,Vn=Ct.content,Hn=new e.RGBAImage({width:Mt,height:Vt});e.RGBAImage.copy(ct,Hn,{x:It,y:Qt},{x:0,y:0},{width:Mt,height:Vt}),dt[bt]={data:Hn,pixelRatio:Yt,sdf:tn,stretchX:vn,stretchY:Mn,content:Vn}}q(null,dt)}}return{cancel:function(){Re&&(Re.cancel(),Re=null),Ue&&(Ue.cancel(),Ue=null)}}}(i,this.map._requestManager,function(C,F){if(a._spriteRequest=null,C)a.fire(new e.ErrorEvent(C));else if(F)for(var q in F)a.imageManager.addImage(q,F[q]);a.imageManager.setLoaded(!0),a._availableImages=a.imageManager.listImages(),a.dispatcher.broadcast("setImages",a._availableImages),a.fire(new e.Event("data",{dataType:"style"}))})},R.prototype._validateLayer=function(i){var a=this.sourceCaches[i.source];if(a){var C=i.sourceLayer;if(C){var F=a.getSource();(F.type==="geojson"||F.vectorLayerIds&&F.vectorLayerIds.indexOf(C)===-1)&&this.fire(new e.ErrorEvent(new Error('Source layer "'+C+'" does not exist on source "'+F.id+'" as specified by style layer "'+i.id+'"')))}}},R.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var i in this.sourceCaches)if(!this.sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()},R.prototype._serializeLayers=function(i){for(var a=[],C=0,F=i;C0)throw new Error("Unimplemented: "+F.map(function(q){return q.command}).join(", ")+".");return C.forEach(function(q){q.command!=="setTransition"&&a[q.command].apply(a,q.args)}),this.stylesheet=i,!0},R.prototype.addImage=function(i,a){if(this.getImage(i))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(i,a),this._afterImageUpdated(i)},R.prototype.updateImage=function(i,a){this.imageManager.updateImage(i,a)},R.prototype.getImage=function(i){return this.imageManager.getImage(i)},R.prototype.removeImage=function(i){if(!this.getImage(i))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(i),this._afterImageUpdated(i)},R.prototype._afterImageUpdated=function(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!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(i,a,C){var F=this;if(C===void 0&&(C={}),this._checkLoaded(),this.sourceCaches[i]!==void 0)throw new Error("There is already a source with this ID");if(!a.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(a).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(a.type)>=0&&this._validate(e.validateStyle.source,"sources."+i,a,null,C))){this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);var q=this.sourceCaches[i]=new Tt(i,a,this.dispatcher);q.style=this,q.setEventedParent(this,function(){return{isSourceLoaded:F.loaded(),source:q.serialize(),sourceId:i}}),q.onAdd(this.map),this._changed=!0}},R.prototype.removeSource=function(i){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error("There is no source with this ID");for(var a in this._layers)if(this._layers[a].source===i)return this.fire(new e.ErrorEvent(new Error('Source "'+i+'" cannot be removed while layer "'+a+'" is using it.')));var C=this.sourceCaches[i];delete this.sourceCaches[i],delete this._updatedSources[i],C.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:i})),C.setEventedParent(null),C.clearTiles(),C.onRemove&&C.onRemove(this.map),this._changed=!0},R.prototype.setGeoJSONSourceData=function(i,a){this._checkLoaded(),this.sourceCaches[i].getSource().setData(a),this._changed=!0},R.prototype.getSource=function(i){return this.sourceCaches[i]&&this.sourceCaches[i].getSource()},R.prototype.addLayer=function(i,a,C){C===void 0&&(C={}),this._checkLoaded();var F=i.id;if(this.getLayer(F))this.fire(new e.ErrorEvent(new Error('Layer with id "'+F+'" already exists on this map')));else{var q;if(i.type==="custom"){if(yr(this,e.validateCustomStyleLayer(i)))return;q=e.createStyleLayer(i)}else{if(typeof i.source=="object"&&(this.addSource(F,i.source),i=e.clone$1(i),i=e.extend(i,{source:F})),this._validate(e.validateStyle.layer,"layers."+F,i,{arrayIndex:-1},C))return;q=e.createStyleLayer(i),this._validateLayer(q),q.setEventedParent(this,{layer:{id:F}}),this._serializedLayers[q.id]=q.serialize()}var te=a?this._order.indexOf(a):this._order.length;if(a&&te===-1)this.fire(new e.ErrorEvent(new Error('Layer with id "'+a+'" does not exist on this map.')));else{if(this._order.splice(te,0,F),this._layerOrderChanged=!0,this._layers[F]=q,this._removedLayers[F]&&q.source&&q.type!=="custom"){var ue=this._removedLayers[F];delete this._removedLayers[F],ue.type!==q.type?this._updatedSources[q.source]="clear":(this._updatedSources[q.source]="reload",this.sourceCaches[q.source].pause())}this._updateLayer(q),q.onAdd&&q.onAdd(this.map)}}},R.prototype.moveLayer=function(i,a){if(this._checkLoaded(),this._changed=!0,this._layers[i]){if(i!==a){var C=this._order.indexOf(i);this._order.splice(C,1);var F=a?this._order.indexOf(a):this._order.length;a&&F===-1?this.fire(new e.ErrorEvent(new Error('Layer with id "'+a+'" does not exist on this map.'))):(this._order.splice(F,0,i),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be moved.")))},R.prototype.removeLayer=function(i){this._checkLoaded();var a=this._layers[i];if(a){a.setEventedParent(null);var C=this._order.indexOf(i);this._order.splice(C,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=a,delete this._layers[i],delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],a.onRemove&&a.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be removed.")))},R.prototype.getLayer=function(i){return this._layers[i]},R.prototype.hasLayer=function(i){return i in this._layers},R.prototype.setLayerZoomRange=function(i,a,C){this._checkLoaded();var F=this.getLayer(i);F?F.minzoom===a&&F.maxzoom===C||(a!=null&&(F.minzoom=a),C!=null&&(F.maxzoom=C),this._updateLayer(F)):this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot have zoom extent.")))},R.prototype.setFilter=function(i,a,C){C===void 0&&(C={}),this._checkLoaded();var F=this.getLayer(i);if(F){if(!e.deepEqual(F.filter,a))return a==null?(F.filter=void 0,void this._updateLayer(F)):void(this._validate(e.validateStyle.filter,"layers."+F.id+".filter",a,null,C)||(F.filter=e.clone$1(a),this._updateLayer(F)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be filtered.")))},R.prototype.getFilter=function(i){return e.clone$1(this.getLayer(i).filter)},R.prototype.setLayoutProperty=function(i,a,C,F){F===void 0&&(F={}),this._checkLoaded();var q=this.getLayer(i);q?e.deepEqual(q.getLayoutProperty(a),C)||(q.setLayoutProperty(a,C,F),this._updateLayer(q)):this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be styled.")))},R.prototype.getLayoutProperty=function(i,a){var C=this.getLayer(i);if(C)return C.getLayoutProperty(a);this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style.")))},R.prototype.setPaintProperty=function(i,a,C,F){F===void 0&&(F={}),this._checkLoaded();var q=this.getLayer(i);q?e.deepEqual(q.getPaintProperty(a),C)||(q.setPaintProperty(a,C,F)&&this._updateLayer(q),this._changed=!0,this._updatedPaintProps[i]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be styled.")))},R.prototype.getPaintProperty=function(i,a){return this.getLayer(i).getPaintProperty(a)},R.prototype.setFeatureState=function(i,a){this._checkLoaded();var C=i.source,F=i.sourceLayer,q=this.sourceCaches[C];if(q!==void 0){var te=q.getSource().type;te==="geojson"&&F?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):te!=="vector"||F?(i.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),q.setFeatureState(F,i.id,a)):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 '"+C+"' does not exist in the map's style.")))},R.prototype.removeFeatureState=function(i,a){this._checkLoaded();var C=i.source,F=this.sourceCaches[C];if(F!==void 0){var q=F.getSource().type,te=q==="vector"?i.sourceLayer:void 0;q!=="vector"||te?a&&typeof i.id!="string"&&typeof i.id!="number"?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):F.removeFeatureState(te,i.id,a):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 '"+C+"' does not exist in the map's style.")))},R.prototype.getFeatureState=function(i){this._checkLoaded();var a=i.source,C=i.sourceLayer,F=this.sourceCaches[a];if(F!==void 0){if(F.getSource().type!=="vector"||C)return i.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),F.getFeatureState(C,i.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 '"+a+"' 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(i){return i.serialize()}),layers:this._serializeLayers(this._order)},function(i){return i!==void 0})},R.prototype._updateLayer=function(i){this._updatedLayers[i.id]=!0,i.source&&!this._updatedSources[i.source]&&this.sourceCaches[i.source].getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()),this._changed=!0},R.prototype._flattenAndSortRenderedFeatures=function(i){for(var a=this,C=function(Vn){return a._layers[Vn].type==="fill-extrusion"},F={},q=[],te=this._order.length-1;te>=0;te--){var ue=this._order[te];if(C(ue)){F[ue]=te;for(var ve=0,Ae=i;ve=0;bt--){var Ct=this._order[bt];if(C(Ct))for(var Mt=q.length-1;Mt>=0;Mt--){var Vt=q[Mt].feature;if(F[Vt.layer.id]24?(isFinite(C)&&(clearTimeout(Qr),Qr=setTimeout(ur,C)),xr=0):(xr=1,kn(ur))}function Zn(){for(var a=Date.now(),C=Or;C;)a>=C.t&&C.c(a-C.t)&&(C.c=null),C=C.n;return a}function cr(){for(var a,C=Or,F=1/0;C;)C.c?(C.t1&&(C=a[ue[ve-2]],F=a[ue[ve-1]],q=a[Ae],(F[0]-C[0])*(q[1]-C[1])-(F[1]-C[1])*(q[0]-C[0])<=0);)--ve;ue[ve++]=Ae}return ue.slice(0,ve)}function ai(a,C){return a[0]-C[0]||a[1]-C[1]}e.timer=function(){Cn.apply(this,arguments)},e.timer.flush=function(){Zn(),cr()},e.round=function(a,C){return C?Math.round(a*(C=Math.pow(10,C)))/C:Math.round(a)},e.geom={},e.geom.hull=function(a){var C=Ir,F=Er;if(arguments.length)return q(a);function q(te){if(te.length<3)return[];var ue,ve=hr(C),Ae=hr(F),Re=te.length,Ue=[],it=[];for(ue=0;ue=0;--ue)Mt.push(te[Ue[ct[ue]][2]]);for(ue=+bt;ueQe)Ae=Ae.L;else{if(!((te=ue-Ur(Ae,ve))>Qe)){q>-Qe?(C=Ae.P,F=Ae):te>-Qe?(C=Ae,F=Ae.N):C=F=Ae;break}if(!Ae.R){C=Ae;break}Ae=Ae.R}var Re=An(a);if(Un.insert(C,Re),C||F){if(C===F)return Jr(C),F=An(C.site),Un.insert(Re,F),Re.edge=F.edge=Yr(C.site,Re.site),Cr(C),void Cr(F);if(F){Jr(C),Jr(F);var Ue=C.site,it=Ue.x,ct=Ue.y,dt=a.x-it,bt=a.y-ct,Ct=F.site,Mt=Ct.x-it,Ut=Ct.y-ct,It=2*(dt*Ut-bt*Mt),Qt=dt*dt+bt*bt,tn=Mt*Mt+Ut*Ut,Yt={x:(Ut*Qt-bt*tn)/It+it,y:(dt*tn-Mt*Qt)/It+ct};oi(F.edge,Ue,Ct,Yt),Re.edge=Yr(Ue,a,null,Yt),F.edge=Yr(a,Ct,null,Yt),Cr(C),Cr(F)}else Re.edge=Yr(C.site,Re.site)}}function yr(a,C){var F=a.site,q=F.x,te=F.y,ue=te-C;if(!ue)return q;var ve=a.P;if(!ve)return-1/0;var Ae=(F=ve.site).x,Re=F.y,Ue=Re-C;if(!Ue)return Ae;var it=Ae-q,ct=1/ue-1/Ue,dt=it/Ue;return ct?(-dt+Math.sqrt(dt*dt-2*ct*(it*it/(-2*Ue)-Re+Ue/2+te-ue/2)))/ct+q:(q+Ae)/2}function Ur(a,C){var F=a.N;if(F)return yr(F,C);var q=a.site;return q.y===C?q.x:1/0}function Rr(a){this.site=a,this.edges=[]}function $r(a,C){return C.angle-a.angle}function Pr(){Pa(this),this.x=this.y=this.arc=this.site=this.cy=null}function Cr(a){var C=a.P,F=a.N;if(C&&F){var q=C.site,te=a.site,ue=F.site;if(q!==ue){var ve=te.x,Ae=te.y,Re=q.x-ve,Ue=q.y-Ae,it=ue.x-ve,ct=2*(Re*(Ut=ue.y-Ae)-Ue*it);if(!(ct>=-pt)){var dt=Re*Re+Ue*Ue,bt=it*it+Ut*Ut,Ct=(Ut*dt-Ue*bt)/ct,Mt=(Re*bt-it*dt)/ct,Ut=Mt+Ae,It=dn.pop()||new Pr;It.arc=a,It.site=te,It.x=Ct+ve,It.y=Ut+Math.sqrt(Ct*Ct+Mt*Mt),It.cy=Ut,a.circle=It;for(var Qt=null,tn=Wn._;tn;)if(It.y=Ae)return;if(dt>Ct){if(ue){if(ue.y>=Ue)return}else ue={x:Ut,y:Re};F={x:Ut,y:Ue}}else{if(ue){if(ue.y1)if(dt>Ct){if(ue){if(ue.y>=Ue)return}else ue={x:(Re-te)/q,y:Re};F={x:(Ue-te)/q,y:Ue}}else{if(ue){if(ue.y=Ae)return}else ue={x:ve,y:q*ve+te};F={x:Ae,y:q*Ae+te}}else{if(ue){if(ue.x0)){if(It/=Hn,Hn<0){if(It0){if(It>Vn)return;It>Mn&&(Mn=It)}if(It=ct-Yt,Hn||!(It<0)){if(It/=Hn,Hn<0){if(It>Vn)return;It>Mn&&(Mn=It)}else if(Hn>0){if(It0)){if(It/=Xn,Xn<0){if(It0){if(It>Vn)return;It>Mn&&(Mn=It)}if(It=dt-vn,Xn||!(It<0)){if(It/=Xn,Xn<0){if(It>Vn)return;It>Mn&&(Mn=It)}else if(Xn>0){if(It0&&(Ut.a={x:Yt+Mn*Hn,y:vn+Mn*Xn}),Vn<1&&(Ut.b={x:Yt+Vn*Hn,y:vn+Vn*Xn}),Ut}}}}}),Mt=bt.length;Mt--;)(!gi(Re=bt[Mt],Ae)||!Ct(Re)||v(Re.a.x-Re.b.x)Qe||v(ct-Ue)>Qe)&&(Ct.splice(bt,0,new Ti((Hn=dt.site,Xn=It,rr=v(it-Qt)Qe?{x:Qt,y:v(Re-Qt)Qe?{x:v(Ue-vn)Qe?{x:tn,y:v(Re-tn)Qe?{x:v(Ue-Yt)=it&&It.x<=dt&&It.y>=ct&&It.y<=bt?[[it,bt],[dt,bt],[dt,ct],[it,ct]]:[]).point=Re[Mt]}),Ue}function Ae(Re){return Re.map(function(Ue,it){return{x:Math.round(q(Ue,it)/Qe)*Qe,y:Math.round(te(Ue,it)/Qe)*Qe,i:it}})}return ve.links=function(Re){return Oa(Ae(Re)).edges.filter(function(Ue){return Ue.l&&Ue.r}).map(function(Ue){return{source:Re[Ue.l.i],target:Re[Ue.r.i]}})},ve.triangles=function(Re){var Ue=[];return Oa(Ae(Re)).cells.forEach(function(it,ct){for(var dt,bt,Ct,Mt,Ut=it.site,It=it.edges.sort($r),Qt=-1,tn=It.length,Yt=It[tn-1].edge,vn=Yt.l===Ut?Yt.r:Yt.l;++Qtue&&(te=C.slice(ue,te),Ae[ve]?Ae[ve]+=te:Ae[++ve]=te),(F=F[0])===(q=q[0])?Ae[ve]?Ae[ve]+=q:Ae[++ve]=q:(Ae[++ve]=null,Re.push({i:ve,x:Ta(F,q)})),ue=Ql.lastIndex;return ueIt&&(It=it.x),it.y>Qt&&(Qt=it.y),ct.push(it.x),dt.push(it.y);else for(bt=0;btIt&&(It=vn),Mn>Qt&&(Qt=Mn),ct.push(vn),dt.push(Mn)}var Vn=It-Mt,Hn=Qt-Ut;function Xn(nr,Lr,dr,Br,Sr,Vr,fi,Nr){if(!isNaN(dr)&&!isNaN(Br))if(nr.leaf){var si=nr.x,_i=nr.y;if(si!=null)if(v(si-dr)+v(_i-Br)<.01)rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr);else{var Gi=nr.point;nr.x=nr.y=nr.point=null,rr(nr,Gi,si,_i,Sr,Vr,fi,Nr),rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr)}else nr.x=dr,nr.y=Br,nr.point=Lr}else rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr)}function rr(nr,Lr,dr,Br,Sr,Vr,fi,Nr){var si=.5*(Sr+fi),_i=.5*(Vr+Nr),Gi=dr>=si,Pi=Br>=_i,Ji=Pi<<1|Gi;nr.leaf=!1,Gi?Sr=si:fi=si,Pi?Vr=_i:Nr=_i,Xn(nr=nr.nodes[Ji]||(nr.nodes[Ji]={leaf:!0,nodes:[],point:null,x:null,y:null}),Lr,dr,Br,Sr,Vr,fi,Nr)}Vn>Hn?Qt=Ut+Vn:It=Mt+Hn;var Mr={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(nr){Xn(Mr,nr,+tn(nr,++bt),+Yt(nr,bt),Mt,Ut,It,Qt)}};if(Mr.visit=function(nr){To(nr,Mr,Mt,Ut,It,Qt)},Mr.find=function(nr){return function(Lr,dr,Br,Sr,Vr,fi,Nr){var si,_i=1/0;return function Gi(Pi,Ji,Yi,na,Ma){if(!(Ji>fi||Yi>Nr||na=wa)<<1|dr>=Ra,qa=Fa+4;Fa=0&&!(F=e.interpolators[q](a,C)););return F}function eu(a,C){var F,q=[],te=[],ue=a.length,ve=C.length,Ae=Math.min(a.length,C.length);for(F=0;F=1)return 1;var C=a*a,F=C*a;return 4*(a<.5?F:3*(a-C)+F-.75)}function jl(a){return 1-Math.cos(a*at)}function Ul(a){return Math.pow(2,10*(a-1))}function Vl(a){return 1-Math.sqrt(1-a*a)}function vs(a){return a<.36363636363636365?7.5625*a*a:a<.7272727272727273?7.5625*(a-=.5454545454545454)*a+.75:a<.9090909090909091?7.5625*(a-=.8181818181818182)*a+.9375:7.5625*(a-=.9545454545454546)*a+.984375}function Ju(a,C){return C-=a,function(F){return Math.round(a+C*F)}}function ju(a){var C,F,q,te=[a.a,a.b],ue=[a.c,a.d],ve=pc(te),Ae=Su(te,ue),Re=pc(((C=ue)[0]+=(q=-Ae)*(F=te)[0],C[1]+=q*F[1],C))||0;te[0]*ue[1]=0?a.slice(0,F):a,te=F>=0?a.slice(F+1):"in";return q=Za.get(q)||vl,te=ko.get(te)||ee,C=te(q.apply(null,w.call(arguments,1))),function(ue){return ue<=0?0:ue>=1?1:C(ue)}},e.interpolateHcl=function(a,C){a=e.hcl(a),C=e.hcl(C);var F=a.h,q=a.c,te=a.l,ue=C.h-F,ve=C.c-q,Ae=C.l-te;return isNaN(ve)&&(ve=0,q=isNaN(q)?C.c:q),isNaN(ue)?(ue=0,F=isNaN(F)?C.h:F):ue>180?ue-=360:ue<-180&&(ue+=360),function(Re){return qt(F+ue*Re,q+ve*Re,te+Ae*Re)+""}},e.interpolateHsl=function(a,C){a=e.hsl(a),C=e.hsl(C);var F=a.h,q=a.s,te=a.l,ue=C.h-F,ve=C.s-q,Ae=C.l-te;return isNaN(ve)&&(ve=0,q=isNaN(q)?C.s:q),isNaN(ue)?(ue=0,F=isNaN(F)?C.h:F):ue>180?ue-=360:ue<-180&&(ue+=360),function(Re){return Ft(F+ue*Re,q+ve*Re,te+Ae*Re)+""}},e.interpolateLab=function(a,C){a=e.lab(a),C=e.lab(C);var F=a.l,q=a.a,te=a.b,ue=C.l-F,ve=C.a-q,Ae=C.b-te;return function(Re){return Dn(F+ue*Re,q+ve*Re,te+Ae*Re)+""}},e.interpolateRound=Ju,e.transform=function(a){var C=_.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(F){if(F!=null){C.setAttribute("transform",F);var q=C.transform.baseVal.consolidate()}return new ju(q?q.matrix:Rs)})(a)},ju.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Rs={a:1,b:0,c:0,d:1,e:0,f:0};function Vs(a){return a.length?a.pop()+",":""}function Uu(a,C){var F=[],q=[];return a=e.transform(a),C=e.transform(C),function(te,ue,ve,Ae){if(te[0]!==ue[0]||te[1]!==ue[1]){var Re=ve.push("translate(",null,",",null,")");Ae.push({i:Re-4,x:Ta(te[0],ue[0])},{i:Re-2,x:Ta(te[1],ue[1])})}else(ue[0]||ue[1])&&ve.push("translate("+ue+")")}(a.translate,C.translate,F,q),function(te,ue,ve,Ae){te!==ue?(te-ue>180?ue+=360:ue-te>180&&(te+=360),Ae.push({i:ve.push(Vs(ve)+"rotate(",null,")")-2,x:Ta(te,ue)})):ue&&ve.push(Vs(ve)+"rotate("+ue+")")}(a.rotate,C.rotate,F,q),function(te,ue,ve,Ae){te!==ue?Ae.push({i:ve.push(Vs(ve)+"skewX(",null,")")-2,x:Ta(te,ue)}):ue&&ve.push(Vs(ve)+"skewX("+ue+")")}(a.skew,C.skew,F,q),function(te,ue,ve,Ae){if(te[0]!==ue[0]||te[1]!==ue[1]){var Re=ve.push(Vs(ve)+"scale(",null,",",null,")");Ae.push({i:Re-4,x:Ta(te[0],ue[0])},{i:Re-2,x:Ta(te[1],ue[1])})}else ue[0]===1&&ue[1]===1||ve.push(Vs(ve)+"scale("+ue+")")}(a.scale,C.scale,F,q),a=C=null,function(te){for(var ue,ve=-1,Ae=q.length;++ve0?F=Yt:(a.c=null,a.t=NaN,a=null,Ae.end({type:"end",alpha:F=0})):Yt>0&&(Ae.start({type:"start",alpha:F=Yt}),a=Cn(ve.tick)),ve):F},ve.start=function(){var Yt,vn,Mn,Vn=Ut.length,Hn=It.length,Xn=Re[0],rr=Re[1];for(Yt=0;Yt=0;)F.push(te[q])}function _a(a,C){for(var F=[a],q=[];(a=F.pop())!=null;)if(q.push(a),(ue=a.children)&&(te=ue.length))for(var te,ue,ve=-1;++ve=0;)ve.push(it=Ue[Re]),it.parent=ue,it.depth=ue.depth+1;F&&(ue.value=0),ue.children=Ue}else F&&(ue.value=+F.call(q,ue,ue.depth)||0),delete ue.children;return _a(te,function(ct){var dt,bt;a&&(dt=ct.children)&&dt.sort(a),F&&(bt=ct.parent)&&(bt.value+=ct.value)}),Ae}return q.sort=function(te){return arguments.length?(a=te,q):a},q.children=function(te){return arguments.length?(C=te,q):C},q.value=function(te){return arguments.length?(F=te,q):F},q.revalue=function(te){return F&&(Bo(te,function(ue){ue.children&&(ue.value=0)}),_a(te,function(ue){var ve;ue.children||(ue.value=+F.call(q,ue,ue.depth)||0),(ve=ue.parent)&&(ve.value+=ue.value)})),te},q},e.layout.partition=function(){var a=e.layout.hierarchy(),C=[1,1];function F(ue,ve,Ae,Re){var Ue=ue.children;if(ue.x=ve,ue.y=ue.depth*Re,ue.dx=Ae,ue.dy=Re,Ue&&(it=Ue.length)){var it,ct,dt,bt=-1;for(Ae=ue.value?Ae/ue.value:0;++btAe&&(Ae=q),ve.push(q)}for(F=0;Fte&&(q=F,te=C);return q}function Zr(a){return a.reduce(Li,0)}function Li(a,C){return a+C[1]}function ia(a,C){return sa(a,Math.ceil(Math.log(C.length)/Math.LN2+1))}function sa(a,C){for(var F=-1,q=+a[0],te=(a[1]-q)/C,ue=[];++F<=C;)ue[F]=te*F+q;return ue}function po(a){return[e.min(a),e.max(a)]}function ro(a,C){return a.value-C.value}function mu(a,C){var F=a._pack_next;a._pack_next=C,C._pack_prev=a,C._pack_next=F,F._pack_prev=C}function qu(a,C){a._pack_next=C,C._pack_prev=a}function ls(a,C){var F=C.x-a.x,q=C.y-a.y,te=a.r+C.r;return .999*te*te>F*F+q*q}function Ws(a){if((C=a.children)&&(Re=C.length)){var C,F,q,te,ue,ve,Ae,Re,Ue=1/0,it=-1/0,ct=1/0,dt=-1/0;if(C.forEach(bl),(F=C[0]).x=-F.r,F.y=0,tn(F),Re>1&&((q=C[1]).x=q.r,q.y=0,tn(q),Re>2))for(La(F,q,te=C[2]),tn(te),mu(F,te),F._pack_prev=te,mu(te,q),q=F._pack_next,ue=3;ue0)for(ve=-1;++ve=ct[0]&&Re<=ct[1]&&((Ae=Ue[e.bisect(dt,Re,1,Ct)-1]).y+=Mt,Ae.push(ue[ve]));return Ue}return te.value=function(ue){return arguments.length?(C=ue,te):C},te.range=function(ue){return arguments.length?(F=hr(ue),te):F},te.bins=function(ue){return arguments.length?(q=typeof ue=="number"?function(ve){return sa(ve,ue)}:hr(ue),te):q},te.frequency=function(ue){return arguments.length?(a=!!ue,te):a},te},e.layout.pack=function(){var a,C=e.layout.hierarchy().sort(ro),F=0,q=[1,1];function te(ue,ve){var Ae=C.call(this,ue,ve),Re=Ae[0],Ue=q[0],it=q[1],ct=a==null?Math.sqrt:typeof a=="function"?a:function(){return a};if(Re.x=Re.y=0,_a(Re,function(bt){bt.r=+ct(bt.value)}),_a(Re,Ws),F){var dt=F*(a?1:Math.max(2*Re.r/Ue,2*Re.r/it))/2;_a(Re,function(bt){bt.r+=dt}),_a(Re,Ws),_a(Re,function(bt){bt.r-=dt})}return vu(Re,Ue/2,it/2,a?1:1/Math.max(2*Re.r/Ue,2*Re.r/it)),Ae}return te.size=function(ue){return arguments.length?(q=ue,te):q},te.radius=function(ue){return arguments.length?(a=ue==null||typeof ue=="function"?ue:+ue,te):a},te.padding=function(ue){return arguments.length?(F=+ue,te):F},qo(te,C)},e.layout.tree=function(){var a=e.layout.hierarchy().sort(null).value(null),C=ba,F=[1,1],q=null;function te(Re,Ue){var it=a.call(this,Re,Ue),ct=it[0],dt=function(tn){for(var Yt,vn={A:null,children:[tn]},Mn=[vn];(Yt=Mn.pop())!=null;)for(var Vn,Hn=Yt.children,Xn=0,rr=Hn.length;XnCt.x&&(Ct=tn),tn.depth>Mt.depth&&(Mt=tn)});var Ut=C(bt,Ct)/2-bt.x,It=F[0]/(Ct.x+C(Ct,bt)/2+Ut),Qt=F[1]/(Mt.depth||1);Bo(ct,function(tn){tn.x=(tn.x+Ut)*It,tn.y=tn.depth*Qt})}return it}function ue(Re){var Ue=Re.children,it=Re.parent.children,ct=Re.i?it[Re.i-1]:null;if(Ue.length){(function(bt){for(var Ct,Mt=0,Ut=0,It=bt.children,Qt=It.length;--Qt>=0;)(Ct=It[Qt]).z+=Mt,Ct.m+=Mt,Mt+=Ct.s+(Ut+=Ct.c)})(Re);var dt=(Ue[0].z+Ue[Ue.length-1].z)/2;ct?(Re.z=ct.z+C(Re._,ct._),Re.m=Re.z-dt):Re.z=dt}else ct&&(Re.z=ct.z+C(Re._,ct._));Re.parent.A=function(bt,Ct,Mt){if(Ct){for(var Ut,It=bt,Qt=bt,tn=Ct,Yt=It.parent.children[0],vn=It.m,Mn=Qt.m,Vn=tn.m,Hn=Yt.m;tn=Ts(tn),It=Ho(It),tn&&It;)Yt=Ho(Yt),(Qt=Ts(Qt)).a=bt,(Ut=tn.z+Vn-It.z-vn+C(tn._,It._))>0&&(Aa(Ua(tn,bt,Mt),bt,Ut),vn+=Ut,Mn+=Ut),Vn+=tn.m,vn+=It.m,Hn+=Yt.m,Mn+=Qt.m;tn&&!Ts(Qt)&&(Qt.t=tn,Qt.m+=Vn-Mn),It&&!Ho(Yt)&&(Yt.t=It,Yt.m+=vn-Hn,Mt=bt)}return Mt}(Re,ct,Re.parent.A||it[0])}function ve(Re){Re._.x=Re.z+Re.parent.m,Re.m+=Re.parent.m}function Ae(Re){Re.x*=F[0],Re.y=Re.depth*F[1]}return te.separation=function(Re){return arguments.length?(C=Re,te):C},te.size=function(Re){return arguments.length?(q=(F=Re)==null?Ae:null,te):q?null:F},te.nodeSize=function(Re){return arguments.length?(q=(F=Re)==null?null:Ae,te):q?F:null},qo(te,a)},e.layout.cluster=function(){var a=e.layout.hierarchy().sort(null).value(null),C=ba,F=[1,1],q=!1;function te(ue,ve){var Ae,Re=a.call(this,ue,ve),Ue=Re[0],it=0;_a(Ue,function(Mt){var Ut=Mt.children;Ut&&Ut.length?(Mt.x=function(It){return It.reduce(function(Qt,tn){return Qt+tn.x},0)/It.length}(Ut),Mt.y=function(It){return 1+e.max(It,function(Qt){return Qt.y})}(Ut)):(Mt.x=Ae?it+=C(Mt,Ae):0,Mt.y=0,Ae=Mt)});var ct=wl(Ue),dt=ic(Ue),bt=ct.x-C(ct,dt)/2,Ct=dt.x+C(dt,ct)/2;return _a(Ue,q?function(Mt){Mt.x=(Mt.x-Ue.x)*F[0],Mt.y=(Ue.y-Mt.y)*F[1]}:function(Mt){Mt.x=(Mt.x-bt)/(Ct-bt)*F[0],Mt.y=(1-(Ue.y?Mt.y/Ue.y:1))*F[1]}),Re}return te.separation=function(ue){return arguments.length?(C=ue,te):C},te.size=function(ue){return arguments.length?(q=(F=ue)==null,te):q?null:F},te.nodeSize=function(ue){return arguments.length?(q=(F=ue)!=null,te):q?F:null},qo(te,a)},e.layout.treemap=function(){var a,C=e.layout.hierarchy(),F=Math.round,q=[1,1],te=null,ue=nu,ve=!1,Ae="squarify",Re=.5*(1+Math.sqrt(5));function Ue(Mt,Ut){for(var It,Qt,tn=-1,Yt=Mt.length;++tn0;)vn.push(It=Mn[tn-1]),vn.area+=It.area,Ae!=="squarify"||(Qt=dt(vn,Hn))<=Vn?(Mn.pop(),Vn=Qt):(vn.area-=vn.pop().area,bt(vn,Hn,Yt,!1),Hn=Math.min(Yt.dx,Yt.dy),vn.length=vn.area=0,Vn=1/0);vn.length&&(bt(vn,Hn,Yt,!0),vn.length=vn.area=0),Ut.forEach(it)}}function ct(Mt){var Ut=Mt.children;if(Ut&&Ut.length){var It,Qt=ue(Mt),tn=Ut.slice(),Yt=[];for(Ue(tn,Qt.dx*Qt.dy/Mt.value),Yt.area=0;It=tn.pop();)Yt.push(It),Yt.area+=It.area,It.z!=null&&(bt(Yt,It.z?Qt.dx:Qt.dy,Qt,!tn.length),Yt.length=Yt.area=0);Ut.forEach(ct)}}function dt(Mt,Ut){for(var It,Qt=Mt.area,tn=0,Yt=1/0,vn=-1,Mn=Mt.length;++vntn&&(tn=It));return Ut*=Ut,(Qt*=Qt)?Math.max(Ut*tn*Re/Qt,Qt/(Ut*Yt*Re)):1/0}function bt(Mt,Ut,It,Qt){var tn,Yt=-1,vn=Mt.length,Mn=It.x,Vn=It.y,Hn=Ut?F(Mt.area/Ut):0;if(Ut==It.dx){for((Qt||Hn>It.dy)&&(Hn=It.dy);++YtIt.dx)&&(Hn=It.dx);++Yt1);return a+C*q*Math.sqrt(-2*Math.log(ue)/ue)}},logNormal:function(){var a=e.random.normal.apply(e,arguments);return function(){return Math.exp(a())}},bates:function(a){var C=e.random.irwinHall(a);return function(){return C()/a}},irwinHall:function(a){return function(){for(var C=0,F=0;F2?Xa:No,Ue=q?Fo:gh;return te=Re(a,C,Ue,F),ue=Re(C,a,Ue,ss),Ae}function Ae(Re){return te(Re)}return Ae.invert=function(Re){return ue(Re)},Ae.domain=function(Re){return arguments.length?(a=Re.map(Number),ve()):a},Ae.range=function(Re){return arguments.length?(C=Re,ve()):C},Ae.rangeRound=function(Re){return Ae.range(Re).interpolate(Ju)},Ae.clamp=function(Re){return arguments.length?(q=Re,ve()):q},Ae.interpolate=function(Re){return arguments.length?(F=Re,ve()):F},Ae.ticks=function(Re){return Ko(a,Re)},Ae.tickFormat=function(Re,Ue){return d3_scale_linearTickFormat(a,Re,Ue)},Ae.nice=function(Re){return Ao(a,Re),ve()},Ae.copy=function(){return Co(a,C,F,q)},ve()}function ka(a,C){return e.rebind(a,C,"range","rangeRound","interpolate","clamp")}function Ao(a,C){return Wl(a,Eu(Va(a,C)[2])),Wl(a,Eu(Va(a,C)[2])),a}function Va(a,C){C==null&&(C=10);var F=Gl(a),q=F[1]-F[0],te=Math.pow(10,Math.floor(Math.log(q/C)/Math.LN10)),ue=C/q*te;return ue<=.15?te*=10:ue<=.35?te*=5:ue<=.75&&(te*=2),F[0]=Math.ceil(F[0]/te)*te,F[1]=Math.floor(F[1]/te)*te+.5*te,F[2]=te,F}function Ko(a,C){return e.range.apply(e,Va(a,C))}function cs(a,C,F,q){function te(Ae){return(F?Math.log(Ae<0?0:Ae):-Math.log(Ae>0?0:-Ae))/Math.log(C)}function ue(Ae){return F?Math.pow(C,Ae):-Math.pow(C,-Ae)}function ve(Ae){return a(te(Ae))}return ve.invert=function(Ae){return ue(a.invert(Ae))},ve.domain=function(Ae){return arguments.length?(F=Ae[0]>=0,a.domain((q=Ae.map(Number)).map(te)),ve):q},ve.base=function(Ae){return arguments.length?(C=+Ae,a.domain(q.map(te)),ve):C},ve.nice=function(){var Ae=Wl(q.map(te),F?Math:rl);return a.domain(Ae),q=Ae.map(ue),ve},ve.ticks=function(){var Ae=Gl(q),Re=[],Ue=Ae[0],it=Ae[1],ct=Math.floor(te(Ue)),dt=Math.ceil(te(it)),bt=C%1?2:C;if(isFinite(dt-ct)){if(F){for(;ct0;Ct--)Re.push(ue(ct)*Ct);for(ct=0;Re[ct]it;dt--);Re=Re.slice(ct,dt)}return Re},ve.copy=function(){return cs(a.copy(),C,F,q)},ka(ve,a)}e.scale.linear=function(){return Co([0,1],[0,1],ss,!1)},e.scale.log=function(){return cs(e.scale.linear().domain([0,1]),10,!0,[1,10])};var rl={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};function xs(a,C,F){var q=Zl(C),te=Zl(1/C);function ue(ve){return a(q(ve))}return ue.invert=function(ve){return te(a.invert(ve))},ue.domain=function(ve){return arguments.length?(a.domain((F=ve.map(Number)).map(q)),ue):F},ue.ticks=function(ve){return Ko(F,ve)},ue.tickFormat=function(ve,Ae){return d3_scale_linearTickFormat(F,ve,Ae)},ue.nice=function(ve){return ue.domain(Ao(F,ve))},ue.exponent=function(ve){return arguments.length?(q=Zl(C=ve),te=Zl(1/C),a.domain(F.map(q)),ue):C},ue.copy=function(){return xs(a.copy(),C,F)},ka(ue,a)}function Zl(a){return function(C){return C<0?-Math.pow(-C,a):Math.pow(C,a)}}function _s(a,C){var F,q,te;function ue(Ae){return q[((F.get(Ae)||(C.t==="range"?F.set(Ae,a.push(Ae)):NaN))-1)%q.length]}function ve(Ae,Re){return e.range(a.length).map(function(Ue){return Ae+Re*Ue})}return ue.domain=function(Ae){if(!arguments.length)return a;a=[],F=new T;for(var Re,Ue=-1,it=Ae.length;++Ue0?F[ue-1]:a[0],uedt?0:1;if(it=Pt)return Re(it,Ct)+(Ue?Re(Ue,1-Ct):"")+"Z";var Mt,Ut,It,Qt,tn,Yt,vn,Mn,Vn,Hn,Xn,rr,Mr=0,nr=0,Lr=[];if((Qt=(+ve.apply(this,arguments)||0)/2)&&(It=q===Al?Math.sqrt(Ue*Ue+it*it):+q.apply(this,arguments),Ct||(nr*=-1),it&&(nr=ut(It/it*Math.sin(Qt))),Ue&&(Mr=ut(It/Ue*Math.sin(Qt)))),it){tn=it*Math.cos(ct+nr),Yt=it*Math.sin(ct+nr),vn=it*Math.cos(dt-nr),Mn=it*Math.sin(dt-nr);var dr=Math.abs(dt-ct-2*nr)<=yt?0:1;if(nr&&al(tn,Yt,vn,Mn)===Ct^dr){var Br=(ct+dt)/2;tn=it*Math.cos(Br),Yt=it*Math.sin(Br),vn=Mn=null}}else tn=Yt=0;if(Ue){Vn=Ue*Math.cos(dt-Mr),Hn=Ue*Math.sin(dt-Mr),Xn=Ue*Math.cos(ct+Mr),rr=Ue*Math.sin(ct+Mr);var Sr=Math.abs(ct-dt+2*Mr)<=yt?0:1;if(Mr&&al(Vn,Hn,Xn,rr)===1-Ct^Sr){var Vr=(ct+dt)/2;Vn=Ue*Math.cos(Vr),Hn=Ue*Math.sin(Vr),Xn=rr=null}}else Vn=Hn=0;if(bt>Qe&&(Mt=Math.min(Math.abs(it-Ue)/2,+F.apply(this,arguments)))>.001){Ut=Ue0?0:1}function Na(a,C,F,q,te){var ue=a[0]-C[0],ve=a[1]-C[1],Ae=(te?q:-q)/Math.sqrt(ue*ue+ve*ve),Re=Ae*ve,Ue=-Ae*ue,it=a[0]+Re,ct=a[1]+Ue,dt=C[0]+Re,bt=C[1]+Ue,Ct=(it+dt)/2,Mt=(ct+bt)/2,Ut=dt-it,It=bt-ct,Qt=Ut*Ut+It*It,tn=F-q,Yt=it*bt-dt*ct,vn=(It<0?-1:1)*Math.sqrt(Math.max(0,tn*tn*Qt-Yt*Yt)),Mn=(Yt*It-Ut*vn)/Qt,Vn=(-Yt*Ut-It*vn)/Qt,Hn=(Yt*It+Ut*vn)/Qt,Xn=(-Yt*Ut+It*vn)/Qt,rr=Mn-Ct,Mr=Vn-Mt,nr=Hn-Ct,Lr=Xn-Mt;return rr*rr+Mr*Mr>nr*nr+Lr*Lr&&(Mn=Hn,Vn=Xn),[[Mn-Re,Vn-Ue],[Mn*F/tn,Vn*F/tn]]}function Ns(){return!0}function iu(a){var C=Ir,F=Er,q=Ns,te=ks,ue=te.key,ve=.7;function Ae(Re){var Ue,it=[],ct=[],dt=-1,bt=Re.length,Ct=hr(C),Mt=hr(F);function Ut(){it.push("M",te(a(ct),ve))}for(;++dt1&&te.push("H",q[0]),te.join("")},"step-before":As,"step-after":Jo,basis:ya,"basis-open":function(a){if(a.length<4)return ks(a);for(var C,F=[],q=-1,te=a.length,ue=[0],ve=[0];++q<3;)C=a[q],ue.push(C[0]),ve.push(C[1]);for(F.push(So(Qo,ue)+","+So(Qo,ve)),--q;++q9&&(ue=3*F/Math.sqrt(ue),Ae[Re]=ue*q,Ae[Re+1]=ue*te);for(Re=-1;++Re<=Ue;)ue=(C[Math.min(Ue,Re+1)][0]-C[Math.max(0,Re-1)][0])/(6*(1+Ae[Re]*Ae[Re])),ve.push([ue||0,Ae[Re]*ue||0]);return ve}(a))}});function ks(a){return a.length>1?a.join("L"):a+"Z"}function au(a){return a.join("L")+"Z"}function As(a){for(var C=0,F=a.length,q=a[0],te=[q[0],",",q[1]];++C1){Ae=C[1],ue=a[Re],Re++,q+="C"+(te[0]+ve[0])+","+(te[1]+ve[1])+","+(ue[0]-Ae[0])+","+(ue[1]-Ae[1])+","+ue[0]+","+ue[1];for(var Ue=2;Ueyt)+",1 "+it}function Re(Ue,it,ct,dt){return"Q 0,0 "+dt}return ue.radius=function(Ue){return arguments.length?(F=hr(Ue),ue):F},ue.source=function(Ue){return arguments.length?(a=hr(Ue),ue):a},ue.target=function(Ue){return arguments.length?(C=hr(Ue),ue):C},ue.startAngle=function(Ue){return arguments.length?(q=hr(Ue),ue):q},ue.endAngle=function(Ue){return arguments.length?(te=hr(Ue),ue):te},ue},e.svg.diagonal=function(){var a=xu,C=sl,F=dc;function q(te,ue){var ve=a.call(this,te,ue),Ae=C.call(this,te,ue),Re=(ve.y+Ae.y)/2,Ue=[ve,{x:ve.x,y:Re},{x:Ae.x,y:Re},Ae];return"M"+(Ue=Ue.map(F))[0]+"C"+Ue[1]+" "+Ue[2]+" "+Ue[3]}return q.source=function(te){return arguments.length?(a=hr(te),q):a},q.target=function(te){return arguments.length?(C=hr(te),q):C},q.projection=function(te){return arguments.length?(F=te,q):F},q},e.svg.diagonal.radial=function(){var a=e.svg.diagonal(),C=dc,F=a.projection;return a.projection=function(q){return arguments.length?F(function(te){return function(){var ue=te.apply(this,arguments),ve=ue[0],Ae=ue[1]-at;return[ve*Math.cos(Ae),ve*Math.sin(Ae)]}}(C=q)):C},a},e.svg.symbol=function(){var a=ou,C=$s;function F(q,te){return(Cl.get(a.call(this,q,te))||eo)(C.call(this,q,te))}return F.type=function(q){return arguments.length?(a=hr(q),F):a},F.size=function(q){return arguments.length?(C=hr(q),F):C},F};var Cl=e.map({circle:eo,cross:function(a){var C=Math.sqrt(a/5)/2;return"M"+-3*C+","+-C+"H"+-C+"V"+-3*C+"H"+C+"V"+-C+"H"+3*C+"V"+C+"H"+C+"V"+3*C+"H"+-C+"V"+C+"H"+-3*C+"Z"},diamond:function(a){var C=Math.sqrt(a/(2*Fi)),F=C*Fi;return"M0,"+-C+"L"+F+",0 0,"+C+" "+-F+",0Z"},square:function(a){var C=Math.sqrt(a)/2;return"M"+-C+","+-C+"L"+C+","+-C+" "+C+","+C+" "+-C+","+C+"Z"},"triangle-down":function(a){var C=Math.sqrt(a/di),F=C*di/2;return"M0,"+F+"L"+C+","+-F+" "+-C+","+-F+"Z"},"triangle-up":function(a){var C=Math.sqrt(a/di),F=C*di/2;return"M0,"+-F+"L"+C+","+F+" "+-C+","+F+"Z"}});e.svg.symbolTypes=Cl.keys();var di=Math.sqrt(3),Fi=Math.tan(30*lt);be.transition=function(a){for(var C,F,q=ho||++Ys,te=xa(a),ue=[],ve=_u||{time:Date.now(),ease:xl,delay:0,duration:250},Ae=-1,Re=this.length;++Ae0;)Ue[--It].call(a,Ut);if(Mt>=1)return ct.event&&ct.event.end.call(a,a.__data__,C),--it.count?delete it[q]:delete a[F],1}ct||(ue=te.time,ve=Cn(function(Ct){var Mt=ct.delay;if(ve.t=Mt+ue,Mt<=Ct)return dt(Ct-Mt);ve.c=dt},0,ue),ct=it[q]={tween:new T,time:ue,timer:ve,delay:te.delay,duration:te.duration,ease:te.ease,index:C},te=null,++it.count)}da.call=be.call,da.empty=be.empty,da.node=be.node,da.size=be.size,e.transition=function(a,C){return a&&a.transition?ho?a.transition(C):a:e.selection().transition(a)},e.transition.prototype=da,da.select=function(a){var C,F,q,te=this.id,ue=this.namespace,ve=[];a=Se(a);for(var Ae=-1,Re=this.length;++Aerect,.s>rect").attr("width",ue[1]-ue[0])}function bt(Mt){Mt.select(".extent").attr("y",ve[0]),Mt.selectAll(".extent,.e>rect,.w>rect").attr("height",ve[1]-ve[0])}function Ct(){var Mt,Ut,It=this,Qt=e.select(e.event.target),tn=F.of(It,arguments),Yt=e.select(It),vn=Qt.datum(),Mn=!/^(n|s)$/.test(vn)&&q,Vn=!/^(e|w)$/.test(vn)&&te,Hn=Qt.classed("extent"),Xn=Vt(It),rr=e.mouse(It),Mr=e.select(r(It)).on("keydown.brush",function(){e.event.keyCode==32&&(Hn||(Mt=null,rr[0]-=ue[1],rr[1]-=ve[1],Hn=2),se())}).on("keyup.brush",function(){e.event.keyCode==32&&Hn==2&&(rr[0]+=ue[1],rr[1]+=ve[1],Hn=0,se())});if(e.event.changedTouches?Mr.on("touchmove.brush",dr).on("touchend.brush",Sr):Mr.on("mousemove.brush",dr).on("mouseup.brush",Sr),Yt.interrupt().selectAll("*").interrupt(),Hn)rr[0]=ue[0]-rr[0],rr[1]=ve[0]-rr[1];else if(vn){var nr=+/w$/.test(vn),Lr=+/^n/.test(vn);Ut=[ue[1-nr]-rr[0],ve[1-Lr]-rr[1]],rr[0]=ue[nr],rr[1]=ve[Lr]}else e.event.altKey&&(Mt=rr.slice());function dr(){var Vr=e.mouse(It),fi=!1;Ut&&(Vr[0]+=Ut[0],Vr[1]+=Ut[1]),Hn||(e.event.altKey?(Mt||(Mt=[(ue[0]+ue[1])/2,(ve[0]+ve[1])/2]),rr[0]=ue[+(Vr[0](we=1))return we;for(;reKe?re=je:we=je,je=.5*(we-re)+re}return je},u.prototype.solve=function(P,G){return this.sampleCurveY(this.solveCurveX(P,G))};var r=n;function n(P,G){this.x=P,this.y=G}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(P){return this.clone()._add(P)},sub:function(P){return this.clone()._sub(P)},multByPoint:function(P){return this.clone()._multByPoint(P)},divByPoint:function(P){return this.clone()._divByPoint(P)},mult:function(P){return this.clone()._mult(P)},div:function(P){return this.clone()._div(P)},rotate:function(P){return this.clone()._rotate(P)},rotateAround:function(P,G){return this.clone()._rotateAround(P,G)},matMult:function(P){return this.clone()._matMult(P)},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(P){return this.x===P.x&&this.y===P.y},dist:function(P){return Math.sqrt(this.distSqr(P))},distSqr:function(P){var G=P.x-this.x,re=P.y-this.y;return G*G+re*re},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(P){return Math.atan2(this.y-P.y,this.x-P.x)},angleWith:function(P){return this.angleWithSep(P.x,P.y)},angleWithSep:function(P,G){return Math.atan2(this.x*G-this.y*P,this.x*P+this.y*G)},_matMult:function(P){var G=P[0]*this.x+P[1]*this.y,re=P[2]*this.x+P[3]*this.y;return this.x=G,this.y=re,this},_add:function(P){return this.x+=P.x,this.y+=P.y,this},_sub:function(P){return this.x-=P.x,this.y-=P.y,this},_mult:function(P){return this.x*=P,this.y*=P,this},_div:function(P){return this.x/=P,this.y/=P,this},_multByPoint:function(P){return this.x*=P.x,this.y*=P.y,this},_divByPoint:function(P){return this.x/=P.x,this.y/=P.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var P=this.y;return this.y=this.x,this.x=-P,this},_rotate:function(P){var G=Math.cos(P),re=Math.sin(P),we=G*this.x-re*this.y,je=re*this.x+G*this.y;return this.x=we,this.y=je,this},_rotateAround:function(P,G){var re=Math.cos(P),we=Math.sin(P),je=G.x+re*(this.x-G.x)-we*(this.y-G.y),Ke=G.y+we*(this.x-G.x)+re*(this.y-G.y);return this.x=je,this.y=Ke,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(P){return P instanceof n?P:Array.isArray(P)?new n(P[0],P[1]):P};var l=typeof self<"u"?self:{},o=Math.pow(2,53)-1;function s(P,G,re,we){var je=new _(P,G,re,we);return function(Ke){return je.solve(Ke)}}var c=s(.25,.1,.25,1);function h(P,G,re){return Math.min(re,Math.max(G,P))}function x(P,G,re){var we=re-G,je=((P-G)%we+we)%we+G;return je===G?re:je}function m(P){for(var G=[],re=arguments.length-1;re-- >0;)G[re]=arguments[re+1];for(var we=0,je=G;we>G/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,P)}()}function v(P){return!!P&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(P)}function S(P,G){P.forEach(function(re){G[re]&&(G[re]=G[re].bind(G))})}function T(P,G){return P.indexOf(G,P.length-G.length)!==-1}function p(P,G,re){var we={};for(var je in P)we[je]=G.call(re||this,P[je],je,P);return we}function M(P,G,re){var we={};for(var je in P)G.call(re||this,P[je],je,P)&&(we[je]=P[je]);return we}function f(P){return Array.isArray(P)?P.map(f):typeof P=="object"&&P?p(P,f):P}var E={};function I(P){E[P]||(typeof console<"u"&&console.warn(P),E[P]=!0)}function B(P,G,re){return(re.y-P.y)*(G.x-P.x)>(G.y-P.y)*(re.x-P.x)}function N(P){for(var G=0,re=0,we=P.length,je=we-1,Ke=void 0,ot=void 0;re@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(we,je,Ke,ot){var _t=Ke||ot;return G[je]=!_t||_t.toLowerCase(),""}),G["max-age"]){var re=parseInt(G["max-age"],10);isNaN(re)?delete G["max-age"]:G["max-age"]=re}return G}var $=null;function ee(P){if($==null){var G=P.navigator?P.navigator.userAgent:null;$=!!P.safari||!(!G||!(/\b(iPad|iPhone|iPod)\b/.test(G)||G.match("Safari")&&!G.match("Chrome")))}return $}function H(P){try{var G=l[P];return G.setItem("_mapbox_test_",1),G.removeItem("_mapbox_test_"),!0}catch{return!1}}var J,Q,Z,K,ae=l.performance&&l.performance.now?l.performance.now.bind(l.performance):Date.now.bind(Date),se=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame,he=l.cancelAnimationFrame||l.mozCancelAnimationFrame||l.webkitCancelAnimationFrame||l.msCancelAnimationFrame,fe={now:ae,frame:function(P){var G=se(P);return{cancel:function(){return he(G)}}},getImageData:function(P,G){G===void 0&&(G=0);var re=l.document.createElement("canvas"),we=re.getContext("2d");if(!we)throw new Error("failed to create canvas 2d context");return re.width=P.width,re.height=P.height,we.drawImage(P,0,0,P.width,P.height),we.getImageData(-G,-G,P.width+2*G,P.height+2*G)},resolveURL:function(P){return J||(J=l.document.createElement("a")),J.href=P,J.href},hardwareConcurrency:l.navigator&&l.navigator.hardwareConcurrency||4,get devicePixelRatio(){return l.devicePixelRatio},get prefersReducedMotion(){return!!l.matchMedia&&(Q==null&&(Q=l.matchMedia("(prefers-reduced-motion: reduce)")),Q.matches)}},ie={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},oe={supported:!1,testSupport:function(P){!le&&K&&(ge?ye(P):Z=P)}},le=!1,ge=!1;function ye(P){var G=P.createTexture();P.bindTexture(P.TEXTURE_2D,G);try{if(P.texImage2D(P.TEXTURE_2D,0,P.RGBA,P.RGBA,P.UNSIGNED_BYTE,K),P.isContextLost())return;oe.supported=!0}catch{}P.deleteTexture(G),le=!0}l.document&&((K=l.document.createElement("img")).onload=function(){Z&&ye(Z),Z=null,ge=!0},K.onerror=function(){le=!0,Z=null},K.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var me="01",be=function(P,G){this._transformRequestFn=P,this._customAccessToken=G,this._createSkuToken()};function Se(P){return P.indexOf("mapbox:")===0}be.prototype._createSkuToken=function(){var P=function(){for(var G="",re=0;re<10;re++)G+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",me,G].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=P.token,this._skuTokenExpiresAt=P.tokenExpiresAt},be.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},be.prototype.transformRequest=function(P,G){return this._transformRequestFn&&this._transformRequestFn(P,G)||{url:P}},be.prototype.normalizeStyleURL=function(P,G){if(!Se(P))return P;var re=Oe(P);return re.path="/styles/v1"+re.path,this._makeAPIURL(re,this._customAccessToken||G)},be.prototype.normalizeGlyphsURL=function(P,G){if(!Se(P))return P;var re=Oe(P);return re.path="/fonts/v1"+re.path,this._makeAPIURL(re,this._customAccessToken||G)},be.prototype.normalizeSourceURL=function(P,G){if(!Se(P))return P;var re=Oe(P);return re.path="/v4/"+re.authority+".json",re.params.push("secure"),this._makeAPIURL(re,this._customAccessToken||G)},be.prototype.normalizeSpriteURL=function(P,G,re,we){var je=Oe(P);return Se(P)?(je.path="/styles/v1"+je.path+"/sprite"+G+re,this._makeAPIURL(je,this._customAccessToken||we)):(je.path+=""+G+re,We(je))},be.prototype.normalizeTileURL=function(P,G){if(this._isSkuTokenExpired()&&this._createSkuToken(),P&&!Se(P))return P;var re=Oe(P),we=fe.devicePixelRatio>=2||G===512?"@2x":"",je=oe.supported?".webp":"$1";re.path=re.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+we+je),re.path=re.path.replace(/^.+\/v4\//,"/"),re.path="/v4"+re.path;var Ke=this._customAccessToken||function(ot){for(var _t=0,Rt=ot;_t=0&&P.params.splice(je,1)}if(we.path!=="/"&&(P.path=""+we.path+P.path),!ie.REQUIRE_ACCESS_TOKEN)return We(P);if(!(G=G||ie.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+re);if(G[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+re);return P.params=P.params.filter(function(Ke){return Ke.indexOf("access_token")===-1}),P.params.push("access_token="+G),We(P)};var Ee=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Ce(P){return Ee.test(P)}var Le=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Oe(P){var G=P.match(Le);if(!G)throw new Error("Unable to parse URL object");return{protocol:G[1],authority:G[2],path:G[3]||"/",params:G[4]?G[4].split("&"):[]}}function We(P){var G=P.params.length?"?"+P.params.join("&"):"";return P.protocol+"://"+P.authority+P.path+G}var Ie="mapbox.eventData";function Ve(P){if(!P)return null;var G,re=P.split(".");if(!re||re.length!==3)return null;try{return JSON.parse((G=re[1],decodeURIComponent(l.atob(G).split("").map(function(we){return"%"+("00"+we.charCodeAt(0).toString(16)).slice(-2)}).join(""))))}catch{return null}}var Pe=function(P){this.type=P,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Pe.prototype.getStorageKey=function(P){var G,re,we=Ve(ie.ACCESS_TOKEN);return G=we&&we.u?(re=we.u,l.btoa(encodeURIComponent(re).replace(/%([0-9A-F]{2})/g,function(je,Ke){return String.fromCharCode(+("0x"+Ke))}))):ie.ACCESS_TOKEN||"",P?Ie+"."+P+":"+G:Ie+":"+G},Pe.prototype.fetchEventData=function(){var P=H("localStorage"),G=this.getStorageKey(),re=this.getStorageKey("uuid");if(P)try{var we=l.localStorage.getItem(G);we&&(this.eventData=JSON.parse(we));var je=l.localStorage.getItem(re);je&&(this.anonId=je)}catch{I("Unable to read from LocalStorage")}},Pe.prototype.saveEventData=function(){var P=H("localStorage"),G=this.getStorageKey(),re=this.getStorageKey("uuid");if(P)try{l.localStorage.setItem(re,this.anonId),Object.keys(this.eventData).length>=1&&l.localStorage.setItem(G,JSON.stringify(this.eventData))}catch{I("Unable to write to LocalStorage")}},Pe.prototype.processRequests=function(P){},Pe.prototype.postEvent=function(P,G,re,we){var je=this;if(ie.EVENTS_URL){var Ke=Oe(ie.EVENTS_URL);Ke.params.push("access_token="+(we||ie.ACCESS_TOKEN||""));var ot={event:this.type,created:new Date(P).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:y,skuId:me,userId:this.anonId},_t=G?m(ot,G):ot,Rt={url:We(Ke),headers:{"Content-Type":"text/plain"},body:JSON.stringify([_t])};this.pendingRequest=Pt(Rt,function(Kt){je.pendingRequest=null,re(Kt),je.saveEventData(),je.processRequests(we)})}},Pe.prototype.queueRequest=function(P,G){this.queue.push(P),this.processRequests(G)};var de,Me,ke=function(P){function G(){P.call(this,"map.load"),this.success={},this.skuToken=""}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.postMapLoadEvent=function(re,we,je,Ke){this.skuToken=je,(ie.EVENTS_URL&&Ke||ie.ACCESS_TOKEN&&Array.isArray(re)&&re.some(function(ot){return Se(ot)||Ce(ot)}))&&this.queueRequest({id:we,timestamp:Date.now()},Ke)},G.prototype.processRequests=function(re){var we=this;if(!this.pendingRequest&&this.queue.length!==0){var je=this.queue.shift(),Ke=je.id,ot=je.timestamp;Ke&&this.success[Ke]||(this.anonId||this.fetchEventData(),v(this.anonId)||(this.anonId=A()),this.postEvent(ot,{skuToken:this.skuToken},function(_t){_t||Ke&&(we.success[Ke]=!0)},re))}},G}(Pe),He=function(P){function G(re){P.call(this,"appUserTurnstile"),this._customAccessToken=re}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.postTurnstileEvent=function(re,we){ie.EVENTS_URL&&ie.ACCESS_TOKEN&&Array.isArray(re)&&re.some(function(je){return Se(je)||Ce(je)})&&this.queueRequest(Date.now(),we)},G.prototype.processRequests=function(re){var we=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var je=Ve(ie.ACCESS_TOKEN),Ke=je?je.u:ie.ACCESS_TOKEN,ot=Ke!==this.eventData.tokenU;v(this.anonId)||(this.anonId=A(),ot=!0);var _t=this.queue.shift();if(this.eventData.lastSuccess){var Rt=new Date(this.eventData.lastSuccess),Kt=new Date(_t),nn=(_t-this.eventData.lastSuccess)/864e5;ot=ot||nn>=1||nn<-1||Rt.getDate()!==Kt.getDate()}else ot=!0;if(!ot)return this.processRequests();this.postEvent(_t,{"enabled.telemetry":!1},function(sn){sn||(we.eventData.lastSuccess=_t,we.eventData.tokenU=Ke)},re)}},G}(Pe),Fe=new He,qe=Fe.postTurnstileEvent.bind(Fe),$e=new ke,Ye=$e.postMapLoadEvent.bind($e),_e="mapbox-tiles",De=500,Be=50,Ge=42e4;function tt(){l.caches&&!de&&(de=l.caches.open(_e))}function nt(P,G,re){if(tt(),de){var we={status:G.status,statusText:G.statusText,headers:new l.Headers};G.headers.forEach(function(Ke,ot){return we.headers.set(ot,Ke)});var je=j(G.headers.get("Cache-Control")||"");je["no-store"]||(je["max-age"]&&we.headers.set("Expires",new Date(re+1e3*je["max-age"]).toUTCString()),new Date(we.headers.get("Expires")).getTime()-reDate.now()&&!Rt["no-cache"]}(je);we.delete(re),Ke&&we.put(re,je.clone()),G(null,je,Ke)}).catch(G)}).catch(G)}var kt,Vt=1/0;function Ht(){return kt==null&&(kt=l.OffscreenCanvas&&new l.OffscreenCanvas(1,1).getContext("2d")&&typeof l.createImageBitmap=="function"),kt}var Gt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Gt);var st=function(P){function G(re,we,je){we===401&&Ce(je)&&(re+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),P.call(this,re),this.status=we,this.url=je,this.name=this.constructor.name,this.message=re}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},G}(Error),Qe=V()?function(){return self.worker&&self.worker.referrer}:function(){return(l.location.protocol==="blob:"?l.parent:l).location.href};function pt(P,G){var re,we=new l.AbortController,je=new l.Request(P.url,{method:P.method||"GET",body:P.body,credentials:P.credentials,headers:P.headers,referrer:Qe(),signal:we.signal}),Ke=!1,ot=!1,_t=(re=je.url).indexOf("sku=")>0&&Ce(re);P.type==="json"&&je.headers.set("Accept","application/json");var Rt=function(nn,sn,yn){if(!ot){if(nn&&nn.message!=="SecurityError"&&I(nn),sn&&yn)return Kt(sn);var fn=Date.now();l.fetch(je).then(function(On){if(On.ok){var jn=_t?On.clone():null;return Kt(On,jn,fn)}return G(new st(On.statusText,On.status,P.url))}).catch(function(On){On.code!==20&&G(new Error(On.message))})}},Kt=function(nn,sn,yn){(P.type==="arrayBuffer"?nn.arrayBuffer():P.type==="json"?nn.json():nn.text()).then(function(fn){ot||(sn&&yn&&nt(je,sn,yn),Ke=!0,G(null,fn,nn.headers.get("Cache-Control"),nn.headers.get("Expires")))}).catch(function(fn){ot||G(new Error(fn.message))})};return _t?At(je,Rt):Rt(null,null),{cancel:function(){ot=!0,Ke||we.abort()}}}var yt=function(P,G){if(re=P.url,!(/^file:/.test(re)||/^file:/.test(Qe())&&!/^\w+:/.test(re))){if(l.fetch&&l.Request&&l.AbortController&&l.Request.prototype.hasOwnProperty("signal"))return pt(P,G);if(V()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",P,G,void 0,!0)}var re;return function(we,je){var Ke=new l.XMLHttpRequest;for(var ot in Ke.open(we.method||"GET",we.url,!0),we.type==="arrayBuffer"&&(Ke.responseType="arraybuffer"),we.headers)Ke.setRequestHeader(ot,we.headers[ot]);return we.type==="json"&&(Ke.responseType="text",Ke.setRequestHeader("Accept","application/json")),Ke.withCredentials=we.credentials==="include",Ke.onerror=function(){je(new Error(Ke.statusText))},Ke.onload=function(){if((Ke.status>=200&&Ke.status<300||Ke.status===0)&&Ke.response!==null){var _t=Ke.response;if(we.type==="json")try{_t=JSON.parse(Ke.response)}catch(Rt){return je(Rt)}je(null,_t,Ke.getResponseHeader("Cache-Control"),Ke.getResponseHeader("Expires"))}else je(new st(Ke.statusText,Ke.status,we.url))},Ke.send(we.body),{cancel:function(){return Ke.abort()}}}(P,G)},Ot=function(P,G){return yt(m(P,{type:"arrayBuffer"}),G)},Pt=function(P,G){return yt(m(P,{method:"POST"}),G)},at,lt,Xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";at=[],lt=0;var ut=function(P,G){if(oe.supported&&(P.headers||(P.headers={}),P.headers.accept="image/webp,*/*"),lt>=ie.MAX_PARALLEL_IMAGE_REQUESTS){var re={requestParameters:P,callback:G,cancelled:!1,cancel:function(){this.cancelled=!0}};return at.push(re),re}lt++;var we=!1,je=function(){if(!we)for(we=!0,lt--;at.length&<0||this._oneTimeListeners&&this._oneTimeListeners[P]&&this._oneTimeListeners[P].length>0||this._eventedParent&&this._eventedParent.listens(P)},rt.prototype.setEventedParent=function(P,G){return this._eventedParent=P,this._eventedParentData=G,this};var et={$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"}}},Et=function(P,G,re,we){this.message=(P?P+": ":"")+re,we&&(this.identifier=we),G!=null&&G.__line__&&(this.line=G.__line__)};function Bt(P){var G=P.key,re=P.value;return re?[new Et(G,re,"constants have been deprecated as of v8")]:[]}function Ft(P){for(var G=[],re=arguments.length-1;re-- >0;)G[re]=arguments[re+1];for(var we=0,je=G;we":P.itemType.kind==="value"?"array":"array<"+G+">"}return P.kind}var Fn=[Wt,Zt,on,un,Pn,En,Dn,Ln(In),Kn];function wn(P,G){if(G.kind==="error")return null;if(P.kind==="array"){if(G.kind==="array"&&(G.N===0&&G.itemType.kind==="value"||!wn(P.itemType,G.itemType))&&(typeof P.N!="number"||P.N===G.N))return null}else{if(P.kind===G.kind)return null;if(P.kind==="value"){for(var re=0,we=Fn;re255?255:Rt}function je(Rt){return Rt<0?0:Rt>1?1:Rt}function Ke(Rt){return Rt[Rt.length-1]==="%"?we(parseFloat(Rt)/100*255):we(parseInt(Rt))}function ot(Rt){return Rt[Rt.length-1]==="%"?je(parseFloat(Rt)/100):je(parseFloat(Rt))}function _t(Rt,Kt,nn){return nn<0?nn+=1:nn>1&&(nn-=1),6*nn<1?Rt+(Kt-Rt)*nn*6:2*nn<1?Kt:3*nn<2?Rt+(Kt-Rt)*(2/3-nn)*6:Rt}try{G.parseCSSColor=function(Rt){var Kt,nn=Rt.replace(/ /g,"").toLowerCase();if(nn in re)return re[nn].slice();if(nn[0]==="#")return nn.length===4?(Kt=parseInt(nn.substr(1),16))>=0&&Kt<=4095?[(3840&Kt)>>4|(3840&Kt)>>8,240&Kt|(240&Kt)>>4,15&Kt|(15&Kt)<<4,1]:null:nn.length===7&&(Kt=parseInt(nn.substr(1),16))>=0&&Kt<=16777215?[(16711680&Kt)>>16,(65280&Kt)>>8,255&Kt,1]:null;var sn=nn.indexOf("("),yn=nn.indexOf(")");if(sn!==-1&&yn+1===nn.length){var fn=nn.substr(0,sn),On=nn.substr(sn+1,yn-(sn+1)).split(","),jn=1;switch(fn){case"rgba":if(On.length!==4)return null;jn=ot(On.pop());case"rgb":return On.length!==3?null:[Ke(On[0]),Ke(On[1]),Ke(On[2]),jn];case"hsla":if(On.length!==4)return null;jn=ot(On.pop());case"hsl":if(On.length!==3)return null;var sr=(parseFloat(On[0])%360+360)%360/360,ir=ot(On[1]),kr=ot(On[2]),_r=kr<=.5?kr*(ir+1):kr+ir-kr*ir,Fr=2*kr-_r;return[we(255*_t(Fr,_r,sr+1/3)),we(255*_t(Fr,_r,sr)),we(255*_t(Fr,_r,sr-1/3)),jn];default:return null}}return null}}catch{}}),vr=$n.parseCSSColor,Qn=function(P,G,re,we){we===void 0&&(we=1),this.r=P,this.g=G,this.b=re,this.a=we};Qn.parse=function(P){if(P){if(P instanceof Qn)return P;if(typeof P=="string"){var G=vr(P);if(G)return new Qn(G[0]/255*G[3],G[1]/255*G[3],G[2]/255*G[3],G[3])}}},Qn.prototype.toString=function(){var P=this.toArray(),G=P[0],re=P[1],we=P[2],je=P[3];return"rgba("+Math.round(G)+","+Math.round(re)+","+Math.round(we)+","+je+")"},Qn.prototype.toArray=function(){var P=this,G=P.r,re=P.g,we=P.b,je=P.a;return je===0?[0,0,0,0]:[255*G/je,255*re/je,255*we/je,je]},Qn.black=new Qn(0,0,0,1),Qn.white=new Qn(1,1,1,1),Qn.transparent=new Qn(0,0,0,0),Qn.red=new Qn(1,0,0,1);var lr=function(P,G,re){this.sensitivity=P?G?"variant":"case":G?"accent":"base",this.locale=re,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};lr.prototype.compare=function(P,G){return this.collator.compare(P,G)},lr.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var hr=function(P,G,re,we,je){this.text=P,this.image=G,this.scale=re,this.fontStack=we,this.textColor=je},jr=function(P){this.sections=P};jr.fromString=function(P){return new jr([new hr(P,null,null,null,null)])},jr.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(P){return P.text.length!==0||P.image&&P.image.name.length!==0})},jr.factory=function(P){return P instanceof jr?P:jr.fromString(P)},jr.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(P){return P.text}).join("")},jr.prototype.serialize=function(){for(var P=["format"],G=0,re=this.sections;G=0&&P<=255&&typeof G=="number"&&G>=0&&G<=255&&typeof re=="number"&&re>=0&&re<=255?we===void 0||typeof we=="number"&&we>=0&&we<=1?null:"Invalid rgba value ["+[P,G,re,we].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof we=="number"?[P,G,re,we]:[P,G,re]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Ar(P){if(P===null||typeof P=="string"||typeof P=="boolean"||typeof P=="number"||P instanceof Qn||P instanceof lr||P instanceof jr||P instanceof ni)return!0;if(Array.isArray(P)){for(var G=0,re=P;G2){var _t=P[1];if(typeof _t!="string"||!(_t in ur)||_t==="object")return G.error('The item type argument of "array" must be one of string, number, boolean',1);Ke=ur[_t],we++}else Ke=In;if(P.length>3){if(P[2]!==null&&(typeof P[2]!="number"||P[2]<0||P[2]!==Math.floor(P[2])))return G.error('The length argument to "array" must be a positive integer literal',2);ot=P[2],we++}re=Ln(Ke,ot)}else re=ur[je];for(var Rt=[];we1)&&G.push(we)}}return G.concat(this.args.map(function(je){return je.serialize()}))};var cr=function(P){this.type=En,this.sections=P};cr.parse=function(P,G){if(P.length<2)return G.error("Expected at least one argument.");var re=P[1];if(!Array.isArray(re)&&typeof re=="object")return G.error("First argument must be an image or text section.");for(var we=[],je=!1,Ke=1;Ke<=P.length-1;++Ke){var ot=P[Ke];if(je&&typeof ot=="object"&&!Array.isArray(ot)){je=!1;var _t=null;if(ot["font-scale"]&&!(_t=G.parse(ot["font-scale"],1,Zt)))return null;var Rt=null;if(ot["text-font"]&&!(Rt=G.parse(ot["text-font"],1,Ln(on))))return null;var Kt=null;if(ot["text-color"]&&!(Kt=G.parse(ot["text-color"],1,Pn)))return null;var nn=we[we.length-1];nn.scale=_t,nn.font=Rt,nn.textColor=Kt}else{var sn=G.parse(P[Ke],1,In);if(!sn)return null;var yn=sn.type.kind;if(yn!=="string"&&yn!=="value"&&yn!=="null"&&yn!=="resolvedImage")return G.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");je=!0,we.push({content:sn,scale:null,font:null,textColor:null})}}return new cr(we)},cr.prototype.evaluate=function(P){return new jr(this.sections.map(function(G){var re=G.content.evaluate(P);return xr(re)===Kn?new hr("",re,null,null,null):new hr(Qr(re),null,G.scale?G.scale.evaluate(P):null,G.font?G.font.evaluate(P).join(","):null,G.textColor?G.textColor.evaluate(P):null)}))},cr.prototype.eachChild=function(P){for(var G=0,re=this.sections;G-1),re},Ir.prototype.eachChild=function(P){P(this.input)},Ir.prototype.outputDefined=function(){return!1},Ir.prototype.serialize=function(){return["image",this.input.serialize()]};var Er={"to-boolean":un,"to-color":Pn,"to-number":Zt,"to-string":on},Xr=function(P,G){this.type=P,this.args=G};Xr.parse=function(P,G){if(P.length<2)return G.error("Expected at least one argument.");var re=P[0];if((re==="to-boolean"||re==="to-string")&&P.length!==2)return G.error("Expected one argument.");for(var we=Er[re],je=[],Ke=1;Ke4?"Invalid rbga value "+JSON.stringify(G)+": expected an array containing either three or four numeric values.":Or(G[0],G[1],G[2],G[3])))return new Qn(G[0]/255,G[1]/255,G[2]/255,G[3])}throw new Cn(re||"Could not parse color from value '"+(typeof G=="string"?G:String(JSON.stringify(G)))+"'")}if(this.type.kind==="number"){for(var ot=null,_t=0,Rt=this.args;_t=G[2]||P[1]<=G[1]||P[3]>=G[3])}function Un(P,G){var re,we=(180+P[0])/360,je=(re=P[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+re*Math.PI/360)))/360),Ke=Math.pow(2,G.z);return[Math.round(we*Ke*_n),Math.round(je*Ke*_n)]}function tr(P,G,re){return G[1]>P[1]!=re[1]>P[1]&&P[0]<(re[0]-G[0])*(P[1]-G[1])/(re[1]-G[1])+G[0]}function Wn(P,G){for(var re=!1,we=0,je=G.length;we0&&sn<0||nn<0&&sn>0}function ln(P,G,re){for(var we=0,je=re;were[2]){var je=.5*we,Ke=P[0]-re[0]>je?-we:re[0]-P[0]>je?we:0;Ke===0&&(Ke=P[0]-re[2]>je?-we:re[2]-P[0]>je?we:0),P[0]+=Ke}gn(G,P)}function Ur(P,G,re,we){for(var je=Math.pow(2,we.z)*_n,Ke=[we.x*_n,we.y*_n],ot=[],_t=0,Rt=P;_t=0)return!1;var re=!0;return P.eachChild(function(we){re&&!Jr(we,G)&&(re=!1)}),re}$r.parse=function(P,G){if(P.length!==2)return G.error("'within' expression requires exactly one argument, but found "+(P.length-1)+" instead.");if(Ar(P[1])){var re=P[1];if(re.type==="FeatureCollection")for(var we=0;weG))throw new Cn("Input is not a number.");ot=_t-1}return 0}ii.prototype.parse=function(P,G,re,we,je){return je===void 0&&(je={}),G?this.concat(G,re,we)._parse(P,je):this._parse(P,je)},ii.prototype._parse=function(P,G){function re(Kt,nn,sn){return sn==="assert"?new Zn(nn,[Kt]):sn==="coerce"?new Xr(nn,[Kt]):Kt}if(P!==null&&typeof P!="string"&&typeof P!="boolean"&&typeof P!="number"||(P=["literal",P]),Array.isArray(P)){if(P.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var we=P[0];if(typeof we!="string")return this.error("Expression name must be a string, but found "+typeof we+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var je=this.registry[we];if(je){var Ke=je.parse(P,this);if(!Ke)return null;if(this.expectedType){var ot=this.expectedType,_t=Ke.type;if(ot.kind!=="string"&&ot.kind!=="number"&&ot.kind!=="boolean"&&ot.kind!=="object"&&ot.kind!=="array"||_t.kind!=="value")if(ot.kind!=="color"&&ot.kind!=="formatted"&&ot.kind!=="resolvedImage"||_t.kind!=="value"&&_t.kind!=="string"){if(this.checkSubtype(ot,_t))return null}else Ke=re(Ke,ot,G.typeAnnotation||"coerce");else Ke=re(Ke,ot,G.typeAnnotation||"assert")}if(!(Ke instanceof kn)&&Ke.type.kind!=="resolvedImage"&&Yr(Ke)){var Rt=new bn;try{Ke=new kn(Ke.type,Ke.evaluate(Rt))}catch(Kt){return this.error(Kt.message),null}}return Ke}return this.error('Unknown expression "'+we+'". If you wanted a literal array, use ["literal", [...]].',0)}return P===void 0?this.error("'undefined' value invalid. Use null instead."):typeof P=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof P+" instead.")},ii.prototype.concat=function(P,G,re){var we=typeof P=="number"?this.path.concat(P):this.path,je=re?this.scope.concat(re):this.scope;return new ii(this.registry,we,G||null,je,this.errors)},ii.prototype.error=function(P){for(var G=[],re=arguments.length-1;re-- >0;)G[re]=arguments[re+1];var we=""+this.key+G.map(function(je){return"["+je+"]"}).join("");this.errors.push(new qt(we,P))},ii.prototype.checkSubtype=function(P,G){var re=wn(P,G);return re&&this.error(re),re};var Ti=function(P,G,re){this.type=P,this.input=G,this.labels=[],this.outputs=[];for(var we=0,je=re;we=ot)return G.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Rt);var nn=G.parse(_t,Kt,je);if(!nn)return null;je=je||nn.type,we.push([ot,nn])}return new Ti(je,re,we)},Ti.prototype.evaluate=function(P){var G=this.labels,re=this.outputs;if(G.length===1)return re[0].evaluate(P);var we=this.input.evaluate(P);if(we<=G[0])return re[0].evaluate(P);var je=G.length;return we>=G[je-1]?re[je-1].evaluate(P):re[oi(G,we)].evaluate(P)},Ti.prototype.eachChild=function(P){P(this.input);for(var G=0,re=this.outputs;G0&&P.push(this.labels[G]),P.push(this.outputs[G].serialize());return P};var Pa=Object.freeze({__proto__:null,number:Wi,color:function(P,G,re){return new Qn(Wi(P.r,G.r,re),Wi(P.g,G.g,re),Wi(P.b,G.b,re),Wi(P.a,G.a,re))},array:function(P,G,re){return P.map(function(we,je){return Wi(we,G[je],re)})}}),ji=.95047,Vo=1,Ha=1.08883,Oa=4/29,bs=6/29,lo=3*bs*bs,Ki=bs*bs*bs,os=Math.PI/180,To=180/Math.PI;function fo(P){return P>Ki?Math.pow(P,.3333333333333333):P/lo+Oa}function Os(P){return P>bs?P*P*P:lo*(P-Oa)}function Ta(P){return 255*(P<=.0031308?12.92*P:1.055*Math.pow(P,.4166666666666667)-.055)}function ws(P){return(P/=255)<=.04045?P/12.92:Math.pow((P+.055)/1.055,2.4)}function Bl(P){var G=ws(P.r),re=ws(P.g),we=ws(P.b),je=fo((.4124564*G+.3575761*re+.1804375*we)/ji),Ke=fo((.2126729*G+.7151522*re+.072175*we)/Vo);return{l:116*Ke-16,a:500*(je-Ke),b:200*(Ke-fo((.0193339*G+.119192*re+.9503041*we)/Ha)),alpha:P.a}}function Ql(P){var G=(P.l+16)/116,re=isNaN(P.a)?G:G+P.a/500,we=isNaN(P.b)?G:G-P.b/200;return G=Vo*Os(G),re=ji*Os(re),we=Ha*Os(we),new Qn(Ta(3.2404542*re-1.5371385*G-.4985314*we),Ta(-.969266*re+1.8760108*G+.041556*we),Ta(.0556434*re-.2040259*G+1.0572252*we),P.alpha)}function ss(P,G,re){var we=G-P;return P+re*(we>180||we<-180?we-360*Math.round(we/360):we)}var eu={forward:Bl,reverse:Ql,interpolate:function(P,G,re){return{l:Wi(P.l,G.l,re),a:Wi(P.a,G.a,re),b:Wi(P.b,G.b,re),alpha:Wi(P.alpha,G.alpha,re)}}},vl={forward:function(P){var G=Bl(P),re=G.l,we=G.a,je=G.b,Ke=Math.atan2(je,we)*To;return{h:Ke<0?Ke+360:Ke,c:Math.sqrt(we*we+je*je),l:re,alpha:P.a}},reverse:function(P){var G=P.h*os,re=P.c;return Ql({l:P.l,a:Math.cos(G)*re,b:Math.sin(G)*re,alpha:P.alpha})},interpolate:function(P,G,re){return{h:ss(P.h,G.h,re),c:Wi(P.c,G.c,re),l:Wi(P.l,G.l,re),alpha:Wi(P.alpha,G.alpha,re)}}},Za=Object.freeze({__proto__:null,lab:eu,hcl:vl}),ko=function(P,G,re,we,je){this.type=P,this.operator=G,this.interpolation=re,this.input=we,this.labels=[],this.outputs=[];for(var Ke=0,ot=je;Ke1}))return G.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);we={name:"cubic-bezier",controlPoints:_t}}if(P.length-1<4)return G.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if((P.length-1)%2!=0)return G.error("Expected an even number of arguments.");if(!(je=G.parse(je,2,Zt)))return null;var Rt=[],Kt=null;re==="interpolate-hcl"||re==="interpolate-lab"?Kt=Pn:G.expectedType&&G.expectedType.kind!=="value"&&(Kt=G.expectedType);for(var nn=0;nn=sn)return G.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',fn);var jn=G.parse(yn,On,Kt);if(!jn)return null;Kt=Kt||jn.type,Rt.push([sn,jn])}return Kt.kind==="number"||Kt.kind==="color"||Kt.kind==="array"&&Kt.itemType.kind==="number"&&typeof Kt.N=="number"?new ko(Kt,re,we,je,Rt):G.error("Type "+Tn(Kt)+" is not interpolatable.")},ko.prototype.evaluate=function(P){var G=this.labels,re=this.outputs;if(G.length===1)return re[0].evaluate(P);var we=this.input.evaluate(P);if(we<=G[0])return re[0].evaluate(P);var je=G.length;if(we>=G[je-1])return re[je-1].evaluate(P);var Ke=oi(G,we),ot=G[Ke],_t=G[Ke+1],Rt=ko.interpolationFactor(this.interpolation,we,ot,_t),Kt=re[Ke].evaluate(P),nn=re[Ke+1].evaluate(P);return this.operator==="interpolate"?Pa[this.type.kind.toLowerCase()](Kt,nn,Rt):this.operator==="interpolate-hcl"?vl.reverse(vl.interpolate(vl.forward(Kt),vl.forward(nn),Rt)):eu.reverse(eu.interpolate(eu.forward(Kt),eu.forward(nn),Rt))},ko.prototype.eachChild=function(P){P(this.input);for(var G=0,re=this.outputs;G=re.length)throw new Cn("Array index out of bounds: "+G+" > "+(re.length-1)+".");if(G!==Math.floor(G))throw new Cn("Array index must be an integer, but found "+G+" instead.");return re[G]},tu.prototype.eachChild=function(P){P(this.index),P(this.input)},tu.prototype.outputDefined=function(){return!1},tu.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var xl=function(P,G){this.type=un,this.needle=P,this.haystack=G};xl.parse=function(P,G){if(P.length!==3)return G.error("Expected 2 arguments, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1,In),we=G.parse(P[2],2,In);return re&&we?zn(re.type,[un,on,Zt,Wt,In])?new xl(re,we):G.error("Expected first argument to be of type boolean, string, number or null, but found "+Tn(re.type)+" instead"):null},xl.prototype.evaluate=function(P){var G=this.needle.evaluate(P),re=this.haystack.evaluate(P);if(!re)return!1;if(!Jn(G,["boolean","string","number","null"]))throw new Cn("Expected first argument to be of type boolean, string, number or null, but found "+Tn(xr(G))+" instead.");if(!Jn(re,["string","array"]))throw new Cn("Expected second argument to be of type array or string, but found "+Tn(xr(re))+" instead.");return re.indexOf(G)>=0},xl.prototype.eachChild=function(P){P(this.needle),P(this.haystack)},xl.prototype.outputDefined=function(){return!0},xl.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var jl=function(P,G,re){this.type=Zt,this.needle=P,this.haystack=G,this.fromIndex=re};jl.parse=function(P,G){if(P.length<=2||P.length>=5)return G.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1,In),we=G.parse(P[2],2,In);if(!re||!we)return null;if(!zn(re.type,[un,on,Zt,Wt,In]))return G.error("Expected first argument to be of type boolean, string, number or null, but found "+Tn(re.type)+" instead");if(P.length===4){var je=G.parse(P[3],3,Zt);return je?new jl(re,we,je):null}return new jl(re,we)},jl.prototype.evaluate=function(P){var G=this.needle.evaluate(P),re=this.haystack.evaluate(P);if(!Jn(G,["boolean","string","number","null"]))throw new Cn("Expected first argument to be of type boolean, string, number or null, but found "+Tn(xr(G))+" instead.");if(!Jn(re,["string","array"]))throw new Cn("Expected second argument to be of type array or string, but found "+Tn(xr(re))+" instead.");if(this.fromIndex){var we=this.fromIndex.evaluate(P);return re.indexOf(G,we)}return re.indexOf(G)},jl.prototype.eachChild=function(P){P(this.needle),P(this.haystack),this.fromIndex&&P(this.fromIndex)},jl.prototype.outputDefined=function(){return!1},jl.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var P=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),P]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Ul=function(P,G,re,we,je,Ke){this.inputType=P,this.type=G,this.input=re,this.cases=we,this.outputs=je,this.otherwise=Ke};Ul.parse=function(P,G){if(P.length<5)return G.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if(P.length%2!=1)return G.error("Expected an even number of arguments.");var re,we;G.expectedType&&G.expectedType.kind!=="value"&&(we=G.expectedType);for(var je={},Ke=[],ot=2;otNumber.MAX_SAFE_INTEGER)return Kt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof yn=="number"&&Math.floor(yn)!==yn)return Kt.error("Numeric branch labels must be integer values.");if(re){if(Kt.checkSubtype(re,xr(yn)))return null}else re=xr(yn);if(je[String(yn)]!==void 0)return Kt.error("Branch labels must be unique.");je[String(yn)]=Ke.length}var fn=G.parse(Rt,ot,we);if(!fn)return null;we=we||fn.type,Ke.push(fn)}var On=G.parse(P[1],1,In);if(!On)return null;var jn=G.parse(P[P.length-1],P.length-1,we);return jn?On.type.kind!=="value"&&G.concat(1).checkSubtype(re,On.type)?null:new Ul(re,we,On,je,Ke,jn):null},Ul.prototype.evaluate=function(P){var G=this.input.evaluate(P);return(xr(G)===this.inputType&&this.outputs[this.cases[G]]||this.otherwise).evaluate(P)},Ul.prototype.eachChild=function(P){P(this.input),this.outputs.forEach(P),P(this.otherwise)},Ul.prototype.outputDefined=function(){return this.outputs.every(function(P){return P.outputDefined()})&&this.otherwise.outputDefined()},Ul.prototype.serialize=function(){for(var P=this,G=["match",this.input.serialize()],re=[],we={},je=0,Ke=Object.keys(this.cases).sort();je=5)return G.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1,In),we=G.parse(P[2],2,Zt);if(!re||!we)return null;if(!zn(re.type,[Ln(In),on,In]))return G.error("Expected first argument to be of type array or string, but found "+Tn(re.type)+" instead");if(P.length===4){var je=G.parse(P[3],3,Zt);return je?new vs(re.type,re,we,je):null}return new vs(re.type,re,we)},vs.prototype.evaluate=function(P){var G=this.input.evaluate(P),re=this.beginIndex.evaluate(P);if(!Jn(G,["string","array"]))throw new Cn("Expected first argument to be of type array or string, but found "+Tn(xr(G))+" instead.");if(this.endIndex){var we=this.endIndex.evaluate(P);return G.slice(re,we)}return G.slice(re)},vs.prototype.eachChild=function(P){P(this.input),P(this.beginIndex),this.endIndex&&P(this.endIndex)},vs.prototype.outputDefined=function(){return!1},vs.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var P=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),P]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var pc=Su("==",function(P,G,re){return G===re},ju),Rs=Su("!=",function(P,G,re){return G!==re},function(P,G,re,we){return!ju(0,G,re,we)}),Vs=Su("<",function(P,G,re){return G",function(P,G,re){return G>re},function(P,G,re,we){return we.compare(G,re)>0}),gh=Su("<=",function(P,G,re){return G<=re},function(P,G,re,we){return we.compare(G,re)<=0}),Fo=Su(">=",function(P,G,re){return G>=re},function(P,G,re,we){return we.compare(G,re)>=0}),Qu=function(P,G,re,we,je){this.type=on,this.number=P,this.locale=G,this.currency=re,this.minFractionDigits=we,this.maxFractionDigits=je};Qu.parse=function(P,G){if(P.length!==3)return G.error("Expected two arguments.");var re=G.parse(P[1],1,Zt);if(!re)return null;var we=P[2];if(typeof we!="object"||Array.isArray(we))return G.error("NumberFormat options argument must be an object.");var je=null;if(we.locale&&!(je=G.parse(we.locale,1,on)))return null;var Ke=null;if(we.currency&&!(Ke=G.parse(we.currency,1,on)))return null;var ot=null;if(we["min-fraction-digits"]&&!(ot=G.parse(we["min-fraction-digits"],1,Zt)))return null;var _t=null;return we["max-fraction-digits"]&&!(_t=G.parse(we["max-fraction-digits"],1,Zt))?null:new Qu(re,je,Ke,ot,_t)},Qu.prototype.evaluate=function(P){return new Intl.NumberFormat(this.locale?this.locale.evaluate(P):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(P):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(P):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(P):void 0}).format(this.number.evaluate(P))},Qu.prototype.eachChild=function(P){P(this.number),this.locale&&P(this.locale),this.currency&&P(this.currency),this.minFractionDigits&&P(this.minFractionDigits),this.maxFractionDigits&&P(this.maxFractionDigits)},Qu.prototype.outputDefined=function(){return!1},Qu.prototype.serialize=function(){var P={};return this.locale&&(P.locale=this.locale.serialize()),this.currency&&(P.currency=this.currency.serialize()),this.minFractionDigits&&(P["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(P["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),P]};var oa=function(P){this.type=Zt,this.input=P};oa.parse=function(P,G){if(P.length!==2)return G.error("Expected 1 argument, but found "+(P.length-1)+" instead.");var re=G.parse(P[1],1);return re?re.type.kind!=="array"&&re.type.kind!=="string"&&re.type.kind!=="value"?G.error("Expected argument of type string or array, but found "+Tn(re.type)+" instead."):new oa(re):null},oa.prototype.evaluate=function(P){var G=this.input.evaluate(P);if(typeof G=="string"||Array.isArray(G))return G.length;throw new Cn("Expected value to be of type string or array, but found "+Tn(xr(G))+" instead.")},oa.prototype.eachChild=function(P){P(this.input)},oa.prototype.outputDefined=function(){return!1},oa.prototype.serialize=function(){var P=["length"];return this.eachChild(function(G){P.push(G.serialize())}),P};var Mu={"==":pc,"!=":Rs,">":Uu,"<":Vs,">=":Fo,"<=":gh,array:Zn,at:tu,boolean:Zn,case:Vl,coalesce:Ds,collator:an,format:cr,image:Ir,in:xl,"index-of":jl,interpolate:ko,"interpolate-hcl":ko,"interpolate-lab":ko,length:oa,let:Nl,literal:kn,match:Ul,number:Zn,"number-format":Qu,object:Zn,slice:vs,step:Ti,string:Zn,"to-boolean":Xr,"to-color":Xr,"to-number":Xr,"to-string":Xr,var:gi,within:$r};function $a(P,G){var re=G[0],we=G[1],je=G[2],Ke=G[3];re=re.evaluate(P),we=we.evaluate(P),je=je.evaluate(P);var ot=Ke?Ke.evaluate(P):1,_t=Or(re,we,je,ot);if(_t)throw new Cn(_t);return new Qn(re/255*ot,we/255*ot,je/255*ot,ot)}function Ya(P,G){return P in G}function ys(P,G){var re=G[P];return re===void 0?null:re}function qs(P){return{type:P}}function ec(P){return{result:"success",value:P}}function ql(P){return{result:"error",value:P}}function Fs(P){return P["property-type"]==="data-driven"||P["property-type"]==="cross-faded-data-driven"}function qo(P){return!!P.expression&&P.expression.parameters.indexOf("zoom")>-1}function Bo(P){return!!P.expression&&P.expression.interpolated}function _a(P){return P instanceof Number?"number":P instanceof String?"string":P instanceof Boolean?"boolean":Array.isArray(P)?"array":P===null?"null":typeof P}function Vu(P){return typeof P=="object"&&P!==null&&!Array.isArray(P)}function Fc(P){return P}function Hs(P,G){var re,we,je,Ke=G.type==="color",ot=P.stops&&typeof P.stops[0][0]=="object",_t=ot||P.property!==void 0,Rt=ot||!_t,Kt=P.type||(Bo(G)?"exponential":"interval");if(Ke&&((P=Ft({},P)).stops&&(P.stops=P.stops.map(function(ei){return[ei[0],Qn.parse(ei[1])]})),P.default?P.default=Qn.parse(P.default):P.default=Qn.parse(G.default)),P.colorSpace&&P.colorSpace!=="rgb"&&!Za[P.colorSpace])throw new Error("Unknown color space: "+P.colorSpace);if(Kt==="exponential")re=rc;else if(Kt==="interval")re=nc;else if(Kt==="categorical"){re=tc,we=Object.create(null);for(var nn=0,sn=P.stops;nn=P.stops[we-1][0])return P.stops[we-1][1];var je=oi(P.stops.map(function(Ke){return Ke[0]}),re);return P.stops[je][1]}function rc(P,G,re){var we=P.base!==void 0?P.base:1;if(_a(re)!=="number")return Yo(P.default,G.default);var je=P.stops.length;if(je===1||re<=P.stops[0][0])return P.stops[0][1];if(re>=P.stops[je-1][0])return P.stops[je-1][1];var Ke=oi(P.stops.map(function(sn){return sn[0]}),re),ot=function(sn,yn,fn,On){var jn=On-fn,sr=sn-fn;return jn===0?0:yn===1?sr/jn:(Math.pow(yn,sr)-1)/(Math.pow(yn,jn)-1)}(re,we,P.stops[Ke][0],P.stops[Ke+1][0]),_t=P.stops[Ke][1],Rt=P.stops[Ke+1][1],Kt=Pa[G.type]||Fc;if(P.colorSpace&&P.colorSpace!=="rgb"){var nn=Za[P.colorSpace];Kt=function(sn,yn){return nn.reverse(nn.interpolate(nn.forward(sn),nn.forward(yn),ot))}}return typeof _t.evaluate=="function"?{evaluate:function(){for(var sn=[],yn=arguments.length;yn--;)sn[yn]=arguments[yn];var fn=_t.evaluate.apply(void 0,sn),On=Rt.evaluate.apply(void 0,sn);if(fn!==void 0&&On!==void 0)return Kt(fn,On,ot)}}:Kt(_t,Rt,ot)}function Qc(P,G,re){return G.type==="color"?re=Qn.parse(re):G.type==="formatted"?re=jr.fromString(re.toString()):G.type==="resolvedImage"?re=ni.fromString(re.toString()):_a(re)===G.type||G.type==="enum"&&G.values[re]||(re=void 0),Yo(re,P.default,G.default)}Yn.register(Mu,{error:[{kind:"error"},[on],function(P,G){var re=G[0];throw new Cn(re.evaluate(P))}],typeof:[on,[In],function(P,G){return Tn(xr(G[0].evaluate(P)))}],"to-rgba":[Ln(Zt,4),[Pn],function(P,G){return G[0].evaluate(P).toArray()}],rgb:[Pn,[Zt,Zt,Zt],$a],rgba:[Pn,[Zt,Zt,Zt,Zt],$a],has:{type:un,overloads:[[[on],function(P,G){return Ya(G[0].evaluate(P),P.properties())}],[[on,Dn],function(P,G){var re=G[0],we=G[1];return Ya(re.evaluate(P),we.evaluate(P))}]]},get:{type:In,overloads:[[[on],function(P,G){return ys(G[0].evaluate(P),P.properties())}],[[on,Dn],function(P,G){var re=G[0],we=G[1];return ys(re.evaluate(P),we.evaluate(P))}]]},"feature-state":[In,[on],function(P,G){return ys(G[0].evaluate(P),P.featureState||{})}],properties:[Dn,[],function(P){return P.properties()}],"geometry-type":[on,[],function(P){return P.geometryType()}],id:[In,[],function(P){return P.id()}],zoom:[Zt,[],function(P){return P.globals.zoom}],"heatmap-density":[Zt,[],function(P){return P.globals.heatmapDensity||0}],"line-progress":[Zt,[],function(P){return P.globals.lineProgress||0}],accumulated:[In,[],function(P){return P.globals.accumulated===void 0?null:P.globals.accumulated}],"+":[Zt,qs(Zt),function(P,G){for(var re=0,we=0,je=G;we":[un,[on,In],function(P,G){var re=G[0],we=G[1],je=P.properties()[re.value],Ke=we.value;return typeof je==typeof Ke&&je>Ke}],"filter-id->":[un,[In],function(P,G){var re=G[0],we=P.id(),je=re.value;return typeof we==typeof je&&we>je}],"filter-<=":[un,[on,In],function(P,G){var re=G[0],we=G[1],je=P.properties()[re.value],Ke=we.value;return typeof je==typeof Ke&&je<=Ke}],"filter-id-<=":[un,[In],function(P,G){var re=G[0],we=P.id(),je=re.value;return typeof we==typeof je&&we<=je}],"filter->=":[un,[on,In],function(P,G){var re=G[0],we=G[1],je=P.properties()[re.value],Ke=we.value;return typeof je==typeof Ke&&je>=Ke}],"filter-id->=":[un,[In],function(P,G){var re=G[0],we=P.id(),je=re.value;return typeof we==typeof je&&we>=je}],"filter-has":[un,[In],function(P,G){return G[0].value in P.properties()}],"filter-has-id":[un,[],function(P){return P.id()!==null&&P.id()!==void 0}],"filter-type-in":[un,[Ln(on)],function(P,G){return G[0].value.indexOf(P.geometryType())>=0}],"filter-id-in":[un,[Ln(In)],function(P,G){return G[0].value.indexOf(P.id())>=0}],"filter-in-small":[un,[on,Ln(In)],function(P,G){var re=G[0];return G[1].value.indexOf(P.properties()[re.value])>=0}],"filter-in-large":[un,[on,Ln(In)],function(P,G){var re=G[0],we=G[1];return function(je,Ke,ot,_t){for(;ot<=_t;){var Rt=ot+_t>>1;if(Ke[Rt]===je)return!0;Ke[Rt]>je?_t=Rt-1:ot=Rt+1}return!1}(P.properties()[re.value],we.value,0,we.value.length-1)}],all:{type:un,overloads:[[[un,un],function(P,G){var re=G[0],we=G[1];return re.evaluate(P)&&we.evaluate(P)}],[qs(un),function(P,G){for(var re=0,we=G;re0&&typeof P[0]=="string"&&P[0]in Mu}function Gs(P,G){var re=new ii(Mu,[],G?function(je){var Ke={color:Pn,string:on,number:Zt,enum:on,boolean:un,formatted:En,resolvedImage:Kn};return je.type==="array"?Ln(Ke[je.value]||In,je.length):Ke[je.type]}(G):void 0),we=re.parse(P,void 0,void 0,void 0,G&&G.type==="string"?{typeAnnotation:"coerce"}:void 0);return we?ec(new _l(we,G)):ql(re.errors)}_l.prototype.evaluateWithoutErrorHandling=function(P,G,re,we,je,Ke){return this._evaluator.globals=P,this._evaluator.feature=G,this._evaluator.featureState=re,this._evaluator.canonical=we,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ke,this.expression.evaluate(this._evaluator)},_l.prototype.evaluate=function(P,G,re,we,je,Ke){this._evaluator.globals=P,this._evaluator.feature=G||null,this._evaluator.featureState=re||null,this._evaluator.canonical=we,this._evaluator.availableImages=je||null,this._evaluator.formattedSection=Ke||null;try{var ot=this.expression.evaluate(this._evaluator);if(ot==null||typeof ot=="number"&&ot!=ot)return this._defaultValue;if(this._enumValues&&!(ot in this._enumValues))throw new Cn("Expected value to be one of "+Object.keys(this._enumValues).map(function(_t){return JSON.stringify(_t)}).join(", ")+", but found "+JSON.stringify(ot)+" instead.");return ot}catch(_t){return this._warningHistory[_t.message]||(this._warningHistory[_t.message]=!0,typeof console<"u"&&console.warn(_t.message)),this._defaultValue}};var pr=function(P,G){this.kind=P,this._styleExpression=G,this.isStateDependent=P!=="constant"&&!Cr(G.expression)};pr.prototype.evaluateWithoutErrorHandling=function(P,G,re,we,je,Ke){return this._styleExpression.evaluateWithoutErrorHandling(P,G,re,we,je,Ke)},pr.prototype.evaluate=function(P,G,re,we,je,Ke){return this._styleExpression.evaluate(P,G,re,we,je,Ke)};var Dr=function(P,G,re,we){this.kind=P,this.zoomStops=re,this._styleExpression=G,this.isStateDependent=P!=="camera"&&!Cr(G.expression),this.interpolationType=we};function Zr(P,G){if((P=Gs(P,G)).result==="error")return P;var re=P.value.expression,we=Pr(re);if(!we&&!Fs(G))return ql([new qt("","data expressions not supported")]);var je=Jr(re,["zoom"]);if(!je&&!qo(G))return ql([new qt("","zoom expressions not supported")]);var Ke=ia(re);if(!Ke&&!je)return ql([new qt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Ke instanceof qt)return ql([Ke]);if(Ke instanceof ko&&!Bo(G))return ql([new qt("",'"interpolate" expressions cannot be used with this property')]);if(!Ke)return ec(new pr(we?"constant":"source",P.value));var ot=Ke instanceof ko?Ke.interpolation:void 0;return ec(new Dr(we?"camera":"composite",P.value,Ke.labels,ot))}Dr.prototype.evaluateWithoutErrorHandling=function(P,G,re,we,je,Ke){return this._styleExpression.evaluateWithoutErrorHandling(P,G,re,we,je,Ke)},Dr.prototype.evaluate=function(P,G,re,we,je,Ke){return this._styleExpression.evaluate(P,G,re,we,je,Ke)},Dr.prototype.interpolationFactor=function(P,G,re){return this.interpolationType?ko.interpolationFactor(this.interpolationType,P,G,re):0};var Li=function(P,G){this._parameters=P,this._specification=G,Ft(this,Hs(this._parameters,this._specification))};function ia(P){var G=null;if(P instanceof Nl)G=ia(P.result);else if(P instanceof Ds)for(var re=0,we=P.args;rewe.maximum?[new Et(G,re,re+" is greater than the maximum value "+we.maximum)]:[]}function mu(P){var G,re,we,je=P.valueSpec,Ke=St(P.value.type),ot={},_t=Ke!=="categorical"&&P.value.property===void 0,Rt=!_t,Kt=_a(P.value.stops)==="array"&&_a(P.value.stops[0])==="array"&&_a(P.value.stops[0][0])==="object",nn=sa({key:P.key,value:P.value,valueSpec:P.styleSpec.function,style:P.style,styleSpec:P.styleSpec,objectElementValidators:{stops:function(fn){if(Ke==="identity")return[new Et(fn.key,fn.value,'identity function may not have a "stops" property')];var On=[],jn=fn.value;return On=On.concat(po({key:fn.key,value:jn,valueSpec:fn.valueSpec,style:fn.style,styleSpec:fn.styleSpec,arrayElementValidator:sn})),_a(jn)==="array"&&jn.length===0&&On.push(new Et(fn.key,jn,"array must have at least one stop")),On},default:function(fn){return Co({key:fn.key,value:fn.value,valueSpec:je,style:fn.style,styleSpec:fn.styleSpec})}}});return Ke==="identity"&&_t&&nn.push(new Et(P.key,P.value,'missing required property "property"')),Ke==="identity"||P.value.stops||nn.push(new Et(P.key,P.value,'missing required property "stops"')),Ke==="exponential"&&P.valueSpec.expression&&!Bo(P.valueSpec)&&nn.push(new Et(P.key,P.value,"exponential functions not supported")),P.styleSpec.$version>=8&&(Rt&&!Fs(P.valueSpec)?nn.push(new Et(P.key,P.value,"property functions not supported")):_t&&!qo(P.valueSpec)&&nn.push(new Et(P.key,P.value,"zoom functions not supported"))),Ke!=="categorical"&&!Kt||P.value.property!==void 0||nn.push(new Et(P.key,P.value,'"property" property is required')),nn;function sn(fn){var On=[],jn=fn.value,sr=fn.key;if(_a(jn)!=="array")return[new Et(sr,jn,"array expected, "+_a(jn)+" found")];if(jn.length!==2)return[new Et(sr,jn,"array length 2 expected, length "+jn.length+" found")];if(Kt){if(_a(jn[0])!=="object")return[new Et(sr,jn,"object expected, "+_a(jn[0])+" found")];if(jn[0].zoom===void 0)return[new Et(sr,jn,"object stop key must have zoom")];if(jn[0].value===void 0)return[new Et(sr,jn,"object stop key must have value")];if(we&&we>St(jn[0].zoom))return[new Et(sr,jn[0].zoom,"stop zoom values must appear in ascending order")];St(jn[0].zoom)!==we&&(we=St(jn[0].zoom),re=void 0,ot={}),On=On.concat(sa({key:sr+"[0]",value:jn[0],valueSpec:{zoom:{}},style:fn.style,styleSpec:fn.styleSpec,objectElementValidators:{zoom:ro,value:yn}}))}else On=On.concat(yn({key:sr+"[0]",value:jn[0],valueSpec:{},style:fn.style,styleSpec:fn.styleSpec},jn));return Hl(Jt(jn[1]))?On.concat([new Et(sr+"[1]",jn[1],"expressions are not allowed in function stops.")]):On.concat(Co({key:sr+"[1]",value:jn[1],valueSpec:je,style:fn.style,styleSpec:fn.styleSpec}))}function yn(fn,On){var jn=_a(fn.value),sr=St(fn.value),ir=fn.value!==null?fn.value:On;if(G){if(jn!==G)return[new Et(fn.key,ir,jn+" stop domain type must match previous stop domain type "+G)]}else G=jn;if(jn!=="number"&&jn!=="string"&&jn!=="boolean")return[new Et(fn.key,ir,"stop domain value must be a number, string, or boolean")];if(jn!=="number"&&Ke!=="categorical"){var kr="number expected, "+jn+" found";return Fs(je)&&Ke===void 0&&(kr+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Et(fn.key,ir,kr)]}return Ke!=="categorical"||jn!=="number"||isFinite(sr)&&Math.floor(sr)===sr?Ke!=="categorical"&&jn==="number"&&re!==void 0&&sr=2&&P[1]!=="$id"&&P[1]!=="$type";case"in":return P.length>=3&&(typeof P[1]!="string"||Array.isArray(P[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return P.length!==3||Array.isArray(P[1])||Array.isArray(P[2]);case"any":case"all":for(var G=0,re=P.slice(1);GG?1:0}function La(P){if(!Array.isArray(P))return!1;if(P[0]==="within")return!0;for(var G=1;G"||re==="<="||re===">="?Ho(P[1],P[2],re):re==="any"?(G=P.slice(1),["any"].concat(G.map(ba))):re==="all"?["all"].concat(P.slice(1).map(ba)):re==="none"?["all"].concat(P.slice(1).map(ba).map(Ua)):re==="in"?Ts(P[1],P.slice(2)):re==="!in"?Ua(Ts(P[1],P.slice(2))):re==="has"?Aa(P[1]):re==="!has"?Ua(Aa(P[1])):re!=="within"||P}function Ho(P,G,re){switch(P){case"$type":return["filter-type-"+re,G];case"$id":return["filter-id-"+re,G];default:return["filter-"+re,P,G]}}function Ts(P,G){if(G.length===0)return!1;switch(P){case"$type":return["filter-type-in",["literal",G]];case"$id":return["filter-id-in",["literal",G]];default:return G.length>200&&!G.some(function(re){return typeof re!=typeof G[0]})?["filter-in-large",P,["literal",G.sort(vu)]]:["filter-in-small",P,["literal",G]]}}function Aa(P){switch(P){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",P]}}function Ua(P){return["!",P]}function wl(P){return Ws(Jt(P.value))?qu(Ft({},P,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ic(P)}function ic(P){var G=P.value,re=P.key;if(_a(G)!=="array")return[new Et(re,G,"array expected, "+_a(G)+" found")];var we,je=P.styleSpec,Ke=[];if(G.length<1)return[new Et(re,G,"filter array must have at least 1 element")];switch(Ke=Ke.concat(ls({key:re+"[0]",value:G[0],valueSpec:je.filter_operator,style:P.style,styleSpec:P.styleSpec})),St(G[0])){case"<":case"<=":case">":case">=":G.length>=2&&St(G[1])==="$type"&&Ke.push(new Et(re,G,'"$type" cannot be use with operator "'+G[0]+'"'));case"==":case"!=":G.length!==3&&Ke.push(new Et(re,G,'filter array for operator "'+G[0]+'" must have 3 elements'));case"in":case"!in":G.length>=2&&(we=_a(G[1]))!=="string"&&Ke.push(new Et(re+"[1]",G[1],"string expected, "+we+" found"));for(var ot=2;ot=nn[fn+0]&&we>=nn[fn+1])?(ot[yn]=!0,Ke.push(Kt[yn])):ot[yn]=!1}}},Tl.prototype._forEachCell=function(P,G,re,we,je,Ke,ot,_t){for(var Rt=this._convertToCellCoord(P),Kt=this._convertToCellCoord(G),nn=this._convertToCellCoord(re),sn=this._convertToCellCoord(we),yn=Rt;yn<=nn;yn++)for(var fn=Kt;fn<=sn;fn++){var On=this.d*fn+yn;if((!_t||_t(this._convertFromCellCoord(yn),this._convertFromCellCoord(fn),this._convertFromCellCoord(yn+1),this._convertFromCellCoord(fn+1)))&&je.call(this,P,G,re,we,On,Ke,ot,_t))return}},Tl.prototype._convertFromCellCoord=function(P){return(P-this.padding)/this.scale},Tl.prototype._convertToCellCoord=function(P){return Math.max(0,Math.min(this.d-1,Math.floor(P*this.scale)+this.padding))},Tl.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var P=this.cells,G=ru+this.cells.length+1+1,re=0,we=0;we=0)){var sn=P[nn];Kt[nn]=kl[Rt].shallow.indexOf(nn)>=0?sn:il(sn,G)}P instanceof Error&&(Kt.message=P.message)}if(Kt.$name)throw new Error("$name property is reserved for worker serialization logic.");return Rt!=="Object"&&(Kt.$name=Rt),Kt}throw new Error("can't serialize object of type "+typeof P)}function Sl(P){if(P==null||typeof P=="boolean"||typeof P=="number"||typeof P=="string"||P instanceof Boolean||P instanceof Number||P instanceof String||P instanceof Date||P instanceof RegExp||Ac(P)||Al(P)||ArrayBuffer.isView(P)||P instanceof Sa)return P;if(Array.isArray(P))return P.map(Sl);if(typeof P=="object"){var G=P.$name||"Object",re=kl[G].klass;if(!re)throw new Error("can't deserialize unregistered class "+G);if(re.deserialize)return re.deserialize(P);for(var we=Object.create(re.prototype),je=0,Ke=Object.keys(P);je=0?_t:Sl(_t)}}return we}throw new Error("can't deserialize object of type "+typeof P)}var Ml=function(){this.first=!0};Ml.prototype.update=function(P,G){var re=Math.floor(P);return this.first?(this.first=!1,this.lastIntegerZoom=re,this.lastIntegerZoomTime=0,this.lastZoom=P,this.lastFloorZoom=re,!0):(this.lastFloorZoom>re?(this.lastIntegerZoom=re+1,this.lastIntegerZoomTime=G):this.lastFloorZoom=128&&P<=255},Arabic:function(P){return P>=1536&&P<=1791},"Arabic Supplement":function(P){return P>=1872&&P<=1919},"Arabic Extended-A":function(P){return P>=2208&&P<=2303},"Hangul Jamo":function(P){return P>=4352&&P<=4607},"Unified Canadian Aboriginal Syllabics":function(P){return P>=5120&&P<=5759},Khmer:function(P){return P>=6016&&P<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(P){return P>=6320&&P<=6399},"General Punctuation":function(P){return P>=8192&&P<=8303},"Letterlike Symbols":function(P){return P>=8448&&P<=8527},"Number Forms":function(P){return P>=8528&&P<=8591},"Miscellaneous Technical":function(P){return P>=8960&&P<=9215},"Control Pictures":function(P){return P>=9216&&P<=9279},"Optical Character Recognition":function(P){return P>=9280&&P<=9311},"Enclosed Alphanumerics":function(P){return P>=9312&&P<=9471},"Geometric Shapes":function(P){return P>=9632&&P<=9727},"Miscellaneous Symbols":function(P){return P>=9728&&P<=9983},"Miscellaneous Symbols and Arrows":function(P){return P>=11008&&P<=11263},"CJK Radicals Supplement":function(P){return P>=11904&&P<=12031},"Kangxi Radicals":function(P){return P>=12032&&P<=12255},"Ideographic Description Characters":function(P){return P>=12272&&P<=12287},"CJK Symbols and Punctuation":function(P){return P>=12288&&P<=12351},Hiragana:function(P){return P>=12352&&P<=12447},Katakana:function(P){return P>=12448&&P<=12543},Bopomofo:function(P){return P>=12544&&P<=12591},"Hangul Compatibility Jamo":function(P){return P>=12592&&P<=12687},Kanbun:function(P){return P>=12688&&P<=12703},"Bopomofo Extended":function(P){return P>=12704&&P<=12735},"CJK Strokes":function(P){return P>=12736&&P<=12783},"Katakana Phonetic Extensions":function(P){return P>=12784&&P<=12799},"Enclosed CJK Letters and Months":function(P){return P>=12800&&P<=13055},"CJK Compatibility":function(P){return P>=13056&&P<=13311},"CJK Unified Ideographs Extension A":function(P){return P>=13312&&P<=19903},"Yijing Hexagram Symbols":function(P){return P>=19904&&P<=19967},"CJK Unified Ideographs":function(P){return P>=19968&&P<=40959},"Yi Syllables":function(P){return P>=40960&&P<=42127},"Yi Radicals":function(P){return P>=42128&&P<=42191},"Hangul Jamo Extended-A":function(P){return P>=43360&&P<=43391},"Hangul Syllables":function(P){return P>=44032&&P<=55215},"Hangul Jamo Extended-B":function(P){return P>=55216&&P<=55295},"Private Use Area":function(P){return P>=57344&&P<=63743},"CJK Compatibility Ideographs":function(P){return P>=63744&&P<=64255},"Arabic Presentation Forms-A":function(P){return P>=64336&&P<=65023},"Vertical Forms":function(P){return P>=65040&&P<=65055},"CJK Compatibility Forms":function(P){return P>=65072&&P<=65103},"Small Form Variants":function(P){return P>=65104&&P<=65135},"Arabic Presentation Forms-B":function(P){return P>=65136&&P<=65279},"Halfwidth and Fullwidth Forms":function(P){return P>=65280&&P<=65519}};function hs(P){for(var G=0,re=P;G=65097&&P<=65103)||li["CJK Compatibility Ideographs"](P)||li["CJK Compatibility"](P)||li["CJK Radicals Supplement"](P)||li["CJK Strokes"](P)||!(!li["CJK Symbols and Punctuation"](P)||P>=12296&&P<=12305||P>=12308&&P<=12319||P===12336)||li["CJK Unified Ideographs Extension A"](P)||li["CJK Unified Ideographs"](P)||li["Enclosed CJK Letters and Months"](P)||li["Hangul Compatibility Jamo"](P)||li["Hangul Jamo Extended-A"](P)||li["Hangul Jamo Extended-B"](P)||li["Hangul Jamo"](P)||li["Hangul Syllables"](P)||li.Hiragana(P)||li["Ideographic Description Characters"](P)||li.Kanbun(P)||li["Kangxi Radicals"](P)||li["Katakana Phonetic Extensions"](P)||li.Katakana(P)&&P!==12540||!(!li["Halfwidth and Fullwidth Forms"](P)||P===65288||P===65289||P===65293||P>=65306&&P<=65310||P===65339||P===65341||P===65343||P>=65371&&P<=65503||P===65507||P>=65512&&P<=65519)||!(!li["Small Form Variants"](P)||P>=65112&&P<=65118||P>=65123&&P<=65126)||li["Unified Canadian Aboriginal Syllabics"](P)||li["Unified Canadian Aboriginal Syllabics Extended"](P)||li["Vertical Forms"](P)||li["Yijing Hexagram Symbols"](P)||li["Yi Syllables"](P)||li["Yi Radicals"](P))))}function Na(P){return!(al(P)||function(G){return!!(li["Latin-1 Supplement"](G)&&(G===167||G===169||G===174||G===177||G===188||G===189||G===190||G===215||G===247)||li["General Punctuation"](G)&&(G===8214||G===8224||G===8225||G===8240||G===8241||G===8251||G===8252||G===8258||G===8263||G===8264||G===8265||G===8273)||li["Letterlike Symbols"](G)||li["Number Forms"](G)||li["Miscellaneous Technical"](G)&&(G>=8960&&G<=8967||G>=8972&&G<=8991||G>=8996&&G<=9e3||G===9003||G>=9085&&G<=9114||G>=9150&&G<=9165||G===9167||G>=9169&&G<=9179||G>=9186&&G<=9215)||li["Control Pictures"](G)&&G!==9251||li["Optical Character Recognition"](G)||li["Enclosed Alphanumerics"](G)||li["Geometric Shapes"](G)||li["Miscellaneous Symbols"](G)&&!(G>=9754&&G<=9759)||li["Miscellaneous Symbols and Arrows"](G)&&(G>=11026&&G<=11055||G>=11088&&G<=11097||G>=11192&&G<=11243)||li["CJK Symbols and Punctuation"](G)||li.Katakana(G)||li["Private Use Area"](G)||li["CJK Compatibility Forms"](G)||li["Small Form Variants"](G)||li["Halfwidth and Fullwidth Forms"](G)||G===8734||G===8756||G===8757||G>=9984&&G<=10087||G>=10102&&G<=10131||G===65532||G===65533)}(P))}function Ns(P){return li.Arabic(P)||li["Arabic Supplement"](P)||li["Arabic Extended-A"](P)||li["Arabic Presentation Forms-A"](P)||li["Arabic Presentation Forms-B"](P)}function iu(P){return P>=1424&&P<=2303||li["Arabic Presentation Forms-A"](P)||li["Arabic Presentation Forms-B"](P)}function El(P,G){return!(!G&&iu(P)||P>=2304&&P<=3583||P>=3840&&P<=4255||li.Khmer(P))}function ks(P){for(var G=0,re=P;G-1&&(ya=ol),cn&&cn(P)};function ta(){Qo.fire(new Lt("pluginStateChange",{pluginStatus:ya,pluginURL:So}))}var Qo=new rt,ac=function(){return ya},yi=function(){if(ya!==au||!So)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ya=As,ta(),So&&Ot({url:So},function(P){P?io(P):(ya=Jo,ta())})},Io={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ya===Jo||Io.applyArabicShaping!=null},isLoading:function(){return ya===As},setState:function(P){ya=P.pluginStatus,So=P.pluginURL},isParsed:function(){return Io.applyArabicShaping!=null&&Io.processBidirectionalText!=null&&Io.processStyledBidirectionalText!=null},getPluginURL:function(){return So}},za=function(P,G){this.zoom=P,G?(this.now=G.now,this.fadeDuration=G.fadeDuration,this.zoomHistory=G.zoomHistory,this.transition=G.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ml,this.transition={})};za.prototype.isSupportedScript=function(P){return function(G,re){for(var we=0,je=G;wethis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:G+(1-G)*re}:{fromScale:.5,toScale:1,t:1-(1-re)*G}};var xu=function(P,G){this.property=P,this.value=G,this.expression=function(re,we){if(Vu(re))return new Li(re,we);if(Hl(re)){var je=Zr(re,we);if(je.result==="error")throw new Error(je.value.map(function(ot){return ot.key+": "+ot.message}).join(", "));return je.value}var Ke=re;return typeof re=="string"&&we.type==="color"&&(Ke=Qn.parse(re)),{kind:"constant",evaluate:function(){return Ke}}}(G===void 0?P.specification.default:G,P.specification)};xu.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},xu.prototype.possiblyEvaluate=function(P,G,re){return this.property.possiblyEvaluate(this,P,G,re)};var sl=function(P){this.property=P,this.value=new xu(P,void 0)};sl.prototype.transitioned=function(P,G){return new dc(this.property,this.value,G,m({},P.transition,this.transition),P.now)},sl.prototype.untransitioned=function(){return new dc(this.property,this.value,null,{},0)};var $l=function(P){this._properties=P,this._values=Object.create(P.defaultTransitionablePropertyValues)};$l.prototype.getValue=function(P){return f(this._values[P].value.value)},$l.prototype.setValue=function(P,G){this._values.hasOwnProperty(P)||(this._values[P]=new sl(this._values[P].property)),this._values[P].value=new xu(this._values[P].property,G===null?void 0:f(G))},$l.prototype.getTransition=function(P){return f(this._values[P].transition)},$l.prototype.setTransition=function(P,G){this._values.hasOwnProperty(P)||(this._values[P]=new sl(this._values[P].property)),this._values[P].transition=f(G)||void 0},$l.prototype.serialize=function(){for(var P={},G=0,re=Object.keys(this._values);Gthis.end)return this.prior=null,je;if(this.value.isDataDriven())return this.prior=null,je;if(we=1)return 1;var Rt=_t*_t,Kt=Rt*_t;return 4*(_t<.5?Kt:3*(_t-Rt)+Kt-.75)}(ot))}return je};var $s=function(P){this._properties=P,this._values=Object.create(P.defaultTransitioningPropertyValues)};$s.prototype.possiblyEvaluate=function(P,G,re){for(var we=new Cl(this._properties),je=0,Ke=Object.keys(this._values);jeKe.zoomHistory.lastIntegerZoom?{from:re,to:we}:{from:je,to:we}},G.prototype.interpolate=function(re){return re},G}(Fi),Il=function(P){this.specification=P};Il.prototype.possiblyEvaluate=function(P,G,re,we){if(P.value!==void 0){if(P.expression.kind==="constant"){var je=P.expression.evaluate(G,null,{},re,we);return this._calculate(je,je,je,G)}return this._calculate(P.expression.evaluate(new za(Math.floor(G.zoom-1),G)),P.expression.evaluate(new za(Math.floor(G.zoom),G)),P.expression.evaluate(new za(Math.floor(G.zoom+1),G)),G)}},Il.prototype._calculate=function(P,G,re,we){return we.zoom>we.zoomHistory.lastIntegerZoom?{from:P,to:G}:{from:re,to:G}},Il.prototype.interpolate=function(P){return P};var su=function(P){this.specification=P};su.prototype.possiblyEvaluate=function(P,G,re,we){return!!P.expression.evaluate(G,null,{},re,we)},su.prototype.interpolate=function(){return!1};var ho=function(P){for(var G in this.properties=P,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],P){var re=P[G];re.specification.overridable&&this.overridableProperties.push(G);var we=this.defaultPropertyValues[G]=new xu(re,void 0),je=this.defaultTransitionablePropertyValues[G]=new sl(re);this.defaultTransitioningPropertyValues[G]=je.untransitioned(),this.defaultPossiblyEvaluatedValues[G]=we.possiblyEvaluate({})}};Mi("DataDrivenProperty",Fi),Mi("DataConstantProperty",di),Mi("CrossFadedDataDrivenProperty",Mo),Mi("CrossFadedProperty",Il),Mi("ColorRampProperty",su);var _u="-transition",da=function(P){function G(re,we){if(P.call(this),this.id=re.id,this.type=re.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},re.type!=="custom"&&(this.metadata=re.metadata,this.minzoom=re.minzoom,this.maxzoom=re.maxzoom,re.type!=="background"&&(this.source=re.source,this.sourceLayer=re["source-layer"],this.filter=re.filter),we.layout&&(this._unevaluatedLayout=new ou(we.layout)),we.paint)){for(var je in this._transitionablePaint=new $l(we.paint),re.paint)this.setPaintProperty(je,re.paint[je],{validate:!1});for(var Ke in re.layout)this.setLayoutProperty(Ke,re.layout[Ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Cl(we.paint)}}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},G.prototype.getLayoutProperty=function(re){return re==="visibility"?this.visibility:this._unevaluatedLayout.getValue(re)},G.prototype.setLayoutProperty=function(re,we,je){if(je===void 0&&(je={}),we!=null){var Ke="layers."+this.id+".layout."+re;if(this._validate(Zl,Ke,re,we,je))return}re!=="visibility"?this._unevaluatedLayout.setValue(re,we):this.visibility=we},G.prototype.getPaintProperty=function(re){return T(re,_u)?this._transitionablePaint.getTransition(re.slice(0,-11)):this._transitionablePaint.getValue(re)},G.prototype.setPaintProperty=function(re,we,je){if(je===void 0&&(je={}),we!=null){var Ke="layers."+this.id+".paint."+re;if(this._validate(xs,Ke,re,we,je))return!1}if(T(re,_u))return this._transitionablePaint.setTransition(re.slice(0,-11),we||void 0),!1;var ot=this._transitionablePaint._values[re],_t=ot.property.specification["property-type"]==="cross-faded-data-driven",Rt=ot.value.isDataDriven(),Kt=ot.value;this._transitionablePaint.setValue(re,we),this._handleSpecialPaintPropertyUpdate(re);var nn=this._transitionablePaint._values[re].value;return nn.isDataDriven()||Rt||_t||this._handleOverridablePaintPropertyUpdate(re,Kt,nn)},G.prototype._handleSpecialPaintPropertyUpdate=function(re){},G.prototype._handleOverridablePaintPropertyUpdate=function(re,we,je){return!1},G.prototype.isHidden=function(re){return!!(this.minzoom&&re=this.maxzoom)||this.visibility==="none"},G.prototype.updateTransitions=function(re){this._transitioningPaint=this._transitionablePaint.transitioned(re,this._transitioningPaint)},G.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},G.prototype.recalculate=function(re,we){re.getCrossfadeParameters&&(this._crossfadeParameters=re.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(re,void 0,we)),this.paint=this._transitioningPaint.possiblyEvaluate(re,void 0,we)},G.prototype.serialize=function(){var re={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&&(re.layout=re.layout||{},re.layout.visibility=this.visibility),M(re,function(we,je){return!(we===void 0||je==="layout"&&!Object.keys(we).length||je==="paint"&&!Object.keys(we).length)})},G.prototype._validate=function(re,we,je,Ke,ot){return ot===void 0&&(ot={}),(!ot||ot.validate!==!1)&&_s(this,re.call(cs,{key:we,layerType:this.type,objectKey:je,value:Ke,styleSpec:et,style:{glyphs:!0,sprite:!0}}))},G.prototype.is3D=function(){return!1},G.prototype.isTileClipped=function(){return!1},G.prototype.hasOffscreenPass=function(){return!1},G.prototype.resize=function(){},G.prototype.isStateDependent=function(){for(var re in this.paint._values){var we=this.paint.get(re);if(we instanceof eo&&Fs(we.property.specification)&&(we.value.kind==="source"||we.value.kind==="composite")&&we.value.isStateDependent)return!0}return!1},G}(rt),Ys={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ai=function(P,G){this._structArray=P,this._pos1=G*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},xi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function xa(P,G){G===void 0&&(G=1);var re=0,we=0;return{members:P.map(function(je){var Ke,ot=(Ke=je.type,Ys[Ke].BYTES_PER_ELEMENT),_t=re=es(re,Math.max(G,ot)),Rt=je.components||1;return we=Math.max(we,ot),re+=ot*Rt,{name:je.name,type:je.type,components:Rt,offset:_t}}),size:es(re,Math.max(we,G)),alignment:G}}function es(P,G){return Math.ceil(P/G)*G}xi.serialize=function(P,G){return P._trim(),G&&(P.isTransferred=!0,G.push(P.arrayBuffer)),{length:P.length,arrayBuffer:P.arrayBuffer}},xi.deserialize=function(P){var G=Object.create(this.prototype);return G.arrayBuffer=P.arrayBuffer,G.length=P.length,G.capacity=P.arrayBuffer.byteLength/G.bytesPerElement,G._refreshViews(),G},xi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},xi.prototype.clear=function(){this.length=0},xi.prototype.resize=function(P){this.reserve(P),this.length=P},xi.prototype.reserve=function(P){if(P>this.capacity){this.capacity=Math.max(P,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var G=this.uint8;this._refreshViews(),G&&this.uint8.set(G)}},xi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var bu=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we){var je=this.length;return this.resize(je+1),this.emplace(je,re,we)},G.prototype.emplace=function(re,we,je){var Ke=2*re;return this.int16[Ke+0]=we,this.int16[Ke+1]=je,re},G}(xi);bu.prototype.bytesPerElement=4,Mi("StructArrayLayout2i4",bu);var js=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke){var ot=this.length;return this.resize(ot+1),this.emplace(ot,re,we,je,Ke)},G.prototype.emplace=function(re,we,je,Ke,ot){var _t=4*re;return this.int16[_t+0]=we,this.int16[_t+1]=je,this.int16[_t+2]=Ke,this.int16[_t+3]=ot,re},G}(xi);js.prototype.bytesPerElement=8,Mi("StructArrayLayout4i8",js);var xt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,re,we,je,Ke,ot,_t)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt){var Kt=6*re;return this.int16[Kt+0]=we,this.int16[Kt+1]=je,this.int16[Kt+2]=Ke,this.int16[Kt+3]=ot,this.int16[Kt+4]=_t,this.int16[Kt+5]=Rt,re},G}(xi);xt.prototype.bytesPerElement=12,Mi("StructArrayLayout2i4i12",xt);var Tt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,re,we,je,Ke,ot,_t)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt){var Kt=4*re,nn=8*re;return this.int16[Kt+0]=we,this.int16[Kt+1]=je,this.uint8[nn+4]=Ke,this.uint8[nn+5]=ot,this.uint8[nn+6]=_t,this.uint8[nn+7]=Rt,re},G}(xi);Tt.prototype.bytesPerElement=8,Mi("StructArrayLayout2i4ub8",Tt);var Dt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we){var je=this.length;return this.resize(je+1),this.emplace(je,re,we)},G.prototype.emplace=function(re,we,je){var Ke=2*re;return this.float32[Ke+0]=we,this.float32[Ke+1]=je,re},G}(xi);Dt.prototype.bytesPerElement=8,Mi("StructArrayLayout2f8",Dt);var X=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn){var yn=this.length;return this.resize(yn+1),this.emplace(yn,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn){var fn=10*re;return this.uint16[fn+0]=we,this.uint16[fn+1]=je,this.uint16[fn+2]=Ke,this.uint16[fn+3]=ot,this.uint16[fn+4]=_t,this.uint16[fn+5]=Rt,this.uint16[fn+6]=Kt,this.uint16[fn+7]=nn,this.uint16[fn+8]=sn,this.uint16[fn+9]=yn,re},G}(xi);X.prototype.bytesPerElement=20,Mi("StructArrayLayout10ui20",X);var R=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn){var On=this.length;return this.resize(On+1),this.emplace(On,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On){var jn=12*re;return this.int16[jn+0]=we,this.int16[jn+1]=je,this.int16[jn+2]=Ke,this.int16[jn+3]=ot,this.uint16[jn+4]=_t,this.uint16[jn+5]=Rt,this.uint16[jn+6]=Kt,this.uint16[jn+7]=nn,this.int16[jn+8]=sn,this.int16[jn+9]=yn,this.int16[jn+10]=fn,this.int16[jn+11]=On,re},G}(xi);R.prototype.bytesPerElement=24,Mi("StructArrayLayout4i4ui4i24",R);var i=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=3*re;return this.float32[ot+0]=we,this.float32[ot+1]=je,this.float32[ot+2]=Ke,re},G}(xi);i.prototype.bytesPerElement=12,Mi("StructArrayLayout3f12",i);var a=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re){var we=this.length;return this.resize(we+1),this.emplace(we,re)},G.prototype.emplace=function(re,we){var je=1*re;return this.uint32[je+0]=we,re},G}(xi);a.prototype.bytesPerElement=4,Mi("StructArrayLayout1ul4",a);var C=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.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)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn){var sn=this.length;return this.resize(sn+1),this.emplace(sn,re,we,je,Ke,ot,_t,Rt,Kt,nn)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn){var yn=10*re,fn=5*re;return this.int16[yn+0]=we,this.int16[yn+1]=je,this.int16[yn+2]=Ke,this.int16[yn+3]=ot,this.int16[yn+4]=_t,this.int16[yn+5]=Rt,this.uint32[fn+3]=Kt,this.uint16[yn+8]=nn,this.uint16[yn+9]=sn,re},G}(xi);C.prototype.bytesPerElement=20,Mi("StructArrayLayout6i1ul2ui20",C);var F=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t){var Rt=this.length;return this.resize(Rt+1),this.emplace(Rt,re,we,je,Ke,ot,_t)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt){var Kt=6*re;return this.int16[Kt+0]=we,this.int16[Kt+1]=je,this.int16[Kt+2]=Ke,this.int16[Kt+3]=ot,this.int16[Kt+4]=_t,this.int16[Kt+5]=Rt,re},G}(xi);F.prototype.bytesPerElement=12,Mi("StructArrayLayout2i2i2i12",F);var q=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke,ot){var _t=this.length;return this.resize(_t+1),this.emplace(_t,re,we,je,Ke,ot)},G.prototype.emplace=function(re,we,je,Ke,ot,_t){var Rt=4*re,Kt=8*re;return this.float32[Rt+0]=we,this.float32[Rt+1]=je,this.float32[Rt+2]=Ke,this.int16[Kt+6]=ot,this.int16[Kt+7]=_t,re},G}(xi);q.prototype.bytesPerElement=16,Mi("StructArrayLayout2f1f2i16",q);var te=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke){var ot=this.length;return this.resize(ot+1),this.emplace(ot,re,we,je,Ke)},G.prototype.emplace=function(re,we,je,Ke,ot){var _t=12*re,Rt=3*re;return this.uint8[_t+0]=we,this.uint8[_t+1]=je,this.float32[Rt+1]=Ke,this.float32[Rt+2]=ot,re},G}(xi);te.prototype.bytesPerElement=12,Mi("StructArrayLayout2ub2f12",te);var ue=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=3*re;return this.uint16[ot+0]=we,this.uint16[ot+1]=je,this.uint16[ot+2]=Ke,re},G}(xi);ue.prototype.bytesPerElement=6,Mi("StructArrayLayout3ui6",ue);var ve=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.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)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr){var _r=this.length;return this.resize(_r+1),this.emplace(_r,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r){var Fr=24*re,Gr=12*re,qr=48*re;return this.int16[Fr+0]=we,this.int16[Fr+1]=je,this.uint16[Fr+2]=Ke,this.uint16[Fr+3]=ot,this.uint32[Gr+2]=_t,this.uint32[Gr+3]=Rt,this.uint32[Gr+4]=Kt,this.uint16[Fr+10]=nn,this.uint16[Fr+11]=sn,this.uint16[Fr+12]=yn,this.float32[Gr+7]=fn,this.float32[Gr+8]=On,this.uint8[qr+36]=jn,this.uint8[qr+37]=sr,this.uint8[qr+38]=ir,this.uint32[Gr+10]=kr,this.int16[Fr+22]=_r,re},G}(xi);ve.prototype.bytesPerElement=48,Mi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ve);var Ae=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.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)},G.prototype.emplaceBack=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r,Fr,Gr,qr,ri,ei,vi,Ei,aa,Ni,Qi){var qi=this.length;return this.resize(qi+1),this.emplace(qi,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r,Fr,Gr,qr,ri,ei,vi,Ei,aa,Ni,Qi)},G.prototype.emplace=function(re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On,jn,sr,ir,kr,_r,Fr,Gr,qr,ri,ei,vi,Ei,aa,Ni,Qi,qi){var zi=34*re,Ea=17*re;return this.int16[zi+0]=we,this.int16[zi+1]=je,this.int16[zi+2]=Ke,this.int16[zi+3]=ot,this.int16[zi+4]=_t,this.int16[zi+5]=Rt,this.int16[zi+6]=Kt,this.int16[zi+7]=nn,this.uint16[zi+8]=sn,this.uint16[zi+9]=yn,this.uint16[zi+10]=fn,this.uint16[zi+11]=On,this.uint16[zi+12]=jn,this.uint16[zi+13]=sr,this.uint16[zi+14]=ir,this.uint16[zi+15]=kr,this.uint16[zi+16]=_r,this.uint16[zi+17]=Fr,this.uint16[zi+18]=Gr,this.uint16[zi+19]=qr,this.uint16[zi+20]=ri,this.uint16[zi+21]=ei,this.uint16[zi+22]=vi,this.uint32[Ea+12]=Ei,this.float32[Ea+13]=aa,this.float32[Ea+14]=Ni,this.float32[Ea+15]=Qi,this.float32[Ea+16]=qi,re},G}(xi);Ae.prototype.bytesPerElement=68,Mi("StructArrayLayout8i15ui1ul4f68",Ae);var Re=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re){var we=this.length;return this.resize(we+1),this.emplace(we,re)},G.prototype.emplace=function(re,we){var je=1*re;return this.float32[je+0]=we,re},G}(xi);Re.prototype.bytesPerElement=4,Mi("StructArrayLayout1f4",Re);var Ue=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=3*re;return this.int16[ot+0]=we,this.int16[ot+1]=je,this.int16[ot+2]=Ke,re},G}(xi);Ue.prototype.bytesPerElement=6,Mi("StructArrayLayout3i6",Ue);var it=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je){var Ke=this.length;return this.resize(Ke+1),this.emplace(Ke,re,we,je)},G.prototype.emplace=function(re,we,je,Ke){var ot=2*re,_t=4*re;return this.uint32[ot+0]=we,this.uint16[_t+2]=je,this.uint16[_t+3]=Ke,re},G}(xi);it.prototype.bytesPerElement=8,Mi("StructArrayLayout1ul2ui8",it);var ct=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we){var je=this.length;return this.resize(je+1),this.emplace(je,re,we)},G.prototype.emplace=function(re,we,je){var Ke=2*re;return this.uint16[Ke+0]=we,this.uint16[Ke+1]=je,re},G}(xi);ct.prototype.bytesPerElement=4,Mi("StructArrayLayout2ui4",ct);var dt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re){var we=this.length;return this.resize(we+1),this.emplace(we,re)},G.prototype.emplace=function(re,we){var je=1*re;return this.uint16[je+0]=we,re},G}(xi);dt.prototype.bytesPerElement=2,Mi("StructArrayLayout1ui2",dt);var bt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},G.prototype.emplaceBack=function(re,we,je,Ke){var ot=this.length;return this.resize(ot+1),this.emplace(ot,re,we,je,Ke)},G.prototype.emplace=function(re,we,je,Ke,ot){var _t=4*re;return this.float32[_t+0]=we,this.float32[_t+1]=je,this.float32[_t+2]=Ke,this.float32[_t+3]=ot,re},G}(xi);bt.prototype.bytesPerElement=16,Mi("StructArrayLayout4f16",bt);var Ct=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={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 re.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},re.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},re.x1.get=function(){return this._structArray.int16[this._pos2+2]},re.y1.get=function(){return this._structArray.int16[this._pos2+3]},re.x2.get=function(){return this._structArray.int16[this._pos2+4]},re.y2.get=function(){return this._structArray.int16[this._pos2+5]},re.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},re.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},re.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},re.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(G.prototype,re),G}(Ai);Ct.prototype.size=20;var Mt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Ct(this,re)},G}(C);Mi("CollisionBoxArray",Mt);var Ut=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={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 re.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},re.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},re.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},re.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},re.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},re.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},re.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},re.segment.get=function(){return this._structArray.uint16[this._pos2+10]},re.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},re.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},re.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},re.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},re.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},re.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},re.placedOrientation.set=function(we){this._structArray.uint8[this._pos1+37]=we},re.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},re.hidden.set=function(we){this._structArray.uint8[this._pos1+38]=we},re.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},re.crossTileID.set=function(we){this._structArray.uint32[this._pos4+10]=we},re.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(G.prototype,re),G}(Ai);Ut.prototype.size=48;var It=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Ut(this,re)},G}(ve);Mi("PlacedSymbolArray",It);var Qt=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={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 re.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},re.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},re.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},re.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},re.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},re.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},re.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},re.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},re.key.get=function(){return this._structArray.uint16[this._pos2+8]},re.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},re.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},re.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},re.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},re.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},re.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},re.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},re.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},re.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},re.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},re.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},re.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},re.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},re.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},re.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},re.crossTileID.set=function(we){this._structArray.uint32[this._pos4+12]=we},re.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},re.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},re.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},re.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(G.prototype,re),G}(Ai);Qt.prototype.size=68;var tn=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Qt(this,re)},G}(Ae);Mi("SymbolInstanceArray",tn);var Yt=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.getoffsetX=function(re){return this.float32[1*re+0]},G}(Re);Mi("GlyphOffsetArray",Yt);var vn=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.getx=function(re){return this.int16[3*re+0]},G.prototype.gety=function(re){return this.int16[3*re+1]},G.prototype.gettileUnitDistanceFromAnchor=function(re){return this.int16[3*re+2]},G}(Ue);Mi("SymbolLineVertexArray",vn);var Mn=function(P){function G(){P.apply(this,arguments)}P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G;var re={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return re.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},re.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},re.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(G.prototype,re),G}(Ai);Mn.prototype.size=8;var Vn=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.get=function(re){return new Mn(this,re)},G}(it);Mi("FeatureIndexArray",Vn);var Hn=xa([{name:"a_pos",components:2,type:"Int16"}],4).members,Xn=function(P){P===void 0&&(P=[]),this.segments=P};function rr(P,G){return 256*(P=h(Math.floor(P),0,255))+h(Math.floor(G),0,255)}Xn.prototype.prepareSegment=function(P,G,re,we){var je=this.segments[this.segments.length-1];return P>Xn.MAX_VERTEX_ARRAY_LENGTH&&I("Max vertices per segment is "+Xn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+P),(!je||je.vertexLength+P>Xn.MAX_VERTEX_ARRAY_LENGTH||je.sortKey!==we)&&(je={vertexOffset:G.length,primitiveOffset:re.length,vertexLength:0,primitiveLength:0},we!==void 0&&(je.sortKey=we),this.segments.push(je)),je},Xn.prototype.get=function(){return this.segments},Xn.prototype.destroy=function(){for(var P=0,G=this.segments;P>>16)*_t&65535)<<16)&4294967295)<<15|Kt>>>17))*Rt+(((Kt>>>16)*Rt&65535)<<16)&4294967295)<<13|Ke>>>19))+((5*(Ke>>>16)&65535)<<16)&4294967295))+((58964+(ot>>>16)&65535)<<16);switch(Kt=0,we){case 3:Kt^=(255&G.charCodeAt(nn+2))<<16;case 2:Kt^=(255&G.charCodeAt(nn+1))<<8;case 1:Ke^=Kt=(65535&(Kt=(Kt=(65535&(Kt^=255&G.charCodeAt(nn)))*_t+(((Kt>>>16)*_t&65535)<<16)&4294967295)<<15|Kt>>>17))*Rt+(((Kt>>>16)*Rt&65535)<<16)&4294967295}return Ke^=G.length,Ke=2246822507*(65535&(Ke^=Ke>>>16))+((2246822507*(Ke>>>16)&65535)<<16)&4294967295,Ke=3266489909*(65535&(Ke^=Ke>>>13))+((3266489909*(Ke>>>16)&65535)<<16)&4294967295,(Ke^=Ke>>>16)>>>0}}),Lr=w(function(P){P.exports=function(G,re){for(var we,je=G.length,Ke=re^je,ot=0;je>=4;)we=1540483477*(65535&(we=255&G.charCodeAt(ot)|(255&G.charCodeAt(++ot))<<8|(255&G.charCodeAt(++ot))<<16|(255&G.charCodeAt(++ot))<<24))+((1540483477*(we>>>16)&65535)<<16),Ke=1540483477*(65535&Ke)+((1540483477*(Ke>>>16)&65535)<<16)^(we=1540483477*(65535&(we^=we>>>24))+((1540483477*(we>>>16)&65535)<<16)),je-=4,++ot;switch(je){case 3:Ke^=(255&G.charCodeAt(ot+2))<<16;case 2:Ke^=(255&G.charCodeAt(ot+1))<<8;case 1:Ke=1540483477*(65535&(Ke^=255&G.charCodeAt(ot)))+((1540483477*(Ke>>>16)&65535)<<16)}return Ke=1540483477*(65535&(Ke^=Ke>>>13))+((1540483477*(Ke>>>16)&65535)<<16),(Ke^=Ke>>>15)>>>0}}),dr=nr,Br=nr,Sr=Lr;dr.murmur3=Br,dr.murmur2=Sr;var Vr=function(){this.ids=[],this.positions=[],this.indexed=!1};Vr.prototype.add=function(P,G,re,we){this.ids.push(Nr(P)),this.positions.push(G,re,we)},Vr.prototype.getPositions=function(P){for(var G=Nr(P),re=0,we=this.ids.length-1;re>1;this.ids[je]>=G?we=je:re=je+1}for(var Ke=[];this.ids[re]===G;){var ot=this.positions[3*re],_t=this.positions[3*re+1],Rt=this.positions[3*re+2];Ke.push({index:ot,start:_t,end:Rt}),re++}return Ke},Vr.serialize=function(P,G){var re=new Float64Array(P.ids),we=new Uint32Array(P.positions);return si(re,we,0,re.length-1),G&&G.push(re.buffer,we.buffer),{ids:re,positions:we}},Vr.deserialize=function(P){var G=new Vr;return G.ids=P.ids,G.positions=P.positions,G.indexed=!0,G};var fi=Math.pow(2,53)-1;function Nr(P){var G=+P;return!isNaN(G)&&G<=fi?G:dr(String(P))}function si(P,G,re,we){for(;re>1],Ke=re-1,ot=we+1;;){do Ke++;while(P[Ke]je);if(Ke>=ot)break;_i(P,Ke,ot),_i(G,3*Ke,3*ot),_i(G,3*Ke+1,3*ot+1),_i(G,3*Ke+2,3*ot+2)}ot-reot.x+1||Rtot.y+1)&&I("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return re}function ao(P,G){return{type:P.type,id:P.id,properties:P.properties,geometry:G?ll(P):[]}}function ul(P,G,re,we,je){P.emplaceBack(2*G+(we+1)/2,2*re+(je+1)/2)}var Lo=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new bu,this.indexArray=new ue,this.segments=new Xn,this.programConfigurations=new fa(P.layers,P.zoom),this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};function Bc(P,G){for(var re=0;re1){if(Cu(P,G))return!0;for(var we=0;we1?P.distSqr(re):P.distSqr(re.sub(G)._mult(je)._add(G))}function nf(P,G){for(var re,we,je,Ke=!1,ot=0;otG.y!=je.y>G.y&&G.x<(je.x-we.x)*(G.y-we.y)/(je.y-we.y)+we.x&&(Ke=!Ke);return Ke}function Xs(P,G){for(var re=!1,we=0,je=P.length-1;weG.y!=ot.y>G.y&&G.x<(ot.x-Ke.x)*(G.y-Ke.y)/(ot.y-Ke.y)+Ke.x&&(re=!re)}return re}function Ap(P,G,re){var we=re[0],je=re[2];if(P.xje.x&&G.x>je.x||P.yje.y&&G.y>je.y)return!1;var Ke=B(P,G,re[0]);return Ke!==B(P,G,re[1])||Ke!==B(P,G,re[2])||Ke!==B(P,G,re[3])}function Mc(P,G,re){var we=G.paint.get(P).value;return we.kind==="constant"?we.value:re.programConfigurations.get(G.id).getMaxValue(P)}function mc(P){return Math.sqrt(P[0]*P[0]+P[1]*P[1])}function oc(P,G,re,we,je){if(!G[0]&&!G[1])return P;var Ke=r.convert(G)._mult(je);re==="viewport"&&Ke._rotate(-we);for(var ot=[],_t=0;_t=Hi||nn<0||nn>=Hi)){var sn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,P.sortKey),yn=sn.vertexLength;ul(this.layoutVertexArray,Kt,nn,-1,-1),ul(this.layoutVertexArray,Kt,nn,1,-1),ul(this.layoutVertexArray,Kt,nn,1,1),ul(this.layoutVertexArray,Kt,nn,-1,1),this.indexArray.emplaceBack(yn,yn+1,yn+2),this.indexArray.emplaceBack(yn,yn+3,yn+2),sn.vertexLength+=4,sn.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,P,re,{},we)},Mi("CircleBucket",Lo,{omit:["layers"]});var Ih=new ho({"circle-sort-key":new Fi(et.layout_circle["circle-sort-key"])}),vc={paint:new ho({"circle-radius":new Fi(et.paint_circle["circle-radius"]),"circle-color":new Fi(et.paint_circle["circle-color"]),"circle-blur":new Fi(et.paint_circle["circle-blur"]),"circle-opacity":new Fi(et.paint_circle["circle-opacity"]),"circle-translate":new di(et.paint_circle["circle-translate"]),"circle-translate-anchor":new di(et.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new di(et.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new di(et.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Fi(et.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Fi(et.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Fi(et.paint_circle["circle-stroke-opacity"])}),layout:Ih},ps=typeof Float32Array<"u"?Float32Array:Array;function Sp(P){return P[0]=1,P[1]=0,P[2]=0,P[3]=0,P[4]=0,P[5]=1,P[6]=0,P[7]=0,P[8]=0,P[9]=0,P[10]=1,P[11]=0,P[12]=0,P[13]=0,P[14]=0,P[15]=1,P}function gd(P,G,re){var we=G[0],je=G[1],Ke=G[2],ot=G[3],_t=G[4],Rt=G[5],Kt=G[6],nn=G[7],sn=G[8],yn=G[9],fn=G[10],On=G[11],jn=G[12],sr=G[13],ir=G[14],kr=G[15],_r=re[0],Fr=re[1],Gr=re[2],qr=re[3];return P[0]=_r*we+Fr*_t+Gr*sn+qr*jn,P[1]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[2]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[3]=_r*ot+Fr*nn+Gr*On+qr*kr,_r=re[4],Fr=re[5],Gr=re[6],qr=re[7],P[4]=_r*we+Fr*_t+Gr*sn+qr*jn,P[5]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[6]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[7]=_r*ot+Fr*nn+Gr*On+qr*kr,_r=re[8],Fr=re[9],Gr=re[10],qr=re[11],P[8]=_r*we+Fr*_t+Gr*sn+qr*jn,P[9]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[10]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[11]=_r*ot+Fr*nn+Gr*On+qr*kr,_r=re[12],Fr=re[13],Gr=re[14],qr=re[15],P[12]=_r*we+Fr*_t+Gr*sn+qr*jn,P[13]=_r*je+Fr*Rt+Gr*yn+qr*sr,P[14]=_r*Ke+Fr*Kt+Gr*fn+qr*ir,P[15]=_r*ot+Fr*nn+Gr*On+qr*kr,P}Math.hypot||(Math.hypot=function(){for(var P=arguments,G=0,re=arguments.length;re--;)G+=P[re]*P[re];return Math.sqrt(G)});var Ss=gd,Ef,md=function(P,G,re){return P[0]=G[0]-re[0],P[1]=G[1]-re[1],P[2]=G[2]-re[2],P};function eh(P,G,re){var we=G[0],je=G[1],Ke=G[2],ot=G[3];return P[0]=re[0]*we+re[4]*je+re[8]*Ke+re[12]*ot,P[1]=re[1]*we+re[5]*je+re[9]*Ke+re[13]*ot,P[2]=re[2]*we+re[6]*je+re[10]*Ke+re[14]*ot,P[3]=re[3]*we+re[7]*je+re[11]*Ke+re[15]*ot,P}Ef=new ps(3),ps!=Float32Array&&(Ef[0]=0,Ef[1]=0,Ef[2]=0),function(){var P=new ps(4);ps!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0,P[3]=0)}();var Ph=function(P){var G=P[0],re=P[1];return G*G+re*re},ep=(function(){var P=new ps(2);ps!=Float32Array&&(P[0]=0,P[1]=0)}(),function(P){function G(re){P.call(this,re,vc)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.createBucket=function(re){return new Lo(re)},G.prototype.queryRadius=function(re){var we=re;return Mc("circle-radius",this,we)+Mc("circle-stroke-width",this,we)+mc(this.paint.get("circle-translate"))},G.prototype.queryIntersectsFeature=function(re,we,je,Ke,ot,_t,Rt,Kt){for(var nn=oc(re,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),_t.angle,Rt),sn=this.paint.get("circle-radius").evaluate(we,je)+this.paint.get("circle-stroke-width").evaluate(we,je),yn=this.paint.get("circle-pitch-alignment")==="map",fn=yn?nn:function(ri,ei){return ri.map(function(vi){return th(vi,ei)})}(nn,Kt),On=yn?sn*Rt:sn,jn=0,sr=Ke;jnP.width||je.height>P.height||re.x>P.width-je.width||re.y>P.height-je.height)throw new RangeError("out of range source coordinates for image copy");if(je.width>G.width||je.height>G.height||we.x>G.width-je.width||we.y>G.height-je.height)throw new RangeError("out of range destination coordinates for image copy");for(var ot=P.data,_t=G.data,Rt=0;Rt80*re){we=Ke=P[0],je=ot=P[1];for(var On=re;OnKe&&(Ke=_t),Rt>ot&&(ot=Rt);Kt=(Kt=Math.max(Ke-we,ot-je))!==0?1/Kt:0}return Ks(yn,fn,re,we,je,Kt),fn}function P0(P,G,re,we,je){var Ke,ot;if(je===Cp(P,G,re,we)>0)for(Ke=G;Ke=G;Ke-=we)ot=sc(Ke,P[Ke],P[Ke+1],ot);return ot&&of(ot,ot.next)&&(lf(ot),ot=ot.next),ot}function rf(P,G){if(!P)return P;G||(G=P);var re,we=P;do if(re=!1,we.steiner||!of(we,we.next)&&Ms(we.prev,we,we.next)!==0)we=we.next;else{if(lf(we),(we=G=we.prev)===we.next)break;re=!0}while(re||we!==G);return G}function Ks(P,G,re,we,je,Ke,ot){if(P){!ot&&Ke&&function(nn,sn,yn,fn){var On=nn;do On.z===null&&(On.z=Pf(On.x,On.y,sn,yn,fn)),On.prevZ=On.prev,On.nextZ=On.next,On=On.next;while(On!==nn);On.prevZ.nextZ=null,On.prevZ=null,function(jn){var sr,ir,kr,_r,Fr,Gr,qr,ri,ei=1;do{for(ir=jn,jn=null,Fr=null,Gr=0;ir;){for(Gr++,kr=ir,qr=0,sr=0;sr0||ri>0&&kr;)qr!==0&&(ri===0||!kr||ir.z<=kr.z)?(_r=ir,ir=ir.nextZ,qr--):(_r=kr,kr=kr.nextZ,ri--),Fr?Fr.nextZ=_r:jn=_r,_r.prevZ=Fr,Fr=_r;ir=kr}Fr.nextZ=null,ei*=2}while(Gr>1)}(On)}(P,we,je,Ke);for(var _t,Rt,Kt=P;P.prev!==P.next;)if(_t=P.prev,Rt=P.next,Ke?xd(P,we,je,Ke):rh(P))G.push(_t.i/re),G.push(P.i/re),G.push(Rt.i/re),lf(P),P=Rt.next,Kt=Rt.next;else if((P=Rt)===Kt){ot?ot===1?Ks(P=L0(rf(P),G,re),G,re,we,je,Ke,2):ot===2&&xv(P,G,re,we,je,Ke):Ks(rf(P),G,re,we,je,Ke,1);break}}}function rh(P){var G=P.prev,re=P,we=P.next;if(Ms(G,re,we)>=0)return!1;for(var je=P.next.next;je!==P.prev;){if(Lf(G.x,G.y,re.x,re.y,we.x,we.y,je.x,je.y)&&Ms(je.prev,je,je.next)>=0)return!1;je=je.next}return!0}function xd(P,G,re,we){var je=P.prev,Ke=P,ot=P.next;if(Ms(je,Ke,ot)>=0)return!1;for(var _t=je.xKe.x?je.x>ot.x?je.x:ot.x:Ke.x>ot.x?Ke.x:ot.x,nn=je.y>Ke.y?je.y>ot.y?je.y:ot.y:Ke.y>ot.y?Ke.y:ot.y,sn=Pf(_t,Rt,G,re,we),yn=Pf(Kt,nn,G,re,we),fn=P.prevZ,On=P.nextZ;fn&&fn.z>=sn&&On&&On.z<=yn;){if(fn!==P.prev&&fn!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,fn.x,fn.y)&&Ms(fn.prev,fn,fn.next)>=0||(fn=fn.prevZ,On!==P.prev&&On!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,On.x,On.y)&&Ms(On.prev,On,On.next)>=0))return!1;On=On.nextZ}for(;fn&&fn.z>=sn;){if(fn!==P.prev&&fn!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,fn.x,fn.y)&&Ms(fn.prev,fn,fn.next)>=0)return!1;fn=fn.prevZ}for(;On&&On.z<=yn;){if(On!==P.prev&&On!==P.next&&Lf(je.x,je.y,Ke.x,Ke.y,ot.x,ot.y,On.x,On.y)&&Ms(On.prev,On,On.next)>=0)return!1;On=On.nextZ}return!0}function L0(P,G,re){var we=P;do{var je=we.prev,Ke=we.next.next;!of(je,Ke)&&_d(je,we,we.next,Ke)&&sf(je,Ke)&&sf(Ke,je)&&(G.push(je.i/re),G.push(we.i/re),G.push(Ke.i/re),lf(we),lf(we.next),we=P=Ke),we=we.next}while(we!==P);return rf(we)}function xv(P,G,re,we,je,Ke){var ot=P;do{for(var _t=ot.next.next;_t!==ot.prev;){if(ot.i!==_t.i&&Mp(ot,_t)){var Rt=zh(ot,_t);return ot=rf(ot,ot.next),Rt=rf(Rt,Rt.next),Ks(ot,G,re,we,je,Ke),void Ks(Rt,G,re,we,je,Ke)}_t=_t.next}ot=ot.next}while(ot!==P)}function Vg(P,G){return P.x-G.x}function np(P,G){if(G=function(we,je){var Ke,ot=je,_t=we.x,Rt=we.y,Kt=-1/0;do{if(Rt<=ot.y&&Rt>=ot.next.y&&ot.next.y!==ot.y){var nn=ot.x+(Rt-ot.y)*(ot.next.x-ot.x)/(ot.next.y-ot.y);if(nn<=_t&&nn>Kt){if(Kt=nn,nn===_t){if(Rt===ot.y)return ot;if(Rt===ot.next.y)return ot.next}Ke=ot.x=ot.x&&ot.x>=fn&&_t!==ot.x&&Lf(RtKe.x||ot.x===Ke.x&&af(Ke,ot)))&&(Ke=ot,jn=sn)),ot=ot.next;while(ot!==yn);return Ke}(P,G)){var re=zh(G,P);rf(G,G.next),rf(re,re.next)}}function af(P,G){return Ms(P.prev,P,G.prev)<0&&Ms(G.next,P,P.next)<0}function Pf(P,G,re,we,je){return(P=1431655765&((P=858993459&((P=252645135&((P=16711935&((P=32767*(P-re)*je)|P<<8))|P<<4))|P<<2))|P<<1))|(G=1431655765&((G=858993459&((G=252645135&((G=16711935&((G=32767*(G-we)*je)|G<<8))|G<<4))|G<<2))|G<<1))<<1}function qg(P){var G=P,re=P;do(G.x=0&&(P-ot)*(we-_t)-(re-ot)*(G-_t)>=0&&(re-ot)*(Ke-_t)-(je-ot)*(we-_t)>=0}function Mp(P,G){return P.next.i!==G.i&&P.prev.i!==G.i&&!function(re,we){var je=re;do{if(je.i!==re.i&&je.next.i!==re.i&&je.i!==we.i&&je.next.i!==we.i&&_d(je,je.next,re,we))return!0;je=je.next}while(je!==re);return!1}(P,G)&&(sf(P,G)&&sf(G,P)&&function(re,we){var je=re,Ke=!1,ot=(re.x+we.x)/2,_t=(re.y+we.y)/2;do je.y>_t!=je.next.y>_t&&je.next.y!==je.y&&ot<(je.next.x-je.x)*(_t-je.y)/(je.next.y-je.y)+je.x&&(Ke=!Ke),je=je.next;while(je!==re);return Ke}(P,G)&&(Ms(P.prev,P,G.prev)||Ms(P,G.prev,G))||of(P,G)&&Ms(P.prev,P,P.next)>0&&Ms(G.prev,G,G.next)>0)}function Ms(P,G,re){return(G.y-P.y)*(re.x-G.x)-(G.x-P.x)*(re.y-G.y)}function of(P,G){return P.x===G.x&&P.y===G.y}function _d(P,G,re,we){var je=Ep(Ms(P,G,re)),Ke=Ep(Ms(P,G,we)),ot=Ep(Ms(re,we,P)),_t=Ep(Ms(re,we,G));return je!==Ke&&ot!==_t||!(je!==0||!Lh(P,re,G))||!(Ke!==0||!Lh(P,we,G))||!(ot!==0||!Lh(re,P,we))||!(_t!==0||!Lh(re,G,we))}function Lh(P,G,re){return G.x<=Math.max(P.x,re.x)&&G.x>=Math.min(P.x,re.x)&&G.y<=Math.max(P.y,re.y)&&G.y>=Math.min(P.y,re.y)}function Ep(P){return P>0?1:P<0?-1:0}function sf(P,G){return Ms(P.prev,P,P.next)<0?Ms(P,G,P.next)>=0&&Ms(P,P.prev,G)>=0:Ms(P,G,P.prev)<0||Ms(P,P.next,G)<0}function zh(P,G){var re=new z0(P.i,P.x,P.y),we=new z0(G.i,G.x,G.y),je=P.next,Ke=G.prev;return P.next=G,G.prev=P,re.next=je,je.prev=re,we.next=re,re.prev=we,Ke.next=we,we.prev=Ke,we}function sc(P,G,re,we){var je=new z0(P,G,re);return we?(je.next=we.next,je.prev=we,we.next.prev=je,we.next=je):(je.prev=je,je.next=je),je}function lf(P){P.next.prev=P.prev,P.prev.next=P.next,P.prevZ&&(P.prevZ.nextZ=P.nextZ),P.nextZ&&(P.nextZ.prevZ=P.prevZ)}function z0(P,G,re){this.i=P,this.x=G,this.y=re,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cp(P,G,re,we){for(var je=0,Ke=G,ot=re-we;Kere;){if(we-re>600){var Ke=we-re+1,ot=G-re+1,_t=Math.log(Ke),Rt=.5*Math.exp(2*_t/3),Kt=.5*Math.sqrt(_t*Rt*(Ke-Rt)/Ke)*(ot-Ke/2<0?-1:1);O0(P,G,Math.max(re,Math.floor(G-ot*Rt/Ke+Kt)),Math.min(we,Math.floor(G+(Ke-ot)*Rt/Ke+Kt)),je)}var nn=P[G],sn=re,yn=we;for(rp(P,re,G),je(P[we],nn)>0&&rp(P,re,we);sn0;)yn--}je(P[re],nn)===0?rp(P,re,yn):rp(P,++yn,we),yn<=G&&(re=yn+1),G<=yn&&(we=yn-1)}}function rp(P,G,re){var we=P[G];P[G]=P[re],P[re]=we}function _v(P,G){return PG?1:0}function D0(P,G){var re=P.length;if(re<=1)return[P];for(var we,je,Ke=[],ot=0;ot1)for(var Rt=0;Rt0&&(we+=P[je-1].length,re.holes.push(we))}return re},If.default=Iu;var lu=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=P.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bu,this.indexArray=new ue,this.indexArray2=new ct,this.programConfigurations=new fa(P.layers,P.zoom),this.segments=new Xn,this.segments2=new Xn,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};lu.prototype.populate=function(P,G,re){this.hasPattern=bd("fill",this.layers,G);for(var we=this.layers[0].layout.get("fill-sort-key"),je=[],Ke=0,ot=P;Ke>3}if(je--,we===1||we===2)Ke+=P.readSVarint(),ot+=P.readSVarint(),we===1&&(G&&_t.push(G),G=[]),G.push(new r(Ke,ot));else{if(we!==7)throw new Error("unknown command "+we);G&&G.push(G[0].clone())}}return G&&_t.push(G),_t},Dh.prototype.bbox=function(){var P=this._pbf;P.pos=this._geometry;for(var G=P.readVarint()+P.pos,re=1,we=0,je=0,Ke=0,ot=1/0,_t=-1/0,Rt=1/0,Kt=-1/0;P.pos>3}if(we--,re===1||re===2)(je+=P.readSVarint())_t&&(_t=je),(Ke+=P.readSVarint())Kt&&(Kt=Ke);else if(re!==7)throw new Error("unknown command "+re)}return[ot,Rt,_t,Kt]},Dh.prototype.toGeoJSON=function(P,G,re){var we,je,Ke=this.extent*Math.pow(2,re),ot=this.extent*P,_t=this.extent*G,Rt=this.loadGeometry(),Kt=Dh.types[this.type];function nn(fn){for(var On=0;On>3;je=ot===1?we.readString():ot===2?we.readFloat():ot===3?we.readDouble():ot===4?we.readVarint64():ot===5?we.readVarint():ot===6?we.readSVarint():ot===7?we.readBoolean():null}return je}(re))}function Wu(P,G,re){if(P===3){var we=new Td(re,re.readVarint()+re.pos);we.length&&(G[we.name]=we)}}kd.prototype.feature=function(P){if(P<0||P>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[P];var G=this._pbf.readVarint()+this._pbf.pos;return new ma(this._pbf,G,this.extent,this._keys,this._values)};var ts={VectorTile:function(P,G){this.layers=P.readFields(Wu,{},G)},VectorTileFeature:ma,VectorTileLayer:Td},Ad=ts.VectorTileFeature.types,Ip=Math.pow(2,13);function uf(P,G,re,we,je,Ke,ot,_t){P.emplaceBack(G,re,2*Math.floor(we*Ip)+ot,je*Ip*2,Ke*Ip*2,Math.round(_t))}var lc=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(G){return G.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new xt,this.indexArray=new ue,this.programConfigurations=new fa(P.layers,P.zoom),this.segments=new Xn,this.stateDependentLayerIds=this.layers.filter(function(G){return G.isStateDependent()}).map(function(G){return G.id})};function Pp(P,G){return P.x===G.x&&(P.x<0||P.x>Hi)||P.y===G.y&&(P.y<0||P.y>Hi)}lc.prototype.populate=function(P,G,re){this.features=[],this.hasPattern=bd("fill-extrusion",this.layers,G);for(var we=0,je=P;weHi})||Ea.every(function(va){return va.y<0})||Ea.every(function(va){return va.y>Hi})))for(var jn=0,sr=0;sr=1){var kr=On[sr-1];if(!Pp(ir,kr)){sn.vertexLength+4>Xn.MAX_VERTEX_ARRAY_LENGTH&&(sn=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var _r=ir.sub(kr)._perp()._unit(),Fr=kr.dist(ir);jn+Fr>32768&&(jn=0),uf(this.layoutVertexArray,ir.x,ir.y,_r.x,_r.y,0,0,jn),uf(this.layoutVertexArray,ir.x,ir.y,_r.x,_r.y,0,1,jn),jn+=Fr,uf(this.layoutVertexArray,kr.x,kr.y,_r.x,_r.y,0,0,jn),uf(this.layoutVertexArray,kr.x,kr.y,_r.x,_r.y,0,1,jn);var Gr=sn.vertexLength;this.indexArray.emplaceBack(Gr,Gr+2,Gr+1),this.indexArray.emplaceBack(Gr+1,Gr+2,Gr+3),sn.vertexLength+=4,sn.primitiveLength+=2}}}}if(sn.vertexLength+Rt>Xn.MAX_VERTEX_ARRAY_LENGTH&&(sn=this.segments.prepareSegment(Rt,this.layoutVertexArray,this.indexArray)),Ad[P.type]==="Polygon"){for(var qr=[],ri=[],ei=sn.vertexLength,vi=0,Ei=_t;vi=2&&P[Rt-1].equals(P[Rt-2]);)Rt--;for(var Kt=0;Kt0;if(ri&&ir>Kt){var vi=nn.dist(fn);if(vi>2*sn){var Ei=nn.sub(nn.sub(fn)._mult(sn/vi)._round());this.updateDistance(fn,Ei),this.addCurrentVertex(Ei,jn,0,0,yn),fn=Ei}}var aa=fn&&On,Ni=aa?re:_t?"butt":we;if(aa&&Ni==="round"&&(Grje&&(Ni="bevel"),Ni==="bevel"&&(Gr>2&&(Ni="flipbevel"),Gr100)kr=sr.mult(-1);else{var Qi=Gr*jn.add(sr).mag()/jn.sub(sr).mag();kr._perp()._mult(Qi*(ei?-1:1))}this.addCurrentVertex(nn,kr,0,0,yn),this.addCurrentVertex(nn,kr.mult(-1),0,0,yn)}else if(Ni==="bevel"||Ni==="fakeround"){var qi=-Math.sqrt(Gr*Gr-1),zi=ei?qi:0,Ea=ei?0:qi;if(fn&&this.addCurrentVertex(nn,jn,zi,Ea,yn),Ni==="fakeround")for(var va=Math.round(180*qr/Math.PI/20),yo=1;yo2*sn){var xo=nn.add(On.sub(nn)._mult(sn/Eo)._round());this.updateDistance(nn,xo),this.addCurrentVertex(xo,sr,0,0,yn),nn=xo}}}}},Ll.prototype.addCurrentVertex=function(P,G,re,we,je,Ke){Ke===void 0&&(Ke=!1);var ot=G.x+G.y*re,_t=G.y-G.x*re,Rt=-G.x+G.y*we,Kt=-G.y-G.x*we;this.addHalfVertex(P,ot,_t,Ke,!1,re,je),this.addHalfVertex(P,Rt,Kt,Ke,!0,-we,je),this.distance>N0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(P,G,re,we,je,Ke))},Ll.prototype.addHalfVertex=function(P,G,re,we,je,Ke,ot){var _t=P.x,Rt=P.y,Kt=.5*(this.lineClips?this.scaledDistance*(N0-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((_t<<1)+(we?1:0),(Rt<<1)+(je?1:0),Math.round(63*G)+128,Math.round(63*re)+128,1+(Ke===0?0:Ke<0?-1:1)|(63&Kt)<<2,Kt>>6),this.lineClips){var nn=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(nn,this.lineClipsArray.length)}var sn=ot.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,sn),ot.primitiveLength++),je?this.e2=sn:this.e1=sn},Ll.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ll.prototype.updateDistance=function(P,G){this.distance+=P.dist(G),this.updateScaledDistance()},Mi("LineBucket",Ll,{omit:["layers","patternFeatures"]});var Zg=new ho({"line-cap":new di(et.layout_line["line-cap"]),"line-join":new Fi(et.layout_line["line-join"]),"line-miter-limit":new di(et.layout_line["line-miter-limit"]),"line-round-limit":new di(et.layout_line["line-round-limit"]),"line-sort-key":new Fi(et.layout_line["line-sort-key"])}),j0={paint:new ho({"line-opacity":new Fi(et.paint_line["line-opacity"]),"line-color":new Fi(et.paint_line["line-color"]),"line-translate":new di(et.paint_line["line-translate"]),"line-translate-anchor":new di(et.paint_line["line-translate-anchor"]),"line-width":new Fi(et.paint_line["line-width"]),"line-gap-width":new Fi(et.paint_line["line-gap-width"]),"line-offset":new Fi(et.paint_line["line-offset"]),"line-blur":new Fi(et.paint_line["line-blur"]),"line-dasharray":new Il(et.paint_line["line-dasharray"]),"line-pattern":new Mo(et.paint_line["line-pattern"]),"line-gradient":new su(et.paint_line["line-gradient"])}),layout:Zg},bv=function(P){function G(){P.apply(this,arguments)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.possiblyEvaluate=function(re,we){return we=new za(Math.floor(we.zoom),{now:we.now,fadeDuration:we.fadeDuration,zoomHistory:we.zoomHistory,transition:we.transition}),P.prototype.possiblyEvaluate.call(this,re,we)},G.prototype.evaluate=function(re,we,je,Ke){return we=m({},we,{zoom:Math.floor(we.zoom)}),P.prototype.evaluate.call(this,re,we,je,Ke)},G}(Fi),$g=new bv(j0.paint.properties["line-width"].specification);$g.useIntegerZoom=!0;var ey=function(P){function G(re){P.call(this,re,j0),this.gradientVersion=0}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype._handleSpecialPaintPropertyUpdate=function(re){if(re==="line-gradient"){var we=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=we._styleExpression.expression instanceof Ti,this.gradientVersion=(this.gradientVersion+1)%o}},G.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},G.prototype.recalculate=function(re,we){P.prototype.recalculate.call(this,re,we),this.paint._values["line-floorwidth"]=$g.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,re)},G.prototype.createBucket=function(re){return new Ll(re)},G.prototype.queryRadius=function(re){var we=re,je=wv(Mc("line-width",this,we),Mc("line-gap-width",this,we)),Ke=Mc("line-offset",this,we);return je/2+Math.abs(Ke)+mc(this.paint.get("line-translate"))},G.prototype.queryIntersectsFeature=function(re,we,je,Ke,ot,_t,Rt){var Kt=oc(re,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),_t.angle,Rt),nn=Rt/2*wv(this.paint.get("line-width").evaluate(we,je),this.paint.get("line-gap-width").evaluate(we,je)),sn=this.paint.get("line-offset").evaluate(we,je);return sn&&(Ke=function(yn,fn){for(var On=[],jn=new r(0,0),sr=0;sr=3){for(var ir=0;ir0?G+2*P:P}var Rh=xa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Yg=xa([{name:"a_projected_pos",components:3,type:"Float32"}],4),Xg=(xa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),xa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Fh=(xa([{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"}]),xa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Kg=xa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Op(P,G,re){return P.sections.forEach(function(we){we.text=function(je,Ke,ot){var _t=Ke.layout.get("text-transform").evaluate(ot,{});return _t==="uppercase"?je=je.toLocaleUpperCase():_t==="lowercase"&&(je=je.toLocaleLowerCase()),Io.applyArabicShaping&&(je=Io.applyArabicShaping(je)),je}(we.text,G,re)}),P}xa([{name:"triangle",components:3,type:"Uint16"}]),xa([{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"}]),xa([{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"}]),xa([{type:"Float32",name:"offsetX"}]),xa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Rf={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},cl=24,Sd=function(P,G,re,we,je){var Ke,ot,_t=8*je-we-1,Rt=(1<<_t)-1,Kt=Rt>>1,nn=-7,sn=re?je-1:0,yn=re?-1:1,fn=P[G+sn];for(sn+=yn,Ke=fn&(1<<-nn)-1,fn>>=-nn,nn+=_t;nn>0;Ke=256*Ke+P[G+sn],sn+=yn,nn-=8);for(ot=Ke&(1<<-nn)-1,Ke>>=-nn,nn+=we;nn>0;ot=256*ot+P[G+sn],sn+=yn,nn-=8);if(Ke===0)Ke=1-Kt;else{if(Ke===Rt)return ot?NaN:1/0*(fn?-1:1);ot+=Math.pow(2,we),Ke-=Kt}return(fn?-1:1)*ot*Math.pow(2,Ke-we)},Dp=function(P,G,re,we,je,Ke){var ot,_t,Rt,Kt=8*Ke-je-1,nn=(1<>1,yn=je===23?Math.pow(2,-24)-Math.pow(2,-77):0,fn=we?0:Ke-1,On=we?1:-1,jn=G<0||G===0&&1/G<0?1:0;for(G=Math.abs(G),isNaN(G)||G===1/0?(_t=isNaN(G)?1:0,ot=nn):(ot=Math.floor(Math.log(G)/Math.LN2),G*(Rt=Math.pow(2,-ot))<1&&(ot--,Rt*=2),(G+=ot+sn>=1?yn/Rt:yn*Math.pow(2,1-sn))*Rt>=2&&(ot++,Rt/=2),ot+sn>=nn?(_t=0,ot=nn):ot+sn>=1?(_t=(G*Rt-1)*Math.pow(2,je),ot+=sn):(_t=G*Math.pow(2,sn-1)*Math.pow(2,je),ot=0));je>=8;P[re+fn]=255&_t,fn+=On,_t/=256,je-=8);for(ot=ot<0;P[re+fn]=255&ot,fn+=On,ot/=256,Kt-=8);P[re+fn-On]|=128*jn},Rp=Ga;function Ga(P){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(P)?P:new Uint8Array(P||0),this.pos=0,this.type=0,this.length=this.buf.length}Ga.Varint=0,Ga.Fixed64=1,Ga.Bytes=2,Ga.Fixed32=5;var Bh=4294967296,Jg=1/Bh,Fp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ec(P){return P.type===Ga.Bytes?P.readVarint()+P.pos:P.pos+1}function cf(P,G,re){return re?4294967296*G+(P>>>0):4294967296*(G>>>0)+(P>>>0)}function Qg(P,G,re){var we=G<=16383?1:G<=2097151?2:G<=268435455?3:Math.floor(Math.log(G)/(7*Math.LN2));re.realloc(we);for(var je=re.pos-1;je>=P;je--)re.buf[je+we]=re.buf[je]}function Tv(P,G){for(var re=0;re>>8,P[re+2]=G>>>16,P[re+3]=G>>>24}function nm(P,G){return(P[G]|P[G+1]<<8|P[G+2]<<16)+(P[G+3]<<24)}Ga.prototype={destroy:function(){this.buf=null},readFields:function(P,G,re){for(re=re||this.length;this.pos>3,Ke=this.pos;this.type=7&we,P(je,G,this),this.pos===Ke&&this.skip(we)}return G},readMessage:function(P,G){return this.readFields(P,G,this.readVarint()+this.pos)},readFixed32:function(){var P=Md(this.buf,this.pos);return this.pos+=4,P},readSFixed32:function(){var P=nm(this.buf,this.pos);return this.pos+=4,P},readFixed64:function(){var P=Md(this.buf,this.pos)+Md(this.buf,this.pos+4)*Bh;return this.pos+=8,P},readSFixed64:function(){var P=Md(this.buf,this.pos)+nm(this.buf,this.pos+4)*Bh;return this.pos+=8,P},readFloat:function(){var P=Sd(this.buf,this.pos,!0,23,4);return this.pos+=4,P},readDouble:function(){var P=Sd(this.buf,this.pos,!0,52,8);return this.pos+=8,P},readVarint:function(P){var G,re,we=this.buf;return G=127&(re=we[this.pos++]),re<128?G:(G|=(127&(re=we[this.pos++]))<<7,re<128?G:(G|=(127&(re=we[this.pos++]))<<14,re<128?G:(G|=(127&(re=we[this.pos++]))<<21,re<128?G:function(je,Ke,ot){var _t,Rt,Kt=ot.buf;if(_t=(112&(Rt=Kt[ot.pos++]))>>4,Rt<128||(_t|=(127&(Rt=Kt[ot.pos++]))<<3,Rt<128)||(_t|=(127&(Rt=Kt[ot.pos++]))<<10,Rt<128)||(_t|=(127&(Rt=Kt[ot.pos++]))<<17,Rt<128)||(_t|=(127&(Rt=Kt[ot.pos++]))<<24,Rt<128)||(_t|=(1&(Rt=Kt[ot.pos++]))<<31,Rt<128))return cf(je,_t,Ke);throw new Error("Expected varint not more than 10 bytes")}(G|=(15&(re=we[this.pos]))<<28,P,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var P=this.readVarint();return P%2==1?(P+1)/-2:P/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var P=this.readVarint()+this.pos,G=this.pos;return this.pos=P,P-G>=12&&Fp?function(re,we,je){return Fp.decode(re.subarray(we,je))}(this.buf,G,P):function(re,we,je){for(var Ke="",ot=we;ot239?4:nn>223?3:nn>191?2:1;if(ot+yn>je)break;yn===1?nn<128&&(sn=nn):yn===2?(192&(_t=re[ot+1]))==128&&(sn=(31&nn)<<6|63&_t)<=127&&(sn=null):yn===3?(_t=re[ot+1],Rt=re[ot+2],(192&_t)==128&&(192&Rt)==128&&((sn=(15&nn)<<12|(63&_t)<<6|63&Rt)<=2047||sn>=55296&&sn<=57343)&&(sn=null)):yn===4&&(_t=re[ot+1],Rt=re[ot+2],Kt=re[ot+3],(192&_t)==128&&(192&Rt)==128&&(192&Kt)==128&&((sn=(15&nn)<<18|(63&_t)<<12|(63&Rt)<<6|63&Kt)<=65535||sn>=1114112)&&(sn=null)),sn===null?(sn=65533,yn=1):sn>65535&&(sn-=65536,Ke+=String.fromCharCode(sn>>>10&1023|55296),sn=56320|1023&sn),Ke+=String.fromCharCode(sn),ot+=yn}return Ke}(this.buf,G,P)},readBytes:function(){var P=this.readVarint()+this.pos,G=this.buf.subarray(this.pos,P);return this.pos=P,G},readPackedVarint:function(P,G){if(this.type!==Ga.Bytes)return P.push(this.readVarint(G));var re=Ec(this);for(P=P||[];this.pos127;);else if(G===Ga.Bytes)this.pos=this.readVarint()+this.pos;else if(G===Ga.Fixed32)this.pos+=4;else{if(G!==Ga.Fixed64)throw new Error("Unimplemented type: "+G);this.pos+=8}},writeTag:function(P,G){this.writeVarint(P<<3|G)},realloc:function(P){for(var G=this.length||16;G268435455||P<0?function(G,re){var we,je;if(G>=0?(we=G%4294967296|0,je=G/4294967296|0):(je=~(-G/4294967296),4294967295^(we=~(-G%4294967296))?we=we+1|0:(we=0,je=je+1|0)),G>=18446744073709552e3||G<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");re.realloc(10),function(Ke,ot,_t){_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos++]=127&Ke|128,Ke>>>=7,_t.buf[_t.pos]=127&Ke}(we,0,re),function(Ke,ot){var _t=(7&Ke)<<4;ot.buf[ot.pos++]|=_t|((Ke>>>=3)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke|((Ke>>>=7)?128:0),Ke&&(ot.buf[ot.pos++]=127&Ke)))))}(je,re)}(P,this):(this.realloc(4),this.buf[this.pos++]=127&P|(P>127?128:0),P<=127||(this.buf[this.pos++]=127&(P>>>=7)|(P>127?128:0),P<=127||(this.buf[this.pos++]=127&(P>>>=7)|(P>127?128:0),P<=127||(this.buf[this.pos++]=P>>>7&127))))},writeSVarint:function(P){this.writeVarint(P<0?2*-P-1:2*P)},writeBoolean:function(P){this.writeVarint(!!P)},writeString:function(P){P=String(P),this.realloc(4*P.length),this.pos++;var G=this.pos;this.pos=function(we,je,Ke){for(var ot,_t,Rt=0;Rt55295&&ot<57344){if(!_t){ot>56319||Rt+1===je.length?(we[Ke++]=239,we[Ke++]=191,we[Ke++]=189):_t=ot;continue}if(ot<56320){we[Ke++]=239,we[Ke++]=191,we[Ke++]=189,_t=ot;continue}ot=_t-55296<<10|ot-56320|65536,_t=null}else _t&&(we[Ke++]=239,we[Ke++]=191,we[Ke++]=189,_t=null);ot<128?we[Ke++]=ot:(ot<2048?we[Ke++]=ot>>6|192:(ot<65536?we[Ke++]=ot>>12|224:(we[Ke++]=ot>>18|240,we[Ke++]=ot>>12&63|128),we[Ke++]=ot>>6&63|128),we[Ke++]=63&ot|128)}return Ke}(this.buf,P,this.pos);var re=this.pos-G;re>=128&&Qg(G,re,this),this.pos=G-1,this.writeVarint(re),this.pos+=re},writeFloat:function(P){this.realloc(4),Dp(this.buf,P,this.pos,!0,23,4),this.pos+=4},writeDouble:function(P){this.realloc(8),Dp(this.buf,P,this.pos,!0,52,8),this.pos+=8},writeBytes:function(P){var G=P.length;this.writeVarint(G),this.realloc(G);for(var re=0;re=128&&Qg(re,we,this),this.pos=re-1,this.writeVarint(we),this.pos+=we},writeMessage:function(P,G,re){this.writeTag(P,Ga.Bytes),this.writeRawMessage(G,re)},writePackedVarint:function(P,G){G.length&&this.writeMessage(P,Tv,G)},writePackedSVarint:function(P,G){G.length&&this.writeMessage(P,em,G)},writePackedBoolean:function(P,G){G.length&&this.writeMessage(P,Bp,G)},writePackedFloat:function(P,G){G.length&&this.writeMessage(P,kv,G)},writePackedDouble:function(P,G){G.length&&this.writeMessage(P,Av,G)},writePackedFixed32:function(P,G){G.length&&this.writeMessage(P,tm,G)},writePackedSFixed32:function(P,G){G.length&&this.writeMessage(P,Sv,G)},writePackedFixed64:function(P,G){G.length&&this.writeMessage(P,Mv,G)},writePackedSFixed64:function(P,G){G.length&&this.writeMessage(P,Ev,G)},writeBytesField:function(P,G){this.writeTag(P,Ga.Bytes),this.writeBytes(G)},writeFixed32Field:function(P,G){this.writeTag(P,Ga.Fixed32),this.writeFixed32(G)},writeSFixed32Field:function(P,G){this.writeTag(P,Ga.Fixed32),this.writeSFixed32(G)},writeFixed64Field:function(P,G){this.writeTag(P,Ga.Fixed64),this.writeFixed64(G)},writeSFixed64Field:function(P,G){this.writeTag(P,Ga.Fixed64),this.writeSFixed64(G)},writeVarintField:function(P,G){this.writeTag(P,Ga.Varint),this.writeVarint(G)},writeSVarintField:function(P,G){this.writeTag(P,Ga.Varint),this.writeSVarint(G)},writeStringField:function(P,G){this.writeTag(P,Ga.Bytes),this.writeString(G)},writeFloatField:function(P,G){this.writeTag(P,Ga.Fixed32),this.writeFloat(G)},writeDoubleField:function(P,G){this.writeTag(P,Ga.Fixed64),this.writeDouble(G)},writeBooleanField:function(P,G){this.writeVarintField(P,!!G)}};var rm=3;function ty(P,G,re){P===1&&re.readMessage(im,G)}function im(P,G,re){if(P===3){var we=re.readMessage(Cv,{}),je=we.id,Ke=we.bitmap,ot=we.width,_t=we.height,Rt=we.left,Kt=we.top,nn=we.advance;G.push({id:je,bitmap:new nh({width:ot+2*rm,height:_t+2*rm},Ke),metrics:{width:ot,height:_t,left:Rt,top:Kt,advance:nn}})}}function Cv(P,G,re){P===1?G.id=re.readVarint():P===2?G.bitmap=re.readBytes():P===3?G.width=re.readVarint():P===4?G.height=re.readVarint():P===5?G.left=re.readSVarint():P===6?G.top=re.readSVarint():P===7&&(G.advance=re.readVarint())}var U0=rm;function Ed(P){for(var G=0,re=0,we=0,je=P;we=0;yn--){var fn=ot[yn];if(!(sn.w>fn.w||sn.h>fn.h)){if(sn.x=fn.x,sn.y=fn.y,Rt=Math.max(Rt,sn.y+sn.h),_t=Math.max(_t,sn.x+sn.w),sn.w===fn.w&&sn.h===fn.h){var On=ot.pop();yn0&&Wr>mt&&(mt=Wr)}else{var pi=va[Nt.fontStack],Ci=pi&&pi[rn];if(Ci&&Ci.rect)xn=Ci.rect,Sn=Ci.metrics;else{var Vi=Ea[Nt.fontStack],ki=Vi&&Vi[rn];if(!ki)continue;Sn=ki.metrics}hn=(ze-Nt.scale)*cl}wr?(zi.verticalizable=!0,ht.push({glyph:rn,imageName:Nn,x:Cs,y:pl+hn,vertical:wr,scale:Nt.scale,fontStack:Nt.fontStack,sectionIndex:Xt,metrics:Sn,rect:xn}),Cs+=Gn*Nt.scale+xo):(ht.push({glyph:rn,imageName:Nn,x:Cs,y:pl+hn,vertical:wr,scale:Nt.scale,fontStack:Nt.fontStack,sectionIndex:Xt,metrics:Sn,rect:xn}),Cs+=Sn.advance*Nt.scale+xo)}if(ht.length!==0){var ui=Cs-xo;jo=Math.max(ui,jo),q0(ht,0,ht.length-1,zl,mt)}Cs=0;var Ii=Ka*ze+mt;Je.lineOffset=Math.max(mt,Ze),pl+=Ii,ea=Math.max(Ii,ea),++Y}else pl+=Ka,++Y}var Oi=pl-jp,Si=vo(Ba),ti=Si.horizontalAlign,Di=Si.verticalAlign;(function(Bi,ra,oo,to,Is,Ou,Js,Ps,hu){var Yl=(ra-oo)*Is,gs=0;gs=Ou!==Js?-Ps*to-jp:(-to*hu+.5)*Js;for(var ns=0,Ol=Bi;ns=0&&we>=P&&Id[this.text.charCodeAt(we)];we--)re--;this.text=this.text.substring(P,re),this.sectionIndex=this.sectionIndex.slice(P,re)},uu.prototype.substring=function(P,G){var re=new uu;return re.text=this.text.substring(P,G),re.sectionIndex=this.sectionIndex.slice(P,G),re.sections=this.sections,re},uu.prototype.toString=function(){return this.text},uu.prototype.getMaxScale=function(){var P=this;return this.sectionIndex.reduce(function(G,re){return Math.max(G,P.sections[re].scale)},0)},uu.prototype.addTextSection=function(P,G){this.text+=P.text,this.sections.push(Bf.forText(P.scale,P.fontStack||G));for(var re=this.sections.length-1,we=0;we=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Id={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Yu={};function am(P,G,re,we,je,Ke){if(G.imageName){var ot=we[G.imageName];return ot?ot.displaySize[0]*G.scale*cl/Ke+je:0}var _t=re[G.fontStack],Rt=_t&&_t[P];return Rt?Rt.metrics.advance*G.scale+je:0}function Pd(P,G,re,we){var je=Math.pow(P-G,2);return we?P=0,nn=0,sn=0;sn-re/2;){if(--ot<0)return!1;_t-=P[ot].dist(Ke),Ke=P[ot]}_t+=P[ot].dist(P[ot+1]),ot++;for(var Rt=[],Kt=0;_twe;)Kt-=Rt.shift().angleDelta;if(Kt>je)return!1;ot++,_t+=sn.dist(yn)}return!0}function lm(P){for(var G=0,re=0;reKt){var On=(Kt-Rt)/fn,jn=Wi(sn.x,yn.x,On),sr=Wi(sn.y,yn.y,On),ir=new Nf(jn,sr,yn.angleTo(sn),nn);return ir._round(),!ot||sm(P,ir,_t,ot,G)?ir:void 0}Rt+=fn}}function Lv(P,G,re,we,je,Ke,ot,_t,Rt){var Kt=um(we,Ke,ot),nn=cm(we,je),sn=nn*ot,yn=P[0].x===0||P[0].x===Rt||P[0].y===0||P[0].y===Rt;return G-sn=0&&Fr=0&&Gr=0&&yn+Kt<=nn){var qr=new Nf(Fr,Gr,kr,On);qr._round(),we&&!sm(P,qr,Ke,we,je)||fn.push(qr)}}sn+=ir}return _t||fn.length||ot||(fn=hm(P,sn/2,re,we,je,Ke,ot,!0,Rt)),fn}function jf(P,G,re,we,je){for(var Ke=[],ot=0;ot=we&&sn.x>=we||(nn.x>=we?nn=new r(we,nn.y+(sn.y-nn.y)*((we-nn.x)/(sn.x-nn.x)))._round():sn.x>=we&&(sn=new r(we,nn.y+(sn.y-nn.y)*((we-nn.x)/(sn.x-nn.x)))._round()),nn.y>=je&&sn.y>=je||(nn.y>=je?nn=new r(nn.x+(sn.x-nn.x)*((je-nn.y)/(sn.y-nn.y)),je)._round():sn.y>=je&&(sn=new r(nn.x+(sn.x-nn.x)*((je-nn.y)/(sn.y-nn.y)),je)._round()),Rt&&nn.equals(Rt[Rt.length-1])||(Rt=[nn],Ke.push(Rt)),Rt.push(sn)))))}return Ke}var jc=Zu;function W0(P,G,re,we){var je=[],Ke=P.image,ot=Ke.pixelRatio,_t=Ke.paddedRect.w-2*jc,Rt=Ke.paddedRect.h-2*jc,Kt=P.right-P.left,nn=P.bottom-P.top,sn=Ke.stretchX||[[0,_t]],yn=Ke.stretchY||[[0,Rt]],fn=function(Ka,Ba){return Ka+Ba[1]-Ba[0]},On=sn.reduce(fn,0),jn=yn.reduce(fn,0),sr=_t-On,ir=Rt-jn,kr=0,_r=On,Fr=0,Gr=jn,qr=0,ri=sr,ei=0,vi=ir;if(Ke.content&&we){var Ei=Ke.content;kr=sp(sn,0,Ei[0]),Fr=sp(yn,0,Ei[1]),_r=sp(sn,Ei[0],Ei[2]),Gr=sp(yn,Ei[1],Ei[3]),qr=Ei[0]-kr,ei=Ei[1]-Fr,ri=Ei[2]-Ei[0]-_r,vi=Ei[3]-Ei[1]-Gr}var aa=function(Ka,Ba,Ja,Eo){var xo=zd(Ka.stretch-kr,_r,Kt,P.left),Es=Od(Ka.fixed-qr,ri,Ka.stretch,On),Oo=zd(Ba.stretch-Fr,Gr,nn,P.top),Cs=Od(Ba.fixed-ei,vi,Ba.stretch,jn),pl=zd(Ja.stretch-kr,_r,Kt,P.left),jo=Od(Ja.fixed-qr,ri,Ja.stretch,On),ea=zd(Eo.stretch-Fr,Gr,nn,P.top),zl=Od(Eo.fixed-ei,vi,Eo.stretch,jn),Y=new r(xo,Oo),U=new r(pl,Oo),ne=new r(pl,ea),pe=new r(xo,ea),ze=new r(Es/ot,Cs/ot),Ze=new r(jo/ot,zl/ot),Je=G*Math.PI/180;if(Je){var ht=Math.sin(Je),mt=Math.cos(Je),zt=[mt,-ht,ht,mt];Y._matMult(zt),U._matMult(zt),pe._matMult(zt),ne._matMult(zt)}var Nt=Ka.stretch+Ka.fixed,Xt=Ja.stretch+Ja.fixed,rn=Ba.stretch+Ba.fixed,hn=Eo.stretch+Eo.fixed;return{tl:Y,tr:U,bl:pe,br:ne,tex:{x:Ke.paddedRect.x+jc+Nt,y:Ke.paddedRect.y+jc+rn,w:Xt-Nt,h:hn-rn},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ze,pixelOffsetBR:Ze,minFontScaleX:ri/ot/Kt,minFontScaleY:vi/ot/nn,isSDF:re}};if(we&&(Ke.stretchX||Ke.stretchY))for(var Ni=Ld(sn,sr,On),Qi=Ld(yn,ir,jn),qi=0;qi0&&(fn=Math.max(10,fn),this.circleDiameter=fn)}else{var On=Ke.top*ot-_t,jn=Ke.bottom*ot+_t,sr=Ke.left*ot-_t,ir=Ke.right*ot+_t,kr=Ke.collisionPadding;if(kr&&(sr-=kr[0]*ot,On-=kr[1]*ot,ir+=kr[2]*ot,jn+=kr[3]*ot),Kt){var _r=new r(sr,On),Fr=new r(ir,On),Gr=new r(sr,jn),qr=new r(ir,jn),ri=Kt*Math.PI/180;_r._rotate(ri),Fr._rotate(ri),Gr._rotate(ri),qr._rotate(ri),sr=Math.min(_r.x,Fr.x,Gr.x,qr.x),ir=Math.max(_r.x,Fr.x,Gr.x,qr.x),On=Math.min(_r.y,Fr.y,Gr.y,qr.y),jn=Math.max(_r.y,Fr.y,Gr.y,qr.y)}P.emplaceBack(G.x,G.y,sr,On,ir,jn,re,we,je)}this.boxEndIndex=P.length},Uf=function(P,G){if(P===void 0&&(P=[]),G===void 0&&(G=fm),this.data=P,this.length=this.data.length,this.compare=G,this.length>0)for(var re=(this.length>>1)-1;re>=0;re--)this._down(re)};function fm(P,G){return PG?1:0}function Xu(P,G,re){G===void 0&&(G=1),re===void 0&&(re=!1);for(var we=1/0,je=1/0,Ke=-1/0,ot=-1/0,_t=P[0],Rt=0;Rt<_t.length;Rt++){var Kt=_t[Rt];(!Rt||Kt.xKe)&&(Ke=Kt.x),(!Rt||Kt.y>ot)&&(ot=Kt.y)}var nn=Ke-we,sn=ot-je,yn=Math.min(nn,sn),fn=yn/2,On=new Uf([],Z0);if(yn===0)return new r(we,je);for(var jn=we;jnir.d||!ir.d)&&(ir=_r,re&&console.log("found best %d after %d probes",Math.round(1e4*_r.d)/1e4,kr)),_r.max-ir.d<=G||(fn=_r.h/2,On.push(new vh(_r.p.x-fn,_r.p.y-fn,fn,P)),On.push(new vh(_r.p.x+fn,_r.p.y-fn,fn,P)),On.push(new vh(_r.p.x-fn,_r.p.y+fn,fn,P)),On.push(new vh(_r.p.x+fn,_r.p.y+fn,fn,P)),kr+=4)}return re&&(console.log("num probes: "+kr),console.log("best distance: "+ir.d)),ir.p}function Z0(P,G){return G.max-P.max}function vh(P,G,re,we){this.p=new r(P,G),this.h=re,this.d=function(je,Ke){for(var ot=!1,_t=1/0,Rt=0;Rtje.y!=On.y>je.y&&je.x<(On.x-fn.x)*(je.y-fn.y)/(On.y-fn.y)+fn.x&&(ot=!ot),_t=Math.min(_t,tf(je,fn,On))}return(ot?1:-1)*Math.sqrt(_t)}(this.p,we),this.max=this.d+this.h*Math.SQRT2}Uf.prototype.push=function(P){this.data.push(P),this.length++,this._up(this.length-1)},Uf.prototype.pop=function(){if(this.length!==0){var P=this.data[0],G=this.data.pop();return this.length--,this.length>0&&(this.data[0]=G,this._down(0)),P}},Uf.prototype.peek=function(){return this.data[0]},Uf.prototype._up=function(P){for(var G=this.data,re=this.compare,we=G[P];P>0;){var je=P-1>>1,Ke=G[je];if(re(we,Ke)>=0)break;G[P]=Ke,P=je}G[P]=we},Uf.prototype._down=function(P){for(var G=this.data,re=this.compare,we=this.length>>1,je=G[P];P=0)break;G[P]=ot,P=Ke}G[P]=je};var Cc=7,Vf=Number.POSITIVE_INFINITY;function lp(P,G){return G[1]!==Vf?function(re,we,je){var Ke=0,ot=0;switch(we=Math.abs(we),je=Math.abs(je),re){case"top-right":case"top-left":case"top":ot=je-Cc;break;case"bottom-right":case"bottom-left":case"bottom":ot=-je+Cc}switch(re){case"top-right":case"bottom-right":case"right":Ke=-we;break;case"top-left":case"bottom-left":case"left":Ke=we}return[Ke,ot]}(P,G[0],G[1]):function(re,we){var je=0,Ke=0;we<0&&(we=0);var ot=we/Math.sqrt(2);switch(re){case"top-right":case"top-left":Ke=ot-Cc;break;case"bottom-right":case"bottom-left":Ke=-ot+Cc;break;case"bottom":Ke=-we+Cc;break;case"top":Ke=we-Cc}switch(re){case"top-right":case"bottom-right":je=-ot;break;case"top-left":case"bottom-left":je=ot;break;case"left":je=we;break;case"right":je=-we}return[je,Ke]}(P,G[0])}function ff(P){switch(P){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var pf=255,ih=pf*cu;function pm(P,G,re,we,je,Ke,ot,_t,Rt,Kt,nn,sn,yn,fn,On){var jn=function(Fr,Gr,qr,ri,ei,vi,Ei,aa){for(var Ni=ri.layout.get("text-rotate").evaluate(vi,{})*Math.PI/180,Qi=[],qi=0,zi=Gr.positionedLines;qiih&&I(P.layerIds[0]+': Value for "text-size" is >= '+pf+'. Reduce your "text-size".'):sr.kind==="composite"&&((ir=[cu*fn.compositeTextSizes[0].evaluate(ot,{},On),cu*fn.compositeTextSizes[1].evaluate(ot,{},On)])[0]>ih||ir[1]>ih)&&I(P.layerIds[0]+': Value for "text-size" is >= '+pf+'. Reduce your "text-size".'),P.addSymbols(P.text,jn,ir,_t,Ke,ot,Kt,G,Rt.lineStartIndex,Rt.lineLength,yn,On);for(var kr=0,_r=nn;kr<_r.length;kr+=1)sn[_r[kr]]=P.text.placedSymbolArray.length-1;return 4*jn.length}function dm(P){for(var G in P)return P[G];return null}function gm(P,G,re,we){var je=P.compareText;if(G in je){for(var Ke=je[G],ot=Ke.length-1;ot>=0;ot--)if(we.dist(Ke[ot])0)&&(Ke.value.kind!=="constant"||Ke.value.value.length>0),Kt=_t.value.kind!=="constant"||!!_t.value.value||Object.keys(_t.parameters).length>0,nn=je.get("symbol-sort-key");if(this.features=[],Rt||Kt){for(var sn=G.iconDependencies,yn=G.glyphDependencies,fn=G.availableImages,On=new za(this.zoom),jn=0,sr=P;jn=0;for(var va=0,yo=ei.sections;va=0;_t--)Ke[_t]={x:G[_t].x,y:G[_t].y,tileUnitDistanceFromAnchor:je},_t>0&&(je+=G[_t-1].dist(G[_t]));for(var Rt=0;Rt0},co.prototype.hasIconData=function(){return this.icon.segments.get().length>0},co.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},co.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},co.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},co.prototype.addIndicesForPlacedSymbol=function(P,G){for(var re=P.placedSymbolArray.get(G),we=re.vertexStartIndex+4*re.numGlyphs,je=re.vertexStartIndex;je1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(P),this.sortedAngle=P,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var re=0,we=this.symbolInstanceIndexes;re=0&&Rt.indexOf(ot)===_t&&G.addIndicesForPlacedSymbol(G.text,ot)}),Ke.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ke.verticalPlacedTextSymbolIndex),Ke.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ke.placedIconSymbolIndex),Ke.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ke.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Mi("SymbolBucket",co,{omit:["layers","collisionBoxArray","features","compareText"]}),co.MAX_GLYPHS=65535,co.addDynamicAttributes=Rd;var Y0=new ho({"symbol-placement":new di(et.layout_symbol["symbol-placement"]),"symbol-spacing":new di(et.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new di(et.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Fi(et.layout_symbol["symbol-sort-key"]),"symbol-z-order":new di(et.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new di(et.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new di(et.layout_symbol["icon-ignore-placement"]),"icon-optional":new di(et.layout_symbol["icon-optional"]),"icon-rotation-alignment":new di(et.layout_symbol["icon-rotation-alignment"]),"icon-size":new Fi(et.layout_symbol["icon-size"]),"icon-text-fit":new di(et.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new di(et.layout_symbol["icon-text-fit-padding"]),"icon-image":new Fi(et.layout_symbol["icon-image"]),"icon-rotate":new Fi(et.layout_symbol["icon-rotate"]),"icon-padding":new di(et.layout_symbol["icon-padding"]),"icon-keep-upright":new di(et.layout_symbol["icon-keep-upright"]),"icon-offset":new Fi(et.layout_symbol["icon-offset"]),"icon-anchor":new Fi(et.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new di(et.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new di(et.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new di(et.layout_symbol["text-rotation-alignment"]),"text-field":new Fi(et.layout_symbol["text-field"]),"text-font":new Fi(et.layout_symbol["text-font"]),"text-size":new Fi(et.layout_symbol["text-size"]),"text-max-width":new Fi(et.layout_symbol["text-max-width"]),"text-line-height":new di(et.layout_symbol["text-line-height"]),"text-letter-spacing":new Fi(et.layout_symbol["text-letter-spacing"]),"text-justify":new Fi(et.layout_symbol["text-justify"]),"text-radial-offset":new Fi(et.layout_symbol["text-radial-offset"]),"text-variable-anchor":new di(et.layout_symbol["text-variable-anchor"]),"text-anchor":new Fi(et.layout_symbol["text-anchor"]),"text-max-angle":new di(et.layout_symbol["text-max-angle"]),"text-writing-mode":new di(et.layout_symbol["text-writing-mode"]),"text-rotate":new Fi(et.layout_symbol["text-rotate"]),"text-padding":new di(et.layout_symbol["text-padding"]),"text-keep-upright":new di(et.layout_symbol["text-keep-upright"]),"text-transform":new Fi(et.layout_symbol["text-transform"]),"text-offset":new Fi(et.layout_symbol["text-offset"]),"text-allow-overlap":new di(et.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new di(et.layout_symbol["text-ignore-placement"]),"text-optional":new di(et.layout_symbol["text-optional"])}),Fd={paint:new ho({"icon-opacity":new Fi(et.paint_symbol["icon-opacity"]),"icon-color":new Fi(et.paint_symbol["icon-color"]),"icon-halo-color":new Fi(et.paint_symbol["icon-halo-color"]),"icon-halo-width":new Fi(et.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Fi(et.paint_symbol["icon-halo-blur"]),"icon-translate":new di(et.paint_symbol["icon-translate"]),"icon-translate-anchor":new di(et.paint_symbol["icon-translate-anchor"]),"text-opacity":new Fi(et.paint_symbol["text-opacity"]),"text-color":new Fi(et.paint_symbol["text-color"],{runtimeType:Pn,getOverride:function(P){return P.textColor},hasOverride:function(P){return!!P.textColor}}),"text-halo-color":new Fi(et.paint_symbol["text-halo-color"]),"text-halo-width":new Fi(et.paint_symbol["text-halo-width"]),"text-halo-blur":new Fi(et.paint_symbol["text-halo-blur"]),"text-translate":new di(et.paint_symbol["text-translate"]),"text-translate-anchor":new di(et.paint_symbol["text-translate-anchor"])}),layout:Y0},yh=function(P){this.type=P.property.overrides?P.property.overrides.runtimeType:Wt,this.defaultValue=P};yh.prototype.evaluate=function(P){if(P.formattedSection){var G=this.defaultValue.property.overrides;if(G&&G.hasOverride(P.formattedSection))return G.getOverride(P.formattedSection)}return P.feature&&P.featureState?this.defaultValue.evaluate(P.feature,P.featureState):this.defaultValue.property.specification.default},yh.prototype.eachChild=function(P){this.defaultValue.isConstant()||P(this.defaultValue.value._styleExpression.expression)},yh.prototype.outputDefined=function(){return!1},yh.prototype.serialize=function(){return null},Mi("FormatSectionOverride",yh,{omit:["defaultValue"]});var xh=function(P){function G(re){P.call(this,re,Fd)}return P&&(G.__proto__=P),G.prototype=Object.create(P&&P.prototype),G.prototype.constructor=G,G.prototype.recalculate=function(re,we){if(P.prototype.recalculate.call(this,re,we),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var je=this.layout.get("text-writing-mode");if(je){for(var Ke=[],ot=0,_t=je;ot<_t.length;ot+=1){var Rt=_t[ot];Ke.indexOf(Rt)<0&&Ke.push(Rt)}this.layout._values["text-writing-mode"]=Ke}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},G.prototype.getValueAndResolveTokens=function(re,we,je,Ke){var ot=this.layout.get(re).evaluate(we,{},je,Ke),_t=this._unevaluatedLayout._values[re];return _t.isDataDriven()||Hl(_t.value)||!ot?ot:function(Rt,Kt){return Kt.replace(/{([^{}]+)}/g,function(nn,sn){return sn in Rt?String(Rt[sn]):""})}(we.properties,ot)},G.prototype.createBucket=function(re){return new co(re)},G.prototype.queryRadius=function(){return 0},G.prototype.queryIntersectsFeature=function(){return!1},G.prototype._setPaintOverrides=function(){for(var re=0,we=Fd.paint.overridableProperties;re",targetMapId:we,sourceMapId:Ke.mapId})}}},ah.prototype.receive=function(P){var G=P.data,re=G.id;if(re&&(!G.targetMapId||this.mapId===G.targetMapId))if(G.type===""){delete this.tasks[re];var we=this.cancelCallbacks[re];delete this.cancelCallbacks[re],we&&we()}else V()||G.mustQueue?(this.tasks[re]=G,this.taskQueue.push(re),this.invoker.trigger()):this.processTask(re,G)},ah.prototype.process=function(){if(this.taskQueue.length){var P=this.taskQueue.shift(),G=this.tasks[P];delete this.tasks[P],this.taskQueue.length&&this.invoker.trigger(),G&&this.processTask(P,G)}},ah.prototype.processTask=function(P,G){var re=this;if(G.type===""){var we=this.callbacks[P];delete this.callbacks[P],we&&(G.error?we(Sl(G.error)):we(null,Sl(G.data)))}else{var je=!1,Ke=ee(this.globalScope)?void 0:[],ot=G.hasCallback?function(nn,sn){je=!0,delete re.cancelCallbacks[P],re.target.postMessage({id:P,type:"",sourceMapId:re.mapId,error:nn?il(nn):null,data:il(sn,Ke)},Ke)}:function(nn){je=!0},_t=null,Rt=Sl(G.data);if(this.parent[G.type])_t=this.parent[G.type](G.sourceMapId,Rt,ot);else if(this.parent.getWorkerSource){var Kt=G.type.split(".");_t=this.parent.getWorkerSource(G.sourceMapId,Kt[0],Rt.source)[Kt[1]](Rt,ot)}else ot(new Error("Could not find function "+G.type));!je&&_t&&_t.cancel&&(this.cancelCallbacks[P]=_t.cancel)}},ah.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var ds=function(P,G){P&&(G?this.setSouthWest(P).setNorthEast(G):P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1]))};ds.prototype.setNorthEast=function(P){return this._ne=P instanceof zo?new zo(P.lng,P.lat):zo.convert(P),this},ds.prototype.setSouthWest=function(P){return this._sw=P instanceof zo?new zo(P.lng,P.lat):zo.convert(P),this},ds.prototype.extend=function(P){var G,re,we=this._sw,je=this._ne;if(P instanceof zo)G=P,re=P;else{if(!(P instanceof ds)){if(Array.isArray(P)){if(P.length===4||P.every(Array.isArray)){var Ke=P;return this.extend(ds.convert(Ke))}var ot=P;return this.extend(zo.convert(ot))}return this}if(G=P._sw,re=P._ne,!G||!re)return this}return we||je?(we.lng=Math.min(G.lng,we.lng),we.lat=Math.min(G.lat,we.lat),je.lng=Math.max(re.lng,je.lng),je.lat=Math.max(re.lat,je.lat)):(this._sw=new zo(G.lng,G.lat),this._ne=new zo(re.lng,re.lat)),this},ds.prototype.getCenter=function(){return new zo((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},ds.prototype.getSouthWest=function(){return this._sw},ds.prototype.getNorthEast=function(){return this._ne},ds.prototype.getNorthWest=function(){return new zo(this.getWest(),this.getNorth())},ds.prototype.getSouthEast=function(){return new zo(this.getEast(),this.getSouth())},ds.prototype.getWest=function(){return this._sw.lng},ds.prototype.getSouth=function(){return this._sw.lat},ds.prototype.getEast=function(){return this._ne.lng},ds.prototype.getNorth=function(){return this._ne.lat},ds.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},ds.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},ds.prototype.isEmpty=function(){return!(this._sw&&this._ne)},ds.prototype.contains=function(P){var G=zo.convert(P),re=G.lng,we=G.lat,je=this._sw.lat<=we&&we<=this._ne.lat,Ke=this._sw.lng<=re&&re<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ke=this._sw.lng>=re&&re>=this._ne.lng),je&&Ke},ds.convert=function(P){return!P||P instanceof ds?P:new ds(P)};var qd=63710088e-1,zo=function(P,G){if(isNaN(P)||isNaN(G))throw new Error("Invalid LngLat object: ("+P+", "+G+")");if(this.lng=+P,this.lat=+G,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};zo.prototype.wrap=function(){return new zo(x(this.lng,-180,180),this.lat)},zo.prototype.toArray=function(){return[this.lng,this.lat]},zo.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},zo.prototype.distanceTo=function(P){var G=Math.PI/180,re=this.lat*G,we=P.lat*G,je=Math.sin(re)*Math.sin(we)+Math.cos(re)*Math.cos(we)*Math.cos((P.lng-this.lng)*G);return qd*Math.acos(Math.min(je,1))},zo.prototype.toBounds=function(P){P===void 0&&(P=0);var G=360*P/40075017,re=G/Math.cos(Math.PI/180*this.lat);return new ds(new zo(this.lng-re,this.lat-G),new zo(this.lng+re,this.lat+G))},zo.convert=function(P){if(P instanceof zo)return P;if(Array.isArray(P)&&(P.length===2||P.length===3))return new zo(Number(P[0]),Number(P[1]));if(!Array.isArray(P)&&typeof P=="object"&&P!==null)return new zo(Number("lng"in P?P.lng:P.lon),Number(P.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var J0=2*Math.PI*qd;function Hd(P){return J0*Math.cos(P*Math.PI/180)}function Q0(P){return(180+P)/360}function eg(P){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+P*Math.PI/360)))/360}function ym(P,G){return P/Hd(G)}function tg(P){var G=180-360*P;return 360/Math.PI*Math.atan(Math.exp(G*Math.PI/180))-90}var jh=function(P,G,re){re===void 0&&(re=0),this.x=+P,this.y=+G,this.z=+re};jh.fromLngLat=function(P,G){G===void 0&&(G=0);var re=zo.convert(P);return new jh(Q0(re.lng),eg(re.lat),ym(G,re.lat))},jh.prototype.toLngLat=function(){return new zo(360*this.x-180,tg(this.y))},jh.prototype.toAltitude=function(){return P=this.z,G=this.y,P*Hd(tg(G));var P,G},jh.prototype.meterInMercatorCoordinateUnits=function(){return 1/J0*(P=tg(this.y),1/Math.cos(P*Math.PI/180));var P};var zu=function(P,G,re){this.z=P,this.x=G,this.y=re,this.key=cp(0,P,P,G,re)};zu.prototype.equals=function(P){return this.z===P.z&&this.x===P.x&&this.y===P.y},zu.prototype.url=function(P,G){var re,we,je,Ke,ot,_t=(re=this.x,we=this.y,je=this.z,Ke=K0(256*re,256*(we=Math.pow(2,je)-we-1),je),ot=K0(256*(re+1),256*(we+1),je),Ke[0]+","+Ke[1]+","+ot[0]+","+ot[1]),Rt=function(Kt,nn,sn){for(var yn,fn="",On=Kt;On>0;On--)fn+=(nn&(yn=1<this.canonical.z?new Us(P,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Us(P,this.wrap,P,this.canonical.x>>G,this.canonical.y>>G)},Us.prototype.calculateScaledKey=function(P,G){var re=this.canonical.z-P;return P>this.canonical.z?cp(this.wrap*+G,P,this.canonical.z,this.canonical.x,this.canonical.y):cp(this.wrap*+G,P,P,this.canonical.x>>re,this.canonical.y>>re)},Us.prototype.isChildOf=function(P){if(P.wrap!==this.wrap)return!1;var G=this.canonical.z-P.canonical.z;return P.overscaledZ===0||P.overscaledZ>G&&P.canonical.y===this.canonical.y>>G},Us.prototype.children=function(P){if(this.overscaledZ>=P)return[new Us(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var G=this.canonical.z+1,re=2*this.canonical.x,we=2*this.canonical.y;return[new Us(G,this.wrap,G,re,we),new Us(G,this.wrap,G,re+1,we),new Us(G,this.wrap,G,re,we+1),new Us(G,this.wrap,G,re+1,we+1)]},Us.prototype.isLessThan=function(P){return this.wrapP.wrap)&&(this.overscaledZP.overscaledZ)&&(this.canonical.xP.canonical.x)&&this.canonical.y=this.dim+1||G<-1||G>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(G+1)*this.stride+(P+1)},Uc.prototype._unpackMapbox=function(P,G,re){return(256*P*256+256*G+re)/10-1e4},Uc.prototype._unpackTerrarium=function(P,G,re){return 256*P+G+re/256-32768},Uc.prototype.getPixels=function(){return new Gu({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Uc.prototype.backfillBorder=function(P,G,re){if(this.dim!==P.dim)throw new Error("dem dimension mismatch");var we=G*this.dim,je=G*this.dim+this.dim,Ke=re*this.dim,ot=re*this.dim+this.dim;switch(G){case-1:we=je-1;break;case 1:je=we+1}switch(re){case-1:Ke=ot-1;break;case 1:ot=Ke+1}for(var _t=-G*this.dim,Rt=-re*this.dim,Kt=Ke;Kt=0&&nn[3]>=0&&_t.insert(ot,nn[0],nn[1],nn[2],nn[3])}},oh.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ts.VectorTile(new Rp(this.rawTileData)).layers,this.sourceLayerCoder=new hp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},oh.prototype.query=function(P,G,re,we){var je=this;this.loadVTLayers();for(var Ke=P.params||{},ot=Hi/P.tileSize/P.scale,_t=Zs(Ke.filter),Rt=P.queryGeometry,Kt=P.queryPadding*ot,nn=xc(Rt),sn=this.grid.query(nn.minX-Kt,nn.minY-Kt,nn.maxX+Kt,nn.maxY+Kt),yn=xc(P.cameraQueryGeometry),fn=0,On=this.grid3D.query(yn.minX-Kt,yn.minY-Kt,yn.maxX+Kt,yn.maxY+Kt,function(Fr,Gr,qr,ri){return function(ei,vi,Ei,aa,Ni){for(var Qi=0,qi=ei;Qi=zi.x&&Ni>=zi.y)return!0}var Ea=[new r(vi,Ei),new r(vi,Ni),new r(aa,Ni),new r(aa,Ei)];if(ei.length>2){for(var va=0,yo=Ea;va=0)return!0;return!1}(Ke,sn)){var yn=this.sourceLayerCoder.decode(re),fn=this.vtLayers[yn].feature(we);if(je.needGeometry){var On=ao(fn,!0);if(!je.filter(new za(this.tileID.overscaledZ),On,this.tileID.canonical))return}else if(!je.filter(new za(this.tileID.overscaledZ),fn))return;for(var jn=this.getId(fn,yn),sr=0;srwe)je=!1;else if(G)if(this.expirationTimeBe&&(P.getActor().send("enforceCacheSizeLimit",De),Vt=0)},e.clamp=h,e.clearTileCache=function(P){var G=l.caches.delete(_e);P&&G.catch(P).then(function(){return P()})},e.clipLine=jf,e.clone=function(P){var G=new ps(16);return G[0]=P[0],G[1]=P[1],G[2]=P[2],G[3]=P[3],G[4]=P[4],G[5]=P[5],G[6]=P[6],G[7]=P[7],G[8]=P[8],G[9]=P[9],G[10]=P[10],G[11]=P[11],G[12]=P[12],G[13]=P[13],G[14]=P[14],G[15]=P[15],G},e.clone$1=f,e.clone$2=function(P){var G=new ps(3);return G[0]=P[0],G[1]=P[1],G[2]=P[2],G},e.collisionCircleLayout=Kg,e.config=ie,e.create=function(){var P=new ps(16);return ps!=Float32Array&&(P[1]=0,P[2]=0,P[3]=0,P[4]=0,P[6]=0,P[7]=0,P[8]=0,P[9]=0,P[11]=0,P[12]=0,P[13]=0,P[14]=0),P[0]=1,P[5]=1,P[10]=1,P[15]=1,P},e.create$1=function(){var P=new ps(9);return ps!=Float32Array&&(P[1]=0,P[2]=0,P[3]=0,P[5]=0,P[6]=0,P[7]=0),P[0]=1,P[4]=1,P[8]=1,P},e.create$2=function(){var P=new ps(4);return ps!=Float32Array&&(P[1]=0,P[2]=0),P[0]=1,P[3]=1,P},e.createCommonjsModule=w,e.createExpression=Gs,e.createLayout=xa,e.createStyleLayer=function(P){return P.type==="custom"?new Dv(P):new Bd[P.type](P)},e.cross=function(P,G,re){var we=G[0],je=G[1],Ke=G[2],ot=re[0],_t=re[1],Rt=re[2];return P[0]=je*Rt-Ke*_t,P[1]=Ke*ot-we*Rt,P[2]=we*_t-je*ot,P},e.deepEqual=function P(G,re){if(Array.isArray(G)){if(!Array.isArray(re)||G.length!==re.length)return!1;for(var we=0;we0&&(Ke=1/Math.sqrt(Ke)),P[0]=G[0]*Ke,P[1]=G[1]*Ke,P[2]=G[2]*Ke,P},e.number=Wi,e.offscreenCanvasSupported=Ht,e.ortho=function(P,G,re,we,je,Ke,ot){var _t=1/(G-re),Rt=1/(we-je),Kt=1/(Ke-ot);return P[0]=-2*_t,P[1]=0,P[2]=0,P[3]=0,P[4]=0,P[5]=-2*Rt,P[6]=0,P[7]=0,P[8]=0,P[9]=0,P[10]=2*Kt,P[11]=0,P[12]=(G+re)*_t,P[13]=(je+we)*Rt,P[14]=(ot+Ke)*Kt,P[15]=1,P},e.parseGlyphPBF=function(P){return new Rp(P).readFields(ty,[])},e.pbf=Rp,e.performSymbolLayout=function(P,G,re,we,je,Ke,ot){P.createArrays();var _t=512*P.overscaling;P.tilePixelRatio=Hi/_t,P.compareText={},P.iconsNeedLinear=!1;var Rt=P.layers[0].layout,Kt=P.layers[0]._unevaluatedLayout._values,nn={};if(P.textSizeData.kind==="composite"){var sn=P.textSizeData,yn=sn.minZoom,fn=sn.maxZoom;nn.compositeTextSizes=[Kt["text-size"].possiblyEvaluate(new za(yn),ot),Kt["text-size"].possiblyEvaluate(new za(fn),ot)]}if(P.iconSizeData.kind==="composite"){var On=P.iconSizeData,jn=On.minZoom,sr=On.maxZoom;nn.compositeIconSizes=[Kt["icon-size"].possiblyEvaluate(new za(jn),ot),Kt["icon-size"].possiblyEvaluate(new za(sr),ot)]}nn.layoutTextSize=Kt["text-size"].possiblyEvaluate(new za(P.zoom+1),ot),nn.layoutIconSize=Kt["icon-size"].possiblyEvaluate(new za(P.zoom+1),ot),nn.textMaxSize=Kt["text-size"].possiblyEvaluate(new za(18));for(var ir=Rt.get("text-line-height")*cl,kr=Rt.get("text-rotation-alignment")==="map"&&Rt.get("symbol-placement")!=="point",_r=Rt.get("text-keep-upright"),Fr=Rt.get("text-size"),Gr=function(){var ei=ri[qr],vi=Rt.get("text-font").evaluate(ei,{},ot).join(","),Ei=Fr.evaluate(ei,{},ot),aa=nn.layoutTextSize.evaluate(ei,{},ot),Ni=nn.layoutIconSize.evaluate(ei,{},ot),Qi={horizontal:{},vertical:void 0},qi=ei.text,zi=[0,0];if(qi){var Ea=qi.toString(),va=Rt.get("text-letter-spacing").evaluate(ei,{},ot)*cl,yo=function(ze){for(var Ze=0,Je=ze;Ze=Hi||dl.y<0||dl.y>=Hi||function(no,Wo,Ic,Vc,Gd,ig,Wp,qc,dp,Pc,Zp,$p,ag,xm,Yp,_m,bm,wm,Tm,Wd,Ls,vf,og,_h,Rv){var Zd,el,Kl,Hc,Zo,bc=no.addToLineVertexArray(Wo,Ic),bh=0,sg=0,ny=0,ry=0,lg=-1,Fv=-1,qh={},iy=dr(""),Bv=0,Nv=0;if(qc._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Bv=(Zd=qc.layout.get("text-offset").evaluate(Ls,{},_h).map(function(hg){return hg*cl}))[0],Nv=Zd[1]):(Bv=qc.layout.get("text-radial-offset").evaluate(Ls,{},_h)*cl,Nv=Vf),no.allowVerticalPlacement&&Vc.vertical){var ay=qc.layout.get("text-rotate").evaluate(Ls,{},_h)+90,oy=Vc.vertical;Hc=new Dd(dp,Wo,Pc,Zp,$p,oy,ag,xm,Yp,ay),Wp&&(Zo=new Dd(dp,Wo,Pc,Zp,$p,Wp,bm,wm,Yp,ay))}if(Gd){var jv=qc.layout.get("icon-rotate").evaluate(Ls,{}),sy=qc.layout.get("icon-text-fit")!=="none",ly=W0(Gd,jv,og,sy),ug=Wp?W0(Wp,jv,og,sy):void 0;Kl=new Dd(dp,Wo,Pc,Zp,$p,Gd,bm,wm,!1,jv),bh=4*ly.length;var km=no.iconSizeData,cg=null;km.kind==="source"?(cg=[cu*qc.layout.get("icon-size").evaluate(Ls,{})])[0]>ih&&I(no.layerIds[0]+': Value for "icon-size" is >= '+pf+'. Reduce your "icon-size".'):km.kind==="composite"&&((cg=[cu*vf.compositeIconSizes[0].evaluate(Ls,{},_h),cu*vf.compositeIconSizes[1].evaluate(Ls,{},_h)])[0]>ih||cg[1]>ih)&&I(no.layerIds[0]+': Value for "icon-size" is >= '+pf+'. Reduce your "icon-size".'),no.addSymbols(no.icon,ly,cg,Wd,Tm,Ls,!1,Wo,bc.lineStartIndex,bc.lineLength,-1,_h),lg=no.icon.placedSymbolArray.length-1,ug&&(sg=4*ug.length,no.addSymbols(no.icon,ug,cg,Wd,Tm,Ls,Lu.vertical,Wo,bc.lineStartIndex,bc.lineLength,-1,_h),Fv=no.icon.placedSymbolArray.length-1)}for(var uy in Vc.horizontal){var Am=Vc.horizontal[uy];if(!el){iy=dr(Am.text);var b_=qc.layout.get("text-rotate").evaluate(Ls,{},_h);el=new Dd(dp,Wo,Pc,Zp,$p,Am,ag,xm,Yp,b_)}var cy=Am.positionedLines.length===1;if(ny+=pm(no,Wo,Am,ig,qc,Yp,Ls,_m,bc,Vc.vertical?Lu.horizontal:Lu.horizontalOnly,cy?Object.keys(Vc.horizontal):[uy],qh,lg,vf,_h),cy)break}Vc.vertical&&(ry+=pm(no,Wo,Vc.vertical,ig,qc,Yp,Ls,_m,bc,Lu.vertical,["vertical"],qh,Fv,vf,_h));var w_=el?el.boxStartIndex:no.collisionBoxArray.length,T_=el?el.boxEndIndex:no.collisionBoxArray.length,k_=Hc?Hc.boxStartIndex:no.collisionBoxArray.length,A_=Hc?Hc.boxEndIndex:no.collisionBoxArray.length,S_=Kl?Kl.boxStartIndex:no.collisionBoxArray.length,M_=Kl?Kl.boxEndIndex:no.collisionBoxArray.length,E_=Zo?Zo.boxStartIndex:no.collisionBoxArray.length,C_=Zo?Zo.boxEndIndex:no.collisionBoxArray.length,yf=-1,Sm=function(hg,fy){return hg&&hg.circleDiameter?Math.max(hg.circleDiameter,fy):fy};yf=Sm(el,yf),yf=Sm(Hc,yf),yf=Sm(Kl,yf);var hy=(yf=Sm(Zo,yf))>-1?1:0;hy&&(yf*=Rv/cl),no.glyphOffsetArray.length>=co.MAX_GLYPHS&&I("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ls.sortKey!==void 0&&no.addToSortKeyRanges(no.symbolInstances.length,Ls.sortKey),no.symbolInstances.emplaceBack(Wo.x,Wo.y,qh.right>=0?qh.right:-1,qh.center>=0?qh.center:-1,qh.left>=0?qh.left:-1,qh.vertical||-1,lg,Fv,iy,w_,T_,k_,A_,S_,M_,E_,C_,Pc,ny,ry,bh,sg,hy,0,ag,Bv,Nv,yf)}(ze,dl,_c,Je,ht,mt,Nn,ze.layers[0],ze.collisionBoxArray,Ze.index,Ze.sourceLayerIndex,ze.index,pi,ui,Si,rn,Vi,Ii,ti,wr,Ze,zt,hn,Sn,Nt)};if(Di==="line")for(var to=0,Is=jf(Ze.geometry,0,0,Hi,Hi);to1){var Ol=Pv(ns,Oi,Je.vertical||or,ht,gr,Ci);Ol&&oo(ns,Ol)}}else if(Ze.type==="Polygon")for(var Uo=0,Qs=D0(Ze.geometry,0);Uo=En.maxzoom||En.visibility!=="none"&&(n(mn,this.zoom,Xe),(Ft[En.id]=En.createBucket({index:jt.bucketLayerIDs.length,layers:mn,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wt,sourceID:this.source})).populate(Zt,St,this.tileID.canonical),jt.bucketLayerIDs.push(mn.map(function(wn){return wn.id})))}}}var Kn=e.mapObject(St.glyphDependencies,function(wn){return Object.keys(wn).map(Number)});Object.keys(Kn).length?ut.send("getGlyphs",{uid:this.uid,stacks:Kn},function(wn,zn){rt||(rt=wn,et=zn,Fn.call(vt))}):et={};var Ln=Object.keys(St.iconDependencies);Ln.length?ut.send("getImages",{icons:Ln,source:this.source,tileID:this.tileID,type:"icons"},function(wn,zn){rt||(rt=wn,Et=zn,Fn.call(vt))}):Et={};var Tn=Object.keys(St.patternDependencies);function Fn(){if(rt)return wt(rt);if(et&&Et&&Bt){var wn=new u(et),zn=new e.ImageAtlas(Et,Bt);for(var Jn in Ft){var $n=Ft[Jn];$n instanceof e.SymbolBucket?(n($n.layers,this.zoom,Xe),e.performSymbolLayout($n,et,wn.positions,Et,zn.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):$n.hasPattern&&($n instanceof e.LineBucket||$n instanceof e.FillBucket||$n instanceof e.FillExtrusionBucket)&&(n($n.layers,this.zoom,Xe),$n.addFeatures(St,this.tileID.canonical,zn.patternPositions))}this.status="done",wt(null,{buckets:e.values(Ft).filter(function(vr){return!vr.isEmpty()}),featureIndex:jt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:wn.image,imageAtlas:zn,glyphMap:this.returnDependencies?et:null,iconMap:this.returnDependencies?Et:null,glyphPositions:this.returnDependencies?wn.positions:null})}}Tn.length?ut.send("getImages",{icons:Tn,source:this.source,tileID:this.tileID,type:"patterns"},function(wn,zn){rt||(rt=wn,Bt=zn,Fn.call(vt))}):Bt={},Fn.call(this)};var o=function(at,lt,Xe,ut){this.actor=at,this.layerIndex=lt,this.availableImages=Xe,this.loadVectorData=ut||l,this.loading={},this.loaded={}};o.prototype.loadTile=function(at,lt){var Xe=this,ut=at.uid;this.loading||(this.loading={});var wt=!!(at&&at.request&&at.request.collectResourceTiming)&&new e.RequestPerformance(at.request),vt=this.loading[ut]=new r(at);vt.abort=this.loadVectorData(at,function(Lt,jt){if(delete Xe.loading[ut],Lt||!jt)return vt.status="done",Xe.loaded[ut]=vt,lt(Lt);var rt=jt.rawData,et={};jt.expires&&(et.expires=jt.expires),jt.cacheControl&&(et.cacheControl=jt.cacheControl);var Et={};if(wt){var Bt=wt.finish();Bt&&(Et.resourceTiming=JSON.parse(JSON.stringify(Bt)))}vt.vectorTile=jt.vectorTile,vt.parse(jt.vectorTile,Xe.layerIndex,Xe.availableImages,Xe.actor,function(Ft,St){if(Ft||!St)return lt(Ft);lt(null,e.extend({rawTileData:rt.slice(0)},St,et,Et))}),Xe.loaded=Xe.loaded||{},Xe.loaded[ut]=vt})},o.prototype.reloadTile=function(at,lt){var Xe=this,ut=this.loaded,wt=at.uid,vt=this;if(ut&&ut[wt]){var Lt=ut[wt];Lt.showCollisionBoxes=at.showCollisionBoxes;var jt=function(rt,et){var Et=Lt.reloadCallback;Et&&(delete Lt.reloadCallback,Lt.parse(Lt.vectorTile,vt.layerIndex,Xe.availableImages,vt.actor,Et)),lt(rt,et)};Lt.status==="parsing"?Lt.reloadCallback=jt:Lt.status==="done"&&(Lt.vectorTile?Lt.parse(Lt.vectorTile,this.layerIndex,this.availableImages,this.actor,jt):jt())}},o.prototype.abortTile=function(at,lt){var Xe=this.loading,ut=at.uid;Xe&&Xe[ut]&&Xe[ut].abort&&(Xe[ut].abort(),delete Xe[ut]),lt()},o.prototype.removeTile=function(at,lt){var Xe=this.loaded,ut=at.uid;Xe&&Xe[ut]&&delete Xe[ut],lt()};var s=e.window.ImageBitmap,c=function(){this.loaded={}};c.prototype.loadTile=function(at,lt){var Xe=at.uid,ut=at.encoding,wt=at.rawImageData,vt=s&&wt instanceof s?this.getImageData(wt):wt,Lt=new e.DEMData(Xe,vt,ut);this.loaded=this.loaded||{},this.loaded[Xe]=Lt,lt(null,Lt)},c.prototype.getImageData=function(at){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(at.width,at.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=at.width,this.offscreenCanvas.height=at.height,this.offscreenCanvasContext.drawImage(at,0,0,at.width,at.height);var lt=this.offscreenCanvasContext.getImageData(-1,-1,at.width+2,at.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:lt.width,height:lt.height},lt.data)},c.prototype.removeTile=function(at){var lt=this.loaded,Xe=at.uid;lt&<[Xe]&&delete lt[Xe]};var h=function at(lt,Xe){var ut,wt=lt&<.type;if(wt==="FeatureCollection")for(ut=0;ut=0!=!!lt&&at.reverse()}var g=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,k=function(at){this._feature=at,this.extent=e.EXTENT,this.type=at.type,this.properties=at.tags,"id"in at&&!isNaN(at.id)&&(this.id=parseInt(at.id,10))};k.prototype.loadGeometry=function(){if(this._feature.type===1){for(var at=[],lt=0,Xe=this._feature.geometry;lt>31}function H(at,lt){for(var Xe=at.loadGeometry(),ut=at.type,wt=0,vt=0,Lt=Xe.length,jt=0;jt>1;Z(at,lt,Lt,ut,wt,vt%2),Q(at,lt,Xe,ut,Lt-1,vt+1),Q(at,lt,Xe,Lt+1,wt,vt+1)}}function Z(at,lt,Xe,ut,wt,vt){for(;wt>ut;){if(wt-ut>600){var Lt=wt-ut+1,jt=Xe-ut+1,rt=Math.log(Lt),et=.5*Math.exp(2*rt/3),Et=.5*Math.sqrt(rt*et*(Lt-et)/Lt)*(jt-Lt/2<0?-1:1);Z(at,lt,Xe,Math.max(ut,Math.floor(Xe-jt*et/Lt+Et)),Math.min(wt,Math.floor(Xe+(Lt-jt)*et/Lt+Et)),vt)}var Bt=lt[2*Xe+vt],Ft=ut,St=wt;for(K(at,lt,ut,Xe),lt[2*wt+vt]>Bt&&K(at,lt,ut,wt);FtBt;)St--}lt[2*ut+vt]===Bt?K(at,lt,ut,St):K(at,lt,++St,wt),St<=Xe&&(ut=St+1),Xe<=St&&(wt=St-1)}}function K(at,lt,Xe,ut){ae(at,Xe,ut),ae(lt,2*Xe,2*ut),ae(lt,2*Xe+1,2*ut+1)}function ae(at,lt,Xe){var ut=at[lt];at[lt]=at[Xe],at[Xe]=ut}function se(at,lt,Xe,ut){var wt=at-Xe,vt=lt-ut;return wt*wt+vt*vt}M.fromVectorTileJs=f,M.fromGeojsonVt=E,M.GeoJSONWrapper=I;var he=function(at){return at[0]},fe=function(at){return at[1]},ie=function(at,lt,Xe,ut,wt){lt===void 0&&(lt=he),Xe===void 0&&(Xe=fe),ut===void 0&&(ut=64),wt===void 0&&(wt=Float64Array),this.nodeSize=ut,this.points=at;for(var vt=at.length<65536?Uint16Array:Uint32Array,Lt=this.ids=new vt(at.length),jt=this.coords=new wt(2*at.length),rt=0;rt=Lt&&Bt<=rt&&Ft>=jt&&Ft<=et&&Jt.push(wt[Zt]);else{var on=Math.floor((Wt+en)/2);Bt=vt[2*on],Ft=vt[2*on+1],Bt>=Lt&&Bt<=rt&&Ft>=jt&&Ft<=et&&Jt.push(wt[on]);var un=(qt+1)%2;(qt===0?Lt<=Bt:jt<=Ft)&&(St.push(Wt),St.push(on-1),St.push(un)),(qt===0?rt>=Bt:et>=Ft)&&(St.push(on+1),St.push(en),St.push(un))}}return Jt}(this.ids,this.coords,at,lt,Xe,ut,this.nodeSize)},ie.prototype.within=function(at,lt,Xe){return function(ut,wt,vt,Lt,jt,rt){for(var et=[0,ut.length-1,0],Et=[],Bt=jt*jt;et.length;){var Ft=et.pop(),St=et.pop(),Jt=et.pop();if(St-Jt<=rt)for(var qt=Jt;qt<=St;qt++)se(wt[2*qt],wt[2*qt+1],vt,Lt)<=Bt&&Et.push(ut[qt]);else{var en=Math.floor((Jt+St)/2),Wt=wt[2*en],Zt=wt[2*en+1];se(Wt,Zt,vt,Lt)<=Bt&&Et.push(ut[en]);var on=(Ft+1)%2;(Ft===0?vt-jt<=Wt:Lt-jt<=Zt)&&(et.push(Jt),et.push(en-1),et.push(on)),(Ft===0?vt+jt>=Wt:Lt+jt>=Zt)&&(et.push(en+1),et.push(St),et.push(on))}}return Et}(this.ids,this.coords,at,lt,Xe,this.nodeSize)};var oe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(at){return at}},le=function(at){this.options=Ce(Object.create(oe),at),this.trees=new Array(this.options.maxZoom+1)};function ge(at,lt,Xe,ut,wt){return{x:at,y:lt,zoom:1/0,id:Xe,parentId:-1,numPoints:ut,properties:wt}}function ye(at,lt){var Xe=at.geometry.coordinates,ut=Xe[0],wt=Xe[1];return{x:Se(ut),y:Ee(wt),zoom:1/0,index:lt,parentId:-1}}function me(at){return{type:"Feature",id:at.id,properties:be(at),geometry:{type:"Point",coordinates:[(ut=at.x,360*(ut-.5)),(lt=at.y,Xe=(180-360*lt)*Math.PI/180,360*Math.atan(Math.exp(Xe))/Math.PI-90)]}};var lt,Xe,ut}function be(at){var lt=at.numPoints,Xe=lt>=1e4?Math.round(lt/1e3)+"k":lt>=1e3?Math.round(lt/100)/10+"k":lt;return Ce(Ce({},at.properties),{cluster:!0,cluster_id:at.id,point_count:lt,point_count_abbreviated:Xe})}function Se(at){return at/360+.5}function Ee(at){var lt=Math.sin(at*Math.PI/180),Xe=.5-.25*Math.log((1+lt)/(1-lt))/Math.PI;return Xe<0?0:Xe>1?1:Xe}function Ce(at,lt){for(var Xe in lt)at[Xe]=lt[Xe];return at}function Le(at){return at.x}function Oe(at){return at.y}function We(at,lt,Xe,ut){for(var wt,vt=ut,Lt=Xe-lt>>1,jt=Xe-lt,rt=at[lt],et=at[lt+1],Et=at[Xe],Bt=at[Xe+1],Ft=lt+3;Ftvt)wt=Ft,vt=St;else if(St===vt){var Jt=Math.abs(Ft-Lt);Jtut&&(wt-lt>3&&We(at,lt,wt,ut),at[wt+2]=vt,Xe-wt>3&&We(at,wt,Xe,ut))}function Ie(at,lt,Xe,ut,wt,vt){var Lt=wt-Xe,jt=vt-ut;if(Lt!==0||jt!==0){var rt=((at-Xe)*Lt+(lt-ut)*jt)/(Lt*Lt+jt*jt);rt>1?(Xe=wt,ut=vt):rt>0&&(Xe+=Lt*rt,ut+=jt*rt)}return(Lt=at-Xe)*Lt+(jt=lt-ut)*jt}function Ve(at,lt,Xe,ut){var wt={id:at===void 0?null:at,type:lt,geometry:Xe,tags:ut,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(vt){var Lt=vt.geometry,jt=vt.type;if(jt==="Point"||jt==="MultiPoint"||jt==="LineString")Pe(vt,Lt);else if(jt==="Polygon"||jt==="MultiLineString")for(var rt=0;rt0&&(Lt+=ut?(wt*et-rt*vt)/2:Math.sqrt(Math.pow(rt-wt,2)+Math.pow(et-vt,2))),wt=rt,vt=et}var Et=lt.length-3;lt[2]=1,We(lt,0,Et,Xe),lt[Et+2]=1,lt.size=Math.abs(Lt),lt.start=0,lt.end=lt.size}function He(at,lt,Xe,ut){for(var wt=0;wt1?1:Xe}function $e(at,lt,Xe,ut,wt,vt,Lt,jt){if(ut/=lt,vt>=(Xe/=lt)&&Lt=ut)return null;for(var rt=[],et=0;et=Xe&&Jt=ut)){var qt=[];if(Ft==="Point"||Ft==="MultiPoint")Ye(Bt,qt,Xe,ut,wt);else if(Ft==="LineString")_e(Bt,qt,Xe,ut,wt,!1,jt.lineMetrics);else if(Ft==="MultiLineString")Be(Bt,qt,Xe,ut,wt,!1);else if(Ft==="Polygon")Be(Bt,qt,Xe,ut,wt,!0);else if(Ft==="MultiPolygon")for(var en=0;en=Xe&&Lt<=ut&&(lt.push(at[vt]),lt.push(at[vt+1]),lt.push(at[vt+2]))}}function _e(at,lt,Xe,ut,wt,vt,Lt){for(var jt,rt,et=De(at),Et=wt===0?tt:nt,Bt=at.start,Ft=0;FtXe&&(rt=Et(et,St,Jt,en,Wt,Xe),Lt&&(et.start=Bt+jt*rt)):Zt>ut?on=Xe&&(rt=Et(et,St,Jt,en,Wt,Xe),un=!0),on>ut&&Zt<=ut&&(rt=Et(et,St,Jt,en,Wt,ut),un=!0),!vt&&un&&(Lt&&(et.end=Bt+jt*rt),lt.push(et),et=De(at)),Lt&&(Bt+=jt)}var Pn=at.length-3;St=at[Pn],Jt=at[Pn+1],qt=at[Pn+2],(Zt=wt===0?St:Jt)>=Xe&&Zt<=ut&&Ge(et,St,Jt,qt),Pn=et.length-3,vt&&Pn>=3&&(et[Pn]!==et[0]||et[Pn+1]!==et[1])&&Ge(et,et[0],et[1],et[2]),et.length&<.push(et)}function De(at){var lt=[];return lt.size=at.size,lt.start=at.start,lt.end=at.end,lt}function Be(at,lt,Xe,ut,wt,vt){for(var Lt=0;LtLt.maxX&&(Lt.maxX=Et),Bt>Lt.maxY&&(Lt.maxY=Bt)}return Lt}function Gt(at,lt,Xe,ut){var wt=lt.geometry,vt=lt.type,Lt=[];if(vt==="Point"||vt==="MultiPoint")for(var jt=0;jt0&<.size<(wt?Lt:ut))Xe.numPoints+=lt.length/3;else{for(var jt=[],rt=0;rtLt)&&(Xe.numSimplified++,jt.push(lt[rt]),jt.push(lt[rt+1])),Xe.numPoints++;wt&&function(et,Et){for(var Bt=0,Ft=0,St=et.length,Jt=St-2;Ft0===Et)for(Ft=0,St=et.length;Ft24)throw new Error("maxZoom should be in the 0-24 range");if(lt.promoteId&<.generateId)throw new Error("promoteId and generateId cannot be used together.");var ut=function(wt,vt){var Lt=[];if(wt.type==="FeatureCollection")for(var jt=0;jt=ut;et--){var Et=+Date.now();jt=this._cluster(jt,et),this.trees[et]=new ie(jt,Le,Oe,vt,Float32Array),Xe&&console.log("z%d: %d clusters in %dms",et,jt.length,+Date.now()-Et)}return Xe&&console.timeEnd("total time"),this},le.prototype.getClusters=function(at,lt){var Xe=((at[0]+180)%360+360)%360-180,ut=Math.max(-90,Math.min(90,at[1])),wt=at[2]===180?180:((at[2]+180)%360+360)%360-180,vt=Math.max(-90,Math.min(90,at[3]));if(at[2]-at[0]>=360)Xe=-180,wt=180;else if(Xe>wt){var Lt=this.getClusters([Xe,ut,180,vt],lt),jt=this.getClusters([-180,ut,wt,vt],lt);return Lt.concat(jt)}for(var rt=this.trees[this._limitZoom(lt)],et=[],Et=0,Bt=rt.range(Se(Xe),Ee(vt),Se(wt),Ee(ut));Etlt&&(Jt+=Zt.numPoints||1)}if(Jt>=jt){for(var on=Et.x*St,un=Et.y*St,Pn=Lt&&St>1?this._map(Et,!0):null,Dn=(et<<5)+(lt+1)+this.points.length,In=0,mn=Ft;In1)for(var Tn=0,Fn=Ft;Tn>5},le.prototype._getOriginZoom=function(at){return(at-this.points.length)%32},le.prototype._map=function(at,lt){if(at.numPoints)return lt?Ce({},at.properties):at.properties;var Xe=this.points[at.index].properties,ut=this.options.map(Xe);return lt&&ut===Xe?Ce({},ut):ut},Qe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Qe.prototype.splitTile=function(at,lt,Xe,ut,wt,vt,Lt){for(var jt=[at,lt,Xe,ut],rt=this.options,et=rt.debug;jt.length;){ut=jt.pop(),Xe=jt.pop(),lt=jt.pop(),at=jt.pop();var Et=1<1&&console.time("creation"),Ft=this.tiles[Bt]=Ht(at,lt,Xe,ut,rt),this.tileCoords.push({z:lt,x:Xe,y:ut}),et)){et>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",lt,Xe,ut,Ft.numFeatures,Ft.numPoints,Ft.numSimplified),console.timeEnd("creation"));var St="z"+lt;this.stats[St]=(this.stats[St]||0)+1,this.total++}if(Ft.source=at,wt){if(lt===rt.maxZoom||lt===wt)continue;var Jt=1<1&&console.time("clipping");var qt,en,Wt,Zt,on,un,Pn=.5*rt.buffer/rt.extent,Dn=.5-Pn,In=.5+Pn,mn=1+Pn;qt=en=Wt=Zt=null,on=$e(at,Et,Xe-Pn,Xe+In,0,Ft.minX,Ft.maxX,rt),un=$e(at,Et,Xe+Dn,Xe+mn,0,Ft.minX,Ft.maxX,rt),at=null,on&&(qt=$e(on,Et,ut-Pn,ut+In,1,Ft.minY,Ft.maxY,rt),en=$e(on,Et,ut+Dn,ut+mn,1,Ft.minY,Ft.maxY,rt),on=null),un&&(Wt=$e(un,Et,ut-Pn,ut+In,1,Ft.minY,Ft.maxY,rt),Zt=$e(un,Et,ut+Dn,ut+mn,1,Ft.minY,Ft.maxY,rt),un=null),et>1&&console.timeEnd("clipping"),jt.push(qt||[],lt+1,2*Xe,2*ut),jt.push(en||[],lt+1,2*Xe,2*ut+1),jt.push(Wt||[],lt+1,2*Xe+1,2*ut),jt.push(Zt||[],lt+1,2*Xe+1,2*ut+1)}}},Qe.prototype.getTile=function(at,lt,Xe){var ut=this.options,wt=ut.extent,vt=ut.debug;if(at<0||at>24)return null;var Lt=1<1&&console.log("drilling down to z%d-%d-%d",at,lt,Xe);for(var rt,et=at,Et=lt,Bt=Xe;!rt&&et>0;)et--,Et=Math.floor(Et/2),Bt=Math.floor(Bt/2),rt=this.tiles[pt(et,Et,Bt)];return rt&&rt.source?(vt>1&&console.log("found parent tile z%d-%d-%d",et,Et,Bt),vt>1&&console.time("drilling down"),this.splitTile(rt.source,et,Et,Bt,at,lt,Xe),vt>1&&console.timeEnd("drilling down"),this.tiles[jt]?kt(this.tiles[jt],wt):null):null};var Ot=function(at){function lt(Xe,ut,wt,vt){at.call(this,Xe,ut,wt,yt),vt&&(this.loadGeoJSON=vt)}return at&&(lt.__proto__=at),lt.prototype=Object.create(at&&at.prototype),lt.prototype.constructor=lt,lt.prototype.loadData=function(Xe,ut){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=ut,this._pendingLoadDataParams=Xe,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},lt.prototype._loadData=function(){var Xe=this;if(this._pendingCallback&&this._pendingLoadDataParams){var ut=this._pendingCallback,wt=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var vt=!!(wt&&wt.request&&wt.request.collectResourceTiming)&&new e.RequestPerformance(wt.request);this.loadGeoJSON(wt,function(Lt,jt){if(Lt||!jt)return ut(Lt);if(typeof jt!="object")return ut(new Error("Input data given to '"+wt.source+"' is not a valid GeoJSON object."));h(jt,!0);try{if(wt.filter){var rt=e.createExpression(wt.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(rt.result==="error")throw new Error(rt.value.map(function(Ft){return Ft.key+": "+Ft.message}).join(", "));var et=jt.features.filter(function(Ft){return rt.value.evaluate({zoom:0},Ft)});jt={type:"FeatureCollection",features:et}}Xe._geoJSONIndex=wt.cluster?new le(function(Ft){var St=Ft.superclusterOptions,Jt=Ft.clusterProperties;if(!Jt||!St)return St;for(var qt={},en={},Wt={accumulated:null,zoom:0},Zt={properties:null},on=Object.keys(Jt),un=0,Pn=on;un=0?0:X.button},y.remove=function(X){X.parentNode&&X.parentNode.removeChild(X)};var x=function(X){function R(){X.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 X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.isLoaded=function(){return this.loaded},R.prototype.setLoaded=function(i){if(this.loaded!==i&&(this.loaded=i,i)){for(var a=0,C=this.requestors;a=0?1.2:1))}function v(X,R,i,a,C,F,q){for(var te=0;te65535)ve(new Error("glyphs > 65535 not supported"));else if(Ue.ranges[ct])ve(null,{stack:Ae,id:Re,glyph:it});else{var dt=Ue.requests[ct];dt||(dt=Ue.requests[ct]=[],T.loadGlyphRange(Ae,ct,i.url,i.requestManager,function(bt,Ct){if(Ct){for(var Mt in Ct)i._doesCharSupportLocalGlyph(+Mt)||(Ue.glyphs[+Mt]=Ct[+Mt]);Ue.ranges[ct]=!0}for(var Ut=0,It=dt;Ut1&&(ue=X[++te]);var Ae=Math.abs(ve-ue.left),Re=Math.abs(ve-ue.right),Ue=Math.min(Ae,Re),it=void 0,ct=C/i*(a+1);if(ue.isDash){var dt=a-Math.abs(ct);it=Math.sqrt(Ue*Ue+dt*dt)}else it=a-Math.sqrt(Ue*Ue+ct*ct);this.data[q+ve]=Math.max(0,Math.min(255,it+128))}},I.prototype.addRegularDash=function(X){for(var R=X.length-1;R>=0;--R){var i=X[R],a=X[R+1];i.zeroLength?X.splice(R,1):a&&a.isDash===i.isDash&&(a.left=i.left,X.splice(R,1))}var C=X[0],F=X[X.length-1];C.isDash===F.isDash&&(C.left=F.left-this.width,F.right=C.right+this.width);for(var q=this.width*this.nextRow,te=0,ue=X[te],ve=0;ve1&&(ue=X[++te]);var Ae=Math.abs(ve-ue.left),Re=Math.abs(ve-ue.right),Ue=Math.min(Ae,Re),it=ue.isDash?Ue:-Ue;this.data[q+ve]=Math.max(0,Math.min(255,it+128))}},I.prototype.addDash=function(X,R){var i=R?7:0,a=2*i+1;if(this.nextRow+a>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var C=0,F=0;F=i&&X.x=a&&X.y0&&(ve[new e.OverscaledTileID(i.overscaledZ,q,a.z,F,a.y-1).key]={backfilled:!1},ve[new e.OverscaledTileID(i.overscaledZ,i.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},ve[new e.OverscaledTileID(i.overscaledZ,ue,a.z,te,a.y-1).key]={backfilled:!1}),a.y+10&&(C.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new e.Event("data",C))}})},R.prototype.onAdd=function(i){this.map=i,this.load()},R.prototype.setData=function(i){var a=this;return this._data=i,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(C){if(C)a.fire(new e.ErrorEvent(C));else{var F={dataType:"source",sourceDataType:"content"};a._collectResourceTiming&&a._resourceTiming&&a._resourceTiming.length>0&&(F.resourceTiming=a._resourceTiming,a._resourceTiming=[]),a.fire(new e.Event("data",F))}}),this},R.prototype.getClusterExpansionZoom=function(i,a){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:i,source:this.id},a),this},R.prototype.getClusterChildren=function(i,a){return this.actor.send("geojson.getClusterChildren",{clusterId:i,source:this.id},a),this},R.prototype.getClusterLeaves=function(i,a,C,F){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:i,limit:a,offset:C},F),this},R.prototype._updateWorkerData=function(i){var a=this;this._loaded=!1;var C=e.extend({},this.workerOptions),F=this._data;typeof F=="string"?(C.request=this.map._requestManager.transformRequest(e.browser.resolveURL(F),e.ResourceType.Source),C.request.collectResourceTiming=this._collectResourceTiming):C.data=JSON.stringify(F),this.actor.send(this.type+".loadData",C,function(q,te){a._removed||te&&te.abandoned||(a._loaded=!0,te&&te.resourceTiming&&te.resourceTiming[a.id]&&(a._resourceTiming=te.resourceTiming[a.id].slice(0)),a.actor.send(a.type+".coalesce",{source:C.source},null),i(q))})},R.prototype.loaded=function(){return this._loaded},R.prototype.loadTile=function(i,a){var C=this,F=i.actor?"reloadTile":"loadTile";i.actor=this.actor;var q={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.request=this.actor.send(F,q,function(te,ue){return delete i.request,i.unloadVectorData(),i.aborted?a(null):te?a(te):(i.loadVectorData(ue,C.map.painter,F==="reloadTile"),a(null))})},R.prototype.abortTile=function(i){i.request&&(i.request.cancel(),delete i.request),i.aborted=!0},R.prototype.unloadTile=function(i){i.unloadVectorData(),this.actor.send("removeTile",{uid:i.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),J=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Q=function(X){function R(i,a,C,F){X.call(this),this.id=i,this.dispatcher=C,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(F),this.options=a}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.load=function(i,a){var C=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(F,q){C._loaded=!0,F?C.fire(new e.ErrorEvent(F)):q&&(C.image=q,i&&(C.coordinates=i),a&&a(),C._finishLoading())})},R.prototype.loaded=function(){return this._loaded},R.prototype.updateImage=function(i){var a=this;return this.image&&i.url?(this.options.url=i.url,this.load(i.coordinates,function(){a.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(i){this.map=i,this.load()},R.prototype.setCoordinates=function(i){var a=this;this.coordinates=i;var C=i.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(q){for(var te=1/0,ue=1/0,ve=-1/0,Ae=-1/0,Re=0,Ue=q;Rea.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+a.start(0)+" and "+a.end(0)+"-second mark."))):this.video.currentTime=i}},R.prototype.getVideo=function(){return this.video},R.prototype.onAdd=function(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},R.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var i=this.map.painter.context,a=i.gl;for(var C in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(i,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE)),this.tiles){var F=this.tiles[C];F.state!=="loaded"&&(F.state="loaded",F.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}(Q),K=function(X){function R(i,a,C,F){X.call(this,i,a,C,F),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some(function(q){return!Array.isArray(q)||q.length!==2||q.some(function(te){return typeof te!="number"})})||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+i,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."+i,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.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(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()},R.prototype.onRemove=function(){this.pause()},R.prototype.prepare=function(){var i=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,i=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,i=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var a=this.map.painter.context,C=a.gl;for(var F in this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(i||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(a,this.canvas,C.RGBA,{premultiply:!0}),this.tiles){var q=this.tiles[F];q.state!=="loaded"&&(q.state="loaded",q.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 i=0,a=[this.canvas.width,this.canvas.height];ithis.max){var q=this._getAndRemoveByKey(this.order[0]);q&&this.onRemove(q)}return this},ie.prototype.has=function(X){return X.wrapped().key in this.data},ie.prototype.getAndRemove=function(X){return this.has(X)?this._getAndRemoveByKey(X.wrapped().key):null},ie.prototype._getAndRemoveByKey=function(X){var R=this.data[X].shift();return R.timeout&&clearTimeout(R.timeout),this.data[X].length===0&&delete this.data[X],this.order.splice(this.order.indexOf(X),1),R.value},ie.prototype.getByKey=function(X){var R=this.data[X];return R?R[0].value:null},ie.prototype.get=function(X){return this.has(X)?this.data[X.wrapped().key][0].value:null},ie.prototype.remove=function(X,R){if(!this.has(X))return this;var i=X.wrapped().key,a=R===void 0?0:this.data[i].indexOf(R),C=this.data[i][a];return this.data[i].splice(a,1),C.timeout&&clearTimeout(C.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(C.value),this.order.splice(this.order.indexOf(i),1),this},ie.prototype.setMaxSize=function(X){for(this.max=X;this.order.length>this.max;){var R=this._getAndRemoveByKey(this.order[0]);R&&this.onRemove(R)}return this},ie.prototype.filter=function(X){var R=[];for(var i in this.data)for(var a=0,C=this.data[i];a1||(Math.abs(Ae)>1&&(Math.abs(Ae+Ue)===1?Ae+=Ue:Math.abs(Ae-Ue)===1&&(Ae-=Ue)),ve.dem&&ue.dem&&(ue.dem.backfillBorder(ve.dem,Ae,Re),ue.neighboringTiles&&ue.neighboringTiles[it]&&(ue.neighboringTiles[it].backfilled=!0)))}},R.prototype.getTile=function(i){return this.getTileByID(i.key)},R.prototype.getTileByID=function(i){return this._tiles[i]},R.prototype._retainLoadedChildren=function(i,a,C,F){for(var q in this._tiles){var te=this._tiles[q];if(!(F[q]||!te.hasData()||te.tileID.overscaledZ<=a||te.tileID.overscaledZ>C)){for(var ue=te.tileID;te&&te.tileID.overscaledZ>a+1;){var ve=te.tileID.scaledTo(te.tileID.overscaledZ-1);(te=this._tiles[ve.key])&&te.hasData()&&(ue=ve)}for(var Ae=ue;Ae.overscaledZ>a;)if(i[(Ae=Ae.scaledTo(Ae.overscaledZ-1)).key]){F[ue.key]=ue;break}}}},R.prototype.findLoadedParent=function(i,a){if(i.key in this._loadedParentTiles){var C=this._loadedParentTiles[i.key];return C&&C.tileID.overscaledZ>=a?C:null}for(var F=i.overscaledZ-1;F>=a;F--){var q=i.scaledTo(F),te=this._getLoadedTile(q);if(te)return te}},R.prototype._getLoadedTile=function(i){var a=this._tiles[i.key];return a&&a.hasData()?a:this._cache.getByKey(i.wrapped().key)},R.prototype.updateCacheSize=function(i){var a=(Math.ceil(i.width/this._source.tileSize)+1)*(Math.ceil(i.height/this._source.tileSize)+1),C=Math.floor(5*a),F=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,C):C;this._cache.setMaxSize(F)},R.prototype.handleWrapJump=function(i){var a=(i-(this._prevLng===void 0?i:this._prevLng))/360,C=Math.round(a);if(this._prevLng=i,C){var F={};for(var q in this._tiles){var te=this._tiles[q];te.tileID=te.tileID.unwrapTo(te.tileID.wrap+C),F[te.tileID.key]=te}for(var ue in this._tiles=F,this._timers)clearTimeout(this._timers[ue]),delete this._timers[ue];for(var ve in this._tiles){var Ae=this._tiles[ve];this._setTileReloadTimer(ve,Ae)}}},R.prototype.update=function(i){var a=this;if(this.transform=i,this._sourceLoaded&&!this._paused){var C;this.updateCacheSize(i),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?C=i.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Yt){return new e.OverscaledTileID(Yt.canonical.z,Yt.wrap,Yt.canonical.z,Yt.canonical.x,Yt.canonical.y)}):(C=i.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(C=C.filter(function(Yt){return a._source.hasTile(Yt)}))):C=[];var F=i.coveringZoomLevel(this._source),q=Math.max(F-R.maxOverzooming,this._source.minzoom),te=Math.max(F+R.maxUnderzooming,this._source.minzoom),ue=this._updateRetainedTiles(C,F);if(Lt(this._source.type)){for(var ve={},Ae={},Re=0,Ue=Object.keys(ue);Rethis._source.maxzoom){var Ct=dt.children(this._source.maxzoom)[0],Mt=this.getTile(Ct);if(Mt&&Mt.hasData()){C[Ct.key]=Ct;continue}}else{var Ut=dt.children(this._source.maxzoom);if(C[Ut[0].key]&&C[Ut[1].key]&&C[Ut[2].key]&&C[Ut[3].key])continue}for(var It=bt.wasRequested(),Qt=dt.overscaledZ-1;Qt>=q;--Qt){var tn=dt.scaledTo(Qt);if(F[tn.key]||(F[tn.key]=!0,!(bt=this.getTile(tn))&&It&&(bt=this._addTile(tn)),bt&&(C[tn.key]=tn,It=bt.wasRequested(),bt.hasData())))break}}}return C},R.prototype._updateLoadedParentTileCache=function(){for(var i in this._loadedParentTiles={},this._tiles){for(var a=[],C=void 0,F=this._tiles[i].tileID;F.overscaledZ>0;){if(F.key in this._loadedParentTiles){C=this._loadedParentTiles[F.key];break}a.push(F.key);var q=F.scaledTo(F.overscaledZ-1);if(C=this._getLoadedTile(q))break;F=q}for(var te=0,ue=a;te0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))},R.prototype.clearTiles=function(){for(var i in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(i);this._cache.reset()},R.prototype.tilesIn=function(i,a,C){var F=this,q=[],te=this.transform;if(!te)return q;for(var ue=C?te.getCameraQueryGeometry(i):i,ve=i.map(function(Qt){return te.pointCoordinate(Qt)}),Ae=ue.map(function(Qt){return te.pointCoordinate(Qt)}),Re=this.getIds(),Ue=1/0,it=1/0,ct=-1/0,dt=-1/0,bt=0,Ct=Ae;bt=0&&Vn[1].y+Mn>=0){var Hn=ve.map(function(rr){return Yt.getTilePoint(rr)}),Xn=Ae.map(function(rr){return Yt.getTilePoint(rr)});q.push({tile:tn,tileID:Yt,queryGeometry:Hn,cameraQueryGeometry:Xn,scale:vn})}}},It=0;It=e.browser.now())return!0}return!1},R.prototype.setFeatureState=function(i,a,C){i=i||"_geojsonTileLayer",this._state.updateState(i,a,C)},R.prototype.removeFeatureState=function(i,a,C){i=i||"_geojsonTileLayer",this._state.removeFeatureState(i,a,C)},R.prototype.getFeatureState=function(i,a){return i=i||"_geojsonTileLayer",this._state.getState(i,a)},R.prototype.setDependencies=function(i,a,C){var F=this._tiles[i];F&&F.setDependencies(a,C)},R.prototype.reloadTilesForDependencies=function(i,a){for(var C in this._tiles)this._tiles[C].hasDependency(i,a)&&this._reloadTile(C,"reloading");this._cache.filter(function(F){return!F.hasDependency(i,a)})},R}(e.Evented);function vt(X,R){var i=Math.abs(2*X.wrap)-+(X.wrap<0),a=Math.abs(2*R.wrap)-+(R.wrap<0);return X.overscaledZ-R.overscaledZ||a-i||R.canonical.y-X.canonical.y||R.canonical.x-X.canonical.x}function Lt(X){return X==="raster"||X==="image"||X==="video"}function jt(){return new e.window.Worker(Dt.workerUrl)}wt.maxOverzooming=10,wt.maxUnderzooming=3;var rt="mapboxgl_preloaded_worker_pool",et=function(){this.active={}};et.prototype.acquire=function(X){if(!this.workers)for(this.workers=[];this.workers.length0?(a-F)/q:0;return this.points[C].mult(1-te).add(this.points[R].mult(te))};var En=function(X,R,i){var a=this.boxCells=[],C=this.circleCells=[];this.xCellCount=Math.ceil(X/i),this.yCellCount=Math.ceil(R/i);for(var F=0;F=-R[0]&&i<=R[0]&&a>=-R[1]&&a<=R[1]}function zn(X,R,i,a,C,F,q,te){var ue=a?X.textSizeData:X.iconSizeData,ve=e.evaluateSizeForZoom(ue,i.transform.zoom),Ae=[256/i.width*2+1,256/i.height*2+1],Re=a?X.text.dynamicLayoutVertexArray:X.icon.dynamicLayoutVertexArray;Re.clear();for(var Ue=X.lineVertexArray,it=a?X.text.placedSymbolArray:X.icon.placedSymbolArray,ct=i.transform.width/i.transform.height,dt=!1,bt=0;btMath.abs(i.x-R.x)*a?{useVertical:!0}:(X===e.WritingMode.vertical?R.yi.x)?{needsFlipping:!0}:null}function vr(X,R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it){var ct,dt=R/24,bt=X.lineOffsetX*dt,Ct=X.lineOffsetY*dt;if(X.numGlyphs>1){var Mt=X.glyphStartIndex+X.numGlyphs,Ut=X.lineStartIndex,It=X.lineStartIndex+X.lineLength,Qt=Jn(dt,te,bt,Ct,i,Ae,Re,X,ue,F,Ue);if(!Qt)return{notEnoughRoom:!0};var tn=Tn(Qt.first.point,q).point,Yt=Tn(Qt.last.point,q).point;if(a&&!i){var vn=$n(X.writingMode,tn,Yt,it);if(vn)return vn}ct=[Qt.first];for(var Mn=X.glyphStartIndex+1;Mn0?rr.point:Qn(Re,Xn,Vn,1,C),nr=$n(X.writingMode,Vn,Mr,it);if(nr)return nr}var Lr=lr(dt*te.getoffsetX(X.glyphStartIndex),bt,Ct,i,Ae,Re,X.segment,X.lineStartIndex,X.lineStartIndex+X.lineLength,ue,F,Ue);if(!Lr)return{notEnoughRoom:!0};ct=[Lr]}for(var dr=0,Br=ct;dr0?1:-1,ct=0;a&&(it*=-1,ct=Math.PI),it<0&&(ct+=Math.PI);for(var dt=it>0?te+q:te+q+1,bt=C,Ct=C,Mt=0,Ut=0,It=Math.abs(Ue),Qt=[];Mt+Ut<=It;){if((dt+=it)=ue)return null;if(Ct=bt,Qt.push(bt),(bt=Re[dt])===void 0){var tn=new e.Point(ve.getx(dt),ve.gety(dt)),Yt=Tn(tn,Ae);if(Yt.signedDistanceFromCamera>0)bt=Re[dt]=Yt.point;else{var vn=dt-it;bt=Qn(Mt===0?F:new e.Point(ve.getx(vn),ve.gety(vn)),tn,Ct,It-Mt+1,Ae)}}Mt+=Ut,Ut=Ct.dist(bt)}var Mn=(It-Mt)/Ut,Vn=bt.sub(Ct),Hn=Vn.mult(Mn)._add(Ct);Hn._add(Vn._unit()._perp()._mult(i*it));var Xn=ct+Math.atan2(bt.y-Ct.y,bt.x-Ct.x);return Qt.push(Hn),{point:Hn,angle:Xn,path:Qt}}En.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},En.prototype.insert=function(X,R,i,a,C){this._forEachCell(R,i,a,C,this._insertBoxCell,this.boxUid++),this.boxKeys.push(X),this.bboxes.push(R),this.bboxes.push(i),this.bboxes.push(a),this.bboxes.push(C)},En.prototype.insertCircle=function(X,R,i,a){this._forEachCell(R-a,i-a,R+a,i+a,this._insertCircleCell,this.circleUid++),this.circleKeys.push(X),this.circles.push(R),this.circles.push(i),this.circles.push(a)},En.prototype._insertBoxCell=function(X,R,i,a,C,F){this.boxCells[C].push(F)},En.prototype._insertCircleCell=function(X,R,i,a,C,F){this.circleCells[C].push(F)},En.prototype._query=function(X,R,i,a,C,F){if(i<0||X>this.width||a<0||R>this.height)return!C&&[];var q=[];if(X<=0&&R<=0&&this.width<=i&&this.height<=a){if(C)return!0;for(var te=0;te0:q},En.prototype._queryCircle=function(X,R,i,a,C){var F=X-i,q=X+i,te=R-i,ue=R+i;if(q<0||F>this.width||ue<0||te>this.height)return!a&&[];var ve=[],Ae={hitTest:a,circle:{x:X,y:R,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(F,te,q,ue,this._queryCellCircle,ve,Ae,C),a?ve.length>0:ve},En.prototype.query=function(X,R,i,a,C){return this._query(X,R,i,a,!1,C)},En.prototype.hitTest=function(X,R,i,a,C){return this._query(X,R,i,a,!0,C)},En.prototype.hitTestCircle=function(X,R,i,a){return this._queryCircle(X,R,i,!0,a)},En.prototype._queryCell=function(X,R,i,a,C,F,q,te){var ue=q.seenUids,ve=this.boxCells[C];if(ve!==null)for(var Ae=this.bboxes,Re=0,Ue=ve;Re=Ae[ct+0]&&a>=Ae[ct+1]&&(!te||te(this.boxKeys[it]))){if(q.hitTest)return F.push(!0),!0;F.push({key:this.boxKeys[it],x1:Ae[ct],y1:Ae[ct+1],x2:Ae[ct+2],y2:Ae[ct+3]})}}}var dt=this.circleCells[C];if(dt!==null)for(var bt=this.circles,Ct=0,Mt=dt;Ctq*q+te*te},En.prototype._circleAndRectCollide=function(X,R,i,a,C,F,q){var te=(F-a)/2,ue=Math.abs(X-(a+te));if(ue>te+i)return!1;var ve=(q-C)/2,Ae=Math.abs(R-(C+ve));if(Ae>ve+i)return!1;if(ue<=te||Ae<=ve)return!0;var Re=ue-te,Ue=Ae-ve;return Re*Re+Ue*Ue<=i*i};var hr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function jr(X,R){for(var i=0;i=1;Mr--)rr.push(Hn.path[Mr]);for(var nr=1;nr0){for(var Sr=rr[0].clone(),Vr=rr[0].clone(),fi=1;fi=vn.x&&Vr.x<=Mn.x&&Sr.y>=vn.y&&Vr.y<=Mn.y?[rr]:Vr.xMn.x||Vr.yMn.y?[]:e.clipLine([rr],vn.x,vn.y,Mn.x,Mn.y)}for(var Nr=0,si=Br;Nr=this.screenRightBoundary||athis.screenBottomBoundary},Ar.prototype.isInsideGrid=function(X,R,i,a){return i>=0&&X=0&&R0?(this.prevPlacement&&this.prevPlacement.variableOffsets[Re.crossTileID]&&this.prevPlacement.placements[Re.crossTileID]&&this.prevPlacement.placements[Re.crossTileID].text&&(dt=this.prevPlacement.variableOffsets[Re.crossTileID].anchor),this.variableOffsets[Re.crossTileID]={textOffset:bt,width:i,height:a,anchor:X,textBoxScale:C,prevAnchor:dt},this.markUsedJustification(Ue,X,Re,it),Ue.allowVerticalPlacement&&(this.markUsedOrientation(Ue,it,Re),this.placedOrientations[Re.crossTileID]=it),{shift:Ct,placedGlyphBoxes:Mt}):void 0},Xr.prototype.placeLayerBucketPart=function(X,R,i){var a=this,C=X.parameters,F=C.bucket,q=C.layout,te=C.posMatrix,ue=C.textLabelPlaneMatrix,ve=C.labelToScreenMatrix,Ae=C.textPixelRatio,Re=C.holdingForFade,Ue=C.collisionBoxArray,it=C.partiallyEvaluatedTextSize,ct=C.collisionGroup,dt=q.get("text-optional"),bt=q.get("icon-optional"),Ct=q.get("text-allow-overlap"),Mt=q.get("icon-allow-overlap"),Ut=q.get("text-rotation-alignment")==="map",It=q.get("text-pitch-alignment")==="map",Qt=q.get("icon-text-fit")!=="none",tn=q.get("symbol-z-order")==="viewport-y",Yt=Ct&&(Mt||!F.hasIconData()||bt),vn=Mt&&(Ct||!F.hasTextData()||dt);!F.collisionArrays&&Ue&&F.deserializeCollisionBoxes(Ue);var Mn=function(nr,Lr){if(!R[nr.crossTileID])if(Re)a.placements[nr.crossTileID]=new Cn(!1,!1,!1);else{var dr,Br=!1,Sr=!1,Vr=!0,fi=null,Nr={box:null,offscreen:null},si={box:null,offscreen:null},_i=null,Gi=null,Pi=0,Ji=0,Yi=0;Lr.textFeatureIndex?Pi=Lr.textFeatureIndex:nr.useRuntimeCollisionCircles&&(Pi=nr.featureIndex),Lr.verticalTextFeatureIndex&&(Ji=Lr.verticalTextFeatureIndex);var na=Lr.textBox;if(na){var Ma=function(ao){var ul=e.WritingMode.horizontal;if(F.allowVerticalPlacement&&!ao&&a.prevPlacement){var Lo=a.prevPlacement.placedOrientations[nr.crossTileID];Lo&&(a.placedOrientations[nr.crossTileID]=Lo,ul=Lo,a.markUsedOrientation(F,ul,nr))}return ul},go=function(ao,ul){if(F.allowVerticalPlacement&&nr.numVerticalGlyphVertices>0&&Lr.verticalTextBox)for(var Lo=0,Bc=F.writingModes;Lo0&&(uo=uo.filter(function(ao){return ao!==Go.anchor})).unshift(Go.anchor)}var Da=function(ao,ul,Lo){for(var Bc=ao.x2-ao.x1,ef=ao.y2-ao.y1,ga=nr.textBoxScale,Ch=Qt&&!Mt?ul:null,Cu={box:[],offscreen:!1},Sc=Ct?2*uo.length:uo.length,gc=0;gc=uo.length,Xs=a.attemptAnchorPlacement(tf,ao,Bc,ef,ga,Ut,It,Ae,te,ct,nf,nr,F,Lo,Ch);if(Xs&&(Cu=Xs.placedGlyphBoxes)&&Cu.box&&Cu.box.length){Br=!0,fi=Xs.shift;break}}return Cu};go(function(){return Da(na,Lr.iconBox,e.WritingMode.horizontal)},function(){var ao=Lr.verticalTextBox,ul=Nr&&Nr.box&&Nr.box.length;return F.allowVerticalPlacement&&!ul&&nr.numVerticalGlyphVertices>0&&ao?Da(ao,Lr.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}}),Nr&&(Br=Nr.box,Vr=Nr.offscreen);var ca=Ma(Nr&&Nr.box);if(!Br&&a.prevPlacement){var Qa=a.prevPlacement.variableOffsets[nr.crossTileID];Qa&&(a.variableOffsets[nr.crossTileID]=Qa,a.markUsedJustification(F,Qa.anchor,nr,ca))}}else{var Ra=function(ao,ul){var Lo=a.collisionIndex.placeCollisionBox(ao,Ct,Ae,te,ct.predicate);return Lo&&Lo.box&&Lo.box.length&&(a.markUsedOrientation(F,ul,nr),a.placedOrientations[nr.crossTileID]=ul),Lo};go(function(){return Ra(na,e.WritingMode.horizontal)},function(){var ao=Lr.verticalTextBox;return F.allowVerticalPlacement&&nr.numVerticalGlyphVertices>0&&ao?Ra(ao,e.WritingMode.vertical):{box:null,offscreen:null}}),Ma(Nr&&Nr.box&&Nr.box.length)}}if(Br=(dr=Nr)&&dr.box&&dr.box.length>0,Vr=dr&&dr.offscreen,nr.useRuntimeCollisionCircles){var wa=F.text.placedSymbolArray.get(nr.centerJustifiedTextSymbolIndex),Fa=e.evaluateSizeForFeature(F.textSizeData,it,wa),qa=q.get("text-padding"),fa=nr.collisionCircleDiameter;_i=a.collisionIndex.placeCollisionCircles(Ct,wa,F.lineVertexArray,F.glyphOffsetArray,Fa,te,ue,ve,i,It,ct.predicate,fa,qa),Br=Ct||_i.circles.length>0&&!_i.collisionDetected,Vr=Vr&&_i.offscreen}if(Lr.iconFeatureIndex&&(Yi=Lr.iconFeatureIndex),Lr.iconBox){var Pl=function(ao){var ul=Qt&&fi?Er(ao,fi.x,fi.y,Ut,It,a.transform.angle):ao;return a.collisionIndex.placeCollisionBox(ul,Mt,Ae,te,ct.predicate)};Sr=si&&si.box&&si.box.length&&Lr.verticalIconBox?(Gi=Pl(Lr.verticalIconBox)).box.length>0:(Gi=Pl(Lr.iconBox)).box.length>0,Vr=Vr&&Gi.offscreen}var mo=dt||nr.numHorizontalGlyphVertices===0&&nr.numVerticalGlyphVertices===0,Hi=bt||nr.numIconVertices===0;if(mo||Hi?Hi?mo||(Sr=Sr&&Br):Br=Sr&&Br:Sr=Br=Sr&&Br,Br&&dr&&dr.box&&(si&&si.box&&Ji?a.collisionIndex.insertCollisionBox(dr.box,q.get("text-ignore-placement"),F.bucketInstanceId,Ji,ct.ID):a.collisionIndex.insertCollisionBox(dr.box,q.get("text-ignore-placement"),F.bucketInstanceId,Pi,ct.ID)),Sr&&Gi&&a.collisionIndex.insertCollisionBox(Gi.box,q.get("icon-ignore-placement"),F.bucketInstanceId,Yi,ct.ID),_i&&(Br&&a.collisionIndex.insertCollisionCircles(_i.circles,q.get("text-ignore-placement"),F.bucketInstanceId,Pi,ct.ID),i)){var fs=F.bucketInstanceId,Po=a.collisionCircleArrays[fs];Po===void 0&&(Po=a.collisionCircleArrays[fs]=new ur);for(var ll=0;ll<_i.circles.length;ll+=4)Po.circles.push(_i.circles[ll+0]),Po.circles.push(_i.circles[ll+1]),Po.circles.push(_i.circles[ll+2]),Po.circles.push(_i.collisionDetected?1:0)}a.placements[nr.crossTileID]=new Cn(Br||Yt,Sr||vn,Vr||F.justReloaded),R[nr.crossTileID]=!0}};if(tn)for(var Vn=F.getSortedSymbolIndexes(this.transform.angle),Hn=Vn.length-1;Hn>=0;--Hn){var Xn=Vn[Hn];Mn(F.symbolInstances.get(Xn),F.collisionArrays[Xn])}else for(var rr=X.symbolInstanceStart;rr=0&&(X.text.placedSymbolArray.get(ue).crossTileID=C>=0&&ue!==C?0:i.crossTileID)}},Xr.prototype.markUsedOrientation=function(X,R,i){for(var a=R===e.WritingMode.horizontal||R===e.WritingMode.horizontalOnly?R:0,C=R===e.WritingMode.vertical?R:0,F=0,q=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];F0||It>0,Mn=Mt.numIconVertices>0,Vn=a.placedOrientations[Mt.crossTileID],Hn=Vn===e.WritingMode.vertical,Xn=Vn===e.WritingMode.horizontal||Vn===e.WritingMode.horizontalOnly;if(vn){var rr=tr(Yt.text),Mr=Hn?Wn:rr;it(X.text,Ut,Mr);var nr=Xn?Wn:rr;it(X.text,It,nr);var Lr=Yt.text.isHidden();[Mt.rightJustifiedTextSymbolIndex,Mt.centerJustifiedTextSymbolIndex,Mt.leftJustifiedTextSymbolIndex].forEach(function(Yi){Yi>=0&&(X.text.placedSymbolArray.get(Yi).hidden=Lr||Hn?1:0)}),Mt.verticalPlacedTextSymbolIndex>=0&&(X.text.placedSymbolArray.get(Mt.verticalPlacedTextSymbolIndex).hidden=Lr||Xn?1:0);var dr=a.variableOffsets[Mt.crossTileID];dr&&a.markUsedJustification(X,dr.anchor,Mt,Vn);var Br=a.placedOrientations[Mt.crossTileID];Br&&(a.markUsedJustification(X,"left",Mt,Br),a.markUsedOrientation(X,Br,Mt))}if(Mn){var Sr=tr(Yt.icon),Vr=!(Re&&Mt.verticalPlacedIconSymbolIndex&&Hn);if(Mt.placedIconSymbolIndex>=0){var fi=Vr?Sr:Wn;it(X.icon,Mt.numIconVertices,fi),X.icon.placedSymbolArray.get(Mt.placedIconSymbolIndex).hidden=Yt.icon.isHidden()}if(Mt.verticalPlacedIconSymbolIndex>=0){var Nr=Vr?Wn:Sr;it(X.icon,Mt.numVerticalIconVertices,Nr),X.icon.placedSymbolArray.get(Mt.verticalPlacedIconSymbolIndex).hidden=Yt.icon.isHidden()}}if(X.hasIconCollisionBoxData()||X.hasTextCollisionBoxData()){var si=X.collisionArrays[Ct];if(si){var _i=new e.Point(0,0);if(si.textBox||si.verticalTextBox){var Gi=!0;if(ue){var Pi=a.variableOffsets[Qt];Pi?(_i=Ir(Pi.anchor,Pi.width,Pi.height,Pi.textOffset,Pi.textBoxScale),ve&&_i._rotate(Ae?a.transform.angle:-a.transform.angle)):Gi=!1}si.textBox&&ai(X.textCollisionBox.collisionVertexArray,Yt.text.placed,!Gi||Hn,_i.x,_i.y),si.verticalTextBox&&ai(X.textCollisionBox.collisionVertexArray,Yt.text.placed,!Gi||Xn,_i.x,_i.y)}var Ji=!!(!Xn&&si.verticalIconBox);si.iconBox&&ai(X.iconCollisionBox.collisionVertexArray,Yt.icon.placed,Ji,Re?_i.x:0,Re?_i.y:0),si.verticalIconBox&&ai(X.iconCollisionBox.collisionVertexArray,Yt.icon.placed,!Ji,Re?_i.x:0,Re?_i.y:0)}}},dt=0;dtX},Xr.prototype.setStale=function(){this.stale=!0};var bn=Math.pow(2,25),Yn=Math.pow(2,24),an=Math.pow(2,17),_n=Math.pow(2,16),gn=Math.pow(2,9),qn=Math.pow(2,8),Un=Math.pow(2,1);function tr(X){if(X.opacity===0&&!X.placed)return 0;if(X.opacity===1&&X.placed)return 4294967295;var R=X.placed?1:0,i=Math.floor(127*X.opacity);return i*bn+R*Yn+i*an+R*_n+i*gn+R*qn+i*Un+R}var Wn=0,Bn=function(X){this._sortAcrossTiles=X.layout.get("symbol-z-order")!=="viewport-y"&&X.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Bn.prototype.continuePlacement=function(X,R,i,a,C){for(var F=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var q=R[X[this._currentPlacementIndex]],te=this.placement.collisionIndex.transform.zoom;if(q.type==="symbol"&&(!q.minzoom||q.minzoom<=te)&&(!q.maxzoom||q.maxzoom>te)){if(this._inProgressLayer||(this._inProgressLayer=new Bn(q)),this._inProgressLayer.continuePlacement(i[q.source],this.placement,this._showCollisionBoxes,q,F))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},dn.prototype.commit=function(X){return this.placement.commit(X),this.placement};var ln=512/e.EXTENT/2,An=function(X,R,i){this.tileID=X,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var a=0;aX.overscaledZ)for(var te in q){var ue=q[te];ue.tileID.isChildOf(X)&&ue.findMatches(R.symbolInstances,X,C)}else{var ve=q[X.scaledTo(Number(F)).key];ve&&ve.findMatches(R.symbolInstances,X,C)}}for(var Ae=0;Ae1?"@2x":"",Re=e.getJSON(F.transformRequest(F.normalizeSpriteURL(C,Ae,".json"),e.ResourceType.SpriteJSON),function(ct,dt){Re=null,ve||(ve=ct,te=dt,it())}),Ue=e.getImage(F.transformRequest(F.normalizeSpriteURL(C,Ae,".png"),e.ResourceType.SpriteImage),function(ct,dt){Ue=null,ve||(ve=ct,ue=dt,it())});function it(){if(ve)q(ve);else if(te&&ue){var ct=e.browser.getImageData(ue),dt={};for(var bt in te){var Ct=te[bt],Mt=Ct.width,Ut=Ct.height,It=Ct.x,Qt=Ct.y,tn=Ct.sdf,Yt=Ct.pixelRatio,vn=Ct.stretchX,Mn=Ct.stretchY,Vn=Ct.content,Hn=new e.RGBAImage({width:Mt,height:Ut});e.RGBAImage.copy(ct,Hn,{x:It,y:Qt},{x:0,y:0},{width:Mt,height:Ut}),dt[bt]={data:Hn,pixelRatio:Yt,sdf:tn,stretchX:vn,stretchY:Mn,content:Vn}}q(null,dt)}}return{cancel:function(){Re&&(Re.cancel(),Re=null),Ue&&(Ue.cancel(),Ue=null)}}}(i,this.map._requestManager,function(C,F){if(a._spriteRequest=null,C)a.fire(new e.ErrorEvent(C));else if(F)for(var q in F)a.imageManager.addImage(q,F[q]);a.imageManager.setLoaded(!0),a._availableImages=a.imageManager.listImages(),a.dispatcher.broadcast("setImages",a._availableImages),a.fire(new e.Event("data",{dataType:"style"}))})},R.prototype._validateLayer=function(i){var a=this.sourceCaches[i.source];if(a){var C=i.sourceLayer;if(C){var F=a.getSource();(F.type==="geojson"||F.vectorLayerIds&&F.vectorLayerIds.indexOf(C)===-1)&&this.fire(new e.ErrorEvent(new Error('Source layer "'+C+'" does not exist on source "'+F.id+'" as specified by style layer "'+i.id+'"')))}}},R.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var i in this.sourceCaches)if(!this.sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()},R.prototype._serializeLayers=function(i){for(var a=[],C=0,F=i;C0)throw new Error("Unimplemented: "+F.map(function(q){return q.command}).join(", ")+".");return C.forEach(function(q){q.command!=="setTransition"&&a[q.command].apply(a,q.args)}),this.stylesheet=i,!0},R.prototype.addImage=function(i,a){if(this.getImage(i))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(i,a),this._afterImageUpdated(i)},R.prototype.updateImage=function(i,a){this.imageManager.updateImage(i,a)},R.prototype.getImage=function(i){return this.imageManager.getImage(i)},R.prototype.removeImage=function(i){if(!this.getImage(i))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(i),this._afterImageUpdated(i)},R.prototype._afterImageUpdated=function(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!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(i,a,C){var F=this;if(C===void 0&&(C={}),this._checkLoaded(),this.sourceCaches[i]!==void 0)throw new Error("There is already a source with this ID");if(!a.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(a).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(a.type)>=0&&this._validate(e.validateStyle.source,"sources."+i,a,null,C))){this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);var q=this.sourceCaches[i]=new wt(i,a,this.dispatcher);q.style=this,q.setEventedParent(this,function(){return{isSourceLoaded:F.loaded(),source:q.serialize(),sourceId:i}}),q.onAdd(this.map),this._changed=!0}},R.prototype.removeSource=function(i){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error("There is no source with this ID");for(var a in this._layers)if(this._layers[a].source===i)return this.fire(new e.ErrorEvent(new Error('Source "'+i+'" cannot be removed while layer "'+a+'" is using it.')));var C=this.sourceCaches[i];delete this.sourceCaches[i],delete this._updatedSources[i],C.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:i})),C.setEventedParent(null),C.clearTiles(),C.onRemove&&C.onRemove(this.map),this._changed=!0},R.prototype.setGeoJSONSourceData=function(i,a){this._checkLoaded(),this.sourceCaches[i].getSource().setData(a),this._changed=!0},R.prototype.getSource=function(i){return this.sourceCaches[i]&&this.sourceCaches[i].getSource()},R.prototype.addLayer=function(i,a,C){C===void 0&&(C={}),this._checkLoaded();var F=i.id;if(this.getLayer(F))this.fire(new e.ErrorEvent(new Error('Layer with id "'+F+'" already exists on this map')));else{var q;if(i.type==="custom"){if(yr(this,e.validateCustomStyleLayer(i)))return;q=e.createStyleLayer(i)}else{if(typeof i.source=="object"&&(this.addSource(F,i.source),i=e.clone$1(i),i=e.extend(i,{source:F})),this._validate(e.validateStyle.layer,"layers."+F,i,{arrayIndex:-1},C))return;q=e.createStyleLayer(i),this._validateLayer(q),q.setEventedParent(this,{layer:{id:F}}),this._serializedLayers[q.id]=q.serialize()}var te=a?this._order.indexOf(a):this._order.length;if(a&&te===-1)this.fire(new e.ErrorEvent(new Error('Layer with id "'+a+'" does not exist on this map.')));else{if(this._order.splice(te,0,F),this._layerOrderChanged=!0,this._layers[F]=q,this._removedLayers[F]&&q.source&&q.type!=="custom"){var ue=this._removedLayers[F];delete this._removedLayers[F],ue.type!==q.type?this._updatedSources[q.source]="clear":(this._updatedSources[q.source]="reload",this.sourceCaches[q.source].pause())}this._updateLayer(q),q.onAdd&&q.onAdd(this.map)}}},R.prototype.moveLayer=function(i,a){if(this._checkLoaded(),this._changed=!0,this._layers[i]){if(i!==a){var C=this._order.indexOf(i);this._order.splice(C,1);var F=a?this._order.indexOf(a):this._order.length;a&&F===-1?this.fire(new e.ErrorEvent(new Error('Layer with id "'+a+'" does not exist on this map.'))):(this._order.splice(F,0,i),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be moved.")))},R.prototype.removeLayer=function(i){this._checkLoaded();var a=this._layers[i];if(a){a.setEventedParent(null);var C=this._order.indexOf(i);this._order.splice(C,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=a,delete this._layers[i],delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],a.onRemove&&a.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be removed.")))},R.prototype.getLayer=function(i){return this._layers[i]},R.prototype.hasLayer=function(i){return i in this._layers},R.prototype.setLayerZoomRange=function(i,a,C){this._checkLoaded();var F=this.getLayer(i);F?F.minzoom===a&&F.maxzoom===C||(a!=null&&(F.minzoom=a),C!=null&&(F.maxzoom=C),this._updateLayer(F)):this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot have zoom extent.")))},R.prototype.setFilter=function(i,a,C){C===void 0&&(C={}),this._checkLoaded();var F=this.getLayer(i);if(F){if(!e.deepEqual(F.filter,a))return a==null?(F.filter=void 0,void this._updateLayer(F)):void(this._validate(e.validateStyle.filter,"layers."+F.id+".filter",a,null,C)||(F.filter=e.clone$1(a),this._updateLayer(F)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be filtered.")))},R.prototype.getFilter=function(i){return e.clone$1(this.getLayer(i).filter)},R.prototype.setLayoutProperty=function(i,a,C,F){F===void 0&&(F={}),this._checkLoaded();var q=this.getLayer(i);q?e.deepEqual(q.getLayoutProperty(a),C)||(q.setLayoutProperty(a,C,F),this._updateLayer(q)):this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be styled.")))},R.prototype.getLayoutProperty=function(i,a){var C=this.getLayer(i);if(C)return C.getLayoutProperty(a);this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style.")))},R.prototype.setPaintProperty=function(i,a,C,F){F===void 0&&(F={}),this._checkLoaded();var q=this.getLayer(i);q?e.deepEqual(q.getPaintProperty(a),C)||(q.setPaintProperty(a,C,F)&&this._updateLayer(q),this._changed=!0,this._updatedPaintProps[i]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+i+"' does not exist in the map's style and cannot be styled.")))},R.prototype.getPaintProperty=function(i,a){return this.getLayer(i).getPaintProperty(a)},R.prototype.setFeatureState=function(i,a){this._checkLoaded();var C=i.source,F=i.sourceLayer,q=this.sourceCaches[C];if(q!==void 0){var te=q.getSource().type;te==="geojson"&&F?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):te!=="vector"||F?(i.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),q.setFeatureState(F,i.id,a)):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 '"+C+"' does not exist in the map's style.")))},R.prototype.removeFeatureState=function(i,a){this._checkLoaded();var C=i.source,F=this.sourceCaches[C];if(F!==void 0){var q=F.getSource().type,te=q==="vector"?i.sourceLayer:void 0;q!=="vector"||te?a&&typeof i.id!="string"&&typeof i.id!="number"?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):F.removeFeatureState(te,i.id,a):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 '"+C+"' does not exist in the map's style.")))},R.prototype.getFeatureState=function(i){this._checkLoaded();var a=i.source,C=i.sourceLayer,F=this.sourceCaches[a];if(F!==void 0){if(F.getSource().type!=="vector"||C)return i.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),F.getFeatureState(C,i.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 '"+a+"' 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(i){return i.serialize()}),layers:this._serializeLayers(this._order)},function(i){return i!==void 0})},R.prototype._updateLayer=function(i){this._updatedLayers[i.id]=!0,i.source&&!this._updatedSources[i.source]&&this.sourceCaches[i.source].getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()),this._changed=!0},R.prototype._flattenAndSortRenderedFeatures=function(i){for(var a=this,C=function(Vn){return a._layers[Vn].type==="fill-extrusion"},F={},q=[],te=this._order.length-1;te>=0;te--){var ue=this._order[te];if(C(ue)){F[ue]=te;for(var ve=0,Ae=i;ve=0;bt--){var Ct=this._order[bt];if(C(Ct))for(var Mt=q.length-1;Mt>=0;Mt--){var Ut=q[Mt].feature;if(F[Ut.layer.id]>16,te>>16],u_pixel_coord_lower:[65535&q,65535&te]}}Nl.prototype.draw=function(X,R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt){var bt,Ct=X.gl;if(!this.failedToCreate){for(var Mt in X.program.set(this.program),X.setDepthMode(i),X.setStencilMode(a),X.setColorMode(C),X.setCullFace(F),this.fixedUniforms)this.fixedUniforms[Mt].set(q[Mt]);it&&it.setUniforms(X,this.binderUniforms,Re,{zoom:Ue});for(var Vt=(bt={},bt[Ct.LINES]=2,bt[Ct.TRIANGLES]=3,bt[Ct.LINE_STRIP]=1,bt)[R],It=0,Qt=Ae.get();It0?1-1/(1.001-q):-q),u_contrast_factor:(F=C.paint.get("raster-contrast"),F>0?1/(1-F):1+F),u_spin_weights:ql(C.paint.get("raster-hue-rotate"))};var F,q};function ql(X){X*=Math.PI/180;var R=Math.sin(X),i=Math.cos(X);return[(2*i+1)/3,(-Math.sqrt(3)*R-i+1)/3,(Math.sqrt(3)*R-i+1)/3]}var Fs,qo=function(X,R,i,a,C,F,q,te,ue,ve){var Ae=C.transform;return{u_is_size_zoom_constant:+(X==="constant"||X==="source"),u_is_size_feature_constant:+(X==="constant"||X==="camera"),u_size_t:R?R.uSizeT:0,u_size:R?R.uSize:0,u_camera_to_center_distance:Ae.cameraToCenterDistance,u_pitch:Ae.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:Ae.width/Ae.height,u_fade_change:C.options.fadeDuration?C.symbolFadeChange:1,u_matrix:F,u_label_plane_matrix:q,u_coord_matrix:te,u_is_text:+ue,u_pitch_with_map:+a,u_texsize:ve,u_texture:0}},Bo=function(X,R,i,a,C,F,q,te,ue,ve,Ae){var Re=C.transform;return e.extend(qo(X,R,i,a,C,F,q,te,ue,ve),{u_gamma_scale:a?Math.cos(Re._pitch)*Re.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+Ae})},_a=function(X,R,i,a,C,F,q,te,ue,ve){return e.extend(Bo(X,R,i,a,C,F,q,te,!0,ue,!0),{u_texsize_icon:ve,u_texture_icon:1})},Vu=function(X,R,i){return{u_matrix:X,u_opacity:R,u_color:i}},Fc=function(X,R,i,a,C,F){return e.extend(function(q,te,ue,ve){var Ae=ue.imageManager.getPattern(q.from.toString()),Re=ue.imageManager.getPattern(q.to.toString()),Ue=ue.imageManager.getPixelSize(),it=Ue.width,ct=Ue.height,dt=Math.pow(2,ve.tileID.overscaledZ),bt=ve.tileSize*Math.pow(2,ue.transform.tileZoom)/dt,Ct=bt*(ve.tileID.canonical.x+ve.tileID.wrap*dt),Mt=bt*ve.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ae.tl,u_pattern_br_a:Ae.br,u_pattern_tl_b:Re.tl,u_pattern_br_b:Re.br,u_texsize:[it,ct],u_mix:te.t,u_pattern_size_a:Ae.displaySize,u_pattern_size_b:Re.displaySize,u_scale_a:te.fromScale,u_scale_b:te.toScale,u_tile_units_to_pixels:1/xr(ve,1,ue.transform.tileZoom),u_pixel_coord_upper:[Ct>>16,Mt>>16],u_pixel_coord_lower:[65535&Ct,65535&Mt]}}(a,F,i,C),{u_matrix:X,u_opacity:R})},Hs={fillExtrusion:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_lightpos:new e.Uniform3f(X,R.u_lightpos),u_lightintensity:new e.Uniform1f(X,R.u_lightintensity),u_lightcolor:new e.Uniform3f(X,R.u_lightcolor),u_vertical_gradient:new e.Uniform1f(X,R.u_vertical_gradient),u_opacity:new e.Uniform1f(X,R.u_opacity)}},fillExtrusionPattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_lightpos:new e.Uniform3f(X,R.u_lightpos),u_lightintensity:new e.Uniform1f(X,R.u_lightintensity),u_lightcolor:new e.Uniform3f(X,R.u_lightcolor),u_vertical_gradient:new e.Uniform1f(X,R.u_vertical_gradient),u_height_factor:new e.Uniform1f(X,R.u_height_factor),u_image:new e.Uniform1i(X,R.u_image),u_texsize:new e.Uniform2f(X,R.u_texsize),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade),u_opacity:new e.Uniform1f(X,R.u_opacity)}},fill:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},fillPattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_image:new e.Uniform1i(X,R.u_image),u_texsize:new e.Uniform2f(X,R.u_texsize),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade)}},fillOutline:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_world:new e.Uniform2f(X,R.u_world)}},fillOutlinePattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_world:new e.Uniform2f(X,R.u_world),u_image:new e.Uniform1i(X,R.u_image),u_texsize:new e.Uniform2f(X,R.u_texsize),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade)}},circle:function(X,R){return{u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(X,R.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(X,R.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},collisionBox:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(X,R.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(X,R.u_extrude_scale),u_overscale_factor:new e.Uniform1f(X,R.u_overscale_factor)}},collisionCircle:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_inv_matrix:new e.UniformMatrix4f(X,R.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(X,R.u_viewport_size)}},debug:function(X,R){return{u_color:new e.UniformColor(X,R.u_color),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_overlay:new e.Uniform1i(X,R.u_overlay),u_overlay_scale:new e.Uniform1f(X,R.u_overlay_scale)}},clippingMask:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},heatmap:function(X,R){return{u_extrude_scale:new e.Uniform1f(X,R.u_extrude_scale),u_intensity:new e.Uniform1f(X,R.u_intensity),u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},heatmapTexture:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_world:new e.Uniform2f(X,R.u_world),u_image:new e.Uniform1i(X,R.u_image),u_color_ramp:new e.Uniform1i(X,R.u_color_ramp),u_opacity:new e.Uniform1f(X,R.u_opacity)}},hillshade:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_image:new e.Uniform1i(X,R.u_image),u_latrange:new e.Uniform2f(X,R.u_latrange),u_light:new e.Uniform2f(X,R.u_light),u_shadow:new e.UniformColor(X,R.u_shadow),u_highlight:new e.UniformColor(X,R.u_highlight),u_accent:new e.UniformColor(X,R.u_accent)}},hillshadePrepare:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_image:new e.Uniform1i(X,R.u_image),u_dimension:new e.Uniform2f(X,R.u_dimension),u_zoom:new e.Uniform1f(X,R.u_zoom),u_unpack:new e.Uniform4f(X,R.u_unpack)}},line:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels)}},lineGradient:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels),u_image:new e.Uniform1i(X,R.u_image),u_image_height:new e.Uniform1f(X,R.u_image_height)}},linePattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_texsize:new e.Uniform2f(X,R.u_texsize),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_image:new e.Uniform1i(X,R.u_image),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade)}},lineSDF:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(X,R.u_patternscale_a),u_patternscale_b:new e.Uniform2f(X,R.u_patternscale_b),u_sdfgamma:new e.Uniform1f(X,R.u_sdfgamma),u_image:new e.Uniform1i(X,R.u_image),u_tex_y_a:new e.Uniform1f(X,R.u_tex_y_a),u_tex_y_b:new e.Uniform1f(X,R.u_tex_y_b),u_mix:new e.Uniform1f(X,R.u_mix)}},raster:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_tl_parent:new e.Uniform2f(X,R.u_tl_parent),u_scale_parent:new e.Uniform1f(X,R.u_scale_parent),u_buffer_scale:new e.Uniform1f(X,R.u_buffer_scale),u_fade_t:new e.Uniform1f(X,R.u_fade_t),u_opacity:new e.Uniform1f(X,R.u_opacity),u_image0:new e.Uniform1i(X,R.u_image0),u_image1:new e.Uniform1i(X,R.u_image1),u_brightness_low:new e.Uniform1f(X,R.u_brightness_low),u_brightness_high:new e.Uniform1f(X,R.u_brightness_high),u_saturation_factor:new e.Uniform1f(X,R.u_saturation_factor),u_contrast_factor:new e.Uniform1f(X,R.u_contrast_factor),u_spin_weights:new e.Uniform3f(X,R.u_spin_weights)}},symbolIcon:function(X,R){return{u_is_size_zoom_constant:new e.Uniform1i(X,R.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(X,R.u_is_size_feature_constant),u_size_t:new e.Uniform1f(X,R.u_size_t),u_size:new e.Uniform1f(X,R.u_size),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pitch:new e.Uniform1f(X,R.u_pitch),u_rotate_symbol:new e.Uniform1i(X,R.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(X,R.u_aspect_ratio),u_fade_change:new e.Uniform1f(X,R.u_fade_change),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(X,R.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(X,R.u_coord_matrix),u_is_text:new e.Uniform1i(X,R.u_is_text),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_texsize:new e.Uniform2f(X,R.u_texsize),u_texture:new e.Uniform1i(X,R.u_texture)}},symbolSDF:function(X,R){return{u_is_size_zoom_constant:new e.Uniform1i(X,R.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(X,R.u_is_size_feature_constant),u_size_t:new e.Uniform1f(X,R.u_size_t),u_size:new e.Uniform1f(X,R.u_size),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pitch:new e.Uniform1f(X,R.u_pitch),u_rotate_symbol:new e.Uniform1i(X,R.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(X,R.u_aspect_ratio),u_fade_change:new e.Uniform1f(X,R.u_fade_change),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(X,R.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(X,R.u_coord_matrix),u_is_text:new e.Uniform1i(X,R.u_is_text),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_texsize:new e.Uniform2f(X,R.u_texsize),u_texture:new e.Uniform1i(X,R.u_texture),u_gamma_scale:new e.Uniform1f(X,R.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(X,R.u_is_halo)}},symbolTextAndIcon:function(X,R){return{u_is_size_zoom_constant:new e.Uniform1i(X,R.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(X,R.u_is_size_feature_constant),u_size_t:new e.Uniform1f(X,R.u_size_t),u_size:new e.Uniform1f(X,R.u_size),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pitch:new e.Uniform1f(X,R.u_pitch),u_rotate_symbol:new e.Uniform1i(X,R.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(X,R.u_aspect_ratio),u_fade_change:new e.Uniform1f(X,R.u_fade_change),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(X,R.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(X,R.u_coord_matrix),u_is_text:new e.Uniform1i(X,R.u_is_text),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_texsize:new e.Uniform2f(X,R.u_texsize),u_texsize_icon:new e.Uniform2f(X,R.u_texsize_icon),u_texture:new e.Uniform1i(X,R.u_texture),u_texture_icon:new e.Uniform1i(X,R.u_texture_icon),u_gamma_scale:new e.Uniform1f(X,R.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(X,R.u_is_halo)}},background:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_opacity:new e.Uniform1f(X,R.u_opacity),u_color:new e.UniformColor(X,R.u_color)}},backgroundPattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_opacity:new e.Uniform1f(X,R.u_opacity),u_image:new e.Uniform1i(X,R.u_image),u_pattern_tl_a:new e.Uniform2f(X,R.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(X,R.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(X,R.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(X,R.u_pattern_br_b),u_texsize:new e.Uniform2f(X,R.u_texsize),u_mix:new e.Uniform1f(X,R.u_mix),u_pattern_size_a:new e.Uniform2f(X,R.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(X,R.u_pattern_size_b),u_scale_a:new e.Uniform1f(X,R.u_scale_a),u_scale_b:new e.Uniform1f(X,R.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(X,R.u_tile_units_to_pixels)}}};function Yo(X,R,i,a,C,F,q){for(var te=X.context,ue=te.gl,ve=X.useProgram("collisionBox"),Ae=[],Re=0,Ue=0,it=0;it0){var It=e.create(),Qt=Ct;e.mul(It,bt.placementInvProjMatrix,X.transform.glCoordMatrix),e.mul(It,It,bt.placementViewportMatrix),Ae.push({circleArray:Vt,circleOffset:Ue,transform:Qt,invTransform:It}),Ue=Re+=Vt.length/4}Mt&&ve.draw(te,ue.LINES,Ot.disabled,at.disabled,X.colorModeForRenderPass(),Xe.disabled,Su(Ct,X.transform,dt),i.id,Mt.layoutVertexBuffer,Mt.indexBuffer,Mt.segments,null,X.transform.zoom,null,null,Mt.collisionVertexBuffer)}}if(q&&Ae.length){var tn=X.useProgram("collisionCircle"),Yt=new e.StructArrayLayout2f1f2i16;Yt.resize(4*Re),Yt._trim();for(var vn=0,Mn=0,Vn=Ae;Mn=0&&(ct[bt.associatedIconIndex]={shiftedAnchor:Vn,angle:Hn})}else jr(bt.numGlyphs,Ue)}if(Ae){it.clear();for(var rr=X.icon.placedSymbolArray,Mr=0;Mr0){var q=e.browser.now(),te=(q-X.timeAdded)/F,ue=R?(q-R.timeAdded)/F:-1,ve=i.getSource(),Ae=C.coveringZoomLevel({tileSize:ve.tileSize,roundZoom:ve.roundZoom}),Re=!R||Math.abs(R.tileID.overscaledZ-Ae)>Math.abs(X.tileID.overscaledZ-Ae),Ue=Re&&X.refreshedUponExpiration?1:e.clamp(Re?te:1-ue,0,1);return X.refreshedUponExpiration&&te>=1&&(X.refreshedUponExpiration=!1),R?{opacity:1,mix:1-Ue}:{opacity:Ue,mix:0}}return{opacity:1,mix:0}}var ia=new e.Color(1,0,0,1),sa=new e.Color(0,1,0,1),po=new e.Color(0,0,1,1),ro=new e.Color(1,0,1,1),mu=new e.Color(0,1,1,1);function qu(X){var R=X.transform.padding;ls(X,X.transform.height-(R.top||0),3,ia),ls(X,R.bottom||0,3,sa),Ws(X,R.left||0,3,po),Ws(X,X.transform.width-(R.right||0),3,ro);var i=X.transform.centerPoint;(function(a,C,F,q){var te=20,ue=2;bl(a,C-ue/2,F-te/2,ue,te,q),bl(a,C-te/2,F-ue/2,te,ue,q)})(X,i.x,X.transform.height-i.y,mu)}function ls(X,R,i,a){bl(X,0,R+i/2,X.transform.width,i,a)}function Ws(X,R,i,a){bl(X,R-i/2,0,i,X.transform.height,a)}function bl(X,R,i,a,C,F){var q=X.context,te=q.gl;te.enable(te.SCISSOR_TEST),te.scissor(R*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio,C*e.browser.devicePixelRatio),q.clear({color:F}),te.disable(te.SCISSOR_TEST)}function Zs(X,R,i){var a=X.context,C=a.gl,F=i.posMatrix,q=X.useProgram("debug"),te=Ot.disabled,ue=at.disabled,ve=X.colorModeForRenderPass(),Ae="$debug";a.activeTexture.set(C.TEXTURE0),X.emptyTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),q.draw(a,C.LINE_STRIP,te,ue,ve,Xe.disabled,Rs(F,e.Color.red),Ae,X.debugBuffer,X.tileBorderIndexBuffer,X.debugSegments);var Re=R.getTileByID(i.key).latestRawTileData,Ue=Re&&Re.byteLength||0,it=Math.floor(Ue/1024),ct=R.getTile(i).tileSize,dt=512/Math.min(ct,512)*(i.overscaledZ/X.transform.zoom)*.5,bt=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(bt+=" => "+i.overscaledZ),function(Ct,Mt){Ct.initDebugOverlayCanvas();var Vt=Ct.debugOverlayCanvas,It=Ct.context.gl,Qt=Ct.debugOverlayCanvas.getContext("2d");Qt.clearRect(0,0,Vt.width,Vt.height),Qt.shadowColor="white",Qt.shadowBlur=2,Qt.lineWidth=1.5,Qt.strokeStyle="white",Qt.textBaseline="top",Qt.font="bold 36px Open Sans, sans-serif",Qt.fillText(Mt,5,5),Qt.strokeText(Mt,5,5),Ct.debugOverlayTexture.update(Vt),Ct.debugOverlayTexture.bind(It.LINEAR,It.CLAMP_TO_EDGE)}(X,bt+" "+it+"kb"),q.draw(a,C.TRIANGLES,te,ue,lt.alphaBlended,Xe.disabled,Rs(F,e.Color.transparent,dt),Ae,X.debugBuffer,X.quadTriangleIndexBuffer,X.debugSegments)}var vu={symbol:function(X,R,i,a,C){if(X.renderPass==="translucent"){var F=at.disabled,q=X.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(te,ue,ve,Ae,Re,Ue,it){for(var ct=ue.transform,dt=Re==="map",bt=Ue==="map",Ct=0,Mt=te;Ct256&&this.clearStencil(),i.setColorMode(lt.disabled),i.setDepthMode(Ot.disabled);var C=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var F=0,q=R;F256&&this.clearStencil();var X=this.nextStencilID++,R=this.context.gl;return new at({func:R.NOTEQUAL,mask:255},X,255,R.KEEP,R.KEEP,R.REPLACE)},La.prototype.stencilModeForClipping=function(X){var R=this.context.gl;return new at({func:R.EQUAL,mask:255},this._tileClippingMaskIDs[X.key],0,R.KEEP,R.KEEP,R.REPLACE)},La.prototype.stencilConfigForOverlap=function(X){var R,i=this.context.gl,a=X.sort(function(ue,ve){return ve.overscaledZ-ue.overscaledZ}),C=a[a.length-1].overscaledZ,F=a[0].overscaledZ-C+1;if(F>1){this.currentStencilSource=void 0,this.nextStencilID+F>256&&this.clearStencil();for(var q={},te=0;te=0;this.currentLayer--){var Qt=this.style._layers[a[this.currentLayer]],tn=C[Qt.source],Yt=ve[Qt.source];this._renderTileClippingMasks(Qt,Yt),this.renderLayer(this,tn,Qt,Yt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?R.pop():null},La.prototype.isPatternMissing=function(X){if(!X)return!1;if(!X.from||!X.to)return!0;var R=this.imageManager.getPattern(X.from.toString()),i=this.imageManager.getPattern(X.to.toString());return!R||!i},La.prototype.useProgram=function(X,R){this.cache=this.cache||{};var i=""+X+(R?R.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new Nl(this.context,X,ko[X],R,Hs[X],this._showOverdrawInspector)),this.cache[i]},La.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()},La.prototype.setBaseState=function(){var X=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(X.FUNC_ADD)},La.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var X=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,X.RGBA)}},La.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ba=function(X,R){this.points=X,this.planes=R};ba.fromInvProjectionMatrix=function(X,R,i){var a=Math.pow(2,i),C=[[-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(q){return e.transformMat4([],q,X)}).map(function(q){return e.scale$1([],q,1/q[3]/R*a)}),F=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(q){var te=e.sub([],C[q[0]],C[q[1]]),ue=e.sub([],C[q[2]],C[q[1]]),ve=e.normalize([],e.cross([],te,ue)),Ae=-e.dot(ve,C[q[1]]);return ve.concat(Ae)});return new ba(C,F)};var Ho=function(X,R){this.min=X,this.max=R,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Ho.prototype.quadrant=function(X){for(var R=[X%2==0,X<2],i=e.clone$2(this.min),a=e.clone$2(this.max),C=0;C=0;if(F===0)return 0;F!==R.length&&(i=!1)}if(i)return 2;for(var te=0;te<3;te++){for(var ue=Number.MAX_VALUE,ve=-Number.MAX_VALUE,Ae=0;Aethis.max[te]-this.min[te])return 0}return 1};var Ts=function(X,R,i,a){if(X===void 0&&(X=0),R===void 0&&(R=0),i===void 0&&(i=0),a===void 0&&(a=0),isNaN(X)||X<0||isNaN(R)||R<0||isNaN(i)||i<0||isNaN(a)||a<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=X,this.bottom=R,this.left=i,this.right=a};Ts.prototype.interpolate=function(X,R,i){return R.top!=null&&X.top!=null&&(this.top=e.number(X.top,R.top,i)),R.bottom!=null&&X.bottom!=null&&(this.bottom=e.number(X.bottom,R.bottom,i)),R.left!=null&&X.left!=null&&(this.left=e.number(X.left,R.left,i)),R.right!=null&&X.right!=null&&(this.right=e.number(X.right,R.right,i)),this},Ts.prototype.getCenter=function(X,R){var i=e.clamp((this.left+X-this.right)/2,0,X),a=e.clamp((this.top+R-this.bottom)/2,0,R);return new e.Point(i,a)},Ts.prototype.equals=function(X){return this.top===X.top&&this.bottom===X.bottom&&this.left===X.left&&this.right===X.right},Ts.prototype.clone=function(){return new Ts(this.top,this.bottom,this.left,this.right)},Ts.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Aa=function(X,R,i,a,C){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=C===void 0||C,this._minZoom=X||0,this._maxZoom=R||22,this._minPitch=i??0,this._maxPitch=a??60,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 Ts,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ua={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}};Aa.prototype.clone=function(){var X=new Aa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return X.tileSize=this.tileSize,X.latRange=this.latRange,X.width=this.width,X.height=this.height,X._center=this._center,X.zoom=this.zoom,X.angle=this.angle,X._fov=this._fov,X._pitch=this._pitch,X._unmodified=this._unmodified,X._edgeInsets=this._edgeInsets.clone(),X._calcMatrices(),X},Ua.minZoom.get=function(){return this._minZoom},Ua.minZoom.set=function(X){this._minZoom!==X&&(this._minZoom=X,this.zoom=Math.max(this.zoom,X))},Ua.maxZoom.get=function(){return this._maxZoom},Ua.maxZoom.set=function(X){this._maxZoom!==X&&(this._maxZoom=X,this.zoom=Math.min(this.zoom,X))},Ua.minPitch.get=function(){return this._minPitch},Ua.minPitch.set=function(X){this._minPitch!==X&&(this._minPitch=X,this.pitch=Math.max(this.pitch,X))},Ua.maxPitch.get=function(){return this._maxPitch},Ua.maxPitch.set=function(X){this._maxPitch!==X&&(this._maxPitch=X,this.pitch=Math.min(this.pitch,X))},Ua.renderWorldCopies.get=function(){return this._renderWorldCopies},Ua.renderWorldCopies.set=function(X){X===void 0?X=!0:X===null&&(X=!1),this._renderWorldCopies=X},Ua.worldSize.get=function(){return this.tileSize*this.scale},Ua.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ua.size.get=function(){return new e.Point(this.width,this.height)},Ua.bearing.get=function(){return-this.angle/Math.PI*180},Ua.bearing.set=function(X){var R=-e.wrap(X,-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))},Ua.pitch.get=function(){return this._pitch/Math.PI*180},Ua.pitch.set=function(X){var R=e.clamp(X,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==R&&(this._unmodified=!1,this._pitch=R,this._calcMatrices())},Ua.fov.get=function(){return this._fov/Math.PI*180},Ua.fov.set=function(X){X=Math.max(.01,Math.min(60,X)),this._fov!==X&&(this._unmodified=!1,this._fov=X/180*Math.PI,this._calcMatrices())},Ua.zoom.get=function(){return this._zoom},Ua.zoom.set=function(X){var R=Math.min(Math.max(X,this.minZoom),this.maxZoom);this._zoom!==R&&(this._unmodified=!1,this._zoom=R,this.scale=this.zoomScale(R),this.tileZoom=Math.floor(R),this.zoomFraction=R-this.tileZoom,this._constrain(),this._calcMatrices())},Ua.center.get=function(){return this._center},Ua.center.set=function(X){X.lat===this._center.lat&&X.lng===this._center.lng||(this._unmodified=!1,this._center=X,this._constrain(),this._calcMatrices())},Ua.padding.get=function(){return this._edgeInsets.toJSON()},Ua.padding.set=function(X){this._edgeInsets.equals(X)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,X,1),this._calcMatrices())},Ua.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Aa.prototype.isPaddingEqual=function(X){return this._edgeInsets.equals(X)},Aa.prototype.interpolatePadding=function(X,R,i){this._unmodified=!1,this._edgeInsets.interpolate(X,R,i),this._constrain(),this._calcMatrices()},Aa.prototype.coveringZoomLevel=function(X){var R=(X.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/X.tileSize));return Math.max(0,R)},Aa.prototype.getVisibleUnwrappedCoordinates=function(X){var R=[new e.UnwrappedTileID(0,X)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new e.Point(0,0)),a=this.pointCoordinate(new e.Point(this.width,0)),C=this.pointCoordinate(new e.Point(this.width,this.height)),F=this.pointCoordinate(new e.Point(0,this.height)),q=Math.floor(Math.min(i.x,a.x,C.x,F.x)),te=Math.floor(Math.max(i.x,a.x,C.x,F.x)),ue=q-1;ue<=te+1;ue++)ue!==0&&R.push(new e.UnwrappedTileID(ue,X));return R},Aa.prototype.coveringTiles=function(X){var R=this.coveringZoomLevel(X),i=R;if(X.minzoom!==void 0&&RX.maxzoom&&(R=X.maxzoom);var a=e.MercatorCoordinate.fromLngLat(this.center),C=Math.pow(2,R),F=[C*a.x,C*a.y,0],q=ba.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,R),te=X.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(te=R);var ue=function(Vn){return{aabb:new Ho([Vn*C,0,0],[(Vn+1)*C,C,0]),zoom:0,x:0,y:0,wrap:Vn,fullyVisible:!1}},ve=[],Ae=[],Re=R,Ue=X.reparseOverscaled?i:R;if(this._renderWorldCopies)for(var it=1;it<=3;it++)ve.push(ue(-it)),ve.push(ue(it));for(ve.push(ue(0));ve.length>0;){var ct=ve.pop(),dt=ct.x,bt=ct.y,Ct=ct.fullyVisible;if(!Ct){var Mt=ct.aabb.intersects(q);if(Mt===0)continue;Ct=Mt===2}var Vt=ct.aabb.distanceX(F),It=ct.aabb.distanceY(F),Qt=Math.max(Math.abs(Vt),Math.abs(It)),tn=3+(1<tn&&ct.zoom>=te)Ae.push({tileID:new e.OverscaledTileID(ct.zoom===Re?Ue:ct.zoom,ct.wrap,ct.zoom,dt,bt),distanceSq:e.sqrLen([F[0]-.5-dt,F[1]-.5-bt])});else for(var Yt=0;Yt<4;Yt++){var vn=(dt<<1)+Yt%2,Mn=(bt<<1)+(Yt>>1);ve.push({aabb:ct.aabb.quadrant(Yt),zoom:ct.zoom+1,x:vn,y:Mn,wrap:ct.wrap,fullyVisible:Ct})}}return Ae.sort(function(Vn,Hn){return Vn.distanceSq-Hn.distanceSq}).map(function(Vn){return Vn.tileID})},Aa.prototype.resize=function(X,R){this.width=X,this.height=R,this.pixelsToGLUnits=[2/X,-2/R],this._constrain(),this._calcMatrices()},Ua.unmodified.get=function(){return this._unmodified},Aa.prototype.zoomScale=function(X){return Math.pow(2,X)},Aa.prototype.scaleZoom=function(X){return Math.log(X)/Math.LN2},Aa.prototype.project=function(X){var R=e.clamp(X.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(X.lng)*this.worldSize,e.mercatorYfromLat(R)*this.worldSize)},Aa.prototype.unproject=function(X){return new e.MercatorCoordinate(X.x/this.worldSize,X.y/this.worldSize).toLngLat()},Ua.point.get=function(){return this.project(this.center)},Aa.prototype.setLocationAtPoint=function(X,R){var i=this.pointCoordinate(R),a=this.pointCoordinate(this.centerPoint),C=this.locationCoordinate(X),F=new e.MercatorCoordinate(C.x-(i.x-a.x),C.y-(i.y-a.y));this.center=this.coordinateLocation(F),this._renderWorldCopies&&(this.center=this.center.wrap())},Aa.prototype.locationPoint=function(X){return this.coordinatePoint(this.locationCoordinate(X))},Aa.prototype.pointLocation=function(X){return this.coordinateLocation(this.pointCoordinate(X))},Aa.prototype.locationCoordinate=function(X){return e.MercatorCoordinate.fromLngLat(X)},Aa.prototype.coordinateLocation=function(X){return X.toLngLat()},Aa.prototype.pointCoordinate=function(X){var R=[X.x,X.y,0,1],i=[X.x,X.y,1,1];e.transformMat4(R,R,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=R[3],C=i[3],F=R[0]/a,q=i[0]/C,te=R[1]/a,ue=i[1]/C,ve=R[2]/a,Ae=i[2]/C,Re=ve===Ae?0:(0-ve)/(Ae-ve);return new e.MercatorCoordinate(e.number(F,q,Re)/this.worldSize,e.number(te,ue,Re)/this.worldSize)},Aa.prototype.coordinatePoint=function(X){var R=[X.x*this.worldSize,X.y*this.worldSize,0,1];return e.transformMat4(R,R,this.pixelMatrix),new e.Point(R[0]/R[3],R[1]/R[3])},Aa.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)))},Aa.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Aa.prototype.setMaxBounds=function(X){X?(this.lngRange=[X.getWest(),X.getEast()],this.latRange=[X.getSouth(),X.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Aa.prototype.calculatePosMatrix=function(X,R){R===void 0&&(R=!1);var i=X.key,a=R?this._alignedPosMatrixCache:this._posMatrixCache;if(a[i])return a[i];var C=X.canonical,F=this.worldSize/this.zoomScale(C.z),q=C.x+Math.pow(2,C.z)*X.wrap,te=e.identity(new Float64Array(16));return e.translate(te,te,[q*F,C.y*F,0]),e.scale(te,te,[F/e.EXTENT,F/e.EXTENT,1]),e.multiply(te,R?this.alignedProjMatrix:this.projMatrix,te),a[i]=new Float32Array(te),a[i]},Aa.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Aa.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var X,R,i,a,C=-90,F=90,q=-180,te=180,ue=this.size,ve=this._unmodified;if(this.latRange){var Ae=this.latRange;C=e.mercatorYfromLat(Ae[1])*this.worldSize,X=(F=e.mercatorYfromLat(Ae[0])*this.worldSize)-CF&&(a=F-dt)}if(this.lngRange){var bt=Ue.x,Ct=ue.x/2;bt-Ctte&&(i=te-Ct)}i===void 0&&a===void 0||(this.center=this.unproject(new e.Point(i!==void 0?i:Ue.x,a!==void 0?a:Ue.y))),this._unmodified=ve,this._constraining=!1}},Aa.prototype._calcMatrices=function(){if(this.height){var X=this._fov/2,R=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(X)*this.height;var i=Math.PI/2+this._pitch,a=this._fov*(.5+R.y/this.height),C=Math.sin(a)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-i-a,.01,Math.PI-.01)),F=this.point,q=F.x,te=F.y,ue=1.01*(Math.cos(Math.PI/2-this._pitch)*C+this.cameraToCenterDistance),ve=this.height/50,Ae=new Float64Array(16);e.perspective(Ae,this._fov,this.width/this.height,ve,ue),Ae[8]=2*-R.x/this.width,Ae[9]=2*R.y/this.height,e.scale(Ae,Ae,[1,-1,1]),e.translate(Ae,Ae,[0,0,-this.cameraToCenterDistance]),e.rotateX(Ae,Ae,this._pitch),e.rotateZ(Ae,Ae,this.angle),e.translate(Ae,Ae,[-q,-te,0]),this.mercatorMatrix=e.scale([],Ae,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Ae,Ae,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Ae,this.invProjMatrix=e.invert([],this.projMatrix);var Re=this.width%2/2,Ue=this.height%2/2,it=Math.cos(this.angle),ct=Math.sin(this.angle),dt=q-Math.round(q)+it*Re+ct*Ue,bt=te-Math.round(te)+it*Ue+ct*Re,Ct=new Float64Array(Ae);if(e.translate(Ct,Ct,[dt>.5?dt-1:dt,bt>.5?bt-1:bt,0]),this.alignedProjMatrix=Ct,Ae=e.create(),e.scale(Ae,Ae,[this.width/2,-this.height/2,1]),e.translate(Ae,Ae,[1,-1,0]),this.labelPlaneMatrix=Ae,Ae=e.create(),e.scale(Ae,Ae,[1,-1,1]),e.translate(Ae,Ae,[-1,-1,0]),e.scale(Ae,Ae,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ae,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(Ae=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ae,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Aa.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var X=this.pointCoordinate(new e.Point(0,0)),R=[X.x*this.worldSize,X.y*this.worldSize,0,1];return e.transformMat4(R,R,this.pixelMatrix)[3]/this.cameraToCenterDistance},Aa.prototype.getCameraPoint=function(){var X=this._pitch,R=Math.tan(X)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,R))},Aa.prototype.getCameraQueryGeometry=function(X){var R=this.getCameraPoint();if(X.length===1)return[X[0],R];for(var i=R.x,a=R.y,C=R.x,F=R.y,q=0,te=X;q=3&&!X.some(function(i){return isNaN(i)})){var R=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(X[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+X[2],+X[1]],zoom:+X[0],bearing:R,pitch:+(X[4]||0)}),!0}return!1},wl.prototype._updateHashUnthrottled=function(){var X=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,X)}catch{}};var ic={linearity:.3,easing:e.bezier(0,0,.3,1)},nu=e.extend({deceleration:2500,maxSpeed:1400},ic),Bs=e.extend({deceleration:20,maxSpeed:1400},ic),Gl=e.extend({deceleration:1e3,maxSpeed:360},ic),us=e.extend({deceleration:1e3,maxSpeed:90},ic),No=function(X){this._map=X,this.clear()};function Wl(X,R){(!X.duration||X.duration0&&R-X[0].time>160;)X.shift()},No.prototype._onMoveEnd=function(X){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},i=0,a=this._inertiaBuffer;i=this._clickTolerance||this._map.fire(new Xo(X.type,this._map,X))},ka.prototype.dblclick=function(X){return this._firePreventable(new Xo(X.type,this._map,X))},ka.prototype.mouseover=function(X){this._map.fire(new Xo(X.type,this._map,X))},ka.prototype.mouseout=function(X){this._map.fire(new Xo(X.type,this._map,X))},ka.prototype.touchstart=function(X){return this._firePreventable(new Xa(X.type,this._map,X))},ka.prototype.touchmove=function(X){this._map.fire(new Xa(X.type,this._map,X))},ka.prototype.touchend=function(X){this._map.fire(new Xa(X.type,this._map,X))},ka.prototype.touchcancel=function(X){this._map.fire(new Xa(X.type,this._map,X))},ka.prototype._firePreventable=function(X){if(this._map.fire(X),X.defaultPrevented)return{}},ka.prototype.isEnabled=function(){return!0},ka.prototype.isActive=function(){return!1},ka.prototype.enable=function(){},ka.prototype.disable=function(){};var Ao=function(X){this._map=X};Ao.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ao.prototype.mousemove=function(X){this._map.fire(new Xo(X.type,this._map,X))},Ao.prototype.mousedown=function(){this._delayContextMenu=!0},Ao.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Xo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ao.prototype.contextmenu=function(X){this._delayContextMenu?this._contextMenuEvent=X:this._map.fire(new Xo(X.type,this._map,X)),this._map.listens("contextmenu")&&X.preventDefault()},Ao.prototype.isEnabled=function(){return!0},Ao.prototype.isActive=function(){return!1},Ao.prototype.enable=function(){},Ao.prototype.disable=function(){};var Va=function(X,R){this._map=X,this._el=X.getCanvasContainer(),this._container=X.getContainer(),this._clickTolerance=R.clickTolerance||1};function Ko(X,R){for(var i={},a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=X.timeStamp),i.length===this.numTouches&&(this.centroid=function(a){for(var C=new e.Point(0,0),F=0,q=a;F30)&&(this.aborted=!0)}}},cs.prototype.touchend=function(X,R,i){if((!this.centroid||X.timeStamp-this.startTime>500)&&(this.aborted=!0),i.length===0){var a=!this.aborted&&this.centroid;if(this.reset(),a)return a}};var rl=function(X){this.singleTap=new cs(X),this.numTaps=X.numTaps,this.reset()};rl.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},rl.prototype.touchstart=function(X,R,i){this.singleTap.touchstart(X,R,i)},rl.prototype.touchmove=function(X,R,i){this.singleTap.touchmove(X,R,i)},rl.prototype.touchend=function(X,R,i){var a=this.singleTap.touchend(X,R,i);if(a){var C=X.timeStamp-this.lastTime<500,F=!this.lastTap||this.lastTap.dist(a)<30;if(C&&F||this.reset(),this.count++,this.lastTime=X.timeStamp,this.lastTap=a,this.count===this.numTaps)return this.reset(),a}};var xs=function(){this._zoomIn=new rl({numTouches:1,numTaps:2}),this._zoomOut=new rl({numTouches:2,numTaps:1}),this.reset()};xs.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},xs.prototype.touchstart=function(X,R,i){this._zoomIn.touchstart(X,R,i),this._zoomOut.touchstart(X,R,i)},xs.prototype.touchmove=function(X,R,i){this._zoomIn.touchmove(X,R,i),this._zoomOut.touchmove(X,R,i)},xs.prototype.touchend=function(X,R,i){var a=this,C=this._zoomIn.touchend(X,R,i),F=this._zoomOut.touchend(X,R,i);return C?(this._active=!0,X.preventDefault(),setTimeout(function(){return a.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()+1,around:q.unproject(C)},{originalEvent:X})}}):F?(this._active=!0,X.preventDefault(),setTimeout(function(){return a.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()-1,around:q.unproject(F)},{originalEvent:X})}}):void 0},xs.prototype.touchcancel=function(){this.reset()},xs.prototype.enable=function(){this._enabled=!0},xs.prototype.disable=function(){this._enabled=!1,this.reset()},xs.prototype.isEnabled=function(){return this._enabled},xs.prototype.isActive=function(){return this._active};var Zl={};Zl[0]=1,Zl[2]=2;var _s=function(X){this.reset(),this._clickTolerance=X.clickTolerance||1};_s.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},_s.prototype._correctButton=function(X,R){return!1},_s.prototype._move=function(X,R){return{}},_s.prototype.mousedown=function(X,R){if(!this._lastPoint){var i=y.mouseButton(X);this._correctButton(X,i)&&(this._lastPoint=R,this._eventButton=i)}},_s.prototype.mousemoveWindow=function(X,R){var i=this._lastPoint;if(i){if(X.preventDefault(),function(a,C){var F=Zl[C];return a.buttons===void 0||(a.buttons&F)!==F}(X,this._eventButton))this.reset();else if(this._moved||!(R.dist(i)0&&(this._active=!0);var a=Ko(i,R),C=new e.Point(0,0),F=new e.Point(0,0),q=0;for(var te in a){var ue=a[te],ve=this._touches[te];ve&&(C._add(ue),F._add(ue.sub(ve)),q++,a[te]=ue)}if(this._touches=a,!(qMath.abs(X.x)}var Sl=function(X){function R(){X.apply(this,arguments)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.reset=function(){X.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},R.prototype._start=function(i){this._lastPoints=i,il(i[0].sub(i[1]))&&(this._valid=!1)},R.prototype._move=function(i,a,C){var F=i[0].sub(this._lastPoints[0]),q=i[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(F,q,C.timeStamp),this._valid)return this._lastPoints=i,this._active=!0,{pitchDelta:(F.y+q.y)/2*-.5}},R.prototype.gestureBeginsVertically=function(i,a,C){if(this._valid!==void 0)return this._valid;var F=i.mag()>=2,q=a.mag()>=2;if(F||q){if(!F||!q)return this._firstMove===void 0&&(this._firstMove=C),C-this._firstMove<100&&void 0;var te=i.y>0==a.y>0;return il(i)&&il(a)&&te}},R}(ua),Ml={panStep:100,bearingStep:15,pitchStep:10},li=function(){var X=Ml;this._panStep=X.panStep,this._bearingStep=X.bearingStep,this._pitchStep=X.pitchStep,this._rotationDisabled=!1};function hs(X){return X*(2-X)}li.prototype.reset=function(){this._active=!1},li.prototype.keydown=function(X){var R=this;if(!(X.altKey||X.ctrlKey||X.metaKey)){var i=0,a=0,C=0,F=0,q=0;switch(X.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:X.shiftKey?a=-1:(X.preventDefault(),F=-1);break;case 39:X.shiftKey?a=1:(X.preventDefault(),F=1);break;case 38:X.shiftKey?C=1:(X.preventDefault(),q=-1);break;case 40:X.shiftKey?C=-1:(X.preventDefault(),q=1);break;default:return}return this._rotationDisabled&&(a=0,C=0),{cameraAnimation:function(te){var ue=te.getZoom();te.easeTo({duration:300,easeId:"keyboardHandler",easing:hs,zoom:i?Math.round(ue)+i*(X.shiftKey?2:1):ue,bearing:te.getBearing()+a*R._bearingStep,pitch:te.getPitch()+C*R._pitchStep,offset:[-F*R._panStep,-q*R._panStep],center:te.getCenter()},{originalEvent:X})}}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active},li.prototype.disableRotation=function(){this._rotationDisabled=!0},li.prototype.enableRotation=function(){this._rotationDisabled=!1};var al=4.000244140625,Na=function(X,R){this._map=X,this._el=X.getCanvasContainer(),this._handler=R,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout"],this)};Na.prototype.setZoomRate=function(X){this._defaultZoomRate=X},Na.prototype.setWheelZoomRate=function(X){this._wheelZoomRate=X},Na.prototype.isEnabled=function(){return!!this._enabled},Na.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Na.prototype.isZooming=function(){return!!this._zooming},Na.prototype.enable=function(X){this.isEnabled()||(this._enabled=!0,this._aroundCenter=X&&X.around==="center")},Na.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Na.prototype.wheel=function(X){if(this.isEnabled()){var R=X.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*X.deltaY:X.deltaY,i=e.browser.now(),a=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,R!==0&&R%al==0?this._type="wheel":R!==0&&Math.abs(R)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=R,this._timeout=setTimeout(this._onTimeout,40,X)):this._type||(this._type=Math.abs(a*R)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,R+=this._lastValue)),X.shiftKey&&R&&(R/=4),this._type&&(this._lastWheelEvent=X,this._delta-=R,this._active||this._start(X)),X.preventDefault()}},Na.prototype._onTimeout=function(X){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(X)},Na.prototype._start=function(X){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var R=y.mousePos(this._el,X);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(R)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Na.prototype.renderFrame=function(){var X=this;if(this._frameId&&(this._frameId=null,this.isActive())){var R=this._map.transform;if(this._delta!==0){var i=this._type==="wheel"&&Math.abs(this._delta)>al?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&a!==0&&(a=1/a);var C=typeof this._targetZoom=="number"?R.zoomScale(this._targetZoom):R.scale;this._targetZoom=Math.min(R.maxZoom,Math.max(R.minZoom,R.scaleZoom(C*a))),this._type==="wheel"&&(this._startZoom=R.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var F,q=typeof this._targetZoom=="number"?this._targetZoom:R.zoom,te=this._startZoom,ue=this._easing,ve=!1;if(this._type==="wheel"&&te&&ue){var Ae=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Re=ue(Ae);F=e.number(te,q,Re),Ae<1?this._frameId||(this._frameId=!0):ve=!0}else F=q,ve=!0;return this._active=!0,ve&&(this._active=!1,this._finishTimeout=setTimeout(function(){X._zooming=!1,X._handler._triggerRenderFrame(),delete X._targetZoom,delete X._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ve,zoomDelta:F-R.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Na.prototype._smoothOutEasing=function(X){var R=e.ease;if(this._prevEase){var i=this._prevEase,a=(e.browser.now()-i.start)/i.duration,C=i.easing(a+.01)-i.easing(a),F=.27/Math.sqrt(C*C+1e-4)*.01,q=Math.sqrt(.0729-F*F);R=e.bezier(F,q,.25,1)}return this._prevEase={start:e.browser.now(),duration:X,easing:R},R},Na.prototype.reset=function(){this._active=!1};var Ns=function(X,R){this._clickZoom=X,this._tapZoom=R};Ns.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Ns.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Ns.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Ns.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var iu=function(){this.reset()};iu.prototype.reset=function(){this._active=!1},iu.prototype.dblclick=function(X,R){return X.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(X.shiftKey?-1:1),around:i.unproject(R)},{originalEvent:X})}}},iu.prototype.enable=function(){this._enabled=!0},iu.prototype.disable=function(){this._enabled=!1,this.reset()},iu.prototype.isEnabled=function(){return this._enabled},iu.prototype.isActive=function(){return this._active};var El=function(){this._tap=new rl({numTouches:1,numTaps:1}),this.reset()};El.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},El.prototype.touchstart=function(X,R,i){this._swipePoint||(this._tapTime&&X.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=R[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(X,R,i))},El.prototype.touchmove=function(X,R,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var a=R[0],C=a.y-this._swipePoint.y;return this._swipePoint=a,X.preventDefault(),this._active=!0,{zoomDelta:C/128}}}else this._tap.touchmove(X,R,i)},El.prototype.touchend=function(X,R,i){this._tapTime?this._swipePoint&&i.length===0&&this.reset():this._tap.touchend(X,R,i)&&(this._tapTime=X.timeStamp)},El.prototype.touchcancel=function(){this.reset()},El.prototype.enable=function(){this._enabled=!0},El.prototype.disable=function(){this._enabled=!1,this.reset()},El.prototype.isEnabled=function(){return this._enabled},El.prototype.isActive=function(){return this._active};var ks=function(X,R,i){this._el=X,this._mousePan=R,this._touchPan=i};ks.prototype.enable=function(X){this._inertiaOptions=X||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ks.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ks.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ks.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var au=function(X,R,i){this._pitchWithRotate=X.pitchWithRotate,this._mouseRotate=R,this._mousePitch=i};au.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},au.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},au.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},au.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var As=function(X,R,i,a){this._el=X,this._touchZoom=R,this._touchRotate=i,this._tapDragZoom=a,this._rotationDisabled=!1,this._enabled=!0};As.prototype.enable=function(X){this._touchZoom.enable(X),this._rotationDisabled||this._touchRotate.enable(X),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},As.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},As.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},As.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},As.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},As.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Jo=function(X){return X.zoom||X.drag||X.pitch||X.rotate},ol=function(X){function R(){X.apply(this,arguments)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R}(e.Event);function cn(X){return X.panDelta&&X.panDelta.mag()||X.zoomDelta||X.bearingDelta||X.pitchDelta}var ya=function(X,R){this._map=X,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new No(X),this._bearingSnap=R.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(R),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,C=this._listeners;aq?Math.min(2,tn):Math.max(.5,tn),Hn=Math.pow(Vn,1-vn),Xn=F.unproject(It.add(Qt.mult(vn*Hn)).mult(Mn));F.setLocationAtPoint(F.renderWorldCopies?Xn.wrap():Xn,dt)}C._fireMoveEvents(a)},function(vn){C._afterEase(a,vn)},i),this},R.prototype._prepareEase=function(i,a,C){C===void 0&&(C={}),this._moving=!0,a||C.moving||this.fire(new e.Event("movestart",i)),this._zooming&&!C.zooming&&this.fire(new e.Event("zoomstart",i)),this._rotating&&!C.rotating&&this.fire(new e.Event("rotatestart",i)),this._pitching&&!C.pitching&&this.fire(new e.Event("pitchstart",i))},R.prototype._fireMoveEvents=function(i){this.fire(new e.Event("move",i)),this._zooming&&this.fire(new e.Event("zoom",i)),this._rotating&&this.fire(new e.Event("rotate",i)),this._pitching&&this.fire(new e.Event("pitch",i))},R.prototype._afterEase=function(i,a){if(!this._easeId||!a||this._easeId!==a){delete this._easeId;var C=this._zooming,F=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,C&&this.fire(new e.Event("zoomend",i)),F&&this.fire(new e.Event("rotateend",i)),q&&this.fire(new e.Event("pitchend",i)),this.fire(new e.Event("moveend",i))}},R.prototype.flyTo=function(i,a){var C=this;if(!i.essential&&e.browser.prefersReducedMotion){var F=e.pick(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(F,a)}this.stop(),i=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},i);var q=this.transform,te=this.getZoom(),ue=this.getBearing(),ve=this.getPitch(),Ae=this.getPadding(),Re="zoom"in i?e.clamp(+i.zoom,q.minZoom,q.maxZoom):te,Ue="bearing"in i?this._normalizeBearing(i.bearing,ue):ue,it="pitch"in i?+i.pitch:ve,ct="padding"in i?i.padding:q.padding,dt=q.zoomScale(Re-te),bt=e.Point.convert(i.offset),Ct=q.centerPoint.add(bt),Mt=q.pointLocation(Ct),Vt=e.LngLat.convert(i.center||Mt);this._normalizeCenter(Vt);var It=q.project(Mt),Qt=q.project(Vt).sub(It),tn=i.curve,Yt=Math.max(q.width,q.height),vn=Yt/dt,Mn=Qt.mag();if("minZoom"in i){var Vn=e.clamp(Math.min(i.minZoom,te,Re),q.minZoom,q.maxZoom),Hn=Yt/q.zoomScale(Vn-te);tn=Math.sqrt(Hn/Mn*2)}var Xn=tn*tn;function rr(Nr){var si=(vn*vn-Yt*Yt+(Nr?-1:1)*Xn*Xn*Mn*Mn)/(2*(Nr?vn:Yt)*Xn*Mn);return Math.log(Math.sqrt(si*si+1)-si)}function Mr(Nr){return(Math.exp(Nr)-Math.exp(-Nr))/2}function nr(Nr){return(Math.exp(Nr)+Math.exp(-Nr))/2}var Lr=rr(0),dr=function(Nr){return nr(Lr)/nr(Lr+tn*Nr)},Br=function(Nr){return Yt*((nr(Lr)*(Mr(si=Lr+tn*Nr)/nr(si))-Mr(Lr))/Xn)/Mn;var si},Sr=(rr(1)-Lr)/tn;if(Math.abs(Mn)<1e-6||!isFinite(Sr)){if(Math.abs(Yt-vn)<1e-6)return this.easeTo(i,a);var Vr=vni.maxDuration&&(i.duration=0),this._zooming=!0,this._rotating=ue!==Ue,this._pitching=it!==ve,this._padding=!q.isPaddingEqual(ct),this._prepareEase(a,!1),this._ease(function(Nr){var si=Nr*Sr,_i=1/dr(si);q.zoom=Nr===1?Re:te+q.scaleZoom(_i),C._rotating&&(q.bearing=e.number(ue,Ue,Nr)),C._pitching&&(q.pitch=e.number(ve,it,Nr)),C._padding&&(q.interpolatePadding(Ae,ct,Nr),Ct=q.centerPoint.add(bt));var Gi=Nr===1?Vt:q.unproject(It.add(Qt.mult(Br(si))).mult(_i));q.setLocationAtPoint(q.renderWorldCopies?Gi.wrap():Gi,Ct),C._fireMoveEvents(a)},function(){return C._afterEase(a)},i),this},R.prototype.isEasing=function(){return!!this._easeFrameId},R.prototype.stop=function(){return this._stop()},R.prototype._stop=function(i,a){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var C=this._onEaseEnd;delete this._onEaseEnd,C.call(this,a)}if(!i){var F=this.handlers;F&&F.stop(!1)}return this},R.prototype._ease=function(i,a,C){C.animate===!1||C.duration===0?(i(1),a()):(this._easeStart=e.browser.now(),this._easeOptions=C,this._onEaseFrame=i,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},R.prototype._renderFrameCallback=function(){var i=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(i)),i<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},R.prototype._normalizeBearing=function(i,a){i=e.wrap(i,-180,180);var C=Math.abs(i-a);return Math.abs(i-360-a)180?-360:C<-180?360:0}},R}(e.Evented),io=function(X){X===void 0&&(X={}),this.options=X,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};io.prototype.getDefaultPosition=function(){return"bottom-right"},io.prototype.onAdd=function(X){var R=this.options&&this.options.compact;return this._map=X,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=y.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=y.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),R&&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),R===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},io.prototype.onRemove=function(){y.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},io.prototype._setElementTitle=function(X,R){var i=this._map._getUIString("AttributionControl."+R);X.title=i,X.setAttribute("aria-label",i)},io.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"))},io.prototype._updateEditLink=function(){var X=this._editLink;X||(X=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(X){var i=R.reduce(function(a,C,F){return C.value&&(a+=C.key+"="+C.value+(F=0)return!1;return!0})).join(" | ");q!==this._attribHTML&&(this._attribHTML=q,X.length?(this._innerContainer.innerHTML=q,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},io.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ta=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ta.prototype.onAdd=function(X){this._map=X,this._container=y.create("div","mapboxgl-ctrl");var R=y.create("a","mapboxgl-ctrl-logo");return R.target="_blank",R.rel="noopener nofollow",R.href="https://www.mapbox.com/",R.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),R.setAttribute("rel","noopener nofollow"),this._container.appendChild(R),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ta.prototype.onRemove=function(){y.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ta.prototype.getDefaultPosition=function(){return"bottom-left"},ta.prototype._updateLogo=function(X){X&&X.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},ta.prototype._logoRequired=function(){if(this._map.style){var X=this._map.style.sourceCaches;for(var R in X)if(X[R].getSource().mapbox_logo)return!0;return!1}},ta.prototype._updateCompact=function(){var X=this._container.children;if(X.length){var R=X[0];this._map.getCanvasContainer().offsetWidth<250?R.classList.add("mapboxgl-compact"):R.classList.remove("mapboxgl-compact")}};var Qo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Qo.prototype.add=function(X){var R=++this._id;return this._queue.push({callback:X,id:R,cancelled:!1}),R},Qo.prototype.remove=function(X){for(var R=this._currentlyRunning,i=0,a=R?this._queue.concat(R):this._queue;ia.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>xu)throw new Error("maxPitch must be less than or equal to 60");var F=new Aa(a.minZoom,a.maxZoom,a.minPitch,a.maxPitch,a.renderWorldCopies);if(X.call(this,F,a),this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._failIfMajorPerformanceCaveat=a.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=a.preserveDrawingBuffer,this._antialias=a.antialias,this._trackResize=a.trackResize,this._bearingSnap=a.bearingSnap,this._refreshExpiredTiles=a.refreshExpiredTiles,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=a.collectResourceTiming,this._renderTaskQueue=new Qo,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},ac,a.locale),this._clickTolerance=a.clickTolerance,this._requestManager=new e.RequestManager(a.transformRequest,a.accessToken),typeof a.container=="string"){if(this._container=e.window.document.getElementById(a.container),!this._container)throw new Error("Container '"+a.container+"' not found.")}else{if(!(a.container instanceof Io))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=a.container}if(a.maxBounds&&this.setMaxBounds(a.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return C._update(!1)}),this.on("moveend",function(){return C._update(!1)}),this.on("zoom",function(){return C._update(!0)}),e.window!==void 0&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new ya(this,a);var q=typeof a.hash=="string"&&a.hash||void 0;this._hash=a.hash&&new wl(q).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:a.center,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,e.extend({},a.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=a.localIdeographFontFamily,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new io({customAttribution:a.customAttribution})),this.addControl(new ta,a.logoPosition),this.on("style.load",function(){C.transform.unmodified&&C.jumpTo(C.style.stylesheet)}),this.on("data",function(te){C._update(te.dataType==="style"),C.fire(new e.Event(te.dataType+"data",te))}),this.on("dataloading",function(te){C.fire(new e.Event(te.dataType+"dataloading",te))})}X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return R.prototype._getMapId=function(){return this._mapId},R.prototype.addControl=function(a,C){if(C===void 0&&(C=a.getDefaultPosition?a.getDefaultPosition():"top-right"),!a||!a.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 F=a.onAdd(this);this._controls.push(a);var q=this._controlPositions[C];return C.indexOf("bottom")!==-1?q.insertBefore(F,q.firstChild):q.appendChild(F),this},R.prototype.removeControl=function(a){if(!a||!a.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 C=this._controls.indexOf(a);return C>-1&&this._controls.splice(C,1),a.onRemove(this),this},R.prototype.hasControl=function(a){return this._controls.indexOf(a)>-1},R.prototype.resize=function(a){var C=this._containerDimensions(),F=C[0],q=C[1];this._resizeCanvas(F,q),this.transform.resize(F,q),this.painter.resize(F,q);var te=!this._moving;return te&&(this.stop(),this.fire(new e.Event("movestart",a)).fire(new e.Event("move",a))),this.fire(new e.Event("resize",a)),te&&this.fire(new e.Event("moveend",a)),this},R.prototype.getBounds=function(){return this.transform.getBounds()},R.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},R.prototype.setMaxBounds=function(a){return this.transform.setMaxBounds(e.LngLatBounds.convert(a)),this._update()},R.prototype.setMinZoom=function(a){if((a=a??-2)>=-2&&a<=this.transform.maxZoom)return this.transform.minZoom=a,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=a,this._update(),this.getZoom()>a&&this.setZoom(a),this;throw new Error("maxZoom must be greater than the current minZoom")},R.prototype.getMaxZoom=function(){return this.transform.maxZoom},R.prototype.setMinPitch=function(a){if((a=a??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(a>=0&&a<=this.transform.maxPitch)return this.transform.minPitch=a,this._update(),this.getPitch()xu)throw new Error("maxPitch must be less than or equal to 60");if(a>=this.transform.minPitch)return this.transform.maxPitch=a,this._update(),this.getPitch()>a&&this.setPitch(a),this;throw new Error("maxPitch must be greater than the current minPitch")},R.prototype.getMaxPitch=function(){return this.transform.maxPitch},R.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},R.prototype.setRenderWorldCopies=function(a){return this.transform.renderWorldCopies=a,this._update()},R.prototype.project=function(a){return this.transform.locationPoint(e.LngLat.convert(a))},R.prototype.unproject=function(a){return this.transform.pointLocation(e.Point.convert(a))},R.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},R.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},R.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},R.prototype._createDelegatedListener=function(a,C,F){var q,te=this;if(a==="mouseenter"||a==="mouseover"){var ue=!1;return{layer:C,listener:F,delegates:{mousemove:function(Ae){var Re=te.getLayer(C)?te.queryRenderedFeatures(Ae.point,{layers:[C]}):[];Re.length?ue||(ue=!0,F.call(te,new Xo(a,te,Ae.originalEvent,{features:Re}))):ue=!1},mouseout:function(){ue=!1}}}}if(a==="mouseleave"||a==="mouseout"){var ve=!1;return{layer:C,listener:F,delegates:{mousemove:function(Ae){(te.getLayer(C)?te.queryRenderedFeatures(Ae.point,{layers:[C]}):[]).length?ve=!0:ve&&(ve=!1,F.call(te,new Xo(a,te,Ae.originalEvent)))},mouseout:function(Ae){ve&&(ve=!1,F.call(te,new Xo(a,te,Ae.originalEvent)))}}}}return{layer:C,listener:F,delegates:(q={},q[a]=function(Ae){var Re=te.getLayer(C)?te.queryRenderedFeatures(Ae.point,{layers:[C]}):[];Re.length&&(Ae.features=Re,F.call(te,Ae),delete Ae.features)},q)}},R.prototype.on=function(a,C,F){if(F===void 0)return X.prototype.on.call(this,a,C);var q=this._createDelegatedListener(a,C,F);for(var te in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[a]=this._delegatedListeners[a]||[],this._delegatedListeners[a].push(q),q.delegates)this.on(te,q.delegates[te]);return this},R.prototype.once=function(a,C,F){if(F===void 0)return X.prototype.once.call(this,a,C);var q=this._createDelegatedListener(a,C,F);for(var te in q.delegates)this.once(te,q.delegates[te]);return this},R.prototype.off=function(a,C,F){var q=this;return F===void 0?X.prototype.off.call(this,a,C):(this._delegatedListeners&&this._delegatedListeners[a]&&function(te){for(var ue=te[a],ve=0;ve180;){var q=i.locationPoint(X);if(q.x>=0&&q.y>=0&&q.x<=i.width&&q.y<=i.height)break;X.lng>i.center.lng?X.lng-=360:X.lng+=360}return X}eo.prototype.down=function(X,R){this.mouseRotate.mousedown(X,R),this.mousePitch&&this.mousePitch.mousedown(X,R),y.disableDrag()},eo.prototype.move=function(X,R){var i=this.map,a=this.mouseRotate.mousemoveWindow(X,R);if(a&&a.bearingDelta&&i.setBearing(i.getBearing()+a.bearingDelta),this.mousePitch){var C=this.mousePitch.mousemoveWindow(X,R);C&&C.pitchDelta&&i.setPitch(i.getPitch()+C.pitchDelta)}},eo.prototype.off=function(){var X=this.element;y.removeEventListener(X,"mousedown",this.mousedown),y.removeEventListener(X,"touchstart",this.touchstart,{passive:!1}),y.removeEventListener(X,"touchmove",this.touchmove),y.removeEventListener(X,"touchend",this.touchend),y.removeEventListener(X,"touchcancel",this.reset),this.offTemp()},eo.prototype.offTemp=function(){y.enableDrag(),y.removeEventListener(e.window,"mousemove",this.mousemove),y.removeEventListener(e.window,"mouseup",this.mouseup)},eo.prototype.mousedown=function(X){this.down(e.extend({},X,{ctrlKey:!0,preventDefault:function(){return X.preventDefault()}}),y.mousePos(this.element,X)),y.addEventListener(e.window,"mousemove",this.mousemove),y.addEventListener(e.window,"mouseup",this.mouseup)},eo.prototype.mousemove=function(X){this.move(X,y.mousePos(this.element,X))},eo.prototype.mouseup=function(X){this.mouseRotate.mouseupWindow(X),this.mousePitch&&this.mousePitch.mouseupWindow(X),this.offTemp()},eo.prototype.touchstart=function(X){X.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=y.touchPos(this.element,X.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return X.preventDefault()}},this._startPos))},eo.prototype.touchmove=function(X){X.targetTouches.length!==1?this.reset():(this._lastPos=y.touchPos(this.element,X.targetTouches)[0],this.move({preventDefault:function(){return X.preventDefault()}},this._lastPos))},eo.prototype.touchend=function(X){X.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=a}this._isDragging&&(this._pos=i.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},R.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},R.prototype._addDragHandler=function(i){this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(this._pos).add(this._offset),this._pointerdownPos=i.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))},R.prototype.setDraggable=function(i){return this._draggable=!!i,this._map&&(i?(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},R.prototype.isDraggable=function(){return this._draggable},R.prototype.setRotation=function(i){return this._rotation=i||0,this._update(),this},R.prototype.getRotation=function(){return this._rotation},R.prototype.setRotationAlignment=function(i){return this._rotationAlignment=i||"auto",this._update(),this},R.prototype.getRotationAlignment=function(){return this._rotationAlignment},R.prototype.setPitchAlignment=function(i){return this._pitchAlignment=i&&i!=="auto"?i:this._rotationAlignment,this._update(),this},R.prototype.getPitchAlignment=function(){return this._pitchAlignment},R}(e.Evented),su={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ho=0,_u=!1,da=function(X){function R(i){X.call(this),this.options=e.extend({},su,i),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.onAdd=function(i){return this._map=i,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),a=this._setupUI,Mo!==void 0?a(Mo):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(C){Mo=C.state!=="denied",a(Mo)}):(Mo=!!e.window.navigator.geolocation,a(Mo)),this._container;var a},R.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(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(),y.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ho=0,_u=!1},R.prototype._isOutOfMapMaxBounds=function(i){var a=this._map.getMaxBounds(),C=i.coords;return a&&(C.longitudea.getEast()||C.latitudea.getNorth())},R.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")}},R.prototype._onSuccess=function(i){if(this._map){if(this._isOutOfMapMaxBounds(i))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",i)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=i,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&&this._watchState!=="OFF"&&this._updateMarker(i),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(i),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",i)),this._finish()}},R.prototype._updateCamera=function(i){var a=new e.LngLat(i.coords.longitude,i.coords.latitude),C=i.coords.accuracy,F=this._map.getBearing(),q=e.extend({bearing:F},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(C),q,{geolocateSource:!0})},R.prototype._updateMarker=function(i){if(i){var a=new e.LngLat(i.coords.longitude,i.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=i.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},R.prototype._updateCircleRadius=function(){var i=this._map._container.clientHeight/2,a=this._map.unproject([0,i]),C=this._map.unproject([1,i]),F=a.distanceTo(C),q=Math.ceil(2*this._accuracy/F);this._circleElement.style.width=q+"px",this._circleElement.style.height=q+"px"},R.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},R.prototype._onError=function(i){if(this._map){if(this.options.trackUserLocation)if(i.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(i.code===3&&_u)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",i)),this._finish()}},R.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},R.prototype._setupUI=function(i){var a=this;if(this._container.addEventListener("contextmenu",function(q){return q.preventDefault()}),this._geolocateButton=y.create("button","mapboxgl-ctrl-geolocate",this._container),y.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",i===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var C=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}else{var F=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=y.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Il(this._dotElement),this._circleElement=y.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Il({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(q){var te=q.originalEvent&&q.originalEvent.type==="resize";q.geolocateSource||a._watchState!=="ACTIVE_LOCK"||te||(a._watchState="BACKGROUND",a._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),a._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),a.fire(new e.Event("trackuserlocationend")))})},R.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":ho--,_u=!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(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var i;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ho>1?(i={maximumAge:6e5,timeout:0},_u=!0):(i=this.options.positionOptions,_u=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,i)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},R.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)},R}(e.Evented),Ys={maxWidth:100,unit:"metric"},Ai=function(X){this.options=e.extend({},Ys,X),e.bindAll(["_onMove","setUnit"],this)};function xi(X,R,i){var a=i&&i.maxWidth||100,C=X._container.clientHeight/2,F=X.unproject([0,C]),q=X.unproject([a,C]),te=F.distanceTo(q);if(i&&i.unit==="imperial"){var ue=3.2808*te;ue>5280?xa(R,a,ue/5280,X._getUIString("ScaleControl.Miles")):xa(R,a,ue,X._getUIString("ScaleControl.Feet"))}else i&&i.unit==="nautical"?xa(R,a,te/1852,X._getUIString("ScaleControl.NauticalMiles")):te>=1e3?xa(R,a,te/1e3,X._getUIString("ScaleControl.Kilometers")):xa(R,a,te,X._getUIString("ScaleControl.Meters"))}function xa(X,R,i,a){var C,F,q,te=(C=i,(F=Math.pow(10,(""+Math.floor(C)).length-1))*((q=C/F)>=10?10:q>=5?5:q>=3?3:q>=2?2:q>=1?1:function(ve){var Ae=Math.pow(10,Math.ceil(-Math.log(ve)/Math.LN10));return Math.round(ve*Ae)/Ae}(q))),ue=te/i;X.style.width=R*ue+"px",X.innerHTML=te+" "+a}Ai.prototype.getDefaultPosition=function(){return"bottom-left"},Ai.prototype._onMove=function(){xi(this._map,this._container,this.options)},Ai.prototype.onAdd=function(X){return this._map=X,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",X.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ai.prototype.onRemove=function(){y.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ai.prototype.setUnit=function(X){this.options.unit=X,xi(this._map,this._container,this.options)};var es=function(X){this._fullscreen=!1,X&&X.container&&(X.container instanceof e.window.HTMLElement?this._container=X.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")};es.prototype.onAdd=function(X){return this._map=X,this._container||(this._container=this._map.getContainer()),this._controlContainer=y.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},es.prototype.onRemove=function(){y.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},es.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},es.prototype._setupUI=function(){var X=this._fullscreenButton=y.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);y.create("span","mapboxgl-ctrl-icon",X).setAttribute("aria-hidden",!0),X.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},es.prototype._updateTitle=function(){var X=this._getTitle();this._fullscreenButton.setAttribute("aria-label",X),this._fullscreenButton.title=X},es.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},es.prototype._isFullscreen=function(){return this._fullscreen},es.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())},es.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 bu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},js=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),xt=function(X){function R(i){X.call(this),this.options=e.extend(Object.create(bu),i),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.addTo=function(i){return this._map&&this.remove(),this._map=i,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},R.prototype.isOpen=function(){return!!this._map},R.prototype.remove=function(){return this._content&&y.remove(this._content),this._container&&(y.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},R.prototype.getLngLat=function(){return this._lngLat},R.prototype.setLngLat=function(i){return this._lngLat=e.LngLat.convert(i),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},R.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},R.prototype.getElement=function(){return this._container},R.prototype.setText=function(i){return this.setDOMContent(e.window.document.createTextNode(i))},R.prototype.setHTML=function(i){var a,C=e.window.document.createDocumentFragment(),F=e.window.document.createElement("body");for(F.innerHTML=i;a=F.firstChild;)C.appendChild(a);return this.setDOMContent(C)},R.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},R.prototype.setMaxWidth=function(i){return this.options.maxWidth=i,this._update(),this},R.prototype.setDOMContent=function(i){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=y.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(i),this._createCloseButton(),this._update(),this._focusFirstElement(),this},R.prototype.addClassName=function(i){this._container&&this._container.classList.add(i)},R.prototype.removeClassName=function(i){this._container&&this._container.classList.remove(i)},R.prototype.setOffset=function(i){return this.options.offset=i,this._update(),this},R.prototype.toggleClassName=function(i){if(this._container)return this._container.classList.toggle(i)},R.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=y.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))},R.prototype._onMouseUp=function(i){this._update(i.point)},R.prototype._onMouseMove=function(i){this._update(i.point)},R.prototype._onDrag=function(i){this._update(i.point)},R.prototype._update=function(i){var a=this,C=this._lngLat||this._trackPointer;if(this._map&&C&&this._content&&(this._container||(this._container=y.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=y.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Ue){return a._container.classList.add(Ue)}),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=Cl(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||i)){var F=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat),q=this.options.anchor,te=kt(this.options.offset);if(!q){var ue,ve=this._container.offsetWidth,Ae=this._container.offsetHeight;ue=F.y+te.bottom.ythis._map.transform.height-Ae?["bottom"]:[],F.xthis._map.transform.width-ve/2&&ue.push("right"),q=ue.length===0?"bottom":ue.join("-")}var Re=F.add(te[q]).round();y.setTransform(this._container,di[q]+" translate("+Re.x+"px,"+Re.y+"px)"),Fi(this._container,q,"popup")}},R.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var i=this._container.querySelector(js);i&&i.focus()}},R.prototype._onClose=function(){this.remove()},R}(e.Evented);function kt(X){if(X){if(typeof X=="number"){var R=Math.round(Math.sqrt(.5*Math.pow(X,2)));return{center:new e.Point(0,0),top:new e.Point(0,X),"top-left":new e.Point(R,R),"top-right":new e.Point(-R,R),bottom:new e.Point(0,-X),"bottom-left":new e.Point(R,-R),"bottom-right":new e.Point(-R,-R),left:new e.Point(X,0),right:new e.Point(-X,0)}}if(X instanceof e.Point||Array.isArray(X)){var i=e.Point.convert(X);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.Point.convert(X.center||[0,0]),top:e.Point.convert(X.top||[0,0]),"top-left":e.Point.convert(X["top-left"]||[0,0]),"top-right":e.Point.convert(X["top-right"]||[0,0]),bottom:e.Point.convert(X.bottom||[0,0]),"bottom-left":e.Point.convert(X["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(X["bottom-right"]||[0,0]),left:e.Point.convert(X.left||[0,0]),right:e.Point.convert(X.right||[0,0])}}return kt(new e.Point(0,0))}var Dt={version:e.version,supported:w,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:$l,NavigationControl:ou,GeolocateControl:da,AttributionControl:io,ScaleControl:Ai,FullscreenControl:es,Popup:xt,Marker:Il,Style:Pr,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){Ft().acquire(rt)},clearPrewarmedResources:function(){var X=Et;X&&(X.isPreloaded()&&X.numActive()===1?(X.release(rt),Et=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(X){e.config.ACCESS_TOKEN=X},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(X){e.config.API_URL=X},get workerCount(){return et.workerCount},set workerCount(X){et.workerCount=X},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(X){e.config.MAX_PARALLEL_IMAGE_REQUESTS=X},clearStorage:function(X){e.clearTileCache(X)},workerUrl:""};return Dt}),b}()},27549:function(D,L,t){D.exports=t(55366)},55366:function(D,L,t){var b=t(31625),d=t(75144),e=t(5137),w=t(78112),y=t(6807),_=t(68650),u=t(83473),r=t(60201),n=t(10275),l=t(62914);function o(s,c){for(var h=c[0],x=c[1],m=1/(c[2]-h),g=1/(c[3]-x),k=new Array(s.length),A=0,v=s.length/2;A>>1;c.dtype||(c.dtype="array"),typeof c.dtype=="string"?m=new(n(c.dtype))(k):c.dtype&&(m=c.dtype,Array.isArray(m)&&(m.length=k));for(var A=0;Ah||Z>1073741824){for(var fe=0;feSe+Ce||oe>Ee+Ce||le=ye||Oe===We)){var Ie=v[Le];We===void 0&&(We=Ie.length);for(var Ve=Oe;Ve=K&&de<=se&&Me>=ae&&Me<=he&&me.push(Pe)}var ke=S[Le],He=ke[4*Oe+0],Fe=ke[4*Oe+1],qe=ke[4*Oe+2],$e=ke[4*Oe+3],Ye=function(Be,Ge){for(var tt=null,nt=0;tt===null;)if(tt=Be[4*Ge+nt],++nt>Be.length)return null;return tt}(ke,Oe+1),_e=.5*Ce,De=Le+1;be(Se,Ee,_e,De,He,Fe||qe||$e||Ye),be(Se,Ee+_e,_e,De,Fe,qe||$e||Ye),be(Se+_e,Ee,_e,De,qe,$e||Ye),be(Se+_e,Ee+_e,_e,De,$e,Ye)}}(0,0,1,0,0,1),me},m;function V(j,$,ee){for(var H=1,J=.5,Q=.5,Z=.5,K=0;Ke&&(e=L[y]),L[y]>16,te>>16],u_pixel_coord_lower:[65535&q,65535&te]}}Nl.prototype.draw=function(X,R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt){var bt,Ct=X.gl;if(!this.failedToCreate){for(var Mt in X.program.set(this.program),X.setDepthMode(i),X.setStencilMode(a),X.setColorMode(C),X.setCullFace(F),this.fixedUniforms)this.fixedUniforms[Mt].set(q[Mt]);it&&it.setUniforms(X,this.binderUniforms,Re,{zoom:Ue});for(var Ut=(bt={},bt[Ct.LINES]=2,bt[Ct.TRIANGLES]=3,bt[Ct.LINE_STRIP]=1,bt)[R],It=0,Qt=Ae.get();It0?1-1/(1.001-q):-q),u_contrast_factor:(F=C.paint.get("raster-contrast"),F>0?1/(1-F):1+F),u_spin_weights:ql(C.paint.get("raster-hue-rotate"))};var F,q};function ql(X){X*=Math.PI/180;var R=Math.sin(X),i=Math.cos(X);return[(2*i+1)/3,(-Math.sqrt(3)*R-i+1)/3,(Math.sqrt(3)*R-i+1)/3]}var Fs,qo=function(X,R,i,a,C,F,q,te,ue,ve){var Ae=C.transform;return{u_is_size_zoom_constant:+(X==="constant"||X==="source"),u_is_size_feature_constant:+(X==="constant"||X==="camera"),u_size_t:R?R.uSizeT:0,u_size:R?R.uSize:0,u_camera_to_center_distance:Ae.cameraToCenterDistance,u_pitch:Ae.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:Ae.width/Ae.height,u_fade_change:C.options.fadeDuration?C.symbolFadeChange:1,u_matrix:F,u_label_plane_matrix:q,u_coord_matrix:te,u_is_text:+ue,u_pitch_with_map:+a,u_texsize:ve,u_texture:0}},Bo=function(X,R,i,a,C,F,q,te,ue,ve,Ae){var Re=C.transform;return e.extend(qo(X,R,i,a,C,F,q,te,ue,ve),{u_gamma_scale:a?Math.cos(Re._pitch)*Re.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+Ae})},_a=function(X,R,i,a,C,F,q,te,ue,ve){return e.extend(Bo(X,R,i,a,C,F,q,te,!0,ue,!0),{u_texsize_icon:ve,u_texture_icon:1})},Vu=function(X,R,i){return{u_matrix:X,u_opacity:R,u_color:i}},Fc=function(X,R,i,a,C,F){return e.extend(function(q,te,ue,ve){var Ae=ue.imageManager.getPattern(q.from.toString()),Re=ue.imageManager.getPattern(q.to.toString()),Ue=ue.imageManager.getPixelSize(),it=Ue.width,ct=Ue.height,dt=Math.pow(2,ve.tileID.overscaledZ),bt=ve.tileSize*Math.pow(2,ue.transform.tileZoom)/dt,Ct=bt*(ve.tileID.canonical.x+ve.tileID.wrap*dt),Mt=bt*ve.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Ae.tl,u_pattern_br_a:Ae.br,u_pattern_tl_b:Re.tl,u_pattern_br_b:Re.br,u_texsize:[it,ct],u_mix:te.t,u_pattern_size_a:Ae.displaySize,u_pattern_size_b:Re.displaySize,u_scale_a:te.fromScale,u_scale_b:te.toScale,u_tile_units_to_pixels:1/xr(ve,1,ue.transform.tileZoom),u_pixel_coord_upper:[Ct>>16,Mt>>16],u_pixel_coord_lower:[65535&Ct,65535&Mt]}}(a,F,i,C),{u_matrix:X,u_opacity:R})},Hs={fillExtrusion:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_lightpos:new e.Uniform3f(X,R.u_lightpos),u_lightintensity:new e.Uniform1f(X,R.u_lightintensity),u_lightcolor:new e.Uniform3f(X,R.u_lightcolor),u_vertical_gradient:new e.Uniform1f(X,R.u_vertical_gradient),u_opacity:new e.Uniform1f(X,R.u_opacity)}},fillExtrusionPattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_lightpos:new e.Uniform3f(X,R.u_lightpos),u_lightintensity:new e.Uniform1f(X,R.u_lightintensity),u_lightcolor:new e.Uniform3f(X,R.u_lightcolor),u_vertical_gradient:new e.Uniform1f(X,R.u_vertical_gradient),u_height_factor:new e.Uniform1f(X,R.u_height_factor),u_image:new e.Uniform1i(X,R.u_image),u_texsize:new e.Uniform2f(X,R.u_texsize),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade),u_opacity:new e.Uniform1f(X,R.u_opacity)}},fill:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},fillPattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_image:new e.Uniform1i(X,R.u_image),u_texsize:new e.Uniform2f(X,R.u_texsize),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade)}},fillOutline:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_world:new e.Uniform2f(X,R.u_world)}},fillOutlinePattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_world:new e.Uniform2f(X,R.u_world),u_image:new e.Uniform1i(X,R.u_image),u_texsize:new e.Uniform2f(X,R.u_texsize),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade)}},circle:function(X,R){return{u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(X,R.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(X,R.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},collisionBox:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(X,R.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(X,R.u_extrude_scale),u_overscale_factor:new e.Uniform1f(X,R.u_overscale_factor)}},collisionCircle:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_inv_matrix:new e.UniformMatrix4f(X,R.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(X,R.u_viewport_size)}},debug:function(X,R){return{u_color:new e.UniformColor(X,R.u_color),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_overlay:new e.Uniform1i(X,R.u_overlay),u_overlay_scale:new e.Uniform1f(X,R.u_overlay_scale)}},clippingMask:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},heatmap:function(X,R){return{u_extrude_scale:new e.Uniform1f(X,R.u_extrude_scale),u_intensity:new e.Uniform1f(X,R.u_intensity),u_matrix:new e.UniformMatrix4f(X,R.u_matrix)}},heatmapTexture:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_world:new e.Uniform2f(X,R.u_world),u_image:new e.Uniform1i(X,R.u_image),u_color_ramp:new e.Uniform1i(X,R.u_color_ramp),u_opacity:new e.Uniform1f(X,R.u_opacity)}},hillshade:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_image:new e.Uniform1i(X,R.u_image),u_latrange:new e.Uniform2f(X,R.u_latrange),u_light:new e.Uniform2f(X,R.u_light),u_shadow:new e.UniformColor(X,R.u_shadow),u_highlight:new e.UniformColor(X,R.u_highlight),u_accent:new e.UniformColor(X,R.u_accent)}},hillshadePrepare:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_image:new e.Uniform1i(X,R.u_image),u_dimension:new e.Uniform2f(X,R.u_dimension),u_zoom:new e.Uniform1f(X,R.u_zoom),u_unpack:new e.Uniform4f(X,R.u_unpack)}},line:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels)}},lineGradient:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels),u_image:new e.Uniform1i(X,R.u_image),u_image_height:new e.Uniform1f(X,R.u_image_height)}},linePattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_texsize:new e.Uniform2f(X,R.u_texsize),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_image:new e.Uniform1i(X,R.u_image),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels),u_scale:new e.Uniform3f(X,R.u_scale),u_fade:new e.Uniform1f(X,R.u_fade)}},lineSDF:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_ratio:new e.Uniform1f(X,R.u_ratio),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(X,R.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(X,R.u_patternscale_a),u_patternscale_b:new e.Uniform2f(X,R.u_patternscale_b),u_sdfgamma:new e.Uniform1f(X,R.u_sdfgamma),u_image:new e.Uniform1i(X,R.u_image),u_tex_y_a:new e.Uniform1f(X,R.u_tex_y_a),u_tex_y_b:new e.Uniform1f(X,R.u_tex_y_b),u_mix:new e.Uniform1f(X,R.u_mix)}},raster:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_tl_parent:new e.Uniform2f(X,R.u_tl_parent),u_scale_parent:new e.Uniform1f(X,R.u_scale_parent),u_buffer_scale:new e.Uniform1f(X,R.u_buffer_scale),u_fade_t:new e.Uniform1f(X,R.u_fade_t),u_opacity:new e.Uniform1f(X,R.u_opacity),u_image0:new e.Uniform1i(X,R.u_image0),u_image1:new e.Uniform1i(X,R.u_image1),u_brightness_low:new e.Uniform1f(X,R.u_brightness_low),u_brightness_high:new e.Uniform1f(X,R.u_brightness_high),u_saturation_factor:new e.Uniform1f(X,R.u_saturation_factor),u_contrast_factor:new e.Uniform1f(X,R.u_contrast_factor),u_spin_weights:new e.Uniform3f(X,R.u_spin_weights)}},symbolIcon:function(X,R){return{u_is_size_zoom_constant:new e.Uniform1i(X,R.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(X,R.u_is_size_feature_constant),u_size_t:new e.Uniform1f(X,R.u_size_t),u_size:new e.Uniform1f(X,R.u_size),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pitch:new e.Uniform1f(X,R.u_pitch),u_rotate_symbol:new e.Uniform1i(X,R.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(X,R.u_aspect_ratio),u_fade_change:new e.Uniform1f(X,R.u_fade_change),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(X,R.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(X,R.u_coord_matrix),u_is_text:new e.Uniform1i(X,R.u_is_text),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_texsize:new e.Uniform2f(X,R.u_texsize),u_texture:new e.Uniform1i(X,R.u_texture)}},symbolSDF:function(X,R){return{u_is_size_zoom_constant:new e.Uniform1i(X,R.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(X,R.u_is_size_feature_constant),u_size_t:new e.Uniform1f(X,R.u_size_t),u_size:new e.Uniform1f(X,R.u_size),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pitch:new e.Uniform1f(X,R.u_pitch),u_rotate_symbol:new e.Uniform1i(X,R.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(X,R.u_aspect_ratio),u_fade_change:new e.Uniform1f(X,R.u_fade_change),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(X,R.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(X,R.u_coord_matrix),u_is_text:new e.Uniform1i(X,R.u_is_text),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_texsize:new e.Uniform2f(X,R.u_texsize),u_texture:new e.Uniform1i(X,R.u_texture),u_gamma_scale:new e.Uniform1f(X,R.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(X,R.u_is_halo)}},symbolTextAndIcon:function(X,R){return{u_is_size_zoom_constant:new e.Uniform1i(X,R.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(X,R.u_is_size_feature_constant),u_size_t:new e.Uniform1f(X,R.u_size_t),u_size:new e.Uniform1f(X,R.u_size),u_camera_to_center_distance:new e.Uniform1f(X,R.u_camera_to_center_distance),u_pitch:new e.Uniform1f(X,R.u_pitch),u_rotate_symbol:new e.Uniform1i(X,R.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(X,R.u_aspect_ratio),u_fade_change:new e.Uniform1f(X,R.u_fade_change),u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(X,R.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(X,R.u_coord_matrix),u_is_text:new e.Uniform1i(X,R.u_is_text),u_pitch_with_map:new e.Uniform1i(X,R.u_pitch_with_map),u_texsize:new e.Uniform2f(X,R.u_texsize),u_texsize_icon:new e.Uniform2f(X,R.u_texsize_icon),u_texture:new e.Uniform1i(X,R.u_texture),u_texture_icon:new e.Uniform1i(X,R.u_texture_icon),u_gamma_scale:new e.Uniform1f(X,R.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(X,R.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(X,R.u_is_halo)}},background:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_opacity:new e.Uniform1f(X,R.u_opacity),u_color:new e.UniformColor(X,R.u_color)}},backgroundPattern:function(X,R){return{u_matrix:new e.UniformMatrix4f(X,R.u_matrix),u_opacity:new e.Uniform1f(X,R.u_opacity),u_image:new e.Uniform1i(X,R.u_image),u_pattern_tl_a:new e.Uniform2f(X,R.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(X,R.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(X,R.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(X,R.u_pattern_br_b),u_texsize:new e.Uniform2f(X,R.u_texsize),u_mix:new e.Uniform1f(X,R.u_mix),u_pattern_size_a:new e.Uniform2f(X,R.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(X,R.u_pattern_size_b),u_scale_a:new e.Uniform1f(X,R.u_scale_a),u_scale_b:new e.Uniform1f(X,R.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(X,R.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(X,R.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(X,R.u_tile_units_to_pixels)}}};function Yo(X,R,i,a,C,F,q){for(var te=X.context,ue=te.gl,ve=X.useProgram("collisionBox"),Ae=[],Re=0,Ue=0,it=0;it0){var It=e.create(),Qt=Ct;e.mul(It,bt.placementInvProjMatrix,X.transform.glCoordMatrix),e.mul(It,It,bt.placementViewportMatrix),Ae.push({circleArray:Ut,circleOffset:Ue,transform:Qt,invTransform:It}),Ue=Re+=Ut.length/4}Mt&&ve.draw(te,ue.LINES,Ot.disabled,at.disabled,X.colorModeForRenderPass(),Xe.disabled,Su(Ct,X.transform,dt),i.id,Mt.layoutVertexBuffer,Mt.indexBuffer,Mt.segments,null,X.transform.zoom,null,null,Mt.collisionVertexBuffer)}}if(q&&Ae.length){var tn=X.useProgram("collisionCircle"),Yt=new e.StructArrayLayout2f1f2i16;Yt.resize(4*Re),Yt._trim();for(var vn=0,Mn=0,Vn=Ae;Mn=0&&(ct[bt.associatedIconIndex]={shiftedAnchor:Vn,angle:Hn})}else jr(bt.numGlyphs,Ue)}if(Ae){it.clear();for(var rr=X.icon.placedSymbolArray,Mr=0;Mr0){var q=e.browser.now(),te=(q-X.timeAdded)/F,ue=R?(q-R.timeAdded)/F:-1,ve=i.getSource(),Ae=C.coveringZoomLevel({tileSize:ve.tileSize,roundZoom:ve.roundZoom}),Re=!R||Math.abs(R.tileID.overscaledZ-Ae)>Math.abs(X.tileID.overscaledZ-Ae),Ue=Re&&X.refreshedUponExpiration?1:e.clamp(Re?te:1-ue,0,1);return X.refreshedUponExpiration&&te>=1&&(X.refreshedUponExpiration=!1),R?{opacity:1,mix:1-Ue}:{opacity:Ue,mix:0}}return{opacity:1,mix:0}}var ia=new e.Color(1,0,0,1),sa=new e.Color(0,1,0,1),po=new e.Color(0,0,1,1),ro=new e.Color(1,0,1,1),mu=new e.Color(0,1,1,1);function qu(X){var R=X.transform.padding;ls(X,X.transform.height-(R.top||0),3,ia),ls(X,R.bottom||0,3,sa),Ws(X,R.left||0,3,po),Ws(X,X.transform.width-(R.right||0),3,ro);var i=X.transform.centerPoint;(function(a,C,F,q){var te=20,ue=2;bl(a,C-ue/2,F-te/2,ue,te,q),bl(a,C-te/2,F-ue/2,te,ue,q)})(X,i.x,X.transform.height-i.y,mu)}function ls(X,R,i,a){bl(X,0,R+i/2,X.transform.width,i,a)}function Ws(X,R,i,a){bl(X,R-i/2,0,i,X.transform.height,a)}function bl(X,R,i,a,C,F){var q=X.context,te=q.gl;te.enable(te.SCISSOR_TEST),te.scissor(R*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio,C*e.browser.devicePixelRatio),q.clear({color:F}),te.disable(te.SCISSOR_TEST)}function Zs(X,R,i){var a=X.context,C=a.gl,F=i.posMatrix,q=X.useProgram("debug"),te=Ot.disabled,ue=at.disabled,ve=X.colorModeForRenderPass(),Ae="$debug";a.activeTexture.set(C.TEXTURE0),X.emptyTexture.bind(C.LINEAR,C.CLAMP_TO_EDGE),q.draw(a,C.LINE_STRIP,te,ue,ve,Xe.disabled,Rs(F,e.Color.red),Ae,X.debugBuffer,X.tileBorderIndexBuffer,X.debugSegments);var Re=R.getTileByID(i.key).latestRawTileData,Ue=Re&&Re.byteLength||0,it=Math.floor(Ue/1024),ct=R.getTile(i).tileSize,dt=512/Math.min(ct,512)*(i.overscaledZ/X.transform.zoom)*.5,bt=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(bt+=" => "+i.overscaledZ),function(Ct,Mt){Ct.initDebugOverlayCanvas();var Ut=Ct.debugOverlayCanvas,It=Ct.context.gl,Qt=Ct.debugOverlayCanvas.getContext("2d");Qt.clearRect(0,0,Ut.width,Ut.height),Qt.shadowColor="white",Qt.shadowBlur=2,Qt.lineWidth=1.5,Qt.strokeStyle="white",Qt.textBaseline="top",Qt.font="bold 36px Open Sans, sans-serif",Qt.fillText(Mt,5,5),Qt.strokeText(Mt,5,5),Ct.debugOverlayTexture.update(Ut),Ct.debugOverlayTexture.bind(It.LINEAR,It.CLAMP_TO_EDGE)}(X,bt+" "+it+"kb"),q.draw(a,C.TRIANGLES,te,ue,lt.alphaBlended,Xe.disabled,Rs(F,e.Color.transparent,dt),Ae,X.debugBuffer,X.quadTriangleIndexBuffer,X.debugSegments)}var vu={symbol:function(X,R,i,a,C){if(X.renderPass==="translucent"){var F=at.disabled,q=X.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(te,ue,ve,Ae,Re,Ue,it){for(var ct=ue.transform,dt=Re==="map",bt=Ue==="map",Ct=0,Mt=te;Ct256&&this.clearStencil(),i.setColorMode(lt.disabled),i.setDepthMode(Ot.disabled);var C=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var F=0,q=R;F256&&this.clearStencil();var X=this.nextStencilID++,R=this.context.gl;return new at({func:R.NOTEQUAL,mask:255},X,255,R.KEEP,R.KEEP,R.REPLACE)},La.prototype.stencilModeForClipping=function(X){var R=this.context.gl;return new at({func:R.EQUAL,mask:255},this._tileClippingMaskIDs[X.key],0,R.KEEP,R.KEEP,R.REPLACE)},La.prototype.stencilConfigForOverlap=function(X){var R,i=this.context.gl,a=X.sort(function(ue,ve){return ve.overscaledZ-ue.overscaledZ}),C=a[a.length-1].overscaledZ,F=a[0].overscaledZ-C+1;if(F>1){this.currentStencilSource=void 0,this.nextStencilID+F>256&&this.clearStencil();for(var q={},te=0;te=0;this.currentLayer--){var Qt=this.style._layers[a[this.currentLayer]],tn=C[Qt.source],Yt=ve[Qt.source];this._renderTileClippingMasks(Qt,Yt),this.renderLayer(this,tn,Qt,Yt)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?R.pop():null},La.prototype.isPatternMissing=function(X){if(!X)return!1;if(!X.from||!X.to)return!0;var R=this.imageManager.getPattern(X.from.toString()),i=this.imageManager.getPattern(X.to.toString());return!R||!i},La.prototype.useProgram=function(X,R){this.cache=this.cache||{};var i=""+X+(R?R.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new Nl(this.context,X,ko[X],R,Hs[X],this._showOverdrawInspector)),this.cache[i]},La.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()},La.prototype.setBaseState=function(){var X=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(X.FUNC_ADD)},La.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var X=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,X.RGBA)}},La.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var ba=function(X,R){this.points=X,this.planes=R};ba.fromInvProjectionMatrix=function(X,R,i){var a=Math.pow(2,i),C=[[-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(q){return e.transformMat4([],q,X)}).map(function(q){return e.scale$1([],q,1/q[3]/R*a)}),F=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(q){var te=e.sub([],C[q[0]],C[q[1]]),ue=e.sub([],C[q[2]],C[q[1]]),ve=e.normalize([],e.cross([],te,ue)),Ae=-e.dot(ve,C[q[1]]);return ve.concat(Ae)});return new ba(C,F)};var Ho=function(X,R){this.min=X,this.max=R,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Ho.prototype.quadrant=function(X){for(var R=[X%2==0,X<2],i=e.clone$2(this.min),a=e.clone$2(this.max),C=0;C=0;if(F===0)return 0;F!==R.length&&(i=!1)}if(i)return 2;for(var te=0;te<3;te++){for(var ue=Number.MAX_VALUE,ve=-Number.MAX_VALUE,Ae=0;Aethis.max[te]-this.min[te])return 0}return 1};var Ts=function(X,R,i,a){if(X===void 0&&(X=0),R===void 0&&(R=0),i===void 0&&(i=0),a===void 0&&(a=0),isNaN(X)||X<0||isNaN(R)||R<0||isNaN(i)||i<0||isNaN(a)||a<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=X,this.bottom=R,this.left=i,this.right=a};Ts.prototype.interpolate=function(X,R,i){return R.top!=null&&X.top!=null&&(this.top=e.number(X.top,R.top,i)),R.bottom!=null&&X.bottom!=null&&(this.bottom=e.number(X.bottom,R.bottom,i)),R.left!=null&&X.left!=null&&(this.left=e.number(X.left,R.left,i)),R.right!=null&&X.right!=null&&(this.right=e.number(X.right,R.right,i)),this},Ts.prototype.getCenter=function(X,R){var i=e.clamp((this.left+X-this.right)/2,0,X),a=e.clamp((this.top+R-this.bottom)/2,0,R);return new e.Point(i,a)},Ts.prototype.equals=function(X){return this.top===X.top&&this.bottom===X.bottom&&this.left===X.left&&this.right===X.right},Ts.prototype.clone=function(){return new Ts(this.top,this.bottom,this.left,this.right)},Ts.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Aa=function(X,R,i,a,C){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=C===void 0||C,this._minZoom=X||0,this._maxZoom=R||22,this._minPitch=i??0,this._maxPitch=a??60,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 Ts,this._posMatrixCache={},this._alignedPosMatrixCache={}},Ua={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}};Aa.prototype.clone=function(){var X=new Aa(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return X.tileSize=this.tileSize,X.latRange=this.latRange,X.width=this.width,X.height=this.height,X._center=this._center,X.zoom=this.zoom,X.angle=this.angle,X._fov=this._fov,X._pitch=this._pitch,X._unmodified=this._unmodified,X._edgeInsets=this._edgeInsets.clone(),X._calcMatrices(),X},Ua.minZoom.get=function(){return this._minZoom},Ua.minZoom.set=function(X){this._minZoom!==X&&(this._minZoom=X,this.zoom=Math.max(this.zoom,X))},Ua.maxZoom.get=function(){return this._maxZoom},Ua.maxZoom.set=function(X){this._maxZoom!==X&&(this._maxZoom=X,this.zoom=Math.min(this.zoom,X))},Ua.minPitch.get=function(){return this._minPitch},Ua.minPitch.set=function(X){this._minPitch!==X&&(this._minPitch=X,this.pitch=Math.max(this.pitch,X))},Ua.maxPitch.get=function(){return this._maxPitch},Ua.maxPitch.set=function(X){this._maxPitch!==X&&(this._maxPitch=X,this.pitch=Math.min(this.pitch,X))},Ua.renderWorldCopies.get=function(){return this._renderWorldCopies},Ua.renderWorldCopies.set=function(X){X===void 0?X=!0:X===null&&(X=!1),this._renderWorldCopies=X},Ua.worldSize.get=function(){return this.tileSize*this.scale},Ua.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Ua.size.get=function(){return new e.Point(this.width,this.height)},Ua.bearing.get=function(){return-this.angle/Math.PI*180},Ua.bearing.set=function(X){var R=-e.wrap(X,-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))},Ua.pitch.get=function(){return this._pitch/Math.PI*180},Ua.pitch.set=function(X){var R=e.clamp(X,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==R&&(this._unmodified=!1,this._pitch=R,this._calcMatrices())},Ua.fov.get=function(){return this._fov/Math.PI*180},Ua.fov.set=function(X){X=Math.max(.01,Math.min(60,X)),this._fov!==X&&(this._unmodified=!1,this._fov=X/180*Math.PI,this._calcMatrices())},Ua.zoom.get=function(){return this._zoom},Ua.zoom.set=function(X){var R=Math.min(Math.max(X,this.minZoom),this.maxZoom);this._zoom!==R&&(this._unmodified=!1,this._zoom=R,this.scale=this.zoomScale(R),this.tileZoom=Math.floor(R),this.zoomFraction=R-this.tileZoom,this._constrain(),this._calcMatrices())},Ua.center.get=function(){return this._center},Ua.center.set=function(X){X.lat===this._center.lat&&X.lng===this._center.lng||(this._unmodified=!1,this._center=X,this._constrain(),this._calcMatrices())},Ua.padding.get=function(){return this._edgeInsets.toJSON()},Ua.padding.set=function(X){this._edgeInsets.equals(X)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,X,1),this._calcMatrices())},Ua.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Aa.prototype.isPaddingEqual=function(X){return this._edgeInsets.equals(X)},Aa.prototype.interpolatePadding=function(X,R,i){this._unmodified=!1,this._edgeInsets.interpolate(X,R,i),this._constrain(),this._calcMatrices()},Aa.prototype.coveringZoomLevel=function(X){var R=(X.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/X.tileSize));return Math.max(0,R)},Aa.prototype.getVisibleUnwrappedCoordinates=function(X){var R=[new e.UnwrappedTileID(0,X)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new e.Point(0,0)),a=this.pointCoordinate(new e.Point(this.width,0)),C=this.pointCoordinate(new e.Point(this.width,this.height)),F=this.pointCoordinate(new e.Point(0,this.height)),q=Math.floor(Math.min(i.x,a.x,C.x,F.x)),te=Math.floor(Math.max(i.x,a.x,C.x,F.x)),ue=q-1;ue<=te+1;ue++)ue!==0&&R.push(new e.UnwrappedTileID(ue,X));return R},Aa.prototype.coveringTiles=function(X){var R=this.coveringZoomLevel(X),i=R;if(X.minzoom!==void 0&&RX.maxzoom&&(R=X.maxzoom);var a=e.MercatorCoordinate.fromLngLat(this.center),C=Math.pow(2,R),F=[C*a.x,C*a.y,0],q=ba.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,R),te=X.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(te=R);var ue=function(Vn){return{aabb:new Ho([Vn*C,0,0],[(Vn+1)*C,C,0]),zoom:0,x:0,y:0,wrap:Vn,fullyVisible:!1}},ve=[],Ae=[],Re=R,Ue=X.reparseOverscaled?i:R;if(this._renderWorldCopies)for(var it=1;it<=3;it++)ve.push(ue(-it)),ve.push(ue(it));for(ve.push(ue(0));ve.length>0;){var ct=ve.pop(),dt=ct.x,bt=ct.y,Ct=ct.fullyVisible;if(!Ct){var Mt=ct.aabb.intersects(q);if(Mt===0)continue;Ct=Mt===2}var Ut=ct.aabb.distanceX(F),It=ct.aabb.distanceY(F),Qt=Math.max(Math.abs(Ut),Math.abs(It)),tn=3+(1<tn&&ct.zoom>=te)Ae.push({tileID:new e.OverscaledTileID(ct.zoom===Re?Ue:ct.zoom,ct.wrap,ct.zoom,dt,bt),distanceSq:e.sqrLen([F[0]-.5-dt,F[1]-.5-bt])});else for(var Yt=0;Yt<4;Yt++){var vn=(dt<<1)+Yt%2,Mn=(bt<<1)+(Yt>>1);ve.push({aabb:ct.aabb.quadrant(Yt),zoom:ct.zoom+1,x:vn,y:Mn,wrap:ct.wrap,fullyVisible:Ct})}}return Ae.sort(function(Vn,Hn){return Vn.distanceSq-Hn.distanceSq}).map(function(Vn){return Vn.tileID})},Aa.prototype.resize=function(X,R){this.width=X,this.height=R,this.pixelsToGLUnits=[2/X,-2/R],this._constrain(),this._calcMatrices()},Ua.unmodified.get=function(){return this._unmodified},Aa.prototype.zoomScale=function(X){return Math.pow(2,X)},Aa.prototype.scaleZoom=function(X){return Math.log(X)/Math.LN2},Aa.prototype.project=function(X){var R=e.clamp(X.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(X.lng)*this.worldSize,e.mercatorYfromLat(R)*this.worldSize)},Aa.prototype.unproject=function(X){return new e.MercatorCoordinate(X.x/this.worldSize,X.y/this.worldSize).toLngLat()},Ua.point.get=function(){return this.project(this.center)},Aa.prototype.setLocationAtPoint=function(X,R){var i=this.pointCoordinate(R),a=this.pointCoordinate(this.centerPoint),C=this.locationCoordinate(X),F=new e.MercatorCoordinate(C.x-(i.x-a.x),C.y-(i.y-a.y));this.center=this.coordinateLocation(F),this._renderWorldCopies&&(this.center=this.center.wrap())},Aa.prototype.locationPoint=function(X){return this.coordinatePoint(this.locationCoordinate(X))},Aa.prototype.pointLocation=function(X){return this.coordinateLocation(this.pointCoordinate(X))},Aa.prototype.locationCoordinate=function(X){return e.MercatorCoordinate.fromLngLat(X)},Aa.prototype.coordinateLocation=function(X){return X.toLngLat()},Aa.prototype.pointCoordinate=function(X){var R=[X.x,X.y,0,1],i=[X.x,X.y,1,1];e.transformMat4(R,R,this.pixelMatrixInverse),e.transformMat4(i,i,this.pixelMatrixInverse);var a=R[3],C=i[3],F=R[0]/a,q=i[0]/C,te=R[1]/a,ue=i[1]/C,ve=R[2]/a,Ae=i[2]/C,Re=ve===Ae?0:(0-ve)/(Ae-ve);return new e.MercatorCoordinate(e.number(F,q,Re)/this.worldSize,e.number(te,ue,Re)/this.worldSize)},Aa.prototype.coordinatePoint=function(X){var R=[X.x*this.worldSize,X.y*this.worldSize,0,1];return e.transformMat4(R,R,this.pixelMatrix),new e.Point(R[0]/R[3],R[1]/R[3])},Aa.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)))},Aa.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Aa.prototype.setMaxBounds=function(X){X?(this.lngRange=[X.getWest(),X.getEast()],this.latRange=[X.getSouth(),X.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Aa.prototype.calculatePosMatrix=function(X,R){R===void 0&&(R=!1);var i=X.key,a=R?this._alignedPosMatrixCache:this._posMatrixCache;if(a[i])return a[i];var C=X.canonical,F=this.worldSize/this.zoomScale(C.z),q=C.x+Math.pow(2,C.z)*X.wrap,te=e.identity(new Float64Array(16));return e.translate(te,te,[q*F,C.y*F,0]),e.scale(te,te,[F/e.EXTENT,F/e.EXTENT,1]),e.multiply(te,R?this.alignedProjMatrix:this.projMatrix,te),a[i]=new Float32Array(te),a[i]},Aa.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Aa.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var X,R,i,a,C=-90,F=90,q=-180,te=180,ue=this.size,ve=this._unmodified;if(this.latRange){var Ae=this.latRange;C=e.mercatorYfromLat(Ae[1])*this.worldSize,X=(F=e.mercatorYfromLat(Ae[0])*this.worldSize)-CF&&(a=F-dt)}if(this.lngRange){var bt=Ue.x,Ct=ue.x/2;bt-Ctte&&(i=te-Ct)}i===void 0&&a===void 0||(this.center=this.unproject(new e.Point(i!==void 0?i:Ue.x,a!==void 0?a:Ue.y))),this._unmodified=ve,this._constraining=!1}},Aa.prototype._calcMatrices=function(){if(this.height){var X=this._fov/2,R=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(X)*this.height;var i=Math.PI/2+this._pitch,a=this._fov*(.5+R.y/this.height),C=Math.sin(a)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-i-a,.01,Math.PI-.01)),F=this.point,q=F.x,te=F.y,ue=1.01*(Math.cos(Math.PI/2-this._pitch)*C+this.cameraToCenterDistance),ve=this.height/50,Ae=new Float64Array(16);e.perspective(Ae,this._fov,this.width/this.height,ve,ue),Ae[8]=2*-R.x/this.width,Ae[9]=2*R.y/this.height,e.scale(Ae,Ae,[1,-1,1]),e.translate(Ae,Ae,[0,0,-this.cameraToCenterDistance]),e.rotateX(Ae,Ae,this._pitch),e.rotateZ(Ae,Ae,this.angle),e.translate(Ae,Ae,[-q,-te,0]),this.mercatorMatrix=e.scale([],Ae,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Ae,Ae,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Ae,this.invProjMatrix=e.invert([],this.projMatrix);var Re=this.width%2/2,Ue=this.height%2/2,it=Math.cos(this.angle),ct=Math.sin(this.angle),dt=q-Math.round(q)+it*Re+ct*Ue,bt=te-Math.round(te)+it*Ue+ct*Re,Ct=new Float64Array(Ae);if(e.translate(Ct,Ct,[dt>.5?dt-1:dt,bt>.5?bt-1:bt,0]),this.alignedProjMatrix=Ct,Ae=e.create(),e.scale(Ae,Ae,[this.width/2,-this.height/2,1]),e.translate(Ae,Ae,[1,-1,0]),this.labelPlaneMatrix=Ae,Ae=e.create(),e.scale(Ae,Ae,[1,-1,1]),e.translate(Ae,Ae,[-1,-1,0]),e.scale(Ae,Ae,[2/this.width,2/this.height,1]),this.glCoordMatrix=Ae,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(Ae=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=Ae,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Aa.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var X=this.pointCoordinate(new e.Point(0,0)),R=[X.x*this.worldSize,X.y*this.worldSize,0,1];return e.transformMat4(R,R,this.pixelMatrix)[3]/this.cameraToCenterDistance},Aa.prototype.getCameraPoint=function(){var X=this._pitch,R=Math.tan(X)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,R))},Aa.prototype.getCameraQueryGeometry=function(X){var R=this.getCameraPoint();if(X.length===1)return[X[0],R];for(var i=R.x,a=R.y,C=R.x,F=R.y,q=0,te=X;q=3&&!X.some(function(i){return isNaN(i)})){var R=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(X[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+X[2],+X[1]],zoom:+X[0],bearing:R,pitch:+(X[4]||0)}),!0}return!1},wl.prototype._updateHashUnthrottled=function(){var X=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,X)}catch{}};var ic={linearity:.3,easing:e.bezier(0,0,.3,1)},nu=e.extend({deceleration:2500,maxSpeed:1400},ic),Bs=e.extend({deceleration:20,maxSpeed:1400},ic),Gl=e.extend({deceleration:1e3,maxSpeed:360},ic),us=e.extend({deceleration:1e3,maxSpeed:90},ic),No=function(X){this._map=X,this.clear()};function Wl(X,R){(!X.duration||X.duration0&&R-X[0].time>160;)X.shift()},No.prototype._onMoveEnd=function(X){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},i=0,a=this._inertiaBuffer;i=this._clickTolerance||this._map.fire(new Xo(X.type,this._map,X))},ka.prototype.dblclick=function(X){return this._firePreventable(new Xo(X.type,this._map,X))},ka.prototype.mouseover=function(X){this._map.fire(new Xo(X.type,this._map,X))},ka.prototype.mouseout=function(X){this._map.fire(new Xo(X.type,this._map,X))},ka.prototype.touchstart=function(X){return this._firePreventable(new Xa(X.type,this._map,X))},ka.prototype.touchmove=function(X){this._map.fire(new Xa(X.type,this._map,X))},ka.prototype.touchend=function(X){this._map.fire(new Xa(X.type,this._map,X))},ka.prototype.touchcancel=function(X){this._map.fire(new Xa(X.type,this._map,X))},ka.prototype._firePreventable=function(X){if(this._map.fire(X),X.defaultPrevented)return{}},ka.prototype.isEnabled=function(){return!0},ka.prototype.isActive=function(){return!1},ka.prototype.enable=function(){},ka.prototype.disable=function(){};var Ao=function(X){this._map=X};Ao.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Ao.prototype.mousemove=function(X){this._map.fire(new Xo(X.type,this._map,X))},Ao.prototype.mousedown=function(){this._delayContextMenu=!0},Ao.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Xo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Ao.prototype.contextmenu=function(X){this._delayContextMenu?this._contextMenuEvent=X:this._map.fire(new Xo(X.type,this._map,X)),this._map.listens("contextmenu")&&X.preventDefault()},Ao.prototype.isEnabled=function(){return!0},Ao.prototype.isActive=function(){return!1},Ao.prototype.enable=function(){},Ao.prototype.disable=function(){};var Va=function(X,R){this._map=X,this._el=X.getCanvasContainer(),this._container=X.getContainer(),this._clickTolerance=R.clickTolerance||1};function Ko(X,R){for(var i={},a=0;athis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=X.timeStamp),i.length===this.numTouches&&(this.centroid=function(a){for(var C=new e.Point(0,0),F=0,q=a;F30)&&(this.aborted=!0)}}},cs.prototype.touchend=function(X,R,i){if((!this.centroid||X.timeStamp-this.startTime>500)&&(this.aborted=!0),i.length===0){var a=!this.aborted&&this.centroid;if(this.reset(),a)return a}};var rl=function(X){this.singleTap=new cs(X),this.numTaps=X.numTaps,this.reset()};rl.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},rl.prototype.touchstart=function(X,R,i){this.singleTap.touchstart(X,R,i)},rl.prototype.touchmove=function(X,R,i){this.singleTap.touchmove(X,R,i)},rl.prototype.touchend=function(X,R,i){var a=this.singleTap.touchend(X,R,i);if(a){var C=X.timeStamp-this.lastTime<500,F=!this.lastTap||this.lastTap.dist(a)<30;if(C&&F||this.reset(),this.count++,this.lastTime=X.timeStamp,this.lastTap=a,this.count===this.numTaps)return this.reset(),a}};var xs=function(){this._zoomIn=new rl({numTouches:1,numTaps:2}),this._zoomOut=new rl({numTouches:2,numTaps:1}),this.reset()};xs.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},xs.prototype.touchstart=function(X,R,i){this._zoomIn.touchstart(X,R,i),this._zoomOut.touchstart(X,R,i)},xs.prototype.touchmove=function(X,R,i){this._zoomIn.touchmove(X,R,i),this._zoomOut.touchmove(X,R,i)},xs.prototype.touchend=function(X,R,i){var a=this,C=this._zoomIn.touchend(X,R,i),F=this._zoomOut.touchend(X,R,i);return C?(this._active=!0,X.preventDefault(),setTimeout(function(){return a.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()+1,around:q.unproject(C)},{originalEvent:X})}}):F?(this._active=!0,X.preventDefault(),setTimeout(function(){return a.reset()},0),{cameraAnimation:function(q){return q.easeTo({duration:300,zoom:q.getZoom()-1,around:q.unproject(F)},{originalEvent:X})}}):void 0},xs.prototype.touchcancel=function(){this.reset()},xs.prototype.enable=function(){this._enabled=!0},xs.prototype.disable=function(){this._enabled=!1,this.reset()},xs.prototype.isEnabled=function(){return this._enabled},xs.prototype.isActive=function(){return this._active};var Zl={};Zl[0]=1,Zl[2]=2;var _s=function(X){this.reset(),this._clickTolerance=X.clickTolerance||1};_s.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},_s.prototype._correctButton=function(X,R){return!1},_s.prototype._move=function(X,R){return{}},_s.prototype.mousedown=function(X,R){if(!this._lastPoint){var i=y.mouseButton(X);this._correctButton(X,i)&&(this._lastPoint=R,this._eventButton=i)}},_s.prototype.mousemoveWindow=function(X,R){var i=this._lastPoint;if(i){if(X.preventDefault(),function(a,C){var F=Zl[C];return a.buttons===void 0||(a.buttons&F)!==F}(X,this._eventButton))this.reset();else if(this._moved||!(R.dist(i)0&&(this._active=!0);var a=Ko(i,R),C=new e.Point(0,0),F=new e.Point(0,0),q=0;for(var te in a){var ue=a[te],ve=this._touches[te];ve&&(C._add(ue),F._add(ue.sub(ve)),q++,a[te]=ue)}if(this._touches=a,!(qMath.abs(X.x)}var Sl=function(X){function R(){X.apply(this,arguments)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.reset=function(){X.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},R.prototype._start=function(i){this._lastPoints=i,il(i[0].sub(i[1]))&&(this._valid=!1)},R.prototype._move=function(i,a,C){var F=i[0].sub(this._lastPoints[0]),q=i[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(F,q,C.timeStamp),this._valid)return this._lastPoints=i,this._active=!0,{pitchDelta:(F.y+q.y)/2*-.5}},R.prototype.gestureBeginsVertically=function(i,a,C){if(this._valid!==void 0)return this._valid;var F=i.mag()>=2,q=a.mag()>=2;if(F||q){if(!F||!q)return this._firstMove===void 0&&(this._firstMove=C),C-this._firstMove<100&&void 0;var te=i.y>0==a.y>0;return il(i)&&il(a)&&te}},R}(ua),Ml={panStep:100,bearingStep:15,pitchStep:10},li=function(){var X=Ml;this._panStep=X.panStep,this._bearingStep=X.bearingStep,this._pitchStep=X.pitchStep,this._rotationDisabled=!1};function hs(X){return X*(2-X)}li.prototype.reset=function(){this._active=!1},li.prototype.keydown=function(X){var R=this;if(!(X.altKey||X.ctrlKey||X.metaKey)){var i=0,a=0,C=0,F=0,q=0;switch(X.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:X.shiftKey?a=-1:(X.preventDefault(),F=-1);break;case 39:X.shiftKey?a=1:(X.preventDefault(),F=1);break;case 38:X.shiftKey?C=1:(X.preventDefault(),q=-1);break;case 40:X.shiftKey?C=-1:(X.preventDefault(),q=1);break;default:return}return this._rotationDisabled&&(a=0,C=0),{cameraAnimation:function(te){var ue=te.getZoom();te.easeTo({duration:300,easeId:"keyboardHandler",easing:hs,zoom:i?Math.round(ue)+i*(X.shiftKey?2:1):ue,bearing:te.getBearing()+a*R._bearingStep,pitch:te.getPitch()+C*R._pitchStep,offset:[-F*R._panStep,-q*R._panStep],center:te.getCenter()},{originalEvent:X})}}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active},li.prototype.disableRotation=function(){this._rotationDisabled=!0},li.prototype.enableRotation=function(){this._rotationDisabled=!1};var al=4.000244140625,Na=function(X,R){this._map=X,this._el=X.getCanvasContainer(),this._handler=R,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout"],this)};Na.prototype.setZoomRate=function(X){this._defaultZoomRate=X},Na.prototype.setWheelZoomRate=function(X){this._wheelZoomRate=X},Na.prototype.isEnabled=function(){return!!this._enabled},Na.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Na.prototype.isZooming=function(){return!!this._zooming},Na.prototype.enable=function(X){this.isEnabled()||(this._enabled=!0,this._aroundCenter=X&&X.around==="center")},Na.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Na.prototype.wheel=function(X){if(this.isEnabled()){var R=X.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*X.deltaY:X.deltaY,i=e.browser.now(),a=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,R!==0&&R%al==0?this._type="wheel":R!==0&&Math.abs(R)<4?this._type="trackpad":a>400?(this._type=null,this._lastValue=R,this._timeout=setTimeout(this._onTimeout,40,X)):this._type||(this._type=Math.abs(a*R)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,R+=this._lastValue)),X.shiftKey&&R&&(R/=4),this._type&&(this._lastWheelEvent=X,this._delta-=R,this._active||this._start(X)),X.preventDefault()}},Na.prototype._onTimeout=function(X){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(X)},Na.prototype._start=function(X){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var R=y.mousePos(this._el,X);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(R)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Na.prototype.renderFrame=function(){var X=this;if(this._frameId&&(this._frameId=null,this.isActive())){var R=this._map.transform;if(this._delta!==0){var i=this._type==="wheel"&&Math.abs(this._delta)>al?this._wheelZoomRate:this._defaultZoomRate,a=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&a!==0&&(a=1/a);var C=typeof this._targetZoom=="number"?R.zoomScale(this._targetZoom):R.scale;this._targetZoom=Math.min(R.maxZoom,Math.max(R.minZoom,R.scaleZoom(C*a))),this._type==="wheel"&&(this._startZoom=R.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var F,q=typeof this._targetZoom=="number"?this._targetZoom:R.zoom,te=this._startZoom,ue=this._easing,ve=!1;if(this._type==="wheel"&&te&&ue){var Ae=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Re=ue(Ae);F=e.number(te,q,Re),Ae<1?this._frameId||(this._frameId=!0):ve=!0}else F=q,ve=!0;return this._active=!0,ve&&(this._active=!1,this._finishTimeout=setTimeout(function(){X._zooming=!1,X._handler._triggerRenderFrame(),delete X._targetZoom,delete X._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ve,zoomDelta:F-R.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Na.prototype._smoothOutEasing=function(X){var R=e.ease;if(this._prevEase){var i=this._prevEase,a=(e.browser.now()-i.start)/i.duration,C=i.easing(a+.01)-i.easing(a),F=.27/Math.sqrt(C*C+1e-4)*.01,q=Math.sqrt(.0729-F*F);R=e.bezier(F,q,.25,1)}return this._prevEase={start:e.browser.now(),duration:X,easing:R},R},Na.prototype.reset=function(){this._active=!1};var Ns=function(X,R){this._clickZoom=X,this._tapZoom=R};Ns.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Ns.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Ns.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Ns.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var iu=function(){this.reset()};iu.prototype.reset=function(){this._active=!1},iu.prototype.dblclick=function(X,R){return X.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(X.shiftKey?-1:1),around:i.unproject(R)},{originalEvent:X})}}},iu.prototype.enable=function(){this._enabled=!0},iu.prototype.disable=function(){this._enabled=!1,this.reset()},iu.prototype.isEnabled=function(){return this._enabled},iu.prototype.isActive=function(){return this._active};var El=function(){this._tap=new rl({numTouches:1,numTaps:1}),this.reset()};El.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},El.prototype.touchstart=function(X,R,i){this._swipePoint||(this._tapTime&&X.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=R[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(X,R,i))},El.prototype.touchmove=function(X,R,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var a=R[0],C=a.y-this._swipePoint.y;return this._swipePoint=a,X.preventDefault(),this._active=!0,{zoomDelta:C/128}}}else this._tap.touchmove(X,R,i)},El.prototype.touchend=function(X,R,i){this._tapTime?this._swipePoint&&i.length===0&&this.reset():this._tap.touchend(X,R,i)&&(this._tapTime=X.timeStamp)},El.prototype.touchcancel=function(){this.reset()},El.prototype.enable=function(){this._enabled=!0},El.prototype.disable=function(){this._enabled=!1,this.reset()},El.prototype.isEnabled=function(){return this._enabled},El.prototype.isActive=function(){return this._active};var ks=function(X,R,i){this._el=X,this._mousePan=R,this._touchPan=i};ks.prototype.enable=function(X){this._inertiaOptions=X||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},ks.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},ks.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},ks.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var au=function(X,R,i){this._pitchWithRotate=X.pitchWithRotate,this._mouseRotate=R,this._mousePitch=i};au.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},au.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},au.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},au.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var As=function(X,R,i,a){this._el=X,this._touchZoom=R,this._touchRotate=i,this._tapDragZoom=a,this._rotationDisabled=!1,this._enabled=!0};As.prototype.enable=function(X){this._touchZoom.enable(X),this._rotationDisabled||this._touchRotate.enable(X),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},As.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},As.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},As.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},As.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},As.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Jo=function(X){return X.zoom||X.drag||X.pitch||X.rotate},ol=function(X){function R(){X.apply(this,arguments)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R}(e.Event);function cn(X){return X.panDelta&&X.panDelta.mag()||X.zoomDelta||X.bearingDelta||X.pitchDelta}var ya=function(X,R){this._map=X,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new No(X),this._bearingSnap=R.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(R),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,C=this._listeners;aq?Math.min(2,tn):Math.max(.5,tn),Hn=Math.pow(Vn,1-vn),Xn=F.unproject(It.add(Qt.mult(vn*Hn)).mult(Mn));F.setLocationAtPoint(F.renderWorldCopies?Xn.wrap():Xn,dt)}C._fireMoveEvents(a)},function(vn){C._afterEase(a,vn)},i),this},R.prototype._prepareEase=function(i,a,C){C===void 0&&(C={}),this._moving=!0,a||C.moving||this.fire(new e.Event("movestart",i)),this._zooming&&!C.zooming&&this.fire(new e.Event("zoomstart",i)),this._rotating&&!C.rotating&&this.fire(new e.Event("rotatestart",i)),this._pitching&&!C.pitching&&this.fire(new e.Event("pitchstart",i))},R.prototype._fireMoveEvents=function(i){this.fire(new e.Event("move",i)),this._zooming&&this.fire(new e.Event("zoom",i)),this._rotating&&this.fire(new e.Event("rotate",i)),this._pitching&&this.fire(new e.Event("pitch",i))},R.prototype._afterEase=function(i,a){if(!this._easeId||!a||this._easeId!==a){delete this._easeId;var C=this._zooming,F=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,C&&this.fire(new e.Event("zoomend",i)),F&&this.fire(new e.Event("rotateend",i)),q&&this.fire(new e.Event("pitchend",i)),this.fire(new e.Event("moveend",i))}},R.prototype.flyTo=function(i,a){var C=this;if(!i.essential&&e.browser.prefersReducedMotion){var F=e.pick(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(F,a)}this.stop(),i=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},i);var q=this.transform,te=this.getZoom(),ue=this.getBearing(),ve=this.getPitch(),Ae=this.getPadding(),Re="zoom"in i?e.clamp(+i.zoom,q.minZoom,q.maxZoom):te,Ue="bearing"in i?this._normalizeBearing(i.bearing,ue):ue,it="pitch"in i?+i.pitch:ve,ct="padding"in i?i.padding:q.padding,dt=q.zoomScale(Re-te),bt=e.Point.convert(i.offset),Ct=q.centerPoint.add(bt),Mt=q.pointLocation(Ct),Ut=e.LngLat.convert(i.center||Mt);this._normalizeCenter(Ut);var It=q.project(Mt),Qt=q.project(Ut).sub(It),tn=i.curve,Yt=Math.max(q.width,q.height),vn=Yt/dt,Mn=Qt.mag();if("minZoom"in i){var Vn=e.clamp(Math.min(i.minZoom,te,Re),q.minZoom,q.maxZoom),Hn=Yt/q.zoomScale(Vn-te);tn=Math.sqrt(Hn/Mn*2)}var Xn=tn*tn;function rr(Nr){var si=(vn*vn-Yt*Yt+(Nr?-1:1)*Xn*Xn*Mn*Mn)/(2*(Nr?vn:Yt)*Xn*Mn);return Math.log(Math.sqrt(si*si+1)-si)}function Mr(Nr){return(Math.exp(Nr)-Math.exp(-Nr))/2}function nr(Nr){return(Math.exp(Nr)+Math.exp(-Nr))/2}var Lr=rr(0),dr=function(Nr){return nr(Lr)/nr(Lr+tn*Nr)},Br=function(Nr){return Yt*((nr(Lr)*(Mr(si=Lr+tn*Nr)/nr(si))-Mr(Lr))/Xn)/Mn;var si},Sr=(rr(1)-Lr)/tn;if(Math.abs(Mn)<1e-6||!isFinite(Sr)){if(Math.abs(Yt-vn)<1e-6)return this.easeTo(i,a);var Vr=vni.maxDuration&&(i.duration=0),this._zooming=!0,this._rotating=ue!==Ue,this._pitching=it!==ve,this._padding=!q.isPaddingEqual(ct),this._prepareEase(a,!1),this._ease(function(Nr){var si=Nr*Sr,_i=1/dr(si);q.zoom=Nr===1?Re:te+q.scaleZoom(_i),C._rotating&&(q.bearing=e.number(ue,Ue,Nr)),C._pitching&&(q.pitch=e.number(ve,it,Nr)),C._padding&&(q.interpolatePadding(Ae,ct,Nr),Ct=q.centerPoint.add(bt));var Gi=Nr===1?Ut:q.unproject(It.add(Qt.mult(Br(si))).mult(_i));q.setLocationAtPoint(q.renderWorldCopies?Gi.wrap():Gi,Ct),C._fireMoveEvents(a)},function(){return C._afterEase(a)},i),this},R.prototype.isEasing=function(){return!!this._easeFrameId},R.prototype.stop=function(){return this._stop()},R.prototype._stop=function(i,a){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var C=this._onEaseEnd;delete this._onEaseEnd,C.call(this,a)}if(!i){var F=this.handlers;F&&F.stop(!1)}return this},R.prototype._ease=function(i,a,C){C.animate===!1||C.duration===0?(i(1),a()):(this._easeStart=e.browser.now(),this._easeOptions=C,this._onEaseFrame=i,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},R.prototype._renderFrameCallback=function(){var i=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(i)),i<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},R.prototype._normalizeBearing=function(i,a){i=e.wrap(i,-180,180);var C=Math.abs(i-a);return Math.abs(i-360-a)180?-360:C<-180?360:0}},R}(e.Evented),io=function(X){X===void 0&&(X={}),this.options=X,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};io.prototype.getDefaultPosition=function(){return"bottom-right"},io.prototype.onAdd=function(X){var R=this.options&&this.options.compact;return this._map=X,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=y.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=y.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),R&&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),R===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},io.prototype.onRemove=function(){y.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},io.prototype._setElementTitle=function(X,R){var i=this._map._getUIString("AttributionControl."+R);X.title=i,X.setAttribute("aria-label",i)},io.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"))},io.prototype._updateEditLink=function(){var X=this._editLink;X||(X=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(X){var i=R.reduce(function(a,C,F){return C.value&&(a+=C.key+"="+C.value+(F=0)return!1;return!0})).join(" | ");q!==this._attribHTML&&(this._attribHTML=q,X.length?(this._innerContainer.innerHTML=q,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},io.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var ta=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};ta.prototype.onAdd=function(X){this._map=X,this._container=y.create("div","mapboxgl-ctrl");var R=y.create("a","mapboxgl-ctrl-logo");return R.target="_blank",R.rel="noopener nofollow",R.href="https://www.mapbox.com/",R.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),R.setAttribute("rel","noopener nofollow"),this._container.appendChild(R),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},ta.prototype.onRemove=function(){y.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},ta.prototype.getDefaultPosition=function(){return"bottom-left"},ta.prototype._updateLogo=function(X){X&&X.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},ta.prototype._logoRequired=function(){if(this._map.style){var X=this._map.style.sourceCaches;for(var R in X)if(X[R].getSource().mapbox_logo)return!0;return!1}},ta.prototype._updateCompact=function(){var X=this._container.children;if(X.length){var R=X[0];this._map.getCanvasContainer().offsetWidth<250?R.classList.add("mapboxgl-compact"):R.classList.remove("mapboxgl-compact")}};var Qo=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Qo.prototype.add=function(X){var R=++this._id;return this._queue.push({callback:X,id:R,cancelled:!1}),R},Qo.prototype.remove=function(X){for(var R=this._currentlyRunning,i=0,a=R?this._queue.concat(R):this._queue;ia.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>xu)throw new Error("maxPitch must be less than or equal to 60");var F=new Aa(a.minZoom,a.maxZoom,a.minPitch,a.maxPitch,a.renderWorldCopies);if(X.call(this,F,a),this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._failIfMajorPerformanceCaveat=a.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=a.preserveDrawingBuffer,this._antialias=a.antialias,this._trackResize=a.trackResize,this._bearingSnap=a.bearingSnap,this._refreshExpiredTiles=a.refreshExpiredTiles,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=a.collectResourceTiming,this._renderTaskQueue=new Qo,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},ac,a.locale),this._clickTolerance=a.clickTolerance,this._requestManager=new e.RequestManager(a.transformRequest,a.accessToken),typeof a.container=="string"){if(this._container=e.window.document.getElementById(a.container),!this._container)throw new Error("Container '"+a.container+"' not found.")}else{if(!(a.container instanceof Io))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=a.container}if(a.maxBounds&&this.setMaxBounds(a.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return C._update(!1)}),this.on("moveend",function(){return C._update(!1)}),this.on("zoom",function(){return C._update(!0)}),e.window!==void 0&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new ya(this,a);var q=typeof a.hash=="string"&&a.hash||void 0;this._hash=a.hash&&new wl(q).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:a.center,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,e.extend({},a.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=a.localIdeographFontFamily,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new io({customAttribution:a.customAttribution})),this.addControl(new ta,a.logoPosition),this.on("style.load",function(){C.transform.unmodified&&C.jumpTo(C.style.stylesheet)}),this.on("data",function(te){C._update(te.dataType==="style"),C.fire(new e.Event(te.dataType+"data",te))}),this.on("dataloading",function(te){C.fire(new e.Event(te.dataType+"dataloading",te))})}X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R;var i={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return R.prototype._getMapId=function(){return this._mapId},R.prototype.addControl=function(a,C){if(C===void 0&&(C=a.getDefaultPosition?a.getDefaultPosition():"top-right"),!a||!a.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 F=a.onAdd(this);this._controls.push(a);var q=this._controlPositions[C];return C.indexOf("bottom")!==-1?q.insertBefore(F,q.firstChild):q.appendChild(F),this},R.prototype.removeControl=function(a){if(!a||!a.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 C=this._controls.indexOf(a);return C>-1&&this._controls.splice(C,1),a.onRemove(this),this},R.prototype.hasControl=function(a){return this._controls.indexOf(a)>-1},R.prototype.resize=function(a){var C=this._containerDimensions(),F=C[0],q=C[1];this._resizeCanvas(F,q),this.transform.resize(F,q),this.painter.resize(F,q);var te=!this._moving;return te&&(this.stop(),this.fire(new e.Event("movestart",a)).fire(new e.Event("move",a))),this.fire(new e.Event("resize",a)),te&&this.fire(new e.Event("moveend",a)),this},R.prototype.getBounds=function(){return this.transform.getBounds()},R.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},R.prototype.setMaxBounds=function(a){return this.transform.setMaxBounds(e.LngLatBounds.convert(a)),this._update()},R.prototype.setMinZoom=function(a){if((a=a??-2)>=-2&&a<=this.transform.maxZoom)return this.transform.minZoom=a,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=a,this._update(),this.getZoom()>a&&this.setZoom(a),this;throw new Error("maxZoom must be greater than the current minZoom")},R.prototype.getMaxZoom=function(){return this.transform.maxZoom},R.prototype.setMinPitch=function(a){if((a=a??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(a>=0&&a<=this.transform.maxPitch)return this.transform.minPitch=a,this._update(),this.getPitch()xu)throw new Error("maxPitch must be less than or equal to 60");if(a>=this.transform.minPitch)return this.transform.maxPitch=a,this._update(),this.getPitch()>a&&this.setPitch(a),this;throw new Error("maxPitch must be greater than the current minPitch")},R.prototype.getMaxPitch=function(){return this.transform.maxPitch},R.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},R.prototype.setRenderWorldCopies=function(a){return this.transform.renderWorldCopies=a,this._update()},R.prototype.project=function(a){return this.transform.locationPoint(e.LngLat.convert(a))},R.prototype.unproject=function(a){return this.transform.pointLocation(e.Point.convert(a))},R.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},R.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},R.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},R.prototype._createDelegatedListener=function(a,C,F){var q,te=this;if(a==="mouseenter"||a==="mouseover"){var ue=!1;return{layer:C,listener:F,delegates:{mousemove:function(Ae){var Re=te.getLayer(C)?te.queryRenderedFeatures(Ae.point,{layers:[C]}):[];Re.length?ue||(ue=!0,F.call(te,new Xo(a,te,Ae.originalEvent,{features:Re}))):ue=!1},mouseout:function(){ue=!1}}}}if(a==="mouseleave"||a==="mouseout"){var ve=!1;return{layer:C,listener:F,delegates:{mousemove:function(Ae){(te.getLayer(C)?te.queryRenderedFeatures(Ae.point,{layers:[C]}):[]).length?ve=!0:ve&&(ve=!1,F.call(te,new Xo(a,te,Ae.originalEvent)))},mouseout:function(Ae){ve&&(ve=!1,F.call(te,new Xo(a,te,Ae.originalEvent)))}}}}return{layer:C,listener:F,delegates:(q={},q[a]=function(Ae){var Re=te.getLayer(C)?te.queryRenderedFeatures(Ae.point,{layers:[C]}):[];Re.length&&(Ae.features=Re,F.call(te,Ae),delete Ae.features)},q)}},R.prototype.on=function(a,C,F){if(F===void 0)return X.prototype.on.call(this,a,C);var q=this._createDelegatedListener(a,C,F);for(var te in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[a]=this._delegatedListeners[a]||[],this._delegatedListeners[a].push(q),q.delegates)this.on(te,q.delegates[te]);return this},R.prototype.once=function(a,C,F){if(F===void 0)return X.prototype.once.call(this,a,C);var q=this._createDelegatedListener(a,C,F);for(var te in q.delegates)this.once(te,q.delegates[te]);return this},R.prototype.off=function(a,C,F){var q=this;return F===void 0?X.prototype.off.call(this,a,C):(this._delegatedListeners&&this._delegatedListeners[a]&&function(te){for(var ue=te[a],ve=0;ve180;){var q=i.locationPoint(X);if(q.x>=0&&q.y>=0&&q.x<=i.width&&q.y<=i.height)break;X.lng>i.center.lng?X.lng-=360:X.lng+=360}return X}eo.prototype.down=function(X,R){this.mouseRotate.mousedown(X,R),this.mousePitch&&this.mousePitch.mousedown(X,R),y.disableDrag()},eo.prototype.move=function(X,R){var i=this.map,a=this.mouseRotate.mousemoveWindow(X,R);if(a&&a.bearingDelta&&i.setBearing(i.getBearing()+a.bearingDelta),this.mousePitch){var C=this.mousePitch.mousemoveWindow(X,R);C&&C.pitchDelta&&i.setPitch(i.getPitch()+C.pitchDelta)}},eo.prototype.off=function(){var X=this.element;y.removeEventListener(X,"mousedown",this.mousedown),y.removeEventListener(X,"touchstart",this.touchstart,{passive:!1}),y.removeEventListener(X,"touchmove",this.touchmove),y.removeEventListener(X,"touchend",this.touchend),y.removeEventListener(X,"touchcancel",this.reset),this.offTemp()},eo.prototype.offTemp=function(){y.enableDrag(),y.removeEventListener(e.window,"mousemove",this.mousemove),y.removeEventListener(e.window,"mouseup",this.mouseup)},eo.prototype.mousedown=function(X){this.down(e.extend({},X,{ctrlKey:!0,preventDefault:function(){return X.preventDefault()}}),y.mousePos(this.element,X)),y.addEventListener(e.window,"mousemove",this.mousemove),y.addEventListener(e.window,"mouseup",this.mouseup)},eo.prototype.mousemove=function(X){this.move(X,y.mousePos(this.element,X))},eo.prototype.mouseup=function(X){this.mouseRotate.mouseupWindow(X),this.mousePitch&&this.mousePitch.mouseupWindow(X),this.offTemp()},eo.prototype.touchstart=function(X){X.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=y.touchPos(this.element,X.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return X.preventDefault()}},this._startPos))},eo.prototype.touchmove=function(X){X.targetTouches.length!==1?this.reset():(this._lastPos=y.touchPos(this.element,X.targetTouches)[0],this.move({preventDefault:function(){return X.preventDefault()}},this._lastPos))},eo.prototype.touchend=function(X){X.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=a}this._isDragging&&(this._pos=i.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},R.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},R.prototype._addDragHandler=function(i){this._element.contains(i.originalEvent.target)&&(i.preventDefault(),this._positionDelta=i.point.sub(this._pos).add(this._offset),this._pointerdownPos=i.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))},R.prototype.setDraggable=function(i){return this._draggable=!!i,this._map&&(i?(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},R.prototype.isDraggable=function(){return this._draggable},R.prototype.setRotation=function(i){return this._rotation=i||0,this._update(),this},R.prototype.getRotation=function(){return this._rotation},R.prototype.setRotationAlignment=function(i){return this._rotationAlignment=i||"auto",this._update(),this},R.prototype.getRotationAlignment=function(){return this._rotationAlignment},R.prototype.setPitchAlignment=function(i){return this._pitchAlignment=i&&i!=="auto"?i:this._rotationAlignment,this._update(),this},R.prototype.getPitchAlignment=function(){return this._pitchAlignment},R}(e.Evented),su={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ho=0,_u=!1,da=function(X){function R(i){X.call(this),this.options=e.extend({},su,i),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.onAdd=function(i){return this._map=i,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),a=this._setupUI,Mo!==void 0?a(Mo):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(C){Mo=C.state!=="denied",a(Mo)}):(Mo=!!e.window.navigator.geolocation,a(Mo)),this._container;var a},R.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(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(),y.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ho=0,_u=!1},R.prototype._isOutOfMapMaxBounds=function(i){var a=this._map.getMaxBounds(),C=i.coords;return a&&(C.longitudea.getEast()||C.latitudea.getNorth())},R.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")}},R.prototype._onSuccess=function(i){if(this._map){if(this._isOutOfMapMaxBounds(i))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",i)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=i,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&&this._watchState!=="OFF"&&this._updateMarker(i),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(i),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",i)),this._finish()}},R.prototype._updateCamera=function(i){var a=new e.LngLat(i.coords.longitude,i.coords.latitude),C=i.coords.accuracy,F=this._map.getBearing(),q=e.extend({bearing:F},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(C),q,{geolocateSource:!0})},R.prototype._updateMarker=function(i){if(i){var a=new e.LngLat(i.coords.longitude,i.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=i.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},R.prototype._updateCircleRadius=function(){var i=this._map._container.clientHeight/2,a=this._map.unproject([0,i]),C=this._map.unproject([1,i]),F=a.distanceTo(C),q=Math.ceil(2*this._accuracy/F);this._circleElement.style.width=q+"px",this._circleElement.style.height=q+"px"},R.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},R.prototype._onError=function(i){if(this._map){if(this.options.trackUserLocation)if(i.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(i.code===3&&_u)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",i)),this._finish()}},R.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},R.prototype._setupUI=function(i){var a=this;if(this._container.addEventListener("contextmenu",function(q){return q.preventDefault()}),this._geolocateButton=y.create("button","mapboxgl-ctrl-geolocate",this._container),y.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",i===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var C=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}else{var F=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=F,this._geolocateButton.setAttribute("aria-label",F)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=y.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Il(this._dotElement),this._circleElement=y.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Il({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(q){var te=q.originalEvent&&q.originalEvent.type==="resize";q.geolocateSource||a._watchState!=="ACTIVE_LOCK"||te||(a._watchState="BACKGROUND",a._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),a._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),a.fire(new e.Event("trackuserlocationend")))})},R.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":ho--,_u=!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(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var i;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ho>1?(i={maximumAge:6e5,timeout:0},_u=!0):(i=this.options.positionOptions,_u=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,i)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},R.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)},R}(e.Evented),Ys={maxWidth:100,unit:"metric"},Ai=function(X){this.options=e.extend({},Ys,X),e.bindAll(["_onMove","setUnit"],this)};function xi(X,R,i){var a=i&&i.maxWidth||100,C=X._container.clientHeight/2,F=X.unproject([0,C]),q=X.unproject([a,C]),te=F.distanceTo(q);if(i&&i.unit==="imperial"){var ue=3.2808*te;ue>5280?xa(R,a,ue/5280,X._getUIString("ScaleControl.Miles")):xa(R,a,ue,X._getUIString("ScaleControl.Feet"))}else i&&i.unit==="nautical"?xa(R,a,te/1852,X._getUIString("ScaleControl.NauticalMiles")):te>=1e3?xa(R,a,te/1e3,X._getUIString("ScaleControl.Kilometers")):xa(R,a,te,X._getUIString("ScaleControl.Meters"))}function xa(X,R,i,a){var C,F,q,te=(C=i,(F=Math.pow(10,(""+Math.floor(C)).length-1))*((q=C/F)>=10?10:q>=5?5:q>=3?3:q>=2?2:q>=1?1:function(ve){var Ae=Math.pow(10,Math.ceil(-Math.log(ve)/Math.LN10));return Math.round(ve*Ae)/Ae}(q))),ue=te/i;X.style.width=R*ue+"px",X.innerHTML=te+" "+a}Ai.prototype.getDefaultPosition=function(){return"bottom-left"},Ai.prototype._onMove=function(){xi(this._map,this._container,this.options)},Ai.prototype.onAdd=function(X){return this._map=X,this._container=y.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",X.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ai.prototype.onRemove=function(){y.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ai.prototype.setUnit=function(X){this.options.unit=X,xi(this._map,this._container,this.options)};var es=function(X){this._fullscreen=!1,X&&X.container&&(X.container instanceof e.window.HTMLElement?this._container=X.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")};es.prototype.onAdd=function(X){return this._map=X,this._container||(this._container=this._map.getContainer()),this._controlContainer=y.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},es.prototype.onRemove=function(){y.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},es.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},es.prototype._setupUI=function(){var X=this._fullscreenButton=y.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);y.create("span","mapboxgl-ctrl-icon",X).setAttribute("aria-hidden",!0),X.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},es.prototype._updateTitle=function(){var X=this._getTitle();this._fullscreenButton.setAttribute("aria-label",X),this._fullscreenButton.title=X},es.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},es.prototype._isFullscreen=function(){return this._fullscreen},es.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())},es.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 bu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},js=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),xt=function(X){function R(i){X.call(this),this.options=e.extend(Object.create(bu),i),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return X&&(R.__proto__=X),R.prototype=Object.create(X&&X.prototype),R.prototype.constructor=R,R.prototype.addTo=function(i){return this._map&&this.remove(),this._map=i,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},R.prototype.isOpen=function(){return!!this._map},R.prototype.remove=function(){return this._content&&y.remove(this._content),this._container&&(y.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},R.prototype.getLngLat=function(){return this._lngLat},R.prototype.setLngLat=function(i){return this._lngLat=e.LngLat.convert(i),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},R.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},R.prototype.getElement=function(){return this._container},R.prototype.setText=function(i){return this.setDOMContent(e.window.document.createTextNode(i))},R.prototype.setHTML=function(i){var a,C=e.window.document.createDocumentFragment(),F=e.window.document.createElement("body");for(F.innerHTML=i;a=F.firstChild;)C.appendChild(a);return this.setDOMContent(C)},R.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},R.prototype.setMaxWidth=function(i){return this.options.maxWidth=i,this._update(),this},R.prototype.setDOMContent=function(i){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=y.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(i),this._createCloseButton(),this._update(),this._focusFirstElement(),this},R.prototype.addClassName=function(i){this._container&&this._container.classList.add(i)},R.prototype.removeClassName=function(i){this._container&&this._container.classList.remove(i)},R.prototype.setOffset=function(i){return this.options.offset=i,this._update(),this},R.prototype.toggleClassName=function(i){if(this._container)return this._container.classList.toggle(i)},R.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=y.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))},R.prototype._onMouseUp=function(i){this._update(i.point)},R.prototype._onMouseMove=function(i){this._update(i.point)},R.prototype._onDrag=function(i){this._update(i.point)},R.prototype._update=function(i){var a=this,C=this._lngLat||this._trackPointer;if(this._map&&C&&this._content&&(this._container||(this._container=y.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=y.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(Ue){return a._container.classList.add(Ue)}),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=Cl(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||i)){var F=this._pos=this._trackPointer&&i?i:this._map.project(this._lngLat),q=this.options.anchor,te=Tt(this.options.offset);if(!q){var ue,ve=this._container.offsetWidth,Ae=this._container.offsetHeight;ue=F.y+te.bottom.ythis._map.transform.height-Ae?["bottom"]:[],F.xthis._map.transform.width-ve/2&&ue.push("right"),q=ue.length===0?"bottom":ue.join("-")}var Re=F.add(te[q]).round();y.setTransform(this._container,di[q]+" translate("+Re.x+"px,"+Re.y+"px)"),Fi(this._container,q,"popup")}},R.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var i=this._container.querySelector(js);i&&i.focus()}},R.prototype._onClose=function(){this.remove()},R}(e.Evented);function Tt(X){if(X){if(typeof X=="number"){var R=Math.round(Math.sqrt(.5*Math.pow(X,2)));return{center:new e.Point(0,0),top:new e.Point(0,X),"top-left":new e.Point(R,R),"top-right":new e.Point(-R,R),bottom:new e.Point(0,-X),"bottom-left":new e.Point(R,-R),"bottom-right":new e.Point(-R,-R),left:new e.Point(X,0),right:new e.Point(-X,0)}}if(X instanceof e.Point||Array.isArray(X)){var i=e.Point.convert(X);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.Point.convert(X.center||[0,0]),top:e.Point.convert(X.top||[0,0]),"top-left":e.Point.convert(X["top-left"]||[0,0]),"top-right":e.Point.convert(X["top-right"]||[0,0]),bottom:e.Point.convert(X.bottom||[0,0]),"bottom-left":e.Point.convert(X["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(X["bottom-right"]||[0,0]),left:e.Point.convert(X.left||[0,0]),right:e.Point.convert(X.right||[0,0])}}return Tt(new e.Point(0,0))}var Dt={version:e.version,supported:w,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:$l,NavigationControl:ou,GeolocateControl:da,AttributionControl:io,ScaleControl:Ai,FullscreenControl:es,Popup:xt,Marker:Il,Style:Pr,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){Ft().acquire(rt)},clearPrewarmedResources:function(){var X=Et;X&&(X.isPreloaded()&&X.numActive()===1?(X.release(rt),Et=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(X){e.config.ACCESS_TOKEN=X},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(X){e.config.API_URL=X},get workerCount(){return et.workerCount},set workerCount(X){et.workerCount=X},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(X){e.config.MAX_PARALLEL_IMAGE_REQUESTS=X},clearStorage:function(X){e.clearTileCache(X)},workerUrl:""};return Dt}),b}()},27549:function(D,L,t){D.exports=t(55366)},55366:function(D,L,t){var b=t(31625),d=t(75144),e=t(5137),w=t(78112),y=t(6807),_=t(68650),u=t(83473),r=t(60201),n=t(10275),l=t(62914);function o(s,c){for(var h=c[0],x=c[1],m=1/(c[2]-h),g=1/(c[3]-x),k=new Array(s.length),A=0,v=s.length/2;A>>1;c.dtype||(c.dtype="array"),typeof c.dtype=="string"?m=new(n(c.dtype))(k):c.dtype&&(m=c.dtype,Array.isArray(m)&&(m.length=k));for(var A=0;Ah||Z>1073741824){for(var fe=0;feSe+Ce||oe>Ee+Ce||le=ye||Oe===We)){var Ie=v[Le];We===void 0&&(We=Ie.length);for(var Ve=Oe;Ve=K&&de<=se&&Me>=ae&&Me<=he&&me.push(Pe)}var ke=S[Le],He=ke[4*Oe+0],Fe=ke[4*Oe+1],qe=ke[4*Oe+2],$e=ke[4*Oe+3],Ye=function(Be,Ge){for(var tt=null,nt=0;tt===null;)if(tt=Be[4*Ge+nt],++nt>Be.length)return null;return tt}(ke,Oe+1),_e=.5*Ce,De=Le+1;be(Se,Ee,_e,De,He,Fe||qe||$e||Ye),be(Se,Ee+_e,_e,De,Fe,qe||$e||Ye),be(Se+_e,Ee,_e,De,qe,$e||Ye),be(Se+_e,Ee+_e,_e,De,$e,Ye)}}(0,0,1,0,0,1),me},m;function V(j,$,ee){for(var H=1,J=.5,Q=.5,Z=.5,K=0;Ke&&(e=L[y]),L[y]2&&(Pe=` - `.concat(function(tt,nt){if(nt=Math.floor(nt),tt.length==0||nt==0)return"";var pt=tt.length*nt;for(nt=Math.floor(Math.log(nt)/Math.log(2));nt;)tt+=tt,nt--;return tt+tt.substring(0,pt-tt.length)}(" ",Ve),"^"),Ve=0)}}for(var Me=We[We.length-1],ke=Ie[Ie.length-1];Me===ke&&(Ve++<2?Ce=` + `.concat(function(tt,nt){if(nt=Math.floor(nt),tt.length==0||nt==0)return"";var ft=tt.length*nt;for(nt=Math.floor(Math.log(nt)/Math.log(2));nt;)tt+=tt,nt--;return tt+tt.substring(0,ft-tt.length)}(" ",Ve),"^"),Ve=0)}}for(var Me=We[We.length-1],ke=Ie[Ie.length-1];Me===ke&&(Ve++<2?Ce=` `.concat(Me).concat(Ce):be=Me,We.pop(),Ie.pop(),We.length!==0&&Ie.length!==0);)Me=We[We.length-1],ke=Ie[Ie.length-1];var He=Math.max(We.length,Ie.length);if(He===0){var Fe=Oe.split(` `);if(Fe.length>30)for(Fe[26]="".concat(g,"...").concat(v);Fe.length>27;)Fe.pop();return"".concat(S.notIdentical,` @@ -2841,7 +2841,7 @@ uniform `+Ae+" "+Re+" u_"+Ue+`; should equal `):oe=" ".concat(Q," ").concat(oe)),H=j.call(this,"".concat(ie).concat(oe))}return Error.stackTraceLimit=se,H.generatedMessage=!J,Object.defineProperty(u(H),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),H.code="ERR_ASSERTION",H.actual=K,H.expected=ae,H.operator=Q,Error.captureStackTrace&&Error.captureStackTrace(u(H),Z),H.stack,H.name="AssertionError",_(H)}return N=$,(V=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:E,value:function(ee,H){return h(this,e(e({},H),{},{customInspect:!1,depth:0}))}}])&&w(N.prototype,V),Object.defineProperty(N,"prototype",{writable:!1}),$}(r(Error),h.custom);D.exports=M},34585:function(D,L,t){function b(n){return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},b(n)}function d(n,l){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,s){return o.__proto__=s,o},d(n,l)}function e(n){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},e(n)}var w,y,_={};function u(n,l,o){o||(o=Error);var s=function(c){(function(A,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(v&&v.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),v&&d(A,v)})(k,c);var h,x,m,g=(x=k,m=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var A,v=e(x);if(m){var S=e(this).constructor;A=Reflect.construct(v,arguments,S)}else A=v.apply(this,arguments);return function(T,p){if(p&&(b(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(M){if(M===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M}(T)}(this,A)});function k(A,v,S){var T;return function(p,M){if(!(p instanceof M))throw new TypeError("Cannot call a class as a function")}(this,k),T=g.call(this,function(p,M,f){return typeof l=="string"?l:l(p,M,f)}(A,v,S)),T.code=n,T}return h=k,Object.defineProperty(h,"prototype",{writable:!1}),h}(o);_[n]=s}function r(n,l){if(Array.isArray(n)){var o=n.length;return n=n.map(function(s){return String(s)}),o>2?"one of ".concat(l," ").concat(n.slice(0,o-1).join(", "),", or ")+n[o-1]:o===2?"one of ".concat(l," ").concat(n[0]," or ").concat(n[1]):"of ".concat(l," ").concat(n[0])}return"of ".concat(l," ").concat(String(n))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(n,l,o){var s,c,h,x,m;if(w===void 0&&(w=t(85672)),w(typeof n=="string","'name' must be a string"),typeof l=="string"&&(c="not ",l.substr(0,4)===c)?(s="must not be",l=l.replace(/^not /,"")):s="must be",function(k,A,v){return(v===void 0||v>k.length)&&(v=k.length),k.substring(v-9,v)===A}(n," argument"))h="The ".concat(n," ").concat(s," ").concat(r(l,"type"));else{var g=(typeof m!="number"&&(m=0),m+1>(x=n).length||x.indexOf(".",m)===-1?"argument":"property");h='The "'.concat(n,'" ').concat(g," ").concat(s," ").concat(r(l,"type"))}return h+". Received type ".concat(b(o))},TypeError),u("ERR_INVALID_ARG_VALUE",function(n,l){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=t(56557));var s=y.inspect(l);return s.length>128&&(s="".concat(s.slice(0,128),"...")),"The argument '".concat(n,"' ").concat(o,". Received ").concat(s)},TypeError),u("ERR_INVALID_RETURN_VALUE",function(n,l,o){var s;return s=o&&o.constructor&&o.constructor.name?"instance of ".concat(o.constructor.name):"type ".concat(b(o)),"Expected ".concat(n,' to be returned from the "').concat(l,'"')+" function but got ".concat(s,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var n=arguments.length,l=new Array(n),o=0;o0,"At least one arg needs to be specified");var s="The ",c=l.length;switch(l=l.map(function(h){return'"'.concat(h,'"')}),c){case 1:s+="".concat(l[0]," argument");break;case 2:s+="".concat(l[0]," and ").concat(l[1]," arguments");break;default:s+=l.slice(0,c-1).join(", "),s+=", and ".concat(l[c-1]," arguments")}return"".concat(s," must be specified")},TypeError),D.exports.codes=_},23879:function(D,L,t){function b(le,ge){return function(ye){if(Array.isArray(ye))return ye}(le)||function(ye,me){var be=ye==null?null:typeof Symbol<"u"&&ye[Symbol.iterator]||ye["@@iterator"];if(be!=null){var Se,Ee,Ce,Le,Oe=[],We=!0,Ie=!1;try{if(Ce=(be=be.call(ye)).next,me===0){if(Object(be)!==be)return;We=!1}else for(;!(We=(Se=Ce.call(be)).done)&&(Oe.push(Se.value),Oe.length!==me);We=!0);}catch(Ve){Ie=!0,Ee=Ve}finally{try{if(!We&&be.return!=null&&(Le=be.return(),Object(Le)!==Le))return}finally{if(Ie)throw Ee}}return Oe}}(le,ge)||function(ye,me){if(ye){if(typeof ye=="string")return d(ye,me);var be=Object.prototype.toString.call(ye).slice(8,-1);return be==="Object"&&ye.constructor&&(be=ye.constructor.name),be==="Map"||be==="Set"?Array.from(ye):be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be)?d(ye,me):void 0}}(le,ge)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function d(le,ge){(ge==null||ge>le.length)&&(ge=le.length);for(var ye=0,me=new Array(ge);ye10)return!0;for(var ge=0;ge57)return!0}return le.length===10&&le>=Math.pow(2,32)}function j(le){return Object.keys(le).filter(V).concat(r(le).filter(Object.prototype.propertyIsEnumerable.bind(le)))}function $(le,ge){if(le===ge)return 0;for(var ye=le.length,me=ge.length,be=0,Se=Math.min(ye,me);be"u"?[]:new Uint8Array(256),e=0;e<64;e++)d[b.charCodeAt(e)]=e;var w=function(_){var u,r=new Uint8Array(_),n=r.length,l="";for(u=0;u>2],l+=b[(3&r[u])<<4|r[u+1]>>4],l+=b[(15&r[u+1])<<2|r[u+2]>>6],l+=b[63&r[u+2]];return n%3==2?l=l.substring(0,l.length-1)+"=":n%3==1&&(l=l.substring(0,l.length-2)+"=="),l},y=function(_){var u,r,n,l,o,s=.75*_.length,c=_.length,h=0;_[_.length-1]==="="&&(s--,_[_.length-2]==="="&&s--);var x=new ArrayBuffer(s),m=new Uint8Array(x);for(u=0;u>4,m[h++]=(15&n)<<4|l>>2,m[h++]=(3&l)<<6|63&o;return x}},76226:function(D,L){L.byteLength=function(u){var r=y(u),n=r[0],l=r[1];return 3*(n+l)/4-l},L.toByteArray=function(u){var r,n,l=y(u),o=l[0],s=l[1],c=new d(function(m,g,k){return 3*(g+k)/4-k}(0,o,s)),h=0,x=s>0?o-4:o;for(n=0;n>16&255,c[h++]=r>>8&255,c[h++]=255&r;return s===2&&(r=b[u.charCodeAt(n)]<<2|b[u.charCodeAt(n+1)]>>4,c[h++]=255&r),s===1&&(r=b[u.charCodeAt(n)]<<10|b[u.charCodeAt(n+1)]<<4|b[u.charCodeAt(n+2)]>>2,c[h++]=r>>8&255,c[h++]=255&r),c},L.fromByteArray=function(u){for(var r,n=u.length,l=n%3,o=[],s=16383,c=0,h=n-l;ch?h:c+s));return l===1?(r=u[n-1],o.push(t[r>>2]+t[r<<4&63]+"==")):l===2&&(r=(u[n-2]<<8)+u[n-1],o.push(t[r>>10]+t[r>>4&63]+t[r<<2&63]+"=")),o.join("")};for(var t=[],b=[],d=typeof Uint8Array<"u"?Uint8Array:Array,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)t[w]=e[w],b[e.charCodeAt(w)]=w;function y(u){var r=u.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=u.indexOf("=");return n===-1&&(n=r),[n,n===r?0:4-n%4]}function _(u,r,n){for(var l,o,s=[],c=r;c>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return s.join("")}b["-".charCodeAt(0)]=62,b["_".charCodeAt(0)]=63},31625:function(D){function L(y,_,u,r,n){for(var l=n+1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)>=0?(l=o,n=o-1):r=o+1}return l}function t(y,_,u,r,n){for(var l=n+1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)>0?(l=o,n=o-1):r=o+1}return l}function b(y,_,u,r,n){for(var l=r-1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)<0?(l=o,r=o+1):n=o-1}return l}function d(y,_,u,r,n){for(var l=r-1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)<=0?(l=o,r=o+1):n=o-1}return l}function e(y,_,u,r,n){for(;r<=n;){var l=r+n>>>1,o=y[l],s=u!==void 0?u(o,_):o-_;if(s===0)return l;s<=0?r=l+1:n=l-1}return-1}function w(y,_,u,r,n,l){return typeof u=="function"?l(y,_,u,r===void 0?0:0|r,n===void 0?y.length-1:0|n):l(y,_,void 0,u===void 0?0:0|u,r===void 0?y.length-1:0|r)}D.exports={ge:function(y,_,u,r,n){return w(y,_,u,r,n,L)},gt:function(y,_,u,r,n){return w(y,_,u,r,n,t)},lt:function(y,_,u,r,n){return w(y,_,u,r,n,b)},le:function(y,_,u,r,n){return w(y,_,u,r,n,d)},eq:function(y,_,u,r,n){return w(y,_,u,r,n,e)}}},54689:function(D,L){function t(d){var e=32;return(d&=-d)&&e--,65535&d&&(e-=16),16711935&d&&(e-=8),252645135&d&&(e-=4),858993459&d&&(e-=2),1431655765&d&&(e-=1),e}L.INT_BITS=32,L.INT_MAX=2147483647,L.INT_MIN=-2147483648,L.sign=function(d){return(d>0)-(d<0)},L.abs=function(d){var e=d>>31;return(d^e)-e},L.min=function(d,e){return e^(d^e)&-(d65535)<<4,e|=w=((d>>>=e)>255)<<3,e|=w=((d>>>=w)>15)<<2,(e|=w=((d>>>=w)>3)<<1)|(d>>>=w)>>1},L.log10=function(d){return d>=1e9?9:d>=1e8?8:d>=1e7?7:d>=1e6?6:d>=1e5?5:d>=1e4?4:d>=1e3?3:d>=100?2:d>=10?1:0},L.popCount=function(d){return 16843009*((d=(858993459&(d-=d>>>1&1431655765))+(d>>>2&858993459))+(d>>>4)&252645135)>>>24},L.countTrailingZeros=t,L.nextPow2=function(d){return d+=d===0,--d,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,1+(d|=d>>>16)},L.prevPow2=function(d){return d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,(d|=d>>>16)-(d>>>1)},L.parity=function(d){return d^=d>>>16,d^=d>>>8,d^=d>>>4,27030>>>(d&=15)&1};var b=new Array(256);(function(d){for(var e=0;e<256;++e){var w=e,y=e,_=7;for(w>>>=1;w;w>>>=1)y<<=1,y|=1&w,--_;d[e]=y<<_&255}})(b),L.reverse=function(d){return b[255&d]<<24|b[d>>>8&255]<<16|b[d>>>16&255]<<8|b[d>>>24&255]},L.interleave2=function(d,e){return(d=1431655765&((d=858993459&((d=252645135&((d=16711935&((d&=65535)|d<<8))|d<<4))|d<<2))|d<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},L.deinterleave2=function(d,e){return(d=65535&((d=16711935&((d=252645135&((d=858993459&((d=d>>>e&1431655765)|d>>>1))|d>>>2))|d>>>4))|d>>>16))<<16>>16},L.interleave3=function(d,e,w){return d=1227133513&((d=3272356035&((d=251719695&((d=4278190335&((d&=1023)|d<<16))|d<<8))|d<<4))|d<<2),(d|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(w=1227133513&((w=3272356035&((w=251719695&((w=4278190335&((w&=1023)|w<<16))|w<<8))|w<<4))|w<<2))<<2},L.deinterleave3=function(d,e){return(d=1023&((d=4278190335&((d=251719695&((d=3272356035&((d=d>>>e&1227133513)|d>>>2))|d>>>4))|d>>>8))|d>>>16))<<22>>22},L.nextCombination=function(d){var e=d|d-1;return e+1|(~e&-~e)-1>>>t(d)+1}},88772:function(D,L,t){var b=t(75144);D.exports=function(y,_){_||(_={});var u,r,n,l,o,s,c,h,x,m,g,k=_.cutoff==null?.25:_.cutoff,A=_.radius==null?8:_.radius,v=_.channel||0;if(ArrayBuffer.isView(y)||Array.isArray(y)){if(!_.width||!_.height)throw Error("For raw data width and height should be provided by options");u=_.width,r=_.height,l=y,s=_.stride?_.stride:Math.floor(y.length/u/r)}else window.HTMLCanvasElement&&y instanceof window.HTMLCanvasElement?(c=(h=y).getContext("2d"),u=h.width,r=h.height,l=(x=c.getImageData(0,0,u,r)).data,s=4):window.CanvasRenderingContext2D&&y instanceof window.CanvasRenderingContext2D?(c=y,u=(h=y.canvas).width,r=h.height,l=(x=c.getImageData(0,0,u,r)).data,s=4):window.ImageData&&y instanceof window.ImageData&&(x=y,u=y.width,r=y.height,l=x.data,s=4);if(n=Math.max(u,r),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(o=l,l=Array(u*r),m=0,g=o.length;m-1?d(_):_}},87227:function(D,L,t){var b=t(87547),d=t(71129),e=t(73285),w=t(48631),y=d("%Function.prototype.apply%"),_=d("%Function.prototype.call%"),u=d("%Reflect.apply%",!0)||b.call(_,y),r=t(40891),n=d("%Math.max%");D.exports=function(o){if(typeof o!="function")throw new w("a function is required");var s=u(b,_,arguments);return e(s,1+n(0,o.length-(arguments.length-1)),!0)};var l=function(){return u(b,y,arguments)};r?r(D.exports,"apply",{value:l}):D.exports.apply=l},75144:function(D){D.exports=function(L,t,b){return tb?b:L:Lt?t:L}},46762:function(D,L,t){var b=t(75144);function d(e,w){w==null&&(w=!0);var y=e[0],_=e[1],u=e[2],r=e[3];return r==null&&(r=w?1:255),w&&(y*=255,_*=255,u*=255,r*=255),16777216*(y=255&b(y,0,255))+((_=255&b(_,0,255))<<16)+((u=255&b(u,0,255))<<8)+(255&b(r,0,255))}D.exports=d,D.exports.to=d,D.exports.from=function(e,w){var y=(e=+e)>>>24,_=(16711680&e)>>>16,u=(65280&e)>>>8,r=255&e;return w===!1?[y,_,u,r]:[y/255,_/255,u/255,r/255]}},86040:function(D){D.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]}},162:function(D,L,t){var b=t(16401),d=t(75144),e=t(10275);D.exports=function(w,y){y!=="float"&&y||(y="array"),y==="uint"&&(y="uint8"),y==="uint_clamped"&&(y="uint8_clamped");var _=new(e(y))(4),u=y!=="uint8"&&y!=="uint8_clamped";return w.length&&typeof w!="string"||((w=b(w))[0]/=255,w[1]/=255,w[2]/=255),function(r){return r instanceof Uint8Array||r instanceof Uint8ClampedArray||!!(Array.isArray(r)&&(r[0]>1||r[0]===0)&&(r[1]>1||r[1]===0)&&(r[2]>1||r[2]===0)&&(!r[3]||r[3]>1))}(w)?(_[0]=w[0],_[1]=w[1],_[2]=w[2],_[3]=w[3]!=null?w[3]:255,u&&(_[0]/=255,_[1]/=255,_[2]/=255,_[3]/=255),_):(u?(_[0]=w[0],_[1]=w[1],_[2]=w[2],_[3]=w[3]!=null?w[3]:1):(_[0]=d(Math.floor(255*w[0]),0,255),_[1]=d(Math.floor(255*w[1]),0,255),_[2]=d(Math.floor(255*w[2]),0,255),_[3]=w[3]==null?255:d(Math.floor(255*w[3]),0,255)),_)}},16401:function(D,L,t){var b=t(10826),d=t(52132),e=t(75144);D.exports=function(w){var y,_=b(w);return _.space?((y=Array(3))[0]=e(_.values[0],0,255),y[1]=e(_.values[1],0,255),y[2]=e(_.values[2],0,255),_.space[0]==="h"&&(y=d.rgb(y)),y.push(e(_.alpha,0,1)),y):[]}},10826:function(D,L,t){var b=t(86040);D.exports=function(e){var w,y,_=[],u=1;if(typeof e=="string")if(e=e.toLowerCase(),b[e])_=b[e].slice(),y="rgb";else if(e==="transparent")u=0,y="rgb",_=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var r=e.slice(1);u=1,(o=r.length)<=4?(_=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(u=parseInt(r[3]+r[3],16)/255)):(_=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(u=parseInt(r[6]+r[7],16)/255)),_[0]||(_[0]=0),_[1]||(_[1]=0),_[2]||(_[2]=0),y="rgb"}else if(w=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var n=w[1],l=n==="rgb";y=r=n.replace(/a$/,"");var o=r==="cmyk"?4:r==="gray"?1:3;_=w[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(s,c){if(/%$/.test(s))return c===o?parseFloat(s)/100:r==="rgb"?255*parseFloat(s)/100:parseFloat(s);if(r[c]==="h"){if(/deg$/.test(s))return parseFloat(s);if(d[s]!==void 0)return d[s]}return parseFloat(s)}),n===r&&_.push(1),u=l||_[o]===void 0?1:_[o],_=_.slice(0,o)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(_=e.match(/([0-9]+)/g).map(function(s){return parseFloat(s)}),y=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(_=[e[0],e[1],e[2]],y="rgb",u=e.length===4?e[3]:1):e instanceof Object&&(e.r!=null||e.red!=null||e.R!=null?(y="rgb",_=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(y="hsl",_=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),u=e.a||e.alpha||e.opacity||1,e.opacity!=null&&(u/=100)):(y="rgb",_=[e>>>16,(65280&e)>>>8,255&e]);return{space:y,values:_,alpha:u}};var d={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},52132:function(D,L,t){var b=t(10520);D.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(d){var e,w,y,_,u,r=d[0]/360,n=d[1]/100,l=d[2]/100;if(n===0)return[u=255*l,u,u];e=2*l-(w=l<.5?l*(1+n):l+n-l*n),_=[0,0,0];for(var o=0;o<3;o++)(y=r+.3333333333333333*-(o-1))<0?y++:y>1&&y--,u=6*y<1?e+6*(w-e)*y:2*y<1?w:3*y<2?e+(w-e)*(.6666666666666666-y)*6:e,_[o]=255*u;return _}},b.hsl=function(d){var e,w,y=d[0]/255,_=d[1]/255,u=d[2]/255,r=Math.min(y,_,u),n=Math.max(y,_,u),l=n-r;return n===r?e=0:y===n?e=(_-u)/l:_===n?e=2+(u-y)/l:u===n&&(e=4+(y-_)/l),(e=Math.min(60*e,360))<0&&(e+=360),w=(r+n)/2,[e,100*(n===r?0:w<=.5?l/(n+r):l/(2-n-r)),100*w]}},10520:function(D){D.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},78171:function(D){D.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},59518:function(D,L,t){D.exports={parse:t(86029),stringify:t(38211)}},87724:function(D,L,t){var b=t(23648);D.exports={isSize:function(d){return/^[\d\.]/.test(d)||d.indexOf("/")!==-1||b.indexOf(d)!==-1}}},86029:function(D,L,t){var b=t(80886),d=t(54324),e=t(94316),w=t(99803),y=t(87486),_=t(2362),u=t(28089),r=t(87724).isSize;D.exports=l;var n=l.cache={};function l(s){if(typeof s!="string")throw new Error("Font argument must be a string.");if(n[s])return n[s];if(s==="")throw new Error("Cannot parse an empty string.");if(e.indexOf(s)!==-1)return n[s]={system:s};for(var c,h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},x=u(s,/\s+/);c=x.shift();){if(d.indexOf(c)!==-1)return["style","variant","weight","stretch"].forEach(function(g){h[g]=c}),n[s]=h;if(y.indexOf(c)===-1)if(c!=="normal"&&c!=="small-caps")if(_.indexOf(c)===-1){if(w.indexOf(c)===-1){if(r(c)){var m=u(c,"/");if(h.size=m[0],m[1]!=null?h.lineHeight=o(m[1]):x[0]==="/"&&(x.shift(),h.lineHeight=o(x.shift())),!x.length)throw new Error("Missing required font-family.");return h.family=u(x.join(" "),/\s*,\s*/).map(b),n[s]=h}throw new Error("Unknown or unsupported font token: "+c)}h.weight=c}else h.stretch=c;else h.variant=c;else h.style=c}throw new Error("Missing required font-size.")}function o(s){var c=parseFloat(s);return c.toString()===s?c:s}},38211:function(D,L,t){var b=t(6807),d=t(87724).isSize,e=s(t(54324)),w=s(t(94316)),y=s(t(99803)),_=s(t(87486)),u=s(t(2362)),r={normal:1,"small-caps":1},n={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},l="serif";function o(c,h){if(c&&!h[c]&&!e[c])throw Error("Unknown keyword `"+c+"`");return c}function s(c){for(var h={},x=0;x0?" ".concat(b[5]):""," {")),d+=L(b),e&&(d+="}"),b[2]&&(d+="}"),b[4]&&(d+="}"),d}).join("")},t.i=function(b,d,e,w,y){typeof b=="string"&&(b=[[null,b,void 0]]);var _={};if(e)for(var u=0;u0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=y),d&&(l[2]&&(l[1]="@media ".concat(l[2]," {").concat(l[1],"}")),l[2]=d),w&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=w):l[4]="".concat(w)),t.push(l))}},t}},62133:function(D){D.exports=function(L,t){return t||(t={}),L&&(L=String(L.__esModule?L.default:L),/^['"].*['"]$/.test(L)&&(L=L.slice(1,-1)),t.hash&&(L+=t.hash),/["'() \t\n]|(%20)/.test(L)||t.needQuotes?'"'.concat(L.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):L)}},22413:function(D){D.exports=function(L){return L[1]}},84510:function(D,L,t){var b,d=t(80299),e=t(9557),w=t(6887),y=t(86591),_=t(76504),u=t(29854),r=Function.prototype.bind,n=Object.defineProperty,l=Object.prototype.hasOwnProperty;b=function(o,s,c){var h,x=e(s)&&w(s.value);return delete(h=y(s)).writable,delete h.value,h.get=function(){return!c.overwriteDefinition&&l.call(this,o)?x:(s.value=r.call(x,c.resolveContext?c.resolveContext(this):this),n(this,o,s),this[o])},h},D.exports=function(o){var s=_(arguments[1]);return d(s.resolveContext)&&w(s.resolveContext),u(o,function(c,h){return b(h,c,s)})}},91819:function(D,L,t){var b=t(80299),d=t(63461),e=t(1920),w=t(76504),y=t(2338),_=D.exports=function(u,r){var n,l,o,s,c;return arguments.length<2||typeof u!="string"?(s=r,r=u,u=null):s=arguments[2],b(u)?(n=y.call(u,"c"),l=y.call(u,"e"),o=y.call(u,"w")):(n=o=!0,l=!1),c={value:r,configurable:n,enumerable:l,writable:o},s?e(w(s),c):c};_.gs=function(u,r,n){var l,o,s,c;return typeof u!="string"?(s=n,n=r,r=u,u=null):s=arguments[3],b(r)?d(r)?b(n)?d(n)||(s=n,n=void 0):n=void 0:(s=r,r=n=void 0):r=void 0,b(u)?(l=y.call(u,"c"),o=y.call(u,"e")):(l=!0,o=!1),c={get:r,set:n,configurable:l,enumerable:o},s?e(w(s),c):c}},29725:function(D,L,t){function b(o,s){return os?1:o>=s?0:NaN}t.d(L,{V_:function(){return b},T9:function(){return w},i2:function(){return _},Am:function(){return u},jk:function(){return r},y1:function(){return n},cz:function(){return l}}),(d=b).length===1&&(e=d,d=function(o,s){return b(e(o),s)});var d,e;function w(o,s){var c,h,x=o.length,m=-1;if(s==null){for(;++m=c)for(h=c;++mh&&(h=c)}else for(;++m=c)for(h=c;++mh&&(h=c);return h}function y(o){return o===null?NaN:+o}function _(o,s){var c,h=o.length,x=h,m=-1,g=0;if(s==null)for(;++m=0;)for(s=(h=o[x]).length;--s>=0;)c[--g]=h[s];return c}function r(o,s){var c,h,x=o.length,m=-1;if(s==null){for(;++m=c)for(h=c;++mc&&(h=c)}else for(;++m=c)for(h=c;++mc&&(h=c);return h}function n(o,s,c){o=+o,s=+s,c=(x=arguments.length)<2?(s=o,o=0,1):x<3?1:+c;for(var h=-1,x=0|Math.max(0,Math.ceil((s-o)/c)),m=new Array(x);++h=x.length)return s!=null&&A.sort(s),c!=null?c(A):A;for(var p,M,f,E=-1,I=A.length,B=x[v++],N=w(),V=S();++Ex.length)return A;var S,T=m[v-1];return c!=null&&v>=x.length?S=A.entries():(S=[],A.each(function(p,M){S.push({key:M,values:k(p,v)})})),T!=null?S.sort(function(p,M){return T(p.key,M.key)}):S}return h={object:function(A){return g(A,0,_,u)},map:function(A){return g(A,0,r,n)},entries:function(A){return k(g(A,0,r,n),0)},key:function(A){return x.push(A),h},sortKeys:function(A){return m[x.length-1]=A,h},sortValues:function(A){return s=A,h},rollup:function(A){return c=A,h}}}function _(){return{}}function u(s,c,h){s[c]=h}function r(){return w()}function n(s,c,h){s.set(c,h)}function l(){}var o=w.prototype;l.prototype={constructor:l,has:o.has,add:function(s){return this[b+(s+="")]=s,this},remove:o.remove,clear:o.clear,values:o.keys,size:o.size,empty:o.empty,each:o.each}},32702:function(D,L,t){function b(Ce,Le){var Oe;function We(){var Ie,Ve,Pe=Oe.length,de=0,Me=0;for(Ie=0;Ie=(Ve=(_e+Be)/2))?_e=Ve:Be=Ve,(He=Oe>=(Pe=(De+Ge)/2))?De=Pe:Ge=Pe,Ie=$e,!($e=$e[Fe=He<<1|ke]))return Ie[Fe]=Ye,Ce;if(de=+Ce._x.call(null,$e.data),Me=+Ce._y.call(null,$e.data),Le===de&&Oe===Me)return Ye.next=$e,Ie?Ie[Fe]=Ye:Ce._root=Ye,Ce;do Ie=Ie?Ie[Fe]=new Array(4):Ce._root=new Array(4),(ke=Le>=(Ve=(_e+Be)/2))?_e=Ve:Be=Ve,(He=Oe>=(Pe=(De+Ge)/2))?De=Pe:Ge=Pe;while((Fe=He<<1|ke)==(qe=(Me>=Pe)<<1|de>=Ve));return Ie[qe]=$e,Ie[Fe]=Ye,Ce}function y(Ce,Le,Oe,We,Ie){this.node=Ce,this.x0=Le,this.y0=Oe,this.x1=We,this.y1=Ie}function _(Ce){return Ce[0]}function u(Ce){return Ce[1]}function r(Ce,Le,Oe){var We=new n(Le??_,Oe??u,NaN,NaN,NaN,NaN);return Ce==null?We:We.addAll(Ce)}function n(Ce,Le,Oe,We,Ie,Ve){this._x=Ce,this._y=Le,this._x0=Oe,this._y0=We,this._x1=Ie,this._y1=Ve,this._root=void 0}function l(Ce){for(var Le={data:Ce.data},Oe=Le;Ce=Ce.next;)Oe=Oe.next={data:Ce.data};return Le}t.r(L),t.d(L,{forceCenter:function(){return b},forceCollide:function(){return h},forceLink:function(){return k},forceManyBody:function(){return me},forceRadial:function(){return be},forceSimulation:function(){return ye},forceX:function(){return Se},forceY:function(){return Ee}});var o=r.prototype=n.prototype;function s(Ce){return Ce.x+Ce.vx}function c(Ce){return Ce.y+Ce.vy}function h(Ce){var Le,Oe,We=1,Ie=1;function Ve(){for(var Me,ke,He,Fe,qe,$e,Ye,_e=Le.length,De=0;DeFe+Ht||ptqe+Ht||AtHe.index){var Gt=Fe-wt.x-wt.vx,st=qe-wt.y-wt.vy,Qe=Gt*Gt+st*st;QeMe.r&&(Me.r=Me[ke].r)}function de(){if(Le){var Me,ke,He=Le.length;for(Oe=new Array(He),Me=0;MeHe&&(He=We),IeFe&&(Fe=Ie));if(Me>He||ke>Fe)return this;for(this.cover(Me,ke).cover(He,Fe),Oe=0;OeCe||Ce>=Ie||We>Le||Le>=Ve;)switch(de=(Leqe||(Ve=Me.y0)>$e||(Pe=Me.x1)=Be)<<1|Ce>=De)&&(Me=Ye[Ye.length-1],Ye[Ye.length-1]=Ye[Ye.length-1-ke],Ye[Ye.length-1-ke]=Me)}else{var Ge=Ce-+this._x.call(null,_e.data),tt=Le-+this._y.call(null,_e.data),nt=Ge*Ge+tt*tt;if(nt=(de=(Ye+De)/2))?Ye=de:De=de,(He=Pe>=(Me=(_e+Be)/2))?_e=Me:Be=Me,Le=$e,!($e=$e[Fe=He<<1|ke]))return this;if(!$e.length)break;(Le[Fe+1&3]||Le[Fe+2&3]||Le[Fe+3&3])&&(Oe=Le,qe=Fe)}for(;$e.data!==Ce;)if(We=$e,!($e=$e.next))return this;return(Ie=$e.next)&&delete $e.next,We?(Ie?We.next=Ie:delete We.next,this):Le?(Ie?Le[Fe]=Ie:delete Le[Fe],($e=Le[0]||Le[1]||Le[2]||Le[3])&&$e===(Le[3]||Le[2]||Le[1]||Le[0])&&!$e.length&&(Oe?Oe[qe]=$e:this._root=$e),this):(this._root=Ie,this)},o.removeAll=function(Ce){for(var Le=0,Oe=Ce.length;Le=0&&(ke=Me.slice(He+1),Me=Me.slice(0,He)),Me&&!We.hasOwnProperty(Me))throw new Error("unknown type: "+Me);return{type:Me,name:ke}})),Pe=-1,de=Ve.length;if(!(arguments.length<2)){if(Le!=null&&typeof Le!="function")throw new Error("invalid callback: "+Le);for(;++Pe0)for(var Oe,We,Ie=new Array(Oe),Ve=0;Ve=0&&Le._call.call(null,Ce),Le=Le._next;--I})()}finally{I=0,function(){for(var Ce,Le,Oe=M,We=1/0;Oe;)Oe._call?(We>Oe._time&&(We=Oe._time),Ce=Oe,Oe=Oe._next):(Le=Oe._next,Oe._next=null,Oe=Ce?Ce._next=Le:M=Le);f=Ce,fe(We)}(),$=0}}function he(){var Ce=H.now(),Le=Ce-j;Le>V&&(ee-=Le,j=Ce)}function fe(Ce){I||(B&&(B=clearTimeout(B)),Ce-$>24?(Ce<1/0&&(B=setTimeout(se,Ce-H.now()-ee)),N&&(N=clearInterval(N))):(N||(j=H.now(),N=setInterval(he,V)),I=1,J(se)))}function ie(Ce){return Ce.x}function oe(Ce){return Ce.y}K.prototype=ae.prototype={constructor:K,restart:function(Ce,Le,Oe){if(typeof Ce!="function")throw new TypeError("callback is not a function");Oe=(Oe==null?Q():+Oe)+(Le==null?0:+Le),this._next||f===this||(f?f._next=this:M=this,f=this),this._call=Ce,this._time=Oe,fe()},stop:function(){this._call&&(this._call=null,this._time=1/0,fe())}};var le=10,ge=Math.PI*(3-Math.sqrt(5));function ye(Ce){var Le,Oe=1,We=.001,Ie=1-Math.pow(We,1/300),Ve=0,Pe=.6,de=(0,x.Tj)(),Me=ae(He),ke=E("tick","end");function He(){Fe(),ke.call("tick",Le),Oe1?(_e==null?de.remove(Ye):de.set(Ye,$e(_e)),Le):de.get(Ye)},find:function(Ye,_e,De){var Be,Ge,tt,nt,pt,At=0,wt=Ce.length;for(De==null?De=1/0:De*=De,At=0;At1?(ke.on(Ye,_e),Le):ke.on(Ye)}}}function me(){var Ce,Le,Oe,We,Ie=d(-30),Ve=1,Pe=1/0,de=.81;function Me(qe){var $e,Ye=Ce.length,_e=r(Ce,ie,oe).visitAfter(He);for(Oe=qe,$e=0;$e=Pe)){(qe.data!==Le||qe.next)&&(De===0&&(tt+=(De=e())*De),Be===0&&(tt+=(Be=e())*Be),tt1?g[0]+g.slice(2):g,+h.slice(m+1)]}t.d(L,{GP:function(){return l},OE:function(){return c}});var d,e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function w(h){if(!(x=e.exec(h)))throw new Error("invalid format: "+h);var x;return new y({fill:x[1],align:x[2],sign:x[3],symbol:x[4],zero:x[5],width:x[6],comma:x[7],precision:x[8]&&x[8].slice(1),trim:x[9],type:x[10]})}function y(h){this.fill=h.fill===void 0?" ":h.fill+"",this.align=h.align===void 0?">":h.align+"",this.sign=h.sign===void 0?"-":h.sign+"",this.symbol=h.symbol===void 0?"":h.symbol+"",this.zero=!!h.zero,this.width=h.width===void 0?void 0:+h.width,this.comma=!!h.comma,this.precision=h.precision===void 0?void 0:+h.precision,this.trim=!!h.trim,this.type=h.type===void 0?"":h.type+""}function _(h,x){var m=b(h,x);if(!m)return h+"";var g=m[0],k=m[1];return k<0?"0."+new Array(-k).join("0")+g:g.length>k+1?g.slice(0,k+1)+"."+g.slice(k+1):g+new Array(k-g.length+2).join("0")}w.prototype=y.prototype,y.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,0|this.width))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(h,x){return(100*h).toFixed(x)},b:function(h){return Math.round(h).toString(2)},c:function(h){return h+""},d:function(h){return Math.abs(h=Math.round(h))>=1e21?h.toLocaleString("en").replace(/,/g,""):h.toString(10)},e:function(h,x){return h.toExponential(x)},f:function(h,x){return h.toFixed(x)},g:function(h,x){return h.toPrecision(x)},o:function(h){return Math.round(h).toString(8)},p:function(h,x){return _(100*h,x)},r:_,s:function(h,x){var m=b(h,x);if(!m)return h+"";var g=m[0],k=m[1],A=k-(d=3*Math.max(-8,Math.min(8,Math.floor(k/3))))+1,v=g.length;return A===v?g:A>v?g+new Array(A-v+1).join("0"):A>0?g.slice(0,A)+"."+g.slice(A):"0."+new Array(1-A).join("0")+b(h,Math.max(0,x+A-1))[0]},X:function(h){return Math.round(h).toString(16).toUpperCase()},x:function(h){return Math.round(h).toString(16)}};function r(h){return h}var n,l,o=Array.prototype.map,s=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function c(h){var x,m,g=h.grouping===void 0||h.thousands===void 0?r:(x=o.call(h.grouping,Number),m=h.thousands+"",function(E,I){for(var B=E.length,N=[],V=0,j=x[0],$=0;B>0&&j>0&&($+j+1>I&&(j=Math.max(1,I-$)),N.push(E.substring(B-=j,B+j)),!(($+=j+1)>I));)j=x[V=(V+1)%x.length];return N.reverse().join(m)}),k=h.currency===void 0?"":h.currency[0]+"",A=h.currency===void 0?"":h.currency[1]+"",v=h.decimal===void 0?".":h.decimal+"",S=h.numerals===void 0?r:function(E){return function(I){return I.replace(/[0-9]/g,function(B){return E[+B]})}}(o.call(h.numerals,String)),T=h.percent===void 0?"%":h.percent+"",p=h.minus===void 0?"-":h.minus+"",M=h.nan===void 0?"NaN":h.nan+"";function f(E){var I=(E=w(E)).fill,B=E.align,N=E.sign,V=E.symbol,j=E.zero,$=E.width,ee=E.comma,H=E.precision,J=E.trim,Q=E.type;Q==="n"?(ee=!0,Q="g"):u[Q]||(H===void 0&&(H=12),J=!0,Q="g"),(j||I==="0"&&B==="=")&&(j=!0,I="0",B="=");var Z=V==="$"?k:V==="#"&&/[boxX]/.test(Q)?"0"+Q.toLowerCase():"",K=V==="$"?A:/[%p]/.test(Q)?T:"",ae=u[Q],se=/[defgprs%]/.test(Q);function he(fe){var ie,oe,le,ge=Z,ye=K;if(Q==="c")ye=ae(fe)+ye,fe="";else{var me=(fe=+fe)<0||1/fe<0;if(fe=isNaN(fe)?M:ae(Math.abs(fe),H),J&&(fe=function(Ee){e:for(var Ce,Le=Ee.length,Oe=1,We=-1;Oe0&&(We=0)}return We>0?Ee.slice(0,We)+Ee.slice(Ce+1):Ee}(fe)),me&&+fe==0&&N!=="+"&&(me=!1),ge=(me?N==="("?N:p:N==="-"||N==="("?"":N)+ge,ye=(Q==="s"?s[8+d/3]:"")+ye+(me&&N==="("?")":""),se){for(ie=-1,oe=fe.length;++ie(le=fe.charCodeAt(ie))||le>57){ye=(le===46?v+fe.slice(ie+1):fe.slice(ie))+ye,fe=fe.slice(0,ie);break}}}ee&&!j&&(fe=g(fe,1/0));var be=ge.length+fe.length+ye.length,Se=be<$?new Array($-be+1).join(I):"";switch(ee&&j&&(fe=g(Se+fe,Se.length?$-ye.length:1/0),Se=""),B){case"<":fe=ge+fe+ye+Se;break;case"=":fe=ge+Se+fe+ye;break;case"^":fe=Se.slice(0,be=Se.length>>1)+ge+fe+ye+Se.slice(be);break;default:fe=Se+ge+fe+ye}return S(fe)}return H=H===void 0?6:/[gprs]/.test(Q)?Math.max(1,Math.min(21,H)):Math.max(0,Math.min(20,H)),he.toString=function(){return E+""},he}return{format:f,formatPrefix:function(E,I){var B,N=f(((E=w(E)).type="f",E)),V=3*Math.max(-8,Math.min(8,Math.floor((B=I,((B=b(Math.abs(B)))?B[1]:NaN)/3)))),j=Math.pow(10,-V),$=s[8+V/3];return function(ee){return N(j*ee)+$}}}}n=c({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),l=n.format,n.formatPrefix},75987:function(D,L,t){t.r(L),t.d(L,{geoAiry:function(){return ee},geoAiryRaw:function(){return $},geoAitoff:function(){return J},geoAitoffRaw:function(){return H},geoArmadillo:function(){return Z},geoArmadilloRaw:function(){return Q},geoAugust:function(){return ae},geoAugustRaw:function(){return K},geoBaker:function(){return ie},geoBakerRaw:function(){return fe},geoBerghaus:function(){return ge},geoBerghausRaw:function(){return le},geoBertin1953:function(){return Oe},geoBertin1953Raw:function(){return Le},geoBoggs:function(){return He},geoBoggsRaw:function(){return ke},geoBonne:function(){return _e},geoBonneRaw:function(){return Ye},geoBottomley:function(){return Be},geoBottomleyRaw:function(){return De},geoBromley:function(){return tt},geoBromleyRaw:function(){return Ge},geoChamberlin:function(){return Qe},geoChamberlinAfrica:function(){return st},geoChamberlinRaw:function(){return Ht},geoCollignon:function(){return yt},geoCollignonRaw:function(){return ft},geoCraig:function(){return Pt},geoCraigRaw:function(){return Ot},geoCraster:function(){return Xe},geoCrasterRaw:function(){return lt},geoCylindricalEqualArea:function(){return Tt},geoCylindricalEqualAreaRaw:function(){return ut},geoCylindricalStereographic:function(){return Lt},geoCylindricalStereographicRaw:function(){return vt},geoEckert1:function(){return rt},geoEckert1Raw:function(){return Ut},geoEckert2:function(){return Et},geoEckert2Raw:function(){return et},geoEckert3:function(){return Ft},geoEckert3Raw:function(){return Bt},geoEckert4:function(){return Jt},geoEckert4Raw:function(){return St},geoEckert5:function(){return en},geoEckert5Raw:function(){return qt},geoEckert6:function(){return Zt},geoEckert6Raw:function(){return Wt},geoEisenlohr:function(){return Pn},geoEisenlohrRaw:function(){return un},geoFahey:function(){return mn},geoFaheyRaw:function(){return In},geoFoucaut:function(){return Kn},geoFoucautRaw:function(){return En},geoFoucautSinusoidal:function(){return Tn},geoFoucautSinusoidalRaw:function(){return Ln},geoGilbert:function(){return $n},geoGingery:function(){return hr},geoGingeryRaw:function(){return vr},geoGinzburg4:function(){return Or},geoGinzburg4Raw:function(){return ni},geoGinzburg5:function(){return xr},geoGinzburg5Raw:function(){return Ar},geoGinzburg6:function(){return kn},geoGinzburg6Raw:function(){return Qr},geoGinzburg8:function(){return ur},geoGinzburg8Raw:function(){return Cn},geoGinzburg9:function(){return cr},geoGinzburg9Raw:function(){return Zn},geoGringorten:function(){return Xr},geoGringortenQuincuncial:function(){return _s},geoGringortenRaw:function(){return Er},geoGuyou:function(){return an},geoGuyouRaw:function(){return Yn},geoHammer:function(){return Se},geoHammerRaw:function(){return me},geoHammerRetroazimuthal:function(){return Un},geoHammerRetroazimuthalRaw:function(){return gn},geoHealpix:function(){return Tr},geoHealpixRaw:function(){return ln},geoHill:function(){return Ur},geoHillRaw:function(){return yr},geoHomolosine:function(){return gi},geoHomolosineRaw:function(){return Jr},geoHufnagel:function(){return Yr},geoHufnagelRaw:function(){return ii},geoHyperelliptical:function(){return Pa},geoHyperellipticalRaw:function(){return Wi},geoInterrupt:function(){return Ha},geoInterruptedBoggs:function(){return bs},geoInterruptedHomolosine:function(){return Ki},geoInterruptedMollweide:function(){return To},geoInterruptedMollweideHemispheres:function(){return Os},geoInterruptedQuarticAuthalic:function(){return nc},geoInterruptedSinuMollweide:function(){return ws},geoInterruptedSinusoidal:function(){return Ql},geoKavrayskiy7:function(){return eu},geoKavrayskiy7Raw:function(){return ss},geoLagrange:function(){return Za},geoLagrangeRaw:function(){return vl},geoLarrivee:function(){return Ds},geoLarriveeRaw:function(){return yl},geoLaskowski:function(){return tu},geoLaskowskiRaw:function(){return Nl},geoLittrow:function(){return jl},geoLittrowRaw:function(){return xl},geoLoximuthal:function(){return Vl},geoLoximuthalRaw:function(){return Ul},geoMiller:function(){return Ju},geoMillerRaw:function(){return vs},geoModifiedStereographic:function(){return $a},geoModifiedStereographicAlaska:function(){return gh},geoModifiedStereographicGs48:function(){return Fo},geoModifiedStereographicGs50:function(){return Qu},geoModifiedStereographicLee:function(){return Mu},geoModifiedStereographicMiller:function(){return oa},geoModifiedStereographicRaw:function(){return ju},geoMollweide:function(){return Pe},geoMollweideRaw:function(){return Ve},geoMtFlatPolarParabolic:function(){return ec},geoMtFlatPolarParabolicRaw:function(){return qs},geoMtFlatPolarQuartic:function(){return Fs},geoMtFlatPolarQuarticRaw:function(){return ql},geoMtFlatPolarSinusoidal:function(){return Bo},geoMtFlatPolarSinusoidalRaw:function(){return qo},geoNaturalEarth:function(){return _a.A},geoNaturalEarth2:function(){return Fc},geoNaturalEarth2Raw:function(){return Vu},geoNaturalEarthRaw:function(){return _a.P},geoNellHammer:function(){return Yo},geoNellHammerRaw:function(){return Hs},geoNicolosi:function(){return Qc},geoNicolosiRaw:function(){return rc},geoPatterson:function(){return ro},geoPattersonRaw:function(){return po},geoPeirceQuincuncial:function(){return yu},geoPierceQuincuncial:function(){return yu},geoPolyconic:function(){return qu},geoPolyconicRaw:function(){return mu},geoPolyhedral:function(){return La},geoPolyhedralButterfly:function(){return ic},geoPolyhedralCollignon:function(){return Gl},geoPolyhedralWaterman:function(){return us},geoProject:function(){return Xa},geoQuantize:function(){return ru},geoQuincuncial:function(){return Zl},geoRectangularPolyconic:function(){return Sa},geoRectangularPolyconicRaw:function(){return Tl},geoRobinson:function(){return Mi},geoRobinsonRaw:function(){return kl},geoSatellite:function(){return Ac},geoSatelliteRaw:function(){return Hu},geoSinuMollweide:function(){return Cr},geoSinuMollweideRaw:function(){return Pr},geoSinusoidal:function(){return $e},geoSinusoidalRaw:function(){return qe},geoStitch:function(){return So},geoTimes:function(){return ta},geoTimesRaw:function(){return io},geoTwoPointAzimuthal:function(){return Io},geoTwoPointAzimuthalRaw:function(){return ac},geoTwoPointAzimuthalUsa:function(){return yi},geoTwoPointEquidistant:function(){return sl},geoTwoPointEquidistantRaw:function(){return za},geoTwoPointEquidistantUsa:function(){return xu},geoVanDerGrinten:function(){return dc},geoVanDerGrinten2:function(){return ou},geoVanDerGrinten2Raw:function(){return $s},geoVanDerGrinten3:function(){return Cl},geoVanDerGrinten3Raw:function(){return eo},geoVanDerGrinten4:function(){return Fi},geoVanDerGrinten4Raw:function(){return di},geoVanDerGrintenRaw:function(){return $l},geoWagner:function(){return Il},geoWagner4:function(){return Ys},geoWagner4Raw:function(){return da},geoWagner6:function(){return xi},geoWagner6Raw:function(){return Ai},geoWagner7:function(){return su},geoWagnerRaw:function(){return Mo},geoWiechel:function(){return es},geoWiechelRaw:function(){return xa},geoWinkel3:function(){return js},geoWinkel3Raw:function(){return bu}});var b=t(94684),d=Math.abs,e=Math.atan,w=Math.atan2,y=Math.cos,_=Math.exp,u=Math.floor,r=Math.log,n=Math.max,l=Math.min,o=Math.pow,s=Math.round,c=Math.sign||function(xt){return xt>0?1:xt<0?-1:0},h=Math.sin,x=Math.tan,m=1e-6,g=1e-12,k=Math.PI,A=k/2,v=k/4,S=Math.SQRT1_2,T=N(2),p=N(k),M=2*k,f=180/k,E=k/180;function I(xt){return xt>1?A:xt<-1?-A:Math.asin(xt)}function B(xt){return xt>1?0:xt<-1?k:Math.acos(xt)}function N(xt){return xt>0?Math.sqrt(xt):0}function V(xt){return(_(xt)-_(-xt))/2}function j(xt){return(_(xt)+_(-xt))/2}function $(xt){var kt=x(xt/2),Dt=2*r(y(xt/2))/(kt*kt);function X(R,i){var a=y(R),C=y(i),F=h(i),q=C*a,te=-((1-q?r((1+q)/2)/(1-q):-.5)+Dt/(1+q));return[te*C*h(R),te*F]}return X.invert=function(R,i){var a,C=N(R*R+i*i),F=-xt/2,q=50;if(!C)return[0,0];do{var te=F/2,ue=y(te),ve=h(te),Ae=ve/ue,Re=-r(d(ue));F-=a=(2/Ae*Re-Dt*Ae-C)/(-Re/(ve*ve)+1-Dt/(2*ue*ue))*(ue<0?.7:1)}while(d(a)>m&&--q>0);var Ue=h(F);return[w(R*Ue,C*y(F)),I(i*Ue/C)]},X}function ee(){var xt=A,kt=(0,b.U)($),Dt=kt(xt);return Dt.radius=function(X){return arguments.length?kt(xt=X*E):xt*f},Dt.scale(179.976).clipAngle(147)}function H(xt,kt){var Dt=y(kt),X=function(R){return R?R/Math.sin(R):1}(B(Dt*y(xt/=2)));return[2*Dt*h(xt)*X,h(kt)*X]}function J(){return(0,b.A)(H).scale(152.63)}function Q(xt){var kt=h(xt),Dt=y(xt),X=xt>=0?1:-1,R=x(X*xt),i=(1+kt-Dt)/2;function a(C,F){var q=y(F),te=y(C/=2);return[(1+q)*h(C),(X*F>-w(te,R)-.001?0:10*-X)+i+h(F)*Dt-(1+q)*kt*te]}return a.invert=function(C,F){var q=0,te=0,ue=50;do{var ve=y(q),Ae=h(q),Re=y(te),Ue=h(te),it=1+Re,ct=it*Ae-C,dt=i+Ue*Dt-it*kt*ve-F,bt=it*ve/2,Ct=-Ae*Ue,Mt=kt*it*Ae/2,Vt=Dt*Re+kt*ve*Ue,It=Ct*Mt-Vt*bt,Qt=(dt*Ct-ct*Vt)/It/2,tn=(ct*Mt-dt*bt)/It;d(tn)>2&&(tn/=2),q-=Qt,te-=tn}while((d(Qt)>m||d(tn)>m)&&--ue>0);return X*te>-w(y(q),R)-.001?[2*q,te]:null},a}function Z(){var xt=20*E,kt=xt>=0?1:-1,Dt=x(kt*xt),X=(0,b.U)(Q),R=X(xt),i=R.stream;return R.parallel=function(a){return arguments.length?(Dt=x((kt=(xt=a*E)>=0?1:-1)*xt),X(xt)):xt*f},R.stream=function(a){var C=R.rotate(),F=i(a),q=(R.rotate([0,0]),i(a)),te=R.precision();return R.rotate(C),F.sphere=function(){q.polygonStart(),q.lineStart();for(var ue=-180*kt;kt*ue<180;ue+=90*kt)q.point(ue,90*kt);if(xt)for(;kt*(ue-=3*kt*te)>=-180;)q.point(ue,kt*-w(y(ue*E/2),Dt)*f);q.lineEnd(),q.polygonEnd()},F},R.scale(218.695).center([0,28.0974])}function K(xt,kt){var Dt=x(kt/2),X=N(1-Dt*Dt),R=1+X*y(xt/=2),i=h(xt)*X/R,a=Dt/R,C=i*i,F=a*a;return[1.3333333333333333*i*(3+C-3*F),1.3333333333333333*a*(3+3*C-F)]}function ae(){return(0,b.A)(K).scale(66.1603)}H.invert=function(xt,kt){if(!(xt*xt+4*kt*kt>k*k+m)){var Dt=xt,X=kt,R=25;do{var i,a=h(Dt),C=h(Dt/2),F=y(Dt/2),q=h(X),te=y(X),ue=h(2*X),ve=q*q,Ae=te*te,Re=C*C,Ue=1-Ae*F*F,it=Ue?B(te*F)*N(i=1/Ue):i=0,ct=2*it*te*C-xt,dt=it*q-kt,bt=i*(Ae*Re+it*te*F*ve),Ct=i*(.5*a*ue-2*it*q*C),Mt=.25*i*(ue*C-it*q*Ae*a),Vt=i*(ve*F+it*Re*te),It=Ct*Mt-Vt*bt;if(!It)break;var Qt=(dt*Ct-ct*Vt)/It,tn=(ct*Mt-dt*bt)/It;Dt-=Qt,X-=tn}while((d(Qt)>m||d(tn)>m)&&--R>0);return[Dt,X]}},K.invert=function(xt,kt){if(kt*=.375,!(xt*=.375)&&d(kt)>1)return null;var Dt=1+xt*xt+kt*kt,X=N((Dt-N(Dt*Dt-4*kt*kt))/2),R=I(X)/3,i=X?function(q){return r(q+N(q*q-1))}(d(kt/X))/3:function(q){return r(q+N(q*q+1))}(d(xt))/3,a=y(R),C=j(i),F=C*C-a*a;return[2*c(xt)*w(V(i)*a,.25-F),2*c(kt)*w(C*h(R),.25+F)]};var se=N(8),he=r(1+T);function fe(xt,kt){var Dt=d(kt);return Dtg&&--i>0);return[xt/(y(R)*(se-1/h(R))),c(kt)*R]};var oe=t(61957);function le(xt){var kt=2*k/xt;function Dt(X,R){var i=(0,oe.j)(X,R);if(d(X)>A){var a=w(i[1],i[0]),C=N(i[0]*i[0]+i[1]*i[1]),F=kt*s((a-A)/kt)+A,q=w(h(a-=F),2-y(a));a=F+I(k/C*h(q))-q,i[0]=C*y(a),i[1]=C*h(a)}return i}return Dt.invert=function(X,R){var i=N(X*X+R*R);if(i>A){var a=w(R,X),C=kt*s((a-A)/kt)+A,F=a>C?-1:1,q=i*y(C-a),te=1/x(F*B((q-k)/N(k*(k-2*q)+i*i)));a=C+2*e((te+F*N(te*te-3))/3),X=i*y(a),R=i*h(a)}return oe.j.invert(X,R)},Dt}function ge(){var xt=5,kt=(0,b.U)(le),Dt=kt(xt),X=Dt.stream,R=.01,i=-y(R*E),a=h(R*E);return Dt.lobes=function(C){return arguments.length?kt(xt=+C):xt},Dt.stream=function(C){var F=Dt.rotate(),q=X(C),te=(Dt.rotate([0,0]),X(C));return Dt.rotate(F),q.sphere=function(){te.polygonStart(),te.lineStart();for(var ue=0,ve=360/xt,Ae=2*k/xt,Re=90-180/xt,Ue=A;ue0&&d(X)>m);return a<0?NaN:Dt}function Ce(xt,kt,Dt){return kt===void 0&&(kt=40),Dt===void 0&&(Dt=g),function(X,R,i,a){var C,F,q;i=i===void 0?0:+i,a=a===void 0?0:+a;for(var te=0;teC)i-=F/=2,a-=q/=2;else{C=Re;var Ue=(i>0?-1:1)*Dt,it=(a>0?-1:1)*Dt,ct=xt(i+Ue,a),dt=xt(i,a+it),bt=(ct[0]-ue[0])/Ue,Ct=(ct[1]-ue[1])/Ue,Mt=(dt[0]-ue[0])/it,Vt=(dt[1]-ue[1])/it,It=Vt*bt-Ct*Mt,Qt=(d(It)<.5?.5:1)/It;if(i+=F=(Ae*Mt-ve*Vt)*Qt,a+=q=(ve*Ct-Ae*bt)*Qt,d(F)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return kt.invert=Ce(kt),kt}function Oe(){return(0,b.A)(Le()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function We(xt,kt){var Dt,X=xt*h(kt),R=30;do kt-=Dt=(kt+h(kt)-X)/(1+y(kt));while(d(Dt)>m&&--R>0);return kt/2}function Ie(xt,kt,Dt){function X(R,i){return[xt*R*y(i=We(Dt,i)),kt*h(i)]}return X.invert=function(R,i){return i=I(i/kt),[R/(xt*y(i)),I((2*i+h(2*i))/Dt)]},X}be.invert=function(xt,kt){var Dt=2*I(kt/2);return[xt*y(Dt/2)/y(Dt),Dt]};var Ve=Ie(T/A,T,k);function Pe(){return(0,b.A)(Ve).scale(169.529)}var de=2.00276,Me=1.11072;function ke(xt,kt){var Dt=We(k,kt);return[de*xt/(1/y(kt)+Me/y(Dt)),(kt+T*h(Dt))/de]}function He(){return(0,b.A)(ke).scale(160.857)}function Fe(xt){var kt=0,Dt=(0,b.U)(xt),X=Dt(kt);return X.parallel=function(R){return arguments.length?Dt(kt=R*E):kt*f},X}function qe(xt,kt){return[xt*y(kt),kt]}function $e(){return(0,b.A)(qe).scale(152.63)}function Ye(xt){if(!xt)return qe;var kt=1/x(xt);function Dt(X,R){var i=kt+xt-R,a=i&&X*y(R)/i;return[i*h(a),kt-i*y(a)]}return Dt.invert=function(X,R){var i=N(X*X+(R=kt-R)*R),a=kt+xt-i;return[i/y(a)*w(X,R),a]},Dt}function _e(){return Fe(Ye).scale(123.082).center([0,26.1441]).parallel(45)}function De(xt){function kt(Dt,X){var R=A-X,i=R&&Dt*xt*h(R)/R;return[R*h(i)/xt,A-R*y(i)]}return kt.invert=function(Dt,X){var R=Dt*xt,i=A-X,a=N(R*R+i*i),C=w(R,i);return[(a?a/h(a):1)*C/xt,A-a]},kt}function Be(){var xt=.5,kt=(0,b.U)(De),Dt=kt(xt);return Dt.fraction=function(X){return arguments.length?kt(xt=+X):xt},Dt.scale(158.837)}ke.invert=function(xt,kt){var Dt,X,R=de*kt,i=kt<0?-v:v,a=25;do X=R-T*h(i),i-=Dt=(h(2*i)+2*i-k*h(X))/(2*y(2*i)+2+k*y(X)*T*y(i));while(d(Dt)>m&&--a>0);return X=R-T*h(i),[xt*(1/y(X)+Me/y(i))/de,X]},qe.invert=function(xt,kt){return[xt/y(kt),kt]};var Ge=Ie(1,4/k,k);function tt(){return(0,b.A)(Ge).scale(152.63)}var nt=t(30021),pt=t(30915);function At(xt,kt,Dt,X,R,i){var a,C=y(i);if(d(xt)>1||d(i)>1)a=B(Dt*R+kt*X*C);else{var F=h(xt/2),q=h(i/2);a=2*I(N(F*F+kt*X*q*q))}return d(a)>m?[a,w(X*h(i),kt*R-Dt*X*C)]:[0,0]}function wt(xt,kt,Dt){return B((xt*xt+kt*kt-Dt*Dt)/(2*xt*kt))}function Nt(xt){return xt-2*k*u((xt+k)/(2*k))}function Ht(xt,kt,Dt){for(var X,R=[[xt[0],xt[1],h(xt[1]),y(xt[1])],[kt[0],kt[1],h(kt[1]),y(kt[1])],[Dt[0],Dt[1],h(Dt[1]),y(Dt[1])]],i=R[2],a=0;a<3;++a,i=X)X=R[a],i.v=At(X[1]-i[1],i[3],i[2],X[3],X[2],X[0]-i[0]),i.point=[0,0];var C=wt(R[0].v[0],R[2].v[0],R[1].v[0]),F=wt(R[0].v[0],R[1].v[0],R[2].v[0]),q=k-C;R[2].point[1]=0,R[0].point[0]=-(R[1].point[0]=R[0].v[0]/2);var te=[R[2].point[0]=R[0].point[0]+R[2].v[0]*y(C),2*(R[0].point[1]=R[1].point[1]=R[2].v[0]*h(C))];return function(ue,ve){var Ae,Re=h(ve),Ue=y(ve),it=new Array(3);for(Ae=0;Ae<3;++Ae){var ct=R[Ae];if(it[Ae]=At(ve-ct[1],ct[3],ct[2],Ue,Re,ue-ct[0]),!it[Ae][0])return ct.point;it[Ae][1]=Nt(it[Ae][1]-ct.v[1])}var dt=te.slice();for(Ae=0;Ae<3;++Ae){var bt=Ae==2?0:Ae+1,Ct=wt(R[Ae].v[0],it[Ae][0],it[bt][0]);it[Ae][1]<0&&(Ct=-Ct),Ae?Ae==1?(Ct=F-Ct,dt[0]-=it[Ae][0]*y(Ct),dt[1]-=it[Ae][0]*h(Ct)):(Ct=q-Ct,dt[0]+=it[Ae][0]*y(Ct),dt[1]+=it[Ae][0]*h(Ct)):(dt[0]+=it[Ae][0]*y(Ct),dt[1]-=it[Ae][0]*h(Ct))}return dt[0]/=3,dt[1]/=3,dt}}function Gt(xt){return xt[0]*=E,xt[1]*=E,xt}function st(){return Qe([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Qe(xt,kt,Dt){var X=(0,nt.A)({type:"MultiPoint",coordinates:[xt,kt,Dt]}),R=[-X[0],-X[1]],i=(0,pt.A)(R),a=Ht(Gt(i(xt)),Gt(i(kt)),Gt(i(Dt)));a.invert=Ce(a);var C=(0,b.A)(a).rotate(R),F=C.center;return delete C.rotate,C.center=function(q){return arguments.length?F(i(q)):i.invert(F())},C.clipAngle(90)}function ft(xt,kt){var Dt=N(1-h(kt));return[2/p*xt*Dt,p*(1-Dt)]}function yt(){return(0,b.A)(ft).scale(95.6464).center([0,30])}function Ot(xt){var kt=x(xt);function Dt(X,R){return[X,(X?X/h(X):1)*(h(R)*y(X)-kt*y(R))]}return Dt.invert=kt?function(X,R){X&&(R*=h(X)/X);var i=y(X);return[X,2*w(N(i*i+kt*kt-R*R)-i,kt-R)]}:function(X,R){return[X,I(X?R*x(X)/X:R)]},Dt}function Pt(){return Fe(Ot).scale(249.828).clipAngle(90)}ft.invert=function(xt,kt){var Dt=(Dt=kt/p-1)*Dt;return[Dt>0?xt*N(k/Dt)/2:0,I(1-Dt)]};var at=N(3);function lt(xt,kt){return[at*xt*(2*y(2*kt/3)-1)/p,at*p*h(kt/3)]}function Xe(){return(0,b.A)(lt).scale(156.19)}function ut(xt){var kt=y(xt);function Dt(X,R){return[X*kt,h(R)/kt]}return Dt.invert=function(X,R){return[X/kt,I(R*kt)]},Dt}function Tt(){return Fe(ut).parallel(38.58).scale(195.044)}function vt(xt){var kt=y(xt);function Dt(X,R){return[X*kt,(1+kt)*x(R/2)]}return Dt.invert=function(X,R){return[X/kt,2*e(R/(1+kt))]},Dt}function Lt(){return Fe(vt).scale(124.75)}function Ut(xt,kt){var Dt=N(8/(3*k));return[Dt*xt*(1-d(kt)/k),Dt*kt]}function rt(){return(0,b.A)(Ut).scale(165.664)}function et(xt,kt){var Dt=N(4-3*h(d(kt)));return[2/N(6*k)*xt*Dt,c(kt)*N(2*k/3)*(2-Dt)]}function Et(){return(0,b.A)(et).scale(165.664)}function Bt(xt,kt){var Dt=N(k*(4+k));return[2/Dt*xt*(1+N(1-4*kt*kt/(k*k))),4/Dt*kt]}function Ft(){return(0,b.A)(Bt).scale(180.739)}function St(xt,kt){var Dt=(2+A)*h(kt);kt/=2;for(var X=0,R=1/0;X<10&&d(R)>m;X++){var i=y(kt);kt-=R=(kt+h(kt)*(i+2)-Dt)/(2*i*(1+i))}return[2/N(k*(4+k))*xt*(1+y(kt)),2*N(k/(4+k))*h(kt)]}function Jt(){return(0,b.A)(St).scale(180.739)}function qt(xt,kt){return[xt*(1+y(kt))/N(2+k),2*kt/N(2+k)]}function en(){return(0,b.A)(qt).scale(173.044)}function Wt(xt,kt){for(var Dt=(1+A)*h(kt),X=0,R=1/0;X<10&&d(R)>m;X++)kt-=R=(kt+h(kt)-Dt)/(1+y(kt));return Dt=N(2+k),[xt*(1+y(kt))/Dt,2*kt/Dt]}function Zt(){return(0,b.A)(Wt).scale(173.044)}lt.invert=function(xt,kt){var Dt=3*I(kt/(at*p));return[p*xt/(at*(2*y(2*Dt/3)-1)),Dt]},Ut.invert=function(xt,kt){var Dt=N(8/(3*k)),X=kt/Dt;return[xt/(Dt*(1-d(X)/k)),X]},et.invert=function(xt,kt){var Dt=2-d(kt)/N(2*k/3);return[xt*N(6*k)/(2*Dt),c(kt)*I((4-Dt*Dt)/3)]},Bt.invert=function(xt,kt){var Dt=N(k*(4+k))/2;return[xt*Dt/(1+N(1-kt*kt*(4+k)/(4*k))),kt*Dt/2]},St.invert=function(xt,kt){var Dt=kt*N((4+k)/k)/2,X=I(Dt),R=y(X);return[xt/(2/N(k*(4+k))*(1+R)),I((X+Dt*(R+2))/(2+A))]},qt.invert=function(xt,kt){var Dt=N(2+k),X=kt*Dt/2;return[Dt*xt/(1+y(X)),X]},Wt.invert=function(xt,kt){var Dt=1+A,X=N(Dt/2);return[2*xt*X/(1+y(kt*=X)),I((kt+h(kt))/Dt)]};var on=3+2*T;function un(xt,kt){var Dt=h(xt/=2),X=y(xt),R=N(y(kt)),i=y(kt/=2),a=h(kt)/(i+T*X*R),C=N(2/(1+a*a)),F=N((T*i+(X+Dt)*R)/(T*i+(X-Dt)*R));return[on*(C*(F-1/F)-2*r(F)),on*(C*a*(F+1/F)-2*e(a))]}function Pn(){return(0,b.A)(un).scale(62.5271)}un.invert=function(xt,kt){if(!(Dt=K.invert(xt/1.2,1.065*kt)))return null;var Dt,X=Dt[0],R=Dt[1],i=20;xt/=on,kt/=on;do{var a=X/2,C=R/2,F=h(a),q=y(a),te=h(C),ue=y(C),ve=y(R),Ae=N(ve),Re=te/(ue+T*q*Ae),Ue=Re*Re,it=N(2/(1+Ue)),ct=(T*ue+(q+F)*Ae)/(T*ue+(q-F)*Ae),dt=N(ct),bt=dt-1/dt,Ct=dt+1/dt,Mt=it*bt-2*r(dt)-xt,Vt=it*Re*Ct-2*e(Re)-kt,It=te&&S*Ae*F*Ue/te,Qt=(T*q*ue+Ae)/(2*(ue+T*q*Ae)*(ue+T*q*Ae)*Ae),tn=-.5*Re*it*it*it,Yt=tn*It,vn=tn*Qt,Mn=(Mn=2*ue+T*Ae*(q-F))*Mn*dt,Vn=(T*q*ue*Ae+ve)/Mn,Hn=-T*F*te/(Ae*Mn),Xn=bt*Yt-2*Vn/dt+it*(Vn+Vn/ct),rr=bt*vn-2*Hn/dt+it*(Hn+Hn/ct),Mr=Re*Ct*Yt-2*It/(1+Ue)+it*Ct*It+it*Re*(Vn-Vn/ct),nr=Re*Ct*vn-2*Qt/(1+Ue)+it*Ct*Qt+it*Re*(Hn-Hn/ct),Lr=rr*Mr-nr*Xn;if(!Lr)break;var dr=(Vt*rr-Mt*nr)/Lr,Br=(Mt*Mr-Vt*Xn)/Lr;X-=dr,R=n(-A,l(A,R-Br))}while((d(dr)>m||d(Br)>m)&&--i>0);return d(d(R)-A)X){var ue=N(te),ve=w(q,F),Ae=Dt*s(ve/Dt),Re=ve-Ae,Ue=xt*y(Re),it=(xt*h(Re)-Re*h(Ue))/(A-Ue),ct=Qn(Re,it),dt=(k-xt)/lr(ct,Ue,k);F=ue;var bt,Ct=50;do F-=bt=(xt+lr(ct,Ue,F)*dt-ue)/(ct(F)*dt);while(d(bt)>m&&--Ct>0);q=Re*h(F),FX){var F=N(C),q=w(a,i),te=Dt*s(q/Dt),ue=q-te;i=F*y(ue),a=F*h(ue);for(var ve=i-A,Ae=h(i),Re=a/Ae,Ue=im||d(ve)>m)&&--Ue>0);return[Ae,Re]},F}var ni=jr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Or(){return(0,b.A)(ni).scale(149.995)}var Ar=jr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function xr(){return(0,b.A)(Ar).scale(153.93)}var Qr=jr(5/6*k,-.62636,-.0344,0,1.3493,-.05524,0,.045);function kn(){return(0,b.A)(Qr).scale(130.945)}function Cn(xt,kt){var Dt=xt*xt,X=kt*kt;return[xt*(1-.162388*X)*(.87-952426e-9*Dt*Dt),kt*(1+X/12)]}function ur(){return(0,b.A)(Cn).scale(131.747)}Cn.invert=function(xt,kt){var Dt,X=xt,R=kt,i=50;do{var a=R*R;R-=Dt=(R*(1+a/12)-kt)/(1+a/4)}while(d(Dt)>m&&--i>0);i=50,xt/=1-.162388*a;do{var C=(C=X*X)*C;X-=Dt=(X*(.87-952426e-9*C)-xt)/(.87-.00476213*C)}while(d(Dt)>m&&--i>0);return[X,R]};var Zn=jr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function cr(){return(0,b.A)(Zn).scale(131.087)}function Ir(xt){var kt=xt(A,0)[0]-xt(-A,0)[0];function Dt(X,R){var i=X>0?-.5:.5,a=xt(X+i*k,R);return a[0]-=i*kt,a}return xt.invert&&(Dt.invert=function(X,R){var i=X>0?-.5:.5,a=xt.invert(X+i*kt,R),C=a[0]-i*k;return C<-k?C+=2*k:C>k&&(C-=2*k),a[0]=C,a}),Dt}function Er(xt,kt){var Dt=c(xt),X=c(kt),R=y(kt),i=y(xt)*R,a=h(xt)*R,C=h(X*kt);xt=d(w(a,C)),kt=I(i),d(xt-A)>m&&(xt%=A);var F=function(q,te){if(te===A)return[0,0];var ue,ve,Ae=h(te),Re=Ae*Ae,Ue=Re*Re,it=1+Ue,ct=1+3*Ue,dt=1-Ue,bt=I(1/N(it)),Ct=dt+Re*it*bt,Mt=(1-Ae)/Ct,Vt=N(Mt),It=Mt*it,Qt=N(It),tn=Vt*dt;if(q===0)return[0,-(tn+Re*Qt)];var Yt,vn=y(te),Mn=1/vn,Vn=2*Ae*vn,Hn=(-Ct*vn-(1-Ae)*((-3*Re+bt*ct)*Vn))/(Ct*Ct),Xn=-Mn*Vn,rr=-Mn*(Re*it*Hn+Mt*ct*Vn),Mr=-2*Mn*(dt*(.5*Hn/Vt)-2*Re*Vt*Vn),nr=4*q/k;if(q>.222*k||te.175*k){if(ue=(tn+Re*N(It*(1+Ue)-tn*tn))/(1+Ue),q>k/4)return[ue,ue];var Lr=ue,dr=.5*ue;ue=.5*(dr+Lr),ve=50;do{var Br=ue*(Mr+Xn*N(It-ue*ue))+rr*I(ue/Qt)-nr;if(!Br)break;Br<0?dr=ue:Lr=ue,ue=.5*(dr+Lr)}while(d(Lr-dr)>m&&--ve>0)}else{ue=m,ve=25;do{var Sr=ue*ue,Vr=N(It-Sr),fi=Mr+Xn*Vr,Nr=ue*fi+rr*I(ue/Qt)-nr;ue-=Yt=Vr?Nr/(fi+(rr-Xn*Sr)/Vr):0}while(d(Yt)>m&&--ve>0)}return[ue,-tn-Re*N(It-ue*ue)]}(xt>k/4?A-xt:xt,kt);return xt>k/4&&(C=F[0],F[0]=-F[1],F[1]=-C),F[0]*=Dt,F[1]*=-X,F}function Xr(){return(0,b.A)(Ir(Er)).scale(239.75)}function ai(xt,kt){var Dt,X,R,i,a,C;if(kt=1-m)return Dt=(1-kt)/4,R=1/(X=j(xt)),[(i=((C=_(2*(C=xt)))-1)/(C+1))+Dt*((a=X*V(xt))-xt)/(X*X),R-Dt*i*R*(a-xt),R+Dt*i*R*(a+xt),2*e(_(xt))-A+Dt*(a-xt)/X];var F=[1,0,0,0,0,0,0,0,0],q=[N(kt),0,0,0,0,0,0,0,0],te=0;for(X=N(1-kt),a=1;d(q[te]/F[te])>m&&te<8;)Dt=F[te++],q[te]=(Dt-X)/2,F[te]=(Dt+X)/2,X=N(Dt*X),a*=2;R=a*F[te]*xt;do R=(I(i=q[te]*h(X=R)/F[te])+R)/2;while(--te);return[h(R),i=y(R),i/y(R-X),R]}function bn(xt,kt){if(!kt)return xt;if(kt===1)return r(x(xt/2+v));for(var Dt=1,X=N(1-kt),R=N(kt),i=0;d(R)>m;i++){if(xt%k){var a=e(X*x(xt)/Dt);a<0&&(a+=k),xt+=a+~~(xt/k)*k}else xt+=xt;R=(Dt+X)/2,X=N(Dt*X),R=((Dt=R)-X)/2}return xt/(o(2,i)*Dt)}function Yn(xt,kt){var Dt=(T-1)/(T+1),X=N(1-Dt*Dt),R=bn(A,X*X),i=r(x(k/4+d(kt)/2)),a=_(-1*i)/N(Dt),C=function(q,te){var ue=q*q,ve=te+1,Ae=1-ue-te*te;return[.5*((q>=0?A:-A)-w(Ae,2*q)),-.25*r(Ae*Ae+4*ue)+.5*r(ve*ve+ue)]}(a*y(-1*xt),a*h(-1*xt)),F=function(q,te,ue){var ve=d(q),Ae=V(d(te));if(ve){var Re=1/h(ve),Ue=1/(x(ve)*x(ve)),it=-(Ue+ue*(Ae*Ae*Re*Re)-1+ue),ct=(-it+N(it*it-(ue-1)*Ue*4))/2;return[bn(e(1/N(ct)),ue)*c(q),bn(e(N((ct/Ue-1)/ue)),1-ue)*c(te)]}return[0,bn(e(Ae),1-ue)*c(te)]}(C[0],C[1],X*X);return[-F[1],(kt>=0?1:-1)*(.5*R-F[0])]}function an(){return(0,b.A)(Ir(Yn)).scale(151.496)}Er.invert=function(xt,kt){d(xt)>1&&(xt=2*c(xt)-xt),d(kt)>1&&(kt=2*c(kt)-kt);var Dt=c(xt),X=c(kt),R=-Dt*xt,i=-X*kt,a=i/R<1,C=function(ue,ve){for(var Ae=0,Re=1,Ue=.5,it=50;;){var ct=Ue*Ue,dt=N(Ue),bt=I(1/N(1+ct)),Ct=1-ct+Ue*(1+ct)*bt,Mt=(1-dt)/Ct,Vt=N(Mt),It=Mt*(1+ct),Qt=Vt*(1-ct),tn=N(It-ue*ue),Yt=ve+Qt+Ue*tn;if(d(Re-Ae)0?Ae=Ue:Re=Ue,Ue=.5*(Ae+Re)}if(!it)return null;var vn=I(dt),Mn=y(vn),Vn=1/Mn,Hn=2*dt*Mn,Xn=(-Ct*Mn-(-3*Ue+bt*(1+3*ct))*Hn*(1-dt))/(Ct*Ct);return[k/4*(ue*(-2*Vn*((1-ct)*(.5*Xn/Vt)-2*Ue*Vt*Hn)+-Vn*Hn*tn)+-Vn*(Ue*(1+ct)*Xn+Mt*(1+3*ct)*Hn)*I(ue/N(It))),vn]}(a?i:R,a?R:i),F=C[0],q=C[1],te=y(q);return a&&(F=-A-F),[Dt*(w(h(F)*te,-h(q))+k),X*I(y(F)*te)]},Yn.invert=function(xt,kt){var Dt,X,R,i,a,C,F=(T-1)/(T+1),q=N(1-F*F),te=(X=-xt,R=q*q,(Dt=.5*bn(A,q*q)-kt)?(i=ai(Dt,R),X?(C=(a=ai(X,1-R))[1]*a[1]+R*i[0]*i[0]*a[0]*a[0],[[i[0]*a[2]/C,i[1]*i[2]*a[0]*a[1]/C],[i[1]*a[1]/C,-i[0]*i[2]*a[0]*a[2]/C],[i[2]*a[1]*a[2]/C,-R*i[0]*i[1]*a[0]/C]]):[[i[0],0],[i[1],0],[i[2],0]]):[[0,(a=ai(X,1-R))[0]/a[1]],[1/a[1],0],[a[2]/a[1],0]]),ue=function(ve,Ae){var Re=Ae[0]*Ae[0]+Ae[1]*Ae[1];return[(ve[0]*Ae[0]+ve[1]*Ae[1])/Re,(ve[1]*Ae[0]-ve[0]*Ae[1])/Re]}(te[0],te[1]);return[w(ue[1],ue[0])/-1,2*e(_(-.5*r(F*ue[0]*ue[0]+F*ue[1]*ue[1])))-A]};var _n=t(39127);function gn(xt){var kt=h(xt),Dt=y(xt),X=qn(xt);function R(i,a){var C=X(i,a);i=C[0],a=C[1];var F=h(a),q=y(a),te=y(i),ue=B(kt*F+Dt*q*te),ve=h(ue),Ae=d(ve)>m?ue/ve:1;return[Ae*Dt*h(i),(d(i)>A?Ae:-Ae)*(kt*q-Dt*F*te)]}return X.invert=qn(-xt),R.invert=function(i,a){var C=N(i*i+a*a),F=-h(C),q=y(C),te=C*q,ue=-a*F,ve=C*kt,Ae=N(te*te+ue*ue-ve*ve),Re=w(te*ve+ue*Ae,ue*ve-te*Ae),Ue=(C>A?-1:1)*w(i*F,C*y(Re)*q+a*h(Re)*F);return X.invert(Ue,Re)},R}function qn(xt){var kt=h(xt),Dt=y(xt);return function(X,R){var i=y(R),a=y(X)*i,C=h(X)*i,F=h(R);return[w(C,a*Dt-F*kt),I(F*Dt+a*kt)]}}function Un(){var xt=0,kt=(0,b.U)(gn),Dt=kt(xt),X=Dt.rotate,R=Dt.stream,i=(0,_n.A)();return Dt.parallel=function(a){if(!arguments.length)return xt*f;var C=Dt.rotate();return kt(xt=a*E).rotate(C)},Dt.rotate=function(a){return arguments.length?(X.call(Dt,[a[0],a[1]-xt*f]),i.center([-a[0],-a[1]]),Dt):((a=X.call(Dt))[1]+=xt*f,a)},Dt.stream=function(a){return(a=R(a)).sphere=function(){a.polygonStart();var C,F=i.radius(89.99)().coordinates[0],q=F.length-1,te=-1;for(a.lineStart();++te=0;)a.point((C=F[te])[0],C[1]);a.lineEnd(),a.polygonEnd()},a},Dt.scale(79.4187).parallel(45).clipAngle(179.999)}var tr=t(29725),Wn=t(20465),Bn=I(1-1/3)*f,dn=ut(0);function ln(xt){var kt=Bn*E,Dt=ft(k,kt)[0]-ft(-k,kt)[0],X=dn(0,kt)[1],R=ft(0,kt)[1],i=p-R,a=M/xt,C=4/M,F=X+i*i*4/M;function q(te,ue){var ve,Ae=d(ue);if(Ae>kt){var Re=l(xt-1,n(0,u((te+k)/a)));(ve=ft(te+=k*(xt-1)/xt-Re*a,Ae))[0]=ve[0]*M/Dt-M*(xt-1)/(2*xt)+Re*M/xt,ve[1]=X+4*(ve[1]-R)*i/M,ue<0&&(ve[1]=-ve[1])}else ve=dn(te,ue);return ve[0]*=C,ve[1]/=F,ve}return q.invert=function(te,ue){te/=C;var ve=d(ue*=F);if(ve>X){var Ae=l(xt-1,n(0,u((te+k)/a)));te=(te+k*(xt-1)/xt-Ae*a)*Dt/M;var Re=ft.invert(te,.25*(ve-X)*M/i+R);return Re[0]-=k*(xt-1)/xt-Ae*a,ue<0&&(Re[1]=-Re[1]),Re}return dn.invert(te,ue)},q}function An(xt,kt){return[xt,1&kt?90-m:Bn]}function er(xt,kt){return[xt,1&kt?-90+m:-Bn]}function br(xt){return[xt[0]*(1-m),xt[1]]}function Tr(){var xt=4,kt=(0,b.U)(ln),Dt=kt(xt),X=Dt.stream;return Dt.lobes=function(R){return arguments.length?kt(xt=+R):xt},Dt.stream=function(R){var i=Dt.rotate(),a=X(R),C=(Dt.rotate([0,0]),X(R));return Dt.rotate(i),a.sphere=function(){var F,q;(0,Wn.A)((F=180/xt,q=[].concat((0,tr.y1)(-180,180+F/2,F).map(An),(0,tr.y1)(180,-180-F/2,-F).map(er)),{type:"Polygon",coordinates:[F===180?q.map(br):q]}),C)},a},Dt.scale(239.75)}function yr(xt){var kt,Dt=1+xt,X=I(h(1/Dt)),R=2*N(k/(kt=k+4*X*Dt)),i=.5*R*(Dt+N(xt*(2+xt))),a=xt*xt,C=Dt*Dt;function F(q,te){var ue,ve,Ae=1-h(te);if(Ae&&Ae<2){var Re,Ue=A-te,it=25;do{var ct=h(Ue),dt=y(Ue),bt=X+w(ct,Dt-dt),Ct=1+C-2*Dt*dt;Ue-=Re=(Ue-a*X-Dt*ct+Ct*bt-.5*Ae*kt)/(2*Dt*ct*bt)}while(d(Re)>g&&--it>0);ue=R*N(Ct),ve=q*bt/k}else ue=R*(xt+Ae),ve=q*X/k;return[ue*h(ve),i-ue*y(ve)]}return F.invert=function(q,te){var ue=q*q+(te-=i)*te,ve=(1+C-ue/(R*R))/(2*Dt),Ae=B(ve),Re=h(Ae),Ue=X+w(Re,Dt-ve);return[I(q/N(ue))*k/Ue,I(1-2*(Ae-a*X-Dt*Re+(1+C-2*Dt*ve)*Ue)/kt)]},F}function Ur(){var xt=1,kt=(0,b.U)(yr),Dt=kt(xt);return Dt.ratio=function(X){return arguments.length?kt(xt=+X):xt},Dt.scale(167.774).center([0,18.67])}var Rr=.7109889596207567,$r=.0528035274542;function Pr(xt,kt){return kt>-Rr?((xt=Ve(xt,kt))[1]+=$r,xt):qe(xt,kt)}function Cr(){return(0,b.A)(Pr).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Jr(xt,kt){return d(kt)>Rr?((xt=Ve(xt,kt))[1]-=kt>0?$r:-$r,xt):qe(xt,kt)}function gi(){return(0,b.A)(Jr).scale(152.63)}function ii(xt,kt,Dt,X){var R=N(4*k/(2*Dt+(1+xt-kt/2)*h(2*Dt)+(xt+kt)/2*h(4*Dt)+kt/2*h(6*Dt))),i=N(X*h(Dt)*N((1+xt*y(2*Dt)+kt*y(4*Dt))/(1+xt+kt))),a=Dt*F(1);function C(ue){return N(1+xt*y(2*ue)+kt*y(4*ue))}function F(ue){var ve=ue*Dt;return(2*ve+(1+xt-kt/2)*h(2*ve)+(xt+kt)/2*h(4*ve)+kt/2*h(6*ve))/Dt}function q(ue){return C(ue)*h(ue)}var te=function(ue,ve){var Ae=Dt*Ee(F,a*h(ve)/Dt,ve/k);isNaN(Ae)&&(Ae=Dt*c(ve));var Re=R*C(Ae);return[Re*i*ue/k*y(Ae),Re/i*h(Ae)]};return te.invert=function(ue,ve){var Ae=Ee(q,ve*i/R);return[ue*k/(y(Ae)*R*i*C(Ae)),I(Dt*F(Ae/Dt)/a)]},Dt===0&&(R=N(X/k),(te=function(ue,ve){return[ue*R,h(ve)/R]}).invert=function(ue,ve){return[ue/R,I(ve*R)]}),te}function Yr(){var xt=1,kt=0,Dt=45*E,X=2,R=(0,b.U)(ii),i=R(xt,kt,Dt,X);return i.a=function(a){return arguments.length?R(xt=+a,kt,Dt,X):xt},i.b=function(a){return arguments.length?R(xt,kt=+a,Dt,X):kt},i.psiMax=function(a){return arguments.length?R(xt,kt,Dt=+a*E,X):Dt*f},i.ratio=function(a){return arguments.length?R(xt,kt,Dt,X=+a):X},i.scale(180.739)}function oi(xt,kt,Dt,X,R,i,a,C,F,q,te){if(te.nanEncountered)return NaN;var ue,ve,Ae,Re,Ue,it,ct,dt,bt,Ct;if(ve=xt(kt+.25*(ue=Dt-kt)),Ae=xt(Dt-.25*ue),isNaN(ve))te.nanEncountered=!0;else{if(!isNaN(Ae))return Ct=((it=(Re=ue*(X+4*ve+R)/12)+(Ue=ue*(R+4*Ae+i)/12))-a)/15,q>F?(te.maxDepthCount++,it+Ct):Math.abs(Ct)Ae?Ue=it:Re=it,it=Re+Ue>>1;while(it>Re);var ct=F[it+1]-F[it];return ct&&(ct=(Ae-F[it+1])/ct),(it+1+ct)/a}var ue=2*te(1)/k*i/Dt,ve=function(Ae,Re){var Ue=te(d(h(Re))),it=X(Ue)*Ae;return Ue/=ue,[it,Re>=0?Ue:-Ue]};return ve.invert=function(Ae,Re){var Ue;return d(Re*=ue)<1&&(Ue=c(Re)*I(R(d(Re))*i)),[Ae/X(d(Re)),Ue]},ve}function Pa(){var xt=0,kt=2.5,Dt=1.183136,X=(0,b.U)(Wi),R=X(xt,kt,Dt);return R.alpha=function(i){return arguments.length?X(xt=+i,kt,Dt):xt},R.k=function(i){return arguments.length?X(xt,kt=+i,Dt):kt},R.gamma=function(i){return arguments.length?X(xt,kt,Dt=+i):Dt},R.scale(152.63)}function ji(xt,kt){return d(xt[0]-kt[0])ue[ve][2][0];++ve);var Re=xt(F-ue[ve][1][0],q);return Re[0]+=xt(ue[ve][1][0],te*q>te*ue[ve][0][1]?ue[ve][0][1]:q)[0],Re}Dt?i.invert=Dt(i):xt.invert&&(i.invert=function(F,q){for(var te=R[+(q<0)],ue=kt[+(q<0)],ve=0,Ae=te.length;ve=0;--it)ue=(te=q[1][it])[0][0],ve=te[0][1],Ae=te[1][1],Re=te[2][0],Ue=te[2][1],ct.push(Vo([[Re-m,Ue-m],[Re-m,Ae+m],[ue+m,Ae+m],[ue+m,ve-m]],30));return{type:"Polygon",coordinates:[(0,tr.Am)(ct)]}}(F),kt=F.map(function(q){return q.map(function(te){return[[te[0][0]*E,te[0][1]*E],[te[1][0]*E,te[1][1]*E],[te[2][0]*E,te[2][1]*E]]})}),R=kt.map(function(q){return q.map(function(te){var ue,ve=xt(te[0][0],te[0][1])[0],Ae=xt(te[2][0],te[2][1])[0],Re=xt(te[1][0],te[0][1])[1],Ue=xt(te[1][0],te[1][1])[1];return Re>Ue&&(ue=Re,Re=Ue,Ue=ue),[[ve,Re],[Ae,Ue]]})}),a):kt.map(function(q){return q.map(function(te){return[[te[0][0]*f,te[0][1]*f],[te[1][0]*f,te[1][1]*f],[te[2][0]*f,te[2][1]*f]]})})},kt!=null&&a.lobes(kt),a}Pr.invert=function(xt,kt){return kt>-Rr?Ve.invert(xt,kt-$r):qe.invert(xt,kt)},Jr.invert=function(xt,kt){return d(kt)>Rr?Ve.invert(xt,kt+(kt>0?$r:-$r)):qe.invert(xt,kt)};var Oa=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function bs(){return Ha(ke,Oa).scale(160.857)}var lo=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ki(){return Ha(Jr,lo).scale(152.63)}var os=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function To(){return Ha(Ve,os).scale(169.529)}var fo=[[[[-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 Os(){return Ha(Ve,fo).scale(169.529).rotate([20,0])}var Ta=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function ws(){return Ha(Pr,Ta,Ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Bl=[[[[-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 Ql(){return Ha(qe,Bl).scale(152.63).rotate([-20,0])}function ss(xt,kt){return[3/M*xt*N(k*k/3-kt*kt),kt]}function eu(){return(0,b.A)(ss).scale(158.837)}function vl(xt){function kt(Dt,X){if(d(d(X)-A)2)return null;var i=(Dt/=2)*Dt,a=(X/=2)*X,C=2*X/(1+i+a);return C=o((1+C)/(1-C),1/xt),[w(2*Dt,1-i-a)/xt,I((C-1)/(C+1))]},kt}function Za(){var xt=.5,kt=(0,b.U)(vl),Dt=kt(xt);return Dt.spacing=function(X){return arguments.length?kt(xt=+X):xt},Dt.scale(124.75)}ss.invert=function(xt,kt){return[M/3*xt/N(k*k/3-kt*kt),kt]};var ko=k/T;function yl(xt,kt){return[xt*(1+N(y(kt)))/2,kt/(y(kt/2)*y(xt/6))]}function Ds(){return(0,b.A)(yl).scale(97.2672)}function Nl(xt,kt){var Dt=xt*xt,X=kt*kt;return[xt*(.975534+X*(-.0143059*Dt-.119161+-.0547009*X)),kt*(1.00384+Dt*(.0802894+-.02855*X+199025e-9*Dt)+X*(.0998909+-.0491032*X))]}function tu(){return(0,b.A)(Nl).scale(139.98)}function xl(xt,kt){return[h(xt)/y(kt),x(kt)*y(xt)]}function jl(){return(0,b.A)(xl).scale(144.049).clipAngle(89.999)}function Ul(xt){var kt=y(xt),Dt=x(v+xt/2);function X(R,i){var a=i-xt,C=d(a)=0;)ve=(ue=xt[te])[0]+F*(i=ve)-q*Ae,Ae=ue[1]+F*Ae+q*i;return[ve=F*(i=ve)-q*Ae,Ae=F*Ae+q*i]}return Dt.invert=function(X,R){var i=20,a=X,C=R;do{for(var F,q=kt,te=xt[q],ue=te[0],ve=te[1],Ae=0,Re=0;--q>=0;)Ae=ue+a*(F=Ae)-C*Re,Re=ve+a*Re+C*F,ue=(te=xt[q])[0]+a*(F=ue)-C*ve,ve=te[1]+a*ve+C*F;var Ue,it,ct=(Ae=ue+a*(F=Ae)-C*Re)*Ae+(Re=ve+a*Re+C*F)*Re;a-=Ue=((ue=a*(F=ue)-C*ve-X)*Ae+(ve=a*ve+C*F-R)*Re)/ct,C-=it=(ve*Ae-ue*Re)/ct}while(d(Ue)+d(it)>m*m&&--i>0);if(i){var dt=N(a*a+C*C),bt=2*e(.5*dt),Ct=h(bt);return[w(a*Ct,dt*y(bt)),dt?I(C*Ct/dt):0]}},Dt}yl.invert=function(xt,kt){var Dt=d(xt),X=d(kt),R=m,i=A;Xm||d(it)>m)&&--R>0);return R&&[Dt,X]},xl.invert=function(xt,kt){var Dt=xt*xt,X=kt*kt+1,R=Dt+X,i=xt?S*N((R-N(R*R-4*Dt))/Dt):1/N(X);return[I(xt*i),c(kt)*B(i)]},vs.invert=function(xt,kt){return[xt,2.5*e(_(.8*kt))-.625*k]};var Su=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],pc=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Rs=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Vs=[[.9245,0],[0,0],[.01943,0]],Uu=[[.721316,0],[0,0],[-.00881625,-.00617325]];function gh(){return $a(Su,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Fo(){return $a(pc,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Qu(){return $a(Rs,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function oa(){return $a(Vs,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Mu(){return $a(Uu,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function $a(xt,kt){var Dt=(0,b.A)(ju(xt)).rotate(kt).clipAngle(90),X=(0,pt.A)(kt),R=Dt.center;return delete Dt.rotate,Dt.center=function(i){return arguments.length?R(X(i)):X.invert(R())},Dt}var Ya=N(6),ys=N(7);function qs(xt,kt){var Dt=I(7*h(kt)/(3*Ya));return[Ya*xt*(2*y(2*Dt/3)-1)/ys,9*h(Dt/3)/ys]}function ec(){return(0,b.A)(qs).scale(164.859)}function ql(xt,kt){for(var Dt,X=(1+S)*h(kt),R=kt,i=0;i<25&&(R-=Dt=(h(R/2)+h(R)-X)/(.5*y(R/2)+y(R)),!(d(Dt)g&&--C>0);return[xt/(.84719-.13063*(X=a*a)+(i=X*(R=X*X))*i*(.05494*X-.04515-.02326*R+.00331*i)),a]},Hs.invert=function(xt,kt){for(var Dt=kt/2,X=0,R=1/0;X<10&&d(R)>m;++X){var i=y(kt/2);kt-=R=(kt-x(kt/2)-Dt)/(1-.5/(i*i))}return[2*xt/(1+y(kt)),kt]};var tc=[[[[-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 nc(){return Ha(me(1/0),tc).rotate([20,0]).scale(152.63)}function rc(xt,kt){var Dt=h(kt),X=y(kt),R=c(xt);if(xt===0||d(kt)===A)return[0,kt];if(kt===0)return[xt,0];if(d(xt)===A)return[xt*X,A*Dt];var i=k/(2*xt)-2*xt/k,a=2*kt/k,C=(1-a*a)/(Dt-a),F=i*i,q=C*C,te=1+F/q,ue=1+q/F,ve=(i*Dt/C-i/2)/te,Ae=(q*Dt/F+C/2)/ue,Re=Ae*Ae-(q*Dt*Dt/F+C*Dt-1)/ue;return[A*(ve+N(ve*ve+X*X/te)*R),A*(Ae+N(Re<0?0:Re)*c(-kt*i)*R)]}function Qc(){return(0,b.A)(rc).scale(127.267)}rc.invert=function(xt,kt){var Dt=(xt/=A)*xt,X=Dt+(kt/=A)*kt,R=k*k;return[xt?(X-1+N((1-X)*(1-X)+4*Dt))/(2*xt)*A:0,Ee(function(i){return X*(k*h(i)-2*i)*k+4*i*i*(kt-h(i))+2*k*i-R*kt},0)]};var _l=1.0148,Hl=.23185,Gs=-.14499,pr=.02406,Dr=_l,Zr=5*Hl,Li=7*Gs,ia=9*pr,sa=1.790857183;function po(xt,kt){var Dt=kt*kt;return[xt,kt*(_l+Dt*Dt*(Hl+Dt*(Gs+pr*Dt)))]}function ro(){return(0,b.A)(po).scale(139.319)}function mu(xt,kt){if(d(kt)sa?kt=sa:kt<-1.790857183&&(kt=-1.790857183);var Dt,X=kt;do{var R=X*X;X-=Dt=(X*(_l+R*R*(Hl+R*(Gs+pr*R)))-kt)/(Dr+R*R*(Zr+R*(Li+ia*R)))}while(d(Dt)>m);return[xt,X]},mu.invert=function(xt,kt){if(d(kt)m&&--i>0);return a=x(R),[(d(kt)=0;)if(Qt=Vt[Mn],It[0]===Qt[0]&&It[1]===Qt[1]){if(Yt)return[Yt,It];Yt=It}}}(F.face,q.face),ue=(Ue=te.map(q.project),it=te.map(F.project),ct=Zs(Ue[1],Ue[0]),dt=Zs(it[1],it[0]),bt=function(Mt,Vt){return w(Mt[0]*Vt[1]-Mt[1]*Vt[0],Mt[0]*Vt[0]+Mt[1]*Vt[1])}(ct,dt),Ct=vu(ct)/vu(dt),bl([1,0,Ue[0][0],0,1,Ue[0][1]],bl([Ct,0,0,0,Ct,0],bl([y(bt),h(bt),0,-h(bt),y(bt),0],[1,0,-it[0][0],0,1,-it[0][1]]))));F.transform=q.transform?bl(q.transform,ue):ue;for(var ve=q.edges,Ae=0,Re=ve.length;Ae0?[-X[0],0]:[180-X[0],180])};var kt=wl.map(function(Dt){return{face:Dt,project:xt(Dt)}});return[-1,0,0,1,0,1,4,5].forEach(function(Dt,X){var R=kt[Dt];R&&(R.children||(R.children=[])).push(kt[X])}),La(kt[0],function(Dt,X){return kt[Dt<-k/2?X<0?6:4:Dt<0?X<0?2:0:DtF^dt>F&&C<(ct-Re)*(F-Ue)/(dt-Ue)+Re&&(q=!q)}return q}(R[0],X))return R.push(Dt),!0})||xt.push([Dt])}),Ko=[],xt.length?xt.length>1?{type:"MultiPolygon",coordinates:xt}:{type:"Polygon",coordinates:xt[0]}:null}};function Zl(xt){var kt=xt(A,0)[0]-xt(-A,0)[0];function Dt(X,R){var i=d(X)0?X-k:X+k,R),C=(a[0]-a[1])*S,F=(a[0]+a[1])*S;if(i)return[C,F];var q=kt*S,te=C>0^F>0?-1:1;return[te*C-c(F)*q,te*F-c(C)*q]}return xt.invert&&(Dt.invert=function(X,R){var i=(X+R)*S,a=(R-X)*S,C=d(i)<.5*kt&&d(a)<.5*kt;if(!C){var F=kt*S,q=i>0^a>0?-1:1,te=-q*X+(a>0?1:-1)*F,ue=-q*R+(i>0?1:-1)*F;i=(-te-ue)*S,a=(te-ue)*S}var ve=xt.invert(i,a);return C||(ve[0]+=i>0?k:-k),ve}),(0,b.A)(Dt).rotate([-90,-90,45]).clipAngle(179.999)}function _s(){return Zl(Er).scale(176.423)}function yu(){return Zl(Yn).scale(111.48)}function ru(xt,kt){if(!(0<=(kt=+kt)&&kt<=20))throw new Error("invalid digits");function Dt(q){var te=q.length,ue=2,ve=new Array(te);for(ve[0]=+q[0].toFixed(kt),ve[1]=+q[1].toFixed(kt);ue2||Ae[0]!=te[0]||Ae[1]!=te[1])&&(ue.push(Ae),te=Ae)}return ue.length===1&&q.length>1&&ue.push(Dt(q[q.length-1])),ue}function i(q){return q.map(R)}function a(q){if(q==null)return q;var te;switch(q.type){case"GeometryCollection":te={type:"GeometryCollection",geometries:q.geometries.map(a)};break;case"Point":te={type:"Point",coordinates:Dt(q.coordinates)};break;case"MultiPoint":te={type:q.type,coordinates:X(q.coordinates)};break;case"LineString":te={type:q.type,coordinates:R(q.coordinates)};break;case"MultiLineString":case"Polygon":te={type:q.type,coordinates:i(q.coordinates)};break;case"MultiPolygon":te={type:"MultiPolygon",coordinates:q.coordinates.map(i)};break;default:return q}return q.bbox!=null&&(te.bbox=q.bbox),te}function C(q){var te={type:"Feature",properties:q.properties,geometry:a(q.geometry)};return q.id!=null&&(te.id=q.id),q.bbox!=null&&(te.bbox=q.bbox),te}if(xt!=null)switch(xt.type){case"Feature":return C(xt);case"FeatureCollection":var F={type:"FeatureCollection",features:xt.features.map(C)};return xt.bbox!=null&&(F.bbox=xt.bbox),F;default:return a(xt)}return xt}function Tl(xt){var kt=h(xt);function Dt(X,R){var i=kt?x(X*kt/2)/kt:X/2;if(!R)return[2*i,-xt];var a=2*e(i*h(R)),C=1/x(R);return[h(a)*C,R+(1-y(a))*C-xt]}return Dt.invert=function(X,R){if(d(R+=xt)m&&--F>0);var ve=X*(q=x(C)),Ae=x(d(R)0?A:-A)*(q+i*(ue-C)/2+i*i*(ue-2*q+C)/2)]}function Mi(){return(0,b.A)(kl).scale(152.63)}function Hu(xt,kt){var Dt=function(a){function C(F,q){var te=y(q),ue=(a-1)/(a-te*y(F));return[ue*te*h(F),ue*h(q)]}return C.invert=function(F,q){var te=F*F+q*q,ue=N(te),ve=(a-N(1-te*(a+1)/(a-1)))/((a-1)/ue+ue/(a-1));return[w(F*ve,ue*N(1-ve*ve)),ue?I(q*ve/ue):0]},C}(xt);if(!kt)return Dt;var X=y(kt),R=h(kt);function i(a,C){var F=Dt(a,C),q=F[1],te=q*R/(xt-1)+X;return[F[0]*X/te,q/te]}return i.invert=function(a,C){var F=(xt-1)/(xt-1-C*R);return Dt.invert(F*a,F*C*X)},i}function Ac(){var xt=2,kt=0,Dt=(0,b.U)(Hu),X=Dt(xt,kt);return X.distance=function(R){return arguments.length?Dt(xt=+R,kt):xt},X.tilt=function(R){return arguments.length?Dt(xt,kt=R*E):kt*f},X.scale(432.147).clipAngle(B(1/xt)*f-1e-6)}ua.forEach(function(xt){xt[1]*=1.0144}),kl.invert=function(xt,kt){var Dt=kt/A,X=90*Dt,R=l(18,d(X/5)),i=n(0,u(R));do{var a=ua[i][1],C=ua[i+1][1],F=ua[l(19,i+2)][1],q=F-a,te=F-2*C+a,ue=2*(d(Dt)-C)/q,ve=te/q,Ae=ue*(1-ve*ue*(1-2*ve*ue));if(Ae>=0||i===1){X=(kt>=0?5:-5)*(Ae+R);var Re,Ue=50;do Ae=(R=l(18,d(X)/5))-(i=u(R)),a=ua[i][1],C=ua[i+1][1],F=ua[l(19,i+2)][1],X-=(Re=(kt>=0?A:-A)*(C+Ae*(F-a)/2+Ae*Ae*(F-2*C+a)/2)-kt)*f;while(d(Re)>g&&--Ue>0);break}}while(--i>=0);var it=ua[i][0],ct=ua[i+1][0],dt=ua[l(19,i+2)][0];return[xt/(ct+Ae*(dt-it)/2+Ae*Ae*(dt-2*ct+it)/2),X*E]};var Al=1e-4,il=1e4,Sl=-180,Ml=Sl+Al,li=180,hs=li-Al,al=-90,Na=al+Al,Ns=90,iu=Ns-Al;function El(xt){return xt.length>0}function ks(xt){return xt===al||xt===Ns?[0,xt]:[Sl,(kt=xt,Math.floor(kt*il)/il)];var kt}function au(xt){var kt=xt[0],Dt=xt[1],X=!1;return kt<=Ml?(kt=Sl,X=!0):kt>=hs&&(kt=li,X=!0),Dt<=Na?(Dt=al,X=!0):Dt>=iu&&(Dt=Ns,X=!0),X?[kt,Dt]:xt}function As(xt){return xt.map(au)}function Jo(xt,kt,Dt){for(var X=0,R=xt.length;X=hs||te<=Na||te>=iu){i[a]=au(F);for(var ue=a+1;ueMl&&AeNa&&Re=C)break;Dt.push({index:-1,polygon:kt,ring:i=i.slice(ue-1)}),i[0]=ks(i[0][1]),a=-1,C=i.length}}}}function ol(xt){var kt,Dt,X,R,i,a,C=xt.length,F={},q={};for(kt=0;kt0?k-C:C)*f],q=(0,b.A)(xt(a)).rotate(F),te=(0,pt.A)(F),ue=q.center;return delete q.rotate,q.center=function(ve){return arguments.length?ue(te(ve)):te.invert(ue())},q.clipAngle(90)}function ac(xt){var kt=y(xt);function Dt(X,R){var i=(0,Aa.T)(X,R);return i[0]*=kt,i}return Dt.invert=function(X,R){return Aa.T.invert(X/kt,R)},Dt}function yi(){return Io([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Io(xt,kt){return Qo(ac,xt,kt)}function za(xt){if(!(xt*=2))return oe.j;var kt=-xt/2,Dt=-kt,X=xt*xt,R=x(Dt),i=.5/h(Dt);function a(C,F){var q=B(y(F)*y(C-kt)),te=B(y(F)*y(C-Dt));return[((q*=q)-(te*=te))/(2*xt),(F<0?-1:1)*N(4*X*te-(X-q+te)*(X-q+te))/(2*xt)]}return a.invert=function(C,F){var q,te,ue=F*F,ve=y(N(ue+(q=C+kt)*q)),Ae=y(N(ue+(q=C+Dt)*q));return[w(te=ve-Ae,q=(ve+Ae)*R),(F<0?-1:1)*B(N(q*q+te*te)*i)]},a}function xu(){return sl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function sl(xt,kt){return Qo(za,xt,kt)}function $l(xt,kt){if(d(kt)m&&--C>0);return[c(xt)*(N(R*R+4)+R)*k/4,A*a]};var ho=4*k+3*N(3),_u=2*N(2*k*N(3)/ho),da=Ie(_u*N(3)/k,_u,ho/6);function Ys(){return(0,b.A)(da).scale(176.84)}function Ai(xt,kt){return[xt*N(1-3*kt*kt/(k*k)),kt]}function xi(){return(0,b.A)(Ai).scale(152.63)}function xa(xt,kt){var Dt=y(kt),X=y(xt)*Dt,R=1-X,i=y(xt=w(h(xt)*Dt,-h(kt))),a=h(xt);return[a*(Dt=N(1-X*X))-i*R,-i*Dt-a*R]}function es(){return(0,b.A)(xa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function bu(xt,kt){var Dt=H(xt,kt);return[(Dt[0]+xt/A)/2,(Dt[1]+kt)/2]}function js(){return(0,b.A)(bu).scale(158.837)}Ai.invert=function(xt,kt){return[xt/N(1-3*kt*kt/(k*k)),kt]},xa.invert=function(xt,kt){var Dt=(xt*xt+kt*kt)/-2,X=N(-Dt*(2+Dt)),R=kt*Dt+xt*X,i=xt*Dt-kt*X,a=N(i*i+R*R);return[w(X*R,a*(1+Dt)),a?-I(X*i/a):0]},bu.invert=function(xt,kt){var Dt=xt,X=kt,R=25;do{var i,a=y(X),C=h(X),F=h(2*X),q=C*C,te=a*a,ue=h(Dt),ve=y(Dt/2),Ae=h(Dt/2),Re=Ae*Ae,Ue=1-te*ve*ve,it=Ue?B(a*ve)*N(i=1/Ue):i=0,ct=.5*(2*it*a*Ae+Dt/A)-xt,dt=.5*(it*C+X)-kt,bt=.5*i*(te*Re+it*a*ve*q)+.5/A,Ct=i*(ue*F/4-it*C*Ae),Mt=.125*i*(F*Ae-it*C*te*ue),Vt=.5*i*(q*ve+it*Re*a)+.5,It=Ct*Mt-Vt*bt,Qt=(dt*Ct-ct*Vt)/It,tn=(ct*Mt-dt*bt)/It;Dt-=Qt,X-=tn}while((d(Qt)>m||d(tn)>m)&&--R>0);return[Dt,X]}},49353:function(D,L,t){function b(){return new d}function d(){this.reset()}t.d(L,{A:function(){return b}}),d.prototype={constructor:d,reset:function(){this.s=this.t=0},add:function(y){w(e,y,this.t),w(this,e.s,this.s),this.s?this.t+=e.t:this.s=e.t},valueOf:function(){return this.s}};var e=new d;function w(y,_,u){var r=y.s=_+u,n=r-_,l=r-n;y.t=_-l+(u-n)}},43976:function(D,L,t){t.d(L,{Ay:function(){return g},B0:function(){return l},Y7:function(){return s}});var b,d,e,w,y,_=t(49353),u=t(61323),r=t(53341),n=t(20465),l=(0,_.A)(),o=(0,_.A)(),s={point:r.A,lineStart:r.A,lineEnd:r.A,polygonStart:function(){l.reset(),s.lineStart=c,s.lineEnd=h},polygonEnd:function(){var k=+l;o.add(k<0?u.FA+k:k),this.lineStart=this.lineEnd=this.point=r.A},sphere:function(){o.add(u.FA)}};function c(){s.point=x}function h(){m(b,d)}function x(k,A){s.point=m,b=k,d=A,k*=u.F2,A*=u.F2,e=k,w=(0,u.gn)(A=A/2+u.gz),y=(0,u.F8)(A)}function m(k,A){k*=u.F2,A=(A*=u.F2)/2+u.gz;var v=k-e,S=v>=0?1:-1,T=S*v,p=(0,u.gn)(A),M=(0,u.F8)(A),f=y*M,E=w*p+f*(0,u.gn)(T),I=f*S*(0,u.F8)(T);l.add((0,u.FP)(I,E)),e=k,w=p,y=M}function g(k){return o.reset(),(0,n.A)(k,s),2*o}},43212:function(D,L,t){t.d(L,{A:function(){return B}});var b,d,e,w,y,_,u,r,n,l,o=t(49353),s=t(43976),c=t(20375),h=t(61323),x=t(20465),m=(0,o.A)(),g={point:k,lineStart:v,lineEnd:S,polygonStart:function(){g.point=T,g.lineStart=p,g.lineEnd=M,m.reset(),s.Y7.polygonStart()},polygonEnd:function(){s.Y7.polygonEnd(),g.point=k,g.lineStart=v,g.lineEnd=S,s.B0<0?(b=-(e=180),d=-(w=90)):m>h.Ni?w=90:m<-h.Ni&&(d=-90),l[0]=b,l[1]=e},sphere:function(){b=-(e=180),d=-(w=90)}};function k(N,V){n.push(l=[b=N,e=N]),Vw&&(w=V)}function A(N,V){var j=(0,c.jf)([N*h.F2,V*h.F2]);if(r){var $=(0,c.r8)(r,j),ee=[$[1],-$[0],0],H=(0,c.r8)(ee,$);(0,c.Cx)(H),H=(0,c.EV)(H);var J,Q=N-y,Z=Q>0?1:-1,K=H[0]*h.uj*Z,ae=(0,h.tn)(Q)>180;ae^(Z*yw&&(w=J):ae^(Z*y<(K=(K+360)%360-180)&&Kw&&(w=V)),ae?Nf(b,e)&&(e=N):f(N,e)>f(b,e)&&(b=N):e>=b?(Ne&&(e=N)):N>y?f(b,N)>f(b,e)&&(e=N):f(N,e)>f(b,e)&&(b=N)}else n.push(l=[b=N,e=N]);Vw&&(w=V),r=j,y=N}function v(){g.point=A}function S(){l[0]=b,l[1]=e,g.point=k,r=null}function T(N,V){if(r){var j=N-y;m.add((0,h.tn)(j)>180?j+(j>0?360:-360):j)}else _=N,u=V;s.Y7.point(N,V),A(N,V)}function p(){s.Y7.lineStart()}function M(){T(_,u),s.Y7.lineEnd(),(0,h.tn)(m)>h.Ni&&(b=-(e=180)),l[0]=b,l[1]=e,r=null}function f(N,V){return(V-=N)<0?V+360:V}function E(N,V){return N[0]-V[0]}function I(N,V){return N[0]<=N[1]?N[0]<=V&&V<=N[1]:Vf($[0],$[1])&&($[1]=ee[1]),f(ee[0],$[1])>f($[0],$[1])&&($[0]=ee[0])):H.push($=ee);for(J=-1/0,V=0,$=H[j=H.length-1];V<=j;$=ee,++V)ee=H[V],(Q=f($[1],ee[0]))>J&&(J=Q,b=ee[0],e=$[1])}return n=l=null,b===1/0||d===1/0?[[NaN,NaN],[NaN,NaN]]:[[b,d],[e,w]]}},20375:function(D,L,t){t.d(L,{Cx:function(){return r},EV:function(){return d},W8:function(){return w},ep:function(){return _},jf:function(){return e},ly:function(){return u},r8:function(){return y}});var b=t(61323);function d(n){return[(0,b.FP)(n[1],n[0]),(0,b.qR)(n[2])]}function e(n){var l=n[0],o=n[1],s=(0,b.gn)(o);return[s*(0,b.gn)(l),s*(0,b.F8)(l),(0,b.F8)(o)]}function w(n,l){return n[0]*l[0]+n[1]*l[1]+n[2]*l[2]}function y(n,l){return[n[1]*l[2]-n[2]*l[1],n[2]*l[0]-n[0]*l[2],n[0]*l[1]-n[1]*l[0]]}function _(n,l){n[0]+=l[0],n[1]+=l[1],n[2]+=l[2]}function u(n,l){return[n[0]*l,n[1]*l,n[2]*l]}function r(n){var l=(0,b.RZ)(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=l,n[1]/=l,n[2]/=l}},30021:function(D,L,t){t.d(L,{A:function(){return j}});var b,d,e,w,y,_,u,r,n,l,o,s,c,h,x,m,g=t(61323),k=t(53341),A=t(20465),v={sphere:k.A,point:S,lineStart:p,lineEnd:E,polygonStart:function(){v.lineStart=I,v.lineEnd=B},polygonEnd:function(){v.lineStart=p,v.lineEnd=E}};function S($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee);T(H*(0,g.gn)($),H*(0,g.F8)($),(0,g.F8)(ee))}function T($,ee,H){++b,e+=($-e)/b,w+=(ee-w)/b,y+=(H-y)/b}function p(){v.point=M}function M($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee);h=H*(0,g.gn)($),x=H*(0,g.F8)($),m=(0,g.F8)(ee),v.point=f,T(h,x,m)}function f($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee),J=H*(0,g.gn)($),Q=H*(0,g.F8)($),Z=(0,g.F8)(ee),K=(0,g.FP)((0,g.RZ)((K=x*Z-m*Q)*K+(K=m*J-h*Z)*K+(K=h*Q-x*J)*K),h*J+x*Q+m*Z);d+=K,_+=K*(h+(h=J)),u+=K*(x+(x=Q)),r+=K*(m+(m=Z)),T(h,x,m)}function E(){v.point=S}function I(){v.point=N}function B(){V(s,c),v.point=S}function N($,ee){s=$,c=ee,$*=g.F2,ee*=g.F2,v.point=V;var H=(0,g.gn)(ee);h=H*(0,g.gn)($),x=H*(0,g.F8)($),m=(0,g.F8)(ee),T(h,x,m)}function V($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee),J=H*(0,g.gn)($),Q=H*(0,g.F8)($),Z=(0,g.F8)(ee),K=x*Z-m*Q,ae=m*J-h*Z,se=h*Q-x*J,he=(0,g.RZ)(K*K+ae*ae+se*se),fe=(0,g.qR)(he),ie=he&&-fe/he;n+=ie*K,l+=ie*ae,o+=ie*se,d+=fe,_+=fe*(h+(h=J)),u+=fe*(x+(x=Q)),r+=fe*(m+(m=Z)),T(h,x,m)}function j($){b=d=e=w=y=_=u=r=n=l=o=0,(0,A.A)($,v);var ee=n,H=l,J=o,Q=ee*ee+H*H+J*J;return Q0?sc)&&(s+=o*e.FA));for(var g,k=s;o>0?k>c:k0?d.pi:-d.pi,o=(0,d.tn)(r-y);(0,d.tn)(o-d.pi)0?d.TW:-d.TW),e.point(u,_),e.lineEnd(),e.lineStart(),e.point(l,_),e.point(r,_),w=0):u!==l&&o>=d.pi&&((0,d.tn)(y-u)d.Ni?(0,d.rY)(((0,d.F8)(c)*(g=(0,d.gn)(x))*(0,d.F8)(h)-(0,d.F8)(x)*(m=(0,d.gn)(c))*(0,d.F8)(s))/(m*g*k)):(c+x)/2}(y,_,r,n),e.point(u,_),e.lineEnd(),e.lineStart(),e.point(l,_),w=0),e.point(y=r,_=n),u=l},lineEnd:function(){e.lineEnd(),y=_=NaN},clean:function(){return 2-w}}},function(e,w,y,_){var u;if(e==null)u=y*d.TW,_.point(-d.pi,u),_.point(0,u),_.point(d.pi,u),_.point(d.pi,0),_.point(d.pi,-u),_.point(0,-u),_.point(-d.pi,-u),_.point(-d.pi,0),_.point(-d.pi,u);else if((0,d.tn)(e[0]-w[0])>d.Ni){var r=e[0]1&&w.push(w.pop().concat(w.shift()))},result:function(){var y=w;return w=[],e=null,y}}}},47402:function(D,L,t){t.d(L,{A:function(){return _}});var b=t(20375),d=t(39127),e=t(61323),w=t(28759),y=t(13720);function _(u){var r=(0,e.gn)(u),n=6*e.F2,l=r>0,o=(0,e.tn)(r)>e.Ni;function s(x,m){return(0,e.gn)(x)*(0,e.gn)(m)>r}function c(x,m,g){var k=(0,b.jf)(x),A=(0,b.jf)(m),v=[1,0,0],S=(0,b.r8)(k,A),T=(0,b.W8)(S,S),p=S[0],M=T-p*p;if(!M)return!g&&x;var f=r*T/M,E=-r*p/M,I=(0,b.r8)(v,S),B=(0,b.ly)(v,f),N=(0,b.ly)(S,E);(0,b.ep)(B,N);var V=I,j=(0,b.W8)(B,V),$=(0,b.W8)(V,V),ee=j*j-$*((0,b.W8)(B,B)-1);if(!(ee<0)){var H=(0,e.RZ)(ee),J=(0,b.ly)(V,(-j-H)/$);if((0,b.ep)(J,B),J=(0,b.EV)(J),!g)return J;var Q,Z=x[0],K=m[0],ae=x[1],se=m[1];K0^J[1]<((0,e.tn)(J[0]-Z)e.pi^(Z<=J[0]&&J[0]<=K)){var ie=(0,b.ly)(V,(-j+H)/$);return(0,b.ep)(ie,B),[J,(0,b.EV)(ie)]}}}function h(x,m){var g=l?u:e.pi-u,k=0;return x<-g?k|=1:x>g&&(k|=2),m<-g?k|=4:m>g&&(k|=8),k}return(0,y.A)(s,function(x){var m,g,k,A,v;return{lineStart:function(){A=k=!1,v=1},point:function(S,T){var p,M=[S,T],f=s(S,T),E=l?f?0:h(S,T):f?h(S+(S<0?e.pi:-e.pi),T):0;if(!m&&(A=k=f)&&x.lineStart(),f!==k&&(!(p=c(m,M))||(0,w.A)(m,p)||(0,w.A)(M,p))&&(M[2]=1),f!==k)v=0,f?(x.lineStart(),p=c(M,m),x.point(p[0],p[1])):(p=c(m,M),x.point(p[0],p[1],2),x.lineEnd()),m=p;else if(o&&m&&l^f){var I;E&g||!(I=c(M,m,!0))||(v=0,l?(x.lineStart(),x.point(I[0][0],I[0][1]),x.point(I[1][0],I[1][1]),x.lineEnd()):(x.point(I[1][0],I[1][1]),x.lineEnd(),x.lineStart(),x.point(I[0][0],I[0][1],3)))}!f||m&&(0,w.A)(m,M)||x.point(M[0],M[1]),m=M,k=f,g=E},lineEnd:function(){k&&x.lineEnd(),m=null},clean:function(){return v|(A&&k)<<1}}},function(x,m,g,k){(0,d.J)(k,u,n,g,x,m)},l?[0,-u]:[-e.pi,u-e.pi])}},13720:function(D,L,t){t.d(L,{A:function(){return _}});var b=t(39608),d=t(19119),e=t(61323),w=t(2274),y=t(29725);function _(n,l,o,s){return function(c){var h,x,m,g=l(c),k=(0,b.A)(),A=l(k),v=!1,S={point:T,lineStart:M,lineEnd:f,polygonStart:function(){S.point=E,S.lineStart=I,S.lineEnd=B,x=[],h=[]},polygonEnd:function(){S.point=T,S.lineStart=M,S.lineEnd=f,x=(0,y.Am)(x);var N=(0,w.A)(h,s);x.length?(v||(c.polygonStart(),v=!0),(0,d.A)(x,r,N,o,c)):N&&(v||(c.polygonStart(),v=!0),c.lineStart(),o(null,null,1,c),c.lineEnd()),v&&(c.polygonEnd(),v=!1),x=h=null},sphere:function(){c.polygonStart(),c.lineStart(),o(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function T(N,V){n(N,V)&&c.point(N,V)}function p(N,V){g.point(N,V)}function M(){S.point=p,g.lineStart()}function f(){S.point=T,g.lineEnd()}function E(N,V){m.push([N,V]),A.point(N,V)}function I(){A.lineStart(),m=[]}function B(){E(m[0][0],m[0][1]),A.lineEnd();var N,V,j,$,ee=A.clean(),H=k.result(),J=H.length;if(m.pop(),h.push(m),m=null,J)if(1&ee){if((V=(j=H[0]).length-1)>0){for(v||(c.polygonStart(),v=!0),c.lineStart(),N=0;N1&&2&ee&&H.push(H.pop().concat(H.shift())),x.push(H.filter(u))}return S}}function u(n){return n.length>1}function r(n,l){return((n=n.x)[0]<0?n[1]-e.TW-e.Ni:e.TW-n[1])-((l=l.x)[0]<0?l[1]-e.TW-e.Ni:e.TW-l[1])}},21503:function(D,L,t){t.d(L,{A:function(){return u}});var b=t(61323),d=t(39608),e=t(19119),w=t(29725),y=1e9,_=-y;function u(r,n,l,o){function s(g,k){return r<=g&&g<=l&&n<=k&&k<=o}function c(g,k,A,v){var S=0,T=0;if(g==null||(S=h(g,A))!==(T=h(k,A))||m(g,k)<0^A>0)do v.point(S===0||S===3?r:l,S>1?o:n);while((S=(S+A+4)%4)!==T);else v.point(k[0],k[1])}function h(g,k){return(0,b.tn)(g[0]-r)0?0:3:(0,b.tn)(g[0]-l)0?2:1:(0,b.tn)(g[1]-n)0?1:0:k>0?3:2}function x(g,k){return m(g.x,k.x)}function m(g,k){var A=h(g,1),v=h(k,1);return A!==v?A-v:A===0?k[1]-g[1]:A===1?g[0]-k[0]:A===2?g[1]-k[1]:k[0]-g[0]}return function(g){var k,A,v,S,T,p,M,f,E,I,B,N=g,V=(0,d.A)(),j={point:$,lineStart:function(){j.point=ee,A&&A.push(v=[]),I=!0,E=!1,M=f=NaN},lineEnd:function(){k&&(ee(S,T),p&&E&&V.rejoin(),k.push(V.result())),j.point=$,E&&N.lineEnd()},polygonStart:function(){N=V,k=[],A=[],B=!0},polygonEnd:function(){var H=function(){for(var Z=0,K=0,ae=A.length;Ko&&(ge-se)*(o-he)>(ye-he)*(r-se)&&++Z:ye<=o&&(ge-se)*(o-he)<(ye-he)*(r-se)&&--Z;return Z}(),J=B&&H,Q=(k=(0,w.Am)(k)).length;(J||Q)&&(g.polygonStart(),J&&(g.lineStart(),c(null,null,1,g),g.lineEnd()),Q&&(0,e.A)(k,x,H,c,g),g.polygonEnd()),N=g,k=A=v=null}};function $(H,J){s(H,J)&&N.point(H,J)}function ee(H,J){var Q=s(H,J);if(A&&v.push([H,J]),I)S=H,T=J,p=Q,I=!1,Q&&(N.lineStart(),N.point(H,J));else if(Q&&E)N.point(H,J);else{var Z=[M=Math.max(_,Math.min(y,M)),f=Math.max(_,Math.min(y,f))],K=[H=Math.max(_,Math.min(y,H)),J=Math.max(_,Math.min(y,J))];(function(ae,se,he,fe,ie,oe){var le,ge=ae[0],ye=ae[1],me=0,be=1,Se=se[0]-ge,Ee=se[1]-ye;if(le=he-ge,Se||!(le>0)){if(le/=Se,Se<0){if(le0){if(le>be)return;le>me&&(me=le)}if(le=ie-ge,Se||!(le<0)){if(le/=Se,Se<0){if(le>be)return;le>me&&(me=le)}else if(Se>0){if(le0)){if(le/=Ee,Ee<0){if(le0){if(le>be)return;le>me&&(me=le)}if(le=oe-ye,Ee||!(le<0)){if(le/=Ee,Ee<0){if(le>be)return;le>me&&(me=le)}else if(Ee>0){if(le0&&(ae[0]=ge+me*Se,ae[1]=ye+me*Ee),be<1&&(se[0]=ge+be*Se,se[1]=ye+be*Ee),!0}}}}})(Z,K,r,n,l,o)?(E||(N.lineStart(),N.point(Z[0],Z[1])),N.point(K[0],K[1]),Q||N.lineEnd(),B=!1):Q&&(N.lineStart(),N.point(H,J),B=!1)}M=H,f=J,E=Q}return j}}},19119:function(D,L,t){t.d(L,{A:function(){return w}});var b=t(28759),d=t(61323);function e(_,u,r,n){this.x=_,this.z=u,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function w(_,u,r,n,l){var o,s,c=[],h=[];if(_.forEach(function(v){if(!((S=v.length-1)<=0)){var S,T,p=v[0],M=v[S];if((0,b.A)(p,M)){if(!p[2]&&!M[2]){for(l.lineStart(),o=0;o=0;--o)l.point((m=x[o])[0],m[1]);else n(k.x,k.p.x,-1,l);k=k.p}x=(k=k.o).z,A=!A}while(!k.v);l.lineEnd()}}}function y(_){if(u=_.length){for(var u,r,n=0,l=_[0];++n0&&(cr=f(kn[Ir],kn[Ir-1]))>0&&ur<=cr&&Zn<=cr&&(ur+Zn-cr)*(1-Math.pow((ur-Zn)/cr,2))h.Ni}).map(ai)).concat((0,J.y1)((0,h.mk)(Ir/gn)*gn,cr,gn).filter(function(dn){return(0,h.tn)(dn%Un)>h.Ni}).map(bn))}return Wn.lines=function(){return Bn().map(function(dn){return{type:"LineString",coordinates:dn}})},Wn.outline=function(){return{type:"Polygon",coordinates:[Yn(Zn).concat(an(Er).slice(1),Yn(ur).reverse().slice(1),an(Xr).reverse().slice(1))]}},Wn.extent=function(dn){return arguments.length?Wn.extentMajor(dn).extentMinor(dn):Wn.extentMinor()},Wn.extentMajor=function(dn){return arguments.length?(Zn=+dn[0][0],ur=+dn[1][0],Xr=+dn[0][1],Er=+dn[1][1],Zn>ur&&(dn=Zn,Zn=ur,ur=dn),Xr>Er&&(dn=Xr,Xr=Er,Er=dn),Wn.precision(tr)):[[Zn,Xr],[ur,Er]]},Wn.extentMinor=function(dn){return arguments.length?(Cn=+dn[0][0],kn=+dn[1][0],Ir=+dn[0][1],cr=+dn[1][1],Cn>kn&&(dn=Cn,Cn=kn,kn=dn),Ir>cr&&(dn=Ir,Ir=cr,cr=dn),Wn.precision(tr)):[[Cn,Ir],[kn,cr]]},Wn.step=function(dn){return arguments.length?Wn.stepMajor(dn).stepMinor(dn):Wn.stepMinor()},Wn.stepMajor=function(dn){return arguments.length?(qn=+dn[0],Un=+dn[1],Wn):[qn,Un]},Wn.stepMinor=function(dn){return arguments.length?(_n=+dn[0],gn=+dn[1],Wn):[_n,gn]},Wn.precision=function(dn){return arguments.length?(tr=+dn,ai=Q(Ir,cr,90),bn=Z(Cn,kn,tr),Yn=Q(Xr,Er,90),an=Z(Zn,ur,tr),Wn):tr},Wn.extentMajor([[-180,-90+h.Ni],[180,90-h.Ni]]).extentMinor([[-180,-80-h.Ni],[180,80+h.Ni]])}function ae(){return K()()}var se,he,fe,ie,oe=t(81758),le=t(26827),ge=(0,c.A)(),ye=(0,c.A)(),me={point:x.A,lineStart:x.A,lineEnd:x.A,polygonStart:function(){me.lineStart=be,me.lineEnd=Ce},polygonEnd:function(){me.lineStart=me.lineEnd=me.point=x.A,ge.add((0,h.tn)(ye)),ye.reset()},result:function(){var kn=ge/2;return ge.reset(),kn}};function be(){me.point=Se}function Se(kn,Cn){me.point=Ee,se=fe=kn,he=ie=Cn}function Ee(kn,Cn){ye.add(ie*kn-fe*Cn),fe=kn,ie=Cn}function Ce(){Ee(se,he)}var Le,Oe,We,Ie,Ve=me,Pe=t(33028),de=0,Me=0,ke=0,He=0,Fe=0,qe=0,$e=0,Ye=0,_e=0,De={point:Be,lineStart:Ge,lineEnd:pt,polygonStart:function(){De.lineStart=At,De.lineEnd=wt},polygonEnd:function(){De.point=Be,De.lineStart=Ge,De.lineEnd=pt},result:function(){var kn=_e?[$e/_e,Ye/_e]:qe?[He/qe,Fe/qe]:ke?[de/ke,Me/ke]:[NaN,NaN];return de=Me=ke=He=Fe=qe=$e=Ye=_e=0,kn}};function Be(kn,Cn){de+=kn,Me+=Cn,++ke}function Ge(){De.point=tt}function tt(kn,Cn){De.point=nt,Be(We=kn,Ie=Cn)}function nt(kn,Cn){var ur=kn-We,Zn=Cn-Ie,cr=(0,h.RZ)(ur*ur+Zn*Zn);He+=cr*(We+kn)/2,Fe+=cr*(Ie+Cn)/2,qe+=cr,Be(We=kn,Ie=Cn)}function pt(){De.point=Be}function At(){De.point=Nt}function wt(){Ht(Le,Oe)}function Nt(kn,Cn){De.point=Ht,Be(Le=We=kn,Oe=Ie=Cn)}function Ht(kn,Cn){var ur=kn-We,Zn=Cn-Ie,cr=(0,h.RZ)(ur*ur+Zn*Zn);He+=cr*(We+kn)/2,Fe+=cr*(Ie+Cn)/2,qe+=cr,$e+=(cr=Ie*kn-We*Cn)*(We+kn),Ye+=cr*(Ie+Cn),_e+=3*cr,Be(We=kn,Ie=Cn)}var Gt=De;function st(kn){this._context=kn}st.prototype={_radius:4.5,pointRadius:function(kn){return this._radius=kn,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(kn,Cn){switch(this._point){case 0:this._context.moveTo(kn,Cn),this._point=1;break;case 1:this._context.lineTo(kn,Cn);break;default:this._context.moveTo(kn+this._radius,Cn),this._context.arc(kn,Cn,this._radius,0,h.FA)}},result:x.A};var Qe,ft,yt,Ot,Pt,at=(0,c.A)(),lt={point:x.A,lineStart:function(){lt.point=Xe},lineEnd:function(){Qe&&ut(ft,yt),lt.point=x.A},polygonStart:function(){Qe=!0},polygonEnd:function(){Qe=null},result:function(){var kn=+at;return at.reset(),kn}};function Xe(kn,Cn){lt.point=ut,ft=Ot=kn,yt=Pt=Cn}function ut(kn,Cn){Ot-=kn,Pt-=Cn,at.add((0,h.RZ)(Ot*Ot+Pt*Pt)),Ot=kn,Pt=Cn}var Tt=lt;function vt(){this._string=[]}function Lt(kn){return"m0,"+kn+"a"+kn+","+kn+" 0 1,1 0,"+-2*kn+"a"+kn+","+kn+" 0 1,1 0,"+2*kn+"z"}function Ut(kn,Cn){var ur,Zn,cr=4.5;function Ir(Er){return Er&&(typeof cr=="function"&&Zn.pointRadius(+cr.apply(this,arguments)),(0,m.A)(Er,ur(Zn))),Zn.result()}return Ir.area=function(Er){return(0,m.A)(Er,ur(Ve)),Ve.result()},Ir.measure=function(Er){return(0,m.A)(Er,ur(Tt)),Tt.result()},Ir.bounds=function(Er){return(0,m.A)(Er,ur(Pe.A)),Pe.A.result()},Ir.centroid=function(Er){return(0,m.A)(Er,ur(Gt)),Gt.result()},Ir.projection=function(Er){return arguments.length?(ur=Er==null?(kn=null,le.A):(kn=Er).stream,Ir):kn},Ir.context=function(Er){return arguments.length?(Zn=Er==null?(Cn=null,new vt):new st(Cn=Er),typeof cr!="function"&&Zn.pointRadius(cr),Ir):Cn},Ir.pointRadius=function(Er){return arguments.length?(cr=typeof Er=="function"?Er:(Zn.pointRadius(+Er),+Er),Ir):cr},Ir.projection(kn).context(Cn)}vt.prototype={_radius:4.5,_circle:Lt(4.5),pointRadius:function(kn){return(kn=+kn)!==this._radius&&(this._radius=kn,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(kn,Cn){switch(this._point){case 0:this._string.push("M",kn,",",Cn),this._point=1;break;case 1:this._string.push("L",kn,",",Cn);break;default:this._circle==null&&(this._circle=Lt(this._radius)),this._string.push("M",kn,",",Cn,this._circle)}},result:function(){if(this._string.length){var kn=this._string.join("");return this._string=[],kn}return null}};var rt=t(94684);function et(kn){var Cn=0,ur=h.pi/3,Zn=(0,rt.U)(kn),cr=Zn(Cn,ur);return cr.parallels=function(Ir){return arguments.length?Zn(Cn=Ir[0]*h.F2,ur=Ir[1]*h.F2):[Cn*h.uj,ur*h.uj]},cr}function Et(kn,Cn){var ur=(0,h.F8)(kn),Zn=(ur+(0,h.F8)(Cn))/2;if((0,h.tn)(Zn)=.12&&tr<.234&&Un>=-.425&&Un<-.214?Xr:tr>=.166&&tr<.234&&Un>=-.214&&Un<-.115?ai:Er).invert(_n)},Yn.stream=function(_n){return kn&&Cn===_n?kn:(gn=[Er.stream(Cn=_n),Xr.stream(_n),ai.stream(_n)],qn=gn.length,kn={point:function(Un,tr){for(var Wn=-1;++Wn0?Xr<-h.TW+h.Ni&&(Xr=-h.TW+h.Ni):Xr>h.TW-h.Ni&&(Xr=h.TW-h.Ni);var ai=cr/(0,h.n7)(Pn(Xr),Zn);return[ai*(0,h.F8)(Zn*Er),cr-ai*(0,h.gn)(Zn*Er)]}return Ir.invert=function(Er,Xr){var ai=cr-Xr,bn=(0,h._S)(Zn)*(0,h.RZ)(Er*Er+ai*ai),Yn=(0,h.FP)(Er,(0,h.tn)(ai))*(0,h._S)(ai);return ai*Zn<0&&(Yn-=h.pi*(0,h._S)(Er)*(0,h._S)(ai)),[Yn/Zn,2*(0,h.rY)((0,h.n7)(cr/bn,1/Zn))-h.TW]},Ir}function In(){return et(Dn).scale(109.5).parallels([30,30])}Zt.invert=function(kn,Cn){return[kn,2*(0,h.rY)((0,h.oN)(Cn))-h.TW]};var mn=t(18139);function En(kn,Cn){var ur=(0,h.gn)(kn),Zn=kn===Cn?(0,h.F8)(kn):(ur-(0,h.gn)(Cn))/(Cn-kn),cr=ur/Zn+kn;if((0,h.tn)(Zn)2?Zn[2]+90:90]):[(Zn=ur())[0],Zn[1],Zn[2]-90]},ur([0,0,90]).scale(159.155)}Or.invert=(0,ni.I)(function(kn){return 2*(0,h.rY)(kn)}),xr.invert=function(kn,Cn){return[-Cn,2*(0,h.rY)((0,h.oN)(kn))-h.TW]}},81758:function(D,L,t){t.d(L,{A:function(){return d}});var b=t(61323);function d(e,w){var y=e[0]*b.F2,_=e[1]*b.F2,u=w[0]*b.F2,r=w[1]*b.F2,n=(0,b.gn)(_),l=(0,b.F8)(_),o=(0,b.gn)(r),s=(0,b.F8)(r),c=n*(0,b.gn)(y),h=n*(0,b.F8)(y),x=o*(0,b.gn)(u),m=o*(0,b.F8)(u),g=2*(0,b.qR)((0,b.RZ)((0,b.bo)(r-_)+n*o*(0,b.bo)(u-y))),k=(0,b.F8)(g),A=g?function(v){var S=(0,b.F8)(v*=g)/k,T=(0,b.F8)(g-v)/k,p=T*c+S*x,M=T*h+S*m,f=T*l+S*s;return[(0,b.FP)(M,p)*b.uj,(0,b.FP)(f,(0,b.RZ)(p*p+M*M))*b.uj]}:function(){return[y*b.uj,_*b.uj]};return A.distance=g,A}},61323:function(D,L,t){t.d(L,{$t:function(){return d},F2:function(){return r},F8:function(){return g},FA:function(){return _},FP:function(){return o},HQ:function(){return S},Ml:function(){return v},Ni:function(){return b},RZ:function(){return A},Rm:function(){return x},TW:function(){return w},_S:function(){return k},bo:function(){return p},gn:function(){return s},gz:function(){return y},mk:function(){return c},n7:function(){return m},oN:function(){return h},pi:function(){return e},qR:function(){return T},rY:function(){return l},tn:function(){return n},uj:function(){return u}});var b=1e-6,d=1e-12,e=Math.PI,w=e/2,y=e/4,_=2*e,u=180/e,r=e/180,n=Math.abs,l=Math.atan,o=Math.atan2,s=Math.cos,c=Math.ceil,h=Math.exp,x=Math.log,m=Math.pow,g=Math.sin,k=Math.sign||function(M){return M>0?1:M<0?-1:0},A=Math.sqrt,v=Math.tan;function S(M){return M>1?0:M<-1?e:Math.acos(M)}function T(M){return M>1?w:M<-1?-w:Math.asin(M)}function p(M){return(M=g(M/2))*M}},53341:function(D,L,t){function b(){}t.d(L,{A:function(){return b}})},33028:function(D,L,t){var b=t(53341),d=1/0,e=d,w=-d,y=w,_={point:function(u,r){uw&&(w=u),ry&&(y=r)},lineStart:b.A,lineEnd:b.A,polygonStart:b.A,polygonEnd:b.A,result:function(){var u=[[d,e],[w,y]];return w=y=-(e=d=1/0),u}};L.A=_},28759:function(D,L,t){t.d(L,{A:function(){return d}});var b=t(61323);function d(e,w){return(0,b.tn)(e[0]-w[0])=0?1:-1,$=j*V,ee=$>e.pi,H=T*B;if(w.add((0,e.FP)(H*j*(0,e.F8)($),p*N+H*(0,e.gn)($))),c+=ee?V+j*e.FA:V,ee^v>=n^E>=n){var J=(0,d.r8)((0,d.jf)(A),(0,d.jf)(f));(0,d.Cx)(J);var Q=(0,d.r8)(s,J);(0,d.Cx)(Q);var Z=(ee^V>=0?-1:1)*(0,e.qR)(Q[2]);(l>Z||l===Z&&(J[0]||J[1]))&&(h+=ee^V>=0?1:-1)}}return(c<-e.Ni||c4*T&&Q--){var he=I+ee,fe=B+H,ie=N+J,oe=(0,_.RZ)(he*he+fe*fe+ie*ie),le=(0,_.qR)(ie/=oe),ge=(0,_.tn)((0,_.tn)(ie)-1)<_.Ni||(0,_.tn)(E-$)<_.Ni?(E+$)/2:(0,_.FP)(fe,he),ye=S(ge,le),me=ye[0],be=ye[1],Se=me-M,Ee=be-f,Ce=ae*Se-K*Ee;(Ce*Ce/se>T||(0,_.tn)((K*Se+ae*Ee)/se-.5)>.3||I*ee+B*H+N*J2?Se[2]%360*_.F2:0,me()):[J*_.uj,Q*_.uj,Z*_.uj]},ge.angle=function(Se){return arguments.length?(K=Se%360*_.F2,me()):K*_.uj},ge.reflectX=function(Se){return arguments.length?(ae=Se?-1:1,me()):ae<0},ge.reflectY=function(Se){return arguments.length?(se=Se?-1:1,me()):se<0},ge.precision=function(Se){return arguments.length?(f=c(E,le=Se*Se),be()):(0,_.RZ)(le)},ge.fitExtent=function(Se,Ee){return(0,n.sp)(ge,Se,Ee)},ge.fitSize=function(Se,Ee){return(0,n.Hv)(ge,Se,Ee)},ge.fitWidth=function(Se,Ee){return(0,n.G0)(ge,Se,Ee)},ge.fitHeight=function(Se,Ee){return(0,n.FL)(ge,Se,Ee)},function(){return v=A.apply(this,arguments),ge.invert=v.invert&&ye,me()}}},57949:function(D,L,t){t.d(L,{A:function(){return w},P:function(){return e}});var b=t(94684),d=t(61323);function e(y,_){var u=_*_,r=u*u;return[y*(.8707-.131979*u+r*(r*(.003971*u-.001529*r)-.013791)),_*(1.007226+u*(.015085+r*(.028874*u-.044475-.005916*r)))]}function w(){return(0,b.A)(e).scale(175.295)}e.invert=function(y,_){var u,r=_,n=25;do{var l=r*r,o=l*l;r-=u=(r*(1.007226+l*(.015085+o*(.028874*l-.044475-.005916*o)))-_)/(1.007226+l*(.045255+o*(.259866*l-.311325-.06507600000000001*o)))}while((0,d.tn)(u)>d.Ni&&--n>0);return[y/(.8707+(l=r*r)*(l*(l*l*l*(.003971-.001529*l)-.013791)-.131979)),r]}},53253:function(D,L,t){t.d(L,{A:function(){return y},x:function(){return w}});var b=t(61323),d=t(57738),e=t(94684);function w(_,u){return[(0,b.gn)(u)*(0,b.F8)(_),(0,b.F8)(u)]}function y(){return(0,e.A)(w).scale(249.5).clipAngle(90+b.Ni)}w.invert=(0,d.I)(b.qR)},30915:function(D,L,t){t.d(L,{A:function(){return r},y:function(){return w}});var b=t(19057),d=t(61323);function e(n,l){return[(0,d.tn)(n)>d.pi?n+Math.round(-n/d.FA)*d.FA:n,l]}function w(n,l,o){return(n%=d.FA)?l||o?(0,b.A)(_(n),u(l,o)):_(n):l||o?u(l,o):e}function y(n){return function(l,o){return[(l+=n)>d.pi?l-d.FA:l<-d.pi?l+d.FA:l,o]}}function _(n){var l=y(n);return l.invert=y(-n),l}function u(n,l){var o=(0,d.gn)(n),s=(0,d.F8)(n),c=(0,d.gn)(l),h=(0,d.F8)(l);function x(m,g){var k=(0,d.gn)(g),A=(0,d.gn)(m)*k,v=(0,d.F8)(m)*k,S=(0,d.F8)(g),T=S*o+A*s;return[(0,d.FP)(v*c-T*h,A*o-S*s),(0,d.qR)(T*c+v*h)]}return x.invert=function(m,g){var k=(0,d.gn)(g),A=(0,d.gn)(m)*k,v=(0,d.F8)(m)*k,S=(0,d.F8)(g),T=S*c-v*h;return[(0,d.FP)(v*c+S*h,A*o+T*s),(0,d.qR)(T*o-A*s)]},x}function r(n){function l(o){return(o=n(o[0]*d.F2,o[1]*d.F2))[0]*=d.uj,o[1]*=d.uj,o}return n=w(n[0]*d.F2,n[1]*d.F2,n.length>2?n[2]*d.F2:0),l.invert=function(o){return(o=n.invert(o[0]*d.F2,o[1]*d.F2))[0]*=d.uj,o[1]*=d.uj,o},l}e.invert=e},20465:function(D,L,t){function b(u,r){u&&e.hasOwnProperty(u.type)&&e[u.type](u,r)}t.d(L,{A:function(){return _}});var d={Feature:function(u,r){b(u.geometry,r)},FeatureCollection:function(u,r){for(var n=u.features,l=-1,o=n.length;++l=0;)de+=Me[ke].value;else de=1;Pe.value=de}function _(Pe,de){var Me,ke,He,Fe,qe,$e=new l(Pe),Ye=+Pe.value&&($e.value=Pe.value),_e=[$e];for(de==null&&(de=u);Me=_e.pop();)if(Ye&&(Me.value=+Me.data.value),(He=de(Me.data))&&(qe=He.length))for(Me.children=new Array(qe),Fe=qe-1;Fe>=0;--Fe)_e.push(ke=Me.children[Fe]=new l(He[Fe])),ke.parent=Me,ke.depth=Me.depth+1;return $e.eachBefore(n)}function u(Pe){return Pe.children}function r(Pe){Pe.data=Pe.data.data}function n(Pe){var de=0;do Pe.height=de;while((Pe=Pe.parent)&&Pe.height<++de)}function l(Pe){this.data=Pe,this.depth=this.height=0,this.parent=null}t.r(L),t.d(L,{cluster:function(){return w},hierarchy:function(){return _},pack:function(){return V},packEnclose:function(){return s},packSiblings:function(){return f},partition:function(){return Q},stratify:function(){return fe},tree:function(){return be},treemap:function(){return Oe},treemapBinary:function(){return We},treemapDice:function(){return J},treemapResquarify:function(){return Ve},treemapSlice:function(){return Se},treemapSliceDice:function(){return Ie},treemapSquarify:function(){return Le}}),l.prototype=_.prototype={constructor:l,count:function(){return this.eachAfter(y)},each:function(Pe){var de,Me,ke,He,Fe=this,qe=[Fe];do for(de=qe.reverse(),qe=[];Fe=de.pop();)if(Pe(Fe),Me=Fe.children)for(ke=0,He=Me.length;ke=0;--Me)He.push(de[Me]);return this},sum:function(Pe){return this.eachAfter(function(de){for(var Me=+Pe(de.data)||0,ke=de.children,He=ke&&ke.length;--He>=0;)Me+=ke[He].value;de.value=Me})},sort:function(Pe){return this.eachBefore(function(de){de.children&&de.children.sort(Pe)})},path:function(Pe){for(var de=this,Me=function(Fe,qe){if(Fe===qe)return Fe;var $e=Fe.ancestors(),Ye=qe.ancestors(),_e=null;for(Fe=$e.pop(),qe=Ye.pop();Fe===qe;)_e=Fe,Fe=$e.pop(),qe=Ye.pop();return _e}(de,Pe),ke=[de];de!==Me;)de=de.parent,ke.push(de);for(var He=ke.length;Pe!==Me;)ke.splice(He,0,Pe),Pe=Pe.parent;return ke},ancestors:function(){for(var Pe=this,de=[Pe];Pe=Pe.parent;)de.push(Pe);return de},descendants:function(){var Pe=[];return this.each(function(de){Pe.push(de)}),Pe},leaves:function(){var Pe=[];return this.eachBefore(function(de){de.children||Pe.push(de)}),Pe},links:function(){var Pe=this,de=[];return Pe.each(function(Me){Me!==Pe&&de.push({source:Me.parent,target:Me})}),de},copy:function(){return _(this).eachBefore(r)}};var o=Array.prototype.slice;function s(Pe){for(var de,Me,ke=0,He=(Pe=function(qe){for(var $e,Ye,_e=qe.length;_e;)Ye=Math.random()*_e--|0,$e=qe[_e],qe[_e]=qe[Ye],qe[Ye]=$e;return qe}(o.call(Pe))).length,Fe=[];ke0&&Me*Me>ke*ke+He*He}function m(Pe,de){for(var Me=0;Me(qe*=qe)?(ke=(_e+qe-He)/(2*_e),Fe=Math.sqrt(Math.max(0,qe/_e-ke*ke)),Me.x=Pe.x-ke*$e-Fe*Ye,Me.y=Pe.y-ke*Ye+Fe*$e):(ke=(_e+He-qe)/(2*_e),Fe=Math.sqrt(Math.max(0,He/_e-ke*ke)),Me.x=de.x+ke*$e-Fe*Ye,Me.y=de.y+ke*Ye+Fe*$e)):(Me.x=de.x+Me.r,Me.y=de.y)}function S(Pe,de){var Me=Pe.r+de.r-1e-6,ke=de.x-Pe.x,He=de.y-Pe.y;return Me>0&&Me*Me>ke*ke+He*He}function T(Pe){var de=Pe._,Me=Pe.next._,ke=de.r+Me.r,He=(de.x*Me.r+Me.x*de.r)/ke,Fe=(de.y*Me.r+Me.y*de.r)/ke;return He*He+Fe*Fe}function p(Pe){this._=Pe,this.next=null,this.previous=null}function M(Pe){if(!(He=Pe.length))return 0;var de,Me,ke,He,Fe,qe,$e,Ye,_e,De,Be;if((de=Pe[0]).x=0,de.y=0,!(He>1))return de.r;if(Me=Pe[1],de.x=-Me.r,Me.x=de.r,Me.y=0,!(He>2))return de.r+Me.r;v(Me,de,ke=Pe[2]),de=new p(de),Me=new p(Me),ke=new p(ke),de.next=ke.previous=Me,Me.next=de.previous=ke,ke.next=Me.previous=de;e:for($e=3;$e0)throw new Error("cycle");return qe}return Me.id=function(ke){return arguments.length?(Pe=E(ke),Me):Pe},Me.parentId=function(ke){return arguments.length?(de=E(ke),Me):de},Me}function ie(Pe,de){return Pe.parent===de.parent?1:2}function oe(Pe){var de=Pe.children;return de?de[0]:Pe.t}function le(Pe){var de=Pe.children;return de?de[de.length-1]:Pe.t}function ge(Pe,de,Me){var ke=Me/(de.i-Pe.i);de.c-=ke,de.s+=Me,Pe.c+=ke,de.z+=Me,de.m+=Me}function ye(Pe,de,Me){return Pe.a.parent===de.parent?Pe.a:Me}function me(Pe,de){this._=Pe,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=de}function be(){var Pe=ie,de=1,Me=1,ke=null;function He(Ye){var _e=function(wt){for(var Nt,Ht,Gt,st,Qe,ft=new me(wt,0),yt=[ft];Nt=yt.pop();)if(Gt=Nt._.children)for(Nt.children=new Array(Qe=Gt.length),st=Qe-1;st>=0;--st)yt.push(Ht=Nt.children[st]=new me(Gt[st],st)),Ht.parent=Nt;return(ft.parent=new me(null,0)).children=[ft],ft}(Ye);if(_e.eachAfter(Fe),_e.parent.m=-_e.z,_e.eachBefore(qe),ke)Ye.eachBefore($e);else{var De=Ye,Be=Ye,Ge=Ye;Ye.eachBefore(function(wt){wt.xBe.x&&(Be=wt),wt.depth>Ge.depth&&(Ge=wt)});var tt=De===Be?1:Pe(De,Be)/2,nt=tt-De.x,pt=de/(Be.x+tt+nt),At=Me/(Ge.depth||1);Ye.eachBefore(function(wt){wt.x=(wt.x+nt)*pt,wt.y=wt.depth*At})}return Ye}function Fe(Ye){var _e=Ye.children,De=Ye.parent.children,Be=Ye.i?De[Ye.i-1]:null;if(_e){(function(tt){for(var nt,pt=0,At=0,wt=tt.children,Nt=wt.length;--Nt>=0;)(nt=wt[Nt]).z+=pt,nt.m+=pt,pt+=nt.s+(At+=nt.c)})(Ye);var Ge=(_e[0].z+_e[_e.length-1].z)/2;Be?(Ye.z=Be.z+Pe(Ye._,Be._),Ye.m=Ye.z-Ge):Ye.z=Ge}else Be&&(Ye.z=Be.z+Pe(Ye._,Be._));Ye.parent.A=function(tt,nt,pt){if(nt){for(var At,wt=tt,Nt=tt,Ht=nt,Gt=wt.parent.children[0],st=wt.m,Qe=Nt.m,ft=Ht.m,yt=Gt.m;Ht=le(Ht),wt=oe(wt),Ht&&wt;)Gt=oe(Gt),(Nt=le(Nt)).a=tt,(At=Ht.z+ft-wt.z-st+Pe(Ht._,wt._))>0&&(ge(ye(Ht,tt,pt),tt,At),st+=At,Qe+=At),ft+=Ht.m,st+=wt.m,yt+=Gt.m,Qe+=Nt.m;Ht&&!le(Nt)&&(Nt.t=Ht,Nt.m+=ft-Qe),wt&&!oe(Gt)&&(Gt.t=wt,Gt.m+=st-yt,pt=tt)}return pt}(Ye,Be,Ye.parent.A||De[0])}function qe(Ye){Ye._.x=Ye.z+Ye.parent.m,Ye.m+=Ye.parent.m}function $e(Ye){Ye.x*=de,Ye.y=Ye.depth*Me}return He.separation=function(Ye){return arguments.length?(Pe=Ye,He):Pe},He.size=function(Ye){return arguments.length?(ke=!1,de=+Ye[0],Me=+Ye[1],He):ke?null:[de,Me]},He.nodeSize=function(Ye){return arguments.length?(ke=!0,de=+Ye[0],Me=+Ye[1],He):ke?[de,Me]:null},He}function Se(Pe,de,Me,ke,He){for(var Fe,qe=Pe.children,$e=-1,Ye=qe.length,_e=Pe.value&&(He-Me)/Pe.value;++$eGe&&(Ge=$e),At=De*De*pt,(tt=Math.max(Ge/At,At/Be))>nt){De-=$e;break}nt=tt}wt.push(qe={value:De,dice:Ye<_e,children:Nt.slice(Ht,Gt)}),qe.dice?J(qe,Me,ke,He,Qe?ke+=_e*De/Qe:Fe):Se(qe,Me,ke,Qe?Me+=Ye*De/Qe:He,Fe),Qe-=De,Ht=Gt}return wt}var Le=function Pe(de){function Me(ke,He,Fe,qe,$e){Ce(de,ke,He,Fe,qe,$e)}return Me.ratio=function(ke){return Pe((ke=+ke)>1?ke:1)},Me}(Ee);function Oe(){var Pe=Le,de=!1,Me=1,ke=1,He=[0],Fe=I,qe=I,$e=I,Ye=I,_e=I;function De(Ge){return Ge.x0=Ge.y0=0,Ge.x1=Me,Ge.y1=ke,Ge.eachBefore(Be),He=[0],de&&Ge.eachBefore(H),Ge}function Be(Ge){var tt=He[Ge.depth],nt=Ge.x0+tt,pt=Ge.y0+tt,At=Ge.x1-tt,wt=Ge.y1-tt;At=Ge-1){var Nt=$e[Be];return Nt.x0=nt,Nt.y0=pt,Nt.x1=At,void(Nt.y1=wt)}for(var Ht=_e[Be],Gt=tt/2+Ht,st=Be+1,Qe=Ge-1;st>>1;_e[ft]wt-pt){var Pt=(nt*Ot+At*yt)/tt;De(Be,st,yt,nt,pt,Pt,wt),De(st,Ge,Ot,Pt,pt,At,wt)}else{var at=(pt*Ot+wt*yt)/tt;De(Be,st,yt,nt,pt,At,at),De(st,Ge,Ot,nt,at,At,wt)}})(0,Ye,Pe.value,de,Me,ke,He)}function Ie(Pe,de,Me,ke,He){(1&Pe.depth?Se:J)(Pe,de,Me,ke,He)}var Ve=function Pe(de){function Me(ke,He,Fe,qe,$e){if((Ye=ke._squarify)&&Ye.ratio===de)for(var Ye,_e,De,Be,Ge,tt=-1,nt=Ye.length,pt=ke.value;++tt1?ke:1)},Me}(Ee)},48544:function(D,L,t){t.d(L,{pq:function(){return x}});var b=Math.PI,d=2*b,e=1e-6,w=d-e;function y(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function _(){return new y}y.prototype=_.prototype={constructor:y,moveTo:function(m,g){this._+="M"+(this._x0=this._x1=+m)+","+(this._y0=this._y1=+g)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(m,g){this._+="L"+(this._x1=+m)+","+(this._y1=+g)},quadraticCurveTo:function(m,g,k,A){this._+="Q"+ +m+","+ +g+","+(this._x1=+k)+","+(this._y1=+A)},bezierCurveTo:function(m,g,k,A,v,S){this._+="C"+ +m+","+ +g+","+ +k+","+ +A+","+(this._x1=+v)+","+(this._y1=+S)},arcTo:function(m,g,k,A,v){m=+m,g=+g,k=+k,A=+A,v=+v;var S=this._x1,T=this._y1,p=k-m,M=A-g,f=S-m,E=T-g,I=f*f+E*E;if(v<0)throw new Error("negative radius: "+v);if(this._x1===null)this._+="M"+(this._x1=m)+","+(this._y1=g);else if(I>e)if(Math.abs(E*p-M*f)>e&&v){var B=k-S,N=A-T,V=p*p+M*M,j=B*B+N*N,$=Math.sqrt(V),ee=Math.sqrt(I),H=v*Math.tan((b-Math.acos((V+I-j)/(2*$*ee)))/2),J=H/ee,Q=H/$;Math.abs(J-1)>e&&(this._+="L"+(m+J*f)+","+(g+J*E)),this._+="A"+v+","+v+",0,0,"+ +(E*B>f*N)+","+(this._x1=m+Q*p)+","+(this._y1=g+Q*M)}else this._+="L"+(this._x1=m)+","+(this._y1=g)},arc:function(m,g,k,A,v,S){m=+m,g=+g,S=!!S;var T=(k=+k)*Math.cos(A),p=k*Math.sin(A),M=m+T,f=g+p,E=1^S,I=S?A-v:v-A;if(k<0)throw new Error("negative radius: "+k);this._x1===null?this._+="M"+M+","+f:(Math.abs(this._x1-M)>e||Math.abs(this._y1-f)>e)&&(this._+="L"+M+","+f),k&&(I<0&&(I=I%d+d),I>w?this._+="A"+k+","+k+",0,1,"+E+","+(m-T)+","+(g-p)+"A"+k+","+k+",0,1,"+E+","+(this._x1=M)+","+(this._y1=f):I>e&&(this._+="A"+k+","+k+",0,"+ +(I>=b)+","+E+","+(this._x1=m+k*Math.cos(v))+","+(this._y1=g+k*Math.sin(v))))},rect:function(m,g,k,A){this._+="M"+(this._x0=this._x1=+m)+","+(this._y0=this._y1=+g)+"h"+ +k+"v"+ +A+"h"+-k+"Z"},toString:function(){return this._}};var u=_,r=Array.prototype.slice;function n(m){return function(){return m}}function l(m){return m[0]}function o(m){return m[1]}function s(m){return m.source}function c(m){return m.target}function h(m,g,k,A,v){m.moveTo(g,k),m.bezierCurveTo(g=(g+A)/2,k,g,v,A,v)}function x(){return function(m){var g=s,k=c,A=l,v=o,S=null;function T(){var p,M=r.call(arguments),f=g.apply(this,M),E=k.apply(this,M);if(S||(S=p=u()),m(S,+A.apply(this,(M[0]=f,M)),+v.apply(this,M),+A.apply(this,(M[0]=E,M)),+v.apply(this,M)),p)return S=null,p+""||null}return T.source=function(p){return arguments.length?(g=p,T):g},T.target=function(p){return arguments.length?(k=p,T):k},T.x=function(p){return arguments.length?(A=typeof p=="function"?p:n(+p),T):A},T.y=function(p){return arguments.length?(v=typeof p=="function"?p:n(+p),T):v},T.context=function(p){return arguments.length?(S=p??null,T):S},T}(h)}},42696:function(D,L,t){t.d(L,{DC:function(){return s},de:function(){return l},aL:function(){return c}});var b=t(1681),d=t(72543),e=t(55735),w=t(47265),y=t(9830),_=t(59764);function u(st){if(0<=st.y&&st.y<100){var Qe=new Date(-1,st.m,st.d,st.H,st.M,st.S,st.L);return Qe.setFullYear(st.y),Qe}return new Date(st.y,st.m,st.d,st.H,st.M,st.S,st.L)}function r(st){if(0<=st.y&&st.y<100){var Qe=new Date(Date.UTC(-1,st.m,st.d,st.H,st.M,st.S,st.L));return Qe.setUTCFullYear(st.y),Qe}return new Date(Date.UTC(st.y,st.m,st.d,st.H,st.M,st.S,st.L))}function n(st,Qe,ft){return{y:st,m:Qe,d:ft,H:0,M:0,S:0,L:0}}function l(st){var Qe=st.dateTime,ft=st.date,yt=st.time,Ot=st.periods,Pt=st.days,at=st.shortDays,lt=st.months,Xe=st.shortMonths,ut=v(Ot),Tt=S(Ot),vt=v(Pt),Lt=S(Pt),Ut=v(at),rt=S(at),et=v(lt),Et=S(lt),Bt=v(Xe),Ft=S(Xe),St={a:function(on){return at[on.getDay()]},A:function(on){return Pt[on.getDay()]},b:function(on){return Xe[on.getMonth()]},B:function(on){return lt[on.getMonth()]},c:null,d:fe,e:fe,f:ye,H:ie,I:oe,j:le,L:ge,m:me,M:be,p:function(on){return Ot[+(on.getHours()>=12)]},q:function(on){return 1+~~(on.getMonth()/3)},Q:Ht,s:Gt,S:Se,u:Ee,U:Ce,V:Le,w:Oe,W:We,x:null,X:null,y:Ie,Y:Ve,Z:Pe,"%":Nt},Jt={a:function(on){return at[on.getUTCDay()]},A:function(on){return Pt[on.getUTCDay()]},b:function(on){return Xe[on.getUTCMonth()]},B:function(on){return lt[on.getUTCMonth()]},c:null,d:de,e:de,f:qe,H:Me,I:ke,j:He,L:Fe,m:$e,M:Ye,p:function(on){return Ot[+(on.getUTCHours()>=12)]},q:function(on){return 1+~~(on.getUTCMonth()/3)},Q:Ht,s:Gt,S:_e,u:De,U:Be,V:Ge,w:tt,W:nt,x:null,X:null,y:pt,Y:At,Z:wt,"%":Nt},qt={a:function(on,un,Pn){var Dn=Ut.exec(un.slice(Pn));return Dn?(on.w=rt[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},A:function(on,un,Pn){var Dn=vt.exec(un.slice(Pn));return Dn?(on.w=Lt[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},b:function(on,un,Pn){var Dn=Bt.exec(un.slice(Pn));return Dn?(on.m=Ft[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},B:function(on,un,Pn){var Dn=et.exec(un.slice(Pn));return Dn?(on.m=Et[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},c:function(on,un,Pn){return Zt(on,Qe,un,Pn)},d:$,e:$,f:K,H,I:H,j:ee,L:Z,m:j,M:J,p:function(on,un,Pn){var Dn=ut.exec(un.slice(Pn));return Dn?(on.p=Tt[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},q:V,Q:se,s:he,S:Q,u:p,U:M,V:f,w:T,W:E,x:function(on,un,Pn){return Zt(on,ft,un,Pn)},X:function(on,un,Pn){return Zt(on,yt,un,Pn)},y:B,Y:I,Z:N,"%":ae};function en(on,un){return function(Pn){var Dn,In,mn,En=[],Kn=-1,Ln=0,Tn=on.length;for(Pn instanceof Date||(Pn=new Date(+Pn));++Kn53)return null;"w"in mn||(mn.w=1),"Z"in mn?(In=(Dn=r(n(mn.y,0,1))).getUTCDay(),Dn=In>4||In===0?b.rt.ceil(Dn):(0,b.rt)(Dn),Dn=d.A.offset(Dn,7*(mn.V-1)),mn.y=Dn.getUTCFullYear(),mn.m=Dn.getUTCMonth(),mn.d=Dn.getUTCDate()+(mn.w+6)%7):(In=(Dn=u(n(mn.y,0,1))).getDay(),Dn=In>4||In===0?e.By.ceil(Dn):(0,e.By)(Dn),Dn=w.A.offset(Dn,7*(mn.V-1)),mn.y=Dn.getFullYear(),mn.m=Dn.getMonth(),mn.d=Dn.getDate()+(mn.w+6)%7)}else("W"in mn||"U"in mn)&&("w"in mn||(mn.w="u"in mn?mn.u%7:"W"in mn?1:0),In="Z"in mn?r(n(mn.y,0,1)).getUTCDay():u(n(mn.y,0,1)).getDay(),mn.m=0,mn.d="W"in mn?(mn.w+6)%7+7*mn.W-(In+5)%7:mn.w+7*mn.U-(In+6)%7);return"Z"in mn?(mn.H+=mn.Z/100|0,mn.M+=mn.Z%100,r(mn)):u(mn)}}function Zt(on,un,Pn,Dn){for(var In,mn,En=0,Kn=un.length,Ln=Pn.length;En=Ln)return-1;if((In=un.charCodeAt(En++))===37){if(In=un.charAt(En++),!(mn=qt[In in h?un.charAt(En++):In])||(Dn=mn(on,Pn,Dn))<0)return-1}else if(In!=Pn.charCodeAt(Dn++))return-1}return Dn}return St.x=en(ft,St),St.X=en(yt,St),St.c=en(Qe,St),Jt.x=en(ft,Jt),Jt.X=en(yt,Jt),Jt.c=en(Qe,Jt),{format:function(on){var un=en(on+="",St);return un.toString=function(){return on},un},parse:function(on){var un=Wt(on+="",!1);return un.toString=function(){return on},un},utcFormat:function(on){var un=en(on+="",Jt);return un.toString=function(){return on},un},utcParse:function(on){var un=Wt(on+="",!0);return un.toString=function(){return on},un}}}var o,s,c,h={"-":"",_:" ",0:"0"},x=/^\s*\d+/,m=/^%/,g=/[\\^$*+?|[\]().{}]/g;function k(st,Qe,ft){var yt=st<0?"-":"",Ot=(yt?-st:st)+"",Pt=Ot.length;return yt+(Pt68?1900:2e3),ft+yt[0].length):-1}function N(st,Qe,ft){var yt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Qe.slice(ft,ft+6));return yt?(st.Z=yt[1]?0:-(yt[2]+(yt[3]||"00")),ft+yt[0].length):-1}function V(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+1));return yt?(st.q=3*yt[0]-3,ft+yt[0].length):-1}function j(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+2));return yt?(st.m=yt[0]-1,ft+yt[0].length):-1}function $(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+2));return yt?(st.d=+yt[0],ft+yt[0].length):-1}function ee(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+3));return yt?(st.m=0,st.d=+yt[0],ft+yt[0].length):-1}function H(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+2));return yt?(st.H=+yt[0],ft+yt[0].length):-1}function J(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+2));return yt?(st.M=+yt[0],ft+yt[0].length):-1}function Q(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+2));return yt?(st.S=+yt[0],ft+yt[0].length):-1}function Z(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+3));return yt?(st.L=+yt[0],ft+yt[0].length):-1}function K(st,Qe,ft){var yt=x.exec(Qe.slice(ft,ft+6));return yt?(st.L=Math.floor(yt[0]/1e3),ft+yt[0].length):-1}function ae(st,Qe,ft){var yt=m.exec(Qe.slice(ft,ft+1));return yt?ft+yt[0].length:-1}function se(st,Qe,ft){var yt=x.exec(Qe.slice(ft));return yt?(st.Q=+yt[0],ft+yt[0].length):-1}function he(st,Qe,ft){var yt=x.exec(Qe.slice(ft));return yt?(st.s=+yt[0],ft+yt[0].length):-1}function fe(st,Qe){return k(st.getDate(),Qe,2)}function ie(st,Qe){return k(st.getHours(),Qe,2)}function oe(st,Qe){return k(st.getHours()%12||12,Qe,2)}function le(st,Qe){return k(1+w.A.count((0,y.A)(st),st),Qe,3)}function ge(st,Qe){return k(st.getMilliseconds(),Qe,3)}function ye(st,Qe){return ge(st,Qe)+"000"}function me(st,Qe){return k(st.getMonth()+1,Qe,2)}function be(st,Qe){return k(st.getMinutes(),Qe,2)}function Se(st,Qe){return k(st.getSeconds(),Qe,2)}function Ee(st){var Qe=st.getDay();return Qe===0?7:Qe}function Ce(st,Qe){return k(e.fz.count((0,y.A)(st)-1,st),Qe,2)}function Le(st,Qe){var ft=st.getDay();return st=ft>=4||ft===0?(0,e.dt)(st):e.dt.ceil(st),k(e.dt.count((0,y.A)(st),st)+((0,y.A)(st).getDay()===4),Qe,2)}function Oe(st){return st.getDay()}function We(st,Qe){return k(e.By.count((0,y.A)(st)-1,st),Qe,2)}function Ie(st,Qe){return k(st.getFullYear()%100,Qe,2)}function Ve(st,Qe){return k(st.getFullYear()%1e4,Qe,4)}function Pe(st){var Qe=st.getTimezoneOffset();return(Qe>0?"-":(Qe*=-1,"+"))+k(Qe/60|0,"0",2)+k(Qe%60,"0",2)}function de(st,Qe){return k(st.getUTCDate(),Qe,2)}function Me(st,Qe){return k(st.getUTCHours(),Qe,2)}function ke(st,Qe){return k(st.getUTCHours()%12||12,Qe,2)}function He(st,Qe){return k(1+d.A.count((0,_.A)(st),st),Qe,3)}function Fe(st,Qe){return k(st.getUTCMilliseconds(),Qe,3)}function qe(st,Qe){return Fe(st,Qe)+"000"}function $e(st,Qe){return k(st.getUTCMonth()+1,Qe,2)}function Ye(st,Qe){return k(st.getUTCMinutes(),Qe,2)}function _e(st,Qe){return k(st.getUTCSeconds(),Qe,2)}function De(st){var Qe=st.getUTCDay();return Qe===0?7:Qe}function Be(st,Qe){return k(b.Hl.count((0,_.A)(st)-1,st),Qe,2)}function Ge(st,Qe){var ft=st.getUTCDay();return st=ft>=4||ft===0?(0,b.pT)(st):b.pT.ceil(st),k(b.pT.count((0,_.A)(st),st)+((0,_.A)(st).getUTCDay()===4),Qe,2)}function tt(st){return st.getUTCDay()}function nt(st,Qe){return k(b.rt.count((0,_.A)(st)-1,st),Qe,2)}function pt(st,Qe){return k(st.getUTCFullYear()%100,Qe,2)}function At(st,Qe){return k(st.getUTCFullYear()%1e4,Qe,4)}function wt(){return"+0000"}function Nt(){return"%"}function Ht(st){return+st}function Gt(st){return Math.floor(+st/1e3)}o=l({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"]}),s=o.format,o.parse,c=o.utcFormat,o.utcParse},47265:function(D,L,t){t.d(L,{_:function(){return w}});var b=t(53398),d=t(66291),e=(0,b.A)(function(y){y.setHours(0,0,0,0)},function(y,_){y.setDate(y.getDate()+_)},function(y,_){return(_-y-(_.getTimezoneOffset()-y.getTimezoneOffset())*d.rR)/d.Nm},function(y){return y.getDate()-1});L.A=e;var w=e.range},66291:function(D,L,t){t.d(L,{Fq:function(){return y},JJ:function(){return e},Nm:function(){return w},Tt:function(){return b},rR:function(){return d}});var b=1e3,d=6e4,e=36e5,w=864e5,y=6048e5},50936:function(D,L,t){t.r(L),t.d(L,{timeDay:function(){return x.A},timeDays:function(){return x._},timeFriday:function(){return m.Sh},timeFridays:function(){return m.tz},timeHour:function(){return c},timeHours:function(){return h},timeInterval:function(){return b.A},timeMillisecond:function(){return e},timeMilliseconds:function(){return w},timeMinute:function(){return l},timeMinutes:function(){return o},timeMonday:function(){return m.By},timeMondays:function(){return m.KP},timeMonth:function(){return k},timeMonths:function(){return A},timeSaturday:function(){return m.kS},timeSaturdays:function(){return m.t$},timeSecond:function(){return u},timeSeconds:function(){return r},timeSunday:function(){return m.fz},timeSundays:function(){return m.se},timeThursday:function(){return m.dt},timeThursdays:function(){return m.Q$},timeTuesday:function(){return m.eQ},timeTuesdays:function(){return m.yW},timeWednesday:function(){return m.l3},timeWednesdays:function(){return m.gf},timeWeek:function(){return m.fz},timeWeeks:function(){return m.se},timeYear:function(){return v.A},timeYears:function(){return v.V},utcDay:function(){return I.A},utcDays:function(){return I.o},utcFriday:function(){return B.a1},utcFridays:function(){return B.Zn},utcHour:function(){return f},utcHours:function(){return E},utcMillisecond:function(){return e},utcMilliseconds:function(){return w},utcMinute:function(){return T},utcMinutes:function(){return p},utcMonday:function(){return B.rt},utcMondays:function(){return B.ON},utcMonth:function(){return V},utcMonths:function(){return j},utcSaturday:function(){return B.c8},utcSaturdays:function(){return B.Xo},utcSecond:function(){return u},utcSeconds:function(){return r},utcSunday:function(){return B.Hl},utcSundays:function(){return B.aZ},utcThursday:function(){return B.pT},utcThursdays:function(){return B.wr},utcTuesday:function(){return B.sr},utcTuesdays:function(){return B.jN},utcWednesday:function(){return B.z2},utcWednesdays:function(){return B.G6},utcWeek:function(){return B.Hl},utcWeeks:function(){return B.aZ},utcYear:function(){return $.A},utcYears:function(){return $.j}});var b=t(53398),d=(0,b.A)(function(){},function(ee,H){ee.setTime(+ee+H)},function(ee,H){return H-ee});d.every=function(ee){return ee=Math.floor(ee),isFinite(ee)&&ee>0?ee>1?(0,b.A)(function(H){H.setTime(Math.floor(H/ee)*ee)},function(H,J){H.setTime(+H+J*ee)},function(H,J){return(J-H)/ee}):d:null};var e=d,w=d.range,y=t(66291),_=(0,b.A)(function(ee){ee.setTime(ee-ee.getMilliseconds())},function(ee,H){ee.setTime(+ee+H*y.Tt)},function(ee,H){return(H-ee)/y.Tt},function(ee){return ee.getUTCSeconds()}),u=_,r=_.range,n=(0,b.A)(function(ee){ee.setTime(ee-ee.getMilliseconds()-ee.getSeconds()*y.Tt)},function(ee,H){ee.setTime(+ee+H*y.rR)},function(ee,H){return(H-ee)/y.rR},function(ee){return ee.getMinutes()}),l=n,o=n.range,s=(0,b.A)(function(ee){ee.setTime(ee-ee.getMilliseconds()-ee.getSeconds()*y.Tt-ee.getMinutes()*y.rR)},function(ee,H){ee.setTime(+ee+H*y.JJ)},function(ee,H){return(H-ee)/y.JJ},function(ee){return ee.getHours()}),c=s,h=s.range,x=t(47265),m=t(55735),g=(0,b.A)(function(ee){ee.setDate(1),ee.setHours(0,0,0,0)},function(ee,H){ee.setMonth(ee.getMonth()+H)},function(ee,H){return H.getMonth()-ee.getMonth()+12*(H.getFullYear()-ee.getFullYear())},function(ee){return ee.getMonth()}),k=g,A=g.range,v=t(9830),S=(0,b.A)(function(ee){ee.setUTCSeconds(0,0)},function(ee,H){ee.setTime(+ee+H*y.rR)},function(ee,H){return(H-ee)/y.rR},function(ee){return ee.getUTCMinutes()}),T=S,p=S.range,M=(0,b.A)(function(ee){ee.setUTCMinutes(0,0,0)},function(ee,H){ee.setTime(+ee+H*y.JJ)},function(ee,H){return(H-ee)/y.JJ},function(ee){return ee.getUTCHours()}),f=M,E=M.range,I=t(72543),B=t(1681),N=(0,b.A)(function(ee){ee.setUTCDate(1),ee.setUTCHours(0,0,0,0)},function(ee,H){ee.setUTCMonth(ee.getUTCMonth()+H)},function(ee,H){return H.getUTCMonth()-ee.getUTCMonth()+12*(H.getUTCFullYear()-ee.getUTCFullYear())},function(ee){return ee.getUTCMonth()}),V=N,j=N.range,$=t(59764)},53398:function(D,L,t){t.d(L,{A:function(){return e}});var b=new Date,d=new Date;function e(w,y,_,u){function r(n){return w(n=arguments.length===0?new Date:new Date(+n)),n}return r.floor=function(n){return w(n=new Date(+n)),n},r.ceil=function(n){return w(n=new Date(n-1)),y(n,1),w(n),n},r.round=function(n){var l=r(n),o=r.ceil(n);return n-l0))return c;do c.push(s=new Date(+n)),y(n,o),w(n);while(s=l)for(;w(l),!n(l);)l.setTime(l-1)},function(l,o){if(l>=l)if(o<0)for(;++o<=0;)for(;y(l,-1),!n(l););else for(;--o>=0;)for(;y(l,1),!n(l););})},_&&(r.count=function(n,l){return b.setTime(+n),d.setTime(+l),w(b),w(d),Math.floor(_(b,d))},r.every=function(n){return n=Math.floor(n),isFinite(n)&&n>0?n>1?r.filter(u?function(l){return u(l)%n==0}:function(l){return r.count(0,l)%n==0}):r:null}),r}},72543:function(D,L,t){t.d(L,{o:function(){return w}});var b=t(53398),d=t(66291),e=(0,b.A)(function(y){y.setUTCHours(0,0,0,0)},function(y,_){y.setUTCDate(y.getUTCDate()+_)},function(y,_){return(_-y)/d.Nm},function(y){return y.getUTCDate()-1});L.A=e;var w=e.range},1681:function(D,L,t){t.d(L,{G6:function(){return h},Hl:function(){return w},ON:function(){return s},Xo:function(){return g},Zn:function(){return m},a1:function(){return n},aZ:function(){return o},c8:function(){return l},jN:function(){return c},pT:function(){return r},rt:function(){return y},sr:function(){return _},wr:function(){return x},z2:function(){return u}});var b=t(53398),d=t(66291);function e(k){return(0,b.A)(function(A){A.setUTCDate(A.getUTCDate()-(A.getUTCDay()+7-k)%7),A.setUTCHours(0,0,0,0)},function(A,v){A.setUTCDate(A.getUTCDate()+7*v)},function(A,v){return(v-A)/d.Fq})}var w=e(0),y=e(1),_=e(2),u=e(3),r=e(4),n=e(5),l=e(6),o=w.range,s=y.range,c=_.range,h=u.range,x=r.range,m=n.range,g=l.range},59764:function(D,L,t){t.d(L,{j:function(){return e}});var b=t(53398),d=(0,b.A)(function(w){w.setUTCMonth(0,1),w.setUTCHours(0,0,0,0)},function(w,y){w.setUTCFullYear(w.getUTCFullYear()+y)},function(w,y){return y.getUTCFullYear()-w.getUTCFullYear()},function(w){return w.getUTCFullYear()});d.every=function(w){return isFinite(w=Math.floor(w))&&w>0?(0,b.A)(function(y){y.setUTCFullYear(Math.floor(y.getUTCFullYear()/w)*w),y.setUTCMonth(0,1),y.setUTCHours(0,0,0,0)},function(y,_){y.setUTCFullYear(y.getUTCFullYear()+_*w)}):null},L.A=d;var e=d.range},55735:function(D,L,t){t.d(L,{By:function(){return y},KP:function(){return s},Q$:function(){return x},Sh:function(){return n},dt:function(){return r},eQ:function(){return _},fz:function(){return w},gf:function(){return h},kS:function(){return l},l3:function(){return u},se:function(){return o},t$:function(){return g},tz:function(){return m},yW:function(){return c}});var b=t(53398),d=t(66291);function e(k){return(0,b.A)(function(A){A.setDate(A.getDate()-(A.getDay()+7-k)%7),A.setHours(0,0,0,0)},function(A,v){A.setDate(A.getDate()+7*v)},function(A,v){return(v-A-(v.getTimezoneOffset()-A.getTimezoneOffset())*d.rR)/d.Fq})}var w=e(0),y=e(1),_=e(2),u=e(3),r=e(4),n=e(5),l=e(6),o=w.range,s=y.range,c=_.range,h=u.range,x=r.range,m=n.range,g=l.range},9830:function(D,L,t){t.d(L,{V:function(){return e}});var b=t(53398),d=(0,b.A)(function(w){w.setMonth(0,1),w.setHours(0,0,0,0)},function(w,y){w.setFullYear(w.getFullYear()+y)},function(w,y){return y.getFullYear()-w.getFullYear()},function(w){return w.getFullYear()});d.every=function(w){return isFinite(w=Math.floor(w))&&w>0?(0,b.A)(function(y){y.setFullYear(Math.floor(y.getFullYear()/w)*w),y.setMonth(0,1),y.setHours(0,0,0,0)},function(y,_){y.setFullYear(y.getFullYear()+_*w)}):null},L.A=d;var e=d.range},70973:function(D,L,t){var b=t(40891),d=t(98800),e=t(48631),w=t(52991);D.exports=function(y,_,u){if(!y||typeof y!="object"&&typeof y!="function")throw new e("`obj` must be an object or a function`");if(typeof _!="string"&&typeof _!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!w&&w(y,_);if(b)b(y,_,{configurable:l===null&&s?s.configurable:!l,enumerable:r===null&&s?s.enumerable:!r,value:u,writable:n===null&&s?s.writable:!n});else{if(!o&&(r||n||l))throw new d("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");y[_]=u}}},97936:function(D,L,t){var b=t(99433),d=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,w=Array.prototype.concat,y=Object.defineProperty,_=t(74268)(),u=y&&_,r=function(l,o,s,c){if(o in l){if(c===!0){if(l[o]===s)return}else if(typeof(h=c)!="function"||e.call(h)!=="[object Function]"||!c())return}var h;u?y(l,o,{configurable:!0,enumerable:!1,value:s,writable:!0}):l[o]=s},n=function(l,o){var s=arguments.length>2?arguments[2]:{},c=b(o);d&&(c=w.call(c,Object.getOwnPropertySymbols(o)));for(var h=0;hu*r){var c=(s-o)/u;_[l]=1e3*c}}return _}function d(e){for(var w=[],y=e[0];y<=e[1];y++)for(var _=String.fromCharCode(y),u=e[0];u0)return function(d,e){var w,y;for(w=new Array(d),y=0;y80*I){B=V=f[0],N=j=f[1];for(var ae=I;aeV&&(V=$),ee>j&&(j=ee);H=(H=Math.max(V-B,j-N))!==0?32767/H:0}return d(Z,K,I,B,N,H,0),K}function t(f,E,I,B,N){var V,j;if(N===M(f,E,I,B)>0)for(V=E;V=E;V-=B)j=S(V,f[V],f[V+1],j);return j&&x(j,j.next)&&(T(j),j=j.next),j}function b(f,E){if(!f)return f;E||(E=f);var I,B=f;do if(I=!1,B.steiner||!x(B,B.next)&&h(B.prev,B,B.next)!==0)B=B.next;else{if(T(B),(B=E=B.prev)===B.next)break;I=!0}while(I||B!==E);return E}function d(f,E,I,B,N,V,j){if(f){!j&&V&&function(J,Q,Z,K){var ae=J;do ae.z===0&&(ae.z=l(ae.x,ae.y,Q,Z,K)),ae.prevZ=ae.prev,ae.nextZ=ae.next,ae=ae.next;while(ae!==J);ae.prevZ.nextZ=null,ae.prevZ=null,function(se){var he,fe,ie,oe,le,ge,ye,me,be=1;do{for(fe=se,se=null,le=null,ge=0;fe;){for(ge++,ie=fe,ye=0,he=0;he0||me>0&&ie;)ye!==0&&(me===0||!ie||fe.z<=ie.z)?(oe=fe,fe=fe.nextZ,ye--):(oe=ie,ie=ie.nextZ,me--),le?le.nextZ=oe:se=oe,oe.prevZ=le,le=oe;fe=ie}le.nextZ=null,be*=2}while(ge>1)}(ae)}(f,B,N,V);for(var $,ee,H=f;f.prev!==f.next;)if($=f.prev,ee=f.next,V?w(f,B,N,V):e(f))E.push($.i/I|0),E.push(f.i/I|0),E.push(ee.i/I|0),T(f),f=ee.next,H=ee.next;else if((f=ee)===H){j?j===1?d(f=y(b(f),E,I),E,I,B,N,V,2):j===2&&_(f,E,I,B,N,V):d(b(f),E,I,B,N,V,1);break}}}function e(f){var E=f.prev,I=f,B=f.next;if(h(E,I,B)>=0)return!1;for(var N=E.x,V=I.x,j=B.x,$=E.y,ee=I.y,H=B.y,J=NV?N>j?N:j:V>j?V:j,K=$>ee?$>H?$:H:ee>H?ee:H,ae=B.next;ae!==E;){if(ae.x>=J&&ae.x<=Z&&ae.y>=Q&&ae.y<=K&&s(N,$,V,ee,j,H,ae.x,ae.y)&&h(ae.prev,ae,ae.next)>=0)return!1;ae=ae.next}return!0}function w(f,E,I,B){var N=f.prev,V=f,j=f.next;if(h(N,V,j)>=0)return!1;for(var $=N.x,ee=V.x,H=j.x,J=N.y,Q=V.y,Z=j.y,K=$ee?$>H?$:H:ee>H?ee:H,he=J>Q?J>Z?J:Z:Q>Z?Q:Z,fe=l(K,ae,E,I,B),ie=l(se,he,E,I,B),oe=f.prevZ,le=f.nextZ;oe&&oe.z>=fe&&le&&le.z<=ie;){if(oe.x>=K&&oe.x<=se&&oe.y>=ae&&oe.y<=he&&oe!==N&&oe!==j&&s($,J,ee,Q,H,Z,oe.x,oe.y)&&h(oe.prev,oe,oe.next)>=0||(oe=oe.prevZ,le.x>=K&&le.x<=se&&le.y>=ae&&le.y<=he&&le!==N&&le!==j&&s($,J,ee,Q,H,Z,le.x,le.y)&&h(le.prev,le,le.next)>=0))return!1;le=le.nextZ}for(;oe&&oe.z>=fe;){if(oe.x>=K&&oe.x<=se&&oe.y>=ae&&oe.y<=he&&oe!==N&&oe!==j&&s($,J,ee,Q,H,Z,oe.x,oe.y)&&h(oe.prev,oe,oe.next)>=0)return!1;oe=oe.prevZ}for(;le&&le.z<=ie;){if(le.x>=K&&le.x<=se&&le.y>=ae&&le.y<=he&&le!==N&&le!==j&&s($,J,ee,Q,H,Z,le.x,le.y)&&h(le.prev,le,le.next)>=0)return!1;le=le.nextZ}return!0}function y(f,E,I){var B=f;do{var N=B.prev,V=B.next.next;!x(N,V)&&m(N,B,B.next,V)&&A(N,V)&&A(V,N)&&(E.push(N.i/I|0),E.push(B.i/I|0),E.push(V.i/I|0),T(B),T(B.next),B=f=V),B=B.next}while(B!==f);return b(B)}function _(f,E,I,B,N,V){var j=f;do{for(var $=j.next.next;$!==j.prev;){if(j.i!==$.i&&c(j,$)){var ee=v(j,$);return j=b(j,j.next),ee=b(ee,ee.next),d(j,E,I,B,N,V,0),void d(ee,E,I,B,N,V,0)}$=$.next}j=j.next}while(j!==f)}function u(f,E){return f.x-E.x}function r(f,E){var I=function(N,V){var j,$=V,ee=N.x,H=N.y,J=-1/0;do{if(H<=$.y&&H>=$.next.y&&$.next.y!==$.y){var Q=$.x+(H-$.y)*($.next.x-$.x)/($.next.y-$.y);if(Q<=ee&&Q>J&&(J=Q,j=$.x<$.next.x?$:$.next,Q===ee))return j}$=$.next}while($!==V);if(!j)return null;var Z,K=j,ae=j.x,se=j.y,he=1/0;$=j;do ee>=$.x&&$.x>=ae&&ee!==$.x&&s(Hj.x||$.x===j.x&&n(j,$)))&&(j=$,he=Z)),$=$.next;while($!==K);return j}(f,E);if(!I)return E;var B=v(I,f);return b(B,B.next),b(I,I.next)}function n(f,E){return h(f.prev,f,E.prev)<0&&h(E.next,f,f.next)<0}function l(f,E,I,B,N){return(f=1431655765&((f=858993459&((f=252645135&((f=16711935&((f=(f-I)*N|0)|f<<8))|f<<4))|f<<2))|f<<1))|(E=1431655765&((E=858993459&((E=252645135&((E=16711935&((E=(E-B)*N|0)|E<<8))|E<<4))|E<<2))|E<<1))<<1}function o(f){var E=f,I=f;do(E.x=(f-j)*(V-$)&&(f-j)*(B-$)>=(I-j)*(E-$)&&(I-j)*(V-$)>=(N-j)*(B-$)}function c(f,E){return f.next.i!==E.i&&f.prev.i!==E.i&&!function(I,B){var N=I;do{if(N.i!==I.i&&N.next.i!==I.i&&N.i!==B.i&&N.next.i!==B.i&&m(N,N.next,I,B))return!0;N=N.next}while(N!==I);return!1}(f,E)&&(A(f,E)&&A(E,f)&&function(I,B){var N=I,V=!1,j=(I.x+B.x)/2,$=(I.y+B.y)/2;do N.y>$!=N.next.y>$&&N.next.y!==N.y&&j<(N.next.x-N.x)*($-N.y)/(N.next.y-N.y)+N.x&&(V=!V),N=N.next;while(N!==I);return V}(f,E)&&(h(f.prev,f,E.prev)||h(f,E.prev,E))||x(f,E)&&h(f.prev,f,f.next)>0&&h(E.prev,E,E.next)>0)}function h(f,E,I){return(E.y-f.y)*(I.x-E.x)-(E.x-f.x)*(I.y-E.y)}function x(f,E){return f.x===E.x&&f.y===E.y}function m(f,E,I,B){var N=k(h(f,E,I)),V=k(h(f,E,B)),j=k(h(I,B,f)),$=k(h(I,B,E));return N!==V&&j!==$||!(N!==0||!g(f,I,E))||!(V!==0||!g(f,B,E))||!(j!==0||!g(I,f,B))||!($!==0||!g(I,E,B))}function g(f,E,I){return E.x<=Math.max(f.x,I.x)&&E.x>=Math.min(f.x,I.x)&&E.y<=Math.max(f.y,I.y)&&E.y>=Math.min(f.y,I.y)}function k(f){return f>0?1:f<0?-1:0}function A(f,E){return h(f.prev,f,f.next)<0?h(f,E,f.next)>=0&&h(f,f.prev,E)>=0:h(f,E,f.prev)<0||h(f,f.next,E)<0}function v(f,E){var I=new p(f.i,f.x,f.y),B=new p(E.i,E.x,E.y),N=f.next,V=E.prev;return f.next=E,E.prev=f,I.next=N,N.prev=I,B.next=I,I.prev=B,V.next=B,B.prev=V,B}function S(f,E,I,B){var N=new p(f,E,I);return B?(N.next=B.next,N.prev=B,B.next.prev=N,B.next=N):(N.prev=N,N.next=N),N}function T(f){f.next.prev=f.prev,f.prev.next=f.next,f.prevZ&&(f.prevZ.nextZ=f.nextZ),f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function p(f,E,I){this.i=f,this.x=E,this.y=I,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(f,E,I,B){for(var N=0,V=E,j=I-B;V0&&(B+=f[N-1].length,I.holes.push(B))}return I}},96143:function(D,L,t){var b=t(26381);D.exports=function(d,e){var w,y=[],_=[],u=[],r={},n=[];function l(A){u[A]=!1,r.hasOwnProperty(A)&&Object.keys(r[A]).forEach(function(v){delete r[A][v],u[v]&&l(v)})}function o(A){var v,S,T=!1;for(_.push(A),u[A]=!0,v=0;v=I})})(A);for(var v,S=b(d).components.filter(function(I){return I.length>1}),T=1/0,p=0;p=55296&&A<=56319&&(p+=c[++x]),p=M?l.call(M,f,p,m):p,h?(o.value=p,s(g,m,o)):g[m]=p,++m;k=m}}if(k===void 0)for(k=w(c.length),h&&(g=new h(k)),x=0;x0?1:-1}},10226:function(D,L,t){var b=t(53579),d=Math.abs,e=Math.floor;D.exports=function(w){return isNaN(w)?0:(w=Number(w))!==0&&isFinite(w)?b(w)*e(d(w)):w}},54653:function(D,L,t){var b=t(10226),d=Math.max;D.exports=function(e){return d(0,b(e))}},39395:function(D,L,t){var b=t(52359),d=t(69746),e=Function.prototype.bind,w=Function.prototype.call,y=Object.keys,_=Object.prototype.propertyIsEnumerable;D.exports=function(u,r){return function(n,l){var o,s=arguments[2],c=arguments[3];return n=Object(d(n)),b(l),o=y(n),c&&o.sort(typeof c=="function"?e.call(c,n):void 0),typeof u!="function"&&(u=o[u]),w.call(u,o,function(h,x){return _.call(n,h)?w.call(l,s,n[h],h,n,x):r})}}},1920:function(D,L,t){D.exports=t(41271)()?Object.assign:t(26399)},41271:function(D){D.exports=function(){var L,t=Object.assign;return typeof t=="function"&&(t(L={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),L.foo+L.bar+L.trzy==="razdwatrzy")}},26399:function(D,L,t){var b=t(36353),d=t(69746),e=Math.max;D.exports=function(w,y){var _,u,r,n=e(arguments.length,2);for(w=Object(d(w)),r=function(l){try{w[l]=y[l]}catch(o){_||(_=o)}},u=1;u-1}},48488:function(D){var L=Object.prototype.toString,t=L.call("");D.exports=function(b){return typeof b=="string"||b&&typeof b=="object"&&(b instanceof String||L.call(b)===t)||!1}},43497:function(D){var L=Object.create(null),t=Math.random;D.exports=function(){var b;do b=t().toString(36).slice(2);while(L[b]);return b}},71343:function(D,L,t){var b,d=t(22834),e=t(2338),w=t(91819),y=t(63008),_=t(85490),u=Object.defineProperty;b=D.exports=function(r,n){if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");_.call(this,r),n=n?e.call(n,"key+value")?"key+value":e.call(n,"key")?"key":"value":"value",u(this,"__kind__",w("",n))},d&&d(b,_),delete b.prototype.constructor,b.prototype=Object.create(_.prototype,{_resolve:w(function(r){return this.__kind__==="value"?this.__list__[r]:this.__kind__==="key+value"?[r,this.__list__[r]]:r})}),u(b.prototype,y.toStringTag,w("c","Array Iterator"))},58755:function(D,L,t){var b=t(82262),d=t(52359),e=t(48488),w=t(34494),y=Array.isArray,_=Function.prototype.call,u=Array.prototype.some;D.exports=function(r,n){var l,o,s,c,h,x,m,g,k=arguments[2];if(y(r)||b(r)?l="array":e(r)?l="string":r=w(r),d(n),s=function(){c=!0},l!=="array")if(l!=="string")for(o=r.next();!o.done;){if(_.call(n,k,o.value,s),c)return;o=r.next()}else for(x=r.length,h=0;h=55296&&g<=56319&&(m+=r[++h]),_.call(n,k,m,s),!c);++h);else u.call(r,function(A){return _.call(n,k,A,s),c})}},34494:function(D,L,t){var b=t(82262),d=t(48488),e=t(71343),w=t(23417),y=t(82831),_=t(63008).iterator;D.exports=function(u){return typeof y(u)[_]=="function"?u[_]():b(u)?new e(u):d(u)?new w(u):new e(u)}},85490:function(D,L,t){var b,d=t(91445),e=t(1920),w=t(52359),y=t(69746),_=t(91819),u=t(84510),r=t(63008),n=Object.defineProperty,l=Object.defineProperties;D.exports=b=function(o,s){if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");l(this,{__list__:_("w",y(o)),__context__:_("w",s),__nextIndex__:_("w",0)}),s&&(w(s.on),s.on("_add",this._onAdd),s.on("_delete",this._onDelete),s.on("_clear",this._onClear))},delete b.prototype.constructor,l(b.prototype,e({_next:_(function(){var o;if(this.__list__)return this.__redo__&&(o=this.__redo__.shift())!==void 0?o:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(s,c){s>=o&&(this.__redo__[c]=++s)},this),this.__redo__.push(o)):n(this,"__redo__",_("c",[o])))}),_onDelete:_(function(o){var s;o>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&((s=this.__redo__.indexOf(o))!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,h){c>o&&(this.__redo__[h]=--c)},this)))}),_onClear:_(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),n(b.prototype,r.iterator,_(function(){return this}))},50567:function(D,L,t){var b=t(82262),d=t(1974),e=t(48488),w=t(63008).iterator,y=Array.isArray;D.exports=function(_){return!(!d(_)||!y(_)&&!e(_)&&!b(_)&&typeof _[w]!="function")}},23417:function(D,L,t){var b,d=t(22834),e=t(91819),w=t(63008),y=t(85490),_=Object.defineProperty;b=D.exports=function(u){if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");u=String(u),y.call(this,u),_(this,"__length__",e("",u.length))},d&&d(b,y),delete b.prototype.constructor,b.prototype=Object.create(y.prototype,{_next:e(function(){if(this.__list__)return this.__nextIndex__=55296&&r<=56319?n+this.__list__[this.__nextIndex__++]:n})}),_(b.prototype,w.toStringTag,e("c","String Iterator"))},82831:function(D,L,t){var b=t(50567);D.exports=function(d){if(!b(d))throw new TypeError(d+" is not iterable");return d}},63008:function(D,L,t){D.exports=t(25143)()?t(64725).Symbol:t(81905)},25143:function(D,L,t){var b=t(64725),d={object:!0,symbol:!0};D.exports=function(){var e,w=b.Symbol;if(typeof w!="function")return!1;e=w("test symbol");try{String(e)}catch{return!1}return!!d[typeof w.iterator]&&!!d[typeof w.toPrimitive]&&!!d[typeof w.toStringTag]}},41707:function(D){D.exports=function(L){return!!L&&(typeof L=="symbol"||!!L.constructor&&L.constructor.name==="Symbol"&&L[L.constructor.toStringTag]==="Symbol")}},74009:function(D,L,t){var b=t(91819),d=Object.create,e=Object.defineProperty,w=Object.prototype,y=d(null);D.exports=function(_){for(var u,r,n=0;y[_+(n||"")];)++n;return y[_+=n||""]=!0,e(w,u="@@"+_,b.gs(null,function(l){r||(r=!0,e(this,u,b(l)),r=!1)})),u}},40313:function(D,L,t){var b=t(91819),d=t(64725).Symbol;D.exports=function(e){return Object.defineProperties(e,{hasInstance:b("",d&&d.hasInstance||e("hasInstance")),isConcatSpreadable:b("",d&&d.isConcatSpreadable||e("isConcatSpreadable")),iterator:b("",d&&d.iterator||e("iterator")),match:b("",d&&d.match||e("match")),replace:b("",d&&d.replace||e("replace")),search:b("",d&&d.search||e("search")),species:b("",d&&d.species||e("species")),split:b("",d&&d.split||e("split")),toPrimitive:b("",d&&d.toPrimitive||e("toPrimitive")),toStringTag:b("",d&&d.toStringTag||e("toStringTag")),unscopables:b("",d&&d.unscopables||e("unscopables"))})}},21290:function(D,L,t){var b=t(91819),d=t(91765),e=Object.create(null);D.exports=function(w){return Object.defineProperties(w,{for:b(function(y){return e[y]?e[y]:e[y]=w(String(y))}),keyFor:b(function(y){var _;for(_ in d(y),e)if(e[_]===y)return _})})}},81905:function(D,L,t){var b,d,e,w=t(91819),y=t(91765),_=t(64725).Symbol,u=t(74009),r=t(40313),n=t(21290),l=Object.create,o=Object.defineProperties,s=Object.defineProperty;if(typeof _=="function")try{String(_()),e=!0}catch{}else _=null;d=function(c){if(this instanceof d)throw new TypeError("Symbol is not a constructor");return b(c)},D.exports=b=function c(h){var x;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return e?_(h):(x=l(d.prototype),h=h===void 0?"":String(h),o(x,{__description__:w("",h),__name__:w("",u(h))}))},r(b),n(b),o(d.prototype,{constructor:w(b),toString:w("",function(){return this.__name__})}),o(b.prototype,{toString:w(function(){return"Symbol ("+y(this).__description__+")"}),valueOf:w(function(){return y(this)})}),s(b.prototype,b.toPrimitive,w("",function(){var c=y(this);return typeof c=="symbol"?c:c.toString()})),s(b.prototype,b.toStringTag,w("c","Symbol")),s(d.prototype,b.toStringTag,w("c",b.prototype[b.toStringTag])),s(d.prototype,b.toPrimitive,w("c",b.prototype[b.toPrimitive]))},91765:function(D,L,t){var b=t(41707);D.exports=function(d){if(!b(d))throw new TypeError(d+" is not a symbol");return d}},93103:function(D,L,t){D.exports=t(22742)()?WeakMap:t(21780)},22742:function(D){D.exports=function(){var L,t;if(typeof WeakMap!="function")return!1;try{L=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return String(L)==="[object WeakMap]"&&typeof L.set=="function"&&L.set({},1)===L&&typeof L.delete=="function"&&typeof L.has=="function"&&L.get(t)==="one"}},81810:function(D){D.exports=typeof WeakMap=="function"&&Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"},21780:function(D,L,t){var b,d=t(1974),e=t(22834),w=t(11004),y=t(69746),_=t(43497),u=t(91819),r=t(34494),n=t(58755),l=t(63008).toStringTag,o=t(81810),s=Array.isArray,c=Object.defineProperty,h=Object.prototype.hasOwnProperty,x=Object.getPrototypeOf;D.exports=b=function(){var m,g=arguments[0];if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");return m=o&&e&&WeakMap!==b?e(new WeakMap,x(this)):this,d(g)&&(s(g)||(g=r(g))),c(m,"__weakMapData__",u("c","$weakMap$"+_())),g&&n(g,function(k){y(k),m.set(k[0],k[1])}),m},o&&(e&&e(b,WeakMap),b.prototype=Object.create(WeakMap.prototype,{constructor:u(b)})),Object.defineProperties(b.prototype,{delete:u(function(m){return!!h.call(w(m),this.__weakMapData__)&&(delete m[this.__weakMapData__],!0)}),get:u(function(m){if(h.call(w(m),this.__weakMapData__))return m[this.__weakMapData__]}),has:u(function(m){return h.call(w(m),this.__weakMapData__)}),set:u(function(m,g){return c(w(m),this.__weakMapData__,u("c",g)),this}),toString:u(function(){return"[object WeakMap]"})}),c(b.prototype,l,u("c","WeakMap"))},7683:function(D){var L,t=typeof Reflect=="object"?Reflect:null,b=t&&typeof t.apply=="function"?t.apply:function(h,x,m){return Function.prototype.apply.call(h,x,m)};L=t&&typeof t.ownKeys=="function"?t.ownKeys:Object.getOwnPropertySymbols?function(h){return Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h))}:function(h){return Object.getOwnPropertyNames(h)};var d=Number.isNaN||function(h){return h!=h};function e(){e.init.call(this)}D.exports=e,D.exports.once=function(h,x){return new Promise(function(m,g){function k(v){h.removeListener(x,A),g(v)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",k),m([].slice.call(arguments))}c(h,x,A,{once:!0}),x!=="error"&&function(v,S,T){typeof v.on=="function"&&c(v,"error",S,{once:!0})}(h,k)})},e.EventEmitter=e,e.prototype._events=void 0,e.prototype._eventsCount=0,e.prototype._maxListeners=void 0;var w=10;function y(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}function _(h){return h._maxListeners===void 0?e.defaultMaxListeners:h._maxListeners}function u(h,x,m,g){var k,A,v,S;if(y(m),(A=h._events)===void 0?(A=h._events=Object.create(null),h._eventsCount=0):(A.newListener!==void 0&&(h.emit("newListener",x,m.listener?m.listener:m),A=h._events),v=A[x]),v===void 0)v=A[x]=m,++h._eventsCount;else if(typeof v=="function"?v=A[x]=g?[m,v]:[v,m]:g?v.unshift(m):v.push(m),(k=_(h))>0&&v.length>k&&!v.warned){v.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+v.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=h,T.type=x,T.count=v.length,S=T,console&&console.warn&&console.warn(S)}return h}function r(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function n(h,x,m){var g={fired:!1,wrapFn:void 0,target:h,type:x,listener:m},k=r.bind(g);return k.listener=m,g.wrapFn=k,k}function l(h,x,m){var g=h._events;if(g===void 0)return[];var k=g[x];return k===void 0?[]:typeof k=="function"?m?[k.listener||k]:[k]:m?function(A){for(var v=new Array(A.length),S=0;S0&&(A=x[0]),A instanceof Error)throw A;var v=new Error("Unhandled error."+(A?" ("+A.message+")":""));throw v.context=A,v}var S=k[h];if(S===void 0)return!1;if(typeof S=="function")b(S,this,x);else{var T=S.length,p=s(S,T);for(m=0;m=0;A--)if(m[A]===x||m[A].listener===x){v=m[A].listener,k=A;break}if(k<0)return this;k===0?m.shift():function(S,T){for(;T+1=0;g--)this.removeListener(h,x[g]);return this},e.prototype.listeners=function(h){return l(this,h,!0)},e.prototype.rawListeners=function(h){return l(this,h,!1)},e.listenerCount=function(h,x){return typeof h.listenerCount=="function"?h.listenerCount(x):o.call(h,x)},e.prototype.listenerCount=o,e.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},77083:function(D){var L=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};D.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return L()}try{return __global__||L()}finally{delete Object.prototype.__global__}}()},64725:function(D,L,t){D.exports=t(17804)()?globalThis:t(77083)},17804:function(D){D.exports=function(){return typeof globalThis=="object"&&!!globalThis&&globalThis.Array===Array}},10721:function(D,L,t){var b=t(9914);D.exports=function(d){var e=typeof d;if(e==="string"){var w=d;if((d=+d)==0&&b(w))return!1}else if(e!=="number")return!1;return d-d<1}},83473:function(D,L,t){var b=t(10275);D.exports=function(d,e,w){if(!d)throw new TypeError("must specify data as first parameter");if(w=0|+(w||0),Array.isArray(d)&&d[0]&&typeof d[0][0]=="number"){var y,_,u,r,n=d[0].length,l=d.length*n;e&&typeof e!="string"||(e=new(b(e||"float32"))(l+w));var o=e.length-w;if(l!==o)throw new Error("source length "+l+" ("+n+"x"+d.length+") does not match destination length "+o);for(y=0,u=w;yw[0]-u[0]/2&&(c=u[0]/2,h+=u[1]);return y}},12673:function(D){function L(e,w){w||(w={}),(typeof e=="string"||Array.isArray(e))&&(w.family=e);var y=Array.isArray(w.family)?w.family.join(", "):w.family;if(!y)throw Error("`family` must be defined");var _=w.size||w.fontSize||w.em||48,u=w.weight||w.fontWeight||"",r=(e=[w.style||w.fontStyle||"",u,_].join(" ")+"px "+y,w.origin||"top");if(L.cache[y]&&_<=L.cache[y].em)return t(L.cache[y],r);var n=w.canvas||L.canvas,l=n.getContext("2d"),o={upper:w.upper!==void 0?w.upper:"H",lower:w.lower!==void 0?w.lower:"x",descent:w.descent!==void 0?w.descent:"p",ascent:w.ascent!==void 0?w.ascent:"h",tittle:w.tittle!==void 0?w.tittle:"i",overshoot:w.overshoot!==void 0?w.overshoot:"O"},s=Math.ceil(1.5*_);n.height=s,n.width=.5*s,l.font=e;var c="H",h={top:0};l.clearRect(0,0,s,s),l.textBaseline="top",l.fillStyle="black",l.fillText(c,0,0);var x=b(l.getImageData(0,0,s,s));l.clearRect(0,0,s,s),l.textBaseline="bottom",l.fillText(c,0,s);var m=b(l.getImageData(0,0,s,s));h.lineHeight=h.bottom=s-m+x,l.clearRect(0,0,s,s),l.textBaseline="alphabetic",l.fillText(c,0,s);var g=s-b(l.getImageData(0,0,s,s))-1+x;h.baseline=h.alphabetic=g,l.clearRect(0,0,s,s),l.textBaseline="middle",l.fillText(c,0,.5*s);var k=b(l.getImageData(0,0,s,s));h.median=h.middle=s-k-1+x-.5*s,l.clearRect(0,0,s,s),l.textBaseline="hanging",l.fillText(c,0,.5*s);var A=b(l.getImageData(0,0,s,s));h.hanging=s-A-1+x-.5*s,l.clearRect(0,0,s,s),l.textBaseline="ideographic",l.fillText(c,0,s);var v=b(l.getImageData(0,0,s,s));if(h.ideographic=s-v-1+x,o.upper&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.upper,0,0),h.upper=b(l.getImageData(0,0,s,s)),h.capHeight=h.baseline-h.upper),o.lower&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.lower,0,0),h.lower=b(l.getImageData(0,0,s,s)),h.xHeight=h.baseline-h.lower),o.tittle&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.tittle,0,0),h.tittle=b(l.getImageData(0,0,s,s))),o.ascent&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.ascent,0,0),h.ascent=b(l.getImageData(0,0,s,s))),o.descent&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.descent,0,0),h.descent=d(l.getImageData(0,0,s,s))),o.overshoot){l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.overshoot,0,0);var S=d(l.getImageData(0,0,s,s));h.overshoot=S-g}for(var T in h)h[T]/=_;return h.em=_,L.cache[y]=h,t(h,r)}function t(e,w){var y={};for(var _ in typeof w=="string"&&(w=e[w]),e)_!=="em"&&(y[_]=e[_]-w);return y}function b(e){for(var w=e.height,y=e.data,_=3;_0;_-=4)if(y[_]!==0)return Math.floor(.25*(_-3)/w)}D.exports=L,L.canvas=document.createElement("canvas"),L.cache={}},61262:function(D,L,t){var b=t(82756),d=Object.prototype.toString,e=Object.prototype.hasOwnProperty;D.exports=function(w,y,_){if(!b(y))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=_),d.call(w)==="[object Array]"?function(r,n,l){for(var o=0,s=r.length;o"u"&&!t.canvas)return null;var b=t.canvas||document.createElement("canvas");typeof t.width=="number"&&(b.width=t.width),typeof t.height=="number"&&(b.height=t.height);var d,e=t;try{var w=[L];L.indexOf("webgl")===0&&w.push("experimental-"+L);for(var y=0;y"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":h&&m?m([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":e,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":n,"%GeneratorFunction%":g,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&m?m(m([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map<"u"&&h&&m?m(new Map()[Symbol.iterator]()):b,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":w,"%ReferenceError%":y,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set<"u"&&h&&m?m(new Set()[Symbol.iterator]()):b,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&m?m(""[Symbol.iterator]()):b,"%Symbol%":h?Symbol:b,"%SyntaxError%":_,"%ThrowTypeError%":c,"%TypedArray%":k,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":r,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet};if(m)try{null.error}catch(ee){var v=m(m(ee));A["%Error.prototype%"]=v}var S=function ee(H){var J;if(H==="%AsyncFunction%")J=l("async function () {}");else if(H==="%GeneratorFunction%")J=l("function* () {}");else if(H==="%AsyncGeneratorFunction%")J=l("async function* () {}");else if(H==="%AsyncGenerator%"){var Q=ee("%AsyncGeneratorFunction%");Q&&(J=Q.prototype)}else if(H==="%AsyncIteratorPrototype%"){var Z=ee("%AsyncGenerator%");Z&&m&&(J=m(Z.prototype))}return A[H]=J,J},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},p=t(87547),M=t(80753),f=p.call(Function.call,Array.prototype.concat),E=p.call(Function.apply,Array.prototype.splice),I=p.call(Function.call,String.prototype.replace),B=p.call(Function.call,String.prototype.slice),N=p.call(Function.call,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,$=function(ee,H){var J,Q=ee;if(M(T,Q)&&(Q="%"+(J=T[Q])[0]+"%"),M(A,Q)){var Z=A[Q];if(Z===g&&(Z=S(Q)),Z===void 0&&!H)throw new u("intrinsic "+ee+" exists, but is not available. Please file an issue!");return{alias:J,name:Q,value:Z}}throw new _("intrinsic "+ee+" does not exist!")};D.exports=function(ee,H){if(typeof ee!="string"||ee.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof H!="boolean")throw new u('"allowMissing" argument must be a boolean');if(N(/^%?[^%]*%?$/,ee)===null)throw new _("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var J=function(me){var be=B(me,0,1),Se=B(me,-1);if(be==="%"&&Se!=="%")throw new _("invalid intrinsic syntax, expected closing `%`");if(Se==="%"&&be!=="%")throw new _("invalid intrinsic syntax, expected opening `%`");var Ee=[];return I(me,V,function(Ce,Le,Oe,We){Ee[Ee.length]=Oe?I(We,j,"$1"):Le||Ce}),Ee}(ee),Q=J.length>0?J[0]:"",Z=$("%"+Q+"%",H),K=Z.name,ae=Z.value,se=!1,he=Z.alias;he&&(Q=he[0],E(J,f([0,1],he)));for(var fe=1,ie=!0;fe=J.length){var ye=o(ae,oe);ae=(ie=!!ye)&&"get"in ye&&!("originalValue"in ye.get)?ye.get:ae[oe]}else ie=M(ae,oe),ae=ae[oe];ie&&!se&&(A[K]=ae)}}return ae}},84840:function(D){D.exports=function(L,t){var b=t[0],d=t[1],e=t[2],w=t[3],y=t[4],_=t[5],u=t[6],r=t[7],n=t[8],l=t[9],o=t[10],s=t[11],c=t[12],h=t[13],x=t[14],m=t[15];return L[0]=_*(o*m-s*x)-l*(u*m-r*x)+h*(u*s-r*o),L[1]=-(d*(o*m-s*x)-l*(e*m-w*x)+h*(e*s-w*o)),L[2]=d*(u*m-r*x)-_*(e*m-w*x)+h*(e*r-w*u),L[3]=-(d*(u*s-r*o)-_*(e*s-w*o)+l*(e*r-w*u)),L[4]=-(y*(o*m-s*x)-n*(u*m-r*x)+c*(u*s-r*o)),L[5]=b*(o*m-s*x)-n*(e*m-w*x)+c*(e*s-w*o),L[6]=-(b*(u*m-r*x)-y*(e*m-w*x)+c*(e*r-w*u)),L[7]=b*(u*s-r*o)-y*(e*s-w*o)+n*(e*r-w*u),L[8]=y*(l*m-s*h)-n*(_*m-r*h)+c*(_*s-r*l),L[9]=-(b*(l*m-s*h)-n*(d*m-w*h)+c*(d*s-w*l)),L[10]=b*(_*m-r*h)-y*(d*m-w*h)+c*(d*r-w*_),L[11]=-(b*(_*s-r*l)-y*(d*s-w*l)+n*(d*r-w*_)),L[12]=-(y*(l*x-o*h)-n*(_*x-u*h)+c*(_*o-u*l)),L[13]=b*(l*x-o*h)-n*(d*x-e*h)+c*(d*o-e*l),L[14]=-(b*(_*x-u*h)-y*(d*x-e*h)+c*(d*u-e*_)),L[15]=b*(_*o-u*l)-y*(d*o-e*l)+n*(d*u-e*_),L}},99698:function(D){D.exports=function(L){var t=new Float32Array(16);return t[0]=L[0],t[1]=L[1],t[2]=L[2],t[3]=L[3],t[4]=L[4],t[5]=L[5],t[6]=L[6],t[7]=L[7],t[8]=L[8],t[9]=L[9],t[10]=L[10],t[11]=L[11],t[12]=L[12],t[13]=L[13],t[14]=L[14],t[15]=L[15],t}},57938:function(D){D.exports=function(L,t){return L[0]=t[0],L[1]=t[1],L[2]=t[2],L[3]=t[3],L[4]=t[4],L[5]=t[5],L[6]=t[6],L[7]=t[7],L[8]=t[8],L[9]=t[9],L[10]=t[10],L[11]=t[11],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15],L}},87519:function(D){D.exports=function(){var L=new Float32Array(16);return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},6900:function(D){D.exports=function(L){var t=L[0],b=L[1],d=L[2],e=L[3],w=L[4],y=L[5],_=L[6],u=L[7],r=L[8],n=L[9],l=L[10],o=L[11],s=L[12],c=L[13],h=L[14],x=L[15];return(t*y-b*w)*(l*x-o*h)-(t*_-d*w)*(n*x-o*c)+(t*u-e*w)*(n*h-l*c)+(b*_-d*y)*(r*x-o*s)-(b*u-e*y)*(r*h-l*s)+(d*u-e*_)*(r*c-n*s)}},36472:function(D){D.exports=function(L,t){var b=t[0],d=t[1],e=t[2],w=t[3],y=b+b,_=d+d,u=e+e,r=b*y,n=d*y,l=d*_,o=e*y,s=e*_,c=e*u,h=w*y,x=w*_,m=w*u;return L[0]=1-l-c,L[1]=n+m,L[2]=o-x,L[3]=0,L[4]=n-m,L[5]=1-r-c,L[6]=s+h,L[7]=0,L[8]=o+x,L[9]=s-h,L[10]=1-r-l,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},43061:function(D){D.exports=function(L,t,b){var d,e,w,y=b[0],_=b[1],u=b[2],r=Math.sqrt(y*y+_*_+u*u);return Math.abs(r)<1e-6?null:(y*=r=1/r,_*=r,u*=r,d=Math.sin(t),w=1-(e=Math.cos(t)),L[0]=y*y*w+e,L[1]=_*y*w+u*d,L[2]=u*y*w-_*d,L[3]=0,L[4]=y*_*w-u*d,L[5]=_*_*w+e,L[6]=u*_*w+y*d,L[7]=0,L[8]=y*u*w+_*d,L[9]=_*u*w-y*d,L[10]=u*u*w+e,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L)}},33606:function(D){D.exports=function(L,t,b){var d=t[0],e=t[1],w=t[2],y=t[3],_=d+d,u=e+e,r=w+w,n=d*_,l=d*u,o=d*r,s=e*u,c=e*r,h=w*r,x=y*_,m=y*u,g=y*r;return L[0]=1-(s+h),L[1]=l+g,L[2]=o-m,L[3]=0,L[4]=l-g,L[5]=1-(n+h),L[6]=c+x,L[7]=0,L[8]=o+m,L[9]=c-x,L[10]=1-(n+s),L[11]=0,L[12]=b[0],L[13]=b[1],L[14]=b[2],L[15]=1,L}},98698:function(D){D.exports=function(L,t){return L[0]=t[0],L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=t[1],L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=t[2],L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},6924:function(D){D.exports=function(L,t){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=t[0],L[13]=t[1],L[14]=t[2],L[15]=1,L}},81181:function(D){D.exports=function(L,t){var b=Math.sin(t),d=Math.cos(t);return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=d,L[6]=b,L[7]=0,L[8]=0,L[9]=-b,L[10]=d,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},95258:function(D){D.exports=function(L,t){var b=Math.sin(t),d=Math.cos(t);return L[0]=d,L[1]=0,L[2]=-b,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=b,L[9]=0,L[10]=d,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},94815:function(D){D.exports=function(L,t){var b=Math.sin(t),d=Math.cos(t);return L[0]=d,L[1]=b,L[2]=0,L[3]=0,L[4]=-b,L[5]=d,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},87301:function(D){D.exports=function(L,t,b,d,e,w,y){var _=1/(b-t),u=1/(e-d),r=1/(w-y);return L[0]=2*w*_,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=2*w*u,L[6]=0,L[7]=0,L[8]=(b+t)*_,L[9]=(e+d)*u,L[10]=(y+w)*r,L[11]=-1,L[12]=0,L[13]=0,L[14]=y*w*2*r,L[15]=0,L}},87193:function(D){D.exports=function(L){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},11191:function(D,L,t){D.exports={create:t(87519),clone:t(99698),copy:t(57938),identity:t(87193),transpose:t(10256),invert:t(96559),adjoint:t(84840),determinant:t(6900),multiply:t(14787),translate:t(4165),scale:t(8697),rotate:t(32416),rotateX:t(81066),rotateY:t(54201),rotateZ:t(33920),fromRotation:t(43061),fromRotationTranslation:t(33606),fromScaling:t(98698),fromTranslation:t(6924),fromXRotation:t(81181),fromYRotation:t(95258),fromZRotation:t(94815),fromQuat:t(36472),frustum:t(87301),perspective:t(5313),perspectiveFromFieldOfView:t(22253),ortho:t(4633),lookAt:t(26645),str:t(66992)}},96559:function(D){D.exports=function(L,t){var b=t[0],d=t[1],e=t[2],w=t[3],y=t[4],_=t[5],u=t[6],r=t[7],n=t[8],l=t[9],o=t[10],s=t[11],c=t[12],h=t[13],x=t[14],m=t[15],g=b*_-d*y,k=b*u-e*y,A=b*r-w*y,v=d*u-e*_,S=d*r-w*_,T=e*r-w*u,p=n*h-l*c,M=n*x-o*c,f=n*m-s*c,E=l*x-o*h,I=l*m-s*h,B=o*m-s*x,N=g*B-k*I+A*E+v*f-S*M+T*p;return N?(N=1/N,L[0]=(_*B-u*I+r*E)*N,L[1]=(e*I-d*B-w*E)*N,L[2]=(h*T-x*S+m*v)*N,L[3]=(o*S-l*T-s*v)*N,L[4]=(u*f-y*B-r*M)*N,L[5]=(b*B-e*f+w*M)*N,L[6]=(x*A-c*T-m*k)*N,L[7]=(n*T-o*A+s*k)*N,L[8]=(y*I-_*f+r*p)*N,L[9]=(d*f-b*I-w*p)*N,L[10]=(c*S-h*A+m*g)*N,L[11]=(l*A-n*S-s*g)*N,L[12]=(_*M-y*E-u*p)*N,L[13]=(b*E-d*M+e*p)*N,L[14]=(h*k-c*v-x*g)*N,L[15]=(n*v-l*k+o*g)*N,L):null}},26645:function(D,L,t){var b=t(87193);D.exports=function(d,e,w,y){var _,u,r,n,l,o,s,c,h,x,m=e[0],g=e[1],k=e[2],A=y[0],v=y[1],S=y[2],T=w[0],p=w[1],M=w[2];return Math.abs(m-T)<1e-6&&Math.abs(g-p)<1e-6&&Math.abs(k-M)<1e-6?b(d):(s=m-T,c=g-p,h=k-M,_=v*(h*=x=1/Math.sqrt(s*s+c*c+h*h))-S*(c*=x),u=S*(s*=x)-A*h,r=A*c-v*s,(x=Math.sqrt(_*_+u*u+r*r))?(_*=x=1/x,u*=x,r*=x):(_=0,u=0,r=0),n=c*r-h*u,l=h*_-s*r,o=s*u-c*_,(x=Math.sqrt(n*n+l*l+o*o))?(n*=x=1/x,l*=x,o*=x):(n=0,l=0,o=0),d[0]=_,d[1]=n,d[2]=s,d[3]=0,d[4]=u,d[5]=l,d[6]=c,d[7]=0,d[8]=r,d[9]=o,d[10]=h,d[11]=0,d[12]=-(_*m+u*g+r*k),d[13]=-(n*m+l*g+o*k),d[14]=-(s*m+c*g+h*k),d[15]=1,d)}},14787:function(D){D.exports=function(L,t,b){var d=t[0],e=t[1],w=t[2],y=t[3],_=t[4],u=t[5],r=t[6],n=t[7],l=t[8],o=t[9],s=t[10],c=t[11],h=t[12],x=t[13],m=t[14],g=t[15],k=b[0],A=b[1],v=b[2],S=b[3];return L[0]=k*d+A*_+v*l+S*h,L[1]=k*e+A*u+v*o+S*x,L[2]=k*w+A*r+v*s+S*m,L[3]=k*y+A*n+v*c+S*g,k=b[4],A=b[5],v=b[6],S=b[7],L[4]=k*d+A*_+v*l+S*h,L[5]=k*e+A*u+v*o+S*x,L[6]=k*w+A*r+v*s+S*m,L[7]=k*y+A*n+v*c+S*g,k=b[8],A=b[9],v=b[10],S=b[11],L[8]=k*d+A*_+v*l+S*h,L[9]=k*e+A*u+v*o+S*x,L[10]=k*w+A*r+v*s+S*m,L[11]=k*y+A*n+v*c+S*g,k=b[12],A=b[13],v=b[14],S=b[15],L[12]=k*d+A*_+v*l+S*h,L[13]=k*e+A*u+v*o+S*x,L[14]=k*w+A*r+v*s+S*m,L[15]=k*y+A*n+v*c+S*g,L}},4633:function(D){D.exports=function(L,t,b,d,e,w,y){var _=1/(t-b),u=1/(d-e),r=1/(w-y);return L[0]=-2*_,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=-2*u,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=2*r,L[11]=0,L[12]=(t+b)*_,L[13]=(e+d)*u,L[14]=(y+w)*r,L[15]=1,L}},5313:function(D){D.exports=function(L,t,b,d,e){var w=1/Math.tan(t/2),y=1/(d-e);return L[0]=w/b,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=w,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=(e+d)*y,L[11]=-1,L[12]=0,L[13]=0,L[14]=2*e*d*y,L[15]=0,L}},22253:function(D){D.exports=function(L,t,b,d){var e=Math.tan(t.upDegrees*Math.PI/180),w=Math.tan(t.downDegrees*Math.PI/180),y=Math.tan(t.leftDegrees*Math.PI/180),_=Math.tan(t.rightDegrees*Math.PI/180),u=2/(y+_),r=2/(e+w);return L[0]=u,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=r,L[6]=0,L[7]=0,L[8]=-(y-_)*u*.5,L[9]=(e-w)*r*.5,L[10]=d/(b-d),L[11]=-1,L[12]=0,L[13]=0,L[14]=d*b/(b-d),L[15]=0,L}},32416:function(D){D.exports=function(L,t,b,d){var e,w,y,_,u,r,n,l,o,s,c,h,x,m,g,k,A,v,S,T,p,M,f,E,I=d[0],B=d[1],N=d[2],V=Math.sqrt(I*I+B*B+N*N);return Math.abs(V)<1e-6?null:(I*=V=1/V,B*=V,N*=V,e=Math.sin(b),y=1-(w=Math.cos(b)),_=t[0],u=t[1],r=t[2],n=t[3],l=t[4],o=t[5],s=t[6],c=t[7],h=t[8],x=t[9],m=t[10],g=t[11],k=I*I*y+w,A=B*I*y+N*e,v=N*I*y-B*e,S=I*B*y-N*e,T=B*B*y+w,p=N*B*y+I*e,M=I*N*y+B*e,f=B*N*y-I*e,E=N*N*y+w,L[0]=_*k+l*A+h*v,L[1]=u*k+o*A+x*v,L[2]=r*k+s*A+m*v,L[3]=n*k+c*A+g*v,L[4]=_*S+l*T+h*p,L[5]=u*S+o*T+x*p,L[6]=r*S+s*T+m*p,L[7]=n*S+c*T+g*p,L[8]=_*M+l*f+h*E,L[9]=u*M+o*f+x*E,L[10]=r*M+s*f+m*E,L[11]=n*M+c*f+g*E,t!==L&&(L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L)}},81066:function(D){D.exports=function(L,t,b){var d=Math.sin(b),e=Math.cos(b),w=t[4],y=t[5],_=t[6],u=t[7],r=t[8],n=t[9],l=t[10],o=t[11];return t!==L&&(L[0]=t[0],L[1]=t[1],L[2]=t[2],L[3]=t[3],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L[4]=w*e+r*d,L[5]=y*e+n*d,L[6]=_*e+l*d,L[7]=u*e+o*d,L[8]=r*e-w*d,L[9]=n*e-y*d,L[10]=l*e-_*d,L[11]=o*e-u*d,L}},54201:function(D){D.exports=function(L,t,b){var d=Math.sin(b),e=Math.cos(b),w=t[0],y=t[1],_=t[2],u=t[3],r=t[8],n=t[9],l=t[10],o=t[11];return t!==L&&(L[4]=t[4],L[5]=t[5],L[6]=t[6],L[7]=t[7],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L[0]=w*e-r*d,L[1]=y*e-n*d,L[2]=_*e-l*d,L[3]=u*e-o*d,L[8]=w*d+r*e,L[9]=y*d+n*e,L[10]=_*d+l*e,L[11]=u*d+o*e,L}},33920:function(D){D.exports=function(L,t,b){var d=Math.sin(b),e=Math.cos(b),w=t[0],y=t[1],_=t[2],u=t[3],r=t[4],n=t[5],l=t[6],o=t[7];return t!==L&&(L[8]=t[8],L[9]=t[9],L[10]=t[10],L[11]=t[11],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L[0]=w*e+r*d,L[1]=y*e+n*d,L[2]=_*e+l*d,L[3]=u*e+o*d,L[4]=r*e-w*d,L[5]=n*e-y*d,L[6]=l*e-_*d,L[7]=o*e-u*d,L}},8697:function(D){D.exports=function(L,t,b){var d=b[0],e=b[1],w=b[2];return L[0]=t[0]*d,L[1]=t[1]*d,L[2]=t[2]*d,L[3]=t[3]*d,L[4]=t[4]*e,L[5]=t[5]*e,L[6]=t[6]*e,L[7]=t[7]*e,L[8]=t[8]*w,L[9]=t[9]*w,L[10]=t[10]*w,L[11]=t[11]*w,L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15],L}},66992:function(D){D.exports=function(L){return"mat4("+L[0]+", "+L[1]+", "+L[2]+", "+L[3]+", "+L[4]+", "+L[5]+", "+L[6]+", "+L[7]+", "+L[8]+", "+L[9]+", "+L[10]+", "+L[11]+", "+L[12]+", "+L[13]+", "+L[14]+", "+L[15]+")"}},4165:function(D){D.exports=function(L,t,b){var d,e,w,y,_,u,r,n,l,o,s,c,h=b[0],x=b[1],m=b[2];return t===L?(L[12]=t[0]*h+t[4]*x+t[8]*m+t[12],L[13]=t[1]*h+t[5]*x+t[9]*m+t[13],L[14]=t[2]*h+t[6]*x+t[10]*m+t[14],L[15]=t[3]*h+t[7]*x+t[11]*m+t[15]):(d=t[0],e=t[1],w=t[2],y=t[3],_=t[4],u=t[5],r=t[6],n=t[7],l=t[8],o=t[9],s=t[10],c=t[11],L[0]=d,L[1]=e,L[2]=w,L[3]=y,L[4]=_,L[5]=u,L[6]=r,L[7]=n,L[8]=l,L[9]=o,L[10]=s,L[11]=c,L[12]=d*h+_*x+l*m+t[12],L[13]=e*h+u*x+o*m+t[13],L[14]=w*h+r*x+s*m+t[14],L[15]=y*h+n*x+c*m+t[15]),L}},10256:function(D){D.exports=function(L,t){if(L===t){var b=t[1],d=t[2],e=t[3],w=t[6],y=t[7],_=t[11];L[1]=t[4],L[2]=t[8],L[3]=t[12],L[4]=b,L[6]=t[9],L[7]=t[13],L[8]=d,L[9]=w,L[11]=t[14],L[12]=e,L[13]=y,L[14]=_}else L[0]=t[0],L[1]=t[4],L[2]=t[8],L[3]=t[12],L[4]=t[1],L[5]=t[5],L[6]=t[9],L[7]=t[13],L[8]=t[2],L[9]=t[6],L[10]=t[10],L[11]=t[14],L[12]=t[3],L[13]=t[7],L[14]=t[11],L[15]=t[15];return L}},74024:function(D,L,t){var b=t(59518),d=t(6807),e=t(81330),w=t(38862),y=t(93103),_=t(162),u=t(68950),r=t(66127),n=t(5137),l=t(29388),o=t(4957),s=t(44626),c=t(44431),h=t(27976),x=t(12673),m=t(83473),g=t(54689).nextPow2,k=new y,A=!1;if(document.body){var v=document.body.appendChild(document.createElement("div"));v.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(v).fontStretch&&(A=!0),document.body.removeChild(v)}var S=function(T){(function(p){return typeof p=="function"&&p._gl&&p.prop&&p.texture&&p.buffer})(T)?(T={regl:T},this.gl=T.regl._gl):this.gl=w(T),this.shader=k.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=T.regl||e({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(),k.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(l(T)?T:{})};S.prototype.createShader=function(){var T=this.regl,p=T({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:T.prop("count"),offset:T.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:T.this("sizeBuffer")},width:{offset:0,stride:8,buffer:T.this("sizeBuffer")},char:T.this("charBuffer"),position:T.this("position")},uniforms:{atlasSize:function(M,f){return[f.atlas.width,f.atlas.height]},atlasDim:function(M,f){return[f.atlas.cols,f.atlas.rows]},atlas:function(M,f){return f.atlas.texture},charStep:function(M,f){return f.atlas.step},em:function(M,f){return f.atlas.em},color:T.prop("color"),opacity:T.prop("opacity"),viewport:T.this("viewportArray"),scale:T.this("scale"),align:T.prop("align"),baseline:T.prop("baseline"),translate:T.this("translate"),positionOffset:T.prop("positionOffset")},primitive:"points",viewport:T.this("viewport"),vert:` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function d(le,ge){(ge==null||ge>le.length)&&(ge=le.length);for(var ye=0,me=new Array(ge);ye10)return!0;for(var ge=0;ge57)return!0}return le.length===10&&le>=Math.pow(2,32)}function j(le){return Object.keys(le).filter(V).concat(r(le).filter(Object.prototype.propertyIsEnumerable.bind(le)))}function $(le,ge){if(le===ge)return 0;for(var ye=le.length,me=ge.length,be=0,Se=Math.min(ye,me);be"u"?[]:new Uint8Array(256),e=0;e<64;e++)d[b.charCodeAt(e)]=e;var w=function(_){var u,r=new Uint8Array(_),n=r.length,l="";for(u=0;u>2],l+=b[(3&r[u])<<4|r[u+1]>>4],l+=b[(15&r[u+1])<<2|r[u+2]>>6],l+=b[63&r[u+2]];return n%3==2?l=l.substring(0,l.length-1)+"=":n%3==1&&(l=l.substring(0,l.length-2)+"=="),l},y=function(_){var u,r,n,l,o,s=.75*_.length,c=_.length,h=0;_[_.length-1]==="="&&(s--,_[_.length-2]==="="&&s--);var x=new ArrayBuffer(s),m=new Uint8Array(x);for(u=0;u>4,m[h++]=(15&n)<<4|l>>2,m[h++]=(3&l)<<6|63&o;return x}},76226:function(D,L){L.byteLength=function(u){var r=y(u),n=r[0],l=r[1];return 3*(n+l)/4-l},L.toByteArray=function(u){var r,n,l=y(u),o=l[0],s=l[1],c=new d(function(m,g,k){return 3*(g+k)/4-k}(0,o,s)),h=0,x=s>0?o-4:o;for(n=0;n>16&255,c[h++]=r>>8&255,c[h++]=255&r;return s===2&&(r=b[u.charCodeAt(n)]<<2|b[u.charCodeAt(n+1)]>>4,c[h++]=255&r),s===1&&(r=b[u.charCodeAt(n)]<<10|b[u.charCodeAt(n+1)]<<4|b[u.charCodeAt(n+2)]>>2,c[h++]=r>>8&255,c[h++]=255&r),c},L.fromByteArray=function(u){for(var r,n=u.length,l=n%3,o=[],s=16383,c=0,h=n-l;ch?h:c+s));return l===1?(r=u[n-1],o.push(t[r>>2]+t[r<<4&63]+"==")):l===2&&(r=(u[n-2]<<8)+u[n-1],o.push(t[r>>10]+t[r>>4&63]+t[r<<2&63]+"=")),o.join("")};for(var t=[],b=[],d=typeof Uint8Array<"u"?Uint8Array:Array,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)t[w]=e[w],b[e.charCodeAt(w)]=w;function y(u){var r=u.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=u.indexOf("=");return n===-1&&(n=r),[n,n===r?0:4-n%4]}function _(u,r,n){for(var l,o,s=[],c=r;c>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return s.join("")}b["-".charCodeAt(0)]=62,b["_".charCodeAt(0)]=63},31625:function(D){function L(y,_,u,r,n){for(var l=n+1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)>=0?(l=o,n=o-1):r=o+1}return l}function t(y,_,u,r,n){for(var l=n+1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)>0?(l=o,n=o-1):r=o+1}return l}function b(y,_,u,r,n){for(var l=r-1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)<0?(l=o,r=o+1):n=o-1}return l}function d(y,_,u,r,n){for(var l=r-1;r<=n;){var o=r+n>>>1,s=y[o];(u!==void 0?u(s,_):s-_)<=0?(l=o,r=o+1):n=o-1}return l}function e(y,_,u,r,n){for(;r<=n;){var l=r+n>>>1,o=y[l],s=u!==void 0?u(o,_):o-_;if(s===0)return l;s<=0?r=l+1:n=l-1}return-1}function w(y,_,u,r,n,l){return typeof u=="function"?l(y,_,u,r===void 0?0:0|r,n===void 0?y.length-1:0|n):l(y,_,void 0,u===void 0?0:0|u,r===void 0?y.length-1:0|r)}D.exports={ge:function(y,_,u,r,n){return w(y,_,u,r,n,L)},gt:function(y,_,u,r,n){return w(y,_,u,r,n,t)},lt:function(y,_,u,r,n){return w(y,_,u,r,n,b)},le:function(y,_,u,r,n){return w(y,_,u,r,n,d)},eq:function(y,_,u,r,n){return w(y,_,u,r,n,e)}}},54689:function(D,L){function t(d){var e=32;return(d&=-d)&&e--,65535&d&&(e-=16),16711935&d&&(e-=8),252645135&d&&(e-=4),858993459&d&&(e-=2),1431655765&d&&(e-=1),e}L.INT_BITS=32,L.INT_MAX=2147483647,L.INT_MIN=-2147483648,L.sign=function(d){return(d>0)-(d<0)},L.abs=function(d){var e=d>>31;return(d^e)-e},L.min=function(d,e){return e^(d^e)&-(d65535)<<4,e|=w=((d>>>=e)>255)<<3,e|=w=((d>>>=w)>15)<<2,(e|=w=((d>>>=w)>3)<<1)|(d>>>=w)>>1},L.log10=function(d){return d>=1e9?9:d>=1e8?8:d>=1e7?7:d>=1e6?6:d>=1e5?5:d>=1e4?4:d>=1e3?3:d>=100?2:d>=10?1:0},L.popCount=function(d){return 16843009*((d=(858993459&(d-=d>>>1&1431655765))+(d>>>2&858993459))+(d>>>4)&252645135)>>>24},L.countTrailingZeros=t,L.nextPow2=function(d){return d+=d===0,--d,d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,1+(d|=d>>>16)},L.prevPow2=function(d){return d|=d>>>1,d|=d>>>2,d|=d>>>4,d|=d>>>8,(d|=d>>>16)-(d>>>1)},L.parity=function(d){return d^=d>>>16,d^=d>>>8,d^=d>>>4,27030>>>(d&=15)&1};var b=new Array(256);(function(d){for(var e=0;e<256;++e){var w=e,y=e,_=7;for(w>>>=1;w;w>>>=1)y<<=1,y|=1&w,--_;d[e]=y<<_&255}})(b),L.reverse=function(d){return b[255&d]<<24|b[d>>>8&255]<<16|b[d>>>16&255]<<8|b[d>>>24&255]},L.interleave2=function(d,e){return(d=1431655765&((d=858993459&((d=252645135&((d=16711935&((d&=65535)|d<<8))|d<<4))|d<<2))|d<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},L.deinterleave2=function(d,e){return(d=65535&((d=16711935&((d=252645135&((d=858993459&((d=d>>>e&1431655765)|d>>>1))|d>>>2))|d>>>4))|d>>>16))<<16>>16},L.interleave3=function(d,e,w){return d=1227133513&((d=3272356035&((d=251719695&((d=4278190335&((d&=1023)|d<<16))|d<<8))|d<<4))|d<<2),(d|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(w=1227133513&((w=3272356035&((w=251719695&((w=4278190335&((w&=1023)|w<<16))|w<<8))|w<<4))|w<<2))<<2},L.deinterleave3=function(d,e){return(d=1023&((d=4278190335&((d=251719695&((d=3272356035&((d=d>>>e&1227133513)|d>>>2))|d>>>4))|d>>>8))|d>>>16))<<22>>22},L.nextCombination=function(d){var e=d|d-1;return e+1|(~e&-~e)-1>>>t(d)+1}},88772:function(D,L,t){var b=t(75144);D.exports=function(y,_){_||(_={});var u,r,n,l,o,s,c,h,x,m,g,k=_.cutoff==null?.25:_.cutoff,A=_.radius==null?8:_.radius,v=_.channel||0;if(ArrayBuffer.isView(y)||Array.isArray(y)){if(!_.width||!_.height)throw Error("For raw data width and height should be provided by options");u=_.width,r=_.height,l=y,s=_.stride?_.stride:Math.floor(y.length/u/r)}else window.HTMLCanvasElement&&y instanceof window.HTMLCanvasElement?(c=(h=y).getContext("2d"),u=h.width,r=h.height,l=(x=c.getImageData(0,0,u,r)).data,s=4):window.CanvasRenderingContext2D&&y instanceof window.CanvasRenderingContext2D?(c=y,u=(h=y.canvas).width,r=h.height,l=(x=c.getImageData(0,0,u,r)).data,s=4):window.ImageData&&y instanceof window.ImageData&&(x=y,u=y.width,r=y.height,l=x.data,s=4);if(n=Math.max(u,r),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(o=l,l=Array(u*r),m=0,g=o.length;m-1?d(_):_}},87227:function(D,L,t){var b=t(87547),d=t(71129),e=t(73285),w=t(48631),y=d("%Function.prototype.apply%"),_=d("%Function.prototype.call%"),u=d("%Reflect.apply%",!0)||b.call(_,y),r=t(40891),n=d("%Math.max%");D.exports=function(o){if(typeof o!="function")throw new w("a function is required");var s=u(b,_,arguments);return e(s,1+n(0,o.length-(arguments.length-1)),!0)};var l=function(){return u(b,y,arguments)};r?r(D.exports,"apply",{value:l}):D.exports.apply=l},75144:function(D){D.exports=function(L,t,b){return tb?b:L:Lt?t:L}},46762:function(D,L,t){var b=t(75144);function d(e,w){w==null&&(w=!0);var y=e[0],_=e[1],u=e[2],r=e[3];return r==null&&(r=w?1:255),w&&(y*=255,_*=255,u*=255,r*=255),16777216*(y=255&b(y,0,255))+((_=255&b(_,0,255))<<16)+((u=255&b(u,0,255))<<8)+(255&b(r,0,255))}D.exports=d,D.exports.to=d,D.exports.from=function(e,w){var y=(e=+e)>>>24,_=(16711680&e)>>>16,u=(65280&e)>>>8,r=255&e;return w===!1?[y,_,u,r]:[y/255,_/255,u/255,r/255]}},86040:function(D){D.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]}},162:function(D,L,t){var b=t(16401),d=t(75144),e=t(10275);D.exports=function(w,y){y!=="float"&&y||(y="array"),y==="uint"&&(y="uint8"),y==="uint_clamped"&&(y="uint8_clamped");var _=new(e(y))(4),u=y!=="uint8"&&y!=="uint8_clamped";return w.length&&typeof w!="string"||((w=b(w))[0]/=255,w[1]/=255,w[2]/=255),function(r){return r instanceof Uint8Array||r instanceof Uint8ClampedArray||!!(Array.isArray(r)&&(r[0]>1||r[0]===0)&&(r[1]>1||r[1]===0)&&(r[2]>1||r[2]===0)&&(!r[3]||r[3]>1))}(w)?(_[0]=w[0],_[1]=w[1],_[2]=w[2],_[3]=w[3]!=null?w[3]:255,u&&(_[0]/=255,_[1]/=255,_[2]/=255,_[3]/=255),_):(u?(_[0]=w[0],_[1]=w[1],_[2]=w[2],_[3]=w[3]!=null?w[3]:1):(_[0]=d(Math.floor(255*w[0]),0,255),_[1]=d(Math.floor(255*w[1]),0,255),_[2]=d(Math.floor(255*w[2]),0,255),_[3]=w[3]==null?255:d(Math.floor(255*w[3]),0,255)),_)}},16401:function(D,L,t){var b=t(10826),d=t(52132),e=t(75144);D.exports=function(w){var y,_=b(w);return _.space?((y=Array(3))[0]=e(_.values[0],0,255),y[1]=e(_.values[1],0,255),y[2]=e(_.values[2],0,255),_.space[0]==="h"&&(y=d.rgb(y)),y.push(e(_.alpha,0,1)),y):[]}},10826:function(D,L,t){var b=t(86040);D.exports=function(e){var w,y,_=[],u=1;if(typeof e=="string")if(e=e.toLowerCase(),b[e])_=b[e].slice(),y="rgb";else if(e==="transparent")u=0,y="rgb",_=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var r=e.slice(1);u=1,(o=r.length)<=4?(_=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(u=parseInt(r[3]+r[3],16)/255)):(_=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(u=parseInt(r[6]+r[7],16)/255)),_[0]||(_[0]=0),_[1]||(_[1]=0),_[2]||(_[2]=0),y="rgb"}else if(w=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var n=w[1],l=n==="rgb";y=r=n.replace(/a$/,"");var o=r==="cmyk"?4:r==="gray"?1:3;_=w[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(s,c){if(/%$/.test(s))return c===o?parseFloat(s)/100:r==="rgb"?255*parseFloat(s)/100:parseFloat(s);if(r[c]==="h"){if(/deg$/.test(s))return parseFloat(s);if(d[s]!==void 0)return d[s]}return parseFloat(s)}),n===r&&_.push(1),u=l||_[o]===void 0?1:_[o],_=_.slice(0,o)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(_=e.match(/([0-9]+)/g).map(function(s){return parseFloat(s)}),y=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(_=[e[0],e[1],e[2]],y="rgb",u=e.length===4?e[3]:1):e instanceof Object&&(e.r!=null||e.red!=null||e.R!=null?(y="rgb",_=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(y="hsl",_=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),u=e.a||e.alpha||e.opacity||1,e.opacity!=null&&(u/=100)):(y="rgb",_=[e>>>16,(65280&e)>>>8,255&e]);return{space:y,values:_,alpha:u}};var d={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}},52132:function(D,L,t){var b=t(10520);D.exports={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(d){var e,w,y,_,u,r=d[0]/360,n=d[1]/100,l=d[2]/100;if(n===0)return[u=255*l,u,u];e=2*l-(w=l<.5?l*(1+n):l+n-l*n),_=[0,0,0];for(var o=0;o<3;o++)(y=r+.3333333333333333*-(o-1))<0?y++:y>1&&y--,u=6*y<1?e+6*(w-e)*y:2*y<1?w:3*y<2?e+(w-e)*(.6666666666666666-y)*6:e,_[o]=255*u;return _}},b.hsl=function(d){var e,w,y=d[0]/255,_=d[1]/255,u=d[2]/255,r=Math.min(y,_,u),n=Math.max(y,_,u),l=n-r;return n===r?e=0:y===n?e=(_-u)/l:_===n?e=2+(u-y)/l:u===n&&(e=4+(y-_)/l),(e=Math.min(60*e,360))<0&&(e+=360),w=(r+n)/2,[e,100*(n===r?0:w<=.5?l/(n+r):l/(2-n-r)),100*w]}},10520:function(D){D.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},78171:function(D){D.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|ç)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|é)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|é)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|ã)o.?tom(e|é)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},59518:function(D,L,t){D.exports={parse:t(86029),stringify:t(38211)}},87724:function(D,L,t){var b=t(23648);D.exports={isSize:function(d){return/^[\d\.]/.test(d)||d.indexOf("/")!==-1||b.indexOf(d)!==-1}}},86029:function(D,L,t){var b=t(80886),d=t(54324),e=t(94316),w=t(99803),y=t(87486),_=t(2362),u=t(28089),r=t(87724).isSize;D.exports=l;var n=l.cache={};function l(s){if(typeof s!="string")throw new Error("Font argument must be a string.");if(n[s])return n[s];if(s==="")throw new Error("Cannot parse an empty string.");if(e.indexOf(s)!==-1)return n[s]={system:s};for(var c,h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},x=u(s,/\s+/);c=x.shift();){if(d.indexOf(c)!==-1)return["style","variant","weight","stretch"].forEach(function(g){h[g]=c}),n[s]=h;if(y.indexOf(c)===-1)if(c!=="normal"&&c!=="small-caps")if(_.indexOf(c)===-1){if(w.indexOf(c)===-1){if(r(c)){var m=u(c,"/");if(h.size=m[0],m[1]!=null?h.lineHeight=o(m[1]):x[0]==="/"&&(x.shift(),h.lineHeight=o(x.shift())),!x.length)throw new Error("Missing required font-family.");return h.family=u(x.join(" "),/\s*,\s*/).map(b),n[s]=h}throw new Error("Unknown or unsupported font token: "+c)}h.weight=c}else h.stretch=c;else h.variant=c;else h.style=c}throw new Error("Missing required font-size.")}function o(s){var c=parseFloat(s);return c.toString()===s?c:s}},38211:function(D,L,t){var b=t(6807),d=t(87724).isSize,e=s(t(54324)),w=s(t(94316)),y=s(t(99803)),_=s(t(87486)),u=s(t(2362)),r={normal:1,"small-caps":1},n={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},l="serif";function o(c,h){if(c&&!h[c]&&!e[c])throw Error("Unknown keyword `"+c+"`");return c}function s(c){for(var h={},x=0;x0?" ".concat(b[5]):""," {")),d+=L(b),e&&(d+="}"),b[2]&&(d+="}"),b[4]&&(d+="}"),d}).join("")},t.i=function(b,d,e,w,y){typeof b=="string"&&(b=[[null,b,void 0]]);var _={};if(e)for(var u=0;u0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=y),d&&(l[2]&&(l[1]="@media ".concat(l[2]," {").concat(l[1],"}")),l[2]=d),w&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=w):l[4]="".concat(w)),t.push(l))}},t}},62133:function(D){D.exports=function(L,t){return t||(t={}),L&&(L=String(L.__esModule?L.default:L),/^['"].*['"]$/.test(L)&&(L=L.slice(1,-1)),t.hash&&(L+=t.hash),/["'() \t\n]|(%20)/.test(L)||t.needQuotes?'"'.concat(L.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):L)}},22413:function(D){D.exports=function(L){return L[1]}},84510:function(D,L,t){var b,d=t(80299),e=t(9557),w=t(6887),y=t(86591),_=t(76504),u=t(29854),r=Function.prototype.bind,n=Object.defineProperty,l=Object.prototype.hasOwnProperty;b=function(o,s,c){var h,x=e(s)&&w(s.value);return delete(h=y(s)).writable,delete h.value,h.get=function(){return!c.overwriteDefinition&&l.call(this,o)?x:(s.value=r.call(x,c.resolveContext?c.resolveContext(this):this),n(this,o,s),this[o])},h},D.exports=function(o){var s=_(arguments[1]);return d(s.resolveContext)&&w(s.resolveContext),u(o,function(c,h){return b(h,c,s)})}},91819:function(D,L,t){var b=t(80299),d=t(63461),e=t(1920),w=t(76504),y=t(2338),_=D.exports=function(u,r){var n,l,o,s,c;return arguments.length<2||typeof u!="string"?(s=r,r=u,u=null):s=arguments[2],b(u)?(n=y.call(u,"c"),l=y.call(u,"e"),o=y.call(u,"w")):(n=o=!0,l=!1),c={value:r,configurable:n,enumerable:l,writable:o},s?e(w(s),c):c};_.gs=function(u,r,n){var l,o,s,c;return typeof u!="string"?(s=n,n=r,r=u,u=null):s=arguments[3],b(r)?d(r)?b(n)?d(n)||(s=n,n=void 0):n=void 0:(s=r,r=n=void 0):r=void 0,b(u)?(l=y.call(u,"c"),o=y.call(u,"e")):(l=!0,o=!1),c={get:r,set:n,configurable:l,enumerable:o},s?e(w(s),c):c}},29725:function(D,L,t){function b(o,s){return os?1:o>=s?0:NaN}t.d(L,{V_:function(){return b},T9:function(){return w},i2:function(){return _},Am:function(){return u},jk:function(){return r},y1:function(){return n},cz:function(){return l}}),(d=b).length===1&&(e=d,d=function(o,s){return b(e(o),s)});var d,e;function w(o,s){var c,h,x=o.length,m=-1;if(s==null){for(;++m=c)for(h=c;++mh&&(h=c)}else for(;++m=c)for(h=c;++mh&&(h=c);return h}function y(o){return o===null?NaN:+o}function _(o,s){var c,h=o.length,x=h,m=-1,g=0;if(s==null)for(;++m=0;)for(s=(h=o[x]).length;--s>=0;)c[--g]=h[s];return c}function r(o,s){var c,h,x=o.length,m=-1;if(s==null){for(;++m=c)for(h=c;++mc&&(h=c)}else for(;++m=c)for(h=c;++mc&&(h=c);return h}function n(o,s,c){o=+o,s=+s,c=(x=arguments.length)<2?(s=o,o=0,1):x<3?1:+c;for(var h=-1,x=0|Math.max(0,Math.ceil((s-o)/c)),m=new Array(x);++h=x.length)return s!=null&&A.sort(s),c!=null?c(A):A;for(var p,M,f,E=-1,I=A.length,B=x[v++],N=w(),V=S();++Ex.length)return A;var S,T=m[v-1];return c!=null&&v>=x.length?S=A.entries():(S=[],A.each(function(p,M){S.push({key:M,values:k(p,v)})})),T!=null?S.sort(function(p,M){return T(p.key,M.key)}):S}return h={object:function(A){return g(A,0,_,u)},map:function(A){return g(A,0,r,n)},entries:function(A){return k(g(A,0,r,n),0)},key:function(A){return x.push(A),h},sortKeys:function(A){return m[x.length-1]=A,h},sortValues:function(A){return s=A,h},rollup:function(A){return c=A,h}}}function _(){return{}}function u(s,c,h){s[c]=h}function r(){return w()}function n(s,c,h){s.set(c,h)}function l(){}var o=w.prototype;l.prototype={constructor:l,has:o.has,add:function(s){return this[b+(s+="")]=s,this},remove:o.remove,clear:o.clear,values:o.keys,size:o.size,empty:o.empty,each:o.each}},32702:function(D,L,t){function b(Ce,Le){var Oe;function We(){var Ie,Ve,Pe=Oe.length,de=0,Me=0;for(Ie=0;Ie=(Ve=(_e+Be)/2))?_e=Ve:Be=Ve,(He=Oe>=(Pe=(De+Ge)/2))?De=Pe:Ge=Pe,Ie=$e,!($e=$e[Fe=He<<1|ke]))return Ie[Fe]=Ye,Ce;if(de=+Ce._x.call(null,$e.data),Me=+Ce._y.call(null,$e.data),Le===de&&Oe===Me)return Ye.next=$e,Ie?Ie[Fe]=Ye:Ce._root=Ye,Ce;do Ie=Ie?Ie[Fe]=new Array(4):Ce._root=new Array(4),(ke=Le>=(Ve=(_e+Be)/2))?_e=Ve:Be=Ve,(He=Oe>=(Pe=(De+Ge)/2))?De=Pe:Ge=Pe;while((Fe=He<<1|ke)==(qe=(Me>=Pe)<<1|de>=Ve));return Ie[qe]=$e,Ie[Fe]=Ye,Ce}function y(Ce,Le,Oe,We,Ie){this.node=Ce,this.x0=Le,this.y0=Oe,this.x1=We,this.y1=Ie}function _(Ce){return Ce[0]}function u(Ce){return Ce[1]}function r(Ce,Le,Oe){var We=new n(Le??_,Oe??u,NaN,NaN,NaN,NaN);return Ce==null?We:We.addAll(Ce)}function n(Ce,Le,Oe,We,Ie,Ve){this._x=Ce,this._y=Le,this._x0=Oe,this._y0=We,this._x1=Ie,this._y1=Ve,this._root=void 0}function l(Ce){for(var Le={data:Ce.data},Oe=Le;Ce=Ce.next;)Oe=Oe.next={data:Ce.data};return Le}t.r(L),t.d(L,{forceCenter:function(){return b},forceCollide:function(){return h},forceLink:function(){return k},forceManyBody:function(){return me},forceRadial:function(){return be},forceSimulation:function(){return ye},forceX:function(){return Se},forceY:function(){return Ee}});var o=r.prototype=n.prototype;function s(Ce){return Ce.x+Ce.vx}function c(Ce){return Ce.y+Ce.vy}function h(Ce){var Le,Oe,We=1,Ie=1;function Ve(){for(var Me,ke,He,Fe,qe,$e,Ye,_e=Le.length,De=0;DeFe+Ht||ftqe+Ht||AtHe.index){var Gt=Fe-kt.x-kt.vx,st=qe-kt.y-kt.vy,Qe=Gt*Gt+st*st;QeMe.r&&(Me.r=Me[ke].r)}function de(){if(Le){var Me,ke,He=Le.length;for(Oe=new Array(He),Me=0;MeHe&&(He=We),IeFe&&(Fe=Ie));if(Me>He||ke>Fe)return this;for(this.cover(Me,ke).cover(He,Fe),Oe=0;OeCe||Ce>=Ie||We>Le||Le>=Ve;)switch(de=(Leqe||(Ve=Me.y0)>$e||(Pe=Me.x1)=Be)<<1|Ce>=De)&&(Me=Ye[Ye.length-1],Ye[Ye.length-1]=Ye[Ye.length-1-ke],Ye[Ye.length-1-ke]=Me)}else{var Ge=Ce-+this._x.call(null,_e.data),tt=Le-+this._y.call(null,_e.data),nt=Ge*Ge+tt*tt;if(nt=(de=(Ye+De)/2))?Ye=de:De=de,(He=Pe>=(Me=(_e+Be)/2))?_e=Me:Be=Me,Le=$e,!($e=$e[Fe=He<<1|ke]))return this;if(!$e.length)break;(Le[Fe+1&3]||Le[Fe+2&3]||Le[Fe+3&3])&&(Oe=Le,qe=Fe)}for(;$e.data!==Ce;)if(We=$e,!($e=$e.next))return this;return(Ie=$e.next)&&delete $e.next,We?(Ie?We.next=Ie:delete We.next,this):Le?(Ie?Le[Fe]=Ie:delete Le[Fe],($e=Le[0]||Le[1]||Le[2]||Le[3])&&$e===(Le[3]||Le[2]||Le[1]||Le[0])&&!$e.length&&(Oe?Oe[qe]=$e:this._root=$e),this):(this._root=Ie,this)},o.removeAll=function(Ce){for(var Le=0,Oe=Ce.length;Le=0&&(ke=Me.slice(He+1),Me=Me.slice(0,He)),Me&&!We.hasOwnProperty(Me))throw new Error("unknown type: "+Me);return{type:Me,name:ke}})),Pe=-1,de=Ve.length;if(!(arguments.length<2)){if(Le!=null&&typeof Le!="function")throw new Error("invalid callback: "+Le);for(;++Pe0)for(var Oe,We,Ie=new Array(Oe),Ve=0;Ve=0&&Le._call.call(null,Ce),Le=Le._next;--I})()}finally{I=0,function(){for(var Ce,Le,Oe=M,We=1/0;Oe;)Oe._call?(We>Oe._time&&(We=Oe._time),Ce=Oe,Oe=Oe._next):(Le=Oe._next,Oe._next=null,Oe=Ce?Ce._next=Le:M=Le);f=Ce,fe(We)}(),$=0}}function he(){var Ce=H.now(),Le=Ce-j;Le>V&&(ee-=Le,j=Ce)}function fe(Ce){I||(B&&(B=clearTimeout(B)),Ce-$>24?(Ce<1/0&&(B=setTimeout(se,Ce-H.now()-ee)),N&&(N=clearInterval(N))):(N||(j=H.now(),N=setInterval(he,V)),I=1,J(se)))}function ie(Ce){return Ce.x}function oe(Ce){return Ce.y}K.prototype=ae.prototype={constructor:K,restart:function(Ce,Le,Oe){if(typeof Ce!="function")throw new TypeError("callback is not a function");Oe=(Oe==null?Q():+Oe)+(Le==null?0:+Le),this._next||f===this||(f?f._next=this:M=this,f=this),this._call=Ce,this._time=Oe,fe()},stop:function(){this._call&&(this._call=null,this._time=1/0,fe())}};var le=10,ge=Math.PI*(3-Math.sqrt(5));function ye(Ce){var Le,Oe=1,We=.001,Ie=1-Math.pow(We,1/300),Ve=0,Pe=.6,de=(0,x.Tj)(),Me=ae(He),ke=E("tick","end");function He(){Fe(),ke.call("tick",Le),Oe1?(_e==null?de.remove(Ye):de.set(Ye,$e(_e)),Le):de.get(Ye)},find:function(Ye,_e,De){var Be,Ge,tt,nt,ft,At=0,kt=Ce.length;for(De==null?De=1/0:De*=De,At=0;At1?(ke.on(Ye,_e),Le):ke.on(Ye)}}}function me(){var Ce,Le,Oe,We,Ie=d(-30),Ve=1,Pe=1/0,de=.81;function Me(qe){var $e,Ye=Ce.length,_e=r(Ce,ie,oe).visitAfter(He);for(Oe=qe,$e=0;$e=Pe)){(qe.data!==Le||qe.next)&&(De===0&&(tt+=(De=e())*De),Be===0&&(tt+=(Be=e())*Be),tt1?g[0]+g.slice(2):g,+h.slice(m+1)]}t.d(L,{GP:function(){return l},OE:function(){return c}});var d,e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function w(h){if(!(x=e.exec(h)))throw new Error("invalid format: "+h);var x;return new y({fill:x[1],align:x[2],sign:x[3],symbol:x[4],zero:x[5],width:x[6],comma:x[7],precision:x[8]&&x[8].slice(1),trim:x[9],type:x[10]})}function y(h){this.fill=h.fill===void 0?" ":h.fill+"",this.align=h.align===void 0?">":h.align+"",this.sign=h.sign===void 0?"-":h.sign+"",this.symbol=h.symbol===void 0?"":h.symbol+"",this.zero=!!h.zero,this.width=h.width===void 0?void 0:+h.width,this.comma=!!h.comma,this.precision=h.precision===void 0?void 0:+h.precision,this.trim=!!h.trim,this.type=h.type===void 0?"":h.type+""}function _(h,x){var m=b(h,x);if(!m)return h+"";var g=m[0],k=m[1];return k<0?"0."+new Array(-k).join("0")+g:g.length>k+1?g.slice(0,k+1)+"."+g.slice(k+1):g+new Array(k-g.length+2).join("0")}w.prototype=y.prototype,y.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,0|this.width))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var u={"%":function(h,x){return(100*h).toFixed(x)},b:function(h){return Math.round(h).toString(2)},c:function(h){return h+""},d:function(h){return Math.abs(h=Math.round(h))>=1e21?h.toLocaleString("en").replace(/,/g,""):h.toString(10)},e:function(h,x){return h.toExponential(x)},f:function(h,x){return h.toFixed(x)},g:function(h,x){return h.toPrecision(x)},o:function(h){return Math.round(h).toString(8)},p:function(h,x){return _(100*h,x)},r:_,s:function(h,x){var m=b(h,x);if(!m)return h+"";var g=m[0],k=m[1],A=k-(d=3*Math.max(-8,Math.min(8,Math.floor(k/3))))+1,v=g.length;return A===v?g:A>v?g+new Array(A-v+1).join("0"):A>0?g.slice(0,A)+"."+g.slice(A):"0."+new Array(1-A).join("0")+b(h,Math.max(0,x+A-1))[0]},X:function(h){return Math.round(h).toString(16).toUpperCase()},x:function(h){return Math.round(h).toString(16)}};function r(h){return h}var n,l,o=Array.prototype.map,s=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function c(h){var x,m,g=h.grouping===void 0||h.thousands===void 0?r:(x=o.call(h.grouping,Number),m=h.thousands+"",function(E,I){for(var B=E.length,N=[],V=0,j=x[0],$=0;B>0&&j>0&&($+j+1>I&&(j=Math.max(1,I-$)),N.push(E.substring(B-=j,B+j)),!(($+=j+1)>I));)j=x[V=(V+1)%x.length];return N.reverse().join(m)}),k=h.currency===void 0?"":h.currency[0]+"",A=h.currency===void 0?"":h.currency[1]+"",v=h.decimal===void 0?".":h.decimal+"",S=h.numerals===void 0?r:function(E){return function(I){return I.replace(/[0-9]/g,function(B){return E[+B]})}}(o.call(h.numerals,String)),T=h.percent===void 0?"%":h.percent+"",p=h.minus===void 0?"-":h.minus+"",M=h.nan===void 0?"NaN":h.nan+"";function f(E){var I=(E=w(E)).fill,B=E.align,N=E.sign,V=E.symbol,j=E.zero,$=E.width,ee=E.comma,H=E.precision,J=E.trim,Q=E.type;Q==="n"?(ee=!0,Q="g"):u[Q]||(H===void 0&&(H=12),J=!0,Q="g"),(j||I==="0"&&B==="=")&&(j=!0,I="0",B="=");var Z=V==="$"?k:V==="#"&&/[boxX]/.test(Q)?"0"+Q.toLowerCase():"",K=V==="$"?A:/[%p]/.test(Q)?T:"",ae=u[Q],se=/[defgprs%]/.test(Q);function he(fe){var ie,oe,le,ge=Z,ye=K;if(Q==="c")ye=ae(fe)+ye,fe="";else{var me=(fe=+fe)<0||1/fe<0;if(fe=isNaN(fe)?M:ae(Math.abs(fe),H),J&&(fe=function(Ee){e:for(var Ce,Le=Ee.length,Oe=1,We=-1;Oe0&&(We=0)}return We>0?Ee.slice(0,We)+Ee.slice(Ce+1):Ee}(fe)),me&&+fe==0&&N!=="+"&&(me=!1),ge=(me?N==="("?N:p:N==="-"||N==="("?"":N)+ge,ye=(Q==="s"?s[8+d/3]:"")+ye+(me&&N==="("?")":""),se){for(ie=-1,oe=fe.length;++ie(le=fe.charCodeAt(ie))||le>57){ye=(le===46?v+fe.slice(ie+1):fe.slice(ie))+ye,fe=fe.slice(0,ie);break}}}ee&&!j&&(fe=g(fe,1/0));var be=ge.length+fe.length+ye.length,Se=be<$?new Array($-be+1).join(I):"";switch(ee&&j&&(fe=g(Se+fe,Se.length?$-ye.length:1/0),Se=""),B){case"<":fe=ge+fe+ye+Se;break;case"=":fe=ge+Se+fe+ye;break;case"^":fe=Se.slice(0,be=Se.length>>1)+ge+fe+ye+Se.slice(be);break;default:fe=Se+ge+fe+ye}return S(fe)}return H=H===void 0?6:/[gprs]/.test(Q)?Math.max(1,Math.min(21,H)):Math.max(0,Math.min(20,H)),he.toString=function(){return E+""},he}return{format:f,formatPrefix:function(E,I){var B,N=f(((E=w(E)).type="f",E)),V=3*Math.max(-8,Math.min(8,Math.floor((B=I,((B=b(Math.abs(B)))?B[1]:NaN)/3)))),j=Math.pow(10,-V),$=s[8+V/3];return function(ee){return N(j*ee)+$}}}}n=c({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),l=n.format,n.formatPrefix},75987:function(D,L,t){t.r(L),t.d(L,{geoAiry:function(){return ee},geoAiryRaw:function(){return $},geoAitoff:function(){return J},geoAitoffRaw:function(){return H},geoArmadillo:function(){return Z},geoArmadilloRaw:function(){return Q},geoAugust:function(){return ae},geoAugustRaw:function(){return K},geoBaker:function(){return ie},geoBakerRaw:function(){return fe},geoBerghaus:function(){return ge},geoBerghausRaw:function(){return le},geoBertin1953:function(){return Oe},geoBertin1953Raw:function(){return Le},geoBoggs:function(){return He},geoBoggsRaw:function(){return ke},geoBonne:function(){return _e},geoBonneRaw:function(){return Ye},geoBottomley:function(){return Be},geoBottomleyRaw:function(){return De},geoBromley:function(){return tt},geoBromleyRaw:function(){return Ge},geoChamberlin:function(){return Qe},geoChamberlinAfrica:function(){return st},geoChamberlinRaw:function(){return Ht},geoCollignon:function(){return yt},geoCollignonRaw:function(){return pt},geoCraig:function(){return Pt},geoCraigRaw:function(){return Ot},geoCraster:function(){return Xe},geoCrasterRaw:function(){return lt},geoCylindricalEqualArea:function(){return wt},geoCylindricalEqualAreaRaw:function(){return ut},geoCylindricalStereographic:function(){return Lt},geoCylindricalStereographicRaw:function(){return vt},geoEckert1:function(){return rt},geoEckert1Raw:function(){return jt},geoEckert2:function(){return Et},geoEckert2Raw:function(){return et},geoEckert3:function(){return Ft},geoEckert3Raw:function(){return Bt},geoEckert4:function(){return Jt},geoEckert4Raw:function(){return St},geoEckert5:function(){return en},geoEckert5Raw:function(){return qt},geoEckert6:function(){return Zt},geoEckert6Raw:function(){return Wt},geoEisenlohr:function(){return Pn},geoEisenlohrRaw:function(){return un},geoFahey:function(){return mn},geoFaheyRaw:function(){return In},geoFoucaut:function(){return Kn},geoFoucautRaw:function(){return En},geoFoucautSinusoidal:function(){return Tn},geoFoucautSinusoidalRaw:function(){return Ln},geoGilbert:function(){return $n},geoGingery:function(){return hr},geoGingeryRaw:function(){return vr},geoGinzburg4:function(){return Or},geoGinzburg4Raw:function(){return ni},geoGinzburg5:function(){return xr},geoGinzburg5Raw:function(){return Ar},geoGinzburg6:function(){return kn},geoGinzburg6Raw:function(){return Qr},geoGinzburg8:function(){return ur},geoGinzburg8Raw:function(){return Cn},geoGinzburg9:function(){return cr},geoGinzburg9Raw:function(){return Zn},geoGringorten:function(){return Xr},geoGringortenQuincuncial:function(){return _s},geoGringortenRaw:function(){return Er},geoGuyou:function(){return an},geoGuyouRaw:function(){return Yn},geoHammer:function(){return Se},geoHammerRaw:function(){return me},geoHammerRetroazimuthal:function(){return Un},geoHammerRetroazimuthalRaw:function(){return gn},geoHealpix:function(){return Tr},geoHealpixRaw:function(){return ln},geoHill:function(){return Ur},geoHillRaw:function(){return yr},geoHomolosine:function(){return gi},geoHomolosineRaw:function(){return Jr},geoHufnagel:function(){return Yr},geoHufnagelRaw:function(){return ii},geoHyperelliptical:function(){return Pa},geoHyperellipticalRaw:function(){return Wi},geoInterrupt:function(){return Ha},geoInterruptedBoggs:function(){return bs},geoInterruptedHomolosine:function(){return Ki},geoInterruptedMollweide:function(){return To},geoInterruptedMollweideHemispheres:function(){return Os},geoInterruptedQuarticAuthalic:function(){return nc},geoInterruptedSinuMollweide:function(){return ws},geoInterruptedSinusoidal:function(){return Ql},geoKavrayskiy7:function(){return eu},geoKavrayskiy7Raw:function(){return ss},geoLagrange:function(){return Za},geoLagrangeRaw:function(){return vl},geoLarrivee:function(){return Ds},geoLarriveeRaw:function(){return yl},geoLaskowski:function(){return tu},geoLaskowskiRaw:function(){return Nl},geoLittrow:function(){return jl},geoLittrowRaw:function(){return xl},geoLoximuthal:function(){return Vl},geoLoximuthalRaw:function(){return Ul},geoMiller:function(){return Ju},geoMillerRaw:function(){return vs},geoModifiedStereographic:function(){return $a},geoModifiedStereographicAlaska:function(){return gh},geoModifiedStereographicGs48:function(){return Fo},geoModifiedStereographicGs50:function(){return Qu},geoModifiedStereographicLee:function(){return Mu},geoModifiedStereographicMiller:function(){return oa},geoModifiedStereographicRaw:function(){return ju},geoMollweide:function(){return Pe},geoMollweideRaw:function(){return Ve},geoMtFlatPolarParabolic:function(){return ec},geoMtFlatPolarParabolicRaw:function(){return qs},geoMtFlatPolarQuartic:function(){return Fs},geoMtFlatPolarQuarticRaw:function(){return ql},geoMtFlatPolarSinusoidal:function(){return Bo},geoMtFlatPolarSinusoidalRaw:function(){return qo},geoNaturalEarth:function(){return _a.A},geoNaturalEarth2:function(){return Fc},geoNaturalEarth2Raw:function(){return Vu},geoNaturalEarthRaw:function(){return _a.P},geoNellHammer:function(){return Yo},geoNellHammerRaw:function(){return Hs},geoNicolosi:function(){return Qc},geoNicolosiRaw:function(){return rc},geoPatterson:function(){return ro},geoPattersonRaw:function(){return po},geoPeirceQuincuncial:function(){return yu},geoPierceQuincuncial:function(){return yu},geoPolyconic:function(){return qu},geoPolyconicRaw:function(){return mu},geoPolyhedral:function(){return La},geoPolyhedralButterfly:function(){return ic},geoPolyhedralCollignon:function(){return Gl},geoPolyhedralWaterman:function(){return us},geoProject:function(){return Xa},geoQuantize:function(){return ru},geoQuincuncial:function(){return Zl},geoRectangularPolyconic:function(){return Sa},geoRectangularPolyconicRaw:function(){return Tl},geoRobinson:function(){return Mi},geoRobinsonRaw:function(){return kl},geoSatellite:function(){return Ac},geoSatelliteRaw:function(){return Hu},geoSinuMollweide:function(){return Cr},geoSinuMollweideRaw:function(){return Pr},geoSinusoidal:function(){return $e},geoSinusoidalRaw:function(){return qe},geoStitch:function(){return So},geoTimes:function(){return ta},geoTimesRaw:function(){return io},geoTwoPointAzimuthal:function(){return Io},geoTwoPointAzimuthalRaw:function(){return ac},geoTwoPointAzimuthalUsa:function(){return yi},geoTwoPointEquidistant:function(){return sl},geoTwoPointEquidistantRaw:function(){return za},geoTwoPointEquidistantUsa:function(){return xu},geoVanDerGrinten:function(){return dc},geoVanDerGrinten2:function(){return ou},geoVanDerGrinten2Raw:function(){return $s},geoVanDerGrinten3:function(){return Cl},geoVanDerGrinten3Raw:function(){return eo},geoVanDerGrinten4:function(){return Fi},geoVanDerGrinten4Raw:function(){return di},geoVanDerGrintenRaw:function(){return $l},geoWagner:function(){return Il},geoWagner4:function(){return Ys},geoWagner4Raw:function(){return da},geoWagner6:function(){return xi},geoWagner6Raw:function(){return Ai},geoWagner7:function(){return su},geoWagnerRaw:function(){return Mo},geoWiechel:function(){return es},geoWiechelRaw:function(){return xa},geoWinkel3:function(){return js},geoWinkel3Raw:function(){return bu}});var b=t(94684),d=Math.abs,e=Math.atan,w=Math.atan2,y=Math.cos,_=Math.exp,u=Math.floor,r=Math.log,n=Math.max,l=Math.min,o=Math.pow,s=Math.round,c=Math.sign||function(xt){return xt>0?1:xt<0?-1:0},h=Math.sin,x=Math.tan,m=1e-6,g=1e-12,k=Math.PI,A=k/2,v=k/4,S=Math.SQRT1_2,T=N(2),p=N(k),M=2*k,f=180/k,E=k/180;function I(xt){return xt>1?A:xt<-1?-A:Math.asin(xt)}function B(xt){return xt>1?0:xt<-1?k:Math.acos(xt)}function N(xt){return xt>0?Math.sqrt(xt):0}function V(xt){return(_(xt)-_(-xt))/2}function j(xt){return(_(xt)+_(-xt))/2}function $(xt){var Tt=x(xt/2),Dt=2*r(y(xt/2))/(Tt*Tt);function X(R,i){var a=y(R),C=y(i),F=h(i),q=C*a,te=-((1-q?r((1+q)/2)/(1-q):-.5)+Dt/(1+q));return[te*C*h(R),te*F]}return X.invert=function(R,i){var a,C=N(R*R+i*i),F=-xt/2,q=50;if(!C)return[0,0];do{var te=F/2,ue=y(te),ve=h(te),Ae=ve/ue,Re=-r(d(ue));F-=a=(2/Ae*Re-Dt*Ae-C)/(-Re/(ve*ve)+1-Dt/(2*ue*ue))*(ue<0?.7:1)}while(d(a)>m&&--q>0);var Ue=h(F);return[w(R*Ue,C*y(F)),I(i*Ue/C)]},X}function ee(){var xt=A,Tt=(0,b.U)($),Dt=Tt(xt);return Dt.radius=function(X){return arguments.length?Tt(xt=X*E):xt*f},Dt.scale(179.976).clipAngle(147)}function H(xt,Tt){var Dt=y(Tt),X=function(R){return R?R/Math.sin(R):1}(B(Dt*y(xt/=2)));return[2*Dt*h(xt)*X,h(Tt)*X]}function J(){return(0,b.A)(H).scale(152.63)}function Q(xt){var Tt=h(xt),Dt=y(xt),X=xt>=0?1:-1,R=x(X*xt),i=(1+Tt-Dt)/2;function a(C,F){var q=y(F),te=y(C/=2);return[(1+q)*h(C),(X*F>-w(te,R)-.001?0:10*-X)+i+h(F)*Dt-(1+q)*Tt*te]}return a.invert=function(C,F){var q=0,te=0,ue=50;do{var ve=y(q),Ae=h(q),Re=y(te),Ue=h(te),it=1+Re,ct=it*Ae-C,dt=i+Ue*Dt-it*Tt*ve-F,bt=it*ve/2,Ct=-Ae*Ue,Mt=Tt*it*Ae/2,Ut=Dt*Re+Tt*ve*Ue,It=Ct*Mt-Ut*bt,Qt=(dt*Ct-ct*Ut)/It/2,tn=(ct*Mt-dt*bt)/It;d(tn)>2&&(tn/=2),q-=Qt,te-=tn}while((d(Qt)>m||d(tn)>m)&&--ue>0);return X*te>-w(y(q),R)-.001?[2*q,te]:null},a}function Z(){var xt=20*E,Tt=xt>=0?1:-1,Dt=x(Tt*xt),X=(0,b.U)(Q),R=X(xt),i=R.stream;return R.parallel=function(a){return arguments.length?(Dt=x((Tt=(xt=a*E)>=0?1:-1)*xt),X(xt)):xt*f},R.stream=function(a){var C=R.rotate(),F=i(a),q=(R.rotate([0,0]),i(a)),te=R.precision();return R.rotate(C),F.sphere=function(){q.polygonStart(),q.lineStart();for(var ue=-180*Tt;Tt*ue<180;ue+=90*Tt)q.point(ue,90*Tt);if(xt)for(;Tt*(ue-=3*Tt*te)>=-180;)q.point(ue,Tt*-w(y(ue*E/2),Dt)*f);q.lineEnd(),q.polygonEnd()},F},R.scale(218.695).center([0,28.0974])}function K(xt,Tt){var Dt=x(Tt/2),X=N(1-Dt*Dt),R=1+X*y(xt/=2),i=h(xt)*X/R,a=Dt/R,C=i*i,F=a*a;return[1.3333333333333333*i*(3+C-3*F),1.3333333333333333*a*(3+3*C-F)]}function ae(){return(0,b.A)(K).scale(66.1603)}H.invert=function(xt,Tt){if(!(xt*xt+4*Tt*Tt>k*k+m)){var Dt=xt,X=Tt,R=25;do{var i,a=h(Dt),C=h(Dt/2),F=y(Dt/2),q=h(X),te=y(X),ue=h(2*X),ve=q*q,Ae=te*te,Re=C*C,Ue=1-Ae*F*F,it=Ue?B(te*F)*N(i=1/Ue):i=0,ct=2*it*te*C-xt,dt=it*q-Tt,bt=i*(Ae*Re+it*te*F*ve),Ct=i*(.5*a*ue-2*it*q*C),Mt=.25*i*(ue*C-it*q*Ae*a),Ut=i*(ve*F+it*Re*te),It=Ct*Mt-Ut*bt;if(!It)break;var Qt=(dt*Ct-ct*Ut)/It,tn=(ct*Mt-dt*bt)/It;Dt-=Qt,X-=tn}while((d(Qt)>m||d(tn)>m)&&--R>0);return[Dt,X]}},K.invert=function(xt,Tt){if(Tt*=.375,!(xt*=.375)&&d(Tt)>1)return null;var Dt=1+xt*xt+Tt*Tt,X=N((Dt-N(Dt*Dt-4*Tt*Tt))/2),R=I(X)/3,i=X?function(q){return r(q+N(q*q-1))}(d(Tt/X))/3:function(q){return r(q+N(q*q+1))}(d(xt))/3,a=y(R),C=j(i),F=C*C-a*a;return[2*c(xt)*w(V(i)*a,.25-F),2*c(Tt)*w(C*h(R),.25+F)]};var se=N(8),he=r(1+T);function fe(xt,Tt){var Dt=d(Tt);return Dtg&&--i>0);return[xt/(y(R)*(se-1/h(R))),c(Tt)*R]};var oe=t(61957);function le(xt){var Tt=2*k/xt;function Dt(X,R){var i=(0,oe.j)(X,R);if(d(X)>A){var a=w(i[1],i[0]),C=N(i[0]*i[0]+i[1]*i[1]),F=Tt*s((a-A)/Tt)+A,q=w(h(a-=F),2-y(a));a=F+I(k/C*h(q))-q,i[0]=C*y(a),i[1]=C*h(a)}return i}return Dt.invert=function(X,R){var i=N(X*X+R*R);if(i>A){var a=w(R,X),C=Tt*s((a-A)/Tt)+A,F=a>C?-1:1,q=i*y(C-a),te=1/x(F*B((q-k)/N(k*(k-2*q)+i*i)));a=C+2*e((te+F*N(te*te-3))/3),X=i*y(a),R=i*h(a)}return oe.j.invert(X,R)},Dt}function ge(){var xt=5,Tt=(0,b.U)(le),Dt=Tt(xt),X=Dt.stream,R=.01,i=-y(R*E),a=h(R*E);return Dt.lobes=function(C){return arguments.length?Tt(xt=+C):xt},Dt.stream=function(C){var F=Dt.rotate(),q=X(C),te=(Dt.rotate([0,0]),X(C));return Dt.rotate(F),q.sphere=function(){te.polygonStart(),te.lineStart();for(var ue=0,ve=360/xt,Ae=2*k/xt,Re=90-180/xt,Ue=A;ue0&&d(X)>m);return a<0?NaN:Dt}function Ce(xt,Tt,Dt){return Tt===void 0&&(Tt=40),Dt===void 0&&(Dt=g),function(X,R,i,a){var C,F,q;i=i===void 0?0:+i,a=a===void 0?0:+a;for(var te=0;teC)i-=F/=2,a-=q/=2;else{C=Re;var Ue=(i>0?-1:1)*Dt,it=(a>0?-1:1)*Dt,ct=xt(i+Ue,a),dt=xt(i,a+it),bt=(ct[0]-ue[0])/Ue,Ct=(ct[1]-ue[1])/Ue,Mt=(dt[0]-ue[0])/it,Ut=(dt[1]-ue[1])/it,It=Ut*bt-Ct*Mt,Qt=(d(It)<.5?.5:1)/It;if(i+=F=(Ae*Mt-ve*Ut)*Qt,a+=q=(ve*Ct-Ae*bt)*Qt,d(F)0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return Tt.invert=Ce(Tt),Tt}function Oe(){return(0,b.A)(Le()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function We(xt,Tt){var Dt,X=xt*h(Tt),R=30;do Tt-=Dt=(Tt+h(Tt)-X)/(1+y(Tt));while(d(Dt)>m&&--R>0);return Tt/2}function Ie(xt,Tt,Dt){function X(R,i){return[xt*R*y(i=We(Dt,i)),Tt*h(i)]}return X.invert=function(R,i){return i=I(i/Tt),[R/(xt*y(i)),I((2*i+h(2*i))/Dt)]},X}be.invert=function(xt,Tt){var Dt=2*I(Tt/2);return[xt*y(Dt/2)/y(Dt),Dt]};var Ve=Ie(T/A,T,k);function Pe(){return(0,b.A)(Ve).scale(169.529)}var de=2.00276,Me=1.11072;function ke(xt,Tt){var Dt=We(k,Tt);return[de*xt/(1/y(Tt)+Me/y(Dt)),(Tt+T*h(Dt))/de]}function He(){return(0,b.A)(ke).scale(160.857)}function Fe(xt){var Tt=0,Dt=(0,b.U)(xt),X=Dt(Tt);return X.parallel=function(R){return arguments.length?Dt(Tt=R*E):Tt*f},X}function qe(xt,Tt){return[xt*y(Tt),Tt]}function $e(){return(0,b.A)(qe).scale(152.63)}function Ye(xt){if(!xt)return qe;var Tt=1/x(xt);function Dt(X,R){var i=Tt+xt-R,a=i&&X*y(R)/i;return[i*h(a),Tt-i*y(a)]}return Dt.invert=function(X,R){var i=N(X*X+(R=Tt-R)*R),a=Tt+xt-i;return[i/y(a)*w(X,R),a]},Dt}function _e(){return Fe(Ye).scale(123.082).center([0,26.1441]).parallel(45)}function De(xt){function Tt(Dt,X){var R=A-X,i=R&&Dt*xt*h(R)/R;return[R*h(i)/xt,A-R*y(i)]}return Tt.invert=function(Dt,X){var R=Dt*xt,i=A-X,a=N(R*R+i*i),C=w(R,i);return[(a?a/h(a):1)*C/xt,A-a]},Tt}function Be(){var xt=.5,Tt=(0,b.U)(De),Dt=Tt(xt);return Dt.fraction=function(X){return arguments.length?Tt(xt=+X):xt},Dt.scale(158.837)}ke.invert=function(xt,Tt){var Dt,X,R=de*Tt,i=Tt<0?-v:v,a=25;do X=R-T*h(i),i-=Dt=(h(2*i)+2*i-k*h(X))/(2*y(2*i)+2+k*y(X)*T*y(i));while(d(Dt)>m&&--a>0);return X=R-T*h(i),[xt*(1/y(X)+Me/y(i))/de,X]},qe.invert=function(xt,Tt){return[xt/y(Tt),Tt]};var Ge=Ie(1,4/k,k);function tt(){return(0,b.A)(Ge).scale(152.63)}var nt=t(30021),ft=t(30915);function At(xt,Tt,Dt,X,R,i){var a,C=y(i);if(d(xt)>1||d(i)>1)a=B(Dt*R+Tt*X*C);else{var F=h(xt/2),q=h(i/2);a=2*I(N(F*F+Tt*X*q*q))}return d(a)>m?[a,w(X*h(i),Tt*R-Dt*X*C)]:[0,0]}function kt(xt,Tt,Dt){return B((xt*xt+Tt*Tt-Dt*Dt)/(2*xt*Tt))}function Vt(xt){return xt-2*k*u((xt+k)/(2*k))}function Ht(xt,Tt,Dt){for(var X,R=[[xt[0],xt[1],h(xt[1]),y(xt[1])],[Tt[0],Tt[1],h(Tt[1]),y(Tt[1])],[Dt[0],Dt[1],h(Dt[1]),y(Dt[1])]],i=R[2],a=0;a<3;++a,i=X)X=R[a],i.v=At(X[1]-i[1],i[3],i[2],X[3],X[2],X[0]-i[0]),i.point=[0,0];var C=kt(R[0].v[0],R[2].v[0],R[1].v[0]),F=kt(R[0].v[0],R[1].v[0],R[2].v[0]),q=k-C;R[2].point[1]=0,R[0].point[0]=-(R[1].point[0]=R[0].v[0]/2);var te=[R[2].point[0]=R[0].point[0]+R[2].v[0]*y(C),2*(R[0].point[1]=R[1].point[1]=R[2].v[0]*h(C))];return function(ue,ve){var Ae,Re=h(ve),Ue=y(ve),it=new Array(3);for(Ae=0;Ae<3;++Ae){var ct=R[Ae];if(it[Ae]=At(ve-ct[1],ct[3],ct[2],Ue,Re,ue-ct[0]),!it[Ae][0])return ct.point;it[Ae][1]=Vt(it[Ae][1]-ct.v[1])}var dt=te.slice();for(Ae=0;Ae<3;++Ae){var bt=Ae==2?0:Ae+1,Ct=kt(R[Ae].v[0],it[Ae][0],it[bt][0]);it[Ae][1]<0&&(Ct=-Ct),Ae?Ae==1?(Ct=F-Ct,dt[0]-=it[Ae][0]*y(Ct),dt[1]-=it[Ae][0]*h(Ct)):(Ct=q-Ct,dt[0]+=it[Ae][0]*y(Ct),dt[1]+=it[Ae][0]*h(Ct)):(dt[0]+=it[Ae][0]*y(Ct),dt[1]-=it[Ae][0]*h(Ct))}return dt[0]/=3,dt[1]/=3,dt}}function Gt(xt){return xt[0]*=E,xt[1]*=E,xt}function st(){return Qe([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Qe(xt,Tt,Dt){var X=(0,nt.A)({type:"MultiPoint",coordinates:[xt,Tt,Dt]}),R=[-X[0],-X[1]],i=(0,ft.A)(R),a=Ht(Gt(i(xt)),Gt(i(Tt)),Gt(i(Dt)));a.invert=Ce(a);var C=(0,b.A)(a).rotate(R),F=C.center;return delete C.rotate,C.center=function(q){return arguments.length?F(i(q)):i.invert(F())},C.clipAngle(90)}function pt(xt,Tt){var Dt=N(1-h(Tt));return[2/p*xt*Dt,p*(1-Dt)]}function yt(){return(0,b.A)(pt).scale(95.6464).center([0,30])}function Ot(xt){var Tt=x(xt);function Dt(X,R){return[X,(X?X/h(X):1)*(h(R)*y(X)-Tt*y(R))]}return Dt.invert=Tt?function(X,R){X&&(R*=h(X)/X);var i=y(X);return[X,2*w(N(i*i+Tt*Tt-R*R)-i,Tt-R)]}:function(X,R){return[X,I(X?R*x(X)/X:R)]},Dt}function Pt(){return Fe(Ot).scale(249.828).clipAngle(90)}pt.invert=function(xt,Tt){var Dt=(Dt=Tt/p-1)*Dt;return[Dt>0?xt*N(k/Dt)/2:0,I(1-Dt)]};var at=N(3);function lt(xt,Tt){return[at*xt*(2*y(2*Tt/3)-1)/p,at*p*h(Tt/3)]}function Xe(){return(0,b.A)(lt).scale(156.19)}function ut(xt){var Tt=y(xt);function Dt(X,R){return[X*Tt,h(R)/Tt]}return Dt.invert=function(X,R){return[X/Tt,I(R*Tt)]},Dt}function wt(){return Fe(ut).parallel(38.58).scale(195.044)}function vt(xt){var Tt=y(xt);function Dt(X,R){return[X*Tt,(1+Tt)*x(R/2)]}return Dt.invert=function(X,R){return[X/Tt,2*e(R/(1+Tt))]},Dt}function Lt(){return Fe(vt).scale(124.75)}function jt(xt,Tt){var Dt=N(8/(3*k));return[Dt*xt*(1-d(Tt)/k),Dt*Tt]}function rt(){return(0,b.A)(jt).scale(165.664)}function et(xt,Tt){var Dt=N(4-3*h(d(Tt)));return[2/N(6*k)*xt*Dt,c(Tt)*N(2*k/3)*(2-Dt)]}function Et(){return(0,b.A)(et).scale(165.664)}function Bt(xt,Tt){var Dt=N(k*(4+k));return[2/Dt*xt*(1+N(1-4*Tt*Tt/(k*k))),4/Dt*Tt]}function Ft(){return(0,b.A)(Bt).scale(180.739)}function St(xt,Tt){var Dt=(2+A)*h(Tt);Tt/=2;for(var X=0,R=1/0;X<10&&d(R)>m;X++){var i=y(Tt);Tt-=R=(Tt+h(Tt)*(i+2)-Dt)/(2*i*(1+i))}return[2/N(k*(4+k))*xt*(1+y(Tt)),2*N(k/(4+k))*h(Tt)]}function Jt(){return(0,b.A)(St).scale(180.739)}function qt(xt,Tt){return[xt*(1+y(Tt))/N(2+k),2*Tt/N(2+k)]}function en(){return(0,b.A)(qt).scale(173.044)}function Wt(xt,Tt){for(var Dt=(1+A)*h(Tt),X=0,R=1/0;X<10&&d(R)>m;X++)Tt-=R=(Tt+h(Tt)-Dt)/(1+y(Tt));return Dt=N(2+k),[xt*(1+y(Tt))/Dt,2*Tt/Dt]}function Zt(){return(0,b.A)(Wt).scale(173.044)}lt.invert=function(xt,Tt){var Dt=3*I(Tt/(at*p));return[p*xt/(at*(2*y(2*Dt/3)-1)),Dt]},jt.invert=function(xt,Tt){var Dt=N(8/(3*k)),X=Tt/Dt;return[xt/(Dt*(1-d(X)/k)),X]},et.invert=function(xt,Tt){var Dt=2-d(Tt)/N(2*k/3);return[xt*N(6*k)/(2*Dt),c(Tt)*I((4-Dt*Dt)/3)]},Bt.invert=function(xt,Tt){var Dt=N(k*(4+k))/2;return[xt*Dt/(1+N(1-Tt*Tt*(4+k)/(4*k))),Tt*Dt/2]},St.invert=function(xt,Tt){var Dt=Tt*N((4+k)/k)/2,X=I(Dt),R=y(X);return[xt/(2/N(k*(4+k))*(1+R)),I((X+Dt*(R+2))/(2+A))]},qt.invert=function(xt,Tt){var Dt=N(2+k),X=Tt*Dt/2;return[Dt*xt/(1+y(X)),X]},Wt.invert=function(xt,Tt){var Dt=1+A,X=N(Dt/2);return[2*xt*X/(1+y(Tt*=X)),I((Tt+h(Tt))/Dt)]};var on=3+2*T;function un(xt,Tt){var Dt=h(xt/=2),X=y(xt),R=N(y(Tt)),i=y(Tt/=2),a=h(Tt)/(i+T*X*R),C=N(2/(1+a*a)),F=N((T*i+(X+Dt)*R)/(T*i+(X-Dt)*R));return[on*(C*(F-1/F)-2*r(F)),on*(C*a*(F+1/F)-2*e(a))]}function Pn(){return(0,b.A)(un).scale(62.5271)}un.invert=function(xt,Tt){if(!(Dt=K.invert(xt/1.2,1.065*Tt)))return null;var Dt,X=Dt[0],R=Dt[1],i=20;xt/=on,Tt/=on;do{var a=X/2,C=R/2,F=h(a),q=y(a),te=h(C),ue=y(C),ve=y(R),Ae=N(ve),Re=te/(ue+T*q*Ae),Ue=Re*Re,it=N(2/(1+Ue)),ct=(T*ue+(q+F)*Ae)/(T*ue+(q-F)*Ae),dt=N(ct),bt=dt-1/dt,Ct=dt+1/dt,Mt=it*bt-2*r(dt)-xt,Ut=it*Re*Ct-2*e(Re)-Tt,It=te&&S*Ae*F*Ue/te,Qt=(T*q*ue+Ae)/(2*(ue+T*q*Ae)*(ue+T*q*Ae)*Ae),tn=-.5*Re*it*it*it,Yt=tn*It,vn=tn*Qt,Mn=(Mn=2*ue+T*Ae*(q-F))*Mn*dt,Vn=(T*q*ue*Ae+ve)/Mn,Hn=-T*F*te/(Ae*Mn),Xn=bt*Yt-2*Vn/dt+it*(Vn+Vn/ct),rr=bt*vn-2*Hn/dt+it*(Hn+Hn/ct),Mr=Re*Ct*Yt-2*It/(1+Ue)+it*Ct*It+it*Re*(Vn-Vn/ct),nr=Re*Ct*vn-2*Qt/(1+Ue)+it*Ct*Qt+it*Re*(Hn-Hn/ct),Lr=rr*Mr-nr*Xn;if(!Lr)break;var dr=(Ut*rr-Mt*nr)/Lr,Br=(Mt*Mr-Ut*Xn)/Lr;X-=dr,R=n(-A,l(A,R-Br))}while((d(dr)>m||d(Br)>m)&&--i>0);return d(d(R)-A)X){var ue=N(te),ve=w(q,F),Ae=Dt*s(ve/Dt),Re=ve-Ae,Ue=xt*y(Re),it=(xt*h(Re)-Re*h(Ue))/(A-Ue),ct=Qn(Re,it),dt=(k-xt)/lr(ct,Ue,k);F=ue;var bt,Ct=50;do F-=bt=(xt+lr(ct,Ue,F)*dt-ue)/(ct(F)*dt);while(d(bt)>m&&--Ct>0);q=Re*h(F),FX){var F=N(C),q=w(a,i),te=Dt*s(q/Dt),ue=q-te;i=F*y(ue),a=F*h(ue);for(var ve=i-A,Ae=h(i),Re=a/Ae,Ue=im||d(ve)>m)&&--Ue>0);return[Ae,Re]},F}var ni=jr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Or(){return(0,b.A)(ni).scale(149.995)}var Ar=jr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function xr(){return(0,b.A)(Ar).scale(153.93)}var Qr=jr(5/6*k,-.62636,-.0344,0,1.3493,-.05524,0,.045);function kn(){return(0,b.A)(Qr).scale(130.945)}function Cn(xt,Tt){var Dt=xt*xt,X=Tt*Tt;return[xt*(1-.162388*X)*(.87-952426e-9*Dt*Dt),Tt*(1+X/12)]}function ur(){return(0,b.A)(Cn).scale(131.747)}Cn.invert=function(xt,Tt){var Dt,X=xt,R=Tt,i=50;do{var a=R*R;R-=Dt=(R*(1+a/12)-Tt)/(1+a/4)}while(d(Dt)>m&&--i>0);i=50,xt/=1-.162388*a;do{var C=(C=X*X)*C;X-=Dt=(X*(.87-952426e-9*C)-xt)/(.87-.00476213*C)}while(d(Dt)>m&&--i>0);return[X,R]};var Zn=jr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function cr(){return(0,b.A)(Zn).scale(131.087)}function Ir(xt){var Tt=xt(A,0)[0]-xt(-A,0)[0];function Dt(X,R){var i=X>0?-.5:.5,a=xt(X+i*k,R);return a[0]-=i*Tt,a}return xt.invert&&(Dt.invert=function(X,R){var i=X>0?-.5:.5,a=xt.invert(X+i*Tt,R),C=a[0]-i*k;return C<-k?C+=2*k:C>k&&(C-=2*k),a[0]=C,a}),Dt}function Er(xt,Tt){var Dt=c(xt),X=c(Tt),R=y(Tt),i=y(xt)*R,a=h(xt)*R,C=h(X*Tt);xt=d(w(a,C)),Tt=I(i),d(xt-A)>m&&(xt%=A);var F=function(q,te){if(te===A)return[0,0];var ue,ve,Ae=h(te),Re=Ae*Ae,Ue=Re*Re,it=1+Ue,ct=1+3*Ue,dt=1-Ue,bt=I(1/N(it)),Ct=dt+Re*it*bt,Mt=(1-Ae)/Ct,Ut=N(Mt),It=Mt*it,Qt=N(It),tn=Ut*dt;if(q===0)return[0,-(tn+Re*Qt)];var Yt,vn=y(te),Mn=1/vn,Vn=2*Ae*vn,Hn=(-Ct*vn-(1-Ae)*((-3*Re+bt*ct)*Vn))/(Ct*Ct),Xn=-Mn*Vn,rr=-Mn*(Re*it*Hn+Mt*ct*Vn),Mr=-2*Mn*(dt*(.5*Hn/Ut)-2*Re*Ut*Vn),nr=4*q/k;if(q>.222*k||te.175*k){if(ue=(tn+Re*N(It*(1+Ue)-tn*tn))/(1+Ue),q>k/4)return[ue,ue];var Lr=ue,dr=.5*ue;ue=.5*(dr+Lr),ve=50;do{var Br=ue*(Mr+Xn*N(It-ue*ue))+rr*I(ue/Qt)-nr;if(!Br)break;Br<0?dr=ue:Lr=ue,ue=.5*(dr+Lr)}while(d(Lr-dr)>m&&--ve>0)}else{ue=m,ve=25;do{var Sr=ue*ue,Vr=N(It-Sr),fi=Mr+Xn*Vr,Nr=ue*fi+rr*I(ue/Qt)-nr;ue-=Yt=Vr?Nr/(fi+(rr-Xn*Sr)/Vr):0}while(d(Yt)>m&&--ve>0)}return[ue,-tn-Re*N(It-ue*ue)]}(xt>k/4?A-xt:xt,Tt);return xt>k/4&&(C=F[0],F[0]=-F[1],F[1]=-C),F[0]*=Dt,F[1]*=-X,F}function Xr(){return(0,b.A)(Ir(Er)).scale(239.75)}function ai(xt,Tt){var Dt,X,R,i,a,C;if(Tt=1-m)return Dt=(1-Tt)/4,R=1/(X=j(xt)),[(i=((C=_(2*(C=xt)))-1)/(C+1))+Dt*((a=X*V(xt))-xt)/(X*X),R-Dt*i*R*(a-xt),R+Dt*i*R*(a+xt),2*e(_(xt))-A+Dt*(a-xt)/X];var F=[1,0,0,0,0,0,0,0,0],q=[N(Tt),0,0,0,0,0,0,0,0],te=0;for(X=N(1-Tt),a=1;d(q[te]/F[te])>m&&te<8;)Dt=F[te++],q[te]=(Dt-X)/2,F[te]=(Dt+X)/2,X=N(Dt*X),a*=2;R=a*F[te]*xt;do R=(I(i=q[te]*h(X=R)/F[te])+R)/2;while(--te);return[h(R),i=y(R),i/y(R-X),R]}function bn(xt,Tt){if(!Tt)return xt;if(Tt===1)return r(x(xt/2+v));for(var Dt=1,X=N(1-Tt),R=N(Tt),i=0;d(R)>m;i++){if(xt%k){var a=e(X*x(xt)/Dt);a<0&&(a+=k),xt+=a+~~(xt/k)*k}else xt+=xt;R=(Dt+X)/2,X=N(Dt*X),R=((Dt=R)-X)/2}return xt/(o(2,i)*Dt)}function Yn(xt,Tt){var Dt=(T-1)/(T+1),X=N(1-Dt*Dt),R=bn(A,X*X),i=r(x(k/4+d(Tt)/2)),a=_(-1*i)/N(Dt),C=function(q,te){var ue=q*q,ve=te+1,Ae=1-ue-te*te;return[.5*((q>=0?A:-A)-w(Ae,2*q)),-.25*r(Ae*Ae+4*ue)+.5*r(ve*ve+ue)]}(a*y(-1*xt),a*h(-1*xt)),F=function(q,te,ue){var ve=d(q),Ae=V(d(te));if(ve){var Re=1/h(ve),Ue=1/(x(ve)*x(ve)),it=-(Ue+ue*(Ae*Ae*Re*Re)-1+ue),ct=(-it+N(it*it-(ue-1)*Ue*4))/2;return[bn(e(1/N(ct)),ue)*c(q),bn(e(N((ct/Ue-1)/ue)),1-ue)*c(te)]}return[0,bn(e(Ae),1-ue)*c(te)]}(C[0],C[1],X*X);return[-F[1],(Tt>=0?1:-1)*(.5*R-F[0])]}function an(){return(0,b.A)(Ir(Yn)).scale(151.496)}Er.invert=function(xt,Tt){d(xt)>1&&(xt=2*c(xt)-xt),d(Tt)>1&&(Tt=2*c(Tt)-Tt);var Dt=c(xt),X=c(Tt),R=-Dt*xt,i=-X*Tt,a=i/R<1,C=function(ue,ve){for(var Ae=0,Re=1,Ue=.5,it=50;;){var ct=Ue*Ue,dt=N(Ue),bt=I(1/N(1+ct)),Ct=1-ct+Ue*(1+ct)*bt,Mt=(1-dt)/Ct,Ut=N(Mt),It=Mt*(1+ct),Qt=Ut*(1-ct),tn=N(It-ue*ue),Yt=ve+Qt+Ue*tn;if(d(Re-Ae)0?Ae=Ue:Re=Ue,Ue=.5*(Ae+Re)}if(!it)return null;var vn=I(dt),Mn=y(vn),Vn=1/Mn,Hn=2*dt*Mn,Xn=(-Ct*Mn-(-3*Ue+bt*(1+3*ct))*Hn*(1-dt))/(Ct*Ct);return[k/4*(ue*(-2*Vn*((1-ct)*(.5*Xn/Ut)-2*Ue*Ut*Hn)+-Vn*Hn*tn)+-Vn*(Ue*(1+ct)*Xn+Mt*(1+3*ct)*Hn)*I(ue/N(It))),vn]}(a?i:R,a?R:i),F=C[0],q=C[1],te=y(q);return a&&(F=-A-F),[Dt*(w(h(F)*te,-h(q))+k),X*I(y(F)*te)]},Yn.invert=function(xt,Tt){var Dt,X,R,i,a,C,F=(T-1)/(T+1),q=N(1-F*F),te=(X=-xt,R=q*q,(Dt=.5*bn(A,q*q)-Tt)?(i=ai(Dt,R),X?(C=(a=ai(X,1-R))[1]*a[1]+R*i[0]*i[0]*a[0]*a[0],[[i[0]*a[2]/C,i[1]*i[2]*a[0]*a[1]/C],[i[1]*a[1]/C,-i[0]*i[2]*a[0]*a[2]/C],[i[2]*a[1]*a[2]/C,-R*i[0]*i[1]*a[0]/C]]):[[i[0],0],[i[1],0],[i[2],0]]):[[0,(a=ai(X,1-R))[0]/a[1]],[1/a[1],0],[a[2]/a[1],0]]),ue=function(ve,Ae){var Re=Ae[0]*Ae[0]+Ae[1]*Ae[1];return[(ve[0]*Ae[0]+ve[1]*Ae[1])/Re,(ve[1]*Ae[0]-ve[0]*Ae[1])/Re]}(te[0],te[1]);return[w(ue[1],ue[0])/-1,2*e(_(-.5*r(F*ue[0]*ue[0]+F*ue[1]*ue[1])))-A]};var _n=t(39127);function gn(xt){var Tt=h(xt),Dt=y(xt),X=qn(xt);function R(i,a){var C=X(i,a);i=C[0],a=C[1];var F=h(a),q=y(a),te=y(i),ue=B(Tt*F+Dt*q*te),ve=h(ue),Ae=d(ve)>m?ue/ve:1;return[Ae*Dt*h(i),(d(i)>A?Ae:-Ae)*(Tt*q-Dt*F*te)]}return X.invert=qn(-xt),R.invert=function(i,a){var C=N(i*i+a*a),F=-h(C),q=y(C),te=C*q,ue=-a*F,ve=C*Tt,Ae=N(te*te+ue*ue-ve*ve),Re=w(te*ve+ue*Ae,ue*ve-te*Ae),Ue=(C>A?-1:1)*w(i*F,C*y(Re)*q+a*h(Re)*F);return X.invert(Ue,Re)},R}function qn(xt){var Tt=h(xt),Dt=y(xt);return function(X,R){var i=y(R),a=y(X)*i,C=h(X)*i,F=h(R);return[w(C,a*Dt-F*Tt),I(F*Dt+a*Tt)]}}function Un(){var xt=0,Tt=(0,b.U)(gn),Dt=Tt(xt),X=Dt.rotate,R=Dt.stream,i=(0,_n.A)();return Dt.parallel=function(a){if(!arguments.length)return xt*f;var C=Dt.rotate();return Tt(xt=a*E).rotate(C)},Dt.rotate=function(a){return arguments.length?(X.call(Dt,[a[0],a[1]-xt*f]),i.center([-a[0],-a[1]]),Dt):((a=X.call(Dt))[1]+=xt*f,a)},Dt.stream=function(a){return(a=R(a)).sphere=function(){a.polygonStart();var C,F=i.radius(89.99)().coordinates[0],q=F.length-1,te=-1;for(a.lineStart();++te=0;)a.point((C=F[te])[0],C[1]);a.lineEnd(),a.polygonEnd()},a},Dt.scale(79.4187).parallel(45).clipAngle(179.999)}var tr=t(29725),Wn=t(20465),Bn=I(1-1/3)*f,dn=ut(0);function ln(xt){var Tt=Bn*E,Dt=pt(k,Tt)[0]-pt(-k,Tt)[0],X=dn(0,Tt)[1],R=pt(0,Tt)[1],i=p-R,a=M/xt,C=4/M,F=X+i*i*4/M;function q(te,ue){var ve,Ae=d(ue);if(Ae>Tt){var Re=l(xt-1,n(0,u((te+k)/a)));(ve=pt(te+=k*(xt-1)/xt-Re*a,Ae))[0]=ve[0]*M/Dt-M*(xt-1)/(2*xt)+Re*M/xt,ve[1]=X+4*(ve[1]-R)*i/M,ue<0&&(ve[1]=-ve[1])}else ve=dn(te,ue);return ve[0]*=C,ve[1]/=F,ve}return q.invert=function(te,ue){te/=C;var ve=d(ue*=F);if(ve>X){var Ae=l(xt-1,n(0,u((te+k)/a)));te=(te+k*(xt-1)/xt-Ae*a)*Dt/M;var Re=pt.invert(te,.25*(ve-X)*M/i+R);return Re[0]-=k*(xt-1)/xt-Ae*a,ue<0&&(Re[1]=-Re[1]),Re}return dn.invert(te,ue)},q}function An(xt,Tt){return[xt,1&Tt?90-m:Bn]}function er(xt,Tt){return[xt,1&Tt?-90+m:-Bn]}function br(xt){return[xt[0]*(1-m),xt[1]]}function Tr(){var xt=4,Tt=(0,b.U)(ln),Dt=Tt(xt),X=Dt.stream;return Dt.lobes=function(R){return arguments.length?Tt(xt=+R):xt},Dt.stream=function(R){var i=Dt.rotate(),a=X(R),C=(Dt.rotate([0,0]),X(R));return Dt.rotate(i),a.sphere=function(){var F,q;(0,Wn.A)((F=180/xt,q=[].concat((0,tr.y1)(-180,180+F/2,F).map(An),(0,tr.y1)(180,-180-F/2,-F).map(er)),{type:"Polygon",coordinates:[F===180?q.map(br):q]}),C)},a},Dt.scale(239.75)}function yr(xt){var Tt,Dt=1+xt,X=I(h(1/Dt)),R=2*N(k/(Tt=k+4*X*Dt)),i=.5*R*(Dt+N(xt*(2+xt))),a=xt*xt,C=Dt*Dt;function F(q,te){var ue,ve,Ae=1-h(te);if(Ae&&Ae<2){var Re,Ue=A-te,it=25;do{var ct=h(Ue),dt=y(Ue),bt=X+w(ct,Dt-dt),Ct=1+C-2*Dt*dt;Ue-=Re=(Ue-a*X-Dt*ct+Ct*bt-.5*Ae*Tt)/(2*Dt*ct*bt)}while(d(Re)>g&&--it>0);ue=R*N(Ct),ve=q*bt/k}else ue=R*(xt+Ae),ve=q*X/k;return[ue*h(ve),i-ue*y(ve)]}return F.invert=function(q,te){var ue=q*q+(te-=i)*te,ve=(1+C-ue/(R*R))/(2*Dt),Ae=B(ve),Re=h(Ae),Ue=X+w(Re,Dt-ve);return[I(q/N(ue))*k/Ue,I(1-2*(Ae-a*X-Dt*Re+(1+C-2*Dt*ve)*Ue)/Tt)]},F}function Ur(){var xt=1,Tt=(0,b.U)(yr),Dt=Tt(xt);return Dt.ratio=function(X){return arguments.length?Tt(xt=+X):xt},Dt.scale(167.774).center([0,18.67])}var Rr=.7109889596207567,$r=.0528035274542;function Pr(xt,Tt){return Tt>-Rr?((xt=Ve(xt,Tt))[1]+=$r,xt):qe(xt,Tt)}function Cr(){return(0,b.A)(Pr).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Jr(xt,Tt){return d(Tt)>Rr?((xt=Ve(xt,Tt))[1]-=Tt>0?$r:-$r,xt):qe(xt,Tt)}function gi(){return(0,b.A)(Jr).scale(152.63)}function ii(xt,Tt,Dt,X){var R=N(4*k/(2*Dt+(1+xt-Tt/2)*h(2*Dt)+(xt+Tt)/2*h(4*Dt)+Tt/2*h(6*Dt))),i=N(X*h(Dt)*N((1+xt*y(2*Dt)+Tt*y(4*Dt))/(1+xt+Tt))),a=Dt*F(1);function C(ue){return N(1+xt*y(2*ue)+Tt*y(4*ue))}function F(ue){var ve=ue*Dt;return(2*ve+(1+xt-Tt/2)*h(2*ve)+(xt+Tt)/2*h(4*ve)+Tt/2*h(6*ve))/Dt}function q(ue){return C(ue)*h(ue)}var te=function(ue,ve){var Ae=Dt*Ee(F,a*h(ve)/Dt,ve/k);isNaN(Ae)&&(Ae=Dt*c(ve));var Re=R*C(Ae);return[Re*i*ue/k*y(Ae),Re/i*h(Ae)]};return te.invert=function(ue,ve){var Ae=Ee(q,ve*i/R);return[ue*k/(y(Ae)*R*i*C(Ae)),I(Dt*F(Ae/Dt)/a)]},Dt===0&&(R=N(X/k),(te=function(ue,ve){return[ue*R,h(ve)/R]}).invert=function(ue,ve){return[ue/R,I(ve*R)]}),te}function Yr(){var xt=1,Tt=0,Dt=45*E,X=2,R=(0,b.U)(ii),i=R(xt,Tt,Dt,X);return i.a=function(a){return arguments.length?R(xt=+a,Tt,Dt,X):xt},i.b=function(a){return arguments.length?R(xt,Tt=+a,Dt,X):Tt},i.psiMax=function(a){return arguments.length?R(xt,Tt,Dt=+a*E,X):Dt*f},i.ratio=function(a){return arguments.length?R(xt,Tt,Dt,X=+a):X},i.scale(180.739)}function oi(xt,Tt,Dt,X,R,i,a,C,F,q,te){if(te.nanEncountered)return NaN;var ue,ve,Ae,Re,Ue,it,ct,dt,bt,Ct;if(ve=xt(Tt+.25*(ue=Dt-Tt)),Ae=xt(Dt-.25*ue),isNaN(ve))te.nanEncountered=!0;else{if(!isNaN(Ae))return Ct=((it=(Re=ue*(X+4*ve+R)/12)+(Ue=ue*(R+4*Ae+i)/12))-a)/15,q>F?(te.maxDepthCount++,it+Ct):Math.abs(Ct)Ae?Ue=it:Re=it,it=Re+Ue>>1;while(it>Re);var ct=F[it+1]-F[it];return ct&&(ct=(Ae-F[it+1])/ct),(it+1+ct)/a}var ue=2*te(1)/k*i/Dt,ve=function(Ae,Re){var Ue=te(d(h(Re))),it=X(Ue)*Ae;return Ue/=ue,[it,Re>=0?Ue:-Ue]};return ve.invert=function(Ae,Re){var Ue;return d(Re*=ue)<1&&(Ue=c(Re)*I(R(d(Re))*i)),[Ae/X(d(Re)),Ue]},ve}function Pa(){var xt=0,Tt=2.5,Dt=1.183136,X=(0,b.U)(Wi),R=X(xt,Tt,Dt);return R.alpha=function(i){return arguments.length?X(xt=+i,Tt,Dt):xt},R.k=function(i){return arguments.length?X(xt,Tt=+i,Dt):Tt},R.gamma=function(i){return arguments.length?X(xt,Tt,Dt=+i):Dt},R.scale(152.63)}function ji(xt,Tt){return d(xt[0]-Tt[0])ue[ve][2][0];++ve);var Re=xt(F-ue[ve][1][0],q);return Re[0]+=xt(ue[ve][1][0],te*q>te*ue[ve][0][1]?ue[ve][0][1]:q)[0],Re}Dt?i.invert=Dt(i):xt.invert&&(i.invert=function(F,q){for(var te=R[+(q<0)],ue=Tt[+(q<0)],ve=0,Ae=te.length;ve=0;--it)ue=(te=q[1][it])[0][0],ve=te[0][1],Ae=te[1][1],Re=te[2][0],Ue=te[2][1],ct.push(Vo([[Re-m,Ue-m],[Re-m,Ae+m],[ue+m,Ae+m],[ue+m,ve-m]],30));return{type:"Polygon",coordinates:[(0,tr.Am)(ct)]}}(F),Tt=F.map(function(q){return q.map(function(te){return[[te[0][0]*E,te[0][1]*E],[te[1][0]*E,te[1][1]*E],[te[2][0]*E,te[2][1]*E]]})}),R=Tt.map(function(q){return q.map(function(te){var ue,ve=xt(te[0][0],te[0][1])[0],Ae=xt(te[2][0],te[2][1])[0],Re=xt(te[1][0],te[0][1])[1],Ue=xt(te[1][0],te[1][1])[1];return Re>Ue&&(ue=Re,Re=Ue,Ue=ue),[[ve,Re],[Ae,Ue]]})}),a):Tt.map(function(q){return q.map(function(te){return[[te[0][0]*f,te[0][1]*f],[te[1][0]*f,te[1][1]*f],[te[2][0]*f,te[2][1]*f]]})})},Tt!=null&&a.lobes(Tt),a}Pr.invert=function(xt,Tt){return Tt>-Rr?Ve.invert(xt,Tt-$r):qe.invert(xt,Tt)},Jr.invert=function(xt,Tt){return d(Tt)>Rr?Ve.invert(xt,Tt+(Tt>0?$r:-$r)):qe.invert(xt,Tt)};var Oa=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function bs(){return Ha(ke,Oa).scale(160.857)}var lo=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ki(){return Ha(Jr,lo).scale(152.63)}var os=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function To(){return Ha(Ve,os).scale(169.529)}var fo=[[[[-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 Os(){return Ha(Ve,fo).scale(169.529).rotate([20,0])}var Ta=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function ws(){return Ha(Pr,Ta,Ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var Bl=[[[[-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 Ql(){return Ha(qe,Bl).scale(152.63).rotate([-20,0])}function ss(xt,Tt){return[3/M*xt*N(k*k/3-Tt*Tt),Tt]}function eu(){return(0,b.A)(ss).scale(158.837)}function vl(xt){function Tt(Dt,X){if(d(d(X)-A)2)return null;var i=(Dt/=2)*Dt,a=(X/=2)*X,C=2*X/(1+i+a);return C=o((1+C)/(1-C),1/xt),[w(2*Dt,1-i-a)/xt,I((C-1)/(C+1))]},Tt}function Za(){var xt=.5,Tt=(0,b.U)(vl),Dt=Tt(xt);return Dt.spacing=function(X){return arguments.length?Tt(xt=+X):xt},Dt.scale(124.75)}ss.invert=function(xt,Tt){return[M/3*xt/N(k*k/3-Tt*Tt),Tt]};var ko=k/T;function yl(xt,Tt){return[xt*(1+N(y(Tt)))/2,Tt/(y(Tt/2)*y(xt/6))]}function Ds(){return(0,b.A)(yl).scale(97.2672)}function Nl(xt,Tt){var Dt=xt*xt,X=Tt*Tt;return[xt*(.975534+X*(-.0143059*Dt-.119161+-.0547009*X)),Tt*(1.00384+Dt*(.0802894+-.02855*X+199025e-9*Dt)+X*(.0998909+-.0491032*X))]}function tu(){return(0,b.A)(Nl).scale(139.98)}function xl(xt,Tt){return[h(xt)/y(Tt),x(Tt)*y(xt)]}function jl(){return(0,b.A)(xl).scale(144.049).clipAngle(89.999)}function Ul(xt){var Tt=y(xt),Dt=x(v+xt/2);function X(R,i){var a=i-xt,C=d(a)=0;)ve=(ue=xt[te])[0]+F*(i=ve)-q*Ae,Ae=ue[1]+F*Ae+q*i;return[ve=F*(i=ve)-q*Ae,Ae=F*Ae+q*i]}return Dt.invert=function(X,R){var i=20,a=X,C=R;do{for(var F,q=Tt,te=xt[q],ue=te[0],ve=te[1],Ae=0,Re=0;--q>=0;)Ae=ue+a*(F=Ae)-C*Re,Re=ve+a*Re+C*F,ue=(te=xt[q])[0]+a*(F=ue)-C*ve,ve=te[1]+a*ve+C*F;var Ue,it,ct=(Ae=ue+a*(F=Ae)-C*Re)*Ae+(Re=ve+a*Re+C*F)*Re;a-=Ue=((ue=a*(F=ue)-C*ve-X)*Ae+(ve=a*ve+C*F-R)*Re)/ct,C-=it=(ve*Ae-ue*Re)/ct}while(d(Ue)+d(it)>m*m&&--i>0);if(i){var dt=N(a*a+C*C),bt=2*e(.5*dt),Ct=h(bt);return[w(a*Ct,dt*y(bt)),dt?I(C*Ct/dt):0]}},Dt}yl.invert=function(xt,Tt){var Dt=d(xt),X=d(Tt),R=m,i=A;Xm||d(it)>m)&&--R>0);return R&&[Dt,X]},xl.invert=function(xt,Tt){var Dt=xt*xt,X=Tt*Tt+1,R=Dt+X,i=xt?S*N((R-N(R*R-4*Dt))/Dt):1/N(X);return[I(xt*i),c(Tt)*B(i)]},vs.invert=function(xt,Tt){return[xt,2.5*e(_(.8*Tt))-.625*k]};var Su=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],pc=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Rs=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Vs=[[.9245,0],[0,0],[.01943,0]],Uu=[[.721316,0],[0,0],[-.00881625,-.00617325]];function gh(){return $a(Su,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Fo(){return $a(pc,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Qu(){return $a(Rs,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function oa(){return $a(Vs,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Mu(){return $a(Uu,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function $a(xt,Tt){var Dt=(0,b.A)(ju(xt)).rotate(Tt).clipAngle(90),X=(0,ft.A)(Tt),R=Dt.center;return delete Dt.rotate,Dt.center=function(i){return arguments.length?R(X(i)):X.invert(R())},Dt}var Ya=N(6),ys=N(7);function qs(xt,Tt){var Dt=I(7*h(Tt)/(3*Ya));return[Ya*xt*(2*y(2*Dt/3)-1)/ys,9*h(Dt/3)/ys]}function ec(){return(0,b.A)(qs).scale(164.859)}function ql(xt,Tt){for(var Dt,X=(1+S)*h(Tt),R=Tt,i=0;i<25&&(R-=Dt=(h(R/2)+h(R)-X)/(.5*y(R/2)+y(R)),!(d(Dt)g&&--C>0);return[xt/(.84719-.13063*(X=a*a)+(i=X*(R=X*X))*i*(.05494*X-.04515-.02326*R+.00331*i)),a]},Hs.invert=function(xt,Tt){for(var Dt=Tt/2,X=0,R=1/0;X<10&&d(R)>m;++X){var i=y(Tt/2);Tt-=R=(Tt-x(Tt/2)-Dt)/(1-.5/(i*i))}return[2*xt/(1+y(Tt)),Tt]};var tc=[[[[-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 nc(){return Ha(me(1/0),tc).rotate([20,0]).scale(152.63)}function rc(xt,Tt){var Dt=h(Tt),X=y(Tt),R=c(xt);if(xt===0||d(Tt)===A)return[0,Tt];if(Tt===0)return[xt,0];if(d(xt)===A)return[xt*X,A*Dt];var i=k/(2*xt)-2*xt/k,a=2*Tt/k,C=(1-a*a)/(Dt-a),F=i*i,q=C*C,te=1+F/q,ue=1+q/F,ve=(i*Dt/C-i/2)/te,Ae=(q*Dt/F+C/2)/ue,Re=Ae*Ae-(q*Dt*Dt/F+C*Dt-1)/ue;return[A*(ve+N(ve*ve+X*X/te)*R),A*(Ae+N(Re<0?0:Re)*c(-Tt*i)*R)]}function Qc(){return(0,b.A)(rc).scale(127.267)}rc.invert=function(xt,Tt){var Dt=(xt/=A)*xt,X=Dt+(Tt/=A)*Tt,R=k*k;return[xt?(X-1+N((1-X)*(1-X)+4*Dt))/(2*xt)*A:0,Ee(function(i){return X*(k*h(i)-2*i)*k+4*i*i*(Tt-h(i))+2*k*i-R*Tt},0)]};var _l=1.0148,Hl=.23185,Gs=-.14499,pr=.02406,Dr=_l,Zr=5*Hl,Li=7*Gs,ia=9*pr,sa=1.790857183;function po(xt,Tt){var Dt=Tt*Tt;return[xt,Tt*(_l+Dt*Dt*(Hl+Dt*(Gs+pr*Dt)))]}function ro(){return(0,b.A)(po).scale(139.319)}function mu(xt,Tt){if(d(Tt)sa?Tt=sa:Tt<-1.790857183&&(Tt=-1.790857183);var Dt,X=Tt;do{var R=X*X;X-=Dt=(X*(_l+R*R*(Hl+R*(Gs+pr*R)))-Tt)/(Dr+R*R*(Zr+R*(Li+ia*R)))}while(d(Dt)>m);return[xt,X]},mu.invert=function(xt,Tt){if(d(Tt)m&&--i>0);return a=x(R),[(d(Tt)=0;)if(Qt=Ut[Mn],It[0]===Qt[0]&&It[1]===Qt[1]){if(Yt)return[Yt,It];Yt=It}}}(F.face,q.face),ue=(Ue=te.map(q.project),it=te.map(F.project),ct=Zs(Ue[1],Ue[0]),dt=Zs(it[1],it[0]),bt=function(Mt,Ut){return w(Mt[0]*Ut[1]-Mt[1]*Ut[0],Mt[0]*Ut[0]+Mt[1]*Ut[1])}(ct,dt),Ct=vu(ct)/vu(dt),bl([1,0,Ue[0][0],0,1,Ue[0][1]],bl([Ct,0,0,0,Ct,0],bl([y(bt),h(bt),0,-h(bt),y(bt),0],[1,0,-it[0][0],0,1,-it[0][1]]))));F.transform=q.transform?bl(q.transform,ue):ue;for(var ve=q.edges,Ae=0,Re=ve.length;Ae0?[-X[0],0]:[180-X[0],180])};var Tt=wl.map(function(Dt){return{face:Dt,project:xt(Dt)}});return[-1,0,0,1,0,1,4,5].forEach(function(Dt,X){var R=Tt[Dt];R&&(R.children||(R.children=[])).push(Tt[X])}),La(Tt[0],function(Dt,X){return Tt[Dt<-k/2?X<0?6:4:Dt<0?X<0?2:0:DtF^dt>F&&C<(ct-Re)*(F-Ue)/(dt-Ue)+Re&&(q=!q)}return q}(R[0],X))return R.push(Dt),!0})||xt.push([Dt])}),Ko=[],xt.length?xt.length>1?{type:"MultiPolygon",coordinates:xt}:{type:"Polygon",coordinates:xt[0]}:null}};function Zl(xt){var Tt=xt(A,0)[0]-xt(-A,0)[0];function Dt(X,R){var i=d(X)0?X-k:X+k,R),C=(a[0]-a[1])*S,F=(a[0]+a[1])*S;if(i)return[C,F];var q=Tt*S,te=C>0^F>0?-1:1;return[te*C-c(F)*q,te*F-c(C)*q]}return xt.invert&&(Dt.invert=function(X,R){var i=(X+R)*S,a=(R-X)*S,C=d(i)<.5*Tt&&d(a)<.5*Tt;if(!C){var F=Tt*S,q=i>0^a>0?-1:1,te=-q*X+(a>0?1:-1)*F,ue=-q*R+(i>0?1:-1)*F;i=(-te-ue)*S,a=(te-ue)*S}var ve=xt.invert(i,a);return C||(ve[0]+=i>0?k:-k),ve}),(0,b.A)(Dt).rotate([-90,-90,45]).clipAngle(179.999)}function _s(){return Zl(Er).scale(176.423)}function yu(){return Zl(Yn).scale(111.48)}function ru(xt,Tt){if(!(0<=(Tt=+Tt)&&Tt<=20))throw new Error("invalid digits");function Dt(q){var te=q.length,ue=2,ve=new Array(te);for(ve[0]=+q[0].toFixed(Tt),ve[1]=+q[1].toFixed(Tt);ue2||Ae[0]!=te[0]||Ae[1]!=te[1])&&(ue.push(Ae),te=Ae)}return ue.length===1&&q.length>1&&ue.push(Dt(q[q.length-1])),ue}function i(q){return q.map(R)}function a(q){if(q==null)return q;var te;switch(q.type){case"GeometryCollection":te={type:"GeometryCollection",geometries:q.geometries.map(a)};break;case"Point":te={type:"Point",coordinates:Dt(q.coordinates)};break;case"MultiPoint":te={type:q.type,coordinates:X(q.coordinates)};break;case"LineString":te={type:q.type,coordinates:R(q.coordinates)};break;case"MultiLineString":case"Polygon":te={type:q.type,coordinates:i(q.coordinates)};break;case"MultiPolygon":te={type:"MultiPolygon",coordinates:q.coordinates.map(i)};break;default:return q}return q.bbox!=null&&(te.bbox=q.bbox),te}function C(q){var te={type:"Feature",properties:q.properties,geometry:a(q.geometry)};return q.id!=null&&(te.id=q.id),q.bbox!=null&&(te.bbox=q.bbox),te}if(xt!=null)switch(xt.type){case"Feature":return C(xt);case"FeatureCollection":var F={type:"FeatureCollection",features:xt.features.map(C)};return xt.bbox!=null&&(F.bbox=xt.bbox),F;default:return a(xt)}return xt}function Tl(xt){var Tt=h(xt);function Dt(X,R){var i=Tt?x(X*Tt/2)/Tt:X/2;if(!R)return[2*i,-xt];var a=2*e(i*h(R)),C=1/x(R);return[h(a)*C,R+(1-y(a))*C-xt]}return Dt.invert=function(X,R){if(d(R+=xt)m&&--F>0);var ve=X*(q=x(C)),Ae=x(d(R)0?A:-A)*(q+i*(ue-C)/2+i*i*(ue-2*q+C)/2)]}function Mi(){return(0,b.A)(kl).scale(152.63)}function Hu(xt,Tt){var Dt=function(a){function C(F,q){var te=y(q),ue=(a-1)/(a-te*y(F));return[ue*te*h(F),ue*h(q)]}return C.invert=function(F,q){var te=F*F+q*q,ue=N(te),ve=(a-N(1-te*(a+1)/(a-1)))/((a-1)/ue+ue/(a-1));return[w(F*ve,ue*N(1-ve*ve)),ue?I(q*ve/ue):0]},C}(xt);if(!Tt)return Dt;var X=y(Tt),R=h(Tt);function i(a,C){var F=Dt(a,C),q=F[1],te=q*R/(xt-1)+X;return[F[0]*X/te,q/te]}return i.invert=function(a,C){var F=(xt-1)/(xt-1-C*R);return Dt.invert(F*a,F*C*X)},i}function Ac(){var xt=2,Tt=0,Dt=(0,b.U)(Hu),X=Dt(xt,Tt);return X.distance=function(R){return arguments.length?Dt(xt=+R,Tt):xt},X.tilt=function(R){return arguments.length?Dt(xt,Tt=R*E):Tt*f},X.scale(432.147).clipAngle(B(1/xt)*f-1e-6)}ua.forEach(function(xt){xt[1]*=1.0144}),kl.invert=function(xt,Tt){var Dt=Tt/A,X=90*Dt,R=l(18,d(X/5)),i=n(0,u(R));do{var a=ua[i][1],C=ua[i+1][1],F=ua[l(19,i+2)][1],q=F-a,te=F-2*C+a,ue=2*(d(Dt)-C)/q,ve=te/q,Ae=ue*(1-ve*ue*(1-2*ve*ue));if(Ae>=0||i===1){X=(Tt>=0?5:-5)*(Ae+R);var Re,Ue=50;do Ae=(R=l(18,d(X)/5))-(i=u(R)),a=ua[i][1],C=ua[i+1][1],F=ua[l(19,i+2)][1],X-=(Re=(Tt>=0?A:-A)*(C+Ae*(F-a)/2+Ae*Ae*(F-2*C+a)/2)-Tt)*f;while(d(Re)>g&&--Ue>0);break}}while(--i>=0);var it=ua[i][0],ct=ua[i+1][0],dt=ua[l(19,i+2)][0];return[xt/(ct+Ae*(dt-it)/2+Ae*Ae*(dt-2*ct+it)/2),X*E]};var Al=1e-4,il=1e4,Sl=-180,Ml=Sl+Al,li=180,hs=li-Al,al=-90,Na=al+Al,Ns=90,iu=Ns-Al;function El(xt){return xt.length>0}function ks(xt){return xt===al||xt===Ns?[0,xt]:[Sl,(Tt=xt,Math.floor(Tt*il)/il)];var Tt}function au(xt){var Tt=xt[0],Dt=xt[1],X=!1;return Tt<=Ml?(Tt=Sl,X=!0):Tt>=hs&&(Tt=li,X=!0),Dt<=Na?(Dt=al,X=!0):Dt>=iu&&(Dt=Ns,X=!0),X?[Tt,Dt]:xt}function As(xt){return xt.map(au)}function Jo(xt,Tt,Dt){for(var X=0,R=xt.length;X=hs||te<=Na||te>=iu){i[a]=au(F);for(var ue=a+1;ueMl&&AeNa&&Re=C)break;Dt.push({index:-1,polygon:Tt,ring:i=i.slice(ue-1)}),i[0]=ks(i[0][1]),a=-1,C=i.length}}}}function ol(xt){var Tt,Dt,X,R,i,a,C=xt.length,F={},q={};for(Tt=0;Tt0?k-C:C)*f],q=(0,b.A)(xt(a)).rotate(F),te=(0,ft.A)(F),ue=q.center;return delete q.rotate,q.center=function(ve){return arguments.length?ue(te(ve)):te.invert(ue())},q.clipAngle(90)}function ac(xt){var Tt=y(xt);function Dt(X,R){var i=(0,Aa.T)(X,R);return i[0]*=Tt,i}return Dt.invert=function(X,R){return Aa.T.invert(X/Tt,R)},Dt}function yi(){return Io([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Io(xt,Tt){return Qo(ac,xt,Tt)}function za(xt){if(!(xt*=2))return oe.j;var Tt=-xt/2,Dt=-Tt,X=xt*xt,R=x(Dt),i=.5/h(Dt);function a(C,F){var q=B(y(F)*y(C-Tt)),te=B(y(F)*y(C-Dt));return[((q*=q)-(te*=te))/(2*xt),(F<0?-1:1)*N(4*X*te-(X-q+te)*(X-q+te))/(2*xt)]}return a.invert=function(C,F){var q,te,ue=F*F,ve=y(N(ue+(q=C+Tt)*q)),Ae=y(N(ue+(q=C+Dt)*q));return[w(te=ve-Ae,q=(ve+Ae)*R),(F<0?-1:1)*B(N(q*q+te*te)*i)]},a}function xu(){return sl([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function sl(xt,Tt){return Qo(za,xt,Tt)}function $l(xt,Tt){if(d(Tt)m&&--C>0);return[c(xt)*(N(R*R+4)+R)*k/4,A*a]};var ho=4*k+3*N(3),_u=2*N(2*k*N(3)/ho),da=Ie(_u*N(3)/k,_u,ho/6);function Ys(){return(0,b.A)(da).scale(176.84)}function Ai(xt,Tt){return[xt*N(1-3*Tt*Tt/(k*k)),Tt]}function xi(){return(0,b.A)(Ai).scale(152.63)}function xa(xt,Tt){var Dt=y(Tt),X=y(xt)*Dt,R=1-X,i=y(xt=w(h(xt)*Dt,-h(Tt))),a=h(xt);return[a*(Dt=N(1-X*X))-i*R,-i*Dt-a*R]}function es(){return(0,b.A)(xa).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)}function bu(xt,Tt){var Dt=H(xt,Tt);return[(Dt[0]+xt/A)/2,(Dt[1]+Tt)/2]}function js(){return(0,b.A)(bu).scale(158.837)}Ai.invert=function(xt,Tt){return[xt/N(1-3*Tt*Tt/(k*k)),Tt]},xa.invert=function(xt,Tt){var Dt=(xt*xt+Tt*Tt)/-2,X=N(-Dt*(2+Dt)),R=Tt*Dt+xt*X,i=xt*Dt-Tt*X,a=N(i*i+R*R);return[w(X*R,a*(1+Dt)),a?-I(X*i/a):0]},bu.invert=function(xt,Tt){var Dt=xt,X=Tt,R=25;do{var i,a=y(X),C=h(X),F=h(2*X),q=C*C,te=a*a,ue=h(Dt),ve=y(Dt/2),Ae=h(Dt/2),Re=Ae*Ae,Ue=1-te*ve*ve,it=Ue?B(a*ve)*N(i=1/Ue):i=0,ct=.5*(2*it*a*Ae+Dt/A)-xt,dt=.5*(it*C+X)-Tt,bt=.5*i*(te*Re+it*a*ve*q)+.5/A,Ct=i*(ue*F/4-it*C*Ae),Mt=.125*i*(F*Ae-it*C*te*ue),Ut=.5*i*(q*ve+it*Re*a)+.5,It=Ct*Mt-Ut*bt,Qt=(dt*Ct-ct*Ut)/It,tn=(ct*Mt-dt*bt)/It;Dt-=Qt,X-=tn}while((d(Qt)>m||d(tn)>m)&&--R>0);return[Dt,X]}},49353:function(D,L,t){function b(){return new d}function d(){this.reset()}t.d(L,{A:function(){return b}}),d.prototype={constructor:d,reset:function(){this.s=this.t=0},add:function(y){w(e,y,this.t),w(this,e.s,this.s),this.s?this.t+=e.t:this.s=e.t},valueOf:function(){return this.s}};var e=new d;function w(y,_,u){var r=y.s=_+u,n=r-_,l=r-n;y.t=_-l+(u-n)}},43976:function(D,L,t){t.d(L,{Ay:function(){return g},B0:function(){return l},Y7:function(){return s}});var b,d,e,w,y,_=t(49353),u=t(61323),r=t(53341),n=t(20465),l=(0,_.A)(),o=(0,_.A)(),s={point:r.A,lineStart:r.A,lineEnd:r.A,polygonStart:function(){l.reset(),s.lineStart=c,s.lineEnd=h},polygonEnd:function(){var k=+l;o.add(k<0?u.FA+k:k),this.lineStart=this.lineEnd=this.point=r.A},sphere:function(){o.add(u.FA)}};function c(){s.point=x}function h(){m(b,d)}function x(k,A){s.point=m,b=k,d=A,k*=u.F2,A*=u.F2,e=k,w=(0,u.gn)(A=A/2+u.gz),y=(0,u.F8)(A)}function m(k,A){k*=u.F2,A=(A*=u.F2)/2+u.gz;var v=k-e,S=v>=0?1:-1,T=S*v,p=(0,u.gn)(A),M=(0,u.F8)(A),f=y*M,E=w*p+f*(0,u.gn)(T),I=f*S*(0,u.F8)(T);l.add((0,u.FP)(I,E)),e=k,w=p,y=M}function g(k){return o.reset(),(0,n.A)(k,s),2*o}},43212:function(D,L,t){t.d(L,{A:function(){return B}});var b,d,e,w,y,_,u,r,n,l,o=t(49353),s=t(43976),c=t(20375),h=t(61323),x=t(20465),m=(0,o.A)(),g={point:k,lineStart:v,lineEnd:S,polygonStart:function(){g.point=T,g.lineStart=p,g.lineEnd=M,m.reset(),s.Y7.polygonStart()},polygonEnd:function(){s.Y7.polygonEnd(),g.point=k,g.lineStart=v,g.lineEnd=S,s.B0<0?(b=-(e=180),d=-(w=90)):m>h.Ni?w=90:m<-h.Ni&&(d=-90),l[0]=b,l[1]=e},sphere:function(){b=-(e=180),d=-(w=90)}};function k(N,V){n.push(l=[b=N,e=N]),Vw&&(w=V)}function A(N,V){var j=(0,c.jf)([N*h.F2,V*h.F2]);if(r){var $=(0,c.r8)(r,j),ee=[$[1],-$[0],0],H=(0,c.r8)(ee,$);(0,c.Cx)(H),H=(0,c.EV)(H);var J,Q=N-y,Z=Q>0?1:-1,K=H[0]*h.uj*Z,ae=(0,h.tn)(Q)>180;ae^(Z*yw&&(w=J):ae^(Z*y<(K=(K+360)%360-180)&&Kw&&(w=V)),ae?Nf(b,e)&&(e=N):f(N,e)>f(b,e)&&(b=N):e>=b?(Ne&&(e=N)):N>y?f(b,N)>f(b,e)&&(e=N):f(N,e)>f(b,e)&&(b=N)}else n.push(l=[b=N,e=N]);Vw&&(w=V),r=j,y=N}function v(){g.point=A}function S(){l[0]=b,l[1]=e,g.point=k,r=null}function T(N,V){if(r){var j=N-y;m.add((0,h.tn)(j)>180?j+(j>0?360:-360):j)}else _=N,u=V;s.Y7.point(N,V),A(N,V)}function p(){s.Y7.lineStart()}function M(){T(_,u),s.Y7.lineEnd(),(0,h.tn)(m)>h.Ni&&(b=-(e=180)),l[0]=b,l[1]=e,r=null}function f(N,V){return(V-=N)<0?V+360:V}function E(N,V){return N[0]-V[0]}function I(N,V){return N[0]<=N[1]?N[0]<=V&&V<=N[1]:Vf($[0],$[1])&&($[1]=ee[1]),f(ee[0],$[1])>f($[0],$[1])&&($[0]=ee[0])):H.push($=ee);for(J=-1/0,V=0,$=H[j=H.length-1];V<=j;$=ee,++V)ee=H[V],(Q=f($[1],ee[0]))>J&&(J=Q,b=ee[0],e=$[1])}return n=l=null,b===1/0||d===1/0?[[NaN,NaN],[NaN,NaN]]:[[b,d],[e,w]]}},20375:function(D,L,t){t.d(L,{Cx:function(){return r},EV:function(){return d},W8:function(){return w},ep:function(){return _},jf:function(){return e},ly:function(){return u},r8:function(){return y}});var b=t(61323);function d(n){return[(0,b.FP)(n[1],n[0]),(0,b.qR)(n[2])]}function e(n){var l=n[0],o=n[1],s=(0,b.gn)(o);return[s*(0,b.gn)(l),s*(0,b.F8)(l),(0,b.F8)(o)]}function w(n,l){return n[0]*l[0]+n[1]*l[1]+n[2]*l[2]}function y(n,l){return[n[1]*l[2]-n[2]*l[1],n[2]*l[0]-n[0]*l[2],n[0]*l[1]-n[1]*l[0]]}function _(n,l){n[0]+=l[0],n[1]+=l[1],n[2]+=l[2]}function u(n,l){return[n[0]*l,n[1]*l,n[2]*l]}function r(n){var l=(0,b.RZ)(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=l,n[1]/=l,n[2]/=l}},30021:function(D,L,t){t.d(L,{A:function(){return j}});var b,d,e,w,y,_,u,r,n,l,o,s,c,h,x,m,g=t(61323),k=t(53341),A=t(20465),v={sphere:k.A,point:S,lineStart:p,lineEnd:E,polygonStart:function(){v.lineStart=I,v.lineEnd=B},polygonEnd:function(){v.lineStart=p,v.lineEnd=E}};function S($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee);T(H*(0,g.gn)($),H*(0,g.F8)($),(0,g.F8)(ee))}function T($,ee,H){++b,e+=($-e)/b,w+=(ee-w)/b,y+=(H-y)/b}function p(){v.point=M}function M($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee);h=H*(0,g.gn)($),x=H*(0,g.F8)($),m=(0,g.F8)(ee),v.point=f,T(h,x,m)}function f($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee),J=H*(0,g.gn)($),Q=H*(0,g.F8)($),Z=(0,g.F8)(ee),K=(0,g.FP)((0,g.RZ)((K=x*Z-m*Q)*K+(K=m*J-h*Z)*K+(K=h*Q-x*J)*K),h*J+x*Q+m*Z);d+=K,_+=K*(h+(h=J)),u+=K*(x+(x=Q)),r+=K*(m+(m=Z)),T(h,x,m)}function E(){v.point=S}function I(){v.point=N}function B(){V(s,c),v.point=S}function N($,ee){s=$,c=ee,$*=g.F2,ee*=g.F2,v.point=V;var H=(0,g.gn)(ee);h=H*(0,g.gn)($),x=H*(0,g.F8)($),m=(0,g.F8)(ee),T(h,x,m)}function V($,ee){$*=g.F2,ee*=g.F2;var H=(0,g.gn)(ee),J=H*(0,g.gn)($),Q=H*(0,g.F8)($),Z=(0,g.F8)(ee),K=x*Z-m*Q,ae=m*J-h*Z,se=h*Q-x*J,he=(0,g.RZ)(K*K+ae*ae+se*se),fe=(0,g.qR)(he),ie=he&&-fe/he;n+=ie*K,l+=ie*ae,o+=ie*se,d+=fe,_+=fe*(h+(h=J)),u+=fe*(x+(x=Q)),r+=fe*(m+(m=Z)),T(h,x,m)}function j($){b=d=e=w=y=_=u=r=n=l=o=0,(0,A.A)($,v);var ee=n,H=l,J=o,Q=ee*ee+H*H+J*J;return Q0?sc)&&(s+=o*e.FA));for(var g,k=s;o>0?k>c:k0?d.pi:-d.pi,o=(0,d.tn)(r-y);(0,d.tn)(o-d.pi)0?d.TW:-d.TW),e.point(u,_),e.lineEnd(),e.lineStart(),e.point(l,_),e.point(r,_),w=0):u!==l&&o>=d.pi&&((0,d.tn)(y-u)d.Ni?(0,d.rY)(((0,d.F8)(c)*(g=(0,d.gn)(x))*(0,d.F8)(h)-(0,d.F8)(x)*(m=(0,d.gn)(c))*(0,d.F8)(s))/(m*g*k)):(c+x)/2}(y,_,r,n),e.point(u,_),e.lineEnd(),e.lineStart(),e.point(l,_),w=0),e.point(y=r,_=n),u=l},lineEnd:function(){e.lineEnd(),y=_=NaN},clean:function(){return 2-w}}},function(e,w,y,_){var u;if(e==null)u=y*d.TW,_.point(-d.pi,u),_.point(0,u),_.point(d.pi,u),_.point(d.pi,0),_.point(d.pi,-u),_.point(0,-u),_.point(-d.pi,-u),_.point(-d.pi,0),_.point(-d.pi,u);else if((0,d.tn)(e[0]-w[0])>d.Ni){var r=e[0]1&&w.push(w.pop().concat(w.shift()))},result:function(){var y=w;return w=[],e=null,y}}}},47402:function(D,L,t){t.d(L,{A:function(){return _}});var b=t(20375),d=t(39127),e=t(61323),w=t(28759),y=t(13720);function _(u){var r=(0,e.gn)(u),n=6*e.F2,l=r>0,o=(0,e.tn)(r)>e.Ni;function s(x,m){return(0,e.gn)(x)*(0,e.gn)(m)>r}function c(x,m,g){var k=(0,b.jf)(x),A=(0,b.jf)(m),v=[1,0,0],S=(0,b.r8)(k,A),T=(0,b.W8)(S,S),p=S[0],M=T-p*p;if(!M)return!g&&x;var f=r*T/M,E=-r*p/M,I=(0,b.r8)(v,S),B=(0,b.ly)(v,f),N=(0,b.ly)(S,E);(0,b.ep)(B,N);var V=I,j=(0,b.W8)(B,V),$=(0,b.W8)(V,V),ee=j*j-$*((0,b.W8)(B,B)-1);if(!(ee<0)){var H=(0,e.RZ)(ee),J=(0,b.ly)(V,(-j-H)/$);if((0,b.ep)(J,B),J=(0,b.EV)(J),!g)return J;var Q,Z=x[0],K=m[0],ae=x[1],se=m[1];K0^J[1]<((0,e.tn)(J[0]-Z)e.pi^(Z<=J[0]&&J[0]<=K)){var ie=(0,b.ly)(V,(-j+H)/$);return(0,b.ep)(ie,B),[J,(0,b.EV)(ie)]}}}function h(x,m){var g=l?u:e.pi-u,k=0;return x<-g?k|=1:x>g&&(k|=2),m<-g?k|=4:m>g&&(k|=8),k}return(0,y.A)(s,function(x){var m,g,k,A,v;return{lineStart:function(){A=k=!1,v=1},point:function(S,T){var p,M=[S,T],f=s(S,T),E=l?f?0:h(S,T):f?h(S+(S<0?e.pi:-e.pi),T):0;if(!m&&(A=k=f)&&x.lineStart(),f!==k&&(!(p=c(m,M))||(0,w.A)(m,p)||(0,w.A)(M,p))&&(M[2]=1),f!==k)v=0,f?(x.lineStart(),p=c(M,m),x.point(p[0],p[1])):(p=c(m,M),x.point(p[0],p[1],2),x.lineEnd()),m=p;else if(o&&m&&l^f){var I;E&g||!(I=c(M,m,!0))||(v=0,l?(x.lineStart(),x.point(I[0][0],I[0][1]),x.point(I[1][0],I[1][1]),x.lineEnd()):(x.point(I[1][0],I[1][1]),x.lineEnd(),x.lineStart(),x.point(I[0][0],I[0][1],3)))}!f||m&&(0,w.A)(m,M)||x.point(M[0],M[1]),m=M,k=f,g=E},lineEnd:function(){k&&x.lineEnd(),m=null},clean:function(){return v|(A&&k)<<1}}},function(x,m,g,k){(0,d.J)(k,u,n,g,x,m)},l?[0,-u]:[-e.pi,u-e.pi])}},13720:function(D,L,t){t.d(L,{A:function(){return _}});var b=t(39608),d=t(19119),e=t(61323),w=t(2274),y=t(29725);function _(n,l,o,s){return function(c){var h,x,m,g=l(c),k=(0,b.A)(),A=l(k),v=!1,S={point:T,lineStart:M,lineEnd:f,polygonStart:function(){S.point=E,S.lineStart=I,S.lineEnd=B,x=[],h=[]},polygonEnd:function(){S.point=T,S.lineStart=M,S.lineEnd=f,x=(0,y.Am)(x);var N=(0,w.A)(h,s);x.length?(v||(c.polygonStart(),v=!0),(0,d.A)(x,r,N,o,c)):N&&(v||(c.polygonStart(),v=!0),c.lineStart(),o(null,null,1,c),c.lineEnd()),v&&(c.polygonEnd(),v=!1),x=h=null},sphere:function(){c.polygonStart(),c.lineStart(),o(null,null,1,c),c.lineEnd(),c.polygonEnd()}};function T(N,V){n(N,V)&&c.point(N,V)}function p(N,V){g.point(N,V)}function M(){S.point=p,g.lineStart()}function f(){S.point=T,g.lineEnd()}function E(N,V){m.push([N,V]),A.point(N,V)}function I(){A.lineStart(),m=[]}function B(){E(m[0][0],m[0][1]),A.lineEnd();var N,V,j,$,ee=A.clean(),H=k.result(),J=H.length;if(m.pop(),h.push(m),m=null,J)if(1&ee){if((V=(j=H[0]).length-1)>0){for(v||(c.polygonStart(),v=!0),c.lineStart(),N=0;N1&&2&ee&&H.push(H.pop().concat(H.shift())),x.push(H.filter(u))}return S}}function u(n){return n.length>1}function r(n,l){return((n=n.x)[0]<0?n[1]-e.TW-e.Ni:e.TW-n[1])-((l=l.x)[0]<0?l[1]-e.TW-e.Ni:e.TW-l[1])}},21503:function(D,L,t){t.d(L,{A:function(){return u}});var b=t(61323),d=t(39608),e=t(19119),w=t(29725),y=1e9,_=-y;function u(r,n,l,o){function s(g,k){return r<=g&&g<=l&&n<=k&&k<=o}function c(g,k,A,v){var S=0,T=0;if(g==null||(S=h(g,A))!==(T=h(k,A))||m(g,k)<0^A>0)do v.point(S===0||S===3?r:l,S>1?o:n);while((S=(S+A+4)%4)!==T);else v.point(k[0],k[1])}function h(g,k){return(0,b.tn)(g[0]-r)0?0:3:(0,b.tn)(g[0]-l)0?2:1:(0,b.tn)(g[1]-n)0?1:0:k>0?3:2}function x(g,k){return m(g.x,k.x)}function m(g,k){var A=h(g,1),v=h(k,1);return A!==v?A-v:A===0?k[1]-g[1]:A===1?g[0]-k[0]:A===2?g[1]-k[1]:k[0]-g[0]}return function(g){var k,A,v,S,T,p,M,f,E,I,B,N=g,V=(0,d.A)(),j={point:$,lineStart:function(){j.point=ee,A&&A.push(v=[]),I=!0,E=!1,M=f=NaN},lineEnd:function(){k&&(ee(S,T),p&&E&&V.rejoin(),k.push(V.result())),j.point=$,E&&N.lineEnd()},polygonStart:function(){N=V,k=[],A=[],B=!0},polygonEnd:function(){var H=function(){for(var Z=0,K=0,ae=A.length;Ko&&(ge-se)*(o-he)>(ye-he)*(r-se)&&++Z:ye<=o&&(ge-se)*(o-he)<(ye-he)*(r-se)&&--Z;return Z}(),J=B&&H,Q=(k=(0,w.Am)(k)).length;(J||Q)&&(g.polygonStart(),J&&(g.lineStart(),c(null,null,1,g),g.lineEnd()),Q&&(0,e.A)(k,x,H,c,g),g.polygonEnd()),N=g,k=A=v=null}};function $(H,J){s(H,J)&&N.point(H,J)}function ee(H,J){var Q=s(H,J);if(A&&v.push([H,J]),I)S=H,T=J,p=Q,I=!1,Q&&(N.lineStart(),N.point(H,J));else if(Q&&E)N.point(H,J);else{var Z=[M=Math.max(_,Math.min(y,M)),f=Math.max(_,Math.min(y,f))],K=[H=Math.max(_,Math.min(y,H)),J=Math.max(_,Math.min(y,J))];(function(ae,se,he,fe,ie,oe){var le,ge=ae[0],ye=ae[1],me=0,be=1,Se=se[0]-ge,Ee=se[1]-ye;if(le=he-ge,Se||!(le>0)){if(le/=Se,Se<0){if(le0){if(le>be)return;le>me&&(me=le)}if(le=ie-ge,Se||!(le<0)){if(le/=Se,Se<0){if(le>be)return;le>me&&(me=le)}else if(Se>0){if(le0)){if(le/=Ee,Ee<0){if(le0){if(le>be)return;le>me&&(me=le)}if(le=oe-ye,Ee||!(le<0)){if(le/=Ee,Ee<0){if(le>be)return;le>me&&(me=le)}else if(Ee>0){if(le0&&(ae[0]=ge+me*Se,ae[1]=ye+me*Ee),be<1&&(se[0]=ge+be*Se,se[1]=ye+be*Ee),!0}}}}})(Z,K,r,n,l,o)?(E||(N.lineStart(),N.point(Z[0],Z[1])),N.point(K[0],K[1]),Q||N.lineEnd(),B=!1):Q&&(N.lineStart(),N.point(H,J),B=!1)}M=H,f=J,E=Q}return j}}},19119:function(D,L,t){t.d(L,{A:function(){return w}});var b=t(28759),d=t(61323);function e(_,u,r,n){this.x=_,this.z=u,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function w(_,u,r,n,l){var o,s,c=[],h=[];if(_.forEach(function(v){if(!((S=v.length-1)<=0)){var S,T,p=v[0],M=v[S];if((0,b.A)(p,M)){if(!p[2]&&!M[2]){for(l.lineStart(),o=0;o=0;--o)l.point((m=x[o])[0],m[1]);else n(k.x,k.p.x,-1,l);k=k.p}x=(k=k.o).z,A=!A}while(!k.v);l.lineEnd()}}}function y(_){if(u=_.length){for(var u,r,n=0,l=_[0];++n0&&(cr=f(kn[Ir],kn[Ir-1]))>0&&ur<=cr&&Zn<=cr&&(ur+Zn-cr)*(1-Math.pow((ur-Zn)/cr,2))h.Ni}).map(ai)).concat((0,J.y1)((0,h.mk)(Ir/gn)*gn,cr,gn).filter(function(dn){return(0,h.tn)(dn%Un)>h.Ni}).map(bn))}return Wn.lines=function(){return Bn().map(function(dn){return{type:"LineString",coordinates:dn}})},Wn.outline=function(){return{type:"Polygon",coordinates:[Yn(Zn).concat(an(Er).slice(1),Yn(ur).reverse().slice(1),an(Xr).reverse().slice(1))]}},Wn.extent=function(dn){return arguments.length?Wn.extentMajor(dn).extentMinor(dn):Wn.extentMinor()},Wn.extentMajor=function(dn){return arguments.length?(Zn=+dn[0][0],ur=+dn[1][0],Xr=+dn[0][1],Er=+dn[1][1],Zn>ur&&(dn=Zn,Zn=ur,ur=dn),Xr>Er&&(dn=Xr,Xr=Er,Er=dn),Wn.precision(tr)):[[Zn,Xr],[ur,Er]]},Wn.extentMinor=function(dn){return arguments.length?(Cn=+dn[0][0],kn=+dn[1][0],Ir=+dn[0][1],cr=+dn[1][1],Cn>kn&&(dn=Cn,Cn=kn,kn=dn),Ir>cr&&(dn=Ir,Ir=cr,cr=dn),Wn.precision(tr)):[[Cn,Ir],[kn,cr]]},Wn.step=function(dn){return arguments.length?Wn.stepMajor(dn).stepMinor(dn):Wn.stepMinor()},Wn.stepMajor=function(dn){return arguments.length?(qn=+dn[0],Un=+dn[1],Wn):[qn,Un]},Wn.stepMinor=function(dn){return arguments.length?(_n=+dn[0],gn=+dn[1],Wn):[_n,gn]},Wn.precision=function(dn){return arguments.length?(tr=+dn,ai=Q(Ir,cr,90),bn=Z(Cn,kn,tr),Yn=Q(Xr,Er,90),an=Z(Zn,ur,tr),Wn):tr},Wn.extentMajor([[-180,-90+h.Ni],[180,90-h.Ni]]).extentMinor([[-180,-80-h.Ni],[180,80+h.Ni]])}function ae(){return K()()}var se,he,fe,ie,oe=t(81758),le=t(26827),ge=(0,c.A)(),ye=(0,c.A)(),me={point:x.A,lineStart:x.A,lineEnd:x.A,polygonStart:function(){me.lineStart=be,me.lineEnd=Ce},polygonEnd:function(){me.lineStart=me.lineEnd=me.point=x.A,ge.add((0,h.tn)(ye)),ye.reset()},result:function(){var kn=ge/2;return ge.reset(),kn}};function be(){me.point=Se}function Se(kn,Cn){me.point=Ee,se=fe=kn,he=ie=Cn}function Ee(kn,Cn){ye.add(ie*kn-fe*Cn),fe=kn,ie=Cn}function Ce(){Ee(se,he)}var Le,Oe,We,Ie,Ve=me,Pe=t(33028),de=0,Me=0,ke=0,He=0,Fe=0,qe=0,$e=0,Ye=0,_e=0,De={point:Be,lineStart:Ge,lineEnd:ft,polygonStart:function(){De.lineStart=At,De.lineEnd=kt},polygonEnd:function(){De.point=Be,De.lineStart=Ge,De.lineEnd=ft},result:function(){var kn=_e?[$e/_e,Ye/_e]:qe?[He/qe,Fe/qe]:ke?[de/ke,Me/ke]:[NaN,NaN];return de=Me=ke=He=Fe=qe=$e=Ye=_e=0,kn}};function Be(kn,Cn){de+=kn,Me+=Cn,++ke}function Ge(){De.point=tt}function tt(kn,Cn){De.point=nt,Be(We=kn,Ie=Cn)}function nt(kn,Cn){var ur=kn-We,Zn=Cn-Ie,cr=(0,h.RZ)(ur*ur+Zn*Zn);He+=cr*(We+kn)/2,Fe+=cr*(Ie+Cn)/2,qe+=cr,Be(We=kn,Ie=Cn)}function ft(){De.point=Be}function At(){De.point=Vt}function kt(){Ht(Le,Oe)}function Vt(kn,Cn){De.point=Ht,Be(Le=We=kn,Oe=Ie=Cn)}function Ht(kn,Cn){var ur=kn-We,Zn=Cn-Ie,cr=(0,h.RZ)(ur*ur+Zn*Zn);He+=cr*(We+kn)/2,Fe+=cr*(Ie+Cn)/2,qe+=cr,$e+=(cr=Ie*kn-We*Cn)*(We+kn),Ye+=cr*(Ie+Cn),_e+=3*cr,Be(We=kn,Ie=Cn)}var Gt=De;function st(kn){this._context=kn}st.prototype={_radius:4.5,pointRadius:function(kn){return this._radius=kn,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(kn,Cn){switch(this._point){case 0:this._context.moveTo(kn,Cn),this._point=1;break;case 1:this._context.lineTo(kn,Cn);break;default:this._context.moveTo(kn+this._radius,Cn),this._context.arc(kn,Cn,this._radius,0,h.FA)}},result:x.A};var Qe,pt,yt,Ot,Pt,at=(0,c.A)(),lt={point:x.A,lineStart:function(){lt.point=Xe},lineEnd:function(){Qe&&ut(pt,yt),lt.point=x.A},polygonStart:function(){Qe=!0},polygonEnd:function(){Qe=null},result:function(){var kn=+at;return at.reset(),kn}};function Xe(kn,Cn){lt.point=ut,pt=Ot=kn,yt=Pt=Cn}function ut(kn,Cn){Ot-=kn,Pt-=Cn,at.add((0,h.RZ)(Ot*Ot+Pt*Pt)),Ot=kn,Pt=Cn}var wt=lt;function vt(){this._string=[]}function Lt(kn){return"m0,"+kn+"a"+kn+","+kn+" 0 1,1 0,"+-2*kn+"a"+kn+","+kn+" 0 1,1 0,"+2*kn+"z"}function jt(kn,Cn){var ur,Zn,cr=4.5;function Ir(Er){return Er&&(typeof cr=="function"&&Zn.pointRadius(+cr.apply(this,arguments)),(0,m.A)(Er,ur(Zn))),Zn.result()}return Ir.area=function(Er){return(0,m.A)(Er,ur(Ve)),Ve.result()},Ir.measure=function(Er){return(0,m.A)(Er,ur(wt)),wt.result()},Ir.bounds=function(Er){return(0,m.A)(Er,ur(Pe.A)),Pe.A.result()},Ir.centroid=function(Er){return(0,m.A)(Er,ur(Gt)),Gt.result()},Ir.projection=function(Er){return arguments.length?(ur=Er==null?(kn=null,le.A):(kn=Er).stream,Ir):kn},Ir.context=function(Er){return arguments.length?(Zn=Er==null?(Cn=null,new vt):new st(Cn=Er),typeof cr!="function"&&Zn.pointRadius(cr),Ir):Cn},Ir.pointRadius=function(Er){return arguments.length?(cr=typeof Er=="function"?Er:(Zn.pointRadius(+Er),+Er),Ir):cr},Ir.projection(kn).context(Cn)}vt.prototype={_radius:4.5,_circle:Lt(4.5),pointRadius:function(kn){return(kn=+kn)!==this._radius&&(this._radius=kn,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(kn,Cn){switch(this._point){case 0:this._string.push("M",kn,",",Cn),this._point=1;break;case 1:this._string.push("L",kn,",",Cn);break;default:this._circle==null&&(this._circle=Lt(this._radius)),this._string.push("M",kn,",",Cn,this._circle)}},result:function(){if(this._string.length){var kn=this._string.join("");return this._string=[],kn}return null}};var rt=t(94684);function et(kn){var Cn=0,ur=h.pi/3,Zn=(0,rt.U)(kn),cr=Zn(Cn,ur);return cr.parallels=function(Ir){return arguments.length?Zn(Cn=Ir[0]*h.F2,ur=Ir[1]*h.F2):[Cn*h.uj,ur*h.uj]},cr}function Et(kn,Cn){var ur=(0,h.F8)(kn),Zn=(ur+(0,h.F8)(Cn))/2;if((0,h.tn)(Zn)=.12&&tr<.234&&Un>=-.425&&Un<-.214?Xr:tr>=.166&&tr<.234&&Un>=-.214&&Un<-.115?ai:Er).invert(_n)},Yn.stream=function(_n){return kn&&Cn===_n?kn:(gn=[Er.stream(Cn=_n),Xr.stream(_n),ai.stream(_n)],qn=gn.length,kn={point:function(Un,tr){for(var Wn=-1;++Wn0?Xr<-h.TW+h.Ni&&(Xr=-h.TW+h.Ni):Xr>h.TW-h.Ni&&(Xr=h.TW-h.Ni);var ai=cr/(0,h.n7)(Pn(Xr),Zn);return[ai*(0,h.F8)(Zn*Er),cr-ai*(0,h.gn)(Zn*Er)]}return Ir.invert=function(Er,Xr){var ai=cr-Xr,bn=(0,h._S)(Zn)*(0,h.RZ)(Er*Er+ai*ai),Yn=(0,h.FP)(Er,(0,h.tn)(ai))*(0,h._S)(ai);return ai*Zn<0&&(Yn-=h.pi*(0,h._S)(Er)*(0,h._S)(ai)),[Yn/Zn,2*(0,h.rY)((0,h.n7)(cr/bn,1/Zn))-h.TW]},Ir}function In(){return et(Dn).scale(109.5).parallels([30,30])}Zt.invert=function(kn,Cn){return[kn,2*(0,h.rY)((0,h.oN)(Cn))-h.TW]};var mn=t(18139);function En(kn,Cn){var ur=(0,h.gn)(kn),Zn=kn===Cn?(0,h.F8)(kn):(ur-(0,h.gn)(Cn))/(Cn-kn),cr=ur/Zn+kn;if((0,h.tn)(Zn)2?Zn[2]+90:90]):[(Zn=ur())[0],Zn[1],Zn[2]-90]},ur([0,0,90]).scale(159.155)}Or.invert=(0,ni.I)(function(kn){return 2*(0,h.rY)(kn)}),xr.invert=function(kn,Cn){return[-Cn,2*(0,h.rY)((0,h.oN)(kn))-h.TW]}},81758:function(D,L,t){t.d(L,{A:function(){return d}});var b=t(61323);function d(e,w){var y=e[0]*b.F2,_=e[1]*b.F2,u=w[0]*b.F2,r=w[1]*b.F2,n=(0,b.gn)(_),l=(0,b.F8)(_),o=(0,b.gn)(r),s=(0,b.F8)(r),c=n*(0,b.gn)(y),h=n*(0,b.F8)(y),x=o*(0,b.gn)(u),m=o*(0,b.F8)(u),g=2*(0,b.qR)((0,b.RZ)((0,b.bo)(r-_)+n*o*(0,b.bo)(u-y))),k=(0,b.F8)(g),A=g?function(v){var S=(0,b.F8)(v*=g)/k,T=(0,b.F8)(g-v)/k,p=T*c+S*x,M=T*h+S*m,f=T*l+S*s;return[(0,b.FP)(M,p)*b.uj,(0,b.FP)(f,(0,b.RZ)(p*p+M*M))*b.uj]}:function(){return[y*b.uj,_*b.uj]};return A.distance=g,A}},61323:function(D,L,t){t.d(L,{$t:function(){return d},F2:function(){return r},F8:function(){return g},FA:function(){return _},FP:function(){return o},HQ:function(){return S},Ml:function(){return v},Ni:function(){return b},RZ:function(){return A},Rm:function(){return x},TW:function(){return w},_S:function(){return k},bo:function(){return p},gn:function(){return s},gz:function(){return y},mk:function(){return c},n7:function(){return m},oN:function(){return h},pi:function(){return e},qR:function(){return T},rY:function(){return l},tn:function(){return n},uj:function(){return u}});var b=1e-6,d=1e-12,e=Math.PI,w=e/2,y=e/4,_=2*e,u=180/e,r=e/180,n=Math.abs,l=Math.atan,o=Math.atan2,s=Math.cos,c=Math.ceil,h=Math.exp,x=Math.log,m=Math.pow,g=Math.sin,k=Math.sign||function(M){return M>0?1:M<0?-1:0},A=Math.sqrt,v=Math.tan;function S(M){return M>1?0:M<-1?e:Math.acos(M)}function T(M){return M>1?w:M<-1?-w:Math.asin(M)}function p(M){return(M=g(M/2))*M}},53341:function(D,L,t){function b(){}t.d(L,{A:function(){return b}})},33028:function(D,L,t){var b=t(53341),d=1/0,e=d,w=-d,y=w,_={point:function(u,r){uw&&(w=u),ry&&(y=r)},lineStart:b.A,lineEnd:b.A,polygonStart:b.A,polygonEnd:b.A,result:function(){var u=[[d,e],[w,y]];return w=y=-(e=d=1/0),u}};L.A=_},28759:function(D,L,t){t.d(L,{A:function(){return d}});var b=t(61323);function d(e,w){return(0,b.tn)(e[0]-w[0])=0?1:-1,$=j*V,ee=$>e.pi,H=T*B;if(w.add((0,e.FP)(H*j*(0,e.F8)($),p*N+H*(0,e.gn)($))),c+=ee?V+j*e.FA:V,ee^v>=n^E>=n){var J=(0,d.r8)((0,d.jf)(A),(0,d.jf)(f));(0,d.Cx)(J);var Q=(0,d.r8)(s,J);(0,d.Cx)(Q);var Z=(ee^V>=0?-1:1)*(0,e.qR)(Q[2]);(l>Z||l===Z&&(J[0]||J[1]))&&(h+=ee^V>=0?1:-1)}}return(c<-e.Ni||c4*T&&Q--){var he=I+ee,fe=B+H,ie=N+J,oe=(0,_.RZ)(he*he+fe*fe+ie*ie),le=(0,_.qR)(ie/=oe),ge=(0,_.tn)((0,_.tn)(ie)-1)<_.Ni||(0,_.tn)(E-$)<_.Ni?(E+$)/2:(0,_.FP)(fe,he),ye=S(ge,le),me=ye[0],be=ye[1],Se=me-M,Ee=be-f,Ce=ae*Se-K*Ee;(Ce*Ce/se>T||(0,_.tn)((K*Se+ae*Ee)/se-.5)>.3||I*ee+B*H+N*J2?Se[2]%360*_.F2:0,me()):[J*_.uj,Q*_.uj,Z*_.uj]},ge.angle=function(Se){return arguments.length?(K=Se%360*_.F2,me()):K*_.uj},ge.reflectX=function(Se){return arguments.length?(ae=Se?-1:1,me()):ae<0},ge.reflectY=function(Se){return arguments.length?(se=Se?-1:1,me()):se<0},ge.precision=function(Se){return arguments.length?(f=c(E,le=Se*Se),be()):(0,_.RZ)(le)},ge.fitExtent=function(Se,Ee){return(0,n.sp)(ge,Se,Ee)},ge.fitSize=function(Se,Ee){return(0,n.Hv)(ge,Se,Ee)},ge.fitWidth=function(Se,Ee){return(0,n.G0)(ge,Se,Ee)},ge.fitHeight=function(Se,Ee){return(0,n.FL)(ge,Se,Ee)},function(){return v=A.apply(this,arguments),ge.invert=v.invert&&ye,me()}}},57949:function(D,L,t){t.d(L,{A:function(){return w},P:function(){return e}});var b=t(94684),d=t(61323);function e(y,_){var u=_*_,r=u*u;return[y*(.8707-.131979*u+r*(r*(.003971*u-.001529*r)-.013791)),_*(1.007226+u*(.015085+r*(.028874*u-.044475-.005916*r)))]}function w(){return(0,b.A)(e).scale(175.295)}e.invert=function(y,_){var u,r=_,n=25;do{var l=r*r,o=l*l;r-=u=(r*(1.007226+l*(.015085+o*(.028874*l-.044475-.005916*o)))-_)/(1.007226+l*(.045255+o*(.259866*l-.311325-.06507600000000001*o)))}while((0,d.tn)(u)>d.Ni&&--n>0);return[y/(.8707+(l=r*r)*(l*(l*l*l*(.003971-.001529*l)-.013791)-.131979)),r]}},53253:function(D,L,t){t.d(L,{A:function(){return y},x:function(){return w}});var b=t(61323),d=t(57738),e=t(94684);function w(_,u){return[(0,b.gn)(u)*(0,b.F8)(_),(0,b.F8)(u)]}function y(){return(0,e.A)(w).scale(249.5).clipAngle(90+b.Ni)}w.invert=(0,d.I)(b.qR)},30915:function(D,L,t){t.d(L,{A:function(){return r},y:function(){return w}});var b=t(19057),d=t(61323);function e(n,l){return[(0,d.tn)(n)>d.pi?n+Math.round(-n/d.FA)*d.FA:n,l]}function w(n,l,o){return(n%=d.FA)?l||o?(0,b.A)(_(n),u(l,o)):_(n):l||o?u(l,o):e}function y(n){return function(l,o){return[(l+=n)>d.pi?l-d.FA:l<-d.pi?l+d.FA:l,o]}}function _(n){var l=y(n);return l.invert=y(-n),l}function u(n,l){var o=(0,d.gn)(n),s=(0,d.F8)(n),c=(0,d.gn)(l),h=(0,d.F8)(l);function x(m,g){var k=(0,d.gn)(g),A=(0,d.gn)(m)*k,v=(0,d.F8)(m)*k,S=(0,d.F8)(g),T=S*o+A*s;return[(0,d.FP)(v*c-T*h,A*o-S*s),(0,d.qR)(T*c+v*h)]}return x.invert=function(m,g){var k=(0,d.gn)(g),A=(0,d.gn)(m)*k,v=(0,d.F8)(m)*k,S=(0,d.F8)(g),T=S*c-v*h;return[(0,d.FP)(v*c+S*h,A*o+T*s),(0,d.qR)(T*o-A*s)]},x}function r(n){function l(o){return(o=n(o[0]*d.F2,o[1]*d.F2))[0]*=d.uj,o[1]*=d.uj,o}return n=w(n[0]*d.F2,n[1]*d.F2,n.length>2?n[2]*d.F2:0),l.invert=function(o){return(o=n.invert(o[0]*d.F2,o[1]*d.F2))[0]*=d.uj,o[1]*=d.uj,o},l}e.invert=e},20465:function(D,L,t){function b(u,r){u&&e.hasOwnProperty(u.type)&&e[u.type](u,r)}t.d(L,{A:function(){return _}});var d={Feature:function(u,r){b(u.geometry,r)},FeatureCollection:function(u,r){for(var n=u.features,l=-1,o=n.length;++l=0;)de+=Me[ke].value;else de=1;Pe.value=de}function _(Pe,de){var Me,ke,He,Fe,qe,$e=new l(Pe),Ye=+Pe.value&&($e.value=Pe.value),_e=[$e];for(de==null&&(de=u);Me=_e.pop();)if(Ye&&(Me.value=+Me.data.value),(He=de(Me.data))&&(qe=He.length))for(Me.children=new Array(qe),Fe=qe-1;Fe>=0;--Fe)_e.push(ke=Me.children[Fe]=new l(He[Fe])),ke.parent=Me,ke.depth=Me.depth+1;return $e.eachBefore(n)}function u(Pe){return Pe.children}function r(Pe){Pe.data=Pe.data.data}function n(Pe){var de=0;do Pe.height=de;while((Pe=Pe.parent)&&Pe.height<++de)}function l(Pe){this.data=Pe,this.depth=this.height=0,this.parent=null}t.r(L),t.d(L,{cluster:function(){return w},hierarchy:function(){return _},pack:function(){return V},packEnclose:function(){return s},packSiblings:function(){return f},partition:function(){return Q},stratify:function(){return fe},tree:function(){return be},treemap:function(){return Oe},treemapBinary:function(){return We},treemapDice:function(){return J},treemapResquarify:function(){return Ve},treemapSlice:function(){return Se},treemapSliceDice:function(){return Ie},treemapSquarify:function(){return Le}}),l.prototype=_.prototype={constructor:l,count:function(){return this.eachAfter(y)},each:function(Pe){var de,Me,ke,He,Fe=this,qe=[Fe];do for(de=qe.reverse(),qe=[];Fe=de.pop();)if(Pe(Fe),Me=Fe.children)for(ke=0,He=Me.length;ke=0;--Me)He.push(de[Me]);return this},sum:function(Pe){return this.eachAfter(function(de){for(var Me=+Pe(de.data)||0,ke=de.children,He=ke&&ke.length;--He>=0;)Me+=ke[He].value;de.value=Me})},sort:function(Pe){return this.eachBefore(function(de){de.children&&de.children.sort(Pe)})},path:function(Pe){for(var de=this,Me=function(Fe,qe){if(Fe===qe)return Fe;var $e=Fe.ancestors(),Ye=qe.ancestors(),_e=null;for(Fe=$e.pop(),qe=Ye.pop();Fe===qe;)_e=Fe,Fe=$e.pop(),qe=Ye.pop();return _e}(de,Pe),ke=[de];de!==Me;)de=de.parent,ke.push(de);for(var He=ke.length;Pe!==Me;)ke.splice(He,0,Pe),Pe=Pe.parent;return ke},ancestors:function(){for(var Pe=this,de=[Pe];Pe=Pe.parent;)de.push(Pe);return de},descendants:function(){var Pe=[];return this.each(function(de){Pe.push(de)}),Pe},leaves:function(){var Pe=[];return this.eachBefore(function(de){de.children||Pe.push(de)}),Pe},links:function(){var Pe=this,de=[];return Pe.each(function(Me){Me!==Pe&&de.push({source:Me.parent,target:Me})}),de},copy:function(){return _(this).eachBefore(r)}};var o=Array.prototype.slice;function s(Pe){for(var de,Me,ke=0,He=(Pe=function(qe){for(var $e,Ye,_e=qe.length;_e;)Ye=Math.random()*_e--|0,$e=qe[_e],qe[_e]=qe[Ye],qe[Ye]=$e;return qe}(o.call(Pe))).length,Fe=[];ke0&&Me*Me>ke*ke+He*He}function m(Pe,de){for(var Me=0;Me(qe*=qe)?(ke=(_e+qe-He)/(2*_e),Fe=Math.sqrt(Math.max(0,qe/_e-ke*ke)),Me.x=Pe.x-ke*$e-Fe*Ye,Me.y=Pe.y-ke*Ye+Fe*$e):(ke=(_e+He-qe)/(2*_e),Fe=Math.sqrt(Math.max(0,He/_e-ke*ke)),Me.x=de.x+ke*$e-Fe*Ye,Me.y=de.y+ke*Ye+Fe*$e)):(Me.x=de.x+Me.r,Me.y=de.y)}function S(Pe,de){var Me=Pe.r+de.r-1e-6,ke=de.x-Pe.x,He=de.y-Pe.y;return Me>0&&Me*Me>ke*ke+He*He}function T(Pe){var de=Pe._,Me=Pe.next._,ke=de.r+Me.r,He=(de.x*Me.r+Me.x*de.r)/ke,Fe=(de.y*Me.r+Me.y*de.r)/ke;return He*He+Fe*Fe}function p(Pe){this._=Pe,this.next=null,this.previous=null}function M(Pe){if(!(He=Pe.length))return 0;var de,Me,ke,He,Fe,qe,$e,Ye,_e,De,Be;if((de=Pe[0]).x=0,de.y=0,!(He>1))return de.r;if(Me=Pe[1],de.x=-Me.r,Me.x=de.r,Me.y=0,!(He>2))return de.r+Me.r;v(Me,de,ke=Pe[2]),de=new p(de),Me=new p(Me),ke=new p(ke),de.next=ke.previous=Me,Me.next=de.previous=ke,ke.next=Me.previous=de;e:for($e=3;$e0)throw new Error("cycle");return qe}return Me.id=function(ke){return arguments.length?(Pe=E(ke),Me):Pe},Me.parentId=function(ke){return arguments.length?(de=E(ke),Me):de},Me}function ie(Pe,de){return Pe.parent===de.parent?1:2}function oe(Pe){var de=Pe.children;return de?de[0]:Pe.t}function le(Pe){var de=Pe.children;return de?de[de.length-1]:Pe.t}function ge(Pe,de,Me){var ke=Me/(de.i-Pe.i);de.c-=ke,de.s+=Me,Pe.c+=ke,de.z+=Me,de.m+=Me}function ye(Pe,de,Me){return Pe.a.parent===de.parent?Pe.a:Me}function me(Pe,de){this._=Pe,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=de}function be(){var Pe=ie,de=1,Me=1,ke=null;function He(Ye){var _e=function(kt){for(var Vt,Ht,Gt,st,Qe,pt=new me(kt,0),yt=[pt];Vt=yt.pop();)if(Gt=Vt._.children)for(Vt.children=new Array(Qe=Gt.length),st=Qe-1;st>=0;--st)yt.push(Ht=Vt.children[st]=new me(Gt[st],st)),Ht.parent=Vt;return(pt.parent=new me(null,0)).children=[pt],pt}(Ye);if(_e.eachAfter(Fe),_e.parent.m=-_e.z,_e.eachBefore(qe),ke)Ye.eachBefore($e);else{var De=Ye,Be=Ye,Ge=Ye;Ye.eachBefore(function(kt){kt.xBe.x&&(Be=kt),kt.depth>Ge.depth&&(Ge=kt)});var tt=De===Be?1:Pe(De,Be)/2,nt=tt-De.x,ft=de/(Be.x+tt+nt),At=Me/(Ge.depth||1);Ye.eachBefore(function(kt){kt.x=(kt.x+nt)*ft,kt.y=kt.depth*At})}return Ye}function Fe(Ye){var _e=Ye.children,De=Ye.parent.children,Be=Ye.i?De[Ye.i-1]:null;if(_e){(function(tt){for(var nt,ft=0,At=0,kt=tt.children,Vt=kt.length;--Vt>=0;)(nt=kt[Vt]).z+=ft,nt.m+=ft,ft+=nt.s+(At+=nt.c)})(Ye);var Ge=(_e[0].z+_e[_e.length-1].z)/2;Be?(Ye.z=Be.z+Pe(Ye._,Be._),Ye.m=Ye.z-Ge):Ye.z=Ge}else Be&&(Ye.z=Be.z+Pe(Ye._,Be._));Ye.parent.A=function(tt,nt,ft){if(nt){for(var At,kt=tt,Vt=tt,Ht=nt,Gt=kt.parent.children[0],st=kt.m,Qe=Vt.m,pt=Ht.m,yt=Gt.m;Ht=le(Ht),kt=oe(kt),Ht&&kt;)Gt=oe(Gt),(Vt=le(Vt)).a=tt,(At=Ht.z+pt-kt.z-st+Pe(Ht._,kt._))>0&&(ge(ye(Ht,tt,ft),tt,At),st+=At,Qe+=At),pt+=Ht.m,st+=kt.m,yt+=Gt.m,Qe+=Vt.m;Ht&&!le(Vt)&&(Vt.t=Ht,Vt.m+=pt-Qe),kt&&!oe(Gt)&&(Gt.t=kt,Gt.m+=st-yt,ft=tt)}return ft}(Ye,Be,Ye.parent.A||De[0])}function qe(Ye){Ye._.x=Ye.z+Ye.parent.m,Ye.m+=Ye.parent.m}function $e(Ye){Ye.x*=de,Ye.y=Ye.depth*Me}return He.separation=function(Ye){return arguments.length?(Pe=Ye,He):Pe},He.size=function(Ye){return arguments.length?(ke=!1,de=+Ye[0],Me=+Ye[1],He):ke?null:[de,Me]},He.nodeSize=function(Ye){return arguments.length?(ke=!0,de=+Ye[0],Me=+Ye[1],He):ke?[de,Me]:null},He}function Se(Pe,de,Me,ke,He){for(var Fe,qe=Pe.children,$e=-1,Ye=qe.length,_e=Pe.value&&(He-Me)/Pe.value;++$eGe&&(Ge=$e),At=De*De*ft,(tt=Math.max(Ge/At,At/Be))>nt){De-=$e;break}nt=tt}kt.push(qe={value:De,dice:Ye<_e,children:Vt.slice(Ht,Gt)}),qe.dice?J(qe,Me,ke,He,Qe?ke+=_e*De/Qe:Fe):Se(qe,Me,ke,Qe?Me+=Ye*De/Qe:He,Fe),Qe-=De,Ht=Gt}return kt}var Le=function Pe(de){function Me(ke,He,Fe,qe,$e){Ce(de,ke,He,Fe,qe,$e)}return Me.ratio=function(ke){return Pe((ke=+ke)>1?ke:1)},Me}(Ee);function Oe(){var Pe=Le,de=!1,Me=1,ke=1,He=[0],Fe=I,qe=I,$e=I,Ye=I,_e=I;function De(Ge){return Ge.x0=Ge.y0=0,Ge.x1=Me,Ge.y1=ke,Ge.eachBefore(Be),He=[0],de&&Ge.eachBefore(H),Ge}function Be(Ge){var tt=He[Ge.depth],nt=Ge.x0+tt,ft=Ge.y0+tt,At=Ge.x1-tt,kt=Ge.y1-tt;At=Ge-1){var Vt=$e[Be];return Vt.x0=nt,Vt.y0=ft,Vt.x1=At,void(Vt.y1=kt)}for(var Ht=_e[Be],Gt=tt/2+Ht,st=Be+1,Qe=Ge-1;st>>1;_e[pt]kt-ft){var Pt=(nt*Ot+At*yt)/tt;De(Be,st,yt,nt,ft,Pt,kt),De(st,Ge,Ot,Pt,ft,At,kt)}else{var at=(ft*Ot+kt*yt)/tt;De(Be,st,yt,nt,ft,At,at),De(st,Ge,Ot,nt,at,At,kt)}})(0,Ye,Pe.value,de,Me,ke,He)}function Ie(Pe,de,Me,ke,He){(1&Pe.depth?Se:J)(Pe,de,Me,ke,He)}var Ve=function Pe(de){function Me(ke,He,Fe,qe,$e){if((Ye=ke._squarify)&&Ye.ratio===de)for(var Ye,_e,De,Be,Ge,tt=-1,nt=Ye.length,ft=ke.value;++tt1?ke:1)},Me}(Ee)},48544:function(D,L,t){t.d(L,{pq:function(){return x}});var b=Math.PI,d=2*b,e=1e-6,w=d-e;function y(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function _(){return new y}y.prototype=_.prototype={constructor:y,moveTo:function(m,g){this._+="M"+(this._x0=this._x1=+m)+","+(this._y0=this._y1=+g)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(m,g){this._+="L"+(this._x1=+m)+","+(this._y1=+g)},quadraticCurveTo:function(m,g,k,A){this._+="Q"+ +m+","+ +g+","+(this._x1=+k)+","+(this._y1=+A)},bezierCurveTo:function(m,g,k,A,v,S){this._+="C"+ +m+","+ +g+","+ +k+","+ +A+","+(this._x1=+v)+","+(this._y1=+S)},arcTo:function(m,g,k,A,v){m=+m,g=+g,k=+k,A=+A,v=+v;var S=this._x1,T=this._y1,p=k-m,M=A-g,f=S-m,E=T-g,I=f*f+E*E;if(v<0)throw new Error("negative radius: "+v);if(this._x1===null)this._+="M"+(this._x1=m)+","+(this._y1=g);else if(I>e)if(Math.abs(E*p-M*f)>e&&v){var B=k-S,N=A-T,V=p*p+M*M,j=B*B+N*N,$=Math.sqrt(V),ee=Math.sqrt(I),H=v*Math.tan((b-Math.acos((V+I-j)/(2*$*ee)))/2),J=H/ee,Q=H/$;Math.abs(J-1)>e&&(this._+="L"+(m+J*f)+","+(g+J*E)),this._+="A"+v+","+v+",0,0,"+ +(E*B>f*N)+","+(this._x1=m+Q*p)+","+(this._y1=g+Q*M)}else this._+="L"+(this._x1=m)+","+(this._y1=g)},arc:function(m,g,k,A,v,S){m=+m,g=+g,S=!!S;var T=(k=+k)*Math.cos(A),p=k*Math.sin(A),M=m+T,f=g+p,E=1^S,I=S?A-v:v-A;if(k<0)throw new Error("negative radius: "+k);this._x1===null?this._+="M"+M+","+f:(Math.abs(this._x1-M)>e||Math.abs(this._y1-f)>e)&&(this._+="L"+M+","+f),k&&(I<0&&(I=I%d+d),I>w?this._+="A"+k+","+k+",0,1,"+E+","+(m-T)+","+(g-p)+"A"+k+","+k+",0,1,"+E+","+(this._x1=M)+","+(this._y1=f):I>e&&(this._+="A"+k+","+k+",0,"+ +(I>=b)+","+E+","+(this._x1=m+k*Math.cos(v))+","+(this._y1=g+k*Math.sin(v))))},rect:function(m,g,k,A){this._+="M"+(this._x0=this._x1=+m)+","+(this._y0=this._y1=+g)+"h"+ +k+"v"+ +A+"h"+-k+"Z"},toString:function(){return this._}};var u=_,r=Array.prototype.slice;function n(m){return function(){return m}}function l(m){return m[0]}function o(m){return m[1]}function s(m){return m.source}function c(m){return m.target}function h(m,g,k,A,v){m.moveTo(g,k),m.bezierCurveTo(g=(g+A)/2,k,g,v,A,v)}function x(){return function(m){var g=s,k=c,A=l,v=o,S=null;function T(){var p,M=r.call(arguments),f=g.apply(this,M),E=k.apply(this,M);if(S||(S=p=u()),m(S,+A.apply(this,(M[0]=f,M)),+v.apply(this,M),+A.apply(this,(M[0]=E,M)),+v.apply(this,M)),p)return S=null,p+""||null}return T.source=function(p){return arguments.length?(g=p,T):g},T.target=function(p){return arguments.length?(k=p,T):k},T.x=function(p){return arguments.length?(A=typeof p=="function"?p:n(+p),T):A},T.y=function(p){return arguments.length?(v=typeof p=="function"?p:n(+p),T):v},T.context=function(p){return arguments.length?(S=p??null,T):S},T}(h)}},42696:function(D,L,t){t.d(L,{DC:function(){return s},de:function(){return l},aL:function(){return c}});var b=t(1681),d=t(72543),e=t(55735),w=t(47265),y=t(9830),_=t(59764);function u(st){if(0<=st.y&&st.y<100){var Qe=new Date(-1,st.m,st.d,st.H,st.M,st.S,st.L);return Qe.setFullYear(st.y),Qe}return new Date(st.y,st.m,st.d,st.H,st.M,st.S,st.L)}function r(st){if(0<=st.y&&st.y<100){var Qe=new Date(Date.UTC(-1,st.m,st.d,st.H,st.M,st.S,st.L));return Qe.setUTCFullYear(st.y),Qe}return new Date(Date.UTC(st.y,st.m,st.d,st.H,st.M,st.S,st.L))}function n(st,Qe,pt){return{y:st,m:Qe,d:pt,H:0,M:0,S:0,L:0}}function l(st){var Qe=st.dateTime,pt=st.date,yt=st.time,Ot=st.periods,Pt=st.days,at=st.shortDays,lt=st.months,Xe=st.shortMonths,ut=v(Ot),wt=S(Ot),vt=v(Pt),Lt=S(Pt),jt=v(at),rt=S(at),et=v(lt),Et=S(lt),Bt=v(Xe),Ft=S(Xe),St={a:function(on){return at[on.getDay()]},A:function(on){return Pt[on.getDay()]},b:function(on){return Xe[on.getMonth()]},B:function(on){return lt[on.getMonth()]},c:null,d:fe,e:fe,f:ye,H:ie,I:oe,j:le,L:ge,m:me,M:be,p:function(on){return Ot[+(on.getHours()>=12)]},q:function(on){return 1+~~(on.getMonth()/3)},Q:Ht,s:Gt,S:Se,u:Ee,U:Ce,V:Le,w:Oe,W:We,x:null,X:null,y:Ie,Y:Ve,Z:Pe,"%":Vt},Jt={a:function(on){return at[on.getUTCDay()]},A:function(on){return Pt[on.getUTCDay()]},b:function(on){return Xe[on.getUTCMonth()]},B:function(on){return lt[on.getUTCMonth()]},c:null,d:de,e:de,f:qe,H:Me,I:ke,j:He,L:Fe,m:$e,M:Ye,p:function(on){return Ot[+(on.getUTCHours()>=12)]},q:function(on){return 1+~~(on.getUTCMonth()/3)},Q:Ht,s:Gt,S:_e,u:De,U:Be,V:Ge,w:tt,W:nt,x:null,X:null,y:ft,Y:At,Z:kt,"%":Vt},qt={a:function(on,un,Pn){var Dn=jt.exec(un.slice(Pn));return Dn?(on.w=rt[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},A:function(on,un,Pn){var Dn=vt.exec(un.slice(Pn));return Dn?(on.w=Lt[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},b:function(on,un,Pn){var Dn=Bt.exec(un.slice(Pn));return Dn?(on.m=Ft[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},B:function(on,un,Pn){var Dn=et.exec(un.slice(Pn));return Dn?(on.m=Et[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},c:function(on,un,Pn){return Zt(on,Qe,un,Pn)},d:$,e:$,f:K,H,I:H,j:ee,L:Z,m:j,M:J,p:function(on,un,Pn){var Dn=ut.exec(un.slice(Pn));return Dn?(on.p=wt[Dn[0].toLowerCase()],Pn+Dn[0].length):-1},q:V,Q:se,s:he,S:Q,u:p,U:M,V:f,w:T,W:E,x:function(on,un,Pn){return Zt(on,pt,un,Pn)},X:function(on,un,Pn){return Zt(on,yt,un,Pn)},y:B,Y:I,Z:N,"%":ae};function en(on,un){return function(Pn){var Dn,In,mn,En=[],Kn=-1,Ln=0,Tn=on.length;for(Pn instanceof Date||(Pn=new Date(+Pn));++Kn53)return null;"w"in mn||(mn.w=1),"Z"in mn?(In=(Dn=r(n(mn.y,0,1))).getUTCDay(),Dn=In>4||In===0?b.rt.ceil(Dn):(0,b.rt)(Dn),Dn=d.A.offset(Dn,7*(mn.V-1)),mn.y=Dn.getUTCFullYear(),mn.m=Dn.getUTCMonth(),mn.d=Dn.getUTCDate()+(mn.w+6)%7):(In=(Dn=u(n(mn.y,0,1))).getDay(),Dn=In>4||In===0?e.By.ceil(Dn):(0,e.By)(Dn),Dn=w.A.offset(Dn,7*(mn.V-1)),mn.y=Dn.getFullYear(),mn.m=Dn.getMonth(),mn.d=Dn.getDate()+(mn.w+6)%7)}else("W"in mn||"U"in mn)&&("w"in mn||(mn.w="u"in mn?mn.u%7:"W"in mn?1:0),In="Z"in mn?r(n(mn.y,0,1)).getUTCDay():u(n(mn.y,0,1)).getDay(),mn.m=0,mn.d="W"in mn?(mn.w+6)%7+7*mn.W-(In+5)%7:mn.w+7*mn.U-(In+6)%7);return"Z"in mn?(mn.H+=mn.Z/100|0,mn.M+=mn.Z%100,r(mn)):u(mn)}}function Zt(on,un,Pn,Dn){for(var In,mn,En=0,Kn=un.length,Ln=Pn.length;En=Ln)return-1;if((In=un.charCodeAt(En++))===37){if(In=un.charAt(En++),!(mn=qt[In in h?un.charAt(En++):In])||(Dn=mn(on,Pn,Dn))<0)return-1}else if(In!=Pn.charCodeAt(Dn++))return-1}return Dn}return St.x=en(pt,St),St.X=en(yt,St),St.c=en(Qe,St),Jt.x=en(pt,Jt),Jt.X=en(yt,Jt),Jt.c=en(Qe,Jt),{format:function(on){var un=en(on+="",St);return un.toString=function(){return on},un},parse:function(on){var un=Wt(on+="",!1);return un.toString=function(){return on},un},utcFormat:function(on){var un=en(on+="",Jt);return un.toString=function(){return on},un},utcParse:function(on){var un=Wt(on+="",!0);return un.toString=function(){return on},un}}}var o,s,c,h={"-":"",_:" ",0:"0"},x=/^\s*\d+/,m=/^%/,g=/[\\^$*+?|[\]().{}]/g;function k(st,Qe,pt){var yt=st<0?"-":"",Ot=(yt?-st:st)+"",Pt=Ot.length;return yt+(Pt68?1900:2e3),pt+yt[0].length):-1}function N(st,Qe,pt){var yt=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Qe.slice(pt,pt+6));return yt?(st.Z=yt[1]?0:-(yt[2]+(yt[3]||"00")),pt+yt[0].length):-1}function V(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+1));return yt?(st.q=3*yt[0]-3,pt+yt[0].length):-1}function j(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+2));return yt?(st.m=yt[0]-1,pt+yt[0].length):-1}function $(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+2));return yt?(st.d=+yt[0],pt+yt[0].length):-1}function ee(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+3));return yt?(st.m=0,st.d=+yt[0],pt+yt[0].length):-1}function H(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+2));return yt?(st.H=+yt[0],pt+yt[0].length):-1}function J(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+2));return yt?(st.M=+yt[0],pt+yt[0].length):-1}function Q(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+2));return yt?(st.S=+yt[0],pt+yt[0].length):-1}function Z(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+3));return yt?(st.L=+yt[0],pt+yt[0].length):-1}function K(st,Qe,pt){var yt=x.exec(Qe.slice(pt,pt+6));return yt?(st.L=Math.floor(yt[0]/1e3),pt+yt[0].length):-1}function ae(st,Qe,pt){var yt=m.exec(Qe.slice(pt,pt+1));return yt?pt+yt[0].length:-1}function se(st,Qe,pt){var yt=x.exec(Qe.slice(pt));return yt?(st.Q=+yt[0],pt+yt[0].length):-1}function he(st,Qe,pt){var yt=x.exec(Qe.slice(pt));return yt?(st.s=+yt[0],pt+yt[0].length):-1}function fe(st,Qe){return k(st.getDate(),Qe,2)}function ie(st,Qe){return k(st.getHours(),Qe,2)}function oe(st,Qe){return k(st.getHours()%12||12,Qe,2)}function le(st,Qe){return k(1+w.A.count((0,y.A)(st),st),Qe,3)}function ge(st,Qe){return k(st.getMilliseconds(),Qe,3)}function ye(st,Qe){return ge(st,Qe)+"000"}function me(st,Qe){return k(st.getMonth()+1,Qe,2)}function be(st,Qe){return k(st.getMinutes(),Qe,2)}function Se(st,Qe){return k(st.getSeconds(),Qe,2)}function Ee(st){var Qe=st.getDay();return Qe===0?7:Qe}function Ce(st,Qe){return k(e.fz.count((0,y.A)(st)-1,st),Qe,2)}function Le(st,Qe){var pt=st.getDay();return st=pt>=4||pt===0?(0,e.dt)(st):e.dt.ceil(st),k(e.dt.count((0,y.A)(st),st)+((0,y.A)(st).getDay()===4),Qe,2)}function Oe(st){return st.getDay()}function We(st,Qe){return k(e.By.count((0,y.A)(st)-1,st),Qe,2)}function Ie(st,Qe){return k(st.getFullYear()%100,Qe,2)}function Ve(st,Qe){return k(st.getFullYear()%1e4,Qe,4)}function Pe(st){var Qe=st.getTimezoneOffset();return(Qe>0?"-":(Qe*=-1,"+"))+k(Qe/60|0,"0",2)+k(Qe%60,"0",2)}function de(st,Qe){return k(st.getUTCDate(),Qe,2)}function Me(st,Qe){return k(st.getUTCHours(),Qe,2)}function ke(st,Qe){return k(st.getUTCHours()%12||12,Qe,2)}function He(st,Qe){return k(1+d.A.count((0,_.A)(st),st),Qe,3)}function Fe(st,Qe){return k(st.getUTCMilliseconds(),Qe,3)}function qe(st,Qe){return Fe(st,Qe)+"000"}function $e(st,Qe){return k(st.getUTCMonth()+1,Qe,2)}function Ye(st,Qe){return k(st.getUTCMinutes(),Qe,2)}function _e(st,Qe){return k(st.getUTCSeconds(),Qe,2)}function De(st){var Qe=st.getUTCDay();return Qe===0?7:Qe}function Be(st,Qe){return k(b.Hl.count((0,_.A)(st)-1,st),Qe,2)}function Ge(st,Qe){var pt=st.getUTCDay();return st=pt>=4||pt===0?(0,b.pT)(st):b.pT.ceil(st),k(b.pT.count((0,_.A)(st),st)+((0,_.A)(st).getUTCDay()===4),Qe,2)}function tt(st){return st.getUTCDay()}function nt(st,Qe){return k(b.rt.count((0,_.A)(st)-1,st),Qe,2)}function ft(st,Qe){return k(st.getUTCFullYear()%100,Qe,2)}function At(st,Qe){return k(st.getUTCFullYear()%1e4,Qe,4)}function kt(){return"+0000"}function Vt(){return"%"}function Ht(st){return+st}function Gt(st){return Math.floor(+st/1e3)}o=l({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"]}),s=o.format,o.parse,c=o.utcFormat,o.utcParse},47265:function(D,L,t){t.d(L,{_:function(){return w}});var b=t(53398),d=t(66291),e=(0,b.A)(function(y){y.setHours(0,0,0,0)},function(y,_){y.setDate(y.getDate()+_)},function(y,_){return(_-y-(_.getTimezoneOffset()-y.getTimezoneOffset())*d.rR)/d.Nm},function(y){return y.getDate()-1});L.A=e;var w=e.range},66291:function(D,L,t){t.d(L,{Fq:function(){return y},JJ:function(){return e},Nm:function(){return w},Tt:function(){return b},rR:function(){return d}});var b=1e3,d=6e4,e=36e5,w=864e5,y=6048e5},50936:function(D,L,t){t.r(L),t.d(L,{timeDay:function(){return x.A},timeDays:function(){return x._},timeFriday:function(){return m.Sh},timeFridays:function(){return m.tz},timeHour:function(){return c},timeHours:function(){return h},timeInterval:function(){return b.A},timeMillisecond:function(){return e},timeMilliseconds:function(){return w},timeMinute:function(){return l},timeMinutes:function(){return o},timeMonday:function(){return m.By},timeMondays:function(){return m.KP},timeMonth:function(){return k},timeMonths:function(){return A},timeSaturday:function(){return m.kS},timeSaturdays:function(){return m.t$},timeSecond:function(){return u},timeSeconds:function(){return r},timeSunday:function(){return m.fz},timeSundays:function(){return m.se},timeThursday:function(){return m.dt},timeThursdays:function(){return m.Q$},timeTuesday:function(){return m.eQ},timeTuesdays:function(){return m.yW},timeWednesday:function(){return m.l3},timeWednesdays:function(){return m.gf},timeWeek:function(){return m.fz},timeWeeks:function(){return m.se},timeYear:function(){return v.A},timeYears:function(){return v.V},utcDay:function(){return I.A},utcDays:function(){return I.o},utcFriday:function(){return B.a1},utcFridays:function(){return B.Zn},utcHour:function(){return f},utcHours:function(){return E},utcMillisecond:function(){return e},utcMilliseconds:function(){return w},utcMinute:function(){return T},utcMinutes:function(){return p},utcMonday:function(){return B.rt},utcMondays:function(){return B.ON},utcMonth:function(){return V},utcMonths:function(){return j},utcSaturday:function(){return B.c8},utcSaturdays:function(){return B.Xo},utcSecond:function(){return u},utcSeconds:function(){return r},utcSunday:function(){return B.Hl},utcSundays:function(){return B.aZ},utcThursday:function(){return B.pT},utcThursdays:function(){return B.wr},utcTuesday:function(){return B.sr},utcTuesdays:function(){return B.jN},utcWednesday:function(){return B.z2},utcWednesdays:function(){return B.G6},utcWeek:function(){return B.Hl},utcWeeks:function(){return B.aZ},utcYear:function(){return $.A},utcYears:function(){return $.j}});var b=t(53398),d=(0,b.A)(function(){},function(ee,H){ee.setTime(+ee+H)},function(ee,H){return H-ee});d.every=function(ee){return ee=Math.floor(ee),isFinite(ee)&&ee>0?ee>1?(0,b.A)(function(H){H.setTime(Math.floor(H/ee)*ee)},function(H,J){H.setTime(+H+J*ee)},function(H,J){return(J-H)/ee}):d:null};var e=d,w=d.range,y=t(66291),_=(0,b.A)(function(ee){ee.setTime(ee-ee.getMilliseconds())},function(ee,H){ee.setTime(+ee+H*y.Tt)},function(ee,H){return(H-ee)/y.Tt},function(ee){return ee.getUTCSeconds()}),u=_,r=_.range,n=(0,b.A)(function(ee){ee.setTime(ee-ee.getMilliseconds()-ee.getSeconds()*y.Tt)},function(ee,H){ee.setTime(+ee+H*y.rR)},function(ee,H){return(H-ee)/y.rR},function(ee){return ee.getMinutes()}),l=n,o=n.range,s=(0,b.A)(function(ee){ee.setTime(ee-ee.getMilliseconds()-ee.getSeconds()*y.Tt-ee.getMinutes()*y.rR)},function(ee,H){ee.setTime(+ee+H*y.JJ)},function(ee,H){return(H-ee)/y.JJ},function(ee){return ee.getHours()}),c=s,h=s.range,x=t(47265),m=t(55735),g=(0,b.A)(function(ee){ee.setDate(1),ee.setHours(0,0,0,0)},function(ee,H){ee.setMonth(ee.getMonth()+H)},function(ee,H){return H.getMonth()-ee.getMonth()+12*(H.getFullYear()-ee.getFullYear())},function(ee){return ee.getMonth()}),k=g,A=g.range,v=t(9830),S=(0,b.A)(function(ee){ee.setUTCSeconds(0,0)},function(ee,H){ee.setTime(+ee+H*y.rR)},function(ee,H){return(H-ee)/y.rR},function(ee){return ee.getUTCMinutes()}),T=S,p=S.range,M=(0,b.A)(function(ee){ee.setUTCMinutes(0,0,0)},function(ee,H){ee.setTime(+ee+H*y.JJ)},function(ee,H){return(H-ee)/y.JJ},function(ee){return ee.getUTCHours()}),f=M,E=M.range,I=t(72543),B=t(1681),N=(0,b.A)(function(ee){ee.setUTCDate(1),ee.setUTCHours(0,0,0,0)},function(ee,H){ee.setUTCMonth(ee.getUTCMonth()+H)},function(ee,H){return H.getUTCMonth()-ee.getUTCMonth()+12*(H.getUTCFullYear()-ee.getUTCFullYear())},function(ee){return ee.getUTCMonth()}),V=N,j=N.range,$=t(59764)},53398:function(D,L,t){t.d(L,{A:function(){return e}});var b=new Date,d=new Date;function e(w,y,_,u){function r(n){return w(n=arguments.length===0?new Date:new Date(+n)),n}return r.floor=function(n){return w(n=new Date(+n)),n},r.ceil=function(n){return w(n=new Date(n-1)),y(n,1),w(n),n},r.round=function(n){var l=r(n),o=r.ceil(n);return n-l0))return c;do c.push(s=new Date(+n)),y(n,o),w(n);while(s=l)for(;w(l),!n(l);)l.setTime(l-1)},function(l,o){if(l>=l)if(o<0)for(;++o<=0;)for(;y(l,-1),!n(l););else for(;--o>=0;)for(;y(l,1),!n(l););})},_&&(r.count=function(n,l){return b.setTime(+n),d.setTime(+l),w(b),w(d),Math.floor(_(b,d))},r.every=function(n){return n=Math.floor(n),isFinite(n)&&n>0?n>1?r.filter(u?function(l){return u(l)%n==0}:function(l){return r.count(0,l)%n==0}):r:null}),r}},72543:function(D,L,t){t.d(L,{o:function(){return w}});var b=t(53398),d=t(66291),e=(0,b.A)(function(y){y.setUTCHours(0,0,0,0)},function(y,_){y.setUTCDate(y.getUTCDate()+_)},function(y,_){return(_-y)/d.Nm},function(y){return y.getUTCDate()-1});L.A=e;var w=e.range},1681:function(D,L,t){t.d(L,{G6:function(){return h},Hl:function(){return w},ON:function(){return s},Xo:function(){return g},Zn:function(){return m},a1:function(){return n},aZ:function(){return o},c8:function(){return l},jN:function(){return c},pT:function(){return r},rt:function(){return y},sr:function(){return _},wr:function(){return x},z2:function(){return u}});var b=t(53398),d=t(66291);function e(k){return(0,b.A)(function(A){A.setUTCDate(A.getUTCDate()-(A.getUTCDay()+7-k)%7),A.setUTCHours(0,0,0,0)},function(A,v){A.setUTCDate(A.getUTCDate()+7*v)},function(A,v){return(v-A)/d.Fq})}var w=e(0),y=e(1),_=e(2),u=e(3),r=e(4),n=e(5),l=e(6),o=w.range,s=y.range,c=_.range,h=u.range,x=r.range,m=n.range,g=l.range},59764:function(D,L,t){t.d(L,{j:function(){return e}});var b=t(53398),d=(0,b.A)(function(w){w.setUTCMonth(0,1),w.setUTCHours(0,0,0,0)},function(w,y){w.setUTCFullYear(w.getUTCFullYear()+y)},function(w,y){return y.getUTCFullYear()-w.getUTCFullYear()},function(w){return w.getUTCFullYear()});d.every=function(w){return isFinite(w=Math.floor(w))&&w>0?(0,b.A)(function(y){y.setUTCFullYear(Math.floor(y.getUTCFullYear()/w)*w),y.setUTCMonth(0,1),y.setUTCHours(0,0,0,0)},function(y,_){y.setUTCFullYear(y.getUTCFullYear()+_*w)}):null},L.A=d;var e=d.range},55735:function(D,L,t){t.d(L,{By:function(){return y},KP:function(){return s},Q$:function(){return x},Sh:function(){return n},dt:function(){return r},eQ:function(){return _},fz:function(){return w},gf:function(){return h},kS:function(){return l},l3:function(){return u},se:function(){return o},t$:function(){return g},tz:function(){return m},yW:function(){return c}});var b=t(53398),d=t(66291);function e(k){return(0,b.A)(function(A){A.setDate(A.getDate()-(A.getDay()+7-k)%7),A.setHours(0,0,0,0)},function(A,v){A.setDate(A.getDate()+7*v)},function(A,v){return(v-A-(v.getTimezoneOffset()-A.getTimezoneOffset())*d.rR)/d.Fq})}var w=e(0),y=e(1),_=e(2),u=e(3),r=e(4),n=e(5),l=e(6),o=w.range,s=y.range,c=_.range,h=u.range,x=r.range,m=n.range,g=l.range},9830:function(D,L,t){t.d(L,{V:function(){return e}});var b=t(53398),d=(0,b.A)(function(w){w.setMonth(0,1),w.setHours(0,0,0,0)},function(w,y){w.setFullYear(w.getFullYear()+y)},function(w,y){return y.getFullYear()-w.getFullYear()},function(w){return w.getFullYear()});d.every=function(w){return isFinite(w=Math.floor(w))&&w>0?(0,b.A)(function(y){y.setFullYear(Math.floor(y.getFullYear()/w)*w),y.setMonth(0,1),y.setHours(0,0,0,0)},function(y,_){y.setFullYear(y.getFullYear()+_*w)}):null},L.A=d;var e=d.range},70973:function(D,L,t){var b=t(40891),d=t(98800),e=t(48631),w=t(52991);D.exports=function(y,_,u){if(!y||typeof y!="object"&&typeof y!="function")throw new e("`obj` must be an object or a function`");if(typeof _!="string"&&typeof _!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,o=arguments.length>6&&arguments[6],s=!!w&&w(y,_);if(b)b(y,_,{configurable:l===null&&s?s.configurable:!l,enumerable:r===null&&s?s.enumerable:!r,value:u,writable:n===null&&s?s.writable:!n});else{if(!o&&(r||n||l))throw new d("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");y[_]=u}}},97936:function(D,L,t){var b=t(99433),d=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,w=Array.prototype.concat,y=Object.defineProperty,_=t(74268)(),u=y&&_,r=function(l,o,s,c){if(o in l){if(c===!0){if(l[o]===s)return}else if(typeof(h=c)!="function"||e.call(h)!=="[object Function]"||!c())return}var h;u?y(l,o,{configurable:!0,enumerable:!1,value:s,writable:!0}):l[o]=s},n=function(l,o){var s=arguments.length>2?arguments[2]:{},c=b(o);d&&(c=w.call(c,Object.getOwnPropertySymbols(o)));for(var h=0;hu*r){var c=(s-o)/u;_[l]=1e3*c}}return _}function d(e){for(var w=[],y=e[0];y<=e[1];y++)for(var _=String.fromCharCode(y),u=e[0];u0)return function(d,e){var w,y;for(w=new Array(d),y=0;y80*I){B=V=f[0],N=j=f[1];for(var ae=I;aeV&&(V=$),ee>j&&(j=ee);H=(H=Math.max(V-B,j-N))!==0?32767/H:0}return d(Z,K,I,B,N,H,0),K}function t(f,E,I,B,N){var V,j;if(N===M(f,E,I,B)>0)for(V=E;V=E;V-=B)j=S(V,f[V],f[V+1],j);return j&&x(j,j.next)&&(T(j),j=j.next),j}function b(f,E){if(!f)return f;E||(E=f);var I,B=f;do if(I=!1,B.steiner||!x(B,B.next)&&h(B.prev,B,B.next)!==0)B=B.next;else{if(T(B),(B=E=B.prev)===B.next)break;I=!0}while(I||B!==E);return E}function d(f,E,I,B,N,V,j){if(f){!j&&V&&function(J,Q,Z,K){var ae=J;do ae.z===0&&(ae.z=l(ae.x,ae.y,Q,Z,K)),ae.prevZ=ae.prev,ae.nextZ=ae.next,ae=ae.next;while(ae!==J);ae.prevZ.nextZ=null,ae.prevZ=null,function(se){var he,fe,ie,oe,le,ge,ye,me,be=1;do{for(fe=se,se=null,le=null,ge=0;fe;){for(ge++,ie=fe,ye=0,he=0;he0||me>0&&ie;)ye!==0&&(me===0||!ie||fe.z<=ie.z)?(oe=fe,fe=fe.nextZ,ye--):(oe=ie,ie=ie.nextZ,me--),le?le.nextZ=oe:se=oe,oe.prevZ=le,le=oe;fe=ie}le.nextZ=null,be*=2}while(ge>1)}(ae)}(f,B,N,V);for(var $,ee,H=f;f.prev!==f.next;)if($=f.prev,ee=f.next,V?w(f,B,N,V):e(f))E.push($.i/I|0),E.push(f.i/I|0),E.push(ee.i/I|0),T(f),f=ee.next,H=ee.next;else if((f=ee)===H){j?j===1?d(f=y(b(f),E,I),E,I,B,N,V,2):j===2&&_(f,E,I,B,N,V):d(b(f),E,I,B,N,V,1);break}}}function e(f){var E=f.prev,I=f,B=f.next;if(h(E,I,B)>=0)return!1;for(var N=E.x,V=I.x,j=B.x,$=E.y,ee=I.y,H=B.y,J=NV?N>j?N:j:V>j?V:j,K=$>ee?$>H?$:H:ee>H?ee:H,ae=B.next;ae!==E;){if(ae.x>=J&&ae.x<=Z&&ae.y>=Q&&ae.y<=K&&s(N,$,V,ee,j,H,ae.x,ae.y)&&h(ae.prev,ae,ae.next)>=0)return!1;ae=ae.next}return!0}function w(f,E,I,B){var N=f.prev,V=f,j=f.next;if(h(N,V,j)>=0)return!1;for(var $=N.x,ee=V.x,H=j.x,J=N.y,Q=V.y,Z=j.y,K=$ee?$>H?$:H:ee>H?ee:H,he=J>Q?J>Z?J:Z:Q>Z?Q:Z,fe=l(K,ae,E,I,B),ie=l(se,he,E,I,B),oe=f.prevZ,le=f.nextZ;oe&&oe.z>=fe&&le&&le.z<=ie;){if(oe.x>=K&&oe.x<=se&&oe.y>=ae&&oe.y<=he&&oe!==N&&oe!==j&&s($,J,ee,Q,H,Z,oe.x,oe.y)&&h(oe.prev,oe,oe.next)>=0||(oe=oe.prevZ,le.x>=K&&le.x<=se&&le.y>=ae&&le.y<=he&&le!==N&&le!==j&&s($,J,ee,Q,H,Z,le.x,le.y)&&h(le.prev,le,le.next)>=0))return!1;le=le.nextZ}for(;oe&&oe.z>=fe;){if(oe.x>=K&&oe.x<=se&&oe.y>=ae&&oe.y<=he&&oe!==N&&oe!==j&&s($,J,ee,Q,H,Z,oe.x,oe.y)&&h(oe.prev,oe,oe.next)>=0)return!1;oe=oe.prevZ}for(;le&&le.z<=ie;){if(le.x>=K&&le.x<=se&&le.y>=ae&&le.y<=he&&le!==N&&le!==j&&s($,J,ee,Q,H,Z,le.x,le.y)&&h(le.prev,le,le.next)>=0)return!1;le=le.nextZ}return!0}function y(f,E,I){var B=f;do{var N=B.prev,V=B.next.next;!x(N,V)&&m(N,B,B.next,V)&&A(N,V)&&A(V,N)&&(E.push(N.i/I|0),E.push(B.i/I|0),E.push(V.i/I|0),T(B),T(B.next),B=f=V),B=B.next}while(B!==f);return b(B)}function _(f,E,I,B,N,V){var j=f;do{for(var $=j.next.next;$!==j.prev;){if(j.i!==$.i&&c(j,$)){var ee=v(j,$);return j=b(j,j.next),ee=b(ee,ee.next),d(j,E,I,B,N,V,0),void d(ee,E,I,B,N,V,0)}$=$.next}j=j.next}while(j!==f)}function u(f,E){return f.x-E.x}function r(f,E){var I=function(N,V){var j,$=V,ee=N.x,H=N.y,J=-1/0;do{if(H<=$.y&&H>=$.next.y&&$.next.y!==$.y){var Q=$.x+(H-$.y)*($.next.x-$.x)/($.next.y-$.y);if(Q<=ee&&Q>J&&(J=Q,j=$.x<$.next.x?$:$.next,Q===ee))return j}$=$.next}while($!==V);if(!j)return null;var Z,K=j,ae=j.x,se=j.y,he=1/0;$=j;do ee>=$.x&&$.x>=ae&&ee!==$.x&&s(Hj.x||$.x===j.x&&n(j,$)))&&(j=$,he=Z)),$=$.next;while($!==K);return j}(f,E);if(!I)return E;var B=v(I,f);return b(B,B.next),b(I,I.next)}function n(f,E){return h(f.prev,f,E.prev)<0&&h(E.next,f,f.next)<0}function l(f,E,I,B,N){return(f=1431655765&((f=858993459&((f=252645135&((f=16711935&((f=(f-I)*N|0)|f<<8))|f<<4))|f<<2))|f<<1))|(E=1431655765&((E=858993459&((E=252645135&((E=16711935&((E=(E-B)*N|0)|E<<8))|E<<4))|E<<2))|E<<1))<<1}function o(f){var E=f,I=f;do(E.x=(f-j)*(V-$)&&(f-j)*(B-$)>=(I-j)*(E-$)&&(I-j)*(V-$)>=(N-j)*(B-$)}function c(f,E){return f.next.i!==E.i&&f.prev.i!==E.i&&!function(I,B){var N=I;do{if(N.i!==I.i&&N.next.i!==I.i&&N.i!==B.i&&N.next.i!==B.i&&m(N,N.next,I,B))return!0;N=N.next}while(N!==I);return!1}(f,E)&&(A(f,E)&&A(E,f)&&function(I,B){var N=I,V=!1,j=(I.x+B.x)/2,$=(I.y+B.y)/2;do N.y>$!=N.next.y>$&&N.next.y!==N.y&&j<(N.next.x-N.x)*($-N.y)/(N.next.y-N.y)+N.x&&(V=!V),N=N.next;while(N!==I);return V}(f,E)&&(h(f.prev,f,E.prev)||h(f,E.prev,E))||x(f,E)&&h(f.prev,f,f.next)>0&&h(E.prev,E,E.next)>0)}function h(f,E,I){return(E.y-f.y)*(I.x-E.x)-(E.x-f.x)*(I.y-E.y)}function x(f,E){return f.x===E.x&&f.y===E.y}function m(f,E,I,B){var N=k(h(f,E,I)),V=k(h(f,E,B)),j=k(h(I,B,f)),$=k(h(I,B,E));return N!==V&&j!==$||!(N!==0||!g(f,I,E))||!(V!==0||!g(f,B,E))||!(j!==0||!g(I,f,B))||!($!==0||!g(I,E,B))}function g(f,E,I){return E.x<=Math.max(f.x,I.x)&&E.x>=Math.min(f.x,I.x)&&E.y<=Math.max(f.y,I.y)&&E.y>=Math.min(f.y,I.y)}function k(f){return f>0?1:f<0?-1:0}function A(f,E){return h(f.prev,f,f.next)<0?h(f,E,f.next)>=0&&h(f,f.prev,E)>=0:h(f,E,f.prev)<0||h(f,f.next,E)<0}function v(f,E){var I=new p(f.i,f.x,f.y),B=new p(E.i,E.x,E.y),N=f.next,V=E.prev;return f.next=E,E.prev=f,I.next=N,N.prev=I,B.next=I,I.prev=B,V.next=B,B.prev=V,B}function S(f,E,I,B){var N=new p(f,E,I);return B?(N.next=B.next,N.prev=B,B.next.prev=N,B.next=N):(N.prev=N,N.next=N),N}function T(f){f.next.prev=f.prev,f.prev.next=f.next,f.prevZ&&(f.prevZ.nextZ=f.nextZ),f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function p(f,E,I){this.i=f,this.x=E,this.y=I,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(f,E,I,B){for(var N=0,V=E,j=I-B;V0&&(B+=f[N-1].length,I.holes.push(B))}return I}},96143:function(D,L,t){var b=t(26381);D.exports=function(d,e){var w,y=[],_=[],u=[],r={},n=[];function l(A){u[A]=!1,r.hasOwnProperty(A)&&Object.keys(r[A]).forEach(function(v){delete r[A][v],u[v]&&l(v)})}function o(A){var v,S,T=!1;for(_.push(A),u[A]=!0,v=0;v=I})})(A);for(var v,S=b(d).components.filter(function(I){return I.length>1}),T=1/0,p=0;p=55296&&A<=56319&&(p+=c[++x]),p=M?l.call(M,f,p,m):p,h?(o.value=p,s(g,m,o)):g[m]=p,++m;k=m}}if(k===void 0)for(k=w(c.length),h&&(g=new h(k)),x=0;x0?1:-1}},10226:function(D,L,t){var b=t(53579),d=Math.abs,e=Math.floor;D.exports=function(w){return isNaN(w)?0:(w=Number(w))!==0&&isFinite(w)?b(w)*e(d(w)):w}},54653:function(D,L,t){var b=t(10226),d=Math.max;D.exports=function(e){return d(0,b(e))}},39395:function(D,L,t){var b=t(52359),d=t(69746),e=Function.prototype.bind,w=Function.prototype.call,y=Object.keys,_=Object.prototype.propertyIsEnumerable;D.exports=function(u,r){return function(n,l){var o,s=arguments[2],c=arguments[3];return n=Object(d(n)),b(l),o=y(n),c&&o.sort(typeof c=="function"?e.call(c,n):void 0),typeof u!="function"&&(u=o[u]),w.call(u,o,function(h,x){return _.call(n,h)?w.call(l,s,n[h],h,n,x):r})}}},1920:function(D,L,t){D.exports=t(41271)()?Object.assign:t(26399)},41271:function(D){D.exports=function(){var L,t=Object.assign;return typeof t=="function"&&(t(L={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),L.foo+L.bar+L.trzy==="razdwatrzy")}},26399:function(D,L,t){var b=t(36353),d=t(69746),e=Math.max;D.exports=function(w,y){var _,u,r,n=e(arguments.length,2);for(w=Object(d(w)),r=function(l){try{w[l]=y[l]}catch(o){_||(_=o)}},u=1;u-1}},48488:function(D){var L=Object.prototype.toString,t=L.call("");D.exports=function(b){return typeof b=="string"||b&&typeof b=="object"&&(b instanceof String||L.call(b)===t)||!1}},43497:function(D){var L=Object.create(null),t=Math.random;D.exports=function(){var b;do b=t().toString(36).slice(2);while(L[b]);return b}},71343:function(D,L,t){var b,d=t(22834),e=t(2338),w=t(91819),y=t(63008),_=t(85490),u=Object.defineProperty;b=D.exports=function(r,n){if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");_.call(this,r),n=n?e.call(n,"key+value")?"key+value":e.call(n,"key")?"key":"value":"value",u(this,"__kind__",w("",n))},d&&d(b,_),delete b.prototype.constructor,b.prototype=Object.create(_.prototype,{_resolve:w(function(r){return this.__kind__==="value"?this.__list__[r]:this.__kind__==="key+value"?[r,this.__list__[r]]:r})}),u(b.prototype,y.toStringTag,w("c","Array Iterator"))},58755:function(D,L,t){var b=t(82262),d=t(52359),e=t(48488),w=t(34494),y=Array.isArray,_=Function.prototype.call,u=Array.prototype.some;D.exports=function(r,n){var l,o,s,c,h,x,m,g,k=arguments[2];if(y(r)||b(r)?l="array":e(r)?l="string":r=w(r),d(n),s=function(){c=!0},l!=="array")if(l!=="string")for(o=r.next();!o.done;){if(_.call(n,k,o.value,s),c)return;o=r.next()}else for(x=r.length,h=0;h=55296&&g<=56319&&(m+=r[++h]),_.call(n,k,m,s),!c);++h);else u.call(r,function(A){return _.call(n,k,A,s),c})}},34494:function(D,L,t){var b=t(82262),d=t(48488),e=t(71343),w=t(23417),y=t(82831),_=t(63008).iterator;D.exports=function(u){return typeof y(u)[_]=="function"?u[_]():b(u)?new e(u):d(u)?new w(u):new e(u)}},85490:function(D,L,t){var b,d=t(91445),e=t(1920),w=t(52359),y=t(69746),_=t(91819),u=t(84510),r=t(63008),n=Object.defineProperty,l=Object.defineProperties;D.exports=b=function(o,s){if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");l(this,{__list__:_("w",y(o)),__context__:_("w",s),__nextIndex__:_("w",0)}),s&&(w(s.on),s.on("_add",this._onAdd),s.on("_delete",this._onDelete),s.on("_clear",this._onClear))},delete b.prototype.constructor,l(b.prototype,e({_next:_(function(){var o;if(this.__list__)return this.__redo__&&(o=this.__redo__.shift())!==void 0?o:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(s,c){s>=o&&(this.__redo__[c]=++s)},this),this.__redo__.push(o)):n(this,"__redo__",_("c",[o])))}),_onDelete:_(function(o){var s;o>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&((s=this.__redo__.indexOf(o))!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,h){c>o&&(this.__redo__[h]=--c)},this)))}),_onClear:_(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),n(b.prototype,r.iterator,_(function(){return this}))},50567:function(D,L,t){var b=t(82262),d=t(1974),e=t(48488),w=t(63008).iterator,y=Array.isArray;D.exports=function(_){return!(!d(_)||!y(_)&&!e(_)&&!b(_)&&typeof _[w]!="function")}},23417:function(D,L,t){var b,d=t(22834),e=t(91819),w=t(63008),y=t(85490),_=Object.defineProperty;b=D.exports=function(u){if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");u=String(u),y.call(this,u),_(this,"__length__",e("",u.length))},d&&d(b,y),delete b.prototype.constructor,b.prototype=Object.create(y.prototype,{_next:e(function(){if(this.__list__)return this.__nextIndex__=55296&&r<=56319?n+this.__list__[this.__nextIndex__++]:n})}),_(b.prototype,w.toStringTag,e("c","String Iterator"))},82831:function(D,L,t){var b=t(50567);D.exports=function(d){if(!b(d))throw new TypeError(d+" is not iterable");return d}},63008:function(D,L,t){D.exports=t(25143)()?t(64725).Symbol:t(81905)},25143:function(D,L,t){var b=t(64725),d={object:!0,symbol:!0};D.exports=function(){var e,w=b.Symbol;if(typeof w!="function")return!1;e=w("test symbol");try{String(e)}catch{return!1}return!!d[typeof w.iterator]&&!!d[typeof w.toPrimitive]&&!!d[typeof w.toStringTag]}},41707:function(D){D.exports=function(L){return!!L&&(typeof L=="symbol"||!!L.constructor&&L.constructor.name==="Symbol"&&L[L.constructor.toStringTag]==="Symbol")}},74009:function(D,L,t){var b=t(91819),d=Object.create,e=Object.defineProperty,w=Object.prototype,y=d(null);D.exports=function(_){for(var u,r,n=0;y[_+(n||"")];)++n;return y[_+=n||""]=!0,e(w,u="@@"+_,b.gs(null,function(l){r||(r=!0,e(this,u,b(l)),r=!1)})),u}},40313:function(D,L,t){var b=t(91819),d=t(64725).Symbol;D.exports=function(e){return Object.defineProperties(e,{hasInstance:b("",d&&d.hasInstance||e("hasInstance")),isConcatSpreadable:b("",d&&d.isConcatSpreadable||e("isConcatSpreadable")),iterator:b("",d&&d.iterator||e("iterator")),match:b("",d&&d.match||e("match")),replace:b("",d&&d.replace||e("replace")),search:b("",d&&d.search||e("search")),species:b("",d&&d.species||e("species")),split:b("",d&&d.split||e("split")),toPrimitive:b("",d&&d.toPrimitive||e("toPrimitive")),toStringTag:b("",d&&d.toStringTag||e("toStringTag")),unscopables:b("",d&&d.unscopables||e("unscopables"))})}},21290:function(D,L,t){var b=t(91819),d=t(91765),e=Object.create(null);D.exports=function(w){return Object.defineProperties(w,{for:b(function(y){return e[y]?e[y]:e[y]=w(String(y))}),keyFor:b(function(y){var _;for(_ in d(y),e)if(e[_]===y)return _})})}},81905:function(D,L,t){var b,d,e,w=t(91819),y=t(91765),_=t(64725).Symbol,u=t(74009),r=t(40313),n=t(21290),l=Object.create,o=Object.defineProperties,s=Object.defineProperty;if(typeof _=="function")try{String(_()),e=!0}catch{}else _=null;d=function(c){if(this instanceof d)throw new TypeError("Symbol is not a constructor");return b(c)},D.exports=b=function c(h){var x;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return e?_(h):(x=l(d.prototype),h=h===void 0?"":String(h),o(x,{__description__:w("",h),__name__:w("",u(h))}))},r(b),n(b),o(d.prototype,{constructor:w(b),toString:w("",function(){return this.__name__})}),o(b.prototype,{toString:w(function(){return"Symbol ("+y(this).__description__+")"}),valueOf:w(function(){return y(this)})}),s(b.prototype,b.toPrimitive,w("",function(){var c=y(this);return typeof c=="symbol"?c:c.toString()})),s(b.prototype,b.toStringTag,w("c","Symbol")),s(d.prototype,b.toStringTag,w("c",b.prototype[b.toStringTag])),s(d.prototype,b.toPrimitive,w("c",b.prototype[b.toPrimitive]))},91765:function(D,L,t){var b=t(41707);D.exports=function(d){if(!b(d))throw new TypeError(d+" is not a symbol");return d}},93103:function(D,L,t){D.exports=t(22742)()?WeakMap:t(21780)},22742:function(D){D.exports=function(){var L,t;if(typeof WeakMap!="function")return!1;try{L=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch{return!1}return String(L)==="[object WeakMap]"&&typeof L.set=="function"&&L.set({},1)===L&&typeof L.delete=="function"&&typeof L.has=="function"&&L.get(t)==="one"}},81810:function(D){D.exports=typeof WeakMap=="function"&&Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"},21780:function(D,L,t){var b,d=t(1974),e=t(22834),w=t(11004),y=t(69746),_=t(43497),u=t(91819),r=t(34494),n=t(58755),l=t(63008).toStringTag,o=t(81810),s=Array.isArray,c=Object.defineProperty,h=Object.prototype.hasOwnProperty,x=Object.getPrototypeOf;D.exports=b=function(){var m,g=arguments[0];if(!(this instanceof b))throw new TypeError("Constructor requires 'new'");return m=o&&e&&WeakMap!==b?e(new WeakMap,x(this)):this,d(g)&&(s(g)||(g=r(g))),c(m,"__weakMapData__",u("c","$weakMap$"+_())),g&&n(g,function(k){y(k),m.set(k[0],k[1])}),m},o&&(e&&e(b,WeakMap),b.prototype=Object.create(WeakMap.prototype,{constructor:u(b)})),Object.defineProperties(b.prototype,{delete:u(function(m){return!!h.call(w(m),this.__weakMapData__)&&(delete m[this.__weakMapData__],!0)}),get:u(function(m){if(h.call(w(m),this.__weakMapData__))return m[this.__weakMapData__]}),has:u(function(m){return h.call(w(m),this.__weakMapData__)}),set:u(function(m,g){return c(w(m),this.__weakMapData__,u("c",g)),this}),toString:u(function(){return"[object WeakMap]"})}),c(b.prototype,l,u("c","WeakMap"))},7683:function(D){var L,t=typeof Reflect=="object"?Reflect:null,b=t&&typeof t.apply=="function"?t.apply:function(h,x,m){return Function.prototype.apply.call(h,x,m)};L=t&&typeof t.ownKeys=="function"?t.ownKeys:Object.getOwnPropertySymbols?function(h){return Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h))}:function(h){return Object.getOwnPropertyNames(h)};var d=Number.isNaN||function(h){return h!=h};function e(){e.init.call(this)}D.exports=e,D.exports.once=function(h,x){return new Promise(function(m,g){function k(v){h.removeListener(x,A),g(v)}function A(){typeof h.removeListener=="function"&&h.removeListener("error",k),m([].slice.call(arguments))}c(h,x,A,{once:!0}),x!=="error"&&function(v,S,T){typeof v.on=="function"&&c(v,"error",S,{once:!0})}(h,k)})},e.EventEmitter=e,e.prototype._events=void 0,e.prototype._eventsCount=0,e.prototype._maxListeners=void 0;var w=10;function y(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}function _(h){return h._maxListeners===void 0?e.defaultMaxListeners:h._maxListeners}function u(h,x,m,g){var k,A,v,S;if(y(m),(A=h._events)===void 0?(A=h._events=Object.create(null),h._eventsCount=0):(A.newListener!==void 0&&(h.emit("newListener",x,m.listener?m.listener:m),A=h._events),v=A[x]),v===void 0)v=A[x]=m,++h._eventsCount;else if(typeof v=="function"?v=A[x]=g?[m,v]:[v,m]:g?v.unshift(m):v.push(m),(k=_(h))>0&&v.length>k&&!v.warned){v.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+v.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=h,T.type=x,T.count=v.length,S=T,console&&console.warn&&console.warn(S)}return h}function r(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function n(h,x,m){var g={fired:!1,wrapFn:void 0,target:h,type:x,listener:m},k=r.bind(g);return k.listener=m,g.wrapFn=k,k}function l(h,x,m){var g=h._events;if(g===void 0)return[];var k=g[x];return k===void 0?[]:typeof k=="function"?m?[k.listener||k]:[k]:m?function(A){for(var v=new Array(A.length),S=0;S0&&(A=x[0]),A instanceof Error)throw A;var v=new Error("Unhandled error."+(A?" ("+A.message+")":""));throw v.context=A,v}var S=k[h];if(S===void 0)return!1;if(typeof S=="function")b(S,this,x);else{var T=S.length,p=s(S,T);for(m=0;m=0;A--)if(m[A]===x||m[A].listener===x){v=m[A].listener,k=A;break}if(k<0)return this;k===0?m.shift():function(S,T){for(;T+1=0;g--)this.removeListener(h,x[g]);return this},e.prototype.listeners=function(h){return l(this,h,!0)},e.prototype.rawListeners=function(h){return l(this,h,!1)},e.listenerCount=function(h,x){return typeof h.listenerCount=="function"?h.listenerCount(x):o.call(h,x)},e.prototype.listenerCount=o,e.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]}},77083:function(D){var L=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};D.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return L()}try{return __global__||L()}finally{delete Object.prototype.__global__}}()},64725:function(D,L,t){D.exports=t(17804)()?globalThis:t(77083)},17804:function(D){D.exports=function(){return typeof globalThis=="object"&&!!globalThis&&globalThis.Array===Array}},10721:function(D,L,t){var b=t(9914);D.exports=function(d){var e=typeof d;if(e==="string"){var w=d;if((d=+d)==0&&b(w))return!1}else if(e!=="number")return!1;return d-d<1}},83473:function(D,L,t){var b=t(10275);D.exports=function(d,e,w){if(!d)throw new TypeError("must specify data as first parameter");if(w=0|+(w||0),Array.isArray(d)&&d[0]&&typeof d[0][0]=="number"){var y,_,u,r,n=d[0].length,l=d.length*n;e&&typeof e!="string"||(e=new(b(e||"float32"))(l+w));var o=e.length-w;if(l!==o)throw new Error("source length "+l+" ("+n+"x"+d.length+") does not match destination length "+o);for(y=0,u=w;yw[0]-u[0]/2&&(c=u[0]/2,h+=u[1]);return y}},12673:function(D){function L(e,w){w||(w={}),(typeof e=="string"||Array.isArray(e))&&(w.family=e);var y=Array.isArray(w.family)?w.family.join(", "):w.family;if(!y)throw Error("`family` must be defined");var _=w.size||w.fontSize||w.em||48,u=w.weight||w.fontWeight||"",r=(e=[w.style||w.fontStyle||"",u,_].join(" ")+"px "+y,w.origin||"top");if(L.cache[y]&&_<=L.cache[y].em)return t(L.cache[y],r);var n=w.canvas||L.canvas,l=n.getContext("2d"),o={upper:w.upper!==void 0?w.upper:"H",lower:w.lower!==void 0?w.lower:"x",descent:w.descent!==void 0?w.descent:"p",ascent:w.ascent!==void 0?w.ascent:"h",tittle:w.tittle!==void 0?w.tittle:"i",overshoot:w.overshoot!==void 0?w.overshoot:"O"},s=Math.ceil(1.5*_);n.height=s,n.width=.5*s,l.font=e;var c="H",h={top:0};l.clearRect(0,0,s,s),l.textBaseline="top",l.fillStyle="black",l.fillText(c,0,0);var x=b(l.getImageData(0,0,s,s));l.clearRect(0,0,s,s),l.textBaseline="bottom",l.fillText(c,0,s);var m=b(l.getImageData(0,0,s,s));h.lineHeight=h.bottom=s-m+x,l.clearRect(0,0,s,s),l.textBaseline="alphabetic",l.fillText(c,0,s);var g=s-b(l.getImageData(0,0,s,s))-1+x;h.baseline=h.alphabetic=g,l.clearRect(0,0,s,s),l.textBaseline="middle",l.fillText(c,0,.5*s);var k=b(l.getImageData(0,0,s,s));h.median=h.middle=s-k-1+x-.5*s,l.clearRect(0,0,s,s),l.textBaseline="hanging",l.fillText(c,0,.5*s);var A=b(l.getImageData(0,0,s,s));h.hanging=s-A-1+x-.5*s,l.clearRect(0,0,s,s),l.textBaseline="ideographic",l.fillText(c,0,s);var v=b(l.getImageData(0,0,s,s));if(h.ideographic=s-v-1+x,o.upper&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.upper,0,0),h.upper=b(l.getImageData(0,0,s,s)),h.capHeight=h.baseline-h.upper),o.lower&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.lower,0,0),h.lower=b(l.getImageData(0,0,s,s)),h.xHeight=h.baseline-h.lower),o.tittle&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.tittle,0,0),h.tittle=b(l.getImageData(0,0,s,s))),o.ascent&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.ascent,0,0),h.ascent=b(l.getImageData(0,0,s,s))),o.descent&&(l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.descent,0,0),h.descent=d(l.getImageData(0,0,s,s))),o.overshoot){l.clearRect(0,0,s,s),l.textBaseline="top",l.fillText(o.overshoot,0,0);var S=d(l.getImageData(0,0,s,s));h.overshoot=S-g}for(var T in h)h[T]/=_;return h.em=_,L.cache[y]=h,t(h,r)}function t(e,w){var y={};for(var _ in typeof w=="string"&&(w=e[w]),e)_!=="em"&&(y[_]=e[_]-w);return y}function b(e){for(var w=e.height,y=e.data,_=3;_0;_-=4)if(y[_]!==0)return Math.floor(.25*(_-3)/w)}D.exports=L,L.canvas=document.createElement("canvas"),L.cache={}},61262:function(D,L,t){var b=t(82756),d=Object.prototype.toString,e=Object.prototype.hasOwnProperty;D.exports=function(w,y,_){if(!b(y))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=_),d.call(w)==="[object Array]"?function(r,n,l){for(var o=0,s=r.length;o"u"&&!t.canvas)return null;var b=t.canvas||document.createElement("canvas");typeof t.width=="number"&&(b.width=t.width),typeof t.height=="number"&&(b.height=t.height);var d,e=t;try{var w=[L];L.indexOf("webgl")===0&&w.push("experimental-"+L);for(var y=0;y"u"?b:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?b:ArrayBuffer,"%ArrayIteratorPrototype%":h&&m?m([][Symbol.iterator]()):b,"%AsyncFromSyncIteratorPrototype%":b,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":typeof Atomics>"u"?b:Atomics,"%BigInt%":typeof BigInt>"u"?b:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?b:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?b:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?b:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":d,"%eval%":eval,"%EvalError%":e,"%Float32Array%":typeof Float32Array>"u"?b:Float32Array,"%Float64Array%":typeof Float64Array>"u"?b:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?b:FinalizationRegistry,"%Function%":n,"%GeneratorFunction%":g,"%Int8Array%":typeof Int8Array>"u"?b:Int8Array,"%Int16Array%":typeof Int16Array>"u"?b:Int16Array,"%Int32Array%":typeof Int32Array>"u"?b:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&m?m(m([][Symbol.iterator]())):b,"%JSON%":typeof JSON=="object"?JSON:b,"%Map%":typeof Map>"u"?b:Map,"%MapIteratorPrototype%":typeof Map<"u"&&h&&m?m(new Map()[Symbol.iterator]()):b,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?b:Promise,"%Proxy%":typeof Proxy>"u"?b:Proxy,"%RangeError%":w,"%ReferenceError%":y,"%Reflect%":typeof Reflect>"u"?b:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?b:Set,"%SetIteratorPrototype%":typeof Set<"u"&&h&&m?m(new Set()[Symbol.iterator]()):b,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?b:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&m?m(""[Symbol.iterator]()):b,"%Symbol%":h?Symbol:b,"%SyntaxError%":_,"%ThrowTypeError%":c,"%TypedArray%":k,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>"u"?b:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?b:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?b:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?b:Uint32Array,"%URIError%":r,"%WeakMap%":typeof WeakMap>"u"?b:WeakMap,"%WeakRef%":typeof WeakRef>"u"?b:WeakRef,"%WeakSet%":typeof WeakSet>"u"?b:WeakSet};if(m)try{null.error}catch(ee){var v=m(m(ee));A["%Error.prototype%"]=v}var S=function ee(H){var J;if(H==="%AsyncFunction%")J=l("async function () {}");else if(H==="%GeneratorFunction%")J=l("function* () {}");else if(H==="%AsyncGeneratorFunction%")J=l("async function* () {}");else if(H==="%AsyncGenerator%"){var Q=ee("%AsyncGeneratorFunction%");Q&&(J=Q.prototype)}else if(H==="%AsyncIteratorPrototype%"){var Z=ee("%AsyncGenerator%");Z&&m&&(J=m(Z.prototype))}return A[H]=J,J},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},p=t(87547),M=t(80753),f=p.call(Function.call,Array.prototype.concat),E=p.call(Function.apply,Array.prototype.splice),I=p.call(Function.call,String.prototype.replace),B=p.call(Function.call,String.prototype.slice),N=p.call(Function.call,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,$=function(ee,H){var J,Q=ee;if(M(T,Q)&&(Q="%"+(J=T[Q])[0]+"%"),M(A,Q)){var Z=A[Q];if(Z===g&&(Z=S(Q)),Z===void 0&&!H)throw new u("intrinsic "+ee+" exists, but is not available. Please file an issue!");return{alias:J,name:Q,value:Z}}throw new _("intrinsic "+ee+" does not exist!")};D.exports=function(ee,H){if(typeof ee!="string"||ee.length===0)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof H!="boolean")throw new u('"allowMissing" argument must be a boolean');if(N(/^%?[^%]*%?$/,ee)===null)throw new _("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var J=function(me){var be=B(me,0,1),Se=B(me,-1);if(be==="%"&&Se!=="%")throw new _("invalid intrinsic syntax, expected closing `%`");if(Se==="%"&&be!=="%")throw new _("invalid intrinsic syntax, expected opening `%`");var Ee=[];return I(me,V,function(Ce,Le,Oe,We){Ee[Ee.length]=Oe?I(We,j,"$1"):Le||Ce}),Ee}(ee),Q=J.length>0?J[0]:"",Z=$("%"+Q+"%",H),K=Z.name,ae=Z.value,se=!1,he=Z.alias;he&&(Q=he[0],E(J,f([0,1],he)));for(var fe=1,ie=!0;fe=J.length){var ye=o(ae,oe);ae=(ie=!!ye)&&"get"in ye&&!("originalValue"in ye.get)?ye.get:ae[oe]}else ie=M(ae,oe),ae=ae[oe];ie&&!se&&(A[K]=ae)}}return ae}},84840:function(D){D.exports=function(L,t){var b=t[0],d=t[1],e=t[2],w=t[3],y=t[4],_=t[5],u=t[6],r=t[7],n=t[8],l=t[9],o=t[10],s=t[11],c=t[12],h=t[13],x=t[14],m=t[15];return L[0]=_*(o*m-s*x)-l*(u*m-r*x)+h*(u*s-r*o),L[1]=-(d*(o*m-s*x)-l*(e*m-w*x)+h*(e*s-w*o)),L[2]=d*(u*m-r*x)-_*(e*m-w*x)+h*(e*r-w*u),L[3]=-(d*(u*s-r*o)-_*(e*s-w*o)+l*(e*r-w*u)),L[4]=-(y*(o*m-s*x)-n*(u*m-r*x)+c*(u*s-r*o)),L[5]=b*(o*m-s*x)-n*(e*m-w*x)+c*(e*s-w*o),L[6]=-(b*(u*m-r*x)-y*(e*m-w*x)+c*(e*r-w*u)),L[7]=b*(u*s-r*o)-y*(e*s-w*o)+n*(e*r-w*u),L[8]=y*(l*m-s*h)-n*(_*m-r*h)+c*(_*s-r*l),L[9]=-(b*(l*m-s*h)-n*(d*m-w*h)+c*(d*s-w*l)),L[10]=b*(_*m-r*h)-y*(d*m-w*h)+c*(d*r-w*_),L[11]=-(b*(_*s-r*l)-y*(d*s-w*l)+n*(d*r-w*_)),L[12]=-(y*(l*x-o*h)-n*(_*x-u*h)+c*(_*o-u*l)),L[13]=b*(l*x-o*h)-n*(d*x-e*h)+c*(d*o-e*l),L[14]=-(b*(_*x-u*h)-y*(d*x-e*h)+c*(d*u-e*_)),L[15]=b*(_*o-u*l)-y*(d*o-e*l)+n*(d*u-e*_),L}},99698:function(D){D.exports=function(L){var t=new Float32Array(16);return t[0]=L[0],t[1]=L[1],t[2]=L[2],t[3]=L[3],t[4]=L[4],t[5]=L[5],t[6]=L[6],t[7]=L[7],t[8]=L[8],t[9]=L[9],t[10]=L[10],t[11]=L[11],t[12]=L[12],t[13]=L[13],t[14]=L[14],t[15]=L[15],t}},57938:function(D){D.exports=function(L,t){return L[0]=t[0],L[1]=t[1],L[2]=t[2],L[3]=t[3],L[4]=t[4],L[5]=t[5],L[6]=t[6],L[7]=t[7],L[8]=t[8],L[9]=t[9],L[10]=t[10],L[11]=t[11],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15],L}},87519:function(D){D.exports=function(){var L=new Float32Array(16);return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},6900:function(D){D.exports=function(L){var t=L[0],b=L[1],d=L[2],e=L[3],w=L[4],y=L[5],_=L[6],u=L[7],r=L[8],n=L[9],l=L[10],o=L[11],s=L[12],c=L[13],h=L[14],x=L[15];return(t*y-b*w)*(l*x-o*h)-(t*_-d*w)*(n*x-o*c)+(t*u-e*w)*(n*h-l*c)+(b*_-d*y)*(r*x-o*s)-(b*u-e*y)*(r*h-l*s)+(d*u-e*_)*(r*c-n*s)}},36472:function(D){D.exports=function(L,t){var b=t[0],d=t[1],e=t[2],w=t[3],y=b+b,_=d+d,u=e+e,r=b*y,n=d*y,l=d*_,o=e*y,s=e*_,c=e*u,h=w*y,x=w*_,m=w*u;return L[0]=1-l-c,L[1]=n+m,L[2]=o-x,L[3]=0,L[4]=n-m,L[5]=1-r-c,L[6]=s+h,L[7]=0,L[8]=o+x,L[9]=s-h,L[10]=1-r-l,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},43061:function(D){D.exports=function(L,t,b){var d,e,w,y=b[0],_=b[1],u=b[2],r=Math.sqrt(y*y+_*_+u*u);return Math.abs(r)<1e-6?null:(y*=r=1/r,_*=r,u*=r,d=Math.sin(t),w=1-(e=Math.cos(t)),L[0]=y*y*w+e,L[1]=_*y*w+u*d,L[2]=u*y*w-_*d,L[3]=0,L[4]=y*_*w-u*d,L[5]=_*_*w+e,L[6]=u*_*w+y*d,L[7]=0,L[8]=y*u*w+_*d,L[9]=_*u*w-y*d,L[10]=u*u*w+e,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L)}},33606:function(D){D.exports=function(L,t,b){var d=t[0],e=t[1],w=t[2],y=t[3],_=d+d,u=e+e,r=w+w,n=d*_,l=d*u,o=d*r,s=e*u,c=e*r,h=w*r,x=y*_,m=y*u,g=y*r;return L[0]=1-(s+h),L[1]=l+g,L[2]=o-m,L[3]=0,L[4]=l-g,L[5]=1-(n+h),L[6]=c+x,L[7]=0,L[8]=o+m,L[9]=c-x,L[10]=1-(n+s),L[11]=0,L[12]=b[0],L[13]=b[1],L[14]=b[2],L[15]=1,L}},98698:function(D){D.exports=function(L,t){return L[0]=t[0],L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=t[1],L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=t[2],L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},6924:function(D){D.exports=function(L,t){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=t[0],L[13]=t[1],L[14]=t[2],L[15]=1,L}},81181:function(D){D.exports=function(L,t){var b=Math.sin(t),d=Math.cos(t);return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=d,L[6]=b,L[7]=0,L[8]=0,L[9]=-b,L[10]=d,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},95258:function(D){D.exports=function(L,t){var b=Math.sin(t),d=Math.cos(t);return L[0]=d,L[1]=0,L[2]=-b,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=b,L[9]=0,L[10]=d,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},94815:function(D){D.exports=function(L,t){var b=Math.sin(t),d=Math.cos(t);return L[0]=d,L[1]=b,L[2]=0,L[3]=0,L[4]=-b,L[5]=d,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},87301:function(D){D.exports=function(L,t,b,d,e,w,y){var _=1/(b-t),u=1/(e-d),r=1/(w-y);return L[0]=2*w*_,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=2*w*u,L[6]=0,L[7]=0,L[8]=(b+t)*_,L[9]=(e+d)*u,L[10]=(y+w)*r,L[11]=-1,L[12]=0,L[13]=0,L[14]=y*w*2*r,L[15]=0,L}},87193:function(D){D.exports=function(L){return L[0]=1,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=1,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=1,L[11]=0,L[12]=0,L[13]=0,L[14]=0,L[15]=1,L}},11191:function(D,L,t){D.exports={create:t(87519),clone:t(99698),copy:t(57938),identity:t(87193),transpose:t(10256),invert:t(96559),adjoint:t(84840),determinant:t(6900),multiply:t(14787),translate:t(4165),scale:t(8697),rotate:t(32416),rotateX:t(81066),rotateY:t(54201),rotateZ:t(33920),fromRotation:t(43061),fromRotationTranslation:t(33606),fromScaling:t(98698),fromTranslation:t(6924),fromXRotation:t(81181),fromYRotation:t(95258),fromZRotation:t(94815),fromQuat:t(36472),frustum:t(87301),perspective:t(5313),perspectiveFromFieldOfView:t(22253),ortho:t(4633),lookAt:t(26645),str:t(66992)}},96559:function(D){D.exports=function(L,t){var b=t[0],d=t[1],e=t[2],w=t[3],y=t[4],_=t[5],u=t[6],r=t[7],n=t[8],l=t[9],o=t[10],s=t[11],c=t[12],h=t[13],x=t[14],m=t[15],g=b*_-d*y,k=b*u-e*y,A=b*r-w*y,v=d*u-e*_,S=d*r-w*_,T=e*r-w*u,p=n*h-l*c,M=n*x-o*c,f=n*m-s*c,E=l*x-o*h,I=l*m-s*h,B=o*m-s*x,N=g*B-k*I+A*E+v*f-S*M+T*p;return N?(N=1/N,L[0]=(_*B-u*I+r*E)*N,L[1]=(e*I-d*B-w*E)*N,L[2]=(h*T-x*S+m*v)*N,L[3]=(o*S-l*T-s*v)*N,L[4]=(u*f-y*B-r*M)*N,L[5]=(b*B-e*f+w*M)*N,L[6]=(x*A-c*T-m*k)*N,L[7]=(n*T-o*A+s*k)*N,L[8]=(y*I-_*f+r*p)*N,L[9]=(d*f-b*I-w*p)*N,L[10]=(c*S-h*A+m*g)*N,L[11]=(l*A-n*S-s*g)*N,L[12]=(_*M-y*E-u*p)*N,L[13]=(b*E-d*M+e*p)*N,L[14]=(h*k-c*v-x*g)*N,L[15]=(n*v-l*k+o*g)*N,L):null}},26645:function(D,L,t){var b=t(87193);D.exports=function(d,e,w,y){var _,u,r,n,l,o,s,c,h,x,m=e[0],g=e[1],k=e[2],A=y[0],v=y[1],S=y[2],T=w[0],p=w[1],M=w[2];return Math.abs(m-T)<1e-6&&Math.abs(g-p)<1e-6&&Math.abs(k-M)<1e-6?b(d):(s=m-T,c=g-p,h=k-M,_=v*(h*=x=1/Math.sqrt(s*s+c*c+h*h))-S*(c*=x),u=S*(s*=x)-A*h,r=A*c-v*s,(x=Math.sqrt(_*_+u*u+r*r))?(_*=x=1/x,u*=x,r*=x):(_=0,u=0,r=0),n=c*r-h*u,l=h*_-s*r,o=s*u-c*_,(x=Math.sqrt(n*n+l*l+o*o))?(n*=x=1/x,l*=x,o*=x):(n=0,l=0,o=0),d[0]=_,d[1]=n,d[2]=s,d[3]=0,d[4]=u,d[5]=l,d[6]=c,d[7]=0,d[8]=r,d[9]=o,d[10]=h,d[11]=0,d[12]=-(_*m+u*g+r*k),d[13]=-(n*m+l*g+o*k),d[14]=-(s*m+c*g+h*k),d[15]=1,d)}},14787:function(D){D.exports=function(L,t,b){var d=t[0],e=t[1],w=t[2],y=t[3],_=t[4],u=t[5],r=t[6],n=t[7],l=t[8],o=t[9],s=t[10],c=t[11],h=t[12],x=t[13],m=t[14],g=t[15],k=b[0],A=b[1],v=b[2],S=b[3];return L[0]=k*d+A*_+v*l+S*h,L[1]=k*e+A*u+v*o+S*x,L[2]=k*w+A*r+v*s+S*m,L[3]=k*y+A*n+v*c+S*g,k=b[4],A=b[5],v=b[6],S=b[7],L[4]=k*d+A*_+v*l+S*h,L[5]=k*e+A*u+v*o+S*x,L[6]=k*w+A*r+v*s+S*m,L[7]=k*y+A*n+v*c+S*g,k=b[8],A=b[9],v=b[10],S=b[11],L[8]=k*d+A*_+v*l+S*h,L[9]=k*e+A*u+v*o+S*x,L[10]=k*w+A*r+v*s+S*m,L[11]=k*y+A*n+v*c+S*g,k=b[12],A=b[13],v=b[14],S=b[15],L[12]=k*d+A*_+v*l+S*h,L[13]=k*e+A*u+v*o+S*x,L[14]=k*w+A*r+v*s+S*m,L[15]=k*y+A*n+v*c+S*g,L}},4633:function(D){D.exports=function(L,t,b,d,e,w,y){var _=1/(t-b),u=1/(d-e),r=1/(w-y);return L[0]=-2*_,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=-2*u,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=2*r,L[11]=0,L[12]=(t+b)*_,L[13]=(e+d)*u,L[14]=(y+w)*r,L[15]=1,L}},5313:function(D){D.exports=function(L,t,b,d,e){var w=1/Math.tan(t/2),y=1/(d-e);return L[0]=w/b,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=w,L[6]=0,L[7]=0,L[8]=0,L[9]=0,L[10]=(e+d)*y,L[11]=-1,L[12]=0,L[13]=0,L[14]=2*e*d*y,L[15]=0,L}},22253:function(D){D.exports=function(L,t,b,d){var e=Math.tan(t.upDegrees*Math.PI/180),w=Math.tan(t.downDegrees*Math.PI/180),y=Math.tan(t.leftDegrees*Math.PI/180),_=Math.tan(t.rightDegrees*Math.PI/180),u=2/(y+_),r=2/(e+w);return L[0]=u,L[1]=0,L[2]=0,L[3]=0,L[4]=0,L[5]=r,L[6]=0,L[7]=0,L[8]=-(y-_)*u*.5,L[9]=(e-w)*r*.5,L[10]=d/(b-d),L[11]=-1,L[12]=0,L[13]=0,L[14]=d*b/(b-d),L[15]=0,L}},32416:function(D){D.exports=function(L,t,b,d){var e,w,y,_,u,r,n,l,o,s,c,h,x,m,g,k,A,v,S,T,p,M,f,E,I=d[0],B=d[1],N=d[2],V=Math.sqrt(I*I+B*B+N*N);return Math.abs(V)<1e-6?null:(I*=V=1/V,B*=V,N*=V,e=Math.sin(b),y=1-(w=Math.cos(b)),_=t[0],u=t[1],r=t[2],n=t[3],l=t[4],o=t[5],s=t[6],c=t[7],h=t[8],x=t[9],m=t[10],g=t[11],k=I*I*y+w,A=B*I*y+N*e,v=N*I*y-B*e,S=I*B*y-N*e,T=B*B*y+w,p=N*B*y+I*e,M=I*N*y+B*e,f=B*N*y-I*e,E=N*N*y+w,L[0]=_*k+l*A+h*v,L[1]=u*k+o*A+x*v,L[2]=r*k+s*A+m*v,L[3]=n*k+c*A+g*v,L[4]=_*S+l*T+h*p,L[5]=u*S+o*T+x*p,L[6]=r*S+s*T+m*p,L[7]=n*S+c*T+g*p,L[8]=_*M+l*f+h*E,L[9]=u*M+o*f+x*E,L[10]=r*M+s*f+m*E,L[11]=n*M+c*f+g*E,t!==L&&(L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L)}},81066:function(D){D.exports=function(L,t,b){var d=Math.sin(b),e=Math.cos(b),w=t[4],y=t[5],_=t[6],u=t[7],r=t[8],n=t[9],l=t[10],o=t[11];return t!==L&&(L[0]=t[0],L[1]=t[1],L[2]=t[2],L[3]=t[3],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L[4]=w*e+r*d,L[5]=y*e+n*d,L[6]=_*e+l*d,L[7]=u*e+o*d,L[8]=r*e-w*d,L[9]=n*e-y*d,L[10]=l*e-_*d,L[11]=o*e-u*d,L}},54201:function(D){D.exports=function(L,t,b){var d=Math.sin(b),e=Math.cos(b),w=t[0],y=t[1],_=t[2],u=t[3],r=t[8],n=t[9],l=t[10],o=t[11];return t!==L&&(L[4]=t[4],L[5]=t[5],L[6]=t[6],L[7]=t[7],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L[0]=w*e-r*d,L[1]=y*e-n*d,L[2]=_*e-l*d,L[3]=u*e-o*d,L[8]=w*d+r*e,L[9]=y*d+n*e,L[10]=_*d+l*e,L[11]=u*d+o*e,L}},33920:function(D){D.exports=function(L,t,b){var d=Math.sin(b),e=Math.cos(b),w=t[0],y=t[1],_=t[2],u=t[3],r=t[4],n=t[5],l=t[6],o=t[7];return t!==L&&(L[8]=t[8],L[9]=t[9],L[10]=t[10],L[11]=t[11],L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15]),L[0]=w*e+r*d,L[1]=y*e+n*d,L[2]=_*e+l*d,L[3]=u*e+o*d,L[4]=r*e-w*d,L[5]=n*e-y*d,L[6]=l*e-_*d,L[7]=o*e-u*d,L}},8697:function(D){D.exports=function(L,t,b){var d=b[0],e=b[1],w=b[2];return L[0]=t[0]*d,L[1]=t[1]*d,L[2]=t[2]*d,L[3]=t[3]*d,L[4]=t[4]*e,L[5]=t[5]*e,L[6]=t[6]*e,L[7]=t[7]*e,L[8]=t[8]*w,L[9]=t[9]*w,L[10]=t[10]*w,L[11]=t[11]*w,L[12]=t[12],L[13]=t[13],L[14]=t[14],L[15]=t[15],L}},66992:function(D){D.exports=function(L){return"mat4("+L[0]+", "+L[1]+", "+L[2]+", "+L[3]+", "+L[4]+", "+L[5]+", "+L[6]+", "+L[7]+", "+L[8]+", "+L[9]+", "+L[10]+", "+L[11]+", "+L[12]+", "+L[13]+", "+L[14]+", "+L[15]+")"}},4165:function(D){D.exports=function(L,t,b){var d,e,w,y,_,u,r,n,l,o,s,c,h=b[0],x=b[1],m=b[2];return t===L?(L[12]=t[0]*h+t[4]*x+t[8]*m+t[12],L[13]=t[1]*h+t[5]*x+t[9]*m+t[13],L[14]=t[2]*h+t[6]*x+t[10]*m+t[14],L[15]=t[3]*h+t[7]*x+t[11]*m+t[15]):(d=t[0],e=t[1],w=t[2],y=t[3],_=t[4],u=t[5],r=t[6],n=t[7],l=t[8],o=t[9],s=t[10],c=t[11],L[0]=d,L[1]=e,L[2]=w,L[3]=y,L[4]=_,L[5]=u,L[6]=r,L[7]=n,L[8]=l,L[9]=o,L[10]=s,L[11]=c,L[12]=d*h+_*x+l*m+t[12],L[13]=e*h+u*x+o*m+t[13],L[14]=w*h+r*x+s*m+t[14],L[15]=y*h+n*x+c*m+t[15]),L}},10256:function(D){D.exports=function(L,t){if(L===t){var b=t[1],d=t[2],e=t[3],w=t[6],y=t[7],_=t[11];L[1]=t[4],L[2]=t[8],L[3]=t[12],L[4]=b,L[6]=t[9],L[7]=t[13],L[8]=d,L[9]=w,L[11]=t[14],L[12]=e,L[13]=y,L[14]=_}else L[0]=t[0],L[1]=t[4],L[2]=t[8],L[3]=t[12],L[4]=t[1],L[5]=t[5],L[6]=t[9],L[7]=t[13],L[8]=t[2],L[9]=t[6],L[10]=t[10],L[11]=t[14],L[12]=t[3],L[13]=t[7],L[14]=t[11],L[15]=t[15];return L}},74024:function(D,L,t){var b=t(59518),d=t(6807),e=t(81330),w=t(38862),y=t(93103),_=t(162),u=t(68950),r=t(66127),n=t(5137),l=t(29388),o=t(4957),s=t(44626),c=t(44431),h=t(27976),x=t(12673),m=t(83473),g=t(54689).nextPow2,k=new y,A=!1;if(document.body){var v=document.body.appendChild(document.createElement("div"));v.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(v).fontStretch&&(A=!0),document.body.removeChild(v)}var S=function(T){(function(p){return typeof p=="function"&&p._gl&&p.prop&&p.texture&&p.buffer})(T)?(T={regl:T},this.gl=T.regl._gl):this.gl=w(T),this.shader=k.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=T.regl||e({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(),k.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(l(T)?T:{})};S.prototype.createShader=function(){var T=this.regl,p=T({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:T.prop("count"),offset:T.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:T.this("sizeBuffer")},width:{offset:0,stride:8,buffer:T.this("sizeBuffer")},char:T.this("charBuffer"),position:T.this("position")},uniforms:{atlasSize:function(M,f){return[f.atlas.width,f.atlas.height]},atlasDim:function(M,f){return[f.atlas.cols,f.atlas.rows]},atlas:function(M,f){return f.atlas.texture},charStep:function(M,f){return f.atlas.step},em:function(M,f){return f.atlas.em},color:T.prop("color"),opacity:T.prop("opacity"),viewport:T.this("viewportArray"),scale:T.this("scale"),align:T.prop("align"),baseline:T.prop("baseline"),translate:T.this("translate"),positionOffset:T.prop("positionOffset")},primitive:"points",viewport:T.this("viewport"),vert:` precision highp float; attribute float width, charOffset, char; attribute vec2 position; @@ -3337,7 +3337,7 @@ varying vec4 fragColor; void main() { gl_FragColor = fragColor; } -`,uniforms:{scale:x.prop("scale"),color:x.prop("fill"),scaleFract:x.prop("scaleFract"),translateFract:x.prop("translateFract"),translate:x.prop("translate"),opacity:x.prop("opacity"),pixelRatio:x.context("pixelRatio"),id:x.prop("id"),viewport:function(v,S){return[S.viewport.x,S.viewport.y,v.viewportWidth,v.viewportHeight]}},attributes:{position:{buffer:x.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:x.prop("positionFractBuffer"),stride:8,offset:8}},blend:k.blend,depth:{enable:!1},scissor:k.scissor,stencil:k.stencil,viewport:k.viewport}),rect:A,miter:m}},h.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},h.prototype.render=function(){for(var x,m=[],g=arguments.length;g--;)m[g]=arguments[g];m.length&&(x=this).update.apply(x,m),this.draw()},h.prototype.draw=function(){for(var x=this,m=[],g=arguments.length;g--;)m[g]=arguments[g];return(m.length?m:this.passes).forEach(function(k,A){var v;if(k&&Array.isArray(k))return(v=x).draw.apply(v,k);typeof k=="number"&&(k=x.passes[k]),k&&k.count>1&&k.opacity&&(x.regl._refresh(),k.fill&&k.triangles&&k.triangles.length>2&&x.shaders.fill(k),k.thickness&&(k.scale[0]*k.viewport.width>h.precisionThreshold||k.scale[1]*k.viewport.height>h.precisionThreshold||k.join==="rect"||!k.join&&(k.thickness<=2||k.count>=h.maxPoints)?x.shaders.rect(k):x.shaders.miter(k)))}),this},h.prototype.update=function(x){var m=this;if(x){x.length!=null?typeof x[0]=="number"&&(x=[{positions:x}]):Array.isArray(x)||(x=[x]);var g=this.regl,k=this.gl;if(x.forEach(function(p,M){var f=m.passes[M];if(p!==void 0)if(p!==null){if(typeof p[0]=="number"&&(p={positions:p}),p=w(p,{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"}),f||(m.passes[M]=f={id:M,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:g.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:g.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:g.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:g.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},p=e({},h.defaults,p)),p.thickness!=null&&(f.thickness=parseFloat(p.thickness)),p.opacity!=null&&(f.opacity=parseFloat(p.opacity)),p.miterLimit!=null&&(f.miterLimit=parseFloat(p.miterLimit)),p.overlay!=null&&(f.overlay=!!p.overlay,M=ie});(se=se.slice(0,oe)).push(ie)}for(var le=function(Ht){var Gt=$.slice(2*fe,2*se[Ht]).concat(ie?$.slice(2*ie):[]),st=(f.hole||[]).map(function(ft){return ft-ie+(se[Ht]-fe)}),Qe=_(Gt,st);Qe=Qe.map(function(ft){return ft+fe+(ft+fe1&&k.opacity&&(x.regl._refresh(),k.fill&&k.triangles&&k.triangles.length>2&&x.shaders.fill(k),k.thickness&&(k.scale[0]*k.viewport.width>h.precisionThreshold||k.scale[1]*k.viewport.height>h.precisionThreshold||k.join==="rect"||!k.join&&(k.thickness<=2||k.count>=h.maxPoints)?x.shaders.rect(k):x.shaders.miter(k)))}),this},h.prototype.update=function(x){var m=this;if(x){x.length!=null?typeof x[0]=="number"&&(x=[{positions:x}]):Array.isArray(x)||(x=[x]);var g=this.regl,k=this.gl;if(x.forEach(function(p,M){var f=m.passes[M];if(p!==void 0)if(p!==null){if(typeof p[0]=="number"&&(p={positions:p}),p=w(p,{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"}),f||(m.passes[M]=f={id:M,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:g.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:g.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:g.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:g.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},p=e({},h.defaults,p)),p.thickness!=null&&(f.thickness=parseFloat(p.thickness)),p.opacity!=null&&(f.opacity=parseFloat(p.opacity)),p.miterLimit!=null&&(f.miterLimit=parseFloat(p.miterLimit)),p.overlay!=null&&(f.overlay=!!p.overlay,M=ie});(se=se.slice(0,oe)).push(ie)}for(var le=function(Ht){var Gt=$.slice(2*fe,2*se[Ht]).concat(ie?$.slice(2*ie):[]),st=(f.hole||[]).map(function(pt){return pt-ie+(se[Ht]-fe)}),Qe=_(Gt,st);Qe=Qe.map(function(pt){return pt+fe+(pt+feA.length)&&(v=A.length);for(var S=0,T=new Array(v);SOe)?Ce.tree=u(Ee,{bounds:de}):Oe&&Oe.length&&(Ce.tree=Oe),Ce.tree){var Me={primitive:"points",usage:"static",data:Ce.tree,type:"uint32"};Ce.elements?Ce.elements(Me):Ce.elements=f.elements(Me)}var ke=h.float32(Ee);return We({data:ke,usage:"dynamic"}),Ie({data:h.fract32(Ee,ke),usage:"dynamic"}),Ve({data:new Uint8Array(Pe),type:"uint8",usage:"stream"}),Ee}},{marker:function(Ee,Ce,Le){var Oe=Ce.activation;if(Oe.forEach(function(ke){return ke&&ke.destroy&&ke.destroy()}),Oe.length=0,Ee&&typeof Ee[0]!="number"){for(var We=[],Ie=0,Ve=Math.min(Ee.length,Ce.count);Ie=0)return M;if(A instanceof Uint8Array||A instanceof Uint8ClampedArray)v=A;else{v=new Uint8Array(A.length);for(var f=0,E=A.length;f4*T&&(this.tooManyColors=!0),this.updatePalette(S),p.length===1?p[0]:p},g.prototype.updatePalette=function(A){if(!this.tooManyColors){var v=this.maxColors,S=this.paletteTexture,T=Math.ceil(.25*A.length/v);if(T>1)for(var p=.25*(A=A.slice()).length%v;p2?(A[0],A[2],x=A[1],m=A[3]):A.length?(x=A[0],m=A[1]):(A.x,x=A.y,A.x,A.width,m=A.y+A.height),v.length>2?(g=v[0],k=v[2],v[1],v[3]):v.length?(g=v[0],k=v[1]):(g=v.x,v.y,k=v.x+v.width,v.y,v.height),[g,x,k,m]}function o(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];var c=_(s);return[c.x,c.y,c.x+c.width,c.y+c.height]}D.exports=r,r.prototype.render=function(){for(var s,c=this,h=[],x=arguments.length;x--;)h[x]=arguments[x];return h.length&&(s=this).update.apply(s,h),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=w(function(){c.draw(),c.dirty=!0,c.planned=null})):(this.draw(),this.dirty=!0,w(function(){c.dirty=!1})),this)},r.prototype.update=function(){for(var s,c=[],h=arguments.length;h--;)c[h]=arguments[h];if(c.length){for(var x=0;xN))&&(g.lower||!(B"u"?1:window.devicePixelRatio,Bt=!1,Ft={},St=function(qt){},Jt=function(){};if(typeof Ut=="string"?ut=document.querySelector(Ut):typeof Ut=="object"&&(typeof Ut.nodeName=="string"&&typeof Ut.appendChild=="function"&&typeof Ut.getBoundingClientRect=="function"?ut=Ut:typeof Ut.drawArrays=="function"||typeof Ut.drawElements=="function"?vt=(Lt=Ut).canvas:("gl"in Ut?Lt=Ut.gl:"canvas"in Ut?vt=e(Ut.canvas):"container"in Ut&&(Tt=e(Ut.container)),"attributes"in Ut&&(Xe=Ut.attributes),"extensions"in Ut&&(rt=d(Ut.extensions)),"optionalExtensions"in Ut&&(et=d(Ut.optionalExtensions)),"onDone"in Ut&&(St=Ut.onDone),"profile"in Ut&&(Bt=!!Ut.profile),"pixelRatio"in Ut&&(Et=+Ut.pixelRatio),"cachedCode"in Ut&&(Ft=Ut.cachedCode))),ut&&(ut.nodeName.toLowerCase()==="canvas"?vt=ut:Tt=ut),!Lt){if(!vt){if(!(ut=function(qt,en,Wt){function Zt(){var Pn=window.innerWidth,Dn=window.innerHeight;qt!==document.body&&(Pn=(Dn=un.getBoundingClientRect()).right-Dn.left,Dn=Dn.bottom-Dn.top),un.width=Wt*Pn,un.height=Wt*Dn}var on,un=document.createElement("canvas");return oe(un.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),qt.appendChild(un),qt===document.body&&(un.style.position="absolute",oe(qt.style,{margin:0,padding:0})),qt!==document.body&&typeof ResizeObserver=="function"?(on=new ResizeObserver(function(){setTimeout(Zt)})).observe(qt):window.addEventListener("resize",Zt,!1),Zt(),{canvas:un,onDestroy:function(){on?on.disconnect():window.removeEventListener("resize",Zt),qt.removeChild(un)}}}(Tt||document.body,0,Et)))return null;vt=ut.canvas,Jt=ut.onDestroy}Xe.premultipliedAlpha===void 0&&(Xe.premultipliedAlpha=!0),Lt=function(qt,en){function Wt(Zt){try{return qt.getContext(Zt,en)}catch{return null}}return Wt("webgl")||Wt("experimental-webgl")||Wt("webgl-experimental")}(vt,Xe)}return Lt?{gl:Lt,canvas:vt,container:Tt,extensions:rt,optionalExtensions:et,pixelRatio:Et,profile:Bt,cachedCode:Ft,onDone:St,onDestroy:Jt}:(Jt(),St("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function y(Xe,ut){for(var Tt=Array(Xe),vt=0;vt>>=ut))<<3,(ut|=Tt=(15<(Xe>>>=Tt))<<2)|(Tt=(3<(Xe>>>=Tt))<<1)|Xe>>>Tt>>1}function u(){function Xe(vt){e:{for(var Lt=16;268435456>=Lt;Lt*=16)if(vt<=Lt){vt=Lt;break e}vt=0}return 0<(Lt=Tt[_(vt)>>2]).length?Lt.pop():new ArrayBuffer(vt)}function ut(vt){Tt[_(vt.byteLength)>>2].push(vt)}var Tt=y(8,function(){return[]});return{alloc:Xe,free:ut,allocType:function(vt,Lt){var Ut=null;switch(vt){case 5120:Ut=new Int8Array(Xe(Lt),0,Lt);break;case 5121:Ut=new Uint8Array(Xe(Lt),0,Lt);break;case 5122:Ut=new Int16Array(Xe(2*Lt),0,Lt);break;case 5123:Ut=new Uint16Array(Xe(2*Lt),0,Lt);break;case 5124:Ut=new Int32Array(Xe(4*Lt),0,Lt);break;case 5125:Ut=new Uint32Array(Xe(4*Lt),0,Lt);break;case 5126:Ut=new Float32Array(Xe(4*Lt),0,Lt);break;default:return null}return Ut.length!==Lt?Ut.subarray(0,Lt):Ut},freeType:function(vt){ut(vt.buffer)}}}function r(Xe){return!!Xe&&typeof Xe=="object"&&Array.isArray(Xe.shape)&&Array.isArray(Xe.stride)&&typeof Xe.offset=="number"&&Xe.shape.length===Xe.stride.length&&(Array.isArray(Xe.data)||Ee(Xe.data))}function n(Xe,ut,Tt,vt,Lt,Ut){for(var rt=0;rt(Jt=Wt)&&(Jt=St.buffer.byteLength,un===5123?Jt>>=1:un===5125&&(Jt>>=2)),St.vertCount=Jt,Jt=en,0>en&&(Jt=4,(en=St.buffer.dimension)===1&&(Jt=0),en===2&&(Jt=1),en===3&&(Jt=4)),St.primType=Jt}function rt(St){vt.elementsCount--,delete et[St.id],St.buffer.destroy(),St.buffer=null}var et={},Et=0,Bt={uint8:5121,uint16:5123};ut.oes_element_index_uint&&(Bt.uint32=5125),Lt.prototype.bind=function(){this.buffer.bind()};var Ft=[];return{create:function(St,Jt){function qt(Zt){if(Zt)if(typeof Zt=="number")en(Zt),Wt.primType=4,Wt.vertCount=0|Zt,Wt.type=5121;else{var on=null,un=35044,Pn=-1,Dn=-1,In=0,mn=0;Array.isArray(Zt)||Ee(Zt)||r(Zt)?on=Zt:("data"in Zt&&(on=Zt.data),"usage"in Zt&&(un=Ie[Zt.usage]),"primitive"in Zt&&(Pn=Me[Zt.primitive]),"count"in Zt&&(Dn=0|Zt.count),"type"in Zt&&(mn=Bt[Zt.type]),"length"in Zt?In=0|Zt.length:(In=Dn,mn===5123||mn===5122?In*=2:mn!==5125&&mn!==5124||(In*=4))),Ut(Wt,on,un,Pn,Dn,In,mn)}else en(),Wt.primType=4,Wt.vertCount=0,Wt.type=5121;return qt}var en=Tt.create(null,34963,!0),Wt=new Lt(en._buffer);return vt.elementsCount++,qt(St),qt._reglType="elements",qt._elements=Wt,qt.subdata=function(Zt,on){return en.subdata(Zt,on),qt},qt.destroy=function(){rt(Wt)},qt},createStream:function(St){var Jt=Ft.pop();return Jt||(Jt=new Lt(Tt.create(null,34963,!0,!1)._buffer)),Ut(Jt,St,35040,-1,-1,0,0),Jt},destroyStream:function(St){Ft.push(St)},getElements:function(St){return typeof St=="function"&&St._elements instanceof Lt?St._elements:null},clear:function(){Ce(et).forEach(rt)}}}function m(Xe){for(var ut=be.allocType(5123,Xe.length),Tt=0;Tt>>31<<15,Lt=(Ut<<1>>>24)-127,Ut=Ut>>13&1023;ut[Tt]=-24>Lt?vt:-14>Lt?vt+(Ut+1024>>-14-Lt):15>=gn,an.height>>=gn,Jt(an,_n[gn]),bn.mipmask|=1<Yn;++Yn)bn.images[Yn]=null;return bn}function In(bn){for(var Yn=bn.images,an=0;anbn){for(var Yn=0;Yn=--this.refCount&&wn(this)}}),rt.profile&&(Ut.getTotalTextureSize=function(){var bn=0;return Object.keys(Er).forEach(function(Yn){bn+=Er[Yn].stats.size}),bn}),{create2D:function(bn,Yn){function an(gn,qn){var Un=_n.texInfo;mn.call(Un);var tr=Dn();return typeof gn=="number"?on(tr,0|gn,typeof qn=="number"?0|qn:0|gn):gn?(En(Un,gn),un(tr,gn)):on(tr,1,1),Un.genMipmaps&&(tr.mipmask=(tr.width<<1)-1),_n.mipmask=tr.mipmask,Et(_n,tr),_n.internalformat=tr.internalformat,an.width=tr.width,an.height=tr.height,Tn(_n),Pn(tr,3553),Kn(Un,3553),Fn(),In(tr),rt.profile&&(_n.stats.size=M(_n.internalformat,_n.type,tr.width,tr.height,Un.genMipmaps,!1)),an.format=Ar[_n.internalformat],an.type=xr[_n.type],an.mag=Qr[Un.magFilter],an.min=kn[Un.minFilter],an.wrapS=Cn[Un.wrapS],an.wrapT=Cn[Un.wrapT],an}var _n=new Ln(3553);return Er[_n.id]=_n,Ut.textureCount++,an(bn,Yn),an.subimage=function(gn,qn,Un,tr){qn|=0,Un|=0,tr|=0;var Wn=en();return Et(Wn,_n),Wn.width=0,Wn.height=0,Jt(Wn,gn),Wn.width=Wn.width||(_n.width>>tr)-qn,Wn.height=Wn.height||(_n.height>>tr)-Un,Tn(_n),qt(Wn,3553,qn,Un,tr),Fn(),Wt(Wn),an},an.resize=function(gn,qn){var Un=0|gn,tr=0|qn||Un;if(Un===_n.width&&tr===_n.height)return an;an.width=_n.width=Un,an.height=_n.height=tr,Tn(_n);for(var Wn=0;_n.mipmask>>Wn;++Wn){var Bn=Un>>Wn,dn=tr>>Wn;if(!Bn||!dn)break;Xe.texImage2D(3553,Wn,_n.format,Bn,dn,0,_n.format,_n.type,null)}return Fn(),rt.profile&&(_n.stats.size=M(_n.internalformat,_n.type,Un,tr,!1,!1)),an},an._reglType="texture2d",an._texture=_n,rt.profile&&(an.stats=_n.stats),an.destroy=function(){_n.decRef()},an},createCube:function(bn,Yn,an,_n,gn,qn){function Un(Bn,dn,ln,An,er,br){var Tr,yr=tr.texInfo;for(mn.call(yr),Tr=0;6>Tr;++Tr)Wn[Tr]=Dn();if(typeof Bn!="number"&&Bn){if(typeof Bn=="object")if(dn)un(Wn[0],Bn),un(Wn[1],dn),un(Wn[2],ln),un(Wn[3],An),un(Wn[4],er),un(Wn[5],br);else if(En(yr,Bn),Bt(tr,Bn),"faces"in Bn)for(Bn=Bn.faces,Tr=0;6>Tr;++Tr)Et(Wn[Tr],tr),un(Wn[Tr],Bn[Tr]);else for(Tr=0;6>Tr;++Tr)un(Wn[Tr],Bn)}else for(Bn=0|Bn||1,Tr=0;6>Tr;++Tr)on(Wn[Tr],Bn,Bn);for(Et(tr,Wn[0]),tr.mipmask=yr.genMipmaps?(Wn[0].width<<1)-1:Wn[0].mipmask,tr.internalformat=Wn[0].internalformat,Un.width=Wn[0].width,Un.height=Wn[0].height,Tn(tr),Tr=0;6>Tr;++Tr)Pn(Wn[Tr],34069+Tr);for(Kn(yr,34067),Fn(),rt.profile&&(tr.stats.size=M(tr.internalformat,tr.type,Un.width,Un.height,yr.genMipmaps,!0)),Un.format=Ar[tr.internalformat],Un.type=xr[tr.type],Un.mag=Qr[yr.magFilter],Un.min=kn[yr.minFilter],Un.wrapS=Cn[yr.wrapS],Un.wrapT=Cn[yr.wrapT],Tr=0;6>Tr;++Tr)In(Wn[Tr]);return Un}var tr=new Ln(34067);Er[tr.id]=tr,Ut.cubeCount++;var Wn=Array(6);return Un(bn,Yn,an,_n,gn,qn),Un.subimage=function(Bn,dn,ln,An,er){ln|=0,An|=0,er|=0;var br=en();return Et(br,tr),br.width=0,br.height=0,Jt(br,dn),br.width=br.width||(tr.width>>er)-ln,br.height=br.height||(tr.height>>er)-An,Tn(tr),qt(br,34069+Bn,ln,An,er),Fn(),Wt(br),Un},Un.resize=function(Bn){if((Bn|=0)!==tr.width){Un.width=tr.width=Bn,Un.height=tr.height=Bn,Tn(tr);for(var dn=0;6>dn;++dn)for(var ln=0;tr.mipmask>>ln;++ln)Xe.texImage2D(34069+dn,ln,tr.format,Bn>>ln,Bn>>ln,0,tr.format,tr.type,null);return Fn(),rt.profile&&(tr.stats.size=M(tr.internalformat,tr.type,Un.width,Un.height,!1,!0)),Un}},Un._reglType="textureCube",Un._texture=tr,rt.profile&&(Un.stats=tr.stats),Un.destroy=function(){tr.decRef()},Un},clear:function(){for(var bn=0;bn_n;++_n)if(an.mipmask&1<<_n)if(an.target===3553)Xe.texImage2D(3553,_n,an.internalformat,an.width>>_n,an.height>>_n,0,an.internalformat,an.type,null);else for(var gn=0;6>gn;++gn)Xe.texImage2D(34069+gn,_n,an.internalformat,an.width>>_n,an.height>>_n,0,an.internalformat,an.type,null);Kn(an.texInfo,an.target)})},refresh:function(){for(var bn=0;bnzn;++zn){for(lr=0;lrwn;++wn)Fn[wn].resize(zn);return Tn.width=Tn.height=zn,Tn},_reglType:"framebufferCube",destroy:function(){Fn.forEach(function(wn){wn.destroy()})}})},clear:function(){Ce(Kn).forEach(Zt)},restore:function(){Pn.cur=null,Pn.next=null,Pn.dirty=!0,Ce(Kn).forEach(function(Ln){Ln.framebuffer=Xe.createFramebuffer(),on(Ln)})}})}function I(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function B(Xe,ut,Tt,vt,Lt,Ut,rt){function et(){this.id=++Ft,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var qt=ut.oes_vertex_array_object;this.vao=qt?qt.createVertexArrayOES():null,St[this.id]=this,this.buffers=[]}var Et=Tt.maxAttributes,Bt=Array(Et);for(Tt=0;Tt=En.byteLength?Dn.subdata(En):(Dn.destroy(),Wt.buffers[Pn]=null)),Wt.buffers[Pn]||(Dn=Wt.buffers[Pn]=Lt.create(In,34962,!1,!0)),mn.buffer=Lt.getBuffer(Dn),mn.size=0|mn.buffer.dimension,mn.normalized=!1,mn.type=mn.buffer.dtype,mn.offset=0,mn.stride=0,mn.divisor=0,mn.state=1,Zt[Pn]=1):Lt.getBuffer(In)?(mn.buffer=Lt.getBuffer(In),mn.size=0|mn.buffer.dimension,mn.normalized=!1,mn.type=mn.buffer.dtype,mn.offset=0,mn.stride=0,mn.divisor=0,mn.state=1):Lt.getBuffer(In.buffer)?(mn.buffer=Lt.getBuffer(In.buffer),mn.size=0|(+In.size||mn.buffer.dimension),mn.normalized=!!In.normalized||!1,mn.type="type"in In?We[In.type]:mn.buffer.dtype,mn.offset=0|(In.offset||0),mn.stride=0|(In.stride||0),mn.divisor=0|(In.divisor||0),mn.state=1):"x"in In&&(mn.x=+In.x||0,mn.y=+In.y||0,mn.z=+In.z||0,mn.w=+In.w||0,mn.state=2)}for(Dn=0;Dnen&&(en=Wt.stats.uniformsCount)}),en},Tt.getMaxAttributesCount=function(){var en=0;return Jt.forEach(function(Wt){Wt.stats.attributesCount>en&&(en=Wt.stats.attributesCount)}),en}),{clear:function(){var en=Xe.deleteShader.bind(Xe);Ce(Bt).forEach(en),Bt={},Ce(Ft).forEach(en),Ft={},Jt.forEach(function(Wt){Xe.deleteProgram(Wt.program)}),Jt.length=0,St={},Tt.shaderCount=0},program:function(en,Wt,Zt,on){var un=St[Wt];un||(un=St[Wt]={});var Pn=un[en];if(Pn&&(Pn.refCount++,!on))return Pn;var Dn=new et(Wt,en);return Tt.shaderCount++,Et(Dn,Zt,on),Pn||(un[en]=Dn),Jt.push(Dn),oe(Dn,{destroy:function(){if(Dn.refCount--,0>=Dn.refCount){Xe.deleteProgram(Dn.program);var In=Jt.indexOf(Dn);Jt.splice(In,1),Tt.shaderCount--}0>=un[Dn.vertId].refCount&&(Xe.deleteShader(Ft[Dn.vertId]),delete Ft[Dn.vertId],delete St[Dn.fragId][Dn.vertId]),Object.keys(St[Dn.fragId]).length||(Xe.deleteShader(Bt[Dn.fragId]),delete Bt[Dn.fragId],delete St[Dn.fragId])}})},restore:function(){Bt={},Ft={};for(var en=0;en>>ut|Xe<<32-ut}function $(Xe,ut){var Tt=(65535&Xe)+(65535&ut);return(Xe>>16)+(ut>>16)+(Tt>>16)<<16|65535&Tt}function ee(Xe){return Array.prototype.slice.call(Xe)}function H(Xe){return ee(Xe).join("")}function J(Xe){function ut(){var Ft=[],St=[];return oe(function(){Ft.push.apply(Ft,ee(arguments))},{def:function(){var Jt="v"+Lt++;return St.push(Jt),0Oe)?Ce.tree=u(Ee,{bounds:de}):Oe&&Oe.length&&(Ce.tree=Oe),Ce.tree){var Me={primitive:"points",usage:"static",data:Ce.tree,type:"uint32"};Ce.elements?Ce.elements(Me):Ce.elements=f.elements(Me)}var ke=h.float32(Ee);return We({data:ke,usage:"dynamic"}),Ie({data:h.fract32(Ee,ke),usage:"dynamic"}),Ve({data:new Uint8Array(Pe),type:"uint8",usage:"stream"}),Ee}},{marker:function(Ee,Ce,Le){var Oe=Ce.activation;if(Oe.forEach(function(ke){return ke&&ke.destroy&&ke.destroy()}),Oe.length=0,Ee&&typeof Ee[0]!="number"){for(var We=[],Ie=0,Ve=Math.min(Ee.length,Ce.count);Ie=0)return M;if(A instanceof Uint8Array||A instanceof Uint8ClampedArray)v=A;else{v=new Uint8Array(A.length);for(var f=0,E=A.length;f4*T&&(this.tooManyColors=!0),this.updatePalette(S),p.length===1?p[0]:p},g.prototype.updatePalette=function(A){if(!this.tooManyColors){var v=this.maxColors,S=this.paletteTexture,T=Math.ceil(.25*A.length/v);if(T>1)for(var p=.25*(A=A.slice()).length%v;p2?(A[0],A[2],x=A[1],m=A[3]):A.length?(x=A[0],m=A[1]):(A.x,x=A.y,A.x,A.width,m=A.y+A.height),v.length>2?(g=v[0],k=v[2],v[1],v[3]):v.length?(g=v[0],k=v[1]):(g=v.x,v.y,k=v.x+v.width,v.y,v.height),[g,x,k,m]}function o(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];var c=_(s);return[c.x,c.y,c.x+c.width,c.y+c.height]}D.exports=r,r.prototype.render=function(){for(var s,c=this,h=[],x=arguments.length;x--;)h[x]=arguments[x];return h.length&&(s=this).update.apply(s,h),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?this.planned==null&&(this.planned=w(function(){c.draw(),c.dirty=!0,c.planned=null})):(this.draw(),this.dirty=!0,w(function(){c.dirty=!1})),this)},r.prototype.update=function(){for(var s,c=[],h=arguments.length;h--;)c[h]=arguments[h];if(c.length){for(var x=0;xN))&&(g.lower||!(B"u"?1:window.devicePixelRatio,Bt=!1,Ft={},St=function(qt){},Jt=function(){};if(typeof jt=="string"?ut=document.querySelector(jt):typeof jt=="object"&&(typeof jt.nodeName=="string"&&typeof jt.appendChild=="function"&&typeof jt.getBoundingClientRect=="function"?ut=jt:typeof jt.drawArrays=="function"||typeof jt.drawElements=="function"?vt=(Lt=jt).canvas:("gl"in jt?Lt=jt.gl:"canvas"in jt?vt=e(jt.canvas):"container"in jt&&(wt=e(jt.container)),"attributes"in jt&&(Xe=jt.attributes),"extensions"in jt&&(rt=d(jt.extensions)),"optionalExtensions"in jt&&(et=d(jt.optionalExtensions)),"onDone"in jt&&(St=jt.onDone),"profile"in jt&&(Bt=!!jt.profile),"pixelRatio"in jt&&(Et=+jt.pixelRatio),"cachedCode"in jt&&(Ft=jt.cachedCode))),ut&&(ut.nodeName.toLowerCase()==="canvas"?vt=ut:wt=ut),!Lt){if(!vt){if(!(ut=function(qt,en,Wt){function Zt(){var Pn=window.innerWidth,Dn=window.innerHeight;qt!==document.body&&(Pn=(Dn=un.getBoundingClientRect()).right-Dn.left,Dn=Dn.bottom-Dn.top),un.width=Wt*Pn,un.height=Wt*Dn}var on,un=document.createElement("canvas");return oe(un.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),qt.appendChild(un),qt===document.body&&(un.style.position="absolute",oe(qt.style,{margin:0,padding:0})),qt!==document.body&&typeof ResizeObserver=="function"?(on=new ResizeObserver(function(){setTimeout(Zt)})).observe(qt):window.addEventListener("resize",Zt,!1),Zt(),{canvas:un,onDestroy:function(){on?on.disconnect():window.removeEventListener("resize",Zt),qt.removeChild(un)}}}(wt||document.body,0,Et)))return null;vt=ut.canvas,Jt=ut.onDestroy}Xe.premultipliedAlpha===void 0&&(Xe.premultipliedAlpha=!0),Lt=function(qt,en){function Wt(Zt){try{return qt.getContext(Zt,en)}catch{return null}}return Wt("webgl")||Wt("experimental-webgl")||Wt("webgl-experimental")}(vt,Xe)}return Lt?{gl:Lt,canvas:vt,container:wt,extensions:rt,optionalExtensions:et,pixelRatio:Et,profile:Bt,cachedCode:Ft,onDone:St,onDestroy:Jt}:(Jt(),St("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function y(Xe,ut){for(var wt=Array(Xe),vt=0;vt>>=ut))<<3,(ut|=wt=(15<(Xe>>>=wt))<<2)|(wt=(3<(Xe>>>=wt))<<1)|Xe>>>wt>>1}function u(){function Xe(vt){e:{for(var Lt=16;268435456>=Lt;Lt*=16)if(vt<=Lt){vt=Lt;break e}vt=0}return 0<(Lt=wt[_(vt)>>2]).length?Lt.pop():new ArrayBuffer(vt)}function ut(vt){wt[_(vt.byteLength)>>2].push(vt)}var wt=y(8,function(){return[]});return{alloc:Xe,free:ut,allocType:function(vt,Lt){var jt=null;switch(vt){case 5120:jt=new Int8Array(Xe(Lt),0,Lt);break;case 5121:jt=new Uint8Array(Xe(Lt),0,Lt);break;case 5122:jt=new Int16Array(Xe(2*Lt),0,Lt);break;case 5123:jt=new Uint16Array(Xe(2*Lt),0,Lt);break;case 5124:jt=new Int32Array(Xe(4*Lt),0,Lt);break;case 5125:jt=new Uint32Array(Xe(4*Lt),0,Lt);break;case 5126:jt=new Float32Array(Xe(4*Lt),0,Lt);break;default:return null}return jt.length!==Lt?jt.subarray(0,Lt):jt},freeType:function(vt){ut(vt.buffer)}}}function r(Xe){return!!Xe&&typeof Xe=="object"&&Array.isArray(Xe.shape)&&Array.isArray(Xe.stride)&&typeof Xe.offset=="number"&&Xe.shape.length===Xe.stride.length&&(Array.isArray(Xe.data)||Ee(Xe.data))}function n(Xe,ut,wt,vt,Lt,jt){for(var rt=0;rt(Jt=Wt)&&(Jt=St.buffer.byteLength,un===5123?Jt>>=1:un===5125&&(Jt>>=2)),St.vertCount=Jt,Jt=en,0>en&&(Jt=4,(en=St.buffer.dimension)===1&&(Jt=0),en===2&&(Jt=1),en===3&&(Jt=4)),St.primType=Jt}function rt(St){vt.elementsCount--,delete et[St.id],St.buffer.destroy(),St.buffer=null}var et={},Et=0,Bt={uint8:5121,uint16:5123};ut.oes_element_index_uint&&(Bt.uint32=5125),Lt.prototype.bind=function(){this.buffer.bind()};var Ft=[];return{create:function(St,Jt){function qt(Zt){if(Zt)if(typeof Zt=="number")en(Zt),Wt.primType=4,Wt.vertCount=0|Zt,Wt.type=5121;else{var on=null,un=35044,Pn=-1,Dn=-1,In=0,mn=0;Array.isArray(Zt)||Ee(Zt)||r(Zt)?on=Zt:("data"in Zt&&(on=Zt.data),"usage"in Zt&&(un=Ie[Zt.usage]),"primitive"in Zt&&(Pn=Me[Zt.primitive]),"count"in Zt&&(Dn=0|Zt.count),"type"in Zt&&(mn=Bt[Zt.type]),"length"in Zt?In=0|Zt.length:(In=Dn,mn===5123||mn===5122?In*=2:mn!==5125&&mn!==5124||(In*=4))),jt(Wt,on,un,Pn,Dn,In,mn)}else en(),Wt.primType=4,Wt.vertCount=0,Wt.type=5121;return qt}var en=wt.create(null,34963,!0),Wt=new Lt(en._buffer);return vt.elementsCount++,qt(St),qt._reglType="elements",qt._elements=Wt,qt.subdata=function(Zt,on){return en.subdata(Zt,on),qt},qt.destroy=function(){rt(Wt)},qt},createStream:function(St){var Jt=Ft.pop();return Jt||(Jt=new Lt(wt.create(null,34963,!0,!1)._buffer)),jt(Jt,St,35040,-1,-1,0,0),Jt},destroyStream:function(St){Ft.push(St)},getElements:function(St){return typeof St=="function"&&St._elements instanceof Lt?St._elements:null},clear:function(){Ce(et).forEach(rt)}}}function m(Xe){for(var ut=be.allocType(5123,Xe.length),wt=0;wt>>31<<15,Lt=(jt<<1>>>24)-127,jt=jt>>13&1023;ut[wt]=-24>Lt?vt:-14>Lt?vt+(jt+1024>>-14-Lt):15>=gn,an.height>>=gn,Jt(an,_n[gn]),bn.mipmask|=1<Yn;++Yn)bn.images[Yn]=null;return bn}function In(bn){for(var Yn=bn.images,an=0;anbn){for(var Yn=0;Yn=--this.refCount&&wn(this)}}),rt.profile&&(jt.getTotalTextureSize=function(){var bn=0;return Object.keys(Er).forEach(function(Yn){bn+=Er[Yn].stats.size}),bn}),{create2D:function(bn,Yn){function an(gn,qn){var Un=_n.texInfo;mn.call(Un);var tr=Dn();return typeof gn=="number"?on(tr,0|gn,typeof qn=="number"?0|qn:0|gn):gn?(En(Un,gn),un(tr,gn)):on(tr,1,1),Un.genMipmaps&&(tr.mipmask=(tr.width<<1)-1),_n.mipmask=tr.mipmask,Et(_n,tr),_n.internalformat=tr.internalformat,an.width=tr.width,an.height=tr.height,Tn(_n),Pn(tr,3553),Kn(Un,3553),Fn(),In(tr),rt.profile&&(_n.stats.size=M(_n.internalformat,_n.type,tr.width,tr.height,Un.genMipmaps,!1)),an.format=Ar[_n.internalformat],an.type=xr[_n.type],an.mag=Qr[Un.magFilter],an.min=kn[Un.minFilter],an.wrapS=Cn[Un.wrapS],an.wrapT=Cn[Un.wrapT],an}var _n=new Ln(3553);return Er[_n.id]=_n,jt.textureCount++,an(bn,Yn),an.subimage=function(gn,qn,Un,tr){qn|=0,Un|=0,tr|=0;var Wn=en();return Et(Wn,_n),Wn.width=0,Wn.height=0,Jt(Wn,gn),Wn.width=Wn.width||(_n.width>>tr)-qn,Wn.height=Wn.height||(_n.height>>tr)-Un,Tn(_n),qt(Wn,3553,qn,Un,tr),Fn(),Wt(Wn),an},an.resize=function(gn,qn){var Un=0|gn,tr=0|qn||Un;if(Un===_n.width&&tr===_n.height)return an;an.width=_n.width=Un,an.height=_n.height=tr,Tn(_n);for(var Wn=0;_n.mipmask>>Wn;++Wn){var Bn=Un>>Wn,dn=tr>>Wn;if(!Bn||!dn)break;Xe.texImage2D(3553,Wn,_n.format,Bn,dn,0,_n.format,_n.type,null)}return Fn(),rt.profile&&(_n.stats.size=M(_n.internalformat,_n.type,Un,tr,!1,!1)),an},an._reglType="texture2d",an._texture=_n,rt.profile&&(an.stats=_n.stats),an.destroy=function(){_n.decRef()},an},createCube:function(bn,Yn,an,_n,gn,qn){function Un(Bn,dn,ln,An,er,br){var Tr,yr=tr.texInfo;for(mn.call(yr),Tr=0;6>Tr;++Tr)Wn[Tr]=Dn();if(typeof Bn!="number"&&Bn){if(typeof Bn=="object")if(dn)un(Wn[0],Bn),un(Wn[1],dn),un(Wn[2],ln),un(Wn[3],An),un(Wn[4],er),un(Wn[5],br);else if(En(yr,Bn),Bt(tr,Bn),"faces"in Bn)for(Bn=Bn.faces,Tr=0;6>Tr;++Tr)Et(Wn[Tr],tr),un(Wn[Tr],Bn[Tr]);else for(Tr=0;6>Tr;++Tr)un(Wn[Tr],Bn)}else for(Bn=0|Bn||1,Tr=0;6>Tr;++Tr)on(Wn[Tr],Bn,Bn);for(Et(tr,Wn[0]),tr.mipmask=yr.genMipmaps?(Wn[0].width<<1)-1:Wn[0].mipmask,tr.internalformat=Wn[0].internalformat,Un.width=Wn[0].width,Un.height=Wn[0].height,Tn(tr),Tr=0;6>Tr;++Tr)Pn(Wn[Tr],34069+Tr);for(Kn(yr,34067),Fn(),rt.profile&&(tr.stats.size=M(tr.internalformat,tr.type,Un.width,Un.height,yr.genMipmaps,!0)),Un.format=Ar[tr.internalformat],Un.type=xr[tr.type],Un.mag=Qr[yr.magFilter],Un.min=kn[yr.minFilter],Un.wrapS=Cn[yr.wrapS],Un.wrapT=Cn[yr.wrapT],Tr=0;6>Tr;++Tr)In(Wn[Tr]);return Un}var tr=new Ln(34067);Er[tr.id]=tr,jt.cubeCount++;var Wn=Array(6);return Un(bn,Yn,an,_n,gn,qn),Un.subimage=function(Bn,dn,ln,An,er){ln|=0,An|=0,er|=0;var br=en();return Et(br,tr),br.width=0,br.height=0,Jt(br,dn),br.width=br.width||(tr.width>>er)-ln,br.height=br.height||(tr.height>>er)-An,Tn(tr),qt(br,34069+Bn,ln,An,er),Fn(),Wt(br),Un},Un.resize=function(Bn){if((Bn|=0)!==tr.width){Un.width=tr.width=Bn,Un.height=tr.height=Bn,Tn(tr);for(var dn=0;6>dn;++dn)for(var ln=0;tr.mipmask>>ln;++ln)Xe.texImage2D(34069+dn,ln,tr.format,Bn>>ln,Bn>>ln,0,tr.format,tr.type,null);return Fn(),rt.profile&&(tr.stats.size=M(tr.internalformat,tr.type,Un.width,Un.height,!1,!0)),Un}},Un._reglType="textureCube",Un._texture=tr,rt.profile&&(Un.stats=tr.stats),Un.destroy=function(){tr.decRef()},Un},clear:function(){for(var bn=0;bn_n;++_n)if(an.mipmask&1<<_n)if(an.target===3553)Xe.texImage2D(3553,_n,an.internalformat,an.width>>_n,an.height>>_n,0,an.internalformat,an.type,null);else for(var gn=0;6>gn;++gn)Xe.texImage2D(34069+gn,_n,an.internalformat,an.width>>_n,an.height>>_n,0,an.internalformat,an.type,null);Kn(an.texInfo,an.target)})},refresh:function(){for(var bn=0;bnzn;++zn){for(lr=0;lrwn;++wn)Fn[wn].resize(zn);return Tn.width=Tn.height=zn,Tn},_reglType:"framebufferCube",destroy:function(){Fn.forEach(function(wn){wn.destroy()})}})},clear:function(){Ce(Kn).forEach(Zt)},restore:function(){Pn.cur=null,Pn.next=null,Pn.dirty=!0,Ce(Kn).forEach(function(Ln){Ln.framebuffer=Xe.createFramebuffer(),on(Ln)})}})}function I(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function B(Xe,ut,wt,vt,Lt,jt,rt){function et(){this.id=++Ft,this.attributes=[],this.elements=null,this.ownsElements=!1,this.offset=this.count=0,this.instances=-1,this.primitive=4;var qt=ut.oes_vertex_array_object;this.vao=qt?qt.createVertexArrayOES():null,St[this.id]=this,this.buffers=[]}var Et=wt.maxAttributes,Bt=Array(Et);for(wt=0;wt=En.byteLength?Dn.subdata(En):(Dn.destroy(),Wt.buffers[Pn]=null)),Wt.buffers[Pn]||(Dn=Wt.buffers[Pn]=Lt.create(In,34962,!1,!0)),mn.buffer=Lt.getBuffer(Dn),mn.size=0|mn.buffer.dimension,mn.normalized=!1,mn.type=mn.buffer.dtype,mn.offset=0,mn.stride=0,mn.divisor=0,mn.state=1,Zt[Pn]=1):Lt.getBuffer(In)?(mn.buffer=Lt.getBuffer(In),mn.size=0|mn.buffer.dimension,mn.normalized=!1,mn.type=mn.buffer.dtype,mn.offset=0,mn.stride=0,mn.divisor=0,mn.state=1):Lt.getBuffer(In.buffer)?(mn.buffer=Lt.getBuffer(In.buffer),mn.size=0|(+In.size||mn.buffer.dimension),mn.normalized=!!In.normalized||!1,mn.type="type"in In?We[In.type]:mn.buffer.dtype,mn.offset=0|(In.offset||0),mn.stride=0|(In.stride||0),mn.divisor=0|(In.divisor||0),mn.state=1):"x"in In&&(mn.x=+In.x||0,mn.y=+In.y||0,mn.z=+In.z||0,mn.w=+In.w||0,mn.state=2)}for(Dn=0;Dnen&&(en=Wt.stats.uniformsCount)}),en},wt.getMaxAttributesCount=function(){var en=0;return Jt.forEach(function(Wt){Wt.stats.attributesCount>en&&(en=Wt.stats.attributesCount)}),en}),{clear:function(){var en=Xe.deleteShader.bind(Xe);Ce(Bt).forEach(en),Bt={},Ce(Ft).forEach(en),Ft={},Jt.forEach(function(Wt){Xe.deleteProgram(Wt.program)}),Jt.length=0,St={},wt.shaderCount=0},program:function(en,Wt,Zt,on){var un=St[Wt];un||(un=St[Wt]={});var Pn=un[en];if(Pn&&(Pn.refCount++,!on))return Pn;var Dn=new et(Wt,en);return wt.shaderCount++,Et(Dn,Zt,on),Pn||(un[en]=Dn),Jt.push(Dn),oe(Dn,{destroy:function(){if(Dn.refCount--,0>=Dn.refCount){Xe.deleteProgram(Dn.program);var In=Jt.indexOf(Dn);Jt.splice(In,1),wt.shaderCount--}0>=un[Dn.vertId].refCount&&(Xe.deleteShader(Ft[Dn.vertId]),delete Ft[Dn.vertId],delete St[Dn.fragId][Dn.vertId]),Object.keys(St[Dn.fragId]).length||(Xe.deleteShader(Bt[Dn.fragId]),delete Bt[Dn.fragId],delete St[Dn.fragId])}})},restore:function(){Bt={},Ft={};for(var en=0;en>>ut|Xe<<32-ut}function $(Xe,ut){var wt=(65535&Xe)+(65535&ut);return(Xe>>16)+(ut>>16)+(wt>>16)<<16|65535&wt}function ee(Xe){return Array.prototype.slice.call(Xe)}function H(Xe){return ee(Xe).join("")}function J(Xe){function ut(){var Ft=[],St=[];return oe(function(){Ft.push.apply(Ft,ee(arguments))},{def:function(){var Jt="v"+Lt++;return St.push(Jt),0>>4&15)+"0123456789abcdef".charAt(15&en);return Wt}(function(qt){for(var en=Array(qt.length>>2),Wt=0;Wt>5]|=(255&qt.charCodeAt(Wt/8))<<24-Wt%32;var Zt,on,un,Pn,Dn,In,mn,En,Kn,Ln,Tn,Fn=8*qt.length;for(qt=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Wt=Array(64),en[Fn>>5]|=128<<24-Fn%32,en[15+(Fn+64>>9<<4)]=Fn,En=0;EnKn;Kn++){var wn;16>Kn?Wt[Kn]=en[Kn+En]:(Ln=Kn,Tn=$(Tn=j(Tn=Wt[Kn-2],17)^j(Tn,19)^Tn>>>10,Wt[Kn-7]),wn=j(wn=Wt[Kn-15],7)^j(wn,18)^wn>>>3,Wt[Ln]=$($(Tn,wn),Wt[Kn-16])),Ln=$($($($(mn,Ln=j(Ln=Pn,6)^j(Ln,11)^j(Ln,25)),Pn&Dn^~Pn&In),st[Kn]),Wt[Kn]),Tn=$(mn=j(mn=Fn,2)^j(mn,13)^j(mn,22),Fn&Zt^Fn&on^Zt&on),mn=In,In=Dn,Dn=Pn,Pn=$(un,Ln),un=on,on=Zt,Zt=Fn,Fn=$(Ln,Tn)}qt[0]=$(Fn,qt[0]),qt[1]=$(Zt,qt[1]),qt[2]=$(on,qt[2]),qt[3]=$(un,qt[3]),qt[4]=$(Pn,qt[4]),qt[5]=$(Dn,qt[5]),qt[6]=$(In,qt[6]),qt[7]=$(mn,qt[7])}for(en="",Wt=0;Wt<32*qt.length;Wt+=8)en+=String.fromCharCode(qt[Wt>>5]>>>24-Wt%32&255);return en}(function(qt){for(var en,Wt,Zt="",on=-1;++on=en&&56320<=Wt&&57343>=Wt&&(en=65536+((1023&en)<<10)+(1023&Wt),on++),127>=en?Zt+=String.fromCharCode(en):2047>=en?Zt+=String.fromCharCode(192|en>>>6&31,128|63&en):65535>=en?Zt+=String.fromCharCode(224|en>>>12&15,128|en>>>6&63,128|63&en):2097151>=en&&(Zt+=String.fromCharCode(240|en>>>18&7,128|en>>>12&63,128|en>>>6&63,128|63&en));return Zt}(Jt))),vt[St])?vt[St].apply(null,rt):(Jt=Function.apply(null,Ut.concat(Jt)),vt&&(vt[St]=Jt),Jt.apply(null,rt))}}}function Q(Xe){return Array.isArray(Xe)||Ee(Xe)||r(Xe)}function Z(Xe){return Xe.sort(function(ut,Tt){return ut==="viewport"?-1:Tt==="viewport"?1:ut"+Cr+"?"+An+".constant["+Cr+"]:0;"}).join(""),"}}else{","if(",Tr,"(",An,".buffer)){",Rr,"=",er,".createStream(",34962,",",An,".buffer);","}else{",Rr,"=",er,".getBuffer(",An,".buffer);","}",$r,'="type" in ',An,"?",br.glTypes,"[",An,".type]:",Rr,".dtype;",yr.normalized,"=!!",An,".normalized;"),ln("size"),ln("offset"),ln("stride"),ln("divisor"),dn("}}"),dn.exit("if(",yr.isStream,"){",er,".destroyStream(",Rr,");","}"),yr})}),Un}function Kn(an,_n,gn,qn,Un){function tr(Ur){var Rr=Bn[Ur];Rr&&(ln[Ur]=Rr)}var Wn=function(Ur,Rr){if(typeof($r=Ur.static).frag=="string"&&typeof $r.vert=="string"){if(0"u"?"Date.now()":"performance.now()"}function Wn(Ur){Ur(ln=_n.def(),"=",tr(),";"),typeof Un=="string"?Ur(br,".count+=",Un,";"):Ur(br,".count++;"),qt&&(qn?Ur(An=_n.def(),"=",yr,".getNumPendingQueries();"):Ur(yr,".beginQuery(",br,");"))}function Bn(Ur){Ur(br,".cpuTime+=",tr(),"-",ln,";"),qt&&(qn?Ur(yr,".pushScopeStats(",An,",",yr,".getNumPendingQueries(),",br,");"):Ur(yr,".endQuery();"))}function dn(Ur){var Rr=_n.def(Tr,".profile");_n(Tr,".profile=",Ur,";"),_n.exit(Tr,".profile=",Rr,";")}var ln,An,er=an.shared,br=an.stats,Tr=er.current,yr=er.timer;if(gn=gn.profile){if(ae(gn))return void(gn.enable?(Wn(_n),Bn(_n.exit),dn("true")):dn("false"));dn(gn=gn.append(an,_n))}else gn=_n.def(Tr,".profile");Wn(er=an.block()),_n("if(",gn,"){",er,"}"),Bn(an=an.block()),_n.exit("if(",gn,"){",an,"}")}function $n(an,_n,gn,qn,Un){function tr(Bn,dn,ln){function An(){_n("if(!",yr,".buffer){",br,".enableVertexAttribArray(",Tr,");}");var Pr,Cr=ln.type;Pr=ln.size?_n.def(ln.size,"||",dn):dn,_n("if(",yr,".type!==",Cr,"||",yr,".size!==",Pr,"||",$r.map(function(Jr){return yr+"."+Jr+"!=="+ln[Jr]}).join("||"),"){",br,".bindBuffer(",34962,",",Ur,".buffer);",br,".vertexAttribPointer(",[Tr,Pr,Cr,ln.normalized,ln.stride,ln.offset],");",yr,".type=",Cr,";",yr,".size=",Pr,";",$r.map(function(Jr){return yr+"."+Jr+"="+ln[Jr]+";"}).join(""),"}"),kn&&(Cr=ln.divisor,_n("if(",yr,".divisor!==",Cr,"){",an.instancing,".vertexAttribDivisorANGLE(",[Tr,Cr],");",yr,".divisor=",Cr,";}"))}function er(){_n("if(",yr,".buffer){",br,".disableVertexAttribArray(",Tr,");",yr,".buffer=null;","}if(",Qe.map(function(Pr,Cr){return yr+"."+Pr+"!=="+Rr[Cr]}).join("||"),"){",br,".vertexAttrib4f(",Tr,",",Rr,");",Qe.map(function(Pr,Cr){return yr+"."+Pr+"="+Rr[Cr]+";"}).join(""),"}")}var br=Wn.gl,Tr=_n.def(Bn,".location"),yr=_n.def(Wn.attributes,"[",Tr,"]");Bn=ln.state;var Ur=ln.buffer,Rr=[ln.x,ln.y,ln.z,ln.w],$r=["buffer","normalized","offset","stride"];Bn===1?An():Bn===2?er():(_n("if(",Bn,"===",1,"){"),An(),_n("}else{"),er(),_n("}"))}var Wn=an.shared;qn.forEach(function(Bn){var dn,ln=Bn.name,An=gn.attributes[ln];if(An){if(!Un(An))return;dn=An.append(an,_n)}else{if(!Un(lt))return;var er=an.scopeAttrib(ln);dn={},Object.keys(new xr).forEach(function(br){dn[br]=_n.def(er,".",br)})}tr(an.link(Bn),function(br){switch(br){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(Bn.info.type),dn)})}function vr(an,_n,gn,qn,Un,tr){for(var Wn,Bn=an.shared,dn=Bn.gl,ln=0;ln>1)",Bn],");")}function Jr(){gn(dn,".drawArraysInstancedANGLE(",[yr,Ur,Rr,Bn],");")}Tr&&Tr!=="null"?Pr?Cr():(gn("if(",Tr,"){"),Cr(),gn("}else{"),Jr(),gn("}")):Jr()}function Wn(){function Cr(){gn(An+".drawElements("+[yr,Rr,$r,Ur+"<<(("+$r+"-5121)>>1)"]+");")}function Jr(){gn(An+".drawArrays("+[yr,Ur,Rr]+");")}Tr&&Tr!=="null"?Pr?Cr():(gn("if(",Tr,"){"),Cr(),gn("}else{"),Jr(),gn("}")):Jr()}var Bn,dn,ln=an.shared,An=ln.gl,er=ln.draw,br=qn.draw,Tr=function(){var Cr=br.elements,Jr=_n;return Cr?((Cr.contextDep&&qn.contextDynamic||Cr.propDep)&&(Jr=gn),Cr=Cr.append(an,Jr),br.elementsActive&&Jr("if("+Cr+")"+An+".bindBuffer(34963,"+Cr+".buffer.buffer);")):(Cr=Jr.def(),Jr(Cr,"=",er,".","elements",";","if(",Cr,"){",An,".bindBuffer(",34963,",",Cr,".buffer.buffer);}","else if(",ln.vao,".currentVAO){",Cr,"=",an.shared.elements+".getElements("+ln.vao,".currentVAO.elements);",ur?"":"if("+Cr+")"+An+".bindBuffer(34963,"+Cr+".buffer.buffer);","}")),Cr}(),yr=Un("primitive"),Ur=Un("offset"),Rr=function(){var Cr=br.count,Jr=_n;return Cr?((Cr.contextDep&&qn.contextDynamic||Cr.propDep)&&(Jr=gn),Cr=Cr.append(an,Jr)):Cr=Jr.def(er,".","count"),Cr}();if(typeof Rr=="number"){if(Rr===0)return}else gn("if(",Rr,"){"),gn.exit("}");kn&&(Bn=Un("instances"),dn=an.instancing);var $r=Tr+".type",Pr=br.elements&&ae(br.elements)&&!br.vaoActive;kn&&(typeof Bn!="number"||0<=Bn)?typeof Bn=="string"?(gn("if(",Bn,">0){"),tr(),gn("}else if(",Bn,"<0){"),Wn(),gn("}")):tr():Wn()}function lr(an,_n,gn,qn,Un){return Un=(_n=Pn()).proc("body",Un),kn&&(_n.instancing=Un.def(_n.shared.extensions,".angle_instanced_arrays")),an(_n,Un,gn,qn),_n.compile().body}function hr(an,_n,gn,qn){zn(an,_n),gn.useVAO?gn.drawVAO?_n(an.shared.vao,".setVAO(",gn.drawVAO.append(an,_n),");"):_n(an.shared.vao,".setVAO(",an.shared.vao,".targetVAO);"):(_n(an.shared.vao,".setVAO(null);"),$n(an,_n,gn,qn.attributes,function(){return!0})),vr(an,_n,gn,qn.uniforms,function(){return!0},!1),Qn(an,_n,_n,gn)}function jr(an,_n,gn,qn){function Un(){return!0}an.batchId="a1",zn(an,_n),$n(an,_n,gn,qn.attributes,Un),vr(an,_n,gn,qn.uniforms,Un,!1),Qn(an,_n,_n,gn)}function ni(an,_n,gn,qn){function Un(er){return er.contextDep&&Wn||er.propDep}function tr(er){return!Un(er)}zn(an,_n);var Wn=gn.contextDep,Bn=_n.def(),dn=_n.def();an.shared.props=dn,an.batchId=Bn;var ln=an.scope(),An=an.scope();_n(ln.entry,"for(",Bn,"=0;",Bn,"<","a1",";++",Bn,"){",dn,"=","a0","[",Bn,"];",An,"}",ln.exit),gn.needsContext&&Ln(an,An,gn.context),gn.needsFramebuffer&&Tn(an,An,gn.framebuffer),wn(an,An,gn.state,Un),gn.profile&&Un(gn.profile)&&Jn(an,An,gn,!1,!0),qn?(gn.useVAO?gn.drawVAO?Un(gn.drawVAO)?An(an.shared.vao,".setVAO(",gn.drawVAO.append(an,An),");"):ln(an.shared.vao,".setVAO(",gn.drawVAO.append(an,ln),");"):ln(an.shared.vao,".setVAO(",an.shared.vao,".targetVAO);"):(ln(an.shared.vao,".setVAO(null);"),$n(an,ln,gn,qn.attributes,tr),$n(an,An,gn,qn.attributes,Un)),vr(an,ln,gn,qn.uniforms,tr,!1),vr(an,An,gn,qn.uniforms,Un,!0),Qn(an,ln,An,gn)):(_n=an.global.def("{}"),qn=gn.shader.progVar.append(an,An),dn=An.def(qn,".id"),ln=An.def(_n,"[",dn,"]"),An(an.shared.gl,".useProgram(",qn,".program);","if(!",ln,"){",ln,"=",_n,"[",dn,"]=",an.link(function(er){return lr(jr,an,gn,er,2)}),"(",qn,");}",ln,".call(this,a0[",Bn,"],",Bn,");"))}function Or(an,_n){function gn(Bn){var dn=_n.shader[Bn];dn&&(dn=dn.append(an,qn),isNaN(dn)?qn.set(Un.shader,"."+Bn,dn):qn.set(Un.shader,"."+Bn,an.link(dn,{stable:!0})))}var qn=an.proc("scope",3);an.batchId="a2";var Un=an.shared,tr=Un.current;if(Ln(an,qn,_n.context),_n.framebuffer&&_n.framebuffer.append(an,qn),Z(Object.keys(_n.state)).forEach(function(Bn){var dn=_n.state[Bn],ln=dn.append(an,qn);g(ln)?ln.forEach(function(An,er){isNaN(An)?qn.set(an.next[Bn],"["+er+"]",An):qn.set(an.next[Bn],"["+er+"]",an.link(An,{stable:!0}))}):ae(dn)?qn.set(Un.next,"."+Bn,an.link(ln,{stable:!0})):qn.set(Un.next,"."+Bn,ln)}),Jn(an,qn,_n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(Bn){var dn=_n.draw[Bn];dn&&(dn=dn.append(an,qn),isNaN(dn)?qn.set(Un.draw,"."+Bn,dn):qn.set(Un.draw,"."+Bn,an.link(dn),{stable:!0}))}),Object.keys(_n.uniforms).forEach(function(Bn){var dn=_n.uniforms[Bn].append(an,qn);Array.isArray(dn)&&(dn="["+dn.map(function(ln){return isNaN(ln)?ln:an.link(ln,{stable:!0})})+"]"),qn.set(Un.uniforms,"["+an.link(ut.id(Bn),{stable:!0})+"]",dn)}),Object.keys(_n.attributes).forEach(function(Bn){var dn=_n.attributes[Bn].append(an,qn),ln=an.scopeAttrib(Bn);Object.keys(new xr).forEach(function(An){qn.set(ln,"."+An,dn[An])})}),_n.scopeVAO){var Wn=_n.scopeVAO.append(an,qn);isNaN(Wn)?qn.set(Un.vao,".targetVAO",Wn):qn.set(Un.vao,".targetVAO",an.link(Wn,{stable:!0}))}gn("vert"),gn("frag"),0=--this.refCount&&rt(this)},Lt.profile&&(vt.getTotalRenderbufferSize=function(){var St=0;return Object.keys(Ft).forEach(function(Jt){St+=Ft[Jt].stats.size}),St}),{create:function(St,Jt){function qt(Wt,Zt){var on=0,un=0,Pn=32854;if(typeof Wt=="object"&&Wt?("shape"in Wt?(on=0|(un=Wt.shape)[0],un=0|un[1]):("radius"in Wt&&(on=un=0|Wt.radius),"width"in Wt&&(on=0|Wt.width),"height"in Wt&&(un=0|Wt.height)),"format"in Wt&&(Pn=et[Wt.format])):typeof Wt=="number"?(on=0|Wt,un=typeof Zt=="number"?0|Zt:on):Wt||(on=un=1),on!==en.width||un!==en.height||Pn!==en.format)return qt.width=en.width=on,qt.height=en.height=un,en.format=Pn,Xe.bindRenderbuffer(36161,en.renderbuffer),Xe.renderbufferStorage(36161,Pn,on,un),Lt.profile&&(en.stats.size=wt[en.format]*en.width*en.height),qt.format=Et[en.format],qt}var en=new Ut(Xe.createRenderbuffer());return Ft[en.id]=en,vt.renderbufferCount++,qt(St,Jt),qt.resize=function(Wt,Zt){var on=0|Wt,un=0|Zt||on;return on===en.width&&un===en.height||(qt.width=en.width=on,qt.height=en.height=un,Xe.bindRenderbuffer(36161,en.renderbuffer),Xe.renderbufferStorage(36161,en.format,on,un),Lt.profile&&(en.stats.size=wt[en.format]*en.width*en.height)),qt},qt._reglType="renderbuffer",qt._renderbuffer=en,Lt.profile&&(qt.stats=en.stats),qt.destroy=function(){en.decRef()},qt},clear:function(){Ce(Ft).forEach(rt)},restore:function(){Ce(Ft).forEach(function(St){St.renderbuffer=Xe.createRenderbuffer(),Xe.bindRenderbuffer(36161,St.renderbuffer),Xe.renderbufferStorage(36161,St.format,St.width,St.height)}),Xe.bindRenderbuffer(36161,null)}}},Ht=[];Ht[6408]=4,Ht[6407]=3;var Gt=[];Gt[5121]=1,Gt[5126]=4,Gt[36193]=2;var st=[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],Qe=["x","y","z","w"],ft="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),yt={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},Ot={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},Pt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},at={cw:2304,ccw:2305},lt=new K(!1,!1,!1,function(){});return function(Xe){function ut(){if(jr.length===0)Dn&&Dn.update(),xr=null;else{xr=ye.next(ut),Ft();for(var kn=jr.length-1;0<=kn;--kn){var Cn=jr[kn];Cn&&Cn(Kn,null,0)}qt.flush(),Dn&&Dn.update()}}function Tt(){!xr&&0=jr.length&&vt()}}}}function Bt(){var kn=lr.viewport,Cn=lr.scissor_box;kn[0]=kn[1]=Cn[0]=Cn[1]=0,Kn.viewportWidth=Kn.framebufferWidth=Kn.drawingBufferWidth=kn[2]=Cn[2]=qt.drawingBufferWidth,Kn.viewportHeight=Kn.framebufferHeight=Kn.drawingBufferHeight=kn[3]=Cn[3]=qt.drawingBufferHeight}function Ft(){Kn.tick+=1,Kn.time=Jt(),Bt(),Qn.procs.poll()}function St(){Jn.refresh(),Bt(),Qn.procs.refresh(),Dn&&Dn.update()}function Jt(){return(me()-In)/1e3}if(!(Xe=w(Xe)))return null;var qt=Xe.gl,en=qt.getContextAttributes();qt.isContextLost();var Wt=function(kn,Cn){function ur(Er){var Xr;Er=Er.toLowerCase();try{Xr=Zn[Er]=kn.getExtension(Er)}catch{}return!!Xr}for(var Zn={},cr=0;crCn;++Cn)Qr(oe({framebuffer:kn.framebuffer.faces[Cn]},kn),et);else Qr(kn,et);else et(0,kn)},prop:ge.define.bind(null,1),context:ge.define.bind(null,2),this:ge.define.bind(null,3),draw:rt({}),buffer:function(kn){return Tn.create(kn,34962,!1,!1)},elements:function(kn){return Fn.create(kn,!1)},texture:Jn.create2D,cube:Jn.createCube,renderbuffer:$n.create,framebuffer:vr.create,framebufferCube:vr.createCube,vao:wn.createVAO,attributes:en,frame:Et,on:function(kn,Cn){var ur;switch(kn){case"frame":return Et(Cn);case"lost":ur=ni;break;case"restore":ur=Or;break;case"destroy":ur=Ar}return ur.push(Cn),{cancel:function(){for(var Zn=0;Zn4294967295||_(r)!==r)throw new y("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],l=!0,o=!0;if("length"in u&&w){var s=w(u,"length");s&&!s.configurable&&(l=!1),s&&!s.writable&&(o=!1)}return(l||o||!n)&&(e?d(u,"length",r,!0,!0):d(u,"length",r)),u}},90386:function(D,L,t){D.exports=d;var b=t(7683).EventEmitter;function d(){b.call(this)}t(28062)(d,b),d.Readable=t(44639),d.Writable=t(84627),d.Duplex=t(71977),d.Transform=t(40255),d.PassThrough=t(28765),d.finished=t(37165),d.pipeline=t(6772),d.Stream=d,d.prototype.pipe=function(e,w){var y=this;function _(c){e.writable&&e.write(c)===!1&&y.pause&&y.pause()}function u(){y.readable&&y.resume&&y.resume()}y.on("data",_),e.on("drain",u),e._isStdio||w&&w.end===!1||(y.on("end",n),y.on("close",l));var r=!1;function n(){r||(r=!0,e.end())}function l(){r||(r=!0,typeof e.destroy=="function"&&e.destroy())}function o(c){if(s(),b.listenerCount(this,"error")===0)throw c}function s(){y.removeListener("data",_),e.removeListener("drain",u),y.removeListener("end",n),y.removeListener("close",l),y.removeListener("error",o),e.removeListener("error",o),y.removeListener("end",s),y.removeListener("close",s),e.removeListener("close",s)}return y.on("error",o),e.on("error",o),y.on("end",s),y.on("close",s),e.on("close",s),e.emit("pipe",y),e}},44059:function(D){var L={};function t(d,e,w){w||(w=Error);var y=function(_){var u,r;function n(l,o,s){return _.call(this,function(c,h,x){return typeof e=="string"?e:e(c,h,x)}(l,o,s))||this}return r=_,(u=n).prototype=Object.create(r.prototype),u.prototype.constructor=u,u.__proto__=r,n}(w);y.prototype.name=w.name,y.prototype.code=d,L[d]=y}function b(d,e){if(Array.isArray(d)){var w=d.length;return d=d.map(function(y){return String(y)}),w>2?"one of ".concat(e," ").concat(d.slice(0,w-1).join(", "),", or ")+d[w-1]:w===2?"one of ".concat(e," ").concat(d[0]," or ").concat(d[1]):"of ".concat(e," ").concat(d[0])}return"of ".concat(e," ").concat(String(d))}t("ERR_INVALID_OPT_VALUE",function(d,e){return'The value "'+e+'" is invalid for option "'+d+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(d,e,w){var y,_,u,r,n;if(typeof e=="string"&&(_="not ",e.substr(0,4)===_)?(y="must not be",e=e.replace(/^not /,"")):y="must be",function(o,s,c){return(c===void 0||c>o.length)&&(c=o.length),o.substring(c-9,c)===s}(d," argument"))u="The ".concat(d," ").concat(y," ").concat(b(e,"type"));else{var l=(typeof n!="number"&&(n=0),n+1>(r=d).length||r.indexOf(".",n)===-1?"argument":"property");u='The "'.concat(d,'" ').concat(l," ").concat(y," ").concat(b(e,"type"))}return u+". Received type ".concat(typeof w)},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(d){return"The "+d+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(d){return"Cannot call "+d+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(d){return"Unknown encoding: "+d},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),D.exports.F=L},71977:function(D,L,t){var b=t(33282),d=Object.keys||function(o){var s=[];for(var c in o)s.push(c);return s};D.exports=r;var e=t(44639),w=t(84627);t(28062)(r,e);for(var y=d(w.prototype),_=0;_0)if(typeof he=="string"||ge.objectMode||Object.getPrototypeOf(he)===_.prototype||(he=function(ye){return _.from(ye)}(he)),ie)ge.endEmitted?v(se,new A):f(se,ge,he,!0);else if(ge.ended)v(se,new g);else{if(ge.destroyed)return!1;ge.reading=!1,ge.decoder&&!fe?(he=ge.decoder.write(he),ge.objectMode||he.length!==0?f(se,ge,he,!1):V(se,ge)):f(se,ge,he,!1)}else ie||(ge.reading=!1,V(se,ge));return!ge.ended&&(ge.lengthhe.highWaterMark&&(he.highWaterMark=function(fe){return fe>=E?fe=E:(fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++),fe}(se)),se<=he.length?se:he.ended?he.length:(he.needReadable=!0,0))}function B(se){var he=se._readableState;e("emitReadable",he.needReadable,he.emittedReadable),he.needReadable=!1,he.emittedReadable||(e("emitReadable",he.flowing),he.emittedReadable=!0,d.nextTick(N,se))}function N(se){var he=se._readableState;e("emitReadable_",he.destroyed,he.length,he.ended),he.destroyed||!he.length&&!he.ended||(se.emit("readable"),he.emittedReadable=!1),he.needReadable=!he.flowing&&!he.ended&&he.length<=he.highWaterMark,J(se)}function V(se,he){he.readingMore||(he.readingMore=!0,d.nextTick(j,se,he))}function j(se,he){for(;!he.reading&&!he.ended&&(he.length0,he.resumeScheduled&&!he.paused?he.flowing=!0:se.listenerCount("data")>0&&se.resume()}function ee(se){e("readable nexttick read 0"),se.read(0)}function H(se,he){e("resume",he.reading),he.reading||se.read(0),he.resumeScheduled=!1,se.emit("resume"),J(se),he.flowing&&!he.reading&&se.read(0)}function J(se){var he=se._readableState;for(e("flow",he.flowing);he.flowing&&se.read()!==null;);}function Q(se,he){return he.length===0?null:(he.objectMode?fe=he.buffer.shift():!se||se>=he.length?(fe=he.decoder?he.buffer.join(""):he.buffer.length===1?he.buffer.first():he.buffer.concat(he.length),he.buffer.clear()):fe=he.buffer.consume(se,he.decoder),fe);var fe}function Z(se){var he=se._readableState;e("endReadable",he.endEmitted),he.endEmitted||(he.ended=!0,d.nextTick(K,he,se))}function K(se,he){if(e("endReadableNT",se.endEmitted,se.length),!se.endEmitted&&se.length===0&&(se.endEmitted=!0,he.readable=!1,he.emit("end"),se.autoDestroy)){var fe=he._writableState;(!fe||fe.autoDestroy&&fe.finished)&&he.destroy()}}function ae(se,he){for(var fe=0,ie=se.length;fe=he.highWaterMark:he.length>0)||he.ended))return e("read: emitReadable",he.length,he.ended),he.length===0&&he.ended?Z(this):B(this),null;if((se=I(se,he))===0&&he.ended)return he.length===0&&Z(this),null;var ie,oe=he.needReadable;return e("need readable",oe),(he.length===0||he.length-se0?Q(se,he):null)===null?(he.needReadable=he.length<=he.highWaterMark,se=0):(he.length-=se,he.awaitDrain=0),he.length===0&&(he.ended||(he.needReadable=!0),fe!==se&&he.ended&&Z(this)),ie!==null&&this.emit("data",ie),ie},p.prototype._read=function(se){v(this,new k("_read()"))},p.prototype.pipe=function(se,he){var fe=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=se;break;case 1:ie.pipes=[ie.pipes,se];break;default:ie.pipes.push(se)}ie.pipesCount+=1,e("pipe count=%d opts=%j",ie.pipesCount,he);var oe=he&&he.end===!1||se===d.stdout||se===d.stderr?Ce:le;function le(){e("onend"),se.end()}ie.endEmitted?d.nextTick(oe):fe.once("end",oe),se.on("unpipe",function Le(Oe,We){e("onunpipe"),Oe===fe&&We&&We.hasUnpiped===!1&&(We.hasUnpiped=!0,e("cleanup"),se.removeListener("close",Se),se.removeListener("finish",Ee),se.removeListener("drain",ge),se.removeListener("error",be),se.removeListener("unpipe",Le),fe.removeListener("end",le),fe.removeListener("end",Ce),fe.removeListener("data",me),ye=!0,!ie.awaitDrain||se._writableState&&!se._writableState.needDrain||ge())});var ge=function(Le){return function(){var Oe=Le._readableState;e("pipeOnDrain",Oe.awaitDrain),Oe.awaitDrain&&Oe.awaitDrain--,Oe.awaitDrain===0&&w(Le,"data")&&(Oe.flowing=!0,J(Le))}}(fe);se.on("drain",ge);var ye=!1;function me(Le){e("ondata");var Oe=se.write(Le);e("dest.write",Oe),Oe===!1&&((ie.pipesCount===1&&ie.pipes===se||ie.pipesCount>1&&ae(ie.pipes,se)!==-1)&&!ye&&(e("false write response, pause",ie.awaitDrain),ie.awaitDrain++),fe.pause())}function be(Le){e("onerror",Le),Ce(),se.removeListener("error",be),w(se,"error")===0&&v(se,Le)}function Se(){se.removeListener("finish",Ee),Ce()}function Ee(){e("onfinish"),se.removeListener("close",Se),Ce()}function Ce(){e("unpipe"),fe.unpipe(se)}return fe.on("data",me),function(Le,Oe,We){if(typeof Le.prependListener=="function")return Le.prependListener(Oe,We);Le._events&&Le._events[Oe]?Array.isArray(Le._events[Oe])?Le._events[Oe].unshift(We):Le._events[Oe]=[We,Le._events[Oe]]:Le.on(Oe,We)}(se,"error",be),se.once("close",Se),se.once("finish",Ee),se.emit("pipe",fe),ie.flowing||(e("pipe resume"),fe.resume()),se},p.prototype.unpipe=function(se){var he=this._readableState,fe={hasUnpiped:!1};if(he.pipesCount===0)return this;if(he.pipesCount===1)return se&&se!==he.pipes||(se||(se=he.pipes),he.pipes=null,he.pipesCount=0,he.flowing=!1,se&&se.emit("unpipe",this,fe)),this;if(!se){var ie=he.pipes,oe=he.pipesCount;he.pipes=null,he.pipesCount=0,he.flowing=!1;for(var le=0;le0,ie.flowing!==!1&&this.resume()):se==="readable"&&(ie.endEmitted||ie.readableListening||(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,e("on readable",ie.length,ie.reading),ie.length?B(this):ie.reading||d.nextTick(ee,this))),fe},p.prototype.addListener=p.prototype.on,p.prototype.removeListener=function(se,he){var fe=y.prototype.removeListener.call(this,se,he);return se==="readable"&&d.nextTick($,this),fe},p.prototype.removeAllListeners=function(se){var he=y.prototype.removeAllListeners.apply(this,arguments);return se!=="readable"&&se!==void 0||d.nextTick($,this),he},p.prototype.resume=function(){var se=this._readableState;return se.flowing||(e("resume"),se.flowing=!se.readableListening,function(he,fe){fe.resumeScheduled||(fe.resumeScheduled=!0,d.nextTick(H,he,fe))}(this,se)),se.paused=!1,this},p.prototype.pause=function(){return e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},p.prototype.wrap=function(se){var he=this,fe=this._readableState,ie=!1;for(var oe in se.on("end",function(){if(e("wrapped end"),fe.decoder&&!fe.ended){var ge=fe.decoder.end();ge&&ge.length&&he.push(ge)}he.push(null)}),se.on("data",function(ge){e("wrapped data"),fe.decoder&&(ge=fe.decoder.write(ge)),fe.objectMode&&ge==null||(fe.objectMode||ge&&ge.length)&&(he.push(ge)||(ie=!0,se.pause()))}),se)this[oe]===void 0&&typeof se[oe]=="function"&&(this[oe]=function(ge){return function(){return se[ge].apply(se,arguments)}}(oe));for(var le=0;le-1))throw new A(V);return this._writableState.defaultEncoding=V,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),p.prototype._write=function(V,j,$){$(new c("_write()"))},p.prototype._writev=null,p.prototype.end=function(V,j,$){var ee=this._writableState;return typeof V=="function"?($=V,V=null,j=null):typeof j=="function"&&($=j,j=null),V!=null&&this.write(V,j),ee.corked&&(ee.corked=1,this.uncork()),ee.ending||function(H,J,Q){J.ending=!0,N(H,J),Q&&(J.finished?d.nextTick(Q):H.once("finish",Q)),J.ended=!0,H.writable=!1}(this,ee,$),this},Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(V){this._writableState&&(this._writableState.destroyed=V)}}),p.prototype.destroy=n.destroy,p.prototype._undestroy=n.undestroy,p.prototype._destroy=function(V,j){j(V)}},73726:function(D,L,t){var b,d=t(33282);function e(g,k,A){return k in g?Object.defineProperty(g,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):g[k]=A,g}var w=t(37165),y=Symbol("lastResolve"),_=Symbol("lastReject"),u=Symbol("error"),r=Symbol("ended"),n=Symbol("lastPromise"),l=Symbol("handlePromise"),o=Symbol("stream");function s(g,k){return{value:g,done:k}}function c(g){var k=g[y];if(k!==null){var A=g[o].read();A!==null&&(g[n]=null,g[y]=null,g[_]=null,k(s(A,!1)))}}function h(g){d.nextTick(c,g)}var x=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((e(b={get stream(){return this[o]},next:function(){var g=this,k=this[u];if(k!==null)return Promise.reject(k);if(this[r])return Promise.resolve(s(void 0,!0));if(this[o].destroyed)return new Promise(function(T,p){d.nextTick(function(){g[u]?p(g[u]):T(s(void 0,!0))})});var A,v=this[n];if(v)A=new Promise(function(T,p){return function(M,f){T.then(function(){p[r]?M(s(void 0,!0)):p[l](M,f)},f)}}(v,this));else{var S=this[o].read();if(S!==null)return Promise.resolve(s(S,!1));A=new Promise(this[l])}return this[n]=A,A}},Symbol.asyncIterator,function(){return this}),e(b,"return",function(){var g=this;return new Promise(function(k,A){g[o].destroy(null,function(v){v?A(v):k(s(void 0,!0))})})}),b),x);D.exports=function(g){var k,A=Object.create(m,(e(k={},o,{value:g,writable:!0}),e(k,y,{value:null,writable:!0}),e(k,_,{value:null,writable:!0}),e(k,u,{value:null,writable:!0}),e(k,r,{value:g._readableState.endEmitted,writable:!0}),e(k,l,{value:function(v,S){var T=A[o].read();T?(A[n]=null,A[y]=null,A[_]=null,v(s(T,!1))):(A[y]=v,A[_]=S)},writable:!0}),k));return A[n]=null,w(g,function(v){if(v&&v.code!=="ERR_STREAM_PREMATURE_CLOSE"){var S=A[_];return S!==null&&(A[n]=null,A[y]=null,A[_]=null,S(v)),void(A[u]=v)}var T=A[y];T!==null&&(A[n]=null,A[y]=null,A[_]=null,T(s(void 0,!0))),A[r]=!0}),g.on("readable",h.bind(null,A)),A}},29930:function(D,L,t){function b(u,r){var n=Object.keys(u);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(u);r&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(u,o).enumerable})),n.push.apply(n,l)}return n}function d(u,r,n){return r in u?Object.defineProperty(u,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):u[r]=n,u}function e(u,r){for(var n=0;n0?this.tail.next=o:this.head=o,this.tail=o,++this.length}},{key:"unshift",value:function(l){var o={data:l,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length}},{key:"shift",value:function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(l){if(this.length===0)return"";for(var o=this.head,s=""+o.data;o=o.next;)s+=l+o.data;return s}},{key:"concat",value:function(l){if(this.length===0)return w.alloc(0);for(var o,s,c,h=w.allocUnsafe(l>>>0),x=this.head,m=0;x;)o=x.data,s=h,c=m,w.prototype.copy.call(o,s,c),m+=x.data.length,x=x.next;return h}},{key:"consume",value:function(l,o){var s;return lh.length?h.length:l;if(x===h.length?c+=h:c+=h.slice(0,l),(l-=x)==0){x===h.length?(++s,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=h.slice(x));break}++s}return this.length-=s,c}},{key:"_getBuffer",value:function(l){var o=w.allocUnsafe(l),s=this.head,c=1;for(s.data.copy(o),l-=s.data.length;s=s.next;){var h=s.data,x=l>h.length?h.length:l;if(h.copy(o,o.length-l,0,x),(l-=x)==0){x===h.length?(++c,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=h.slice(x));break}++c}return this.length-=c,o}},{key:_,value:function(l,o){return y(this,function(s){for(var c=1;c0,function(g){o||(o=g),g&&c.forEach(_),m||(c.forEach(_),s(o))})});return n.reduce(u)}},31976:function(D,L,t){var b=t(44059).F.ERR_INVALID_OPT_VALUE;D.exports={getHighWaterMark:function(d,e,w,y){var _=function(u,r,n){return u.highWaterMark!=null?u.highWaterMark:r?u[n]:null}(e,y,w);if(_!=null){if(!isFinite(_)||Math.floor(_)!==_||_<0)throw new b(y?w:"highWaterMark",_);return Math.floor(_)}return d.objectMode?16:16384}}},60032:function(D,L,t){D.exports=t(7683).EventEmitter},54304:function(D,L,t){var b=t(41041).Buffer,d=b.isEncoding||function(s){switch((s=""+s)&&s.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function e(s){var c;switch(this.encoding=function(h){var x=function(m){if(!m)return"utf8";for(var g;;)switch(m){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return m;default:if(g)return;m=(""+m).toLowerCase(),g=!0}}(h);if(typeof x!="string"&&(b.isEncoding===d||!d(h)))throw new Error("Unknown encoding: "+h);return x||h}(s),this.encoding){case"utf16le":this.text=_,this.end=u,c=4;break;case"utf8":this.fillLast=y,c=4;break;case"base64":this.text=r,this.end=n,c=3;break;default:return this.write=l,void(this.end=o)}this.lastNeed=0,this.lastTotal=0,this.lastChar=b.allocUnsafe(c)}function w(s){return s<=127?0:s>>5==6?2:s>>4==14?3:s>>3==30?4:s>>6==2?-1:-2}function y(s){var c=this.lastTotal-this.lastNeed,h=function(x,m,g){if((192&m[0])!=128)return x.lastNeed=0,"�";if(x.lastNeed>1&&m.length>1){if((192&m[1])!=128)return x.lastNeed=1,"�";if(x.lastNeed>2&&m.length>2&&(192&m[2])!=128)return x.lastNeed=2,"�"}}(this,s);return h!==void 0?h:this.lastNeed<=s.length?(s.copy(this.lastChar,c,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(s.copy(this.lastChar,c,0,s.length),void(this.lastNeed-=s.length))}function _(s,c){if((s.length-c)%2==0){var h=s.toString("utf16le",c);if(h){var x=h.charCodeAt(h.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=s[s.length-1],s.toString("utf16le",c,s.length-1)}function u(s){var c=s&&s.length?this.write(s):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return c+this.lastChar.toString("utf16le",0,h)}return c}function r(s,c){var h=(s.length-c)%3;return h===0?s.toString("base64",c):(this.lastNeed=3-h,this.lastTotal=3,h===1?this.lastChar[0]=s[s.length-1]:(this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1]),s.toString("base64",c,s.length-h))}function n(s){var c=s&&s.length?this.write(s):"";return this.lastNeed?c+this.lastChar.toString("base64",0,3-this.lastNeed):c}function l(s){return s.toString(this.encoding)}function o(s){return s&&s.length?this.write(s):""}L.I=e,e.prototype.write=function(s){if(s.length===0)return"";var c,h;if(this.lastNeed){if((c=this.fillLast(s))===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h=0?(v>0&&(m.lastNeed=v-1),v):--A=0?(v>0&&(m.lastNeed=v-2),v):--A=0?(v>0&&(v===2?v=0:m.lastNeed=v-3),v):0}(this,s,c);if(!this.lastNeed)return s.toString("utf8",c);this.lastTotal=h;var x=s.length-(h-this.lastNeed);return s.copy(this.lastChar,0,x),s.toString("utf8",c,x)},e.prototype.fillLast=function(s){if(this.lastNeed<=s.length)return s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,s.length),this.lastNeed-=s.length}},79743:function(D,L,t){var b=t(45708).Buffer,d=t(85672),e=t(79399)("stream-parser");D.exports=function(g){var k=g&&typeof g._transform=="function",A=g&&typeof g._write=="function";if(!k&&!A)throw new Error("must pass a Writable or Transform stream in");e("extending Parser into stream"),g._bytes=n,g._skipBytes=l,k&&(g._passthrough=o),k?g._transform=c:g._write=s};var w=-1,y=0,_=1,u=2;function r(g){e("initializing parser stream"),g._parserBytesLeft=0,g._parserBuffers=[],g._parserBuffered=0,g._parserState=w,g._parserCallback=null,typeof g.push=="function"&&(g._parserOutput=g.push.bind(g)),g._parserInit=!0}function n(g,k){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(g)&&g>0,'can only buffer a finite number of bytes > 0, got "'+g+'"'),this._parserInit||r(this),e("buffering %o bytes",g),this._parserBytesLeft=g,this._parserCallback=k,this._parserState=y}function l(g,k){d(!this._parserCallback,'there is already a "callback" set!'),d(g>0,'can only skip > 0 bytes, got "'+g+'"'),this._parserInit||r(this),e("skipping %o bytes",g),this._parserBytesLeft=g,this._parserCallback=k,this._parserState=_}function o(g,k){d(!this._parserCallback,'There is already a "callback" set!'),d(g>0,'can only pass through > 0 bytes, got "'+g+'"'),this._parserInit||r(this),e("passing through %o bytes",g),this._parserBytesLeft=g,this._parserCallback=k,this._parserState=u}function s(g,k,A){this._parserInit||r(this),e("write(%o bytes)",g.length),typeof k=="function"&&(A=k),x(this,g,null,A)}function c(g,k,A){this._parserInit||r(this),e("transform(%o bytes)",g.length),typeof k!="function"&&(k=this._parserOutput),x(this,g,k,A)}function h(g,k,A,v){if(g._parserBytesLeft-=k.length,e("%o bytes left for stream piece",g._parserBytesLeft),g._parserState===y?(g._parserBuffers.push(k),g._parserBuffered+=k.length):g._parserState===u&&A(k),g._parserBytesLeft!==0)return v;var S=g._parserCallback;if(S&&g._parserState===y&&g._parserBuffers.length>1&&(k=b.concat(g._parserBuffers,g._parserBuffered)),g._parserState!==y&&(k=null),g._parserCallback=null,g._parserBuffered=0,g._parserState=w,g._parserBuffers.splice(0),S){var T=[];k&&T.push(k),A&&T.push(A);var p=S.length>T.length;p&&T.push(m(v));var M=S.apply(g,T);if(!p||v===M)return v}}var x=m(function g(k,A,v,S){return k._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):A.length<=k._parserBytesLeft?function(){return h(k,A,v,S)}:function(){var T=A.slice(0,k._parserBytesLeft);return h(k,T,v,function(p){return p?S(p):A.length>T.length?function(){return g(k,A.slice(T.length),v,S)}:void 0})}});function m(g){return function(){for(var k=g.apply(this,arguments);typeof k=="function";)k=k();return k}}},79399:function(D,L,t){var b=t(33282);function d(){var e;try{e=L.storage.debug}catch{}return!e&&b!==void 0&&"env"in b&&(e=b.env.DEBUG),e}(L=D.exports=t(43228)).log=function(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},L.formatArgs=function(e){var w=this.useColors;if(e[0]=(w?"%c":"")+this.namespace+(w?" %c":" ")+e[0]+(w?"%c ":" ")+"+"+L.humanize(this.diff),w){var y="color: "+this.color;e.splice(1,0,y,"color: inherit");var _=0,u=0;e[0].replace(/%[a-zA-Z%]/g,function(r){r!=="%%"&&(_++,r==="%c"&&(u=_))}),e.splice(u,0,y)}},L.save=function(e){try{e==null?L.storage.removeItem("debug"):L.storage.debug=e}catch{}},L.load=d,L.useColors=function(){return!(typeof window>"u"||!window.process||window.process.type!=="renderer")||typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},L.storage=typeof chrome<"u"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),L.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],L.formatters.j=function(e){try{return JSON.stringify(e)}catch(w){return"[UnexpectedJSONParseError]: "+w.message}},L.enable(d())},43228:function(D,L,t){var b;function d(e){function w(){if(w.enabled){var y=w,_=+new Date,u=_-(b||_);y.diff=u,y.prev=b,y.curr=_,b=_;for(var r=new Array(arguments.length),n=0;n0)return function(r){if(!((r=String(r)).length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(n){var l=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"days":case"day":case"d":return l*d;case"hours":case"hour":case"hrs":case"hr":case"h":return l*b;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*L;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}(w);if(u==="number"&&isNaN(w)===!1)return y.long?e(_=w,d,"day")||e(_,b,"hour")||e(_,t,"minute")||e(_,L,"second")||_+" ms":function(r){return r>=d?Math.round(r/d)+"d":r>=b?Math.round(r/b)+"h":r>=t?Math.round(r/t)+"m":r>=L?Math.round(r/L)+"s":r+"ms"}(w);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(w))}},28089:function(D,L,t){var b=t(59811);D.exports=function(d,e,w){if(d==null)throw Error("First argument should be a string");if(e==null)throw Error("Separator should be a string or a RegExp");w?(typeof w=="string"||Array.isArray(w))&&(w={ignore:w}):w={},w.escape==null&&(w.escape=!0),w.ignore==null?w.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof w.ignore=="string"&&(w.ignore=[w.ignore]),w.ignore=w.ignore.map(function(o){return o.length===1&&(o+=o),o}));var y=b.parse(d,{flat:!0,brackets:w.ignore}),_=y[0].split(e);if(w.escape){for(var u=[],r=0;r<_.length;r++){var n=_[r],l=_[r+1];n[n.length-1]==="\\"&&n[n.length-2]!=="\\"?(u.push(n+e+l),r++):u.push(n)}_=u}for(r=0;r<_.length;r++)y[0]=_[r],_[r]=b.stringify(y,{flat:!0});return _}},26381:function(D){D.exports=function(L){for(var t=L.length,b=new Array(t),d=new Array(t),e=new Array(t),w=new Array(t),y=new Array(t),_=new Array(t),u=0;u0;){x=g[g.length-1];var k=L[x];if(w[x]=0&&_[x].push(y[v])}w[x]=A}else{if(d[x]===b[x]){var S=[],T=[],p=0;for(A=m.length-1;A>=0;--A){var M=m[A];if(e[M]=!1,S.push(M),T.push(_[M]),p+=_[M].length,y[M]=l.length,M===x){m.length=A;break}}l.push(S);var f=new Array(p);for(A=0;A1&&(n=1),n<-1&&(n=-1),(y*r-_*u<0?-1:1)*Math.acos(n)};L.default=function(y){var _=y.px,u=y.py,r=y.cx,n=y.cy,l=y.rx,o=y.ry,s=y.xAxisRotation,c=s===void 0?0:s,h=y.largeArcFlag,x=h===void 0?0:h,m=y.sweepFlag,g=m===void 0?0:m,k=[];if(l===0||o===0)return[];var A=Math.sin(c*b/360),v=Math.cos(c*b/360),S=v*(_-r)/2+A*(u-n)/2,T=-A*(_-r)/2+v*(u-n)/2;if(S===0&&T===0)return[];l=Math.abs(l),o=Math.abs(o);var p=Math.pow(S,2)/Math.pow(l,2)+Math.pow(T,2)/Math.pow(o,2);p>1&&(l*=Math.sqrt(p),o*=Math.sqrt(p));var M=function(ee,H,J,Q,Z,K,ae,se,he,fe,ie,oe){var le=Math.pow(Z,2),ge=Math.pow(K,2),ye=Math.pow(ie,2),me=Math.pow(oe,2),be=le*ge-le*me-ge*ye;be<0&&(be=0),be/=le*me+ge*ye;var Se=(be=Math.sqrt(be)*(ae===se?-1:1))*Z/K*oe,Ee=be*-K/Z*ie,Ce=fe*Se-he*Ee+(ee+J)/2,Le=he*Se+fe*Ee+(H+Q)/2,Oe=(ie-Se)/Z,We=(oe-Ee)/K,Ie=(-ie-Se)/Z,Ve=(-oe-Ee)/K,Pe=w(1,0,Oe,We),de=w(Oe,We,Ie,Ve);return se===0&&de>0&&(de-=b),se===1&&de<0&&(de+=b),[Ce,Le,Pe,de]}(_,u,r,n,l,o,x,g,A,v,S,T),f=function(ee,H){if(Array.isArray(ee))return ee;if(Symbol.iterator in Object(ee))return function(J,Q){var Z=[],K=!0,ae=!1,se=void 0;try{for(var he,fe=J[Symbol.iterator]();!(K=(he=fe.next()).done)&&(Z.push(he.value),!Q||Z.length!==Q);K=!0);}catch(ie){ae=!0,se=ie}finally{try{!K&&fe.return&&fe.return()}finally{if(ae)throw se}}return Z}(ee,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(M,4),E=f[0],I=f[1],B=f[2],N=f[3],V=Math.abs(N)/(b/4);Math.abs(1-V)<1e-7&&(V=1);var j=Math.max(Math.ceil(V),1);N/=j;for(var $=0;$u[2]&&(u[2]=l[o+0]),l[o+1]>u[3]&&(u[3]=l[o+1]);return u}},41883:function(D,L,t){D.exports=function(w){for(var y,_=[],u=0,r=0,n=0,l=0,o=null,s=null,c=0,h=0,x=0,m=w.length;x4?(u=g[g.length-4],r=g[g.length-3]):(u=c,r=h),_.push(g)}return _};var b=t(13193);function d(w,y,_,u){return["C",w,y,_,u,_,u]}function e(w,y,_,u,r,n){return["C",w/3+.6666666666666666*_,y/3+.6666666666666666*u,r/3+.6666666666666666*_,n/3+.6666666666666666*u,r,n]}},96021:function(D,L,t){var b,d=t(97251),e=t(26953),w=t(95620),y=t(13986),_=t(88772),u=document.createElement("canvas"),r=u.getContext("2d");D.exports=function(n,l){if(!y(n))throw Error("Argument should be valid svg path string");var o,s;l||(l={}),l.shape?(o=l.shape[0],s=l.shape[1]):(o=u.width=l.w||l.width||200,s=u.height=l.h||l.height||200);var c=Math.min(o,s),h=l.stroke||0,x=l.viewbox||l.viewBox||d(n),m=[o/(x[2]-x[0]),s/(x[3]-x[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,o,s),r.fillStyle="white",h&&(typeof h!="number"&&(h=1),r.strokeStyle=h>0?"white":"black",r.lineWidth=Math.abs(h)),r.translate(.5*o,.5*s),r.scale(g,g),function(){if(b!=null)return b;var v=document.createElement("canvas").getContext("2d");if(v.canvas.width=v.canvas.height=1,!window.Path2D)return b=!1;var S=new Path2D("M0,0h1v1h-1v-1Z");v.fillStyle="black",v.fill(S);var T=v.getImageData(0,0,1,1);return b=T&&T.data&&T.data[3]===255}()){var k=new Path2D(n);r.fill(k),h&&r.stroke(k)}else{var A=e(n);w(r,A),r.fill(),h&&r.stroke()}return r.setTransform(1,0,0,1,0,0),_(r,{cutoff:l.cutoff!=null?l.cutoff:.5,radius:l.radius!=null?l.radius:.5*c})}},65657:function(D,L,t){var b;(function(d){var e=/^\s+/,w=/\s+$/,y=0,_=d.round,u=d.min,r=d.max,n=d.random;function l(ie,oe){if(oe=oe||{},(ie=ie||"")instanceof l)return ie;if(!(this instanceof l))return new l(ie,oe);var le=function(ge){var ye,me,be,Se={r:0,g:0,b:0},Ee=1,Ce=null,Le=null,Oe=null,We=!1,Ie=!1;return typeof ge=="string"&&(ge=function(Ve){Ve=Ve.replace(e,"").replace(w,"").toLowerCase();var Pe,de=!1;if(B[Ve])Ve=B[Ve],de=!0;else if(Ve=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(Pe=he.rgb.exec(Ve))?{r:Pe[1],g:Pe[2],b:Pe[3]}:(Pe=he.rgba.exec(Ve))?{r:Pe[1],g:Pe[2],b:Pe[3],a:Pe[4]}:(Pe=he.hsl.exec(Ve))?{h:Pe[1],s:Pe[2],l:Pe[3]}:(Pe=he.hsla.exec(Ve))?{h:Pe[1],s:Pe[2],l:Pe[3],a:Pe[4]}:(Pe=he.hsv.exec(Ve))?{h:Pe[1],s:Pe[2],v:Pe[3]}:(Pe=he.hsva.exec(Ve))?{h:Pe[1],s:Pe[2],v:Pe[3],a:Pe[4]}:(Pe=he.hex8.exec(Ve))?{r:ee(Pe[1]),g:ee(Pe[2]),b:ee(Pe[3]),a:Z(Pe[4]),format:de?"name":"hex8"}:(Pe=he.hex6.exec(Ve))?{r:ee(Pe[1]),g:ee(Pe[2]),b:ee(Pe[3]),format:de?"name":"hex"}:(Pe=he.hex4.exec(Ve))?{r:ee(Pe[1]+""+Pe[1]),g:ee(Pe[2]+""+Pe[2]),b:ee(Pe[3]+""+Pe[3]),a:Z(Pe[4]+""+Pe[4]),format:de?"name":"hex8"}:!!(Pe=he.hex3.exec(Ve))&&{r:ee(Pe[1]+""+Pe[1]),g:ee(Pe[2]+""+Pe[2]),b:ee(Pe[3]+""+Pe[3]),format:de?"name":"hex"}}(ge)),typeof ge=="object"&&(fe(ge.r)&&fe(ge.g)&&fe(ge.b)?(ye=ge.r,me=ge.g,be=ge.b,Se={r:255*j(ye,255),g:255*j(me,255),b:255*j(be,255)},We=!0,Ie=String(ge.r).substr(-1)==="%"?"prgb":"rgb"):fe(ge.h)&&fe(ge.s)&&fe(ge.v)?(Ce=J(ge.s),Le=J(ge.v),Se=function(Ve,Pe,de){Ve=6*j(Ve,360),Pe=j(Pe,100),de=j(de,100);var Me=d.floor(Ve),ke=Ve-Me,He=de*(1-Pe),Fe=de*(1-ke*Pe),qe=de*(1-(1-ke)*Pe),$e=Me%6;return{r:255*[de,Fe,He,He,qe,de][$e],g:255*[qe,de,de,Fe,He,He][$e],b:255*[He,He,qe,de,de,Fe][$e]}}(ge.h,Ce,Le),We=!0,Ie="hsv"):fe(ge.h)&&fe(ge.s)&&fe(ge.l)&&(Ce=J(ge.s),Oe=J(ge.l),Se=function(Ve,Pe,de){var Me,ke,He;function Fe(Ye,_e,De){return De<0&&(De+=1),De>1&&(De-=1),De<1/6?Ye+6*(_e-Ye)*De:De<.5?_e:De<2/3?Ye+(_e-Ye)*(2/3-De)*6:Ye}if(Ve=j(Ve,360),Pe=j(Pe,100),de=j(de,100),Pe===0)Me=ke=He=de;else{var qe=de<.5?de*(1+Pe):de+Pe-de*Pe,$e=2*de-qe;Me=Fe($e,qe,Ve+1/3),ke=Fe($e,qe,Ve),He=Fe($e,qe,Ve-1/3)}return{r:255*Me,g:255*ke,b:255*He}}(ge.h,Ce,Oe),We=!0,Ie="hsl"),ge.hasOwnProperty("a")&&(Ee=ge.a)),Ee=V(Ee),{ok:We,format:ge.format||Ie,r:u(255,r(Se.r,0)),g:u(255,r(Se.g,0)),b:u(255,r(Se.b,0)),a:Ee}}(ie);this._originalInput=ie,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=_(100*this._a)/100,this._format=oe.format||le.format,this._gradientType=oe.gradientType,this._r<1&&(this._r=_(this._r)),this._g<1&&(this._g=_(this._g)),this._b<1&&(this._b=_(this._b)),this._ok=le.ok,this._tc_id=y++}function o(ie,oe,le){ie=j(ie,255),oe=j(oe,255),le=j(le,255);var ge,ye,me=r(ie,oe,le),be=u(ie,oe,le),Se=(me+be)/2;if(me==be)ge=ye=0;else{var Ee=me-be;switch(ye=Se>.5?Ee/(2-me-be):Ee/(me+be),me){case ie:ge=(oe-le)/Ee+(oe>1)+720)%360;--oe;)ge.h=(ge.h+ye)%360,me.push(l(ge));return me}function I(ie,oe){oe=oe||6;for(var le=l(ie).toHsv(),ge=le.h,ye=le.s,me=le.v,be=[],Se=1/oe;oe--;)be.push(l({h:ge,s:ye,v:me})),me=(me+Se)%1;return be}l.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 ie=this.toRgb();return(299*ie.r+587*ie.g+114*ie.b)/1e3},getLuminance:function(){var ie,oe,le,ge=this.toRgb();return ie=ge.r/255,oe=ge.g/255,le=ge.b/255,.2126*(ie<=.03928?ie/12.92:d.pow((ie+.055)/1.055,2.4))+.7152*(oe<=.03928?oe/12.92:d.pow((oe+.055)/1.055,2.4))+.0722*(le<=.03928?le/12.92:d.pow((le+.055)/1.055,2.4))},setAlpha:function(ie){return this._a=V(ie),this._roundA=_(100*this._a)/100,this},toHsv:function(){var ie=s(this._r,this._g,this._b);return{h:360*ie.h,s:ie.s,v:ie.v,a:this._a}},toHsvString:function(){var ie=s(this._r,this._g,this._b),oe=_(360*ie.h),le=_(100*ie.s),ge=_(100*ie.v);return this._a==1?"hsv("+oe+", "+le+"%, "+ge+"%)":"hsva("+oe+", "+le+"%, "+ge+"%, "+this._roundA+")"},toHsl:function(){var ie=o(this._r,this._g,this._b);return{h:360*ie.h,s:ie.s,l:ie.l,a:this._a}},toHslString:function(){var ie=o(this._r,this._g,this._b),oe=_(360*ie.h),le=_(100*ie.s),ge=_(100*ie.l);return this._a==1?"hsl("+oe+", "+le+"%, "+ge+"%)":"hsla("+oe+", "+le+"%, "+ge+"%, "+this._roundA+")"},toHex:function(ie){return c(this._r,this._g,this._b,ie)},toHexString:function(ie){return"#"+this.toHex(ie)},toHex8:function(ie){return function(oe,le,ge,ye,me){var be=[H(_(oe).toString(16)),H(_(le).toString(16)),H(_(ge).toString(16)),H(Q(ye))];return me&&be[0].charAt(0)==be[0].charAt(1)&&be[1].charAt(0)==be[1].charAt(1)&&be[2].charAt(0)==be[2].charAt(1)&&be[3].charAt(0)==be[3].charAt(1)?be[0].charAt(0)+be[1].charAt(0)+be[2].charAt(0)+be[3].charAt(0):be.join("")}(this._r,this._g,this._b,this._a,ie)},toHex8String:function(ie){return"#"+this.toHex8(ie)},toRgb:function(){return{r:_(this._r),g:_(this._g),b:_(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+_(this._r)+", "+_(this._g)+", "+_(this._b)+")":"rgba("+_(this._r)+", "+_(this._g)+", "+_(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:_(100*j(this._r,255))+"%",g:_(100*j(this._g,255))+"%",b:_(100*j(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+_(100*j(this._r,255))+"%, "+_(100*j(this._g,255))+"%, "+_(100*j(this._b,255))+"%)":"rgba("+_(100*j(this._r,255))+"%, "+_(100*j(this._g,255))+"%, "+_(100*j(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(N[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(ie){var oe="#"+h(this._r,this._g,this._b,this._a),le=oe,ge=this._gradientType?"GradientType = 1, ":"";if(ie){var ye=l(ie);le="#"+h(ye._r,ye._g,ye._b,ye._a)}return"progid:DXImageTransform.Microsoft.gradient("+ge+"startColorstr="+oe+",endColorstr="+le+")"},toString:function(ie){var oe=!!ie;ie=ie||this._format;var le=!1,ge=this._a<1&&this._a>=0;return oe||!ge||ie!=="hex"&&ie!=="hex6"&&ie!=="hex3"&&ie!=="hex4"&&ie!=="hex8"&&ie!=="name"?(ie==="rgb"&&(le=this.toRgbString()),ie==="prgb"&&(le=this.toPercentageRgbString()),ie!=="hex"&&ie!=="hex6"||(le=this.toHexString()),ie==="hex3"&&(le=this.toHexString(!0)),ie==="hex4"&&(le=this.toHex8String(!0)),ie==="hex8"&&(le=this.toHex8String()),ie==="name"&&(le=this.toName()),ie==="hsl"&&(le=this.toHslString()),ie==="hsv"&&(le=this.toHsvString()),le||this.toHexString()):ie==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return l(this.toString())},_applyModification:function(ie,oe){var le=ie.apply(null,[this].concat([].slice.call(oe)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(ie,oe){return ie.apply(null,[this].concat([].slice.call(oe)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(I,arguments)},splitcomplement:function(){return this._applyCombination(f,arguments)},triad:function(){return this._applyCombination(p,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},l.fromRatio=function(ie,oe){if(typeof ie=="object"){var le={};for(var ge in ie)ie.hasOwnProperty(ge)&&(le[ge]=ge==="a"?ie[ge]:J(ie[ge]));ie=le}return l(ie,oe)},l.equals=function(ie,oe){return!(!ie||!oe)&&l(ie).toRgbString()==l(oe).toRgbString()},l.random=function(){return l.fromRatio({r:n(),g:n(),b:n()})},l.mix=function(ie,oe,le){le=le===0?0:le||50;var ge=l(ie).toRgb(),ye=l(oe).toRgb(),me=le/100;return l({r:(ye.r-ge.r)*me+ge.r,g:(ye.g-ge.g)*me+ge.g,b:(ye.b-ge.b)*me+ge.b,a:(ye.a-ge.a)*me+ge.a})},l.readability=function(ie,oe){var le=l(ie),ge=l(oe);return(d.max(le.getLuminance(),ge.getLuminance())+.05)/(d.min(le.getLuminance(),ge.getLuminance())+.05)},l.isReadable=function(ie,oe,le){var ge,ye,me,be,Se,Ee=l.readability(ie,oe);switch(ye=!1,(me=le,(be=((me=me||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&be!=="AAA"&&(be="AA"),(Se=(me.size||"small").toLowerCase())!=="small"&&Se!=="large"&&(Se="small"),ge={level:be,size:Se}).level+ge.size){case"AAsmall":case"AAAlarge":ye=Ee>=4.5;break;case"AAlarge":ye=Ee>=3;break;case"AAAsmall":ye=Ee>=7}return ye},l.mostReadable=function(ie,oe,le){var ge,ye,me,be,Se=null,Ee=0;ye=(le=le||{}).includeFallbackColors,me=le.level,be=le.size;for(var Ce=0;CeEe&&(Ee=ge,Se=l(oe[Ce]));return l.isReadable(ie,Se,{level:me,size:be})||!ye?Se:(le.includeFallbackColors=!1,l.mostReadable(ie,["#fff","#000"],le))};var B=l.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"},N=l.hexNames=function(ie){var oe={};for(var le in ie)ie.hasOwnProperty(le)&&(oe[ie[le]]=le);return oe}(B);function V(ie){return ie=parseFloat(ie),(isNaN(ie)||ie<0||ie>1)&&(ie=1),ie}function j(ie,oe){(function(ge){return typeof ge=="string"&&ge.indexOf(".")!=-1&&parseFloat(ge)===1})(ie)&&(ie="100%");var le=function(ge){return typeof ge=="string"&&ge.indexOf("%")!=-1}(ie);return ie=u(oe,r(0,parseFloat(ie))),le&&(ie=parseInt(ie*oe,10)/100),d.abs(ie-oe)<1e-6?1:ie%oe/parseFloat(oe)}function $(ie){return u(1,r(0,ie))}function ee(ie){return parseInt(ie,16)}function H(ie){return ie.length==1?"0"+ie:""+ie}function J(ie){return ie<=1&&(ie=100*ie+"%"),ie}function Q(ie){return d.round(255*parseFloat(ie)).toString(16)}function Z(ie){return ee(ie)/255}var K,ae,se,he=(ae="[\\s|\\(]+("+(K="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",se="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",{CSS_UNIT:new RegExp(K),rgb:new RegExp("rgb"+ae),rgba:new RegExp("rgba"+se),hsl:new RegExp("hsl"+ae),hsla:new RegExp("hsla"+se),hsv:new RegExp("hsv"+ae),hsva:new RegExp("hsva"+se),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 fe(ie){return!!he.CSS_UNIT.exec(ie)}D.exports?D.exports=l:(b=(function(){return l}).call(L,t,L,D))===void 0||(D.exports=b)})(Math)},51498:function(D){D.exports=t,D.exports.float32=D.exports.float=t,D.exports.fract32=D.exports.fract=function(b,d){if(b.length){if(b instanceof Float32Array)return new Float32Array(b.length);d instanceof Float32Array||(d=t(b));for(var e=0,w=d.length;e":(w.length>100&&(w=w.slice(0,99)+"…"),w=w.replace(d,function(y){switch(y){case` +`);return vt&&(St=function(qt){for(var en,Wt="",Zt=0;Zt>>4&15)+"0123456789abcdef".charAt(15&en);return Wt}(function(qt){for(var en=Array(qt.length>>2),Wt=0;Wt>5]|=(255&qt.charCodeAt(Wt/8))<<24-Wt%32;var Zt,on,un,Pn,Dn,In,mn,En,Kn,Ln,Tn,Fn=8*qt.length;for(qt=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Wt=Array(64),en[Fn>>5]|=128<<24-Fn%32,en[15+(Fn+64>>9<<4)]=Fn,En=0;EnKn;Kn++){var wn;16>Kn?Wt[Kn]=en[Kn+En]:(Ln=Kn,Tn=$(Tn=j(Tn=Wt[Kn-2],17)^j(Tn,19)^Tn>>>10,Wt[Kn-7]),wn=j(wn=Wt[Kn-15],7)^j(wn,18)^wn>>>3,Wt[Ln]=$($(Tn,wn),Wt[Kn-16])),Ln=$($($($(mn,Ln=j(Ln=Pn,6)^j(Ln,11)^j(Ln,25)),Pn&Dn^~Pn&In),st[Kn]),Wt[Kn]),Tn=$(mn=j(mn=Fn,2)^j(mn,13)^j(mn,22),Fn&Zt^Fn&on^Zt&on),mn=In,In=Dn,Dn=Pn,Pn=$(un,Ln),un=on,on=Zt,Zt=Fn,Fn=$(Ln,Tn)}qt[0]=$(Fn,qt[0]),qt[1]=$(Zt,qt[1]),qt[2]=$(on,qt[2]),qt[3]=$(un,qt[3]),qt[4]=$(Pn,qt[4]),qt[5]=$(Dn,qt[5]),qt[6]=$(In,qt[6]),qt[7]=$(mn,qt[7])}for(en="",Wt=0;Wt<32*qt.length;Wt+=8)en+=String.fromCharCode(qt[Wt>>5]>>>24-Wt%32&255);return en}(function(qt){for(var en,Wt,Zt="",on=-1;++on=en&&56320<=Wt&&57343>=Wt&&(en=65536+((1023&en)<<10)+(1023&Wt),on++),127>=en?Zt+=String.fromCharCode(en):2047>=en?Zt+=String.fromCharCode(192|en>>>6&31,128|63&en):65535>=en?Zt+=String.fromCharCode(224|en>>>12&15,128|en>>>6&63,128|63&en):2097151>=en&&(Zt+=String.fromCharCode(240|en>>>18&7,128|en>>>12&63,128|en>>>6&63,128|63&en));return Zt}(Jt))),vt[St])?vt[St].apply(null,rt):(Jt=Function.apply(null,jt.concat(Jt)),vt&&(vt[St]=Jt),Jt.apply(null,rt))}}}function Q(Xe){return Array.isArray(Xe)||Ee(Xe)||r(Xe)}function Z(Xe){return Xe.sort(function(ut,wt){return ut==="viewport"?-1:wt==="viewport"?1:ut"+Cr+"?"+An+".constant["+Cr+"]:0;"}).join(""),"}}else{","if(",Tr,"(",An,".buffer)){",Rr,"=",er,".createStream(",34962,",",An,".buffer);","}else{",Rr,"=",er,".getBuffer(",An,".buffer);","}",$r,'="type" in ',An,"?",br.glTypes,"[",An,".type]:",Rr,".dtype;",yr.normalized,"=!!",An,".normalized;"),ln("size"),ln("offset"),ln("stride"),ln("divisor"),dn("}}"),dn.exit("if(",yr.isStream,"){",er,".destroyStream(",Rr,");","}"),yr})}),Un}function Kn(an,_n,gn,qn,Un){function tr(Ur){var Rr=Bn[Ur];Rr&&(ln[Ur]=Rr)}var Wn=function(Ur,Rr){if(typeof($r=Ur.static).frag=="string"&&typeof $r.vert=="string"){if(0"u"?"Date.now()":"performance.now()"}function Wn(Ur){Ur(ln=_n.def(),"=",tr(),";"),typeof Un=="string"?Ur(br,".count+=",Un,";"):Ur(br,".count++;"),qt&&(qn?Ur(An=_n.def(),"=",yr,".getNumPendingQueries();"):Ur(yr,".beginQuery(",br,");"))}function Bn(Ur){Ur(br,".cpuTime+=",tr(),"-",ln,";"),qt&&(qn?Ur(yr,".pushScopeStats(",An,",",yr,".getNumPendingQueries(),",br,");"):Ur(yr,".endQuery();"))}function dn(Ur){var Rr=_n.def(Tr,".profile");_n(Tr,".profile=",Ur,";"),_n.exit(Tr,".profile=",Rr,";")}var ln,An,er=an.shared,br=an.stats,Tr=er.current,yr=er.timer;if(gn=gn.profile){if(ae(gn))return void(gn.enable?(Wn(_n),Bn(_n.exit),dn("true")):dn("false"));dn(gn=gn.append(an,_n))}else gn=_n.def(Tr,".profile");Wn(er=an.block()),_n("if(",gn,"){",er,"}"),Bn(an=an.block()),_n.exit("if(",gn,"){",an,"}")}function $n(an,_n,gn,qn,Un){function tr(Bn,dn,ln){function An(){_n("if(!",yr,".buffer){",br,".enableVertexAttribArray(",Tr,");}");var Pr,Cr=ln.type;Pr=ln.size?_n.def(ln.size,"||",dn):dn,_n("if(",yr,".type!==",Cr,"||",yr,".size!==",Pr,"||",$r.map(function(Jr){return yr+"."+Jr+"!=="+ln[Jr]}).join("||"),"){",br,".bindBuffer(",34962,",",Ur,".buffer);",br,".vertexAttribPointer(",[Tr,Pr,Cr,ln.normalized,ln.stride,ln.offset],");",yr,".type=",Cr,";",yr,".size=",Pr,";",$r.map(function(Jr){return yr+"."+Jr+"="+ln[Jr]+";"}).join(""),"}"),kn&&(Cr=ln.divisor,_n("if(",yr,".divisor!==",Cr,"){",an.instancing,".vertexAttribDivisorANGLE(",[Tr,Cr],");",yr,".divisor=",Cr,";}"))}function er(){_n("if(",yr,".buffer){",br,".disableVertexAttribArray(",Tr,");",yr,".buffer=null;","}if(",Qe.map(function(Pr,Cr){return yr+"."+Pr+"!=="+Rr[Cr]}).join("||"),"){",br,".vertexAttrib4f(",Tr,",",Rr,");",Qe.map(function(Pr,Cr){return yr+"."+Pr+"="+Rr[Cr]+";"}).join(""),"}")}var br=Wn.gl,Tr=_n.def(Bn,".location"),yr=_n.def(Wn.attributes,"[",Tr,"]");Bn=ln.state;var Ur=ln.buffer,Rr=[ln.x,ln.y,ln.z,ln.w],$r=["buffer","normalized","offset","stride"];Bn===1?An():Bn===2?er():(_n("if(",Bn,"===",1,"){"),An(),_n("}else{"),er(),_n("}"))}var Wn=an.shared;qn.forEach(function(Bn){var dn,ln=Bn.name,An=gn.attributes[ln];if(An){if(!Un(An))return;dn=An.append(an,_n)}else{if(!Un(lt))return;var er=an.scopeAttrib(ln);dn={},Object.keys(new xr).forEach(function(br){dn[br]=_n.def(er,".",br)})}tr(an.link(Bn),function(br){switch(br){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(Bn.info.type),dn)})}function vr(an,_n,gn,qn,Un,tr){for(var Wn,Bn=an.shared,dn=Bn.gl,ln=0;ln>1)",Bn],");")}function Jr(){gn(dn,".drawArraysInstancedANGLE(",[yr,Ur,Rr,Bn],");")}Tr&&Tr!=="null"?Pr?Cr():(gn("if(",Tr,"){"),Cr(),gn("}else{"),Jr(),gn("}")):Jr()}function Wn(){function Cr(){gn(An+".drawElements("+[yr,Rr,$r,Ur+"<<(("+$r+"-5121)>>1)"]+");")}function Jr(){gn(An+".drawArrays("+[yr,Ur,Rr]+");")}Tr&&Tr!=="null"?Pr?Cr():(gn("if(",Tr,"){"),Cr(),gn("}else{"),Jr(),gn("}")):Jr()}var Bn,dn,ln=an.shared,An=ln.gl,er=ln.draw,br=qn.draw,Tr=function(){var Cr=br.elements,Jr=_n;return Cr?((Cr.contextDep&&qn.contextDynamic||Cr.propDep)&&(Jr=gn),Cr=Cr.append(an,Jr),br.elementsActive&&Jr("if("+Cr+")"+An+".bindBuffer(34963,"+Cr+".buffer.buffer);")):(Cr=Jr.def(),Jr(Cr,"=",er,".","elements",";","if(",Cr,"){",An,".bindBuffer(",34963,",",Cr,".buffer.buffer);}","else if(",ln.vao,".currentVAO){",Cr,"=",an.shared.elements+".getElements("+ln.vao,".currentVAO.elements);",ur?"":"if("+Cr+")"+An+".bindBuffer(34963,"+Cr+".buffer.buffer);","}")),Cr}(),yr=Un("primitive"),Ur=Un("offset"),Rr=function(){var Cr=br.count,Jr=_n;return Cr?((Cr.contextDep&&qn.contextDynamic||Cr.propDep)&&(Jr=gn),Cr=Cr.append(an,Jr)):Cr=Jr.def(er,".","count"),Cr}();if(typeof Rr=="number"){if(Rr===0)return}else gn("if(",Rr,"){"),gn.exit("}");kn&&(Bn=Un("instances"),dn=an.instancing);var $r=Tr+".type",Pr=br.elements&&ae(br.elements)&&!br.vaoActive;kn&&(typeof Bn!="number"||0<=Bn)?typeof Bn=="string"?(gn("if(",Bn,">0){"),tr(),gn("}else if(",Bn,"<0){"),Wn(),gn("}")):tr():Wn()}function lr(an,_n,gn,qn,Un){return Un=(_n=Pn()).proc("body",Un),kn&&(_n.instancing=Un.def(_n.shared.extensions,".angle_instanced_arrays")),an(_n,Un,gn,qn),_n.compile().body}function hr(an,_n,gn,qn){zn(an,_n),gn.useVAO?gn.drawVAO?_n(an.shared.vao,".setVAO(",gn.drawVAO.append(an,_n),");"):_n(an.shared.vao,".setVAO(",an.shared.vao,".targetVAO);"):(_n(an.shared.vao,".setVAO(null);"),$n(an,_n,gn,qn.attributes,function(){return!0})),vr(an,_n,gn,qn.uniforms,function(){return!0},!1),Qn(an,_n,_n,gn)}function jr(an,_n,gn,qn){function Un(){return!0}an.batchId="a1",zn(an,_n),$n(an,_n,gn,qn.attributes,Un),vr(an,_n,gn,qn.uniforms,Un,!1),Qn(an,_n,_n,gn)}function ni(an,_n,gn,qn){function Un(er){return er.contextDep&&Wn||er.propDep}function tr(er){return!Un(er)}zn(an,_n);var Wn=gn.contextDep,Bn=_n.def(),dn=_n.def();an.shared.props=dn,an.batchId=Bn;var ln=an.scope(),An=an.scope();_n(ln.entry,"for(",Bn,"=0;",Bn,"<","a1",";++",Bn,"){",dn,"=","a0","[",Bn,"];",An,"}",ln.exit),gn.needsContext&&Ln(an,An,gn.context),gn.needsFramebuffer&&Tn(an,An,gn.framebuffer),wn(an,An,gn.state,Un),gn.profile&&Un(gn.profile)&&Jn(an,An,gn,!1,!0),qn?(gn.useVAO?gn.drawVAO?Un(gn.drawVAO)?An(an.shared.vao,".setVAO(",gn.drawVAO.append(an,An),");"):ln(an.shared.vao,".setVAO(",gn.drawVAO.append(an,ln),");"):ln(an.shared.vao,".setVAO(",an.shared.vao,".targetVAO);"):(ln(an.shared.vao,".setVAO(null);"),$n(an,ln,gn,qn.attributes,tr),$n(an,An,gn,qn.attributes,Un)),vr(an,ln,gn,qn.uniforms,tr,!1),vr(an,An,gn,qn.uniforms,Un,!0),Qn(an,ln,An,gn)):(_n=an.global.def("{}"),qn=gn.shader.progVar.append(an,An),dn=An.def(qn,".id"),ln=An.def(_n,"[",dn,"]"),An(an.shared.gl,".useProgram(",qn,".program);","if(!",ln,"){",ln,"=",_n,"[",dn,"]=",an.link(function(er){return lr(jr,an,gn,er,2)}),"(",qn,");}",ln,".call(this,a0[",Bn,"],",Bn,");"))}function Or(an,_n){function gn(Bn){var dn=_n.shader[Bn];dn&&(dn=dn.append(an,qn),isNaN(dn)?qn.set(Un.shader,"."+Bn,dn):qn.set(Un.shader,"."+Bn,an.link(dn,{stable:!0})))}var qn=an.proc("scope",3);an.batchId="a2";var Un=an.shared,tr=Un.current;if(Ln(an,qn,_n.context),_n.framebuffer&&_n.framebuffer.append(an,qn),Z(Object.keys(_n.state)).forEach(function(Bn){var dn=_n.state[Bn],ln=dn.append(an,qn);g(ln)?ln.forEach(function(An,er){isNaN(An)?qn.set(an.next[Bn],"["+er+"]",An):qn.set(an.next[Bn],"["+er+"]",an.link(An,{stable:!0}))}):ae(dn)?qn.set(Un.next,"."+Bn,an.link(ln,{stable:!0})):qn.set(Un.next,"."+Bn,ln)}),Jn(an,qn,_n,!0,!0),["elements","offset","count","instances","primitive"].forEach(function(Bn){var dn=_n.draw[Bn];dn&&(dn=dn.append(an,qn),isNaN(dn)?qn.set(Un.draw,"."+Bn,dn):qn.set(Un.draw,"."+Bn,an.link(dn),{stable:!0}))}),Object.keys(_n.uniforms).forEach(function(Bn){var dn=_n.uniforms[Bn].append(an,qn);Array.isArray(dn)&&(dn="["+dn.map(function(ln){return isNaN(ln)?ln:an.link(ln,{stable:!0})})+"]"),qn.set(Un.uniforms,"["+an.link(ut.id(Bn),{stable:!0})+"]",dn)}),Object.keys(_n.attributes).forEach(function(Bn){var dn=_n.attributes[Bn].append(an,qn),ln=an.scopeAttrib(Bn);Object.keys(new xr).forEach(function(An){qn.set(ln,"."+An,dn[An])})}),_n.scopeVAO){var Wn=_n.scopeVAO.append(an,qn);isNaN(Wn)?qn.set(Un.vao,".targetVAO",Wn):qn.set(Un.vao,".targetVAO",an.link(Wn,{stable:!0}))}gn("vert"),gn("frag"),0=--this.refCount&&rt(this)},Lt.profile&&(vt.getTotalRenderbufferSize=function(){var St=0;return Object.keys(Ft).forEach(function(Jt){St+=Ft[Jt].stats.size}),St}),{create:function(St,Jt){function qt(Wt,Zt){var on=0,un=0,Pn=32854;if(typeof Wt=="object"&&Wt?("shape"in Wt?(on=0|(un=Wt.shape)[0],un=0|un[1]):("radius"in Wt&&(on=un=0|Wt.radius),"width"in Wt&&(on=0|Wt.width),"height"in Wt&&(un=0|Wt.height)),"format"in Wt&&(Pn=et[Wt.format])):typeof Wt=="number"?(on=0|Wt,un=typeof Zt=="number"?0|Zt:on):Wt||(on=un=1),on!==en.width||un!==en.height||Pn!==en.format)return qt.width=en.width=on,qt.height=en.height=un,en.format=Pn,Xe.bindRenderbuffer(36161,en.renderbuffer),Xe.renderbufferStorage(36161,Pn,on,un),Lt.profile&&(en.stats.size=kt[en.format]*en.width*en.height),qt.format=Et[en.format],qt}var en=new jt(Xe.createRenderbuffer());return Ft[en.id]=en,vt.renderbufferCount++,qt(St,Jt),qt.resize=function(Wt,Zt){var on=0|Wt,un=0|Zt||on;return on===en.width&&un===en.height||(qt.width=en.width=on,qt.height=en.height=un,Xe.bindRenderbuffer(36161,en.renderbuffer),Xe.renderbufferStorage(36161,en.format,on,un),Lt.profile&&(en.stats.size=kt[en.format]*en.width*en.height)),qt},qt._reglType="renderbuffer",qt._renderbuffer=en,Lt.profile&&(qt.stats=en.stats),qt.destroy=function(){en.decRef()},qt},clear:function(){Ce(Ft).forEach(rt)},restore:function(){Ce(Ft).forEach(function(St){St.renderbuffer=Xe.createRenderbuffer(),Xe.bindRenderbuffer(36161,St.renderbuffer),Xe.renderbufferStorage(36161,St.format,St.width,St.height)}),Xe.bindRenderbuffer(36161,null)}}},Ht=[];Ht[6408]=4,Ht[6407]=3;var Gt=[];Gt[5121]=1,Gt[5126]=4,Gt[36193]=2;var st=[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],Qe=["x","y","z","w"],pt="blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "),yt={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},Ot={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},Pt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},at={cw:2304,ccw:2305},lt=new K(!1,!1,!1,function(){});return function(Xe){function ut(){if(jr.length===0)Dn&&Dn.update(),xr=null;else{xr=ye.next(ut),Ft();for(var kn=jr.length-1;0<=kn;--kn){var Cn=jr[kn];Cn&&Cn(Kn,null,0)}qt.flush(),Dn&&Dn.update()}}function wt(){!xr&&0=jr.length&&vt()}}}}function Bt(){var kn=lr.viewport,Cn=lr.scissor_box;kn[0]=kn[1]=Cn[0]=Cn[1]=0,Kn.viewportWidth=Kn.framebufferWidth=Kn.drawingBufferWidth=kn[2]=Cn[2]=qt.drawingBufferWidth,Kn.viewportHeight=Kn.framebufferHeight=Kn.drawingBufferHeight=kn[3]=Cn[3]=qt.drawingBufferHeight}function Ft(){Kn.tick+=1,Kn.time=Jt(),Bt(),Qn.procs.poll()}function St(){Jn.refresh(),Bt(),Qn.procs.refresh(),Dn&&Dn.update()}function Jt(){return(me()-In)/1e3}if(!(Xe=w(Xe)))return null;var qt=Xe.gl,en=qt.getContextAttributes();qt.isContextLost();var Wt=function(kn,Cn){function ur(Er){var Xr;Er=Er.toLowerCase();try{Xr=Zn[Er]=kn.getExtension(Er)}catch{}return!!Xr}for(var Zn={},cr=0;crCn;++Cn)Qr(oe({framebuffer:kn.framebuffer.faces[Cn]},kn),et);else Qr(kn,et);else et(0,kn)},prop:ge.define.bind(null,1),context:ge.define.bind(null,2),this:ge.define.bind(null,3),draw:rt({}),buffer:function(kn){return Tn.create(kn,34962,!1,!1)},elements:function(kn){return Fn.create(kn,!1)},texture:Jn.create2D,cube:Jn.createCube,renderbuffer:$n.create,framebuffer:vr.create,framebufferCube:vr.createCube,vao:wn.createVAO,attributes:en,frame:Et,on:function(kn,Cn){var ur;switch(kn){case"frame":return Et(Cn);case"lost":ur=ni;break;case"restore":ur=Or;break;case"destroy":ur=Ar}return ur.push(Cn),{cancel:function(){for(var Zn=0;Zn4294967295||_(r)!==r)throw new y("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],l=!0,o=!0;if("length"in u&&w){var s=w(u,"length");s&&!s.configurable&&(l=!1),s&&!s.writable&&(o=!1)}return(l||o||!n)&&(e?d(u,"length",r,!0,!0):d(u,"length",r)),u}},90386:function(D,L,t){D.exports=d;var b=t(7683).EventEmitter;function d(){b.call(this)}t(28062)(d,b),d.Readable=t(44639),d.Writable=t(84627),d.Duplex=t(71977),d.Transform=t(40255),d.PassThrough=t(28765),d.finished=t(37165),d.pipeline=t(6772),d.Stream=d,d.prototype.pipe=function(e,w){var y=this;function _(c){e.writable&&e.write(c)===!1&&y.pause&&y.pause()}function u(){y.readable&&y.resume&&y.resume()}y.on("data",_),e.on("drain",u),e._isStdio||w&&w.end===!1||(y.on("end",n),y.on("close",l));var r=!1;function n(){r||(r=!0,e.end())}function l(){r||(r=!0,typeof e.destroy=="function"&&e.destroy())}function o(c){if(s(),b.listenerCount(this,"error")===0)throw c}function s(){y.removeListener("data",_),e.removeListener("drain",u),y.removeListener("end",n),y.removeListener("close",l),y.removeListener("error",o),e.removeListener("error",o),y.removeListener("end",s),y.removeListener("close",s),e.removeListener("close",s)}return y.on("error",o),e.on("error",o),y.on("end",s),y.on("close",s),e.on("close",s),e.emit("pipe",y),e}},44059:function(D){var L={};function t(d,e,w){w||(w=Error);var y=function(_){var u,r;function n(l,o,s){return _.call(this,function(c,h,x){return typeof e=="string"?e:e(c,h,x)}(l,o,s))||this}return r=_,(u=n).prototype=Object.create(r.prototype),u.prototype.constructor=u,u.__proto__=r,n}(w);y.prototype.name=w.name,y.prototype.code=d,L[d]=y}function b(d,e){if(Array.isArray(d)){var w=d.length;return d=d.map(function(y){return String(y)}),w>2?"one of ".concat(e," ").concat(d.slice(0,w-1).join(", "),", or ")+d[w-1]:w===2?"one of ".concat(e," ").concat(d[0]," or ").concat(d[1]):"of ".concat(e," ").concat(d[0])}return"of ".concat(e," ").concat(String(d))}t("ERR_INVALID_OPT_VALUE",function(d,e){return'The value "'+e+'" is invalid for option "'+d+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(d,e,w){var y,_,u,r,n;if(typeof e=="string"&&(_="not ",e.substr(0,4)===_)?(y="must not be",e=e.replace(/^not /,"")):y="must be",function(o,s,c){return(c===void 0||c>o.length)&&(c=o.length),o.substring(c-9,c)===s}(d," argument"))u="The ".concat(d," ").concat(y," ").concat(b(e,"type"));else{var l=(typeof n!="number"&&(n=0),n+1>(r=d).length||r.indexOf(".",n)===-1?"argument":"property");u='The "'.concat(d,'" ').concat(l," ").concat(y," ").concat(b(e,"type"))}return u+". Received type ".concat(typeof w)},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(d){return"The "+d+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(d){return"Cannot call "+d+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(d){return"Unknown encoding: "+d},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),D.exports.F=L},71977:function(D,L,t){var b=t(33282),d=Object.keys||function(o){var s=[];for(var c in o)s.push(c);return s};D.exports=r;var e=t(44639),w=t(84627);t(28062)(r,e);for(var y=d(w.prototype),_=0;_0)if(typeof he=="string"||ge.objectMode||Object.getPrototypeOf(he)===_.prototype||(he=function(ye){return _.from(ye)}(he)),ie)ge.endEmitted?v(se,new A):f(se,ge,he,!0);else if(ge.ended)v(se,new g);else{if(ge.destroyed)return!1;ge.reading=!1,ge.decoder&&!fe?(he=ge.decoder.write(he),ge.objectMode||he.length!==0?f(se,ge,he,!1):V(se,ge)):f(se,ge,he,!1)}else ie||(ge.reading=!1,V(se,ge));return!ge.ended&&(ge.lengthhe.highWaterMark&&(he.highWaterMark=function(fe){return fe>=E?fe=E:(fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++),fe}(se)),se<=he.length?se:he.ended?he.length:(he.needReadable=!0,0))}function B(se){var he=se._readableState;e("emitReadable",he.needReadable,he.emittedReadable),he.needReadable=!1,he.emittedReadable||(e("emitReadable",he.flowing),he.emittedReadable=!0,d.nextTick(N,se))}function N(se){var he=se._readableState;e("emitReadable_",he.destroyed,he.length,he.ended),he.destroyed||!he.length&&!he.ended||(se.emit("readable"),he.emittedReadable=!1),he.needReadable=!he.flowing&&!he.ended&&he.length<=he.highWaterMark,J(se)}function V(se,he){he.readingMore||(he.readingMore=!0,d.nextTick(j,se,he))}function j(se,he){for(;!he.reading&&!he.ended&&(he.length0,he.resumeScheduled&&!he.paused?he.flowing=!0:se.listenerCount("data")>0&&se.resume()}function ee(se){e("readable nexttick read 0"),se.read(0)}function H(se,he){e("resume",he.reading),he.reading||se.read(0),he.resumeScheduled=!1,se.emit("resume"),J(se),he.flowing&&!he.reading&&se.read(0)}function J(se){var he=se._readableState;for(e("flow",he.flowing);he.flowing&&se.read()!==null;);}function Q(se,he){return he.length===0?null:(he.objectMode?fe=he.buffer.shift():!se||se>=he.length?(fe=he.decoder?he.buffer.join(""):he.buffer.length===1?he.buffer.first():he.buffer.concat(he.length),he.buffer.clear()):fe=he.buffer.consume(se,he.decoder),fe);var fe}function Z(se){var he=se._readableState;e("endReadable",he.endEmitted),he.endEmitted||(he.ended=!0,d.nextTick(K,he,se))}function K(se,he){if(e("endReadableNT",se.endEmitted,se.length),!se.endEmitted&&se.length===0&&(se.endEmitted=!0,he.readable=!1,he.emit("end"),se.autoDestroy)){var fe=he._writableState;(!fe||fe.autoDestroy&&fe.finished)&&he.destroy()}}function ae(se,he){for(var fe=0,ie=se.length;fe=he.highWaterMark:he.length>0)||he.ended))return e("read: emitReadable",he.length,he.ended),he.length===0&&he.ended?Z(this):B(this),null;if((se=I(se,he))===0&&he.ended)return he.length===0&&Z(this),null;var ie,oe=he.needReadable;return e("need readable",oe),(he.length===0||he.length-se0?Q(se,he):null)===null?(he.needReadable=he.length<=he.highWaterMark,se=0):(he.length-=se,he.awaitDrain=0),he.length===0&&(he.ended||(he.needReadable=!0),fe!==se&&he.ended&&Z(this)),ie!==null&&this.emit("data",ie),ie},p.prototype._read=function(se){v(this,new k("_read()"))},p.prototype.pipe=function(se,he){var fe=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=se;break;case 1:ie.pipes=[ie.pipes,se];break;default:ie.pipes.push(se)}ie.pipesCount+=1,e("pipe count=%d opts=%j",ie.pipesCount,he);var oe=he&&he.end===!1||se===d.stdout||se===d.stderr?Ce:le;function le(){e("onend"),se.end()}ie.endEmitted?d.nextTick(oe):fe.once("end",oe),se.on("unpipe",function Le(Oe,We){e("onunpipe"),Oe===fe&&We&&We.hasUnpiped===!1&&(We.hasUnpiped=!0,e("cleanup"),se.removeListener("close",Se),se.removeListener("finish",Ee),se.removeListener("drain",ge),se.removeListener("error",be),se.removeListener("unpipe",Le),fe.removeListener("end",le),fe.removeListener("end",Ce),fe.removeListener("data",me),ye=!0,!ie.awaitDrain||se._writableState&&!se._writableState.needDrain||ge())});var ge=function(Le){return function(){var Oe=Le._readableState;e("pipeOnDrain",Oe.awaitDrain),Oe.awaitDrain&&Oe.awaitDrain--,Oe.awaitDrain===0&&w(Le,"data")&&(Oe.flowing=!0,J(Le))}}(fe);se.on("drain",ge);var ye=!1;function me(Le){e("ondata");var Oe=se.write(Le);e("dest.write",Oe),Oe===!1&&((ie.pipesCount===1&&ie.pipes===se||ie.pipesCount>1&&ae(ie.pipes,se)!==-1)&&!ye&&(e("false write response, pause",ie.awaitDrain),ie.awaitDrain++),fe.pause())}function be(Le){e("onerror",Le),Ce(),se.removeListener("error",be),w(se,"error")===0&&v(se,Le)}function Se(){se.removeListener("finish",Ee),Ce()}function Ee(){e("onfinish"),se.removeListener("close",Se),Ce()}function Ce(){e("unpipe"),fe.unpipe(se)}return fe.on("data",me),function(Le,Oe,We){if(typeof Le.prependListener=="function")return Le.prependListener(Oe,We);Le._events&&Le._events[Oe]?Array.isArray(Le._events[Oe])?Le._events[Oe].unshift(We):Le._events[Oe]=[We,Le._events[Oe]]:Le.on(Oe,We)}(se,"error",be),se.once("close",Se),se.once("finish",Ee),se.emit("pipe",fe),ie.flowing||(e("pipe resume"),fe.resume()),se},p.prototype.unpipe=function(se){var he=this._readableState,fe={hasUnpiped:!1};if(he.pipesCount===0)return this;if(he.pipesCount===1)return se&&se!==he.pipes||(se||(se=he.pipes),he.pipes=null,he.pipesCount=0,he.flowing=!1,se&&se.emit("unpipe",this,fe)),this;if(!se){var ie=he.pipes,oe=he.pipesCount;he.pipes=null,he.pipesCount=0,he.flowing=!1;for(var le=0;le0,ie.flowing!==!1&&this.resume()):se==="readable"&&(ie.endEmitted||ie.readableListening||(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,e("on readable",ie.length,ie.reading),ie.length?B(this):ie.reading||d.nextTick(ee,this))),fe},p.prototype.addListener=p.prototype.on,p.prototype.removeListener=function(se,he){var fe=y.prototype.removeListener.call(this,se,he);return se==="readable"&&d.nextTick($,this),fe},p.prototype.removeAllListeners=function(se){var he=y.prototype.removeAllListeners.apply(this,arguments);return se!=="readable"&&se!==void 0||d.nextTick($,this),he},p.prototype.resume=function(){var se=this._readableState;return se.flowing||(e("resume"),se.flowing=!se.readableListening,function(he,fe){fe.resumeScheduled||(fe.resumeScheduled=!0,d.nextTick(H,he,fe))}(this,se)),se.paused=!1,this},p.prototype.pause=function(){return e("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(e("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},p.prototype.wrap=function(se){var he=this,fe=this._readableState,ie=!1;for(var oe in se.on("end",function(){if(e("wrapped end"),fe.decoder&&!fe.ended){var ge=fe.decoder.end();ge&&ge.length&&he.push(ge)}he.push(null)}),se.on("data",function(ge){e("wrapped data"),fe.decoder&&(ge=fe.decoder.write(ge)),fe.objectMode&&ge==null||(fe.objectMode||ge&&ge.length)&&(he.push(ge)||(ie=!0,se.pause()))}),se)this[oe]===void 0&&typeof se[oe]=="function"&&(this[oe]=function(ge){return function(){return se[ge].apply(se,arguments)}}(oe));for(var le=0;le-1))throw new A(V);return this._writableState.defaultEncoding=V,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),p.prototype._write=function(V,j,$){$(new c("_write()"))},p.prototype._writev=null,p.prototype.end=function(V,j,$){var ee=this._writableState;return typeof V=="function"?($=V,V=null,j=null):typeof j=="function"&&($=j,j=null),V!=null&&this.write(V,j),ee.corked&&(ee.corked=1,this.uncork()),ee.ending||function(H,J,Q){J.ending=!0,N(H,J),Q&&(J.finished?d.nextTick(Q):H.once("finish",Q)),J.ended=!0,H.writable=!1}(this,ee,$),this},Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(V){this._writableState&&(this._writableState.destroyed=V)}}),p.prototype.destroy=n.destroy,p.prototype._undestroy=n.undestroy,p.prototype._destroy=function(V,j){j(V)}},73726:function(D,L,t){var b,d=t(33282);function e(g,k,A){return k in g?Object.defineProperty(g,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):g[k]=A,g}var w=t(37165),y=Symbol("lastResolve"),_=Symbol("lastReject"),u=Symbol("error"),r=Symbol("ended"),n=Symbol("lastPromise"),l=Symbol("handlePromise"),o=Symbol("stream");function s(g,k){return{value:g,done:k}}function c(g){var k=g[y];if(k!==null){var A=g[o].read();A!==null&&(g[n]=null,g[y]=null,g[_]=null,k(s(A,!1)))}}function h(g){d.nextTick(c,g)}var x=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((e(b={get stream(){return this[o]},next:function(){var g=this,k=this[u];if(k!==null)return Promise.reject(k);if(this[r])return Promise.resolve(s(void 0,!0));if(this[o].destroyed)return new Promise(function(T,p){d.nextTick(function(){g[u]?p(g[u]):T(s(void 0,!0))})});var A,v=this[n];if(v)A=new Promise(function(T,p){return function(M,f){T.then(function(){p[r]?M(s(void 0,!0)):p[l](M,f)},f)}}(v,this));else{var S=this[o].read();if(S!==null)return Promise.resolve(s(S,!1));A=new Promise(this[l])}return this[n]=A,A}},Symbol.asyncIterator,function(){return this}),e(b,"return",function(){var g=this;return new Promise(function(k,A){g[o].destroy(null,function(v){v?A(v):k(s(void 0,!0))})})}),b),x);D.exports=function(g){var k,A=Object.create(m,(e(k={},o,{value:g,writable:!0}),e(k,y,{value:null,writable:!0}),e(k,_,{value:null,writable:!0}),e(k,u,{value:null,writable:!0}),e(k,r,{value:g._readableState.endEmitted,writable:!0}),e(k,l,{value:function(v,S){var T=A[o].read();T?(A[n]=null,A[y]=null,A[_]=null,v(s(T,!1))):(A[y]=v,A[_]=S)},writable:!0}),k));return A[n]=null,w(g,function(v){if(v&&v.code!=="ERR_STREAM_PREMATURE_CLOSE"){var S=A[_];return S!==null&&(A[n]=null,A[y]=null,A[_]=null,S(v)),void(A[u]=v)}var T=A[y];T!==null&&(A[n]=null,A[y]=null,A[_]=null,T(s(void 0,!0))),A[r]=!0}),g.on("readable",h.bind(null,A)),A}},29930:function(D,L,t){function b(u,r){var n=Object.keys(u);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(u);r&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(u,o).enumerable})),n.push.apply(n,l)}return n}function d(u,r,n){return r in u?Object.defineProperty(u,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):u[r]=n,u}function e(u,r){for(var n=0;n0?this.tail.next=o:this.head=o,this.tail=o,++this.length}},{key:"unshift",value:function(l){var o={data:l,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length}},{key:"shift",value:function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(l){if(this.length===0)return"";for(var o=this.head,s=""+o.data;o=o.next;)s+=l+o.data;return s}},{key:"concat",value:function(l){if(this.length===0)return w.alloc(0);for(var o,s,c,h=w.allocUnsafe(l>>>0),x=this.head,m=0;x;)o=x.data,s=h,c=m,w.prototype.copy.call(o,s,c),m+=x.data.length,x=x.next;return h}},{key:"consume",value:function(l,o){var s;return lh.length?h.length:l;if(x===h.length?c+=h:c+=h.slice(0,l),(l-=x)==0){x===h.length?(++s,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=h.slice(x));break}++s}return this.length-=s,c}},{key:"_getBuffer",value:function(l){var o=w.allocUnsafe(l),s=this.head,c=1;for(s.data.copy(o),l-=s.data.length;s=s.next;){var h=s.data,x=l>h.length?h.length:l;if(h.copy(o,o.length-l,0,x),(l-=x)==0){x===h.length?(++c,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=h.slice(x));break}++c}return this.length-=c,o}},{key:_,value:function(l,o){return y(this,function(s){for(var c=1;c0,function(g){o||(o=g),g&&c.forEach(_),m||(c.forEach(_),s(o))})});return n.reduce(u)}},31976:function(D,L,t){var b=t(44059).F.ERR_INVALID_OPT_VALUE;D.exports={getHighWaterMark:function(d,e,w,y){var _=function(u,r,n){return u.highWaterMark!=null?u.highWaterMark:r?u[n]:null}(e,y,w);if(_!=null){if(!isFinite(_)||Math.floor(_)!==_||_<0)throw new b(y?w:"highWaterMark",_);return Math.floor(_)}return d.objectMode?16:16384}}},60032:function(D,L,t){D.exports=t(7683).EventEmitter},54304:function(D,L,t){var b=t(41041).Buffer,d=b.isEncoding||function(s){switch((s=""+s)&&s.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function e(s){var c;switch(this.encoding=function(h){var x=function(m){if(!m)return"utf8";for(var g;;)switch(m){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return m;default:if(g)return;m=(""+m).toLowerCase(),g=!0}}(h);if(typeof x!="string"&&(b.isEncoding===d||!d(h)))throw new Error("Unknown encoding: "+h);return x||h}(s),this.encoding){case"utf16le":this.text=_,this.end=u,c=4;break;case"utf8":this.fillLast=y,c=4;break;case"base64":this.text=r,this.end=n,c=3;break;default:return this.write=l,void(this.end=o)}this.lastNeed=0,this.lastTotal=0,this.lastChar=b.allocUnsafe(c)}function w(s){return s<=127?0:s>>5==6?2:s>>4==14?3:s>>3==30?4:s>>6==2?-1:-2}function y(s){var c=this.lastTotal-this.lastNeed,h=function(x,m,g){if((192&m[0])!=128)return x.lastNeed=0,"�";if(x.lastNeed>1&&m.length>1){if((192&m[1])!=128)return x.lastNeed=1,"�";if(x.lastNeed>2&&m.length>2&&(192&m[2])!=128)return x.lastNeed=2,"�"}}(this,s);return h!==void 0?h:this.lastNeed<=s.length?(s.copy(this.lastChar,c,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(s.copy(this.lastChar,c,0,s.length),void(this.lastNeed-=s.length))}function _(s,c){if((s.length-c)%2==0){var h=s.toString("utf16le",c);if(h){var x=h.charCodeAt(h.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1],h.slice(0,-1)}return h}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=s[s.length-1],s.toString("utf16le",c,s.length-1)}function u(s){var c=s&&s.length?this.write(s):"";if(this.lastNeed){var h=this.lastTotal-this.lastNeed;return c+this.lastChar.toString("utf16le",0,h)}return c}function r(s,c){var h=(s.length-c)%3;return h===0?s.toString("base64",c):(this.lastNeed=3-h,this.lastTotal=3,h===1?this.lastChar[0]=s[s.length-1]:(this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1]),s.toString("base64",c,s.length-h))}function n(s){var c=s&&s.length?this.write(s):"";return this.lastNeed?c+this.lastChar.toString("base64",0,3-this.lastNeed):c}function l(s){return s.toString(this.encoding)}function o(s){return s&&s.length?this.write(s):""}L.I=e,e.prototype.write=function(s){if(s.length===0)return"";var c,h;if(this.lastNeed){if((c=this.fillLast(s))===void 0)return"";h=this.lastNeed,this.lastNeed=0}else h=0;return h=0?(v>0&&(m.lastNeed=v-1),v):--A=0?(v>0&&(m.lastNeed=v-2),v):--A=0?(v>0&&(v===2?v=0:m.lastNeed=v-3),v):0}(this,s,c);if(!this.lastNeed)return s.toString("utf8",c);this.lastTotal=h;var x=s.length-(h-this.lastNeed);return s.copy(this.lastChar,0,x),s.toString("utf8",c,x)},e.prototype.fillLast=function(s){if(this.lastNeed<=s.length)return s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);s.copy(this.lastChar,this.lastTotal-this.lastNeed,0,s.length),this.lastNeed-=s.length}},79743:function(D,L,t){var b=t(45708).Buffer,d=t(85672),e=t(79399)("stream-parser");D.exports=function(g){var k=g&&typeof g._transform=="function",A=g&&typeof g._write=="function";if(!k&&!A)throw new Error("must pass a Writable or Transform stream in");e("extending Parser into stream"),g._bytes=n,g._skipBytes=l,k&&(g._passthrough=o),k?g._transform=c:g._write=s};var w=-1,y=0,_=1,u=2;function r(g){e("initializing parser stream"),g._parserBytesLeft=0,g._parserBuffers=[],g._parserBuffered=0,g._parserState=w,g._parserCallback=null,typeof g.push=="function"&&(g._parserOutput=g.push.bind(g)),g._parserInit=!0}function n(g,k){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(g)&&g>0,'can only buffer a finite number of bytes > 0, got "'+g+'"'),this._parserInit||r(this),e("buffering %o bytes",g),this._parserBytesLeft=g,this._parserCallback=k,this._parserState=y}function l(g,k){d(!this._parserCallback,'there is already a "callback" set!'),d(g>0,'can only skip > 0 bytes, got "'+g+'"'),this._parserInit||r(this),e("skipping %o bytes",g),this._parserBytesLeft=g,this._parserCallback=k,this._parserState=_}function o(g,k){d(!this._parserCallback,'There is already a "callback" set!'),d(g>0,'can only pass through > 0 bytes, got "'+g+'"'),this._parserInit||r(this),e("passing through %o bytes",g),this._parserBytesLeft=g,this._parserCallback=k,this._parserState=u}function s(g,k,A){this._parserInit||r(this),e("write(%o bytes)",g.length),typeof k=="function"&&(A=k),x(this,g,null,A)}function c(g,k,A){this._parserInit||r(this),e("transform(%o bytes)",g.length),typeof k!="function"&&(k=this._parserOutput),x(this,g,k,A)}function h(g,k,A,v){if(g._parserBytesLeft-=k.length,e("%o bytes left for stream piece",g._parserBytesLeft),g._parserState===y?(g._parserBuffers.push(k),g._parserBuffered+=k.length):g._parserState===u&&A(k),g._parserBytesLeft!==0)return v;var S=g._parserCallback;if(S&&g._parserState===y&&g._parserBuffers.length>1&&(k=b.concat(g._parserBuffers,g._parserBuffered)),g._parserState!==y&&(k=null),g._parserCallback=null,g._parserBuffered=0,g._parserState=w,g._parserBuffers.splice(0),S){var T=[];k&&T.push(k),A&&T.push(A);var p=S.length>T.length;p&&T.push(m(v));var M=S.apply(g,T);if(!p||v===M)return v}}var x=m(function g(k,A,v,S){return k._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):A.length<=k._parserBytesLeft?function(){return h(k,A,v,S)}:function(){var T=A.slice(0,k._parserBytesLeft);return h(k,T,v,function(p){return p?S(p):A.length>T.length?function(){return g(k,A.slice(T.length),v,S)}:void 0})}});function m(g){return function(){for(var k=g.apply(this,arguments);typeof k=="function";)k=k();return k}}},79399:function(D,L,t){var b=t(33282);function d(){var e;try{e=L.storage.debug}catch{}return!e&&b!==void 0&&"env"in b&&(e=b.env.DEBUG),e}(L=D.exports=t(43228)).log=function(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},L.formatArgs=function(e){var w=this.useColors;if(e[0]=(w?"%c":"")+this.namespace+(w?" %c":" ")+e[0]+(w?"%c ":" ")+"+"+L.humanize(this.diff),w){var y="color: "+this.color;e.splice(1,0,y,"color: inherit");var _=0,u=0;e[0].replace(/%[a-zA-Z%]/g,function(r){r!=="%%"&&(_++,r==="%c"&&(u=_))}),e.splice(u,0,y)}},L.save=function(e){try{e==null?L.storage.removeItem("debug"):L.storage.debug=e}catch{}},L.load=d,L.useColors=function(){return!(typeof window>"u"||!window.process||window.process.type!=="renderer")||typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},L.storage=typeof chrome<"u"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),L.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],L.formatters.j=function(e){try{return JSON.stringify(e)}catch(w){return"[UnexpectedJSONParseError]: "+w.message}},L.enable(d())},43228:function(D,L,t){var b;function d(e){function w(){if(w.enabled){var y=w,_=+new Date,u=_-(b||_);y.diff=u,y.prev=b,y.curr=_,b=_;for(var r=new Array(arguments.length),n=0;n0)return function(r){if(!((r=String(r)).length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(n){var l=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"days":case"day":case"d":return l*d;case"hours":case"hour":case"hrs":case"hr":case"h":return l*b;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*L;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}(w);if(u==="number"&&isNaN(w)===!1)return y.long?e(_=w,d,"day")||e(_,b,"hour")||e(_,t,"minute")||e(_,L,"second")||_+" ms":function(r){return r>=d?Math.round(r/d)+"d":r>=b?Math.round(r/b)+"h":r>=t?Math.round(r/t)+"m":r>=L?Math.round(r/L)+"s":r+"ms"}(w);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(w))}},28089:function(D,L,t){var b=t(59811);D.exports=function(d,e,w){if(d==null)throw Error("First argument should be a string");if(e==null)throw Error("Separator should be a string or a RegExp");w?(typeof w=="string"||Array.isArray(w))&&(w={ignore:w}):w={},w.escape==null&&(w.escape=!0),w.ignore==null?w.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof w.ignore=="string"&&(w.ignore=[w.ignore]),w.ignore=w.ignore.map(function(o){return o.length===1&&(o+=o),o}));var y=b.parse(d,{flat:!0,brackets:w.ignore}),_=y[0].split(e);if(w.escape){for(var u=[],r=0;r<_.length;r++){var n=_[r],l=_[r+1];n[n.length-1]==="\\"&&n[n.length-2]!=="\\"?(u.push(n+e+l),r++):u.push(n)}_=u}for(r=0;r<_.length;r++)y[0]=_[r],_[r]=b.stringify(y,{flat:!0});return _}},26381:function(D){D.exports=function(L){for(var t=L.length,b=new Array(t),d=new Array(t),e=new Array(t),w=new Array(t),y=new Array(t),_=new Array(t),u=0;u0;){x=g[g.length-1];var k=L[x];if(w[x]=0&&_[x].push(y[v])}w[x]=A}else{if(d[x]===b[x]){var S=[],T=[],p=0;for(A=m.length-1;A>=0;--A){var M=m[A];if(e[M]=!1,S.push(M),T.push(_[M]),p+=_[M].length,y[M]=l.length,M===x){m.length=A;break}}l.push(S);var f=new Array(p);for(A=0;A1&&(n=1),n<-1&&(n=-1),(y*r-_*u<0?-1:1)*Math.acos(n)};L.default=function(y){var _=y.px,u=y.py,r=y.cx,n=y.cy,l=y.rx,o=y.ry,s=y.xAxisRotation,c=s===void 0?0:s,h=y.largeArcFlag,x=h===void 0?0:h,m=y.sweepFlag,g=m===void 0?0:m,k=[];if(l===0||o===0)return[];var A=Math.sin(c*b/360),v=Math.cos(c*b/360),S=v*(_-r)/2+A*(u-n)/2,T=-A*(_-r)/2+v*(u-n)/2;if(S===0&&T===0)return[];l=Math.abs(l),o=Math.abs(o);var p=Math.pow(S,2)/Math.pow(l,2)+Math.pow(T,2)/Math.pow(o,2);p>1&&(l*=Math.sqrt(p),o*=Math.sqrt(p));var M=function(ee,H,J,Q,Z,K,ae,se,he,fe,ie,oe){var le=Math.pow(Z,2),ge=Math.pow(K,2),ye=Math.pow(ie,2),me=Math.pow(oe,2),be=le*ge-le*me-ge*ye;be<0&&(be=0),be/=le*me+ge*ye;var Se=(be=Math.sqrt(be)*(ae===se?-1:1))*Z/K*oe,Ee=be*-K/Z*ie,Ce=fe*Se-he*Ee+(ee+J)/2,Le=he*Se+fe*Ee+(H+Q)/2,Oe=(ie-Se)/Z,We=(oe-Ee)/K,Ie=(-ie-Se)/Z,Ve=(-oe-Ee)/K,Pe=w(1,0,Oe,We),de=w(Oe,We,Ie,Ve);return se===0&&de>0&&(de-=b),se===1&&de<0&&(de+=b),[Ce,Le,Pe,de]}(_,u,r,n,l,o,x,g,A,v,S,T),f=function(ee,H){if(Array.isArray(ee))return ee;if(Symbol.iterator in Object(ee))return function(J,Q){var Z=[],K=!0,ae=!1,se=void 0;try{for(var he,fe=J[Symbol.iterator]();!(K=(he=fe.next()).done)&&(Z.push(he.value),!Q||Z.length!==Q);K=!0);}catch(ie){ae=!0,se=ie}finally{try{!K&&fe.return&&fe.return()}finally{if(ae)throw se}}return Z}(ee,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(M,4),E=f[0],I=f[1],B=f[2],N=f[3],V=Math.abs(N)/(b/4);Math.abs(1-V)<1e-7&&(V=1);var j=Math.max(Math.ceil(V),1);N/=j;for(var $=0;$u[2]&&(u[2]=l[o+0]),l[o+1]>u[3]&&(u[3]=l[o+1]);return u}},41883:function(D,L,t){D.exports=function(w){for(var y,_=[],u=0,r=0,n=0,l=0,o=null,s=null,c=0,h=0,x=0,m=w.length;x4?(u=g[g.length-4],r=g[g.length-3]):(u=c,r=h),_.push(g)}return _};var b=t(13193);function d(w,y,_,u){return["C",w,y,_,u,_,u]}function e(w,y,_,u,r,n){return["C",w/3+.6666666666666666*_,y/3+.6666666666666666*u,r/3+.6666666666666666*_,n/3+.6666666666666666*u,r,n]}},96021:function(D,L,t){var b,d=t(97251),e=t(26953),w=t(95620),y=t(13986),_=t(88772),u=document.createElement("canvas"),r=u.getContext("2d");D.exports=function(n,l){if(!y(n))throw Error("Argument should be valid svg path string");var o,s;l||(l={}),l.shape?(o=l.shape[0],s=l.shape[1]):(o=u.width=l.w||l.width||200,s=u.height=l.h||l.height||200);var c=Math.min(o,s),h=l.stroke||0,x=l.viewbox||l.viewBox||d(n),m=[o/(x[2]-x[0]),s/(x[3]-x[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(r.fillStyle="black",r.fillRect(0,0,o,s),r.fillStyle="white",h&&(typeof h!="number"&&(h=1),r.strokeStyle=h>0?"white":"black",r.lineWidth=Math.abs(h)),r.translate(.5*o,.5*s),r.scale(g,g),function(){if(b!=null)return b;var v=document.createElement("canvas").getContext("2d");if(v.canvas.width=v.canvas.height=1,!window.Path2D)return b=!1;var S=new Path2D("M0,0h1v1h-1v-1Z");v.fillStyle="black",v.fill(S);var T=v.getImageData(0,0,1,1);return b=T&&T.data&&T.data[3]===255}()){var k=new Path2D(n);r.fill(k),h&&r.stroke(k)}else{var A=e(n);w(r,A),r.fill(),h&&r.stroke()}return r.setTransform(1,0,0,1,0,0),_(r,{cutoff:l.cutoff!=null?l.cutoff:.5,radius:l.radius!=null?l.radius:.5*c})}},65657:function(D,L,t){var b;(function(d){var e=/^\s+/,w=/\s+$/,y=0,_=d.round,u=d.min,r=d.max,n=d.random;function l(ie,oe){if(oe=oe||{},(ie=ie||"")instanceof l)return ie;if(!(this instanceof l))return new l(ie,oe);var le=function(ge){var ye,me,be,Se={r:0,g:0,b:0},Ee=1,Ce=null,Le=null,Oe=null,We=!1,Ie=!1;return typeof ge=="string"&&(ge=function(Ve){Ve=Ve.replace(e,"").replace(w,"").toLowerCase();var Pe,de=!1;if(B[Ve])Ve=B[Ve],de=!0;else if(Ve=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};return(Pe=he.rgb.exec(Ve))?{r:Pe[1],g:Pe[2],b:Pe[3]}:(Pe=he.rgba.exec(Ve))?{r:Pe[1],g:Pe[2],b:Pe[3],a:Pe[4]}:(Pe=he.hsl.exec(Ve))?{h:Pe[1],s:Pe[2],l:Pe[3]}:(Pe=he.hsla.exec(Ve))?{h:Pe[1],s:Pe[2],l:Pe[3],a:Pe[4]}:(Pe=he.hsv.exec(Ve))?{h:Pe[1],s:Pe[2],v:Pe[3]}:(Pe=he.hsva.exec(Ve))?{h:Pe[1],s:Pe[2],v:Pe[3],a:Pe[4]}:(Pe=he.hex8.exec(Ve))?{r:ee(Pe[1]),g:ee(Pe[2]),b:ee(Pe[3]),a:Z(Pe[4]),format:de?"name":"hex8"}:(Pe=he.hex6.exec(Ve))?{r:ee(Pe[1]),g:ee(Pe[2]),b:ee(Pe[3]),format:de?"name":"hex"}:(Pe=he.hex4.exec(Ve))?{r:ee(Pe[1]+""+Pe[1]),g:ee(Pe[2]+""+Pe[2]),b:ee(Pe[3]+""+Pe[3]),a:Z(Pe[4]+""+Pe[4]),format:de?"name":"hex8"}:!!(Pe=he.hex3.exec(Ve))&&{r:ee(Pe[1]+""+Pe[1]),g:ee(Pe[2]+""+Pe[2]),b:ee(Pe[3]+""+Pe[3]),format:de?"name":"hex"}}(ge)),typeof ge=="object"&&(fe(ge.r)&&fe(ge.g)&&fe(ge.b)?(ye=ge.r,me=ge.g,be=ge.b,Se={r:255*j(ye,255),g:255*j(me,255),b:255*j(be,255)},We=!0,Ie=String(ge.r).substr(-1)==="%"?"prgb":"rgb"):fe(ge.h)&&fe(ge.s)&&fe(ge.v)?(Ce=J(ge.s),Le=J(ge.v),Se=function(Ve,Pe,de){Ve=6*j(Ve,360),Pe=j(Pe,100),de=j(de,100);var Me=d.floor(Ve),ke=Ve-Me,He=de*(1-Pe),Fe=de*(1-ke*Pe),qe=de*(1-(1-ke)*Pe),$e=Me%6;return{r:255*[de,Fe,He,He,qe,de][$e],g:255*[qe,de,de,Fe,He,He][$e],b:255*[He,He,qe,de,de,Fe][$e]}}(ge.h,Ce,Le),We=!0,Ie="hsv"):fe(ge.h)&&fe(ge.s)&&fe(ge.l)&&(Ce=J(ge.s),Oe=J(ge.l),Se=function(Ve,Pe,de){var Me,ke,He;function Fe(Ye,_e,De){return De<0&&(De+=1),De>1&&(De-=1),De<1/6?Ye+6*(_e-Ye)*De:De<.5?_e:De<2/3?Ye+(_e-Ye)*(2/3-De)*6:Ye}if(Ve=j(Ve,360),Pe=j(Pe,100),de=j(de,100),Pe===0)Me=ke=He=de;else{var qe=de<.5?de*(1+Pe):de+Pe-de*Pe,$e=2*de-qe;Me=Fe($e,qe,Ve+1/3),ke=Fe($e,qe,Ve),He=Fe($e,qe,Ve-1/3)}return{r:255*Me,g:255*ke,b:255*He}}(ge.h,Ce,Oe),We=!0,Ie="hsl"),ge.hasOwnProperty("a")&&(Ee=ge.a)),Ee=V(Ee),{ok:We,format:ge.format||Ie,r:u(255,r(Se.r,0)),g:u(255,r(Se.g,0)),b:u(255,r(Se.b,0)),a:Ee}}(ie);this._originalInput=ie,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=_(100*this._a)/100,this._format=oe.format||le.format,this._gradientType=oe.gradientType,this._r<1&&(this._r=_(this._r)),this._g<1&&(this._g=_(this._g)),this._b<1&&(this._b=_(this._b)),this._ok=le.ok,this._tc_id=y++}function o(ie,oe,le){ie=j(ie,255),oe=j(oe,255),le=j(le,255);var ge,ye,me=r(ie,oe,le),be=u(ie,oe,le),Se=(me+be)/2;if(me==be)ge=ye=0;else{var Ee=me-be;switch(ye=Se>.5?Ee/(2-me-be):Ee/(me+be),me){case ie:ge=(oe-le)/Ee+(oe>1)+720)%360;--oe;)ge.h=(ge.h+ye)%360,me.push(l(ge));return me}function I(ie,oe){oe=oe||6;for(var le=l(ie).toHsv(),ge=le.h,ye=le.s,me=le.v,be=[],Se=1/oe;oe--;)be.push(l({h:ge,s:ye,v:me})),me=(me+Se)%1;return be}l.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 ie=this.toRgb();return(299*ie.r+587*ie.g+114*ie.b)/1e3},getLuminance:function(){var ie,oe,le,ge=this.toRgb();return ie=ge.r/255,oe=ge.g/255,le=ge.b/255,.2126*(ie<=.03928?ie/12.92:d.pow((ie+.055)/1.055,2.4))+.7152*(oe<=.03928?oe/12.92:d.pow((oe+.055)/1.055,2.4))+.0722*(le<=.03928?le/12.92:d.pow((le+.055)/1.055,2.4))},setAlpha:function(ie){return this._a=V(ie),this._roundA=_(100*this._a)/100,this},toHsv:function(){var ie=s(this._r,this._g,this._b);return{h:360*ie.h,s:ie.s,v:ie.v,a:this._a}},toHsvString:function(){var ie=s(this._r,this._g,this._b),oe=_(360*ie.h),le=_(100*ie.s),ge=_(100*ie.v);return this._a==1?"hsv("+oe+", "+le+"%, "+ge+"%)":"hsva("+oe+", "+le+"%, "+ge+"%, "+this._roundA+")"},toHsl:function(){var ie=o(this._r,this._g,this._b);return{h:360*ie.h,s:ie.s,l:ie.l,a:this._a}},toHslString:function(){var ie=o(this._r,this._g,this._b),oe=_(360*ie.h),le=_(100*ie.s),ge=_(100*ie.l);return this._a==1?"hsl("+oe+", "+le+"%, "+ge+"%)":"hsla("+oe+", "+le+"%, "+ge+"%, "+this._roundA+")"},toHex:function(ie){return c(this._r,this._g,this._b,ie)},toHexString:function(ie){return"#"+this.toHex(ie)},toHex8:function(ie){return function(oe,le,ge,ye,me){var be=[H(_(oe).toString(16)),H(_(le).toString(16)),H(_(ge).toString(16)),H(Q(ye))];return me&&be[0].charAt(0)==be[0].charAt(1)&&be[1].charAt(0)==be[1].charAt(1)&&be[2].charAt(0)==be[2].charAt(1)&&be[3].charAt(0)==be[3].charAt(1)?be[0].charAt(0)+be[1].charAt(0)+be[2].charAt(0)+be[3].charAt(0):be.join("")}(this._r,this._g,this._b,this._a,ie)},toHex8String:function(ie){return"#"+this.toHex8(ie)},toRgb:function(){return{r:_(this._r),g:_(this._g),b:_(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+_(this._r)+", "+_(this._g)+", "+_(this._b)+")":"rgba("+_(this._r)+", "+_(this._g)+", "+_(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:_(100*j(this._r,255))+"%",g:_(100*j(this._g,255))+"%",b:_(100*j(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+_(100*j(this._r,255))+"%, "+_(100*j(this._g,255))+"%, "+_(100*j(this._b,255))+"%)":"rgba("+_(100*j(this._r,255))+"%, "+_(100*j(this._g,255))+"%, "+_(100*j(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(N[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(ie){var oe="#"+h(this._r,this._g,this._b,this._a),le=oe,ge=this._gradientType?"GradientType = 1, ":"";if(ie){var ye=l(ie);le="#"+h(ye._r,ye._g,ye._b,ye._a)}return"progid:DXImageTransform.Microsoft.gradient("+ge+"startColorstr="+oe+",endColorstr="+le+")"},toString:function(ie){var oe=!!ie;ie=ie||this._format;var le=!1,ge=this._a<1&&this._a>=0;return oe||!ge||ie!=="hex"&&ie!=="hex6"&&ie!=="hex3"&&ie!=="hex4"&&ie!=="hex8"&&ie!=="name"?(ie==="rgb"&&(le=this.toRgbString()),ie==="prgb"&&(le=this.toPercentageRgbString()),ie!=="hex"&&ie!=="hex6"||(le=this.toHexString()),ie==="hex3"&&(le=this.toHexString(!0)),ie==="hex4"&&(le=this.toHex8String(!0)),ie==="hex8"&&(le=this.toHex8String()),ie==="name"&&(le=this.toName()),ie==="hsl"&&(le=this.toHslString()),ie==="hsv"&&(le=this.toHsvString()),le||this.toHexString()):ie==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return l(this.toString())},_applyModification:function(ie,oe){var le=ie.apply(null,[this].concat([].slice.call(oe)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(k,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(x,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(S,arguments)},_applyCombination:function(ie,oe){return ie.apply(null,[this].concat([].slice.call(oe)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(T,arguments)},monochromatic:function(){return this._applyCombination(I,arguments)},splitcomplement:function(){return this._applyCombination(f,arguments)},triad:function(){return this._applyCombination(p,arguments)},tetrad:function(){return this._applyCombination(M,arguments)}},l.fromRatio=function(ie,oe){if(typeof ie=="object"){var le={};for(var ge in ie)ie.hasOwnProperty(ge)&&(le[ge]=ge==="a"?ie[ge]:J(ie[ge]));ie=le}return l(ie,oe)},l.equals=function(ie,oe){return!(!ie||!oe)&&l(ie).toRgbString()==l(oe).toRgbString()},l.random=function(){return l.fromRatio({r:n(),g:n(),b:n()})},l.mix=function(ie,oe,le){le=le===0?0:le||50;var ge=l(ie).toRgb(),ye=l(oe).toRgb(),me=le/100;return l({r:(ye.r-ge.r)*me+ge.r,g:(ye.g-ge.g)*me+ge.g,b:(ye.b-ge.b)*me+ge.b,a:(ye.a-ge.a)*me+ge.a})},l.readability=function(ie,oe){var le=l(ie),ge=l(oe);return(d.max(le.getLuminance(),ge.getLuminance())+.05)/(d.min(le.getLuminance(),ge.getLuminance())+.05)},l.isReadable=function(ie,oe,le){var ge,ye,me,be,Se,Ee=l.readability(ie,oe);switch(ye=!1,(me=le,(be=((me=me||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&be!=="AAA"&&(be="AA"),(Se=(me.size||"small").toLowerCase())!=="small"&&Se!=="large"&&(Se="small"),ge={level:be,size:Se}).level+ge.size){case"AAsmall":case"AAAlarge":ye=Ee>=4.5;break;case"AAlarge":ye=Ee>=3;break;case"AAAsmall":ye=Ee>=7}return ye},l.mostReadable=function(ie,oe,le){var ge,ye,me,be,Se=null,Ee=0;ye=(le=le||{}).includeFallbackColors,me=le.level,be=le.size;for(var Ce=0;CeEe&&(Ee=ge,Se=l(oe[Ce]));return l.isReadable(ie,Se,{level:me,size:be})||!ye?Se:(le.includeFallbackColors=!1,l.mostReadable(ie,["#fff","#000"],le))};var B=l.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"},N=l.hexNames=function(ie){var oe={};for(var le in ie)ie.hasOwnProperty(le)&&(oe[ie[le]]=le);return oe}(B);function V(ie){return ie=parseFloat(ie),(isNaN(ie)||ie<0||ie>1)&&(ie=1),ie}function j(ie,oe){(function(ge){return typeof ge=="string"&&ge.indexOf(".")!=-1&&parseFloat(ge)===1})(ie)&&(ie="100%");var le=function(ge){return typeof ge=="string"&&ge.indexOf("%")!=-1}(ie);return ie=u(oe,r(0,parseFloat(ie))),le&&(ie=parseInt(ie*oe,10)/100),d.abs(ie-oe)<1e-6?1:ie%oe/parseFloat(oe)}function $(ie){return u(1,r(0,ie))}function ee(ie){return parseInt(ie,16)}function H(ie){return ie.length==1?"0"+ie:""+ie}function J(ie){return ie<=1&&(ie=100*ie+"%"),ie}function Q(ie){return d.round(255*parseFloat(ie)).toString(16)}function Z(ie){return ee(ie)/255}var K,ae,se,he=(ae="[\\s|\\(]+("+(K="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",se="[\\s|\\(]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")[,|\\s]+("+K+")\\s*\\)?",{CSS_UNIT:new RegExp(K),rgb:new RegExp("rgb"+ae),rgba:new RegExp("rgba"+se),hsl:new RegExp("hsl"+ae),hsla:new RegExp("hsla"+se),hsv:new RegExp("hsv"+ae),hsva:new RegExp("hsva"+se),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 fe(ie){return!!he.CSS_UNIT.exec(ie)}D.exports?D.exports=l:(b=(function(){return l}).call(L,t,L,D))===void 0||(D.exports=b)})(Math)},51498:function(D){D.exports=t,D.exports.float32=D.exports.float=t,D.exports.fract32=D.exports.fract=function(b,d){if(b.length){if(b instanceof Float32Array)return new Float32Array(b.length);d instanceof Float32Array||(d=t(b));for(var e=0,w=d.length;e":(w.length>100&&(w=w.slice(0,99)+"…"),w=w.replace(d,function(y){switch(y){case` `:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}))}},76481:function(D,L,t){var b=t(80299),d={object:!0,function:!0,undefined:!0};D.exports=function(e){return!!b(e)&&hasOwnProperty.call(d,typeof e)}},6887:function(D,L,t){var b=t(99497),d=t(63461);D.exports=function(e){return d(e)?e:b(e,"%v is not a plain function",arguments[1])}},63461:function(D,L,t){var b=t(64276),d=/^\s*class[\s{/}]/,e=Function.prototype.toString;D.exports=function(w){return!!b(w)&&!d.test(e.call(w))}},31350:function(D,L,t){var b=t(76481);D.exports=function(d){if(!b(d))return!1;try{return!!d.constructor&&d.constructor.prototype===d}catch{return!1}}},58698:function(D,L,t){var b=t(80299),d=t(76481),e=Object.prototype.toString;D.exports=function(w){if(!b(w))return null;if(d(w)){var y=w.toString;if(typeof y!="function"||y===e)return null}try{return""+w}catch{return null}}},9557:function(D,L,t){var b=t(99497),d=t(80299);D.exports=function(e){return d(e)?e:b(e,"Cannot use %v",arguments[1])}},80299:function(D){D.exports=function(L){return L!=null}},66127:function(D,L,t){var b=t(54689),d=t(49523),e=t(45708).Buffer;t.g.__TYPEDARRAY_POOL||(t.g.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var w=typeof Uint8ClampedArray<"u",y=typeof BigUint64Array<"u",_=typeof BigInt64Array<"u",u=t.g.__TYPEDARRAY_POOL;u.UINT8C||(u.UINT8C=d([32,0])),u.BIGUINT64||(u.BIGUINT64=d([32,0])),u.BIGINT64||(u.BIGINT64=d([32,0])),u.BUFFER||(u.BUFFER=d([32,0]));var r=u.DATA,n=u.BUFFER;function l(f){if(f){var E=f.length||f.byteLength,I=b.log2(E);r[I].push(f)}}function o(f){f=b.nextPow2(f);var E=b.log2(f),I=r[E];return I.length>0?I.pop():new ArrayBuffer(f)}function s(f){return new Uint8Array(o(f),0,f)}function c(f){return new Uint16Array(o(2*f),0,f)}function h(f){return new Uint32Array(o(4*f),0,f)}function x(f){return new Int8Array(o(f),0,f)}function m(f){return new Int16Array(o(2*f),0,f)}function g(f){return new Int32Array(o(4*f),0,f)}function k(f){return new Float32Array(o(4*f),0,f)}function A(f){return new Float64Array(o(8*f),0,f)}function v(f){return w?new Uint8ClampedArray(o(f),0,f):s(f)}function S(f){return y?new BigUint64Array(o(8*f),0,f):null}function T(f){return _?new BigInt64Array(o(8*f),0,f):null}function p(f){return new DataView(o(f),0,f)}function M(f){f=b.nextPow2(f);var E=b.log2(f),I=n[E];return I.length>0?I.pop():new e(f)}L.free=function(f){if(e.isBuffer(f))n[b.log2(f.length)].push(f);else{if(Object.prototype.toString.call(f)!=="[object ArrayBuffer]"&&(f=f.buffer),!f)return;var E=f.length||f.byteLength,I=0|b.log2(E);r[I].push(f)}},L.freeUint8=L.freeUint16=L.freeUint32=L.freeBigUint64=L.freeInt8=L.freeInt16=L.freeInt32=L.freeBigInt64=L.freeFloat32=L.freeFloat=L.freeFloat64=L.freeDouble=L.freeUint8Clamped=L.freeDataView=function(f){l(f.buffer)},L.freeArrayBuffer=l,L.freeBuffer=function(f){n[b.log2(f.length)].push(f)},L.malloc=function(f,E){if(E===void 0||E==="arraybuffer")return o(f);switch(E){case"uint8":return s(f);case"uint16":return c(f);case"uint32":return h(f);case"int8":return x(f);case"int16":return m(f);case"int32":return g(f);case"float":case"float32":return k(f);case"double":case"float64":return A(f);case"uint8_clamped":return v(f);case"bigint64":return T(f);case"biguint64":return S(f);case"buffer":return M(f);case"data":case"dataview":return p(f);default:return null}return null},L.mallocArrayBuffer=o,L.mallocUint8=s,L.mallocUint16=c,L.mallocUint32=h,L.mallocInt8=x,L.mallocInt16=m,L.mallocInt32=g,L.mallocFloat32=L.mallocFloat=k,L.mallocFloat64=L.mallocDouble=A,L.mallocUint8Clamped=v,L.mallocBigUint64=S,L.mallocBigInt64=T,L.mallocDataView=p,L.mallocBuffer=M,L.clearCache=function(){for(var f=0;f<32;++f)u.UINT8[f].length=0,u.UINT16[f].length=0,u.UINT32[f].length=0,u.INT8[f].length=0,u.INT16[f].length=0,u.INT32[f].length=0,u.FLOAT[f].length=0,u.DOUBLE[f].length=0,u.BIGUINT64[f].length=0,u.BIGINT64[f].length=0,u.UINT8C[f].length=0,r[f].length=0,n[f].length=0}},80886:function(D){var L=/[\'\"]/;D.exports=function(t){return t?(L.test(t.charAt(0))&&(t=t.substr(1)),L.test(t.charAt(t.length-1))&&(t=t.substr(0,t.length-1)),t):""}},79788:function(D){D.exports=function(L,t,b){Array.isArray(b)||(b=[].slice.call(arguments,2));for(var d=0,e=b.length;d=H)return Z;switch(Z){case"%s":return String(ee[$++]);case"%d":return Number(ee[$++]);case"%j":try{return JSON.stringify(ee[$++])}catch{return"[Circular]"}default:return Z}}),Q=ee[$];$=3&&($.depth=arguments[2]),arguments.length>=4&&($.colors=arguments[3]),h(j)?$.showHidden=j:j&&L._extend($,j),k($.showHidden)&&($.showHidden=!1),k($.depth)&&($.depth=2),k($.colors)&&($.colors=!1),k($.customInspect)&&($.customInspect=!0),$.colors&&($.stylize=r),l($,V,$.depth)}function r(V,j){var $=u.styles[j];return $?"\x1B["+u.colors[$][0]+"m"+V+"\x1B["+u.colors[$][1]+"m":V}function n(V,j){return V}function l(V,j,$){if(V.customInspect&&j&&p(j.inspect)&&j.inspect!==L.inspect&&(!j.constructor||j.constructor.prototype!==j)){var ee=j.inspect($,V);return g(ee)||(ee=l(V,ee,$)),ee}var H=function(fe,ie){if(k(ie))return fe.stylize("undefined","undefined");if(g(ie)){var oe="'"+JSON.stringify(ie).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return fe.stylize(oe,"string")}return m(ie)?fe.stylize(""+ie,"number"):h(ie)?fe.stylize(""+ie,"boolean"):x(ie)?fe.stylize("null","null"):void 0}(V,j);if(H)return H;var J=Object.keys(j),Q=function(fe){var ie={};return fe.forEach(function(oe,le){ie[oe]=!0}),ie}(J);if(V.showHidden&&(J=Object.getOwnPropertyNames(j)),T(j)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return o(j);if(J.length===0){if(p(j)){var Z=j.name?": "+j.name:"";return V.stylize("[Function"+Z+"]","special")}if(A(j))return V.stylize(RegExp.prototype.toString.call(j),"regexp");if(S(j))return V.stylize(Date.prototype.toString.call(j),"date");if(T(j))return o(j)}var K,ae="",se=!1,he=["{","}"];return c(j)&&(se=!0,he=["[","]"]),p(j)&&(ae=" [Function"+(j.name?": "+j.name:"")+"]"),A(j)&&(ae=" "+RegExp.prototype.toString.call(j)),S(j)&&(ae=" "+Date.prototype.toUTCString.call(j)),T(j)&&(ae=" "+o(j)),J.length!==0||se&&j.length!=0?$<0?A(j)?V.stylize(RegExp.prototype.toString.call(j),"regexp"):V.stylize("[Object]","special"):(V.seen.push(j),K=se?function(fe,ie,oe,le,ge){for(var ye=[],me=0,be=ie.length;me60?oe[0]+(ie===""?"":ie+` `)+" "+fe.join(`, @@ -3553,8 +3553,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `+Z.split(` `).map(function(ae){return" "+ae}).join(` `)):Z=V.stylize("[Circular]","special")),k(Q)){if(J&&H.match(/^\d+$/))return Z;(Q=JSON.stringify(""+H)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(Q=Q.slice(1,-1),Q=V.stylize(Q,"name")):(Q=Q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Q=V.stylize(Q,"string"))}return Q+": "+Z}function c(V){return Array.isArray(V)}function h(V){return typeof V=="boolean"}function x(V){return V===null}function m(V){return typeof V=="number"}function g(V){return typeof V=="string"}function k(V){return V===void 0}function A(V){return v(V)&&M(V)==="[object RegExp]"}function v(V){return typeof V=="object"&&V!==null}function S(V){return v(V)&&M(V)==="[object Date]"}function T(V){return v(V)&&(M(V)==="[object Error]"||V instanceof Error)}function p(V){return typeof V=="function"}function M(V){return Object.prototype.toString.call(V)}function f(V){return V<10?"0"+V.toString(10):V.toString(10)}L.debuglog=function(V){if(V=V.toUpperCase(),!w[V])if(y.test(V)){var j=b.pid;w[V]=function(){var $=L.format.apply(L,arguments);console.error("%s %d: %s",V,j,$)}}else w[V]=function(){};return w[V]},L.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=t(15724),L.isArray=c,L.isBoolean=h,L.isNull=x,L.isNullOrUndefined=function(V){return V==null},L.isNumber=m,L.isString=g,L.isSymbol=function(V){return typeof V=="symbol"},L.isUndefined=k,L.isRegExp=A,L.types.isRegExp=A,L.isObject=v,L.isDate=S,L.types.isDate=S,L.isError=T,L.types.isNativeError=T,L.isFunction=p,L.isPrimitive=function(V){return V===null||typeof V=="boolean"||typeof V=="number"||typeof V=="string"||typeof V=="symbol"||V===void 0},L.isBuffer=t(44123);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(V,j){return Object.prototype.hasOwnProperty.call(V,j)}L.log=function(){var V,j;console.log("%s - %s",(j=[f((V=new Date).getHours()),f(V.getMinutes()),f(V.getSeconds())].join(":"),[V.getDate(),E[V.getMonth()],j].join(" ")),L.format.apply(L,arguments))},L.inherits=t(28062),L._extend=function(V,j){if(!j||!v(j))return V;for(var $=Object.keys(j),ee=$.length;ee--;)V[$[ee]]=j[$[ee]];return V};var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function N(V,j){if(!V){var $=new Error("Promise was rejected with a falsy value");$.reason=V,V=$}return j(V)}L.promisify=function(V){if(typeof V!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&V[B]){var j;if(typeof(j=V[B])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(j,B,{value:j,enumerable:!1,writable:!1,configurable:!0}),j}function j(){for(var $,ee,H=new Promise(function(Z,K){$=Z,ee=K}),J=[],Q=0;Q"u"?t.g:globalThis,n=d(),l=w("String.prototype.slice"),o=Object.getPrototypeOf,s=w("Array.prototype.indexOf",!0)||function(h,x){for(var m=0;m-1?x:x==="Object"&&function(m){var g=!1;return b(c,function(k,A){if(!g)try{k(m),g=l(A,1)}catch{}}),g}(h)}return y?function(m){var g=!1;return b(c,function(k,A){if(!g)try{"$"+k(m)===A&&(g=l(A,1))}catch{}}),g}(h):null}},1401:function(D,L,t){var b=t(24453),d=t(27976),e=b.instance();function w(o){this.local=this.regionalOptions[o||""]||this.regionalOptions[""]}w.prototype=new b.baseCalendar,d(w.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(o,s){if(typeof o=="string"){var c=o.match(_);return c?c[0]:""}var h=this._validateYear(o),x=o.month(),m=""+this.toChineseMonth(h,x);return s&&m.length<2&&(m="0"+m),this.isIntercalaryMonth(h,x)&&(m+="i"),m},monthNames:function(o){if(typeof o=="string"){var s=o.match(u);return s?s[0]:""}var c=this._validateYear(o),h=o.month(),x=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][this.toChineseMonth(c,h)-1];return this.isIntercalaryMonth(c,h)&&(x="闰"+x),x},monthNamesShort:function(o){if(typeof o=="string"){var s=o.match(r);return s?s[0]:""}var c=this._validateYear(o),h=o.month(),x=["一","二","三","四","五","六","七","八","九","十","十一","十二"][this.toChineseMonth(c,h)-1];return this.isIntercalaryMonth(c,h)&&(x="闰"+x),x},parseMonth:function(o,s){o=this._validateYear(o);var c,h=parseInt(s);if(isNaN(h))s[0]==="闰"&&(c=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),h=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var x=s[s.length-1];c=x==="i"||x==="I"}return this.toMonthIndex(o,h,c)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(o,s){if(o.year&&(o=o.year()),typeof o!="number"||o<1888||o>2111)throw s.replace(/\{0\}/,this.local.name);return o},toMonthIndex:function(o,s,c){var h=this.intercalaryMonth(o);if(c&&s!==h||s<1||s>12)throw b.local.invalidMonth.replace(/\{0\}/,this.local.name);return h?!c&&s<=h?s-1:s:s-1},toChineseMonth:function(o,s){o.year&&(s=(o=o.year()).month());var c=this.intercalaryMonth(o);if(s<0||s>(c?12:11))throw b.local.invalidMonth.replace(/\{0\}/,this.local.name);return c?s>13},isIntercalaryMonth:function(o,s){o.year&&(s=(o=o.year()).month());var c=this.intercalaryMonth(o);return!!c&&c===s},leapYear:function(o){return this.intercalaryMonth(o)!==0},weekOfYear:function(o,s,c){var h,x=this._validateYear(o,b.local.invalidyear),m=l[x-l[0]],g=m>>9&4095,k=m>>5&15,A=31&m;(h=e.newDate(g,k,A)).add(4-(h.dayOfWeek()||7),"d");var v=this.toJD(o,s,c)-h.toJD();return 1+Math.floor(v/7)},monthsInYear:function(o){return this.leapYear(o)?13:12},daysInMonth:function(o,s){o.year&&(s=o.month(),o=o.year()),o=this._validateYear(o);var c=n[o-n[0]];if(s>(c>>13?12:11))throw b.local.invalidMonth.replace(/\{0\}/,this.local.name);return c&1<<12-s?30:29},weekDay:function(o,s,c){return(this.dayOfWeek(o,s,c)||7)<6},toJD:function(o,s,c){var h=this._validate(o,m,c,b.local.invalidDate);o=this._validateYear(h.year()),s=h.month(),c=h.day();var x=this.isIntercalaryMonth(o,s),m=this.toChineseMonth(o,s),g=function(k,A,v,S,T){var p,M,f;if(typeof k=="object")M=k,p=A||{};else{var E;if(!(typeof k=="number"&&k>=1888&&k<=2111))throw new Error("Lunar year outside range 1888-2111");if(!(typeof A=="number"&&A>=1&&A<=12))throw new Error("Lunar month outside range 1 - 12");if(!(typeof v=="number"&&v>=1&&v<=30))throw new Error("Lunar day outside range 1 - 30");typeof S=="object"?(E=!1,p=S):(E=!!S,p={}),M={year:k,month:A,day:v,isIntercalary:E}}f=M.day-1;var I,B=n[M.year-n[0]],N=B>>13;I=N&&(M.month>N||M.isIntercalary)?M.month:M.month-1;for(var V=0;V>9&4095,(j>>5&15)-1,(31&j)+f);return p.year=$.getFullYear(),p.month=1+$.getMonth(),p.day=$.getDate(),p}(o,m,c,x);return e.toJD(g.year,g.month,g.day)},fromJD:function(o){var s=e.fromJD(o),c=function(x,m,g,k){var A,v;if(typeof x=="object")A=x,v=m||{};else{if(!(typeof x=="number"&&x>=1888&&x<=2111))throw new Error("Solar year outside range 1888-2111");if(!(typeof m=="number"&&m>=1&&m<=12))throw new Error("Solar month outside range 1 - 12");if(!(typeof g=="number"&&g>=1&&g<=31))throw new Error("Solar day outside range 1 - 31");A={year:x,month:m,day:g},v={}}var S=l[A.year-l[0]],T=A.year<<9|A.month<<5|A.day;v.year=T>=S?A.year:A.year-1,S=l[v.year-l[0]];var p,M=new Date(S>>9&4095,(S>>5&15)-1,31&S),f=new Date(A.year,A.month-1,A.day);p=Math.round((f-M)/864e5);var E,I=n[v.year-n[0]];for(E=0;E<13;E++){var B=I&1<<12-E?30:29;if(p>13;return!N||E=2&&r<=6},extraInfo:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);return{century:w[Math.floor((r.year()-1)/100)+1]||""}},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);return y=r.year()+(r.year()<0?1:0),_=r.month(),(u=r.day())+(_>1?16:0)+(_>2?32*(_-2):0)+400*(y-1)+this.jdEpoch-1},fromJD:function(y){y=Math.floor(y+.5)-Math.floor(this.jdEpoch)-1;var _=Math.floor(y/400)+1;y-=400*(_-1),y+=y>15?16:0;var u=Math.floor(y/32)+1,r=y-32*(u-1)+1;return this.newDate(_<=0?_-1:_,u,r)}});var w={20:"Fruitbat",21:"Anchovy"};b.calendars.discworld=e},81133:function(D,L,t){var b=t(24453),d=t(27976);function e(w){this.local=this.regionalOptions[w||""]||this.regionalOptions[""]}e.prototype=new b.baseCalendar,d(e.prototype,{name:"Ethiopian",jdEpoch:17242205e-1,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(w){var y=this._validate(w,this.minMonth,this.minDay,b.local.invalidYear);return(w=y.year()+(y.year()<0?1:0))%4==3||w%4==-1},monthsInYear:function(w){return this._validate(w,this.minMonth,this.minDay,b.local.invalidYear||b.regionalOptions[""].invalidYear),13},weekOfYear:function(w,y,_){var u=this.newDate(w,y,_);return u.add(-u.dayOfWeek(),"d"),Math.floor((u.dayOfYear()-1)/7)+1},daysInMonth:function(w,y){var _=this._validate(w,y,this.minDay,b.local.invalidMonth);return this.daysPerMonth[_.month()-1]+(_.month()===13&&this.leapYear(_.year())?1:0)},weekDay:function(w,y,_){return(this.dayOfWeek(w,y,_)||7)<6},toJD:function(w,y,_){var u=this._validate(w,y,_,b.local.invalidDate);return(w=u.year())<0&&w++,u.day()+30*(u.month()-1)+365*(w-1)+Math.floor(w/4)+this.jdEpoch-1},fromJD:function(w){var y=Math.floor(w)+.5-this.jdEpoch,_=Math.floor((y-Math.floor((y+366)/1461))/365)+1;_<=0&&_--,y=Math.floor(w)+.5-this.newDate(_,1,1).toJD();var u=Math.floor(y/30)+1,r=y-30*(u-1)+1;return this.newDate(_,u,r)}}),b.calendars.ethiopian=e},78295:function(D,L,t){var b=t(24453),d=t(27976);function e(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}function w(y,_){return y-_*Math.floor(y/_)}e.prototype=new b.baseCalendar,d(e.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(y){var _=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear);return this._leapYear(_.year())},_leapYear:function(y){return w(7*(y=y<0?y+1:y)+1,19)<7},monthsInYear:function(y){return this._validate(y,this.minMonth,this.minDay,b.local.invalidYear),this._leapYear(y.year?y.year():y)?13:12},weekOfYear:function(y,_,u){var r=this.newDate(y,_,u);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(y){return y=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear).year(),this.toJD(y===-1?1:y+1,7,1)-this.toJD(y,7,1)},daysInMonth:function(y,_){return y.year&&(_=y.month(),y=y.year()),this._validate(y,_,this.minDay,b.local.invalidMonth),_===12&&this.leapYear(y)||_===8&&w(this.daysInYear(y),10)===5?30:_===9&&w(this.daysInYear(y),10)===3?29:this.daysPerMonth[_-1]},weekDay:function(y,_,u){return this.dayOfWeek(y,_,u)!==6},extraInfo:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);return{yearType:(this.leapYear(r)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(r)%10-3]}},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);y=r.year(),_=r.month(),u=r.day();var n=y<=0?y+1:y,l=this.jdEpoch+this._delay1(n)+this._delay2(n)+u+1;if(_<7){for(var o=7;o<=this.monthsInYear(y);o++)l+=this.daysInMonth(y,o);for(o=1;o<_;o++)l+=this.daysInMonth(y,o)}else for(o=7;o<_;o++)l+=this.daysInMonth(y,o);return l},_delay1:function(y){var _=Math.floor((235*y-234)/19),u=12084+13753*_,r=29*_+Math.floor(u/25920);return w(3*(r+1),7)<3&&r++,r},_delay2:function(y){var _=this._delay1(y-1),u=this._delay1(y);return this._delay1(y+1)-u==356?2:u-_==382?1:0},fromJD:function(y){y=Math.floor(y)+.5;for(var _=Math.floor(98496*(y-this.jdEpoch)/35975351)-1;y>=this.toJD(_===-1?1:_+1,7,1);)_++;for(var u=ythis.toJD(_,u,this.daysInMonth(_,u));)u++;var r=y-this.toJD(_,u,1)+1;return this.newDate(_,u,r)}}),b.calendars.hebrew=e},25512:function(D,L,t){var b=t(24453),d=t(27976);function e(w){this.local=this.regionalOptions[w||""]||this.regionalOptions[""]}e.prototype=new b.baseCalendar,d(e.prototype,{name:"Islamic",jdEpoch:19484395e-1,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-khamīs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(w){return(11*this._validate(w,this.minMonth,this.minDay,b.local.invalidYear).year()+14)%30<11},weekOfYear:function(w,y,_){var u=this.newDate(w,y,_);return u.add(-u.dayOfWeek(),"d"),Math.floor((u.dayOfYear()-1)/7)+1},daysInYear:function(w){return this.leapYear(w)?355:354},daysInMonth:function(w,y){var _=this._validate(w,y,this.minDay,b.local.invalidMonth);return this.daysPerMonth[_.month()-1]+(_.month()===12&&this.leapYear(_.year())?1:0)},weekDay:function(w,y,_){return this.dayOfWeek(w,y,_)!==5},toJD:function(w,y,_){var u=this._validate(w,y,_,b.local.invalidDate);return w=u.year(),y=u.month(),w=w<=0?w+1:w,(_=u.day())+Math.ceil(29.5*(y-1))+354*(w-1)+Math.floor((3+11*w)/30)+this.jdEpoch-1},fromJD:function(w){w=Math.floor(w)+.5;var y=Math.floor((30*(w-this.jdEpoch)+10646)/10631);y=y<=0?y-1:y;var _=Math.min(12,Math.ceil((w-29-this.toJD(y,1,1))/29.5)+1),u=w-this.toJD(y,_,1)+1;return this.newDate(y,_,u)}}),b.calendars.islamic=e},42645:function(D,L,t){var b=t(24453),d=t(27976);function e(w){this.local=this.regionalOptions[w||""]||this.regionalOptions[""]}e.prototype=new b.baseCalendar,d(e.prototype,{name:"Julian",jdEpoch:17214235e-1,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(w){var y=this._validate(w,this.minMonth,this.minDay,b.local.invalidYear);return(w=y.year()<0?y.year()+1:y.year())%4==0},weekOfYear:function(w,y,_){var u=this.newDate(w,y,_);return u.add(4-(u.dayOfWeek()||7),"d"),Math.floor((u.dayOfYear()-1)/7)+1},daysInMonth:function(w,y){var _=this._validate(w,y,this.minDay,b.local.invalidMonth);return this.daysPerMonth[_.month()-1]+(_.month()===2&&this.leapYear(_.year())?1:0)},weekDay:function(w,y,_){return(this.dayOfWeek(w,y,_)||7)<6},toJD:function(w,y,_){var u=this._validate(w,y,_,b.local.invalidDate);return w=u.year(),y=u.month(),_=u.day(),w<0&&w++,y<=2&&(w--,y+=12),Math.floor(365.25*(w+4716))+Math.floor(30.6001*(y+1))+_-1524.5},fromJD:function(w){var y=Math.floor(w+.5)+1524,_=Math.floor((y-122.1)/365.25),u=Math.floor(365.25*_),r=Math.floor((y-u)/30.6001),n=r-Math.floor(r<14?1:13),l=_-Math.floor(n>2?4716:4715),o=y-u-Math.floor(30.6001*r);return l<=0&&l--,this.newDate(l,n,o)}}),b.calendars.julian=e},62324:function(D,L,t){var b=t(24453),d=t(27976);function e(_){this.local=this.regionalOptions[_||""]||this.regionalOptions[""]}function w(_,u){return _-u*Math.floor(_/u)}function y(_,u){return w(_-1,u)+1}e.prototype=new b.baseCalendar,d(e.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(_){return this._validate(_,this.minMonth,this.minDay,b.local.invalidYear),!1},formatYear:function(_){_=this._validate(_,this.minMonth,this.minDay,b.local.invalidYear).year();var u=Math.floor(_/400);return _%=400,_+=_<0?400:0,u+"."+Math.floor(_/20)+"."+_%20},forYear:function(_){if((_=_.split(".")).length<3)throw"Invalid Mayan year";for(var u=0,r=0;r<_.length;r++){var n=parseInt(_[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";u=20*u+n}return u},monthsInYear:function(_){return this._validate(_,this.minMonth,this.minDay,b.local.invalidYear),18},weekOfYear:function(_,u,r){return this._validate(_,u,r,b.local.invalidDate),0},daysInYear:function(_){return this._validate(_,this.minMonth,this.minDay,b.local.invalidYear),360},daysInMonth:function(_,u){return this._validate(_,u,this.minDay,b.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(_,u,r){return this._validate(_,u,r,b.local.invalidDate).day()},weekDay:function(_,u,r){return this._validate(_,u,r,b.local.invalidDate),!0},extraInfo:function(_,u,r){var n=this._validate(_,u,r,b.local.invalidDate).toJD(),l=this._toHaab(n),o=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[l[0]-1],haabMonth:l[0],haabDay:l[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(_){var u=w(8+(_-=this.jdEpoch)+340,365);return[Math.floor(u/20)+1,w(u,20)]},_toTzolkin:function(_){return[y(20+(_-=this.jdEpoch),20),y(_+4,13)]},toJD:function(_,u,r){var n=this._validate(_,u,r,b.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(_){_=Math.floor(_)+.5-this.jdEpoch;var u=Math.floor(_/360);_%=360,_+=_<0?360:0;var r=Math.floor(_/20),n=_%20;return this.newDate(u,r,n)}}),b.calendars.mayan=e},91662:function(D,L,t){var b=t(24453),d=t(27976);function e(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}e.prototype=new b.baseCalendar;var w=b.instance("gregorian");d(e.prototype,{name:"Nanakshahi",jdEpoch:22576735e-1,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(y){var _=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear||b.regionalOptions[""].invalidYear);return w.leapYear(_.year()+(_.year()<1?1:0)+1469)},weekOfYear:function(y,_,u){var r=this.newDate(y,_,u);return r.add(1-(r.dayOfWeek()||7),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(y,_){var u=this._validate(y,_,this.minDay,b.local.invalidMonth);return this.daysPerMonth[u.month()-1]+(u.month()===12&&this.leapYear(u.year())?1:0)},weekDay:function(y,_,u){return(this.dayOfWeek(y,_,u)||7)<6},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidMonth);(y=r.year())<0&&y++;for(var n=r.day(),l=1;l=this.toJD(_+1,1,1);)_++;for(var u=y-Math.floor(this.toJD(_,1,1)+.5)+1,r=1;u>this.daysInMonth(_,r);)u-=this.daysInMonth(_,r),r++;return this.newDate(_,r,u)}}),b.calendars.nanakshahi=e},66445:function(D,L,t){var b=t(24453),d=t(27976);function e(w){this.local=this.regionalOptions[w||""]||this.regionalOptions[""]}e.prototype=new b.baseCalendar,d(e.prototype,{name:"Nepali",jdEpoch:17007095e-1,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(w){return this.daysInYear(w)!==this.daysPerYear},weekOfYear:function(w,y,_){var u=this.newDate(w,y,_);return u.add(-u.dayOfWeek(),"d"),Math.floor((u.dayOfYear()-1)/7)+1},daysInYear:function(w){if(w=this._validate(w,this.minMonth,this.minDay,b.local.invalidYear).year(),this.NEPALI_CALENDAR_DATA[w]===void 0)return this.daysPerYear;for(var y=0,_=this.minMonth;_<=12;_++)y+=this.NEPALI_CALENDAR_DATA[w][_];return y},daysInMonth:function(w,y){return w.year&&(y=w.month(),w=w.year()),this._validate(w,y,this.minDay,b.local.invalidMonth),this.NEPALI_CALENDAR_DATA[w]===void 0?this.daysPerMonth[y-1]:this.NEPALI_CALENDAR_DATA[w][y]},weekDay:function(w,y,_){return this.dayOfWeek(w,y,_)!==6},toJD:function(w,y,_){var u=this._validate(w,y,_,b.local.invalidDate);w=u.year(),y=u.month(),_=u.day();var r=b.instance(),n=0,l=y,o=w;this._createMissingCalendarData(w);var s=w-(l>9||l===9&&_>=this.NEPALI_CALENDAR_DATA[o][0]?56:57);for(y!==9&&(n=_,l--);l!==9;)l<=0&&(l=12,o--),n+=this.NEPALI_CALENDAR_DATA[o][l],l--;return y===9?(n+=_-this.NEPALI_CALENDAR_DATA[o][0])<0&&(n+=r.daysInYear(s)):n+=this.NEPALI_CALENDAR_DATA[o][9]-this.NEPALI_CALENDAR_DATA[o][0],r.newDate(s,1,1).add(n,"d").toJD()},fromJD:function(w){var y=b.instance().fromJD(w),_=y.year(),u=y.dayOfYear(),r=_+56;this._createMissingCalendarData(r);for(var n=9,l=this.NEPALI_CALENDAR_DATA[r][0],o=this.NEPALI_CALENDAR_DATA[r][n]-l+1;u>o;)++n>12&&(n=1,r++),o+=this.NEPALI_CALENDAR_DATA[r][n];var s=this.NEPALI_CALENDAR_DATA[r][n]-(o-u);return this.newDate(r,n,s)},_createMissingCalendarData:function(w){var y=this.daysPerMonth.slice(0);y.unshift(17);for(var _=w-1;_0?474:473))%2820+474+38)%2816<682},weekOfYear:function(y,_,u){var r=this.newDate(y,_,u);return r.add(-(r.dayOfWeek()+1)%7,"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInMonth:function(y,_){var u=this._validate(y,_,this.minDay,b.local.invalidMonth);return this.daysPerMonth[u.month()-1]+(u.month()===12&&this.leapYear(u.year())?1:0)},weekDay:function(y,_,u){return this.dayOfWeek(y,_,u)!==5},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);y=r.year(),_=r.month(),u=r.day();var n=y-(y>=0?474:473),l=474+w(n,2820);return u+(_<=7?31*(_-1):30*(_-1)+6)+Math.floor((682*l-110)/2816)+365*(l-1)+1029983*Math.floor(n/2820)+this.jdEpoch-1},fromJD:function(y){var _=(y=Math.floor(y)+.5)-this.toJD(475,1,1),u=Math.floor(_/1029983),r=w(_,1029983),n=2820;if(r!==1029982){var l=Math.floor(r/366),o=w(r,366);n=Math.floor((2134*l+2816*o+2815)/1028522)+l+1}var s=n+2820*u+474;s=s<=0?s-1:s;var c=y-this.toJD(s,1,1)+1,h=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),x=y-this.toJD(s,h,1)+1;return this.newDate(s,h,x)}}),b.calendars.persian=e,b.calendars.jalali=e},84756:function(D,L,t){var b=t(24453),d=t(27976),e=b.instance();function w(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}w.prototype=new b.baseCalendar,d(w.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(y){var _=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear);return y=this._t2gYear(_.year()),e.leapYear(y)},weekOfYear:function(y,_,u){var r=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear);return y=this._t2gYear(r.year()),e.weekOfYear(y,r.month(),r.day())},daysInMonth:function(y,_){var u=this._validate(y,_,this.minDay,b.local.invalidMonth);return this.daysPerMonth[u.month()-1]+(u.month()===2&&this.leapYear(u.year())?1:0)},weekDay:function(y,_,u){return(this.dayOfWeek(y,_,u)||7)<6},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);return y=this._t2gYear(r.year()),e.toJD(y,r.month(),r.day())},fromJD:function(y){var _=e.fromJD(y),u=this._g2tYear(_.year());return this.newDate(u,_.month(),_.day())},_t2gYear:function(y){return y+this.yearsOffset+(y>=-this.yearsOffset&&y<=-1?1:0)},_g2tYear:function(y){return y-this.yearsOffset-(y>=1&&y<=this.yearsOffset?1:0)}}),b.calendars.taiwan=w},41858:function(D,L,t){var b=t(24453),d=t(27976),e=b.instance();function w(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}w.prototype=new b.baseCalendar,d(w.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(y){var _=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear);return y=this._t2gYear(_.year()),e.leapYear(y)},weekOfYear:function(y,_,u){var r=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear);return y=this._t2gYear(r.year()),e.weekOfYear(y,r.month(),r.day())},daysInMonth:function(y,_){var u=this._validate(y,_,this.minDay,b.local.invalidMonth);return this.daysPerMonth[u.month()-1]+(u.month()===2&&this.leapYear(u.year())?1:0)},weekDay:function(y,_,u){return(this.dayOfWeek(y,_,u)||7)<6},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate);return y=this._t2gYear(r.year()),e.toJD(y,r.month(),r.day())},fromJD:function(y){var _=e.fromJD(y),u=this._g2tYear(_.year());return this.newDate(u,_.month(),_.day())},_t2gYear:function(y){return y-this.yearsOffset-(y>=1&&y<=this.yearsOffset?1:0)},_g2tYear:function(y){return y+this.yearsOffset+(y>=-this.yearsOffset&&y<=-1?1:0)}}),b.calendars.thai=w},57985:function(D,L,t){var b=t(24453),d=t(27976);function e(y){this.local=this.regionalOptions[y||""]||this.regionalOptions[""]}e.prototype=new b.baseCalendar,d(e.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thalāthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(y){var _=this._validate(y,this.minMonth,this.minDay,b.local.invalidYear);return this.daysInYear(_.year())===355},weekOfYear:function(y,_,u){var r=this.newDate(y,_,u);return r.add(-r.dayOfWeek(),"d"),Math.floor((r.dayOfYear()-1)/7)+1},daysInYear:function(y){for(var _=0,u=1;u<=12;u++)_+=this.daysInMonth(y,u);return _},daysInMonth:function(y,_){for(var u=this._validate(y,_,this.minDay,b.local.invalidMonth).toJD()-24e5+.5,r=0,n=0;nu)return w[r]-w[r-1];r++}return 30},weekDay:function(y,_,u){return this.dayOfWeek(y,_,u)!==5},toJD:function(y,_,u){var r=this._validate(y,_,u,b.local.invalidDate),n=12*(r.year()-1)+r.month()-15292;return r.day()+w[n-1]-1+24e5-.5},fromJD:function(y){for(var _=y-24e5+.5,u=0,r=0;r_);r++)u++;var n=u+15292,l=Math.floor((n-1)/12),o=l+1,s=n-12*l,c=_-w[u-1]+1;return this.newDate(o,s,c)},isValid:function(y,_,u){var r=b.baseCalendar.prototype.isValid.apply(this,arguments);return r&&(r=(y=y.year!=null?y.year:y)>=1276&&y<=1500),r},_validate:function(y,_,u,r){var n=b.baseCalendar.prototype._validate.apply(this,arguments);if(n.year<1276||n.year>1500)throw r.replace(/\{0\}/,this.local.name);return n}}),b.calendars.ummalqura=e;var w=[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]},24453:function(D,L,t){var b=t(27976);function d(){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 e(r,n,l,o){if(this._calendar=r,this._year=n,this._month=l,this._day=o,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function w(r,n){return"000000".substring(0,n-(r=""+r).length)+r}function y(){this.shortYearCutoff="+10"}function _(r){this.local=this.regionalOptions[r]||this.regionalOptions[""]}b(d.prototype,{instance:function(r,n){r=(r||"gregorian").toLowerCase(),n=n||"";var l=this._localCals[r+"-"+n];if(!l&&this.calendars[r]&&(l=new this.calendars[r](n),this._localCals[r+"-"+n]=l),!l)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,r);return l},newDate:function(r,n,l,o,s){return(o=(r!=null&&r.year?r.calendar():typeof o=="string"?this.instance(o,s):o)||this.instance()).newDate(r,n,l)},substituteDigits:function(r){return function(n){return(n+"").replace(/[0-9]/g,function(l){return r[l]})}},substituteChineseDigits:function(r,n){return function(l){for(var o="",s=0;l>0;){var c=l%10;o=(c===0?"":r[c]+n[s])+o,s++,l=Math.floor(l/10)}return o.indexOf(r[1]+n[1])===0&&(o=o.substr(1)),o||r[0]}}}),b(e.prototype,{newDate:function(r,n,l){return this._calendar.newDate(r??this,n,l)},year:function(r){return arguments.length===0?this._year:this.set(r,"y")},month:function(r){return arguments.length===0?this._month:this.set(r,"m")},day:function(r){return arguments.length===0?this._day:this.set(r,"d")},date:function(r,n,l){if(!this._calendar.isValid(r,n,l))throw(u.local.invalidDate||u.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=r,this._month=n,this._day=l,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(r,n){return this._calendar.add(this,r,n)},set:function(r,n){return this._calendar.set(this,r,n)},compareTo:function(r){if(this._calendar.name!==r._calendar.name)throw(u.local.differentCalendars||u.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,r._calendar.local.name);var n=this._year!==r._year?this._year-r._year:this._month!==r._month?this.monthOfYear()-r.monthOfYear():this._day-r._day;return n===0?0:n<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(r){return this._calendar.fromJD(r)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(r){return this._calendar.fromJSDate(r)},toString:function(){return(this.year()<0?"-":"")+w(Math.abs(this.year()),4)+"-"+w(this.month(),2)+"-"+w(this.day(),2)}}),b(y.prototype,{_validateLevel:0,newDate:function(r,n,l){return r==null?this.today():(r.year&&(this._validate(r,n,l,u.local.invalidDate||u.regionalOptions[""].invalidDate),l=r.day(),n=r.month(),r=r.year()),new e(this,r,n,l))},today:function(){return this.fromJSDate(new Date)},epoch:function(r){return this._validate(r,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(r){var n=this._validate(r,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return(n.year()<0?"-":"")+w(Math.abs(n.year()),4)},monthsInYear:function(r){return this._validate(r,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear),12},monthOfYear:function(r,n){var l=this._validate(r,n,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth);return(l.month()+this.monthsInYear(l)-this.firstMonth)%this.monthsInYear(l)+this.minMonth},fromMonthOfYear:function(r,n){var l=(n+this.firstMonth-2*this.minMonth)%this.monthsInYear(r)+this.minMonth;return this._validate(r,l,this.minDay,u.local.invalidMonth||u.regionalOptions[""].invalidMonth),l},daysInYear:function(r){var n=this._validate(r,this.minMonth,this.minDay,u.local.invalidYear||u.regionalOptions[""].invalidYear);return this.leapYear(n)?366:365},dayOfYear:function(r,n,l){var o=this._validate(r,n,l,u.local.invalidDate||u.regionalOptions[""].invalidDate);return o.toJD()-this.newDate(o.year(),this.fromMonthOfYear(o.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(r,n,l){var o=this._validate(r,n,l,u.local.invalidDate||u.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(o))+2)%this.daysInWeek()},extraInfo:function(r,n,l){return this._validate(r,n,l,u.local.invalidDate||u.regionalOptions[""].invalidDate),{}},add:function(r,n,l){return this._validate(r,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate),this._correctAdd(r,this._add(r,n,l),n,l)},_add:function(r,n,l){if(this._validateLevel++,l==="d"||l==="w"){var o=r.toJD()+n*(l==="w"?this.daysInWeek():1),s=r.calendar().fromJD(o);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var c=r.year()+(l==="y"?n:0),h=r.monthOfYear()+(l==="m"?n:0);s=r.day(),l==="y"?(r.month()!==this.fromMonthOfYear(c,h)&&(h=this.newDate(c,r.month(),this.minDay).monthOfYear()),h=Math.min(h,this.monthsInYear(c)),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,h)))):l==="m"&&(function(m){for(;hg-1+m.minMonth;)c++,h-=g,g=m.monthsInYear(c)}(this),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,h))));var x=[c,this.fromMonthOfYear(c,h),s];return this._validateLevel--,x}catch(m){throw this._validateLevel--,m}},_correctAdd:function(r,n,l,o){if(!(this.hasYearZero||o!=="y"&&o!=="m"||n[0]!==0&&r.year()>0==n[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[o],c=l<0?-1:1;n=this._add(r,l*s[0]+c*s[1],s[2])}return r.date(n[0],n[1],n[2])},set:function(r,n,l){this._validate(r,this.minMonth,this.minDay,u.local.invalidDate||u.regionalOptions[""].invalidDate);var o=l==="y"?n:r.year(),s=l==="m"?n:r.month(),c=l==="d"?n:r.day();return l!=="y"&&l!=="m"||(c=Math.min(c,this.daysInMonth(o,s))),r.date(o,s,c)},isValid:function(r,n,l){this._validateLevel++;var o=this.hasYearZero||r!==0;if(o){var s=this.newDate(r,n,this.minDay);o=n>=this.minMonth&&n-this.minMonth=this.minDay&&l-this.minDay13.5?13:1),g=s-(m>2.5?4716:4715);return g<=0&&g--,this.newDate(g,m,x)},toJSDate:function(r,n,l){var o=this._validate(r,n,l,u.local.invalidDate||u.regionalOptions[""].invalidDate),s=new Date(o.year(),o.month()-1,o.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(r){return this.newDate(r.getFullYear(),r.getMonth()+1,r.getDate())}});var u=D.exports=new d;u.cdate=e,u.baseCalendar=y,u.calendars.gregorian=_},23428:function(D,L,t){var b=t(27976),d=t(24453);b(d.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"}),d.local=d.regionalOptions[""],b(d.cdate.prototype,{formatDate:function(e,w){return typeof e!="string"&&(w=e,e=""),this._calendar.formatDate(e||"",this,w)}}),b(d.baseCalendar.prototype,{UNIX_EPOCH:d.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:d.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,w,y){if(typeof e!="string"&&(y=w,w=e,e=""),!w)return"";if(w.calendar()!==this)throw d.local.invalidFormat||d.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var _,u,r,n=(y=y||{}).dayNamesShort||this.local.dayNamesShort,l=y.dayNames||this.local.dayNames,o=y.monthNumbers||this.local.monthNumbers,s=y.monthNamesShort||this.local.monthNamesShort,c=y.monthNames||this.local.monthNames,h=(y.calculateWeek||this.local.calculateWeek,function(M,f){for(var E=1;p+E1}),x=function(M,f,E,I){var B=""+f;if(h(M,I))for(;B.length1},S=function(j,$){var ee=v(j,$),H=[2,3,ee?4:2,ee?4:2,10,11,20]["oyYJ@!".indexOf(j)+1],J=new RegExp("^-?\\d{1,"+H+"}"),Q=w.substring(I).match(J);if(!Q)throw(d.local.missingNumberAt||d.regionalOptions[""].missingNumberAt).replace(/\{0\}/,I);return I+=Q[0].length,parseInt(Q[0],10)},T=this,p=function(){if(typeof l=="function"){v("m");var j=l.call(T,w.substring(I));return I+=j.length,j}return S("m")},M=function(j,$,ee,H){for(var J=v(j,H)?ee:$,Q=0;Q-1){x=1,m=g;for(var V=this.daysInMonth(h,x);m>V;V=this.daysInMonth(h,x))x++,m-=V}return c>-1?this.fromJD(c):this.newDate(h,x,m)},determineDate:function(e,w,y,_,u){y&&typeof y!="object"&&(u=_,_=y,y=null),typeof _!="string"&&(u=_,_="");var r=this;return w=w?w.newDate():null,e==null?w:typeof e=="string"?function(n){try{return r.parseDate(_,n,u)}catch{}for(var l=((n=n.toLowerCase()).match(/^c/)&&y?y.newDate():null)||r.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(n);s;)l.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(n);return l}(e):typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?w:r.today().add(e,"d"):r.newDate(e)}})},96144:function(D,L,t){t.r(L);var b=t(85072),d=t.n(b),e=t(97825),w=t.n(e),y=t(77659),_=t.n(y),u=t(55056),r=t.n(u),n=t(10540),l=t.n(n),o=t(41113),s=t.n(o),c=t(5955),h={};h.styleTagTransform=s(),h.setAttributes=r(),h.insert=_().bind(null,"head"),h.domAPI=w(),h.insertStyleElement=l(),d()(c.A,h),L.default=c.A&&c.A.locals?c.A.locals:void 0},85072:function(D){var L=[];function t(e){for(var w=-1,y=0;y"u")return{update:function(){},remove:function(){}};var t=L.insertStyleElement(L);return{update:function(b){(function(d,e,w){var y="";w.supports&&(y+="@supports (".concat(w.supports,") {")),w.media&&(y+="@media ".concat(w.media," {"));var _=w.layer!==void 0;_&&(y+="@layer".concat(w.layer.length>0?" ".concat(w.layer):""," {")),y+=w.css,_&&(y+="}"),w.media&&(y+="}"),w.supports&&(y+="}");var u=w.sourceMap;u&&typeof btoa<"u"&&(y+=` -/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(u))))," */")),e.styleTagTransform(y,d,e.options)})(t,L,b)},remove:function(){(function(b){if(b.parentNode===null)return!1;b.parentNode.removeChild(b)})(t)}}}},41113:function(D){D.exports=function(L,t){if(t.styleSheet)t.styleSheet.cssText=L;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(L))}}},25446:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2722%27 fill=%27%23333%27 viewBox=%270 0 22 22%27%3E%3Cpath d=%27m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0%27/%3E%3C/svg%3E"},56694:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2722%27 fill=%27%2333b5e5%27 viewBox=%270 0 22 22%27%3E%3Cpath d=%27m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0%27/%3E%3C/svg%3E"},26117:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 fill-rule=%27evenodd%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},66311:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 fill=%27%23fff%27 fill-rule=%27evenodd%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},24420:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},77035:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},43470:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},13490:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},80216:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},47695:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%2333b5e5%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3C/svg%3E"},92228:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%2333b5e5%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},43737:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23666%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},48460:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23999%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},75796:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23aaa%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},28869:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23e54e33%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3C/svg%3E"},9819:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23e58978%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},30557:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},68164:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},64665:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},91413:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z%27/%3E%3C/svg%3E"},13913:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},61907:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},56539:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},4890:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},13363:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},47603:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z%27/%3E%3C/svg%3E"},64643:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},68605:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},47914:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2788%27 height=%2723%27 fill=%27none%27%3E%3Cpath fill=%27%23000%27 fill-opacity=%27.4%27 fill-rule=%27evenodd%27 d=%27M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%27/%3E%3Cpath fill=%27%23fff%27 d=%27m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z%27/%3E%3Cpath fill=%27%23e1e3e9%27 d=%27M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z%27/%3E%3Cpath d=%27M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z%27 style=%27fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001%27/%3E%3Cg style=%27stroke-width:1.12603545%27%3E%3Cpath d=%27M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%27 style=%27color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3%27 style=%27clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%27 style=%27clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3C/g%3E%3C/svg%3E"},63779:function(){},77199:function(){},61990:function(D,L,t){Object.defineProperty(L,"__esModule",{value:!0});var b=t(85846),d=t(66030);function e(n){return d.geomReduce.call(void 0,n,(l,o)=>l+function(s){let c,h=0;switch(s.type){case"Polygon":return w(s.coordinates);case"MultiPolygon":for(c=0;c0){l+=Math.abs(u(n[0]));for(let o=1;o=l?(s+2)%l:s+2],m=c[0]*_,g=h[1]*_;o+=(x[0]*_-m)*Math.sin(g),s++}return o*y}var r=e;L.area=e,L.default=r},25368:function(D,L,t){Object.defineProperty(L,"__esModule",{value:!0});var b=t(66030);function d(w,y={}){if(w.bbox!=null&&y.recompute!==!0)return w.bbox;const _=[1/0,1/0,-1/0,-1/0];return b.coordEach.call(void 0,w,u=>{_[0]>u[0]&&(_[0]=u[0]),_[1]>u[1]&&(_[1]=u[1]),_[2]0?x>180?x-360:x:x<-180?x+360:x},L.bearingToAzimuth=function(x){let m=x%360;return m<0&&(m+=360),m},L.convertArea=function(x,m="meters",g="kilometers"){if(!(x>=0))throw new Error("area must be a positive number");const k=d[m];if(!k)throw new Error("invalid original units");const A=d[g];if(!A)throw new Error("invalid final units");return x/k*A},L.convertLength=function(x,m="kilometers",g="kilometers"){if(!(x>=0))throw new Error("length must be a positive number");return o(s(x,m),g)},L.degreesToRadians=function(x){return x%360*Math.PI/180},L.earthRadius=t,L.factors=b,L.feature=e,L.featureCollection=u,L.geometry=function(x,m,g={}){switch(x){case"Point":return w(m).geometry;case"LineString":return _(m).geometry;case"Polygon":return y(m).geometry;case"MultiPoint":return n(m).geometry;case"MultiLineString":return r(m).geometry;case"MultiPolygon":return l(m).geometry;default:throw new Error(x+" is invalid")}},L.geometryCollection=function(x,m,g={}){return e({type:"GeometryCollection",geometries:x},m,g)},L.isNumber=h,L.isObject=function(x){return x!==null&&typeof x=="object"&&!Array.isArray(x)},L.lengthToDegrees=function(x,m){return c(s(x,m))},L.lengthToRadians=s,L.lineString=_,L.lineStrings=function(x,m,g={}){return u(x.map(k=>_(k,m)),g)},L.multiLineString=r,L.multiPoint=n,L.multiPolygon=l,L.point=w,L.points=function(x,m,g={}){return u(x.map(k=>w(k,m)),g)},L.polygon=y,L.polygons=function(x,m,g={}){return u(x.map(k=>y(k,m)),g)},L.radiansToDegrees=c,L.radiansToLength=o,L.round=function(x,m=0){if(m&&!(m>=0))throw new Error("precision must be a positive number");const g=Math.pow(10,m||0);return Math.round(x*g)/g},L.validateBBox=function(x){if(!x)throw new Error("bbox is required");if(!Array.isArray(x))throw new Error("bbox must be an Array");if(x.length!==4&&x.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");x.forEach(m=>{if(!h(m))throw new Error("bbox must only contain numbers")})},L.validateId=function(x){if(!x)throw new Error("id is required");if(["string","number"].indexOf(typeof x)===-1)throw new Error("id must be a number or a string")}},66030:function(D,L,t){Object.defineProperty(L,"__esModule",{value:!0});var b=t(85846);function d(n,l,o){if(n!==null)for(var s,c,h,x,m,g,k,A,v=0,S=0,T=n.type,p=T==="FeatureCollection",M=T==="Feature",f=p?n.features.length:1,E=0;Eg||p>k||M>A)return m=v,g=s,k=p,A=M,void(h=0);var f=b.lineString.call(void 0,[m,v],o.properties);if(l(f,s,c,M,h)===!1)return!1;h++,m=v})!==!1&&void 0}}})}function r(n,l){if(!n)throw new Error("geojson is required");_(n,function(o,s,c){if(o.geometry!==null){var h=o.geometry.type,x=o.geometry.coordinates;switch(h){case"LineString":if(l(o,s,c,0,0)===!1)return!1;break;case"Polygon":for(var m=0;m"u"?t.g:globalThis;D.exports=function(){for(var e=[],w=0;w1)return 1;for(var ne=Y,pe=0;pe<8;pe++){var ze=this.sampleCurveX(ne)-Y;if(Math.abs(ze)ze?Je=ne:ht=ne,ne=.5*(ht-Je)+Je;return ne},solve:function(Y,U){return this.sampleCurveY(this.solveCurveX(Y,U))}};var l=w(r);let o,s;function c(){return o==null&&(o=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),o}function h(){if(s==null&&(s=!1,c())){const U=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(U){for(let pe=0;pe<25;pe++){const ze=4*pe;U.fillStyle=`rgb(${ze},${ze+1},${ze+2})`,U.fillRect(pe%5,Math.floor(pe/5),1,1)}const ne=U.getImageData(0,0,5,5).data;for(let pe=0;pe<100;pe++)if(pe%4!=3&&ne[pe]!==pe){s=!0;break}}}return s||!1}function x(Y,U,ne,pe){const ze=new l(Y,U,ne,pe);return Ze=>ze.solve(Ze)}const m=x(.25,.1,.25,1);function g(Y,U,ne){return Math.min(ne,Math.max(U,Y))}function k(Y,U,ne){const pe=ne-U,ze=((Y-U)%pe+pe)%pe+U;return ze===U?ne:ze}function A(Y,...U){for(const ne of U)for(const pe in ne)Y[pe]=ne[pe];return Y}let v=1;function S(Y,U,ne){const pe={};for(const ze in Y)pe[ze]=U.call(this,Y[ze],ze,Y);return pe}function T(Y,U,ne){const pe={};for(const ze in Y)U.call(this,Y[ze],ze,Y)&&(pe[ze]=Y[ze]);return pe}function p(Y){return Array.isArray(Y)?Y.map(p):typeof Y=="object"&&Y?S(Y,p):Y}const M={};function f(Y){M[Y]||(typeof console<"u"&&console.warn(Y),M[Y]=!0)}function E(Y,U,ne){return(ne.y-Y.y)*(U.x-Y.x)>(U.y-Y.y)*(ne.x-Y.x)}function I(Y){return typeof WorkerGlobalScope<"u"&&Y!==void 0&&Y instanceof WorkerGlobalScope}let B=null;function N(Y){return typeof ImageBitmap<"u"&&Y instanceof ImageBitmap}const V="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function j(Y,U,ne,pe,ze){return e(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Ze=new VideoFrame(Y,{timestamp:0});try{const Je=Ze==null?void 0:Ze.format;if(!Je||!Je.startsWith("BGR")&&!Je.startsWith("RGB"))throw new Error(`Unrecognized format ${Je}`);const ht=Je.startsWith("BGR"),mt=new Uint8ClampedArray(pe*ze*4);if(yield Ze.copyTo(mt,function(zt,jt,Xt,rn,hn){const Sn=4*Math.max(-jt,0),xn=(Math.max(0,Xt)-Xt)*rn*4+Sn,Nn=4*rn,Gn=Math.max(0,jt),wr=Math.max(0,Xt);return{rect:{x:Gn,y:wr,width:Math.min(zt.width,jt+rn)-Gn,height:Math.min(zt.height,Xt+hn)-wr},layout:[{offset:xn,stride:Nn}]}}(Y,U,ne,pe,ze)),ht)for(let zt=0;ztI(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,he=function(Y,U){if(/:\/\//.test(Y.url)&&!/^https?:|^file:/.test(Y.url)){const pe=Z(Y.url);if(pe)return pe(Y,U);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,targetMapId:K},U)}if(ne=Y.url,!(/^file:/.test(ne)||/^file:/.test(se())&&!/^\w+:/.test(ne))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(pe,ze){return e(this,void 0,void 0,function*(){const Ze=new Request(pe.url,{method:pe.method||"GET",body:pe.body,credentials:pe.credentials,headers:pe.headers,cache:pe.cache,referrer:se(),signal:ze.signal});pe.type!=="json"||Ze.headers.has("Accept")||Ze.headers.set("Accept","application/json");const Je=yield fetch(Ze);if(!Je.ok){const zt=yield Je.blob();throw new ae(Je.status,Je.statusText,pe.url,zt)}let ht;ht=pe.type==="arrayBuffer"||pe.type==="image"?Je.arrayBuffer():pe.type==="json"?Je.json():Je.text();const mt=yield ht;if(ze.signal.aborted)throw J();return{data:mt,cacheControl:Je.headers.get("Cache-Control"),expires:Je.headers.get("Expires")}})}(Y,U);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,mustQueue:!0,targetMapId:K},U)}var ne;return function(pe,ze){return new Promise((Ze,Je)=>{var ht;const mt=new XMLHttpRequest;mt.open(pe.method||"GET",pe.url,!0),pe.type!=="arrayBuffer"&&pe.type!=="image"||(mt.responseType="arraybuffer");for(const zt in pe.headers)mt.setRequestHeader(zt,pe.headers[zt]);pe.type==="json"&&(mt.responseType="text",!((ht=pe.headers)===null||ht===void 0)&&ht.Accept||mt.setRequestHeader("Accept","application/json")),mt.withCredentials=pe.credentials==="include",mt.onerror=()=>{Je(new Error(mt.statusText))},mt.onload=()=>{if(!ze.signal.aborted)if((mt.status>=200&&mt.status<300||mt.status===0)&&mt.response!==null){let zt=mt.response;if(pe.type==="json")try{zt=JSON.parse(mt.response)}catch(jt){return void Je(jt)}Ze({data:zt,cacheControl:mt.getResponseHeader("Cache-Control"),expires:mt.getResponseHeader("Expires")})}else{const zt=new Blob([mt.response],{type:mt.getResponseHeader("Content-Type")});Je(new ae(mt.status,mt.statusText,pe.url,zt))}},ze.signal.addEventListener("abort",()=>{mt.abort(),Je(J())}),mt.send(pe.body)})}(Y,U)};function fe(Y){if(!Y||Y.indexOf("://")<=0||Y.indexOf("data:image/")===0||Y.indexOf("blob:")===0)return!0;const U=new URL(Y),ne=window.location;return U.protocol===ne.protocol&&U.host===ne.host}function ie(Y,U,ne){ne[Y]&&ne[Y].indexOf(U)!==-1||(ne[Y]=ne[Y]||[],ne[Y].push(U))}function oe(Y,U,ne){if(ne&&ne[Y]){const pe=ne[Y].indexOf(U);pe!==-1&&ne[Y].splice(pe,1)}}class le{constructor(U,ne={}){A(this,ne),this.type=U}}class ge extends le{constructor(U,ne={}){super("error",A({error:U},ne))}}class ye{on(U,ne){return this._listeners=this._listeners||{},ie(U,ne,this._listeners),this}off(U,ne){return oe(U,ne,this._listeners),oe(U,ne,this._oneTimeListeners),this}once(U,ne){return ne?(this._oneTimeListeners=this._oneTimeListeners||{},ie(U,ne,this._oneTimeListeners),this):new Promise(pe=>this.once(U,pe))}fire(U,ne){typeof U=="string"&&(U=new le(U,ne||{}));const pe=U.type;if(this.listens(pe)){U.target=this;const ze=this._listeners&&this._listeners[pe]?this._listeners[pe].slice():[];for(const ht of ze)ht.call(this,U);const Ze=this._oneTimeListeners&&this._oneTimeListeners[pe]?this._oneTimeListeners[pe].slice():[];for(const ht of Ze)oe(pe,ht,this._oneTimeListeners),ht.call(this,U);const Je=this._eventedParent;Je&&(A(U,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Je.fire(U))}else U instanceof ge&&console.error(U.error);return this}listens(U){return this._listeners&&this._listeners[U]&&this._listeners[U].length>0||this._oneTimeListeners&&this._oneTimeListeners[U]&&this._oneTimeListeners[U].length>0||this._eventedParent&&this._eventedParent.listens(U)}setEventedParent(U,ne){return this._eventedParent=U,this._eventedParentData=ne,this}}var me={$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 be=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Se(Y,U){const ne={};for(const pe in Y)pe!=="ref"&&(ne[pe]=Y[pe]);return be.forEach(pe=>{pe in U&&(ne[pe]=U[pe])}),ne}function Ee(Y,U){if(Array.isArray(Y)){if(!Array.isArray(U)||Y.length!==U.length)return!1;for(let ne=0;ne`:Y.itemType.kind==="value"?"array":`array<${U}>`}return Y.kind}const Gt=[qe,$e,Ye,_e,De,nt,Be,Nt(Ge),pt,At,wt];function st(Y,U){if(U.kind==="error")return null;if(Y.kind==="array"){if(U.kind==="array"&&(U.N===0&&U.itemType.kind==="value"||!st(Y.itemType,U.itemType))&&(typeof Y.N!="number"||Y.N===U.N))return null}else{if(Y.kind===U.kind)return null;if(Y.kind==="value"){for(const ne of Gt)if(!st(ne,U))return null}}return`Expected ${Ht(Y)} but found ${Ht(U)} instead.`}function Qe(Y,U){return U.some(ne=>ne.kind===Y.kind)}function ft(Y,U){return U.some(ne=>ne==="null"?Y===null:ne==="array"?Array.isArray(Y):ne==="object"?Y&&!Array.isArray(Y)&&typeof Y=="object":ne===typeof Y)}function yt(Y,U){return Y.kind==="array"&&U.kind==="array"?Y.itemType.kind===U.itemType.kind&&typeof Y.N=="number":Y.kind===U.kind}const Ot=.96422,Pt=1,at=.82521,lt=4/29,Xe=6/29,ut=3*Xe*Xe,Tt=Xe*Xe*Xe,vt=Math.PI/180,Lt=180/Math.PI;function Ut(Y){return(Y%=360)<0&&(Y+=360),Y}function rt([Y,U,ne,pe]){let ze,Ze;const Je=Et((.2225045*(Y=et(Y))+.7168786*(U=et(U))+.0606169*(ne=et(ne)))/Pt);Y===U&&U===ne?ze=Ze=Je:(ze=Et((.4360747*Y+.3850649*U+.1430804*ne)/Ot),Ze=Et((.0139322*Y+.0971045*U+.7141733*ne)/at));const ht=116*Je-16;return[ht<0?0:ht,500*(ze-Je),200*(Je-Ze),pe]}function et(Y){return Y<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function Et(Y){return Y>Tt?Math.pow(Y,.3333333333333333):Y/ut+lt}function Bt([Y,U,ne,pe]){let ze=(Y+16)/116,Ze=isNaN(U)?ze:ze+U/500,Je=isNaN(ne)?ze:ze-ne/200;return ze=Pt*St(ze),Ze=Ot*St(Ze),Je=at*St(Je),[Ft(3.1338561*Ze-1.6168667*ze-.4906146*Je),Ft(-.9787684*Ze+1.9161415*ze+.033454*Je),Ft(.0719453*Ze-.2289914*ze+1.4052427*Je),pe]}function Ft(Y){return(Y=Y<=.00304?12.92*Y:1.055*Math.pow(Y,.4166666666666667)-.055)<0?0:Y>1?1:Y}function St(Y){return Y>Xe?Y*Y*Y:ut*(Y-lt)}function Jt(Y){if((Y=Y.toLowerCase().trim())==="transparent")return[0,0,0,0];const U=on[Y];if(U){const[pe,ze,Ze]=U;return[pe/255,ze/255,Ze/255,1]}if(Y.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(Y)){const pe=Y.length<6?1:2;let ze=1;return[qt(Y.slice(ze,ze+=pe)),qt(Y.slice(ze,ze+=pe)),qt(Y.slice(ze,ze+=pe)),qt(Y.slice(ze,ze+pe)||"ff")]}if(Y.startsWith("rgb")){const pe=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,ze=Y.match(pe);if(ze){const[Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn]=ze,Gn=[mt||" ",Xt||" ",Sn].join("");if(Gn===" "||Gn===" /"||Gn===",,"||Gn===",,,"){const wr=[ht,jt,hn].join(""),or=wr==="%%%"?100:wr===""?255:0;if(or){const gr=[Wt(+Je/or,0,1),Wt(+zt/or,0,1),Wt(+rn/or,0,1),xn?en(+xn,Nn):1];if(Zt(gr))return gr}}return}}const ne=Y.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(ne){const[pe,ze,Ze,Je,ht,mt,zt,jt,Xt]=ne,rn=[Ze||" ",ht||" ",zt].join("");if(rn===" "||rn===" /"||rn===",,"||rn===",,,"){const hn=[+ze,Wt(+Je,0,100),Wt(+mt,0,100),jt?en(+jt,Xt):1];if(Zt(hn))return function([Sn,xn,Nn,Gn]){function wr(or){const gr=(or+Sn/30)%12,Wr=xn*Math.min(Nn,1-Nn);return Nn-Wr*Math.max(-1,Math.min(gr-3,9-gr,1))}return Sn=Ut(Sn),xn/=100,Nn/=100,[wr(0),wr(8),wr(4),Gn]}(hn)}}}function qt(Y){return parseInt(Y.padEnd(2,Y),16)/255}function en(Y,U){return Wt(U?Y/100:Y,0,1)}function Wt(Y,U,ne){return Math.min(Math.max(U,Y),ne)}function Zt(Y){return!Y.some(Number.isNaN)}const on={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 un{constructor(U,ne,pe,ze=1,Ze=!0){this.r=U,this.g=ne,this.b=pe,this.a=ze,Ze||(this.r*=ze,this.g*=ze,this.b*=ze,ze||this.overwriteGetter("rgb",[U,ne,pe,ze]))}static parse(U){if(U instanceof un)return U;if(typeof U!="string")return;const ne=Jt(U);return ne?new un(...ne,!1):void 0}get rgb(){const{r:U,g:ne,b:pe,a:ze}=this,Ze=ze||1/0;return this.overwriteGetter("rgb",[U/Ze,ne/Ze,pe/Ze,ze])}get hcl(){return this.overwriteGetter("hcl",function(U){const[ne,pe,ze,Ze]=rt(U),Je=Math.sqrt(pe*pe+ze*ze);return[Math.round(1e4*Je)?Ut(Math.atan2(ze,pe)*Lt):NaN,Je,ne,Ze]}(this.rgb))}get lab(){return this.overwriteGetter("lab",rt(this.rgb))}overwriteGetter(U,ne){return Object.defineProperty(this,U,{value:ne}),ne}toString(){const[U,ne,pe,ze]=this.rgb;return`rgba(${[U,ne,pe].map(Ze=>Math.round(255*Ze)).join(",")},${ze})`}}un.black=new un(0,0,0,1),un.white=new un(1,1,1,1),un.transparent=new un(0,0,0,0),un.red=new un(1,0,0,1);class Pn{constructor(U,ne,pe){this.sensitivity=U?ne?"variant":"case":ne?"accent":"base",this.locale=pe,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(U,ne){return this.collator.compare(U,ne)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Dn{constructor(U,ne,pe,ze,Ze){this.text=U,this.image=ne,this.scale=pe,this.fontStack=ze,this.textColor=Ze}}class In{constructor(U){this.sections=U}static fromString(U){return new In([new Dn(U,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(U=>U.text.length!==0||U.image&&U.image.name.length!==0)}static factory(U){return U instanceof In?U:In.fromString(U)}toString(){return this.sections.length===0?"":this.sections.map(U=>U.text).join("")}}class mn{constructor(U){this.values=U.slice()}static parse(U){if(U instanceof mn)return U;if(typeof U=="number")return new mn([U,U,U,U]);if(Array.isArray(U)&&!(U.length<1||U.length>4)){for(const ne of U)if(typeof ne!="number")return;switch(U.length){case 1:U=[U[0],U[0],U[0],U[0]];break;case 2:U=[U[0],U[1],U[0],U[1]];break;case 3:U=[U[0],U[1],U[2],U[1]]}return new mn(U)}}toString(){return JSON.stringify(this.values)}}const En=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Kn{constructor(U){this.values=U.slice()}static parse(U){if(U instanceof Kn)return U;if(Array.isArray(U)&&!(U.length<1)&&U.length%2==0){for(let ne=0;ne=0&&Y<=255&&typeof U=="number"&&U>=0&&U<=255&&typeof ne=="number"&&ne>=0&&ne<=255?pe===void 0||typeof pe=="number"&&pe>=0&&pe<=1?null:`Invalid rgba value [${[Y,U,ne,pe].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof pe=="number"?[Y,U,ne,pe]:[Y,U,ne]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Fn(Y){if(Y===null||typeof Y=="string"||typeof Y=="boolean"||typeof Y=="number"||Y instanceof un||Y instanceof Pn||Y instanceof In||Y instanceof mn||Y instanceof Kn||Y instanceof Ln)return!0;if(Array.isArray(Y)){for(const U of Y)if(!Fn(U))return!1;return!0}if(typeof Y=="object"){for(const U in Y)if(!Fn(Y[U]))return!1;return!0}return!1}function wn(Y){if(Y===null)return qe;if(typeof Y=="string")return Ye;if(typeof Y=="boolean")return _e;if(typeof Y=="number")return $e;if(Y instanceof un)return De;if(Y instanceof Pn)return tt;if(Y instanceof In)return nt;if(Y instanceof mn)return pt;if(Y instanceof Kn)return wt;if(Y instanceof Ln)return At;if(Array.isArray(Y)){const U=Y.length;let ne;for(const pe of Y){const ze=wn(pe);if(ne){if(ne===ze)continue;ne=Ge;break}ne=ze}return Nt(ne||Ge,U)}return Be}function zn(Y){const U=typeof Y;return Y===null?"":U==="string"||U==="number"||U==="boolean"?String(Y):Y instanceof un||Y instanceof In||Y instanceof mn||Y instanceof Kn||Y instanceof Ln?Y.toString():JSON.stringify(Y)}class Jn{constructor(U,ne){this.type=U,this.value=ne}static parse(U,ne){if(U.length!==2)return ne.error(`'literal' expression requires exactly one argument, but found ${U.length-1} instead.`);if(!Fn(U[1]))return ne.error("invalid value");const pe=U[1];let ze=wn(pe);const Ze=ne.expectedType;return ze.kind!=="array"||ze.N!==0||!Ze||Ze.kind!=="array"||typeof Ze.N=="number"&&Ze.N!==0||(ze=Ze),new Jn(ze,pe)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class $n{constructor(U){this.name="ExpressionEvaluationError",this.message=U}toJSON(){return this.message}}const vr={string:Ye,number:$e,boolean:_e,object:Be};class Qn{constructor(U,ne){this.type=U,this.args=ne}static parse(U,ne){if(U.length<2)return ne.error("Expected at least one argument.");let pe,ze=1;const Ze=U[0];if(Ze==="array"){let ht,mt;if(U.length>2){const zt=U[1];if(typeof zt!="string"||!(zt in vr)||zt==="object")return ne.error('The item type argument of "array" must be one of string, number, boolean',1);ht=vr[zt],ze++}else ht=Ge;if(U.length>3){if(U[2]!==null&&(typeof U[2]!="number"||U[2]<0||U[2]!==Math.floor(U[2])))return ne.error('The length argument to "array" must be a positive integer literal',2);mt=U[2],ze++}pe=Nt(ht,mt)}else{if(!vr[Ze])throw new Error(`Types doesn't contain name = ${Ze}`);pe=vr[Ze]}const Je=[];for(;zeU.outputDefined())}}const lr={"to-boolean":_e,"to-color":De,"to-number":$e,"to-string":Ye};class hr{constructor(U,ne){this.type=U,this.args=ne}static parse(U,ne){if(U.length<2)return ne.error("Expected at least one argument.");const pe=U[0];if(!lr[pe])throw new Error(`Can't parse ${pe} as it is not part of the known types`);if((pe==="to-boolean"||pe==="to-string")&&U.length!==2)return ne.error("Expected one argument.");const ze=lr[pe],Ze=[];for(let Je=1;Je4?`Invalid rbga value ${JSON.stringify(ne)}: expected an array containing either three or four numeric values.`:Tn(ne[0],ne[1],ne[2],ne[3]),!pe))return new un(ne[0]/255,ne[1]/255,ne[2]/255,ne[3])}throw new $n(pe||`Could not parse color from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"padding":{let ne;for(const pe of this.args){ne=pe.evaluate(U);const ze=mn.parse(ne);if(ze)return ze}throw new $n(`Could not parse padding from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"variableAnchorOffsetCollection":{let ne;for(const pe of this.args){ne=pe.evaluate(U);const ze=Kn.parse(ne);if(ze)return ze}throw new $n(`Could not parse variableAnchorOffsetCollection from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"number":{let ne=null;for(const pe of this.args){if(ne=pe.evaluate(U),ne===null)return 0;const ze=Number(ne);if(!isNaN(ze))return ze}throw new $n(`Could not convert ${JSON.stringify(ne)} to number.`)}case"formatted":return In.fromString(zn(this.args[0].evaluate(U)));case"resolvedImage":return Ln.fromString(zn(this.args[0].evaluate(U)));default:return zn(this.args[0].evaluate(U))}}eachChild(U){this.args.forEach(U)}outputDefined(){return this.args.every(U=>U.outputDefined())}}const jr=["Unknown","Point","LineString","Polygon"];class ni{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?jr[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(U){let ne=this._parseColorCache[U];return ne||(ne=this._parseColorCache[U]=un.parse(U)),ne}}class Or{constructor(U,ne,pe=[],ze,Ze=new Fe,Je=[]){this.registry=U,this.path=pe,this.key=pe.map(ht=>`[${ht}]`).join(""),this.scope=Ze,this.errors=Je,this.expectedType=ze,this._isConstant=ne}parse(U,ne,pe,ze,Ze={}){return ne?this.concat(ne,pe,ze)._parse(U,Ze):this._parse(U,Ze)}_parse(U,ne){function pe(ze,Ze,Je){return Je==="assert"?new Qn(Ze,[ze]):Je==="coerce"?new hr(Ze,[ze]):ze}if(U!==null&&typeof U!="string"&&typeof U!="boolean"&&typeof U!="number"||(U=["literal",U]),Array.isArray(U)){if(U.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const ze=U[0];if(typeof ze!="string")return this.error(`Expression name must be a string, but found ${typeof ze} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Ze=this.registry[ze];if(Ze){let Je=Ze.parse(U,this);if(!Je)return null;if(this.expectedType){const ht=this.expectedType,mt=Je.type;if(ht.kind!=="string"&&ht.kind!=="number"&&ht.kind!=="boolean"&&ht.kind!=="object"&&ht.kind!=="array"||mt.kind!=="value")if(ht.kind!=="color"&&ht.kind!=="formatted"&&ht.kind!=="resolvedImage"||mt.kind!=="value"&&mt.kind!=="string")if(ht.kind!=="padding"||mt.kind!=="value"&&mt.kind!=="number"&&mt.kind!=="array")if(ht.kind!=="variableAnchorOffsetCollection"||mt.kind!=="value"&&mt.kind!=="array"){if(this.checkSubtype(ht,mt))return null}else Je=pe(Je,ht,ne.typeAnnotation||"coerce");else Je=pe(Je,ht,ne.typeAnnotation||"coerce");else Je=pe(Je,ht,ne.typeAnnotation||"coerce");else Je=pe(Je,ht,ne.typeAnnotation||"assert")}if(!(Je instanceof Jn)&&Je.type.kind!=="resolvedImage"&&this._isConstant(Je)){const ht=new ni;try{Je=new Jn(Je.type,Je.evaluate(ht))}catch(mt){return this.error(mt.message),null}}return Je}return this.error(`Unknown expression "${ze}". If you wanted a literal array, use ["literal", [...]].`,0)}return U===void 0?this.error("'undefined' value invalid. Use null instead."):typeof U=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof U} instead.`)}concat(U,ne,pe){const ze=typeof U=="number"?this.path.concat(U):this.path,Ze=pe?this.scope.concat(pe):this.scope;return new Or(this.registry,this._isConstant,ze,ne||null,Ze,this.errors)}error(U,...ne){const pe=`${this.key}${ne.map(ze=>`[${ze}]`).join("")}`;this.errors.push(new He(pe,U))}checkSubtype(U,ne){const pe=st(U,ne);return pe&&this.error(pe),pe}}class Ar{constructor(U,ne){this.type=ne.type,this.bindings=[].concat(U),this.result=ne}evaluate(U){return this.result.evaluate(U)}eachChild(U){for(const ne of this.bindings)U(ne[1]);U(this.result)}static parse(U,ne){if(U.length<4)return ne.error(`Expected at least 3 arguments, but found ${U.length-1} instead.`);const pe=[];for(let Ze=1;Ze=pe.length)throw new $n(`Array index out of bounds: ${ne} > ${pe.length-1}.`);if(ne!==Math.floor(ne))throw new $n(`Array index must be an integer, but found ${ne} instead.`);return pe[ne]}eachChild(U){U(this.index),U(this.input)}outputDefined(){return!1}}class kn{constructor(U,ne){this.type=_e,this.needle=U,this.haystack=ne}static parse(U,ne){if(U.length!==3)return ne.error(`Expected 2 arguments, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1,Ge),ze=ne.parse(U[2],2,Ge);return pe&&ze?Qe(pe.type,[_e,Ye,$e,qe,Ge])?new kn(pe,ze):ne.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(pe.type)} instead`):null}evaluate(U){const ne=this.needle.evaluate(U),pe=this.haystack.evaluate(U);if(!pe)return!1;if(!ft(ne,["boolean","string","number","null"]))throw new $n(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(wn(ne))} instead.`);if(!ft(pe,["string","array"]))throw new $n(`Expected second argument to be of type array or string, but found ${Ht(wn(pe))} instead.`);return pe.indexOf(ne)>=0}eachChild(U){U(this.needle),U(this.haystack)}outputDefined(){return!0}}class Cn{constructor(U,ne,pe){this.type=$e,this.needle=U,this.haystack=ne,this.fromIndex=pe}static parse(U,ne){if(U.length<=2||U.length>=5)return ne.error(`Expected 3 or 4 arguments, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1,Ge),ze=ne.parse(U[2],2,Ge);if(!pe||!ze)return null;if(!Qe(pe.type,[_e,Ye,$e,qe,Ge]))return ne.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(pe.type)} instead`);if(U.length===4){const Ze=ne.parse(U[3],3,$e);return Ze?new Cn(pe,ze,Ze):null}return new Cn(pe,ze)}evaluate(U){const ne=this.needle.evaluate(U),pe=this.haystack.evaluate(U);if(!ft(ne,["boolean","string","number","null"]))throw new $n(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(wn(ne))} instead.`);if(!ft(pe,["string","array"]))throw new $n(`Expected second argument to be of type array or string, but found ${Ht(wn(pe))} instead.`);if(this.fromIndex){const ze=this.fromIndex.evaluate(U);return pe.indexOf(ne,ze)}return pe.indexOf(ne)}eachChild(U){U(this.needle),U(this.haystack),this.fromIndex&&U(this.fromIndex)}outputDefined(){return!1}}class ur{constructor(U,ne,pe,ze,Ze,Je){this.inputType=U,this.type=ne,this.input=pe,this.cases=ze,this.outputs=Ze,this.otherwise=Je}static parse(U,ne){if(U.length<5)return ne.error(`Expected at least 4 arguments, but found only ${U.length-1}.`);if(U.length%2!=1)return ne.error("Expected an even number of arguments.");let pe,ze;ne.expectedType&&ne.expectedType.kind!=="value"&&(ze=ne.expectedType);const Ze={},Je=[];for(let zt=2;ztNumber.MAX_SAFE_INTEGER)return rn.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Sn=="number"&&Math.floor(Sn)!==Sn)return rn.error("Numeric branch labels must be integer values.");if(pe){if(rn.checkSubtype(pe,wn(Sn)))return null}else pe=wn(Sn);if(Ze[String(Sn)]!==void 0)return rn.error("Branch labels must be unique.");Ze[String(Sn)]=Je.length}const hn=ne.parse(Xt,zt,ze);if(!hn)return null;ze=ze||hn.type,Je.push(hn)}const ht=ne.parse(U[1],1,Ge);if(!ht)return null;const mt=ne.parse(U[U.length-1],U.length-1,ze);return mt?ht.type.kind!=="value"&&ne.concat(1).checkSubtype(pe,ht.type)?null:new ur(pe,ze,ht,Ze,Je,mt):null}evaluate(U){const ne=this.input.evaluate(U);return(wn(ne)===this.inputType&&this.outputs[this.cases[ne]]||this.otherwise).evaluate(U)}eachChild(U){U(this.input),this.outputs.forEach(U),U(this.otherwise)}outputDefined(){return this.outputs.every(U=>U.outputDefined())&&this.otherwise.outputDefined()}}class Zn{constructor(U,ne,pe){this.type=U,this.branches=ne,this.otherwise=pe}static parse(U,ne){if(U.length<4)return ne.error(`Expected at least 3 arguments, but found only ${U.length-1}.`);if(U.length%2!=0)return ne.error("Expected an odd number of arguments.");let pe;ne.expectedType&&ne.expectedType.kind!=="value"&&(pe=ne.expectedType);const ze=[];for(let Je=1;Jene.outputDefined())&&this.otherwise.outputDefined()}}class cr{constructor(U,ne,pe,ze){this.type=U,this.input=ne,this.beginIndex=pe,this.endIndex=ze}static parse(U,ne){if(U.length<=2||U.length>=5)return ne.error(`Expected 3 or 4 arguments, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1,Ge),ze=ne.parse(U[2],2,$e);if(!pe||!ze)return null;if(!Qe(pe.type,[Nt(Ge),Ye,Ge]))return ne.error(`Expected first argument to be of type array or string, but found ${Ht(pe.type)} instead`);if(U.length===4){const Ze=ne.parse(U[3],3,$e);return Ze?new cr(pe.type,pe,ze,Ze):null}return new cr(pe.type,pe,ze)}evaluate(U){const ne=this.input.evaluate(U),pe=this.beginIndex.evaluate(U);if(!ft(ne,["string","array"]))throw new $n(`Expected first argument to be of type array or string, but found ${Ht(wn(ne))} instead.`);if(this.endIndex){const ze=this.endIndex.evaluate(U);return ne.slice(pe,ze)}return ne.slice(pe)}eachChild(U){U(this.input),U(this.beginIndex),this.endIndex&&U(this.endIndex)}outputDefined(){return!1}}function Ir(Y,U){const ne=Y.length-1;let pe,ze,Ze=0,Je=ne,ht=0;for(;Ze<=Je;)if(ht=Math.floor((Ze+Je)/2),pe=Y[ht],ze=Y[ht+1],pe<=U){if(ht===ne||UU))throw new $n("Input is not a number.");Je=ht-1}return 0}class Er{constructor(U,ne,pe){this.type=U,this.input=ne,this.labels=[],this.outputs=[];for(const[ze,Ze]of pe)this.labels.push(ze),this.outputs.push(Ze)}static parse(U,ne){if(U.length-1<4)return ne.error(`Expected at least 4 arguments, but found only ${U.length-1}.`);if((U.length-1)%2!=0)return ne.error("Expected an even number of arguments.");const pe=ne.parse(U[1],1,$e);if(!pe)return null;const ze=[];let Ze=null;ne.expectedType&&ne.expectedType.kind!=="value"&&(Ze=ne.expectedType);for(let Je=1;Je=ht)return ne.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',zt);const Xt=ne.parse(mt,jt,Ze);if(!Xt)return null;Ze=Ze||Xt.type,ze.push([ht,Xt])}return new Er(Ze,pe,ze)}evaluate(U){const ne=this.labels,pe=this.outputs;if(ne.length===1)return pe[0].evaluate(U);const ze=this.input.evaluate(U);if(ze<=ne[0])return pe[0].evaluate(U);const Ze=ne.length;return ze>=ne[Ze-1]?pe[Ze-1].evaluate(U):pe[Ir(ne,ze)].evaluate(U)}eachChild(U){U(this.input);for(const ne of this.outputs)U(ne)}outputDefined(){return this.outputs.every(U=>U.outputDefined())}}function Xr(Y){return Y&&Y.__esModule&&Object.prototype.hasOwnProperty.call(Y,"default")?Y.default:Y}var ai=bn;function bn(Y,U,ne,pe){this.cx=3*Y,this.bx=3*(ne-Y)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*U,this.by=3*(pe-U)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Y,this.p1y=U,this.p2x=ne,this.p2y=pe}bn.prototype={sampleCurveX:function(Y){return((this.ax*Y+this.bx)*Y+this.cx)*Y},sampleCurveY:function(Y){return((this.ay*Y+this.by)*Y+this.cy)*Y},sampleCurveDerivativeX:function(Y){return(3*this.ax*Y+2*this.bx)*Y+this.cx},solveCurveX:function(Y,U){if(U===void 0&&(U=1e-6),Y<0)return 0;if(Y>1)return 1;for(var ne=Y,pe=0;pe<8;pe++){var ze=this.sampleCurveX(ne)-Y;if(Math.abs(ze)ze?Je=ne:ht=ne,ne=.5*(ht-Je)+Je;return ne},solve:function(Y,U){return this.sampleCurveY(this.solveCurveX(Y,U))}};var Yn=Xr(ai);function an(Y,U,ne){return Y+ne*(U-Y)}function _n(Y,U,ne){return Y.map((pe,ze)=>an(pe,U[ze],ne))}const gn={number:an,color:function(Y,U,ne,pe="rgb"){switch(pe){case"rgb":{const[ze,Ze,Je,ht]=_n(Y.rgb,U.rgb,ne);return new un(ze,Ze,Je,ht,!1)}case"hcl":{const[ze,Ze,Je,ht]=Y.hcl,[mt,zt,jt,Xt]=U.hcl;let rn,hn;if(isNaN(ze)||isNaN(mt))isNaN(ze)?isNaN(mt)?rn=NaN:(rn=mt,Je!==1&&Je!==0||(hn=zt)):(rn=ze,jt!==1&&jt!==0||(hn=Ze));else{let wr=mt-ze;mt>ze&&wr>180?wr-=360:mt180&&(wr+=360),rn=ze+ne*wr}const[Sn,xn,Nn,Gn]=function([wr,or,gr,Wr]){return wr=isNaN(wr)?0:wr*vt,Bt([gr,Math.cos(wr)*or,Math.sin(wr)*or,Wr])}([rn,hn??an(Ze,zt,ne),an(Je,jt,ne),an(ht,Xt,ne)]);return new un(Sn,xn,Nn,Gn,!1)}case"lab":{const[ze,Ze,Je,ht]=Bt(_n(Y.lab,U.lab,ne));return new un(ze,Ze,Je,ht,!1)}}},array:_n,padding:function(Y,U,ne){return new mn(_n(Y.values,U.values,ne))},variableAnchorOffsetCollection:function(Y,U,ne){const pe=Y.values,ze=U.values;if(pe.length!==ze.length)throw new $n(`Cannot interpolate values of different length. from: ${Y.toString()}, to: ${U.toString()}`);const Ze=[];for(let Je=0;Jetypeof jt!="number"||jt<0||jt>1))return ne.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);ze={name:"cubic-bezier",controlPoints:zt}}}if(U.length-1<4)return ne.error(`Expected at least 4 arguments, but found only ${U.length-1}.`);if((U.length-1)%2!=0)return ne.error("Expected an even number of arguments.");if(Ze=ne.parse(Ze,2,$e),!Ze)return null;const ht=[];let mt=null;pe==="interpolate-hcl"||pe==="interpolate-lab"?mt=De:ne.expectedType&&ne.expectedType.kind!=="value"&&(mt=ne.expectedType);for(let zt=0;zt=jt)return ne.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',rn);const Sn=ne.parse(Xt,hn,mt);if(!Sn)return null;mt=mt||Sn.type,ht.push([jt,Sn])}return yt(mt,$e)||yt(mt,De)||yt(mt,pt)||yt(mt,wt)||yt(mt,Nt($e))?new qn(mt,pe,ze,Ze,ht):ne.error(`Type ${Ht(mt)} is not interpolatable.`)}evaluate(U){const ne=this.labels,pe=this.outputs;if(ne.length===1)return pe[0].evaluate(U);const ze=this.input.evaluate(U);if(ze<=ne[0])return pe[0].evaluate(U);const Ze=ne.length;if(ze>=ne[Ze-1])return pe[Ze-1].evaluate(U);const Je=Ir(ne,ze),ht=ne[Je],mt=ne[Je+1],zt=qn.interpolationFactor(this.interpolation,ze,ht,mt),jt=pe[Je].evaluate(U),Xt=pe[Je+1].evaluate(U);switch(this.operator){case"interpolate":return gn[this.type.kind](jt,Xt,zt);case"interpolate-hcl":return gn.color(jt,Xt,zt,"hcl");case"interpolate-lab":return gn.color(jt,Xt,zt,"lab")}}eachChild(U){U(this.input);for(const ne of this.outputs)U(ne)}outputDefined(){return this.outputs.every(U=>U.outputDefined())}}function Un(Y,U,ne,pe){const ze=pe-ne,Ze=Y-ne;return ze===0?0:U===1?Ze/ze:(Math.pow(U,Ze)-1)/(Math.pow(U,ze)-1)}class tr{constructor(U,ne){this.type=U,this.args=ne}static parse(U,ne){if(U.length<2)return ne.error("Expectected at least one argument.");let pe=null;const ze=ne.expectedType;ze&&ze.kind!=="value"&&(pe=ze);const Ze=[];for(const ht of U.slice(1)){const mt=ne.parse(ht,1+Ze.length,pe,void 0,{typeAnnotation:"omit"});if(!mt)return null;pe=pe||mt.type,Ze.push(mt)}if(!pe)throw new Error("No output type");const Je=ze&&Ze.some(ht=>st(ze,ht.type));return new tr(Je?Ge:pe,Ze)}evaluate(U){let ne,pe=null,ze=0;for(const Ze of this.args)if(ze++,pe=Ze.evaluate(U),pe&&pe instanceof Ln&&!pe.available&&(ne||(ne=pe.name),pe=null,ze===this.args.length&&(pe=ne)),pe!==null)break;return pe}eachChild(U){this.args.forEach(U)}outputDefined(){return this.args.every(U=>U.outputDefined())}}function Wn(Y,U){return Y==="=="||Y==="!="?U.kind==="boolean"||U.kind==="string"||U.kind==="number"||U.kind==="null"||U.kind==="value":U.kind==="string"||U.kind==="number"||U.kind==="value"}function Bn(Y,U,ne,pe){return pe.compare(U,ne)===0}function dn(Y,U,ne){const pe=Y!=="=="&&Y!=="!=";return class v8{constructor(Ze,Je,ht){this.type=_e,this.lhs=Ze,this.rhs=Je,this.collator=ht,this.hasUntypedArgument=Ze.type.kind==="value"||Je.type.kind==="value"}static parse(Ze,Je){if(Ze.length!==3&&Ze.length!==4)return Je.error("Expected two or three arguments.");const ht=Ze[0];let mt=Je.parse(Ze[1],1,Ge);if(!mt)return null;if(!Wn(ht,mt.type))return Je.concat(1).error(`"${ht}" comparisons are not supported for type '${Ht(mt.type)}'.`);let zt=Je.parse(Ze[2],2,Ge);if(!zt)return null;if(!Wn(ht,zt.type))return Je.concat(2).error(`"${ht}" comparisons are not supported for type '${Ht(zt.type)}'.`);if(mt.type.kind!==zt.type.kind&&mt.type.kind!=="value"&&zt.type.kind!=="value")return Je.error(`Cannot compare types '${Ht(mt.type)}' and '${Ht(zt.type)}'.`);pe&&(mt.type.kind==="value"&&zt.type.kind!=="value"?mt=new Qn(zt.type,[mt]):mt.type.kind!=="value"&&zt.type.kind==="value"&&(zt=new Qn(mt.type,[zt])));let jt=null;if(Ze.length===4){if(mt.type.kind!=="string"&&zt.type.kind!=="string"&&mt.type.kind!=="value"&&zt.type.kind!=="value")return Je.error("Cannot use collator to compare non-string types.");if(jt=Je.parse(Ze[3],3,tt),!jt)return null}return new v8(mt,zt,jt)}evaluate(Ze){const Je=this.lhs.evaluate(Ze),ht=this.rhs.evaluate(Ze);if(pe&&this.hasUntypedArgument){const mt=wn(Je),zt=wn(ht);if(mt.kind!==zt.kind||mt.kind!=="string"&&mt.kind!=="number")throw new $n(`Expected arguments for "${Y}" to be (string, string) or (number, number), but found (${mt.kind}, ${zt.kind}) instead.`)}if(this.collator&&!pe&&this.hasUntypedArgument){const mt=wn(Je),zt=wn(ht);if(mt.kind!=="string"||zt.kind!=="string")return U(Ze,Je,ht)}return this.collator?ne(Ze,Je,ht,this.collator.evaluate(Ze)):U(Ze,Je,ht)}eachChild(Ze){Ze(this.lhs),Ze(this.rhs),this.collator&&Ze(this.collator)}outputDefined(){return!0}}}const ln=dn("==",function(Y,U,ne){return U===ne},Bn),An=dn("!=",function(Y,U,ne){return U!==ne},function(Y,U,ne,pe){return!Bn(0,U,ne,pe)}),er=dn("<",function(Y,U,ne){return U",function(Y,U,ne){return U>ne},function(Y,U,ne,pe){return pe.compare(U,ne)>0}),Tr=dn("<=",function(Y,U,ne){return U<=ne},function(Y,U,ne,pe){return pe.compare(U,ne)<=0}),yr=dn(">=",function(Y,U,ne){return U>=ne},function(Y,U,ne,pe){return pe.compare(U,ne)>=0});class Ur{constructor(U,ne,pe){this.type=tt,this.locale=pe,this.caseSensitive=U,this.diacriticSensitive=ne}static parse(U,ne){if(U.length!==2)return ne.error("Expected one argument.");const pe=U[1];if(typeof pe!="object"||Array.isArray(pe))return ne.error("Collator options argument must be an object.");const ze=ne.parse(pe["case-sensitive"]!==void 0&&pe["case-sensitive"],1,_e);if(!ze)return null;const Ze=ne.parse(pe["diacritic-sensitive"]!==void 0&&pe["diacritic-sensitive"],1,_e);if(!Ze)return null;let Je=null;return pe.locale&&(Je=ne.parse(pe.locale,1,Ye),!Je)?null:new Ur(ze,Ze,Je)}evaluate(U){return new Pn(this.caseSensitive.evaluate(U),this.diacriticSensitive.evaluate(U),this.locale?this.locale.evaluate(U):null)}eachChild(U){U(this.caseSensitive),U(this.diacriticSensitive),this.locale&&U(this.locale)}outputDefined(){return!1}}class Rr{constructor(U,ne,pe,ze,Ze){this.type=Ye,this.number=U,this.locale=ne,this.currency=pe,this.minFractionDigits=ze,this.maxFractionDigits=Ze}static parse(U,ne){if(U.length!==3)return ne.error("Expected two arguments.");const pe=ne.parse(U[1],1,$e);if(!pe)return null;const ze=U[2];if(typeof ze!="object"||Array.isArray(ze))return ne.error("NumberFormat options argument must be an object.");let Ze=null;if(ze.locale&&(Ze=ne.parse(ze.locale,1,Ye),!Ze))return null;let Je=null;if(ze.currency&&(Je=ne.parse(ze.currency,1,Ye),!Je))return null;let ht=null;if(ze["min-fraction-digits"]&&(ht=ne.parse(ze["min-fraction-digits"],1,$e),!ht))return null;let mt=null;return ze["max-fraction-digits"]&&(mt=ne.parse(ze["max-fraction-digits"],1,$e),!mt)?null:new Rr(pe,Ze,Je,ht,mt)}evaluate(U){return new Intl.NumberFormat(this.locale?this.locale.evaluate(U):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(U):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(U):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(U):void 0}).format(this.number.evaluate(U))}eachChild(U){U(this.number),this.locale&&U(this.locale),this.currency&&U(this.currency),this.minFractionDigits&&U(this.minFractionDigits),this.maxFractionDigits&&U(this.maxFractionDigits)}outputDefined(){return!1}}class $r{constructor(U){this.type=nt,this.sections=U}static parse(U,ne){if(U.length<2)return ne.error("Expected at least one argument.");const pe=U[1];if(!Array.isArray(pe)&&typeof pe=="object")return ne.error("First argument must be an image or text section.");const ze=[];let Ze=!1;for(let Je=1;Je<=U.length-1;++Je){const ht=U[Je];if(Ze&&typeof ht=="object"&&!Array.isArray(ht)){Ze=!1;let mt=null;if(ht["font-scale"]&&(mt=ne.parse(ht["font-scale"],1,$e),!mt))return null;let zt=null;if(ht["text-font"]&&(zt=ne.parse(ht["text-font"],1,Nt(Ye)),!zt))return null;let jt=null;if(ht["text-color"]&&(jt=ne.parse(ht["text-color"],1,De),!jt))return null;const Xt=ze[ze.length-1];Xt.scale=mt,Xt.font=zt,Xt.textColor=jt}else{const mt=ne.parse(U[Je],1,Ge);if(!mt)return null;const zt=mt.type.kind;if(zt!=="string"&&zt!=="value"&&zt!=="null"&&zt!=="resolvedImage")return ne.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ze=!0,ze.push({content:mt,scale:null,font:null,textColor:null})}}return new $r(ze)}evaluate(U){return new In(this.sections.map(ne=>{const pe=ne.content.evaluate(U);return wn(pe)===At?new Dn("",pe,null,null,null):new Dn(zn(pe),null,ne.scale?ne.scale.evaluate(U):null,ne.font?ne.font.evaluate(U).join(","):null,ne.textColor?ne.textColor.evaluate(U):null)}))}eachChild(U){for(const ne of this.sections)U(ne.content),ne.scale&&U(ne.scale),ne.font&&U(ne.font),ne.textColor&&U(ne.textColor)}outputDefined(){return!1}}class Pr{constructor(U){this.type=At,this.input=U}static parse(U,ne){if(U.length!==2)return ne.error("Expected two arguments.");const pe=ne.parse(U[1],1,Ye);return pe?new Pr(pe):ne.error("No image name provided.")}evaluate(U){const ne=this.input.evaluate(U),pe=Ln.fromString(ne);return pe&&U.availableImages&&(pe.available=U.availableImages.indexOf(ne)>-1),pe}eachChild(U){U(this.input)}outputDefined(){return!1}}class Cr{constructor(U){this.type=$e,this.input=U}static parse(U,ne){if(U.length!==2)return ne.error(`Expected 1 argument, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1);return pe?pe.type.kind!=="array"&&pe.type.kind!=="string"&&pe.type.kind!=="value"?ne.error(`Expected argument of type string or array, but found ${Ht(pe.type)} instead.`):new Cr(pe):null}evaluate(U){const ne=this.input.evaluate(U);if(typeof ne=="string"||Array.isArray(ne))return ne.length;throw new $n(`Expected value to be of type string or array, but found ${Ht(wn(ne))} instead.`)}eachChild(U){U(this.input)}outputDefined(){return!1}}const Jr=8192;function gi(Y,U){const ne=(180+Y[0])/360,pe=(Ze=Y[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Ze*Math.PI/360)))/360),ze=Math.pow(2,U.z);var Ze;return[Math.round(ne*ze*Jr),Math.round(pe*ze*Jr)]}function ii(Y,U){const ne=Math.pow(2,U.z),pe=(Y[0]/Jr+U.x)/ne,ze=(Y[1]/Jr+U.y)/ne;return[(Je=pe,360*Je-180),(Ze=ze,360/Math.PI*Math.atan(Math.exp((180-360*Ze)*Math.PI/180))-90)];var Ze,Je}function Yr(Y,U){Y[0]=Math.min(Y[0],U[0]),Y[1]=Math.min(Y[1],U[1]),Y[2]=Math.max(Y[2],U[0]),Y[3]=Math.max(Y[3],U[1])}function oi(Y,U){return!(Y[0]<=U[0]||Y[2]>=U[2]||Y[1]<=U[1]||Y[3]>=U[3])}function Ti(Y,U,ne){const pe=Y[0]-U[0],ze=Y[1]-U[1],Ze=Y[0]-ne[0],Je=Y[1]-ne[1];return pe*Je-Ze*ze==0&&pe*Ze<=0&&ze*Je<=0}function Wi(Y,U,ne,pe){const ze=[U[0]-Y[0],U[1]-Y[1]];return Ze=[pe[0]-ne[0],pe[1]-ne[1]],Je=ze,Ze[0]*Je[1]-Ze[1]*Je[0]!=0&&!(!bs(Y,U,ne,pe)||!bs(ne,pe,Y,U));var Ze,Je}function Pa(Y,U,ne){for(const pe of ne)for(let ze=0;zeze[1]!=Je[1]>ze[1]&&ze[0]<(Je[0]-Ze[0])*(ze[1]-Ze[1])/(Je[1]-Ze[1])+Ze[0]&&(pe=!pe)}var ze,Ze,Je;return pe}function Vo(Y,U){for(const ne of U)if(ji(Y,ne))return!0;return!1}function Ha(Y,U){for(const ne of Y)if(!ji(ne,U))return!1;for(let ne=0;ne0&&Xt<0||jt<0&&Xt>0}function lo(Y,U,ne){const pe=[];for(let ze=0;zene[2]){const ze=.5*pe;let Ze=Y[0]-ne[0]>ze?-pe:ne[0]-Y[0]>ze?pe:0;Ze===0&&(Ze=Y[0]-ne[2]>ze?-pe:ne[2]-Y[0]>ze?pe:0),Y[0]+=Ze}Yr(U,Y)}function To(Y,U,ne,pe){const ze=Math.pow(2,pe.z)*Jr,Ze=[pe.x*Jr,pe.y*Jr],Je=[];for(const ht of Y)for(const mt of ht){const zt=[mt.x+Ze[0],mt.y+Ze[1]];os(zt,U,ne,ze),Je.push(zt)}return Je}function fo(Y,U,ne,pe){const ze=Math.pow(2,pe.z)*Jr,Ze=[pe.x*Jr,pe.y*Jr],Je=[];for(const mt of Y){const zt=[];for(const jt of mt){const Xt=[jt.x+Ze[0],jt.y+Ze[1]];Yr(U,Xt),zt.push(Xt)}Je.push(zt)}if(U[2]-U[0]<=ze/2){(ht=U)[0]=ht[1]=1/0,ht[2]=ht[3]=-1/0;for(const mt of Je)for(const zt of mt)os(zt,U,ne,ze)}var ht;return Je}class Os{constructor(U,ne){this.type=_e,this.geojson=U,this.geometries=ne}static parse(U,ne){if(U.length!==2)return ne.error(`'within' expression requires exactly one argument, but found ${U.length-1} instead.`);if(Fn(U[1])){const pe=U[1];if(pe.type==="FeatureCollection"){const ze=[];for(const Ze of pe.features){const{type:Je,coordinates:ht}=Ze.geometry;Je==="Polygon"&&ze.push(ht),Je==="MultiPolygon"&&ze.push(...ht)}if(ze.length)return new Os(pe,{type:"MultiPolygon",coordinates:ze})}else if(pe.type==="Feature"){const ze=pe.geometry.type;if(ze==="Polygon"||ze==="MultiPolygon")return new Os(pe,pe.geometry)}else if(pe.type==="Polygon"||pe.type==="MultiPolygon")return new Os(pe,pe)}return ne.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(U){if(U.geometry()!=null&&U.canonicalID()!=null){if(U.geometryType()==="Point")return function(ne,pe){const ze=[1/0,1/0,-1/0,-1/0],Ze=[1/0,1/0,-1/0,-1/0],Je=ne.canonicalID();if(pe.type==="Polygon"){const ht=lo(pe.coordinates,Ze,Je),mt=To(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!ji(zt,ht))return!1}if(pe.type==="MultiPolygon"){const ht=Ki(pe.coordinates,Ze,Je),mt=To(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!Vo(zt,ht))return!1}return!0}(U,this.geometries);if(U.geometryType()==="LineString")return function(ne,pe){const ze=[1/0,1/0,-1/0,-1/0],Ze=[1/0,1/0,-1/0,-1/0],Je=ne.canonicalID();if(pe.type==="Polygon"){const ht=lo(pe.coordinates,Ze,Je),mt=fo(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!Ha(zt,ht))return!1}if(pe.type==="MultiPolygon"){const ht=Ki(pe.coordinates,Ze,Je),mt=fo(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!Oa(zt,ht))return!1}return!0}(U,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ta=class{constructor(Y=[],U=ws){if(this.data=Y,this.length=this.data.length,this.compare=U,this.length>0)for(let ne=(this.length>>1)-1;ne>=0;ne--)this._down(ne)}push(Y){this.data.push(Y),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const Y=this.data[0],U=this.data.pop();return this.length--,this.length>0&&(this.data[0]=U,this._down(0)),Y}peek(){return this.data[0]}_up(Y){const{data:U,compare:ne}=this,pe=U[Y];for(;Y>0;){const ze=Y-1>>1,Ze=U[ze];if(ne(pe,Ze)>=0)break;U[Y]=Ze,Y=ze}U[Y]=pe}_down(Y){const{data:U,compare:ne}=this,pe=this.length>>1,ze=U[Y];for(;Y=0)break;U[Y]=Je,Y=Ze}U[Y]=ze}};function ws(Y,U){return YU?1:0}function Bl(Y,U,ne,pe,ze){Ql(Y,U,ne,pe||Y.length-1,ze||eu)}function Ql(Y,U,ne,pe,ze){for(;pe>ne;){if(pe-ne>600){var Ze=pe-ne+1,Je=U-ne+1,ht=Math.log(Ze),mt=.5*Math.exp(2*ht/3),zt=.5*Math.sqrt(ht*mt*(Ze-mt)/Ze)*(Je-Ze/2<0?-1:1);Ql(Y,U,Math.max(ne,Math.floor(U-Je*mt/Ze+zt)),Math.min(pe,Math.floor(U+(Ze-Je)*mt/Ze+zt)),ze)}var jt=Y[U],Xt=ne,rn=pe;for(ss(Y,ne,U),ze(Y[pe],jt)>0&&ss(Y,ne,pe);Xt0;)rn--}ze(Y[ne],jt)===0?ss(Y,ne,rn):ss(Y,++rn,pe),rn<=U&&(ne=rn+1),U<=rn&&(pe=rn-1)}}function ss(Y,U,ne){var pe=Y[U];Y[U]=Y[ne],Y[ne]=pe}function eu(Y,U){return YU?1:0}function vl(Y,U){if(Y.length<=1)return[Y];const ne=[];let pe,ze;for(const Ze of Y){const Je=ko(Ze);Je!==0&&(Ze.area=Math.abs(Je),ze===void 0&&(ze=Je<0),ze===Je<0?(pe&&ne.push(pe),pe=[Ze]):pe.push(Ze))}if(pe&&ne.push(pe),U>1)for(let Ze=0;Ze1?(zt=U[mt+1][0],jt=U[mt+1][1]):hn>0&&(zt+=Xt/this.kx*hn,jt+=rn/this.ky*hn)),Xt=this.wrap(ne[0]-zt)*this.kx,rn=(ne[1]-jt)*this.ky;const Sn=Xt*Xt+rn*rn;Sn180;)U-=360;return U}}const xl=100,jl=50;function Ul(Y,U){return U[0]-Y[0]}function Vl(Y){return Y[1]-Y[0]+1}function vs(Y,U){return Y[1]>=Y[0]&&Y[1]Y[1])return[null,null];const ne=Vl(Y);if(U){if(ne===2)return[Y,null];const ze=Math.floor(ne/2);return[[Y[0],Y[0]+ze],[Y[0]+ze,Y[1]]]}if(ne===1)return[Y,null];const pe=Math.floor(ne/2)-1;return[[Y[0],Y[0]+pe],[Y[0]+pe+1,Y[1]]]}function ju(Y,U){if(!vs(U,Y.length))return[1/0,1/0,-1/0,-1/0];const ne=[1/0,1/0,-1/0,-1/0];for(let pe=U[0];pe<=U[1];++pe)Yr(ne,Y[pe]);return ne}function Su(Y){const U=[1/0,1/0,-1/0,-1/0];for(const ne of Y)for(const pe of ne)Yr(U,pe);return U}function pc(Y){return Y[0]!==-1/0&&Y[1]!==-1/0&&Y[2]!==1/0&&Y[3]!==1/0}function Rs(Y,U,ne){if(!pc(Y)||!pc(U))return NaN;let pe=0,ze=0;return Y[2]U[2]&&(pe=Y[0]-U[2]),Y[1]>U[3]&&(ze=Y[1]-U[3]),Y[3]=pe)return pe;if(oi(ze,Ze)){if(Mu(Y,U))return 0}else if(Mu(U,Y))return 0;let Je=1/0;for(const ht of Y)for(let mt=0,zt=ht.length,jt=zt-1;mt0;){const mt=Je.pop();if(mt[0]>=Ze)continue;const zt=mt[1],jt=U?jl:xl;if(Vl(zt)<=jt){if(!vs(zt,Y.length))return NaN;if(U){const Xt=oa(Y,zt,ne,pe);if(isNaN(Xt)||Xt===0)return Xt;Ze=Math.min(Ze,Xt)}else for(let Xt=zt[0];Xt<=zt[1];++Xt){const rn=Qu(Y[Xt],ne,pe);if(Ze=Math.min(Ze,rn),Ze===0)return 0}}else{const Xt=Ju(zt,U);Ya(Je,Ze,pe,Y,ht,Xt[0]),Ya(Je,Ze,pe,Y,ht,Xt[1])}}return Ze}function ec(Y,U,ne,pe,ze,Ze=1/0){let Je=Math.min(Ze,ze.distance(Y[0],ne[0]));if(Je===0)return Je;const ht=new Ta([[0,[0,Y.length-1],[0,ne.length-1]]],Ul);for(;ht.length>0;){const mt=ht.pop();if(mt[0]>=Je)continue;const zt=mt[1],jt=mt[2],Xt=U?jl:xl,rn=pe?jl:xl;if(Vl(zt)<=Xt&&Vl(jt)<=rn){if(!vs(zt,Y.length)&&vs(jt,ne.length))return NaN;let hn;if(U&&pe)hn=gh(Y,zt,ne,jt,ze),Je=Math.min(Je,hn);else if(U&&!pe){const Sn=Y.slice(zt[0],zt[1]+1);for(let xn=jt[0];xn<=jt[1];++xn)if(hn=Vs(ne[xn],Sn,ze),Je=Math.min(Je,hn),Je===0)return Je}else if(!U&&pe){const Sn=ne.slice(jt[0],jt[1]+1);for(let xn=zt[0];xn<=zt[1];++xn)if(hn=Vs(Y[xn],Sn,ze),Je=Math.min(Je,hn),Je===0)return Je}else hn=Fo(Y,zt,ne,jt,ze),Je=Math.min(Je,hn)}else{const hn=Ju(zt,U),Sn=Ju(jt,pe);ys(ht,Je,ze,Y,ne,hn[0],Sn[0]),ys(ht,Je,ze,Y,ne,hn[0],Sn[1]),ys(ht,Je,ze,Y,ne,hn[1],Sn[0]),ys(ht,Je,ze,Y,ne,hn[1],Sn[1])}}return Je}function ql(Y){return Y.type==="MultiPolygon"?Y.coordinates.map(U=>({type:"Polygon",coordinates:U})):Y.type==="MultiLineString"?Y.coordinates.map(U=>({type:"LineString",coordinates:U})):Y.type==="MultiPoint"?Y.coordinates.map(U=>({type:"Point",coordinates:U})):[Y]}class Fs{constructor(U,ne){this.type=$e,this.geojson=U,this.geometries=ne}static parse(U,ne){if(U.length!==2)return ne.error(`'distance' expression requires exactly one argument, but found ${U.length-1} instead.`);if(Fn(U[1])){const pe=U[1];if(pe.type==="FeatureCollection")return new Fs(pe,pe.features.map(ze=>ql(ze.geometry)).flat());if(pe.type==="Feature")return new Fs(pe,ql(pe.geometry));if("type"in pe&&"coordinates"in pe)return new Fs(pe,ql(pe))}return ne.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(U){if(U.geometry()!=null&&U.canonicalID()!=null){if(U.geometryType()==="Point")return function(ne,pe){const ze=ne.geometry(),Ze=ze.flat().map(mt=>ii([mt.x,mt.y],ne.canonical));if(ze.length===0)return NaN;const Je=new tu(Ze[0][1]);let ht=1/0;for(const mt of pe){switch(mt.type){case"Point":ht=Math.min(ht,ec(Ze,!1,[mt.coordinates],!1,Je,ht));break;case"LineString":ht=Math.min(ht,ec(Ze,!1,mt.coordinates,!0,Je,ht));break;case"Polygon":ht=Math.min(ht,qs(Ze,!1,mt.coordinates,Je,ht))}if(ht===0)return ht}return ht}(U,this.geometries);if(U.geometryType()==="LineString")return function(ne,pe){const ze=ne.geometry(),Ze=ze.flat().map(mt=>ii([mt.x,mt.y],ne.canonical));if(ze.length===0)return NaN;const Je=new tu(Ze[0][1]);let ht=1/0;for(const mt of pe){switch(mt.type){case"Point":ht=Math.min(ht,ec(Ze,!0,[mt.coordinates],!1,Je,ht));break;case"LineString":ht=Math.min(ht,ec(Ze,!0,mt.coordinates,!0,Je,ht));break;case"Polygon":ht=Math.min(ht,qs(Ze,!0,mt.coordinates,Je,ht))}if(ht===0)return ht}return ht}(U,this.geometries);if(U.geometryType()==="Polygon")return function(ne,pe){const ze=ne.geometry();if(ze.length===0||ze[0].length===0)return NaN;const Ze=vl(ze,0).map(mt=>mt.map(zt=>zt.map(jt=>ii([jt.x,jt.y],ne.canonical)))),Je=new tu(Ze[0][0][0][1]);let ht=1/0;for(const mt of pe)for(const zt of Ze){switch(mt.type){case"Point":ht=Math.min(ht,qs([mt.coordinates],!1,zt,Je,ht));break;case"LineString":ht=Math.min(ht,qs(mt.coordinates,!0,zt,Je,ht));break;case"Polygon":ht=Math.min(ht,$a(zt,mt.coordinates,Je,ht))}if(ht===0)return ht}return ht}(U,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const qo={"==":ln,"!=":An,">":br,"<":er,">=":yr,"<=":Tr,array:Qn,at:Qr,boolean:Qn,case:Zn,coalesce:tr,collator:Ur,format:$r,image:Pr,in:kn,"index-of":Cn,interpolate:qn,"interpolate-hcl":qn,"interpolate-lab":qn,length:Cr,let:Ar,literal:Jn,match:ur,number:Qn,"number-format":Rr,object:Qn,slice:cr,step:Er,string:Qn,"to-boolean":hr,"to-color":hr,"to-number":hr,"to-string":hr,var:xr,within:Os,distance:Fs};class Bo{constructor(U,ne,pe,ze){this.name=U,this.type=ne,this._evaluate=pe,this.args=ze}evaluate(U){return this._evaluate(U,this.args)}eachChild(U){this.args.forEach(U)}outputDefined(){return!1}static parse(U,ne){const pe=U[0],ze=Bo.definitions[pe];if(!ze)return ne.error(`Unknown expression "${pe}". If you wanted a literal array, use ["literal", [...]].`,0);const Ze=Array.isArray(ze)?ze[0]:ze.type,Je=Array.isArray(ze)?[[ze[1],ze[2]]]:ze.overloads,ht=Je.filter(([zt])=>!Array.isArray(zt)||zt.length===U.length-1);let mt=null;for(const[zt,jt]of ht){mt=new Or(ne.registry,Yo,ne.path,null,ne.scope);const Xt=[];let rn=!1;for(let hn=1;hn{return rn=Xt,Array.isArray(rn)?`(${rn.map(Ht).join(", ")})`:`(${Ht(rn.type)}...)`;var rn}).join(" | "),jt=[];for(let Xt=1;Xt{ne=U?ne&&Yo(pe):ne&&pe instanceof Jn}),!!ne&&tc(Y)&&rc(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function tc(Y){if(Y instanceof Bo&&(Y.name==="get"&&Y.args.length===1||Y.name==="feature-state"||Y.name==="has"&&Y.args.length===1||Y.name==="properties"||Y.name==="geometry-type"||Y.name==="id"||/^filter-/.test(Y.name))||Y instanceof Os||Y instanceof Fs)return!1;let U=!0;return Y.eachChild(ne=>{U&&!tc(ne)&&(U=!1)}),U}function nc(Y){if(Y instanceof Bo&&Y.name==="feature-state")return!1;let U=!0;return Y.eachChild(ne=>{U&&!nc(ne)&&(U=!1)}),U}function rc(Y,U){if(Y instanceof Bo&&U.indexOf(Y.name)>=0)return!1;let ne=!0;return Y.eachChild(pe=>{ne&&!rc(pe,U)&&(ne=!1)}),ne}function Qc(Y){return{result:"success",value:Y}}function _l(Y){return{result:"error",value:Y}}function Hl(Y){return Y["property-type"]==="data-driven"||Y["property-type"]==="cross-faded-data-driven"}function Gs(Y){return!!Y.expression&&Y.expression.parameters.indexOf("zoom")>-1}function pr(Y){return!!Y.expression&&Y.expression.interpolated}function Dr(Y){return Y instanceof Number?"number":Y instanceof String?"string":Y instanceof Boolean?"boolean":Array.isArray(Y)?"array":Y===null?"null":typeof Y}function Zr(Y){return typeof Y=="object"&&Y!==null&&!Array.isArray(Y)}function Li(Y){return Y}function ia(Y,U){const ne=U.type==="color",pe=Y.stops&&typeof Y.stops[0][0]=="object",ze=pe||Y.property!==void 0,Ze=pe||!ze,Je=Y.type||(pr(U)?"exponential":"interval");if(ne||U.type==="padding"){const Xt=ne?un.parse:mn.parse;(Y=ke({},Y)).stops&&(Y.stops=Y.stops.map(rn=>[rn[0],Xt(rn[1])])),Y.default?Y.default=Xt(Y.default):Y.default=Xt(U.default)}if(Y.colorSpace&&(ht=Y.colorSpace)!=="rgb"&&ht!=="hcl"&&ht!=="lab")throw new Error(`Unknown color space: "${Y.colorSpace}"`);var ht;let mt,zt,jt;if(Je==="exponential")mt=mu;else if(Je==="interval")mt=ro;else if(Je==="categorical"){mt=po,zt=Object.create(null);for(const Xt of Y.stops)zt[Xt[0]]=Xt[1];jt=typeof Y.stops[0][0]}else{if(Je!=="identity")throw new Error(`Unknown function type "${Je}"`);mt=qu}if(pe){const Xt={},rn=[];for(let xn=0;xnxn[0]),evaluate({zoom:xn},Nn){return mu({stops:hn,base:Y.base},U,xn).evaluate(xn,Nn)}}}if(Ze){const Xt=Je==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:Xt,interpolationFactor:qn.interpolationFactor.bind(void 0,Xt),zoomStops:Y.stops.map(rn=>rn[0]),evaluate:({zoom:rn})=>mt(Y,U,rn,zt,jt)}}return{kind:"source",evaluate(Xt,rn){const hn=rn&&rn.properties?rn.properties[Y.property]:void 0;return hn===void 0?sa(Y.default,U.default):mt(Y,U,hn,zt,jt)}}}function sa(Y,U,ne){return Y!==void 0?Y:U!==void 0?U:ne!==void 0?ne:void 0}function po(Y,U,ne,pe,ze){return sa(typeof ne===ze?pe[ne]:void 0,Y.default,U.default)}function ro(Y,U,ne){if(Dr(ne)!=="number")return sa(Y.default,U.default);const pe=Y.stops.length;if(pe===1||ne<=Y.stops[0][0])return Y.stops[0][1];if(ne>=Y.stops[pe-1][0])return Y.stops[pe-1][1];const ze=Ir(Y.stops.map(Ze=>Ze[0]),ne);return Y.stops[ze][1]}function mu(Y,U,ne){const pe=Y.base!==void 0?Y.base:1;if(Dr(ne)!=="number")return sa(Y.default,U.default);const ze=Y.stops.length;if(ze===1||ne<=Y.stops[0][0])return Y.stops[0][1];if(ne>=Y.stops[ze-1][0])return Y.stops[ze-1][1];const Ze=Ir(Y.stops.map(jt=>jt[0]),ne),Je=function(jt,Xt,rn,hn){const Sn=hn-rn,xn=jt-rn;return Sn===0?0:Xt===1?xn/Sn:(Math.pow(Xt,xn)-1)/(Math.pow(Xt,Sn)-1)}(ne,pe,Y.stops[Ze][0],Y.stops[Ze+1][0]),ht=Y.stops[Ze][1],mt=Y.stops[Ze+1][1],zt=gn[U.type]||Li;return typeof ht.evaluate=="function"?{evaluate(...jt){const Xt=ht.evaluate.apply(void 0,jt),rn=mt.evaluate.apply(void 0,jt);if(Xt!==void 0&&rn!==void 0)return zt(Xt,rn,Je,Y.colorSpace)}}:zt(ht,mt,Je,Y.colorSpace)}function qu(Y,U,ne){switch(U.type){case"color":ne=un.parse(ne);break;case"formatted":ne=In.fromString(ne.toString());break;case"resolvedImage":ne=Ln.fromString(ne.toString());break;case"padding":ne=mn.parse(ne);break;default:Dr(ne)===U.type||U.type==="enum"&&U.values[ne]||(ne=void 0)}return sa(ne,Y.default,U.default)}Bo.register(qo,{error:[{kind:"error"},[Ye],(Y,[U])=>{throw new $n(U.evaluate(Y))}],typeof:[Ye,[Ge],(Y,[U])=>Ht(wn(U.evaluate(Y)))],"to-rgba":[Nt($e,4),[De],(Y,[U])=>{const[ne,pe,ze,Ze]=U.evaluate(Y).rgb;return[255*ne,255*pe,255*ze,Ze]}],rgb:[De,[$e,$e,$e],_a],rgba:[De,[$e,$e,$e,$e],_a],has:{type:_e,overloads:[[[Ye],(Y,[U])=>Vu(U.evaluate(Y),Y.properties())],[[Ye,Be],(Y,[U,ne])=>Vu(U.evaluate(Y),ne.evaluate(Y))]]},get:{type:Ge,overloads:[[[Ye],(Y,[U])=>Fc(U.evaluate(Y),Y.properties())],[[Ye,Be],(Y,[U,ne])=>Fc(U.evaluate(Y),ne.evaluate(Y))]]},"feature-state":[Ge,[Ye],(Y,[U])=>Fc(U.evaluate(Y),Y.featureState||{})],properties:[Be,[],Y=>Y.properties()],"geometry-type":[Ye,[],Y=>Y.geometryType()],id:[Ge,[],Y=>Y.id()],zoom:[$e,[],Y=>Y.globals.zoom],"heatmap-density":[$e,[],Y=>Y.globals.heatmapDensity||0],"line-progress":[$e,[],Y=>Y.globals.lineProgress||0],accumulated:[Ge,[],Y=>Y.globals.accumulated===void 0?null:Y.globals.accumulated],"+":[$e,Hs($e),(Y,U)=>{let ne=0;for(const pe of U)ne+=pe.evaluate(Y);return ne}],"*":[$e,Hs($e),(Y,U)=>{let ne=1;for(const pe of U)ne*=pe.evaluate(Y);return ne}],"-":{type:$e,overloads:[[[$e,$e],(Y,[U,ne])=>U.evaluate(Y)-ne.evaluate(Y)],[[$e],(Y,[U])=>-U.evaluate(Y)]]},"/":[$e,[$e,$e],(Y,[U,ne])=>U.evaluate(Y)/ne.evaluate(Y)],"%":[$e,[$e,$e],(Y,[U,ne])=>U.evaluate(Y)%ne.evaluate(Y)],ln2:[$e,[],()=>Math.LN2],pi:[$e,[],()=>Math.PI],e:[$e,[],()=>Math.E],"^":[$e,[$e,$e],(Y,[U,ne])=>Math.pow(U.evaluate(Y),ne.evaluate(Y))],sqrt:[$e,[$e],(Y,[U])=>Math.sqrt(U.evaluate(Y))],log10:[$e,[$e],(Y,[U])=>Math.log(U.evaluate(Y))/Math.LN10],ln:[$e,[$e],(Y,[U])=>Math.log(U.evaluate(Y))],log2:[$e,[$e],(Y,[U])=>Math.log(U.evaluate(Y))/Math.LN2],sin:[$e,[$e],(Y,[U])=>Math.sin(U.evaluate(Y))],cos:[$e,[$e],(Y,[U])=>Math.cos(U.evaluate(Y))],tan:[$e,[$e],(Y,[U])=>Math.tan(U.evaluate(Y))],asin:[$e,[$e],(Y,[U])=>Math.asin(U.evaluate(Y))],acos:[$e,[$e],(Y,[U])=>Math.acos(U.evaluate(Y))],atan:[$e,[$e],(Y,[U])=>Math.atan(U.evaluate(Y))],min:[$e,Hs($e),(Y,U)=>Math.min(...U.map(ne=>ne.evaluate(Y)))],max:[$e,Hs($e),(Y,U)=>Math.max(...U.map(ne=>ne.evaluate(Y)))],abs:[$e,[$e],(Y,[U])=>Math.abs(U.evaluate(Y))],round:[$e,[$e],(Y,[U])=>{const ne=U.evaluate(Y);return ne<0?-Math.round(-ne):Math.round(ne)}],floor:[$e,[$e],(Y,[U])=>Math.floor(U.evaluate(Y))],ceil:[$e,[$e],(Y,[U])=>Math.ceil(U.evaluate(Y))],"filter-==":[_e,[Ye,Ge],(Y,[U,ne])=>Y.properties()[U.value]===ne.value],"filter-id-==":[_e,[Ge],(Y,[U])=>Y.id()===U.value],"filter-type-==":[_e,[Ye],(Y,[U])=>Y.geometryType()===U.value],"filter-<":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe>ze}],"filter-id->":[_e,[Ge],(Y,[U])=>{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne>pe}],"filter-<=":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe<=ze}],"filter-id-<=":[_e,[Ge],(Y,[U])=>{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne<=pe}],"filter->=":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe>=ze}],"filter-id->=":[_e,[Ge],(Y,[U])=>{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne>=pe}],"filter-has":[_e,[Ge],(Y,[U])=>U.value in Y.properties()],"filter-has-id":[_e,[],Y=>Y.id()!==null&&Y.id()!==void 0],"filter-type-in":[_e,[Nt(Ye)],(Y,[U])=>U.value.indexOf(Y.geometryType())>=0],"filter-id-in":[_e,[Nt(Ge)],(Y,[U])=>U.value.indexOf(Y.id())>=0],"filter-in-small":[_e,[Ye,Nt(Ge)],(Y,[U,ne])=>ne.value.indexOf(Y.properties()[U.value])>=0],"filter-in-large":[_e,[Ye,Nt(Ge)],(Y,[U,ne])=>function(pe,ze,Ze,Je){for(;Ze<=Je;){const ht=Ze+Je>>1;if(ze[ht]===pe)return!0;ze[ht]>pe?Je=ht-1:Ze=ht+1}return!1}(Y.properties()[U.value],ne.value,0,ne.value.length-1)],all:{type:_e,overloads:[[[_e,_e],(Y,[U,ne])=>U.evaluate(Y)&&ne.evaluate(Y)],[Hs(_e),(Y,U)=>{for(const ne of U)if(!ne.evaluate(Y))return!1;return!0}]]},any:{type:_e,overloads:[[[_e,_e],(Y,[U,ne])=>U.evaluate(Y)||ne.evaluate(Y)],[Hs(_e),(Y,U)=>{for(const ne of U)if(ne.evaluate(Y))return!0;return!1}]]},"!":[_e,[_e],(Y,[U])=>!U.evaluate(Y)],"is-supported-script":[_e,[Ye],(Y,[U])=>{const ne=Y.globals&&Y.globals.isSupportedScript;return!ne||ne(U.evaluate(Y))}],upcase:[Ye,[Ye],(Y,[U])=>U.evaluate(Y).toUpperCase()],downcase:[Ye,[Ye],(Y,[U])=>U.evaluate(Y).toLowerCase()],concat:[Ye,Hs(Ge),(Y,U)=>U.map(ne=>zn(ne.evaluate(Y))).join("")],"resolved-locale":[Ye,[tt],(Y,[U])=>U.evaluate(Y).resolvedLocale()]});class ls{constructor(U,ne){var pe;this.expression=U,this._warningHistory={},this._evaluator=new ni,this._defaultValue=ne?(pe=ne).type==="color"&&Zr(pe.default)?new un(0,0,0,0):pe.type==="color"?un.parse(pe.default)||null:pe.type==="padding"?mn.parse(pe.default)||null:pe.type==="variableAnchorOffsetCollection"?Kn.parse(pe.default)||null:pe.default===void 0?null:pe.default:null,this._enumValues=ne&&ne.type==="enum"?ne.values:null}evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je){return this._evaluator.globals=U,this._evaluator.feature=ne,this._evaluator.featureState=pe,this._evaluator.canonical=ze,this._evaluator.availableImages=Ze||null,this._evaluator.formattedSection=Je,this.expression.evaluate(this._evaluator)}evaluate(U,ne,pe,ze,Ze,Je){this._evaluator.globals=U,this._evaluator.feature=ne||null,this._evaluator.featureState=pe||null,this._evaluator.canonical=ze,this._evaluator.availableImages=Ze||null,this._evaluator.formattedSection=Je||null;try{const ht=this.expression.evaluate(this._evaluator);if(ht==null||typeof ht=="number"&&ht!=ht)return this._defaultValue;if(this._enumValues&&!(ht in this._enumValues))throw new $n(`Expected value to be one of ${Object.keys(this._enumValues).map(mt=>JSON.stringify(mt)).join(", ")}, but found ${JSON.stringify(ht)} instead.`);return ht}catch(ht){return this._warningHistory[ht.message]||(this._warningHistory[ht.message]=!0,typeof console<"u"&&console.warn(ht.message)),this._defaultValue}}}function Ws(Y){return Array.isArray(Y)&&Y.length>0&&typeof Y[0]=="string"&&Y[0]in qo}function bl(Y,U){const ne=new Or(qo,Yo,[],U?function(ze){const Ze={color:De,string:Ye,number:$e,enum:Ye,boolean:_e,formatted:nt,padding:pt,resolvedImage:At,variableAnchorOffsetCollection:wt};return ze.type==="array"?Nt(Ze[ze.value]||Ge,ze.length):Ze[ze.type]}(U):void 0),pe=ne.parse(Y,void 0,void 0,void 0,U&&U.type==="string"?{typeAnnotation:"coerce"}:void 0);return pe?Qc(new ls(pe,U)):_l(ne.errors)}class Zs{constructor(U,ne){this.kind=U,this._styleExpression=ne,this.isStateDependent=U!=="constant"&&!nc(ne.expression)}evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je)}evaluate(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluate(U,ne,pe,ze,Ze,Je)}}class vu{constructor(U,ne,pe,ze){this.kind=U,this.zoomStops=pe,this._styleExpression=ne,this.isStateDependent=U!=="camera"&&!nc(ne.expression),this.interpolationType=ze}evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je)}evaluate(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluate(U,ne,pe,ze,Ze,Je)}interpolationFactor(U,ne,pe){return this.interpolationType?qn.interpolationFactor(this.interpolationType,U,ne,pe):0}}function La(Y,U){const ne=bl(Y,U);if(ne.result==="error")return ne;const pe=ne.value.expression,ze=tc(pe);if(!ze&&!Hl(U))return _l([new He("","data expressions not supported")]);const Ze=rc(pe,["zoom"]);if(!Ze&&!Gs(U))return _l([new He("","zoom expressions not supported")]);const Je=Ho(pe);if(!Je&&!Ze)return _l([new He("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Je instanceof He)return _l([Je]);if(Je instanceof qn&&!pr(U))return _l([new He("",'"interpolate" expressions cannot be used with this property')]);if(!Je)return Qc(new Zs(ze?"constant":"source",ne.value));const ht=Je instanceof qn?Je.interpolation:void 0;return Qc(new vu(ze?"camera":"composite",ne.value,Je.labels,ht))}class ba{constructor(U,ne){this._parameters=U,this._specification=ne,ke(this,ia(this._parameters,this._specification))}static deserialize(U){return new ba(U._parameters,U._specification)}static serialize(U){return{_parameters:U._parameters,_specification:U._specification}}}function Ho(Y){let U=null;if(Y instanceof Ar)U=Ho(Y.result);else if(Y instanceof tr){for(const ne of Y.args)if(U=Ho(ne),U)break}else(Y instanceof Er||Y instanceof qn)&&Y.input instanceof Bo&&Y.input.name==="zoom"&&(U=Y);return U instanceof He||Y.eachChild(ne=>{const pe=Ho(ne);pe instanceof He?U=pe:!U&&pe?U=new He("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):U&&pe&&U!==pe&&(U=new He("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),U}function Ts(Y){if(Y===!0||Y===!1)return!0;if(!Array.isArray(Y)||Y.length===0)return!1;switch(Y[0]){case"has":return Y.length>=2&&Y[1]!=="$id"&&Y[1]!=="$type";case"in":return Y.length>=3&&(typeof Y[1]!="string"||Array.isArray(Y[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return Y.length!==3||Array.isArray(Y[1])||Array.isArray(Y[2]);case"any":case"all":for(const U of Y.slice(1))if(!Ts(U)&&typeof U!="boolean")return!1;return!0;default:return!0}}const Aa={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ua(Y){if(Y==null)return{filter:()=>!0,needGeometry:!1};Ts(Y)||(Y=nu(Y));const U=bl(Y,Aa);if(U.result==="error")throw new Error(U.value.map(ne=>`${ne.key}: ${ne.message}`).join(", "));return{filter:(ne,pe,ze)=>U.value.evaluate(ne,pe,{},ze),needGeometry:ic(Y)}}function wl(Y,U){return YU?1:0}function ic(Y){if(!Array.isArray(Y))return!1;if(Y[0]==="within"||Y[0]==="distance")return!0;for(let U=1;U"||U==="<="||U===">="?Bs(Y[1],Y[2],U):U==="any"?(ne=Y.slice(1),["any"].concat(ne.map(nu))):U==="all"?["all"].concat(Y.slice(1).map(nu)):U==="none"?["all"].concat(Y.slice(1).map(nu).map(No)):U==="in"?Gl(Y[1],Y.slice(2)):U==="!in"?No(Gl(Y[1],Y.slice(2))):U==="has"?us(Y[1]):U!=="!has"||No(us(Y[1]));var ne}function Bs(Y,U,ne){switch(Y){case"$type":return[`filter-type-${ne}`,U];case"$id":return[`filter-id-${ne}`,U];default:return[`filter-${ne}`,Y,U]}}function Gl(Y,U){if(U.length===0)return!1;switch(Y){case"$type":return["filter-type-in",["literal",U]];case"$id":return["filter-id-in",["literal",U]];default:return U.length>200&&!U.some(ne=>typeof ne!=typeof U[0])?["filter-in-large",Y,["literal",U.sort(wl)]]:["filter-in-small",Y,["literal",U]]}}function us(Y){switch(Y){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",Y]}}function No(Y){return["!",Y]}function Wl(Y){const U=typeof Y;if(U==="number"||U==="boolean"||U==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let ze="[";for(const Ze of Y)ze+=`${Wl(Ze)},`;return`${ze}]`}const ne=Object.keys(Y).sort();let pe="{";for(let ze=0;zepe.maximum?[new Me(U,ne,`${ne} is greater than the maximum value ${pe.maximum}`)]:[]}function Ko(Y){const U=Y.valueSpec,ne=Xa(Y.value.type);let pe,ze,Ze,Je={};const ht=ne!=="categorical"&&Y.value.property===void 0,mt=!ht,zt=Dr(Y.value.stops)==="array"&&Dr(Y.value.stops[0])==="array"&&Dr(Y.value.stops[0][0])==="object",jt=ka({key:Y.key,value:Y.value,valueSpec:Y.styleSpec.function,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,objectElementValidators:{stops:function(hn){if(ne==="identity")return[new Me(hn.key,hn.value,'identity function may not have a "stops" property')];let Sn=[];const xn=hn.value;return Sn=Sn.concat(Ao({key:hn.key,value:xn,valueSpec:hn.valueSpec,validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec,arrayElementValidator:Xt})),Dr(xn)==="array"&&xn.length===0&&Sn.push(new Me(hn.key,xn,"array must have at least one stop")),Sn},default:function(hn){return hn.validateSpec({key:hn.key,value:hn.value,valueSpec:U,validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec})}}});return ne==="identity"&&ht&&jt.push(new Me(Y.key,Y.value,'missing required property "property"')),ne==="identity"||Y.value.stops||jt.push(new Me(Y.key,Y.value,'missing required property "stops"')),ne==="exponential"&&Y.valueSpec.expression&&!pr(Y.valueSpec)&&jt.push(new Me(Y.key,Y.value,"exponential functions not supported")),Y.styleSpec.$version>=8&&(mt&&!Hl(Y.valueSpec)?jt.push(new Me(Y.key,Y.value,"property functions not supported")):ht&&!Gs(Y.valueSpec)&&jt.push(new Me(Y.key,Y.value,"zoom functions not supported"))),ne!=="categorical"&&!zt||Y.value.property!==void 0||jt.push(new Me(Y.key,Y.value,'"property" property is required')),jt;function Xt(hn){let Sn=[];const xn=hn.value,Nn=hn.key;if(Dr(xn)!=="array")return[new Me(Nn,xn,`array expected, ${Dr(xn)} found`)];if(xn.length!==2)return[new Me(Nn,xn,`array length 2 expected, length ${xn.length} found`)];if(zt){if(Dr(xn[0])!=="object")return[new Me(Nn,xn,`object expected, ${Dr(xn[0])} found`)];if(xn[0].zoom===void 0)return[new Me(Nn,xn,"object stop key must have zoom")];if(xn[0].value===void 0)return[new Me(Nn,xn,"object stop key must have value")];if(Ze&&Ze>Xa(xn[0].zoom))return[new Me(Nn,xn[0].zoom,"stop zoom values must appear in ascending order")];Xa(xn[0].zoom)!==Ze&&(Ze=Xa(xn[0].zoom),ze=void 0,Je={}),Sn=Sn.concat(ka({key:`${Nn}[0]`,value:xn[0],valueSpec:{zoom:{}},validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec,objectElementValidators:{zoom:Va,value:rn}}))}else Sn=Sn.concat(rn({key:`${Nn}[0]`,value:xn[0],valueSpec:{},validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec},xn));return Ws(Co(xn[1]))?Sn.concat([new Me(`${Nn}[1]`,xn[1],"expressions are not allowed in function stops.")]):Sn.concat(hn.validateSpec({key:`${Nn}[1]`,value:xn[1],valueSpec:U,validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec}))}function rn(hn,Sn){const xn=Dr(hn.value),Nn=Xa(hn.value),Gn=hn.value!==null?hn.value:Sn;if(pe){if(xn!==pe)return[new Me(hn.key,Gn,`${xn} stop domain type must match previous stop domain type ${pe}`)]}else pe=xn;if(xn!=="number"&&xn!=="string"&&xn!=="boolean")return[new Me(hn.key,Gn,"stop domain value must be a number, string, or boolean")];if(xn!=="number"&&ne!=="categorical"){let wr=`number expected, ${xn} found`;return Hl(U)&&ne===void 0&&(wr+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Me(hn.key,Gn,wr)]}return ne!=="categorical"||xn!=="number"||isFinite(Nn)&&Math.floor(Nn)===Nn?ne!=="categorical"&&xn==="number"&&ze!==void 0&&Nnnew Me(`${Y.key}${pe.key}`,Y.value,pe.message));const ne=U.value.expression||U.value._styleExpression.expression;if(Y.expressionContext==="property"&&Y.propertyKey==="text-font"&&!ne.outputDefined())return[new Me(Y.key,Y.value,`Invalid data expression for "${Y.propertyKey}". Output values must be contained as literals within the expression.`)];if(Y.expressionContext==="property"&&Y.propertyType==="layout"&&!nc(ne))return[new Me(Y.key,Y.value,'"feature-state" data expressions are not supported with layout properties.')];if(Y.expressionContext==="filter"&&!nc(ne))return[new Me(Y.key,Y.value,'"feature-state" data expressions are not supported with filters.')];if(Y.expressionContext&&Y.expressionContext.indexOf("cluster")===0){if(!rc(ne,["zoom","feature-state"]))return[new Me(Y.key,Y.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(Y.expressionContext==="cluster-initial"&&!tc(ne))return[new Me(Y.key,Y.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rl(Y){const U=Y.key,ne=Y.value,pe=Y.valueSpec,ze=[];return Array.isArray(pe.values)?pe.values.indexOf(Xa(ne))===-1&&ze.push(new Me(U,ne,`expected one of [${pe.values.join(", ")}], ${JSON.stringify(ne)} found`)):Object.keys(pe.values).indexOf(Xa(ne))===-1&&ze.push(new Me(U,ne,`expected one of [${Object.keys(pe.values).join(", ")}], ${JSON.stringify(ne)} found`)),ze}function xs(Y){return Ts(Co(Y.value))?cs(ke({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Zl(Y)}function Zl(Y){const U=Y.value,ne=Y.key;if(Dr(U)!=="array")return[new Me(ne,U,`array expected, ${Dr(U)} found`)];const pe=Y.styleSpec;let ze,Ze=[];if(U.length<1)return[new Me(ne,U,"filter array must have at least 1 element")];switch(Ze=Ze.concat(rl({key:`${ne}[0]`,value:U[0],valueSpec:pe.filter_operator,style:Y.style,styleSpec:Y.styleSpec})),Xa(U[0])){case"<":case"<=":case">":case">=":U.length>=2&&Xa(U[1])==="$type"&&Ze.push(new Me(ne,U,`"$type" cannot be use with operator "${U[0]}"`));case"==":case"!=":U.length!==3&&Ze.push(new Me(ne,U,`filter array for operator "${U[0]}" must have 3 elements`));case"in":case"!in":U.length>=2&&(ze=Dr(U[1]),ze!=="string"&&Ze.push(new Me(`${ne}[1]`,U[1],`string expected, ${ze} found`)));for(let Je=2;Je{zt in ne&&U.push(new Me(pe,ne[zt],`"${zt}" is prohibited for ref layers`))}),ze.layers.forEach(zt=>{Xa(zt.id)===ht&&(mt=zt)}),mt?mt.ref?U.push(new Me(pe,ne.ref,"ref cannot reference another ref layer")):Je=Xa(mt.type):U.push(new Me(pe,ne.ref,`ref layer "${ht}" not found`))}else if(Je!=="background")if(ne.source){const mt=ze.sources&&ze.sources[ne.source],zt=mt&&Xa(mt.type);mt?zt==="vector"&&Je==="raster"?U.push(new Me(pe,ne.source,`layer "${ne.id}" requires a raster source`)):zt!=="raster-dem"&&Je==="hillshade"?U.push(new Me(pe,ne.source,`layer "${ne.id}" requires a raster-dem source`)):zt==="raster"&&Je!=="raster"?U.push(new Me(pe,ne.source,`layer "${ne.id}" requires a vector source`)):zt!=="vector"||ne["source-layer"]?zt==="raster-dem"&&Je!=="hillshade"?U.push(new Me(pe,ne.source,"raster-dem source can only be used with layer type 'hillshade'.")):Je!=="line"||!ne.paint||!ne.paint["line-gradient"]||zt==="geojson"&&mt.lineMetrics||U.push(new Me(pe,ne,`layer "${ne.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):U.push(new Me(pe,ne,`layer "${ne.id}" must specify a "source-layer"`)):U.push(new Me(pe,ne.source,`source "${ne.source}" not found`))}else U.push(new Me(pe,ne,'missing required property "source"'));return U=U.concat(ka({key:pe,value:ne,valueSpec:Ze.layer,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,objectElementValidators:{"*"(){return[]},type(){return Y.validateSpec({key:`${pe}.type`,value:ne.type,valueSpec:Ze.layer.type,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,object:ne,objectKey:"type"})},filter:xs,layout(mt){return ka({layer:ne,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*"(zt){return ru(ke({layerType:Je},zt))}}})},paint(mt){return ka({layer:ne,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*"(zt){return yu(ke({layerType:Je},zt))}}})}}})),U}function Sa(Y){const U=Y.value,ne=Y.key,pe=Dr(U);return pe!=="string"?[new Me(ne,U,`string expected, ${pe} found`)]:[]}const ua={promoteId:function({key:Y,value:U}){if(Dr(U)==="string")return Sa({key:Y,value:U});{const ne=[];for(const pe in U)ne.push(...Sa({key:`${Y}.${pe}`,value:U[pe]}));return ne}}};function kl(Y){const U=Y.value,ne=Y.key,pe=Y.styleSpec,ze=Y.style,Ze=Y.validateSpec;if(!U.type)return[new Me(ne,U,'"type" is required')];const Je=Xa(U.type);let ht;switch(Je){case"vector":case"raster":return ht=ka({key:ne,value:U,valueSpec:pe[`source_${Je.replace("-","_")}`],style:Y.style,styleSpec:pe,objectElementValidators:ua,validateSpec:Ze}),ht;case"raster-dem":return ht=function(mt){var zt;const jt=(zt=mt.sourceName)!==null&&zt!==void 0?zt:"",Xt=mt.value,rn=mt.styleSpec,hn=rn.source_raster_dem,Sn=mt.style;let xn=[];const Nn=Dr(Xt);if(Xt===void 0)return xn;if(Nn!=="object")return xn.push(new Me("source_raster_dem",Xt,`object expected, ${Nn} found`)),xn;const Gn=Xa(Xt.encoding)==="custom",wr=["redFactor","greenFactor","blueFactor","baseShift"],or=mt.value.encoding?`"${mt.value.encoding}"`:"Default";for(const gr in Xt)!Gn&&wr.includes(gr)?xn.push(new Me(gr,Xt[gr],`In "${jt}": "${gr}" is only valid when "encoding" is set to "custom". ${or} encoding found`)):hn[gr]?xn=xn.concat(mt.validateSpec({key:gr,value:Xt[gr],valueSpec:hn[gr],validateSpec:mt.validateSpec,style:Sn,styleSpec:rn})):xn.push(new Me(gr,Xt[gr],`unknown property "${gr}"`));return xn}({sourceName:ne,value:U,style:Y.style,styleSpec:pe,validateSpec:Ze}),ht;case"geojson":if(ht=ka({key:ne,value:U,valueSpec:pe.source_geojson,style:ze,styleSpec:pe,validateSpec:Ze,objectElementValidators:ua}),U.cluster)for(const mt in U.clusterProperties){const[zt,jt]=U.clusterProperties[mt],Xt=typeof zt=="string"?[zt,["accumulated"],["get",mt]]:zt;ht.push(...cs({key:`${ne}.${mt}.map`,value:jt,validateSpec:Ze,expressionContext:"cluster-map"})),ht.push(...cs({key:`${ne}.${mt}.reduce`,value:Xt,validateSpec:Ze,expressionContext:"cluster-reduce"}))}return ht;case"video":return ka({key:ne,value:U,valueSpec:pe.source_video,style:ze,validateSpec:Ze,styleSpec:pe});case"image":return ka({key:ne,value:U,valueSpec:pe.source_image,style:ze,validateSpec:Ze,styleSpec:pe});case"canvas":return[new Me(ne,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rl({key:`${ne}.type`,value:U.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:ze,validateSpec:Ze,styleSpec:pe})}}function Mi(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.light,ze=Y.style;let Ze=[];const Je=Dr(U);if(U===void 0)return Ze;if(Je!=="object")return Ze=Ze.concat([new Me("light",U,`object expected, ${Je} found`)]),Ze;for(const ht in U){const mt=ht.match(/^(.*)-transition$/);Ze=mt&&pe[mt[1]]&&pe[mt[1]].transition?Ze.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:ne.transition,validateSpec:Y.validateSpec,style:ze,styleSpec:ne})):pe[ht]?Ze.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],validateSpec:Y.validateSpec,style:ze,styleSpec:ne})):Ze.concat([new Me(ht,U[ht],`unknown property "${ht}"`)])}return Ze}function Hu(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.sky,ze=Y.style,Ze=Dr(U);if(U===void 0)return[];if(Ze!=="object")return[new Me("sky",U,`object expected, ${Ze} found`)];let Je=[];for(const ht in U)Je=pe[ht]?Je.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],style:ze,styleSpec:ne})):Je.concat([new Me(ht,U[ht],`unknown property "${ht}"`)]);return Je}function Ac(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.terrain,ze=Y.style;let Ze=[];const Je=Dr(U);if(U===void 0)return Ze;if(Je!=="object")return Ze=Ze.concat([new Me("terrain",U,`object expected, ${Je} found`)]),Ze;for(const ht in U)Ze=pe[ht]?Ze.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],validateSpec:Y.validateSpec,style:ze,styleSpec:ne})):Ze.concat([new Me(ht,U[ht],`unknown property "${ht}"`)]);return Ze}function Al(Y){let U=[];const ne=Y.value,pe=Y.key;if(Array.isArray(ne)){const ze=[],Ze=[];for(const Je in ne){ne[Je].id&&ze.includes(ne[Je].id)&&U.push(new Me(pe,ne,`all the sprites' ids must be unique, but ${ne[Je].id} is duplicated`)),ze.push(ne[Je].id),ne[Je].url&&Ze.includes(ne[Je].url)&&U.push(new Me(pe,ne,`all the sprites' URLs must be unique, but ${ne[Je].url} is duplicated`)),Ze.push(ne[Je].url);const ht={id:{type:"string",required:!0},url:{type:"string",required:!0}};U=U.concat(ka({key:`${pe}[${Je}]`,value:ne[Je],valueSpec:ht,validateSpec:Y.validateSpec}))}return U}return Sa({key:pe,value:ne})}const il={"*"(){return[]},array:Ao,boolean:function(Y){const U=Y.value,ne=Y.key,pe=Dr(U);return pe!=="boolean"?[new Me(ne,U,`boolean expected, ${pe} found`)]:[]},number:Va,color:function(Y){const U=Y.key,ne=Y.value,pe=Dr(ne);return pe!=="string"?[new Me(U,ne,`color expected, ${pe} found`)]:un.parse(String(ne))?[]:[new Me(U,ne,`color expected, "${ne}" found`)]},constants:Xo,enum:rl,filter:xs,function:Ko,layer:Tl,object:ka,source:kl,light:Mi,sky:Hu,terrain:Ac,projection:function(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.projection,ze=Y.style,Ze=Dr(U);if(U===void 0)return[];if(Ze!=="object")return[new Me("projection",U,`object expected, ${Ze} found`)];let Je=[];for(const ht in U)Je=pe[ht]?Je.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],style:ze,styleSpec:ne})):Je.concat([new Me(ht,U[ht],`unknown property "${ht}"`)]);return Je},string:Sa,formatted:function(Y){return Sa(Y).length===0?[]:cs(Y)},resolvedImage:function(Y){return Sa(Y).length===0?[]:cs(Y)},padding:function(Y){const U=Y.key,ne=Y.value;if(Dr(ne)==="array"){if(ne.length<1||ne.length>4)return[new Me(U,ne,`padding requires 1 to 4 values; ${ne.length} values found`)];const pe={type:"number"};let ze=[];for(let Ze=0;ZeU.line-ne.line)}function Na(Y){return function(...U){return al(Y.apply(this,U))}}li.source=Na(hs(kl)),li.sprite=Na(hs(Al)),li.glyphs=Na(hs(Ml)),li.light=Na(hs(Mi)),li.sky=Na(hs(Hu)),li.terrain=Na(hs(Ac)),li.layer=Na(hs(Tl)),li.filter=Na(hs(xs)),li.paintProperty=Na(hs(yu)),li.layoutProperty=Na(hs(ru));const Ns=li;Ns.source;const iu=Ns.light,El=Ns.sky;Ns.terrain,Ns.filter;const ks=Ns.paintProperty,au=Ns.layoutProperty;function As(Y,U){let ne=!1;if(U&&U.length)for(const pe of U)Y.fire(new ge(new Error(pe.message))),ne=!0;return ne}class Jo{constructor(U,ne,pe){const ze=this.cells=[];if(U instanceof ArrayBuffer){this.arrayBuffer=U;const Je=new Int32Array(this.arrayBuffer);U=Je[0],ne=Je[1],pe=Je[2],this.d=ne+2*pe;for(let zt=0;zt=Xt[Sn+0]&&ze>=Xt[Sn+1])?(ht[hn]=!0,Je.push(jt[hn])):ht[hn]=!1}}}}_forEachCell(U,ne,pe,ze,Ze,Je,ht,mt){const zt=this._convertToCellCoord(U),jt=this._convertToCellCoord(ne),Xt=this._convertToCellCoord(pe),rn=this._convertToCellCoord(ze);for(let hn=zt;hn<=Xt;hn++)for(let Sn=jt;Sn<=rn;Sn++){const xn=this.d*Sn+hn;if((!mt||mt(this._convertFromCellCoord(hn),this._convertFromCellCoord(Sn),this._convertFromCellCoord(hn+1),this._convertFromCellCoord(Sn+1)))&&Ze.call(this,U,ne,pe,ze,xn,Je,ht,mt))return}}_convertFromCellCoord(U){return(U-this.padding)/this.scale}_convertToCellCoord(U){return Math.max(0,Math.min(this.d-1,Math.floor(U*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const U=this.cells,ne=3+this.cells.length+1+1;let pe=0;for(let Je=0;Je=0)continue;const Je=Y[Ze];ze[Ze]=ol[ne].shallow.indexOf(Ze)>=0?Je:ta(Je,U)}Y instanceof Error&&(ze.message=Y.message)}if(ze.$name)throw new Error("$name property is reserved for worker serialization logic.");return ne!=="Object"&&(ze.$name=ne),ze}function Qo(Y){if(io(Y))return Y;if(Array.isArray(Y))return Y.map(Qo);if(typeof Y!="object")throw new Error("can't deserialize object of type "+typeof Y);const U=So(Y)||"Object";if(!ol[U])throw new Error(`can't deserialize unregistered class ${U}`);const{klass:ne}=ol[U];if(!ne)throw new Error(`can't deserialize unregistered class ${U}`);if(ne.deserialize)return ne.deserialize(Y);const pe=Object.create(ne.prototype);for(const ze of Object.keys(Y)){if(ze==="$name")continue;const Ze=Y[ze];pe[ze]=ol[U].shallow.indexOf(ze)>=0?Ze:Qo(Ze)}return pe}class ac{constructor(){this.first=!0}update(U,ne){const pe=Math.floor(U);return this.first?(this.first=!1,this.lastIntegerZoom=pe,this.lastIntegerZoomTime=0,this.lastZoom=U,this.lastFloorZoom=pe,!0):(this.lastFloorZoom>pe?(this.lastIntegerZoom=pe+1,this.lastIntegerZoomTime=ne):this.lastFloorZoomY>=128&&Y<=255,Arabic:Y=>Y>=1536&&Y<=1791,"Arabic Supplement":Y=>Y>=1872&&Y<=1919,"Arabic Extended-A":Y=>Y>=2208&&Y<=2303,"Hangul Jamo":Y=>Y>=4352&&Y<=4607,"Unified Canadian Aboriginal Syllabics":Y=>Y>=5120&&Y<=5759,Khmer:Y=>Y>=6016&&Y<=6143,"Unified Canadian Aboriginal Syllabics Extended":Y=>Y>=6320&&Y<=6399,"General Punctuation":Y=>Y>=8192&&Y<=8303,"Letterlike Symbols":Y=>Y>=8448&&Y<=8527,"Number Forms":Y=>Y>=8528&&Y<=8591,"Miscellaneous Technical":Y=>Y>=8960&&Y<=9215,"Control Pictures":Y=>Y>=9216&&Y<=9279,"Optical Character Recognition":Y=>Y>=9280&&Y<=9311,"Enclosed Alphanumerics":Y=>Y>=9312&&Y<=9471,"Geometric Shapes":Y=>Y>=9632&&Y<=9727,"Miscellaneous Symbols":Y=>Y>=9728&&Y<=9983,"Miscellaneous Symbols and Arrows":Y=>Y>=11008&&Y<=11263,"CJK Radicals Supplement":Y=>Y>=11904&&Y<=12031,"Kangxi Radicals":Y=>Y>=12032&&Y<=12255,"Ideographic Description Characters":Y=>Y>=12272&&Y<=12287,"CJK Symbols and Punctuation":Y=>Y>=12288&&Y<=12351,Hiragana:Y=>Y>=12352&&Y<=12447,Katakana:Y=>Y>=12448&&Y<=12543,Bopomofo:Y=>Y>=12544&&Y<=12591,"Hangul Compatibility Jamo":Y=>Y>=12592&&Y<=12687,Kanbun:Y=>Y>=12688&&Y<=12703,"Bopomofo Extended":Y=>Y>=12704&&Y<=12735,"CJK Strokes":Y=>Y>=12736&&Y<=12783,"Katakana Phonetic Extensions":Y=>Y>=12784&&Y<=12799,"Enclosed CJK Letters and Months":Y=>Y>=12800&&Y<=13055,"CJK Compatibility":Y=>Y>=13056&&Y<=13311,"CJK Unified Ideographs Extension A":Y=>Y>=13312&&Y<=19903,"Yijing Hexagram Symbols":Y=>Y>=19904&&Y<=19967,"CJK Unified Ideographs":Y=>Y>=19968&&Y<=40959,"Yi Syllables":Y=>Y>=40960&&Y<=42127,"Yi Radicals":Y=>Y>=42128&&Y<=42191,"Hangul Jamo Extended-A":Y=>Y>=43360&&Y<=43391,"Hangul Syllables":Y=>Y>=44032&&Y<=55215,"Hangul Jamo Extended-B":Y=>Y>=55216&&Y<=55295,"Private Use Area":Y=>Y>=57344&&Y<=63743,"CJK Compatibility Ideographs":Y=>Y>=63744&&Y<=64255,"Arabic Presentation Forms-A":Y=>Y>=64336&&Y<=65023,"Vertical Forms":Y=>Y>=65040&&Y<=65055,"CJK Compatibility Forms":Y=>Y>=65072&&Y<=65103,"Small Form Variants":Y=>Y>=65104&&Y<=65135,"Arabic Presentation Forms-B":Y=>Y>=65136&&Y<=65279,"Halfwidth and Fullwidth Forms":Y=>Y>=65280&&Y<=65519};function Io(Y){for(const U of Y)if(sl(U.charCodeAt(0)))return!0;return!1}function za(Y){for(const U of Y)if(!xu(U.charCodeAt(0)))return!1;return!0}function xu(Y){return!(yi.Arabic(Y)||yi["Arabic Supplement"](Y)||yi["Arabic Extended-A"](Y)||yi["Arabic Presentation Forms-A"](Y)||yi["Arabic Presentation Forms-B"](Y))}function sl(Y){return!(Y!==746&&Y!==747&&(Y<4352||!(yi["Bopomofo Extended"](Y)||yi.Bopomofo(Y)||yi["CJK Compatibility Forms"](Y)&&!(Y>=65097&&Y<=65103)||yi["CJK Compatibility Ideographs"](Y)||yi["CJK Compatibility"](Y)||yi["CJK Radicals Supplement"](Y)||yi["CJK Strokes"](Y)||!(!yi["CJK Symbols and Punctuation"](Y)||Y>=12296&&Y<=12305||Y>=12308&&Y<=12319||Y===12336)||yi["CJK Unified Ideographs Extension A"](Y)||yi["CJK Unified Ideographs"](Y)||yi["Enclosed CJK Letters and Months"](Y)||yi["Hangul Compatibility Jamo"](Y)||yi["Hangul Jamo Extended-A"](Y)||yi["Hangul Jamo Extended-B"](Y)||yi["Hangul Jamo"](Y)||yi["Hangul Syllables"](Y)||yi.Hiragana(Y)||yi["Ideographic Description Characters"](Y)||yi.Kanbun(Y)||yi["Kangxi Radicals"](Y)||yi["Katakana Phonetic Extensions"](Y)||yi.Katakana(Y)&&Y!==12540||!(!yi["Halfwidth and Fullwidth Forms"](Y)||Y===65288||Y===65289||Y===65293||Y>=65306&&Y<=65310||Y===65339||Y===65341||Y===65343||Y>=65371&&Y<=65503||Y===65507||Y>=65512&&Y<=65519)||!(!yi["Small Form Variants"](Y)||Y>=65112&&Y<=65118||Y>=65123&&Y<=65126)||yi["Unified Canadian Aboriginal Syllabics"](Y)||yi["Unified Canadian Aboriginal Syllabics Extended"](Y)||yi["Vertical Forms"](Y)||yi["Yijing Hexagram Symbols"](Y)||yi["Yi Syllables"](Y)||yi["Yi Radicals"](Y))))}function $l(Y){return!(sl(Y)||function(U){return!!(yi["Latin-1 Supplement"](U)&&(U===167||U===169||U===174||U===177||U===188||U===189||U===190||U===215||U===247)||yi["General Punctuation"](U)&&(U===8214||U===8224||U===8225||U===8240||U===8241||U===8251||U===8252||U===8258||U===8263||U===8264||U===8265||U===8273)||yi["Letterlike Symbols"](U)||yi["Number Forms"](U)||yi["Miscellaneous Technical"](U)&&(U>=8960&&U<=8967||U>=8972&&U<=8991||U>=8996&&U<=9e3||U===9003||U>=9085&&U<=9114||U>=9150&&U<=9165||U===9167||U>=9169&&U<=9179||U>=9186&&U<=9215)||yi["Control Pictures"](U)&&U!==9251||yi["Optical Character Recognition"](U)||yi["Enclosed Alphanumerics"](U)||yi["Geometric Shapes"](U)||yi["Miscellaneous Symbols"](U)&&!(U>=9754&&U<=9759)||yi["Miscellaneous Symbols and Arrows"](U)&&(U>=11026&&U<=11055||U>=11088&&U<=11097||U>=11192&&U<=11243)||yi["CJK Symbols and Punctuation"](U)||yi.Katakana(U)||yi["Private Use Area"](U)||yi["CJK Compatibility Forms"](U)||yi["Small Form Variants"](U)||yi["Halfwidth and Fullwidth Forms"](U)||U===8734||U===8756||U===8757||U>=9984&&U<=10087||U>=10102&&U<=10131||U===65532||U===65533)}(Y))}function dc(Y){return yi.Arabic(Y)||yi["Arabic Supplement"](Y)||yi["Arabic Extended-A"](Y)||yi["Arabic Presentation Forms-A"](Y)||yi["Arabic Presentation Forms-B"](Y)}function $s(Y){return Y>=1424&&Y<=2303||yi["Arabic Presentation Forms-A"](Y)||yi["Arabic Presentation Forms-B"](Y)}function ou(Y,U){return!(!U&&$s(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||yi.Khmer(Y))}function eo(Y){for(const U of Y)if($s(U.charCodeAt(0)))return!0;return!1}const Cl=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(Y){this.pluginStatus=Y.pluginStatus,this.pluginURL=Y.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(Y){this.applyArabicShaping=Y.applyArabicShaping,this.processBidirectionalText=Y.processBidirectionalText,this.processStyledBidirectionalText=Y.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class di{constructor(U,ne){this.zoom=U,ne?(this.now=ne.now,this.fadeDuration=ne.fadeDuration,this.zoomHistory=ne.zoomHistory,this.transition=ne.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ac,this.transition={})}isSupportedScript(U){return function(ne,pe){for(const ze of ne)if(!ou(ze.charCodeAt(0),pe))return!1;return!0}(U,Cl.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const U=this.zoom,ne=U-Math.floor(U),pe=this.crossFadingFactor();return U>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:ne+(1-ne)*pe}:{fromScale:.5,toScale:1,t:1-(1-pe)*ne}}}class Fi{constructor(U,ne){this.property=U,this.value=ne,this.expression=function(pe,ze){if(Zr(pe))return new ba(pe,ze);if(Ws(pe)){const Ze=La(pe,ze);if(Ze.result==="error")throw new Error(Ze.value.map(Je=>`${Je.key}: ${Je.message}`).join(", "));return Ze.value}{let Ze=pe;return ze.type==="color"&&typeof pe=="string"?Ze=un.parse(pe):ze.type!=="padding"||typeof pe!="number"&&!Array.isArray(pe)?ze.type==="variableAnchorOffsetCollection"&&Array.isArray(pe)&&(Ze=Kn.parse(pe)):Ze=mn.parse(pe),{kind:"constant",evaluate:()=>Ze}}}(ne===void 0?U.specification.default:ne,U.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(U,ne,pe){return this.property.possiblyEvaluate(this,U,ne,pe)}}class Mo{constructor(U){this.property=U,this.value=new Fi(U,void 0)}transitioned(U,ne){return new su(this.property,this.value,ne,A({},U.transition,this.transition),U.now)}untransitioned(){return new su(this.property,this.value,null,{},0)}}class Il{constructor(U){this._properties=U,this._values=Object.create(U.defaultTransitionablePropertyValues)}getValue(U){return p(this._values[U].value.value)}setValue(U,ne){Object.prototype.hasOwnProperty.call(this._values,U)||(this._values[U]=new Mo(this._values[U].property)),this._values[U].value=new Fi(this._values[U].property,ne===null?void 0:p(ne))}getTransition(U){return p(this._values[U].transition)}setTransition(U,ne){Object.prototype.hasOwnProperty.call(this._values,U)||(this._values[U]=new Mo(this._values[U].property)),this._values[U].transition=p(ne)||void 0}serialize(){const U={};for(const ne of Object.keys(this._values)){const pe=this.getValue(ne);pe!==void 0&&(U[ne]=pe);const ze=this.getTransition(ne);ze!==void 0&&(U[`${ne}-transition`]=ze)}return U}transitioned(U,ne){const pe=new ho(this._properties);for(const ze of Object.keys(this._values))pe._values[ze]=this._values[ze].transitioned(U,ne._values[ze]);return pe}untransitioned(){const U=new ho(this._properties);for(const ne of Object.keys(this._values))U._values[ne]=this._values[ne].untransitioned();return U}}class su{constructor(U,ne,pe,ze,Ze){this.property=U,this.value=ne,this.begin=Ze+ze.delay||0,this.end=this.begin+ze.duration||0,U.specification.transition&&(ze.delay||ze.duration)&&(this.prior=pe)}possiblyEvaluate(U,ne,pe){const ze=U.now||0,Ze=this.value.possiblyEvaluate(U,ne,pe),Je=this.prior;if(Je){if(ze>this.end)return this.prior=null,Ze;if(this.value.isDataDriven())return this.prior=null,Ze;if(ze=1)return 1;const zt=mt*mt,jt=zt*mt;return 4*(mt<.5?jt:3*(mt-zt)+jt-.75)}(ht))}}return Ze}}class ho{constructor(U){this._properties=U,this._values=Object.create(U.defaultTransitioningPropertyValues)}possiblyEvaluate(U,ne,pe){const ze=new Ys(this._properties);for(const Ze of Object.keys(this._values))ze._values[Ze]=this._values[Ze].possiblyEvaluate(U,ne,pe);return ze}hasTransition(){for(const U of Object.keys(this._values))if(this._values[U].prior)return!0;return!1}}class _u{constructor(U){this._properties=U,this._values=Object.create(U.defaultPropertyValues)}hasValue(U){return this._values[U].value!==void 0}getValue(U){return p(this._values[U].value)}setValue(U,ne){this._values[U]=new Fi(this._values[U].property,ne===null?void 0:p(ne))}serialize(){const U={};for(const ne of Object.keys(this._values)){const pe=this.getValue(ne);pe!==void 0&&(U[ne]=pe)}return U}possiblyEvaluate(U,ne,pe){const ze=new Ys(this._properties);for(const Ze of Object.keys(this._values))ze._values[Ze]=this._values[Ze].possiblyEvaluate(U,ne,pe);return ze}}class da{constructor(U,ne,pe){this.property=U,this.value=ne,this.parameters=pe}isConstant(){return this.value.kind==="constant"}constantOr(U){return this.value.kind==="constant"?this.value.value:U}evaluate(U,ne,pe,ze){return this.property.evaluate(this.value,this.parameters,U,ne,pe,ze)}}class Ys{constructor(U){this._properties=U,this._values=Object.create(U.defaultPossiblyEvaluatedValues)}get(U){return this._values[U]}}class Ai{constructor(U){this.specification=U}possiblyEvaluate(U,ne){if(U.isDataDriven())throw new Error("Value should not be data driven");return U.expression.evaluate(ne)}interpolate(U,ne,pe){const ze=this.specification.type,Ze=gn[ze];return Ze?Ze(U,ne,pe):U}}class xi{constructor(U,ne){this.specification=U,this.overrides=ne}possiblyEvaluate(U,ne,pe,ze){return U.expression.kind==="constant"||U.expression.kind==="camera"?new da(this,{kind:"constant",value:U.expression.evaluate(ne,null,{},pe,ze)},ne):new da(this,U.expression,ne)}interpolate(U,ne,pe){if(U.value.kind!=="constant"||ne.value.kind!=="constant")return U;if(U.value.value===void 0||ne.value.value===void 0)return new da(this,{kind:"constant",value:void 0},U.parameters);const ze=this.specification.type,Ze=gn[ze];if(Ze){const Je=Ze(U.value.value,ne.value.value,pe);return new da(this,{kind:"constant",value:Je},U.parameters)}return U}evaluate(U,ne,pe,ze,Ze,Je){return U.kind==="constant"?U.value:U.evaluate(ne,pe,ze,Ze,Je)}}class xa extends xi{possiblyEvaluate(U,ne,pe,ze){if(U.value===void 0)return new da(this,{kind:"constant",value:void 0},ne);if(U.expression.kind==="constant"){const Ze=U.expression.evaluate(ne,null,{},pe,ze),Je=U.property.specification.type==="resolvedImage"&&typeof Ze!="string"?Ze.name:Ze,ht=this._calculate(Je,Je,Je,ne);return new da(this,{kind:"constant",value:ht},ne)}if(U.expression.kind==="camera"){const Ze=this._calculate(U.expression.evaluate({zoom:ne.zoom-1}),U.expression.evaluate({zoom:ne.zoom}),U.expression.evaluate({zoom:ne.zoom+1}),ne);return new da(this,{kind:"constant",value:Ze},ne)}return new da(this,U.expression,ne)}evaluate(U,ne,pe,ze,Ze,Je){if(U.kind==="source"){const ht=U.evaluate(ne,pe,ze,Ze,Je);return this._calculate(ht,ht,ht,ne)}return U.kind==="composite"?this._calculate(U.evaluate({zoom:Math.floor(ne.zoom)-1},pe,ze),U.evaluate({zoom:Math.floor(ne.zoom)},pe,ze),U.evaluate({zoom:Math.floor(ne.zoom)+1},pe,ze),ne):U.value}_calculate(U,ne,pe,ze){return ze.zoom>ze.zoomHistory.lastIntegerZoom?{from:U,to:ne}:{from:pe,to:ne}}interpolate(U){return U}}class es{constructor(U){this.specification=U}possiblyEvaluate(U,ne,pe,ze){if(U.value!==void 0){if(U.expression.kind==="constant"){const Ze=U.expression.evaluate(ne,null,{},pe,ze);return this._calculate(Ze,Ze,Ze,ne)}return this._calculate(U.expression.evaluate(new di(Math.floor(ne.zoom-1),ne)),U.expression.evaluate(new di(Math.floor(ne.zoom),ne)),U.expression.evaluate(new di(Math.floor(ne.zoom+1),ne)),ne)}}_calculate(U,ne,pe,ze){return ze.zoom>ze.zoomHistory.lastIntegerZoom?{from:U,to:ne}:{from:pe,to:ne}}interpolate(U){return U}}class bu{constructor(U){this.specification=U}possiblyEvaluate(U,ne,pe,ze){return!!U.expression.evaluate(ne,null,{},pe,ze)}interpolate(){return!1}}class js{constructor(U){this.properties=U,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const ne in U){const pe=U[ne];pe.specification.overridable&&this.overridableProperties.push(ne);const ze=this.defaultPropertyValues[ne]=new Fi(pe,void 0),Ze=this.defaultTransitionablePropertyValues[ne]=new Mo(pe);this.defaultTransitioningPropertyValues[ne]=Ze.untransitioned(),this.defaultPossiblyEvaluatedValues[ne]=ze.possiblyEvaluate({})}}}cn("DataDrivenProperty",xi),cn("DataConstantProperty",Ai),cn("CrossFadedDataDrivenProperty",xa),cn("CrossFadedProperty",es),cn("ColorRampProperty",bu);const xt="-transition";class kt extends ye{constructor(U,ne){if(super(),this.id=U.id,this.type=U.type,this._featureFilter={filter:()=>!0,needGeometry:!1},U.type!=="custom"&&(this.metadata=U.metadata,this.minzoom=U.minzoom,this.maxzoom=U.maxzoom,U.type!=="background"&&(this.source=U.source,this.sourceLayer=U["source-layer"],this.filter=U.filter),ne.layout&&(this._unevaluatedLayout=new _u(ne.layout)),ne.paint)){this._transitionablePaint=new Il(ne.paint);for(const pe in U.paint)this.setPaintProperty(pe,U.paint[pe],{validate:!1});for(const pe in U.layout)this.setLayoutProperty(pe,U.layout[pe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ys(ne.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(U){return U==="visibility"?this.visibility:this._unevaluatedLayout.getValue(U)}setLayoutProperty(U,ne,pe={}){if(ne!=null){const ze=`layers.${this.id}.layout.${U}`;if(this._validate(au,ze,U,ne,pe))return}U!=="visibility"?this._unevaluatedLayout.setValue(U,ne):this.visibility=ne}getPaintProperty(U){return U.endsWith(xt)?this._transitionablePaint.getTransition(U.slice(0,-11)):this._transitionablePaint.getValue(U)}setPaintProperty(U,ne,pe={}){if(ne!=null){const ze=`layers.${this.id}.paint.${U}`;if(this._validate(ks,ze,U,ne,pe))return!1}if(U.endsWith(xt))return this._transitionablePaint.setTransition(U.slice(0,-11),ne||void 0),!1;{const ze=this._transitionablePaint._values[U],Ze=ze.property.specification["property-type"]==="cross-faded-data-driven",Je=ze.value.isDataDriven(),ht=ze.value;this._transitionablePaint.setValue(U,ne),this._handleSpecialPaintPropertyUpdate(U);const mt=this._transitionablePaint._values[U].value;return mt.isDataDriven()||Je||Ze||this._handleOverridablePaintPropertyUpdate(U,ht,mt)}}_handleSpecialPaintPropertyUpdate(U){}_handleOverridablePaintPropertyUpdate(U,ne,pe){return!1}isHidden(U){return!!(this.minzoom&&U=this.maxzoom)||this.visibility==="none"}updateTransitions(U){this._transitioningPaint=this._transitionablePaint.transitioned(U,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(U,ne){U.getCrossfadeParameters&&(this._crossfadeParameters=U.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(U,void 0,ne)),this.paint=this._transitioningPaint.possiblyEvaluate(U,void 0,ne)}serialize(){const U={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&&(U.layout=U.layout||{},U.layout.visibility=this.visibility),T(U,(ne,pe)=>!(ne===void 0||pe==="layout"&&!Object.keys(ne).length||pe==="paint"&&!Object.keys(ne).length))}_validate(U,ne,pe,ze,Ze={}){return(!Ze||Ze.validate!==!1)&&As(this,U.call(Ns,{key:ne,layerType:this.type,objectKey:pe,value:ze,styleSpec:me,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const U in this.paint._values){const ne=this.paint.get(U);if(ne instanceof da&&Hl(ne.property.specification)&&(ne.value.kind==="source"||ne.value.kind==="composite")&&ne.value.isStateDependent)return!0}return!1}}const Dt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class X{constructor(U,ne){this._structArray=U,this._pos1=ne*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class R{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(U,ne){return U._trim(),ne&&(U.isTransferred=!0,ne.push(U.arrayBuffer)),{length:U.length,arrayBuffer:U.arrayBuffer}}static deserialize(U){const ne=Object.create(this.prototype);return ne.arrayBuffer=U.arrayBuffer,ne.length=U.length,ne.capacity=U.arrayBuffer.byteLength/ne.bytesPerElement,ne._refreshViews(),ne}_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(U){this.reserve(U),this.length=U}reserve(U){if(U>this.capacity){this.capacity=Math.max(U,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const ne=this.uint8;this._refreshViews(),ne&&this.uint8.set(ne)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function i(Y,U=1){let ne=0,pe=0;return{members:Y.map(ze=>{const Ze=(mt=ze.type,Dt[mt].BYTES_PER_ELEMENT),Je=ne=a(ne,Math.max(U,Ze)),ht=ze.components||1;var mt;return pe=Math.max(pe,Ze),ne+=Ze*ht,{name:ze.name,type:ze.type,components:ht,offset:Je}}),size:a(ne,Math.max(pe,U)),alignment:U}}function a(Y,U){return Math.ceil(Y/U)*U}class C extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne){const pe=this.length;return this.resize(pe+1),this.emplace(pe,U,ne)}emplace(U,ne,pe){const ze=2*U;return this.int16[ze+0]=ne,this.int16[ze+1]=pe,U}}C.prototype.bytesPerElement=4,cn("StructArrayLayout2i4",C);class F extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=3*U;return this.int16[Ze+0]=ne,this.int16[Ze+1]=pe,this.int16[Ze+2]=ze,U}}F.prototype.bytesPerElement=6,cn("StructArrayLayout3i6",F);class q extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze){const Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,U,ne,pe,ze)}emplace(U,ne,pe,ze,Ze){const Je=4*U;return this.int16[Je+0]=ne,this.int16[Je+1]=pe,this.int16[Je+2]=ze,this.int16[Je+3]=Ze,U}}q.prototype.bytesPerElement=8,cn("StructArrayLayout4i8",q);class te extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=6*U;return this.int16[mt+0]=ne,this.int16[mt+1]=pe,this.int16[mt+2]=ze,this.int16[mt+3]=Ze,this.int16[mt+4]=Je,this.int16[mt+5]=ht,U}}te.prototype.bytesPerElement=12,cn("StructArrayLayout2i4i12",te);class ue extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=4*U,zt=8*U;return this.int16[mt+0]=ne,this.int16[mt+1]=pe,this.uint8[zt+4]=ze,this.uint8[zt+5]=Ze,this.uint8[zt+6]=Je,this.uint8[zt+7]=ht,U}}ue.prototype.bytesPerElement=8,cn("StructArrayLayout2i4ub8",ue);class ve extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne){const pe=this.length;return this.resize(pe+1),this.emplace(pe,U,ne)}emplace(U,ne,pe){const ze=2*U;return this.float32[ze+0]=ne,this.float32[ze+1]=pe,U}}ve.prototype.bytesPerElement=8,cn("StructArrayLayout2f8",ve);class Ae extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt){const rn=10*U;return this.uint16[rn+0]=ne,this.uint16[rn+1]=pe,this.uint16[rn+2]=ze,this.uint16[rn+3]=Ze,this.uint16[rn+4]=Je,this.uint16[rn+5]=ht,this.uint16[rn+6]=mt,this.uint16[rn+7]=zt,this.uint16[rn+8]=jt,this.uint16[rn+9]=Xt,U}}Ae.prototype.bytesPerElement=20,cn("StructArrayLayout10ui20",Ae);class Re extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn){const hn=this.length;return this.resize(hn+1),this.emplace(hn,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn){const Sn=12*U;return this.int16[Sn+0]=ne,this.int16[Sn+1]=pe,this.int16[Sn+2]=ze,this.int16[Sn+3]=Ze,this.uint16[Sn+4]=Je,this.uint16[Sn+5]=ht,this.uint16[Sn+6]=mt,this.uint16[Sn+7]=zt,this.int16[Sn+8]=jt,this.int16[Sn+9]=Xt,this.int16[Sn+10]=rn,this.int16[Sn+11]=hn,U}}Re.prototype.bytesPerElement=24,cn("StructArrayLayout4i4ui4i24",Re);class Ue extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=3*U;return this.float32[Ze+0]=ne,this.float32[Ze+1]=pe,this.float32[Ze+2]=ze,U}}Ue.prototype.bytesPerElement=12,cn("StructArrayLayout3f12",Ue);class it extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(U){const ne=this.length;return this.resize(ne+1),this.emplace(ne,U)}emplace(U,ne){const pe=1*U;return this.uint32[pe+0]=ne,U}}it.prototype.bytesPerElement=4,cn("StructArrayLayout1ul4",it);class ct extends R{_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(U,ne,pe,ze,Ze,Je,ht,mt,zt){const jt=this.length;return this.resize(jt+1),this.emplace(jt,U,ne,pe,ze,Ze,Je,ht,mt,zt)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt){const Xt=10*U,rn=5*U;return this.int16[Xt+0]=ne,this.int16[Xt+1]=pe,this.int16[Xt+2]=ze,this.int16[Xt+3]=Ze,this.int16[Xt+4]=Je,this.int16[Xt+5]=ht,this.uint32[rn+3]=mt,this.uint16[Xt+8]=zt,this.uint16[Xt+9]=jt,U}}ct.prototype.bytesPerElement=20,cn("StructArrayLayout6i1ul2ui20",ct);class dt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=6*U;return this.int16[mt+0]=ne,this.int16[mt+1]=pe,this.int16[mt+2]=ze,this.int16[mt+3]=Ze,this.int16[mt+4]=Je,this.int16[mt+5]=ht,U}}dt.prototype.bytesPerElement=12,cn("StructArrayLayout2i2i2i12",dt);class bt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze){const Je=this.length;return this.resize(Je+1),this.emplace(Je,U,ne,pe,ze,Ze)}emplace(U,ne,pe,ze,Ze,Je){const ht=4*U,mt=8*U;return this.float32[ht+0]=ne,this.float32[ht+1]=pe,this.float32[ht+2]=ze,this.int16[mt+6]=Ze,this.int16[mt+7]=Je,U}}bt.prototype.bytesPerElement=16,cn("StructArrayLayout2f1f2i16",bt);class Ct extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=16*U,zt=4*U,jt=8*U;return this.uint8[mt+0]=ne,this.uint8[mt+1]=pe,this.float32[zt+1]=ze,this.float32[zt+2]=Ze,this.int16[jt+6]=Je,this.int16[jt+7]=ht,U}}Ct.prototype.bytesPerElement=16,cn("StructArrayLayout2ub2f2i16",Ct);class Mt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=3*U;return this.uint16[Ze+0]=ne,this.uint16[Ze+1]=pe,this.uint16[Ze+2]=ze,U}}Mt.prototype.bytesPerElement=6,cn("StructArrayLayout3ui6",Mt);class Vt extends R{_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(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn,Gn){const wr=this.length;return this.resize(wr+1),this.emplace(wr,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn,Gn)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn,Gn,wr){const or=24*U,gr=12*U,Wr=48*U;return this.int16[or+0]=ne,this.int16[or+1]=pe,this.uint16[or+2]=ze,this.uint16[or+3]=Ze,this.uint32[gr+2]=Je,this.uint32[gr+3]=ht,this.uint32[gr+4]=mt,this.uint16[or+10]=zt,this.uint16[or+11]=jt,this.uint16[or+12]=Xt,this.float32[gr+7]=rn,this.float32[gr+8]=hn,this.uint8[Wr+36]=Sn,this.uint8[Wr+37]=xn,this.uint8[Wr+38]=Nn,this.uint32[gr+10]=Gn,this.int16[or+22]=wr,U}}Vt.prototype.bytesPerElement=48,cn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Vt);class It extends R{_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(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn,Gn,wr,or,gr,Wr,pi,Ci,Vi,ki,ui,Ii,Oi){const Si=this.length;return this.resize(Si+1),this.emplace(Si,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn,Gn,wr,or,gr,Wr,pi,Ci,Vi,ki,ui,Ii,Oi)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn,Nn,Gn,wr,or,gr,Wr,pi,Ci,Vi,ki,ui,Ii,Oi,Si){const ti=32*U,Di=16*U;return this.int16[ti+0]=ne,this.int16[ti+1]=pe,this.int16[ti+2]=ze,this.int16[ti+3]=Ze,this.int16[ti+4]=Je,this.int16[ti+5]=ht,this.int16[ti+6]=mt,this.int16[ti+7]=zt,this.uint16[ti+8]=jt,this.uint16[ti+9]=Xt,this.uint16[ti+10]=rn,this.uint16[ti+11]=hn,this.uint16[ti+12]=Sn,this.uint16[ti+13]=xn,this.uint16[ti+14]=Nn,this.uint16[ti+15]=Gn,this.uint16[ti+16]=wr,this.uint16[ti+17]=or,this.uint16[ti+18]=gr,this.uint16[ti+19]=Wr,this.uint16[ti+20]=pi,this.uint16[ti+21]=Ci,this.uint16[ti+22]=Vi,this.uint32[Di+12]=ki,this.float32[Di+13]=ui,this.float32[Di+14]=Ii,this.uint16[ti+30]=Oi,this.uint16[ti+31]=Si,U}}It.prototype.bytesPerElement=64,cn("StructArrayLayout8i15ui1ul2f2ui64",It);class Qt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U){const ne=this.length;return this.resize(ne+1),this.emplace(ne,U)}emplace(U,ne){const pe=1*U;return this.float32[pe+0]=ne,U}}Qt.prototype.bytesPerElement=4,cn("StructArrayLayout1f4",Qt);class tn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=6*U,Je=3*U;return this.uint16[Ze+0]=ne,this.float32[Je+1]=pe,this.float32[Je+2]=ze,U}}tn.prototype.bytesPerElement=12,cn("StructArrayLayout1ui2f12",tn);class Yt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=2*U,Je=4*U;return this.uint32[Ze+0]=ne,this.uint16[Je+2]=pe,this.uint16[Je+3]=ze,U}}Yt.prototype.bytesPerElement=8,cn("StructArrayLayout1ul2ui8",Yt);class vn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne){const pe=this.length;return this.resize(pe+1),this.emplace(pe,U,ne)}emplace(U,ne,pe){const ze=2*U;return this.uint16[ze+0]=ne,this.uint16[ze+1]=pe,U}}vn.prototype.bytesPerElement=4,cn("StructArrayLayout2ui4",vn);class Mn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U){const ne=this.length;return this.resize(ne+1),this.emplace(ne,U)}emplace(U,ne){const pe=1*U;return this.uint16[pe+0]=ne,U}}Mn.prototype.bytesPerElement=2,cn("StructArrayLayout1ui2",Mn);class Vn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze){const Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,U,ne,pe,ze)}emplace(U,ne,pe,ze,Ze){const Je=4*U;return this.float32[Je+0]=ne,this.float32[Je+1]=pe,this.float32[Je+2]=ze,this.float32[Je+3]=Ze,U}}Vn.prototype.bytesPerElement=16,cn("StructArrayLayout4f16",Vn);class Hn extends X{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 u(this.anchorPointX,this.anchorPointY)}}Hn.prototype.size=20;class Xn extends ct{get(U){return new Hn(this,U)}}cn("CollisionBoxArray",Xn);class rr extends X{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(U){this._structArray.uint8[this._pos1+37]=U}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(U){this._structArray.uint8[this._pos1+38]=U}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(U){this._structArray.uint32[this._pos4+10]=U}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}rr.prototype.size=48;class Mr extends Vt{get(U){return new rr(this,U)}}cn("PlacedSymbolArray",Mr);class nr extends X{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(U){this._structArray.uint32[this._pos4+12]=U}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]}}nr.prototype.size=64;class Lr extends It{get(U){return new nr(this,U)}}cn("SymbolInstanceArray",Lr);class dr extends Qt{getoffsetX(U){return this.float32[1*U+0]}}cn("GlyphOffsetArray",dr);class Br extends F{getx(U){return this.int16[3*U+0]}gety(U){return this.int16[3*U+1]}gettileUnitDistanceFromAnchor(U){return this.int16[3*U+2]}}cn("SymbolLineVertexArray",Br);class Sr extends X{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]}}Sr.prototype.size=12;class Vr extends tn{get(U){return new Sr(this,U)}}cn("TextAnchorOffsetArray",Vr);class fi extends X{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]}}fi.prototype.size=8;class Nr extends Yt{get(U){return new fi(this,U)}}cn("FeatureIndexArray",Nr);class si extends C{}class _i extends C{}class Gi extends C{}class Pi extends te{}class Ji extends ue{}class Yi extends ve{}class na extends Ae{}class Ma extends Re{}class go extends Ue{}class uo extends it{}class Go extends dt{}class Da extends Ct{}class ca extends Mt{}class Qa extends vn{}const Ra=i([{name:"a_pos",components:2,type:"Int16"}],4),{members:wa,size:Fa,alignment:qa}=Ra;class fa{constructor(U=[]){this.segments=U}prepareSegment(U,ne,pe,ze){let Ze=this.segments[this.segments.length-1];return U>fa.MAX_VERTEX_ARRAY_LENGTH&&f(`Max vertices per segment is ${fa.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${U}`),(!Ze||Ze.vertexLength+U>fa.MAX_VERTEX_ARRAY_LENGTH||Ze.sortKey!==ze)&&(Ze={vertexOffset:ne.length,primitiveOffset:pe.length,vertexLength:0,primitiveLength:0},ze!==void 0&&(Ze.sortKey=ze),this.segments.push(Ze)),Ze}get(){return this.segments}destroy(){for(const U of this.segments)for(const ne in U.vaos)U.vaos[ne].destroy()}static simpleSegment(U,ne,pe,ze){return new fa([{vertexOffset:U,primitiveOffset:ne,vertexLength:pe,primitiveLength:ze,vaos:{},sortKey:0}])}}function Pl(Y,U){return 256*(Y=g(Math.floor(Y),0,255))+g(Math.floor(U),0,255)}fa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,cn("SegmentVector",fa);const mo=i([{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 Hi={exports:{}},fs={exports:{}};(function(Y){Y.exports=function(U,ne){var pe,ze,Ze,Je,ht,mt,zt,jt;for(pe=3&U.length,ze=U.length-pe,Ze=ne,ht=3432918353,mt=461845907,jt=0;jt>>16)*ht&65535)<<16)&4294967295)<<15|zt>>>17))*mt+(((zt>>>16)*mt&65535)<<16)&4294967295)<<13|Ze>>>19))+((5*(Ze>>>16)&65535)<<16)&4294967295))+((58964+(Je>>>16)&65535)<<16);switch(zt=0,pe){case 3:zt^=(255&U.charCodeAt(jt+2))<<16;case 2:zt^=(255&U.charCodeAt(jt+1))<<8;case 1:Ze^=zt=(65535&(zt=(zt=(65535&(zt^=255&U.charCodeAt(jt)))*ht+(((zt>>>16)*ht&65535)<<16)&4294967295)<<15|zt>>>17))*mt+(((zt>>>16)*mt&65535)<<16)&4294967295}return Ze^=U.length,Ze=2246822507*(65535&(Ze^=Ze>>>16))+((2246822507*(Ze>>>16)&65535)<<16)&4294967295,Ze=3266489909*(65535&(Ze^=Ze>>>13))+((3266489909*(Ze>>>16)&65535)<<16)&4294967295,(Ze^=Ze>>>16)>>>0}})(fs);var Po=fs.exports,ll={exports:{}};(function(Y){Y.exports=function(U,ne){for(var pe,ze=U.length,Ze=ne^ze,Je=0;ze>=4;)pe=1540483477*(65535&(pe=255&U.charCodeAt(Je)|(255&U.charCodeAt(++Je))<<8|(255&U.charCodeAt(++Je))<<16|(255&U.charCodeAt(++Je))<<24))+((1540483477*(pe>>>16)&65535)<<16),Ze=1540483477*(65535&Ze)+((1540483477*(Ze>>>16)&65535)<<16)^(pe=1540483477*(65535&(pe^=pe>>>24))+((1540483477*(pe>>>16)&65535)<<16)),ze-=4,++Je;switch(ze){case 3:Ze^=(255&U.charCodeAt(Je+2))<<16;case 2:Ze^=(255&U.charCodeAt(Je+1))<<8;case 1:Ze=1540483477*(65535&(Ze^=255&U.charCodeAt(Je)))+((1540483477*(Ze>>>16)&65535)<<16)}return Ze=1540483477*(65535&(Ze^=Ze>>>13))+((1540483477*(Ze>>>16)&65535)<<16),(Ze^=Ze>>>15)>>>0}})(ll);var ao=Po,ul=ll.exports;Hi.exports=ao,Hi.exports.murmur3=ao,Hi.exports.murmur2=ul;var Lo=w(Hi.exports);class Bc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(U,ne,pe,ze){this.ids.push(ef(U)),this.positions.push(ne,pe,ze)}getPositions(U){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const ne=ef(U);let pe=0,ze=this.ids.length-1;for(;pe>1;this.ids[Je]>=ne?ze=Je:pe=Je+1}const Ze=[];for(;this.ids[pe]===ne;){const Je=this.positions[3*pe],ht=this.positions[3*pe+1],mt=this.positions[3*pe+2];Ze.push({index:Je,start:ht,end:mt}),pe++}return Ze}static serialize(U,ne){const pe=new Float64Array(U.ids),ze=new Uint32Array(U.positions);return ga(pe,ze,0,pe.length-1),ne&&ne.push(pe.buffer,ze.buffer),{ids:pe,positions:ze}}static deserialize(U){const ne=new Bc;return ne.ids=U.ids,ne.positions=U.positions,ne.indexed=!0,ne}}function ef(Y){const U=+Y;return!isNaN(U)&&U<=Number.MAX_SAFE_INTEGER?U:Lo(String(Y))}function ga(Y,U,ne,pe){for(;ne>1];let Ze=ne-1,Je=pe+1;for(;;){do Ze++;while(Y[Ze]ze);if(Ze>=Je)break;Ch(Y,Ze,Je),Ch(U,3*Ze,3*Je),Ch(U,3*Ze+1,3*Je+1),Ch(U,3*Ze+2,3*Je+2)}Je-ne`u_${ze}`),this.type=pe}setUniform(U,ne,pe){U.set(pe.constantOr(this.value))}getBinding(U,ne,pe){return this.type==="color"?new tf(U,ne):new Sc(U,ne)}}class Mc{constructor(U,ne){this.uniformNames=ne.map(pe=>`u_${pe}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(U,ne){this.pixelRatioFrom=ne.pixelRatio,this.pixelRatioTo=U.pixelRatio,this.patternFrom=ne.tlbr,this.patternTo=U.tlbr}setUniform(U,ne,pe,ze){const Ze=ze==="u_pattern_to"?this.patternTo:ze==="u_pattern_from"?this.patternFrom:ze==="u_pixel_ratio_to"?this.pixelRatioTo:ze==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ze&&U.set(Ze)}getBinding(U,ne,pe){return pe.substr(0,9)==="u_pattern"?new gc(U,ne):new Sc(U,ne)}}class mc{constructor(U,ne,pe,ze){this.expression=U,this.type=pe,this.maxValue=0,this.paintVertexAttributes=ne.map(Ze=>({name:`a_${Ze}`,type:"Float32",components:pe==="color"?2:1,offset:0})),this.paintVertexArray=new ze}populatePaintArray(U,ne,pe,ze,Ze){const Je=this.paintVertexArray.length,ht=this.expression.evaluate(new di(0),ne,{},ze,[],Ze);this.paintVertexArray.resize(U),this._setPaintValue(Je,U,ht)}updatePaintArray(U,ne,pe,ze){const Ze=this.expression.evaluate({zoom:0},pe,ze);this._setPaintValue(U,ne,Ze)}_setPaintValue(U,ne,pe){if(this.type==="color"){const ze=Xs(pe);for(let Ze=U;Ze`u_${ht}_t`),this.type=pe,this.useIntegerZoom=ze,this.zoom=Ze,this.maxValue=0,this.paintVertexAttributes=ne.map(ht=>({name:`a_${ht}`,type:"Float32",components:pe==="color"?4:2,offset:0})),this.paintVertexArray=new Je}populatePaintArray(U,ne,pe,ze,Ze){const Je=this.expression.evaluate(new di(this.zoom),ne,{},ze,[],Ze),ht=this.expression.evaluate(new di(this.zoom+1),ne,{},ze,[],Ze),mt=this.paintVertexArray.length;this.paintVertexArray.resize(U),this._setPaintValue(mt,U,Je,ht)}updatePaintArray(U,ne,pe,ze){const Ze=this.expression.evaluate({zoom:this.zoom},pe,ze),Je=this.expression.evaluate({zoom:this.zoom+1},pe,ze);this._setPaintValue(U,ne,Ze,Je)}_setPaintValue(U,ne,pe,ze){if(this.type==="color"){const Ze=Xs(pe),Je=Xs(ze);for(let ht=U;ht`#define HAS_UNIFORM_${ze}`))}return U}getBinderAttributes(){const U=[];for(const ne in this.binders){const pe=this.binders[ne];if(pe instanceof mc||pe instanceof oc)for(let ze=0;ze!0){this.programConfigurations={};for(const ze of U)this.programConfigurations[ze.id]=new vc(ze,ne,pe);this.needsUpload=!1,this._featureMap=new Bc,this._bufferOffset=0}populatePaintArrays(U,ne,pe,ze,Ze,Je){for(const ht in this.programConfigurations)this.programConfigurations[ht].populatePaintArrays(U,ne,ze,Ze,Je);ne.id!==void 0&&this._featureMap.add(ne.id,pe,this._bufferOffset,U),this._bufferOffset=U,this.needsUpload=!0}updatePaintArrays(U,ne,pe,ze){for(const Ze of pe)this.needsUpload=this.programConfigurations[Ze.id].updatePaintArrays(U,this._featureMap,ne,Ze,ze)||this.needsUpload}get(U){return this.programConfigurations[U]}upload(U){if(this.needsUpload){for(const ne in this.programConfigurations)this.programConfigurations[ne].upload(U);this.needsUpload=!1}}destroy(){for(const U in this.programConfigurations)this.programConfigurations[U].destroy()}}function Sp(Y,U){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"]}[Y]||[Y.replace(`${U}-`,"").replace(/-/g,"_")]}function gd(Y,U,ne){const pe={color:{source:ve,composite:Vn},number:{source:Qt,composite:ve}},ze=function(Ze){return{"line-pattern":{source:na,composite:na},"fill-pattern":{source:na,composite:na},"fill-extrusion-pattern":{source:na,composite:na}}[Ze]}(Y);return ze&&ze[ne]||pe[U][ne]}cn("ConstantBinder",Ap),cn("CrossFadedConstantBinder",Mc),cn("SourceExpressionBinder",mc),cn("CrossFadedCompositeBinder",Ih),cn("CompositeExpressionBinder",oc),cn("ProgramConfiguration",vc,{omit:["_buffers"]}),cn("ProgramConfigurationSet",ps);const Ss=8192,Ef=Math.pow(2,14)-1,md=-Ef-1;function eh(Y){const U=Ss/Y.extent,ne=Y.loadGeometry();for(let pe=0;peJe.x+1||mtJe.y+1)&&f("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return ne}function Ph(Y,U){return{type:Y.type,id:Y.id,properties:Y.properties,geometry:U?eh(Y):[]}}function ep(Y,U,ne,pe,ze){Y.emplaceBack(2*U+(pe+1)/2,2*ne+(ze+1)/2)}class th{constructor(U){this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=U.index,this.hasPattern=!1,this.layoutVertexArray=new _i,this.indexArray=new ca,this.segments=new fa,this.programConfigurations=new ps(U.layers,U.zoom),this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){const ze=this.layers[0],Ze=[];let Je=null,ht=!1;ze.type==="circle"&&(Je=ze.layout.get("circle-sort-key"),ht=!Je.isConstant());for(const{feature:mt,id:zt,index:jt,sourceLayerIndex:Xt}of U){const rn=this.layers[0]._featureFilter.needGeometry,hn=Ph(mt,rn);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),hn,pe))continue;const Sn=ht?Je.evaluate(hn,{},pe):void 0,xn={id:zt,properties:mt.properties,type:mt.type,sourceLayerIndex:Xt,index:jt,geometry:rn?hn.geometry:eh(mt),patterns:{},sortKey:Sn};Ze.push(xn)}ht&&Ze.sort((mt,zt)=>mt.sortKey-zt.sortKey);for(const mt of Ze){const{geometry:zt,index:jt,sourceLayerIndex:Xt}=mt,rn=U[jt].feature;this.addFeature(mt,zt,jt,pe),ne.featureIndex.insert(rn,zt,jt,Xt,this.index)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,wa),this.indexBuffer=U.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(U),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(U,ne,pe,ze){for(const Ze of ne)for(const Je of Ze){const ht=Je.x,mt=Je.y;if(ht<0||ht>=Ss||mt<0||mt>=Ss)continue;const zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,U.sortKey),jt=zt.vertexLength;ep(this.layoutVertexArray,ht,mt,-1,-1),ep(this.layoutVertexArray,ht,mt,1,-1),ep(this.layoutVertexArray,ht,mt,1,1),ep(this.layoutVertexArray,ht,mt,-1,1),this.indexArray.emplaceBack(jt,jt+1,jt+2),this.indexArray.emplaceBack(jt,jt+3,jt+2),zt.vertexLength+=4,zt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,U,pe,{},ze)}}function M0(Y,U){for(let ne=0;ne1){if(nh(Y,U))return!0;for(let pe=0;pe1?Y.distSqr(ne):Y.distSqr(ne.sub(U)._mult(ze)._add(U))}function I0(Y,U){let ne,pe,ze,Ze=!1;for(let Je=0;JeU.y!=ze.y>U.y&&U.x<(ze.x-pe.x)*(U.y-pe.y)/(ze.y-pe.y)+pe.x&&(Ze=!Ze)}return Ze}function Cf(Y,U){let ne=!1;for(let pe=0,ze=Y.length-1;peU.y!=Je.y>U.y&&U.x<(Je.x-Ze.x)*(U.y-Ze.y)/(Je.y-Ze.y)+Ze.x&&(ne=!ne)}return ne}function yv(Y,U,ne){const pe=ne[0],ze=ne[2];if(Y.xze.x&&U.x>ze.x||Y.yze.y&&U.y>ze.y)return!1;const Ze=E(Y,U,ne[0]);return Ze!==E(Y,U,ne[1])||Ze!==E(Y,U,ne[2])||Ze!==E(Y,U,ne[3])}function tp(Y,U,ne){const pe=U.paint.get(Y).value;return pe.kind==="constant"?pe.value:ne.programConfigurations.get(U.id).getMaxValue(Y)}function If(Y){return Math.sqrt(Y[0]*Y[0]+Y[1]*Y[1])}function Iu(Y,U,ne,pe,ze){if(!U[0]&&!U[1])return Y;const Ze=u.convert(U)._mult(ze);ne==="viewport"&&Ze._rotate(-pe);const Je=[];for(let ht=0;htMp(Nn,xn))}(zt,mt),hn=Xt?jt*ht:jt;for(const Sn of ze)for(const xn of Sn){const Nn=Xt?xn:Mp(xn,mt);let Gn=hn;const wr=af([],[xn.x,xn.y,0,1],mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Gn*=wr[3]/Je.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Gn*=Je.cameraToCenterDistance/wr[3]),mh(rn,Nn,Gn))return!0}return!1}}function Mp(Y,U){const ne=af([],[Y.x,Y.y,0,1],U);return new u(ne[0]/ne[3],ne[1]/ne[3])}class Ms extends th{}let of;cn("HeatmapBucket",Ms,{omit:["layers"]});var _d={get paint(){return of=of||new js({"heatmap-radius":new xi(me.paint_heatmap["heatmap-radius"]),"heatmap-weight":new xi(me.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ai(me.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bu(me.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ai(me.paint_heatmap["heatmap-opacity"])})}};function Lh(Y,{width:U,height:ne},pe,ze){if(ze){if(ze instanceof Uint8ClampedArray)ze=new Uint8Array(ze.buffer);else if(ze.length!==U*ne*pe)throw new RangeError(`mismatched image size. expected: ${ze.length} but got: ${U*ne*pe}`)}else ze=new Uint8Array(U*ne*pe);return Y.width=U,Y.height=ne,Y.data=ze,Y}function Ep(Y,{width:U,height:ne},pe){if(U===Y.width&&ne===Y.height)return;const ze=Lh({},{width:U,height:ne},pe);sf(Y,ze,{x:0,y:0},{x:0,y:0},{width:Math.min(Y.width,U),height:Math.min(Y.height,ne)},pe),Y.width=U,Y.height=ne,Y.data=ze.data}function sf(Y,U,ne,pe,ze,Ze){if(ze.width===0||ze.height===0)return U;if(ze.width>Y.width||ze.height>Y.height||ne.x>Y.width-ze.width||ne.y>Y.height-ze.height)throw new RangeError("out of range source coordinates for image copy");if(ze.width>U.width||ze.height>U.height||pe.x>U.width-ze.width||pe.y>U.height-ze.height)throw new RangeError("out of range destination coordinates for image copy");const Je=Y.data,ht=U.data;if(Je===ht)throw new Error("srcData equals dstData, so image is already copied");for(let mt=0;mt{U[Y.evaluationKey]=zt;const jt=Y.expression.evaluate(U);ze.data[ht+mt+0]=Math.floor(255*jt.r/jt.a),ze.data[ht+mt+1]=Math.floor(255*jt.g/jt.a),ze.data[ht+mt+2]=Math.floor(255*jt.b/jt.a),ze.data[ht+mt+3]=Math.floor(255*jt.a)};if(Y.clips)for(let ht=0,mt=0;ht80*ne){ht=1/0,mt=1/0;let jt=-1/0,Xt=-1/0;for(let rn=ne;rnjt&&(jt=hn),Sn>Xt&&(Xt=Sn)}zt=Math.max(jt-ht,Xt-mt),zt=zt!==0?32767/zt:0}return zf(Ze,Je,ne,ht,mt,zt,0),Je}function Nc(Y,U,ne,pe,ze){let Ze;if(ze===function(Je,ht,mt,zt){let jt=0;for(let Xt=ht,rn=mt-zt;Xt0)for(let Je=U;Je=U;Je-=pe)Ze=Gg(Je/pe|0,Y[Je],Y[Je+1],Ze);return Ze&&Ad(Ze,Ze.next)&&(Pu(Ze),Ze=Ze.next),Ze}function lu(Y,U){if(!Y)return Y;U||(U=Y);let ne,pe=Y;do if(ne=!1,pe.steiner||!Ad(pe,pe.next)&&ts(pe.prev,pe,pe.next)!==0)pe=pe.next;else{if(Pu(pe),pe=U=pe.prev,pe===pe.next)break;ne=!0}while(ne||pe!==U);return U}function zf(Y,U,ne,pe,ze,Ze,Je){if(!Y)return;!Je&&Ze&&function(mt,zt,jt,Xt){let rn=mt;do rn.z===0&&(rn.z=Td(rn.x,rn.y,zt,jt,Xt)),rn.prevZ=rn.prev,rn.nextZ=rn.next,rn=rn.next;while(rn!==mt);rn.prevZ.nextZ=null,rn.prevZ=null,function(hn){let Sn,xn=1;do{let Nn,Gn=hn;hn=null;let wr=null;for(Sn=0;Gn;){Sn++;let or=Gn,gr=0;for(let pi=0;pi0||Wr>0&∨)gr!==0&&(Wr===0||!or||Gn.z<=or.z)?(Nn=Gn,Gn=Gn.nextZ,gr--):(Nn=or,or=or.nextZ,Wr--),wr?wr.nextZ=Nn:hn=Nn,Nn.prevZ=wr,wr=Nn;Gn=or}wr.nextZ=null,xn*=2}while(Sn>1)}(rn)}(Y,pe,ze,Ze);let ht=Y;for(;Y.prev!==Y.next;){const mt=Y.prev,zt=Y.next;if(Ze?wd(Y,pe,ze,Ze):R0(Y))U.push(mt.i,Y.i,zt.i),Pu(Y),Y=zt.next,ht=zt.next;else if((Y=zt)===ht){Je?Je===1?zf(Y=ip(lu(Y),U),U,ne,pe,ze,Ze,2):Je===2&&ma(Y,U,ne,pe,ze,Ze):zf(lu(Y),U,ne,pe,ze,Ze,1);break}}}function R0(Y){const U=Y.prev,ne=Y,pe=Y.next;if(ts(U,ne,pe)>=0)return!1;const ze=U.x,Ze=ne.x,Je=pe.x,ht=U.y,mt=ne.y,zt=pe.y,jt=zeZe?ze>Je?ze:Je:Ze>Je?Ze:Je,hn=ht>mt?ht>zt?ht:zt:mt>zt?mt:zt;let Sn=pe.next;for(;Sn!==U;){if(Sn.x>=jt&&Sn.x<=rn&&Sn.y>=Xt&&Sn.y<=hn&&Df(ze,ht,Ze,mt,Je,zt,Sn.x,Sn.y)&&ts(Sn.prev,Sn,Sn.next)>=0)return!1;Sn=Sn.next}return!0}function wd(Y,U,ne,pe){const ze=Y.prev,Ze=Y,Je=Y.next;if(ts(ze,Ze,Je)>=0)return!1;const ht=ze.x,mt=Ze.x,zt=Je.x,jt=ze.y,Xt=Ze.y,rn=Je.y,hn=htmt?ht>zt?ht:zt:mt>zt?mt:zt,Nn=jt>Xt?jt>rn?jt:rn:Xt>rn?Xt:rn,Gn=Td(hn,Sn,U,ne,pe),wr=Td(xn,Nn,U,ne,pe);let or=Y.prevZ,gr=Y.nextZ;for(;or&&or.z>=Gn&&gr&&gr.z<=wr;){if(or.x>=hn&&or.x<=xn&&or.y>=Sn&&or.y<=Nn&&or!==ze&&or!==Je&&Df(ht,jt,mt,Xt,zt,rn,or.x,or.y)&&ts(or.prev,or,or.next)>=0||(or=or.prevZ,gr.x>=hn&&gr.x<=xn&&gr.y>=Sn&&gr.y<=Nn&&gr!==ze&&gr!==Je&&Df(ht,jt,mt,Xt,zt,rn,gr.x,gr.y)&&ts(gr.prev,gr,gr.next)>=0))return!1;gr=gr.nextZ}for(;or&&or.z>=Gn;){if(or.x>=hn&&or.x<=xn&&or.y>=Sn&&or.y<=Nn&&or!==ze&&or!==Je&&Df(ht,jt,mt,Xt,zt,rn,or.x,or.y)&&ts(or.prev,or,or.next)>=0)return!1;or=or.prevZ}for(;gr&&gr.z<=wr;){if(gr.x>=hn&&gr.x<=xn&&gr.y>=Sn&&gr.y<=Nn&&gr!==ze&&gr!==Je&&Df(ht,jt,mt,Xt,zt,rn,gr.x,gr.y)&&ts(gr.prev,gr,gr.next)>=0)return!1;gr=gr.nextZ}return!0}function ip(Y,U){let ne=Y;do{const pe=ne.prev,ze=ne.next.next;!Ad(pe,ze)&&Ip(pe,ne,ne.next,ze)&&Pp(pe,ze)&&Pp(ze,pe)&&(U.push(pe.i,ne.i,ze.i),Pu(ne),Pu(ne.next),ne=Y=ze),ne=ne.next}while(ne!==Y);return lu(ne)}function ma(Y,U,ne,pe,ze,Ze){let Je=Y;do{let ht=Je.next.next;for(;ht!==Je.prev;){if(Je.i!==ht.i&&Wu(Je,ht)){let mt=Hg(Je,ht);return Je=lu(Je,Je.next),mt=lu(mt,mt.next),zf(Je,U,ne,pe,ze,Ze,0),void zf(mt,U,ne,pe,ze,Ze,0)}ht=ht.next}Je=Je.next}while(Je!==Y)}function Dh(Y,U){return Y.x-U.x}function F0(Y,U){const ne=function(ze,Ze){let Je=Ze;const ht=ze.x,mt=ze.y;let zt,jt=-1/0;do{if(mt<=Je.y&&mt>=Je.next.y&&Je.next.y!==Je.y){const xn=Je.x+(mt-Je.y)*(Je.next.x-Je.x)/(Je.next.y-Je.y);if(xn<=ht&&xn>jt&&(jt=xn,zt=Je.x=Je.x&&Je.x>=rn&&ht!==Je.x&&Df(mtzt.x||Je.x===zt.x&&Of(zt,Je)))&&(zt=Je,Sn=xn)}Je=Je.next}while(Je!==Xt);return zt}(Y,U);if(!ne)return U;const pe=Hg(ne,Y);return lu(pe,pe.next),lu(ne,ne.next)}function Of(Y,U){return ts(Y.prev,Y,U.prev)<0&&ts(U.next,Y,Y.next)<0}function Td(Y,U,ne,pe,ze){return(Y=1431655765&((Y=858993459&((Y=252645135&((Y=16711935&((Y=(Y-ne)*ze|0)|Y<<8))|Y<<4))|Y<<2))|Y<<1))|(U=1431655765&((U=858993459&((U=252645135&((U=16711935&((U=(U-pe)*ze|0)|U<<8))|U<<4))|U<<2))|U<<1))<<1}function kd(Y){let U=Y,ne=Y;do(U.x=(Y-Je)*(Ze-ht)&&(Y-Je)*(pe-ht)>=(ne-Je)*(U-ht)&&(ne-Je)*(Ze-ht)>=(ze-Je)*(pe-ht)}function Wu(Y,U){return Y.next.i!==U.i&&Y.prev.i!==U.i&&!function(ne,pe){let ze=ne;do{if(ze.i!==ne.i&&ze.next.i!==ne.i&&ze.i!==pe.i&&ze.next.i!==pe.i&&Ip(ze,ze.next,ne,pe))return!0;ze=ze.next}while(ze!==ne);return!1}(Y,U)&&(Pp(Y,U)&&Pp(U,Y)&&function(ne,pe){let ze=ne,Ze=!1;const Je=(ne.x+pe.x)/2,ht=(ne.y+pe.y)/2;do ze.y>ht!=ze.next.y>ht&&ze.next.y!==ze.y&&Je<(ze.next.x-ze.x)*(ht-ze.y)/(ze.next.y-ze.y)+ze.x&&(Ze=!Ze),ze=ze.next;while(ze!==ne);return Ze}(Y,U)&&(ts(Y.prev,Y,U.prev)||ts(Y,U.prev,U))||Ad(Y,U)&&ts(Y.prev,Y,Y.next)>0&&ts(U.prev,U,U.next)>0)}function ts(Y,U,ne){return(U.y-Y.y)*(ne.x-U.x)-(U.x-Y.x)*(ne.y-U.y)}function Ad(Y,U){return Y.x===U.x&&Y.y===U.y}function Ip(Y,U,ne,pe){const ze=lc(ts(Y,U,ne)),Ze=lc(ts(Y,U,pe)),Je=lc(ts(ne,pe,Y)),ht=lc(ts(ne,pe,U));return ze!==Ze&&Je!==ht||!(ze!==0||!uf(Y,ne,U))||!(Ze!==0||!uf(Y,pe,U))||!(Je!==0||!uf(ne,Y,pe))||!(ht!==0||!uf(ne,U,pe))}function uf(Y,U,ne){return U.x<=Math.max(Y.x,ne.x)&&U.x>=Math.min(Y.x,ne.x)&&U.y<=Math.max(Y.y,ne.y)&&U.y>=Math.min(Y.y,ne.y)}function lc(Y){return Y>0?1:Y<0?-1:0}function Pp(Y,U){return ts(Y.prev,Y,Y.next)<0?ts(Y,U,Y.next)>=0&&ts(Y,Y.prev,U)>=0:ts(Y,U,Y.prev)<0||ts(Y,Y.next,U)<0}function Hg(Y,U){const ne=wu(Y.i,Y.x,Y.y),pe=wu(U.i,U.x,U.y),ze=Y.next,Ze=U.prev;return Y.next=U,U.prev=Y,ne.next=ze,ze.prev=ne,pe.next=ne,ne.prev=pe,Ze.next=pe,pe.prev=Ze,pe}function Gg(Y,U,ne,pe){const ze=wu(Y,U,ne);return pe?(ze.next=pe.next,ze.prev=pe,pe.next.prev=ze,pe.next=ze):(ze.prev=ze,ze.next=ze),ze}function Pu(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function wu(Y,U,ne){return{i:Y,x:U,y:ne,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Lp(Y,U,ne){const pe=ne.patternDependencies;let ze=!1;for(const Ze of U){const Je=Ze.paint.get(`${Y}-pattern`);Je.isConstant()||(ze=!0);const ht=Je.constantOr(null);ht&&(ze=!0,pe[ht.to]=!0,pe[ht.from]=!0)}return ze}function B0(Y,U,ne,pe,ze){const Ze=ze.patternDependencies;for(const Je of U){const ht=Je.paint.get(`${Y}-pattern`).value;if(ht.kind!=="constant"){let mt=ht.evaluate({zoom:pe-1},ne,{},ze.availableImages),zt=ht.evaluate({zoom:pe},ne,{},ze.availableImages),jt=ht.evaluate({zoom:pe+1},ne,{},ze.availableImages);mt=mt&&mt.name?mt.name:mt,zt=zt&&zt.name?zt.name:zt,jt=jt&&jt.name?jt.name:jt,Ze[mt]=!0,Ze[zt]=!0,Ze[jt]=!0,ne.patterns[Je.id]={min:mt,mid:zt,max:jt}}}return ne}class zp{constructor(U){this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=U.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Gi,this.indexArray=new ca,this.indexArray2=new Qa,this.programConfigurations=new ps(U.layers,U.zoom),this.segments=new fa,this.segments2=new fa,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){this.hasPattern=Lp("fill",this.layers,ne);const ze=this.layers[0].layout.get("fill-sort-key"),Ze=!ze.isConstant(),Je=[];for(const{feature:ht,id:mt,index:zt,sourceLayerIndex:jt}of U){const Xt=this.layers[0]._featureFilter.needGeometry,rn=Ph(ht,Xt);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),rn,pe))continue;const hn=Ze?ze.evaluate(rn,{},pe,ne.availableImages):void 0,Sn={id:mt,properties:ht.properties,type:ht.type,sourceLayerIndex:jt,index:zt,geometry:Xt?rn.geometry:eh(ht),patterns:{},sortKey:hn};Je.push(Sn)}Ze&&Je.sort((ht,mt)=>ht.sortKey-mt.sortKey);for(const ht of Je){const{geometry:mt,index:zt,sourceLayerIndex:jt}=ht;if(this.hasPattern){const rn=B0("fill",this.layers,ht,this.zoom,ne);this.patternFeatures.push(rn)}else this.addFeature(ht,mt,zt,pe,{});const Xt=U[zt].feature;ne.featureIndex.insert(Xt,mt,zt,jt,this.index)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}addFeatures(U,ne,pe){for(const ze of this.patternFeatures)this.addFeature(ze,ze.geometry,ze.index,ne,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,_v),this.indexBuffer=U.createIndexBuffer(this.indexArray),this.indexBuffer2=U.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(U),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(U,ne,pe,ze,Ze){for(const Je of vl(ne,500)){let ht=0;for(const hn of Je)ht+=hn.length;const mt=this.segments.prepareSegment(ht,this.layoutVertexArray,this.indexArray),zt=mt.vertexLength,jt=[],Xt=[];for(const hn of Je){if(hn.length===0)continue;hn!==Je[0]&&Xt.push(jt.length/2);const Sn=this.segments2.prepareSegment(hn.length,this.layoutVertexArray,this.indexArray2),xn=Sn.vertexLength;this.layoutVertexArray.emplaceBack(hn[0].x,hn[0].y),this.indexArray2.emplaceBack(xn+hn.length-1,xn),jt.push(hn[0].x),jt.push(hn[0].y);for(let Nn=1;Nn>3}if(ze--,pe===1||pe===2)Ze+=Y.readSVarint(),Je+=Y.readSVarint(),pe===1&&(U&&ht.push(U),U=[]),U.push(new Yg(Ze,Je));else{if(pe!==7)throw new Error("unknown command "+pe);U&&U.push(U[0].clone())}}return U&&ht.push(U),ht},Fh.prototype.bbox=function(){var Y=this._pbf;Y.pos=this._geometry;for(var U=Y.readVarint()+Y.pos,ne=1,pe=0,ze=0,Ze=0,Je=1/0,ht=-1/0,mt=1/0,zt=-1/0;Y.pos>3}if(pe--,ne===1||ne===2)(ze+=Y.readSVarint())ht&&(ht=ze),(Ze+=Y.readSVarint())zt&&(zt=Ze);else if(ne!==7)throw new Error("unknown command "+ne)}return[Je,mt,ht,zt]},Fh.prototype.toGeoJSON=function(Y,U,ne){var pe,ze,Ze=this.extent*Math.pow(2,ne),Je=this.extent*Y,ht=this.extent*U,mt=this.loadGeometry(),zt=Fh.types[this.type];function jt(hn){for(var Sn=0;Sn>3;ze=Je===1?pe.readString():Je===2?pe.readFloat():Je===3?pe.readDouble():Je===4?pe.readVarint64():Je===5?pe.readVarint():Je===6?pe.readSVarint():Je===7?pe.readBoolean():null}return ze}(ne))}Sd.prototype.feature=function(Y){if(Y<0||Y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Y];var U=this._pbf.readVarint()+this._pbf.pos;return new Rf(this._pbf,U,this.extent,this._keys,this._values)};var Rp=cl,Ga=function(Y,U){this.layers=Y.readFields(Bh,{},U)};function Bh(Y,U,ne){if(Y===3){var pe=new Rp(ne,ne.readVarint()+ne.pos);pe.length&&(U[pe.name]=pe)}}Rh.VectorTile=Ga,Rh.VectorTileFeature=Xg,Rh.VectorTileLayer=cl;const Jg=Rh.VectorTileFeature.types,Fp=Math.pow(2,13);function Ec(Y,U,ne,pe,ze,Ze,Je,ht){Y.emplaceBack(U,ne,2*Math.floor(pe*Fp)+Je,ze*Fp*2,Ze*Fp*2,Math.round(ht))}class cf{constructor(U){this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=U.index,this.hasPattern=!1,this.layoutVertexArray=new Pi,this.centroidVertexArray=new si,this.indexArray=new ca,this.programConfigurations=new ps(U.layers,U.zoom),this.segments=new fa,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){this.features=[],this.hasPattern=Lp("fill-extrusion",this.layers,ne);for(const{feature:ze,id:Ze,index:Je,sourceLayerIndex:ht}of U){const mt=this.layers[0]._featureFilter.needGeometry,zt=Ph(ze,mt);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),zt,pe))continue;const jt={id:Ze,sourceLayerIndex:ht,index:Je,geometry:mt?zt.geometry:eh(ze),properties:ze.properties,type:ze.type,patterns:{}};this.hasPattern?this.features.push(B0("fill-extrusion",this.layers,jt,this.zoom,ne)):this.addFeature(jt,jt.geometry,Je,pe,{}),ne.featureIndex.insert(ze,jt.geometry,Je,ht,this.index,!0)}}addFeatures(U,ne,pe){for(const ze of this.features){const{geometry:Ze}=ze;this.addFeature(ze,Ze,ze.index,ne,pe)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,$g),this.centroidVertexBuffer=U.createVertexBuffer(this.centroidVertexArray,bv.members,!0),this.indexBuffer=U.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(U),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(U,ne,pe,ze,Ze){for(const Je of vl(ne,500)){const ht={x:0,y:0,vertexCount:0};let mt=0;for(const Sn of Je)mt+=Sn.length;let zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const Sn of Je){if(Sn.length===0||Tv(Sn))continue;let xn=0;for(let Nn=0;Nn=1){const wr=Sn[Nn-1];if(!Qg(Gn,wr)){zt.vertexLength+4>fa.MAX_VERTEX_ARRAY_LENGTH&&(zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const or=Gn.sub(wr)._perp()._unit(),gr=wr.dist(Gn);xn+gr>32768&&(xn=0),Ec(this.layoutVertexArray,Gn.x,Gn.y,or.x,or.y,0,0,xn),Ec(this.layoutVertexArray,Gn.x,Gn.y,or.x,or.y,0,1,xn),ht.x+=2*Gn.x,ht.y+=2*Gn.y,ht.vertexCount+=2,xn+=gr,Ec(this.layoutVertexArray,wr.x,wr.y,or.x,or.y,0,0,xn),Ec(this.layoutVertexArray,wr.x,wr.y,or.x,or.y,0,1,xn),ht.x+=2*wr.x,ht.y+=2*wr.y,ht.vertexCount+=2;const Wr=zt.vertexLength;this.indexArray.emplaceBack(Wr,Wr+2,Wr+1),this.indexArray.emplaceBack(Wr+1,Wr+2,Wr+3),zt.vertexLength+=4,zt.primitiveLength+=2}}}}if(zt.vertexLength+mt>fa.MAX_VERTEX_ARRAY_LENGTH&&(zt=this.segments.prepareSegment(mt,this.layoutVertexArray,this.indexArray)),Jg[U.type]!=="Polygon")continue;const jt=[],Xt=[],rn=zt.vertexLength;for(const Sn of Je)if(Sn.length!==0){Sn!==Je[0]&&Xt.push(jt.length/2);for(let xn=0;xnSs)||Y.y===U.y&&(Y.y<0||Y.y>Ss)}function Tv(Y){return Y.every(U=>U.x<0)||Y.every(U=>U.x>Ss)||Y.every(U=>U.y<0)||Y.every(U=>U.y>Ss)}let em;cn("FillExtrusionBucket",cf,{omit:["layers","features"]});var kv={get paint(){return em=em||new js({"fill-extrusion-opacity":new Ai(me["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new xi(me["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ai(me["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ai(me["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new xa(me["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new xi(me["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new xi(me["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ai(me["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Av extends kt{constructor(U){super(U,kv)}createBucket(U){return new cf(U)}queryRadius(){return If(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(U,ne,pe,ze,Ze,Je,ht,mt){const zt=Iu(U,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Je.angle,ht),jt=this.paint.get("fill-extrusion-height").evaluate(ne,pe),Xt=this.paint.get("fill-extrusion-base").evaluate(ne,pe),rn=function(Sn,xn,Nn,Gn){const wr=[];for(const or of Sn){const gr=[or.x,or.y,Gn,1];af(gr,gr,xn),wr.push(new u(gr[0]/gr[3],gr[1]/gr[3]))}return wr}(zt,mt,0,0),hn=function(Sn,xn,Nn,Gn){const wr=[],or=[],gr=Gn[8]*xn,Wr=Gn[9]*xn,pi=Gn[10]*xn,Ci=Gn[11]*xn,Vi=Gn[8]*Nn,ki=Gn[9]*Nn,ui=Gn[10]*Nn,Ii=Gn[11]*Nn;for(const Oi of Sn){const Si=[],ti=[];for(const Di of Oi){const Bi=Di.x,ra=Di.y,oo=Gn[0]*Bi+Gn[4]*ra+Gn[12],to=Gn[1]*Bi+Gn[5]*ra+Gn[13],Is=Gn[2]*Bi+Gn[6]*ra+Gn[14],Ou=Gn[3]*Bi+Gn[7]*ra+Gn[15],Js=Is+pi,Ps=Ou+Ci,hu=oo+Vi,Yl=to+ki,gs=Is+ui,ns=Ou+Ii,Ol=new u((oo+gr)/Ps,(to+Wr)/Ps);Ol.z=Js/Ps,Si.push(Ol);const Uo=new u(hu/ns,Yl/ns);Uo.z=gs/ns,ti.push(Uo)}wr.push(Si),or.push(ti)}return[wr,or]}(ze,Xt,jt,mt);return function(Sn,xn,Nn){let Gn=1/0;vd(Nn,xn)&&(Gn=tm(Nn,xn[0]));for(let wr=0;wrne.id),this.index=U.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(ne=>{this.gradients[ne.id]={}}),this.layoutVertexArray=new Ji,this.layoutVertexArray2=new Yi,this.indexArray=new ca,this.programConfigurations=new ps(U.layers,U.zoom),this.segments=new fa,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){this.hasPattern=Lp("line",this.layers,ne);const ze=this.layers[0].layout.get("line-sort-key"),Ze=!ze.isConstant(),Je=[];for(const{feature:ht,id:mt,index:zt,sourceLayerIndex:jt}of U){const Xt=this.layers[0]._featureFilter.needGeometry,rn=Ph(ht,Xt);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),rn,pe))continue;const hn=Ze?ze.evaluate(rn,{},pe):void 0,Sn={id:mt,properties:ht.properties,type:ht.type,sourceLayerIndex:jt,index:zt,geometry:Xt?rn.geometry:eh(ht),patterns:{},sortKey:hn};Je.push(Sn)}Ze&&Je.sort((ht,mt)=>ht.sortKey-mt.sortKey);for(const ht of Je){const{geometry:mt,index:zt,sourceLayerIndex:jt}=ht;if(this.hasPattern){const rn=B0("line",this.layers,ht,this.zoom,ne);this.patternFeatures.push(rn)}else this.addFeature(ht,mt,zt,pe,{});const Xt=U[zt].feature;ne.featureIndex.insert(Xt,mt,zt,jt,this.index)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}addFeatures(U,ne,pe){for(const ze of this.patternFeatures)this.addFeature(ze,ze.geometry,ze.index,ne,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=U.createVertexBuffer(this.layoutVertexArray2,nm)),this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,Mv),this.indexBuffer=U.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(U),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(U){if(U.properties&&Object.prototype.hasOwnProperty.call(U.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(U.properties,"mapbox_clip_end"))return{start:+U.properties.mapbox_clip_start,end:+U.properties.mapbox_clip_end}}addFeature(U,ne,pe,ze,Ze){const Je=this.layers[0].layout,ht=Je.get("line-join").evaluate(U,{}),mt=Je.get("line-cap"),zt=Je.get("line-miter-limit"),jt=Je.get("line-round-limit");this.lineClips=this.lineFeatureClips(U);for(const Xt of ne)this.addLine(Xt,U,ht,mt,zt,jt);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,U,pe,Ze,ze)}addLine(U,ne,pe,ze,Ze,Je){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Gn=0;Gn=2&&U[mt-1].equals(U[mt-2]);)mt--;let zt=0;for(;zt0;if(Ci&&Gn>zt){const Ii=rn.dist(hn);if(Ii>2*jt){const Oi=rn.sub(rn.sub(hn)._mult(jt/Ii)._round());this.updateDistance(hn,Oi),this.addCurrentVertex(Oi,xn,0,0,Xt),hn=Oi}}const ki=hn&&Sn;let ui=ki?pe:ht?"butt":ze;if(ki&&ui==="round"&&(WrZe&&(ui="bevel"),ui==="bevel"&&(Wr>2&&(ui="flipbevel"),Wr100)wr=Nn.mult(-1);else{const Ii=Wr*xn.add(Nn).mag()/xn.sub(Nn).mag();wr._perp()._mult(Ii*(Vi?-1:1))}this.addCurrentVertex(rn,wr,0,0,Xt),this.addCurrentVertex(rn,wr.mult(-1),0,0,Xt)}else if(ui==="bevel"||ui==="fakeround"){const Ii=-Math.sqrt(Wr*Wr-1),Oi=Vi?Ii:0,Si=Vi?0:Ii;if(hn&&this.addCurrentVertex(rn,xn,Oi,Si,Xt),ui==="fakeround"){const ti=Math.round(180*pi/Math.PI/20);for(let Di=1;Di2*jt){const Oi=rn.add(Sn.sub(rn)._mult(jt/Ii)._round());this.updateDistance(rn,Oi),this.addCurrentVertex(Oi,Nn,0,0,Xt),rn=Oi}}}}addCurrentVertex(U,ne,pe,ze,Ze,Je=!1){const ht=ne.x+ne.y*pe,mt=ne.y-ne.x*pe,zt=-ne.x+ne.y*ze,jt=-ne.y-ne.x*ze;this.addHalfVertex(U,ht,mt,Je,!1,pe,Ze),this.addHalfVertex(U,zt,jt,Je,!0,-ze,Ze),this.distance>U0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(U,ne,pe,ze,Ze,Je))}addHalfVertex({x:U,y:ne},pe,ze,Ze,Je,ht,mt){const zt=.5*(this.lineClips?this.scaledDistance*(U0-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((U<<1)+(Ze?1:0),(ne<<1)+(Je?1:0),Math.round(63*pe)+128,Math.round(63*ze)+128,1+(ht===0?0:ht<0?-1:1)|(63&zt)<<2,zt>>6),this.lineClips){const Xt=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(Xt,this.lineClipsArray.length)}const jt=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,jt),mt.primitiveLength++),Je?this.e2=jt:this.e1=jt}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(U,ne){this.distance+=U.dist(ne),this.updateScaledDistance()}}let Zu;cn("LineBucket",Ed,{omit:["layers","patternFeatures"]});let Np;var ap={get paint(){return Np=Np||new js({"line-opacity":new xi(me.paint_line["line-opacity"]),"line-color":new xi(me.paint_line["line-color"]),"line-translate":new Ai(me.paint_line["line-translate"]),"line-translate-anchor":new Ai(me.paint_line["line-translate-anchor"]),"line-width":new xi(me.paint_line["line-width"]),"line-gap-width":new xi(me.paint_line["line-gap-width"]),"line-offset":new xi(me.paint_line["line-offset"]),"line-blur":new xi(me.paint_line["line-blur"]),"line-dasharray":new es(me.paint_line["line-dasharray"]),"line-pattern":new xa(me.paint_line["line-pattern"]),"line-gradient":new bu(me.paint_line["line-gradient"])})},get layout(){return Zu=Zu||new js({"line-cap":new Ai(me.layout_line["line-cap"]),"line-join":new xi(me.layout_line["line-join"]),"line-miter-limit":new Ai(me.layout_line["line-miter-limit"]),"line-round-limit":new Ai(me.layout_line["line-round-limit"]),"line-sort-key":new xi(me.layout_line["line-sort-key"])})}};class $u extends xi{possiblyEvaluate(U,ne){return ne=new di(Math.floor(ne.zoom),{now:ne.now,fadeDuration:ne.fadeDuration,zoomHistory:ne.zoomHistory,transition:ne.transition}),super.possiblyEvaluate(U,ne)}evaluate(U,ne,pe,ze){return ne=A({},ne,{zoom:Math.floor(ne.zoom)}),super.evaluate(U,ne,pe,ze)}}let Lu;class jp extends kt{constructor(U){super(U,ap),this.gradientVersion=0,Lu||(Lu=new $u(ap.paint.properties["line-width"].specification),Lu.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(U){if(U==="line-gradient"){const ne=this.gradientExpression();(function(pe){return pe._styleExpression!==void 0})(ne)?this.stepInterpolant=ne._styleExpression.expression instanceof Er:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(U,ne){super.recalculate(U,ne),this.paint._values["line-floorwidth"]=Lu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,U)}createBucket(U){return new Ed(U)}queryRadius(U){const ne=U,pe=Bf(tp("line-width",this,ne),tp("line-gap-width",this,ne)),ze=tp("line-offset",this,ne);return pe/2+Math.abs(ze)+If(this.paint.get("line-translate"))}queryIntersectsFeature(U,ne,pe,ze,Ze,Je,ht){const mt=Iu(U,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Je.angle,ht),zt=ht/2*Bf(this.paint.get("line-width").evaluate(ne,pe),this.paint.get("line-gap-width").evaluate(ne,pe)),jt=this.paint.get("line-offset").evaluate(ne,pe);return jt&&(ze=function(Xt,rn){const hn=[];for(let Sn=0;Sn=3){for(let Nn=0;Nn0?U+2*Y:Y}const uu=i([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Cd=i([{name:"a_projected_pos",components:3,type:"Float32"}],4);i([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Id=i([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);i([{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 Yu=i([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),am=i([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Pd(Y,U,ne){return Y.sections.forEach(pe=>{pe.text=function(ze,Ze,Je){const ht=Ze.layout.get("text-transform").evaluate(Je,{});return ht==="uppercase"?ze=ze.toLocaleUpperCase():ht==="lowercase"&&(ze=ze.toLocaleLowerCase()),Cl.applyArabicShaping&&(ze=Cl.applyArabicShaping(ze)),ze}(pe.text,U,ne)}),Y}i([{name:"triangle",components:3,type:"Uint16"}]),i([{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"}]),i([{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"}]),i([{type:"Float32",name:"offsetX"}]),i([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),i([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Up={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var hl=24,V0=vo,op={read:function(Y,U,ne,pe,ze){var Ze,Je,ht=8*ze-pe-1,mt=(1<>1,jt=-7,Xt=ne?ze-1:0,rn=ne?-1:1,hn=Y[U+Xt];for(Xt+=rn,Ze=hn&(1<<-jt)-1,hn>>=-jt,jt+=ht;jt>0;Ze=256*Ze+Y[U+Xt],Xt+=rn,jt-=8);for(Je=Ze&(1<<-jt)-1,Ze>>=-jt,jt+=pe;jt>0;Je=256*Je+Y[U+Xt],Xt+=rn,jt-=8);if(Ze===0)Ze=1-zt;else{if(Ze===mt)return Je?NaN:1/0*(hn?-1:1);Je+=Math.pow(2,pe),Ze-=zt}return(hn?-1:1)*Je*Math.pow(2,Ze-pe)},write:function(Y,U,ne,pe,ze,Ze){var Je,ht,mt,zt=8*Ze-ze-1,jt=(1<>1,rn=ze===23?Math.pow(2,-24)-Math.pow(2,-77):0,hn=pe?0:Ze-1,Sn=pe?1:-1,xn=U<0||U===0&&1/U<0?1:0;for(U=Math.abs(U),isNaN(U)||U===1/0?(ht=isNaN(U)?1:0,Je=jt):(Je=Math.floor(Math.log(U)/Math.LN2),U*(mt=Math.pow(2,-Je))<1&&(Je--,mt*=2),(U+=Je+Xt>=1?rn/mt:rn*Math.pow(2,1-Xt))*mt>=2&&(Je++,mt/=2),Je+Xt>=jt?(ht=0,Je=jt):Je+Xt>=1?(ht=(U*mt-1)*Math.pow(2,ze),Je+=Xt):(ht=U*Math.pow(2,Xt-1)*Math.pow(2,ze),Je=0));ze>=8;Y[ne+hn]=255&ht,hn+=Sn,ht/=256,ze-=8);for(Je=Je<0;Y[ne+hn]=255&Je,hn+=Sn,Je/=256,zt-=8);Y[ne+hn-Sn]|=128*xn}};function vo(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}vo.Varint=0,vo.Fixed64=1,vo.Bytes=2,vo.Fixed32=5;var q0=4294967296,H0=1/q0,Nf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function cu(Y){return Y.type===vo.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function hf(Y,U,ne){return ne?4294967296*U+(Y>>>0):4294967296*(U>>>0)+(Y>>>0)}function G0(Y,U,ne){var pe=U<=16383?1:U<=2097151?2:U<=268435455?3:Math.floor(Math.log(U)/(7*Math.LN2));ne.realloc(pe);for(var ze=ne.pos-1;ze>=Y;ze--)ne.buf[ze+pe]=ne.buf[ze]}function om(Y,U){for(var ne=0;ne>>8,Y[ne+2]=U>>>16,Y[ne+3]=U>>>24}function W0(Y,U){return(Y[U]|Y[U+1]<<8|Y[U+2]<<16)+(Y[U+3]<<24)}vo.prototype={destroy:function(){this.buf=null},readFields:function(Y,U,ne){for(ne=ne||this.length;this.pos>3,Ze=this.pos;this.type=7&pe,Y(ze,U,this),this.pos===Ze&&this.skip(pe)}return U},readMessage:function(Y,U){return this.readFields(Y,U,this.readVarint()+this.pos)},readFixed32:function(){var Y=jf(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=W0(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=jf(this.buf,this.pos)+jf(this.buf,this.pos+4)*q0;return this.pos+=8,Y},readSFixed64:function(){var Y=jf(this.buf,this.pos)+W0(this.buf,this.pos+4)*q0;return this.pos+=8,Y},readFloat:function(){var Y=op.read(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=op.read(this.buf,this.pos,!0,52,8);return this.pos+=8,Y},readVarint:function(Y){var U,ne,pe=this.buf;return U=127&(ne=pe[this.pos++]),ne<128?U:(U|=(127&(ne=pe[this.pos++]))<<7,ne<128?U:(U|=(127&(ne=pe[this.pos++]))<<14,ne<128?U:(U|=(127&(ne=pe[this.pos++]))<<21,ne<128?U:function(ze,Ze,Je){var ht,mt,zt=Je.buf;if(ht=(112&(mt=zt[Je.pos++]))>>4,mt<128||(ht|=(127&(mt=zt[Je.pos++]))<<3,mt<128)||(ht|=(127&(mt=zt[Je.pos++]))<<10,mt<128)||(ht|=(127&(mt=zt[Je.pos++]))<<17,mt<128)||(ht|=(127&(mt=zt[Je.pos++]))<<24,mt<128)||(ht|=(1&(mt=zt[Je.pos++]))<<31,mt<128))return hf(ze,ht,Ze);throw new Error("Expected varint not more than 10 bytes")}(U|=(15&(ne=pe[this.pos]))<<28,Y,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Y=this.readVarint();return Y%2==1?(Y+1)/-2:Y/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Y=this.readVarint()+this.pos,U=this.pos;return this.pos=Y,Y-U>=12&&Nf?function(ne,pe,ze){return Nf.decode(ne.subarray(pe,ze))}(this.buf,U,Y):function(ne,pe,ze){for(var Ze="",Je=pe;Je239?4:jt>223?3:jt>191?2:1;if(Je+rn>ze)break;rn===1?jt<128&&(Xt=jt):rn===2?(192&(ht=ne[Je+1]))==128&&(Xt=(31&jt)<<6|63&ht)<=127&&(Xt=null):rn===3?(ht=ne[Je+1],mt=ne[Je+2],(192&ht)==128&&(192&mt)==128&&((Xt=(15&jt)<<12|(63&ht)<<6|63&mt)<=2047||Xt>=55296&&Xt<=57343)&&(Xt=null)):rn===4&&(ht=ne[Je+1],mt=ne[Je+2],zt=ne[Je+3],(192&ht)==128&&(192&mt)==128&&(192&zt)==128&&((Xt=(15&jt)<<18|(63&ht)<<12|(63&mt)<<6|63&zt)<=65535||Xt>=1114112)&&(Xt=null)),Xt===null?(Xt=65533,rn=1):Xt>65535&&(Xt-=65536,Ze+=String.fromCharCode(Xt>>>10&1023|55296),Xt=56320|1023&Xt),Ze+=String.fromCharCode(Xt),Je+=rn}return Ze}(this.buf,U,Y)},readBytes:function(){var Y=this.readVarint()+this.pos,U=this.buf.subarray(this.pos,Y);return this.pos=Y,U},readPackedVarint:function(Y,U){if(this.type!==vo.Bytes)return Y.push(this.readVarint(U));var ne=cu(this);for(Y=Y||[];this.pos127;);else if(U===vo.Bytes)this.pos=this.readVarint()+this.pos;else if(U===vo.Fixed32)this.pos+=4;else{if(U!==vo.Fixed64)throw new Error("Unimplemented type: "+U);this.pos+=8}},writeTag:function(Y,U){this.writeVarint(Y<<3|U)},realloc:function(Y){for(var U=this.length||16;U268435455||Y<0?function(U,ne){var pe,ze;if(U>=0?(pe=U%4294967296|0,ze=U/4294967296|0):(ze=~(-U/4294967296),4294967295^(pe=~(-U%4294967296))?pe=pe+1|0:(pe=0,ze=ze+1|0)),U>=18446744073709552e3||U<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ne.realloc(10),function(Ze,Je,ht){ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos]=127&Ze}(pe,0,ne),function(Ze,Je){var ht=(7&Ze)<<4;Je.buf[Je.pos++]|=ht|((Ze>>>=3)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze)))))}(ze,ne)}(Y,this):(this.realloc(4),this.buf[this.pos++]=127&Y|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=Y>>>7&127))))},writeSVarint:function(Y){this.writeVarint(Y<0?2*-Y-1:2*Y)},writeBoolean:function(Y){this.writeVarint(!!Y)},writeString:function(Y){Y=String(Y),this.realloc(4*Y.length),this.pos++;var U=this.pos;this.pos=function(pe,ze,Ze){for(var Je,ht,mt=0;mt55295&&Je<57344){if(!ht){Je>56319||mt+1===ze.length?(pe[Ze++]=239,pe[Ze++]=191,pe[Ze++]=189):ht=Je;continue}if(Je<56320){pe[Ze++]=239,pe[Ze++]=191,pe[Ze++]=189,ht=Je;continue}Je=ht-55296<<10|Je-56320|65536,ht=null}else ht&&(pe[Ze++]=239,pe[Ze++]=191,pe[Ze++]=189,ht=null);Je<128?pe[Ze++]=Je:(Je<2048?pe[Ze++]=Je>>6|192:(Je<65536?pe[Ze++]=Je>>12|224:(pe[Ze++]=Je>>18|240,pe[Ze++]=Je>>12&63|128),pe[Ze++]=Je>>6&63|128),pe[Ze++]=63&Je|128)}return Ze}(this.buf,Y,this.pos);var ne=this.pos-U;ne>=128&&G0(U,ne,this),this.pos=U-1,this.writeVarint(ne),this.pos+=ne},writeFloat:function(Y){this.realloc(4),op.write(this.buf,Y,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Y){this.realloc(8),op.write(this.buf,Y,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Y){var U=Y.length;this.writeVarint(U),this.realloc(U);for(var ne=0;ne=128&&G0(ne,pe,this),this.pos=ne-1,this.writeVarint(pe),this.pos+=pe},writeMessage:function(Y,U,ne){this.writeTag(Y,vo.Bytes),this.writeRawMessage(U,ne)},writePackedVarint:function(Y,U){U.length&&this.writeMessage(Y,om,U)},writePackedSVarint:function(Y,U){U.length&&this.writeMessage(Y,Iv,U)},writePackedBoolean:function(Y,U){U.length&&this.writeMessage(Y,um,U)},writePackedFloat:function(Y,U){U.length&&this.writeMessage(Y,sm,U)},writePackedDouble:function(Y,U){U.length&&this.writeMessage(Y,lm,U)},writePackedFixed32:function(Y,U){U.length&&this.writeMessage(Y,cm,U)},writePackedSFixed32:function(Y,U){U.length&&this.writeMessage(Y,Pv,U)},writePackedFixed64:function(Y,U){U.length&&this.writeMessage(Y,Lv,U)},writePackedSFixed64:function(Y,U){U.length&&this.writeMessage(Y,hm,U)},writeBytesField:function(Y,U){this.writeTag(Y,vo.Bytes),this.writeBytes(U)},writeFixed32Field:function(Y,U){this.writeTag(Y,vo.Fixed32),this.writeFixed32(U)},writeSFixed32Field:function(Y,U){this.writeTag(Y,vo.Fixed32),this.writeSFixed32(U)},writeFixed64Field:function(Y,U){this.writeTag(Y,vo.Fixed64),this.writeFixed64(U)},writeSFixed64Field:function(Y,U){this.writeTag(Y,vo.Fixed64),this.writeSFixed64(U)},writeVarintField:function(Y,U){this.writeTag(Y,vo.Varint),this.writeVarint(U)},writeSVarintField:function(Y,U){this.writeTag(Y,vo.Varint),this.writeSVarint(U)},writeStringField:function(Y,U){this.writeTag(Y,vo.Bytes),this.writeString(U)},writeFloatField:function(Y,U){this.writeTag(Y,vo.Fixed32),this.writeFloat(U)},writeDoubleField:function(Y,U){this.writeTag(Y,vo.Fixed64),this.writeDouble(U)},writeBooleanField:function(Y,U){this.writeVarintField(Y,!!U)}};var sp=w(V0);const Ld=3;function zd(Y,U,ne){Y===1&&ne.readMessage(Od,U)}function Od(Y,U,ne){if(Y===3){const{id:pe,bitmap:ze,width:Ze,height:Je,left:ht,top:mt,advance:zt}=ne.readMessage(Dd,{});U.push({id:pe,bitmap:new zh({width:Ze+2*Ld,height:Je+2*Ld},ze),metrics:{width:Ze,height:Je,left:ht,top:mt,advance:zt}})}}function Dd(Y,U,ne){Y===1?U.id=ne.readVarint():Y===2?U.bitmap=ne.readBytes():Y===3?U.width=ne.readVarint():Y===4?U.height=ne.readVarint():Y===5?U.left=ne.readSVarint():Y===6?U.top=ne.readSVarint():Y===7&&(U.advance=ne.readVarint())}const Uf=Ld;function fm(Y){let U=0,ne=0;for(const Je of Y)U+=Je.w*Je.h,ne=Math.max(ne,Je.w);Y.sort((Je,ht)=>ht.h-Je.h);const pe=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(U/.95)),ne),h:1/0}];let ze=0,Ze=0;for(const Je of Y)for(let ht=pe.length-1;ht>=0;ht--){const mt=pe[ht];if(!(Je.w>mt.w||Je.h>mt.h)){if(Je.x=mt.x,Je.y=mt.y,Ze=Math.max(Ze,Je.y+Je.h),ze=Math.max(ze,Je.x+Je.w),Je.w===mt.w&&Je.h===mt.h){const zt=pe.pop();ht=0&&pe>=U&&ih[this.text.charCodeAt(pe)];pe--)ne--;this.text=this.text.substring(U,ne),this.sectionIndex=this.sectionIndex.slice(U,ne)}substring(U,ne){const pe=new ff;return pe.text=this.text.substring(U,ne),pe.sectionIndex=this.sectionIndex.slice(U,ne),pe.sections=this.sections,pe}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((U,ne)=>Math.max(U,this.sections[ne].scale),0)}addTextSection(U,ne){this.text+=U.text,this.sections.push(lp.forText(U.scale,U.fontStack||ne));const pe=this.sections.length-1;for(let ze=0;ze=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function pf(Y,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn){const xn=ff.fromFeature(Y,ze);let Nn;Xt===d.ai.vertical&&xn.verticalizePunctuation();const{processBidirectionalText:Gn,processStyledBidirectionalText:wr}=Cl;if(Gn&&xn.sections.length===1){Nn=[];const Wr=Gn(xn.toString(),$0(xn,zt,Ze,U,pe,hn));for(const pi of Wr){const Ci=new ff;Ci.text=pi,Ci.sections=xn.sections;for(let Vi=0;Vi0&&Ic>Xl&&(Xl=Ic)}else{const no=Ci[ms.fontStack],Wo=no&&no[Do];if(Wo&&Wo.rect)as=Wo.rect,is=Wo.metrics;else{const Ic=pi[ms.fontStack],Vc=Ic&&Ic[Do];if(!Vc)continue;is=Vc.metrics}rs=(ns-ms.scale)*hl}dl?(Wr.verticalizable=!0,Qs.push({glyph:Do,imageName:Vh,x:ra,y:oo+rs,vertical:dl,scale:ms.scale,fontStack:ms.fontStack,sectionIndex:uc,metrics:is,rect:as}),ra+=_c*ms.scale+ti):(Qs.push({glyph:Do,imageName:Vh,x:ra,y:oo+rs,vertical:dl,scale:ms.scale,fontStack:ms.fontStack,sectionIndex:uc,metrics:is,rect:as}),ra+=is.advance*ms.scale+ti)}if(Qs.length!==0){const fu=ra-ti;to=Math.max(fu,to),qp(Qs,0,Qs.length-1,Ou,Xl)}ra=0;const Du=ui*ns+Xl;Uo.lineOffset=Math.max(Xl,Ol),oo+=Du,Is=Math.max(Du,Is),++Js}const Ps=oo-Vf,{horizontalAlign:hu,verticalAlign:Yl}=df(Ii);(function(gs,ns,Ol,Uo,Qs,Xl,Du,fu,ms){const uc=(ns-Ol)*Qs;let Do=0;Do=Xl!==Du?-fu*Uo-Vf:(-Uo*ms+.5)*Du;for(const rs of gs)for(const is of rs.positionedGlyphs)is.x+=uc,is.y+=Do})(Wr.positionedLines,Ou,hu,Yl,to,Is,ui,Ps,ki.length),Wr.top+=-Yl*Ps,Wr.bottom=Wr.top+Ps,Wr.left+=-hu*to,Wr.right=Wr.left+to}(gr,U,ne,pe,Nn,Je,ht,mt,Xt,zt,rn,Sn),!function(Wr){for(const pi of Wr)if(pi.positionedGlyphs.length!==0)return!1;return!0}(or)&&gr}const ih={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},pm={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},dm={40:!0};function gm(Y,U,ne,pe,ze,Ze){if(U.imageName){const Je=pe[U.imageName];return Je?Je.displaySize[0]*U.scale*hl/Ze+ze:0}{const Je=ne[U.fontStack],ht=Je&&Je[Y];return ht?ht.metrics.advance*U.scale+ze:0}}function mm(Y,U,ne,pe){const ze=Math.pow(Y-U,2);return pe?Y=0;let zt=0;for(let Xt=0;XtXt){const rn=Math.ceil(Ze/Xt);ze*=rn/Je,Je=rn}return{x1:pe,y1:ze,x2:pe+Ze,y2:ze+Je}}function Fd(Y,U,ne,pe,ze,Ze){const Je=Y.image;let ht;if(Je.content){const Nn=Je.content,Gn=Je.pixelRatio||1;ht=[Nn[0]/Gn,Nn[1]/Gn,Je.displaySize[0]-Nn[2]/Gn,Je.displaySize[1]-Nn[3]/Gn]}const mt=U.left*Ze,zt=U.right*Ze;let jt,Xt,rn,hn;ne==="width"||ne==="both"?(hn=ze[0]+mt-pe[3],Xt=ze[0]+zt+pe[1]):(hn=ze[0]+(mt+zt-Je.displaySize[0])/2,Xt=hn+Je.displaySize[0]);const Sn=U.top*Ze,xn=U.bottom*Ze;return ne==="height"||ne==="both"?(jt=ze[1]+Sn-pe[0],rn=ze[1]+xn+pe[2]):(jt=ze[1]+(Sn+xn-Je.displaySize[1])/2,rn=jt+Je.displaySize[1]),{image:Je,top:jt,right:Xt,bottom:rn,left:hn,collisionPadding:ht}}const yh=255,xh=128,gf=yh*xh;function Hp(Y,U){const{expression:ne}=U;if(ne.kind==="constant")return{kind:"constant",layoutSize:ne.evaluate(new di(Y+1))};if(ne.kind==="source")return{kind:"source"};{const{zoomStops:pe,interpolationType:ze}=ne;let Ze=0;for(;Zeht.id),this.index=U.index,this.pixelRatio=U.pixelRatio,this.sourceLayerIndex=U.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=xd([]),this.placementViewportMatrix=xd([]);const ne=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Hp(this.zoom,ne["text-size"]),this.iconSizeData=Hp(this.zoom,ne["icon-size"]);const pe=this.layers[0].layout,ze=pe.get("symbol-sort-key"),Ze=pe.get("symbol-z-order");this.canOverlap=X0(pe,"text-overlap","text-allow-overlap")!=="never"||X0(pe,"icon-overlap","icon-allow-overlap")!=="never"||pe.get("text-ignore-placement")||pe.get("icon-ignore-placement"),this.sortFeaturesByKey=Ze!=="viewport-y"&&!ze.isConstant();const Je=Ze==="viewport-y"||Ze==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=Je&&this.canOverlap,pe.get("symbol-placement")==="point"&&(this.writingModes=pe.get("text-writing-mode").map(ht=>d.ai[ht])),this.stateDependentLayerIds=this.layers.filter(ht=>ht.isStateDependent()).map(ht=>ht.id),this.sourceID=U.sourceID}createArrays(){this.text=new jd(new ps(this.layers,this.zoom,U=>/^text/.test(U))),this.icon=new jd(new ps(this.layers,this.zoom,U=>/^icon/.test(U))),this.glyphOffsetArray=new dr,this.lineVertexArray=new Br,this.symbolInstances=new Lr,this.textAnchorOffsets=new Vr}calculateGlyphDependencies(U,ne,pe,ze,Ze){for(let Je=0;Je0)&&(Je.value.kind!=="constant"||Je.value.value.length>0),jt=mt.value.kind!=="constant"||!!mt.value.value||Object.keys(mt.parameters).length>0,Xt=Ze.get("symbol-sort-key");if(this.features=[],!zt&&!jt)return;const rn=ne.iconDependencies,hn=ne.glyphDependencies,Sn=ne.availableImages,xn=new di(this.zoom);for(const{feature:Nn,id:Gn,index:wr,sourceLayerIndex:or}of U){const gr=ze._featureFilter.needGeometry,Wr=Ph(Nn,gr);if(!ze._featureFilter.filter(xn,Wr,pe))continue;let pi,Ci;if(gr||(Wr.geometry=eh(Nn)),zt){const ui=ze.getValueAndResolveTokens("text-field",Wr,pe,Sn),Ii=In.factory(ui),Oi=this.hasRTLText=this.hasRTLText||vm(Ii);(!Oi||Cl.getRTLTextPluginStatus()==="unavailable"||Oi&&Cl.isParsed())&&(pi=Pd(Ii,ze,Wr))}if(jt){const ui=ze.getValueAndResolveTokens("icon-image",Wr,pe,Sn);Ci=ui instanceof Ln?ui:Ln.fromString(ui)}if(!pi&&!Ci)continue;const Vi=this.sortFeaturesByKey?Xt.evaluate(Wr,{},pe):void 0,ki={id:Gn,text:pi,icon:Ci,index:wr,sourceLayerIndex:or,geometry:Wr.geometry,properties:Nn.properties,type:Ov[Nn.type],sortKey:Vi};if(this.features.push(ki),Ci&&(rn[Ci.name]=!0),pi){const ui=Je.evaluate(Wr,{},pe).join(","),Ii=Ze.get("text-rotation-alignment")!=="viewport"&&Ze.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(d.ai.vertical)>=0;for(const Oi of pi.sections)if(Oi.image)rn[Oi.image.name]=!0;else{const Si=Io(pi.toString()),ti=Oi.fontStack||ui,Di=hn[ti]=hn[ti]||{};this.calculateGlyphDependencies(Oi.text,Di,Ii,this.allowVerticalPlacement,Si)}}}Ze.get("symbol-placement")==="line"&&(this.features=function(Nn){const Gn={},wr={},or=[];let gr=0;function Wr(ki){or.push(Nn[ki]),gr++}function pi(ki,ui,Ii){const Oi=wr[ki];return delete wr[ki],wr[ui]=Oi,or[Oi].geometry[0].pop(),or[Oi].geometry[0]=or[Oi].geometry[0].concat(Ii[0]),Oi}function Ci(ki,ui,Ii){const Oi=Gn[ui];return delete Gn[ui],Gn[ki]=Oi,or[Oi].geometry[0].shift(),or[Oi].geometry[0]=Ii[0].concat(or[Oi].geometry[0]),Oi}function Vi(ki,ui,Ii){const Oi=Ii?ui[0][ui[0].length-1]:ui[0][0];return`${ki}:${Oi.x}:${Oi.y}`}for(let ki=0;kiki.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Nn,Gn)=>Nn.sortKey-Gn.sortKey)}update(U,ne,pe){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(U,ne,this.layers,pe),this.icon.programConfigurations.updatePaintArrays(U,ne,this.layers,pe))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(U){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(U),this.iconCollisionBox.upload(U)),this.text.upload(U,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(U,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(U,ne){const pe=this.lineVertexArray.length;if(U.segment!==void 0){let ze=U.dist(ne[U.segment+1]),Ze=U.dist(ne[U.segment]);const Je={};for(let ht=U.segment+1;ht=0;ht--)Je[ht]={x:ne[ht].x,y:ne[ht].y,tileUnitDistanceFromAnchor:Ze},ht>0&&(Ze+=ne[ht-1].dist(ne[ht]));for(let ht=0;ht0}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(U,ne){const pe=U.placedSymbolArray.get(ne),ze=pe.vertexStartIndex+4*pe.numGlyphs;for(let Ze=pe.vertexStartIndex;Zeze[ht]-ze[mt]||Ze[mt]-Ze[ht]),Je}addToSortKeyRanges(U,ne){const pe=this.sortKeyRanges[this.sortKeyRanges.length-1];pe&&pe.sortKey===ne?pe.symbolInstanceEnd=U+1:this.sortKeyRanges.push({sortKey:ne,symbolInstanceStart:U,symbolInstanceEnd:U+1})}sortFeatures(U){if(this.sortFeaturesByY&&this.sortedAngle!==U&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(U),this.sortedAngle=U,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const ne of this.symbolInstanceIndexes){const pe=this.symbolInstances.get(ne);this.featureSortOrder.push(pe.featureIndex),[pe.rightJustifiedTextSymbolIndex,pe.centerJustifiedTextSymbolIndex,pe.leftJustifiedTextSymbolIndex].forEach((ze,Ze,Je)=>{ze>=0&&Je.indexOf(ze)===Ze&&this.addIndicesForPlacedSymbol(this.text,ze)}),pe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,pe.verticalPlacedTextSymbolIndex),pe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,pe.placedIconSymbolIndex),pe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,pe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let mf;cn("SymbolBucket",Nh,{omit:["layers","collisionBoxArray","features","compareText"]}),Nh.MAX_GLYPHS=65535,Nh.addDynamicAttributes=Nd;let Vd;var ah={get paint(){return Vd=Vd||new js({"icon-opacity":new xi(me.paint_symbol["icon-opacity"]),"icon-color":new xi(me.paint_symbol["icon-color"]),"icon-halo-color":new xi(me.paint_symbol["icon-halo-color"]),"icon-halo-width":new xi(me.paint_symbol["icon-halo-width"]),"icon-halo-blur":new xi(me.paint_symbol["icon-halo-blur"]),"icon-translate":new Ai(me.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ai(me.paint_symbol["icon-translate-anchor"]),"text-opacity":new xi(me.paint_symbol["text-opacity"]),"text-color":new xi(me.paint_symbol["text-color"],{runtimeType:De,getOverride:Y=>Y.textColor,hasOverride:Y=>!!Y.textColor}),"text-halo-color":new xi(me.paint_symbol["text-halo-color"]),"text-halo-width":new xi(me.paint_symbol["text-halo-width"]),"text-halo-blur":new xi(me.paint_symbol["text-halo-blur"]),"text-translate":new Ai(me.paint_symbol["text-translate"]),"text-translate-anchor":new Ai(me.paint_symbol["text-translate-anchor"])})},get layout(){return mf=mf||new js({"symbol-placement":new Ai(me.layout_symbol["symbol-placement"]),"symbol-spacing":new Ai(me.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ai(me.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new xi(me.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ai(me.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ai(me.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ai(me.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ai(me.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ai(me.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ai(me.layout_symbol["icon-rotation-alignment"]),"icon-size":new xi(me.layout_symbol["icon-size"]),"icon-text-fit":new Ai(me.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ai(me.layout_symbol["icon-text-fit-padding"]),"icon-image":new xi(me.layout_symbol["icon-image"]),"icon-rotate":new xi(me.layout_symbol["icon-rotate"]),"icon-padding":new xi(me.layout_symbol["icon-padding"]),"icon-keep-upright":new Ai(me.layout_symbol["icon-keep-upright"]),"icon-offset":new xi(me.layout_symbol["icon-offset"]),"icon-anchor":new xi(me.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ai(me.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ai(me.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ai(me.layout_symbol["text-rotation-alignment"]),"text-field":new xi(me.layout_symbol["text-field"]),"text-font":new xi(me.layout_symbol["text-font"]),"text-size":new xi(me.layout_symbol["text-size"]),"text-max-width":new xi(me.layout_symbol["text-max-width"]),"text-line-height":new Ai(me.layout_symbol["text-line-height"]),"text-letter-spacing":new xi(me.layout_symbol["text-letter-spacing"]),"text-justify":new xi(me.layout_symbol["text-justify"]),"text-radial-offset":new xi(me.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ai(me.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new xi(me.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new xi(me.layout_symbol["text-anchor"]),"text-max-angle":new Ai(me.layout_symbol["text-max-angle"]),"text-writing-mode":new Ai(me.layout_symbol["text-writing-mode"]),"text-rotate":new xi(me.layout_symbol["text-rotate"]),"text-padding":new Ai(me.layout_symbol["text-padding"]),"text-keep-upright":new Ai(me.layout_symbol["text-keep-upright"]),"text-transform":new xi(me.layout_symbol["text-transform"]),"text-offset":new xi(me.layout_symbol["text-offset"]),"text-allow-overlap":new Ai(me.layout_symbol["text-allow-overlap"]),"text-overlap":new Ai(me.layout_symbol["text-overlap"]),"text-ignore-placement":new Ai(me.layout_symbol["text-ignore-placement"]),"text-optional":new Ai(me.layout_symbol["text-optional"])})}};class K0{constructor(U){if(U.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=U.property.overrides?U.property.overrides.runtimeType:qe,this.defaultValue=U}evaluate(U){if(U.formattedSection){const ne=this.defaultValue.property.overrides;if(ne&&ne.hasOverride(U.formattedSection))return ne.getOverride(U.formattedSection)}return U.feature&&U.featureState?this.defaultValue.evaluate(U.feature,U.featureState):this.defaultValue.property.specification.default}eachChild(U){this.defaultValue.isConstant()||U(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}cn("FormatSectionOverride",K0,{omit:["defaultValue"]});class ds extends kt{constructor(U){super(U,ah)}recalculate(U,ne){if(super.recalculate(U,ne),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const pe=this.layout.get("text-writing-mode");if(pe){const ze=[];for(const Ze of pe)ze.indexOf(Ze)<0&&ze.push(Ze);this.layout._values["text-writing-mode"]=ze}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(U,ne,pe,ze){const Ze=this.layout.get(U).evaluate(ne,{},pe,ze),Je=this._unevaluatedLayout._values[U];return Je.isDataDriven()||Ws(Je.value)||!Ze?Ze:function(ht,mt){return mt.replace(/{([^{}]+)}/g,(zt,jt)=>ht&&jt in ht?String(ht[jt]):"")}(ne.properties,Ze)}createBucket(U){return new Nh(U)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const U of ah.paint.overridableProperties){if(!ds.hasPaintOverride(this.layout,U))continue;const ne=this.paint.get(U),pe=new K0(ne),ze=new ls(pe,ne.property.specification);let Ze=null;Ze=ne.value.kind==="constant"||ne.value.kind==="source"?new Zs("source",ze):new vu("composite",ze,ne.value.zoomStops),this.paint._values[U]=new da(ne.property,Ze,ne.parameters)}}_handleOverridablePaintPropertyUpdate(U,ne,pe){return!(!this.layout||ne.isDataDriven()||pe.isDataDriven())&&ds.hasPaintOverride(this.layout,U)}static hasPaintOverride(U,ne){const pe=U.get("text-field"),ze=ah.paint.properties[ne];let Ze=!1;const Je=ht=>{for(const mt of ht)if(ze.overrides&&ze.overrides.hasOverride(mt))return void(Ze=!0)};if(pe.value.kind==="constant"&&pe.value.value instanceof In)Je(pe.value.value.sections);else if(pe.value.kind==="source"){const ht=zt=>{if(!Ze)if(zt instanceof Jn&&wn(zt.value)===nt){const jt=zt.value;Je(jt.sections)}else zt instanceof $r?Je(zt.sections):zt.eachChild(ht)},mt=pe.value;mt._styleExpression&&ht(mt._styleExpression.expression)}return Ze}}let qd;var zo={get paint(){return qd=qd||new js({"background-color":new Ai(me.paint_background["background-color"]),"background-pattern":new es(me.paint_background["background-pattern"]),"background-opacity":new Ai(me.paint_background["background-opacity"])})}};class J0 extends kt{constructor(U){super(U,zo)}}let Hd;var Q0={get paint(){return Hd=Hd||new js({"raster-opacity":new Ai(me.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ai(me.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ai(me.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ai(me.paint_raster["raster-brightness-max"]),"raster-saturation":new Ai(me.paint_raster["raster-saturation"]),"raster-contrast":new Ai(me.paint_raster["raster-contrast"]),"raster-resampling":new Ai(me.paint_raster["raster-resampling"]),"raster-fade-duration":new Ai(me.paint_raster["raster-fade-duration"])})}};class eg extends kt{constructor(U){super(U,Q0)}}class ym extends kt{constructor(U){super(U,{}),this.onAdd=ne=>{this.implementation.onAdd&&this.implementation.onAdd(ne,ne.painter.context.gl)},this.onRemove=ne=>{this.implementation.onRemove&&this.implementation.onRemove(ne,ne.painter.context.gl)},this.implementation=U}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class tg{constructor(U){this._methodToThrottle=U,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const jh=63710088e-1;class zu{constructor(U,ne){if(isNaN(U)||isNaN(ne))throw new Error(`Invalid LngLat object: (${U}, ${ne})`);if(this.lng=+U,this.lat=+ne,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new zu(k(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(U){const ne=Math.PI/180,pe=this.lat*ne,ze=U.lat*ne,Ze=Math.sin(pe)*Math.sin(ze)+Math.cos(pe)*Math.cos(ze)*Math.cos((U.lng-this.lng)*ne);return jh*Math.acos(Math.min(Ze,1))}static convert(U){if(U instanceof zu)return U;if(Array.isArray(U)&&(U.length===2||U.length===3))return new zu(Number(U[0]),Number(U[1]));if(!Array.isArray(U)&&typeof U=="object"&&U!==null)return new zu(Number("lng"in U?U.lng:U.lon),Number(U.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 up=2*Math.PI*jh;function Us(Y){return up*Math.cos(Y*Math.PI/180)}function cp(Y){return(180+Y)/360}function Uc(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function hp(Y,U){return Y/Us(U)}function fp(Y){const U=180-360*Y;return 360/Math.PI*Math.atan(Math.exp(U*Math.PI/180))-90}class pp{constructor(U,ne,pe=0){this.x=+U,this.y=+ne,this.z=+pe}static fromLngLat(U,ne=0){const pe=zu.convert(U);return new pp(cp(pe.lng),Uc(pe.lat),hp(ne,pe.lat))}toLngLat(){return new zu(360*this.x-180,fp(this.y))}toAltitude(){return U=this.z,ne=this.y,U*Us(fp(ne));var U,ne}meterInMercatorCoordinateUnits(){return 1/up*(U=fp(this.y),1/Math.cos(U*Math.PI/180));var U}}function qf(Y,U,ne){var pe=2*Math.PI*6378137/256/Math.pow(2,ne);return[Y*pe-2*Math.PI*6378137/2,U*pe-2*Math.PI*6378137/2]}class oh{constructor(U,ne,pe){if(U<0||U>25||pe<0||pe>=Math.pow(2,U)||ne<0||ne>=Math.pow(2,U))throw new Error(`x=${ne}, y=${pe}, z=${U} outside of bounds. 0<=x<${Math.pow(2,U)}, 0<=y<${Math.pow(2,U)} 0<=z<=25 `);this.z=U,this.x=ne,this.y=pe,this.key=Gp(0,U,U,ne,pe)}equals(U){return this.z===U.z&&this.x===U.x&&this.y===U.y}url(U,ne,pe){const ze=(Je=this.x,ht=this.y,mt=this.z,zt=qf(256*Je,256*(ht=Math.pow(2,mt)-ht-1),mt),jt=qf(256*(Je+1),256*(ht+1),mt),zt[0]+","+zt[1]+","+jt[0]+","+jt[1]),Ze=function(Xt,rn,hn){let Sn,xn="";for(let Nn=Xt;Nn>0;Nn--)Sn=1<1?"@2x":"").replace(/{quadkey}/g,Ze).replace(/{bbox-epsg-3857}/g,ze)}isChildOf(U){const ne=this.z-U.z;return ne>0&&U.x===this.x>>ne&&U.y===this.y>>ne}getTilePoint(U){const ne=Math.pow(2,this.z);return new u((U.x*ne-this.x)*Ss,(U.y*ne-this.y)*Ss)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ng{constructor(U,ne){this.wrap=U,this.canonical=ne,this.key=Gp(U,ne.z,ne.z,ne.x,ne.y)}}class xc{constructor(U,ne,pe,ze,Ze){if(U= z; overscaledZ = ${U}; z = ${pe}`);this.overscaledZ=U,this.wrap=ne,this.canonical=new oh(pe,+ze,+Ze),this.key=Gp(ne,U,pe,ze,Ze)}clone(){return new xc(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(U){return this.overscaledZ===U.overscaledZ&&this.wrap===U.wrap&&this.canonical.equals(U.canonical)}scaledTo(U){if(U>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${U}; overscaledZ = ${this.overscaledZ}`);const ne=this.canonical.z-U;return U>this.canonical.z?new xc(U,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xc(U,this.wrap,U,this.canonical.x>>ne,this.canonical.y>>ne)}calculateScaledKey(U,ne){if(U>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${U}; overscaledZ = ${this.overscaledZ}`);const pe=this.canonical.z-U;return U>this.canonical.z?Gp(this.wrap*+ne,U,this.canonical.z,this.canonical.x,this.canonical.y):Gp(this.wrap*+ne,U,U,this.canonical.x>>pe,this.canonical.y>>pe)}isChildOf(U){if(U.wrap!==this.wrap)return!1;const ne=this.canonical.z-U.canonical.z;return U.overscaledZ===0||U.overscaledZ>ne&&U.canonical.y===this.canonical.y>>ne}children(U){if(this.overscaledZ>=U)return[new xc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const ne=this.canonical.z+1,pe=2*this.canonical.x,ze=2*this.canonical.y;return[new xc(ne,this.wrap,ne,pe,ze),new xc(ne,this.wrap,ne,pe+1,ze),new xc(ne,this.wrap,ne,pe,ze+1),new xc(ne,this.wrap,ne,pe+1,ze+1)]}isLessThan(U){return this.wrapU.wrap)&&(this.overscaledZU.overscaledZ)&&(this.canonical.xU.canonical.x)&&this.canonical.ythis.max&&(this.max=Xt),Xt=this.dim+1||ne<-1||ne>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(ne+1)*this.stride+(U+1)}unpack(U,ne,pe){return U*this.redFactor+ne*this.greenFactor+pe*this.blueFactor-this.baseShift}getPixels(){return new sc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(U,ne,pe){if(this.dim!==U.dim)throw new Error("dem dimension mismatch");let ze=ne*this.dim,Ze=ne*this.dim+this.dim,Je=pe*this.dim,ht=pe*this.dim+this.dim;switch(ne){case-1:ze=Ze-1;break;case 1:Ze=ze+1}switch(pe){case-1:Je=ht-1;break;case 1:ht=Je+1}const mt=-ne*this.dim,zt=-pe*this.dim;for(let jt=Je;jt=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${U} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[U]}}class rg{constructor(U,ne,pe,ze,Ze){this.type="Feature",this._vectorTileFeature=U,U._z=ne,U._x=pe,U._y=ze,this.properties=U.properties,this.id=Ze}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(U){this._geometry=U}toJSON(){const U={geometry:this.geometry};for(const ne in this)ne!=="_geometry"&&ne!=="_vectorTileFeature"&&(U[ne]=this[ne]);return U}}class P{constructor(U,ne){this.tileID=U,this.x=U.canonical.x,this.y=U.canonical.y,this.z=U.canonical.z,this.grid=new Jo(Ss,16,0),this.grid3D=new Jo(Ss,16,0),this.featureIndexArray=new Nr,this.promoteId=ne}insert(U,ne,pe,ze,Ze,Je){const ht=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(pe,ze,Ze);const mt=Je?this.grid3D:this.grid;for(let zt=0;zt=0&&Xt[3]>=0&&mt.insert(ht,Xt[0],Xt[1],Xt[2],Xt[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Rh.VectorTile(new sp(this.rawTileData)).layers,this.sourceLayerCoder=new Uh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(U,ne,pe,ze){this.loadVTLayers();const Ze=U.params||{},Je=Ss/U.tileSize/U.scale,ht=Ua(Ze.filter),mt=U.queryGeometry,zt=U.queryPadding*Je,jt=re(mt),Xt=this.grid.query(jt.minX-zt,jt.minY-zt,jt.maxX+zt,jt.maxY+zt),rn=re(U.cameraQueryGeometry),hn=this.grid3D.query(rn.minX-zt,rn.minY-zt,rn.maxX+zt,rn.maxY+zt,(Nn,Gn,wr,or)=>function(gr,Wr,pi,Ci,Vi){for(const ui of gr)if(Wr<=ui.x&&pi<=ui.y&&Ci>=ui.x&&Vi>=ui.y)return!0;const ki=[new u(Wr,pi),new u(Wr,Vi),new u(Ci,Vi),new u(Ci,pi)];if(gr.length>2){for(const ui of ki)if(Cf(gr,ui))return!0}for(let ui=0;ui(or||(or=eh(gr)),Wr.queryIntersectsFeature(mt,gr,pi,or,this.z,U.transform,Je,U.pixelPosMatrix)))}return Sn}loadMatchingFeature(U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt){const rn=this.bucketLayerIDs[ne];if(Je&&!function(Nn,Gn){for(let wr=0;wr=0)return!0;return!1}(Je,rn))return;const hn=this.sourceLayerCoder.decode(pe),Sn=this.vtLayers[hn].feature(ze);if(Ze.needGeometry){const Nn=Ph(Sn,!0);if(!Ze.filter(new di(this.tileID.overscaledZ),Nn,this.tileID.canonical))return}else if(!Ze.filter(new di(this.tileID.overscaledZ),Sn))return;const xn=this.getId(Sn,hn);for(let Nn=0;Nn{const ht=U instanceof Ys?U.get(Je):null;return ht&&ht.evaluate?ht.evaluate(ne,pe,ze):ht})}function re(Y){let U=1/0,ne=1/0,pe=-1/0,ze=-1/0;for(const Ze of Y)U=Math.min(U,Ze.x),ne=Math.min(ne,Ze.y),pe=Math.max(pe,Ze.x),ze=Math.max(ze,Ze.y);return{minX:U,minY:ne,maxX:pe,maxY:ze}}function we(Y,U){return U-Y}function je(Y,U,ne,pe,ze){const Ze=[];for(let Je=0;Je=pe&&Xt.x>=pe||(jt.x>=pe?jt=new u(pe,jt.y+(Xt.y-jt.y)*((pe-jt.x)/(Xt.x-jt.x)))._round():Xt.x>=pe&&(Xt=new u(pe,jt.y+(Xt.y-jt.y)*((pe-jt.x)/(Xt.x-jt.x)))._round()),jt.y>=ze&&Xt.y>=ze||(jt.y>=ze?jt=new u(jt.x+(Xt.x-jt.x)*((ze-jt.y)/(Xt.y-jt.y)),ze)._round():Xt.y>=ze&&(Xt=new u(jt.x+(Xt.x-jt.x)*((ze-jt.y)/(Xt.y-jt.y)),ze)._round()),mt&&jt.equals(mt[mt.length-1])||(mt=[jt],Ze.push(mt)),mt.push(Xt)))))}}return Ze}cn("FeatureIndex",P,{omit:["rawTileData","sourceLayerCoder"]});class Ke extends u{constructor(U,ne,pe,ze){super(U,ne),this.angle=pe,ze!==void 0&&(this.segment=ze)}clone(){return new Ke(this.x,this.y,this.angle,this.segment)}}function ot(Y,U,ne,pe,ze){if(U.segment===void 0||ne===0)return!0;let Ze=U,Je=U.segment+1,ht=0;for(;ht>-ne/2;){if(Je--,Je<0)return!1;ht-=Y[Je].dist(Ze),Ze=Y[Je]}ht+=Y[Je].dist(Y[Je+1]),Je++;const mt=[];let zt=0;for(;htpe;)zt-=mt.shift().angleDelta;if(zt>ze)return!1;Je++,ht+=Xt.dist(rn)}return!0}function _t(Y){let U=0;for(let ne=0;nezt){const Sn=(zt-mt)/hn,xn=gn.number(Xt.x,rn.x,Sn),Nn=gn.number(Xt.y,rn.y,Sn),Gn=new Ke(xn,Nn,rn.angleTo(Xt),jt);return Gn._round(),!Je||ot(Y,Gn,ht,Je,U)?Gn:void 0}mt+=hn}}function sn(Y,U,ne,pe,ze,Ze,Je,ht,mt){const zt=Rt(pe,Ze,Je),jt=Kt(pe,ze),Xt=jt*Je,rn=Y[0].x===0||Y[0].x===mt||Y[0].y===0||Y[0].y===mt;return U-Xt=0&&gr=0&&Wr=0&&rn+zt<=jt){const pi=new Ke(gr,Wr,wr,Sn);pi._round(),pe&&!ot(Y,pi,Ze,pe,ze)||hn.push(pi)}}Xt+=Gn}return ht||hn.length||Je||(hn=yn(Y,Xt/2,ne,pe,ze,Ze,Je,!0,mt)),hn}cn("Anchor",Ke);const fn=Xu;function On(Y,U,ne,pe){const ze=[],Ze=Y.image,Je=Ze.pixelRatio,ht=Ze.paddedRect.w-2*fn,mt=Ze.paddedRect.h-2*fn;let zt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const jt=Ze.stretchX||[[0,ht]],Xt=Ze.stretchY||[[0,mt]],rn=(ti,Di)=>ti+Di[1]-Di[0],hn=jt.reduce(rn,0),Sn=Xt.reduce(rn,0),xn=ht-hn,Nn=mt-Sn;let Gn=0,wr=hn,or=0,gr=Sn,Wr=0,pi=xn,Ci=0,Vi=Nn;if(Ze.content&&pe){const ti=Ze.content,Di=ti[2]-ti[0],Bi=ti[3]-ti[1];(Ze.textFitWidth||Ze.textFitHeight)&&(zt=Y0(Y)),Gn=jn(jt,0,ti[0]),or=jn(Xt,0,ti[1]),wr=jn(jt,ti[0],ti[2]),gr=jn(Xt,ti[1],ti[3]),Wr=ti[0]-Gn,Ci=ti[1]-or,pi=Di-wr,Vi=Bi-gr}const ki=zt.x1,ui=zt.y1,Ii=zt.x2-ki,Oi=zt.y2-ui,Si=(ti,Di,Bi,ra)=>{const oo=ir(ti.stretch-Gn,wr,Ii,ki),to=kr(ti.fixed-Wr,pi,ti.stretch,hn),Is=ir(Di.stretch-or,gr,Oi,ui),Ou=kr(Di.fixed-Ci,Vi,Di.stretch,Sn),Js=ir(Bi.stretch-Gn,wr,Ii,ki),Ps=kr(Bi.fixed-Wr,pi,Bi.stretch,hn),hu=ir(ra.stretch-or,gr,Oi,ui),Yl=kr(ra.fixed-Ci,Vi,ra.stretch,Sn),gs=new u(oo,Is),ns=new u(Js,Is),Ol=new u(Js,hu),Uo=new u(oo,hu),Qs=new u(to/Je,Ou/Je),Xl=new u(Ps/Je,Yl/Je),Du=U*Math.PI/180;if(Du){const rs=Math.sin(Du),is=Math.cos(Du),as=[is,-rs,rs,is];gs._matMult(as),ns._matMult(as),Uo._matMult(as),Ol._matMult(as)}const fu=ti.stretch+ti.fixed,ms=Bi.stretch+Bi.fixed,uc=Di.stretch+Di.fixed,Do=ra.stretch+ra.fixed;return{tl:gs,tr:ns,bl:Uo,br:Ol,tex:{x:Ze.paddedRect.x+fn+fu,y:Ze.paddedRect.y+fn+uc,w:ms-fu,h:Do-uc},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Qs,pixelOffsetBR:Xl,minFontScaleX:pi/Je/Ii,minFontScaleY:Vi/Je/Oi,isSDF:ne}};if(pe&&(Ze.stretchX||Ze.stretchY)){const ti=sr(jt,xn,hn),Di=sr(Xt,Nn,Sn);for(let Bi=0;Bi0&&(xn=Math.max(10,xn),this.circleDiameter=xn)}else{const rn=!((Xt=Je.image)===null||Xt===void 0)&&Xt.content&&(Je.image.textFitWidth||Je.image.textFitHeight)?Y0(Je):{x1:Je.left,y1:Je.top,x2:Je.right,y2:Je.bottom};rn.y1=rn.y1*ht-mt[0],rn.y2=rn.y2*ht+mt[2],rn.x1=rn.x1*ht-mt[3],rn.x2=rn.x2*ht+mt[1];const hn=Je.collisionPadding;if(hn&&(rn.x1-=hn[0]*ht,rn.y1-=hn[1]*ht,rn.x2+=hn[2]*ht,rn.y2+=hn[3]*ht),jt){const Sn=new u(rn.x1,rn.y1),xn=new u(rn.x2,rn.y1),Nn=new u(rn.x1,rn.y2),Gn=new u(rn.x2,rn.y2),wr=jt*Math.PI/180;Sn._rotate(wr),xn._rotate(wr),Nn._rotate(wr),Gn._rotate(wr),rn.x1=Math.min(Sn.x,xn.x,Nn.x,Gn.x),rn.x2=Math.max(Sn.x,xn.x,Nn.x,Gn.x),rn.y1=Math.min(Sn.y,xn.y,Nn.y,Gn.y),rn.y2=Math.max(Sn.y,xn.y,Nn.y,Gn.y)}U.emplaceBack(ne.x,ne.y,rn.x1,rn.y1,rn.x2,rn.y2,pe,ze,Ze)}this.boxEndIndex=U.length}}class Fr{constructor(U=[],ne=(pe,ze)=>peze?1:0){if(this.data=U,this.length=this.data.length,this.compare=ne,this.length>0)for(let pe=(this.length>>1)-1;pe>=0;pe--)this._down(pe)}push(U){this.data.push(U),this._up(this.length++)}pop(){if(this.length===0)return;const U=this.data[0],ne=this.data.pop();return--this.length>0&&(this.data[0]=ne,this._down(0)),U}peek(){return this.data[0]}_up(U){const{data:ne,compare:pe}=this,ze=ne[U];for(;U>0;){const Ze=U-1>>1,Je=ne[Ze];if(pe(ze,Je)>=0)break;ne[U]=Je,U=Ze}ne[U]=ze}_down(U){const{data:ne,compare:pe}=this,ze=this.length>>1,Ze=ne[U];for(;U=0)break;ne[U]=ne[Je],U=Je}ne[U]=Ze}}function Gr(Y,U=1,ne=!1){let pe=1/0,ze=1/0,Ze=-1/0,Je=-1/0;const ht=Y[0];for(let xn=0;xnZe)&&(Ze=Nn.x),(!xn||Nn.y>Je)&&(Je=Nn.y)}const mt=Ze-pe,zt=Je-ze,jt=Math.min(mt,zt);let Xt=jt/2;const rn=new Fr([],qr);if(jt===0)return new u(pe,ze);for(let xn=pe;xnhn.d||!hn.d)&&(hn=xn,ne&&console.log("found best %d after %d probes",Math.round(1e4*xn.d)/1e4,Sn)),xn.max-hn.d<=U||(Xt=xn.h/2,rn.push(new ri(xn.p.x-Xt,xn.p.y-Xt,Xt,Y)),rn.push(new ri(xn.p.x+Xt,xn.p.y-Xt,Xt,Y)),rn.push(new ri(xn.p.x-Xt,xn.p.y+Xt,Xt,Y)),rn.push(new ri(xn.p.x+Xt,xn.p.y+Xt,Xt,Y)),Sn+=4)}return ne&&(console.log(`num probes: ${Sn}`),console.log(`best distance: ${hn.d}`)),hn.p}function qr(Y,U){return U.max-Y.max}function ri(Y,U,ne,pe){this.p=new u(Y,U),this.h=ne,this.d=function(ze,Ze){let Je=!1,ht=1/0;for(let mt=0;mtze.y!=Sn.y>ze.y&&ze.x<(Sn.x-hn.x)*(ze.y-hn.y)/(Sn.y-hn.y)+hn.x&&(Je=!Je),ht=Math.min(ht,C0(ze,hn,Sn))}}return(Je?1:-1)*Math.sqrt(ht)}(this.p,pe),this.max=this.d+this.h*Math.SQRT2}var ei;d.ar=void 0,(ei=d.ar||(d.ar={}))[ei.center=1]="center",ei[ei.left=2]="left",ei[ei.right=3]="right",ei[ei.top=4]="top",ei[ei.bottom=5]="bottom",ei[ei["top-left"]=6]="top-left",ei[ei["top-right"]=7]="top-right",ei[ei["bottom-left"]=8]="bottom-left",ei[ei["bottom-right"]=9]="bottom-right";const vi=7,Ei=Number.POSITIVE_INFINITY;function aa(Y,U){return U[1]!==Ei?function(ne,pe,ze){let Ze=0,Je=0;switch(pe=Math.abs(pe),ze=Math.abs(ze),ne){case"top-right":case"top-left":case"top":Je=ze-vi;break;case"bottom-right":case"bottom-left":case"bottom":Je=-ze+vi}switch(ne){case"top-right":case"bottom-right":case"right":Ze=-pe;break;case"top-left":case"bottom-left":case"left":Ze=pe}return[Ze,Je]}(Y,U[0],U[1]):function(ne,pe){let ze=0,Ze=0;pe<0&&(pe=0);const Je=pe/Math.SQRT2;switch(ne){case"top-right":case"top-left":Ze=Je-vi;break;case"bottom-right":case"bottom-left":Ze=-Je+vi;break;case"bottom":Ze=-pe+vi;break;case"top":Ze=pe-vi}switch(ne){case"top-right":case"bottom-right":ze=-Je;break;case"top-left":case"bottom-left":ze=Je;break;case"left":ze=pe;break;case"right":ze=-pe}return[ze,Ze]}(Y,U[0])}function Ni(Y,U,ne){var pe;const ze=Y.layout,Ze=(pe=ze.get("text-variable-anchor-offset"))===null||pe===void 0?void 0:pe.evaluate(U,{},ne);if(Ze){const ht=Ze.values,mt=[];for(let zt=0;ztrn*hl);jt.startsWith("top")?Xt[1]-=vi:jt.startsWith("bottom")&&(Xt[1]+=vi),mt[zt+1]=Xt}return new Kn(mt)}const Je=ze.get("text-variable-anchor");if(Je){let ht;ht=Y._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[ze.get("text-radial-offset").evaluate(U,{},ne)*hl,Ei]:ze.get("text-offset").evaluate(U,{},ne).map(zt=>zt*hl);const mt=[];for(const zt of Je)mt.push(zt,aa(zt,ht));return new Kn(mt)}return null}function Qi(Y){switch(Y){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qi(Y,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt){let Xt=Ze.textMaxSize.evaluate(U,{});Xt===void 0&&(Xt=Je);const rn=Y.layers[0].layout,hn=rn.get("icon-offset").evaluate(U,{},jt),Sn=Ea(ne.horizontal),xn=Je/24,Nn=Y.tilePixelRatio*xn,Gn=Y.tilePixelRatio*Xt/24,wr=Y.tilePixelRatio*ht,or=Y.tilePixelRatio*rn.get("symbol-spacing"),gr=rn.get("text-padding")*Y.tilePixelRatio,Wr=function(ti,Di,Bi,ra=1){const oo=ti.get("icon-padding").evaluate(Di,{},Bi),to=oo&&oo.values;return[to[0]*ra,to[1]*ra,to[2]*ra,to[3]*ra]}(rn,U,jt,Y.tilePixelRatio),pi=rn.get("text-max-angle")/180*Math.PI,Ci=rn.get("text-rotation-alignment")!=="viewport"&&rn.get("symbol-placement")!=="point",Vi=rn.get("icon-rotation-alignment")==="map"&&rn.get("symbol-placement")!=="point",ki=rn.get("symbol-placement"),ui=or/2,Ii=rn.get("icon-text-fit");let Oi;pe&&Ii!=="none"&&(Y.allowVerticalPlacement&&ne.vertical&&(Oi=Fd(pe,ne.vertical,Ii,rn.get("icon-text-fit-padding"),hn,xn)),Sn&&(pe=Fd(pe,Sn,Ii,rn.get("icon-text-fit-padding"),hn,xn)));const Si=(ti,Di)=>{Di.x<0||Di.x>=Ss||Di.y<0||Di.y>=Ss||function(Bi,ra,oo,to,Is,Ou,Js,Ps,hu,Yl,gs,ns,Ol,Uo,Qs,Xl,Du,fu,ms,uc,Do,rs,is,as,Vh){const _c=Bi.addToLineVertexArray(ra,oo);let dl,no,Wo,Ic,Vc=0,Gd=0,ig=0,Wp=0,qc=-1,dp=-1;const Pc={};let Zp=Lo("");if(Bi.allowVerticalPlacement&&to.vertical){const el=Ps.layout.get("text-rotate").evaluate(Do,{},as)+90,Kl=to.vertical;Wo=new _r(hu,ra,Yl,gs,ns,Kl,Ol,Uo,Qs,el),Js&&(Ic=new _r(hu,ra,Yl,gs,ns,Js,Du,fu,Qs,el))}if(Is){const el=Ps.layout.get("icon-rotate").evaluate(Do,{}),Kl=Ps.layout.get("icon-text-fit")!=="none",Hc=On(Is,el,is,Kl),Zo=Js?On(Js,el,is,Kl):void 0;no=new _r(hu,ra,Yl,gs,ns,Is,Du,fu,!1,el),Vc=4*Hc.length;const bc=Bi.iconSizeData;let bh=null;bc.kind==="source"?(bh=[xh*Ps.layout.get("icon-size").evaluate(Do,{})],bh[0]>gf&&f(`${Bi.layerIds[0]}: Value for "icon-size" is >= ${yh}. Reduce your "icon-size".`)):bc.kind==="composite"&&(bh=[xh*rs.compositeIconSizes[0].evaluate(Do,{},as),xh*rs.compositeIconSizes[1].evaluate(Do,{},as)],(bh[0]>gf||bh[1]>gf)&&f(`${Bi.layerIds[0]}: Value for "icon-size" is >= ${yh}. Reduce your "icon-size".`)),Bi.addSymbols(Bi.icon,Hc,bh,uc,ms,Do,d.ai.none,ra,_c.lineStartIndex,_c.lineLength,-1,as),qc=Bi.icon.placedSymbolArray.length-1,Zo&&(Gd=4*Zo.length,Bi.addSymbols(Bi.icon,Zo,bh,uc,ms,Do,d.ai.vertical,ra,_c.lineStartIndex,_c.lineLength,-1,as),dp=Bi.icon.placedSymbolArray.length-1)}const $p=Object.keys(to.horizontal);for(const el of $p){const Kl=to.horizontal[el];if(!dl){Zp=Lo(Kl.text);const Zo=Ps.layout.get("text-rotate").evaluate(Do,{},as);dl=new _r(hu,ra,Yl,gs,ns,Kl,Ol,Uo,Qs,Zo)}const Hc=Kl.positionedLines.length===1;if(ig+=zi(Bi,ra,Kl,Ou,Ps,Qs,Do,Xl,_c,to.vertical?d.ai.horizontal:d.ai.horizontalOnly,Hc?$p:[el],Pc,qc,rs,as),Hc)break}to.vertical&&(Wp+=zi(Bi,ra,to.vertical,Ou,Ps,Qs,Do,Xl,_c,d.ai.vertical,["vertical"],Pc,dp,rs,as));const ag=dl?dl.boxStartIndex:Bi.collisionBoxArray.length,xm=dl?dl.boxEndIndex:Bi.collisionBoxArray.length,Yp=Wo?Wo.boxStartIndex:Bi.collisionBoxArray.length,_m=Wo?Wo.boxEndIndex:Bi.collisionBoxArray.length,bm=no?no.boxStartIndex:Bi.collisionBoxArray.length,wm=no?no.boxEndIndex:Bi.collisionBoxArray.length,Tm=Ic?Ic.boxStartIndex:Bi.collisionBoxArray.length,Wd=Ic?Ic.boxEndIndex:Bi.collisionBoxArray.length;let Ls=-1;const vf=(el,Kl)=>el&&el.circleDiameter?Math.max(el.circleDiameter,Kl):Kl;Ls=vf(dl,Ls),Ls=vf(Wo,Ls),Ls=vf(no,Ls),Ls=vf(Ic,Ls);const og=Ls>-1?1:0;og&&(Ls*=Vh/hl),Bi.glyphOffsetArray.length>=Nh.MAX_GLYPHS&&f("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Do.sortKey!==void 0&&Bi.addToSortKeyRanges(Bi.symbolInstances.length,Do.sortKey);const _h=Ni(Ps,Do,as),[Rv,Zd]=function(el,Kl){const Hc=el.length,Zo=Kl==null?void 0:Kl.values;if((Zo==null?void 0:Zo.length)>0)for(let bc=0;bc=0?Pc.right:-1,Pc.center>=0?Pc.center:-1,Pc.left>=0?Pc.left:-1,Pc.vertical||-1,qc,dp,Zp,ag,xm,Yp,_m,bm,wm,Tm,Wd,Yl,ig,Wp,Vc,Gd,og,0,Ol,Ls,Rv,Zd)}(Y,Di,ti,ne,pe,ze,Oi,Y.layers[0],Y.collisionBoxArray,U.index,U.sourceLayerIndex,Y.index,Nn,[gr,gr,gr,gr],Ci,mt,wr,Wr,Vi,hn,U,Ze,zt,jt,Je)};if(ki==="line")for(const ti of je(U.geometry,0,0,Ss,Ss)){const Di=sn(ti,or,pi,ne.vertical||Sn,pe,24,Gn,Y.overscaling,Ss);for(const Bi of Di)Sn&&va(Y,Sn.text,ui,Bi)||Si(ti,Bi)}else if(ki==="line-center"){for(const ti of U.geometry)if(ti.length>1){const Di=nn(ti,pi,ne.vertical||Sn,pe,24,Gn);Di&&Si(ti,Di)}}else if(U.type==="Polygon")for(const ti of vl(U.geometry,0)){const Di=Gr(ti,16);Si(ti[0],new Ke(Di.x,Di.y,0))}else if(U.type==="LineString")for(const ti of U.geometry)Si(ti,new Ke(ti[0].x,ti[0].y,0));else if(U.type==="Point")for(const ti of U.geometry)for(const Di of ti)Si([Di],new Ke(Di.x,Di.y,0))}function zi(Y,U,ne,pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn){const xn=function(wr,or,gr,Wr,pi,Ci,Vi,ki){const ui=Wr.layout.get("text-rotate").evaluate(Ci,{})*Math.PI/180,Ii=[];for(const Oi of or.positionedLines)for(const Si of Oi.positionedGlyphs){if(!Si.rect)continue;const ti=Si.rect||{};let Di=Uf+1,Bi=!0,ra=1,oo=0;const to=(pi||ki)&&Si.vertical,Is=Si.metrics.advance*Si.scale/2;if(ki&&or.verticalizable){const rs=(Si.scale-1)*hl,is=(hl-Si.metrics.width*Si.scale)/2;oo=Oi.lineOffset/2-(Si.imageName?-is:rs)}if(Si.imageName){const rs=Vi[Si.imageName];Bi=rs.sdf,ra=rs.pixelRatio,Di=Xu/ra}const Ou=pi?[Si.x+Is,Si.y]:[0,0];let Js=pi?[0,0]:[Si.x+Is+gr[0],Si.y+gr[1]-oo],Ps=[0,0];to&&(Ps=Js,Js=[0,0]);const hu=Si.metrics.isDoubleResolution?2:1,Yl=(Si.metrics.left-Di)*Si.scale-Is+Js[0],gs=(-Si.metrics.top-Di)*Si.scale+Js[1],ns=Yl+ti.w/hu*Si.scale/ra,Ol=gs+ti.h/hu*Si.scale/ra,Uo=new u(Yl,gs),Qs=new u(ns,gs),Xl=new u(Yl,Ol),Du=new u(ns,Ol);if(to){const rs=new u(-Is,Is-Vf),is=-Math.PI/2,as=hl/2-Is,Vh=Si.imageName?as:0,_c=new u(5-Vf-as,-Vh),dl=new u(...Ps);Uo._rotateAround(is,rs)._add(_c)._add(dl),Qs._rotateAround(is,rs)._add(_c)._add(dl),Xl._rotateAround(is,rs)._add(_c)._add(dl),Du._rotateAround(is,rs)._add(_c)._add(dl)}if(ui){const rs=Math.sin(ui),is=Math.cos(ui),as=[is,-rs,rs,is];Uo._matMult(as),Qs._matMult(as),Xl._matMult(as),Du._matMult(as)}const fu=new u(0,0),ms=new u(0,0),uc=0,Do=0;Ii.push({tl:Uo,tr:Qs,bl:Xl,br:Du,tex:ti,writingMode:or.writingMode,glyphOffset:Ou,sectionIndex:Si.sectionIndex,isSDF:Bi,pixelOffsetTL:fu,pixelOffsetBR:ms,minFontScaleX:uc,minFontScaleY:Do})}return Ii}(0,ne,ht,ze,Ze,Je,pe,Y.allowVerticalPlacement),Nn=Y.textSizeData;let Gn=null;Nn.kind==="source"?(Gn=[xh*ze.layout.get("text-size").evaluate(Je,{})],Gn[0]>gf&&f(`${Y.layerIds[0]}: Value for "text-size" is >= ${yh}. Reduce your "text-size".`)):Nn.kind==="composite"&&(Gn=[xh*hn.compositeTextSizes[0].evaluate(Je,{},Sn),xh*hn.compositeTextSizes[1].evaluate(Je,{},Sn)],(Gn[0]>gf||Gn[1]>gf)&&f(`${Y.layerIds[0]}: Value for "text-size" is >= ${yh}. Reduce your "text-size".`)),Y.addSymbols(Y.text,xn,Gn,ht,Ze,Je,zt,U,mt.lineStartIndex,mt.lineLength,rn,Sn);for(const wr of jt)Xt[wr]=Y.text.placedSymbolArray.length-1;return 4*xn.length}function Ea(Y){for(const U in Y)return Y[U];return null}function va(Y,U,ne,pe){const ze=Y.compareText;if(U in ze){const Ze=ze[U];for(let Je=Ze.length-1;Je>=0;Je--)if(pe.dist(Ze[Je])>4;if(ze!==1)throw new Error(`Got v${ze} data when expected v1.`);const Ze=yo[15&pe];if(!Ze)throw new Error("Unrecognized array type.");const[Je]=new Uint16Array(U,2,1),[ht]=new Uint32Array(U,4,1);return new Zi(ht,Je,Ze,U)}constructor(U,ne=64,pe=Float64Array,ze){if(isNaN(U)||U<0)throw new Error(`Unpexpected numItems value: ${U}.`);this.numItems=+U,this.nodeSize=Math.min(Math.max(+ne,2),65535),this.ArrayType=pe,this.IndexArrayType=U<65536?Uint16Array:Uint32Array;const Ze=yo.indexOf(this.ArrayType),Je=2*U*this.ArrayType.BYTES_PER_ELEMENT,ht=U*this.IndexArrayType.BYTES_PER_ELEMENT,mt=(8-ht%8)%8;if(Ze<0)throw new Error(`Unexpected typed array class: ${pe}.`);ze&&ze instanceof ArrayBuffer?(this.data=ze,this.ids=new this.IndexArrayType(this.data,8,U),this.coords=new this.ArrayType(this.data,8+ht+mt,2*U),this._pos=2*U,this._finished=!0):(this.data=new ArrayBuffer(8+Je+ht+mt),this.ids=new this.IndexArrayType(this.data,8,U),this.coords=new this.ArrayType(this.data,8+ht+mt,2*U),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Ze]),new Uint16Array(this.data,2,1)[0]=ne,new Uint32Array(this.data,4,1)[0]=U)}add(U,ne){const pe=this._pos>>1;return this.ids[pe]=pe,this.coords[this._pos++]=U,this.coords[this._pos++]=ne,pe}finish(){const U=this._pos>>1;if(U!==this.numItems)throw new Error(`Added ${U} items when expected ${this.numItems}.`);return Ka(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(U,ne,pe,ze){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ze,coords:Je,nodeSize:ht}=this,mt=[0,Ze.length-1,0],zt=[];for(;mt.length;){const jt=mt.pop()||0,Xt=mt.pop()||0,rn=mt.pop()||0;if(Xt-rn<=ht){for(let Nn=rn;Nn<=Xt;Nn++){const Gn=Je[2*Nn],wr=Je[2*Nn+1];Gn>=U&&Gn<=pe&&wr>=ne&&wr<=ze&&zt.push(Ze[Nn])}continue}const hn=rn+Xt>>1,Sn=Je[2*hn],xn=Je[2*hn+1];Sn>=U&&Sn<=pe&&xn>=ne&&xn<=ze&&zt.push(Ze[hn]),(jt===0?U<=Sn:ne<=xn)&&(mt.push(rn),mt.push(hn-1),mt.push(1-jt)),(jt===0?pe>=Sn:ze>=xn)&&(mt.push(hn+1),mt.push(Xt),mt.push(1-jt))}return zt}within(U,ne,pe){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:ze,coords:Ze,nodeSize:Je}=this,ht=[0,ze.length-1,0],mt=[],zt=pe*pe;for(;ht.length;){const jt=ht.pop()||0,Xt=ht.pop()||0,rn=ht.pop()||0;if(Xt-rn<=Je){for(let Nn=rn;Nn<=Xt;Nn++)xo(Ze[2*Nn],Ze[2*Nn+1],U,ne)<=zt&&mt.push(ze[Nn]);continue}const hn=rn+Xt>>1,Sn=Ze[2*hn],xn=Ze[2*hn+1];xo(Sn,xn,U,ne)<=zt&&mt.push(ze[hn]),(jt===0?U-pe<=Sn:ne-pe<=xn)&&(ht.push(rn),ht.push(hn-1),ht.push(1-jt)),(jt===0?U+pe>=Sn:ne+pe>=xn)&&(ht.push(hn+1),ht.push(Xt),ht.push(1-jt))}return mt}}function Ka(Y,U,ne,pe,ze,Ze){if(ze-pe<=ne)return;const Je=pe+ze>>1;Ba(Y,U,Je,pe,ze,Ze),Ka(Y,U,ne,pe,Je-1,1-Ze),Ka(Y,U,ne,Je+1,ze,1-Ze)}function Ba(Y,U,ne,pe,ze,Ze){for(;ze>pe;){if(ze-pe>600){const zt=ze-pe+1,jt=ne-pe+1,Xt=Math.log(zt),rn=.5*Math.exp(2*Xt/3),hn=.5*Math.sqrt(Xt*rn*(zt-rn)/zt)*(jt-zt/2<0?-1:1);Ba(Y,U,ne,Math.max(pe,Math.floor(ne-jt*rn/zt+hn)),Math.min(ze,Math.floor(ne+(zt-jt)*rn/zt+hn)),Ze)}const Je=U[2*ne+Ze];let ht=pe,mt=ze;for(Ja(Y,U,pe,ne),U[2*ze+Ze]>Je&&Ja(Y,U,pe,ze);htJe;)mt--}U[2*pe+Ze]===Je?Ja(Y,U,pe,mt):(mt++,Ja(Y,U,mt,ze)),mt<=ne&&(pe=mt+1),ne<=mt&&(ze=mt-1)}}function Ja(Y,U,ne,pe){Eo(Y,ne,pe),Eo(U,2*ne,2*pe),Eo(U,2*ne+1,2*pe+1)}function Eo(Y,U,ne){const pe=Y[U];Y[U]=Y[ne],Y[ne]=pe}function xo(Y,U,ne,pe){const ze=Y-ne,Ze=U-pe;return ze*ze+Ze*Ze}var Es;d.bf=void 0,(Es=d.bf||(d.bf={})).create="create",Es.load="load",Es.fullLoad="fullLoad";let Oo=null,Cs=[];const pl=1e3/60,jo="loadTime",ea="fullLoadTime",zl={mark(Y){performance.mark(Y)},frame(Y){const U=Y;if(Oo!=null){const ne=U-Oo;Cs.push(ne)}Oo=U},clearMetrics(){Oo=null,Cs=[],performance.clearMeasures(jo),performance.clearMeasures(ea);for(const Y in d.bf)performance.clearMarks(d.bf[Y])},getPerformanceMetrics(){performance.measure(jo,d.bf.create,d.bf.load),performance.measure(ea,d.bf.create,d.bf.fullLoad);const Y=performance.getEntriesByName(jo)[0].duration,U=performance.getEntriesByName(ea)[0].duration,ne=Cs.length,pe=1/(Cs.reduce((Ze,Je)=>Ze+Je,0)/ne/1e3),ze=Cs.filter(Ze=>Ze>pl).reduce((Ze,Je)=>Ze+(Je-pl)/pl,0);return{loadTime:Y,fullLoadTime:U,fps:pe,percentDroppedFrames:ze/(ne+ze)*100,totalFrames:ne}}};d.$=class extends q{},d.A=rh,d.B=El,d.C=function(Y){if(B==null){const U=Y.navigator?Y.navigator.userAgent:null;B=!!Y.safari||!(!U||!(/\b(iPad|iPhone|iPod)\b/.test(U)||U.match("Safari")&&!U.match("Chrome")))}return B},d.D=Ai,d.E=ye,d.F=class{constructor(Y,U){this.target=Y,this.mapId=U,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new tg(()=>this.process()),this.subscription=function(ne,pe,ze,Ze){return ne.addEventListener(pe,ze,Ze),{unsubscribe:()=>{ne.removeEventListener(pe,ze,Ze)}}}(this.target,"message",ne=>this.receive(ne),!1),this.globalScope=I(self)?Y:window}registerMessageHandler(Y,U){this.messageHandlers[Y]=U}sendAsync(Y,U){return new Promise((ne,pe)=>{const ze=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[ze]={resolve:ne,reject:pe},U&&U.signal.addEventListener("abort",()=>{delete this.resolveRejects[ze];const ht={id:ze,type:"",origin:location.origin,targetMapId:Y.targetMapId,sourceMapId:this.mapId};this.target.postMessage(ht)},{once:!0});const Ze=[],Je=Object.assign(Object.assign({},Y),{id:ze,sourceMapId:this.mapId,origin:location.origin,data:ta(Y.data,Ze)});this.target.postMessage(Je,{transfer:Ze})})}receive(Y){const U=Y.data,ne=U.id;if(!(U.origin!=="file://"&&location.origin!=="file://"&&U.origin!=="resource://android"&&location.origin!=="resource://android"&&U.origin!==location.origin||U.targetMapId&&this.mapId!==U.targetMapId)){if(U.type===""){delete this.tasks[ne];const pe=this.abortControllers[ne];return delete this.abortControllers[ne],void(pe&&pe.abort())}if(I(self)||U.mustQueue)return this.tasks[ne]=U,this.taskQueue.push(ne),void this.invoker.trigger();this.processTask(ne,U)}}process(){if(this.taskQueue.length===0)return;const Y=this.taskQueue.shift(),U=this.tasks[Y];delete this.tasks[Y],this.taskQueue.length>0&&this.invoker.trigger(),U&&this.processTask(Y,U)}processTask(Y,U){return e(this,void 0,void 0,function*(){if(U.type===""){const ze=this.resolveRejects[Y];return delete this.resolveRejects[Y],ze?void(U.error?ze.reject(Qo(U.error)):ze.resolve(Qo(U.data))):void 0}if(!this.messageHandlers[U.type])return void this.completeTask(Y,new Error(`Could not find a registered handler for ${U.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const ne=Qo(U.data),pe=new AbortController;this.abortControllers[Y]=pe;try{const ze=yield this.messageHandlers[U.type](U.sourceMapId,ne,pe);this.completeTask(Y,null,ze)}catch(ze){this.completeTask(Y,ze)}})}completeTask(Y,U,ne){const pe=[];delete this.abortControllers[Y];const ze={id:Y,type:"",sourceMapId:this.mapId,origin:location.origin,error:U?ta(U):null,data:ta(ne,pe)};this.target.postMessage(ze,{transfer:pe})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},d.G=K,d.H=function(){var Y=new rh(16);return rh!=Float32Array&&(Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0),Y[0]=1,Y[5]=1,Y[10]=1,Y[15]=1,Y},d.I=Z0,d.J=function(Y,U,ne){var pe,ze,Ze,Je,ht,mt,zt,jt,Xt,rn,hn,Sn,xn=ne[0],Nn=ne[1],Gn=ne[2];return U===Y?(Y[12]=U[0]*xn+U[4]*Nn+U[8]*Gn+U[12],Y[13]=U[1]*xn+U[5]*Nn+U[9]*Gn+U[13],Y[14]=U[2]*xn+U[6]*Nn+U[10]*Gn+U[14],Y[15]=U[3]*xn+U[7]*Nn+U[11]*Gn+U[15]):(pe=U[0],ze=U[1],Ze=U[2],Je=U[3],ht=U[4],mt=U[5],zt=U[6],jt=U[7],Xt=U[8],rn=U[9],hn=U[10],Sn=U[11],Y[0]=pe,Y[1]=ze,Y[2]=Ze,Y[3]=Je,Y[4]=ht,Y[5]=mt,Y[6]=zt,Y[7]=jt,Y[8]=Xt,Y[9]=rn,Y[10]=hn,Y[11]=Sn,Y[12]=pe*xn+ht*Nn+Xt*Gn+U[12],Y[13]=ze*xn+mt*Nn+rn*Gn+U[13],Y[14]=Ze*xn+zt*Nn+hn*Gn+U[14],Y[15]=Je*xn+jt*Nn+Sn*Gn+U[15]),Y},d.K=function(Y,U,ne){var pe=ne[0],ze=ne[1],Ze=ne[2];return Y[0]=U[0]*pe,Y[1]=U[1]*pe,Y[2]=U[2]*pe,Y[3]=U[3]*pe,Y[4]=U[4]*ze,Y[5]=U[5]*ze,Y[6]=U[6]*ze,Y[7]=U[7]*ze,Y[8]=U[8]*Ze,Y[9]=U[9]*Ze,Y[10]=U[10]*Ze,Y[11]=U[11]*Ze,Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15],Y},d.L=L0,d.M=function(Y,U){const ne={};for(let pe=0;pe{const U=window.document.createElement("video");return U.muted=!0,new Promise(ne=>{U.onloadstart=()=>{ne(U)};for(const pe of Y){const ze=window.document.createElement("source");fe(pe)||(U.crossOrigin="Anonymous"),ze.src=pe,U.appendChild(ze)}})},d.a4=function(){return v++},d.a5=Xn,d.a6=Nh,d.a7=Ua,d.a8=Ph,d.a9=di,d.aA=function(Y){Y=Y.slice();const U=Object.create(null);for(let ne=0;ne{"source"in Je&&pe[Je.source]?ne.push({command:"removeLayer",args:[Je.id]}):Ze.push(Je)}),ne=ne.concat(ze),function(Je,ht,mt){ht=ht||[];const zt=(Je=Je||[]).map(Pe),jt=ht.map(Pe),Xt=Je.reduce(de,{}),rn=ht.reduce(de,{}),hn=zt.slice(),Sn=Object.create(null);let xn,Nn,Gn,wr,or;for(let gr=0,Wr=0;gr@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(ne,pe,ze,Ze)=>{const Je=ze||Ze;return U[pe]=!Je||Je.toLowerCase(),""}),U["max-age"]){const ne=parseInt(U["max-age"],10);isNaN(ne)?delete U["max-age"]:U["max-age"]=ne}return U},d.ac=function(Y,U){const ne=[];for(const pe in Y)pe in U||ne.push(pe);return ne},d.ad=g,d.ae=function(Y,U,ne){var pe=Math.sin(ne),ze=Math.cos(ne),Ze=U[0],Je=U[1],ht=U[2],mt=U[3],zt=U[4],jt=U[5],Xt=U[6],rn=U[7];return U!==Y&&(Y[8]=U[8],Y[9]=U[9],Y[10]=U[10],Y[11]=U[11],Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15]),Y[0]=Ze*ze+zt*pe,Y[1]=Je*ze+jt*pe,Y[2]=ht*ze+Xt*pe,Y[3]=mt*ze+rn*pe,Y[4]=zt*ze-Ze*pe,Y[5]=jt*ze-Je*pe,Y[6]=Xt*ze-ht*pe,Y[7]=rn*ze-mt*pe,Y},d.af=function(Y){var U=new rh(16);return U[0]=Y[0],U[1]=Y[1],U[2]=Y[2],U[3]=Y[3],U[4]=Y[4],U[5]=Y[5],U[6]=Y[6],U[7]=Y[7],U[8]=Y[8],U[9]=Y[9],U[10]=Y[10],U[11]=Y[11],U[12]=Y[12],U[13]=Y[13],U[14]=Y[14],U[15]=Y[15],U},d.ag=af,d.ah=function(Y,U){let ne=0,pe=0;if(Y.kind==="constant")pe=Y.layoutSize;else if(Y.kind!=="source"){const{interpolationType:ze,minZoom:Ze,maxZoom:Je}=Y,ht=ze?g(qn.interpolationFactor(ze,U,Ze,Je),0,1):0;Y.kind==="camera"?pe=gn.number(Y.minSize,Y.maxSize,ht):ne=ht}return{uSizeT:ne,uSize:pe}},d.aj=function(Y,{uSize:U,uSizeT:ne},{lowerSize:pe,upperSize:ze}){return Y.kind==="source"?pe/xh:Y.kind==="composite"?gn.number(pe/xh,ze/xh,ne):U},d.ak=Nd,d.al=function(Y,U,ne,pe){const ze=U.y-Y.y,Ze=U.x-Y.x,Je=pe.y-ne.y,ht=pe.x-ne.x,mt=Je*Ze-ht*ze;if(mt===0)return null;const zt=(ht*(Y.y-ne.y)-Je*(Y.x-ne.x))/mt;return new u(Y.x+zt*Ze,Y.y+zt*ze)},d.am=je,d.an=M0,d.ao=xd,d.ap=function(Y){let U=1/0,ne=1/0,pe=-1/0,ze=-1/0;for(const Ze of Y)U=Math.min(U,Ze.x),ne=Math.min(ne,Ze.y),pe=Math.max(pe,Ze.x),ze=Math.max(ze,Ze.y);return[U,ne,pe,ze]},d.aq=hl,d.as=X0,d.at=function(Y,U){var ne=U[0],pe=U[1],ze=U[2],Ze=U[3],Je=U[4],ht=U[5],mt=U[6],zt=U[7],jt=U[8],Xt=U[9],rn=U[10],hn=U[11],Sn=U[12],xn=U[13],Nn=U[14],Gn=U[15],wr=ne*ht-pe*Je,or=ne*mt-ze*Je,gr=ne*zt-Ze*Je,Wr=pe*mt-ze*ht,pi=pe*zt-Ze*ht,Ci=ze*zt-Ze*mt,Vi=jt*xn-Xt*Sn,ki=jt*Nn-rn*Sn,ui=jt*Gn-hn*Sn,Ii=Xt*Nn-rn*xn,Oi=Xt*Gn-hn*xn,Si=rn*Gn-hn*Nn,ti=wr*Si-or*Oi+gr*Ii+Wr*ui-pi*ki+Ci*Vi;return ti?(ti=1/ti,Y[0]=(ht*Si-mt*Oi+zt*Ii)*ti,Y[1]=(ze*Oi-pe*Si-Ze*Ii)*ti,Y[2]=(xn*Ci-Nn*pi+Gn*Wr)*ti,Y[3]=(rn*pi-Xt*Ci-hn*Wr)*ti,Y[4]=(mt*ui-Je*Si-zt*ki)*ti,Y[5]=(ne*Si-ze*ui+Ze*ki)*ti,Y[6]=(Nn*gr-Sn*Ci-Gn*or)*ti,Y[7]=(jt*Ci-rn*gr+hn*or)*ti,Y[8]=(Je*Oi-ht*ui+zt*Vi)*ti,Y[9]=(pe*ui-ne*Oi-Ze*Vi)*ti,Y[10]=(Sn*pi-xn*gr+Gn*wr)*ti,Y[11]=(Xt*gr-jt*pi-hn*wr)*ti,Y[12]=(ht*ki-Je*Ii-mt*Vi)*ti,Y[13]=(ne*Ii-pe*ki+ze*Vi)*ti,Y[14]=(xn*or-Sn*Wr-Nn*wr)*ti,Y[15]=(jt*Wr-Xt*or+rn*wr)*ti,Y):null},d.au=Qi,d.av=df,d.aw=Zi,d.ax=function(){const Y={},U=me.$version;for(const ne in me.$root){const pe=me.$root[ne];if(pe.required){let ze=null;ze=ne==="version"?U:pe.type==="array"?[]:{},ze!=null&&(Y[ne]=ze)}}return Y},d.ay=ac,d.az=se,d.b=N,d.b0=function(Y,U){return Y[0]=U[0],Y[1]=U[1],Y[2]=U[2],Y[3]=U[3],Y[4]=U[4],Y[5]=U[5],Y[6]=U[6],Y[7]=U[7],Y[8]=U[8],Y[9]=U[9],Y[10]=U[10],Y[11]=U[11],Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15],Y},d.b1=qg,d.b2=function(Y,U){return Y[0]*U[0]+Y[1]*U[1]+Y[2]*U[2]+Y[3]*U[3]},d.b3=k,d.b4=ng,d.b5=hp,d.b6=xv,d.b7=function(Y,U,ne){var pe=Math.sin(ne),ze=Math.cos(ne),Ze=U[4],Je=U[5],ht=U[6],mt=U[7],zt=U[8],jt=U[9],Xt=U[10],rn=U[11];return U!==Y&&(Y[0]=U[0],Y[1]=U[1],Y[2]=U[2],Y[3]=U[3],Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15]),Y[4]=Ze*ze+zt*pe,Y[5]=Je*ze+jt*pe,Y[6]=ht*ze+Xt*pe,Y[7]=mt*ze+rn*pe,Y[8]=zt*ze-Ze*pe,Y[9]=jt*ze-Je*pe,Y[10]=Xt*ze-ht*pe,Y[11]=rn*ze-mt*pe,Y},d.b8=x,d.b9=m,d.bA=function(Y){return Y.message===H},d.bB=bl,d.bC=Cl,d.ba=function(Y){return Y*Math.PI/180},d.bb=function(Y,U){return Y[0]=U[0],Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[5]=U[1],Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[10]=U[2],Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0,Y[15]=1,Y},d.bc=class extends F{},d.bd=jh,d.be=zl,d.bg=ae,d.bh=function(Y,U){Q.REGISTERED_PROTOCOLS[Y]=U},d.bi=function(Y){delete Q.REGISTERED_PROTOCOLS[Y]},d.bj=function(Y,U){const ne={};for(let ze=0;zeti*hl)}let ui=ht?"center":pe.get("text-justify").evaluate(jt,{},Y.canonical);const Ii=pe.get("symbol-placement")==="point"?pe.get("text-max-width").evaluate(jt,{},Y.canonical)*hl:1/0,Oi=()=>{Y.bucket.allowVerticalPlacement&&Io(Wr)&&(xn.vertical=pf(Nn,Y.glyphMap,Y.glyphPositions,Y.imagePositions,Xt,Ii,Je,Vi,"left",Ci,wr,d.ai.vertical,!0,hn,rn))};if(!ht&&ki){const Si=new Set;if(ui==="auto")for(let Di=0;Die(void 0,void 0,void 0,function*(){if(Y.byteLength===0)return createImageBitmap(new ImageData(1,1));const U=new Blob([new Uint8Array(Y)],{type:"image/png"});try{return createImageBitmap(U)}catch(ne){throw new Error(`Could not load image because of ${ne.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),d.e=A,d.f=Y=>new Promise((U,ne)=>{const pe=new Image;pe.onload=()=>{U(pe),URL.revokeObjectURL(pe.src),pe.onload=null,window.requestAnimationFrame(()=>{pe.src=V})},pe.onerror=()=>ne(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 ze=new Blob([new Uint8Array(Y)],{type:"image/png"});pe.src=Y.byteLength?URL.createObjectURL(ze):V}),d.g=Z,d.h=(Y,U)=>he(A(Y,{type:"json"}),U),d.i=I,d.j=ge,d.k=le,d.l=(Y,U)=>he(A(Y,{type:"arrayBuffer"}),U),d.m=he,d.n=function(Y){return new sp(Y).readFields(zd,[])},d.o=zh,d.p=fm,d.q=js,d.r=iu,d.s=fe,d.t=As,d.u=yi,d.v=me,d.w=f,d.x=Ns,d.y=function([Y,U,ne]){return U+=90,U*=Math.PI/180,ne*=Math.PI/180,{x:Y*Math.cos(U)*Math.sin(ne),y:Y*Math.sin(U)*Math.sin(ne),z:Y*Math.cos(ne)}},d.z=gn}),b("worker",0,function(d){class e{constructor(Qe){this.keyCache={},Qe&&this.replace(Qe)}replace(Qe){this._layerConfigs={},this._layers={},this.update(Qe,[])}update(Qe,ft){for(const Ot of Qe){this._layerConfigs[Ot.id]=Ot;const Pt=this._layers[Ot.id]=d.aB(Ot);Pt._featureFilter=d.a7(Pt.filter),this.keyCache[Ot.id]&&delete this.keyCache[Ot.id]}for(const Ot of ft)delete this.keyCache[Ot],delete this._layerConfigs[Ot],delete this._layers[Ot];this.familiesBySource={};const yt=d.bj(Object.values(this._layerConfigs),this.keyCache);for(const Ot of yt){const Pt=Ot.map(vt=>this._layers[vt.id]),at=Pt[0];if(at.visibility==="none")continue;const lt=at.source||"";let Xe=this.familiesBySource[lt];Xe||(Xe=this.familiesBySource[lt]={});const ut=at.sourceLayer||"_geojsonTileLayer";let Tt=Xe[ut];Tt||(Tt=Xe[ut]=[]),Tt.push(Pt)}}}class w{constructor(Qe){const ft={},yt=[];for(const lt in Qe){const Xe=Qe[lt],ut=ft[lt]={};for(const Tt in Xe){const vt=Xe[+Tt];if(!vt||vt.bitmap.width===0||vt.bitmap.height===0)continue;const Lt={x:0,y:0,w:vt.bitmap.width+2,h:vt.bitmap.height+2};yt.push(Lt),ut[Tt]={rect:Lt,metrics:vt.metrics}}}const{w:Ot,h:Pt}=d.p(yt),at=new d.o({width:Ot||1,height:Pt||1});for(const lt in Qe){const Xe=Qe[lt];for(const ut in Xe){const Tt=Xe[+ut];if(!Tt||Tt.bitmap.width===0||Tt.bitmap.height===0)continue;const vt=ft[lt][ut].rect;d.o.copy(Tt.bitmap,at,{x:0,y:0},{x:vt.x+1,y:vt.y+1},Tt.bitmap)}}this.image=at,this.positions=ft}}d.bk("GlyphAtlas",w);class y{constructor(Qe){this.tileID=new d.S(Qe.tileID.overscaledZ,Qe.tileID.wrap,Qe.tileID.canonical.z,Qe.tileID.canonical.x,Qe.tileID.canonical.y),this.uid=Qe.uid,this.zoom=Qe.zoom,this.pixelRatio=Qe.pixelRatio,this.tileSize=Qe.tileSize,this.source=Qe.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Qe.showCollisionBoxes,this.collectResourceTiming=!!Qe.collectResourceTiming,this.returnDependencies=!!Qe.returnDependencies,this.promoteId=Qe.promoteId,this.inFlightDependencies=[]}parse(Qe,ft,yt,Ot){return d._(this,void 0,void 0,function*(){this.status="parsing",this.data=Qe,this.collisionBoxArray=new d.a5;const Pt=new d.bl(Object.keys(Qe.layers).sort()),at=new d.bm(this.tileID,this.promoteId);at.bucketLayerIDs=[];const lt={},Xe={featureIndex:at,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:yt},ut=ft.familiesBySource[this.source];for(const qt in ut){const en=Qe.layers[qt];if(!en)continue;en.version===1&&d.w(`Vector tile source "${this.source}" layer "${qt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Wt=Pt.encode(qt),Zt=[];for(let on=0;on=un.maxzoom||un.visibility!=="none"&&(_(on,this.zoom,yt),(lt[un.id]=un.createBucket({index:at.bucketLayerIDs.length,layers:on,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wt,sourceID:this.source})).populate(Zt,Xe,this.tileID.canonical),at.bucketLayerIDs.push(on.map(Pn=>Pn.id)))}}const Tt=d.aG(Xe.glyphDependencies,qt=>Object.keys(qt).map(Number));this.inFlightDependencies.forEach(qt=>qt==null?void 0:qt.abort()),this.inFlightDependencies=[];let vt=Promise.resolve({});if(Object.keys(Tt).length){const qt=new AbortController;this.inFlightDependencies.push(qt),vt=Ot.sendAsync({type:"GG",data:{stacks:Tt,source:this.source,tileID:this.tileID,type:"glyphs"}},qt)}const Lt=Object.keys(Xe.iconDependencies);let Ut=Promise.resolve({});if(Lt.length){const qt=new AbortController;this.inFlightDependencies.push(qt),Ut=Ot.sendAsync({type:"GI",data:{icons:Lt,source:this.source,tileID:this.tileID,type:"icons"}},qt)}const rt=Object.keys(Xe.patternDependencies);let et=Promise.resolve({});if(rt.length){const qt=new AbortController;this.inFlightDependencies.push(qt),et=Ot.sendAsync({type:"GI",data:{icons:rt,source:this.source,tileID:this.tileID,type:"patterns"}},qt)}const[Et,Bt,Ft]=yield Promise.all([vt,Ut,et]),St=new w(Et),Jt=new d.bn(Bt,Ft);for(const qt in lt){const en=lt[qt];en instanceof d.a6?(_(en.layers,this.zoom,yt),d.bo({bucket:en,glyphMap:Et,glyphPositions:St.positions,imageMap:Bt,imagePositions:Jt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):en.hasPattern&&(en instanceof d.bp||en instanceof d.bq||en instanceof d.br)&&(_(en.layers,this.zoom,yt),en.addFeatures(Xe,this.tileID.canonical,Jt.patternPositions))}return this.status="done",{buckets:Object.values(lt).filter(qt=>!qt.isEmpty()),featureIndex:at,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:St.image,imageAtlas:Jt,glyphMap:this.returnDependencies?Et:null,iconMap:this.returnDependencies?Bt:null,glyphPositions:this.returnDependencies?St.positions:null}})}}function _(st,Qe,ft){const yt=new d.a9(Qe);for(const Ot of st)Ot.recalculate(yt,ft)}class u{constructor(Qe,ft,yt){this.actor=Qe,this.layerIndex=ft,this.availableImages=yt,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Qe,ft){return d._(this,void 0,void 0,function*(){const yt=yield d.l(Qe.request,ft);try{return{vectorTile:new d.bs.VectorTile(new d.bt(yt.data)),rawData:yt.data,cacheControl:yt.cacheControl,expires:yt.expires}}catch(Ot){const Pt=new Uint8Array(yt.data),at=Pt[0]===31&&Pt[1]===139;let lt=`Unable to parse the tile at ${Qe.request.url}, `;throw lt+=at?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ot.message}`,new Error(lt)}})}loadTile(Qe){return d._(this,void 0,void 0,function*(){const ft=Qe.uid,yt=!!(Qe&&Qe.request&&Qe.request.collectResourceTiming)&&new d.bu(Qe.request),Ot=new y(Qe);this.loading[ft]=Ot;const Pt=new AbortController;Ot.abort=Pt;try{const at=yield this.loadVectorTile(Qe,Pt);if(delete this.loading[ft],!at)return null;const lt=at.rawData,Xe={};at.expires&&(Xe.expires=at.expires),at.cacheControl&&(Xe.cacheControl=at.cacheControl);const ut={};if(yt){const vt=yt.finish();vt&&(ut.resourceTiming=JSON.parse(JSON.stringify(vt)))}Ot.vectorTile=at.vectorTile;const Tt=Ot.parse(at.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[ft]=Ot,this.fetching[ft]={rawTileData:lt,cacheControl:Xe,resourceTiming:ut};try{const vt=yield Tt;return d.e({rawTileData:lt.slice(0)},vt,Xe,ut)}finally{delete this.fetching[ft]}}catch(at){throw delete this.loading[ft],Ot.status="done",this.loaded[ft]=Ot,at}})}reloadTile(Qe){return d._(this,void 0,void 0,function*(){const ft=Qe.uid;if(!this.loaded||!this.loaded[ft])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const yt=this.loaded[ft];if(yt.showCollisionBoxes=Qe.showCollisionBoxes,yt.status==="parsing"){const Ot=yield yt.parse(yt.vectorTile,this.layerIndex,this.availableImages,this.actor);let Pt;if(this.fetching[ft]){const{rawTileData:at,cacheControl:lt,resourceTiming:Xe}=this.fetching[ft];delete this.fetching[ft],Pt=d.e({rawTileData:at.slice(0)},Ot,lt,Xe)}else Pt=Ot;return Pt}if(yt.status==="done"&&yt.vectorTile)return yt.parse(yt.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Qe){return d._(this,void 0,void 0,function*(){const ft=this.loading,yt=Qe.uid;ft&&ft[yt]&&ft[yt].abort&&(ft[yt].abort.abort(),delete ft[yt])})}removeTile(Qe){return d._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Qe.uid]&&delete this.loaded[Qe.uid]})}}class r{constructor(){this.loaded={}}loadTile(Qe){return d._(this,void 0,void 0,function*(){const{uid:ft,encoding:yt,rawImageData:Ot,redFactor:Pt,greenFactor:at,blueFactor:lt,baseShift:Xe}=Qe,ut=Ot.width+2,Tt=Ot.height+2,vt=d.b(Ot)?new d.R({width:ut,height:Tt},yield d.bv(Ot,-1,-1,ut,Tt)):Ot,Lt=new d.bw(ft,vt,yt,Pt,at,lt,Xe);return this.loaded=this.loaded||{},this.loaded[ft]=Lt,Lt})}removeTile(Qe){const ft=this.loaded,yt=Qe.uid;ft&&ft[yt]&&delete ft[yt]}}var n=function st(Qe,ft){var yt,Ot=Qe&&Qe.type;if(Ot==="FeatureCollection")for(yt=0;yt=Math.abs(lt)?ft-Xe+lt:lt-Xe+ft,ft=Xe}ft+yt>=0!=!!Qe&&st.reverse()}var s=d.bx(n);const c=d.bs.VectorTileFeature.prototype.toGeoJSON;let h=class{constructor(st){this._feature=st,this.extent=d.X,this.type=st.type,this.properties=st.tags,"id"in st&&!isNaN(st.id)&&(this.id=parseInt(st.id,10))}loadGeometry(){if(this._feature.type===1){const st=[];for(const Qe of this._feature.geometry)st.push([new d.P(Qe[0],Qe[1])]);return st}{const st=[];for(const Qe of this._feature.geometry){const ft=[];for(const yt of Qe)ft.push(new d.P(yt[0],yt[1]));st.push(ft)}return st}}toGeoJSON(st,Qe,ft){return c.call(this,st,Qe,ft)}},x=class{constructor(st){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=d.X,this.length=st.length,this._features=st}feature(st){return new h(this._features[st])}};var m={exports:{}},g=d.by,k=d.bs.VectorTileFeature,A=v;function v(st,Qe){this.options=Qe||{},this.features=st,this.length=st.length}function S(st,Qe){this.id=typeof st.id=="number"?st.id:void 0,this.type=st.type,this.rawGeometry=st.type===1?[st.geometry]:st.geometry,this.properties=st.tags,this.extent=Qe||4096}v.prototype.feature=function(st){return new S(this.features[st],this.options.extent)},S.prototype.loadGeometry=function(){var st=this.rawGeometry;this.geometry=[];for(var Qe=0;Qe>31}function V(st,Qe){for(var ft=st.loadGeometry(),yt=st.type,Ot=0,Pt=0,at=ft.length,lt=0;ltst},J=Math.fround||(Q=new Float32Array(1),st=>(Q[0]=+st,Q[0]));var Q;const Z=3,K=5,ae=6;class se{constructor(Qe){this.options=Object.assign(Object.create(H),Qe),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Qe){const{log:ft,minZoom:yt,maxZoom:Ot}=this.options;ft&&console.time("total time");const Pt=`prepare ${Qe.length} points`;ft&&console.time(Pt),this.points=Qe;const at=[];for(let Xe=0;Xe=yt;Xe--){const ut=+Date.now();lt=this.trees[Xe]=this._createTree(this._cluster(lt,Xe)),ft&&console.log("z%d: %d clusters in %dms",Xe,lt.numItems,+Date.now()-ut)}return ft&&console.timeEnd("total time"),this}getClusters(Qe,ft){let yt=((Qe[0]+180)%360+360)%360-180;const Ot=Math.max(-90,Math.min(90,Qe[1]));let Pt=Qe[2]===180?180:((Qe[2]+180)%360+360)%360-180;const at=Math.max(-90,Math.min(90,Qe[3]));if(Qe[2]-Qe[0]>=360)yt=-180,Pt=180;else if(yt>Pt){const vt=this.getClusters([yt,Ot,180,at],ft),Lt=this.getClusters([-180,Ot,Pt,at],ft);return vt.concat(Lt)}const lt=this.trees[this._limitZoom(ft)],Xe=lt.range(ie(yt),oe(at),ie(Pt),oe(Ot)),ut=lt.data,Tt=[];for(const vt of Xe){const Lt=this.stride*vt;Tt.push(ut[Lt+K]>1?he(ut,Lt,this.clusterProps):this.points[ut[Lt+Z]])}return Tt}getChildren(Qe){const ft=this._getOriginId(Qe),yt=this._getOriginZoom(Qe),Ot="No cluster with the specified id.",Pt=this.trees[yt];if(!Pt)throw new Error(Ot);const at=Pt.data;if(ft*this.stride>=at.length)throw new Error(Ot);const lt=this.options.radius/(this.options.extent*Math.pow(2,yt-1)),Xe=at[ft*this.stride],ut=at[ft*this.stride+1],Tt=Pt.within(Xe,ut,lt),vt=[];for(const Lt of Tt){const Ut=Lt*this.stride;at[Ut+4]===Qe&&vt.push(at[Ut+K]>1?he(at,Ut,this.clusterProps):this.points[at[Ut+Z]])}if(vt.length===0)throw new Error(Ot);return vt}getLeaves(Qe,ft,yt){ft=ft||10,yt=yt||0;const Ot=[];return this._appendLeaves(Ot,Qe,ft,yt,0),Ot}getTile(Qe,ft,yt){const Ot=this.trees[this._limitZoom(Qe)],Pt=Math.pow(2,Qe),{extent:at,radius:lt}=this.options,Xe=lt/at,ut=(yt-Xe)/Pt,Tt=(yt+1+Xe)/Pt,vt={features:[]};return this._addTileFeatures(Ot.range((ft-Xe)/Pt,ut,(ft+1+Xe)/Pt,Tt),Ot.data,ft,yt,Pt,vt),ft===0&&this._addTileFeatures(Ot.range(1-Xe/Pt,ut,1,Tt),Ot.data,Pt,yt,Pt,vt),ft===Pt-1&&this._addTileFeatures(Ot.range(0,ut,Xe/Pt,Tt),Ot.data,-1,yt,Pt,vt),vt.features.length?vt:null}getClusterExpansionZoom(Qe){let ft=this._getOriginZoom(Qe)-1;for(;ft<=this.options.maxZoom;){const yt=this.getChildren(Qe);if(ft++,yt.length!==1)break;Qe=yt[0].properties.cluster_id}return ft}_appendLeaves(Qe,ft,yt,Ot,Pt){const at=this.getChildren(ft);for(const lt of at){const Xe=lt.properties;if(Xe&&Xe.cluster?Pt+Xe.point_count<=Ot?Pt+=Xe.point_count:Pt=this._appendLeaves(Qe,Xe.cluster_id,yt,Ot,Pt):Pt1;let Tt,vt,Lt;if(ut)Tt=fe(ft,Xe,this.clusterProps),vt=ft[Xe],Lt=ft[Xe+1];else{const et=this.points[ft[Xe+Z]];Tt=et.properties;const[Et,Bt]=et.geometry.coordinates;vt=ie(Et),Lt=oe(Bt)}const Ut={type:1,geometry:[[Math.round(this.options.extent*(vt*Pt-yt)),Math.round(this.options.extent*(Lt*Pt-Ot))]],tags:Tt};let rt;rt=ut||this.options.generateId?ft[Xe+Z]:this.points[ft[Xe+Z]].id,rt!==void 0&&(Ut.id=rt),at.features.push(Ut)}}_limitZoom(Qe){return Math.max(this.options.minZoom,Math.min(Math.floor(+Qe),this.options.maxZoom+1))}_cluster(Qe,ft){const{radius:yt,extent:Ot,reduce:Pt,minPoints:at}=this.options,lt=yt/(Ot*Math.pow(2,ft)),Xe=Qe.data,ut=[],Tt=this.stride;for(let vt=0;vtft&&(Et+=Xe[Ft+K])}if(Et>et&&Et>=at){let Bt,Ft=Lt*et,St=Ut*et,Jt=-1;const qt=((vt/Tt|0)<<5)+(ft+1)+this.points.length;for(const en of rt){const Wt=en*Tt;if(Xe[Wt+2]<=ft)continue;Xe[Wt+2]=ft;const Zt=Xe[Wt+K];Ft+=Xe[Wt]*Zt,St+=Xe[Wt+1]*Zt,Xe[Wt+4]=qt,Pt&&(Bt||(Bt=this._map(Xe,vt,!0),Jt=this.clusterProps.length,this.clusterProps.push(Bt)),Pt(Bt,this._map(Xe,Wt)))}Xe[vt+4]=qt,ut.push(Ft/Et,St/Et,1/0,qt,-1,Et),Pt&&ut.push(Jt)}else{for(let Bt=0;Bt1)for(const Bt of rt){const Ft=Bt*Tt;if(!(Xe[Ft+2]<=ft)){Xe[Ft+2]=ft;for(let St=0;St>5}_getOriginZoom(Qe){return(Qe-this.points.length)%32}_map(Qe,ft,yt){if(Qe[ft+K]>1){const at=this.clusterProps[Qe[ft+ae]];return yt?Object.assign({},at):at}const Ot=this.points[Qe[ft+Z]].properties,Pt=this.options.map(Ot);return yt&&Pt===Ot?Object.assign({},Pt):Pt}}function he(st,Qe,ft){return{type:"Feature",id:st[Qe+Z],properties:fe(st,Qe,ft),geometry:{type:"Point",coordinates:[(yt=st[Qe],360*(yt-.5)),le(st[Qe+1])]}};var yt}function fe(st,Qe,ft){const yt=st[Qe+K],Ot=yt>=1e4?`${Math.round(yt/1e3)}k`:yt>=1e3?Math.round(yt/100)/10+"k":yt,Pt=st[Qe+ae],at=Pt===-1?{}:Object.assign({},ft[Pt]);return Object.assign(at,{cluster:!0,cluster_id:st[Qe+Z],point_count:yt,point_count_abbreviated:Ot})}function ie(st){return st/360+.5}function oe(st){const Qe=Math.sin(st*Math.PI/180),ft=.5-.25*Math.log((1+Qe)/(1-Qe))/Math.PI;return ft<0?0:ft>1?1:ft}function le(st){const Qe=(180-360*st)*Math.PI/180;return 360*Math.atan(Math.exp(Qe))/Math.PI-90}function ge(st,Qe,ft,yt){let Ot=yt;const Pt=Qe+(ft-Qe>>1);let at,lt=ft-Qe;const Xe=st[Qe],ut=st[Qe+1],Tt=st[ft],vt=st[ft+1];for(let Lt=Qe+3;LtOt)at=Lt,Ot=Ut;else if(Ut===Ot){const rt=Math.abs(Lt-Pt);rtyt&&(at-Qe>3&&ge(st,Qe,at,yt),st[at+2]=Ot,ft-at>3&&ge(st,at,ft,yt))}function ye(st,Qe,ft,yt,Ot,Pt){let at=Ot-ft,lt=Pt-yt;if(at!==0||lt!==0){const Xe=((st-ft)*at+(Qe-yt)*lt)/(at*at+lt*lt);Xe>1?(ft=Ot,yt=Pt):Xe>0&&(ft+=at*Xe,yt+=lt*Xe)}return at=st-ft,lt=Qe-yt,at*at+lt*lt}function me(st,Qe,ft,yt){const Ot={id:st??null,type:Qe,geometry:ft,tags:yt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Qe==="Point"||Qe==="MultiPoint"||Qe==="LineString")be(Ot,ft);else if(Qe==="Polygon")be(Ot,ft[0]);else if(Qe==="MultiLineString")for(const Pt of ft)be(Ot,Pt);else if(Qe==="MultiPolygon")for(const Pt of ft)be(Ot,Pt[0]);return Ot}function be(st,Qe){for(let ft=0;ft0&&(at+=yt?(Ot*Tt-ut*Pt)/2:Math.sqrt(Math.pow(ut-Ot,2)+Math.pow(Tt-Pt,2))),Ot=ut,Pt=Tt}const lt=Qe.length-3;Qe[2]=1,ge(Qe,0,lt,ft),Qe[lt+2]=1,Qe.size=Math.abs(at),Qe.start=0,Qe.end=Qe.size}function Le(st,Qe,ft,yt){for(let Ot=0;Ot1?1:ft}function Ie(st,Qe,ft,yt,Ot,Pt,at,lt){if(yt/=Qe,Pt>=(ft/=Qe)&&at=yt)return null;const Xe=[];for(const ut of st){const Tt=ut.geometry;let vt=ut.type;const Lt=Ot===0?ut.minX:ut.minY,Ut=Ot===0?ut.maxX:ut.maxY;if(Lt>=ft&&Ut=yt)continue;let rt=[];if(vt==="Point"||vt==="MultiPoint")Ve(Tt,rt,ft,yt,Ot);else if(vt==="LineString")Pe(Tt,rt,ft,yt,Ot,!1,lt.lineMetrics);else if(vt==="MultiLineString")Me(Tt,rt,ft,yt,Ot,!1);else if(vt==="Polygon")Me(Tt,rt,ft,yt,Ot,!0);else if(vt==="MultiPolygon")for(const et of Tt){const Et=[];Me(et,Et,ft,yt,Ot,!0),Et.length&&rt.push(Et)}if(rt.length){if(lt.lineMetrics&&vt==="LineString"){for(const et of rt)Xe.push(me(ut.id,vt,et,ut.tags));continue}vt!=="LineString"&&vt!=="MultiLineString"||(rt.length===1?(vt="LineString",rt=rt[0]):vt="MultiLineString"),vt!=="Point"&&vt!=="MultiPoint"||(vt=rt.length===3?"Point":"MultiPoint"),Xe.push(me(ut.id,vt,rt,ut.tags))}}return Xe.length?Xe:null}function Ve(st,Qe,ft,yt,Ot){for(let Pt=0;Pt=ft&&at<=yt&&ke(Qe,st[Pt],st[Pt+1],st[Pt+2])}}function Pe(st,Qe,ft,yt,Ot,Pt,at){let lt=de(st);const Xe=Ot===0?He:Fe;let ut,Tt,vt=st.start;for(let Bt=0;Btft&&(Tt=Xe(lt,Ft,St,qt,en,ft),at&&(lt.start=vt+ut*Tt)):Wt>yt?Zt=ft&&(Tt=Xe(lt,Ft,St,qt,en,ft),on=!0),Zt>yt&&Wt<=yt&&(Tt=Xe(lt,Ft,St,qt,en,yt),on=!0),!Pt&&on&&(at&&(lt.end=vt+ut*Tt),Qe.push(lt),lt=de(st)),at&&(vt+=ut)}let Lt=st.length-3;const Ut=st[Lt],rt=st[Lt+1],et=st[Lt+2],Et=Ot===0?Ut:rt;Et>=ft&&Et<=yt&&ke(lt,Ut,rt,et),Lt=lt.length-3,Pt&&Lt>=3&&(lt[Lt]!==lt[0]||lt[Lt+1]!==lt[1])&&ke(lt,lt[0],lt[1],lt[2]),lt.length&&Qe.push(lt)}function de(st){const Qe=[];return Qe.size=st.size,Qe.start=st.start,Qe.end=st.end,Qe}function Me(st,Qe,ft,yt,Ot,Pt){for(const at of st)Pe(at,Qe,ft,yt,Ot,Pt,!1)}function ke(st,Qe,ft,yt){st.push(Qe,ft,yt)}function He(st,Qe,ft,yt,Ot,Pt){const at=(Pt-Qe)/(yt-Qe);return ke(st,Pt,ft+(Ot-ft)*at,1),at}function Fe(st,Qe,ft,yt,Ot,Pt){const at=(Pt-ft)/(Ot-ft);return ke(st,Qe+(yt-Qe)*at,Pt,1),at}function qe(st,Qe){const ft=[];for(let yt=0;yt0&&Qe.size<(Ot?at:yt))return void(ft.numPoints+=Qe.length/3);const lt=[];for(let Xe=0;Xeat)&&(ft.numSimplified++,lt.push(Qe[Xe],Qe[Xe+1])),ft.numPoints++;Ot&&function(Xe,ut){let Tt=0;for(let vt=0,Lt=Xe.length,Ut=Lt-2;vt0===ut)for(let vt=0,Lt=Xe.length;vt24)throw new Error("maxZoom should be in the 0-24 range");if(ft.promoteId&&ft.generateId)throw new Error("promoteId and generateId cannot be used together.");let Ot=function(Pt,at){const lt=[];if(Pt.type==="FeatureCollection")for(let Xe=0;Xe1&&console.time("creation"),Ut=this.tiles[Lt]=De(Qe,ft,yt,Ot,ut),this.tileCoords.push({z:ft,x:yt,y:Ot}),Tt)){Tt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ft,yt,Ot,Ut.numFeatures,Ut.numPoints,Ut.numSimplified),console.timeEnd("creation"));const Zt=`z${ft}`;this.stats[Zt]=(this.stats[Zt]||0)+1,this.total++}if(Ut.source=Qe,Pt==null){if(ft===ut.indexMaxZoom||Ut.numPoints<=ut.indexMaxPoints)continue}else{if(ft===ut.maxZoom||ft===Pt)continue;if(Pt!=null){const Zt=Pt-ft;if(yt!==at>>Zt||Ot!==lt>>Zt)continue}}if(Ut.source=null,Qe.length===0)continue;Tt>1&&console.time("clipping");const rt=.5*ut.buffer/ut.extent,et=.5-rt,Et=.5+rt,Bt=1+rt;let Ft=null,St=null,Jt=null,qt=null,en=Ie(Qe,vt,yt-rt,yt+Et,0,Ut.minX,Ut.maxX,ut),Wt=Ie(Qe,vt,yt+et,yt+Bt,0,Ut.minX,Ut.maxX,ut);Qe=null,en&&(Ft=Ie(en,vt,Ot-rt,Ot+Et,1,Ut.minY,Ut.maxY,ut),St=Ie(en,vt,Ot+et,Ot+Bt,1,Ut.minY,Ut.maxY,ut),en=null),Wt&&(Jt=Ie(Wt,vt,Ot-rt,Ot+Et,1,Ut.minY,Ut.maxY,ut),qt=Ie(Wt,vt,Ot+et,Ot+Bt,1,Ut.minY,Ut.maxY,ut),Wt=null),Tt>1&&console.timeEnd("clipping"),Xe.push(Ft||[],ft+1,2*yt,2*Ot),Xe.push(St||[],ft+1,2*yt,2*Ot+1),Xe.push(Jt||[],ft+1,2*yt+1,2*Ot),Xe.push(qt||[],ft+1,2*yt+1,2*Ot+1)}}getTile(Qe,ft,yt){Qe=+Qe,ft=+ft,yt=+yt;const Ot=this.options,{extent:Pt,debug:at}=Ot;if(Qe<0||Qe>24)return null;const lt=1<1&&console.log("drilling down to z%d-%d-%d",Qe,ft,yt);let ut,Tt=Qe,vt=ft,Lt=yt;for(;!ut&&Tt>0;)Tt--,vt>>=1,Lt>>=1,ut=this.tiles[pt(Tt,vt,Lt)];return ut&&ut.source?(at>1&&(console.log("found parent tile z%d-%d-%d",Tt,vt,Lt),console.time("drilling down")),this.splitTile(ut.source,Tt,vt,Lt,Qe,ft,yt),at>1&&console.timeEnd("drilling down"),this.tiles[Xe]?Ye(this.tiles[Xe],Pt):null):null}}function pt(st,Qe,ft){return 32*((1<{Lt.properties=rt;const et={};for(const Et of Ut)et[Et]=ut[Et].evaluate(vt,Lt);return et},lt.reduce=(rt,et)=>{Lt.properties=et;for(const Et of Ut)vt.accumulated=rt[Et],rt[Et]=Tt[Et].evaluate(vt,Lt)},lt}(Qe)).load((yield this._pendingData).features):(Ot=yield this._pendingData,Pt=Qe.geojsonVtOptions,new nt(Ot,Pt)),this.loaded={};const at={};if(yt){const lt=yt.finish();lt&&(at.resourceTiming={},at.resourceTiming[Qe.source]=JSON.parse(JSON.stringify(lt)))}return at}catch(at){if(delete this._pendingRequest,d.bA(at))return{abandoned:!0};throw at}var Ot,Pt})}getData(){return d._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Qe){const ft=this.loaded,yt=Qe.uid;return ft&&ft[yt]?super.reloadTile(Qe):this.loadTile(Qe)}loadAndProcessGeoJSON(Qe,ft){return d._(this,void 0,void 0,function*(){let yt=yield this.loadGeoJSON(Qe,ft);if(delete this._pendingRequest,typeof yt!="object")throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`);if(s(yt,!0),Qe.filter){const Ot=d.bB(Qe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ot.result==="error")throw new Error(Ot.value.map(at=>`${at.key}: ${at.message}`).join(", "));yt={type:"FeatureCollection",features:yt.features.filter(at=>Ot.value.evaluate({zoom:0},at))}}return yt})}loadGeoJSON(Qe,ft){return d._(this,void 0,void 0,function*(){const{promoteId:yt}=Qe;if(Qe.request){const Ot=yield d.h(Qe.request,ft);return this._dataUpdateable=wt(Ot.data,yt)?Nt(Ot.data,yt):void 0,Ot.data}if(typeof Qe.data=="string")try{const Ot=JSON.parse(Qe.data);return this._dataUpdateable=wt(Ot,yt)?Nt(Ot,yt):void 0,Ot}catch{throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`)}if(!Qe.dataDiff)throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Qe.source}`);return function(Ot,Pt,at){var lt,Xe,ut,Tt;if(Pt.removeAll&&Ot.clear(),Pt.remove)for(const vt of Pt.remove)Ot.delete(vt);if(Pt.add)for(const vt of Pt.add){const Lt=At(vt,at);Lt!=null&&Ot.set(Lt,vt)}if(Pt.update)for(const vt of Pt.update){let Lt=Ot.get(vt.id);if(Lt==null)continue;const Ut=vt.newGeometry||vt.removeAllProperties,rt=!vt.removeAllProperties&&(((lt=vt.removeProperties)===null||lt===void 0?void 0:lt.length)>0||((Xe=vt.addOrUpdateProperties)===null||Xe===void 0?void 0:Xe.length)>0);if((Ut||rt)&&(Lt=Object.assign({},Lt),Ot.set(vt.id,Lt),rt&&(Lt.properties=Object.assign({},Lt.properties))),vt.newGeometry&&(Lt.geometry=vt.newGeometry),vt.removeAllProperties)Lt.properties={};else if(((ut=vt.removeProperties)===null||ut===void 0?void 0:ut.length)>0)for(const et of vt.removeProperties)Object.prototype.hasOwnProperty.call(Lt.properties,et)&&delete Lt.properties[et];if(((Tt=vt.addOrUpdateProperties)===null||Tt===void 0?void 0:Tt.length)>0)for(const{key:et,value:Et}of vt.addOrUpdateProperties)Lt.properties[et]=Et}}(this._dataUpdateable,Qe.dataDiff,yt),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Qe){return d._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Qe){return this._geoJSONIndex.getClusterExpansionZoom(Qe.clusterId)}getClusterChildren(Qe){return this._geoJSONIndex.getChildren(Qe.clusterId)}getClusterLeaves(Qe){return this._geoJSONIndex.getLeaves(Qe.clusterId,Qe.limit,Qe.offset)}}class Gt{constructor(Qe){this.self=Qe,this.actor=new d.F(Qe),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(ft,yt)=>{if(this.externalWorkerSourceTypes[ft])throw new Error(`Worker source with name "${ft}" already registered.`);this.externalWorkerSourceTypes[ft]=yt},this.self.addProtocol=d.bh,this.self.removeProtocol=d.bi,this.self.registerRTLTextPlugin=ft=>{if(d.bC.isParsed())throw new Error("RTL text plugin already registered.");d.bC.setMethods(ft)},this.actor.registerMessageHandler("LDT",(ft,yt)=>this._getDEMWorkerSource(ft,yt.source).loadTile(yt)),this.actor.registerMessageHandler("RDT",(ft,yt)=>d._(this,void 0,void 0,function*(){this._getDEMWorkerSource(ft,yt.source).removeTile(yt)})),this.actor.registerMessageHandler("GCEZ",(ft,yt)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource(ft,yt.type,yt.source).getClusterExpansionZoom(yt)})),this.actor.registerMessageHandler("GCC",(ft,yt)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource(ft,yt.type,yt.source).getClusterChildren(yt)})),this.actor.registerMessageHandler("GCL",(ft,yt)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource(ft,yt.type,yt.source).getClusterLeaves(yt)})),this.actor.registerMessageHandler("LD",(ft,yt)=>this._getWorkerSource(ft,yt.type,yt.source).loadData(yt)),this.actor.registerMessageHandler("GD",(ft,yt)=>this._getWorkerSource(ft,yt.type,yt.source).getData()),this.actor.registerMessageHandler("LT",(ft,yt)=>this._getWorkerSource(ft,yt.type,yt.source).loadTile(yt)),this.actor.registerMessageHandler("RT",(ft,yt)=>this._getWorkerSource(ft,yt.type,yt.source).reloadTile(yt)),this.actor.registerMessageHandler("AT",(ft,yt)=>this._getWorkerSource(ft,yt.type,yt.source).abortTile(yt)),this.actor.registerMessageHandler("RMT",(ft,yt)=>this._getWorkerSource(ft,yt.type,yt.source).removeTile(yt)),this.actor.registerMessageHandler("RS",(ft,yt)=>d._(this,void 0,void 0,function*(){if(!this.workerSources[ft]||!this.workerSources[ft][yt.type]||!this.workerSources[ft][yt.type][yt.source])return;const Ot=this.workerSources[ft][yt.type][yt.source];delete this.workerSources[ft][yt.type][yt.source],Ot.removeSource!==void 0&&Ot.removeSource(yt)})),this.actor.registerMessageHandler("RM",ft=>d._(this,void 0,void 0,function*(){delete this.layerIndexes[ft],delete this.availableImages[ft],delete this.workerSources[ft],delete this.demWorkerSources[ft]})),this.actor.registerMessageHandler("SR",(ft,yt)=>d._(this,void 0,void 0,function*(){this.referrer=yt})),this.actor.registerMessageHandler("SRPS",(ft,yt)=>this._syncRTLPluginState(ft,yt)),this.actor.registerMessageHandler("IS",(ft,yt)=>d._(this,void 0,void 0,function*(){this.self.importScripts(yt)})),this.actor.registerMessageHandler("SI",(ft,yt)=>this._setImages(ft,yt)),this.actor.registerMessageHandler("UL",(ft,yt)=>d._(this,void 0,void 0,function*(){this._getLayerIndex(ft).update(yt.layers,yt.removedIds)})),this.actor.registerMessageHandler("SL",(ft,yt)=>d._(this,void 0,void 0,function*(){this._getLayerIndex(ft).replace(yt)}))}_setImages(Qe,ft){return d._(this,void 0,void 0,function*(){this.availableImages[Qe]=ft;for(const yt in this.workerSources[Qe]){const Ot=this.workerSources[Qe][yt];for(const Pt in Ot)Ot[Pt].availableImages=ft}})}_syncRTLPluginState(Qe,ft){return d._(this,void 0,void 0,function*(){if(d.bC.isParsed())return d.bC.getState();if(ft.pluginStatus!=="loading")return d.bC.setState(ft),ft;const yt=ft.pluginURL;if(this.self.importScripts(yt),d.bC.isParsed()){const Ot={pluginStatus:"loaded",pluginURL:yt};return d.bC.setState(Ot),Ot}throw d.bC.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${yt}`)})}_getAvailableImages(Qe){let ft=this.availableImages[Qe];return ft||(ft=[]),ft}_getLayerIndex(Qe){let ft=this.layerIndexes[Qe];return ft||(ft=this.layerIndexes[Qe]=new e),ft}_getWorkerSource(Qe,ft,yt){if(this.workerSources[Qe]||(this.workerSources[Qe]={}),this.workerSources[Qe][ft]||(this.workerSources[Qe][ft]={}),!this.workerSources[Qe][ft][yt]){const Ot={sendAsync:(Pt,at)=>(Pt.targetMapId=Qe,this.actor.sendAsync(Pt,at))};switch(ft){case"vector":this.workerSources[Qe][ft][yt]=new u(Ot,this._getLayerIndex(Qe),this._getAvailableImages(Qe));break;case"geojson":this.workerSources[Qe][ft][yt]=new Ht(Ot,this._getLayerIndex(Qe),this._getAvailableImages(Qe));break;default:this.workerSources[Qe][ft][yt]=new this.externalWorkerSourceTypes[ft](Ot,this._getLayerIndex(Qe),this._getAvailableImages(Qe))}}return this.workerSources[Qe][ft][yt]}_getDEMWorkerSource(Qe,ft){return this.demWorkerSources[Qe]||(this.demWorkerSources[Qe]={}),this.demWorkerSources[Qe][ft]||(this.demWorkerSources[Qe][ft]=new r),this.demWorkerSources[Qe][ft]}}return d.i(self)&&(self.worker=new Gt(self)),Gt}),b("index",0,function(d,e){var w="4.5.2";let y,_;const u={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync(R){return new Promise((i,a)=>{const C=requestAnimationFrame(i);R.signal.addEventListener("abort",()=>{cancelAnimationFrame(C),a(e.c())})})},getImageData(R,i=0){return this.getImageCanvasContext(R).getImageData(-i,-i,R.width+2*i,R.height+2*i)},getImageCanvasContext(R){const i=window.document.createElement("canvas"),a=i.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return i.width=R.width,i.height=R.height,a.drawImage(R,0,0,R.width,R.height),a},resolveURL(R){return y||(y=document.createElement("a")),y.href=R,y.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(_==null&&(_=matchMedia("(prefers-reduced-motion: reduce)")),_.matches)}};class r{static testProp(i){if(!r.docStyle)return i[0];for(let a=0;a{window.removeEventListener("click",r.suppressClickInternal,!0)},0)}static getScale(i){const a=i.getBoundingClientRect();return{x:a.width/i.offsetWidth||1,y:a.height/i.offsetHeight||1,boundingClientRect:a}}static getPoint(i,a,C){const F=a.boundingClientRect;return new e.P((C.clientX-F.left)/a.x-i.clientLeft,(C.clientY-F.top)/a.y-i.clientTop)}static mousePos(i,a){const C=r.getScale(i);return r.getPoint(i,C,a)}static touchPos(i,a){const C=[],F=r.getScale(i);for(let q=0;q{l&&h(l),l=null,c=!0},o.onerror=()=>{s=!0,l=null},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(R){let i,a,C,F;R.resetRequestQueue=()=>{i=[],a=0,C=0,F={}},R.addThrottleControl=ve=>{const Ae=C++;return F[Ae]=ve,Ae},R.removeThrottleControl=ve=>{delete F[ve],te()},R.getImage=(ve,Ae,Re=!0)=>new Promise((Ue,it)=>{n.supported&&(ve.headers||(ve.headers={}),ve.headers.accept="image/webp,*/*"),e.e(ve,{type:"image"});const ct={abortController:Ae,requestParameters:ve,supportImageRefresh:Re,state:"queued",onError:dt=>{it(dt)},onSuccess:dt=>{Ue(dt)}};i.push(ct),te()});const q=ve=>e._(this,void 0,void 0,function*(){ve.state="running";const{requestParameters:Ae,supportImageRefresh:Re,onError:Ue,onSuccess:it,abortController:ct}=ve,dt=Re===!1&&!e.i(self)&&!e.g(Ae.url)&&(!Ae.headers||Object.keys(Ae.headers).reduce((Mt,Vt)=>Mt&&Vt==="accept",!0));a++;const bt=dt?ue(Ae,ct):e.m(Ae,ct);try{const Mt=yield bt;delete ve.abortController,ve.state="completed",Mt.data instanceof HTMLImageElement||e.b(Mt.data)?it(Mt):Mt.data&&it({data:yield(Ct=Mt.data,typeof createImageBitmap=="function"?e.d(Ct):e.f(Ct)),cacheControl:Mt.cacheControl,expires:Mt.expires})}catch(Mt){delete ve.abortController,Ue(Mt)}finally{a--,te()}var Ct}),te=()=>{const ve=(()=>{for(const Ae of Object.keys(F))if(F[Ae]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Ae=a;Ae0;Ae++){const Re=i.shift();Re.abortController.signal.aborted?Ae--:q(Re)}},ue=(ve,Ae)=>new Promise((Re,Ue)=>{const it=new Image,ct=ve.url,dt=ve.credentials;dt&&dt==="include"?it.crossOrigin="use-credentials":(dt&&dt==="same-origin"||!e.s(ct))&&(it.crossOrigin="anonymous"),Ae.signal.addEventListener("abort",()=>{it.src="",Ue(e.c())}),it.fetchPriority="high",it.onload=()=>{it.onerror=it.onload=null,Re({data:it})},it.onerror=()=>{it.onerror=it.onload=null,Ae.signal.aborted||Ue(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."))},it.src=ct})}(x||(x={})),x.resetRequestQueue();class m{constructor(i){this._transformRequestFn=i}transformRequest(i,a){return this._transformRequestFn&&this._transformRequestFn(i,a)||{url:i}}setTransformRequest(i){this._transformRequestFn=i}}function g(R){var i=new e.A(3);return i[0]=R[0],i[1]=R[1],i[2]=R[2],i}var k,A=function(R,i,a){return R[0]=i[0]-a[0],R[1]=i[1]-a[1],R[2]=i[2]-a[2],R};k=new e.A(3),e.A!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0);var v=function(R){var i=R[0],a=R[1];return i*i+a*a};function S(R){const i=[];if(typeof R=="string")i.push({id:"default",url:R});else if(R&&R.length>0){const a=[];for(const{id:C,url:F}of R){const q=`${C}${F}`;a.indexOf(q)===-1&&(a.push(q),i.push({id:C,url:F}))}}return i}function T(R,i,a){const C=R.split("?");return C[0]+=`${i}${a}`,C.join("?")}function p(R,i,a,C){return e._(this,void 0,void 0,function*(){const F=S(R),q=a>1?"@2x":"",te={},ue={};for(const{id:ve,url:Ae}of F){const Re=i.transformRequest(T(Ae,q,".json"),"SpriteJSON");te[ve]=e.h(Re,C);const Ue=i.transformRequest(T(Ae,q,".png"),"SpriteImage");ue[ve]=x.getImage(Ue,C)}return yield Promise.all([...Object.values(te),...Object.values(ue)]),function(ve,Ae){return e._(this,void 0,void 0,function*(){const Re={};for(const Ue in ve){Re[Ue]={};const it=u.getImageCanvasContext((yield Ae[Ue]).data),ct=(yield ve[Ue]).data;for(const dt in ct){const{width:bt,height:Ct,x:Mt,y:Vt,sdf:It,pixelRatio:Qt,stretchX:tn,stretchY:Yt,content:vn,textFitWidth:Mn,textFitHeight:Vn}=ct[dt],Hn={width:bt,height:Ct,x:Mt,y:Vt,context:it};Re[Ue][dt]={data:null,pixelRatio:Qt,sdf:It,stretchX:tn,stretchY:Yt,content:vn,textFitWidth:Mn,textFitHeight:Vn,spriteData:Hn}}}return Re})}(te,ue)})}(function(){var R=new e.A(2);e.A!=Float32Array&&(R[0]=0,R[1]=0)})();class M{constructor(i,a,C,F){this.context=i,this.format=C,this.texture=i.gl.createTexture(),this.update(a,F)}update(i,a,C){const{width:F,height:q}=i,te=!(this.size&&this.size[0]===F&&this.size[1]===q||C),{context:ue}=this,{gl:ve}=ue;if(this.useMipmap=!!(a&&a.useMipmap),ve.bindTexture(ve.TEXTURE_2D,this.texture),ue.pixelStoreUnpackFlipY.set(!1),ue.pixelStoreUnpack.set(1),ue.pixelStoreUnpackPremultiplyAlpha.set(this.format===ve.RGBA&&(!a||a.premultiply!==!1)),te)this.size=[F,q],i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||e.b(i)?ve.texImage2D(ve.TEXTURE_2D,0,this.format,this.format,ve.UNSIGNED_BYTE,i):ve.texImage2D(ve.TEXTURE_2D,0,this.format,F,q,0,this.format,ve.UNSIGNED_BYTE,i.data);else{const{x:Ae,y:Re}=C||{x:0,y:0};i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||e.b(i)?ve.texSubImage2D(ve.TEXTURE_2D,0,Ae,Re,ve.RGBA,ve.UNSIGNED_BYTE,i):ve.texSubImage2D(ve.TEXTURE_2D,0,Ae,Re,F,q,ve.RGBA,ve.UNSIGNED_BYTE,i.data)}this.useMipmap&&this.isSizePowerOfTwo()&&ve.generateMipmap(ve.TEXTURE_2D)}bind(i,a,C){const{context:F}=this,{gl:q}=F;q.bindTexture(q.TEXTURE_2D,this.texture),C!==q.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(C=q.LINEAR),i!==this.filter&&(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MAG_FILTER,i),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER,C||i),this.filter=i),a!==this.wrap&&(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_S,a),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_T,a),this.wrap=a)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:i}=this.context;i.deleteTexture(this.texture),this.texture=null}}function f(R){const{userImage:i}=R;return!!(i&&i.render&&i.render())&&(R.data.replace(new Uint8Array(i.data.buffer)),!0)}class E extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(i){if(this.loaded!==i&&(this.loaded=i,i)){for(const{ids:a,promiseResolve:C}of this.requestors)C(this._getImagesForIds(a));this.requestors=[]}}getImage(i){const a=this.images[i];if(a&&!a.data&&a.spriteData){const C=a.spriteData;a.data=new e.R({width:C.width,height:C.height},C.context.getImageData(C.x,C.y,C.width,C.height).data),a.spriteData=null}return a}addImage(i,a){if(this.images[i])throw new Error(`Image id ${i} already exist, use updateImage instead`);this._validate(i,a)&&(this.images[i]=a)}_validate(i,a){let C=!0;const F=a.data||a.spriteData;return this._validateStretch(a.stretchX,F&&F.width)||(this.fire(new e.j(new Error(`Image "${i}" has invalid "stretchX" value`))),C=!1),this._validateStretch(a.stretchY,F&&F.height)||(this.fire(new e.j(new Error(`Image "${i}" has invalid "stretchY" value`))),C=!1),this._validateContent(a.content,a)||(this.fire(new e.j(new Error(`Image "${i}" has invalid "content" value`))),C=!1),C}_validateStretch(i,a){if(!i)return!0;let C=0;for(const F of i){if(F[0]{let F=!0;if(!this.isLoaded())for(const q of i)this.images[q]||(F=!1);this.isLoaded()||F?a(this._getImagesForIds(i)):this.requestors.push({ids:i,promiseResolve:a})})}_getImagesForIds(i){const a={};for(const C of i){let F=this.getImage(C);F||(this.fire(new e.k("styleimagemissing",{id:C})),F=this.getImage(C)),F?a[C]={data:F.data.clone(),pixelRatio:F.pixelRatio,sdf:F.sdf,version:F.version,stretchX:F.stretchX,stretchY:F.stretchY,content:F.content,textFitWidth:F.textFitWidth,textFitHeight:F.textFitHeight,hasRenderCallback:!!(F.userImage&&F.userImage.render)}:e.w(`Image "${C}" 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 a}getPixelSize(){const{width:i,height:a}=this.atlasImage;return{width:i,height:a}}getPattern(i){const a=this.patterns[i],C=this.getImage(i);if(!C)return null;if(a&&a.position.version===C.version)return a.position;if(a)a.position.version=C.version;else{const F={w:C.data.width+2,h:C.data.height+2,x:0,y:0},q=new e.I(F,C);this.patterns[i]={bin:F,position:q}}return this._updatePatternAtlas(),this.patterns[i].position}bind(i){const a=i.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new M(i,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){const i=[];for(const q in this.patterns)i.push(this.patterns[q].bin);const{w:a,h:C}=e.p(i),F=this.atlasImage;F.resize({width:a||1,height:C||1});for(const q in this.patterns){const{bin:te}=this.patterns[q],ue=te.x+1,ve=te.y+1,Ae=this.getImage(q).data,Re=Ae.width,Ue=Ae.height;e.R.copy(Ae,F,{x:0,y:0},{x:ue,y:ve},{width:Re,height:Ue}),e.R.copy(Ae,F,{x:0,y:Ue-1},{x:ue,y:ve-1},{width:Re,height:1}),e.R.copy(Ae,F,{x:0,y:0},{x:ue,y:ve+Ue},{width:Re,height:1}),e.R.copy(Ae,F,{x:Re-1,y:0},{x:ue-1,y:ve},{width:1,height:Ue}),e.R.copy(Ae,F,{x:0,y:0},{x:ue+Re,y:ve},{width:1,height:Ue})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(i){for(const a of i){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;const C=this.getImage(a);C||e.w(`Image with ID: "${a}" was not found`),f(C)&&this.updateImage(a,C)}}}const I=1e20;function B(R,i,a,C,F,q,te,ue,ve){for(let Ae=i;Ae-1);ve++,q[ve]=ue,te[ve]=Ae,te[ve+1]=I}for(let ue=0,ve=0;ue65535)throw new Error("glyphs > 65535 not supported");if(C.ranges[q])return{stack:i,id:a,glyph:F};if(!this.url)throw new Error("glyphsUrl is not set");if(!C.requests[q]){const ue=V.loadGlyphRange(i,q,this.url,this.requestManager);C.requests[q]=ue}const te=yield C.requests[q];for(const ue in te)this._doesCharSupportLocalGlyph(+ue)||(C.glyphs[+ue]=te[+ue]);return C.ranges[q]=!0,{stack:i,id:a,glyph:te[a]||null}})}_doesCharSupportLocalGlyph(i){return!!this.localIdeographFontFamily&&(e.u["CJK Unified Ideographs"](i)||e.u["Hangul Syllables"](i)||e.u.Hiragana(i)||e.u.Katakana(i))}_tinySDF(i,a,C){const F=this.localIdeographFontFamily;if(!F||!this._doesCharSupportLocalGlyph(C))return;let q=i.tinySDF;if(!q){let ue="400";/bold/i.test(a)?ue="900":/medium/i.test(a)?ue="500":/light/i.test(a)&&(ue="200"),q=i.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:F,fontWeight:ue})}const te=q.draw(String.fromCharCode(C));return{id:C,bitmap:new e.o({width:te.width||60,height:te.height||60},te.data),metrics:{width:te.glyphWidth/2||24,height:te.glyphHeight/2||24,left:te.glyphLeft/2+.5||0,top:te.glyphTop/2-27.5||-8,advance:te.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(R,i,a,C){return e._(this,void 0,void 0,function*(){const F=256*i,q=F+255,te=C.transformRequest(a.replace("{fontstack}",R).replace("{range}",`${F}-${q}`),"Glyphs"),ue=yield e.l(te,new AbortController);if(!ue||!ue.data)throw new Error(`Could not load glyph range. range: ${i}, ${F}-${q}`);const ve={};for(const Ae of e.n(ue.data))ve[Ae.id]=Ae;return ve})},V.TinySDF=class{constructor({fontSize:R=24,buffer:i=3,radius:a=8,cutoff:C=.25,fontFamily:F="sans-serif",fontWeight:q="normal",fontStyle:te="normal"}={}){this.buffer=i,this.cutoff=C,this.radius=a;const ue=this.size=R+4*i,ve=this._createCanvas(ue),Ae=this.ctx=ve.getContext("2d",{willReadFrequently:!0});Ae.font=`${te} ${q} ${R}px ${F}`,Ae.textBaseline="alphabetic",Ae.textAlign="left",Ae.fillStyle="black",this.gridOuter=new Float64Array(ue*ue),this.gridInner=new Float64Array(ue*ue),this.f=new Float64Array(ue),this.z=new Float64Array(ue+1),this.v=new Uint16Array(ue)}_createCanvas(R){const i=document.createElement("canvas");return i.width=i.height=R,i}draw(R){const{width:i,actualBoundingBoxAscent:a,actualBoundingBoxDescent:C,actualBoundingBoxLeft:F,actualBoundingBoxRight:q}=this.ctx.measureText(R),te=Math.ceil(a),ue=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(q-F))),ve=Math.min(this.size-this.buffer,te+Math.ceil(C)),Ae=ue+2*this.buffer,Re=ve+2*this.buffer,Ue=Math.max(Ae*Re,0),it=new Uint8ClampedArray(Ue),ct={data:it,width:Ae,height:Re,glyphWidth:ue,glyphHeight:ve,glyphTop:te,glyphLeft:0,glyphAdvance:i};if(ue===0||ve===0)return ct;const{ctx:dt,buffer:bt,gridInner:Ct,gridOuter:Mt}=this;dt.clearRect(bt,bt,ue,ve),dt.fillText(R,bt,bt+te);const Vt=dt.getImageData(bt,bt,ue,ve);Mt.fill(I,0,Ue),Ct.fill(0,0,Ue);for(let It=0;It0?vn*vn:0,Ct[Yt]=vn<0?vn*vn:0}}B(Mt,0,0,Ae,Re,Ae,this.f,this.v,this.z),B(Ct,bt,bt,ue,ve,Ae,this.f,this.v,this.z);for(let It=0;It1&&(Ae=i[++ve]);const Ue=Math.abs(Re-Ae.left),it=Math.abs(Re-Ae.right),ct=Math.min(Ue,it);let dt;const bt=q/C*(F+1);if(Ae.isDash){const Ct=F-Math.abs(bt);dt=Math.sqrt(ct*ct+Ct*Ct)}else dt=F-Math.sqrt(ct*ct+bt*bt);this.data[ue+Re]=Math.max(0,Math.min(255,dt+128))}}}addRegularDash(i){for(let ue=i.length-1;ue>=0;--ue){const ve=i[ue],Ae=i[ue+1];ve.zeroLength?i.splice(ue,1):Ae&&Ae.isDash===ve.isDash&&(Ae.left=ve.left,i.splice(ue,1))}const a=i[0],C=i[i.length-1];a.isDash===C.isDash&&(a.left=C.left-this.width,C.right=a.right+this.width);const F=this.width*this.nextRow;let q=0,te=i[q];for(let ue=0;ue1&&(te=i[++q]);const ve=Math.abs(ue-te.left),Ae=Math.abs(ue-te.right),Re=Math.min(ve,Ae),Ue=te.isDash?Re:-Re;this.data[F+ue]=Math.max(0,Math.min(255,Ue+128))}}addDash(i,a){const C=a?7:0,F=2*C+1;if(this.nextRow+F>this.height)return e.w("LineAtlas out of space"),null;let q=0;for(let ue=0;ue{a.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ae]}numActive(){return Object.keys(this.active).length}}const he=Math.floor(u.hardwareConcurrency/2);let fe,ie;function oe(){return fe||(fe=new se),fe}se.workerCount=e.C(globalThis)?Math.max(Math.min(he,3),1):1;class le{constructor(i,a){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=a;const C=this.workerPool.acquire(a);for(let F=0;F{a.remove()}),this.actors=[],i&&this.workerPool.release(this.id)}registerMessageHandler(i,a){for(const C of this.actors)C.registerMessageHandler(i,a)}}function ge(){return ie||(ie=new le(oe(),e.G),ie.registerMessageHandler("GR",(R,i,a)=>e.m(i,a))),ie}function ye(R,i){const a=e.H();return e.J(a,a,[1,1,0]),e.K(a,a,[.5*R.width,.5*R.height,1]),e.L(a,a,R.calculatePosMatrix(i.toUnwrapped()))}function me(R,i,a,C,F,q){const te=function(Ue,it,ct){if(Ue)for(const dt of Ue){const bt=it[dt];if(bt&&bt.source===ct&&bt.type==="fill-extrusion")return!0}else for(const dt in it){const bt=it[dt];if(bt.source===ct&&bt.type==="fill-extrusion")return!0}return!1}(F&&F.layers,i,R.id),ue=q.maxPitchScaleFactor(),ve=R.tilesIn(C,ue,te);ve.sort(be);const Ae=[];for(const Ue of ve)Ae.push({wrappedTileID:Ue.tileID.wrapped().key,queryResults:Ue.tile.queryRenderedFeatures(i,a,R._state,Ue.queryGeometry,Ue.cameraQueryGeometry,Ue.scale,F,q,ue,ye(R.transform,Ue.tileID))});const Re=function(Ue){const it={},ct={};for(const dt of Ue){const bt=dt.queryResults,Ct=dt.wrappedTileID,Mt=ct[Ct]=ct[Ct]||{};for(const Vt in bt){const It=bt[Vt],Qt=Mt[Vt]=Mt[Vt]||{},tn=it[Vt]=it[Vt]||[];for(const Yt of It)Qt[Yt.featureIndex]||(Qt[Yt.featureIndex]=!0,tn.push(Yt))}}return it}(Ae);for(const Ue in Re)Re[Ue].forEach(it=>{const ct=it.feature,dt=R.getFeatureState(ct.layer["source-layer"],ct.id);ct.source=ct.layer.source,ct.layer["source-layer"]&&(ct.sourceLayer=ct.layer["source-layer"]),ct.state=dt});return Re}function be(R,i){const a=R.tileID,C=i.tileID;return a.overscaledZ-C.overscaledZ||a.canonical.y-C.canonical.y||a.wrap-C.wrap||a.canonical.x-C.canonical.x}function Se(R,i,a){return e._(this,void 0,void 0,function*(){let C=R;if(R.url?C=(yield e.h(i.transformRequest(R.url,"Source"),a)).data:yield u.frameAsync(a),!C)return null;const F=e.M(e.e(C,R),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in C&&C.vector_layers&&(F.vectorLayerIds=C.vector_layers.map(q=>q.id)),F})}class Ee{constructor(i,a){i&&(a?this.setSouthWest(i).setNorthEast(a):Array.isArray(i)&&(i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1])))}setNorthEast(i){return this._ne=i instanceof e.N?new e.N(i.lng,i.lat):e.N.convert(i),this}setSouthWest(i){return this._sw=i instanceof e.N?new e.N(i.lng,i.lat):e.N.convert(i),this}extend(i){const a=this._sw,C=this._ne;let F,q;if(i instanceof e.N)F=i,q=i;else{if(!(i instanceof Ee)){if(Array.isArray(i)){if(i.length===4||i.every(Array.isArray)){const te=i;return this.extend(Ee.convert(te))}{const te=i;return this.extend(e.N.convert(te))}}return i&&("lng"in i||"lon"in i)&&"lat"in i?this.extend(e.N.convert(i)):this}if(F=i._sw,q=i._ne,!F||!q)return this}return a||C?(a.lng=Math.min(F.lng,a.lng),a.lat=Math.min(F.lat,a.lat),C.lng=Math.max(q.lng,C.lng),C.lat=Math.max(q.lat,C.lat)):(this._sw=new e.N(F.lng,F.lat),this._ne=new e.N(q.lng,q.lat)),this}getCenter(){return new e.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 e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.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(i){const{lng:a,lat:C}=e.N.convert(i),F=this._sw.lat<=C&&C<=this._ne.lat;let q=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(q=this._sw.lng>=a&&a>=this._ne.lng),F&&q}static convert(i){return i instanceof Ee?i:i&&new Ee(i)}static fromLngLat(i,a=0){const C=360*a/40075017,F=C/Math.cos(Math.PI/180*i.lat);return new Ee(new e.N(i.lng-F,i.lat-C),new e.N(i.lng+F,i.lat+C))}}class Ce{constructor(i,a,C){this.bounds=Ee.convert(this.validateBounds(i)),this.minzoom=a||0,this.maxzoom=C||24}validateBounds(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]}contains(i){const a=Math.pow(2,i.z),C=Math.floor(e.O(this.bounds.getWest())*a),F=Math.floor(e.Q(this.bounds.getNorth())*a),q=Math.ceil(e.O(this.bounds.getEast())*a),te=Math.ceil(e.Q(this.bounds.getSouth())*a);return i.x>=C&&i.x=F&&i.y{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),C={request:this.map._requestManager.transformRequest(a,"Tile"),uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};C.request.collectResourceTiming=this._collectResourceTiming;let F="RT";if(i.actor&&i.state!=="expired"){if(i.state==="loading")return new Promise((q,te)=>{i.reloadPromise={resolve:q,reject:te}})}else i.actor=this.dispatcher.getActor(),F="LT";i.abortController=new AbortController;try{const q=yield i.actor.sendAsync({type:F,data:C},i.abortController);if(delete i.abortController,i.aborted)return;this._afterTileLoadWorkerResponse(i,q)}catch(q){if(delete i.abortController,i.aborted)return;if(q&&q.status!==404)throw q;this._afterTileLoadWorkerResponse(i,null)}})}_afterTileLoadWorkerResponse(i,a){if(a&&a.resourceTiming&&(i.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&i.setExpiryData(a),i.loadVectorData(a,this.map.painter),i.reloadPromise){const C=i.reloadPromise;i.reloadPromise=null,this.loadTile(i).then(C.resolve).catch(C.reject)}}abortTile(i){return e._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.actor&&(yield i.actor.sendAsync({type:"AT",data:{uid:i.uid,type:this.type,source:this.id}}))})}unloadTile(i){return e._(this,void 0,void 0,function*(){i.unloadVectorData(),i.actor&&(yield i.actor.sendAsync({type:"RMT",data:{uid:i.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Oe extends e.E{constructor(i,a,C,F){super(),this.id=i,this.dispatcher=C,this.setEventedParent(F),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},a),e.e(this,e.M(a,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield Se(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,i&&(e.e(this,i),i.bounds&&(this.tileBounds=new Ce(i.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(i){this._tileJSONRequest=null,this.fire(new e.j(i))}})}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(i){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),i(),this.load()}setTiles(i){return this.setSourceProperty(()=>{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}serialize(){return e.e({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);i.abortController=new AbortController;try{const C=yield x.getImage(this.map._requestManager.transformRequest(a,"Tile"),i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(C&&C.data){this.map._refreshExpiredTiles&&C.cacheControl&&C.expires&&i.setExpiryData({cacheControl:C.cacheControl,expires:C.expires});const F=this.map.painter.context,q=F.gl,te=C.data;i.texture=this.map.painter.getTileTexture(te.width),i.texture?i.texture.update(te,{useMipmap:!0}):(i.texture=new M(F,te,q.RGBA,{useMipmap:!0}),i.texture.bind(q.LINEAR,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST)),i.state="loaded"}}catch(C){if(delete i.abortController,i.aborted)i.state="unloaded";else if(C)throw i.state="errored",C}})}abortTile(i){return e._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController)})}unloadTile(i){return e._(this,void 0,void 0,function*(){i.texture&&this.map.painter.saveTileTexture(i.texture)})}hasTransition(){return!1}}class We extends Oe{constructor(i,a,C,F){super(i,a,C,F),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),C=this.map._requestManager.transformRequest(a,"Tile");i.neighboringTiles=this._getNeighboringTiles(i.tileID),i.abortController=new AbortController;try{const F=yield x.getImage(C,i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(F&&F.data){const q=F.data;this.map._refreshExpiredTiles&&F.cacheControl&&F.expires&&i.setExpiryData({cacheControl:F.cacheControl,expires:F.expires});const te=e.b(q)&&e.U()?q:yield this.readImageNow(q),ue={type:this.type,uid:i.uid,source:this.id,rawImageData:te,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!i.actor||i.state==="expired"){i.actor=this.dispatcher.getActor();const ve=yield i.actor.sendAsync({type:"LDT",data:ue});i.dem=ve,i.needsHillshadePrepare=!0,i.needsTerrainPrepare=!0,i.state="loaded"}}}catch(F){if(delete i.abortController,i.aborted)i.state="unloaded";else if(F)throw i.state="errored",F}})}readImageNow(i){return e._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&e.V()){const a=i.width+2,C=i.height+2;try{return new e.R({width:a,height:C},yield e.W(i,-1,-1,a,C))}catch{}}return u.getImageData(i,1)})}_getNeighboringTiles(i){const a=i.canonical,C=Math.pow(2,a.z),F=(a.x-1+C)%C,q=a.x===0?i.wrap-1:i.wrap,te=(a.x+1+C)%C,ue=a.x+1===C?i.wrap+1:i.wrap,ve={};return ve[new e.S(i.overscaledZ,q,a.z,F,a.y).key]={backfilled:!1},ve[new e.S(i.overscaledZ,ue,a.z,te,a.y).key]={backfilled:!1},a.y>0&&(ve[new e.S(i.overscaledZ,q,a.z,F,a.y-1).key]={backfilled:!1},ve[new e.S(i.overscaledZ,i.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},ve[new e.S(i.overscaledZ,ue,a.z,te,a.y-1).key]={backfilled:!1}),a.y+10&&e.e(q,{resourceTiming:F}),this.fire(new e.k("data",Object.assign(Object.assign({},q),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},q),{sourceDataType:"content"})))}catch(C){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(C))}})}loaded(){return this._pendingLoads===0}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.actor?"RT":"LT";i.actor=this.actor;const C={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.abortController=new AbortController;const F=yield this.actor.sendAsync({type:a,data:C},i.abortController);delete i.abortController,i.unloadVectorData(),i.aborted||i.loadVectorData(F,this.map.painter,a==="RT")})}abortTile(i){return e._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.aborted=!0})}unloadTile(i){return e._(this,void 0,void 0,function*(){i.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:i.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 e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ve=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Pe extends e.E{constructor(i,a,C,F){super(),this.id=i,this.dispatcher=C,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(F),this.options=a}load(i){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const a=yield x.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a&&a.data&&(this.image=a.data,i&&(this.coordinates=i),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,this.fire(new e.j(a))}})}loaded(){return this._loaded}updateImage(i){return i.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=i.url,this.load(i.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(i){this.map=i,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(i){this.coordinates=i;const a=i.map(e.Z.fromLngLat);this.tileID=function(F){let q=1/0,te=1/0,ue=-1/0,ve=-1/0;for(const dt of F)q=Math.min(q,dt.x),te=Math.min(te,dt.y),ue=Math.max(ue,dt.x),ve=Math.max(ve,dt.y);const Ae=ue-q,Re=ve-te,Ue=Math.max(Ae,Re),it=Math.max(0,Math.floor(-Math.log(Ue)/Math.LN2)),ct=Math.pow(2,it);return new e.a1(it,Math.floor((q+ue)/2*ct),Math.floor((te+ve)/2*ct))}(a),this.minzoom=this.maxzoom=this.tileID.z;const C=a.map(F=>this.tileID.getTilePoint(F)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(C[0].x,C[0].y,0,0),this._boundsArray.emplaceBack(C[1].x,C[1].y,e.X,0),this._boundsArray.emplaceBack(C[3].x,C[3].y,0,e.X),this._boundsArray.emplaceBack(C[2].x,C[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const i=this.map.painter.context,a=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Ve.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new M(i,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let C=!1;for(const F in this.tiles){const q=this.tiles[F];q.state!=="loaded"&&(q.state="loaded",q.texture=this.texture,C=!0)}C&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(i){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(i.tileID.canonical)?(this.tiles[String(i.tileID.wrap)]=i,i.buckets={}):i.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class de extends Pe{constructor(i,a,C,F){super(i,a,C,F),this.roundZoom=!0,this.type="video",this.options=a}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;const i=this.options;this.urls=[];for(const a of i.urls)this.urls.push(this.map._requestManager.transformRequest(a,"Source").url);try{const a=yield e.a3(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new e.j(a))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(i){if(this.video){const a=this.video.seekable;ia.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=i}}getVideo(){return this.video}onAdd(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const i=this.map.painter.context,a=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Ve.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new M(i,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let C=!1;for(const F in this.tiles){const q=this.tiles[F];q.state!=="loaded"&&(q.state="loaded",q.texture=this.texture,C=!0)}C&&this.fire(new e.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 Me extends Pe{constructor(i,a,C,F){super(i,a,C,F),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some(q=>!Array.isArray(q)||q.length!==2||q.some(te=>typeof te!="number"))||this.fire(new e.j(new e.a2(`sources.${i}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${i}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new e.j(new e.a2(`sources.${i}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${i}`,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.j(new e.a2(`sources.${i}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return e._(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 e.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(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let i=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,i=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,i=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const a=this.map.painter.context,C=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,Ve.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(i||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new M(a,this.canvas,C.RGBA,{premultiply:!0});let F=!1;for(const q in this.tiles){const te=this.tiles[q];te.state!=="loaded"&&(te.state="loaded",te.texture=this.texture,F=!0)}F&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const i of[this.canvas.width,this.canvas.height])if(isNaN(i)||i<=0)return!0;return!1}}const ke={},He=R=>{switch(R){case"geojson":return Ie;case"image":return Pe;case"raster":return Oe;case"raster-dem":return We;case"vector":return Le;case"video":return de;case"canvas":return Me}return ke[R]},Fe="RTLPluginLoaded";class qe extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=ge()}_syncState(i){return this.status=i,this.dispatcher.broadcast("SRPS",{pluginStatus:i,pluginURL:this.url}).catch(a=>{throw this.status="error",a})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(i){return e._(this,arguments,void 0,function*(a,C=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=u.resolveURL(a),!this.url)throw new Error(`requested url ${a} is invalid`);if(this.status==="unavailable"){if(!C)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(Fe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let $e=null;function Ye(){return $e||($e=new qe),$e}class _e{constructor(i,a){this.timeAdded=0,this.fadeEndTime=0,this.tileID=i,this.uid=e.a4(),this.uses=0,this.tileSize=a,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(i){const a=i+this.timeAdded;aq.getLayer(Ae)).filter(Boolean);if(ve.length!==0){ue.layers=ve,ue.stateDependentLayerIds&&(ue.stateDependentLayers=ue.stateDependentLayerIds.map(Ae=>ve.filter(Re=>Re.id===Ae)[0]));for(const Ae of ve)te[Ae.id]=ue}}return te}(i.buckets,a.style),this.hasSymbolBuckets=!1;for(const F in this.buckets){const q=this.buckets[F];if(q instanceof e.a6){if(this.hasSymbolBuckets=!0,!C)break;q.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const F in this.buckets){const q=this.buckets[F];if(q instanceof e.a6&&q.hasRTLText){this.hasRTLText=!0,Ye().lazyLoad();break}}this.queryPadding=0;for(const F in this.buckets){const q=this.buckets[F];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(F).queryRadius(q))}i.imageAtlas&&(this.imageAtlas=i.imageAtlas),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const i in this.buckets)this.buckets[i].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(i){return this.buckets[i.id]}upload(i){for(const C in this.buckets){const F=this.buckets[C];F.uploadPending()&&F.upload(i)}const a=i.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new M(i,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new M(i,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(i){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture)}queryRenderedFeatures(i,a,C,F,q,te,ue,ve,Ae,Re){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:F,cameraQueryGeometry:q,scale:te,tileSize:this.tileSize,pixelPosMatrix:Re,transform:ve,params:ue,queryPadding:this.queryPadding*Ae},i,a,C):{}}querySourceFeatures(i,a){const C=this.latestFeatureIndex;if(!C||!C.rawTileData)return;const F=C.loadVTLayers(),q=a&&a.sourceLayer?a.sourceLayer:"",te=F._geojsonTileLayer||F[q];if(!te)return;const ue=e.a7(a&&a.filter),{z:ve,x:Ae,y:Re}=this.tileID.canonical,Ue={z:ve,x:Ae,y:Re};for(let it=0;itC)F=!1;else if(a)if(this.expirationTime{this.remove(i,q)},C)),this.data[F].push(q),this.order.push(F),this.order.length>this.max){const te=this._getAndRemoveByKey(this.order[0]);te&&this.onRemove(te)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){const a=this.data[i].shift();return a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),a.value}getByKey(i){const a=this.data[i];return a?a[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,a){if(!this.has(i))return this;const C=i.wrapped().key,F=a===void 0?0:this.data[C].indexOf(a),q=this.data[C][F];return this.data[C].splice(F,1),q.timeout&&clearTimeout(q.timeout),this.data[C].length===0&&delete this.data[C],this.onRemove(q.value),this.order.splice(this.order.indexOf(C),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){const a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}filter(i){const a=[];for(const C in this.data)for(const F of this.data[C])i(F.value)||a.push(F);for(const C of a)this.remove(C.value.tileID,C)}}class Be{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(i,a,C){const F=String(a);if(this.stateChanges[i]=this.stateChanges[i]||{},this.stateChanges[i][F]=this.stateChanges[i][F]||{},e.e(this.stateChanges[i][F],C),this.deletedStates[i]===null){this.deletedStates[i]={};for(const q in this.state[i])q!==F&&(this.deletedStates[i][q]=null)}else if(this.deletedStates[i]&&this.deletedStates[i][F]===null){this.deletedStates[i][F]={};for(const q in this.state[i][F])C[q]||(this.deletedStates[i][F][q]=null)}else for(const q in C)this.deletedStates[i]&&this.deletedStates[i][F]&&this.deletedStates[i][F][q]===null&&delete this.deletedStates[i][F][q]}removeFeatureState(i,a,C){if(this.deletedStates[i]===null)return;const F=String(a);if(this.deletedStates[i]=this.deletedStates[i]||{},C&&a!==void 0)this.deletedStates[i][F]!==null&&(this.deletedStates[i][F]=this.deletedStates[i][F]||{},this.deletedStates[i][F][C]=null);else if(a!==void 0)if(this.stateChanges[i]&&this.stateChanges[i][F])for(C in this.deletedStates[i][F]={},this.stateChanges[i][F])this.deletedStates[i][F][C]=null;else this.deletedStates[i][F]=null;else this.deletedStates[i]=null}getState(i,a){const C=String(a),F=this.state[i]||{},q=this.stateChanges[i]||{},te=e.e({},F[C],q[C]);if(this.deletedStates[i]===null)return{};if(this.deletedStates[i]){const ue=this.deletedStates[i][a];if(ue===null)return{};for(const ve in ue)delete te[ve]}return te}initializeTileState(i,a){i.setFeatureState(this.state,a)}coalesceChanges(i,a){const C={};for(const F in this.stateChanges){this.state[F]=this.state[F]||{};const q={};for(const te in this.stateChanges[F])this.state[F][te]||(this.state[F][te]={}),e.e(this.state[F][te],this.stateChanges[F][te]),q[te]=this.state[F][te];C[F]=q}for(const F in this.deletedStates){this.state[F]=this.state[F]||{};const q={};if(this.deletedStates[F]===null)for(const te in this.state[F])q[te]={},this.state[F][te]={};else for(const te in this.deletedStates[F]){if(this.deletedStates[F][te]===null)this.state[F][te]={};else for(const ue of Object.keys(this.deletedStates[F][te]))delete this.state[F][te][ue];q[te]=this.state[F][te]}C[F]=C[F]||{},e.e(C[F],q)}if(this.stateChanges={},this.deletedStates={},Object.keys(C).length!==0)for(const F in i)i[F].setFeatureState(C,a)}}class Ge extends e.E{constructor(i,a,C){super(),this.id=i,this.dispatcher=C,this.on("data",F=>this._dataHandler(F)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((F,q,te,ue)=>{const ve=new(He(q.type))(F,q,te,ue);if(ve.id!==F)throw new Error(`Expected Source id to be ${F} instead of ${ve.id}`);return ve})(i,a,C,this),this._tiles={},this._cache=new De(0,F=>this._unloadTile(F)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Be,this._didEmitContent=!1,this._updated=!1}onAdd(i){this.map=i,this._maxTileCacheSize=i?i._maxTileCacheSize:null,this._maxTileCacheZoomLevels=i?i._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(i)}onRemove(i){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(i)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const i in this._tiles){const a=this._tiles[i];if(a.state!=="loaded"&&a.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const i=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,i&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(i,a,C){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(i),this._tileLoaded(i,a,C)}catch(F){i.state="errored",F.status!==404?this._source.fire(new e.j(F,{tile:i})):this.update(this.transform,this.terrain)}})}_unloadTile(i){this._source.unloadTile&&this._source.unloadTile(i)}_abortTile(i){this._source.abortTile&&this._source.abortTile(i),this._source.fire(new e.k("dataabort",{tile:i,coord:i.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(i){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const a in this._tiles){const C=this._tiles[a];C.upload(i),C.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(i=>i.tileID).sort(tt).map(i=>i.key)}getRenderableIds(i){const a=[];for(const C in this._tiles)this._isIdRenderable(C,i)&&a.push(this._tiles[C]);return i?a.sort((C,F)=>{const q=C.tileID,te=F.tileID,ue=new e.P(q.canonical.x,q.canonical.y)._rotate(this.transform.angle),ve=new e.P(te.canonical.x,te.canonical.y)._rotate(this.transform.angle);return q.overscaledZ-te.overscaledZ||ve.y-ue.y||ve.x-ue.x}).map(C=>C.tileID.key):a.map(C=>C.tileID).sort(tt).map(C=>C.key)}hasRenderableParent(i){const a=this.findLoadedParent(i,0);return!!a&&this._isIdRenderable(a.tileID.key)}_isIdRenderable(i,a){return this._tiles[i]&&this._tiles[i].hasData()&&!this._coveredTiles[i]&&(a||!this._tiles[i].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const i in this._tiles)this._tiles[i].state!=="errored"&&this._reloadTile(i,"reloading")}}_reloadTile(i,a){return e._(this,void 0,void 0,function*(){const C=this._tiles[i];C&&(C.state!=="loading"&&(C.state=a),yield this._loadTile(C,i,a))})}_tileLoaded(i,a,C){i.timeAdded=u.now(),C==="expired"&&(i.refreshedUponExpiration=!0),this._setTileReloadTimer(a,i),this.getSource().type==="raster-dem"&&i.dem&&this._backfillDEM(i),this._state.initializeTileState(i,this.map?this.map.painter:null),i.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:i,coord:i.tileID}))}_backfillDEM(i){const a=this.getRenderableIds();for(let F=0;F1||(Math.abs(te)>1&&(Math.abs(te+ve)===1?te+=ve:Math.abs(te-ve)===1&&(te-=ve)),q.dem&&F.dem&&(F.dem.backfillBorder(q.dem,te,ue),F.neighboringTiles&&F.neighboringTiles[Ae]&&(F.neighboringTiles[Ae].backfilled=!0)))}}getTile(i){return this.getTileByID(i.key)}getTileByID(i){return this._tiles[i]}_retainLoadedChildren(i,a,C,F){for(const q in this._tiles){let te=this._tiles[q];if(F[q]||!te.hasData()||te.tileID.overscaledZ<=a||te.tileID.overscaledZ>C)continue;let ue=te.tileID;for(;te&&te.tileID.overscaledZ>a+1;){const Ae=te.tileID.scaledTo(te.tileID.overscaledZ-1);te=this._tiles[Ae.key],te&&te.hasData()&&(ue=Ae)}let ve=ue;for(;ve.overscaledZ>a;)if(ve=ve.scaledTo(ve.overscaledZ-1),i[ve.key]){F[ue.key]=ue;break}}}findLoadedParent(i,a){if(i.key in this._loadedParentTiles){const C=this._loadedParentTiles[i.key];return C&&C.tileID.overscaledZ>=a?C:null}for(let C=i.overscaledZ-1;C>=a;C--){const F=i.scaledTo(C),q=this._getLoadedTile(F);if(q)return q}}findLoadedSibling(i){return this._getLoadedTile(i)}_getLoadedTile(i){const a=this._tiles[i.key];return a&&a.hasData()?a:this._cache.getByKey(i.wrapped().key)}updateCacheSize(i){const a=(Math.ceil(i.width/this._source.tileSize)+1)*(Math.ceil(i.height/this._source.tileSize)+1),C=this._maxTileCacheZoomLevels===null?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,F=Math.floor(a*C),q=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,F):F;this._cache.setMaxSize(q)}handleWrapJump(i){const a=(i-(this._prevLng===void 0?i:this._prevLng))/360,C=Math.round(a);if(this._prevLng=i,C){const F={};for(const q in this._tiles){const te=this._tiles[q];te.tileID=te.tileID.unwrapTo(te.tileID.wrap+C),F[te.tileID.key]=te}this._tiles=F;for(const q in this._timers)clearTimeout(this._timers[q]),delete this._timers[q];for(const q in this._tiles){const te=this._tiles[q];this._setTileReloadTimer(q,te)}}}_updateCoveredAndRetainedTiles(i,a,C,F,q,te){const ue={},ve={},Ae=Object.keys(i),Re=u.now();for(const Ue of Ae){const it=i[Ue],ct=this._tiles[Ue];if(!ct||ct.fadeEndTime!==0&&ct.fadeEndTime<=Re)continue;const dt=this.findLoadedParent(it,a),bt=this.findLoadedSibling(it),Ct=dt||bt||null;Ct&&(this._addTile(Ct.tileID),ue[Ct.tileID.key]=Ct.tileID),ve[Ue]=it}this._retainLoadedChildren(ve,F,C,i);for(const Ue in ue)i[Ue]||(this._coveredTiles[Ue]=!0,i[Ue]=ue[Ue]);if(te){const Ue={},it={};for(const ct of q)this._tiles[ct.key].hasData()?Ue[ct.key]=ct:it[ct.key]=ct;for(const ct in it){const dt=it[ct].children(this._source.maxzoom);this._tiles[dt[0].key]&&this._tiles[dt[1].key]&&this._tiles[dt[2].key]&&this._tiles[dt[3].key]&&(Ue[dt[0].key]=i[dt[0].key]=dt[0],Ue[dt[1].key]=i[dt[1].key]=dt[1],Ue[dt[2].key]=i[dt[2].key]=dt[2],Ue[dt[3].key]=i[dt[3].key]=dt[3],delete it[ct])}for(const ct in it){const dt=it[ct],bt=this.findLoadedParent(dt,this._source.minzoom),Ct=this.findLoadedSibling(dt),Mt=bt||Ct||null;if(Mt){Ue[Mt.tileID.key]=i[Mt.tileID.key]=Mt.tileID;for(const Vt in Ue)Ue[Vt].isChildOf(Mt.tileID)&&delete Ue[Vt]}}for(const ct in this._tiles)Ue[ct]||(this._coveredTiles[ct]=!0)}}update(i,a){if(!this._sourceLoaded||this._paused)return;let C;this.transform=i,this.terrain=a,this.updateCacheSize(i),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?C=i.getVisibleUnwrappedCoordinates(this._source.tileID).map(Re=>new e.S(Re.canonical.z,Re.wrap,Re.canonical.z,Re.canonical.x,Re.canonical.y)):(C=i.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:a}),this._source.hasTile&&(C=C.filter(Re=>this._source.hasTile(Re)))):C=[];const F=i.coveringZoomLevel(this._source),q=Math.max(F-Ge.maxOverzooming,this._source.minzoom),te=Math.max(F+Ge.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Re={};for(const Ue of C)if(Ue.canonical.z>this._source.minzoom){const it=Ue.scaledTo(Ue.canonical.z-1);Re[it.key]=it;const ct=Ue.scaledTo(Math.max(this._source.minzoom,Math.min(Ue.canonical.z,5)));Re[ct.key]=ct}C=C.concat(Object.values(Re))}const ue=C.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,ue&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const ve=this._updateRetainedTiles(C,F);nt(this._source.type)&&this._updateCoveredAndRetainedTiles(ve,q,te,F,C,a);for(const Re in ve)this._tiles[Re].clearFadeHold();const Ae=e.ac(this._tiles,ve);for(const Re of Ae){const Ue=this._tiles[Re];Ue.hasSymbolBuckets&&!Ue.holdingForFade()?Ue.setHoldDuration(this.map._fadeDuration):Ue.hasSymbolBuckets&&!Ue.symbolFadeFinished()||this._removeTile(Re)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const i in this._tiles)this._tiles[i].holdingForFade()&&this._removeTile(i)}_updateRetainedTiles(i,a){var C;const F={},q={},te=Math.max(a-Ge.maxOverzooming,this._source.minzoom),ue=Math.max(a+Ge.maxUnderzooming,this._source.minzoom),ve={};for(const Ae of i){const Re=this._addTile(Ae);F[Ae.key]=Ae,Re.hasData()||athis._source.maxzoom){const it=Ae.children(this._source.maxzoom)[0],ct=this.getTile(it);if(ct&&ct.hasData()){F[it.key]=it;continue}}else{const it=Ae.children(this._source.maxzoom);if(F[it[0].key]&&F[it[1].key]&&F[it[2].key]&&F[it[3].key])continue}let Ue=Re.wasRequested();for(let it=Ae.overscaledZ-1;it>=te;--it){const ct=Ae.scaledTo(it);if(q[ct.key])break;if(q[ct.key]=!0,Re=this.getTile(ct),!Re&&Ue&&(Re=this._addTile(ct)),Re){const dt=Re.hasData();if((dt||!(!((C=this.map)===null||C===void 0)&&C.cancelPendingTileRequestsWhileZooming)||Ue)&&(F[ct.key]=ct),Ue=Re.wasRequested(),dt)break}}}return F}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const i in this._tiles){const a=[];let C,F=this._tiles[i].tileID;for(;F.overscaledZ>0;){if(F.key in this._loadedParentTiles){C=this._loadedParentTiles[F.key];break}a.push(F.key);const q=F.scaledTo(F.overscaledZ-1);if(C=this._getLoadedTile(q),C)break;F=q}for(const q of a)this._loadedParentTiles[q]=C}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const i in this._tiles){const a=this._tiles[i].tileID,C=this._getLoadedTile(a);this._loadedSiblingTiles[a.key]=C}}_addTile(i){let a=this._tiles[i.key];if(a)return a;a=this._cache.getAndRemove(i),a&&(this._setTileReloadTimer(i.key,a),a.tileID=i,this._state.initializeTileState(a,this.map?this.map.painter:null),this._cacheTimers[i.key]&&(clearTimeout(this._cacheTimers[i.key]),delete this._cacheTimers[i.key],this._setTileReloadTimer(i.key,a)));const C=a;return a||(a=new _e(i,this._source.tileSize*i.overscaleFactor()),this._loadTile(a,i.key,a.state)),a.uses++,this._tiles[i.key]=a,C||this._source.fire(new e.k("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(i,a){i in this._timers&&(clearTimeout(this._timers[i]),delete this._timers[i]);const C=a.getExpiryTimeout();C&&(this._timers[i]=setTimeout(()=>{this._reloadTile(i,"expired"),delete this._timers[i]},C))}_removeTile(i){const a=this._tiles[i];a&&(a.uses--,delete this._tiles[i],this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(i){const a=i.sourceDataType;i.dataType==="source"&&a==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&i.dataType==="source"&&a==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const i in this._tiles)this._removeTile(i);this._cache.reset()}tilesIn(i,a,C){const F=[],q=this.transform;if(!q)return F;const te=C?q.getCameraQueryGeometry(i):i,ue=i.map(dt=>q.pointCoordinate(dt,this.terrain)),ve=te.map(dt=>q.pointCoordinate(dt,this.terrain)),Ae=this.getIds();let Re=1/0,Ue=1/0,it=-1/0,ct=-1/0;for(const dt of ve)Re=Math.min(Re,dt.x),Ue=Math.min(Ue,dt.y),it=Math.max(it,dt.x),ct=Math.max(ct,dt.y);for(let dt=0;dt=0&&It[1].y+Vt>=0){const Qt=ue.map(Yt=>Ct.getTilePoint(Yt)),tn=ve.map(Yt=>Ct.getTilePoint(Yt));F.push({tile:bt,tileID:Ct,queryGeometry:Qt,cameraQueryGeometry:tn,scale:Mt})}}return F}getVisibleCoordinates(i){const a=this.getRenderableIds(i).map(C=>this._tiles[C].tileID);for(const C of a)C.posMatrix=this.transform.calculatePosMatrix(C.toUnwrapped());return a}hasTransition(){if(this._source.hasTransition())return!0;if(nt(this._source.type)){const i=u.now();for(const a in this._tiles)if(this._tiles[a].fadeEndTime>=i)return!0}return!1}setFeatureState(i,a,C){i=i||"_geojsonTileLayer",this._state.updateState(i,a,C)}removeFeatureState(i,a,C){i=i||"_geojsonTileLayer",this._state.removeFeatureState(i,a,C)}getFeatureState(i,a){return i=i||"_geojsonTileLayer",this._state.getState(i,a)}setDependencies(i,a,C){const F=this._tiles[i];F&&F.setDependencies(a,C)}reloadTilesForDependencies(i,a){for(const C in this._tiles)this._tiles[C].hasDependency(i,a)&&this._reloadTile(C,"reloading");this._cache.filter(C=>!C.hasDependency(i,a))}}function tt(R,i){const a=Math.abs(2*R.wrap)-+(R.wrap<0),C=Math.abs(2*i.wrap)-+(i.wrap<0);return R.overscaledZ-i.overscaledZ||C-a||i.canonical.y-R.canonical.y||i.canonical.x-R.canonical.x}function nt(R){return R==="raster"||R==="image"||R==="video"}Ge.maxOverzooming=10,Ge.maxUnderzooming=3;class pt{constructor(i,a){this.reset(i,a)}reset(i,a){this.points=i||[],this._distances=[0];for(let C=1;C0?(F-te)/ue:0;return this.points[q].mult(1-ve).add(this.points[a].mult(ve))}}function At(R,i){let a=!0;return R==="always"||R!=="never"&&i!=="never"||(a=!1),a}class wt{constructor(i,a,C){const F=this.boxCells=[],q=this.circleCells=[];this.xCellCount=Math.ceil(i/C),this.yCellCount=Math.ceil(a/C);for(let te=0;tethis.width||F<0||a>this.height)return[];const ve=[];if(i<=0&&a<=0&&this.width<=C&&this.height<=F){if(q)return[{key:null,x1:i,y1:a,x2:C,y2:F}];for(let Ae=0;Ae0}hitTestCircle(i,a,C,F,q){const te=i-C,ue=i+C,ve=a-C,Ae=a+C;if(ue<0||te>this.width||Ae<0||ve>this.height)return!1;const Re=[],Ue={hitTest:!0,overlapMode:F,circle:{x:i,y:a,radius:C},seenUids:{box:{},circle:{}}};return this._forEachCell(te,ve,ue,Ae,this._queryCellCircle,Re,Ue,q),Re.length>0}_queryCell(i,a,C,F,q,te,ue,ve){const{seenUids:Ae,hitTest:Re,overlapMode:Ue}=ue,it=this.boxCells[q];if(it!==null){const dt=this.bboxes;for(const bt of it)if(!Ae.box[bt]){Ae.box[bt]=!0;const Ct=4*bt,Mt=this.boxKeys[bt];if(i<=dt[Ct+2]&&a<=dt[Ct+3]&&C>=dt[Ct+0]&&F>=dt[Ct+1]&&(!ve||ve(Mt))&&(!Re||!At(Ue,Mt.overlapMode))&&(te.push({key:Mt,x1:dt[Ct],y1:dt[Ct+1],x2:dt[Ct+2],y2:dt[Ct+3]}),Re))return!0}}const ct=this.circleCells[q];if(ct!==null){const dt=this.circles;for(const bt of ct)if(!Ae.circle[bt]){Ae.circle[bt]=!0;const Ct=3*bt,Mt=this.circleKeys[bt];if(this._circleAndRectCollide(dt[Ct],dt[Ct+1],dt[Ct+2],i,a,C,F)&&(!ve||ve(Mt))&&(!Re||!At(Ue,Mt.overlapMode))){const Vt=dt[Ct],It=dt[Ct+1],Qt=dt[Ct+2];if(te.push({key:Mt,x1:Vt-Qt,y1:It-Qt,x2:Vt+Qt,y2:It+Qt}),Re)return!0}}}return!1}_queryCellCircle(i,a,C,F,q,te,ue,ve){const{circle:Ae,seenUids:Re,overlapMode:Ue}=ue,it=this.boxCells[q];if(it!==null){const dt=this.bboxes;for(const bt of it)if(!Re.box[bt]){Re.box[bt]=!0;const Ct=4*bt,Mt=this.boxKeys[bt];if(this._circleAndRectCollide(Ae.x,Ae.y,Ae.radius,dt[Ct+0],dt[Ct+1],dt[Ct+2],dt[Ct+3])&&(!ve||ve(Mt))&&!At(Ue,Mt.overlapMode))return te.push(!0),!0}}const ct=this.circleCells[q];if(ct!==null){const dt=this.circles;for(const bt of ct)if(!Re.circle[bt]){Re.circle[bt]=!0;const Ct=3*bt,Mt=this.circleKeys[bt];if(this._circlesCollide(dt[Ct],dt[Ct+1],dt[Ct+2],Ae.x,Ae.y,Ae.radius)&&(!ve||ve(Mt))&&!At(Ue,Mt.overlapMode))return te.push(!0),!0}}}_forEachCell(i,a,C,F,q,te,ue,ve){const Ae=this._convertToXCellCoord(i),Re=this._convertToYCellCoord(a),Ue=this._convertToXCellCoord(C),it=this._convertToYCellCoord(F);for(let ct=Ae;ct<=Ue;ct++)for(let dt=Re;dt<=it;dt++){const bt=this.xCellCount*dt+ct;if(q.call(this,i,a,C,F,bt,te,ue,ve))return}}_convertToXCellCoord(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_convertToYCellCoord(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_circlesCollide(i,a,C,F,q,te){const ue=F-i,ve=q-a,Ae=C+te;return Ae*Ae>ue*ue+ve*ve}_circleAndRectCollide(i,a,C,F,q,te,ue){const ve=(te-F)/2,Ae=Math.abs(i-(F+ve));if(Ae>ve+C)return!1;const Re=(ue-q)/2,Ue=Math.abs(a-(q+Re));if(Ue>Re+C)return!1;if(Ae<=ve||Ue<=Re)return!0;const it=Ae-ve,ct=Ue-Re;return it*it+ct*ct<=C*C}}function Nt(R,i,a,C,F){const q=e.H();return i?(e.K(q,q,[1/F,1/F,1]),a||e.ae(q,q,C.angle)):e.L(q,C.labelPlaneMatrix,R),q}function Ht(R,i,a,C,F){if(i){const q=e.af(R);return e.K(q,q,[F,F,1]),a||e.ae(q,q,-C.angle),q}return C.glCoordMatrix}function Gt(R,i,a){let C;a?(C=[R.x,R.y,a(R.x,R.y),1],e.ag(C,C,i)):(C=[R.x,R.y,0,1],function(q,te,ue){const ve=te[0],Ae=te[1];q[0]=ue[0]*ve+ue[4]*Ae+ue[12],q[1]=ue[1]*ve+ue[5]*Ae+ue[13],q[3]=ue[3]*ve+ue[7]*Ae+ue[15]}(C,C,i));const F=C[3];return{point:new e.P(C[0]/F,C[1]/F),signedDistanceFromCamera:F,isOccluded:!1}}function st(R,i){return .5+R/i*.5}function Qe(R,i){return R.x>=-i[0]&&R.x<=i[0]&&R.y>=-i[1]&&R.y<=i[1]}function ft(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt){const bt=C?R.textSizeData:R.iconSizeData,Ct=e.ah(bt,a.transform.zoom),Mt=[256/a.width*2+1,256/a.height*2+1],Vt=C?R.text.dynamicLayoutVertexArray:R.icon.dynamicLayoutVertexArray;Vt.clear();const It=R.lineVertexArray,Qt=C?R.text.placedSymbolArray:R.icon.placedSymbolArray,tn=a.transform.width/a.transform.height;let Yt=!1;for(let vn=0;vnMath.abs(a.x-i.x)*C?{useVertical:!0}:(R===e.ai.vertical?i.ya.x)?{needsFlipping:!0}:null}function Pt(R,i,a,C,F,q,te,ue,ve,Ae,Re){const Ue=a/24,it=i.lineOffsetX*Ue,ct=i.lineOffsetY*Ue;let dt;if(i.numGlyphs>1){const bt=i.glyphStartIndex+i.numGlyphs,Ct=i.lineStartIndex,Mt=i.lineStartIndex+i.lineLength,Vt=yt(Ue,ue,it,ct,C,i,Re,R);if(!Vt)return{notEnoughRoom:!0};const It=Gt(Vt.first.point,te,R.getElevation).point,Qt=Gt(Vt.last.point,te,R.getElevation).point;if(F&&!C){const tn=Ot(i.writingMode,It,Qt,Ae);if(tn)return tn}dt=[Vt.first];for(let tn=i.glyphStartIndex+1;tn0?It.point:function(Yt,vn,Mn,Vn,Hn,Xn){return at(Yt,vn,Mn,Vn,Hn,Xn)}(R.tileAnchorPoint,Vt,Ct,1,q,R),tn=Ot(i.writingMode,Ct,Qt,Ae);if(tn)return tn}const bt=vt(Ue*ue.getoffsetX(i.glyphStartIndex),it,ct,C,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,R,Re);if(!bt||R.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};dt=[bt]}for(const bt of dt)e.ak(ve,bt.point,bt.angle);return{}}function at(R,i,a,C,F,q){const te=R.add(R.sub(i)._unit()),ue=F!==void 0?Gt(te,F,q.getElevation).point:Xe(te.x,te.y,q).point,ve=a.sub(ue);return a.add(ve._mult(C/ve.mag()))}function lt(R,i,a){const C=i.projectionCache;if(C.projections[R])return C.projections[R];const F=new e.P(i.lineVertexArray.getx(R),i.lineVertexArray.gety(R)),q=Xe(F.x,F.y,i);if(q.signedDistanceFromCamera>0)return C.projections[R]=q.point,C.anyProjectionOccluded=C.anyProjectionOccluded||q.isOccluded,q.point;const te=R-a.direction,ue=a.distanceFromAnchor===0?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(te),i.lineVertexArray.gety(te)),ve=a.absOffsetX-a.distanceFromAnchor+1;return function(Ae,Re,Ue,it,ct){return at(Ae,Re,Ue,it,void 0,ct)}(ue,F,a.previousVertex,ve,i)}function Xe(R,i,a){const C=R+a.translation[0],F=i+a.translation[1];let q;return!a.pitchWithMap&&a.projection.useSpecialProjectionForSymbols?(q=a.projection.projectTileCoordinates(C,F,a.unwrappedTileID,a.getElevation),q.point.x=(.5*q.point.x+.5)*a.width,q.point.y=(.5*-q.point.y+.5)*a.height):(q=Gt(new e.P(C,F),a.labelPlaneMatrix,a.getElevation),q.isOccluded=!1),q}function ut(R,i,a){return R._unit()._perp()._mult(i*a)}function Tt(R,i,a,C,F,q,te,ue,ve){if(ue.projectionCache.offsets[R])return ue.projectionCache.offsets[R];const Ae=a.add(i);if(R+ve.direction=F)return ue.projectionCache.offsets[R]=Ae,Ae;const Re=lt(R+ve.direction,ue,ve),Ue=ut(Re.sub(a),te,ve.direction),it=a.add(Ue),ct=Re.add(Ue);return ue.projectionCache.offsets[R]=e.al(q,Ae,it,ct)||Ae,ue.projectionCache.offsets[R]}function vt(R,i,a,C,F,q,te,ue,ve){const Ae=C?R-i:R+i;let Re=Ae>0?1:-1,Ue=0;C&&(Re*=-1,Ue=Math.PI),Re<0&&(Ue+=Math.PI);let it,ct=Re>0?q+F:q+F+1;ue.projectionCache.cachedAnchorPoint?it=ue.projectionCache.cachedAnchorPoint:(it=Xe(ue.tileAnchorPoint.x,ue.tileAnchorPoint.y,ue).point,ue.projectionCache.cachedAnchorPoint=it);let dt,bt,Ct=it,Mt=it,Vt=0,It=0;const Qt=Math.abs(Ae),tn=[];let Yt;for(;Vt+It<=Qt;){if(ct+=Re,ct=te)return null;Vt+=It,Mt=Ct,bt=dt;const Hn={absOffsetX:Qt,direction:Re,distanceFromAnchor:Vt,previousVertex:Mt};if(Ct=lt(ct,ue,Hn),a===0)tn.push(Mt),Yt=Ct.sub(Mt);else{let Xn;const rr=Ct.sub(Mt);Xn=rr.mag()===0?ut(lt(ct+Re,ue,Hn).sub(Ct),a,Re):ut(rr,a,Re),bt||(bt=Mt.add(Xn)),dt=Tt(ct,Xn,Ct,q,te,bt,a,ue,Hn),tn.push(bt),Yt=dt.sub(bt)}It=Yt.mag()}const vn=(Qt-Vt)/It,Mn=Yt._mult(vn)._add(bt||Mt),Vn=Ue+Math.atan2(Ct.y-Mt.y,Ct.x-Mt.x);return tn.push(Mn),{point:Mn,angle:ve?Vn:0,path:tn}}const Lt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ut(R,i){for(let a=0;a=1;Nr--)Sr.push(dr.path[Nr]);for(let Nr=1;Nrsi.signedDistanceFromCamera<=0)?[]:Nr.map(si=>si.point)}let fi=[];if(Sr.length>0){const Nr=Sr[0].clone(),si=Sr[0].clone();for(let _i=1;_i=Mr.x&&si.x<=nr.x&&Nr.y>=Mr.y&&si.y<=nr.y?[Sr]:si.xnr.x||si.ynr.y?[]:e.am([Sr],Mr.x,Mr.y,nr.x,nr.y)}for(const Nr of fi){Lr.reset(Nr,.25*rr);let si=0;si=Lr.length<=.5*rr?1:Math.ceil(Lr.paddedLength/Vr)+1;for(let _i=0;_iGt(F,C,a.getElevation))}queryRenderedSymbols(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const a=[];let C=1/0,F=1/0,q=-1/0,te=-1/0;for(const Re of i){const Ue=new e.P(Re.x+rt,Re.y+rt);C=Math.min(C,Ue.x),F=Math.min(F,Ue.y),q=Math.max(q,Ue.x),te=Math.max(te,Ue.y),a.push(Ue)}const ue=this.grid.query(C,F,q,te).concat(this.ignoredGrid.query(C,F,q,te)),ve={},Ae={};for(const Re of ue){const Ue=Re.key;if(ve[Ue.bucketInstanceId]===void 0&&(ve[Ue.bucketInstanceId]={}),ve[Ue.bucketInstanceId][Ue.featureIndex])continue;const it=[new e.P(Re.x1,Re.y1),new e.P(Re.x2,Re.y1),new e.P(Re.x2,Re.y2),new e.P(Re.x1,Re.y2)];e.an(a,it)&&(ve[Ue.bucketInstanceId][Ue.featureIndex]=!0,Ae[Ue.bucketInstanceId]===void 0&&(Ae[Ue.bucketInstanceId]=[]),Ae[Ue.bucketInstanceId].push(Ue.featureIndex))}return Ae}insertCollisionBox(i,a,C,F,q,te){const ue={bucketInstanceId:F,featureIndex:q,collisionGroupID:te,overlapMode:a};(C?this.ignoredGrid:this.grid).insert(ue,i[0],i[1],i[2],i[3])}insertCollisionCircles(i,a,C,F,q,te){const ue=C?this.ignoredGrid:this.grid,ve={bucketInstanceId:F,featureIndex:q,collisionGroupID:te,overlapMode:a};for(let Ae=0;Ae=this.screenRightBoundary||Fthis.screenBottomBoundary}isInsideGrid(i,a,C,F){return C>=0&&i=0&&athis.projectAndGetPerspectiveRatio(C,Xn.x,Xn.y,F,Ae));Vn=Hn.some(Xn=>!Xn.isOccluded),Mn=Hn.map(Xn=>Xn.point)}else Vn=!0;return{box:e.ap(Mn),allPointsOccluded:!Vn}}}function Et(R,i,a){return i*(e.X/(R.tileSize*Math.pow(2,a-R.tileID.overscaledZ)))}class Bt{constructor(i,a,C,F){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?a:-a))):F&&C?1:0,this.placed=C}isHidden(){return this.opacity===0&&!this.placed}}class Ft{constructor(i,a,C,F,q){this.text=new Bt(i?i.text:null,a,C,q),this.icon=new Bt(i?i.icon:null,a,F,q)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class St{constructor(i,a,C){this.text=i,this.icon=a,this.skipFade=C}}class Jt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class qt{constructor(i,a,C,F,q){this.bucketInstanceId=i,this.featureIndex=a,this.sourceLayerIndex=C,this.bucketIndex=F,this.tileID=q}}class en{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){const a=++this.maxGroupID;this.collisionGroups[i]={ID:a,predicate:C=>C.collisionGroupID===a}}return this.collisionGroups[i]}}function Wt(R,i,a,C,F){const{horizontalAlign:q,verticalAlign:te}=e.av(R),ue=-(q-.5)*i,ve=-(te-.5)*a;return new e.P(ue+C[0]*F,ve+C[1]*F)}class Zt{constructor(i,a,C,F,q,te){this.transform=i.clone(),this.terrain=C,this.collisionIndex=new et(this.transform,a),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=F,this.retainedQueryData={},this.collisionGroups=new en(q),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=te,te&&(te.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(i){const a=this.terrain;return a?(C,F)=>a.getElevation(i,C,F):null}getBucketParts(i,a,C,F){const q=C.getBucket(a),te=C.latestFeatureIndex;if(!q||!te||a.id!==q.layerIds[0])return;const ue=C.collisionBoxArray,ve=q.layers[0].layout,Ae=q.layers[0].paint,Re=Math.pow(2,this.transform.zoom-C.tileID.overscaledZ),Ue=C.tileSize/e.X,it=C.tileID.toUnwrapped(),ct=this.transform.calculatePosMatrix(it),dt=ve.get("text-pitch-alignment")==="map",bt=ve.get("text-rotation-alignment")==="map",Ct=Et(C,1,this.transform.zoom),Mt=this.collisionIndex.mapProjection.translatePosition(this.transform,C,Ae.get("text-translate"),Ae.get("text-translate-anchor")),Vt=this.collisionIndex.mapProjection.translatePosition(this.transform,C,Ae.get("icon-translate"),Ae.get("icon-translate-anchor")),It=Nt(ct,dt,bt,this.transform,Ct);let Qt=null;if(dt){const Yt=Ht(ct,dt,bt,this.transform,Ct);Qt=e.L([],this.transform.labelPlaneMatrix,Yt)}this.retainedQueryData[q.bucketInstanceId]=new qt(q.bucketInstanceId,te,q.sourceLayerIndex,q.index,C.tileID);const tn={bucket:q,layout:ve,translationText:Mt,translationIcon:Vt,posMatrix:ct,unwrappedTileID:it,textLabelPlaneMatrix:It,labelToScreenMatrix:Qt,scale:Re,textPixelRatio:Ue,holdingForFade:C.holdingForFade(),collisionBoxArray:ue,partiallyEvaluatedTextSize:e.ah(q.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(q.sourceID)};if(F)for(const Yt of q.sortKeyRanges){const{sortKey:vn,symbolInstanceStart:Mn,symbolInstanceEnd:Vn}=Yt;i.push({sortKey:vn,symbolInstanceStart:Mn,symbolInstanceEnd:Vn,parameters:tn})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:q.symbolInstances.length,parameters:tn})}attemptAnchorPlacement(i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt,bt,Ct,Mt,Vt,It){const Qt=e.ar[i.textAnchor],tn=[i.textOffset0,i.textOffset1],Yt=Wt(Qt,C,F,tn,q),vn=this.collisionIndex.placeCollisionBox(a,it,ve,Ae,Re,ue,te,Ct,Ue.predicate,It,Yt);if((!Vt||this.collisionIndex.placeCollisionBox(Vt,it,ve,Ae,Re,ue,te,Mt,Ue.predicate,It,Yt).placeable)&&vn.placeable){let Mn;if(this.prevPlacement&&this.prevPlacement.variableOffsets[ct.crossTileID]&&this.prevPlacement.placements[ct.crossTileID]&&this.prevPlacement.placements[ct.crossTileID].text&&(Mn=this.prevPlacement.variableOffsets[ct.crossTileID].anchor),ct.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[ct.crossTileID]={textOffset:tn,width:C,height:F,anchor:Qt,textBoxScale:q,prevAnchor:Mn},this.markUsedJustification(dt,Qt,ct,bt),dt.allowVerticalPlacement&&(this.markUsedOrientation(dt,bt,ct),this.placedOrientations[ct.crossTileID]=bt),{shift:Yt,placedGlyphBoxes:vn}}}placeLayerBucketPart(i,a,C){const{bucket:F,layout:q,translationText:te,translationIcon:ue,posMatrix:ve,unwrappedTileID:Ae,textLabelPlaneMatrix:Re,labelToScreenMatrix:Ue,textPixelRatio:it,holdingForFade:ct,collisionBoxArray:dt,partiallyEvaluatedTextSize:bt,collisionGroup:Ct}=i.parameters,Mt=q.get("text-optional"),Vt=q.get("icon-optional"),It=e.as(q,"text-overlap","text-allow-overlap"),Qt=It==="always",tn=e.as(q,"icon-overlap","icon-allow-overlap"),Yt=tn==="always",vn=q.get("text-rotation-alignment")==="map",Mn=q.get("text-pitch-alignment")==="map",Vn=q.get("icon-text-fit")!=="none",Hn=q.get("symbol-z-order")==="viewport-y",Xn=Qt&&(Yt||!F.hasIconData()||Vt),rr=Yt&&(Qt||!F.hasTextData()||Mt);!F.collisionArrays&&dt&&F.deserializeCollisionBoxes(dt);const Mr=this.retainedQueryData[F.bucketInstanceId].tileID,nr=this._getTerrainElevationFunc(Mr),Lr=(dr,Br,Sr)=>{var Vr,fi;if(a[dr.crossTileID])return;if(ct)return void(this.placements[dr.crossTileID]=new St(!1,!1,!1));let Nr=!1,si=!1,_i=!0,Gi=null,Pi={box:null,placeable:!1,offscreen:null},Ji={box:null,placeable:!1,offscreen:null},Yi=null,na=null,Ma=null,go=0,uo=0,Go=0;Br.textFeatureIndex?go=Br.textFeatureIndex:dr.useRuntimeCollisionCircles&&(go=dr.featureIndex),Br.verticalTextFeatureIndex&&(uo=Br.verticalTextFeatureIndex);const Da=Br.textBox;if(Da){const Fa=mo=>{let Hi=e.ai.horizontal;if(F.allowVerticalPlacement&&!mo&&this.prevPlacement){const fs=this.prevPlacement.placedOrientations[dr.crossTileID];fs&&(this.placedOrientations[dr.crossTileID]=fs,Hi=fs,this.markUsedOrientation(F,Hi,dr))}return Hi},qa=(mo,Hi)=>{if(F.allowVerticalPlacement&&dr.numVerticalGlyphVertices>0&&Br.verticalTextBox){for(const fs of F.writingModes)if(fs===e.ai.vertical?(Pi=Hi(),Ji=Pi):Pi=mo(),Pi&&Pi.placeable)break}else Pi=mo()},fa=dr.textAnchorOffsetStartIndex,Pl=dr.textAnchorOffsetEndIndex;if(Pl===fa){const mo=(Hi,fs)=>{const Po=this.collisionIndex.placeCollisionBox(Hi,It,it,ve,Ae,Mn,vn,te,Ct.predicate,nr);return Po&&Po.placeable&&(this.markUsedOrientation(F,fs,dr),this.placedOrientations[dr.crossTileID]=fs),Po};qa(()=>mo(Da,e.ai.horizontal),()=>{const Hi=Br.verticalTextBox;return F.allowVerticalPlacement&&dr.numVerticalGlyphVertices>0&&Hi?mo(Hi,e.ai.vertical):{box:null,offscreen:null}}),Fa(Pi&&Pi.placeable)}else{let mo=e.ar[(fi=(Vr=this.prevPlacement)===null||Vr===void 0?void 0:Vr.variableOffsets[dr.crossTileID])===null||fi===void 0?void 0:fi.anchor];const Hi=(Po,ll,ao)=>{const ul=Po.x2-Po.x1,Lo=Po.y2-Po.y1,Bc=dr.textBoxScale,ef=Vn&&tn==="never"?ll:null;let ga=null,Ch=It==="never"?1:2,Cu="never";mo&&Ch++;for(let Sc=0;ScHi(Da,Br.iconBox,e.ai.horizontal),()=>{const Po=Br.verticalTextBox,ll=Pi&&Pi.placeable;return F.allowVerticalPlacement&&!ll&&dr.numVerticalGlyphVertices>0&&Po?Hi(Po,Br.verticalIconBox,e.ai.vertical):{box:null,occluded:!0,offscreen:null}}),Pi&&(Nr=Pi.placeable,_i=Pi.offscreen);const fs=Fa(Pi&&Pi.placeable);if(!Nr&&this.prevPlacement){const Po=this.prevPlacement.variableOffsets[dr.crossTileID];Po&&(this.variableOffsets[dr.crossTileID]=Po,this.markUsedJustification(F,Po.anchor,dr,fs))}}}if(Yi=Pi,Nr=Yi&&Yi.placeable,_i=Yi&&Yi.offscreen,dr.useRuntimeCollisionCircles){const Fa=F.text.placedSymbolArray.get(dr.centerJustifiedTextSymbolIndex),qa=e.aj(F.textSizeData,bt,Fa),fa=q.get("text-padding"),Pl=dr.collisionCircleDiameter;na=this.collisionIndex.placeCollisionCircles(It,Fa,F.lineVertexArray,F.glyphOffsetArray,qa,ve,Ae,Re,Ue,C,Mn,Ct.predicate,Pl,fa,te,nr),na.circles.length&&na.collisionDetected&&!C&&e.w("Collisions detected, but collision boxes are not shown"),Nr=Qt||na.circles.length>0&&!na.collisionDetected,_i=_i&&na.offscreen}if(Br.iconFeatureIndex&&(Go=Br.iconFeatureIndex),Br.iconBox){const Fa=qa=>this.collisionIndex.placeCollisionBox(qa,tn,it,ve,Ae,Mn,vn,ue,Ct.predicate,nr,Vn&&Gi?Gi:void 0);Ji&&Ji.placeable&&Br.verticalIconBox?(Ma=Fa(Br.verticalIconBox),si=Ma.placeable):(Ma=Fa(Br.iconBox),si=Ma.placeable),_i=_i&&Ma.offscreen}const ca=Mt||dr.numHorizontalGlyphVertices===0&&dr.numVerticalGlyphVertices===0,Qa=Vt||dr.numIconVertices===0;ca||Qa?Qa?ca||(si=si&&Nr):Nr=si&&Nr:si=Nr=si&&Nr;const Ra=Nr&&Yi.placeable,wa=si&&Ma.placeable;if(Ra&&(Ji&&Ji.placeable&&uo?this.collisionIndex.insertCollisionBox(Yi.box,It,q.get("text-ignore-placement"),F.bucketInstanceId,uo,Ct.ID):this.collisionIndex.insertCollisionBox(Yi.box,It,q.get("text-ignore-placement"),F.bucketInstanceId,go,Ct.ID)),wa&&this.collisionIndex.insertCollisionBox(Ma.box,tn,q.get("icon-ignore-placement"),F.bucketInstanceId,Go,Ct.ID),na&&Nr&&this.collisionIndex.insertCollisionCircles(na.circles,It,q.get("text-ignore-placement"),F.bucketInstanceId,go,Ct.ID),C&&this.storeCollisionData(F.bucketInstanceId,Sr,Br,Yi,Ma,na),dr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(F.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[dr.crossTileID]=new St(Nr||Xn,si||rr,_i||F.justReloaded),a[dr.crossTileID]=!0};if(Hn){if(i.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const dr=F.getSortedSymbolIndexes(this.transform.angle);for(let Br=dr.length-1;Br>=0;--Br){const Sr=dr[Br];Lr(F.symbolInstances.get(Sr),F.collisionArrays[Sr],Sr)}}else for(let dr=i.symbolInstanceStart;dr=0&&(i.text.placedSymbolArray.get(ve).crossTileID=te>=0&&ve!==te?0:C.crossTileID)}markUsedOrientation(i,a,C){const F=a===e.ai.horizontal||a===e.ai.horizontalOnly?a:0,q=a===e.ai.vertical?a:0,te=[C.leftJustifiedTextSymbolIndex,C.centerJustifiedTextSymbolIndex,C.rightJustifiedTextSymbolIndex];for(const ue of te)i.text.placedSymbolArray.get(ue).placedOrientation=F;C.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(C.verticalPlacedTextSymbolIndex).placedOrientation=q)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;const a=this.prevPlacement;let C=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;const F=a?a.symbolFadeChange(i):1,q=a?a.opacities:{},te=a?a.variableOffsets:{},ue=a?a.placedOrientations:{};for(const ve in this.placements){const Ae=this.placements[ve],Re=q[ve];Re?(this.opacities[ve]=new Ft(Re,F,Ae.text,Ae.icon),C=C||Ae.text!==Re.text.placed||Ae.icon!==Re.icon.placed):(this.opacities[ve]=new Ft(null,F,Ae.text,Ae.icon,Ae.skipFade),C=C||Ae.text||Ae.icon)}for(const ve in q){const Ae=q[ve];if(!this.opacities[ve]){const Re=new Ft(Ae,F,!1,!1);Re.isHidden()||(this.opacities[ve]=Re,C=C||Ae.text.placed||Ae.icon.placed)}}for(const ve in te)this.variableOffsets[ve]||!this.opacities[ve]||this.opacities[ve].isHidden()||(this.variableOffsets[ve]=te[ve]);for(const ve in ue)this.placedOrientations[ve]||!this.opacities[ve]||this.opacities[ve].isHidden()||(this.placedOrientations[ve]=ue[ve]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");C?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:i)}updateLayerOpacities(i,a){const C={};for(const F of a){const q=F.getBucket(i);q&&F.latestFeatureIndex&&i.id===q.layerIds[0]&&this.updateBucketOpacities(q,F.tileID,C,F.collisionBoxArray)}}updateBucketOpacities(i,a,C,F){i.hasTextData()&&(i.text.opacityVertexArray.clear(),i.text.hasVisibleVertices=!1),i.hasIconData()&&(i.icon.opacityVertexArray.clear(),i.icon.hasVisibleVertices=!1),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();const q=i.layers[0],te=q.layout,ue=new Ft(null,0,!1,!1,!0),ve=te.get("text-allow-overlap"),Ae=te.get("icon-allow-overlap"),Re=q._unevaluatedLayout.hasValue("text-variable-anchor")||q._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Ue=te.get("text-rotation-alignment")==="map",it=te.get("text-pitch-alignment")==="map",ct=te.get("icon-text-fit")!=="none",dt=new Ft(null,0,ve&&(Ae||!i.hasIconData()||te.get("icon-optional")),Ae&&(ve||!i.hasTextData()||te.get("text-optional")),!0);!i.collisionArrays&&F&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(F);const bt=(Mt,Vt,It)=>{for(let Qt=0;Qt0||Qt>0,Vn=Vt.numIconVertices>0,Hn=this.placedOrientations[Vt.crossTileID],Xn=Hn===e.ai.vertical,rr=Hn===e.ai.horizontal||Hn===e.ai.horizontalOnly;if(Mn){const nr=Ln(vn.text),Lr=Xn?Tn:nr;bt(i.text,It,Lr);const dr=rr?Tn:nr;bt(i.text,Qt,dr);const Br=vn.text.isHidden();[Vt.rightJustifiedTextSymbolIndex,Vt.centerJustifiedTextSymbolIndex,Vt.leftJustifiedTextSymbolIndex].forEach(fi=>{fi>=0&&(i.text.placedSymbolArray.get(fi).hidden=Br||Xn?1:0)}),Vt.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(Vt.verticalPlacedTextSymbolIndex).hidden=Br||rr?1:0);const Sr=this.variableOffsets[Vt.crossTileID];Sr&&this.markUsedJustification(i,Sr.anchor,Vt,Hn);const Vr=this.placedOrientations[Vt.crossTileID];Vr&&(this.markUsedJustification(i,"left",Vt,Vr),this.markUsedOrientation(i,Vr,Vt))}if(Vn){const nr=Ln(vn.icon),Lr=!(ct&&Vt.verticalPlacedIconSymbolIndex&&Xn);if(Vt.placedIconSymbolIndex>=0){const dr=Lr?nr:Tn;bt(i.icon,Vt.numIconVertices,dr),i.icon.placedSymbolArray.get(Vt.placedIconSymbolIndex).hidden=vn.icon.isHidden()}if(Vt.verticalPlacedIconSymbolIndex>=0){const dr=Lr?Tn:nr;bt(i.icon,Vt.numVerticalIconVertices,dr),i.icon.placedSymbolArray.get(Vt.verticalPlacedIconSymbolIndex).hidden=vn.icon.isHidden()}}const Mr=Ct&&Ct.has(Mt)?Ct.get(Mt):{text:null,icon:null};if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){const nr=i.collisionArrays[Mt];if(nr){let Lr=new e.P(0,0);if(nr.textBox||nr.verticalTextBox){let dr=!0;if(Re){const Br=this.variableOffsets[tn];Br?(Lr=Wt(Br.anchor,Br.width,Br.height,Br.textOffset,Br.textBoxScale),Ue&&Lr._rotate(it?this.transform.angle:-this.transform.angle)):dr=!1}if(nr.textBox||nr.verticalTextBox){let Br;nr.textBox&&(Br=Xn),nr.verticalTextBox&&(Br=rr),on(i.textCollisionBox.collisionVertexArray,vn.text.placed,!dr||Br,Mr.text,Lr.x,Lr.y)}}if(nr.iconBox||nr.verticalIconBox){const dr=!!(!rr&&nr.verticalIconBox);let Br;nr.iconBox&&(Br=dr),nr.verticalIconBox&&(Br=!dr),on(i.iconCollisionBox.collisionVertexArray,vn.icon.placed,Br,Mr.icon,ct?Lr.x:0,ct?Lr.y:0)}}}}if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.text.opacityVertexArray.length!==i.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${i.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${i.text.layoutVertexArray.length}) / 4`);if(i.icon.opacityVertexArray.length!==i.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${i.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${i.icon.layoutVertexArray.length}) / 4`);if(i.bucketInstanceId in this.collisionCircleArrays){const Mt=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=Mt.invProjMatrix,i.placementViewportMatrix=Mt.viewportMatrix,i.collisionCircleArray=Mt.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}}symbolFadeChange(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return this.stale||i-this.lastPlacementChangeTimei}setStale(){this.stale=!0}}function on(R,i,a,C,F,q){C&&C.length!==0||(C=[0,0,0,0]);const te=C[0]-rt,ue=C[1]-rt,ve=C[2]-rt,Ae=C[3]-rt;R.emplaceBack(i?1:0,a?1:0,F||0,q||0,te,ue),R.emplaceBack(i?1:0,a?1:0,F||0,q||0,ve,ue),R.emplaceBack(i?1:0,a?1:0,F||0,q||0,ve,Ae),R.emplaceBack(i?1:0,a?1:0,F||0,q||0,te,Ae)}const un=Math.pow(2,25),Pn=Math.pow(2,24),Dn=Math.pow(2,17),In=Math.pow(2,16),mn=Math.pow(2,9),En=Math.pow(2,8),Kn=Math.pow(2,1);function Ln(R){if(R.opacity===0&&!R.placed)return 0;if(R.opacity===1&&R.placed)return 4294967295;const i=R.placed?1:0,a=Math.floor(127*R.opacity);return a*un+i*Pn+a*Dn+i*In+a*mn+i*En+a*Kn+i}const Tn=0;function Fn(){return{isOccluded(R,i,a){return!1},getPitchedTextCorrection(R,i,a){return 1},get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(R,i,a,C){throw new Error("Not implemented.")},translatePosition(R,i,a,C){return function(F,q,te,ue,ve=!1){if(!te[0]&&!te[1])return[0,0];const Ae=ve?ue==="map"?F.angle:0:ue==="viewport"?-F.angle:0;if(Ae){const Re=Math.sin(Ae),Ue=Math.cos(Ae);te=[te[0]*Ue-te[1]*Re,te[0]*Re+te[1]*Ue]}return[ve?te[0]:Et(q,te[0],F.zoom),ve?te[1]:Et(q,te[1],F.zoom)]}(R,i,a,C)},getCircleRadiusCorrection(R){return 1}}}class wn{constructor(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&!i.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(i,a,C,F,q){const te=this._bucketParts;for(;this._currentTileIndexue.sortKey-ve.sortKey));this._currentPartIndex!this._forceFullPlacement&&u.now()-F>2;for(;this._currentPlacementIndex>=0;){const te=a[i[this._currentPlacementIndex]],ue=this.placement.collisionIndex.transform.zoom;if(te.type==="symbol"&&(!te.minzoom||te.minzoom<=ue)&&(!te.maxzoom||te.maxzoom>ue)){if(this._inProgressLayer||(this._inProgressLayer=new wn(te)),this._inProgressLayer.continuePlacement(C[te.source],this.placement,this._showCollisionBoxes,te,q))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(i){return this.placement.commit(i),this.placement}}const Jn=512/e.X/2;class $n{constructor(i,a,C){this.tileID=i,this.bucketInstanceId=C,this._symbolsByKey={};const F=new Map;for(let q=0;q({x:Math.floor(ve.anchorX*Jn),y:Math.floor(ve.anchorY*Jn)})),crossTileIDs:te.map(ve=>ve.crossTileID)};if(ue.positions.length>128){const ve=new e.aw(ue.positions.length,16,Uint16Array);for(const{x:Ae,y:Re}of ue.positions)ve.add(Ae,Re);ve.finish(),delete ue.positions,ue.index=ve}this._symbolsByKey[q]=ue}}getScaledCoordinates(i,a){const{x:C,y:F,z:q}=this.tileID.canonical,{x:te,y:ue,z:ve}=a.canonical,Ae=ve-q,Re=Jn/Math.pow(2,Ae),Ue=(te*e.X+i.anchorX)*Re,it=(ue*e.X+i.anchorY)*Re,ct=C*e.X*Jn,dt=F*e.X*Jn;return{x:Math.floor(Ue-ct),y:Math.floor(it-dt)}}findMatches(i,a,C){const F=this.tileID.canonical.zi)}}class vr{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Qn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){const a=Math.round((i-this.lng)/360);if(a!==0)for(const C in this.indexes){const F=this.indexes[C],q={};for(const te in F){const ue=F[te];ue.tileID=ue.tileID.unwrapTo(ue.tileID.wrap+a),q[ue.tileID.key]=ue}this.indexes[C]=q}this.lng=i}addBucket(i,a,C){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let q=0;qi.overscaledZ)for(const ue in te){const ve=te[ue];ve.tileID.isChildOf(i)&&ve.findMatches(a.symbolInstances,i,F)}else{const ue=te[i.scaledTo(Number(q)).key];ue&&ue.findMatches(a.symbolInstances,i,F)}}for(let q=0;q{a[C]=!0});for(const C in this.layerIndexes)a[C]||delete this.layerIndexes[C]}}const hr=(R,i)=>e.t(R,i&&i.filter(a=>a.identifier!=="source.canvas")),jr=e.ax();class ni extends e.E{constructor(i,a={}){super(),this._rtlPluginLoaded=()=>{for(const C in this.sourceCaches){const F=this.sourceCaches[C].getSource().type;F!=="vector"&&F!=="geojson"||this.sourceCaches[C].reload()}},this.map=i,this.dispatcher=new le(oe(),i._getMapId()),this.dispatcher.registerMessageHandler("GG",(C,F)=>this.getGlyphs(C,F)),this.dispatcher.registerMessageHandler("GI",(C,F)=>this.getImages(C,F)),this.imageManager=new E,this.imageManager.setEventedParent(this),this.glyphManager=new V(i._requestManager,a.localIdeographFontFamily),this.lineAtlas=new K(256,512),this.crossTileSymbolIndex=new lr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.az()),Ye().on(Fe,this._rtlPluginLoaded),this.on("data",C=>{if(C.dataType!=="source"||C.sourceDataType!=="metadata")return;const F=this.sourceCaches[C.sourceId];if(!F)return;const q=F.getSource();if(q&&q.vectorLayerIds)for(const te in this._layers){const ue=this._layers[te];ue.source===q.id&&this._validateLayer(ue)}})}loadURL(i,a={},C){this.fire(new e.k("dataloading",{dataType:"style"})),a.validate=typeof a.validate!="boolean"||a.validate;const F=this.map._requestManager.transformRequest(i,"Style");this._loadStyleRequest=new AbortController;const q=this._loadStyleRequest;e.h(F,this._loadStyleRequest).then(te=>{this._loadStyleRequest=null,this._load(te.data,a,C)}).catch(te=>{this._loadStyleRequest=null,te&&!q.signal.aborted&&this.fire(new e.j(te))})}loadJSON(i,a={},C){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(i,a,C)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(jr,{validate:!1})}_load(i,a,C){var F;const q=a.transformStyle?a.transformStyle(C,i):i;if(!a.validate||!hr(this,e.x(q))){this._loaded=!0,this.stylesheet=q;for(const te in q.sources)this.addSource(te,q.sources[te],{validate:!1});q.sprite?this._loadSprite(q.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(q.glyphs),this._createLayers(),this.light=new H(this.stylesheet.light),this.sky=new Z(this.stylesheet.sky),this.map.setTerrain((F=this.stylesheet.terrain)!==null&&F!==void 0?F:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const i=e.aA(this.stylesheet.layers);this.dispatcher.broadcast("SL",i),this._order=i.map(a=>a.id),this._layers={},this._serializedLayers=null;for(const a of i){const C=e.aB(a);C.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=C}}_loadSprite(i,a=!1,C=void 0){let F;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,p(i,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(q=>{if(this._spriteRequest=null,q)for(const te in q){this._spritesImagesIds[te]=[];const ue=this._spritesImagesIds[te]?this._spritesImagesIds[te].filter(ve=>!(ve in q)):[];for(const ve of ue)this.imageManager.removeImage(ve),this._changedImages[ve]=!0;for(const ve in q[te]){const Ae=te==="default"?ve:`${te}:${ve}`;this._spritesImagesIds[te].push(Ae),Ae in this.imageManager.images?this.imageManager.updateImage(Ae,q[te][ve],!1):this.imageManager.addImage(Ae,q[te][ve]),a&&(this._changedImages[Ae]=!0)}}}).catch(q=>{this._spriteRequest=null,F=q,this.fire(new e.j(F))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),C&&C(F)})}_unloadSprite(){for(const i of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(i),this._changedImages[i]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(i){const a=this.sourceCaches[i.source];if(!a)return;const C=i.sourceLayer;if(!C)return;const F=a.getSource();(F.type==="geojson"||F.vectorLayerIds&&F.vectorLayerIds.indexOf(C)===-1)&&this.fire(new e.j(new Error(`Source layer "${C}" does not exist on source "${F.id}" as specified by style layer "${i.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const i in this.sourceCaches)if(!this.sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(i){const a=this._serializedAllLayers();if(!i||i.length===0)return Object.values(a);const C=[];for(const F of i)a[F]&&C.push(a[F]);return C}_serializedAllLayers(){let i=this._serializedLayers;if(i)return i;i=this._serializedLayers={};const a=Object.keys(this._layers);for(const C of a){const F=this._layers[C];F.type!=="custom"&&(i[C]=F.serialize())}return i}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const i in this.sourceCaches)if(this.sourceCaches[i].hasTransition())return!0;for(const i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(i){if(!this._loaded)return;const a=this._changed;if(a){const F=Object.keys(this._updatedLayers),q=Object.keys(this._removedLayers);(F.length||q.length)&&this._updateWorkerLayers(F,q);for(const te in this._updatedSources){const ue=this._updatedSources[te];if(ue==="reload")this._reloadSource(te);else{if(ue!=="clear")throw new Error(`Invalid action ${ue}`);this._clearSource(te)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const te in this._updatedPaintProps)this._layers[te].updateTransitions(i);this.light.updateTransitions(i),this.sky.updateTransitions(i),this._resetUpdates()}const C={};for(const F in this.sourceCaches){const q=this.sourceCaches[F];C[F]=q.used,q.used=!1}for(const F of this._order){const q=this._layers[F];q.recalculate(i,this._availableImages),!q.isHidden(i.zoom)&&q.source&&(this.sourceCaches[q.source].used=!0)}for(const F in C){const q=this.sourceCaches[F];!!C[F]!=!!q.used&&q.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:F}))}this.light.recalculate(i),this.sky.recalculate(i),this.z=i.zoom,a&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const i=Object.keys(this._changedImages);if(i.length){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["icons","patterns"],i);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const i in this.sourceCaches)this.sourceCaches[i].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(i,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(i),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(i,a={}){var C;this._checkLoaded();const F=this.serialize();if(i=a.transformStyle?a.transformStyle(F,i):i,((C=a.validate)===null||C===void 0||C)&&hr(this,e.x(i)))return!1;(i=e.aC(i)).layers=e.aA(i.layers);const q=e.aD(F,i),te=this._getOperationsToPerform(q);if(te.unimplemented.length>0)throw new Error(`Unimplemented: ${te.unimplemented.join(", ")}.`);if(te.operations.length===0)return!1;for(const ue of te.operations)ue();return this.stylesheet=i,this._serializedLayers=null,!0}_getOperationsToPerform(i){const a=[],C=[];for(const F of i)switch(F.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":a.push(()=>this.addLayer.apply(this,F.args));break;case"removeLayer":a.push(()=>this.removeLayer.apply(this,F.args));break;case"setPaintProperty":a.push(()=>this.setPaintProperty.apply(this,F.args));break;case"setLayoutProperty":a.push(()=>this.setLayoutProperty.apply(this,F.args));break;case"setFilter":a.push(()=>this.setFilter.apply(this,F.args));break;case"addSource":a.push(()=>this.addSource.apply(this,F.args));break;case"removeSource":a.push(()=>this.removeSource.apply(this,F.args));break;case"setLayerZoomRange":a.push(()=>this.setLayerZoomRange.apply(this,F.args));break;case"setLight":a.push(()=>this.setLight.apply(this,F.args));break;case"setGeoJSONSourceData":a.push(()=>this.setGeoJSONSourceData.apply(this,F.args));break;case"setGlyphs":a.push(()=>this.setGlyphs.apply(this,F.args));break;case"setSprite":a.push(()=>this.setSprite.apply(this,F.args));break;case"setSky":a.push(()=>this.setSky.apply(this,F.args));break;case"setTerrain":a.push(()=>this.map.setTerrain.apply(this,F.args));break;case"setTransition":a.push(()=>{});break;default:C.push(F.command)}return{operations:a,unimplemented:C}}addImage(i,a){if(this.getImage(i))return this.fire(new e.j(new Error(`An image named "${i}" already exists.`)));this.imageManager.addImage(i,a),this._afterImageUpdated(i)}updateImage(i,a){this.imageManager.updateImage(i,a)}getImage(i){return this.imageManager.getImage(i)}removeImage(i){if(!this.getImage(i))return this.fire(new e.j(new Error(`An image named "${i}" does not exist.`)));this.imageManager.removeImage(i),this._afterImageUpdated(i)}_afterImageUpdated(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(i,a,C={}){if(this._checkLoaded(),this.sourceCaches[i]!==void 0)throw new Error(`Source "${i}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(a.type)>=0&&this._validate(e.x.source,`sources.${i}`,a,null,C))return;this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);const F=this.sourceCaches[i]=new Ge(i,a,this.dispatcher);F.style=this,F.setEventedParent(this,()=>({isSourceLoaded:F.loaded(),source:F.serialize(),sourceId:i})),F.onAdd(this.map),this._changed=!0}removeSource(i){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error("There is no source with this ID");for(const C in this._layers)if(this._layers[C].source===i)return this.fire(new e.j(new Error(`Source "${i}" cannot be removed while layer "${C}" is using it.`)));const a=this.sourceCaches[i];delete this.sourceCaches[i],delete this._updatedSources[i],a.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:i})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(i,a){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error(`There is no source with this ID=${i}`);const C=this.sourceCaches[i].getSource();if(C.type!=="geojson")throw new Error(`geojsonSource.type is ${C.type}, which is !== 'geojson`);C.setData(a),this._changed=!0}getSource(i){return this.sourceCaches[i]&&this.sourceCaches[i].getSource()}addLayer(i,a,C={}){this._checkLoaded();const F=i.id;if(this.getLayer(F))return void this.fire(new e.j(new Error(`Layer "${F}" already exists on this map.`)));let q;if(i.type==="custom"){if(hr(this,e.aE(i)))return;q=e.aB(i)}else{if("source"in i&&typeof i.source=="object"&&(this.addSource(F,i.source),i=e.aC(i),i=e.e(i,{source:F})),this._validate(e.x.layer,`layers.${F}`,i,{arrayIndex:-1},C))return;q=e.aB(i),this._validateLayer(q),q.setEventedParent(this,{layer:{id:F}})}const te=a?this._order.indexOf(a):this._order.length;if(a&&te===-1)this.fire(new e.j(new Error(`Cannot add layer "${F}" before non-existing layer "${a}".`)));else{if(this._order.splice(te,0,F),this._layerOrderChanged=!0,this._layers[F]=q,this._removedLayers[F]&&q.source&&q.type!=="custom"){const ue=this._removedLayers[F];delete this._removedLayers[F],ue.type!==q.type?this._updatedSources[q.source]="clear":(this._updatedSources[q.source]="reload",this.sourceCaches[q.source].pause())}this._updateLayer(q),q.onAdd&&q.onAdd(this.map)}}moveLayer(i,a){if(this._checkLoaded(),this._changed=!0,!this._layers[i])return void this.fire(new e.j(new Error(`The layer '${i}' does not exist in the map's style and cannot be moved.`)));if(i===a)return;const C=this._order.indexOf(i);this._order.splice(C,1);const F=a?this._order.indexOf(a):this._order.length;a&&F===-1?this.fire(new e.j(new Error(`Cannot move layer "${i}" before non-existing layer "${a}".`))):(this._order.splice(F,0,i),this._layerOrderChanged=!0)}removeLayer(i){this._checkLoaded();const a=this._layers[i];if(!a)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${i}".`)));a.setEventedParent(null);const C=this._order.indexOf(i);this._order.splice(C,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=a,delete this._layers[i],this._serializedLayers&&delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],a.onRemove&&a.onRemove(this.map)}getLayer(i){return this._layers[i]}getLayersOrder(){return[...this._order]}hasLayer(i){return i in this._layers}setLayerZoomRange(i,a,C){this._checkLoaded();const F=this.getLayer(i);F?F.minzoom===a&&F.maxzoom===C||(a!=null&&(F.minzoom=a),C!=null&&(F.maxzoom=C),this._updateLayer(F)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${i}".`)))}setFilter(i,a,C={}){this._checkLoaded();const F=this.getLayer(i);if(F){if(!e.aF(F.filter,a))return a==null?(F.filter=void 0,void this._updateLayer(F)):void(this._validate(e.x.filter,`layers.${F.id}.filter`,a,null,C)||(F.filter=e.aC(a),this._updateLayer(F)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${i}".`)))}getFilter(i){return e.aC(this.getLayer(i).filter)}setLayoutProperty(i,a,C,F={}){this._checkLoaded();const q=this.getLayer(i);q?e.aF(q.getLayoutProperty(a),C)||(q.setLayoutProperty(a,C,F),this._updateLayer(q)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${i}".`)))}getLayoutProperty(i,a){const C=this.getLayer(i);if(C)return C.getLayoutProperty(a);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${i}".`)))}setPaintProperty(i,a,C,F={}){this._checkLoaded();const q=this.getLayer(i);q?e.aF(q.getPaintProperty(a),C)||(q.setPaintProperty(a,C,F)&&this._updateLayer(q),this._changed=!0,this._updatedPaintProps[i]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${i}".`)))}getPaintProperty(i,a){return this.getLayer(i).getPaintProperty(a)}setFeatureState(i,a){this._checkLoaded();const C=i.source,F=i.sourceLayer,q=this.sourceCaches[C];if(q===void 0)return void this.fire(new e.j(new Error(`The source '${C}' does not exist in the map's style.`)));const te=q.getSource().type;te==="geojson"&&F?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):te!=="vector"||F?(i.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),q.setFeatureState(F,i.id,a)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(i,a){this._checkLoaded();const C=i.source,F=this.sourceCaches[C];if(F===void 0)return void this.fire(new e.j(new Error(`The source '${C}' does not exist in the map's style.`)));const q=F.getSource().type,te=q==="vector"?i.sourceLayer:void 0;q!=="vector"||te?a&&typeof i.id!="string"&&typeof i.id!="number"?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):F.removeFeatureState(te,i.id,a):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(i){this._checkLoaded();const a=i.source,C=i.sourceLayer,F=this.sourceCaches[a];if(F!==void 0)return F.getSource().type!=="vector"||C?(i.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),F.getFeatureState(C,i.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const i=e.aG(this.sourceCaches,q=>q.serialize()),a=this._serializeByIds(this._order),C=this.map.getTerrain()||void 0,F=this.stylesheet;return e.aH({version:F.version,name:F.name,metadata:F.metadata,light:F.light,sky:F.sky,center:F.center,zoom:F.zoom,bearing:F.bearing,pitch:F.pitch,sprite:F.sprite,glyphs:F.glyphs,transition:F.transition,sources:i,layers:a,terrain:C},q=>q!==void 0)}_updateLayer(i){this._updatedLayers[i.id]=!0,i.source&&!this._updatedSources[i.source]&&this.sourceCaches[i.source].getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(i){const a=te=>this._layers[te].type==="fill-extrusion",C={},F=[];for(let te=this._order.length-1;te>=0;te--){const ue=this._order[te];if(a(ue)){C[ue]=te;for(const ve of i){const Ae=ve[ue];if(Ae)for(const Re of Ae)F.push(Re)}}}F.sort((te,ue)=>ue.intersectionZ-te.intersectionZ);const q=[];for(let te=this._order.length-1;te>=0;te--){const ue=this._order[te];if(a(ue))for(let ve=F.length-1;ve>=0;ve--){const Ae=F[ve].feature;if(C[Ae.layer.id]{const Mn=Mt.featureSortOrder;if(Mn){const Vn=Mn.indexOf(Yt.featureIndex);return Mn.indexOf(vn.featureIndex)-Vn}return vn.featureIndex-Yt.featureIndex});for(const Yt of tn)Qt.push(Yt)}}for(const Mt in dt)dt[Mt].forEach(Vt=>{const It=Vt.feature,Qt=ue[Mt],tn=Ae[Qt.source].getFeatureState(It.layer["source-layer"],It.id);It.source=It.layer.source,It.layer["source-layer"]&&(It.sourceLayer=It.layer["source-layer"]),It.state=tn});return dt}(this._layers,te,this.sourceCaches,i,a,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(q)}querySourceFeatures(i,a){a&&a.filter&&this._validate(e.x.filter,"querySourceFeatures.filter",a.filter,null,a);const C=this.sourceCaches[i];return C?function(F,q){const te=F.getRenderableIds().map(Ae=>F.getTileByID(Ae)),ue=[],ve={};for(let Ae=0;Aeit.getTileByID(ct)).sort((ct,dt)=>dt.tileID.overscaledZ-ct.tileID.overscaledZ||(ct.tileID.isLessThan(dt.tileID)?-1:1))}const Ue=this.crossTileSymbolIndex.addLayer(Re,ve[Re.source],i.center.lng);te=te||Ue}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((q=q||this._layerOrderChanged||C===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.now(),i.zoom))&&(this.pauseablePlacement=new zn(i,this.map.terrain,this._order,q,a,C,F,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,ve),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.now()),ue=!0),te&&this.pauseablePlacement.placement.setStale()),ue||te)for(const Ae of this._order){const Re=this._layers[Ae];Re.type==="symbol"&&this.placement.updateLayerOpacities(Re,ve[Re.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.now())}_releaseSymbolFadeTiles(){for(const i in this.sourceCaches)this.sourceCaches[i].releaseSymbolFadeTiles()}getImages(i,a){return e._(this,void 0,void 0,function*(){const C=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();const F=this.sourceCaches[a.source];return F&&F.setDependencies(a.tileID.key,a.type,a.icons),C})}getGlyphs(i,a){return e._(this,void 0,void 0,function*(){const C=yield this.glyphManager.getGlyphs(a.stacks),F=this.sourceCaches[a.source];return F&&F.setDependencies(a.tileID.key,a.type,[""]),C})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(i,a={}){this._checkLoaded(),i&&this._validate(e.x.glyphs,"glyphs",i,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=i,this.glyphManager.entries={},this.glyphManager.setURL(i))}addSprite(i,a,C={},F){this._checkLoaded();const q=[{id:i,url:a}],te=[...S(this.stylesheet.sprite),...q];this._validate(e.x.sprite,"sprite",te,null,C)||(this.stylesheet.sprite=te,this._loadSprite(q,!0,F))}removeSprite(i){this._checkLoaded();const a=S(this.stylesheet.sprite);if(a.find(C=>C.id===i)){if(this._spritesImagesIds[i])for(const C of this._spritesImagesIds[i])this.imageManager.removeImage(C),this._changedImages[C]=!0;a.splice(a.findIndex(C=>C.id===i),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[i],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${i}" doesn't exists on this map.`)))}getSprite(){return S(this.stylesheet.sprite)}setSprite(i,a={},C){this._checkLoaded(),i&&this._validate(e.x.sprite,"sprite",i,null,a)||(this.stylesheet.sprite=i,i?this._loadSprite(i,!0,C):(this._unloadSprite(),C&&C(null)))}}var Or=e.Y([{name:"a_pos",type:"Int16",components:2}]);const Ar={prelude:xr(`#ifdef GL_ES +/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(u))))," */")),e.styleTagTransform(y,d,e.options)})(t,L,b)},remove:function(){(function(b){if(b.parentNode===null)return!1;b.parentNode.removeChild(b)})(t)}}}},41113:function(D){D.exports=function(L,t){if(t.styleSheet)t.styleSheet.cssText=L;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(L))}}},25446:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2722%27 fill=%27%23333%27 viewBox=%270 0 22 22%27%3E%3Cpath d=%27m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0%27/%3E%3C/svg%3E"},56694:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2722%27 height=%2722%27 fill=%27%2333b5e5%27 viewBox=%270 0 22 22%27%3E%3Cpath d=%27m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0%27/%3E%3C/svg%3E"},26117:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 fill-rule=%27evenodd%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},66311:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 fill=%27%23fff%27 fill-rule=%27evenodd%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0%27/%3E%3C/svg%3E"},24420:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},77035:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},43470:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},13490:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},80216:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23333%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},47695:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%2333b5e5%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3C/svg%3E"},92228:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%2333b5e5%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},43737:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23666%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},48460:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23999%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},75796:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23aaa%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3Cpath fill=%27red%27 d=%27m14 5 1 1-9 9-1-1z%27/%3E%3C/svg%3E"},28869:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23e54e33%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3C/svg%3E"},9819:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23e58978%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},30557:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},68164:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},64665:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},91413:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z%27/%3E%3C/svg%3E"},13913:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},61907:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 fill=%27%23fff%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},56539:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 20 20%27%3E%3Cpath d=%27M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7%27/%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%272%27/%3E%3C/svg%3E"},4890:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z%27/%3E%3C/svg%3E"},13363:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5%27/%3E%3C/svg%3E"},47603:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z%27/%3E%3C/svg%3E"},64643:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z%27/%3E%3C/svg%3E"},68605:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2729%27 height=%2729%27 viewBox=%270 0 29 29%27%3E%3Cpath d=%27m10.5 14 4-8 4 8z%27/%3E%3Cpath fill=%27%23ccc%27 d=%27m10.5 16 4 8 4-8z%27/%3E%3C/svg%3E"},47914:function(D){D.exports="data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2788%27 height=%2723%27 fill=%27none%27%3E%3Cpath fill=%27%23000%27 fill-opacity=%27.4%27 fill-rule=%27evenodd%27 d=%27M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z%27/%3E%3Cpath fill=%27%23fff%27 d=%27m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z%27/%3E%3Cpath fill=%27%23e1e3e9%27 d=%27M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z%27/%3E%3Cpath d=%27M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z%27 style=%27fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001%27/%3E%3Cg style=%27stroke-width:1.12603545%27%3E%3Cpath d=%27M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668%27 style=%27color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3%27 style=%27clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3Cpath d=%27M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z%27 style=%27clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4%27 transform=%27translate%2815.553 2.85%29scale%28.88807%29%27/%3E%3C/g%3E%3C/svg%3E"},63779:function(){},77199:function(){},61990:function(D,L,t){Object.defineProperty(L,"__esModule",{value:!0});var b=t(85846),d=t(66030);function e(n){return d.geomReduce.call(void 0,n,(l,o)=>l+function(s){let c,h=0;switch(s.type){case"Polygon":return w(s.coordinates);case"MultiPolygon":for(c=0;c0){l+=Math.abs(u(n[0]));for(let o=1;o=l?(s+2)%l:s+2],m=c[0]*_,g=h[1]*_;o+=(x[0]*_-m)*Math.sin(g),s++}return o*y}var r=e;L.area=e,L.default=r},25368:function(D,L,t){Object.defineProperty(L,"__esModule",{value:!0});var b=t(66030);function d(w,y={}){if(w.bbox!=null&&y.recompute!==!0)return w.bbox;const _=[1/0,1/0,-1/0,-1/0];return b.coordEach.call(void 0,w,u=>{_[0]>u[0]&&(_[0]=u[0]),_[1]>u[1]&&(_[1]=u[1]),_[2]0?x>180?x-360:x:x<-180?x+360:x},L.bearingToAzimuth=function(x){let m=x%360;return m<0&&(m+=360),m},L.convertArea=function(x,m="meters",g="kilometers"){if(!(x>=0))throw new Error("area must be a positive number");const k=d[m];if(!k)throw new Error("invalid original units");const A=d[g];if(!A)throw new Error("invalid final units");return x/k*A},L.convertLength=function(x,m="kilometers",g="kilometers"){if(!(x>=0))throw new Error("length must be a positive number");return o(s(x,m),g)},L.degreesToRadians=function(x){return x%360*Math.PI/180},L.earthRadius=t,L.factors=b,L.feature=e,L.featureCollection=u,L.geometry=function(x,m,g={}){switch(x){case"Point":return w(m).geometry;case"LineString":return _(m).geometry;case"Polygon":return y(m).geometry;case"MultiPoint":return n(m).geometry;case"MultiLineString":return r(m).geometry;case"MultiPolygon":return l(m).geometry;default:throw new Error(x+" is invalid")}},L.geometryCollection=function(x,m,g={}){return e({type:"GeometryCollection",geometries:x},m,g)},L.isNumber=h,L.isObject=function(x){return x!==null&&typeof x=="object"&&!Array.isArray(x)},L.lengthToDegrees=function(x,m){return c(s(x,m))},L.lengthToRadians=s,L.lineString=_,L.lineStrings=function(x,m,g={}){return u(x.map(k=>_(k,m)),g)},L.multiLineString=r,L.multiPoint=n,L.multiPolygon=l,L.point=w,L.points=function(x,m,g={}){return u(x.map(k=>w(k,m)),g)},L.polygon=y,L.polygons=function(x,m,g={}){return u(x.map(k=>y(k,m)),g)},L.radiansToDegrees=c,L.radiansToLength=o,L.round=function(x,m=0){if(m&&!(m>=0))throw new Error("precision must be a positive number");const g=Math.pow(10,m||0);return Math.round(x*g)/g},L.validateBBox=function(x){if(!x)throw new Error("bbox is required");if(!Array.isArray(x))throw new Error("bbox must be an Array");if(x.length!==4&&x.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");x.forEach(m=>{if(!h(m))throw new Error("bbox must only contain numbers")})},L.validateId=function(x){if(!x)throw new Error("id is required");if(["string","number"].indexOf(typeof x)===-1)throw new Error("id must be a number or a string")}},66030:function(D,L,t){Object.defineProperty(L,"__esModule",{value:!0});var b=t(85846);function d(n,l,o){if(n!==null)for(var s,c,h,x,m,g,k,A,v=0,S=0,T=n.type,p=T==="FeatureCollection",M=T==="Feature",f=p?n.features.length:1,E=0;Eg||p>k||M>A)return m=v,g=s,k=p,A=M,void(h=0);var f=b.lineString.call(void 0,[m,v],o.properties);if(l(f,s,c,M,h)===!1)return!1;h++,m=v})!==!1&&void 0}}})}function r(n,l){if(!n)throw new Error("geojson is required");_(n,function(o,s,c){if(o.geometry!==null){var h=o.geometry.type,x=o.geometry.coordinates;switch(h){case"LineString":if(l(o,s,c,0,0)===!1)return!1;break;case"Polygon":for(var m=0;m"u"?t.g:globalThis;D.exports=function(){for(var e=[],w=0;w1)return 1;for(var ne=Y,pe=0;pe<8;pe++){var ze=this.sampleCurveX(ne)-Y;if(Math.abs(ze)ze?Je=ne:ht=ne,ne=.5*(ht-Je)+Je;return ne},solve:function(Y,U){return this.sampleCurveY(this.solveCurveX(Y,U))}};var l=w(r);let o,s;function c(){return o==null&&(o=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),o}function h(){if(s==null&&(s=!1,c())){const U=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(U){for(let pe=0;pe<25;pe++){const ze=4*pe;U.fillStyle=`rgb(${ze},${ze+1},${ze+2})`,U.fillRect(pe%5,Math.floor(pe/5),1,1)}const ne=U.getImageData(0,0,5,5).data;for(let pe=0;pe<100;pe++)if(pe%4!=3&&ne[pe]!==pe){s=!0;break}}}return s||!1}function x(Y,U,ne,pe){const ze=new l(Y,U,ne,pe);return Ze=>ze.solve(Ze)}const m=x(.25,.1,.25,1);function g(Y,U,ne){return Math.min(ne,Math.max(U,Y))}function k(Y,U,ne){const pe=ne-U,ze=((Y-U)%pe+pe)%pe+U;return ze===U?ne:ze}function A(Y,...U){for(const ne of U)for(const pe in ne)Y[pe]=ne[pe];return Y}let v=1;function S(Y,U,ne){const pe={};for(const ze in Y)pe[ze]=U.call(this,Y[ze],ze,Y);return pe}function T(Y,U,ne){const pe={};for(const ze in Y)U.call(this,Y[ze],ze,Y)&&(pe[ze]=Y[ze]);return pe}function p(Y){return Array.isArray(Y)?Y.map(p):typeof Y=="object"&&Y?S(Y,p):Y}const M={};function f(Y){M[Y]||(typeof console<"u"&&console.warn(Y),M[Y]=!0)}function E(Y,U,ne){return(ne.y-Y.y)*(U.x-Y.x)>(U.y-Y.y)*(ne.x-Y.x)}function I(Y){return typeof WorkerGlobalScope<"u"&&Y!==void 0&&Y instanceof WorkerGlobalScope}let B=null;function N(Y){return typeof ImageBitmap<"u"&&Y instanceof ImageBitmap}const V="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function j(Y,U,ne,pe,ze){return e(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Ze=new VideoFrame(Y,{timestamp:0});try{const Je=Ze==null?void 0:Ze.format;if(!Je||!Je.startsWith("BGR")&&!Je.startsWith("RGB"))throw new Error(`Unrecognized format ${Je}`);const ht=Je.startsWith("BGR"),mt=new Uint8ClampedArray(pe*ze*4);if(yield Ze.copyTo(mt,function(zt,Nt,Xt,rn,hn){const Sn=4*Math.max(-Nt,0),xn=(Math.max(0,Xt)-Xt)*rn*4+Sn,Nn=4*rn,Gn=Math.max(0,Nt),wr=Math.max(0,Xt);return{rect:{x:Gn,y:wr,width:Math.min(zt.width,Nt+rn)-Gn,height:Math.min(zt.height,Xt+hn)-wr},layout:[{offset:xn,stride:Nn}]}}(Y,U,ne,pe,ze)),ht)for(let zt=0;ztI(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,he=function(Y,U){if(/:\/\//.test(Y.url)&&!/^https?:|^file:/.test(Y.url)){const pe=Z(Y.url);if(pe)return pe(Y,U);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,targetMapId:K},U)}if(ne=Y.url,!(/^file:/.test(ne)||/^file:/.test(se())&&!/^\w+:/.test(ne))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(pe,ze){return e(this,void 0,void 0,function*(){const Ze=new Request(pe.url,{method:pe.method||"GET",body:pe.body,credentials:pe.credentials,headers:pe.headers,cache:pe.cache,referrer:se(),signal:ze.signal});pe.type!=="json"||Ze.headers.has("Accept")||Ze.headers.set("Accept","application/json");const Je=yield fetch(Ze);if(!Je.ok){const zt=yield Je.blob();throw new ae(Je.status,Je.statusText,pe.url,zt)}let ht;ht=pe.type==="arrayBuffer"||pe.type==="image"?Je.arrayBuffer():pe.type==="json"?Je.json():Je.text();const mt=yield ht;if(ze.signal.aborted)throw J();return{data:mt,cacheControl:Je.headers.get("Cache-Control"),expires:Je.headers.get("Expires")}})}(Y,U);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:Y,mustQueue:!0,targetMapId:K},U)}var ne;return function(pe,ze){return new Promise((Ze,Je)=>{var ht;const mt=new XMLHttpRequest;mt.open(pe.method||"GET",pe.url,!0),pe.type!=="arrayBuffer"&&pe.type!=="image"||(mt.responseType="arraybuffer");for(const zt in pe.headers)mt.setRequestHeader(zt,pe.headers[zt]);pe.type==="json"&&(mt.responseType="text",!((ht=pe.headers)===null||ht===void 0)&&ht.Accept||mt.setRequestHeader("Accept","application/json")),mt.withCredentials=pe.credentials==="include",mt.onerror=()=>{Je(new Error(mt.statusText))},mt.onload=()=>{if(!ze.signal.aborted)if((mt.status>=200&&mt.status<300||mt.status===0)&&mt.response!==null){let zt=mt.response;if(pe.type==="json")try{zt=JSON.parse(mt.response)}catch(Nt){return void Je(Nt)}Ze({data:zt,cacheControl:mt.getResponseHeader("Cache-Control"),expires:mt.getResponseHeader("Expires")})}else{const zt=new Blob([mt.response],{type:mt.getResponseHeader("Content-Type")});Je(new ae(mt.status,mt.statusText,pe.url,zt))}},ze.signal.addEventListener("abort",()=>{mt.abort(),Je(J())}),mt.send(pe.body)})}(Y,U)};function fe(Y){if(!Y||Y.indexOf("://")<=0||Y.indexOf("data:image/")===0||Y.indexOf("blob:")===0)return!0;const U=new URL(Y),ne=window.location;return U.protocol===ne.protocol&&U.host===ne.host}function ie(Y,U,ne){ne[Y]&&ne[Y].indexOf(U)!==-1||(ne[Y]=ne[Y]||[],ne[Y].push(U))}function oe(Y,U,ne){if(ne&&ne[Y]){const pe=ne[Y].indexOf(U);pe!==-1&&ne[Y].splice(pe,1)}}class le{constructor(U,ne={}){A(this,ne),this.type=U}}class ge extends le{constructor(U,ne={}){super("error",A({error:U},ne))}}class ye{on(U,ne){return this._listeners=this._listeners||{},ie(U,ne,this._listeners),this}off(U,ne){return oe(U,ne,this._listeners),oe(U,ne,this._oneTimeListeners),this}once(U,ne){return ne?(this._oneTimeListeners=this._oneTimeListeners||{},ie(U,ne,this._oneTimeListeners),this):new Promise(pe=>this.once(U,pe))}fire(U,ne){typeof U=="string"&&(U=new le(U,ne||{}));const pe=U.type;if(this.listens(pe)){U.target=this;const ze=this._listeners&&this._listeners[pe]?this._listeners[pe].slice():[];for(const ht of ze)ht.call(this,U);const Ze=this._oneTimeListeners&&this._oneTimeListeners[pe]?this._oneTimeListeners[pe].slice():[];for(const ht of Ze)oe(pe,ht,this._oneTimeListeners),ht.call(this,U);const Je=this._eventedParent;Je&&(A(U,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Je.fire(U))}else U instanceof ge&&console.error(U.error);return this}listens(U){return this._listeners&&this._listeners[U]&&this._listeners[U].length>0||this._oneTimeListeners&&this._oneTimeListeners[U]&&this._oneTimeListeners[U].length>0||this._eventedParent&&this._eventedParent.listens(U)}setEventedParent(U,ne){return this._eventedParent=U,this._eventedParentData=ne,this}}var me={$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 be=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Se(Y,U){const ne={};for(const pe in Y)pe!=="ref"&&(ne[pe]=Y[pe]);return be.forEach(pe=>{pe in U&&(ne[pe]=U[pe])}),ne}function Ee(Y,U){if(Array.isArray(Y)){if(!Array.isArray(U)||Y.length!==U.length)return!1;for(let ne=0;ne`:Y.itemType.kind==="value"?"array":`array<${U}>`}return Y.kind}const Gt=[qe,$e,Ye,_e,De,nt,Be,Vt(Ge),ft,At,kt];function st(Y,U){if(U.kind==="error")return null;if(Y.kind==="array"){if(U.kind==="array"&&(U.N===0&&U.itemType.kind==="value"||!st(Y.itemType,U.itemType))&&(typeof Y.N!="number"||Y.N===U.N))return null}else{if(Y.kind===U.kind)return null;if(Y.kind==="value"){for(const ne of Gt)if(!st(ne,U))return null}}return`Expected ${Ht(Y)} but found ${Ht(U)} instead.`}function Qe(Y,U){return U.some(ne=>ne.kind===Y.kind)}function pt(Y,U){return U.some(ne=>ne==="null"?Y===null:ne==="array"?Array.isArray(Y):ne==="object"?Y&&!Array.isArray(Y)&&typeof Y=="object":ne===typeof Y)}function yt(Y,U){return Y.kind==="array"&&U.kind==="array"?Y.itemType.kind===U.itemType.kind&&typeof Y.N=="number":Y.kind===U.kind}const Ot=.96422,Pt=1,at=.82521,lt=4/29,Xe=6/29,ut=3*Xe*Xe,wt=Xe*Xe*Xe,vt=Math.PI/180,Lt=180/Math.PI;function jt(Y){return(Y%=360)<0&&(Y+=360),Y}function rt([Y,U,ne,pe]){let ze,Ze;const Je=Et((.2225045*(Y=et(Y))+.7168786*(U=et(U))+.0606169*(ne=et(ne)))/Pt);Y===U&&U===ne?ze=Ze=Je:(ze=Et((.4360747*Y+.3850649*U+.1430804*ne)/Ot),Ze=Et((.0139322*Y+.0971045*U+.7141733*ne)/at));const ht=116*Je-16;return[ht<0?0:ht,500*(ze-Je),200*(Je-Ze),pe]}function et(Y){return Y<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function Et(Y){return Y>wt?Math.pow(Y,.3333333333333333):Y/ut+lt}function Bt([Y,U,ne,pe]){let ze=(Y+16)/116,Ze=isNaN(U)?ze:ze+U/500,Je=isNaN(ne)?ze:ze-ne/200;return ze=Pt*St(ze),Ze=Ot*St(Ze),Je=at*St(Je),[Ft(3.1338561*Ze-1.6168667*ze-.4906146*Je),Ft(-.9787684*Ze+1.9161415*ze+.033454*Je),Ft(.0719453*Ze-.2289914*ze+1.4052427*Je),pe]}function Ft(Y){return(Y=Y<=.00304?12.92*Y:1.055*Math.pow(Y,.4166666666666667)-.055)<0?0:Y>1?1:Y}function St(Y){return Y>Xe?Y*Y*Y:ut*(Y-lt)}function Jt(Y){if((Y=Y.toLowerCase().trim())==="transparent")return[0,0,0,0];const U=on[Y];if(U){const[pe,ze,Ze]=U;return[pe/255,ze/255,Ze/255,1]}if(Y.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(Y)){const pe=Y.length<6?1:2;let ze=1;return[qt(Y.slice(ze,ze+=pe)),qt(Y.slice(ze,ze+=pe)),qt(Y.slice(ze,ze+=pe)),qt(Y.slice(ze,ze+pe)||"ff")]}if(Y.startsWith("rgb")){const pe=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,ze=Y.match(pe);if(ze){const[Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn]=ze,Gn=[mt||" ",Xt||" ",Sn].join("");if(Gn===" "||Gn===" /"||Gn===",,"||Gn===",,,"){const wr=[ht,Nt,hn].join(""),or=wr==="%%%"?100:wr===""?255:0;if(or){const gr=[Wt(+Je/or,0,1),Wt(+zt/or,0,1),Wt(+rn/or,0,1),xn?en(+xn,Nn):1];if(Zt(gr))return gr}}return}}const ne=Y.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(ne){const[pe,ze,Ze,Je,ht,mt,zt,Nt,Xt]=ne,rn=[Ze||" ",ht||" ",zt].join("");if(rn===" "||rn===" /"||rn===",,"||rn===",,,"){const hn=[+ze,Wt(+Je,0,100),Wt(+mt,0,100),Nt?en(+Nt,Xt):1];if(Zt(hn))return function([Sn,xn,Nn,Gn]){function wr(or){const gr=(or+Sn/30)%12,Wr=xn*Math.min(Nn,1-Nn);return Nn-Wr*Math.max(-1,Math.min(gr-3,9-gr,1))}return Sn=jt(Sn),xn/=100,Nn/=100,[wr(0),wr(8),wr(4),Gn]}(hn)}}}function qt(Y){return parseInt(Y.padEnd(2,Y),16)/255}function en(Y,U){return Wt(U?Y/100:Y,0,1)}function Wt(Y,U,ne){return Math.min(Math.max(U,Y),ne)}function Zt(Y){return!Y.some(Number.isNaN)}const on={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 un{constructor(U,ne,pe,ze=1,Ze=!0){this.r=U,this.g=ne,this.b=pe,this.a=ze,Ze||(this.r*=ze,this.g*=ze,this.b*=ze,ze||this.overwriteGetter("rgb",[U,ne,pe,ze]))}static parse(U){if(U instanceof un)return U;if(typeof U!="string")return;const ne=Jt(U);return ne?new un(...ne,!1):void 0}get rgb(){const{r:U,g:ne,b:pe,a:ze}=this,Ze=ze||1/0;return this.overwriteGetter("rgb",[U/Ze,ne/Ze,pe/Ze,ze])}get hcl(){return this.overwriteGetter("hcl",function(U){const[ne,pe,ze,Ze]=rt(U),Je=Math.sqrt(pe*pe+ze*ze);return[Math.round(1e4*Je)?jt(Math.atan2(ze,pe)*Lt):NaN,Je,ne,Ze]}(this.rgb))}get lab(){return this.overwriteGetter("lab",rt(this.rgb))}overwriteGetter(U,ne){return Object.defineProperty(this,U,{value:ne}),ne}toString(){const[U,ne,pe,ze]=this.rgb;return`rgba(${[U,ne,pe].map(Ze=>Math.round(255*Ze)).join(",")},${ze})`}}un.black=new un(0,0,0,1),un.white=new un(1,1,1,1),un.transparent=new un(0,0,0,0),un.red=new un(1,0,0,1);class Pn{constructor(U,ne,pe){this.sensitivity=U?ne?"variant":"case":ne?"accent":"base",this.locale=pe,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(U,ne){return this.collator.compare(U,ne)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Dn{constructor(U,ne,pe,ze,Ze){this.text=U,this.image=ne,this.scale=pe,this.fontStack=ze,this.textColor=Ze}}class In{constructor(U){this.sections=U}static fromString(U){return new In([new Dn(U,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(U=>U.text.length!==0||U.image&&U.image.name.length!==0)}static factory(U){return U instanceof In?U:In.fromString(U)}toString(){return this.sections.length===0?"":this.sections.map(U=>U.text).join("")}}class mn{constructor(U){this.values=U.slice()}static parse(U){if(U instanceof mn)return U;if(typeof U=="number")return new mn([U,U,U,U]);if(Array.isArray(U)&&!(U.length<1||U.length>4)){for(const ne of U)if(typeof ne!="number")return;switch(U.length){case 1:U=[U[0],U[0],U[0],U[0]];break;case 2:U=[U[0],U[1],U[0],U[1]];break;case 3:U=[U[0],U[1],U[2],U[1]]}return new mn(U)}}toString(){return JSON.stringify(this.values)}}const En=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Kn{constructor(U){this.values=U.slice()}static parse(U){if(U instanceof Kn)return U;if(Array.isArray(U)&&!(U.length<1)&&U.length%2==0){for(let ne=0;ne=0&&Y<=255&&typeof U=="number"&&U>=0&&U<=255&&typeof ne=="number"&&ne>=0&&ne<=255?pe===void 0||typeof pe=="number"&&pe>=0&&pe<=1?null:`Invalid rgba value [${[Y,U,ne,pe].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof pe=="number"?[Y,U,ne,pe]:[Y,U,ne]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Fn(Y){if(Y===null||typeof Y=="string"||typeof Y=="boolean"||typeof Y=="number"||Y instanceof un||Y instanceof Pn||Y instanceof In||Y instanceof mn||Y instanceof Kn||Y instanceof Ln)return!0;if(Array.isArray(Y)){for(const U of Y)if(!Fn(U))return!1;return!0}if(typeof Y=="object"){for(const U in Y)if(!Fn(Y[U]))return!1;return!0}return!1}function wn(Y){if(Y===null)return qe;if(typeof Y=="string")return Ye;if(typeof Y=="boolean")return _e;if(typeof Y=="number")return $e;if(Y instanceof un)return De;if(Y instanceof Pn)return tt;if(Y instanceof In)return nt;if(Y instanceof mn)return ft;if(Y instanceof Kn)return kt;if(Y instanceof Ln)return At;if(Array.isArray(Y)){const U=Y.length;let ne;for(const pe of Y){const ze=wn(pe);if(ne){if(ne===ze)continue;ne=Ge;break}ne=ze}return Vt(ne||Ge,U)}return Be}function zn(Y){const U=typeof Y;return Y===null?"":U==="string"||U==="number"||U==="boolean"?String(Y):Y instanceof un||Y instanceof In||Y instanceof mn||Y instanceof Kn||Y instanceof Ln?Y.toString():JSON.stringify(Y)}class Jn{constructor(U,ne){this.type=U,this.value=ne}static parse(U,ne){if(U.length!==2)return ne.error(`'literal' expression requires exactly one argument, but found ${U.length-1} instead.`);if(!Fn(U[1]))return ne.error("invalid value");const pe=U[1];let ze=wn(pe);const Ze=ne.expectedType;return ze.kind!=="array"||ze.N!==0||!Ze||Ze.kind!=="array"||typeof Ze.N=="number"&&Ze.N!==0||(ze=Ze),new Jn(ze,pe)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class $n{constructor(U){this.name="ExpressionEvaluationError",this.message=U}toJSON(){return this.message}}const vr={string:Ye,number:$e,boolean:_e,object:Be};class Qn{constructor(U,ne){this.type=U,this.args=ne}static parse(U,ne){if(U.length<2)return ne.error("Expected at least one argument.");let pe,ze=1;const Ze=U[0];if(Ze==="array"){let ht,mt;if(U.length>2){const zt=U[1];if(typeof zt!="string"||!(zt in vr)||zt==="object")return ne.error('The item type argument of "array" must be one of string, number, boolean',1);ht=vr[zt],ze++}else ht=Ge;if(U.length>3){if(U[2]!==null&&(typeof U[2]!="number"||U[2]<0||U[2]!==Math.floor(U[2])))return ne.error('The length argument to "array" must be a positive integer literal',2);mt=U[2],ze++}pe=Vt(ht,mt)}else{if(!vr[Ze])throw new Error(`Types doesn't contain name = ${Ze}`);pe=vr[Ze]}const Je=[];for(;zeU.outputDefined())}}const lr={"to-boolean":_e,"to-color":De,"to-number":$e,"to-string":Ye};class hr{constructor(U,ne){this.type=U,this.args=ne}static parse(U,ne){if(U.length<2)return ne.error("Expected at least one argument.");const pe=U[0];if(!lr[pe])throw new Error(`Can't parse ${pe} as it is not part of the known types`);if((pe==="to-boolean"||pe==="to-string")&&U.length!==2)return ne.error("Expected one argument.");const ze=lr[pe],Ze=[];for(let Je=1;Je4?`Invalid rbga value ${JSON.stringify(ne)}: expected an array containing either three or four numeric values.`:Tn(ne[0],ne[1],ne[2],ne[3]),!pe))return new un(ne[0]/255,ne[1]/255,ne[2]/255,ne[3])}throw new $n(pe||`Could not parse color from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"padding":{let ne;for(const pe of this.args){ne=pe.evaluate(U);const ze=mn.parse(ne);if(ze)return ze}throw new $n(`Could not parse padding from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"variableAnchorOffsetCollection":{let ne;for(const pe of this.args){ne=pe.evaluate(U);const ze=Kn.parse(ne);if(ze)return ze}throw new $n(`Could not parse variableAnchorOffsetCollection from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"number":{let ne=null;for(const pe of this.args){if(ne=pe.evaluate(U),ne===null)return 0;const ze=Number(ne);if(!isNaN(ze))return ze}throw new $n(`Could not convert ${JSON.stringify(ne)} to number.`)}case"formatted":return In.fromString(zn(this.args[0].evaluate(U)));case"resolvedImage":return Ln.fromString(zn(this.args[0].evaluate(U)));default:return zn(this.args[0].evaluate(U))}}eachChild(U){this.args.forEach(U)}outputDefined(){return this.args.every(U=>U.outputDefined())}}const jr=["Unknown","Point","LineString","Polygon"];class ni{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?jr[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(U){let ne=this._parseColorCache[U];return ne||(ne=this._parseColorCache[U]=un.parse(U)),ne}}class Or{constructor(U,ne,pe=[],ze,Ze=new Fe,Je=[]){this.registry=U,this.path=pe,this.key=pe.map(ht=>`[${ht}]`).join(""),this.scope=Ze,this.errors=Je,this.expectedType=ze,this._isConstant=ne}parse(U,ne,pe,ze,Ze={}){return ne?this.concat(ne,pe,ze)._parse(U,Ze):this._parse(U,Ze)}_parse(U,ne){function pe(ze,Ze,Je){return Je==="assert"?new Qn(Ze,[ze]):Je==="coerce"?new hr(Ze,[ze]):ze}if(U!==null&&typeof U!="string"&&typeof U!="boolean"&&typeof U!="number"||(U=["literal",U]),Array.isArray(U)){if(U.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const ze=U[0];if(typeof ze!="string")return this.error(`Expression name must be a string, but found ${typeof ze} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Ze=this.registry[ze];if(Ze){let Je=Ze.parse(U,this);if(!Je)return null;if(this.expectedType){const ht=this.expectedType,mt=Je.type;if(ht.kind!=="string"&&ht.kind!=="number"&&ht.kind!=="boolean"&&ht.kind!=="object"&&ht.kind!=="array"||mt.kind!=="value")if(ht.kind!=="color"&&ht.kind!=="formatted"&&ht.kind!=="resolvedImage"||mt.kind!=="value"&&mt.kind!=="string")if(ht.kind!=="padding"||mt.kind!=="value"&&mt.kind!=="number"&&mt.kind!=="array")if(ht.kind!=="variableAnchorOffsetCollection"||mt.kind!=="value"&&mt.kind!=="array"){if(this.checkSubtype(ht,mt))return null}else Je=pe(Je,ht,ne.typeAnnotation||"coerce");else Je=pe(Je,ht,ne.typeAnnotation||"coerce");else Je=pe(Je,ht,ne.typeAnnotation||"coerce");else Je=pe(Je,ht,ne.typeAnnotation||"assert")}if(!(Je instanceof Jn)&&Je.type.kind!=="resolvedImage"&&this._isConstant(Je)){const ht=new ni;try{Je=new Jn(Je.type,Je.evaluate(ht))}catch(mt){return this.error(mt.message),null}}return Je}return this.error(`Unknown expression "${ze}". If you wanted a literal array, use ["literal", [...]].`,0)}return U===void 0?this.error("'undefined' value invalid. Use null instead."):typeof U=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof U} instead.`)}concat(U,ne,pe){const ze=typeof U=="number"?this.path.concat(U):this.path,Ze=pe?this.scope.concat(pe):this.scope;return new Or(this.registry,this._isConstant,ze,ne||null,Ze,this.errors)}error(U,...ne){const pe=`${this.key}${ne.map(ze=>`[${ze}]`).join("")}`;this.errors.push(new He(pe,U))}checkSubtype(U,ne){const pe=st(U,ne);return pe&&this.error(pe),pe}}class Ar{constructor(U,ne){this.type=ne.type,this.bindings=[].concat(U),this.result=ne}evaluate(U){return this.result.evaluate(U)}eachChild(U){for(const ne of this.bindings)U(ne[1]);U(this.result)}static parse(U,ne){if(U.length<4)return ne.error(`Expected at least 3 arguments, but found ${U.length-1} instead.`);const pe=[];for(let Ze=1;Ze=pe.length)throw new $n(`Array index out of bounds: ${ne} > ${pe.length-1}.`);if(ne!==Math.floor(ne))throw new $n(`Array index must be an integer, but found ${ne} instead.`);return pe[ne]}eachChild(U){U(this.index),U(this.input)}outputDefined(){return!1}}class kn{constructor(U,ne){this.type=_e,this.needle=U,this.haystack=ne}static parse(U,ne){if(U.length!==3)return ne.error(`Expected 2 arguments, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1,Ge),ze=ne.parse(U[2],2,Ge);return pe&&ze?Qe(pe.type,[_e,Ye,$e,qe,Ge])?new kn(pe,ze):ne.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(pe.type)} instead`):null}evaluate(U){const ne=this.needle.evaluate(U),pe=this.haystack.evaluate(U);if(!pe)return!1;if(!pt(ne,["boolean","string","number","null"]))throw new $n(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(wn(ne))} instead.`);if(!pt(pe,["string","array"]))throw new $n(`Expected second argument to be of type array or string, but found ${Ht(wn(pe))} instead.`);return pe.indexOf(ne)>=0}eachChild(U){U(this.needle),U(this.haystack)}outputDefined(){return!0}}class Cn{constructor(U,ne,pe){this.type=$e,this.needle=U,this.haystack=ne,this.fromIndex=pe}static parse(U,ne){if(U.length<=2||U.length>=5)return ne.error(`Expected 3 or 4 arguments, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1,Ge),ze=ne.parse(U[2],2,Ge);if(!pe||!ze)return null;if(!Qe(pe.type,[_e,Ye,$e,qe,Ge]))return ne.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(pe.type)} instead`);if(U.length===4){const Ze=ne.parse(U[3],3,$e);return Ze?new Cn(pe,ze,Ze):null}return new Cn(pe,ze)}evaluate(U){const ne=this.needle.evaluate(U),pe=this.haystack.evaluate(U);if(!pt(ne,["boolean","string","number","null"]))throw new $n(`Expected first argument to be of type boolean, string, number or null, but found ${Ht(wn(ne))} instead.`);if(!pt(pe,["string","array"]))throw new $n(`Expected second argument to be of type array or string, but found ${Ht(wn(pe))} instead.`);if(this.fromIndex){const ze=this.fromIndex.evaluate(U);return pe.indexOf(ne,ze)}return pe.indexOf(ne)}eachChild(U){U(this.needle),U(this.haystack),this.fromIndex&&U(this.fromIndex)}outputDefined(){return!1}}class ur{constructor(U,ne,pe,ze,Ze,Je){this.inputType=U,this.type=ne,this.input=pe,this.cases=ze,this.outputs=Ze,this.otherwise=Je}static parse(U,ne){if(U.length<5)return ne.error(`Expected at least 4 arguments, but found only ${U.length-1}.`);if(U.length%2!=1)return ne.error("Expected an even number of arguments.");let pe,ze;ne.expectedType&&ne.expectedType.kind!=="value"&&(ze=ne.expectedType);const Ze={},Je=[];for(let zt=2;ztNumber.MAX_SAFE_INTEGER)return rn.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Sn=="number"&&Math.floor(Sn)!==Sn)return rn.error("Numeric branch labels must be integer values.");if(pe){if(rn.checkSubtype(pe,wn(Sn)))return null}else pe=wn(Sn);if(Ze[String(Sn)]!==void 0)return rn.error("Branch labels must be unique.");Ze[String(Sn)]=Je.length}const hn=ne.parse(Xt,zt,ze);if(!hn)return null;ze=ze||hn.type,Je.push(hn)}const ht=ne.parse(U[1],1,Ge);if(!ht)return null;const mt=ne.parse(U[U.length-1],U.length-1,ze);return mt?ht.type.kind!=="value"&&ne.concat(1).checkSubtype(pe,ht.type)?null:new ur(pe,ze,ht,Ze,Je,mt):null}evaluate(U){const ne=this.input.evaluate(U);return(wn(ne)===this.inputType&&this.outputs[this.cases[ne]]||this.otherwise).evaluate(U)}eachChild(U){U(this.input),this.outputs.forEach(U),U(this.otherwise)}outputDefined(){return this.outputs.every(U=>U.outputDefined())&&this.otherwise.outputDefined()}}class Zn{constructor(U,ne,pe){this.type=U,this.branches=ne,this.otherwise=pe}static parse(U,ne){if(U.length<4)return ne.error(`Expected at least 3 arguments, but found only ${U.length-1}.`);if(U.length%2!=0)return ne.error("Expected an odd number of arguments.");let pe;ne.expectedType&&ne.expectedType.kind!=="value"&&(pe=ne.expectedType);const ze=[];for(let Je=1;Jene.outputDefined())&&this.otherwise.outputDefined()}}class cr{constructor(U,ne,pe,ze){this.type=U,this.input=ne,this.beginIndex=pe,this.endIndex=ze}static parse(U,ne){if(U.length<=2||U.length>=5)return ne.error(`Expected 3 or 4 arguments, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1,Ge),ze=ne.parse(U[2],2,$e);if(!pe||!ze)return null;if(!Qe(pe.type,[Vt(Ge),Ye,Ge]))return ne.error(`Expected first argument to be of type array or string, but found ${Ht(pe.type)} instead`);if(U.length===4){const Ze=ne.parse(U[3],3,$e);return Ze?new cr(pe.type,pe,ze,Ze):null}return new cr(pe.type,pe,ze)}evaluate(U){const ne=this.input.evaluate(U),pe=this.beginIndex.evaluate(U);if(!pt(ne,["string","array"]))throw new $n(`Expected first argument to be of type array or string, but found ${Ht(wn(ne))} instead.`);if(this.endIndex){const ze=this.endIndex.evaluate(U);return ne.slice(pe,ze)}return ne.slice(pe)}eachChild(U){U(this.input),U(this.beginIndex),this.endIndex&&U(this.endIndex)}outputDefined(){return!1}}function Ir(Y,U){const ne=Y.length-1;let pe,ze,Ze=0,Je=ne,ht=0;for(;Ze<=Je;)if(ht=Math.floor((Ze+Je)/2),pe=Y[ht],ze=Y[ht+1],pe<=U){if(ht===ne||UU))throw new $n("Input is not a number.");Je=ht-1}return 0}class Er{constructor(U,ne,pe){this.type=U,this.input=ne,this.labels=[],this.outputs=[];for(const[ze,Ze]of pe)this.labels.push(ze),this.outputs.push(Ze)}static parse(U,ne){if(U.length-1<4)return ne.error(`Expected at least 4 arguments, but found only ${U.length-1}.`);if((U.length-1)%2!=0)return ne.error("Expected an even number of arguments.");const pe=ne.parse(U[1],1,$e);if(!pe)return null;const ze=[];let Ze=null;ne.expectedType&&ne.expectedType.kind!=="value"&&(Ze=ne.expectedType);for(let Je=1;Je=ht)return ne.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',zt);const Xt=ne.parse(mt,Nt,Ze);if(!Xt)return null;Ze=Ze||Xt.type,ze.push([ht,Xt])}return new Er(Ze,pe,ze)}evaluate(U){const ne=this.labels,pe=this.outputs;if(ne.length===1)return pe[0].evaluate(U);const ze=this.input.evaluate(U);if(ze<=ne[0])return pe[0].evaluate(U);const Ze=ne.length;return ze>=ne[Ze-1]?pe[Ze-1].evaluate(U):pe[Ir(ne,ze)].evaluate(U)}eachChild(U){U(this.input);for(const ne of this.outputs)U(ne)}outputDefined(){return this.outputs.every(U=>U.outputDefined())}}function Xr(Y){return Y&&Y.__esModule&&Object.prototype.hasOwnProperty.call(Y,"default")?Y.default:Y}var ai=bn;function bn(Y,U,ne,pe){this.cx=3*Y,this.bx=3*(ne-Y)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*U,this.by=3*(pe-U)-this.cy,this.ay=1-this.cy-this.by,this.p1x=Y,this.p1y=U,this.p2x=ne,this.p2y=pe}bn.prototype={sampleCurveX:function(Y){return((this.ax*Y+this.bx)*Y+this.cx)*Y},sampleCurveY:function(Y){return((this.ay*Y+this.by)*Y+this.cy)*Y},sampleCurveDerivativeX:function(Y){return(3*this.ax*Y+2*this.bx)*Y+this.cx},solveCurveX:function(Y,U){if(U===void 0&&(U=1e-6),Y<0)return 0;if(Y>1)return 1;for(var ne=Y,pe=0;pe<8;pe++){var ze=this.sampleCurveX(ne)-Y;if(Math.abs(ze)ze?Je=ne:ht=ne,ne=.5*(ht-Je)+Je;return ne},solve:function(Y,U){return this.sampleCurveY(this.solveCurveX(Y,U))}};var Yn=Xr(ai);function an(Y,U,ne){return Y+ne*(U-Y)}function _n(Y,U,ne){return Y.map((pe,ze)=>an(pe,U[ze],ne))}const gn={number:an,color:function(Y,U,ne,pe="rgb"){switch(pe){case"rgb":{const[ze,Ze,Je,ht]=_n(Y.rgb,U.rgb,ne);return new un(ze,Ze,Je,ht,!1)}case"hcl":{const[ze,Ze,Je,ht]=Y.hcl,[mt,zt,Nt,Xt]=U.hcl;let rn,hn;if(isNaN(ze)||isNaN(mt))isNaN(ze)?isNaN(mt)?rn=NaN:(rn=mt,Je!==1&&Je!==0||(hn=zt)):(rn=ze,Nt!==1&&Nt!==0||(hn=Ze));else{let wr=mt-ze;mt>ze&&wr>180?wr-=360:mt180&&(wr+=360),rn=ze+ne*wr}const[Sn,xn,Nn,Gn]=function([wr,or,gr,Wr]){return wr=isNaN(wr)?0:wr*vt,Bt([gr,Math.cos(wr)*or,Math.sin(wr)*or,Wr])}([rn,hn??an(Ze,zt,ne),an(Je,Nt,ne),an(ht,Xt,ne)]);return new un(Sn,xn,Nn,Gn,!1)}case"lab":{const[ze,Ze,Je,ht]=Bt(_n(Y.lab,U.lab,ne));return new un(ze,Ze,Je,ht,!1)}}},array:_n,padding:function(Y,U,ne){return new mn(_n(Y.values,U.values,ne))},variableAnchorOffsetCollection:function(Y,U,ne){const pe=Y.values,ze=U.values;if(pe.length!==ze.length)throw new $n(`Cannot interpolate values of different length. from: ${Y.toString()}, to: ${U.toString()}`);const Ze=[];for(let Je=0;Jetypeof Nt!="number"||Nt<0||Nt>1))return ne.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);ze={name:"cubic-bezier",controlPoints:zt}}}if(U.length-1<4)return ne.error(`Expected at least 4 arguments, but found only ${U.length-1}.`);if((U.length-1)%2!=0)return ne.error("Expected an even number of arguments.");if(Ze=ne.parse(Ze,2,$e),!Ze)return null;const ht=[];let mt=null;pe==="interpolate-hcl"||pe==="interpolate-lab"?mt=De:ne.expectedType&&ne.expectedType.kind!=="value"&&(mt=ne.expectedType);for(let zt=0;zt=Nt)return ne.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',rn);const Sn=ne.parse(Xt,hn,mt);if(!Sn)return null;mt=mt||Sn.type,ht.push([Nt,Sn])}return yt(mt,$e)||yt(mt,De)||yt(mt,ft)||yt(mt,kt)||yt(mt,Vt($e))?new qn(mt,pe,ze,Ze,ht):ne.error(`Type ${Ht(mt)} is not interpolatable.`)}evaluate(U){const ne=this.labels,pe=this.outputs;if(ne.length===1)return pe[0].evaluate(U);const ze=this.input.evaluate(U);if(ze<=ne[0])return pe[0].evaluate(U);const Ze=ne.length;if(ze>=ne[Ze-1])return pe[Ze-1].evaluate(U);const Je=Ir(ne,ze),ht=ne[Je],mt=ne[Je+1],zt=qn.interpolationFactor(this.interpolation,ze,ht,mt),Nt=pe[Je].evaluate(U),Xt=pe[Je+1].evaluate(U);switch(this.operator){case"interpolate":return gn[this.type.kind](Nt,Xt,zt);case"interpolate-hcl":return gn.color(Nt,Xt,zt,"hcl");case"interpolate-lab":return gn.color(Nt,Xt,zt,"lab")}}eachChild(U){U(this.input);for(const ne of this.outputs)U(ne)}outputDefined(){return this.outputs.every(U=>U.outputDefined())}}function Un(Y,U,ne,pe){const ze=pe-ne,Ze=Y-ne;return ze===0?0:U===1?Ze/ze:(Math.pow(U,Ze)-1)/(Math.pow(U,ze)-1)}class tr{constructor(U,ne){this.type=U,this.args=ne}static parse(U,ne){if(U.length<2)return ne.error("Expectected at least one argument.");let pe=null;const ze=ne.expectedType;ze&&ze.kind!=="value"&&(pe=ze);const Ze=[];for(const ht of U.slice(1)){const mt=ne.parse(ht,1+Ze.length,pe,void 0,{typeAnnotation:"omit"});if(!mt)return null;pe=pe||mt.type,Ze.push(mt)}if(!pe)throw new Error("No output type");const Je=ze&&Ze.some(ht=>st(ze,ht.type));return new tr(Je?Ge:pe,Ze)}evaluate(U){let ne,pe=null,ze=0;for(const Ze of this.args)if(ze++,pe=Ze.evaluate(U),pe&&pe instanceof Ln&&!pe.available&&(ne||(ne=pe.name),pe=null,ze===this.args.length&&(pe=ne)),pe!==null)break;return pe}eachChild(U){this.args.forEach(U)}outputDefined(){return this.args.every(U=>U.outputDefined())}}function Wn(Y,U){return Y==="=="||Y==="!="?U.kind==="boolean"||U.kind==="string"||U.kind==="number"||U.kind==="null"||U.kind==="value":U.kind==="string"||U.kind==="number"||U.kind==="value"}function Bn(Y,U,ne,pe){return pe.compare(U,ne)===0}function dn(Y,U,ne){const pe=Y!=="=="&&Y!=="!=";return class v8{constructor(Ze,Je,ht){this.type=_e,this.lhs=Ze,this.rhs=Je,this.collator=ht,this.hasUntypedArgument=Ze.type.kind==="value"||Je.type.kind==="value"}static parse(Ze,Je){if(Ze.length!==3&&Ze.length!==4)return Je.error("Expected two or three arguments.");const ht=Ze[0];let mt=Je.parse(Ze[1],1,Ge);if(!mt)return null;if(!Wn(ht,mt.type))return Je.concat(1).error(`"${ht}" comparisons are not supported for type '${Ht(mt.type)}'.`);let zt=Je.parse(Ze[2],2,Ge);if(!zt)return null;if(!Wn(ht,zt.type))return Je.concat(2).error(`"${ht}" comparisons are not supported for type '${Ht(zt.type)}'.`);if(mt.type.kind!==zt.type.kind&&mt.type.kind!=="value"&&zt.type.kind!=="value")return Je.error(`Cannot compare types '${Ht(mt.type)}' and '${Ht(zt.type)}'.`);pe&&(mt.type.kind==="value"&&zt.type.kind!=="value"?mt=new Qn(zt.type,[mt]):mt.type.kind!=="value"&&zt.type.kind==="value"&&(zt=new Qn(mt.type,[zt])));let Nt=null;if(Ze.length===4){if(mt.type.kind!=="string"&&zt.type.kind!=="string"&&mt.type.kind!=="value"&&zt.type.kind!=="value")return Je.error("Cannot use collator to compare non-string types.");if(Nt=Je.parse(Ze[3],3,tt),!Nt)return null}return new v8(mt,zt,Nt)}evaluate(Ze){const Je=this.lhs.evaluate(Ze),ht=this.rhs.evaluate(Ze);if(pe&&this.hasUntypedArgument){const mt=wn(Je),zt=wn(ht);if(mt.kind!==zt.kind||mt.kind!=="string"&&mt.kind!=="number")throw new $n(`Expected arguments for "${Y}" to be (string, string) or (number, number), but found (${mt.kind}, ${zt.kind}) instead.`)}if(this.collator&&!pe&&this.hasUntypedArgument){const mt=wn(Je),zt=wn(ht);if(mt.kind!=="string"||zt.kind!=="string")return U(Ze,Je,ht)}return this.collator?ne(Ze,Je,ht,this.collator.evaluate(Ze)):U(Ze,Je,ht)}eachChild(Ze){Ze(this.lhs),Ze(this.rhs),this.collator&&Ze(this.collator)}outputDefined(){return!0}}}const ln=dn("==",function(Y,U,ne){return U===ne},Bn),An=dn("!=",function(Y,U,ne){return U!==ne},function(Y,U,ne,pe){return!Bn(0,U,ne,pe)}),er=dn("<",function(Y,U,ne){return U",function(Y,U,ne){return U>ne},function(Y,U,ne,pe){return pe.compare(U,ne)>0}),Tr=dn("<=",function(Y,U,ne){return U<=ne},function(Y,U,ne,pe){return pe.compare(U,ne)<=0}),yr=dn(">=",function(Y,U,ne){return U>=ne},function(Y,U,ne,pe){return pe.compare(U,ne)>=0});class Ur{constructor(U,ne,pe){this.type=tt,this.locale=pe,this.caseSensitive=U,this.diacriticSensitive=ne}static parse(U,ne){if(U.length!==2)return ne.error("Expected one argument.");const pe=U[1];if(typeof pe!="object"||Array.isArray(pe))return ne.error("Collator options argument must be an object.");const ze=ne.parse(pe["case-sensitive"]!==void 0&&pe["case-sensitive"],1,_e);if(!ze)return null;const Ze=ne.parse(pe["diacritic-sensitive"]!==void 0&&pe["diacritic-sensitive"],1,_e);if(!Ze)return null;let Je=null;return pe.locale&&(Je=ne.parse(pe.locale,1,Ye),!Je)?null:new Ur(ze,Ze,Je)}evaluate(U){return new Pn(this.caseSensitive.evaluate(U),this.diacriticSensitive.evaluate(U),this.locale?this.locale.evaluate(U):null)}eachChild(U){U(this.caseSensitive),U(this.diacriticSensitive),this.locale&&U(this.locale)}outputDefined(){return!1}}class Rr{constructor(U,ne,pe,ze,Ze){this.type=Ye,this.number=U,this.locale=ne,this.currency=pe,this.minFractionDigits=ze,this.maxFractionDigits=Ze}static parse(U,ne){if(U.length!==3)return ne.error("Expected two arguments.");const pe=ne.parse(U[1],1,$e);if(!pe)return null;const ze=U[2];if(typeof ze!="object"||Array.isArray(ze))return ne.error("NumberFormat options argument must be an object.");let Ze=null;if(ze.locale&&(Ze=ne.parse(ze.locale,1,Ye),!Ze))return null;let Je=null;if(ze.currency&&(Je=ne.parse(ze.currency,1,Ye),!Je))return null;let ht=null;if(ze["min-fraction-digits"]&&(ht=ne.parse(ze["min-fraction-digits"],1,$e),!ht))return null;let mt=null;return ze["max-fraction-digits"]&&(mt=ne.parse(ze["max-fraction-digits"],1,$e),!mt)?null:new Rr(pe,Ze,Je,ht,mt)}evaluate(U){return new Intl.NumberFormat(this.locale?this.locale.evaluate(U):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(U):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(U):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(U):void 0}).format(this.number.evaluate(U))}eachChild(U){U(this.number),this.locale&&U(this.locale),this.currency&&U(this.currency),this.minFractionDigits&&U(this.minFractionDigits),this.maxFractionDigits&&U(this.maxFractionDigits)}outputDefined(){return!1}}class $r{constructor(U){this.type=nt,this.sections=U}static parse(U,ne){if(U.length<2)return ne.error("Expected at least one argument.");const pe=U[1];if(!Array.isArray(pe)&&typeof pe=="object")return ne.error("First argument must be an image or text section.");const ze=[];let Ze=!1;for(let Je=1;Je<=U.length-1;++Je){const ht=U[Je];if(Ze&&typeof ht=="object"&&!Array.isArray(ht)){Ze=!1;let mt=null;if(ht["font-scale"]&&(mt=ne.parse(ht["font-scale"],1,$e),!mt))return null;let zt=null;if(ht["text-font"]&&(zt=ne.parse(ht["text-font"],1,Vt(Ye)),!zt))return null;let Nt=null;if(ht["text-color"]&&(Nt=ne.parse(ht["text-color"],1,De),!Nt))return null;const Xt=ze[ze.length-1];Xt.scale=mt,Xt.font=zt,Xt.textColor=Nt}else{const mt=ne.parse(U[Je],1,Ge);if(!mt)return null;const zt=mt.type.kind;if(zt!=="string"&&zt!=="value"&&zt!=="null"&&zt!=="resolvedImage")return ne.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Ze=!0,ze.push({content:mt,scale:null,font:null,textColor:null})}}return new $r(ze)}evaluate(U){return new In(this.sections.map(ne=>{const pe=ne.content.evaluate(U);return wn(pe)===At?new Dn("",pe,null,null,null):new Dn(zn(pe),null,ne.scale?ne.scale.evaluate(U):null,ne.font?ne.font.evaluate(U).join(","):null,ne.textColor?ne.textColor.evaluate(U):null)}))}eachChild(U){for(const ne of this.sections)U(ne.content),ne.scale&&U(ne.scale),ne.font&&U(ne.font),ne.textColor&&U(ne.textColor)}outputDefined(){return!1}}class Pr{constructor(U){this.type=At,this.input=U}static parse(U,ne){if(U.length!==2)return ne.error("Expected two arguments.");const pe=ne.parse(U[1],1,Ye);return pe?new Pr(pe):ne.error("No image name provided.")}evaluate(U){const ne=this.input.evaluate(U),pe=Ln.fromString(ne);return pe&&U.availableImages&&(pe.available=U.availableImages.indexOf(ne)>-1),pe}eachChild(U){U(this.input)}outputDefined(){return!1}}class Cr{constructor(U){this.type=$e,this.input=U}static parse(U,ne){if(U.length!==2)return ne.error(`Expected 1 argument, but found ${U.length-1} instead.`);const pe=ne.parse(U[1],1);return pe?pe.type.kind!=="array"&&pe.type.kind!=="string"&&pe.type.kind!=="value"?ne.error(`Expected argument of type string or array, but found ${Ht(pe.type)} instead.`):new Cr(pe):null}evaluate(U){const ne=this.input.evaluate(U);if(typeof ne=="string"||Array.isArray(ne))return ne.length;throw new $n(`Expected value to be of type string or array, but found ${Ht(wn(ne))} instead.`)}eachChild(U){U(this.input)}outputDefined(){return!1}}const Jr=8192;function gi(Y,U){const ne=(180+Y[0])/360,pe=(Ze=Y[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Ze*Math.PI/360)))/360),ze=Math.pow(2,U.z);var Ze;return[Math.round(ne*ze*Jr),Math.round(pe*ze*Jr)]}function ii(Y,U){const ne=Math.pow(2,U.z),pe=(Y[0]/Jr+U.x)/ne,ze=(Y[1]/Jr+U.y)/ne;return[(Je=pe,360*Je-180),(Ze=ze,360/Math.PI*Math.atan(Math.exp((180-360*Ze)*Math.PI/180))-90)];var Ze,Je}function Yr(Y,U){Y[0]=Math.min(Y[0],U[0]),Y[1]=Math.min(Y[1],U[1]),Y[2]=Math.max(Y[2],U[0]),Y[3]=Math.max(Y[3],U[1])}function oi(Y,U){return!(Y[0]<=U[0]||Y[2]>=U[2]||Y[1]<=U[1]||Y[3]>=U[3])}function Ti(Y,U,ne){const pe=Y[0]-U[0],ze=Y[1]-U[1],Ze=Y[0]-ne[0],Je=Y[1]-ne[1];return pe*Je-Ze*ze==0&&pe*Ze<=0&&ze*Je<=0}function Wi(Y,U,ne,pe){const ze=[U[0]-Y[0],U[1]-Y[1]];return Ze=[pe[0]-ne[0],pe[1]-ne[1]],Je=ze,Ze[0]*Je[1]-Ze[1]*Je[0]!=0&&!(!bs(Y,U,ne,pe)||!bs(ne,pe,Y,U));var Ze,Je}function Pa(Y,U,ne){for(const pe of ne)for(let ze=0;zeze[1]!=Je[1]>ze[1]&&ze[0]<(Je[0]-Ze[0])*(ze[1]-Ze[1])/(Je[1]-Ze[1])+Ze[0]&&(pe=!pe)}var ze,Ze,Je;return pe}function Vo(Y,U){for(const ne of U)if(ji(Y,ne))return!0;return!1}function Ha(Y,U){for(const ne of Y)if(!ji(ne,U))return!1;for(let ne=0;ne0&&Xt<0||Nt<0&&Xt>0}function lo(Y,U,ne){const pe=[];for(let ze=0;zene[2]){const ze=.5*pe;let Ze=Y[0]-ne[0]>ze?-pe:ne[0]-Y[0]>ze?pe:0;Ze===0&&(Ze=Y[0]-ne[2]>ze?-pe:ne[2]-Y[0]>ze?pe:0),Y[0]+=Ze}Yr(U,Y)}function To(Y,U,ne,pe){const ze=Math.pow(2,pe.z)*Jr,Ze=[pe.x*Jr,pe.y*Jr],Je=[];for(const ht of Y)for(const mt of ht){const zt=[mt.x+Ze[0],mt.y+Ze[1]];os(zt,U,ne,ze),Je.push(zt)}return Je}function fo(Y,U,ne,pe){const ze=Math.pow(2,pe.z)*Jr,Ze=[pe.x*Jr,pe.y*Jr],Je=[];for(const mt of Y){const zt=[];for(const Nt of mt){const Xt=[Nt.x+Ze[0],Nt.y+Ze[1]];Yr(U,Xt),zt.push(Xt)}Je.push(zt)}if(U[2]-U[0]<=ze/2){(ht=U)[0]=ht[1]=1/0,ht[2]=ht[3]=-1/0;for(const mt of Je)for(const zt of mt)os(zt,U,ne,ze)}var ht;return Je}class Os{constructor(U,ne){this.type=_e,this.geojson=U,this.geometries=ne}static parse(U,ne){if(U.length!==2)return ne.error(`'within' expression requires exactly one argument, but found ${U.length-1} instead.`);if(Fn(U[1])){const pe=U[1];if(pe.type==="FeatureCollection"){const ze=[];for(const Ze of pe.features){const{type:Je,coordinates:ht}=Ze.geometry;Je==="Polygon"&&ze.push(ht),Je==="MultiPolygon"&&ze.push(...ht)}if(ze.length)return new Os(pe,{type:"MultiPolygon",coordinates:ze})}else if(pe.type==="Feature"){const ze=pe.geometry.type;if(ze==="Polygon"||ze==="MultiPolygon")return new Os(pe,pe.geometry)}else if(pe.type==="Polygon"||pe.type==="MultiPolygon")return new Os(pe,pe)}return ne.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(U){if(U.geometry()!=null&&U.canonicalID()!=null){if(U.geometryType()==="Point")return function(ne,pe){const ze=[1/0,1/0,-1/0,-1/0],Ze=[1/0,1/0,-1/0,-1/0],Je=ne.canonicalID();if(pe.type==="Polygon"){const ht=lo(pe.coordinates,Ze,Je),mt=To(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!ji(zt,ht))return!1}if(pe.type==="MultiPolygon"){const ht=Ki(pe.coordinates,Ze,Je),mt=To(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!Vo(zt,ht))return!1}return!0}(U,this.geometries);if(U.geometryType()==="LineString")return function(ne,pe){const ze=[1/0,1/0,-1/0,-1/0],Ze=[1/0,1/0,-1/0,-1/0],Je=ne.canonicalID();if(pe.type==="Polygon"){const ht=lo(pe.coordinates,Ze,Je),mt=fo(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!Ha(zt,ht))return!1}if(pe.type==="MultiPolygon"){const ht=Ki(pe.coordinates,Ze,Je),mt=fo(ne.geometry(),ze,Ze,Je);if(!oi(ze,Ze))return!1;for(const zt of mt)if(!Oa(zt,ht))return!1}return!0}(U,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ta=class{constructor(Y=[],U=ws){if(this.data=Y,this.length=this.data.length,this.compare=U,this.length>0)for(let ne=(this.length>>1)-1;ne>=0;ne--)this._down(ne)}push(Y){this.data.push(Y),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const Y=this.data[0],U=this.data.pop();return this.length--,this.length>0&&(this.data[0]=U,this._down(0)),Y}peek(){return this.data[0]}_up(Y){const{data:U,compare:ne}=this,pe=U[Y];for(;Y>0;){const ze=Y-1>>1,Ze=U[ze];if(ne(pe,Ze)>=0)break;U[Y]=Ze,Y=ze}U[Y]=pe}_down(Y){const{data:U,compare:ne}=this,pe=this.length>>1,ze=U[Y];for(;Y=0)break;U[Y]=Je,Y=Ze}U[Y]=ze}};function ws(Y,U){return YU?1:0}function Bl(Y,U,ne,pe,ze){Ql(Y,U,ne,pe||Y.length-1,ze||eu)}function Ql(Y,U,ne,pe,ze){for(;pe>ne;){if(pe-ne>600){var Ze=pe-ne+1,Je=U-ne+1,ht=Math.log(Ze),mt=.5*Math.exp(2*ht/3),zt=.5*Math.sqrt(ht*mt*(Ze-mt)/Ze)*(Je-Ze/2<0?-1:1);Ql(Y,U,Math.max(ne,Math.floor(U-Je*mt/Ze+zt)),Math.min(pe,Math.floor(U+(Ze-Je)*mt/Ze+zt)),ze)}var Nt=Y[U],Xt=ne,rn=pe;for(ss(Y,ne,U),ze(Y[pe],Nt)>0&&ss(Y,ne,pe);Xt0;)rn--}ze(Y[ne],Nt)===0?ss(Y,ne,rn):ss(Y,++rn,pe),rn<=U&&(ne=rn+1),U<=rn&&(pe=rn-1)}}function ss(Y,U,ne){var pe=Y[U];Y[U]=Y[ne],Y[ne]=pe}function eu(Y,U){return YU?1:0}function vl(Y,U){if(Y.length<=1)return[Y];const ne=[];let pe,ze;for(const Ze of Y){const Je=ko(Ze);Je!==0&&(Ze.area=Math.abs(Je),ze===void 0&&(ze=Je<0),ze===Je<0?(pe&&ne.push(pe),pe=[Ze]):pe.push(Ze))}if(pe&&ne.push(pe),U>1)for(let Ze=0;Ze1?(zt=U[mt+1][0],Nt=U[mt+1][1]):hn>0&&(zt+=Xt/this.kx*hn,Nt+=rn/this.ky*hn)),Xt=this.wrap(ne[0]-zt)*this.kx,rn=(ne[1]-Nt)*this.ky;const Sn=Xt*Xt+rn*rn;Sn180;)U-=360;return U}}const xl=100,jl=50;function Ul(Y,U){return U[0]-Y[0]}function Vl(Y){return Y[1]-Y[0]+1}function vs(Y,U){return Y[1]>=Y[0]&&Y[1]Y[1])return[null,null];const ne=Vl(Y);if(U){if(ne===2)return[Y,null];const ze=Math.floor(ne/2);return[[Y[0],Y[0]+ze],[Y[0]+ze,Y[1]]]}if(ne===1)return[Y,null];const pe=Math.floor(ne/2)-1;return[[Y[0],Y[0]+pe],[Y[0]+pe+1,Y[1]]]}function ju(Y,U){if(!vs(U,Y.length))return[1/0,1/0,-1/0,-1/0];const ne=[1/0,1/0,-1/0,-1/0];for(let pe=U[0];pe<=U[1];++pe)Yr(ne,Y[pe]);return ne}function Su(Y){const U=[1/0,1/0,-1/0,-1/0];for(const ne of Y)for(const pe of ne)Yr(U,pe);return U}function pc(Y){return Y[0]!==-1/0&&Y[1]!==-1/0&&Y[2]!==1/0&&Y[3]!==1/0}function Rs(Y,U,ne){if(!pc(Y)||!pc(U))return NaN;let pe=0,ze=0;return Y[2]U[2]&&(pe=Y[0]-U[2]),Y[1]>U[3]&&(ze=Y[1]-U[3]),Y[3]=pe)return pe;if(oi(ze,Ze)){if(Mu(Y,U))return 0}else if(Mu(U,Y))return 0;let Je=1/0;for(const ht of Y)for(let mt=0,zt=ht.length,Nt=zt-1;mt0;){const mt=Je.pop();if(mt[0]>=Ze)continue;const zt=mt[1],Nt=U?jl:xl;if(Vl(zt)<=Nt){if(!vs(zt,Y.length))return NaN;if(U){const Xt=oa(Y,zt,ne,pe);if(isNaN(Xt)||Xt===0)return Xt;Ze=Math.min(Ze,Xt)}else for(let Xt=zt[0];Xt<=zt[1];++Xt){const rn=Qu(Y[Xt],ne,pe);if(Ze=Math.min(Ze,rn),Ze===0)return 0}}else{const Xt=Ju(zt,U);Ya(Je,Ze,pe,Y,ht,Xt[0]),Ya(Je,Ze,pe,Y,ht,Xt[1])}}return Ze}function ec(Y,U,ne,pe,ze,Ze=1/0){let Je=Math.min(Ze,ze.distance(Y[0],ne[0]));if(Je===0)return Je;const ht=new Ta([[0,[0,Y.length-1],[0,ne.length-1]]],Ul);for(;ht.length>0;){const mt=ht.pop();if(mt[0]>=Je)continue;const zt=mt[1],Nt=mt[2],Xt=U?jl:xl,rn=pe?jl:xl;if(Vl(zt)<=Xt&&Vl(Nt)<=rn){if(!vs(zt,Y.length)&&vs(Nt,ne.length))return NaN;let hn;if(U&&pe)hn=gh(Y,zt,ne,Nt,ze),Je=Math.min(Je,hn);else if(U&&!pe){const Sn=Y.slice(zt[0],zt[1]+1);for(let xn=Nt[0];xn<=Nt[1];++xn)if(hn=Vs(ne[xn],Sn,ze),Je=Math.min(Je,hn),Je===0)return Je}else if(!U&&pe){const Sn=ne.slice(Nt[0],Nt[1]+1);for(let xn=zt[0];xn<=zt[1];++xn)if(hn=Vs(Y[xn],Sn,ze),Je=Math.min(Je,hn),Je===0)return Je}else hn=Fo(Y,zt,ne,Nt,ze),Je=Math.min(Je,hn)}else{const hn=Ju(zt,U),Sn=Ju(Nt,pe);ys(ht,Je,ze,Y,ne,hn[0],Sn[0]),ys(ht,Je,ze,Y,ne,hn[0],Sn[1]),ys(ht,Je,ze,Y,ne,hn[1],Sn[0]),ys(ht,Je,ze,Y,ne,hn[1],Sn[1])}}return Je}function ql(Y){return Y.type==="MultiPolygon"?Y.coordinates.map(U=>({type:"Polygon",coordinates:U})):Y.type==="MultiLineString"?Y.coordinates.map(U=>({type:"LineString",coordinates:U})):Y.type==="MultiPoint"?Y.coordinates.map(U=>({type:"Point",coordinates:U})):[Y]}class Fs{constructor(U,ne){this.type=$e,this.geojson=U,this.geometries=ne}static parse(U,ne){if(U.length!==2)return ne.error(`'distance' expression requires exactly one argument, but found ${U.length-1} instead.`);if(Fn(U[1])){const pe=U[1];if(pe.type==="FeatureCollection")return new Fs(pe,pe.features.map(ze=>ql(ze.geometry)).flat());if(pe.type==="Feature")return new Fs(pe,ql(pe.geometry));if("type"in pe&&"coordinates"in pe)return new Fs(pe,ql(pe))}return ne.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(U){if(U.geometry()!=null&&U.canonicalID()!=null){if(U.geometryType()==="Point")return function(ne,pe){const ze=ne.geometry(),Ze=ze.flat().map(mt=>ii([mt.x,mt.y],ne.canonical));if(ze.length===0)return NaN;const Je=new tu(Ze[0][1]);let ht=1/0;for(const mt of pe){switch(mt.type){case"Point":ht=Math.min(ht,ec(Ze,!1,[mt.coordinates],!1,Je,ht));break;case"LineString":ht=Math.min(ht,ec(Ze,!1,mt.coordinates,!0,Je,ht));break;case"Polygon":ht=Math.min(ht,qs(Ze,!1,mt.coordinates,Je,ht))}if(ht===0)return ht}return ht}(U,this.geometries);if(U.geometryType()==="LineString")return function(ne,pe){const ze=ne.geometry(),Ze=ze.flat().map(mt=>ii([mt.x,mt.y],ne.canonical));if(ze.length===0)return NaN;const Je=new tu(Ze[0][1]);let ht=1/0;for(const mt of pe){switch(mt.type){case"Point":ht=Math.min(ht,ec(Ze,!0,[mt.coordinates],!1,Je,ht));break;case"LineString":ht=Math.min(ht,ec(Ze,!0,mt.coordinates,!0,Je,ht));break;case"Polygon":ht=Math.min(ht,qs(Ze,!0,mt.coordinates,Je,ht))}if(ht===0)return ht}return ht}(U,this.geometries);if(U.geometryType()==="Polygon")return function(ne,pe){const ze=ne.geometry();if(ze.length===0||ze[0].length===0)return NaN;const Ze=vl(ze,0).map(mt=>mt.map(zt=>zt.map(Nt=>ii([Nt.x,Nt.y],ne.canonical)))),Je=new tu(Ze[0][0][0][1]);let ht=1/0;for(const mt of pe)for(const zt of Ze){switch(mt.type){case"Point":ht=Math.min(ht,qs([mt.coordinates],!1,zt,Je,ht));break;case"LineString":ht=Math.min(ht,qs(mt.coordinates,!0,zt,Je,ht));break;case"Polygon":ht=Math.min(ht,$a(zt,mt.coordinates,Je,ht))}if(ht===0)return ht}return ht}(U,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const qo={"==":ln,"!=":An,">":br,"<":er,">=":yr,"<=":Tr,array:Qn,at:Qr,boolean:Qn,case:Zn,coalesce:tr,collator:Ur,format:$r,image:Pr,in:kn,"index-of":Cn,interpolate:qn,"interpolate-hcl":qn,"interpolate-lab":qn,length:Cr,let:Ar,literal:Jn,match:ur,number:Qn,"number-format":Rr,object:Qn,slice:cr,step:Er,string:Qn,"to-boolean":hr,"to-color":hr,"to-number":hr,"to-string":hr,var:xr,within:Os,distance:Fs};class Bo{constructor(U,ne,pe,ze){this.name=U,this.type=ne,this._evaluate=pe,this.args=ze}evaluate(U){return this._evaluate(U,this.args)}eachChild(U){this.args.forEach(U)}outputDefined(){return!1}static parse(U,ne){const pe=U[0],ze=Bo.definitions[pe];if(!ze)return ne.error(`Unknown expression "${pe}". If you wanted a literal array, use ["literal", [...]].`,0);const Ze=Array.isArray(ze)?ze[0]:ze.type,Je=Array.isArray(ze)?[[ze[1],ze[2]]]:ze.overloads,ht=Je.filter(([zt])=>!Array.isArray(zt)||zt.length===U.length-1);let mt=null;for(const[zt,Nt]of ht){mt=new Or(ne.registry,Yo,ne.path,null,ne.scope);const Xt=[];let rn=!1;for(let hn=1;hn{return rn=Xt,Array.isArray(rn)?`(${rn.map(Ht).join(", ")})`:`(${Ht(rn.type)}...)`;var rn}).join(" | "),Nt=[];for(let Xt=1;Xt{ne=U?ne&&Yo(pe):ne&&pe instanceof Jn}),!!ne&&tc(Y)&&rc(Y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function tc(Y){if(Y instanceof Bo&&(Y.name==="get"&&Y.args.length===1||Y.name==="feature-state"||Y.name==="has"&&Y.args.length===1||Y.name==="properties"||Y.name==="geometry-type"||Y.name==="id"||/^filter-/.test(Y.name))||Y instanceof Os||Y instanceof Fs)return!1;let U=!0;return Y.eachChild(ne=>{U&&!tc(ne)&&(U=!1)}),U}function nc(Y){if(Y instanceof Bo&&Y.name==="feature-state")return!1;let U=!0;return Y.eachChild(ne=>{U&&!nc(ne)&&(U=!1)}),U}function rc(Y,U){if(Y instanceof Bo&&U.indexOf(Y.name)>=0)return!1;let ne=!0;return Y.eachChild(pe=>{ne&&!rc(pe,U)&&(ne=!1)}),ne}function Qc(Y){return{result:"success",value:Y}}function _l(Y){return{result:"error",value:Y}}function Hl(Y){return Y["property-type"]==="data-driven"||Y["property-type"]==="cross-faded-data-driven"}function Gs(Y){return!!Y.expression&&Y.expression.parameters.indexOf("zoom")>-1}function pr(Y){return!!Y.expression&&Y.expression.interpolated}function Dr(Y){return Y instanceof Number?"number":Y instanceof String?"string":Y instanceof Boolean?"boolean":Array.isArray(Y)?"array":Y===null?"null":typeof Y}function Zr(Y){return typeof Y=="object"&&Y!==null&&!Array.isArray(Y)}function Li(Y){return Y}function ia(Y,U){const ne=U.type==="color",pe=Y.stops&&typeof Y.stops[0][0]=="object",ze=pe||Y.property!==void 0,Ze=pe||!ze,Je=Y.type||(pr(U)?"exponential":"interval");if(ne||U.type==="padding"){const Xt=ne?un.parse:mn.parse;(Y=ke({},Y)).stops&&(Y.stops=Y.stops.map(rn=>[rn[0],Xt(rn[1])])),Y.default?Y.default=Xt(Y.default):Y.default=Xt(U.default)}if(Y.colorSpace&&(ht=Y.colorSpace)!=="rgb"&&ht!=="hcl"&&ht!=="lab")throw new Error(`Unknown color space: "${Y.colorSpace}"`);var ht;let mt,zt,Nt;if(Je==="exponential")mt=mu;else if(Je==="interval")mt=ro;else if(Je==="categorical"){mt=po,zt=Object.create(null);for(const Xt of Y.stops)zt[Xt[0]]=Xt[1];Nt=typeof Y.stops[0][0]}else{if(Je!=="identity")throw new Error(`Unknown function type "${Je}"`);mt=qu}if(pe){const Xt={},rn=[];for(let xn=0;xnxn[0]),evaluate({zoom:xn},Nn){return mu({stops:hn,base:Y.base},U,xn).evaluate(xn,Nn)}}}if(Ze){const Xt=Je==="exponential"?{name:"exponential",base:Y.base!==void 0?Y.base:1}:null;return{kind:"camera",interpolationType:Xt,interpolationFactor:qn.interpolationFactor.bind(void 0,Xt),zoomStops:Y.stops.map(rn=>rn[0]),evaluate:({zoom:rn})=>mt(Y,U,rn,zt,Nt)}}return{kind:"source",evaluate(Xt,rn){const hn=rn&&rn.properties?rn.properties[Y.property]:void 0;return hn===void 0?sa(Y.default,U.default):mt(Y,U,hn,zt,Nt)}}}function sa(Y,U,ne){return Y!==void 0?Y:U!==void 0?U:ne!==void 0?ne:void 0}function po(Y,U,ne,pe,ze){return sa(typeof ne===ze?pe[ne]:void 0,Y.default,U.default)}function ro(Y,U,ne){if(Dr(ne)!=="number")return sa(Y.default,U.default);const pe=Y.stops.length;if(pe===1||ne<=Y.stops[0][0])return Y.stops[0][1];if(ne>=Y.stops[pe-1][0])return Y.stops[pe-1][1];const ze=Ir(Y.stops.map(Ze=>Ze[0]),ne);return Y.stops[ze][1]}function mu(Y,U,ne){const pe=Y.base!==void 0?Y.base:1;if(Dr(ne)!=="number")return sa(Y.default,U.default);const ze=Y.stops.length;if(ze===1||ne<=Y.stops[0][0])return Y.stops[0][1];if(ne>=Y.stops[ze-1][0])return Y.stops[ze-1][1];const Ze=Ir(Y.stops.map(Nt=>Nt[0]),ne),Je=function(Nt,Xt,rn,hn){const Sn=hn-rn,xn=Nt-rn;return Sn===0?0:Xt===1?xn/Sn:(Math.pow(Xt,xn)-1)/(Math.pow(Xt,Sn)-1)}(ne,pe,Y.stops[Ze][0],Y.stops[Ze+1][0]),ht=Y.stops[Ze][1],mt=Y.stops[Ze+1][1],zt=gn[U.type]||Li;return typeof ht.evaluate=="function"?{evaluate(...Nt){const Xt=ht.evaluate.apply(void 0,Nt),rn=mt.evaluate.apply(void 0,Nt);if(Xt!==void 0&&rn!==void 0)return zt(Xt,rn,Je,Y.colorSpace)}}:zt(ht,mt,Je,Y.colorSpace)}function qu(Y,U,ne){switch(U.type){case"color":ne=un.parse(ne);break;case"formatted":ne=In.fromString(ne.toString());break;case"resolvedImage":ne=Ln.fromString(ne.toString());break;case"padding":ne=mn.parse(ne);break;default:Dr(ne)===U.type||U.type==="enum"&&U.values[ne]||(ne=void 0)}return sa(ne,Y.default,U.default)}Bo.register(qo,{error:[{kind:"error"},[Ye],(Y,[U])=>{throw new $n(U.evaluate(Y))}],typeof:[Ye,[Ge],(Y,[U])=>Ht(wn(U.evaluate(Y)))],"to-rgba":[Vt($e,4),[De],(Y,[U])=>{const[ne,pe,ze,Ze]=U.evaluate(Y).rgb;return[255*ne,255*pe,255*ze,Ze]}],rgb:[De,[$e,$e,$e],_a],rgba:[De,[$e,$e,$e,$e],_a],has:{type:_e,overloads:[[[Ye],(Y,[U])=>Vu(U.evaluate(Y),Y.properties())],[[Ye,Be],(Y,[U,ne])=>Vu(U.evaluate(Y),ne.evaluate(Y))]]},get:{type:Ge,overloads:[[[Ye],(Y,[U])=>Fc(U.evaluate(Y),Y.properties())],[[Ye,Be],(Y,[U,ne])=>Fc(U.evaluate(Y),ne.evaluate(Y))]]},"feature-state":[Ge,[Ye],(Y,[U])=>Fc(U.evaluate(Y),Y.featureState||{})],properties:[Be,[],Y=>Y.properties()],"geometry-type":[Ye,[],Y=>Y.geometryType()],id:[Ge,[],Y=>Y.id()],zoom:[$e,[],Y=>Y.globals.zoom],"heatmap-density":[$e,[],Y=>Y.globals.heatmapDensity||0],"line-progress":[$e,[],Y=>Y.globals.lineProgress||0],accumulated:[Ge,[],Y=>Y.globals.accumulated===void 0?null:Y.globals.accumulated],"+":[$e,Hs($e),(Y,U)=>{let ne=0;for(const pe of U)ne+=pe.evaluate(Y);return ne}],"*":[$e,Hs($e),(Y,U)=>{let ne=1;for(const pe of U)ne*=pe.evaluate(Y);return ne}],"-":{type:$e,overloads:[[[$e,$e],(Y,[U,ne])=>U.evaluate(Y)-ne.evaluate(Y)],[[$e],(Y,[U])=>-U.evaluate(Y)]]},"/":[$e,[$e,$e],(Y,[U,ne])=>U.evaluate(Y)/ne.evaluate(Y)],"%":[$e,[$e,$e],(Y,[U,ne])=>U.evaluate(Y)%ne.evaluate(Y)],ln2:[$e,[],()=>Math.LN2],pi:[$e,[],()=>Math.PI],e:[$e,[],()=>Math.E],"^":[$e,[$e,$e],(Y,[U,ne])=>Math.pow(U.evaluate(Y),ne.evaluate(Y))],sqrt:[$e,[$e],(Y,[U])=>Math.sqrt(U.evaluate(Y))],log10:[$e,[$e],(Y,[U])=>Math.log(U.evaluate(Y))/Math.LN10],ln:[$e,[$e],(Y,[U])=>Math.log(U.evaluate(Y))],log2:[$e,[$e],(Y,[U])=>Math.log(U.evaluate(Y))/Math.LN2],sin:[$e,[$e],(Y,[U])=>Math.sin(U.evaluate(Y))],cos:[$e,[$e],(Y,[U])=>Math.cos(U.evaluate(Y))],tan:[$e,[$e],(Y,[U])=>Math.tan(U.evaluate(Y))],asin:[$e,[$e],(Y,[U])=>Math.asin(U.evaluate(Y))],acos:[$e,[$e],(Y,[U])=>Math.acos(U.evaluate(Y))],atan:[$e,[$e],(Y,[U])=>Math.atan(U.evaluate(Y))],min:[$e,Hs($e),(Y,U)=>Math.min(...U.map(ne=>ne.evaluate(Y)))],max:[$e,Hs($e),(Y,U)=>Math.max(...U.map(ne=>ne.evaluate(Y)))],abs:[$e,[$e],(Y,[U])=>Math.abs(U.evaluate(Y))],round:[$e,[$e],(Y,[U])=>{const ne=U.evaluate(Y);return ne<0?-Math.round(-ne):Math.round(ne)}],floor:[$e,[$e],(Y,[U])=>Math.floor(U.evaluate(Y))],ceil:[$e,[$e],(Y,[U])=>Math.ceil(U.evaluate(Y))],"filter-==":[_e,[Ye,Ge],(Y,[U,ne])=>Y.properties()[U.value]===ne.value],"filter-id-==":[_e,[Ge],(Y,[U])=>Y.id()===U.value],"filter-type-==":[_e,[Ye],(Y,[U])=>Y.geometryType()===U.value],"filter-<":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe>ze}],"filter-id->":[_e,[Ge],(Y,[U])=>{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne>pe}],"filter-<=":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe<=ze}],"filter-id-<=":[_e,[Ge],(Y,[U])=>{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne<=pe}],"filter->=":[_e,[Ye,Ge],(Y,[U,ne])=>{const pe=Y.properties()[U.value],ze=ne.value;return typeof pe==typeof ze&&pe>=ze}],"filter-id->=":[_e,[Ge],(Y,[U])=>{const ne=Y.id(),pe=U.value;return typeof ne==typeof pe&&ne>=pe}],"filter-has":[_e,[Ge],(Y,[U])=>U.value in Y.properties()],"filter-has-id":[_e,[],Y=>Y.id()!==null&&Y.id()!==void 0],"filter-type-in":[_e,[Vt(Ye)],(Y,[U])=>U.value.indexOf(Y.geometryType())>=0],"filter-id-in":[_e,[Vt(Ge)],(Y,[U])=>U.value.indexOf(Y.id())>=0],"filter-in-small":[_e,[Ye,Vt(Ge)],(Y,[U,ne])=>ne.value.indexOf(Y.properties()[U.value])>=0],"filter-in-large":[_e,[Ye,Vt(Ge)],(Y,[U,ne])=>function(pe,ze,Ze,Je){for(;Ze<=Je;){const ht=Ze+Je>>1;if(ze[ht]===pe)return!0;ze[ht]>pe?Je=ht-1:Ze=ht+1}return!1}(Y.properties()[U.value],ne.value,0,ne.value.length-1)],all:{type:_e,overloads:[[[_e,_e],(Y,[U,ne])=>U.evaluate(Y)&&ne.evaluate(Y)],[Hs(_e),(Y,U)=>{for(const ne of U)if(!ne.evaluate(Y))return!1;return!0}]]},any:{type:_e,overloads:[[[_e,_e],(Y,[U,ne])=>U.evaluate(Y)||ne.evaluate(Y)],[Hs(_e),(Y,U)=>{for(const ne of U)if(ne.evaluate(Y))return!0;return!1}]]},"!":[_e,[_e],(Y,[U])=>!U.evaluate(Y)],"is-supported-script":[_e,[Ye],(Y,[U])=>{const ne=Y.globals&&Y.globals.isSupportedScript;return!ne||ne(U.evaluate(Y))}],upcase:[Ye,[Ye],(Y,[U])=>U.evaluate(Y).toUpperCase()],downcase:[Ye,[Ye],(Y,[U])=>U.evaluate(Y).toLowerCase()],concat:[Ye,Hs(Ge),(Y,U)=>U.map(ne=>zn(ne.evaluate(Y))).join("")],"resolved-locale":[Ye,[tt],(Y,[U])=>U.evaluate(Y).resolvedLocale()]});class ls{constructor(U,ne){var pe;this.expression=U,this._warningHistory={},this._evaluator=new ni,this._defaultValue=ne?(pe=ne).type==="color"&&Zr(pe.default)?new un(0,0,0,0):pe.type==="color"?un.parse(pe.default)||null:pe.type==="padding"?mn.parse(pe.default)||null:pe.type==="variableAnchorOffsetCollection"?Kn.parse(pe.default)||null:pe.default===void 0?null:pe.default:null,this._enumValues=ne&&ne.type==="enum"?ne.values:null}evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je){return this._evaluator.globals=U,this._evaluator.feature=ne,this._evaluator.featureState=pe,this._evaluator.canonical=ze,this._evaluator.availableImages=Ze||null,this._evaluator.formattedSection=Je,this.expression.evaluate(this._evaluator)}evaluate(U,ne,pe,ze,Ze,Je){this._evaluator.globals=U,this._evaluator.feature=ne||null,this._evaluator.featureState=pe||null,this._evaluator.canonical=ze,this._evaluator.availableImages=Ze||null,this._evaluator.formattedSection=Je||null;try{const ht=this.expression.evaluate(this._evaluator);if(ht==null||typeof ht=="number"&&ht!=ht)return this._defaultValue;if(this._enumValues&&!(ht in this._enumValues))throw new $n(`Expected value to be one of ${Object.keys(this._enumValues).map(mt=>JSON.stringify(mt)).join(", ")}, but found ${JSON.stringify(ht)} instead.`);return ht}catch(ht){return this._warningHistory[ht.message]||(this._warningHistory[ht.message]=!0,typeof console<"u"&&console.warn(ht.message)),this._defaultValue}}}function Ws(Y){return Array.isArray(Y)&&Y.length>0&&typeof Y[0]=="string"&&Y[0]in qo}function bl(Y,U){const ne=new Or(qo,Yo,[],U?function(ze){const Ze={color:De,string:Ye,number:$e,enum:Ye,boolean:_e,formatted:nt,padding:ft,resolvedImage:At,variableAnchorOffsetCollection:kt};return ze.type==="array"?Vt(Ze[ze.value]||Ge,ze.length):Ze[ze.type]}(U):void 0),pe=ne.parse(Y,void 0,void 0,void 0,U&&U.type==="string"?{typeAnnotation:"coerce"}:void 0);return pe?Qc(new ls(pe,U)):_l(ne.errors)}class Zs{constructor(U,ne){this.kind=U,this._styleExpression=ne,this.isStateDependent=U!=="constant"&&!nc(ne.expression)}evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je)}evaluate(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluate(U,ne,pe,ze,Ze,Je)}}class vu{constructor(U,ne,pe,ze){this.kind=U,this.zoomStops=pe,this._styleExpression=ne,this.isStateDependent=U!=="camera"&&!nc(ne.expression),this.interpolationType=ze}evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluateWithoutErrorHandling(U,ne,pe,ze,Ze,Je)}evaluate(U,ne,pe,ze,Ze,Je){return this._styleExpression.evaluate(U,ne,pe,ze,Ze,Je)}interpolationFactor(U,ne,pe){return this.interpolationType?qn.interpolationFactor(this.interpolationType,U,ne,pe):0}}function La(Y,U){const ne=bl(Y,U);if(ne.result==="error")return ne;const pe=ne.value.expression,ze=tc(pe);if(!ze&&!Hl(U))return _l([new He("","data expressions not supported")]);const Ze=rc(pe,["zoom"]);if(!Ze&&!Gs(U))return _l([new He("","zoom expressions not supported")]);const Je=Ho(pe);if(!Je&&!Ze)return _l([new He("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(Je instanceof He)return _l([Je]);if(Je instanceof qn&&!pr(U))return _l([new He("",'"interpolate" expressions cannot be used with this property')]);if(!Je)return Qc(new Zs(ze?"constant":"source",ne.value));const ht=Je instanceof qn?Je.interpolation:void 0;return Qc(new vu(ze?"camera":"composite",ne.value,Je.labels,ht))}class ba{constructor(U,ne){this._parameters=U,this._specification=ne,ke(this,ia(this._parameters,this._specification))}static deserialize(U){return new ba(U._parameters,U._specification)}static serialize(U){return{_parameters:U._parameters,_specification:U._specification}}}function Ho(Y){let U=null;if(Y instanceof Ar)U=Ho(Y.result);else if(Y instanceof tr){for(const ne of Y.args)if(U=Ho(ne),U)break}else(Y instanceof Er||Y instanceof qn)&&Y.input instanceof Bo&&Y.input.name==="zoom"&&(U=Y);return U instanceof He||Y.eachChild(ne=>{const pe=Ho(ne);pe instanceof He?U=pe:!U&&pe?U=new He("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):U&&pe&&U!==pe&&(U=new He("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),U}function Ts(Y){if(Y===!0||Y===!1)return!0;if(!Array.isArray(Y)||Y.length===0)return!1;switch(Y[0]){case"has":return Y.length>=2&&Y[1]!=="$id"&&Y[1]!=="$type";case"in":return Y.length>=3&&(typeof Y[1]!="string"||Array.isArray(Y[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return Y.length!==3||Array.isArray(Y[1])||Array.isArray(Y[2]);case"any":case"all":for(const U of Y.slice(1))if(!Ts(U)&&typeof U!="boolean")return!1;return!0;default:return!0}}const Aa={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ua(Y){if(Y==null)return{filter:()=>!0,needGeometry:!1};Ts(Y)||(Y=nu(Y));const U=bl(Y,Aa);if(U.result==="error")throw new Error(U.value.map(ne=>`${ne.key}: ${ne.message}`).join(", "));return{filter:(ne,pe,ze)=>U.value.evaluate(ne,pe,{},ze),needGeometry:ic(Y)}}function wl(Y,U){return YU?1:0}function ic(Y){if(!Array.isArray(Y))return!1;if(Y[0]==="within"||Y[0]==="distance")return!0;for(let U=1;U"||U==="<="||U===">="?Bs(Y[1],Y[2],U):U==="any"?(ne=Y.slice(1),["any"].concat(ne.map(nu))):U==="all"?["all"].concat(Y.slice(1).map(nu)):U==="none"?["all"].concat(Y.slice(1).map(nu).map(No)):U==="in"?Gl(Y[1],Y.slice(2)):U==="!in"?No(Gl(Y[1],Y.slice(2))):U==="has"?us(Y[1]):U!=="!has"||No(us(Y[1]));var ne}function Bs(Y,U,ne){switch(Y){case"$type":return[`filter-type-${ne}`,U];case"$id":return[`filter-id-${ne}`,U];default:return[`filter-${ne}`,Y,U]}}function Gl(Y,U){if(U.length===0)return!1;switch(Y){case"$type":return["filter-type-in",["literal",U]];case"$id":return["filter-id-in",["literal",U]];default:return U.length>200&&!U.some(ne=>typeof ne!=typeof U[0])?["filter-in-large",Y,["literal",U.sort(wl)]]:["filter-in-small",Y,["literal",U]]}}function us(Y){switch(Y){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",Y]}}function No(Y){return["!",Y]}function Wl(Y){const U=typeof Y;if(U==="number"||U==="boolean"||U==="string"||Y==null)return JSON.stringify(Y);if(Array.isArray(Y)){let ze="[";for(const Ze of Y)ze+=`${Wl(Ze)},`;return`${ze}]`}const ne=Object.keys(Y).sort();let pe="{";for(let ze=0;zepe.maximum?[new Me(U,ne,`${ne} is greater than the maximum value ${pe.maximum}`)]:[]}function Ko(Y){const U=Y.valueSpec,ne=Xa(Y.value.type);let pe,ze,Ze,Je={};const ht=ne!=="categorical"&&Y.value.property===void 0,mt=!ht,zt=Dr(Y.value.stops)==="array"&&Dr(Y.value.stops[0])==="array"&&Dr(Y.value.stops[0][0])==="object",Nt=ka({key:Y.key,value:Y.value,valueSpec:Y.styleSpec.function,validateSpec:Y.validateSpec,style:Y.style,styleSpec:Y.styleSpec,objectElementValidators:{stops:function(hn){if(ne==="identity")return[new Me(hn.key,hn.value,'identity function may not have a "stops" property')];let Sn=[];const xn=hn.value;return Sn=Sn.concat(Ao({key:hn.key,value:xn,valueSpec:hn.valueSpec,validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec,arrayElementValidator:Xt})),Dr(xn)==="array"&&xn.length===0&&Sn.push(new Me(hn.key,xn,"array must have at least one stop")),Sn},default:function(hn){return hn.validateSpec({key:hn.key,value:hn.value,valueSpec:U,validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec})}}});return ne==="identity"&&ht&&Nt.push(new Me(Y.key,Y.value,'missing required property "property"')),ne==="identity"||Y.value.stops||Nt.push(new Me(Y.key,Y.value,'missing required property "stops"')),ne==="exponential"&&Y.valueSpec.expression&&!pr(Y.valueSpec)&&Nt.push(new Me(Y.key,Y.value,"exponential functions not supported")),Y.styleSpec.$version>=8&&(mt&&!Hl(Y.valueSpec)?Nt.push(new Me(Y.key,Y.value,"property functions not supported")):ht&&!Gs(Y.valueSpec)&&Nt.push(new Me(Y.key,Y.value,"zoom functions not supported"))),ne!=="categorical"&&!zt||Y.value.property!==void 0||Nt.push(new Me(Y.key,Y.value,'"property" property is required')),Nt;function Xt(hn){let Sn=[];const xn=hn.value,Nn=hn.key;if(Dr(xn)!=="array")return[new Me(Nn,xn,`array expected, ${Dr(xn)} found`)];if(xn.length!==2)return[new Me(Nn,xn,`array length 2 expected, length ${xn.length} found`)];if(zt){if(Dr(xn[0])!=="object")return[new Me(Nn,xn,`object expected, ${Dr(xn[0])} found`)];if(xn[0].zoom===void 0)return[new Me(Nn,xn,"object stop key must have zoom")];if(xn[0].value===void 0)return[new Me(Nn,xn,"object stop key must have value")];if(Ze&&Ze>Xa(xn[0].zoom))return[new Me(Nn,xn[0].zoom,"stop zoom values must appear in ascending order")];Xa(xn[0].zoom)!==Ze&&(Ze=Xa(xn[0].zoom),ze=void 0,Je={}),Sn=Sn.concat(ka({key:`${Nn}[0]`,value:xn[0],valueSpec:{zoom:{}},validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec,objectElementValidators:{zoom:Va,value:rn}}))}else Sn=Sn.concat(rn({key:`${Nn}[0]`,value:xn[0],valueSpec:{},validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec},xn));return Ws(Co(xn[1]))?Sn.concat([new Me(`${Nn}[1]`,xn[1],"expressions are not allowed in function stops.")]):Sn.concat(hn.validateSpec({key:`${Nn}[1]`,value:xn[1],valueSpec:U,validateSpec:hn.validateSpec,style:hn.style,styleSpec:hn.styleSpec}))}function rn(hn,Sn){const xn=Dr(hn.value),Nn=Xa(hn.value),Gn=hn.value!==null?hn.value:Sn;if(pe){if(xn!==pe)return[new Me(hn.key,Gn,`${xn} stop domain type must match previous stop domain type ${pe}`)]}else pe=xn;if(xn!=="number"&&xn!=="string"&&xn!=="boolean")return[new Me(hn.key,Gn,"stop domain value must be a number, string, or boolean")];if(xn!=="number"&&ne!=="categorical"){let wr=`number expected, ${xn} found`;return Hl(U)&&ne===void 0&&(wr+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Me(hn.key,Gn,wr)]}return ne!=="categorical"||xn!=="number"||isFinite(Nn)&&Math.floor(Nn)===Nn?ne!=="categorical"&&xn==="number"&&ze!==void 0&&Nnnew Me(`${Y.key}${pe.key}`,Y.value,pe.message));const ne=U.value.expression||U.value._styleExpression.expression;if(Y.expressionContext==="property"&&Y.propertyKey==="text-font"&&!ne.outputDefined())return[new Me(Y.key,Y.value,`Invalid data expression for "${Y.propertyKey}". Output values must be contained as literals within the expression.`)];if(Y.expressionContext==="property"&&Y.propertyType==="layout"&&!nc(ne))return[new Me(Y.key,Y.value,'"feature-state" data expressions are not supported with layout properties.')];if(Y.expressionContext==="filter"&&!nc(ne))return[new Me(Y.key,Y.value,'"feature-state" data expressions are not supported with filters.')];if(Y.expressionContext&&Y.expressionContext.indexOf("cluster")===0){if(!rc(ne,["zoom","feature-state"]))return[new Me(Y.key,Y.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(Y.expressionContext==="cluster-initial"&&!tc(ne))return[new Me(Y.key,Y.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rl(Y){const U=Y.key,ne=Y.value,pe=Y.valueSpec,ze=[];return Array.isArray(pe.values)?pe.values.indexOf(Xa(ne))===-1&&ze.push(new Me(U,ne,`expected one of [${pe.values.join(", ")}], ${JSON.stringify(ne)} found`)):Object.keys(pe.values).indexOf(Xa(ne))===-1&&ze.push(new Me(U,ne,`expected one of [${Object.keys(pe.values).join(", ")}], ${JSON.stringify(ne)} found`)),ze}function xs(Y){return Ts(Co(Y.value))?cs(ke({},Y,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Zl(Y)}function Zl(Y){const U=Y.value,ne=Y.key;if(Dr(U)!=="array")return[new Me(ne,U,`array expected, ${Dr(U)} found`)];const pe=Y.styleSpec;let ze,Ze=[];if(U.length<1)return[new Me(ne,U,"filter array must have at least 1 element")];switch(Ze=Ze.concat(rl({key:`${ne}[0]`,value:U[0],valueSpec:pe.filter_operator,style:Y.style,styleSpec:Y.styleSpec})),Xa(U[0])){case"<":case"<=":case">":case">=":U.length>=2&&Xa(U[1])==="$type"&&Ze.push(new Me(ne,U,`"$type" cannot be use with operator "${U[0]}"`));case"==":case"!=":U.length!==3&&Ze.push(new Me(ne,U,`filter array for operator "${U[0]}" must have 3 elements`));case"in":case"!in":U.length>=2&&(ze=Dr(U[1]),ze!=="string"&&Ze.push(new Me(`${ne}[1]`,U[1],`string expected, ${ze} found`)));for(let Je=2;Je{zt in ne&&U.push(new Me(pe,ne[zt],`"${zt}" is prohibited for ref layers`))}),ze.layers.forEach(zt=>{Xa(zt.id)===ht&&(mt=zt)}),mt?mt.ref?U.push(new Me(pe,ne.ref,"ref cannot reference another ref layer")):Je=Xa(mt.type):U.push(new Me(pe,ne.ref,`ref layer "${ht}" not found`))}else if(Je!=="background")if(ne.source){const mt=ze.sources&&ze.sources[ne.source],zt=mt&&Xa(mt.type);mt?zt==="vector"&&Je==="raster"?U.push(new Me(pe,ne.source,`layer "${ne.id}" requires a raster source`)):zt!=="raster-dem"&&Je==="hillshade"?U.push(new Me(pe,ne.source,`layer "${ne.id}" requires a raster-dem source`)):zt==="raster"&&Je!=="raster"?U.push(new Me(pe,ne.source,`layer "${ne.id}" requires a vector source`)):zt!=="vector"||ne["source-layer"]?zt==="raster-dem"&&Je!=="hillshade"?U.push(new Me(pe,ne.source,"raster-dem source can only be used with layer type 'hillshade'.")):Je!=="line"||!ne.paint||!ne.paint["line-gradient"]||zt==="geojson"&&mt.lineMetrics||U.push(new Me(pe,ne,`layer "${ne.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):U.push(new Me(pe,ne,`layer "${ne.id}" must specify a "source-layer"`)):U.push(new Me(pe,ne.source,`source "${ne.source}" not found`))}else U.push(new Me(pe,ne,'missing required property "source"'));return U=U.concat(ka({key:pe,value:ne,valueSpec:Ze.layer,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,objectElementValidators:{"*"(){return[]},type(){return Y.validateSpec({key:`${pe}.type`,value:ne.type,valueSpec:Ze.layer.type,style:Y.style,styleSpec:Y.styleSpec,validateSpec:Y.validateSpec,object:ne,objectKey:"type"})},filter:xs,layout(mt){return ka({layer:ne,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*"(zt){return ru(ke({layerType:Je},zt))}}})},paint(mt){return ka({layer:ne,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*"(zt){return yu(ke({layerType:Je},zt))}}})}}})),U}function Sa(Y){const U=Y.value,ne=Y.key,pe=Dr(U);return pe!=="string"?[new Me(ne,U,`string expected, ${pe} found`)]:[]}const ua={promoteId:function({key:Y,value:U}){if(Dr(U)==="string")return Sa({key:Y,value:U});{const ne=[];for(const pe in U)ne.push(...Sa({key:`${Y}.${pe}`,value:U[pe]}));return ne}}};function kl(Y){const U=Y.value,ne=Y.key,pe=Y.styleSpec,ze=Y.style,Ze=Y.validateSpec;if(!U.type)return[new Me(ne,U,'"type" is required')];const Je=Xa(U.type);let ht;switch(Je){case"vector":case"raster":return ht=ka({key:ne,value:U,valueSpec:pe[`source_${Je.replace("-","_")}`],style:Y.style,styleSpec:pe,objectElementValidators:ua,validateSpec:Ze}),ht;case"raster-dem":return ht=function(mt){var zt;const Nt=(zt=mt.sourceName)!==null&&zt!==void 0?zt:"",Xt=mt.value,rn=mt.styleSpec,hn=rn.source_raster_dem,Sn=mt.style;let xn=[];const Nn=Dr(Xt);if(Xt===void 0)return xn;if(Nn!=="object")return xn.push(new Me("source_raster_dem",Xt,`object expected, ${Nn} found`)),xn;const Gn=Xa(Xt.encoding)==="custom",wr=["redFactor","greenFactor","blueFactor","baseShift"],or=mt.value.encoding?`"${mt.value.encoding}"`:"Default";for(const gr in Xt)!Gn&&wr.includes(gr)?xn.push(new Me(gr,Xt[gr],`In "${Nt}": "${gr}" is only valid when "encoding" is set to "custom". ${or} encoding found`)):hn[gr]?xn=xn.concat(mt.validateSpec({key:gr,value:Xt[gr],valueSpec:hn[gr],validateSpec:mt.validateSpec,style:Sn,styleSpec:rn})):xn.push(new Me(gr,Xt[gr],`unknown property "${gr}"`));return xn}({sourceName:ne,value:U,style:Y.style,styleSpec:pe,validateSpec:Ze}),ht;case"geojson":if(ht=ka({key:ne,value:U,valueSpec:pe.source_geojson,style:ze,styleSpec:pe,validateSpec:Ze,objectElementValidators:ua}),U.cluster)for(const mt in U.clusterProperties){const[zt,Nt]=U.clusterProperties[mt],Xt=typeof zt=="string"?[zt,["accumulated"],["get",mt]]:zt;ht.push(...cs({key:`${ne}.${mt}.map`,value:Nt,validateSpec:Ze,expressionContext:"cluster-map"})),ht.push(...cs({key:`${ne}.${mt}.reduce`,value:Xt,validateSpec:Ze,expressionContext:"cluster-reduce"}))}return ht;case"video":return ka({key:ne,value:U,valueSpec:pe.source_video,style:ze,validateSpec:Ze,styleSpec:pe});case"image":return ka({key:ne,value:U,valueSpec:pe.source_image,style:ze,validateSpec:Ze,styleSpec:pe});case"canvas":return[new Me(ne,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rl({key:`${ne}.type`,value:U.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:ze,validateSpec:Ze,styleSpec:pe})}}function Mi(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.light,ze=Y.style;let Ze=[];const Je=Dr(U);if(U===void 0)return Ze;if(Je!=="object")return Ze=Ze.concat([new Me("light",U,`object expected, ${Je} found`)]),Ze;for(const ht in U){const mt=ht.match(/^(.*)-transition$/);Ze=mt&&pe[mt[1]]&&pe[mt[1]].transition?Ze.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:ne.transition,validateSpec:Y.validateSpec,style:ze,styleSpec:ne})):pe[ht]?Ze.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],validateSpec:Y.validateSpec,style:ze,styleSpec:ne})):Ze.concat([new Me(ht,U[ht],`unknown property "${ht}"`)])}return Ze}function Hu(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.sky,ze=Y.style,Ze=Dr(U);if(U===void 0)return[];if(Ze!=="object")return[new Me("sky",U,`object expected, ${Ze} found`)];let Je=[];for(const ht in U)Je=pe[ht]?Je.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],style:ze,styleSpec:ne})):Je.concat([new Me(ht,U[ht],`unknown property "${ht}"`)]);return Je}function Ac(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.terrain,ze=Y.style;let Ze=[];const Je=Dr(U);if(U===void 0)return Ze;if(Je!=="object")return Ze=Ze.concat([new Me("terrain",U,`object expected, ${Je} found`)]),Ze;for(const ht in U)Ze=pe[ht]?Ze.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],validateSpec:Y.validateSpec,style:ze,styleSpec:ne})):Ze.concat([new Me(ht,U[ht],`unknown property "${ht}"`)]);return Ze}function Al(Y){let U=[];const ne=Y.value,pe=Y.key;if(Array.isArray(ne)){const ze=[],Ze=[];for(const Je in ne){ne[Je].id&&ze.includes(ne[Je].id)&&U.push(new Me(pe,ne,`all the sprites' ids must be unique, but ${ne[Je].id} is duplicated`)),ze.push(ne[Je].id),ne[Je].url&&Ze.includes(ne[Je].url)&&U.push(new Me(pe,ne,`all the sprites' URLs must be unique, but ${ne[Je].url} is duplicated`)),Ze.push(ne[Je].url);const ht={id:{type:"string",required:!0},url:{type:"string",required:!0}};U=U.concat(ka({key:`${pe}[${Je}]`,value:ne[Je],valueSpec:ht,validateSpec:Y.validateSpec}))}return U}return Sa({key:pe,value:ne})}const il={"*"(){return[]},array:Ao,boolean:function(Y){const U=Y.value,ne=Y.key,pe=Dr(U);return pe!=="boolean"?[new Me(ne,U,`boolean expected, ${pe} found`)]:[]},number:Va,color:function(Y){const U=Y.key,ne=Y.value,pe=Dr(ne);return pe!=="string"?[new Me(U,ne,`color expected, ${pe} found`)]:un.parse(String(ne))?[]:[new Me(U,ne,`color expected, "${ne}" found`)]},constants:Xo,enum:rl,filter:xs,function:Ko,layer:Tl,object:ka,source:kl,light:Mi,sky:Hu,terrain:Ac,projection:function(Y){const U=Y.value,ne=Y.styleSpec,pe=ne.projection,ze=Y.style,Ze=Dr(U);if(U===void 0)return[];if(Ze!=="object")return[new Me("projection",U,`object expected, ${Ze} found`)];let Je=[];for(const ht in U)Je=pe[ht]?Je.concat(Y.validateSpec({key:ht,value:U[ht],valueSpec:pe[ht],style:ze,styleSpec:ne})):Je.concat([new Me(ht,U[ht],`unknown property "${ht}"`)]);return Je},string:Sa,formatted:function(Y){return Sa(Y).length===0?[]:cs(Y)},resolvedImage:function(Y){return Sa(Y).length===0?[]:cs(Y)},padding:function(Y){const U=Y.key,ne=Y.value;if(Dr(ne)==="array"){if(ne.length<1||ne.length>4)return[new Me(U,ne,`padding requires 1 to 4 values; ${ne.length} values found`)];const pe={type:"number"};let ze=[];for(let Ze=0;ZeU.line-ne.line)}function Na(Y){return function(...U){return al(Y.apply(this,U))}}li.source=Na(hs(kl)),li.sprite=Na(hs(Al)),li.glyphs=Na(hs(Ml)),li.light=Na(hs(Mi)),li.sky=Na(hs(Hu)),li.terrain=Na(hs(Ac)),li.layer=Na(hs(Tl)),li.filter=Na(hs(xs)),li.paintProperty=Na(hs(yu)),li.layoutProperty=Na(hs(ru));const Ns=li;Ns.source;const iu=Ns.light,El=Ns.sky;Ns.terrain,Ns.filter;const ks=Ns.paintProperty,au=Ns.layoutProperty;function As(Y,U){let ne=!1;if(U&&U.length)for(const pe of U)Y.fire(new ge(new Error(pe.message))),ne=!0;return ne}class Jo{constructor(U,ne,pe){const ze=this.cells=[];if(U instanceof ArrayBuffer){this.arrayBuffer=U;const Je=new Int32Array(this.arrayBuffer);U=Je[0],ne=Je[1],pe=Je[2],this.d=ne+2*pe;for(let zt=0;zt=Xt[Sn+0]&&ze>=Xt[Sn+1])?(ht[hn]=!0,Je.push(Nt[hn])):ht[hn]=!1}}}}_forEachCell(U,ne,pe,ze,Ze,Je,ht,mt){const zt=this._convertToCellCoord(U),Nt=this._convertToCellCoord(ne),Xt=this._convertToCellCoord(pe),rn=this._convertToCellCoord(ze);for(let hn=zt;hn<=Xt;hn++)for(let Sn=Nt;Sn<=rn;Sn++){const xn=this.d*Sn+hn;if((!mt||mt(this._convertFromCellCoord(hn),this._convertFromCellCoord(Sn),this._convertFromCellCoord(hn+1),this._convertFromCellCoord(Sn+1)))&&Ze.call(this,U,ne,pe,ze,xn,Je,ht,mt))return}}_convertFromCellCoord(U){return(U-this.padding)/this.scale}_convertToCellCoord(U){return Math.max(0,Math.min(this.d-1,Math.floor(U*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const U=this.cells,ne=3+this.cells.length+1+1;let pe=0;for(let Je=0;Je=0)continue;const Je=Y[Ze];ze[Ze]=ol[ne].shallow.indexOf(Ze)>=0?Je:ta(Je,U)}Y instanceof Error&&(ze.message=Y.message)}if(ze.$name)throw new Error("$name property is reserved for worker serialization logic.");return ne!=="Object"&&(ze.$name=ne),ze}function Qo(Y){if(io(Y))return Y;if(Array.isArray(Y))return Y.map(Qo);if(typeof Y!="object")throw new Error("can't deserialize object of type "+typeof Y);const U=So(Y)||"Object";if(!ol[U])throw new Error(`can't deserialize unregistered class ${U}`);const{klass:ne}=ol[U];if(!ne)throw new Error(`can't deserialize unregistered class ${U}`);if(ne.deserialize)return ne.deserialize(Y);const pe=Object.create(ne.prototype);for(const ze of Object.keys(Y)){if(ze==="$name")continue;const Ze=Y[ze];pe[ze]=ol[U].shallow.indexOf(ze)>=0?Ze:Qo(Ze)}return pe}class ac{constructor(){this.first=!0}update(U,ne){const pe=Math.floor(U);return this.first?(this.first=!1,this.lastIntegerZoom=pe,this.lastIntegerZoomTime=0,this.lastZoom=U,this.lastFloorZoom=pe,!0):(this.lastFloorZoom>pe?(this.lastIntegerZoom=pe+1,this.lastIntegerZoomTime=ne):this.lastFloorZoomY>=128&&Y<=255,Arabic:Y=>Y>=1536&&Y<=1791,"Arabic Supplement":Y=>Y>=1872&&Y<=1919,"Arabic Extended-A":Y=>Y>=2208&&Y<=2303,"Hangul Jamo":Y=>Y>=4352&&Y<=4607,"Unified Canadian Aboriginal Syllabics":Y=>Y>=5120&&Y<=5759,Khmer:Y=>Y>=6016&&Y<=6143,"Unified Canadian Aboriginal Syllabics Extended":Y=>Y>=6320&&Y<=6399,"General Punctuation":Y=>Y>=8192&&Y<=8303,"Letterlike Symbols":Y=>Y>=8448&&Y<=8527,"Number Forms":Y=>Y>=8528&&Y<=8591,"Miscellaneous Technical":Y=>Y>=8960&&Y<=9215,"Control Pictures":Y=>Y>=9216&&Y<=9279,"Optical Character Recognition":Y=>Y>=9280&&Y<=9311,"Enclosed Alphanumerics":Y=>Y>=9312&&Y<=9471,"Geometric Shapes":Y=>Y>=9632&&Y<=9727,"Miscellaneous Symbols":Y=>Y>=9728&&Y<=9983,"Miscellaneous Symbols and Arrows":Y=>Y>=11008&&Y<=11263,"CJK Radicals Supplement":Y=>Y>=11904&&Y<=12031,"Kangxi Radicals":Y=>Y>=12032&&Y<=12255,"Ideographic Description Characters":Y=>Y>=12272&&Y<=12287,"CJK Symbols and Punctuation":Y=>Y>=12288&&Y<=12351,Hiragana:Y=>Y>=12352&&Y<=12447,Katakana:Y=>Y>=12448&&Y<=12543,Bopomofo:Y=>Y>=12544&&Y<=12591,"Hangul Compatibility Jamo":Y=>Y>=12592&&Y<=12687,Kanbun:Y=>Y>=12688&&Y<=12703,"Bopomofo Extended":Y=>Y>=12704&&Y<=12735,"CJK Strokes":Y=>Y>=12736&&Y<=12783,"Katakana Phonetic Extensions":Y=>Y>=12784&&Y<=12799,"Enclosed CJK Letters and Months":Y=>Y>=12800&&Y<=13055,"CJK Compatibility":Y=>Y>=13056&&Y<=13311,"CJK Unified Ideographs Extension A":Y=>Y>=13312&&Y<=19903,"Yijing Hexagram Symbols":Y=>Y>=19904&&Y<=19967,"CJK Unified Ideographs":Y=>Y>=19968&&Y<=40959,"Yi Syllables":Y=>Y>=40960&&Y<=42127,"Yi Radicals":Y=>Y>=42128&&Y<=42191,"Hangul Jamo Extended-A":Y=>Y>=43360&&Y<=43391,"Hangul Syllables":Y=>Y>=44032&&Y<=55215,"Hangul Jamo Extended-B":Y=>Y>=55216&&Y<=55295,"Private Use Area":Y=>Y>=57344&&Y<=63743,"CJK Compatibility Ideographs":Y=>Y>=63744&&Y<=64255,"Arabic Presentation Forms-A":Y=>Y>=64336&&Y<=65023,"Vertical Forms":Y=>Y>=65040&&Y<=65055,"CJK Compatibility Forms":Y=>Y>=65072&&Y<=65103,"Small Form Variants":Y=>Y>=65104&&Y<=65135,"Arabic Presentation Forms-B":Y=>Y>=65136&&Y<=65279,"Halfwidth and Fullwidth Forms":Y=>Y>=65280&&Y<=65519};function Io(Y){for(const U of Y)if(sl(U.charCodeAt(0)))return!0;return!1}function za(Y){for(const U of Y)if(!xu(U.charCodeAt(0)))return!1;return!0}function xu(Y){return!(yi.Arabic(Y)||yi["Arabic Supplement"](Y)||yi["Arabic Extended-A"](Y)||yi["Arabic Presentation Forms-A"](Y)||yi["Arabic Presentation Forms-B"](Y))}function sl(Y){return!(Y!==746&&Y!==747&&(Y<4352||!(yi["Bopomofo Extended"](Y)||yi.Bopomofo(Y)||yi["CJK Compatibility Forms"](Y)&&!(Y>=65097&&Y<=65103)||yi["CJK Compatibility Ideographs"](Y)||yi["CJK Compatibility"](Y)||yi["CJK Radicals Supplement"](Y)||yi["CJK Strokes"](Y)||!(!yi["CJK Symbols and Punctuation"](Y)||Y>=12296&&Y<=12305||Y>=12308&&Y<=12319||Y===12336)||yi["CJK Unified Ideographs Extension A"](Y)||yi["CJK Unified Ideographs"](Y)||yi["Enclosed CJK Letters and Months"](Y)||yi["Hangul Compatibility Jamo"](Y)||yi["Hangul Jamo Extended-A"](Y)||yi["Hangul Jamo Extended-B"](Y)||yi["Hangul Jamo"](Y)||yi["Hangul Syllables"](Y)||yi.Hiragana(Y)||yi["Ideographic Description Characters"](Y)||yi.Kanbun(Y)||yi["Kangxi Radicals"](Y)||yi["Katakana Phonetic Extensions"](Y)||yi.Katakana(Y)&&Y!==12540||!(!yi["Halfwidth and Fullwidth Forms"](Y)||Y===65288||Y===65289||Y===65293||Y>=65306&&Y<=65310||Y===65339||Y===65341||Y===65343||Y>=65371&&Y<=65503||Y===65507||Y>=65512&&Y<=65519)||!(!yi["Small Form Variants"](Y)||Y>=65112&&Y<=65118||Y>=65123&&Y<=65126)||yi["Unified Canadian Aboriginal Syllabics"](Y)||yi["Unified Canadian Aboriginal Syllabics Extended"](Y)||yi["Vertical Forms"](Y)||yi["Yijing Hexagram Symbols"](Y)||yi["Yi Syllables"](Y)||yi["Yi Radicals"](Y))))}function $l(Y){return!(sl(Y)||function(U){return!!(yi["Latin-1 Supplement"](U)&&(U===167||U===169||U===174||U===177||U===188||U===189||U===190||U===215||U===247)||yi["General Punctuation"](U)&&(U===8214||U===8224||U===8225||U===8240||U===8241||U===8251||U===8252||U===8258||U===8263||U===8264||U===8265||U===8273)||yi["Letterlike Symbols"](U)||yi["Number Forms"](U)||yi["Miscellaneous Technical"](U)&&(U>=8960&&U<=8967||U>=8972&&U<=8991||U>=8996&&U<=9e3||U===9003||U>=9085&&U<=9114||U>=9150&&U<=9165||U===9167||U>=9169&&U<=9179||U>=9186&&U<=9215)||yi["Control Pictures"](U)&&U!==9251||yi["Optical Character Recognition"](U)||yi["Enclosed Alphanumerics"](U)||yi["Geometric Shapes"](U)||yi["Miscellaneous Symbols"](U)&&!(U>=9754&&U<=9759)||yi["Miscellaneous Symbols and Arrows"](U)&&(U>=11026&&U<=11055||U>=11088&&U<=11097||U>=11192&&U<=11243)||yi["CJK Symbols and Punctuation"](U)||yi.Katakana(U)||yi["Private Use Area"](U)||yi["CJK Compatibility Forms"](U)||yi["Small Form Variants"](U)||yi["Halfwidth and Fullwidth Forms"](U)||U===8734||U===8756||U===8757||U>=9984&&U<=10087||U>=10102&&U<=10131||U===65532||U===65533)}(Y))}function dc(Y){return yi.Arabic(Y)||yi["Arabic Supplement"](Y)||yi["Arabic Extended-A"](Y)||yi["Arabic Presentation Forms-A"](Y)||yi["Arabic Presentation Forms-B"](Y)}function $s(Y){return Y>=1424&&Y<=2303||yi["Arabic Presentation Forms-A"](Y)||yi["Arabic Presentation Forms-B"](Y)}function ou(Y,U){return!(!U&&$s(Y)||Y>=2304&&Y<=3583||Y>=3840&&Y<=4255||yi.Khmer(Y))}function eo(Y){for(const U of Y)if($s(U.charCodeAt(0)))return!0;return!1}const Cl=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(Y){this.pluginStatus=Y.pluginStatus,this.pluginURL=Y.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(Y){this.applyArabicShaping=Y.applyArabicShaping,this.processBidirectionalText=Y.processBidirectionalText,this.processStyledBidirectionalText=Y.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class di{constructor(U,ne){this.zoom=U,ne?(this.now=ne.now,this.fadeDuration=ne.fadeDuration,this.zoomHistory=ne.zoomHistory,this.transition=ne.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ac,this.transition={})}isSupportedScript(U){return function(ne,pe){for(const ze of ne)if(!ou(ze.charCodeAt(0),pe))return!1;return!0}(U,Cl.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const U=this.zoom,ne=U-Math.floor(U),pe=this.crossFadingFactor();return U>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:ne+(1-ne)*pe}:{fromScale:.5,toScale:1,t:1-(1-pe)*ne}}}class Fi{constructor(U,ne){this.property=U,this.value=ne,this.expression=function(pe,ze){if(Zr(pe))return new ba(pe,ze);if(Ws(pe)){const Ze=La(pe,ze);if(Ze.result==="error")throw new Error(Ze.value.map(Je=>`${Je.key}: ${Je.message}`).join(", "));return Ze.value}{let Ze=pe;return ze.type==="color"&&typeof pe=="string"?Ze=un.parse(pe):ze.type!=="padding"||typeof pe!="number"&&!Array.isArray(pe)?ze.type==="variableAnchorOffsetCollection"&&Array.isArray(pe)&&(Ze=Kn.parse(pe)):Ze=mn.parse(pe),{kind:"constant",evaluate:()=>Ze}}}(ne===void 0?U.specification.default:ne,U.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(U,ne,pe){return this.property.possiblyEvaluate(this,U,ne,pe)}}class Mo{constructor(U){this.property=U,this.value=new Fi(U,void 0)}transitioned(U,ne){return new su(this.property,this.value,ne,A({},U.transition,this.transition),U.now)}untransitioned(){return new su(this.property,this.value,null,{},0)}}class Il{constructor(U){this._properties=U,this._values=Object.create(U.defaultTransitionablePropertyValues)}getValue(U){return p(this._values[U].value.value)}setValue(U,ne){Object.prototype.hasOwnProperty.call(this._values,U)||(this._values[U]=new Mo(this._values[U].property)),this._values[U].value=new Fi(this._values[U].property,ne===null?void 0:p(ne))}getTransition(U){return p(this._values[U].transition)}setTransition(U,ne){Object.prototype.hasOwnProperty.call(this._values,U)||(this._values[U]=new Mo(this._values[U].property)),this._values[U].transition=p(ne)||void 0}serialize(){const U={};for(const ne of Object.keys(this._values)){const pe=this.getValue(ne);pe!==void 0&&(U[ne]=pe);const ze=this.getTransition(ne);ze!==void 0&&(U[`${ne}-transition`]=ze)}return U}transitioned(U,ne){const pe=new ho(this._properties);for(const ze of Object.keys(this._values))pe._values[ze]=this._values[ze].transitioned(U,ne._values[ze]);return pe}untransitioned(){const U=new ho(this._properties);for(const ne of Object.keys(this._values))U._values[ne]=this._values[ne].untransitioned();return U}}class su{constructor(U,ne,pe,ze,Ze){this.property=U,this.value=ne,this.begin=Ze+ze.delay||0,this.end=this.begin+ze.duration||0,U.specification.transition&&(ze.delay||ze.duration)&&(this.prior=pe)}possiblyEvaluate(U,ne,pe){const ze=U.now||0,Ze=this.value.possiblyEvaluate(U,ne,pe),Je=this.prior;if(Je){if(ze>this.end)return this.prior=null,Ze;if(this.value.isDataDriven())return this.prior=null,Ze;if(ze=1)return 1;const zt=mt*mt,Nt=zt*mt;return 4*(mt<.5?Nt:3*(mt-zt)+Nt-.75)}(ht))}}return Ze}}class ho{constructor(U){this._properties=U,this._values=Object.create(U.defaultTransitioningPropertyValues)}possiblyEvaluate(U,ne,pe){const ze=new Ys(this._properties);for(const Ze of Object.keys(this._values))ze._values[Ze]=this._values[Ze].possiblyEvaluate(U,ne,pe);return ze}hasTransition(){for(const U of Object.keys(this._values))if(this._values[U].prior)return!0;return!1}}class _u{constructor(U){this._properties=U,this._values=Object.create(U.defaultPropertyValues)}hasValue(U){return this._values[U].value!==void 0}getValue(U){return p(this._values[U].value)}setValue(U,ne){this._values[U]=new Fi(this._values[U].property,ne===null?void 0:p(ne))}serialize(){const U={};for(const ne of Object.keys(this._values)){const pe=this.getValue(ne);pe!==void 0&&(U[ne]=pe)}return U}possiblyEvaluate(U,ne,pe){const ze=new Ys(this._properties);for(const Ze of Object.keys(this._values))ze._values[Ze]=this._values[Ze].possiblyEvaluate(U,ne,pe);return ze}}class da{constructor(U,ne,pe){this.property=U,this.value=ne,this.parameters=pe}isConstant(){return this.value.kind==="constant"}constantOr(U){return this.value.kind==="constant"?this.value.value:U}evaluate(U,ne,pe,ze){return this.property.evaluate(this.value,this.parameters,U,ne,pe,ze)}}class Ys{constructor(U){this._properties=U,this._values=Object.create(U.defaultPossiblyEvaluatedValues)}get(U){return this._values[U]}}class Ai{constructor(U){this.specification=U}possiblyEvaluate(U,ne){if(U.isDataDriven())throw new Error("Value should not be data driven");return U.expression.evaluate(ne)}interpolate(U,ne,pe){const ze=this.specification.type,Ze=gn[ze];return Ze?Ze(U,ne,pe):U}}class xi{constructor(U,ne){this.specification=U,this.overrides=ne}possiblyEvaluate(U,ne,pe,ze){return U.expression.kind==="constant"||U.expression.kind==="camera"?new da(this,{kind:"constant",value:U.expression.evaluate(ne,null,{},pe,ze)},ne):new da(this,U.expression,ne)}interpolate(U,ne,pe){if(U.value.kind!=="constant"||ne.value.kind!=="constant")return U;if(U.value.value===void 0||ne.value.value===void 0)return new da(this,{kind:"constant",value:void 0},U.parameters);const ze=this.specification.type,Ze=gn[ze];if(Ze){const Je=Ze(U.value.value,ne.value.value,pe);return new da(this,{kind:"constant",value:Je},U.parameters)}return U}evaluate(U,ne,pe,ze,Ze,Je){return U.kind==="constant"?U.value:U.evaluate(ne,pe,ze,Ze,Je)}}class xa extends xi{possiblyEvaluate(U,ne,pe,ze){if(U.value===void 0)return new da(this,{kind:"constant",value:void 0},ne);if(U.expression.kind==="constant"){const Ze=U.expression.evaluate(ne,null,{},pe,ze),Je=U.property.specification.type==="resolvedImage"&&typeof Ze!="string"?Ze.name:Ze,ht=this._calculate(Je,Je,Je,ne);return new da(this,{kind:"constant",value:ht},ne)}if(U.expression.kind==="camera"){const Ze=this._calculate(U.expression.evaluate({zoom:ne.zoom-1}),U.expression.evaluate({zoom:ne.zoom}),U.expression.evaluate({zoom:ne.zoom+1}),ne);return new da(this,{kind:"constant",value:Ze},ne)}return new da(this,U.expression,ne)}evaluate(U,ne,pe,ze,Ze,Je){if(U.kind==="source"){const ht=U.evaluate(ne,pe,ze,Ze,Je);return this._calculate(ht,ht,ht,ne)}return U.kind==="composite"?this._calculate(U.evaluate({zoom:Math.floor(ne.zoom)-1},pe,ze),U.evaluate({zoom:Math.floor(ne.zoom)},pe,ze),U.evaluate({zoom:Math.floor(ne.zoom)+1},pe,ze),ne):U.value}_calculate(U,ne,pe,ze){return ze.zoom>ze.zoomHistory.lastIntegerZoom?{from:U,to:ne}:{from:pe,to:ne}}interpolate(U){return U}}class es{constructor(U){this.specification=U}possiblyEvaluate(U,ne,pe,ze){if(U.value!==void 0){if(U.expression.kind==="constant"){const Ze=U.expression.evaluate(ne,null,{},pe,ze);return this._calculate(Ze,Ze,Ze,ne)}return this._calculate(U.expression.evaluate(new di(Math.floor(ne.zoom-1),ne)),U.expression.evaluate(new di(Math.floor(ne.zoom),ne)),U.expression.evaluate(new di(Math.floor(ne.zoom+1),ne)),ne)}}_calculate(U,ne,pe,ze){return ze.zoom>ze.zoomHistory.lastIntegerZoom?{from:U,to:ne}:{from:pe,to:ne}}interpolate(U){return U}}class bu{constructor(U){this.specification=U}possiblyEvaluate(U,ne,pe,ze){return!!U.expression.evaluate(ne,null,{},pe,ze)}interpolate(){return!1}}class js{constructor(U){this.properties=U,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const ne in U){const pe=U[ne];pe.specification.overridable&&this.overridableProperties.push(ne);const ze=this.defaultPropertyValues[ne]=new Fi(pe,void 0),Ze=this.defaultTransitionablePropertyValues[ne]=new Mo(pe);this.defaultTransitioningPropertyValues[ne]=Ze.untransitioned(),this.defaultPossiblyEvaluatedValues[ne]=ze.possiblyEvaluate({})}}}cn("DataDrivenProperty",xi),cn("DataConstantProperty",Ai),cn("CrossFadedDataDrivenProperty",xa),cn("CrossFadedProperty",es),cn("ColorRampProperty",bu);const xt="-transition";class Tt extends ye{constructor(U,ne){if(super(),this.id=U.id,this.type=U.type,this._featureFilter={filter:()=>!0,needGeometry:!1},U.type!=="custom"&&(this.metadata=U.metadata,this.minzoom=U.minzoom,this.maxzoom=U.maxzoom,U.type!=="background"&&(this.source=U.source,this.sourceLayer=U["source-layer"],this.filter=U.filter),ne.layout&&(this._unevaluatedLayout=new _u(ne.layout)),ne.paint)){this._transitionablePaint=new Il(ne.paint);for(const pe in U.paint)this.setPaintProperty(pe,U.paint[pe],{validate:!1});for(const pe in U.layout)this.setLayoutProperty(pe,U.layout[pe],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ys(ne.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(U){return U==="visibility"?this.visibility:this._unevaluatedLayout.getValue(U)}setLayoutProperty(U,ne,pe={}){if(ne!=null){const ze=`layers.${this.id}.layout.${U}`;if(this._validate(au,ze,U,ne,pe))return}U!=="visibility"?this._unevaluatedLayout.setValue(U,ne):this.visibility=ne}getPaintProperty(U){return U.endsWith(xt)?this._transitionablePaint.getTransition(U.slice(0,-11)):this._transitionablePaint.getValue(U)}setPaintProperty(U,ne,pe={}){if(ne!=null){const ze=`layers.${this.id}.paint.${U}`;if(this._validate(ks,ze,U,ne,pe))return!1}if(U.endsWith(xt))return this._transitionablePaint.setTransition(U.slice(0,-11),ne||void 0),!1;{const ze=this._transitionablePaint._values[U],Ze=ze.property.specification["property-type"]==="cross-faded-data-driven",Je=ze.value.isDataDriven(),ht=ze.value;this._transitionablePaint.setValue(U,ne),this._handleSpecialPaintPropertyUpdate(U);const mt=this._transitionablePaint._values[U].value;return mt.isDataDriven()||Je||Ze||this._handleOverridablePaintPropertyUpdate(U,ht,mt)}}_handleSpecialPaintPropertyUpdate(U){}_handleOverridablePaintPropertyUpdate(U,ne,pe){return!1}isHidden(U){return!!(this.minzoom&&U=this.maxzoom)||this.visibility==="none"}updateTransitions(U){this._transitioningPaint=this._transitionablePaint.transitioned(U,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(U,ne){U.getCrossfadeParameters&&(this._crossfadeParameters=U.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(U,void 0,ne)),this.paint=this._transitioningPaint.possiblyEvaluate(U,void 0,ne)}serialize(){const U={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&&(U.layout=U.layout||{},U.layout.visibility=this.visibility),T(U,(ne,pe)=>!(ne===void 0||pe==="layout"&&!Object.keys(ne).length||pe==="paint"&&!Object.keys(ne).length))}_validate(U,ne,pe,ze,Ze={}){return(!Ze||Ze.validate!==!1)&&As(this,U.call(Ns,{key:ne,layerType:this.type,objectKey:pe,value:ze,styleSpec:me,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const U in this.paint._values){const ne=this.paint.get(U);if(ne instanceof da&&Hl(ne.property.specification)&&(ne.value.kind==="source"||ne.value.kind==="composite")&&ne.value.isStateDependent)return!0}return!1}}const Dt={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class X{constructor(U,ne){this._structArray=U,this._pos1=ne*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class R{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(U,ne){return U._trim(),ne&&(U.isTransferred=!0,ne.push(U.arrayBuffer)),{length:U.length,arrayBuffer:U.arrayBuffer}}static deserialize(U){const ne=Object.create(this.prototype);return ne.arrayBuffer=U.arrayBuffer,ne.length=U.length,ne.capacity=U.arrayBuffer.byteLength/ne.bytesPerElement,ne._refreshViews(),ne}_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(U){this.reserve(U),this.length=U}reserve(U){if(U>this.capacity){this.capacity=Math.max(U,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const ne=this.uint8;this._refreshViews(),ne&&this.uint8.set(ne)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function i(Y,U=1){let ne=0,pe=0;return{members:Y.map(ze=>{const Ze=(mt=ze.type,Dt[mt].BYTES_PER_ELEMENT),Je=ne=a(ne,Math.max(U,Ze)),ht=ze.components||1;var mt;return pe=Math.max(pe,Ze),ne+=Ze*ht,{name:ze.name,type:ze.type,components:ht,offset:Je}}),size:a(ne,Math.max(pe,U)),alignment:U}}function a(Y,U){return Math.ceil(Y/U)*U}class C extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne){const pe=this.length;return this.resize(pe+1),this.emplace(pe,U,ne)}emplace(U,ne,pe){const ze=2*U;return this.int16[ze+0]=ne,this.int16[ze+1]=pe,U}}C.prototype.bytesPerElement=4,cn("StructArrayLayout2i4",C);class F extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=3*U;return this.int16[Ze+0]=ne,this.int16[Ze+1]=pe,this.int16[Ze+2]=ze,U}}F.prototype.bytesPerElement=6,cn("StructArrayLayout3i6",F);class q extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze){const Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,U,ne,pe,ze)}emplace(U,ne,pe,ze,Ze){const Je=4*U;return this.int16[Je+0]=ne,this.int16[Je+1]=pe,this.int16[Je+2]=ze,this.int16[Je+3]=Ze,U}}q.prototype.bytesPerElement=8,cn("StructArrayLayout4i8",q);class te extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=6*U;return this.int16[mt+0]=ne,this.int16[mt+1]=pe,this.int16[mt+2]=ze,this.int16[mt+3]=Ze,this.int16[mt+4]=Je,this.int16[mt+5]=ht,U}}te.prototype.bytesPerElement=12,cn("StructArrayLayout2i4i12",te);class ue extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=4*U,zt=8*U;return this.int16[mt+0]=ne,this.int16[mt+1]=pe,this.uint8[zt+4]=ze,this.uint8[zt+5]=Ze,this.uint8[zt+6]=Je,this.uint8[zt+7]=ht,U}}ue.prototype.bytesPerElement=8,cn("StructArrayLayout2i4ub8",ue);class ve extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne){const pe=this.length;return this.resize(pe+1),this.emplace(pe,U,ne)}emplace(U,ne,pe){const ze=2*U;return this.float32[ze+0]=ne,this.float32[ze+1]=pe,U}}ve.prototype.bytesPerElement=8,cn("StructArrayLayout2f8",ve);class Ae extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt){const rn=10*U;return this.uint16[rn+0]=ne,this.uint16[rn+1]=pe,this.uint16[rn+2]=ze,this.uint16[rn+3]=Ze,this.uint16[rn+4]=Je,this.uint16[rn+5]=ht,this.uint16[rn+6]=mt,this.uint16[rn+7]=zt,this.uint16[rn+8]=Nt,this.uint16[rn+9]=Xt,U}}Ae.prototype.bytesPerElement=20,cn("StructArrayLayout10ui20",Ae);class Re extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn){const hn=this.length;return this.resize(hn+1),this.emplace(hn,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn){const Sn=12*U;return this.int16[Sn+0]=ne,this.int16[Sn+1]=pe,this.int16[Sn+2]=ze,this.int16[Sn+3]=Ze,this.uint16[Sn+4]=Je,this.uint16[Sn+5]=ht,this.uint16[Sn+6]=mt,this.uint16[Sn+7]=zt,this.int16[Sn+8]=Nt,this.int16[Sn+9]=Xt,this.int16[Sn+10]=rn,this.int16[Sn+11]=hn,U}}Re.prototype.bytesPerElement=24,cn("StructArrayLayout4i4ui4i24",Re);class Ue extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=3*U;return this.float32[Ze+0]=ne,this.float32[Ze+1]=pe,this.float32[Ze+2]=ze,U}}Ue.prototype.bytesPerElement=12,cn("StructArrayLayout3f12",Ue);class it extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(U){const ne=this.length;return this.resize(ne+1),this.emplace(ne,U)}emplace(U,ne){const pe=1*U;return this.uint32[pe+0]=ne,U}}it.prototype.bytesPerElement=4,cn("StructArrayLayout1ul4",it);class ct extends R{_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(U,ne,pe,ze,Ze,Je,ht,mt,zt){const Nt=this.length;return this.resize(Nt+1),this.emplace(Nt,U,ne,pe,ze,Ze,Je,ht,mt,zt)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt){const Xt=10*U,rn=5*U;return this.int16[Xt+0]=ne,this.int16[Xt+1]=pe,this.int16[Xt+2]=ze,this.int16[Xt+3]=Ze,this.int16[Xt+4]=Je,this.int16[Xt+5]=ht,this.uint32[rn+3]=mt,this.uint16[Xt+8]=zt,this.uint16[Xt+9]=Nt,U}}ct.prototype.bytesPerElement=20,cn("StructArrayLayout6i1ul2ui20",ct);class dt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=6*U;return this.int16[mt+0]=ne,this.int16[mt+1]=pe,this.int16[mt+2]=ze,this.int16[mt+3]=Ze,this.int16[mt+4]=Je,this.int16[mt+5]=ht,U}}dt.prototype.bytesPerElement=12,cn("StructArrayLayout2i2i2i12",dt);class bt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze){const Je=this.length;return this.resize(Je+1),this.emplace(Je,U,ne,pe,ze,Ze)}emplace(U,ne,pe,ze,Ze,Je){const ht=4*U,mt=8*U;return this.float32[ht+0]=ne,this.float32[ht+1]=pe,this.float32[ht+2]=ze,this.int16[mt+6]=Ze,this.int16[mt+7]=Je,U}}bt.prototype.bytesPerElement=16,cn("StructArrayLayout2f1f2i16",bt);class Ct extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze,Ze,Je){const ht=this.length;return this.resize(ht+1),this.emplace(ht,U,ne,pe,ze,Ze,Je)}emplace(U,ne,pe,ze,Ze,Je,ht){const mt=16*U,zt=4*U,Nt=8*U;return this.uint8[mt+0]=ne,this.uint8[mt+1]=pe,this.float32[zt+1]=ze,this.float32[zt+2]=Ze,this.int16[Nt+6]=Je,this.int16[Nt+7]=ht,U}}Ct.prototype.bytesPerElement=16,cn("StructArrayLayout2ub2f2i16",Ct);class Mt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=3*U;return this.uint16[Ze+0]=ne,this.uint16[Ze+1]=pe,this.uint16[Ze+2]=ze,U}}Mt.prototype.bytesPerElement=6,cn("StructArrayLayout3ui6",Mt);class Ut extends R{_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(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn,Gn){const wr=this.length;return this.resize(wr+1),this.emplace(wr,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn,Gn)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn,Gn,wr){const or=24*U,gr=12*U,Wr=48*U;return this.int16[or+0]=ne,this.int16[or+1]=pe,this.uint16[or+2]=ze,this.uint16[or+3]=Ze,this.uint32[gr+2]=Je,this.uint32[gr+3]=ht,this.uint32[gr+4]=mt,this.uint16[or+10]=zt,this.uint16[or+11]=Nt,this.uint16[or+12]=Xt,this.float32[gr+7]=rn,this.float32[gr+8]=hn,this.uint8[Wr+36]=Sn,this.uint8[Wr+37]=xn,this.uint8[Wr+38]=Nn,this.uint32[gr+10]=Gn,this.int16[or+22]=wr,U}}Ut.prototype.bytesPerElement=48,cn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ut);class It extends R{_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(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn,Gn,wr,or,gr,Wr,pi,Ci,Vi,ki,ui,Ii,Oi){const Si=this.length;return this.resize(Si+1),this.emplace(Si,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn,Gn,wr,or,gr,Wr,pi,Ci,Vi,ki,ui,Ii,Oi)}emplace(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn,Nn,Gn,wr,or,gr,Wr,pi,Ci,Vi,ki,ui,Ii,Oi,Si){const ti=32*U,Di=16*U;return this.int16[ti+0]=ne,this.int16[ti+1]=pe,this.int16[ti+2]=ze,this.int16[ti+3]=Ze,this.int16[ti+4]=Je,this.int16[ti+5]=ht,this.int16[ti+6]=mt,this.int16[ti+7]=zt,this.uint16[ti+8]=Nt,this.uint16[ti+9]=Xt,this.uint16[ti+10]=rn,this.uint16[ti+11]=hn,this.uint16[ti+12]=Sn,this.uint16[ti+13]=xn,this.uint16[ti+14]=Nn,this.uint16[ti+15]=Gn,this.uint16[ti+16]=wr,this.uint16[ti+17]=or,this.uint16[ti+18]=gr,this.uint16[ti+19]=Wr,this.uint16[ti+20]=pi,this.uint16[ti+21]=Ci,this.uint16[ti+22]=Vi,this.uint32[Di+12]=ki,this.float32[Di+13]=ui,this.float32[Di+14]=Ii,this.uint16[ti+30]=Oi,this.uint16[ti+31]=Si,U}}It.prototype.bytesPerElement=64,cn("StructArrayLayout8i15ui1ul2f2ui64",It);class Qt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U){const ne=this.length;return this.resize(ne+1),this.emplace(ne,U)}emplace(U,ne){const pe=1*U;return this.float32[pe+0]=ne,U}}Qt.prototype.bytesPerElement=4,cn("StructArrayLayout1f4",Qt);class tn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=6*U,Je=3*U;return this.uint16[Ze+0]=ne,this.float32[Je+1]=pe,this.float32[Je+2]=ze,U}}tn.prototype.bytesPerElement=12,cn("StructArrayLayout1ui2f12",tn);class Yt extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne,pe){const ze=this.length;return this.resize(ze+1),this.emplace(ze,U,ne,pe)}emplace(U,ne,pe,ze){const Ze=2*U,Je=4*U;return this.uint32[Ze+0]=ne,this.uint16[Je+2]=pe,this.uint16[Je+3]=ze,U}}Yt.prototype.bytesPerElement=8,cn("StructArrayLayout1ul2ui8",Yt);class vn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U,ne){const pe=this.length;return this.resize(pe+1),this.emplace(pe,U,ne)}emplace(U,ne,pe){const ze=2*U;return this.uint16[ze+0]=ne,this.uint16[ze+1]=pe,U}}vn.prototype.bytesPerElement=4,cn("StructArrayLayout2ui4",vn);class Mn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(U){const ne=this.length;return this.resize(ne+1),this.emplace(ne,U)}emplace(U,ne){const pe=1*U;return this.uint16[pe+0]=ne,U}}Mn.prototype.bytesPerElement=2,cn("StructArrayLayout1ui2",Mn);class Vn extends R{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(U,ne,pe,ze){const Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,U,ne,pe,ze)}emplace(U,ne,pe,ze,Ze){const Je=4*U;return this.float32[Je+0]=ne,this.float32[Je+1]=pe,this.float32[Je+2]=ze,this.float32[Je+3]=Ze,U}}Vn.prototype.bytesPerElement=16,cn("StructArrayLayout4f16",Vn);class Hn extends X{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 u(this.anchorPointX,this.anchorPointY)}}Hn.prototype.size=20;class Xn extends ct{get(U){return new Hn(this,U)}}cn("CollisionBoxArray",Xn);class rr extends X{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(U){this._structArray.uint8[this._pos1+37]=U}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(U){this._structArray.uint8[this._pos1+38]=U}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(U){this._structArray.uint32[this._pos4+10]=U}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}rr.prototype.size=48;class Mr extends Ut{get(U){return new rr(this,U)}}cn("PlacedSymbolArray",Mr);class nr extends X{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(U){this._structArray.uint32[this._pos4+12]=U}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]}}nr.prototype.size=64;class Lr extends It{get(U){return new nr(this,U)}}cn("SymbolInstanceArray",Lr);class dr extends Qt{getoffsetX(U){return this.float32[1*U+0]}}cn("GlyphOffsetArray",dr);class Br extends F{getx(U){return this.int16[3*U+0]}gety(U){return this.int16[3*U+1]}gettileUnitDistanceFromAnchor(U){return this.int16[3*U+2]}}cn("SymbolLineVertexArray",Br);class Sr extends X{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]}}Sr.prototype.size=12;class Vr extends tn{get(U){return new Sr(this,U)}}cn("TextAnchorOffsetArray",Vr);class fi extends X{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]}}fi.prototype.size=8;class Nr extends Yt{get(U){return new fi(this,U)}}cn("FeatureIndexArray",Nr);class si extends C{}class _i extends C{}class Gi extends C{}class Pi extends te{}class Ji extends ue{}class Yi extends ve{}class na extends Ae{}class Ma extends Re{}class go extends Ue{}class uo extends it{}class Go extends dt{}class Da extends Ct{}class ca extends Mt{}class Qa extends vn{}const Ra=i([{name:"a_pos",components:2,type:"Int16"}],4),{members:wa,size:Fa,alignment:qa}=Ra;class fa{constructor(U=[]){this.segments=U}prepareSegment(U,ne,pe,ze){let Ze=this.segments[this.segments.length-1];return U>fa.MAX_VERTEX_ARRAY_LENGTH&&f(`Max vertices per segment is ${fa.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${U}`),(!Ze||Ze.vertexLength+U>fa.MAX_VERTEX_ARRAY_LENGTH||Ze.sortKey!==ze)&&(Ze={vertexOffset:ne.length,primitiveOffset:pe.length,vertexLength:0,primitiveLength:0},ze!==void 0&&(Ze.sortKey=ze),this.segments.push(Ze)),Ze}get(){return this.segments}destroy(){for(const U of this.segments)for(const ne in U.vaos)U.vaos[ne].destroy()}static simpleSegment(U,ne,pe,ze){return new fa([{vertexOffset:U,primitiveOffset:ne,vertexLength:pe,primitiveLength:ze,vaos:{},sortKey:0}])}}function Pl(Y,U){return 256*(Y=g(Math.floor(Y),0,255))+g(Math.floor(U),0,255)}fa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,cn("SegmentVector",fa);const mo=i([{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 Hi={exports:{}},fs={exports:{}};(function(Y){Y.exports=function(U,ne){var pe,ze,Ze,Je,ht,mt,zt,Nt;for(pe=3&U.length,ze=U.length-pe,Ze=ne,ht=3432918353,mt=461845907,Nt=0;Nt>>16)*ht&65535)<<16)&4294967295)<<15|zt>>>17))*mt+(((zt>>>16)*mt&65535)<<16)&4294967295)<<13|Ze>>>19))+((5*(Ze>>>16)&65535)<<16)&4294967295))+((58964+(Je>>>16)&65535)<<16);switch(zt=0,pe){case 3:zt^=(255&U.charCodeAt(Nt+2))<<16;case 2:zt^=(255&U.charCodeAt(Nt+1))<<8;case 1:Ze^=zt=(65535&(zt=(zt=(65535&(zt^=255&U.charCodeAt(Nt)))*ht+(((zt>>>16)*ht&65535)<<16)&4294967295)<<15|zt>>>17))*mt+(((zt>>>16)*mt&65535)<<16)&4294967295}return Ze^=U.length,Ze=2246822507*(65535&(Ze^=Ze>>>16))+((2246822507*(Ze>>>16)&65535)<<16)&4294967295,Ze=3266489909*(65535&(Ze^=Ze>>>13))+((3266489909*(Ze>>>16)&65535)<<16)&4294967295,(Ze^=Ze>>>16)>>>0}})(fs);var Po=fs.exports,ll={exports:{}};(function(Y){Y.exports=function(U,ne){for(var pe,ze=U.length,Ze=ne^ze,Je=0;ze>=4;)pe=1540483477*(65535&(pe=255&U.charCodeAt(Je)|(255&U.charCodeAt(++Je))<<8|(255&U.charCodeAt(++Je))<<16|(255&U.charCodeAt(++Je))<<24))+((1540483477*(pe>>>16)&65535)<<16),Ze=1540483477*(65535&Ze)+((1540483477*(Ze>>>16)&65535)<<16)^(pe=1540483477*(65535&(pe^=pe>>>24))+((1540483477*(pe>>>16)&65535)<<16)),ze-=4,++Je;switch(ze){case 3:Ze^=(255&U.charCodeAt(Je+2))<<16;case 2:Ze^=(255&U.charCodeAt(Je+1))<<8;case 1:Ze=1540483477*(65535&(Ze^=255&U.charCodeAt(Je)))+((1540483477*(Ze>>>16)&65535)<<16)}return Ze=1540483477*(65535&(Ze^=Ze>>>13))+((1540483477*(Ze>>>16)&65535)<<16),(Ze^=Ze>>>15)>>>0}})(ll);var ao=Po,ul=ll.exports;Hi.exports=ao,Hi.exports.murmur3=ao,Hi.exports.murmur2=ul;var Lo=w(Hi.exports);class Bc{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(U,ne,pe,ze){this.ids.push(ef(U)),this.positions.push(ne,pe,ze)}getPositions(U){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const ne=ef(U);let pe=0,ze=this.ids.length-1;for(;pe>1;this.ids[Je]>=ne?ze=Je:pe=Je+1}const Ze=[];for(;this.ids[pe]===ne;){const Je=this.positions[3*pe],ht=this.positions[3*pe+1],mt=this.positions[3*pe+2];Ze.push({index:Je,start:ht,end:mt}),pe++}return Ze}static serialize(U,ne){const pe=new Float64Array(U.ids),ze=new Uint32Array(U.positions);return ga(pe,ze,0,pe.length-1),ne&&ne.push(pe.buffer,ze.buffer),{ids:pe,positions:ze}}static deserialize(U){const ne=new Bc;return ne.ids=U.ids,ne.positions=U.positions,ne.indexed=!0,ne}}function ef(Y){const U=+Y;return!isNaN(U)&&U<=Number.MAX_SAFE_INTEGER?U:Lo(String(Y))}function ga(Y,U,ne,pe){for(;ne>1];let Ze=ne-1,Je=pe+1;for(;;){do Ze++;while(Y[Ze]ze);if(Ze>=Je)break;Ch(Y,Ze,Je),Ch(U,3*Ze,3*Je),Ch(U,3*Ze+1,3*Je+1),Ch(U,3*Ze+2,3*Je+2)}Je-ne`u_${ze}`),this.type=pe}setUniform(U,ne,pe){U.set(pe.constantOr(this.value))}getBinding(U,ne,pe){return this.type==="color"?new tf(U,ne):new Sc(U,ne)}}class Mc{constructor(U,ne){this.uniformNames=ne.map(pe=>`u_${pe}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(U,ne){this.pixelRatioFrom=ne.pixelRatio,this.pixelRatioTo=U.pixelRatio,this.patternFrom=ne.tlbr,this.patternTo=U.tlbr}setUniform(U,ne,pe,ze){const Ze=ze==="u_pattern_to"?this.patternTo:ze==="u_pattern_from"?this.patternFrom:ze==="u_pixel_ratio_to"?this.pixelRatioTo:ze==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Ze&&U.set(Ze)}getBinding(U,ne,pe){return pe.substr(0,9)==="u_pattern"?new gc(U,ne):new Sc(U,ne)}}class mc{constructor(U,ne,pe,ze){this.expression=U,this.type=pe,this.maxValue=0,this.paintVertexAttributes=ne.map(Ze=>({name:`a_${Ze}`,type:"Float32",components:pe==="color"?2:1,offset:0})),this.paintVertexArray=new ze}populatePaintArray(U,ne,pe,ze,Ze){const Je=this.paintVertexArray.length,ht=this.expression.evaluate(new di(0),ne,{},ze,[],Ze);this.paintVertexArray.resize(U),this._setPaintValue(Je,U,ht)}updatePaintArray(U,ne,pe,ze){const Ze=this.expression.evaluate({zoom:0},pe,ze);this._setPaintValue(U,ne,Ze)}_setPaintValue(U,ne,pe){if(this.type==="color"){const ze=Xs(pe);for(let Ze=U;Ze`u_${ht}_t`),this.type=pe,this.useIntegerZoom=ze,this.zoom=Ze,this.maxValue=0,this.paintVertexAttributes=ne.map(ht=>({name:`a_${ht}`,type:"Float32",components:pe==="color"?4:2,offset:0})),this.paintVertexArray=new Je}populatePaintArray(U,ne,pe,ze,Ze){const Je=this.expression.evaluate(new di(this.zoom),ne,{},ze,[],Ze),ht=this.expression.evaluate(new di(this.zoom+1),ne,{},ze,[],Ze),mt=this.paintVertexArray.length;this.paintVertexArray.resize(U),this._setPaintValue(mt,U,Je,ht)}updatePaintArray(U,ne,pe,ze){const Ze=this.expression.evaluate({zoom:this.zoom},pe,ze),Je=this.expression.evaluate({zoom:this.zoom+1},pe,ze);this._setPaintValue(U,ne,Ze,Je)}_setPaintValue(U,ne,pe,ze){if(this.type==="color"){const Ze=Xs(pe),Je=Xs(ze);for(let ht=U;ht`#define HAS_UNIFORM_${ze}`))}return U}getBinderAttributes(){const U=[];for(const ne in this.binders){const pe=this.binders[ne];if(pe instanceof mc||pe instanceof oc)for(let ze=0;ze!0){this.programConfigurations={};for(const ze of U)this.programConfigurations[ze.id]=new vc(ze,ne,pe);this.needsUpload=!1,this._featureMap=new Bc,this._bufferOffset=0}populatePaintArrays(U,ne,pe,ze,Ze,Je){for(const ht in this.programConfigurations)this.programConfigurations[ht].populatePaintArrays(U,ne,ze,Ze,Je);ne.id!==void 0&&this._featureMap.add(ne.id,pe,this._bufferOffset,U),this._bufferOffset=U,this.needsUpload=!0}updatePaintArrays(U,ne,pe,ze){for(const Ze of pe)this.needsUpload=this.programConfigurations[Ze.id].updatePaintArrays(U,this._featureMap,ne,Ze,ze)||this.needsUpload}get(U){return this.programConfigurations[U]}upload(U){if(this.needsUpload){for(const ne in this.programConfigurations)this.programConfigurations[ne].upload(U);this.needsUpload=!1}}destroy(){for(const U in this.programConfigurations)this.programConfigurations[U].destroy()}}function Sp(Y,U){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"]}[Y]||[Y.replace(`${U}-`,"").replace(/-/g,"_")]}function gd(Y,U,ne){const pe={color:{source:ve,composite:Vn},number:{source:Qt,composite:ve}},ze=function(Ze){return{"line-pattern":{source:na,composite:na},"fill-pattern":{source:na,composite:na},"fill-extrusion-pattern":{source:na,composite:na}}[Ze]}(Y);return ze&&ze[ne]||pe[U][ne]}cn("ConstantBinder",Ap),cn("CrossFadedConstantBinder",Mc),cn("SourceExpressionBinder",mc),cn("CrossFadedCompositeBinder",Ih),cn("CompositeExpressionBinder",oc),cn("ProgramConfiguration",vc,{omit:["_buffers"]}),cn("ProgramConfigurationSet",ps);const Ss=8192,Ef=Math.pow(2,14)-1,md=-Ef-1;function eh(Y){const U=Ss/Y.extent,ne=Y.loadGeometry();for(let pe=0;peJe.x+1||mtJe.y+1)&&f("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return ne}function Ph(Y,U){return{type:Y.type,id:Y.id,properties:Y.properties,geometry:U?eh(Y):[]}}function ep(Y,U,ne,pe,ze){Y.emplaceBack(2*U+(pe+1)/2,2*ne+(ze+1)/2)}class th{constructor(U){this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=U.index,this.hasPattern=!1,this.layoutVertexArray=new _i,this.indexArray=new ca,this.segments=new fa,this.programConfigurations=new ps(U.layers,U.zoom),this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){const ze=this.layers[0],Ze=[];let Je=null,ht=!1;ze.type==="circle"&&(Je=ze.layout.get("circle-sort-key"),ht=!Je.isConstant());for(const{feature:mt,id:zt,index:Nt,sourceLayerIndex:Xt}of U){const rn=this.layers[0]._featureFilter.needGeometry,hn=Ph(mt,rn);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),hn,pe))continue;const Sn=ht?Je.evaluate(hn,{},pe):void 0,xn={id:zt,properties:mt.properties,type:mt.type,sourceLayerIndex:Xt,index:Nt,geometry:rn?hn.geometry:eh(mt),patterns:{},sortKey:Sn};Ze.push(xn)}ht&&Ze.sort((mt,zt)=>mt.sortKey-zt.sortKey);for(const mt of Ze){const{geometry:zt,index:Nt,sourceLayerIndex:Xt}=mt,rn=U[Nt].feature;this.addFeature(mt,zt,Nt,pe),ne.featureIndex.insert(rn,zt,Nt,Xt,this.index)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,wa),this.indexBuffer=U.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(U),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(U,ne,pe,ze){for(const Ze of ne)for(const Je of Ze){const ht=Je.x,mt=Je.y;if(ht<0||ht>=Ss||mt<0||mt>=Ss)continue;const zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,U.sortKey),Nt=zt.vertexLength;ep(this.layoutVertexArray,ht,mt,-1,-1),ep(this.layoutVertexArray,ht,mt,1,-1),ep(this.layoutVertexArray,ht,mt,1,1),ep(this.layoutVertexArray,ht,mt,-1,1),this.indexArray.emplaceBack(Nt,Nt+1,Nt+2),this.indexArray.emplaceBack(Nt,Nt+3,Nt+2),zt.vertexLength+=4,zt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,U,pe,{},ze)}}function M0(Y,U){for(let ne=0;ne1){if(nh(Y,U))return!0;for(let pe=0;pe1?Y.distSqr(ne):Y.distSqr(ne.sub(U)._mult(ze)._add(U))}function I0(Y,U){let ne,pe,ze,Ze=!1;for(let Je=0;JeU.y!=ze.y>U.y&&U.x<(ze.x-pe.x)*(U.y-pe.y)/(ze.y-pe.y)+pe.x&&(Ze=!Ze)}return Ze}function Cf(Y,U){let ne=!1;for(let pe=0,ze=Y.length-1;peU.y!=Je.y>U.y&&U.x<(Je.x-Ze.x)*(U.y-Ze.y)/(Je.y-Ze.y)+Ze.x&&(ne=!ne)}return ne}function yv(Y,U,ne){const pe=ne[0],ze=ne[2];if(Y.xze.x&&U.x>ze.x||Y.yze.y&&U.y>ze.y)return!1;const Ze=E(Y,U,ne[0]);return Ze!==E(Y,U,ne[1])||Ze!==E(Y,U,ne[2])||Ze!==E(Y,U,ne[3])}function tp(Y,U,ne){const pe=U.paint.get(Y).value;return pe.kind==="constant"?pe.value:ne.programConfigurations.get(U.id).getMaxValue(Y)}function If(Y){return Math.sqrt(Y[0]*Y[0]+Y[1]*Y[1])}function Iu(Y,U,ne,pe,ze){if(!U[0]&&!U[1])return Y;const Ze=u.convert(U)._mult(ze);ne==="viewport"&&Ze._rotate(-pe);const Je=[];for(let ht=0;htMp(Nn,xn))}(zt,mt),hn=Xt?Nt*ht:Nt;for(const Sn of ze)for(const xn of Sn){const Nn=Xt?xn:Mp(xn,mt);let Gn=hn;const wr=af([],[xn.x,xn.y,0,1],mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Gn*=wr[3]/Je.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Gn*=Je.cameraToCenterDistance/wr[3]),mh(rn,Nn,Gn))return!0}return!1}}function Mp(Y,U){const ne=af([],[Y.x,Y.y,0,1],U);return new u(ne[0]/ne[3],ne[1]/ne[3])}class Ms extends th{}let of;cn("HeatmapBucket",Ms,{omit:["layers"]});var _d={get paint(){return of=of||new js({"heatmap-radius":new xi(me.paint_heatmap["heatmap-radius"]),"heatmap-weight":new xi(me.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ai(me.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bu(me.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ai(me.paint_heatmap["heatmap-opacity"])})}};function Lh(Y,{width:U,height:ne},pe,ze){if(ze){if(ze instanceof Uint8ClampedArray)ze=new Uint8Array(ze.buffer);else if(ze.length!==U*ne*pe)throw new RangeError(`mismatched image size. expected: ${ze.length} but got: ${U*ne*pe}`)}else ze=new Uint8Array(U*ne*pe);return Y.width=U,Y.height=ne,Y.data=ze,Y}function Ep(Y,{width:U,height:ne},pe){if(U===Y.width&&ne===Y.height)return;const ze=Lh({},{width:U,height:ne},pe);sf(Y,ze,{x:0,y:0},{x:0,y:0},{width:Math.min(Y.width,U),height:Math.min(Y.height,ne)},pe),Y.width=U,Y.height=ne,Y.data=ze.data}function sf(Y,U,ne,pe,ze,Ze){if(ze.width===0||ze.height===0)return U;if(ze.width>Y.width||ze.height>Y.height||ne.x>Y.width-ze.width||ne.y>Y.height-ze.height)throw new RangeError("out of range source coordinates for image copy");if(ze.width>U.width||ze.height>U.height||pe.x>U.width-ze.width||pe.y>U.height-ze.height)throw new RangeError("out of range destination coordinates for image copy");const Je=Y.data,ht=U.data;if(Je===ht)throw new Error("srcData equals dstData, so image is already copied");for(let mt=0;mt{U[Y.evaluationKey]=zt;const Nt=Y.expression.evaluate(U);ze.data[ht+mt+0]=Math.floor(255*Nt.r/Nt.a),ze.data[ht+mt+1]=Math.floor(255*Nt.g/Nt.a),ze.data[ht+mt+2]=Math.floor(255*Nt.b/Nt.a),ze.data[ht+mt+3]=Math.floor(255*Nt.a)};if(Y.clips)for(let ht=0,mt=0;ht80*ne){ht=1/0,mt=1/0;let Nt=-1/0,Xt=-1/0;for(let rn=ne;rnNt&&(Nt=hn),Sn>Xt&&(Xt=Sn)}zt=Math.max(Nt-ht,Xt-mt),zt=zt!==0?32767/zt:0}return zf(Ze,Je,ne,ht,mt,zt,0),Je}function Nc(Y,U,ne,pe,ze){let Ze;if(ze===function(Je,ht,mt,zt){let Nt=0;for(let Xt=ht,rn=mt-zt;Xt0)for(let Je=U;Je=U;Je-=pe)Ze=Gg(Je/pe|0,Y[Je],Y[Je+1],Ze);return Ze&&Ad(Ze,Ze.next)&&(Pu(Ze),Ze=Ze.next),Ze}function lu(Y,U){if(!Y)return Y;U||(U=Y);let ne,pe=Y;do if(ne=!1,pe.steiner||!Ad(pe,pe.next)&&ts(pe.prev,pe,pe.next)!==0)pe=pe.next;else{if(Pu(pe),pe=U=pe.prev,pe===pe.next)break;ne=!0}while(ne||pe!==U);return U}function zf(Y,U,ne,pe,ze,Ze,Je){if(!Y)return;!Je&&Ze&&function(mt,zt,Nt,Xt){let rn=mt;do rn.z===0&&(rn.z=Td(rn.x,rn.y,zt,Nt,Xt)),rn.prevZ=rn.prev,rn.nextZ=rn.next,rn=rn.next;while(rn!==mt);rn.prevZ.nextZ=null,rn.prevZ=null,function(hn){let Sn,xn=1;do{let Nn,Gn=hn;hn=null;let wr=null;for(Sn=0;Gn;){Sn++;let or=Gn,gr=0;for(let pi=0;pi0||Wr>0&∨)gr!==0&&(Wr===0||!or||Gn.z<=or.z)?(Nn=Gn,Gn=Gn.nextZ,gr--):(Nn=or,or=or.nextZ,Wr--),wr?wr.nextZ=Nn:hn=Nn,Nn.prevZ=wr,wr=Nn;Gn=or}wr.nextZ=null,xn*=2}while(Sn>1)}(rn)}(Y,pe,ze,Ze);let ht=Y;for(;Y.prev!==Y.next;){const mt=Y.prev,zt=Y.next;if(Ze?wd(Y,pe,ze,Ze):R0(Y))U.push(mt.i,Y.i,zt.i),Pu(Y),Y=zt.next,ht=zt.next;else if((Y=zt)===ht){Je?Je===1?zf(Y=ip(lu(Y),U),U,ne,pe,ze,Ze,2):Je===2&&ma(Y,U,ne,pe,ze,Ze):zf(lu(Y),U,ne,pe,ze,Ze,1);break}}}function R0(Y){const U=Y.prev,ne=Y,pe=Y.next;if(ts(U,ne,pe)>=0)return!1;const ze=U.x,Ze=ne.x,Je=pe.x,ht=U.y,mt=ne.y,zt=pe.y,Nt=zeZe?ze>Je?ze:Je:Ze>Je?Ze:Je,hn=ht>mt?ht>zt?ht:zt:mt>zt?mt:zt;let Sn=pe.next;for(;Sn!==U;){if(Sn.x>=Nt&&Sn.x<=rn&&Sn.y>=Xt&&Sn.y<=hn&&Df(ze,ht,Ze,mt,Je,zt,Sn.x,Sn.y)&&ts(Sn.prev,Sn,Sn.next)>=0)return!1;Sn=Sn.next}return!0}function wd(Y,U,ne,pe){const ze=Y.prev,Ze=Y,Je=Y.next;if(ts(ze,Ze,Je)>=0)return!1;const ht=ze.x,mt=Ze.x,zt=Je.x,Nt=ze.y,Xt=Ze.y,rn=Je.y,hn=htmt?ht>zt?ht:zt:mt>zt?mt:zt,Nn=Nt>Xt?Nt>rn?Nt:rn:Xt>rn?Xt:rn,Gn=Td(hn,Sn,U,ne,pe),wr=Td(xn,Nn,U,ne,pe);let or=Y.prevZ,gr=Y.nextZ;for(;or&&or.z>=Gn&&gr&&gr.z<=wr;){if(or.x>=hn&&or.x<=xn&&or.y>=Sn&&or.y<=Nn&&or!==ze&&or!==Je&&Df(ht,Nt,mt,Xt,zt,rn,or.x,or.y)&&ts(or.prev,or,or.next)>=0||(or=or.prevZ,gr.x>=hn&&gr.x<=xn&&gr.y>=Sn&&gr.y<=Nn&&gr!==ze&&gr!==Je&&Df(ht,Nt,mt,Xt,zt,rn,gr.x,gr.y)&&ts(gr.prev,gr,gr.next)>=0))return!1;gr=gr.nextZ}for(;or&&or.z>=Gn;){if(or.x>=hn&&or.x<=xn&&or.y>=Sn&&or.y<=Nn&&or!==ze&&or!==Je&&Df(ht,Nt,mt,Xt,zt,rn,or.x,or.y)&&ts(or.prev,or,or.next)>=0)return!1;or=or.prevZ}for(;gr&&gr.z<=wr;){if(gr.x>=hn&&gr.x<=xn&&gr.y>=Sn&&gr.y<=Nn&&gr!==ze&&gr!==Je&&Df(ht,Nt,mt,Xt,zt,rn,gr.x,gr.y)&&ts(gr.prev,gr,gr.next)>=0)return!1;gr=gr.nextZ}return!0}function ip(Y,U){let ne=Y;do{const pe=ne.prev,ze=ne.next.next;!Ad(pe,ze)&&Ip(pe,ne,ne.next,ze)&&Pp(pe,ze)&&Pp(ze,pe)&&(U.push(pe.i,ne.i,ze.i),Pu(ne),Pu(ne.next),ne=Y=ze),ne=ne.next}while(ne!==Y);return lu(ne)}function ma(Y,U,ne,pe,ze,Ze){let Je=Y;do{let ht=Je.next.next;for(;ht!==Je.prev;){if(Je.i!==ht.i&&Wu(Je,ht)){let mt=Hg(Je,ht);return Je=lu(Je,Je.next),mt=lu(mt,mt.next),zf(Je,U,ne,pe,ze,Ze,0),void zf(mt,U,ne,pe,ze,Ze,0)}ht=ht.next}Je=Je.next}while(Je!==Y)}function Dh(Y,U){return Y.x-U.x}function F0(Y,U){const ne=function(ze,Ze){let Je=Ze;const ht=ze.x,mt=ze.y;let zt,Nt=-1/0;do{if(mt<=Je.y&&mt>=Je.next.y&&Je.next.y!==Je.y){const xn=Je.x+(mt-Je.y)*(Je.next.x-Je.x)/(Je.next.y-Je.y);if(xn<=ht&&xn>Nt&&(Nt=xn,zt=Je.x=Je.x&&Je.x>=rn&&ht!==Je.x&&Df(mtzt.x||Je.x===zt.x&&Of(zt,Je)))&&(zt=Je,Sn=xn)}Je=Je.next}while(Je!==Xt);return zt}(Y,U);if(!ne)return U;const pe=Hg(ne,Y);return lu(pe,pe.next),lu(ne,ne.next)}function Of(Y,U){return ts(Y.prev,Y,U.prev)<0&&ts(U.next,Y,Y.next)<0}function Td(Y,U,ne,pe,ze){return(Y=1431655765&((Y=858993459&((Y=252645135&((Y=16711935&((Y=(Y-ne)*ze|0)|Y<<8))|Y<<4))|Y<<2))|Y<<1))|(U=1431655765&((U=858993459&((U=252645135&((U=16711935&((U=(U-pe)*ze|0)|U<<8))|U<<4))|U<<2))|U<<1))<<1}function kd(Y){let U=Y,ne=Y;do(U.x=(Y-Je)*(Ze-ht)&&(Y-Je)*(pe-ht)>=(ne-Je)*(U-ht)&&(ne-Je)*(Ze-ht)>=(ze-Je)*(pe-ht)}function Wu(Y,U){return Y.next.i!==U.i&&Y.prev.i!==U.i&&!function(ne,pe){let ze=ne;do{if(ze.i!==ne.i&&ze.next.i!==ne.i&&ze.i!==pe.i&&ze.next.i!==pe.i&&Ip(ze,ze.next,ne,pe))return!0;ze=ze.next}while(ze!==ne);return!1}(Y,U)&&(Pp(Y,U)&&Pp(U,Y)&&function(ne,pe){let ze=ne,Ze=!1;const Je=(ne.x+pe.x)/2,ht=(ne.y+pe.y)/2;do ze.y>ht!=ze.next.y>ht&&ze.next.y!==ze.y&&Je<(ze.next.x-ze.x)*(ht-ze.y)/(ze.next.y-ze.y)+ze.x&&(Ze=!Ze),ze=ze.next;while(ze!==ne);return Ze}(Y,U)&&(ts(Y.prev,Y,U.prev)||ts(Y,U.prev,U))||Ad(Y,U)&&ts(Y.prev,Y,Y.next)>0&&ts(U.prev,U,U.next)>0)}function ts(Y,U,ne){return(U.y-Y.y)*(ne.x-U.x)-(U.x-Y.x)*(ne.y-U.y)}function Ad(Y,U){return Y.x===U.x&&Y.y===U.y}function Ip(Y,U,ne,pe){const ze=lc(ts(Y,U,ne)),Ze=lc(ts(Y,U,pe)),Je=lc(ts(ne,pe,Y)),ht=lc(ts(ne,pe,U));return ze!==Ze&&Je!==ht||!(ze!==0||!uf(Y,ne,U))||!(Ze!==0||!uf(Y,pe,U))||!(Je!==0||!uf(ne,Y,pe))||!(ht!==0||!uf(ne,U,pe))}function uf(Y,U,ne){return U.x<=Math.max(Y.x,ne.x)&&U.x>=Math.min(Y.x,ne.x)&&U.y<=Math.max(Y.y,ne.y)&&U.y>=Math.min(Y.y,ne.y)}function lc(Y){return Y>0?1:Y<0?-1:0}function Pp(Y,U){return ts(Y.prev,Y,Y.next)<0?ts(Y,U,Y.next)>=0&&ts(Y,Y.prev,U)>=0:ts(Y,U,Y.prev)<0||ts(Y,Y.next,U)<0}function Hg(Y,U){const ne=wu(Y.i,Y.x,Y.y),pe=wu(U.i,U.x,U.y),ze=Y.next,Ze=U.prev;return Y.next=U,U.prev=Y,ne.next=ze,ze.prev=ne,pe.next=ne,ne.prev=pe,Ze.next=pe,pe.prev=Ze,pe}function Gg(Y,U,ne,pe){const ze=wu(Y,U,ne);return pe?(ze.next=pe.next,ze.prev=pe,pe.next.prev=ze,pe.next=ze):(ze.prev=ze,ze.next=ze),ze}function Pu(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function wu(Y,U,ne){return{i:Y,x:U,y:ne,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Lp(Y,U,ne){const pe=ne.patternDependencies;let ze=!1;for(const Ze of U){const Je=Ze.paint.get(`${Y}-pattern`);Je.isConstant()||(ze=!0);const ht=Je.constantOr(null);ht&&(ze=!0,pe[ht.to]=!0,pe[ht.from]=!0)}return ze}function B0(Y,U,ne,pe,ze){const Ze=ze.patternDependencies;for(const Je of U){const ht=Je.paint.get(`${Y}-pattern`).value;if(ht.kind!=="constant"){let mt=ht.evaluate({zoom:pe-1},ne,{},ze.availableImages),zt=ht.evaluate({zoom:pe},ne,{},ze.availableImages),Nt=ht.evaluate({zoom:pe+1},ne,{},ze.availableImages);mt=mt&&mt.name?mt.name:mt,zt=zt&&zt.name?zt.name:zt,Nt=Nt&&Nt.name?Nt.name:Nt,Ze[mt]=!0,Ze[zt]=!0,Ze[Nt]=!0,ne.patterns[Je.id]={min:mt,mid:zt,max:Nt}}}return ne}class zp{constructor(U){this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=U.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Gi,this.indexArray=new ca,this.indexArray2=new Qa,this.programConfigurations=new ps(U.layers,U.zoom),this.segments=new fa,this.segments2=new fa,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){this.hasPattern=Lp("fill",this.layers,ne);const ze=this.layers[0].layout.get("fill-sort-key"),Ze=!ze.isConstant(),Je=[];for(const{feature:ht,id:mt,index:zt,sourceLayerIndex:Nt}of U){const Xt=this.layers[0]._featureFilter.needGeometry,rn=Ph(ht,Xt);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),rn,pe))continue;const hn=Ze?ze.evaluate(rn,{},pe,ne.availableImages):void 0,Sn={id:mt,properties:ht.properties,type:ht.type,sourceLayerIndex:Nt,index:zt,geometry:Xt?rn.geometry:eh(ht),patterns:{},sortKey:hn};Je.push(Sn)}Ze&&Je.sort((ht,mt)=>ht.sortKey-mt.sortKey);for(const ht of Je){const{geometry:mt,index:zt,sourceLayerIndex:Nt}=ht;if(this.hasPattern){const rn=B0("fill",this.layers,ht,this.zoom,ne);this.patternFeatures.push(rn)}else this.addFeature(ht,mt,zt,pe,{});const Xt=U[zt].feature;ne.featureIndex.insert(Xt,mt,zt,Nt,this.index)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}addFeatures(U,ne,pe){for(const ze of this.patternFeatures)this.addFeature(ze,ze.geometry,ze.index,ne,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,_v),this.indexBuffer=U.createIndexBuffer(this.indexArray),this.indexBuffer2=U.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(U),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(U,ne,pe,ze,Ze){for(const Je of vl(ne,500)){let ht=0;for(const hn of Je)ht+=hn.length;const mt=this.segments.prepareSegment(ht,this.layoutVertexArray,this.indexArray),zt=mt.vertexLength,Nt=[],Xt=[];for(const hn of Je){if(hn.length===0)continue;hn!==Je[0]&&Xt.push(Nt.length/2);const Sn=this.segments2.prepareSegment(hn.length,this.layoutVertexArray,this.indexArray2),xn=Sn.vertexLength;this.layoutVertexArray.emplaceBack(hn[0].x,hn[0].y),this.indexArray2.emplaceBack(xn+hn.length-1,xn),Nt.push(hn[0].x),Nt.push(hn[0].y);for(let Nn=1;Nn>3}if(ze--,pe===1||pe===2)Ze+=Y.readSVarint(),Je+=Y.readSVarint(),pe===1&&(U&&ht.push(U),U=[]),U.push(new Yg(Ze,Je));else{if(pe!==7)throw new Error("unknown command "+pe);U&&U.push(U[0].clone())}}return U&&ht.push(U),ht},Fh.prototype.bbox=function(){var Y=this._pbf;Y.pos=this._geometry;for(var U=Y.readVarint()+Y.pos,ne=1,pe=0,ze=0,Ze=0,Je=1/0,ht=-1/0,mt=1/0,zt=-1/0;Y.pos>3}if(pe--,ne===1||ne===2)(ze+=Y.readSVarint())ht&&(ht=ze),(Ze+=Y.readSVarint())zt&&(zt=Ze);else if(ne!==7)throw new Error("unknown command "+ne)}return[Je,mt,ht,zt]},Fh.prototype.toGeoJSON=function(Y,U,ne){var pe,ze,Ze=this.extent*Math.pow(2,ne),Je=this.extent*Y,ht=this.extent*U,mt=this.loadGeometry(),zt=Fh.types[this.type];function Nt(hn){for(var Sn=0;Sn>3;ze=Je===1?pe.readString():Je===2?pe.readFloat():Je===3?pe.readDouble():Je===4?pe.readVarint64():Je===5?pe.readVarint():Je===6?pe.readSVarint():Je===7?pe.readBoolean():null}return ze}(ne))}Sd.prototype.feature=function(Y){if(Y<0||Y>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[Y];var U=this._pbf.readVarint()+this._pbf.pos;return new Rf(this._pbf,U,this.extent,this._keys,this._values)};var Rp=cl,Ga=function(Y,U){this.layers=Y.readFields(Bh,{},U)};function Bh(Y,U,ne){if(Y===3){var pe=new Rp(ne,ne.readVarint()+ne.pos);pe.length&&(U[pe.name]=pe)}}Rh.VectorTile=Ga,Rh.VectorTileFeature=Xg,Rh.VectorTileLayer=cl;const Jg=Rh.VectorTileFeature.types,Fp=Math.pow(2,13);function Ec(Y,U,ne,pe,ze,Ze,Je,ht){Y.emplaceBack(U,ne,2*Math.floor(pe*Fp)+Je,ze*Fp*2,Ze*Fp*2,Math.round(ht))}class cf{constructor(U){this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=U.index,this.hasPattern=!1,this.layoutVertexArray=new Pi,this.centroidVertexArray=new si,this.indexArray=new ca,this.programConfigurations=new ps(U.layers,U.zoom),this.segments=new fa,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){this.features=[],this.hasPattern=Lp("fill-extrusion",this.layers,ne);for(const{feature:ze,id:Ze,index:Je,sourceLayerIndex:ht}of U){const mt=this.layers[0]._featureFilter.needGeometry,zt=Ph(ze,mt);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),zt,pe))continue;const Nt={id:Ze,sourceLayerIndex:ht,index:Je,geometry:mt?zt.geometry:eh(ze),properties:ze.properties,type:ze.type,patterns:{}};this.hasPattern?this.features.push(B0("fill-extrusion",this.layers,Nt,this.zoom,ne)):this.addFeature(Nt,Nt.geometry,Je,pe,{}),ne.featureIndex.insert(ze,Nt.geometry,Je,ht,this.index,!0)}}addFeatures(U,ne,pe){for(const ze of this.features){const{geometry:Ze}=ze;this.addFeature(ze,Ze,ze.index,ne,pe)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,$g),this.centroidVertexBuffer=U.createVertexBuffer(this.centroidVertexArray,bv.members,!0),this.indexBuffer=U.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(U),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(U,ne,pe,ze,Ze){for(const Je of vl(ne,500)){const ht={x:0,y:0,vertexCount:0};let mt=0;for(const Sn of Je)mt+=Sn.length;let zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const Sn of Je){if(Sn.length===0||Tv(Sn))continue;let xn=0;for(let Nn=0;Nn=1){const wr=Sn[Nn-1];if(!Qg(Gn,wr)){zt.vertexLength+4>fa.MAX_VERTEX_ARRAY_LENGTH&&(zt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const or=Gn.sub(wr)._perp()._unit(),gr=wr.dist(Gn);xn+gr>32768&&(xn=0),Ec(this.layoutVertexArray,Gn.x,Gn.y,or.x,or.y,0,0,xn),Ec(this.layoutVertexArray,Gn.x,Gn.y,or.x,or.y,0,1,xn),ht.x+=2*Gn.x,ht.y+=2*Gn.y,ht.vertexCount+=2,xn+=gr,Ec(this.layoutVertexArray,wr.x,wr.y,or.x,or.y,0,0,xn),Ec(this.layoutVertexArray,wr.x,wr.y,or.x,or.y,0,1,xn),ht.x+=2*wr.x,ht.y+=2*wr.y,ht.vertexCount+=2;const Wr=zt.vertexLength;this.indexArray.emplaceBack(Wr,Wr+2,Wr+1),this.indexArray.emplaceBack(Wr+1,Wr+2,Wr+3),zt.vertexLength+=4,zt.primitiveLength+=2}}}}if(zt.vertexLength+mt>fa.MAX_VERTEX_ARRAY_LENGTH&&(zt=this.segments.prepareSegment(mt,this.layoutVertexArray,this.indexArray)),Jg[U.type]!=="Polygon")continue;const Nt=[],Xt=[],rn=zt.vertexLength;for(const Sn of Je)if(Sn.length!==0){Sn!==Je[0]&&Xt.push(Nt.length/2);for(let xn=0;xnSs)||Y.y===U.y&&(Y.y<0||Y.y>Ss)}function Tv(Y){return Y.every(U=>U.x<0)||Y.every(U=>U.x>Ss)||Y.every(U=>U.y<0)||Y.every(U=>U.y>Ss)}let em;cn("FillExtrusionBucket",cf,{omit:["layers","features"]});var kv={get paint(){return em=em||new js({"fill-extrusion-opacity":new Ai(me["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new xi(me["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ai(me["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ai(me["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new xa(me["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new xi(me["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new xi(me["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ai(me["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Av extends Tt{constructor(U){super(U,kv)}createBucket(U){return new cf(U)}queryRadius(){return If(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(U,ne,pe,ze,Ze,Je,ht,mt){const zt=Iu(U,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Je.angle,ht),Nt=this.paint.get("fill-extrusion-height").evaluate(ne,pe),Xt=this.paint.get("fill-extrusion-base").evaluate(ne,pe),rn=function(Sn,xn,Nn,Gn){const wr=[];for(const or of Sn){const gr=[or.x,or.y,Gn,1];af(gr,gr,xn),wr.push(new u(gr[0]/gr[3],gr[1]/gr[3]))}return wr}(zt,mt,0,0),hn=function(Sn,xn,Nn,Gn){const wr=[],or=[],gr=Gn[8]*xn,Wr=Gn[9]*xn,pi=Gn[10]*xn,Ci=Gn[11]*xn,Vi=Gn[8]*Nn,ki=Gn[9]*Nn,ui=Gn[10]*Nn,Ii=Gn[11]*Nn;for(const Oi of Sn){const Si=[],ti=[];for(const Di of Oi){const Bi=Di.x,ra=Di.y,oo=Gn[0]*Bi+Gn[4]*ra+Gn[12],to=Gn[1]*Bi+Gn[5]*ra+Gn[13],Is=Gn[2]*Bi+Gn[6]*ra+Gn[14],Ou=Gn[3]*Bi+Gn[7]*ra+Gn[15],Js=Is+pi,Ps=Ou+Ci,hu=oo+Vi,Yl=to+ki,gs=Is+ui,ns=Ou+Ii,Ol=new u((oo+gr)/Ps,(to+Wr)/Ps);Ol.z=Js/Ps,Si.push(Ol);const Uo=new u(hu/ns,Yl/ns);Uo.z=gs/ns,ti.push(Uo)}wr.push(Si),or.push(ti)}return[wr,or]}(ze,Xt,Nt,mt);return function(Sn,xn,Nn){let Gn=1/0;vd(Nn,xn)&&(Gn=tm(Nn,xn[0]));for(let wr=0;wrne.id),this.index=U.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(ne=>{this.gradients[ne.id]={}}),this.layoutVertexArray=new Ji,this.layoutVertexArray2=new Yi,this.indexArray=new ca,this.programConfigurations=new ps(U.layers,U.zoom),this.segments=new fa,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(U,ne,pe){this.hasPattern=Lp("line",this.layers,ne);const ze=this.layers[0].layout.get("line-sort-key"),Ze=!ze.isConstant(),Je=[];for(const{feature:ht,id:mt,index:zt,sourceLayerIndex:Nt}of U){const Xt=this.layers[0]._featureFilter.needGeometry,rn=Ph(ht,Xt);if(!this.layers[0]._featureFilter.filter(new di(this.zoom),rn,pe))continue;const hn=Ze?ze.evaluate(rn,{},pe):void 0,Sn={id:mt,properties:ht.properties,type:ht.type,sourceLayerIndex:Nt,index:zt,geometry:Xt?rn.geometry:eh(ht),patterns:{},sortKey:hn};Je.push(Sn)}Ze&&Je.sort((ht,mt)=>ht.sortKey-mt.sortKey);for(const ht of Je){const{geometry:mt,index:zt,sourceLayerIndex:Nt}=ht;if(this.hasPattern){const rn=B0("line",this.layers,ht,this.zoom,ne);this.patternFeatures.push(rn)}else this.addFeature(ht,mt,zt,pe,{});const Xt=U[zt].feature;ne.featureIndex.insert(Xt,mt,zt,Nt,this.index)}}update(U,ne,pe){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(U,ne,this.stateDependentLayers,pe)}addFeatures(U,ne,pe){for(const ze of this.patternFeatures)this.addFeature(ze,ze.geometry,ze.index,ne,pe)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(U){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=U.createVertexBuffer(this.layoutVertexArray2,nm)),this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,Mv),this.indexBuffer=U.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(U),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(U){if(U.properties&&Object.prototype.hasOwnProperty.call(U.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(U.properties,"mapbox_clip_end"))return{start:+U.properties.mapbox_clip_start,end:+U.properties.mapbox_clip_end}}addFeature(U,ne,pe,ze,Ze){const Je=this.layers[0].layout,ht=Je.get("line-join").evaluate(U,{}),mt=Je.get("line-cap"),zt=Je.get("line-miter-limit"),Nt=Je.get("line-round-limit");this.lineClips=this.lineFeatureClips(U);for(const Xt of ne)this.addLine(Xt,U,ht,mt,zt,Nt);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,U,pe,Ze,ze)}addLine(U,ne,pe,ze,Ze,Je){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Gn=0;Gn=2&&U[mt-1].equals(U[mt-2]);)mt--;let zt=0;for(;zt0;if(Ci&&Gn>zt){const Ii=rn.dist(hn);if(Ii>2*Nt){const Oi=rn.sub(rn.sub(hn)._mult(Nt/Ii)._round());this.updateDistance(hn,Oi),this.addCurrentVertex(Oi,xn,0,0,Xt),hn=Oi}}const ki=hn&&Sn;let ui=ki?pe:ht?"butt":ze;if(ki&&ui==="round"&&(WrZe&&(ui="bevel"),ui==="bevel"&&(Wr>2&&(ui="flipbevel"),Wr100)wr=Nn.mult(-1);else{const Ii=Wr*xn.add(Nn).mag()/xn.sub(Nn).mag();wr._perp()._mult(Ii*(Vi?-1:1))}this.addCurrentVertex(rn,wr,0,0,Xt),this.addCurrentVertex(rn,wr.mult(-1),0,0,Xt)}else if(ui==="bevel"||ui==="fakeround"){const Ii=-Math.sqrt(Wr*Wr-1),Oi=Vi?Ii:0,Si=Vi?0:Ii;if(hn&&this.addCurrentVertex(rn,xn,Oi,Si,Xt),ui==="fakeround"){const ti=Math.round(180*pi/Math.PI/20);for(let Di=1;Di2*Nt){const Oi=rn.add(Sn.sub(rn)._mult(Nt/Ii)._round());this.updateDistance(rn,Oi),this.addCurrentVertex(Oi,Nn,0,0,Xt),rn=Oi}}}}addCurrentVertex(U,ne,pe,ze,Ze,Je=!1){const ht=ne.x+ne.y*pe,mt=ne.y-ne.x*pe,zt=-ne.x+ne.y*ze,Nt=-ne.y-ne.x*ze;this.addHalfVertex(U,ht,mt,Je,!1,pe,Ze),this.addHalfVertex(U,zt,Nt,Je,!0,-ze,Ze),this.distance>U0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(U,ne,pe,ze,Ze,Je))}addHalfVertex({x:U,y:ne},pe,ze,Ze,Je,ht,mt){const zt=.5*(this.lineClips?this.scaledDistance*(U0-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((U<<1)+(Ze?1:0),(ne<<1)+(Je?1:0),Math.round(63*pe)+128,Math.round(63*ze)+128,1+(ht===0?0:ht<0?-1:1)|(63&zt)<<2,zt>>6),this.lineClips){const Xt=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(Xt,this.lineClipsArray.length)}const Nt=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Nt),mt.primitiveLength++),Je?this.e2=Nt:this.e1=Nt}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(U,ne){this.distance+=U.dist(ne),this.updateScaledDistance()}}let Zu;cn("LineBucket",Ed,{omit:["layers","patternFeatures"]});let Np;var ap={get paint(){return Np=Np||new js({"line-opacity":new xi(me.paint_line["line-opacity"]),"line-color":new xi(me.paint_line["line-color"]),"line-translate":new Ai(me.paint_line["line-translate"]),"line-translate-anchor":new Ai(me.paint_line["line-translate-anchor"]),"line-width":new xi(me.paint_line["line-width"]),"line-gap-width":new xi(me.paint_line["line-gap-width"]),"line-offset":new xi(me.paint_line["line-offset"]),"line-blur":new xi(me.paint_line["line-blur"]),"line-dasharray":new es(me.paint_line["line-dasharray"]),"line-pattern":new xa(me.paint_line["line-pattern"]),"line-gradient":new bu(me.paint_line["line-gradient"])})},get layout(){return Zu=Zu||new js({"line-cap":new Ai(me.layout_line["line-cap"]),"line-join":new xi(me.layout_line["line-join"]),"line-miter-limit":new Ai(me.layout_line["line-miter-limit"]),"line-round-limit":new Ai(me.layout_line["line-round-limit"]),"line-sort-key":new xi(me.layout_line["line-sort-key"])})}};class $u extends xi{possiblyEvaluate(U,ne){return ne=new di(Math.floor(ne.zoom),{now:ne.now,fadeDuration:ne.fadeDuration,zoomHistory:ne.zoomHistory,transition:ne.transition}),super.possiblyEvaluate(U,ne)}evaluate(U,ne,pe,ze){return ne=A({},ne,{zoom:Math.floor(ne.zoom)}),super.evaluate(U,ne,pe,ze)}}let Lu;class jp extends Tt{constructor(U){super(U,ap),this.gradientVersion=0,Lu||(Lu=new $u(ap.paint.properties["line-width"].specification),Lu.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(U){if(U==="line-gradient"){const ne=this.gradientExpression();(function(pe){return pe._styleExpression!==void 0})(ne)?this.stepInterpolant=ne._styleExpression.expression instanceof Er:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(U,ne){super.recalculate(U,ne),this.paint._values["line-floorwidth"]=Lu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,U)}createBucket(U){return new Ed(U)}queryRadius(U){const ne=U,pe=Bf(tp("line-width",this,ne),tp("line-gap-width",this,ne)),ze=tp("line-offset",this,ne);return pe/2+Math.abs(ze)+If(this.paint.get("line-translate"))}queryIntersectsFeature(U,ne,pe,ze,Ze,Je,ht){const mt=Iu(U,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Je.angle,ht),zt=ht/2*Bf(this.paint.get("line-width").evaluate(ne,pe),this.paint.get("line-gap-width").evaluate(ne,pe)),Nt=this.paint.get("line-offset").evaluate(ne,pe);return Nt&&(ze=function(Xt,rn){const hn=[];for(let Sn=0;Sn=3){for(let Nn=0;Nn0?U+2*Y:Y}const uu=i([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Cd=i([{name:"a_projected_pos",components:3,type:"Float32"}],4);i([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Id=i([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);i([{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 Yu=i([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),am=i([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Pd(Y,U,ne){return Y.sections.forEach(pe=>{pe.text=function(ze,Ze,Je){const ht=Ze.layout.get("text-transform").evaluate(Je,{});return ht==="uppercase"?ze=ze.toLocaleUpperCase():ht==="lowercase"&&(ze=ze.toLocaleLowerCase()),Cl.applyArabicShaping&&(ze=Cl.applyArabicShaping(ze)),ze}(pe.text,U,ne)}),Y}i([{name:"triangle",components:3,type:"Uint16"}]),i([{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"}]),i([{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"}]),i([{type:"Float32",name:"offsetX"}]),i([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),i([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Up={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var hl=24,V0=vo,op={read:function(Y,U,ne,pe,ze){var Ze,Je,ht=8*ze-pe-1,mt=(1<>1,Nt=-7,Xt=ne?ze-1:0,rn=ne?-1:1,hn=Y[U+Xt];for(Xt+=rn,Ze=hn&(1<<-Nt)-1,hn>>=-Nt,Nt+=ht;Nt>0;Ze=256*Ze+Y[U+Xt],Xt+=rn,Nt-=8);for(Je=Ze&(1<<-Nt)-1,Ze>>=-Nt,Nt+=pe;Nt>0;Je=256*Je+Y[U+Xt],Xt+=rn,Nt-=8);if(Ze===0)Ze=1-zt;else{if(Ze===mt)return Je?NaN:1/0*(hn?-1:1);Je+=Math.pow(2,pe),Ze-=zt}return(hn?-1:1)*Je*Math.pow(2,Ze-pe)},write:function(Y,U,ne,pe,ze,Ze){var Je,ht,mt,zt=8*Ze-ze-1,Nt=(1<>1,rn=ze===23?Math.pow(2,-24)-Math.pow(2,-77):0,hn=pe?0:Ze-1,Sn=pe?1:-1,xn=U<0||U===0&&1/U<0?1:0;for(U=Math.abs(U),isNaN(U)||U===1/0?(ht=isNaN(U)?1:0,Je=Nt):(Je=Math.floor(Math.log(U)/Math.LN2),U*(mt=Math.pow(2,-Je))<1&&(Je--,mt*=2),(U+=Je+Xt>=1?rn/mt:rn*Math.pow(2,1-Xt))*mt>=2&&(Je++,mt/=2),Je+Xt>=Nt?(ht=0,Je=Nt):Je+Xt>=1?(ht=(U*mt-1)*Math.pow(2,ze),Je+=Xt):(ht=U*Math.pow(2,Xt-1)*Math.pow(2,ze),Je=0));ze>=8;Y[ne+hn]=255&ht,hn+=Sn,ht/=256,ze-=8);for(Je=Je<0;Y[ne+hn]=255&Je,hn+=Sn,Je/=256,zt-=8);Y[ne+hn-Sn]|=128*xn}};function vo(Y){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Y)?Y:new Uint8Array(Y||0),this.pos=0,this.type=0,this.length=this.buf.length}vo.Varint=0,vo.Fixed64=1,vo.Bytes=2,vo.Fixed32=5;var q0=4294967296,H0=1/q0,Nf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function cu(Y){return Y.type===vo.Bytes?Y.readVarint()+Y.pos:Y.pos+1}function hf(Y,U,ne){return ne?4294967296*U+(Y>>>0):4294967296*(U>>>0)+(Y>>>0)}function G0(Y,U,ne){var pe=U<=16383?1:U<=2097151?2:U<=268435455?3:Math.floor(Math.log(U)/(7*Math.LN2));ne.realloc(pe);for(var ze=ne.pos-1;ze>=Y;ze--)ne.buf[ze+pe]=ne.buf[ze]}function om(Y,U){for(var ne=0;ne>>8,Y[ne+2]=U>>>16,Y[ne+3]=U>>>24}function W0(Y,U){return(Y[U]|Y[U+1]<<8|Y[U+2]<<16)+(Y[U+3]<<24)}vo.prototype={destroy:function(){this.buf=null},readFields:function(Y,U,ne){for(ne=ne||this.length;this.pos>3,Ze=this.pos;this.type=7&pe,Y(ze,U,this),this.pos===Ze&&this.skip(pe)}return U},readMessage:function(Y,U){return this.readFields(Y,U,this.readVarint()+this.pos)},readFixed32:function(){var Y=jf(this.buf,this.pos);return this.pos+=4,Y},readSFixed32:function(){var Y=W0(this.buf,this.pos);return this.pos+=4,Y},readFixed64:function(){var Y=jf(this.buf,this.pos)+jf(this.buf,this.pos+4)*q0;return this.pos+=8,Y},readSFixed64:function(){var Y=jf(this.buf,this.pos)+W0(this.buf,this.pos+4)*q0;return this.pos+=8,Y},readFloat:function(){var Y=op.read(this.buf,this.pos,!0,23,4);return this.pos+=4,Y},readDouble:function(){var Y=op.read(this.buf,this.pos,!0,52,8);return this.pos+=8,Y},readVarint:function(Y){var U,ne,pe=this.buf;return U=127&(ne=pe[this.pos++]),ne<128?U:(U|=(127&(ne=pe[this.pos++]))<<7,ne<128?U:(U|=(127&(ne=pe[this.pos++]))<<14,ne<128?U:(U|=(127&(ne=pe[this.pos++]))<<21,ne<128?U:function(ze,Ze,Je){var ht,mt,zt=Je.buf;if(ht=(112&(mt=zt[Je.pos++]))>>4,mt<128||(ht|=(127&(mt=zt[Je.pos++]))<<3,mt<128)||(ht|=(127&(mt=zt[Je.pos++]))<<10,mt<128)||(ht|=(127&(mt=zt[Je.pos++]))<<17,mt<128)||(ht|=(127&(mt=zt[Je.pos++]))<<24,mt<128)||(ht|=(1&(mt=zt[Je.pos++]))<<31,mt<128))return hf(ze,ht,Ze);throw new Error("Expected varint not more than 10 bytes")}(U|=(15&(ne=pe[this.pos]))<<28,Y,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Y=this.readVarint();return Y%2==1?(Y+1)/-2:Y/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Y=this.readVarint()+this.pos,U=this.pos;return this.pos=Y,Y-U>=12&&Nf?function(ne,pe,ze){return Nf.decode(ne.subarray(pe,ze))}(this.buf,U,Y):function(ne,pe,ze){for(var Ze="",Je=pe;Je239?4:Nt>223?3:Nt>191?2:1;if(Je+rn>ze)break;rn===1?Nt<128&&(Xt=Nt):rn===2?(192&(ht=ne[Je+1]))==128&&(Xt=(31&Nt)<<6|63&ht)<=127&&(Xt=null):rn===3?(ht=ne[Je+1],mt=ne[Je+2],(192&ht)==128&&(192&mt)==128&&((Xt=(15&Nt)<<12|(63&ht)<<6|63&mt)<=2047||Xt>=55296&&Xt<=57343)&&(Xt=null)):rn===4&&(ht=ne[Je+1],mt=ne[Je+2],zt=ne[Je+3],(192&ht)==128&&(192&mt)==128&&(192&zt)==128&&((Xt=(15&Nt)<<18|(63&ht)<<12|(63&mt)<<6|63&zt)<=65535||Xt>=1114112)&&(Xt=null)),Xt===null?(Xt=65533,rn=1):Xt>65535&&(Xt-=65536,Ze+=String.fromCharCode(Xt>>>10&1023|55296),Xt=56320|1023&Xt),Ze+=String.fromCharCode(Xt),Je+=rn}return Ze}(this.buf,U,Y)},readBytes:function(){var Y=this.readVarint()+this.pos,U=this.buf.subarray(this.pos,Y);return this.pos=Y,U},readPackedVarint:function(Y,U){if(this.type!==vo.Bytes)return Y.push(this.readVarint(U));var ne=cu(this);for(Y=Y||[];this.pos127;);else if(U===vo.Bytes)this.pos=this.readVarint()+this.pos;else if(U===vo.Fixed32)this.pos+=4;else{if(U!==vo.Fixed64)throw new Error("Unimplemented type: "+U);this.pos+=8}},writeTag:function(Y,U){this.writeVarint(Y<<3|U)},realloc:function(Y){for(var U=this.length||16;U268435455||Y<0?function(U,ne){var pe,ze;if(U>=0?(pe=U%4294967296|0,ze=U/4294967296|0):(ze=~(-U/4294967296),4294967295^(pe=~(-U%4294967296))?pe=pe+1|0:(pe=0,ze=ze+1|0)),U>=18446744073709552e3||U<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ne.realloc(10),function(Ze,Je,ht){ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos++]=127&Ze|128,Ze>>>=7,ht.buf[ht.pos]=127&Ze}(pe,0,ne),function(Ze,Je){var ht=(7&Ze)<<4;Je.buf[Je.pos++]|=ht|((Ze>>>=3)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze|((Ze>>>=7)?128:0),Ze&&(Je.buf[Je.pos++]=127&Ze)))))}(ze,ne)}(Y,this):(this.realloc(4),this.buf[this.pos++]=127&Y|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=127&(Y>>>=7)|(Y>127?128:0),Y<=127||(this.buf[this.pos++]=Y>>>7&127))))},writeSVarint:function(Y){this.writeVarint(Y<0?2*-Y-1:2*Y)},writeBoolean:function(Y){this.writeVarint(!!Y)},writeString:function(Y){Y=String(Y),this.realloc(4*Y.length),this.pos++;var U=this.pos;this.pos=function(pe,ze,Ze){for(var Je,ht,mt=0;mt55295&&Je<57344){if(!ht){Je>56319||mt+1===ze.length?(pe[Ze++]=239,pe[Ze++]=191,pe[Ze++]=189):ht=Je;continue}if(Je<56320){pe[Ze++]=239,pe[Ze++]=191,pe[Ze++]=189,ht=Je;continue}Je=ht-55296<<10|Je-56320|65536,ht=null}else ht&&(pe[Ze++]=239,pe[Ze++]=191,pe[Ze++]=189,ht=null);Je<128?pe[Ze++]=Je:(Je<2048?pe[Ze++]=Je>>6|192:(Je<65536?pe[Ze++]=Je>>12|224:(pe[Ze++]=Je>>18|240,pe[Ze++]=Je>>12&63|128),pe[Ze++]=Je>>6&63|128),pe[Ze++]=63&Je|128)}return Ze}(this.buf,Y,this.pos);var ne=this.pos-U;ne>=128&&G0(U,ne,this),this.pos=U-1,this.writeVarint(ne),this.pos+=ne},writeFloat:function(Y){this.realloc(4),op.write(this.buf,Y,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Y){this.realloc(8),op.write(this.buf,Y,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Y){var U=Y.length;this.writeVarint(U),this.realloc(U);for(var ne=0;ne=128&&G0(ne,pe,this),this.pos=ne-1,this.writeVarint(pe),this.pos+=pe},writeMessage:function(Y,U,ne){this.writeTag(Y,vo.Bytes),this.writeRawMessage(U,ne)},writePackedVarint:function(Y,U){U.length&&this.writeMessage(Y,om,U)},writePackedSVarint:function(Y,U){U.length&&this.writeMessage(Y,Iv,U)},writePackedBoolean:function(Y,U){U.length&&this.writeMessage(Y,um,U)},writePackedFloat:function(Y,U){U.length&&this.writeMessage(Y,sm,U)},writePackedDouble:function(Y,U){U.length&&this.writeMessage(Y,lm,U)},writePackedFixed32:function(Y,U){U.length&&this.writeMessage(Y,cm,U)},writePackedSFixed32:function(Y,U){U.length&&this.writeMessage(Y,Pv,U)},writePackedFixed64:function(Y,U){U.length&&this.writeMessage(Y,Lv,U)},writePackedSFixed64:function(Y,U){U.length&&this.writeMessage(Y,hm,U)},writeBytesField:function(Y,U){this.writeTag(Y,vo.Bytes),this.writeBytes(U)},writeFixed32Field:function(Y,U){this.writeTag(Y,vo.Fixed32),this.writeFixed32(U)},writeSFixed32Field:function(Y,U){this.writeTag(Y,vo.Fixed32),this.writeSFixed32(U)},writeFixed64Field:function(Y,U){this.writeTag(Y,vo.Fixed64),this.writeFixed64(U)},writeSFixed64Field:function(Y,U){this.writeTag(Y,vo.Fixed64),this.writeSFixed64(U)},writeVarintField:function(Y,U){this.writeTag(Y,vo.Varint),this.writeVarint(U)},writeSVarintField:function(Y,U){this.writeTag(Y,vo.Varint),this.writeSVarint(U)},writeStringField:function(Y,U){this.writeTag(Y,vo.Bytes),this.writeString(U)},writeFloatField:function(Y,U){this.writeTag(Y,vo.Fixed32),this.writeFloat(U)},writeDoubleField:function(Y,U){this.writeTag(Y,vo.Fixed64),this.writeDouble(U)},writeBooleanField:function(Y,U){this.writeVarintField(Y,!!U)}};var sp=w(V0);const Ld=3;function zd(Y,U,ne){Y===1&&ne.readMessage(Od,U)}function Od(Y,U,ne){if(Y===3){const{id:pe,bitmap:ze,width:Ze,height:Je,left:ht,top:mt,advance:zt}=ne.readMessage(Dd,{});U.push({id:pe,bitmap:new zh({width:Ze+2*Ld,height:Je+2*Ld},ze),metrics:{width:Ze,height:Je,left:ht,top:mt,advance:zt}})}}function Dd(Y,U,ne){Y===1?U.id=ne.readVarint():Y===2?U.bitmap=ne.readBytes():Y===3?U.width=ne.readVarint():Y===4?U.height=ne.readVarint():Y===5?U.left=ne.readSVarint():Y===6?U.top=ne.readSVarint():Y===7&&(U.advance=ne.readVarint())}const Uf=Ld;function fm(Y){let U=0,ne=0;for(const Je of Y)U+=Je.w*Je.h,ne=Math.max(ne,Je.w);Y.sort((Je,ht)=>ht.h-Je.h);const pe=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(U/.95)),ne),h:1/0}];let ze=0,Ze=0;for(const Je of Y)for(let ht=pe.length-1;ht>=0;ht--){const mt=pe[ht];if(!(Je.w>mt.w||Je.h>mt.h)){if(Je.x=mt.x,Je.y=mt.y,Ze=Math.max(Ze,Je.y+Je.h),ze=Math.max(ze,Je.x+Je.w),Je.w===mt.w&&Je.h===mt.h){const zt=pe.pop();ht=0&&pe>=U&&ih[this.text.charCodeAt(pe)];pe--)ne--;this.text=this.text.substring(U,ne),this.sectionIndex=this.sectionIndex.slice(U,ne)}substring(U,ne){const pe=new ff;return pe.text=this.text.substring(U,ne),pe.sectionIndex=this.sectionIndex.slice(U,ne),pe.sections=this.sections,pe}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((U,ne)=>Math.max(U,this.sections[ne].scale),0)}addTextSection(U,ne){this.text+=U.text,this.sections.push(lp.forText(U.scale,U.fontStack||ne));const pe=this.sections.length-1;for(let ze=0;ze=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function pf(Y,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn){const xn=ff.fromFeature(Y,ze);let Nn;Xt===d.ai.vertical&&xn.verticalizePunctuation();const{processBidirectionalText:Gn,processStyledBidirectionalText:wr}=Cl;if(Gn&&xn.sections.length===1){Nn=[];const Wr=Gn(xn.toString(),$0(xn,zt,Ze,U,pe,hn));for(const pi of Wr){const Ci=new ff;Ci.text=pi,Ci.sections=xn.sections;for(let Vi=0;Vi0&&Ic>Xl&&(Xl=Ic)}else{const no=Ci[ms.fontStack],Wo=no&&no[Do];if(Wo&&Wo.rect)as=Wo.rect,is=Wo.metrics;else{const Ic=pi[ms.fontStack],Vc=Ic&&Ic[Do];if(!Vc)continue;is=Vc.metrics}rs=(ns-ms.scale)*hl}dl?(Wr.verticalizable=!0,Qs.push({glyph:Do,imageName:Vh,x:ra,y:oo+rs,vertical:dl,scale:ms.scale,fontStack:ms.fontStack,sectionIndex:uc,metrics:is,rect:as}),ra+=_c*ms.scale+ti):(Qs.push({glyph:Do,imageName:Vh,x:ra,y:oo+rs,vertical:dl,scale:ms.scale,fontStack:ms.fontStack,sectionIndex:uc,metrics:is,rect:as}),ra+=is.advance*ms.scale+ti)}if(Qs.length!==0){const fu=ra-ti;to=Math.max(fu,to),qp(Qs,0,Qs.length-1,Ou,Xl)}ra=0;const Du=ui*ns+Xl;Uo.lineOffset=Math.max(Xl,Ol),oo+=Du,Is=Math.max(Du,Is),++Js}const Ps=oo-Vf,{horizontalAlign:hu,verticalAlign:Yl}=df(Ii);(function(gs,ns,Ol,Uo,Qs,Xl,Du,fu,ms){const uc=(ns-Ol)*Qs;let Do=0;Do=Xl!==Du?-fu*Uo-Vf:(-Uo*ms+.5)*Du;for(const rs of gs)for(const is of rs.positionedGlyphs)is.x+=uc,is.y+=Do})(Wr.positionedLines,Ou,hu,Yl,to,Is,ui,Ps,ki.length),Wr.top+=-Yl*Ps,Wr.bottom=Wr.top+Ps,Wr.left+=-hu*to,Wr.right=Wr.left+to}(gr,U,ne,pe,Nn,Je,ht,mt,Xt,zt,rn,Sn),!function(Wr){for(const pi of Wr)if(pi.positionedGlyphs.length!==0)return!1;return!0}(or)&&gr}const ih={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},pm={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},dm={40:!0};function gm(Y,U,ne,pe,ze,Ze){if(U.imageName){const Je=pe[U.imageName];return Je?Je.displaySize[0]*U.scale*hl/Ze+ze:0}{const Je=ne[U.fontStack],ht=Je&&Je[Y];return ht?ht.metrics.advance*U.scale+ze:0}}function mm(Y,U,ne,pe){const ze=Math.pow(Y-U,2);return pe?Y=0;let zt=0;for(let Xt=0;XtXt){const rn=Math.ceil(Ze/Xt);ze*=rn/Je,Je=rn}return{x1:pe,y1:ze,x2:pe+Ze,y2:ze+Je}}function Fd(Y,U,ne,pe,ze,Ze){const Je=Y.image;let ht;if(Je.content){const Nn=Je.content,Gn=Je.pixelRatio||1;ht=[Nn[0]/Gn,Nn[1]/Gn,Je.displaySize[0]-Nn[2]/Gn,Je.displaySize[1]-Nn[3]/Gn]}const mt=U.left*Ze,zt=U.right*Ze;let Nt,Xt,rn,hn;ne==="width"||ne==="both"?(hn=ze[0]+mt-pe[3],Xt=ze[0]+zt+pe[1]):(hn=ze[0]+(mt+zt-Je.displaySize[0])/2,Xt=hn+Je.displaySize[0]);const Sn=U.top*Ze,xn=U.bottom*Ze;return ne==="height"||ne==="both"?(Nt=ze[1]+Sn-pe[0],rn=ze[1]+xn+pe[2]):(Nt=ze[1]+(Sn+xn-Je.displaySize[1])/2,rn=Nt+Je.displaySize[1]),{image:Je,top:Nt,right:Xt,bottom:rn,left:hn,collisionPadding:ht}}const yh=255,xh=128,gf=yh*xh;function Hp(Y,U){const{expression:ne}=U;if(ne.kind==="constant")return{kind:"constant",layoutSize:ne.evaluate(new di(Y+1))};if(ne.kind==="source")return{kind:"source"};{const{zoomStops:pe,interpolationType:ze}=ne;let Ze=0;for(;Zeht.id),this.index=U.index,this.pixelRatio=U.pixelRatio,this.sourceLayerIndex=U.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=xd([]),this.placementViewportMatrix=xd([]);const ne=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Hp(this.zoom,ne["text-size"]),this.iconSizeData=Hp(this.zoom,ne["icon-size"]);const pe=this.layers[0].layout,ze=pe.get("symbol-sort-key"),Ze=pe.get("symbol-z-order");this.canOverlap=X0(pe,"text-overlap","text-allow-overlap")!=="never"||X0(pe,"icon-overlap","icon-allow-overlap")!=="never"||pe.get("text-ignore-placement")||pe.get("icon-ignore-placement"),this.sortFeaturesByKey=Ze!=="viewport-y"&&!ze.isConstant();const Je=Ze==="viewport-y"||Ze==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=Je&&this.canOverlap,pe.get("symbol-placement")==="point"&&(this.writingModes=pe.get("text-writing-mode").map(ht=>d.ai[ht])),this.stateDependentLayerIds=this.layers.filter(ht=>ht.isStateDependent()).map(ht=>ht.id),this.sourceID=U.sourceID}createArrays(){this.text=new jd(new ps(this.layers,this.zoom,U=>/^text/.test(U))),this.icon=new jd(new ps(this.layers,this.zoom,U=>/^icon/.test(U))),this.glyphOffsetArray=new dr,this.lineVertexArray=new Br,this.symbolInstances=new Lr,this.textAnchorOffsets=new Vr}calculateGlyphDependencies(U,ne,pe,ze,Ze){for(let Je=0;Je0)&&(Je.value.kind!=="constant"||Je.value.value.length>0),Nt=mt.value.kind!=="constant"||!!mt.value.value||Object.keys(mt.parameters).length>0,Xt=Ze.get("symbol-sort-key");if(this.features=[],!zt&&!Nt)return;const rn=ne.iconDependencies,hn=ne.glyphDependencies,Sn=ne.availableImages,xn=new di(this.zoom);for(const{feature:Nn,id:Gn,index:wr,sourceLayerIndex:or}of U){const gr=ze._featureFilter.needGeometry,Wr=Ph(Nn,gr);if(!ze._featureFilter.filter(xn,Wr,pe))continue;let pi,Ci;if(gr||(Wr.geometry=eh(Nn)),zt){const ui=ze.getValueAndResolveTokens("text-field",Wr,pe,Sn),Ii=In.factory(ui),Oi=this.hasRTLText=this.hasRTLText||vm(Ii);(!Oi||Cl.getRTLTextPluginStatus()==="unavailable"||Oi&&Cl.isParsed())&&(pi=Pd(Ii,ze,Wr))}if(Nt){const ui=ze.getValueAndResolveTokens("icon-image",Wr,pe,Sn);Ci=ui instanceof Ln?ui:Ln.fromString(ui)}if(!pi&&!Ci)continue;const Vi=this.sortFeaturesByKey?Xt.evaluate(Wr,{},pe):void 0,ki={id:Gn,text:pi,icon:Ci,index:wr,sourceLayerIndex:or,geometry:Wr.geometry,properties:Nn.properties,type:Ov[Nn.type],sortKey:Vi};if(this.features.push(ki),Ci&&(rn[Ci.name]=!0),pi){const ui=Je.evaluate(Wr,{},pe).join(","),Ii=Ze.get("text-rotation-alignment")!=="viewport"&&Ze.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(d.ai.vertical)>=0;for(const Oi of pi.sections)if(Oi.image)rn[Oi.image.name]=!0;else{const Si=Io(pi.toString()),ti=Oi.fontStack||ui,Di=hn[ti]=hn[ti]||{};this.calculateGlyphDependencies(Oi.text,Di,Ii,this.allowVerticalPlacement,Si)}}}Ze.get("symbol-placement")==="line"&&(this.features=function(Nn){const Gn={},wr={},or=[];let gr=0;function Wr(ki){or.push(Nn[ki]),gr++}function pi(ki,ui,Ii){const Oi=wr[ki];return delete wr[ki],wr[ui]=Oi,or[Oi].geometry[0].pop(),or[Oi].geometry[0]=or[Oi].geometry[0].concat(Ii[0]),Oi}function Ci(ki,ui,Ii){const Oi=Gn[ui];return delete Gn[ui],Gn[ki]=Oi,or[Oi].geometry[0].shift(),or[Oi].geometry[0]=Ii[0].concat(or[Oi].geometry[0]),Oi}function Vi(ki,ui,Ii){const Oi=Ii?ui[0][ui[0].length-1]:ui[0][0];return`${ki}:${Oi.x}:${Oi.y}`}for(let ki=0;kiki.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Nn,Gn)=>Nn.sortKey-Gn.sortKey)}update(U,ne,pe){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(U,ne,this.layers,pe),this.icon.programConfigurations.updatePaintArrays(U,ne,this.layers,pe))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(U){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(U),this.iconCollisionBox.upload(U)),this.text.upload(U,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(U,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(U,ne){const pe=this.lineVertexArray.length;if(U.segment!==void 0){let ze=U.dist(ne[U.segment+1]),Ze=U.dist(ne[U.segment]);const Je={};for(let ht=U.segment+1;ht=0;ht--)Je[ht]={x:ne[ht].x,y:ne[ht].y,tileUnitDistanceFromAnchor:Ze},ht>0&&(Ze+=ne[ht-1].dist(ne[ht]));for(let ht=0;ht0}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(U,ne){const pe=U.placedSymbolArray.get(ne),ze=pe.vertexStartIndex+4*pe.numGlyphs;for(let Ze=pe.vertexStartIndex;Zeze[ht]-ze[mt]||Ze[mt]-Ze[ht]),Je}addToSortKeyRanges(U,ne){const pe=this.sortKeyRanges[this.sortKeyRanges.length-1];pe&&pe.sortKey===ne?pe.symbolInstanceEnd=U+1:this.sortKeyRanges.push({sortKey:ne,symbolInstanceStart:U,symbolInstanceEnd:U+1})}sortFeatures(U){if(this.sortFeaturesByY&&this.sortedAngle!==U&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(U),this.sortedAngle=U,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const ne of this.symbolInstanceIndexes){const pe=this.symbolInstances.get(ne);this.featureSortOrder.push(pe.featureIndex),[pe.rightJustifiedTextSymbolIndex,pe.centerJustifiedTextSymbolIndex,pe.leftJustifiedTextSymbolIndex].forEach((ze,Ze,Je)=>{ze>=0&&Je.indexOf(ze)===Ze&&this.addIndicesForPlacedSymbol(this.text,ze)}),pe.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,pe.verticalPlacedTextSymbolIndex),pe.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,pe.placedIconSymbolIndex),pe.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,pe.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let mf;cn("SymbolBucket",Nh,{omit:["layers","collisionBoxArray","features","compareText"]}),Nh.MAX_GLYPHS=65535,Nh.addDynamicAttributes=Nd;let Vd;var ah={get paint(){return Vd=Vd||new js({"icon-opacity":new xi(me.paint_symbol["icon-opacity"]),"icon-color":new xi(me.paint_symbol["icon-color"]),"icon-halo-color":new xi(me.paint_symbol["icon-halo-color"]),"icon-halo-width":new xi(me.paint_symbol["icon-halo-width"]),"icon-halo-blur":new xi(me.paint_symbol["icon-halo-blur"]),"icon-translate":new Ai(me.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ai(me.paint_symbol["icon-translate-anchor"]),"text-opacity":new xi(me.paint_symbol["text-opacity"]),"text-color":new xi(me.paint_symbol["text-color"],{runtimeType:De,getOverride:Y=>Y.textColor,hasOverride:Y=>!!Y.textColor}),"text-halo-color":new xi(me.paint_symbol["text-halo-color"]),"text-halo-width":new xi(me.paint_symbol["text-halo-width"]),"text-halo-blur":new xi(me.paint_symbol["text-halo-blur"]),"text-translate":new Ai(me.paint_symbol["text-translate"]),"text-translate-anchor":new Ai(me.paint_symbol["text-translate-anchor"])})},get layout(){return mf=mf||new js({"symbol-placement":new Ai(me.layout_symbol["symbol-placement"]),"symbol-spacing":new Ai(me.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ai(me.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new xi(me.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ai(me.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ai(me.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ai(me.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ai(me.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ai(me.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ai(me.layout_symbol["icon-rotation-alignment"]),"icon-size":new xi(me.layout_symbol["icon-size"]),"icon-text-fit":new Ai(me.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ai(me.layout_symbol["icon-text-fit-padding"]),"icon-image":new xi(me.layout_symbol["icon-image"]),"icon-rotate":new xi(me.layout_symbol["icon-rotate"]),"icon-padding":new xi(me.layout_symbol["icon-padding"]),"icon-keep-upright":new Ai(me.layout_symbol["icon-keep-upright"]),"icon-offset":new xi(me.layout_symbol["icon-offset"]),"icon-anchor":new xi(me.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ai(me.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ai(me.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ai(me.layout_symbol["text-rotation-alignment"]),"text-field":new xi(me.layout_symbol["text-field"]),"text-font":new xi(me.layout_symbol["text-font"]),"text-size":new xi(me.layout_symbol["text-size"]),"text-max-width":new xi(me.layout_symbol["text-max-width"]),"text-line-height":new Ai(me.layout_symbol["text-line-height"]),"text-letter-spacing":new xi(me.layout_symbol["text-letter-spacing"]),"text-justify":new xi(me.layout_symbol["text-justify"]),"text-radial-offset":new xi(me.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ai(me.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new xi(me.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new xi(me.layout_symbol["text-anchor"]),"text-max-angle":new Ai(me.layout_symbol["text-max-angle"]),"text-writing-mode":new Ai(me.layout_symbol["text-writing-mode"]),"text-rotate":new xi(me.layout_symbol["text-rotate"]),"text-padding":new Ai(me.layout_symbol["text-padding"]),"text-keep-upright":new Ai(me.layout_symbol["text-keep-upright"]),"text-transform":new xi(me.layout_symbol["text-transform"]),"text-offset":new xi(me.layout_symbol["text-offset"]),"text-allow-overlap":new Ai(me.layout_symbol["text-allow-overlap"]),"text-overlap":new Ai(me.layout_symbol["text-overlap"]),"text-ignore-placement":new Ai(me.layout_symbol["text-ignore-placement"]),"text-optional":new Ai(me.layout_symbol["text-optional"])})}};class K0{constructor(U){if(U.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=U.property.overrides?U.property.overrides.runtimeType:qe,this.defaultValue=U}evaluate(U){if(U.formattedSection){const ne=this.defaultValue.property.overrides;if(ne&&ne.hasOverride(U.formattedSection))return ne.getOverride(U.formattedSection)}return U.feature&&U.featureState?this.defaultValue.evaluate(U.feature,U.featureState):this.defaultValue.property.specification.default}eachChild(U){this.defaultValue.isConstant()||U(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}cn("FormatSectionOverride",K0,{omit:["defaultValue"]});class ds extends Tt{constructor(U){super(U,ah)}recalculate(U,ne){if(super.recalculate(U,ne),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const pe=this.layout.get("text-writing-mode");if(pe){const ze=[];for(const Ze of pe)ze.indexOf(Ze)<0&&ze.push(Ze);this.layout._values["text-writing-mode"]=ze}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(U,ne,pe,ze){const Ze=this.layout.get(U).evaluate(ne,{},pe,ze),Je=this._unevaluatedLayout._values[U];return Je.isDataDriven()||Ws(Je.value)||!Ze?Ze:function(ht,mt){return mt.replace(/{([^{}]+)}/g,(zt,Nt)=>ht&&Nt in ht?String(ht[Nt]):"")}(ne.properties,Ze)}createBucket(U){return new Nh(U)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const U of ah.paint.overridableProperties){if(!ds.hasPaintOverride(this.layout,U))continue;const ne=this.paint.get(U),pe=new K0(ne),ze=new ls(pe,ne.property.specification);let Ze=null;Ze=ne.value.kind==="constant"||ne.value.kind==="source"?new Zs("source",ze):new vu("composite",ze,ne.value.zoomStops),this.paint._values[U]=new da(ne.property,Ze,ne.parameters)}}_handleOverridablePaintPropertyUpdate(U,ne,pe){return!(!this.layout||ne.isDataDriven()||pe.isDataDriven())&&ds.hasPaintOverride(this.layout,U)}static hasPaintOverride(U,ne){const pe=U.get("text-field"),ze=ah.paint.properties[ne];let Ze=!1;const Je=ht=>{for(const mt of ht)if(ze.overrides&&ze.overrides.hasOverride(mt))return void(Ze=!0)};if(pe.value.kind==="constant"&&pe.value.value instanceof In)Je(pe.value.value.sections);else if(pe.value.kind==="source"){const ht=zt=>{if(!Ze)if(zt instanceof Jn&&wn(zt.value)===nt){const Nt=zt.value;Je(Nt.sections)}else zt instanceof $r?Je(zt.sections):zt.eachChild(ht)},mt=pe.value;mt._styleExpression&&ht(mt._styleExpression.expression)}return Ze}}let qd;var zo={get paint(){return qd=qd||new js({"background-color":new Ai(me.paint_background["background-color"]),"background-pattern":new es(me.paint_background["background-pattern"]),"background-opacity":new Ai(me.paint_background["background-opacity"])})}};class J0 extends Tt{constructor(U){super(U,zo)}}let Hd;var Q0={get paint(){return Hd=Hd||new js({"raster-opacity":new Ai(me.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ai(me.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ai(me.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ai(me.paint_raster["raster-brightness-max"]),"raster-saturation":new Ai(me.paint_raster["raster-saturation"]),"raster-contrast":new Ai(me.paint_raster["raster-contrast"]),"raster-resampling":new Ai(me.paint_raster["raster-resampling"]),"raster-fade-duration":new Ai(me.paint_raster["raster-fade-duration"])})}};class eg extends Tt{constructor(U){super(U,Q0)}}class ym extends Tt{constructor(U){super(U,{}),this.onAdd=ne=>{this.implementation.onAdd&&this.implementation.onAdd(ne,ne.painter.context.gl)},this.onRemove=ne=>{this.implementation.onRemove&&this.implementation.onRemove(ne,ne.painter.context.gl)},this.implementation=U}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class tg{constructor(U){this._methodToThrottle=U,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const jh=63710088e-1;class zu{constructor(U,ne){if(isNaN(U)||isNaN(ne))throw new Error(`Invalid LngLat object: (${U}, ${ne})`);if(this.lng=+U,this.lat=+ne,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new zu(k(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(U){const ne=Math.PI/180,pe=this.lat*ne,ze=U.lat*ne,Ze=Math.sin(pe)*Math.sin(ze)+Math.cos(pe)*Math.cos(ze)*Math.cos((U.lng-this.lng)*ne);return jh*Math.acos(Math.min(Ze,1))}static convert(U){if(U instanceof zu)return U;if(Array.isArray(U)&&(U.length===2||U.length===3))return new zu(Number(U[0]),Number(U[1]));if(!Array.isArray(U)&&typeof U=="object"&&U!==null)return new zu(Number("lng"in U?U.lng:U.lon),Number(U.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 up=2*Math.PI*jh;function Us(Y){return up*Math.cos(Y*Math.PI/180)}function cp(Y){return(180+Y)/360}function Uc(Y){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+Y*Math.PI/360)))/360}function hp(Y,U){return Y/Us(U)}function fp(Y){const U=180-360*Y;return 360/Math.PI*Math.atan(Math.exp(U*Math.PI/180))-90}class pp{constructor(U,ne,pe=0){this.x=+U,this.y=+ne,this.z=+pe}static fromLngLat(U,ne=0){const pe=zu.convert(U);return new pp(cp(pe.lng),Uc(pe.lat),hp(ne,pe.lat))}toLngLat(){return new zu(360*this.x-180,fp(this.y))}toAltitude(){return U=this.z,ne=this.y,U*Us(fp(ne));var U,ne}meterInMercatorCoordinateUnits(){return 1/up*(U=fp(this.y),1/Math.cos(U*Math.PI/180));var U}}function qf(Y,U,ne){var pe=2*Math.PI*6378137/256/Math.pow(2,ne);return[Y*pe-2*Math.PI*6378137/2,U*pe-2*Math.PI*6378137/2]}class oh{constructor(U,ne,pe){if(U<0||U>25||pe<0||pe>=Math.pow(2,U)||ne<0||ne>=Math.pow(2,U))throw new Error(`x=${ne}, y=${pe}, z=${U} outside of bounds. 0<=x<${Math.pow(2,U)}, 0<=y<${Math.pow(2,U)} 0<=z<=25 `);this.z=U,this.x=ne,this.y=pe,this.key=Gp(0,U,U,ne,pe)}equals(U){return this.z===U.z&&this.x===U.x&&this.y===U.y}url(U,ne,pe){const ze=(Je=this.x,ht=this.y,mt=this.z,zt=qf(256*Je,256*(ht=Math.pow(2,mt)-ht-1),mt),Nt=qf(256*(Je+1),256*(ht+1),mt),zt[0]+","+zt[1]+","+Nt[0]+","+Nt[1]),Ze=function(Xt,rn,hn){let Sn,xn="";for(let Nn=Xt;Nn>0;Nn--)Sn=1<1?"@2x":"").replace(/{quadkey}/g,Ze).replace(/{bbox-epsg-3857}/g,ze)}isChildOf(U){const ne=this.z-U.z;return ne>0&&U.x===this.x>>ne&&U.y===this.y>>ne}getTilePoint(U){const ne=Math.pow(2,this.z);return new u((U.x*ne-this.x)*Ss,(U.y*ne-this.y)*Ss)}toString(){return`${this.z}/${this.x}/${this.y}`}}class ng{constructor(U,ne){this.wrap=U,this.canonical=ne,this.key=Gp(U,ne.z,ne.z,ne.x,ne.y)}}class xc{constructor(U,ne,pe,ze,Ze){if(U= z; overscaledZ = ${U}; z = ${pe}`);this.overscaledZ=U,this.wrap=ne,this.canonical=new oh(pe,+ze,+Ze),this.key=Gp(ne,U,pe,ze,Ze)}clone(){return new xc(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(U){return this.overscaledZ===U.overscaledZ&&this.wrap===U.wrap&&this.canonical.equals(U.canonical)}scaledTo(U){if(U>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${U}; overscaledZ = ${this.overscaledZ}`);const ne=this.canonical.z-U;return U>this.canonical.z?new xc(U,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xc(U,this.wrap,U,this.canonical.x>>ne,this.canonical.y>>ne)}calculateScaledKey(U,ne){if(U>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${U}; overscaledZ = ${this.overscaledZ}`);const pe=this.canonical.z-U;return U>this.canonical.z?Gp(this.wrap*+ne,U,this.canonical.z,this.canonical.x,this.canonical.y):Gp(this.wrap*+ne,U,U,this.canonical.x>>pe,this.canonical.y>>pe)}isChildOf(U){if(U.wrap!==this.wrap)return!1;const ne=this.canonical.z-U.canonical.z;return U.overscaledZ===0||U.overscaledZ>ne&&U.canonical.y===this.canonical.y>>ne}children(U){if(this.overscaledZ>=U)return[new xc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const ne=this.canonical.z+1,pe=2*this.canonical.x,ze=2*this.canonical.y;return[new xc(ne,this.wrap,ne,pe,ze),new xc(ne,this.wrap,ne,pe+1,ze),new xc(ne,this.wrap,ne,pe,ze+1),new xc(ne,this.wrap,ne,pe+1,ze+1)]}isLessThan(U){return this.wrapU.wrap)&&(this.overscaledZU.overscaledZ)&&(this.canonical.xU.canonical.x)&&this.canonical.ythis.max&&(this.max=Xt),Xt=this.dim+1||ne<-1||ne>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(ne+1)*this.stride+(U+1)}unpack(U,ne,pe){return U*this.redFactor+ne*this.greenFactor+pe*this.blueFactor-this.baseShift}getPixels(){return new sc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(U,ne,pe){if(this.dim!==U.dim)throw new Error("dem dimension mismatch");let ze=ne*this.dim,Ze=ne*this.dim+this.dim,Je=pe*this.dim,ht=pe*this.dim+this.dim;switch(ne){case-1:ze=Ze-1;break;case 1:Ze=ze+1}switch(pe){case-1:Je=ht-1;break;case 1:ht=Je+1}const mt=-ne*this.dim,zt=-pe*this.dim;for(let Nt=Je;Nt=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${U} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[U]}}class rg{constructor(U,ne,pe,ze,Ze){this.type="Feature",this._vectorTileFeature=U,U._z=ne,U._x=pe,U._y=ze,this.properties=U.properties,this.id=Ze}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(U){this._geometry=U}toJSON(){const U={geometry:this.geometry};for(const ne in this)ne!=="_geometry"&&ne!=="_vectorTileFeature"&&(U[ne]=this[ne]);return U}}class P{constructor(U,ne){this.tileID=U,this.x=U.canonical.x,this.y=U.canonical.y,this.z=U.canonical.z,this.grid=new Jo(Ss,16,0),this.grid3D=new Jo(Ss,16,0),this.featureIndexArray=new Nr,this.promoteId=ne}insert(U,ne,pe,ze,Ze,Je){const ht=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(pe,ze,Ze);const mt=Je?this.grid3D:this.grid;for(let zt=0;zt=0&&Xt[3]>=0&&mt.insert(ht,Xt[0],Xt[1],Xt[2],Xt[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Rh.VectorTile(new sp(this.rawTileData)).layers,this.sourceLayerCoder=new Uh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(U,ne,pe,ze){this.loadVTLayers();const Ze=U.params||{},Je=Ss/U.tileSize/U.scale,ht=Ua(Ze.filter),mt=U.queryGeometry,zt=U.queryPadding*Je,Nt=re(mt),Xt=this.grid.query(Nt.minX-zt,Nt.minY-zt,Nt.maxX+zt,Nt.maxY+zt),rn=re(U.cameraQueryGeometry),hn=this.grid3D.query(rn.minX-zt,rn.minY-zt,rn.maxX+zt,rn.maxY+zt,(Nn,Gn,wr,or)=>function(gr,Wr,pi,Ci,Vi){for(const ui of gr)if(Wr<=ui.x&&pi<=ui.y&&Ci>=ui.x&&Vi>=ui.y)return!0;const ki=[new u(Wr,pi),new u(Wr,Vi),new u(Ci,Vi),new u(Ci,pi)];if(gr.length>2){for(const ui of ki)if(Cf(gr,ui))return!0}for(let ui=0;ui(or||(or=eh(gr)),Wr.queryIntersectsFeature(mt,gr,pi,or,this.z,U.transform,Je,U.pixelPosMatrix)))}return Sn}loadMatchingFeature(U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt){const rn=this.bucketLayerIDs[ne];if(Je&&!function(Nn,Gn){for(let wr=0;wr=0)return!0;return!1}(Je,rn))return;const hn=this.sourceLayerCoder.decode(pe),Sn=this.vtLayers[hn].feature(ze);if(Ze.needGeometry){const Nn=Ph(Sn,!0);if(!Ze.filter(new di(this.tileID.overscaledZ),Nn,this.tileID.canonical))return}else if(!Ze.filter(new di(this.tileID.overscaledZ),Sn))return;const xn=this.getId(Sn,hn);for(let Nn=0;Nn{const ht=U instanceof Ys?U.get(Je):null;return ht&&ht.evaluate?ht.evaluate(ne,pe,ze):ht})}function re(Y){let U=1/0,ne=1/0,pe=-1/0,ze=-1/0;for(const Ze of Y)U=Math.min(U,Ze.x),ne=Math.min(ne,Ze.y),pe=Math.max(pe,Ze.x),ze=Math.max(ze,Ze.y);return{minX:U,minY:ne,maxX:pe,maxY:ze}}function we(Y,U){return U-Y}function je(Y,U,ne,pe,ze){const Ze=[];for(let Je=0;Je=pe&&Xt.x>=pe||(Nt.x>=pe?Nt=new u(pe,Nt.y+(Xt.y-Nt.y)*((pe-Nt.x)/(Xt.x-Nt.x)))._round():Xt.x>=pe&&(Xt=new u(pe,Nt.y+(Xt.y-Nt.y)*((pe-Nt.x)/(Xt.x-Nt.x)))._round()),Nt.y>=ze&&Xt.y>=ze||(Nt.y>=ze?Nt=new u(Nt.x+(Xt.x-Nt.x)*((ze-Nt.y)/(Xt.y-Nt.y)),ze)._round():Xt.y>=ze&&(Xt=new u(Nt.x+(Xt.x-Nt.x)*((ze-Nt.y)/(Xt.y-Nt.y)),ze)._round()),mt&&Nt.equals(mt[mt.length-1])||(mt=[Nt],Ze.push(mt)),mt.push(Xt)))))}}return Ze}cn("FeatureIndex",P,{omit:["rawTileData","sourceLayerCoder"]});class Ke extends u{constructor(U,ne,pe,ze){super(U,ne),this.angle=pe,ze!==void 0&&(this.segment=ze)}clone(){return new Ke(this.x,this.y,this.angle,this.segment)}}function ot(Y,U,ne,pe,ze){if(U.segment===void 0||ne===0)return!0;let Ze=U,Je=U.segment+1,ht=0;for(;ht>-ne/2;){if(Je--,Je<0)return!1;ht-=Y[Je].dist(Ze),Ze=Y[Je]}ht+=Y[Je].dist(Y[Je+1]),Je++;const mt=[];let zt=0;for(;htpe;)zt-=mt.shift().angleDelta;if(zt>ze)return!1;Je++,ht+=Xt.dist(rn)}return!0}function _t(Y){let U=0;for(let ne=0;nezt){const Sn=(zt-mt)/hn,xn=gn.number(Xt.x,rn.x,Sn),Nn=gn.number(Xt.y,rn.y,Sn),Gn=new Ke(xn,Nn,rn.angleTo(Xt),Nt);return Gn._round(),!Je||ot(Y,Gn,ht,Je,U)?Gn:void 0}mt+=hn}}function sn(Y,U,ne,pe,ze,Ze,Je,ht,mt){const zt=Rt(pe,Ze,Je),Nt=Kt(pe,ze),Xt=Nt*Je,rn=Y[0].x===0||Y[0].x===mt||Y[0].y===0||Y[0].y===mt;return U-Xt=0&&gr=0&&Wr=0&&rn+zt<=Nt){const pi=new Ke(gr,Wr,wr,Sn);pi._round(),pe&&!ot(Y,pi,Ze,pe,ze)||hn.push(pi)}}Xt+=Gn}return ht||hn.length||Je||(hn=yn(Y,Xt/2,ne,pe,ze,Ze,Je,!0,mt)),hn}cn("Anchor",Ke);const fn=Xu;function On(Y,U,ne,pe){const ze=[],Ze=Y.image,Je=Ze.pixelRatio,ht=Ze.paddedRect.w-2*fn,mt=Ze.paddedRect.h-2*fn;let zt={x1:Y.left,y1:Y.top,x2:Y.right,y2:Y.bottom};const Nt=Ze.stretchX||[[0,ht]],Xt=Ze.stretchY||[[0,mt]],rn=(ti,Di)=>ti+Di[1]-Di[0],hn=Nt.reduce(rn,0),Sn=Xt.reduce(rn,0),xn=ht-hn,Nn=mt-Sn;let Gn=0,wr=hn,or=0,gr=Sn,Wr=0,pi=xn,Ci=0,Vi=Nn;if(Ze.content&&pe){const ti=Ze.content,Di=ti[2]-ti[0],Bi=ti[3]-ti[1];(Ze.textFitWidth||Ze.textFitHeight)&&(zt=Y0(Y)),Gn=jn(Nt,0,ti[0]),or=jn(Xt,0,ti[1]),wr=jn(Nt,ti[0],ti[2]),gr=jn(Xt,ti[1],ti[3]),Wr=ti[0]-Gn,Ci=ti[1]-or,pi=Di-wr,Vi=Bi-gr}const ki=zt.x1,ui=zt.y1,Ii=zt.x2-ki,Oi=zt.y2-ui,Si=(ti,Di,Bi,ra)=>{const oo=ir(ti.stretch-Gn,wr,Ii,ki),to=kr(ti.fixed-Wr,pi,ti.stretch,hn),Is=ir(Di.stretch-or,gr,Oi,ui),Ou=kr(Di.fixed-Ci,Vi,Di.stretch,Sn),Js=ir(Bi.stretch-Gn,wr,Ii,ki),Ps=kr(Bi.fixed-Wr,pi,Bi.stretch,hn),hu=ir(ra.stretch-or,gr,Oi,ui),Yl=kr(ra.fixed-Ci,Vi,ra.stretch,Sn),gs=new u(oo,Is),ns=new u(Js,Is),Ol=new u(Js,hu),Uo=new u(oo,hu),Qs=new u(to/Je,Ou/Je),Xl=new u(Ps/Je,Yl/Je),Du=U*Math.PI/180;if(Du){const rs=Math.sin(Du),is=Math.cos(Du),as=[is,-rs,rs,is];gs._matMult(as),ns._matMult(as),Uo._matMult(as),Ol._matMult(as)}const fu=ti.stretch+ti.fixed,ms=Bi.stretch+Bi.fixed,uc=Di.stretch+Di.fixed,Do=ra.stretch+ra.fixed;return{tl:gs,tr:ns,bl:Uo,br:Ol,tex:{x:Ze.paddedRect.x+fn+fu,y:Ze.paddedRect.y+fn+uc,w:ms-fu,h:Do-uc},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Qs,pixelOffsetBR:Xl,minFontScaleX:pi/Je/Ii,minFontScaleY:Vi/Je/Oi,isSDF:ne}};if(pe&&(Ze.stretchX||Ze.stretchY)){const ti=sr(Nt,xn,hn),Di=sr(Xt,Nn,Sn);for(let Bi=0;Bi0&&(xn=Math.max(10,xn),this.circleDiameter=xn)}else{const rn=!((Xt=Je.image)===null||Xt===void 0)&&Xt.content&&(Je.image.textFitWidth||Je.image.textFitHeight)?Y0(Je):{x1:Je.left,y1:Je.top,x2:Je.right,y2:Je.bottom};rn.y1=rn.y1*ht-mt[0],rn.y2=rn.y2*ht+mt[2],rn.x1=rn.x1*ht-mt[3],rn.x2=rn.x2*ht+mt[1];const hn=Je.collisionPadding;if(hn&&(rn.x1-=hn[0]*ht,rn.y1-=hn[1]*ht,rn.x2+=hn[2]*ht,rn.y2+=hn[3]*ht),Nt){const Sn=new u(rn.x1,rn.y1),xn=new u(rn.x2,rn.y1),Nn=new u(rn.x1,rn.y2),Gn=new u(rn.x2,rn.y2),wr=Nt*Math.PI/180;Sn._rotate(wr),xn._rotate(wr),Nn._rotate(wr),Gn._rotate(wr),rn.x1=Math.min(Sn.x,xn.x,Nn.x,Gn.x),rn.x2=Math.max(Sn.x,xn.x,Nn.x,Gn.x),rn.y1=Math.min(Sn.y,xn.y,Nn.y,Gn.y),rn.y2=Math.max(Sn.y,xn.y,Nn.y,Gn.y)}U.emplaceBack(ne.x,ne.y,rn.x1,rn.y1,rn.x2,rn.y2,pe,ze,Ze)}this.boxEndIndex=U.length}}class Fr{constructor(U=[],ne=(pe,ze)=>peze?1:0){if(this.data=U,this.length=this.data.length,this.compare=ne,this.length>0)for(let pe=(this.length>>1)-1;pe>=0;pe--)this._down(pe)}push(U){this.data.push(U),this._up(this.length++)}pop(){if(this.length===0)return;const U=this.data[0],ne=this.data.pop();return--this.length>0&&(this.data[0]=ne,this._down(0)),U}peek(){return this.data[0]}_up(U){const{data:ne,compare:pe}=this,ze=ne[U];for(;U>0;){const Ze=U-1>>1,Je=ne[Ze];if(pe(ze,Je)>=0)break;ne[U]=Je,U=Ze}ne[U]=ze}_down(U){const{data:ne,compare:pe}=this,ze=this.length>>1,Ze=ne[U];for(;U=0)break;ne[U]=ne[Je],U=Je}ne[U]=Ze}}function Gr(Y,U=1,ne=!1){let pe=1/0,ze=1/0,Ze=-1/0,Je=-1/0;const ht=Y[0];for(let xn=0;xnZe)&&(Ze=Nn.x),(!xn||Nn.y>Je)&&(Je=Nn.y)}const mt=Ze-pe,zt=Je-ze,Nt=Math.min(mt,zt);let Xt=Nt/2;const rn=new Fr([],qr);if(Nt===0)return new u(pe,ze);for(let xn=pe;xnhn.d||!hn.d)&&(hn=xn,ne&&console.log("found best %d after %d probes",Math.round(1e4*xn.d)/1e4,Sn)),xn.max-hn.d<=U||(Xt=xn.h/2,rn.push(new ri(xn.p.x-Xt,xn.p.y-Xt,Xt,Y)),rn.push(new ri(xn.p.x+Xt,xn.p.y-Xt,Xt,Y)),rn.push(new ri(xn.p.x-Xt,xn.p.y+Xt,Xt,Y)),rn.push(new ri(xn.p.x+Xt,xn.p.y+Xt,Xt,Y)),Sn+=4)}return ne&&(console.log(`num probes: ${Sn}`),console.log(`best distance: ${hn.d}`)),hn.p}function qr(Y,U){return U.max-Y.max}function ri(Y,U,ne,pe){this.p=new u(Y,U),this.h=ne,this.d=function(ze,Ze){let Je=!1,ht=1/0;for(let mt=0;mtze.y!=Sn.y>ze.y&&ze.x<(Sn.x-hn.x)*(ze.y-hn.y)/(Sn.y-hn.y)+hn.x&&(Je=!Je),ht=Math.min(ht,C0(ze,hn,Sn))}}return(Je?1:-1)*Math.sqrt(ht)}(this.p,pe),this.max=this.d+this.h*Math.SQRT2}var ei;d.ar=void 0,(ei=d.ar||(d.ar={}))[ei.center=1]="center",ei[ei.left=2]="left",ei[ei.right=3]="right",ei[ei.top=4]="top",ei[ei.bottom=5]="bottom",ei[ei["top-left"]=6]="top-left",ei[ei["top-right"]=7]="top-right",ei[ei["bottom-left"]=8]="bottom-left",ei[ei["bottom-right"]=9]="bottom-right";const vi=7,Ei=Number.POSITIVE_INFINITY;function aa(Y,U){return U[1]!==Ei?function(ne,pe,ze){let Ze=0,Je=0;switch(pe=Math.abs(pe),ze=Math.abs(ze),ne){case"top-right":case"top-left":case"top":Je=ze-vi;break;case"bottom-right":case"bottom-left":case"bottom":Je=-ze+vi}switch(ne){case"top-right":case"bottom-right":case"right":Ze=-pe;break;case"top-left":case"bottom-left":case"left":Ze=pe}return[Ze,Je]}(Y,U[0],U[1]):function(ne,pe){let ze=0,Ze=0;pe<0&&(pe=0);const Je=pe/Math.SQRT2;switch(ne){case"top-right":case"top-left":Ze=Je-vi;break;case"bottom-right":case"bottom-left":Ze=-Je+vi;break;case"bottom":Ze=-pe+vi;break;case"top":Ze=pe-vi}switch(ne){case"top-right":case"bottom-right":ze=-Je;break;case"top-left":case"bottom-left":ze=Je;break;case"left":ze=pe;break;case"right":ze=-pe}return[ze,Ze]}(Y,U[0])}function Ni(Y,U,ne){var pe;const ze=Y.layout,Ze=(pe=ze.get("text-variable-anchor-offset"))===null||pe===void 0?void 0:pe.evaluate(U,{},ne);if(Ze){const ht=Ze.values,mt=[];for(let zt=0;ztrn*hl);Nt.startsWith("top")?Xt[1]-=vi:Nt.startsWith("bottom")&&(Xt[1]+=vi),mt[zt+1]=Xt}return new Kn(mt)}const Je=ze.get("text-variable-anchor");if(Je){let ht;ht=Y._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[ze.get("text-radial-offset").evaluate(U,{},ne)*hl,Ei]:ze.get("text-offset").evaluate(U,{},ne).map(zt=>zt*hl);const mt=[];for(const zt of Je)mt.push(zt,aa(zt,ht));return new Kn(mt)}return null}function Qi(Y){switch(Y){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qi(Y,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt){let Xt=Ze.textMaxSize.evaluate(U,{});Xt===void 0&&(Xt=Je);const rn=Y.layers[0].layout,hn=rn.get("icon-offset").evaluate(U,{},Nt),Sn=Ea(ne.horizontal),xn=Je/24,Nn=Y.tilePixelRatio*xn,Gn=Y.tilePixelRatio*Xt/24,wr=Y.tilePixelRatio*ht,or=Y.tilePixelRatio*rn.get("symbol-spacing"),gr=rn.get("text-padding")*Y.tilePixelRatio,Wr=function(ti,Di,Bi,ra=1){const oo=ti.get("icon-padding").evaluate(Di,{},Bi),to=oo&&oo.values;return[to[0]*ra,to[1]*ra,to[2]*ra,to[3]*ra]}(rn,U,Nt,Y.tilePixelRatio),pi=rn.get("text-max-angle")/180*Math.PI,Ci=rn.get("text-rotation-alignment")!=="viewport"&&rn.get("symbol-placement")!=="point",Vi=rn.get("icon-rotation-alignment")==="map"&&rn.get("symbol-placement")!=="point",ki=rn.get("symbol-placement"),ui=or/2,Ii=rn.get("icon-text-fit");let Oi;pe&&Ii!=="none"&&(Y.allowVerticalPlacement&&ne.vertical&&(Oi=Fd(pe,ne.vertical,Ii,rn.get("icon-text-fit-padding"),hn,xn)),Sn&&(pe=Fd(pe,Sn,Ii,rn.get("icon-text-fit-padding"),hn,xn)));const Si=(ti,Di)=>{Di.x<0||Di.x>=Ss||Di.y<0||Di.y>=Ss||function(Bi,ra,oo,to,Is,Ou,Js,Ps,hu,Yl,gs,ns,Ol,Uo,Qs,Xl,Du,fu,ms,uc,Do,rs,is,as,Vh){const _c=Bi.addToLineVertexArray(ra,oo);let dl,no,Wo,Ic,Vc=0,Gd=0,ig=0,Wp=0,qc=-1,dp=-1;const Pc={};let Zp=Lo("");if(Bi.allowVerticalPlacement&&to.vertical){const el=Ps.layout.get("text-rotate").evaluate(Do,{},as)+90,Kl=to.vertical;Wo=new _r(hu,ra,Yl,gs,ns,Kl,Ol,Uo,Qs,el),Js&&(Ic=new _r(hu,ra,Yl,gs,ns,Js,Du,fu,Qs,el))}if(Is){const el=Ps.layout.get("icon-rotate").evaluate(Do,{}),Kl=Ps.layout.get("icon-text-fit")!=="none",Hc=On(Is,el,is,Kl),Zo=Js?On(Js,el,is,Kl):void 0;no=new _r(hu,ra,Yl,gs,ns,Is,Du,fu,!1,el),Vc=4*Hc.length;const bc=Bi.iconSizeData;let bh=null;bc.kind==="source"?(bh=[xh*Ps.layout.get("icon-size").evaluate(Do,{})],bh[0]>gf&&f(`${Bi.layerIds[0]}: Value for "icon-size" is >= ${yh}. Reduce your "icon-size".`)):bc.kind==="composite"&&(bh=[xh*rs.compositeIconSizes[0].evaluate(Do,{},as),xh*rs.compositeIconSizes[1].evaluate(Do,{},as)],(bh[0]>gf||bh[1]>gf)&&f(`${Bi.layerIds[0]}: Value for "icon-size" is >= ${yh}. Reduce your "icon-size".`)),Bi.addSymbols(Bi.icon,Hc,bh,uc,ms,Do,d.ai.none,ra,_c.lineStartIndex,_c.lineLength,-1,as),qc=Bi.icon.placedSymbolArray.length-1,Zo&&(Gd=4*Zo.length,Bi.addSymbols(Bi.icon,Zo,bh,uc,ms,Do,d.ai.vertical,ra,_c.lineStartIndex,_c.lineLength,-1,as),dp=Bi.icon.placedSymbolArray.length-1)}const $p=Object.keys(to.horizontal);for(const el of $p){const Kl=to.horizontal[el];if(!dl){Zp=Lo(Kl.text);const Zo=Ps.layout.get("text-rotate").evaluate(Do,{},as);dl=new _r(hu,ra,Yl,gs,ns,Kl,Ol,Uo,Qs,Zo)}const Hc=Kl.positionedLines.length===1;if(ig+=zi(Bi,ra,Kl,Ou,Ps,Qs,Do,Xl,_c,to.vertical?d.ai.horizontal:d.ai.horizontalOnly,Hc?$p:[el],Pc,qc,rs,as),Hc)break}to.vertical&&(Wp+=zi(Bi,ra,to.vertical,Ou,Ps,Qs,Do,Xl,_c,d.ai.vertical,["vertical"],Pc,dp,rs,as));const ag=dl?dl.boxStartIndex:Bi.collisionBoxArray.length,xm=dl?dl.boxEndIndex:Bi.collisionBoxArray.length,Yp=Wo?Wo.boxStartIndex:Bi.collisionBoxArray.length,_m=Wo?Wo.boxEndIndex:Bi.collisionBoxArray.length,bm=no?no.boxStartIndex:Bi.collisionBoxArray.length,wm=no?no.boxEndIndex:Bi.collisionBoxArray.length,Tm=Ic?Ic.boxStartIndex:Bi.collisionBoxArray.length,Wd=Ic?Ic.boxEndIndex:Bi.collisionBoxArray.length;let Ls=-1;const vf=(el,Kl)=>el&&el.circleDiameter?Math.max(el.circleDiameter,Kl):Kl;Ls=vf(dl,Ls),Ls=vf(Wo,Ls),Ls=vf(no,Ls),Ls=vf(Ic,Ls);const og=Ls>-1?1:0;og&&(Ls*=Vh/hl),Bi.glyphOffsetArray.length>=Nh.MAX_GLYPHS&&f("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Do.sortKey!==void 0&&Bi.addToSortKeyRanges(Bi.symbolInstances.length,Do.sortKey);const _h=Ni(Ps,Do,as),[Rv,Zd]=function(el,Kl){const Hc=el.length,Zo=Kl==null?void 0:Kl.values;if((Zo==null?void 0:Zo.length)>0)for(let bc=0;bc=0?Pc.right:-1,Pc.center>=0?Pc.center:-1,Pc.left>=0?Pc.left:-1,Pc.vertical||-1,qc,dp,Zp,ag,xm,Yp,_m,bm,wm,Tm,Wd,Yl,ig,Wp,Vc,Gd,og,0,Ol,Ls,Rv,Zd)}(Y,Di,ti,ne,pe,ze,Oi,Y.layers[0],Y.collisionBoxArray,U.index,U.sourceLayerIndex,Y.index,Nn,[gr,gr,gr,gr],Ci,mt,wr,Wr,Vi,hn,U,Ze,zt,Nt,Je)};if(ki==="line")for(const ti of je(U.geometry,0,0,Ss,Ss)){const Di=sn(ti,or,pi,ne.vertical||Sn,pe,24,Gn,Y.overscaling,Ss);for(const Bi of Di)Sn&&va(Y,Sn.text,ui,Bi)||Si(ti,Bi)}else if(ki==="line-center"){for(const ti of U.geometry)if(ti.length>1){const Di=nn(ti,pi,ne.vertical||Sn,pe,24,Gn);Di&&Si(ti,Di)}}else if(U.type==="Polygon")for(const ti of vl(U.geometry,0)){const Di=Gr(ti,16);Si(ti[0],new Ke(Di.x,Di.y,0))}else if(U.type==="LineString")for(const ti of U.geometry)Si(ti,new Ke(ti[0].x,ti[0].y,0));else if(U.type==="Point")for(const ti of U.geometry)for(const Di of ti)Si([Di],new Ke(Di.x,Di.y,0))}function zi(Y,U,ne,pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn){const xn=function(wr,or,gr,Wr,pi,Ci,Vi,ki){const ui=Wr.layout.get("text-rotate").evaluate(Ci,{})*Math.PI/180,Ii=[];for(const Oi of or.positionedLines)for(const Si of Oi.positionedGlyphs){if(!Si.rect)continue;const ti=Si.rect||{};let Di=Uf+1,Bi=!0,ra=1,oo=0;const to=(pi||ki)&&Si.vertical,Is=Si.metrics.advance*Si.scale/2;if(ki&&or.verticalizable){const rs=(Si.scale-1)*hl,is=(hl-Si.metrics.width*Si.scale)/2;oo=Oi.lineOffset/2-(Si.imageName?-is:rs)}if(Si.imageName){const rs=Vi[Si.imageName];Bi=rs.sdf,ra=rs.pixelRatio,Di=Xu/ra}const Ou=pi?[Si.x+Is,Si.y]:[0,0];let Js=pi?[0,0]:[Si.x+Is+gr[0],Si.y+gr[1]-oo],Ps=[0,0];to&&(Ps=Js,Js=[0,0]);const hu=Si.metrics.isDoubleResolution?2:1,Yl=(Si.metrics.left-Di)*Si.scale-Is+Js[0],gs=(-Si.metrics.top-Di)*Si.scale+Js[1],ns=Yl+ti.w/hu*Si.scale/ra,Ol=gs+ti.h/hu*Si.scale/ra,Uo=new u(Yl,gs),Qs=new u(ns,gs),Xl=new u(Yl,Ol),Du=new u(ns,Ol);if(to){const rs=new u(-Is,Is-Vf),is=-Math.PI/2,as=hl/2-Is,Vh=Si.imageName?as:0,_c=new u(5-Vf-as,-Vh),dl=new u(...Ps);Uo._rotateAround(is,rs)._add(_c)._add(dl),Qs._rotateAround(is,rs)._add(_c)._add(dl),Xl._rotateAround(is,rs)._add(_c)._add(dl),Du._rotateAround(is,rs)._add(_c)._add(dl)}if(ui){const rs=Math.sin(ui),is=Math.cos(ui),as=[is,-rs,rs,is];Uo._matMult(as),Qs._matMult(as),Xl._matMult(as),Du._matMult(as)}const fu=new u(0,0),ms=new u(0,0),uc=0,Do=0;Ii.push({tl:Uo,tr:Qs,bl:Xl,br:Du,tex:ti,writingMode:or.writingMode,glyphOffset:Ou,sectionIndex:Si.sectionIndex,isSDF:Bi,pixelOffsetTL:fu,pixelOffsetBR:ms,minFontScaleX:uc,minFontScaleY:Do})}return Ii}(0,ne,ht,ze,Ze,Je,pe,Y.allowVerticalPlacement),Nn=Y.textSizeData;let Gn=null;Nn.kind==="source"?(Gn=[xh*ze.layout.get("text-size").evaluate(Je,{})],Gn[0]>gf&&f(`${Y.layerIds[0]}: Value for "text-size" is >= ${yh}. Reduce your "text-size".`)):Nn.kind==="composite"&&(Gn=[xh*hn.compositeTextSizes[0].evaluate(Je,{},Sn),xh*hn.compositeTextSizes[1].evaluate(Je,{},Sn)],(Gn[0]>gf||Gn[1]>gf)&&f(`${Y.layerIds[0]}: Value for "text-size" is >= ${yh}. Reduce your "text-size".`)),Y.addSymbols(Y.text,xn,Gn,ht,Ze,Je,zt,U,mt.lineStartIndex,mt.lineLength,rn,Sn);for(const wr of Nt)Xt[wr]=Y.text.placedSymbolArray.length-1;return 4*xn.length}function Ea(Y){for(const U in Y)return Y[U];return null}function va(Y,U,ne,pe){const ze=Y.compareText;if(U in ze){const Ze=ze[U];for(let Je=Ze.length-1;Je>=0;Je--)if(pe.dist(Ze[Je])>4;if(ze!==1)throw new Error(`Got v${ze} data when expected v1.`);const Ze=yo[15&pe];if(!Ze)throw new Error("Unrecognized array type.");const[Je]=new Uint16Array(U,2,1),[ht]=new Uint32Array(U,4,1);return new Zi(ht,Je,Ze,U)}constructor(U,ne=64,pe=Float64Array,ze){if(isNaN(U)||U<0)throw new Error(`Unpexpected numItems value: ${U}.`);this.numItems=+U,this.nodeSize=Math.min(Math.max(+ne,2),65535),this.ArrayType=pe,this.IndexArrayType=U<65536?Uint16Array:Uint32Array;const Ze=yo.indexOf(this.ArrayType),Je=2*U*this.ArrayType.BYTES_PER_ELEMENT,ht=U*this.IndexArrayType.BYTES_PER_ELEMENT,mt=(8-ht%8)%8;if(Ze<0)throw new Error(`Unexpected typed array class: ${pe}.`);ze&&ze instanceof ArrayBuffer?(this.data=ze,this.ids=new this.IndexArrayType(this.data,8,U),this.coords=new this.ArrayType(this.data,8+ht+mt,2*U),this._pos=2*U,this._finished=!0):(this.data=new ArrayBuffer(8+Je+ht+mt),this.ids=new this.IndexArrayType(this.data,8,U),this.coords=new this.ArrayType(this.data,8+ht+mt,2*U),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Ze]),new Uint16Array(this.data,2,1)[0]=ne,new Uint32Array(this.data,4,1)[0]=U)}add(U,ne){const pe=this._pos>>1;return this.ids[pe]=pe,this.coords[this._pos++]=U,this.coords[this._pos++]=ne,pe}finish(){const U=this._pos>>1;if(U!==this.numItems)throw new Error(`Added ${U} items when expected ${this.numItems}.`);return Ka(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(U,ne,pe,ze){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ze,coords:Je,nodeSize:ht}=this,mt=[0,Ze.length-1,0],zt=[];for(;mt.length;){const Nt=mt.pop()||0,Xt=mt.pop()||0,rn=mt.pop()||0;if(Xt-rn<=ht){for(let Nn=rn;Nn<=Xt;Nn++){const Gn=Je[2*Nn],wr=Je[2*Nn+1];Gn>=U&&Gn<=pe&&wr>=ne&&wr<=ze&&zt.push(Ze[Nn])}continue}const hn=rn+Xt>>1,Sn=Je[2*hn],xn=Je[2*hn+1];Sn>=U&&Sn<=pe&&xn>=ne&&xn<=ze&&zt.push(Ze[hn]),(Nt===0?U<=Sn:ne<=xn)&&(mt.push(rn),mt.push(hn-1),mt.push(1-Nt)),(Nt===0?pe>=Sn:ze>=xn)&&(mt.push(hn+1),mt.push(Xt),mt.push(1-Nt))}return zt}within(U,ne,pe){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:ze,coords:Ze,nodeSize:Je}=this,ht=[0,ze.length-1,0],mt=[],zt=pe*pe;for(;ht.length;){const Nt=ht.pop()||0,Xt=ht.pop()||0,rn=ht.pop()||0;if(Xt-rn<=Je){for(let Nn=rn;Nn<=Xt;Nn++)xo(Ze[2*Nn],Ze[2*Nn+1],U,ne)<=zt&&mt.push(ze[Nn]);continue}const hn=rn+Xt>>1,Sn=Ze[2*hn],xn=Ze[2*hn+1];xo(Sn,xn,U,ne)<=zt&&mt.push(ze[hn]),(Nt===0?U-pe<=Sn:ne-pe<=xn)&&(ht.push(rn),ht.push(hn-1),ht.push(1-Nt)),(Nt===0?U+pe>=Sn:ne+pe>=xn)&&(ht.push(hn+1),ht.push(Xt),ht.push(1-Nt))}return mt}}function Ka(Y,U,ne,pe,ze,Ze){if(ze-pe<=ne)return;const Je=pe+ze>>1;Ba(Y,U,Je,pe,ze,Ze),Ka(Y,U,ne,pe,Je-1,1-Ze),Ka(Y,U,ne,Je+1,ze,1-Ze)}function Ba(Y,U,ne,pe,ze,Ze){for(;ze>pe;){if(ze-pe>600){const zt=ze-pe+1,Nt=ne-pe+1,Xt=Math.log(zt),rn=.5*Math.exp(2*Xt/3),hn=.5*Math.sqrt(Xt*rn*(zt-rn)/zt)*(Nt-zt/2<0?-1:1);Ba(Y,U,ne,Math.max(pe,Math.floor(ne-Nt*rn/zt+hn)),Math.min(ze,Math.floor(ne+(zt-Nt)*rn/zt+hn)),Ze)}const Je=U[2*ne+Ze];let ht=pe,mt=ze;for(Ja(Y,U,pe,ne),U[2*ze+Ze]>Je&&Ja(Y,U,pe,ze);htJe;)mt--}U[2*pe+Ze]===Je?Ja(Y,U,pe,mt):(mt++,Ja(Y,U,mt,ze)),mt<=ne&&(pe=mt+1),ne<=mt&&(ze=mt-1)}}function Ja(Y,U,ne,pe){Eo(Y,ne,pe),Eo(U,2*ne,2*pe),Eo(U,2*ne+1,2*pe+1)}function Eo(Y,U,ne){const pe=Y[U];Y[U]=Y[ne],Y[ne]=pe}function xo(Y,U,ne,pe){const ze=Y-ne,Ze=U-pe;return ze*ze+Ze*Ze}var Es;d.bf=void 0,(Es=d.bf||(d.bf={})).create="create",Es.load="load",Es.fullLoad="fullLoad";let Oo=null,Cs=[];const pl=1e3/60,jo="loadTime",ea="fullLoadTime",zl={mark(Y){performance.mark(Y)},frame(Y){const U=Y;if(Oo!=null){const ne=U-Oo;Cs.push(ne)}Oo=U},clearMetrics(){Oo=null,Cs=[],performance.clearMeasures(jo),performance.clearMeasures(ea);for(const Y in d.bf)performance.clearMarks(d.bf[Y])},getPerformanceMetrics(){performance.measure(jo,d.bf.create,d.bf.load),performance.measure(ea,d.bf.create,d.bf.fullLoad);const Y=performance.getEntriesByName(jo)[0].duration,U=performance.getEntriesByName(ea)[0].duration,ne=Cs.length,pe=1/(Cs.reduce((Ze,Je)=>Ze+Je,0)/ne/1e3),ze=Cs.filter(Ze=>Ze>pl).reduce((Ze,Je)=>Ze+(Je-pl)/pl,0);return{loadTime:Y,fullLoadTime:U,fps:pe,percentDroppedFrames:ze/(ne+ze)*100,totalFrames:ne}}};d.$=class extends q{},d.A=rh,d.B=El,d.C=function(Y){if(B==null){const U=Y.navigator?Y.navigator.userAgent:null;B=!!Y.safari||!(!U||!(/\b(iPad|iPhone|iPod)\b/.test(U)||U.match("Safari")&&!U.match("Chrome")))}return B},d.D=Ai,d.E=ye,d.F=class{constructor(Y,U){this.target=Y,this.mapId=U,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new tg(()=>this.process()),this.subscription=function(ne,pe,ze,Ze){return ne.addEventListener(pe,ze,Ze),{unsubscribe:()=>{ne.removeEventListener(pe,ze,Ze)}}}(this.target,"message",ne=>this.receive(ne),!1),this.globalScope=I(self)?Y:window}registerMessageHandler(Y,U){this.messageHandlers[Y]=U}sendAsync(Y,U){return new Promise((ne,pe)=>{const ze=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[ze]={resolve:ne,reject:pe},U&&U.signal.addEventListener("abort",()=>{delete this.resolveRejects[ze];const ht={id:ze,type:"",origin:location.origin,targetMapId:Y.targetMapId,sourceMapId:this.mapId};this.target.postMessage(ht)},{once:!0});const Ze=[],Je=Object.assign(Object.assign({},Y),{id:ze,sourceMapId:this.mapId,origin:location.origin,data:ta(Y.data,Ze)});this.target.postMessage(Je,{transfer:Ze})})}receive(Y){const U=Y.data,ne=U.id;if(!(U.origin!=="file://"&&location.origin!=="file://"&&U.origin!=="resource://android"&&location.origin!=="resource://android"&&U.origin!==location.origin||U.targetMapId&&this.mapId!==U.targetMapId)){if(U.type===""){delete this.tasks[ne];const pe=this.abortControllers[ne];return delete this.abortControllers[ne],void(pe&&pe.abort())}if(I(self)||U.mustQueue)return this.tasks[ne]=U,this.taskQueue.push(ne),void this.invoker.trigger();this.processTask(ne,U)}}process(){if(this.taskQueue.length===0)return;const Y=this.taskQueue.shift(),U=this.tasks[Y];delete this.tasks[Y],this.taskQueue.length>0&&this.invoker.trigger(),U&&this.processTask(Y,U)}processTask(Y,U){return e(this,void 0,void 0,function*(){if(U.type===""){const ze=this.resolveRejects[Y];return delete this.resolveRejects[Y],ze?void(U.error?ze.reject(Qo(U.error)):ze.resolve(Qo(U.data))):void 0}if(!this.messageHandlers[U.type])return void this.completeTask(Y,new Error(`Could not find a registered handler for ${U.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const ne=Qo(U.data),pe=new AbortController;this.abortControllers[Y]=pe;try{const ze=yield this.messageHandlers[U.type](U.sourceMapId,ne,pe);this.completeTask(Y,null,ze)}catch(ze){this.completeTask(Y,ze)}})}completeTask(Y,U,ne){const pe=[];delete this.abortControllers[Y];const ze={id:Y,type:"",sourceMapId:this.mapId,origin:location.origin,error:U?ta(U):null,data:ta(ne,pe)};this.target.postMessage(ze,{transfer:pe})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},d.G=K,d.H=function(){var Y=new rh(16);return rh!=Float32Array&&(Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0),Y[0]=1,Y[5]=1,Y[10]=1,Y[15]=1,Y},d.I=Z0,d.J=function(Y,U,ne){var pe,ze,Ze,Je,ht,mt,zt,Nt,Xt,rn,hn,Sn,xn=ne[0],Nn=ne[1],Gn=ne[2];return U===Y?(Y[12]=U[0]*xn+U[4]*Nn+U[8]*Gn+U[12],Y[13]=U[1]*xn+U[5]*Nn+U[9]*Gn+U[13],Y[14]=U[2]*xn+U[6]*Nn+U[10]*Gn+U[14],Y[15]=U[3]*xn+U[7]*Nn+U[11]*Gn+U[15]):(pe=U[0],ze=U[1],Ze=U[2],Je=U[3],ht=U[4],mt=U[5],zt=U[6],Nt=U[7],Xt=U[8],rn=U[9],hn=U[10],Sn=U[11],Y[0]=pe,Y[1]=ze,Y[2]=Ze,Y[3]=Je,Y[4]=ht,Y[5]=mt,Y[6]=zt,Y[7]=Nt,Y[8]=Xt,Y[9]=rn,Y[10]=hn,Y[11]=Sn,Y[12]=pe*xn+ht*Nn+Xt*Gn+U[12],Y[13]=ze*xn+mt*Nn+rn*Gn+U[13],Y[14]=Ze*xn+zt*Nn+hn*Gn+U[14],Y[15]=Je*xn+Nt*Nn+Sn*Gn+U[15]),Y},d.K=function(Y,U,ne){var pe=ne[0],ze=ne[1],Ze=ne[2];return Y[0]=U[0]*pe,Y[1]=U[1]*pe,Y[2]=U[2]*pe,Y[3]=U[3]*pe,Y[4]=U[4]*ze,Y[5]=U[5]*ze,Y[6]=U[6]*ze,Y[7]=U[7]*ze,Y[8]=U[8]*Ze,Y[9]=U[9]*Ze,Y[10]=U[10]*Ze,Y[11]=U[11]*Ze,Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15],Y},d.L=L0,d.M=function(Y,U){const ne={};for(let pe=0;pe{const U=window.document.createElement("video");return U.muted=!0,new Promise(ne=>{U.onloadstart=()=>{ne(U)};for(const pe of Y){const ze=window.document.createElement("source");fe(pe)||(U.crossOrigin="Anonymous"),ze.src=pe,U.appendChild(ze)}})},d.a4=function(){return v++},d.a5=Xn,d.a6=Nh,d.a7=Ua,d.a8=Ph,d.a9=di,d.aA=function(Y){Y=Y.slice();const U=Object.create(null);for(let ne=0;ne{"source"in Je&&pe[Je.source]?ne.push({command:"removeLayer",args:[Je.id]}):Ze.push(Je)}),ne=ne.concat(ze),function(Je,ht,mt){ht=ht||[];const zt=(Je=Je||[]).map(Pe),Nt=ht.map(Pe),Xt=Je.reduce(de,{}),rn=ht.reduce(de,{}),hn=zt.slice(),Sn=Object.create(null);let xn,Nn,Gn,wr,or;for(let gr=0,Wr=0;gr@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(ne,pe,ze,Ze)=>{const Je=ze||Ze;return U[pe]=!Je||Je.toLowerCase(),""}),U["max-age"]){const ne=parseInt(U["max-age"],10);isNaN(ne)?delete U["max-age"]:U["max-age"]=ne}return U},d.ac=function(Y,U){const ne=[];for(const pe in Y)pe in U||ne.push(pe);return ne},d.ad=g,d.ae=function(Y,U,ne){var pe=Math.sin(ne),ze=Math.cos(ne),Ze=U[0],Je=U[1],ht=U[2],mt=U[3],zt=U[4],Nt=U[5],Xt=U[6],rn=U[7];return U!==Y&&(Y[8]=U[8],Y[9]=U[9],Y[10]=U[10],Y[11]=U[11],Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15]),Y[0]=Ze*ze+zt*pe,Y[1]=Je*ze+Nt*pe,Y[2]=ht*ze+Xt*pe,Y[3]=mt*ze+rn*pe,Y[4]=zt*ze-Ze*pe,Y[5]=Nt*ze-Je*pe,Y[6]=Xt*ze-ht*pe,Y[7]=rn*ze-mt*pe,Y},d.af=function(Y){var U=new rh(16);return U[0]=Y[0],U[1]=Y[1],U[2]=Y[2],U[3]=Y[3],U[4]=Y[4],U[5]=Y[5],U[6]=Y[6],U[7]=Y[7],U[8]=Y[8],U[9]=Y[9],U[10]=Y[10],U[11]=Y[11],U[12]=Y[12],U[13]=Y[13],U[14]=Y[14],U[15]=Y[15],U},d.ag=af,d.ah=function(Y,U){let ne=0,pe=0;if(Y.kind==="constant")pe=Y.layoutSize;else if(Y.kind!=="source"){const{interpolationType:ze,minZoom:Ze,maxZoom:Je}=Y,ht=ze?g(qn.interpolationFactor(ze,U,Ze,Je),0,1):0;Y.kind==="camera"?pe=gn.number(Y.minSize,Y.maxSize,ht):ne=ht}return{uSizeT:ne,uSize:pe}},d.aj=function(Y,{uSize:U,uSizeT:ne},{lowerSize:pe,upperSize:ze}){return Y.kind==="source"?pe/xh:Y.kind==="composite"?gn.number(pe/xh,ze/xh,ne):U},d.ak=Nd,d.al=function(Y,U,ne,pe){const ze=U.y-Y.y,Ze=U.x-Y.x,Je=pe.y-ne.y,ht=pe.x-ne.x,mt=Je*Ze-ht*ze;if(mt===0)return null;const zt=(ht*(Y.y-ne.y)-Je*(Y.x-ne.x))/mt;return new u(Y.x+zt*Ze,Y.y+zt*ze)},d.am=je,d.an=M0,d.ao=xd,d.ap=function(Y){let U=1/0,ne=1/0,pe=-1/0,ze=-1/0;for(const Ze of Y)U=Math.min(U,Ze.x),ne=Math.min(ne,Ze.y),pe=Math.max(pe,Ze.x),ze=Math.max(ze,Ze.y);return[U,ne,pe,ze]},d.aq=hl,d.as=X0,d.at=function(Y,U){var ne=U[0],pe=U[1],ze=U[2],Ze=U[3],Je=U[4],ht=U[5],mt=U[6],zt=U[7],Nt=U[8],Xt=U[9],rn=U[10],hn=U[11],Sn=U[12],xn=U[13],Nn=U[14],Gn=U[15],wr=ne*ht-pe*Je,or=ne*mt-ze*Je,gr=ne*zt-Ze*Je,Wr=pe*mt-ze*ht,pi=pe*zt-Ze*ht,Ci=ze*zt-Ze*mt,Vi=Nt*xn-Xt*Sn,ki=Nt*Nn-rn*Sn,ui=Nt*Gn-hn*Sn,Ii=Xt*Nn-rn*xn,Oi=Xt*Gn-hn*xn,Si=rn*Gn-hn*Nn,ti=wr*Si-or*Oi+gr*Ii+Wr*ui-pi*ki+Ci*Vi;return ti?(ti=1/ti,Y[0]=(ht*Si-mt*Oi+zt*Ii)*ti,Y[1]=(ze*Oi-pe*Si-Ze*Ii)*ti,Y[2]=(xn*Ci-Nn*pi+Gn*Wr)*ti,Y[3]=(rn*pi-Xt*Ci-hn*Wr)*ti,Y[4]=(mt*ui-Je*Si-zt*ki)*ti,Y[5]=(ne*Si-ze*ui+Ze*ki)*ti,Y[6]=(Nn*gr-Sn*Ci-Gn*or)*ti,Y[7]=(Nt*Ci-rn*gr+hn*or)*ti,Y[8]=(Je*Oi-ht*ui+zt*Vi)*ti,Y[9]=(pe*ui-ne*Oi-Ze*Vi)*ti,Y[10]=(Sn*pi-xn*gr+Gn*wr)*ti,Y[11]=(Xt*gr-Nt*pi-hn*wr)*ti,Y[12]=(ht*ki-Je*Ii-mt*Vi)*ti,Y[13]=(ne*Ii-pe*ki+ze*Vi)*ti,Y[14]=(xn*or-Sn*Wr-Nn*wr)*ti,Y[15]=(Nt*Wr-Xt*or+rn*wr)*ti,Y):null},d.au=Qi,d.av=df,d.aw=Zi,d.ax=function(){const Y={},U=me.$version;for(const ne in me.$root){const pe=me.$root[ne];if(pe.required){let ze=null;ze=ne==="version"?U:pe.type==="array"?[]:{},ze!=null&&(Y[ne]=ze)}}return Y},d.ay=ac,d.az=se,d.b=N,d.b0=function(Y,U){return Y[0]=U[0],Y[1]=U[1],Y[2]=U[2],Y[3]=U[3],Y[4]=U[4],Y[5]=U[5],Y[6]=U[6],Y[7]=U[7],Y[8]=U[8],Y[9]=U[9],Y[10]=U[10],Y[11]=U[11],Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15],Y},d.b1=qg,d.b2=function(Y,U){return Y[0]*U[0]+Y[1]*U[1]+Y[2]*U[2]+Y[3]*U[3]},d.b3=k,d.b4=ng,d.b5=hp,d.b6=xv,d.b7=function(Y,U,ne){var pe=Math.sin(ne),ze=Math.cos(ne),Ze=U[4],Je=U[5],ht=U[6],mt=U[7],zt=U[8],Nt=U[9],Xt=U[10],rn=U[11];return U!==Y&&(Y[0]=U[0],Y[1]=U[1],Y[2]=U[2],Y[3]=U[3],Y[12]=U[12],Y[13]=U[13],Y[14]=U[14],Y[15]=U[15]),Y[4]=Ze*ze+zt*pe,Y[5]=Je*ze+Nt*pe,Y[6]=ht*ze+Xt*pe,Y[7]=mt*ze+rn*pe,Y[8]=zt*ze-Ze*pe,Y[9]=Nt*ze-Je*pe,Y[10]=Xt*ze-ht*pe,Y[11]=rn*ze-mt*pe,Y},d.b8=x,d.b9=m,d.bA=function(Y){return Y.message===H},d.bB=bl,d.bC=Cl,d.ba=function(Y){return Y*Math.PI/180},d.bb=function(Y,U){return Y[0]=U[0],Y[1]=0,Y[2]=0,Y[3]=0,Y[4]=0,Y[5]=U[1],Y[6]=0,Y[7]=0,Y[8]=0,Y[9]=0,Y[10]=U[2],Y[11]=0,Y[12]=0,Y[13]=0,Y[14]=0,Y[15]=1,Y},d.bc=class extends F{},d.bd=jh,d.be=zl,d.bg=ae,d.bh=function(Y,U){Q.REGISTERED_PROTOCOLS[Y]=U},d.bi=function(Y){delete Q.REGISTERED_PROTOCOLS[Y]},d.bj=function(Y,U){const ne={};for(let ze=0;zeti*hl)}let ui=ht?"center":pe.get("text-justify").evaluate(Nt,{},Y.canonical);const Ii=pe.get("symbol-placement")==="point"?pe.get("text-max-width").evaluate(Nt,{},Y.canonical)*hl:1/0,Oi=()=>{Y.bucket.allowVerticalPlacement&&Io(Wr)&&(xn.vertical=pf(Nn,Y.glyphMap,Y.glyphPositions,Y.imagePositions,Xt,Ii,Je,Vi,"left",Ci,wr,d.ai.vertical,!0,hn,rn))};if(!ht&&ki){const Si=new Set;if(ui==="auto")for(let Di=0;Die(void 0,void 0,void 0,function*(){if(Y.byteLength===0)return createImageBitmap(new ImageData(1,1));const U=new Blob([new Uint8Array(Y)],{type:"image/png"});try{return createImageBitmap(U)}catch(ne){throw new Error(`Could not load image because of ${ne.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),d.e=A,d.f=Y=>new Promise((U,ne)=>{const pe=new Image;pe.onload=()=>{U(pe),URL.revokeObjectURL(pe.src),pe.onload=null,window.requestAnimationFrame(()=>{pe.src=V})},pe.onerror=()=>ne(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 ze=new Blob([new Uint8Array(Y)],{type:"image/png"});pe.src=Y.byteLength?URL.createObjectURL(ze):V}),d.g=Z,d.h=(Y,U)=>he(A(Y,{type:"json"}),U),d.i=I,d.j=ge,d.k=le,d.l=(Y,U)=>he(A(Y,{type:"arrayBuffer"}),U),d.m=he,d.n=function(Y){return new sp(Y).readFields(zd,[])},d.o=zh,d.p=fm,d.q=js,d.r=iu,d.s=fe,d.t=As,d.u=yi,d.v=me,d.w=f,d.x=Ns,d.y=function([Y,U,ne]){return U+=90,U*=Math.PI/180,ne*=Math.PI/180,{x:Y*Math.cos(U)*Math.sin(ne),y:Y*Math.sin(U)*Math.sin(ne),z:Y*Math.cos(ne)}},d.z=gn}),b("worker",0,function(d){class e{constructor(Qe){this.keyCache={},Qe&&this.replace(Qe)}replace(Qe){this._layerConfigs={},this._layers={},this.update(Qe,[])}update(Qe,pt){for(const Ot of Qe){this._layerConfigs[Ot.id]=Ot;const Pt=this._layers[Ot.id]=d.aB(Ot);Pt._featureFilter=d.a7(Pt.filter),this.keyCache[Ot.id]&&delete this.keyCache[Ot.id]}for(const Ot of pt)delete this.keyCache[Ot],delete this._layerConfigs[Ot],delete this._layers[Ot];this.familiesBySource={};const yt=d.bj(Object.values(this._layerConfigs),this.keyCache);for(const Ot of yt){const Pt=Ot.map(vt=>this._layers[vt.id]),at=Pt[0];if(at.visibility==="none")continue;const lt=at.source||"";let Xe=this.familiesBySource[lt];Xe||(Xe=this.familiesBySource[lt]={});const ut=at.sourceLayer||"_geojsonTileLayer";let wt=Xe[ut];wt||(wt=Xe[ut]=[]),wt.push(Pt)}}}class w{constructor(Qe){const pt={},yt=[];for(const lt in Qe){const Xe=Qe[lt],ut=pt[lt]={};for(const wt in Xe){const vt=Xe[+wt];if(!vt||vt.bitmap.width===0||vt.bitmap.height===0)continue;const Lt={x:0,y:0,w:vt.bitmap.width+2,h:vt.bitmap.height+2};yt.push(Lt),ut[wt]={rect:Lt,metrics:vt.metrics}}}const{w:Ot,h:Pt}=d.p(yt),at=new d.o({width:Ot||1,height:Pt||1});for(const lt in Qe){const Xe=Qe[lt];for(const ut in Xe){const wt=Xe[+ut];if(!wt||wt.bitmap.width===0||wt.bitmap.height===0)continue;const vt=pt[lt][ut].rect;d.o.copy(wt.bitmap,at,{x:0,y:0},{x:vt.x+1,y:vt.y+1},wt.bitmap)}}this.image=at,this.positions=pt}}d.bk("GlyphAtlas",w);class y{constructor(Qe){this.tileID=new d.S(Qe.tileID.overscaledZ,Qe.tileID.wrap,Qe.tileID.canonical.z,Qe.tileID.canonical.x,Qe.tileID.canonical.y),this.uid=Qe.uid,this.zoom=Qe.zoom,this.pixelRatio=Qe.pixelRatio,this.tileSize=Qe.tileSize,this.source=Qe.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Qe.showCollisionBoxes,this.collectResourceTiming=!!Qe.collectResourceTiming,this.returnDependencies=!!Qe.returnDependencies,this.promoteId=Qe.promoteId,this.inFlightDependencies=[]}parse(Qe,pt,yt,Ot){return d._(this,void 0,void 0,function*(){this.status="parsing",this.data=Qe,this.collisionBoxArray=new d.a5;const Pt=new d.bl(Object.keys(Qe.layers).sort()),at=new d.bm(this.tileID,this.promoteId);at.bucketLayerIDs=[];const lt={},Xe={featureIndex:at,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:yt},ut=pt.familiesBySource[this.source];for(const qt in ut){const en=Qe.layers[qt];if(!en)continue;en.version===1&&d.w(`Vector tile source "${this.source}" layer "${qt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Wt=Pt.encode(qt),Zt=[];for(let on=0;on=un.maxzoom||un.visibility!=="none"&&(_(on,this.zoom,yt),(lt[un.id]=un.createBucket({index:at.bucketLayerIDs.length,layers:on,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Wt,sourceID:this.source})).populate(Zt,Xe,this.tileID.canonical),at.bucketLayerIDs.push(on.map(Pn=>Pn.id)))}}const wt=d.aG(Xe.glyphDependencies,qt=>Object.keys(qt).map(Number));this.inFlightDependencies.forEach(qt=>qt==null?void 0:qt.abort()),this.inFlightDependencies=[];let vt=Promise.resolve({});if(Object.keys(wt).length){const qt=new AbortController;this.inFlightDependencies.push(qt),vt=Ot.sendAsync({type:"GG",data:{stacks:wt,source:this.source,tileID:this.tileID,type:"glyphs"}},qt)}const Lt=Object.keys(Xe.iconDependencies);let jt=Promise.resolve({});if(Lt.length){const qt=new AbortController;this.inFlightDependencies.push(qt),jt=Ot.sendAsync({type:"GI",data:{icons:Lt,source:this.source,tileID:this.tileID,type:"icons"}},qt)}const rt=Object.keys(Xe.patternDependencies);let et=Promise.resolve({});if(rt.length){const qt=new AbortController;this.inFlightDependencies.push(qt),et=Ot.sendAsync({type:"GI",data:{icons:rt,source:this.source,tileID:this.tileID,type:"patterns"}},qt)}const[Et,Bt,Ft]=yield Promise.all([vt,jt,et]),St=new w(Et),Jt=new d.bn(Bt,Ft);for(const qt in lt){const en=lt[qt];en instanceof d.a6?(_(en.layers,this.zoom,yt),d.bo({bucket:en,glyphMap:Et,glyphPositions:St.positions,imageMap:Bt,imagePositions:Jt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):en.hasPattern&&(en instanceof d.bp||en instanceof d.bq||en instanceof d.br)&&(_(en.layers,this.zoom,yt),en.addFeatures(Xe,this.tileID.canonical,Jt.patternPositions))}return this.status="done",{buckets:Object.values(lt).filter(qt=>!qt.isEmpty()),featureIndex:at,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:St.image,imageAtlas:Jt,glyphMap:this.returnDependencies?Et:null,iconMap:this.returnDependencies?Bt:null,glyphPositions:this.returnDependencies?St.positions:null}})}}function _(st,Qe,pt){const yt=new d.a9(Qe);for(const Ot of st)Ot.recalculate(yt,pt)}class u{constructor(Qe,pt,yt){this.actor=Qe,this.layerIndex=pt,this.availableImages=yt,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Qe,pt){return d._(this,void 0,void 0,function*(){const yt=yield d.l(Qe.request,pt);try{return{vectorTile:new d.bs.VectorTile(new d.bt(yt.data)),rawData:yt.data,cacheControl:yt.cacheControl,expires:yt.expires}}catch(Ot){const Pt=new Uint8Array(yt.data),at=Pt[0]===31&&Pt[1]===139;let lt=`Unable to parse the tile at ${Qe.request.url}, `;throw lt+=at?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ot.message}`,new Error(lt)}})}loadTile(Qe){return d._(this,void 0,void 0,function*(){const pt=Qe.uid,yt=!!(Qe&&Qe.request&&Qe.request.collectResourceTiming)&&new d.bu(Qe.request),Ot=new y(Qe);this.loading[pt]=Ot;const Pt=new AbortController;Ot.abort=Pt;try{const at=yield this.loadVectorTile(Qe,Pt);if(delete this.loading[pt],!at)return null;const lt=at.rawData,Xe={};at.expires&&(Xe.expires=at.expires),at.cacheControl&&(Xe.cacheControl=at.cacheControl);const ut={};if(yt){const vt=yt.finish();vt&&(ut.resourceTiming=JSON.parse(JSON.stringify(vt)))}Ot.vectorTile=at.vectorTile;const wt=Ot.parse(at.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[pt]=Ot,this.fetching[pt]={rawTileData:lt,cacheControl:Xe,resourceTiming:ut};try{const vt=yield wt;return d.e({rawTileData:lt.slice(0)},vt,Xe,ut)}finally{delete this.fetching[pt]}}catch(at){throw delete this.loading[pt],Ot.status="done",this.loaded[pt]=Ot,at}})}reloadTile(Qe){return d._(this,void 0,void 0,function*(){const pt=Qe.uid;if(!this.loaded||!this.loaded[pt])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const yt=this.loaded[pt];if(yt.showCollisionBoxes=Qe.showCollisionBoxes,yt.status==="parsing"){const Ot=yield yt.parse(yt.vectorTile,this.layerIndex,this.availableImages,this.actor);let Pt;if(this.fetching[pt]){const{rawTileData:at,cacheControl:lt,resourceTiming:Xe}=this.fetching[pt];delete this.fetching[pt],Pt=d.e({rawTileData:at.slice(0)},Ot,lt,Xe)}else Pt=Ot;return Pt}if(yt.status==="done"&&yt.vectorTile)return yt.parse(yt.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Qe){return d._(this,void 0,void 0,function*(){const pt=this.loading,yt=Qe.uid;pt&&pt[yt]&&pt[yt].abort&&(pt[yt].abort.abort(),delete pt[yt])})}removeTile(Qe){return d._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Qe.uid]&&delete this.loaded[Qe.uid]})}}class r{constructor(){this.loaded={}}loadTile(Qe){return d._(this,void 0,void 0,function*(){const{uid:pt,encoding:yt,rawImageData:Ot,redFactor:Pt,greenFactor:at,blueFactor:lt,baseShift:Xe}=Qe,ut=Ot.width+2,wt=Ot.height+2,vt=d.b(Ot)?new d.R({width:ut,height:wt},yield d.bv(Ot,-1,-1,ut,wt)):Ot,Lt=new d.bw(pt,vt,yt,Pt,at,lt,Xe);return this.loaded=this.loaded||{},this.loaded[pt]=Lt,Lt})}removeTile(Qe){const pt=this.loaded,yt=Qe.uid;pt&&pt[yt]&&delete pt[yt]}}var n=function st(Qe,pt){var yt,Ot=Qe&&Qe.type;if(Ot==="FeatureCollection")for(yt=0;yt=Math.abs(lt)?pt-Xe+lt:lt-Xe+pt,pt=Xe}pt+yt>=0!=!!Qe&&st.reverse()}var s=d.bx(n);const c=d.bs.VectorTileFeature.prototype.toGeoJSON;let h=class{constructor(st){this._feature=st,this.extent=d.X,this.type=st.type,this.properties=st.tags,"id"in st&&!isNaN(st.id)&&(this.id=parseInt(st.id,10))}loadGeometry(){if(this._feature.type===1){const st=[];for(const Qe of this._feature.geometry)st.push([new d.P(Qe[0],Qe[1])]);return st}{const st=[];for(const Qe of this._feature.geometry){const pt=[];for(const yt of Qe)pt.push(new d.P(yt[0],yt[1]));st.push(pt)}return st}}toGeoJSON(st,Qe,pt){return c.call(this,st,Qe,pt)}},x=class{constructor(st){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=d.X,this.length=st.length,this._features=st}feature(st){return new h(this._features[st])}};var m={exports:{}},g=d.by,k=d.bs.VectorTileFeature,A=v;function v(st,Qe){this.options=Qe||{},this.features=st,this.length=st.length}function S(st,Qe){this.id=typeof st.id=="number"?st.id:void 0,this.type=st.type,this.rawGeometry=st.type===1?[st.geometry]:st.geometry,this.properties=st.tags,this.extent=Qe||4096}v.prototype.feature=function(st){return new S(this.features[st],this.options.extent)},S.prototype.loadGeometry=function(){var st=this.rawGeometry;this.geometry=[];for(var Qe=0;Qe>31}function V(st,Qe){for(var pt=st.loadGeometry(),yt=st.type,Ot=0,Pt=0,at=pt.length,lt=0;ltst},J=Math.fround||(Q=new Float32Array(1),st=>(Q[0]=+st,Q[0]));var Q;const Z=3,K=5,ae=6;class se{constructor(Qe){this.options=Object.assign(Object.create(H),Qe),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Qe){const{log:pt,minZoom:yt,maxZoom:Ot}=this.options;pt&&console.time("total time");const Pt=`prepare ${Qe.length} points`;pt&&console.time(Pt),this.points=Qe;const at=[];for(let Xe=0;Xe=yt;Xe--){const ut=+Date.now();lt=this.trees[Xe]=this._createTree(this._cluster(lt,Xe)),pt&&console.log("z%d: %d clusters in %dms",Xe,lt.numItems,+Date.now()-ut)}return pt&&console.timeEnd("total time"),this}getClusters(Qe,pt){let yt=((Qe[0]+180)%360+360)%360-180;const Ot=Math.max(-90,Math.min(90,Qe[1]));let Pt=Qe[2]===180?180:((Qe[2]+180)%360+360)%360-180;const at=Math.max(-90,Math.min(90,Qe[3]));if(Qe[2]-Qe[0]>=360)yt=-180,Pt=180;else if(yt>Pt){const vt=this.getClusters([yt,Ot,180,at],pt),Lt=this.getClusters([-180,Ot,Pt,at],pt);return vt.concat(Lt)}const lt=this.trees[this._limitZoom(pt)],Xe=lt.range(ie(yt),oe(at),ie(Pt),oe(Ot)),ut=lt.data,wt=[];for(const vt of Xe){const Lt=this.stride*vt;wt.push(ut[Lt+K]>1?he(ut,Lt,this.clusterProps):this.points[ut[Lt+Z]])}return wt}getChildren(Qe){const pt=this._getOriginId(Qe),yt=this._getOriginZoom(Qe),Ot="No cluster with the specified id.",Pt=this.trees[yt];if(!Pt)throw new Error(Ot);const at=Pt.data;if(pt*this.stride>=at.length)throw new Error(Ot);const lt=this.options.radius/(this.options.extent*Math.pow(2,yt-1)),Xe=at[pt*this.stride],ut=at[pt*this.stride+1],wt=Pt.within(Xe,ut,lt),vt=[];for(const Lt of wt){const jt=Lt*this.stride;at[jt+4]===Qe&&vt.push(at[jt+K]>1?he(at,jt,this.clusterProps):this.points[at[jt+Z]])}if(vt.length===0)throw new Error(Ot);return vt}getLeaves(Qe,pt,yt){pt=pt||10,yt=yt||0;const Ot=[];return this._appendLeaves(Ot,Qe,pt,yt,0),Ot}getTile(Qe,pt,yt){const Ot=this.trees[this._limitZoom(Qe)],Pt=Math.pow(2,Qe),{extent:at,radius:lt}=this.options,Xe=lt/at,ut=(yt-Xe)/Pt,wt=(yt+1+Xe)/Pt,vt={features:[]};return this._addTileFeatures(Ot.range((pt-Xe)/Pt,ut,(pt+1+Xe)/Pt,wt),Ot.data,pt,yt,Pt,vt),pt===0&&this._addTileFeatures(Ot.range(1-Xe/Pt,ut,1,wt),Ot.data,Pt,yt,Pt,vt),pt===Pt-1&&this._addTileFeatures(Ot.range(0,ut,Xe/Pt,wt),Ot.data,-1,yt,Pt,vt),vt.features.length?vt:null}getClusterExpansionZoom(Qe){let pt=this._getOriginZoom(Qe)-1;for(;pt<=this.options.maxZoom;){const yt=this.getChildren(Qe);if(pt++,yt.length!==1)break;Qe=yt[0].properties.cluster_id}return pt}_appendLeaves(Qe,pt,yt,Ot,Pt){const at=this.getChildren(pt);for(const lt of at){const Xe=lt.properties;if(Xe&&Xe.cluster?Pt+Xe.point_count<=Ot?Pt+=Xe.point_count:Pt=this._appendLeaves(Qe,Xe.cluster_id,yt,Ot,Pt):Pt1;let wt,vt,Lt;if(ut)wt=fe(pt,Xe,this.clusterProps),vt=pt[Xe],Lt=pt[Xe+1];else{const et=this.points[pt[Xe+Z]];wt=et.properties;const[Et,Bt]=et.geometry.coordinates;vt=ie(Et),Lt=oe(Bt)}const jt={type:1,geometry:[[Math.round(this.options.extent*(vt*Pt-yt)),Math.round(this.options.extent*(Lt*Pt-Ot))]],tags:wt};let rt;rt=ut||this.options.generateId?pt[Xe+Z]:this.points[pt[Xe+Z]].id,rt!==void 0&&(jt.id=rt),at.features.push(jt)}}_limitZoom(Qe){return Math.max(this.options.minZoom,Math.min(Math.floor(+Qe),this.options.maxZoom+1))}_cluster(Qe,pt){const{radius:yt,extent:Ot,reduce:Pt,minPoints:at}=this.options,lt=yt/(Ot*Math.pow(2,pt)),Xe=Qe.data,ut=[],wt=this.stride;for(let vt=0;vtpt&&(Et+=Xe[Ft+K])}if(Et>et&&Et>=at){let Bt,Ft=Lt*et,St=jt*et,Jt=-1;const qt=((vt/wt|0)<<5)+(pt+1)+this.points.length;for(const en of rt){const Wt=en*wt;if(Xe[Wt+2]<=pt)continue;Xe[Wt+2]=pt;const Zt=Xe[Wt+K];Ft+=Xe[Wt]*Zt,St+=Xe[Wt+1]*Zt,Xe[Wt+4]=qt,Pt&&(Bt||(Bt=this._map(Xe,vt,!0),Jt=this.clusterProps.length,this.clusterProps.push(Bt)),Pt(Bt,this._map(Xe,Wt)))}Xe[vt+4]=qt,ut.push(Ft/Et,St/Et,1/0,qt,-1,Et),Pt&&ut.push(Jt)}else{for(let Bt=0;Bt1)for(const Bt of rt){const Ft=Bt*wt;if(!(Xe[Ft+2]<=pt)){Xe[Ft+2]=pt;for(let St=0;St>5}_getOriginZoom(Qe){return(Qe-this.points.length)%32}_map(Qe,pt,yt){if(Qe[pt+K]>1){const at=this.clusterProps[Qe[pt+ae]];return yt?Object.assign({},at):at}const Ot=this.points[Qe[pt+Z]].properties,Pt=this.options.map(Ot);return yt&&Pt===Ot?Object.assign({},Pt):Pt}}function he(st,Qe,pt){return{type:"Feature",id:st[Qe+Z],properties:fe(st,Qe,pt),geometry:{type:"Point",coordinates:[(yt=st[Qe],360*(yt-.5)),le(st[Qe+1])]}};var yt}function fe(st,Qe,pt){const yt=st[Qe+K],Ot=yt>=1e4?`${Math.round(yt/1e3)}k`:yt>=1e3?Math.round(yt/100)/10+"k":yt,Pt=st[Qe+ae],at=Pt===-1?{}:Object.assign({},pt[Pt]);return Object.assign(at,{cluster:!0,cluster_id:st[Qe+Z],point_count:yt,point_count_abbreviated:Ot})}function ie(st){return st/360+.5}function oe(st){const Qe=Math.sin(st*Math.PI/180),pt=.5-.25*Math.log((1+Qe)/(1-Qe))/Math.PI;return pt<0?0:pt>1?1:pt}function le(st){const Qe=(180-360*st)*Math.PI/180;return 360*Math.atan(Math.exp(Qe))/Math.PI-90}function ge(st,Qe,pt,yt){let Ot=yt;const Pt=Qe+(pt-Qe>>1);let at,lt=pt-Qe;const Xe=st[Qe],ut=st[Qe+1],wt=st[pt],vt=st[pt+1];for(let Lt=Qe+3;LtOt)at=Lt,Ot=jt;else if(jt===Ot){const rt=Math.abs(Lt-Pt);rtyt&&(at-Qe>3&&ge(st,Qe,at,yt),st[at+2]=Ot,pt-at>3&&ge(st,at,pt,yt))}function ye(st,Qe,pt,yt,Ot,Pt){let at=Ot-pt,lt=Pt-yt;if(at!==0||lt!==0){const Xe=((st-pt)*at+(Qe-yt)*lt)/(at*at+lt*lt);Xe>1?(pt=Ot,yt=Pt):Xe>0&&(pt+=at*Xe,yt+=lt*Xe)}return at=st-pt,lt=Qe-yt,at*at+lt*lt}function me(st,Qe,pt,yt){const Ot={id:st??null,type:Qe,geometry:pt,tags:yt,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Qe==="Point"||Qe==="MultiPoint"||Qe==="LineString")be(Ot,pt);else if(Qe==="Polygon")be(Ot,pt[0]);else if(Qe==="MultiLineString")for(const Pt of pt)be(Ot,Pt);else if(Qe==="MultiPolygon")for(const Pt of pt)be(Ot,Pt[0]);return Ot}function be(st,Qe){for(let pt=0;pt0&&(at+=yt?(Ot*wt-ut*Pt)/2:Math.sqrt(Math.pow(ut-Ot,2)+Math.pow(wt-Pt,2))),Ot=ut,Pt=wt}const lt=Qe.length-3;Qe[2]=1,ge(Qe,0,lt,pt),Qe[lt+2]=1,Qe.size=Math.abs(at),Qe.start=0,Qe.end=Qe.size}function Le(st,Qe,pt,yt){for(let Ot=0;Ot1?1:pt}function Ie(st,Qe,pt,yt,Ot,Pt,at,lt){if(yt/=Qe,Pt>=(pt/=Qe)&&at=yt)return null;const Xe=[];for(const ut of st){const wt=ut.geometry;let vt=ut.type;const Lt=Ot===0?ut.minX:ut.minY,jt=Ot===0?ut.maxX:ut.maxY;if(Lt>=pt&&jt=yt)continue;let rt=[];if(vt==="Point"||vt==="MultiPoint")Ve(wt,rt,pt,yt,Ot);else if(vt==="LineString")Pe(wt,rt,pt,yt,Ot,!1,lt.lineMetrics);else if(vt==="MultiLineString")Me(wt,rt,pt,yt,Ot,!1);else if(vt==="Polygon")Me(wt,rt,pt,yt,Ot,!0);else if(vt==="MultiPolygon")for(const et of wt){const Et=[];Me(et,Et,pt,yt,Ot,!0),Et.length&&rt.push(Et)}if(rt.length){if(lt.lineMetrics&&vt==="LineString"){for(const et of rt)Xe.push(me(ut.id,vt,et,ut.tags));continue}vt!=="LineString"&&vt!=="MultiLineString"||(rt.length===1?(vt="LineString",rt=rt[0]):vt="MultiLineString"),vt!=="Point"&&vt!=="MultiPoint"||(vt=rt.length===3?"Point":"MultiPoint"),Xe.push(me(ut.id,vt,rt,ut.tags))}}return Xe.length?Xe:null}function Ve(st,Qe,pt,yt,Ot){for(let Pt=0;Pt=pt&&at<=yt&&ke(Qe,st[Pt],st[Pt+1],st[Pt+2])}}function Pe(st,Qe,pt,yt,Ot,Pt,at){let lt=de(st);const Xe=Ot===0?He:Fe;let ut,wt,vt=st.start;for(let Bt=0;Btpt&&(wt=Xe(lt,Ft,St,qt,en,pt),at&&(lt.start=vt+ut*wt)):Wt>yt?Zt=pt&&(wt=Xe(lt,Ft,St,qt,en,pt),on=!0),Zt>yt&&Wt<=yt&&(wt=Xe(lt,Ft,St,qt,en,yt),on=!0),!Pt&&on&&(at&&(lt.end=vt+ut*wt),Qe.push(lt),lt=de(st)),at&&(vt+=ut)}let Lt=st.length-3;const jt=st[Lt],rt=st[Lt+1],et=st[Lt+2],Et=Ot===0?jt:rt;Et>=pt&&Et<=yt&&ke(lt,jt,rt,et),Lt=lt.length-3,Pt&&Lt>=3&&(lt[Lt]!==lt[0]||lt[Lt+1]!==lt[1])&&ke(lt,lt[0],lt[1],lt[2]),lt.length&&Qe.push(lt)}function de(st){const Qe=[];return Qe.size=st.size,Qe.start=st.start,Qe.end=st.end,Qe}function Me(st,Qe,pt,yt,Ot,Pt){for(const at of st)Pe(at,Qe,pt,yt,Ot,Pt,!1)}function ke(st,Qe,pt,yt){st.push(Qe,pt,yt)}function He(st,Qe,pt,yt,Ot,Pt){const at=(Pt-Qe)/(yt-Qe);return ke(st,Pt,pt+(Ot-pt)*at,1),at}function Fe(st,Qe,pt,yt,Ot,Pt){const at=(Pt-pt)/(Ot-pt);return ke(st,Qe+(yt-Qe)*at,Pt,1),at}function qe(st,Qe){const pt=[];for(let yt=0;yt0&&Qe.size<(Ot?at:yt))return void(pt.numPoints+=Qe.length/3);const lt=[];for(let Xe=0;Xeat)&&(pt.numSimplified++,lt.push(Qe[Xe],Qe[Xe+1])),pt.numPoints++;Ot&&function(Xe,ut){let wt=0;for(let vt=0,Lt=Xe.length,jt=Lt-2;vt0===ut)for(let vt=0,Lt=Xe.length;vt24)throw new Error("maxZoom should be in the 0-24 range");if(pt.promoteId&&pt.generateId)throw new Error("promoteId and generateId cannot be used together.");let Ot=function(Pt,at){const lt=[];if(Pt.type==="FeatureCollection")for(let Xe=0;Xe1&&console.time("creation"),jt=this.tiles[Lt]=De(Qe,pt,yt,Ot,ut),this.tileCoords.push({z:pt,x:yt,y:Ot}),wt)){wt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",pt,yt,Ot,jt.numFeatures,jt.numPoints,jt.numSimplified),console.timeEnd("creation"));const Zt=`z${pt}`;this.stats[Zt]=(this.stats[Zt]||0)+1,this.total++}if(jt.source=Qe,Pt==null){if(pt===ut.indexMaxZoom||jt.numPoints<=ut.indexMaxPoints)continue}else{if(pt===ut.maxZoom||pt===Pt)continue;if(Pt!=null){const Zt=Pt-pt;if(yt!==at>>Zt||Ot!==lt>>Zt)continue}}if(jt.source=null,Qe.length===0)continue;wt>1&&console.time("clipping");const rt=.5*ut.buffer/ut.extent,et=.5-rt,Et=.5+rt,Bt=1+rt;let Ft=null,St=null,Jt=null,qt=null,en=Ie(Qe,vt,yt-rt,yt+Et,0,jt.minX,jt.maxX,ut),Wt=Ie(Qe,vt,yt+et,yt+Bt,0,jt.minX,jt.maxX,ut);Qe=null,en&&(Ft=Ie(en,vt,Ot-rt,Ot+Et,1,jt.minY,jt.maxY,ut),St=Ie(en,vt,Ot+et,Ot+Bt,1,jt.minY,jt.maxY,ut),en=null),Wt&&(Jt=Ie(Wt,vt,Ot-rt,Ot+Et,1,jt.minY,jt.maxY,ut),qt=Ie(Wt,vt,Ot+et,Ot+Bt,1,jt.minY,jt.maxY,ut),Wt=null),wt>1&&console.timeEnd("clipping"),Xe.push(Ft||[],pt+1,2*yt,2*Ot),Xe.push(St||[],pt+1,2*yt,2*Ot+1),Xe.push(Jt||[],pt+1,2*yt+1,2*Ot),Xe.push(qt||[],pt+1,2*yt+1,2*Ot+1)}}getTile(Qe,pt,yt){Qe=+Qe,pt=+pt,yt=+yt;const Ot=this.options,{extent:Pt,debug:at}=Ot;if(Qe<0||Qe>24)return null;const lt=1<1&&console.log("drilling down to z%d-%d-%d",Qe,pt,yt);let ut,wt=Qe,vt=pt,Lt=yt;for(;!ut&&wt>0;)wt--,vt>>=1,Lt>>=1,ut=this.tiles[ft(wt,vt,Lt)];return ut&&ut.source?(at>1&&(console.log("found parent tile z%d-%d-%d",wt,vt,Lt),console.time("drilling down")),this.splitTile(ut.source,wt,vt,Lt,Qe,pt,yt),at>1&&console.timeEnd("drilling down"),this.tiles[Xe]?Ye(this.tiles[Xe],Pt):null):null}}function ft(st,Qe,pt){return 32*((1<{Lt.properties=rt;const et={};for(const Et of jt)et[Et]=ut[Et].evaluate(vt,Lt);return et},lt.reduce=(rt,et)=>{Lt.properties=et;for(const Et of jt)vt.accumulated=rt[Et],rt[Et]=wt[Et].evaluate(vt,Lt)},lt}(Qe)).load((yield this._pendingData).features):(Ot=yield this._pendingData,Pt=Qe.geojsonVtOptions,new nt(Ot,Pt)),this.loaded={};const at={};if(yt){const lt=yt.finish();lt&&(at.resourceTiming={},at.resourceTiming[Qe.source]=JSON.parse(JSON.stringify(lt)))}return at}catch(at){if(delete this._pendingRequest,d.bA(at))return{abandoned:!0};throw at}var Ot,Pt})}getData(){return d._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Qe){const pt=this.loaded,yt=Qe.uid;return pt&&pt[yt]?super.reloadTile(Qe):this.loadTile(Qe)}loadAndProcessGeoJSON(Qe,pt){return d._(this,void 0,void 0,function*(){let yt=yield this.loadGeoJSON(Qe,pt);if(delete this._pendingRequest,typeof yt!="object")throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`);if(s(yt,!0),Qe.filter){const Ot=d.bB(Qe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ot.result==="error")throw new Error(Ot.value.map(at=>`${at.key}: ${at.message}`).join(", "));yt={type:"FeatureCollection",features:yt.features.filter(at=>Ot.value.evaluate({zoom:0},at))}}return yt})}loadGeoJSON(Qe,pt){return d._(this,void 0,void 0,function*(){const{promoteId:yt}=Qe;if(Qe.request){const Ot=yield d.h(Qe.request,pt);return this._dataUpdateable=kt(Ot.data,yt)?Vt(Ot.data,yt):void 0,Ot.data}if(typeof Qe.data=="string")try{const Ot=JSON.parse(Qe.data);return this._dataUpdateable=kt(Ot,yt)?Vt(Ot,yt):void 0,Ot}catch{throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`)}if(!Qe.dataDiff)throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Qe.source}`);return function(Ot,Pt,at){var lt,Xe,ut,wt;if(Pt.removeAll&&Ot.clear(),Pt.remove)for(const vt of Pt.remove)Ot.delete(vt);if(Pt.add)for(const vt of Pt.add){const Lt=At(vt,at);Lt!=null&&Ot.set(Lt,vt)}if(Pt.update)for(const vt of Pt.update){let Lt=Ot.get(vt.id);if(Lt==null)continue;const jt=vt.newGeometry||vt.removeAllProperties,rt=!vt.removeAllProperties&&(((lt=vt.removeProperties)===null||lt===void 0?void 0:lt.length)>0||((Xe=vt.addOrUpdateProperties)===null||Xe===void 0?void 0:Xe.length)>0);if((jt||rt)&&(Lt=Object.assign({},Lt),Ot.set(vt.id,Lt),rt&&(Lt.properties=Object.assign({},Lt.properties))),vt.newGeometry&&(Lt.geometry=vt.newGeometry),vt.removeAllProperties)Lt.properties={};else if(((ut=vt.removeProperties)===null||ut===void 0?void 0:ut.length)>0)for(const et of vt.removeProperties)Object.prototype.hasOwnProperty.call(Lt.properties,et)&&delete Lt.properties[et];if(((wt=vt.addOrUpdateProperties)===null||wt===void 0?void 0:wt.length)>0)for(const{key:et,value:Et}of vt.addOrUpdateProperties)Lt.properties[et]=Et}}(this._dataUpdateable,Qe.dataDiff,yt),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Qe){return d._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Qe){return this._geoJSONIndex.getClusterExpansionZoom(Qe.clusterId)}getClusterChildren(Qe){return this._geoJSONIndex.getChildren(Qe.clusterId)}getClusterLeaves(Qe){return this._geoJSONIndex.getLeaves(Qe.clusterId,Qe.limit,Qe.offset)}}class Gt{constructor(Qe){this.self=Qe,this.actor=new d.F(Qe),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(pt,yt)=>{if(this.externalWorkerSourceTypes[pt])throw new Error(`Worker source with name "${pt}" already registered.`);this.externalWorkerSourceTypes[pt]=yt},this.self.addProtocol=d.bh,this.self.removeProtocol=d.bi,this.self.registerRTLTextPlugin=pt=>{if(d.bC.isParsed())throw new Error("RTL text plugin already registered.");d.bC.setMethods(pt)},this.actor.registerMessageHandler("LDT",(pt,yt)=>this._getDEMWorkerSource(pt,yt.source).loadTile(yt)),this.actor.registerMessageHandler("RDT",(pt,yt)=>d._(this,void 0,void 0,function*(){this._getDEMWorkerSource(pt,yt.source).removeTile(yt)})),this.actor.registerMessageHandler("GCEZ",(pt,yt)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource(pt,yt.type,yt.source).getClusterExpansionZoom(yt)})),this.actor.registerMessageHandler("GCC",(pt,yt)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource(pt,yt.type,yt.source).getClusterChildren(yt)})),this.actor.registerMessageHandler("GCL",(pt,yt)=>d._(this,void 0,void 0,function*(){return this._getWorkerSource(pt,yt.type,yt.source).getClusterLeaves(yt)})),this.actor.registerMessageHandler("LD",(pt,yt)=>this._getWorkerSource(pt,yt.type,yt.source).loadData(yt)),this.actor.registerMessageHandler("GD",(pt,yt)=>this._getWorkerSource(pt,yt.type,yt.source).getData()),this.actor.registerMessageHandler("LT",(pt,yt)=>this._getWorkerSource(pt,yt.type,yt.source).loadTile(yt)),this.actor.registerMessageHandler("RT",(pt,yt)=>this._getWorkerSource(pt,yt.type,yt.source).reloadTile(yt)),this.actor.registerMessageHandler("AT",(pt,yt)=>this._getWorkerSource(pt,yt.type,yt.source).abortTile(yt)),this.actor.registerMessageHandler("RMT",(pt,yt)=>this._getWorkerSource(pt,yt.type,yt.source).removeTile(yt)),this.actor.registerMessageHandler("RS",(pt,yt)=>d._(this,void 0,void 0,function*(){if(!this.workerSources[pt]||!this.workerSources[pt][yt.type]||!this.workerSources[pt][yt.type][yt.source])return;const Ot=this.workerSources[pt][yt.type][yt.source];delete this.workerSources[pt][yt.type][yt.source],Ot.removeSource!==void 0&&Ot.removeSource(yt)})),this.actor.registerMessageHandler("RM",pt=>d._(this,void 0,void 0,function*(){delete this.layerIndexes[pt],delete this.availableImages[pt],delete this.workerSources[pt],delete this.demWorkerSources[pt]})),this.actor.registerMessageHandler("SR",(pt,yt)=>d._(this,void 0,void 0,function*(){this.referrer=yt})),this.actor.registerMessageHandler("SRPS",(pt,yt)=>this._syncRTLPluginState(pt,yt)),this.actor.registerMessageHandler("IS",(pt,yt)=>d._(this,void 0,void 0,function*(){this.self.importScripts(yt)})),this.actor.registerMessageHandler("SI",(pt,yt)=>this._setImages(pt,yt)),this.actor.registerMessageHandler("UL",(pt,yt)=>d._(this,void 0,void 0,function*(){this._getLayerIndex(pt).update(yt.layers,yt.removedIds)})),this.actor.registerMessageHandler("SL",(pt,yt)=>d._(this,void 0,void 0,function*(){this._getLayerIndex(pt).replace(yt)}))}_setImages(Qe,pt){return d._(this,void 0,void 0,function*(){this.availableImages[Qe]=pt;for(const yt in this.workerSources[Qe]){const Ot=this.workerSources[Qe][yt];for(const Pt in Ot)Ot[Pt].availableImages=pt}})}_syncRTLPluginState(Qe,pt){return d._(this,void 0,void 0,function*(){if(d.bC.isParsed())return d.bC.getState();if(pt.pluginStatus!=="loading")return d.bC.setState(pt),pt;const yt=pt.pluginURL;if(this.self.importScripts(yt),d.bC.isParsed()){const Ot={pluginStatus:"loaded",pluginURL:yt};return d.bC.setState(Ot),Ot}throw d.bC.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${yt}`)})}_getAvailableImages(Qe){let pt=this.availableImages[Qe];return pt||(pt=[]),pt}_getLayerIndex(Qe){let pt=this.layerIndexes[Qe];return pt||(pt=this.layerIndexes[Qe]=new e),pt}_getWorkerSource(Qe,pt,yt){if(this.workerSources[Qe]||(this.workerSources[Qe]={}),this.workerSources[Qe][pt]||(this.workerSources[Qe][pt]={}),!this.workerSources[Qe][pt][yt]){const Ot={sendAsync:(Pt,at)=>(Pt.targetMapId=Qe,this.actor.sendAsync(Pt,at))};switch(pt){case"vector":this.workerSources[Qe][pt][yt]=new u(Ot,this._getLayerIndex(Qe),this._getAvailableImages(Qe));break;case"geojson":this.workerSources[Qe][pt][yt]=new Ht(Ot,this._getLayerIndex(Qe),this._getAvailableImages(Qe));break;default:this.workerSources[Qe][pt][yt]=new this.externalWorkerSourceTypes[pt](Ot,this._getLayerIndex(Qe),this._getAvailableImages(Qe))}}return this.workerSources[Qe][pt][yt]}_getDEMWorkerSource(Qe,pt){return this.demWorkerSources[Qe]||(this.demWorkerSources[Qe]={}),this.demWorkerSources[Qe][pt]||(this.demWorkerSources[Qe][pt]=new r),this.demWorkerSources[Qe][pt]}}return d.i(self)&&(self.worker=new Gt(self)),Gt}),b("index",0,function(d,e){var w="4.5.2";let y,_;const u={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync(R){return new Promise((i,a)=>{const C=requestAnimationFrame(i);R.signal.addEventListener("abort",()=>{cancelAnimationFrame(C),a(e.c())})})},getImageData(R,i=0){return this.getImageCanvasContext(R).getImageData(-i,-i,R.width+2*i,R.height+2*i)},getImageCanvasContext(R){const i=window.document.createElement("canvas"),a=i.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return i.width=R.width,i.height=R.height,a.drawImage(R,0,0,R.width,R.height),a},resolveURL(R){return y||(y=document.createElement("a")),y.href=R,y.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(_==null&&(_=matchMedia("(prefers-reduced-motion: reduce)")),_.matches)}};class r{static testProp(i){if(!r.docStyle)return i[0];for(let a=0;a{window.removeEventListener("click",r.suppressClickInternal,!0)},0)}static getScale(i){const a=i.getBoundingClientRect();return{x:a.width/i.offsetWidth||1,y:a.height/i.offsetHeight||1,boundingClientRect:a}}static getPoint(i,a,C){const F=a.boundingClientRect;return new e.P((C.clientX-F.left)/a.x-i.clientLeft,(C.clientY-F.top)/a.y-i.clientTop)}static mousePos(i,a){const C=r.getScale(i);return r.getPoint(i,C,a)}static touchPos(i,a){const C=[],F=r.getScale(i);for(let q=0;q{l&&h(l),l=null,c=!0},o.onerror=()=>{s=!0,l=null},o.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(R){let i,a,C,F;R.resetRequestQueue=()=>{i=[],a=0,C=0,F={}},R.addThrottleControl=ve=>{const Ae=C++;return F[Ae]=ve,Ae},R.removeThrottleControl=ve=>{delete F[ve],te()},R.getImage=(ve,Ae,Re=!0)=>new Promise((Ue,it)=>{n.supported&&(ve.headers||(ve.headers={}),ve.headers.accept="image/webp,*/*"),e.e(ve,{type:"image"});const ct={abortController:Ae,requestParameters:ve,supportImageRefresh:Re,state:"queued",onError:dt=>{it(dt)},onSuccess:dt=>{Ue(dt)}};i.push(ct),te()});const q=ve=>e._(this,void 0,void 0,function*(){ve.state="running";const{requestParameters:Ae,supportImageRefresh:Re,onError:Ue,onSuccess:it,abortController:ct}=ve,dt=Re===!1&&!e.i(self)&&!e.g(Ae.url)&&(!Ae.headers||Object.keys(Ae.headers).reduce((Mt,Ut)=>Mt&&Ut==="accept",!0));a++;const bt=dt?ue(Ae,ct):e.m(Ae,ct);try{const Mt=yield bt;delete ve.abortController,ve.state="completed",Mt.data instanceof HTMLImageElement||e.b(Mt.data)?it(Mt):Mt.data&&it({data:yield(Ct=Mt.data,typeof createImageBitmap=="function"?e.d(Ct):e.f(Ct)),cacheControl:Mt.cacheControl,expires:Mt.expires})}catch(Mt){delete ve.abortController,Ue(Mt)}finally{a--,te()}var Ct}),te=()=>{const ve=(()=>{for(const Ae of Object.keys(F))if(F[Ae]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Ae=a;Ae0;Ae++){const Re=i.shift();Re.abortController.signal.aborted?Ae--:q(Re)}},ue=(ve,Ae)=>new Promise((Re,Ue)=>{const it=new Image,ct=ve.url,dt=ve.credentials;dt&&dt==="include"?it.crossOrigin="use-credentials":(dt&&dt==="same-origin"||!e.s(ct))&&(it.crossOrigin="anonymous"),Ae.signal.addEventListener("abort",()=>{it.src="",Ue(e.c())}),it.fetchPriority="high",it.onload=()=>{it.onerror=it.onload=null,Re({data:it})},it.onerror=()=>{it.onerror=it.onload=null,Ae.signal.aborted||Ue(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."))},it.src=ct})}(x||(x={})),x.resetRequestQueue();class m{constructor(i){this._transformRequestFn=i}transformRequest(i,a){return this._transformRequestFn&&this._transformRequestFn(i,a)||{url:i}}setTransformRequest(i){this._transformRequestFn=i}}function g(R){var i=new e.A(3);return i[0]=R[0],i[1]=R[1],i[2]=R[2],i}var k,A=function(R,i,a){return R[0]=i[0]-a[0],R[1]=i[1]-a[1],R[2]=i[2]-a[2],R};k=new e.A(3),e.A!=Float32Array&&(k[0]=0,k[1]=0,k[2]=0);var v=function(R){var i=R[0],a=R[1];return i*i+a*a};function S(R){const i=[];if(typeof R=="string")i.push({id:"default",url:R});else if(R&&R.length>0){const a=[];for(const{id:C,url:F}of R){const q=`${C}${F}`;a.indexOf(q)===-1&&(a.push(q),i.push({id:C,url:F}))}}return i}function T(R,i,a){const C=R.split("?");return C[0]+=`${i}${a}`,C.join("?")}function p(R,i,a,C){return e._(this,void 0,void 0,function*(){const F=S(R),q=a>1?"@2x":"",te={},ue={};for(const{id:ve,url:Ae}of F){const Re=i.transformRequest(T(Ae,q,".json"),"SpriteJSON");te[ve]=e.h(Re,C);const Ue=i.transformRequest(T(Ae,q,".png"),"SpriteImage");ue[ve]=x.getImage(Ue,C)}return yield Promise.all([...Object.values(te),...Object.values(ue)]),function(ve,Ae){return e._(this,void 0,void 0,function*(){const Re={};for(const Ue in ve){Re[Ue]={};const it=u.getImageCanvasContext((yield Ae[Ue]).data),ct=(yield ve[Ue]).data;for(const dt in ct){const{width:bt,height:Ct,x:Mt,y:Ut,sdf:It,pixelRatio:Qt,stretchX:tn,stretchY:Yt,content:vn,textFitWidth:Mn,textFitHeight:Vn}=ct[dt],Hn={width:bt,height:Ct,x:Mt,y:Ut,context:it};Re[Ue][dt]={data:null,pixelRatio:Qt,sdf:It,stretchX:tn,stretchY:Yt,content:vn,textFitWidth:Mn,textFitHeight:Vn,spriteData:Hn}}}return Re})}(te,ue)})}(function(){var R=new e.A(2);e.A!=Float32Array&&(R[0]=0,R[1]=0)})();class M{constructor(i,a,C,F){this.context=i,this.format=C,this.texture=i.gl.createTexture(),this.update(a,F)}update(i,a,C){const{width:F,height:q}=i,te=!(this.size&&this.size[0]===F&&this.size[1]===q||C),{context:ue}=this,{gl:ve}=ue;if(this.useMipmap=!!(a&&a.useMipmap),ve.bindTexture(ve.TEXTURE_2D,this.texture),ue.pixelStoreUnpackFlipY.set(!1),ue.pixelStoreUnpack.set(1),ue.pixelStoreUnpackPremultiplyAlpha.set(this.format===ve.RGBA&&(!a||a.premultiply!==!1)),te)this.size=[F,q],i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||e.b(i)?ve.texImage2D(ve.TEXTURE_2D,0,this.format,this.format,ve.UNSIGNED_BYTE,i):ve.texImage2D(ve.TEXTURE_2D,0,this.format,F,q,0,this.format,ve.UNSIGNED_BYTE,i.data);else{const{x:Ae,y:Re}=C||{x:0,y:0};i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageData||e.b(i)?ve.texSubImage2D(ve.TEXTURE_2D,0,Ae,Re,ve.RGBA,ve.UNSIGNED_BYTE,i):ve.texSubImage2D(ve.TEXTURE_2D,0,Ae,Re,F,q,ve.RGBA,ve.UNSIGNED_BYTE,i.data)}this.useMipmap&&this.isSizePowerOfTwo()&&ve.generateMipmap(ve.TEXTURE_2D)}bind(i,a,C){const{context:F}=this,{gl:q}=F;q.bindTexture(q.TEXTURE_2D,this.texture),C!==q.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(C=q.LINEAR),i!==this.filter&&(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MAG_FILTER,i),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER,C||i),this.filter=i),a!==this.wrap&&(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_S,a),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_T,a),this.wrap=a)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:i}=this.context;i.deleteTexture(this.texture),this.texture=null}}function f(R){const{userImage:i}=R;return!!(i&&i.render&&i.render())&&(R.data.replace(new Uint8Array(i.data.buffer)),!0)}class E extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(i){if(this.loaded!==i&&(this.loaded=i,i)){for(const{ids:a,promiseResolve:C}of this.requestors)C(this._getImagesForIds(a));this.requestors=[]}}getImage(i){const a=this.images[i];if(a&&!a.data&&a.spriteData){const C=a.spriteData;a.data=new e.R({width:C.width,height:C.height},C.context.getImageData(C.x,C.y,C.width,C.height).data),a.spriteData=null}return a}addImage(i,a){if(this.images[i])throw new Error(`Image id ${i} already exist, use updateImage instead`);this._validate(i,a)&&(this.images[i]=a)}_validate(i,a){let C=!0;const F=a.data||a.spriteData;return this._validateStretch(a.stretchX,F&&F.width)||(this.fire(new e.j(new Error(`Image "${i}" has invalid "stretchX" value`))),C=!1),this._validateStretch(a.stretchY,F&&F.height)||(this.fire(new e.j(new Error(`Image "${i}" has invalid "stretchY" value`))),C=!1),this._validateContent(a.content,a)||(this.fire(new e.j(new Error(`Image "${i}" has invalid "content" value`))),C=!1),C}_validateStretch(i,a){if(!i)return!0;let C=0;for(const F of i){if(F[0]{let F=!0;if(!this.isLoaded())for(const q of i)this.images[q]||(F=!1);this.isLoaded()||F?a(this._getImagesForIds(i)):this.requestors.push({ids:i,promiseResolve:a})})}_getImagesForIds(i){const a={};for(const C of i){let F=this.getImage(C);F||(this.fire(new e.k("styleimagemissing",{id:C})),F=this.getImage(C)),F?a[C]={data:F.data.clone(),pixelRatio:F.pixelRatio,sdf:F.sdf,version:F.version,stretchX:F.stretchX,stretchY:F.stretchY,content:F.content,textFitWidth:F.textFitWidth,textFitHeight:F.textFitHeight,hasRenderCallback:!!(F.userImage&&F.userImage.render)}:e.w(`Image "${C}" 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 a}getPixelSize(){const{width:i,height:a}=this.atlasImage;return{width:i,height:a}}getPattern(i){const a=this.patterns[i],C=this.getImage(i);if(!C)return null;if(a&&a.position.version===C.version)return a.position;if(a)a.position.version=C.version;else{const F={w:C.data.width+2,h:C.data.height+2,x:0,y:0},q=new e.I(F,C);this.patterns[i]={bin:F,position:q}}return this._updatePatternAtlas(),this.patterns[i].position}bind(i){const a=i.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new M(i,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){const i=[];for(const q in this.patterns)i.push(this.patterns[q].bin);const{w:a,h:C}=e.p(i),F=this.atlasImage;F.resize({width:a||1,height:C||1});for(const q in this.patterns){const{bin:te}=this.patterns[q],ue=te.x+1,ve=te.y+1,Ae=this.getImage(q).data,Re=Ae.width,Ue=Ae.height;e.R.copy(Ae,F,{x:0,y:0},{x:ue,y:ve},{width:Re,height:Ue}),e.R.copy(Ae,F,{x:0,y:Ue-1},{x:ue,y:ve-1},{width:Re,height:1}),e.R.copy(Ae,F,{x:0,y:0},{x:ue,y:ve+Ue},{width:Re,height:1}),e.R.copy(Ae,F,{x:Re-1,y:0},{x:ue-1,y:ve},{width:1,height:Ue}),e.R.copy(Ae,F,{x:0,y:0},{x:ue+Re,y:ve},{width:1,height:Ue})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(i){for(const a of i){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;const C=this.getImage(a);C||e.w(`Image with ID: "${a}" was not found`),f(C)&&this.updateImage(a,C)}}}const I=1e20;function B(R,i,a,C,F,q,te,ue,ve){for(let Ae=i;Ae-1);ve++,q[ve]=ue,te[ve]=Ae,te[ve+1]=I}for(let ue=0,ve=0;ue65535)throw new Error("glyphs > 65535 not supported");if(C.ranges[q])return{stack:i,id:a,glyph:F};if(!this.url)throw new Error("glyphsUrl is not set");if(!C.requests[q]){const ue=V.loadGlyphRange(i,q,this.url,this.requestManager);C.requests[q]=ue}const te=yield C.requests[q];for(const ue in te)this._doesCharSupportLocalGlyph(+ue)||(C.glyphs[+ue]=te[+ue]);return C.ranges[q]=!0,{stack:i,id:a,glyph:te[a]||null}})}_doesCharSupportLocalGlyph(i){return!!this.localIdeographFontFamily&&(e.u["CJK Unified Ideographs"](i)||e.u["Hangul Syllables"](i)||e.u.Hiragana(i)||e.u.Katakana(i))}_tinySDF(i,a,C){const F=this.localIdeographFontFamily;if(!F||!this._doesCharSupportLocalGlyph(C))return;let q=i.tinySDF;if(!q){let ue="400";/bold/i.test(a)?ue="900":/medium/i.test(a)?ue="500":/light/i.test(a)&&(ue="200"),q=i.tinySDF=new V.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:F,fontWeight:ue})}const te=q.draw(String.fromCharCode(C));return{id:C,bitmap:new e.o({width:te.width||60,height:te.height||60},te.data),metrics:{width:te.glyphWidth/2||24,height:te.glyphHeight/2||24,left:te.glyphLeft/2+.5||0,top:te.glyphTop/2-27.5||-8,advance:te.glyphAdvance/2||24,isDoubleResolution:!0}}}}V.loadGlyphRange=function(R,i,a,C){return e._(this,void 0,void 0,function*(){const F=256*i,q=F+255,te=C.transformRequest(a.replace("{fontstack}",R).replace("{range}",`${F}-${q}`),"Glyphs"),ue=yield e.l(te,new AbortController);if(!ue||!ue.data)throw new Error(`Could not load glyph range. range: ${i}, ${F}-${q}`);const ve={};for(const Ae of e.n(ue.data))ve[Ae.id]=Ae;return ve})},V.TinySDF=class{constructor({fontSize:R=24,buffer:i=3,radius:a=8,cutoff:C=.25,fontFamily:F="sans-serif",fontWeight:q="normal",fontStyle:te="normal"}={}){this.buffer=i,this.cutoff=C,this.radius=a;const ue=this.size=R+4*i,ve=this._createCanvas(ue),Ae=this.ctx=ve.getContext("2d",{willReadFrequently:!0});Ae.font=`${te} ${q} ${R}px ${F}`,Ae.textBaseline="alphabetic",Ae.textAlign="left",Ae.fillStyle="black",this.gridOuter=new Float64Array(ue*ue),this.gridInner=new Float64Array(ue*ue),this.f=new Float64Array(ue),this.z=new Float64Array(ue+1),this.v=new Uint16Array(ue)}_createCanvas(R){const i=document.createElement("canvas");return i.width=i.height=R,i}draw(R){const{width:i,actualBoundingBoxAscent:a,actualBoundingBoxDescent:C,actualBoundingBoxLeft:F,actualBoundingBoxRight:q}=this.ctx.measureText(R),te=Math.ceil(a),ue=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(q-F))),ve=Math.min(this.size-this.buffer,te+Math.ceil(C)),Ae=ue+2*this.buffer,Re=ve+2*this.buffer,Ue=Math.max(Ae*Re,0),it=new Uint8ClampedArray(Ue),ct={data:it,width:Ae,height:Re,glyphWidth:ue,glyphHeight:ve,glyphTop:te,glyphLeft:0,glyphAdvance:i};if(ue===0||ve===0)return ct;const{ctx:dt,buffer:bt,gridInner:Ct,gridOuter:Mt}=this;dt.clearRect(bt,bt,ue,ve),dt.fillText(R,bt,bt+te);const Ut=dt.getImageData(bt,bt,ue,ve);Mt.fill(I,0,Ue),Ct.fill(0,0,Ue);for(let It=0;It0?vn*vn:0,Ct[Yt]=vn<0?vn*vn:0}}B(Mt,0,0,Ae,Re,Ae,this.f,this.v,this.z),B(Ct,bt,bt,ue,ve,Ae,this.f,this.v,this.z);for(let It=0;It1&&(Ae=i[++ve]);const Ue=Math.abs(Re-Ae.left),it=Math.abs(Re-Ae.right),ct=Math.min(Ue,it);let dt;const bt=q/C*(F+1);if(Ae.isDash){const Ct=F-Math.abs(bt);dt=Math.sqrt(ct*ct+Ct*Ct)}else dt=F-Math.sqrt(ct*ct+bt*bt);this.data[ue+Re]=Math.max(0,Math.min(255,dt+128))}}}addRegularDash(i){for(let ue=i.length-1;ue>=0;--ue){const ve=i[ue],Ae=i[ue+1];ve.zeroLength?i.splice(ue,1):Ae&&Ae.isDash===ve.isDash&&(Ae.left=ve.left,i.splice(ue,1))}const a=i[0],C=i[i.length-1];a.isDash===C.isDash&&(a.left=C.left-this.width,C.right=a.right+this.width);const F=this.width*this.nextRow;let q=0,te=i[q];for(let ue=0;ue1&&(te=i[++q]);const ve=Math.abs(ue-te.left),Ae=Math.abs(ue-te.right),Re=Math.min(ve,Ae),Ue=te.isDash?Re:-Re;this.data[F+ue]=Math.max(0,Math.min(255,Ue+128))}}addDash(i,a){const C=a?7:0,F=2*C+1;if(this.nextRow+F>this.height)return e.w("LineAtlas out of space"),null;let q=0;for(let ue=0;ue{a.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ae]}numActive(){return Object.keys(this.active).length}}const he=Math.floor(u.hardwareConcurrency/2);let fe,ie;function oe(){return fe||(fe=new se),fe}se.workerCount=e.C(globalThis)?Math.max(Math.min(he,3),1):1;class le{constructor(i,a){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=a;const C=this.workerPool.acquire(a);for(let F=0;F{a.remove()}),this.actors=[],i&&this.workerPool.release(this.id)}registerMessageHandler(i,a){for(const C of this.actors)C.registerMessageHandler(i,a)}}function ge(){return ie||(ie=new le(oe(),e.G),ie.registerMessageHandler("GR",(R,i,a)=>e.m(i,a))),ie}function ye(R,i){const a=e.H();return e.J(a,a,[1,1,0]),e.K(a,a,[.5*R.width,.5*R.height,1]),e.L(a,a,R.calculatePosMatrix(i.toUnwrapped()))}function me(R,i,a,C,F,q){const te=function(Ue,it,ct){if(Ue)for(const dt of Ue){const bt=it[dt];if(bt&&bt.source===ct&&bt.type==="fill-extrusion")return!0}else for(const dt in it){const bt=it[dt];if(bt.source===ct&&bt.type==="fill-extrusion")return!0}return!1}(F&&F.layers,i,R.id),ue=q.maxPitchScaleFactor(),ve=R.tilesIn(C,ue,te);ve.sort(be);const Ae=[];for(const Ue of ve)Ae.push({wrappedTileID:Ue.tileID.wrapped().key,queryResults:Ue.tile.queryRenderedFeatures(i,a,R._state,Ue.queryGeometry,Ue.cameraQueryGeometry,Ue.scale,F,q,ue,ye(R.transform,Ue.tileID))});const Re=function(Ue){const it={},ct={};for(const dt of Ue){const bt=dt.queryResults,Ct=dt.wrappedTileID,Mt=ct[Ct]=ct[Ct]||{};for(const Ut in bt){const It=bt[Ut],Qt=Mt[Ut]=Mt[Ut]||{},tn=it[Ut]=it[Ut]||[];for(const Yt of It)Qt[Yt.featureIndex]||(Qt[Yt.featureIndex]=!0,tn.push(Yt))}}return it}(Ae);for(const Ue in Re)Re[Ue].forEach(it=>{const ct=it.feature,dt=R.getFeatureState(ct.layer["source-layer"],ct.id);ct.source=ct.layer.source,ct.layer["source-layer"]&&(ct.sourceLayer=ct.layer["source-layer"]),ct.state=dt});return Re}function be(R,i){const a=R.tileID,C=i.tileID;return a.overscaledZ-C.overscaledZ||a.canonical.y-C.canonical.y||a.wrap-C.wrap||a.canonical.x-C.canonical.x}function Se(R,i,a){return e._(this,void 0,void 0,function*(){let C=R;if(R.url?C=(yield e.h(i.transformRequest(R.url,"Source"),a)).data:yield u.frameAsync(a),!C)return null;const F=e.M(e.e(C,R),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in C&&C.vector_layers&&(F.vectorLayerIds=C.vector_layers.map(q=>q.id)),F})}class Ee{constructor(i,a){i&&(a?this.setSouthWest(i).setNorthEast(a):Array.isArray(i)&&(i.length===4?this.setSouthWest([i[0],i[1]]).setNorthEast([i[2],i[3]]):this.setSouthWest(i[0]).setNorthEast(i[1])))}setNorthEast(i){return this._ne=i instanceof e.N?new e.N(i.lng,i.lat):e.N.convert(i),this}setSouthWest(i){return this._sw=i instanceof e.N?new e.N(i.lng,i.lat):e.N.convert(i),this}extend(i){const a=this._sw,C=this._ne;let F,q;if(i instanceof e.N)F=i,q=i;else{if(!(i instanceof Ee)){if(Array.isArray(i)){if(i.length===4||i.every(Array.isArray)){const te=i;return this.extend(Ee.convert(te))}{const te=i;return this.extend(e.N.convert(te))}}return i&&("lng"in i||"lon"in i)&&"lat"in i?this.extend(e.N.convert(i)):this}if(F=i._sw,q=i._ne,!F||!q)return this}return a||C?(a.lng=Math.min(F.lng,a.lng),a.lat=Math.min(F.lat,a.lat),C.lng=Math.max(q.lng,C.lng),C.lat=Math.max(q.lat,C.lat)):(this._sw=new e.N(F.lng,F.lat),this._ne=new e.N(q.lng,q.lat)),this}getCenter(){return new e.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 e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.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(i){const{lng:a,lat:C}=e.N.convert(i),F=this._sw.lat<=C&&C<=this._ne.lat;let q=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(q=this._sw.lng>=a&&a>=this._ne.lng),F&&q}static convert(i){return i instanceof Ee?i:i&&new Ee(i)}static fromLngLat(i,a=0){const C=360*a/40075017,F=C/Math.cos(Math.PI/180*i.lat);return new Ee(new e.N(i.lng-F,i.lat-C),new e.N(i.lng+F,i.lat+C))}}class Ce{constructor(i,a,C){this.bounds=Ee.convert(this.validateBounds(i)),this.minzoom=a||0,this.maxzoom=C||24}validateBounds(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]}contains(i){const a=Math.pow(2,i.z),C=Math.floor(e.O(this.bounds.getWest())*a),F=Math.floor(e.Q(this.bounds.getNorth())*a),q=Math.ceil(e.O(this.bounds.getEast())*a),te=Math.ceil(e.Q(this.bounds.getSouth())*a);return i.x>=C&&i.x=F&&i.y{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),C={request:this.map._requestManager.transformRequest(a,"Tile"),uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*i.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};C.request.collectResourceTiming=this._collectResourceTiming;let F="RT";if(i.actor&&i.state!=="expired"){if(i.state==="loading")return new Promise((q,te)=>{i.reloadPromise={resolve:q,reject:te}})}else i.actor=this.dispatcher.getActor(),F="LT";i.abortController=new AbortController;try{const q=yield i.actor.sendAsync({type:F,data:C},i.abortController);if(delete i.abortController,i.aborted)return;this._afterTileLoadWorkerResponse(i,q)}catch(q){if(delete i.abortController,i.aborted)return;if(q&&q.status!==404)throw q;this._afterTileLoadWorkerResponse(i,null)}})}_afterTileLoadWorkerResponse(i,a){if(a&&a.resourceTiming&&(i.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&i.setExpiryData(a),i.loadVectorData(a,this.map.painter),i.reloadPromise){const C=i.reloadPromise;i.reloadPromise=null,this.loadTile(i).then(C.resolve).catch(C.reject)}}abortTile(i){return e._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.actor&&(yield i.actor.sendAsync({type:"AT",data:{uid:i.uid,type:this.type,source:this.id}}))})}unloadTile(i){return e._(this,void 0,void 0,function*(){i.unloadVectorData(),i.actor&&(yield i.actor.sendAsync({type:"RMT",data:{uid:i.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Oe extends e.E{constructor(i,a,C,F){super(),this.id=i,this.dispatcher=C,this.setEventedParent(F),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},a),e.e(this,e.M(a,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield Se(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,i&&(e.e(this,i),i.bounds&&(this.tileBounds=new Ce(i.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(i){this._tileJSONRequest=null,this.fire(new e.j(i))}})}loaded(){return this._loaded}onAdd(i){this.map=i,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(i){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),i(),this.load()}setTiles(i){return this.setSourceProperty(()=>{this._options.tiles=i}),this}setUrl(i){return this.setSourceProperty(()=>{this.url=i,this._options.url=i}),this}serialize(){return e.e({},this._options)}hasTile(i){return!this.tileBounds||this.tileBounds.contains(i.canonical)}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);i.abortController=new AbortController;try{const C=yield x.getImage(this.map._requestManager.transformRequest(a,"Tile"),i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(C&&C.data){this.map._refreshExpiredTiles&&C.cacheControl&&C.expires&&i.setExpiryData({cacheControl:C.cacheControl,expires:C.expires});const F=this.map.painter.context,q=F.gl,te=C.data;i.texture=this.map.painter.getTileTexture(te.width),i.texture?i.texture.update(te,{useMipmap:!0}):(i.texture=new M(F,te,q.RGBA,{useMipmap:!0}),i.texture.bind(q.LINEAR,q.CLAMP_TO_EDGE,q.LINEAR_MIPMAP_NEAREST)),i.state="loaded"}}catch(C){if(delete i.abortController,i.aborted)i.state="unloaded";else if(C)throw i.state="errored",C}})}abortTile(i){return e._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController)})}unloadTile(i){return e._(this,void 0,void 0,function*(){i.texture&&this.map.painter.saveTileTexture(i.texture)})}hasTransition(){return!1}}class We extends Oe{constructor(i,a,C,F){super(i,a,C,F),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),C=this.map._requestManager.transformRequest(a,"Tile");i.neighboringTiles=this._getNeighboringTiles(i.tileID),i.abortController=new AbortController;try{const F=yield x.getImage(C,i.abortController,this.map._refreshExpiredTiles);if(delete i.abortController,i.aborted)return void(i.state="unloaded");if(F&&F.data){const q=F.data;this.map._refreshExpiredTiles&&F.cacheControl&&F.expires&&i.setExpiryData({cacheControl:F.cacheControl,expires:F.expires});const te=e.b(q)&&e.U()?q:yield this.readImageNow(q),ue={type:this.type,uid:i.uid,source:this.id,rawImageData:te,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!i.actor||i.state==="expired"){i.actor=this.dispatcher.getActor();const ve=yield i.actor.sendAsync({type:"LDT",data:ue});i.dem=ve,i.needsHillshadePrepare=!0,i.needsTerrainPrepare=!0,i.state="loaded"}}}catch(F){if(delete i.abortController,i.aborted)i.state="unloaded";else if(F)throw i.state="errored",F}})}readImageNow(i){return e._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&e.V()){const a=i.width+2,C=i.height+2;try{return new e.R({width:a,height:C},yield e.W(i,-1,-1,a,C))}catch{}}return u.getImageData(i,1)})}_getNeighboringTiles(i){const a=i.canonical,C=Math.pow(2,a.z),F=(a.x-1+C)%C,q=a.x===0?i.wrap-1:i.wrap,te=(a.x+1+C)%C,ue=a.x+1===C?i.wrap+1:i.wrap,ve={};return ve[new e.S(i.overscaledZ,q,a.z,F,a.y).key]={backfilled:!1},ve[new e.S(i.overscaledZ,ue,a.z,te,a.y).key]={backfilled:!1},a.y>0&&(ve[new e.S(i.overscaledZ,q,a.z,F,a.y-1).key]={backfilled:!1},ve[new e.S(i.overscaledZ,i.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},ve[new e.S(i.overscaledZ,ue,a.z,te,a.y-1).key]={backfilled:!1}),a.y+10&&e.e(q,{resourceTiming:F}),this.fire(new e.k("data",Object.assign(Object.assign({},q),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},q),{sourceDataType:"content"})))}catch(C){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(C))}})}loaded(){return this._pendingLoads===0}loadTile(i){return e._(this,void 0,void 0,function*(){const a=i.actor?"RT":"LT";i.actor=this.actor;const C={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.abortController=new AbortController;const F=yield this.actor.sendAsync({type:a,data:C},i.abortController);delete i.abortController,i.unloadVectorData(),i.aborted||i.loadVectorData(F,this.map.painter,a==="RT")})}abortTile(i){return e._(this,void 0,void 0,function*(){i.abortController&&(i.abortController.abort(),delete i.abortController),i.aborted=!0})}unloadTile(i){return e._(this,void 0,void 0,function*(){i.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:i.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 e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Ve=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Pe extends e.E{constructor(i,a,C,F){super(),this.id=i,this.dispatcher=C,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(F),this.options=a}load(i){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const a=yield x.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a&&a.data&&(this.image=a.data,i&&(this.coordinates=i),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,this.fire(new e.j(a))}})}loaded(){return this._loaded}updateImage(i){return i.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=i.url,this.load(i.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(i){this.map=i,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(i){this.coordinates=i;const a=i.map(e.Z.fromLngLat);this.tileID=function(F){let q=1/0,te=1/0,ue=-1/0,ve=-1/0;for(const dt of F)q=Math.min(q,dt.x),te=Math.min(te,dt.y),ue=Math.max(ue,dt.x),ve=Math.max(ve,dt.y);const Ae=ue-q,Re=ve-te,Ue=Math.max(Ae,Re),it=Math.max(0,Math.floor(-Math.log(Ue)/Math.LN2)),ct=Math.pow(2,it);return new e.a1(it,Math.floor((q+ue)/2*ct),Math.floor((te+ve)/2*ct))}(a),this.minzoom=this.maxzoom=this.tileID.z;const C=a.map(F=>this.tileID.getTilePoint(F)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(C[0].x,C[0].y,0,0),this._boundsArray.emplaceBack(C[1].x,C[1].y,e.X,0),this._boundsArray.emplaceBack(C[3].x,C[3].y,0,e.X),this._boundsArray.emplaceBack(C[2].x,C[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const i=this.map.painter.context,a=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Ve.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new M(i,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let C=!1;for(const F in this.tiles){const q=this.tiles[F];q.state!=="loaded"&&(q.state="loaded",q.texture=this.texture,C=!0)}C&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(i){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(i.tileID.canonical)?(this.tiles[String(i.tileID.wrap)]=i,i.buckets={}):i.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class de extends Pe{constructor(i,a,C,F){super(i,a,C,F),this.roundZoom=!0,this.type="video",this.options=a}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;const i=this.options;this.urls=[];for(const a of i.urls)this.urls.push(this.map._requestManager.transformRequest(a,"Source").url);try{const a=yield e.a3(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new e.j(a))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(i){if(this.video){const a=this.video.seekable;ia.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=i}}getVideo(){return this.video}onAdd(i){this.map||(this.map=i,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const i=this.map.painter.context,a=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Ve.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new M(i,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let C=!1;for(const F in this.tiles){const q=this.tiles[F];q.state!=="loaded"&&(q.state="loaded",q.texture=this.texture,C=!0)}C&&this.fire(new e.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 Me extends Pe{constructor(i,a,C,F){super(i,a,C,F),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some(q=>!Array.isArray(q)||q.length!==2||q.some(te=>typeof te!="number"))||this.fire(new e.j(new e.a2(`sources.${i}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${i}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new e.j(new e.a2(`sources.${i}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${i}`,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.j(new e.a2(`sources.${i}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return e._(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 e.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(i){this.map=i,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let i=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,i=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,i=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const a=this.map.painter.context,C=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,Ve.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(i||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new M(a,this.canvas,C.RGBA,{premultiply:!0});let F=!1;for(const q in this.tiles){const te=this.tiles[q];te.state!=="loaded"&&(te.state="loaded",te.texture=this.texture,F=!0)}F&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const i of[this.canvas.width,this.canvas.height])if(isNaN(i)||i<=0)return!0;return!1}}const ke={},He=R=>{switch(R){case"geojson":return Ie;case"image":return Pe;case"raster":return Oe;case"raster-dem":return We;case"vector":return Le;case"video":return de;case"canvas":return Me}return ke[R]},Fe="RTLPluginLoaded";class qe extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=ge()}_syncState(i){return this.status=i,this.dispatcher.broadcast("SRPS",{pluginStatus:i,pluginURL:this.url}).catch(a=>{throw this.status="error",a})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(i){return e._(this,arguments,void 0,function*(a,C=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=u.resolveURL(a),!this.url)throw new Error(`requested url ${a} is invalid`);if(this.status==="unavailable"){if(!C)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(Fe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let $e=null;function Ye(){return $e||($e=new qe),$e}class _e{constructor(i,a){this.timeAdded=0,this.fadeEndTime=0,this.tileID=i,this.uid=e.a4(),this.uses=0,this.tileSize=a,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(i){const a=i+this.timeAdded;aq.getLayer(Ae)).filter(Boolean);if(ve.length!==0){ue.layers=ve,ue.stateDependentLayerIds&&(ue.stateDependentLayers=ue.stateDependentLayerIds.map(Ae=>ve.filter(Re=>Re.id===Ae)[0]));for(const Ae of ve)te[Ae.id]=ue}}return te}(i.buckets,a.style),this.hasSymbolBuckets=!1;for(const F in this.buckets){const q=this.buckets[F];if(q instanceof e.a6){if(this.hasSymbolBuckets=!0,!C)break;q.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const F in this.buckets){const q=this.buckets[F];if(q instanceof e.a6&&q.hasRTLText){this.hasRTLText=!0,Ye().lazyLoad();break}}this.queryPadding=0;for(const F in this.buckets){const q=this.buckets[F];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(F).queryRadius(q))}i.imageAtlas&&(this.imageAtlas=i.imageAtlas),i.glyphAtlasImage&&(this.glyphAtlasImage=i.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const i in this.buckets)this.buckets[i].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(i){return this.buckets[i.id]}upload(i){for(const C in this.buckets){const F=this.buckets[C];F.uploadPending()&&F.upload(i)}const a=i.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new M(i,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new M(i,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(i){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(i,this.imageAtlasTexture)}queryRenderedFeatures(i,a,C,F,q,te,ue,ve,Ae,Re){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:F,cameraQueryGeometry:q,scale:te,tileSize:this.tileSize,pixelPosMatrix:Re,transform:ve,params:ue,queryPadding:this.queryPadding*Ae},i,a,C):{}}querySourceFeatures(i,a){const C=this.latestFeatureIndex;if(!C||!C.rawTileData)return;const F=C.loadVTLayers(),q=a&&a.sourceLayer?a.sourceLayer:"",te=F._geojsonTileLayer||F[q];if(!te)return;const ue=e.a7(a&&a.filter),{z:ve,x:Ae,y:Re}=this.tileID.canonical,Ue={z:ve,x:Ae,y:Re};for(let it=0;itC)F=!1;else if(a)if(this.expirationTime{this.remove(i,q)},C)),this.data[F].push(q),this.order.push(F),this.order.length>this.max){const te=this._getAndRemoveByKey(this.order[0]);te&&this.onRemove(te)}return this}has(i){return i.wrapped().key in this.data}getAndRemove(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null}_getAndRemoveByKey(i){const a=this.data[i].shift();return a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),a.value}getByKey(i){const a=this.data[i];return a?a[0].value:null}get(i){return this.has(i)?this.data[i.wrapped().key][0].value:null}remove(i,a){if(!this.has(i))return this;const C=i.wrapped().key,F=a===void 0?0:this.data[C].indexOf(a),q=this.data[C][F];return this.data[C].splice(F,1),q.timeout&&clearTimeout(q.timeout),this.data[C].length===0&&delete this.data[C],this.onRemove(q.value),this.order.splice(this.order.indexOf(C),1),this}setMaxSize(i){for(this.max=i;this.order.length>this.max;){const a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}filter(i){const a=[];for(const C in this.data)for(const F of this.data[C])i(F.value)||a.push(F);for(const C of a)this.remove(C.value.tileID,C)}}class Be{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(i,a,C){const F=String(a);if(this.stateChanges[i]=this.stateChanges[i]||{},this.stateChanges[i][F]=this.stateChanges[i][F]||{},e.e(this.stateChanges[i][F],C),this.deletedStates[i]===null){this.deletedStates[i]={};for(const q in this.state[i])q!==F&&(this.deletedStates[i][q]=null)}else if(this.deletedStates[i]&&this.deletedStates[i][F]===null){this.deletedStates[i][F]={};for(const q in this.state[i][F])C[q]||(this.deletedStates[i][F][q]=null)}else for(const q in C)this.deletedStates[i]&&this.deletedStates[i][F]&&this.deletedStates[i][F][q]===null&&delete this.deletedStates[i][F][q]}removeFeatureState(i,a,C){if(this.deletedStates[i]===null)return;const F=String(a);if(this.deletedStates[i]=this.deletedStates[i]||{},C&&a!==void 0)this.deletedStates[i][F]!==null&&(this.deletedStates[i][F]=this.deletedStates[i][F]||{},this.deletedStates[i][F][C]=null);else if(a!==void 0)if(this.stateChanges[i]&&this.stateChanges[i][F])for(C in this.deletedStates[i][F]={},this.stateChanges[i][F])this.deletedStates[i][F][C]=null;else this.deletedStates[i][F]=null;else this.deletedStates[i]=null}getState(i,a){const C=String(a),F=this.state[i]||{},q=this.stateChanges[i]||{},te=e.e({},F[C],q[C]);if(this.deletedStates[i]===null)return{};if(this.deletedStates[i]){const ue=this.deletedStates[i][a];if(ue===null)return{};for(const ve in ue)delete te[ve]}return te}initializeTileState(i,a){i.setFeatureState(this.state,a)}coalesceChanges(i,a){const C={};for(const F in this.stateChanges){this.state[F]=this.state[F]||{};const q={};for(const te in this.stateChanges[F])this.state[F][te]||(this.state[F][te]={}),e.e(this.state[F][te],this.stateChanges[F][te]),q[te]=this.state[F][te];C[F]=q}for(const F in this.deletedStates){this.state[F]=this.state[F]||{};const q={};if(this.deletedStates[F]===null)for(const te in this.state[F])q[te]={},this.state[F][te]={};else for(const te in this.deletedStates[F]){if(this.deletedStates[F][te]===null)this.state[F][te]={};else for(const ue of Object.keys(this.deletedStates[F][te]))delete this.state[F][te][ue];q[te]=this.state[F][te]}C[F]=C[F]||{},e.e(C[F],q)}if(this.stateChanges={},this.deletedStates={},Object.keys(C).length!==0)for(const F in i)i[F].setFeatureState(C,a)}}class Ge extends e.E{constructor(i,a,C){super(),this.id=i,this.dispatcher=C,this.on("data",F=>this._dataHandler(F)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((F,q,te,ue)=>{const ve=new(He(q.type))(F,q,te,ue);if(ve.id!==F)throw new Error(`Expected Source id to be ${F} instead of ${ve.id}`);return ve})(i,a,C,this),this._tiles={},this._cache=new De(0,F=>this._unloadTile(F)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Be,this._didEmitContent=!1,this._updated=!1}onAdd(i){this.map=i,this._maxTileCacheSize=i?i._maxTileCacheSize:null,this._maxTileCacheZoomLevels=i?i._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(i)}onRemove(i){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(i)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const i in this._tiles){const a=this._tiles[i];if(a.state!=="loaded"&&a.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const i=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,i&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(i,a,C){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(i),this._tileLoaded(i,a,C)}catch(F){i.state="errored",F.status!==404?this._source.fire(new e.j(F,{tile:i})):this.update(this.transform,this.terrain)}})}_unloadTile(i){this._source.unloadTile&&this._source.unloadTile(i)}_abortTile(i){this._source.abortTile&&this._source.abortTile(i),this._source.fire(new e.k("dataabort",{tile:i,coord:i.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(i){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const a in this._tiles){const C=this._tiles[a];C.upload(i),C.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(i=>i.tileID).sort(tt).map(i=>i.key)}getRenderableIds(i){const a=[];for(const C in this._tiles)this._isIdRenderable(C,i)&&a.push(this._tiles[C]);return i?a.sort((C,F)=>{const q=C.tileID,te=F.tileID,ue=new e.P(q.canonical.x,q.canonical.y)._rotate(this.transform.angle),ve=new e.P(te.canonical.x,te.canonical.y)._rotate(this.transform.angle);return q.overscaledZ-te.overscaledZ||ve.y-ue.y||ve.x-ue.x}).map(C=>C.tileID.key):a.map(C=>C.tileID).sort(tt).map(C=>C.key)}hasRenderableParent(i){const a=this.findLoadedParent(i,0);return!!a&&this._isIdRenderable(a.tileID.key)}_isIdRenderable(i,a){return this._tiles[i]&&this._tiles[i].hasData()&&!this._coveredTiles[i]&&(a||!this._tiles[i].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const i in this._tiles)this._tiles[i].state!=="errored"&&this._reloadTile(i,"reloading")}}_reloadTile(i,a){return e._(this,void 0,void 0,function*(){const C=this._tiles[i];C&&(C.state!=="loading"&&(C.state=a),yield this._loadTile(C,i,a))})}_tileLoaded(i,a,C){i.timeAdded=u.now(),C==="expired"&&(i.refreshedUponExpiration=!0),this._setTileReloadTimer(a,i),this.getSource().type==="raster-dem"&&i.dem&&this._backfillDEM(i),this._state.initializeTileState(i,this.map?this.map.painter:null),i.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:i,coord:i.tileID}))}_backfillDEM(i){const a=this.getRenderableIds();for(let F=0;F1||(Math.abs(te)>1&&(Math.abs(te+ve)===1?te+=ve:Math.abs(te-ve)===1&&(te-=ve)),q.dem&&F.dem&&(F.dem.backfillBorder(q.dem,te,ue),F.neighboringTiles&&F.neighboringTiles[Ae]&&(F.neighboringTiles[Ae].backfilled=!0)))}}getTile(i){return this.getTileByID(i.key)}getTileByID(i){return this._tiles[i]}_retainLoadedChildren(i,a,C,F){for(const q in this._tiles){let te=this._tiles[q];if(F[q]||!te.hasData()||te.tileID.overscaledZ<=a||te.tileID.overscaledZ>C)continue;let ue=te.tileID;for(;te&&te.tileID.overscaledZ>a+1;){const Ae=te.tileID.scaledTo(te.tileID.overscaledZ-1);te=this._tiles[Ae.key],te&&te.hasData()&&(ue=Ae)}let ve=ue;for(;ve.overscaledZ>a;)if(ve=ve.scaledTo(ve.overscaledZ-1),i[ve.key]){F[ue.key]=ue;break}}}findLoadedParent(i,a){if(i.key in this._loadedParentTiles){const C=this._loadedParentTiles[i.key];return C&&C.tileID.overscaledZ>=a?C:null}for(let C=i.overscaledZ-1;C>=a;C--){const F=i.scaledTo(C),q=this._getLoadedTile(F);if(q)return q}}findLoadedSibling(i){return this._getLoadedTile(i)}_getLoadedTile(i){const a=this._tiles[i.key];return a&&a.hasData()?a:this._cache.getByKey(i.wrapped().key)}updateCacheSize(i){const a=(Math.ceil(i.width/this._source.tileSize)+1)*(Math.ceil(i.height/this._source.tileSize)+1),C=this._maxTileCacheZoomLevels===null?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,F=Math.floor(a*C),q=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,F):F;this._cache.setMaxSize(q)}handleWrapJump(i){const a=(i-(this._prevLng===void 0?i:this._prevLng))/360,C=Math.round(a);if(this._prevLng=i,C){const F={};for(const q in this._tiles){const te=this._tiles[q];te.tileID=te.tileID.unwrapTo(te.tileID.wrap+C),F[te.tileID.key]=te}this._tiles=F;for(const q in this._timers)clearTimeout(this._timers[q]),delete this._timers[q];for(const q in this._tiles){const te=this._tiles[q];this._setTileReloadTimer(q,te)}}}_updateCoveredAndRetainedTiles(i,a,C,F,q,te){const ue={},ve={},Ae=Object.keys(i),Re=u.now();for(const Ue of Ae){const it=i[Ue],ct=this._tiles[Ue];if(!ct||ct.fadeEndTime!==0&&ct.fadeEndTime<=Re)continue;const dt=this.findLoadedParent(it,a),bt=this.findLoadedSibling(it),Ct=dt||bt||null;Ct&&(this._addTile(Ct.tileID),ue[Ct.tileID.key]=Ct.tileID),ve[Ue]=it}this._retainLoadedChildren(ve,F,C,i);for(const Ue in ue)i[Ue]||(this._coveredTiles[Ue]=!0,i[Ue]=ue[Ue]);if(te){const Ue={},it={};for(const ct of q)this._tiles[ct.key].hasData()?Ue[ct.key]=ct:it[ct.key]=ct;for(const ct in it){const dt=it[ct].children(this._source.maxzoom);this._tiles[dt[0].key]&&this._tiles[dt[1].key]&&this._tiles[dt[2].key]&&this._tiles[dt[3].key]&&(Ue[dt[0].key]=i[dt[0].key]=dt[0],Ue[dt[1].key]=i[dt[1].key]=dt[1],Ue[dt[2].key]=i[dt[2].key]=dt[2],Ue[dt[3].key]=i[dt[3].key]=dt[3],delete it[ct])}for(const ct in it){const dt=it[ct],bt=this.findLoadedParent(dt,this._source.minzoom),Ct=this.findLoadedSibling(dt),Mt=bt||Ct||null;if(Mt){Ue[Mt.tileID.key]=i[Mt.tileID.key]=Mt.tileID;for(const Ut in Ue)Ue[Ut].isChildOf(Mt.tileID)&&delete Ue[Ut]}}for(const ct in this._tiles)Ue[ct]||(this._coveredTiles[ct]=!0)}}update(i,a){if(!this._sourceLoaded||this._paused)return;let C;this.transform=i,this.terrain=a,this.updateCacheSize(i),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?C=i.getVisibleUnwrappedCoordinates(this._source.tileID).map(Re=>new e.S(Re.canonical.z,Re.wrap,Re.canonical.z,Re.canonical.x,Re.canonical.y)):(C=i.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:a}),this._source.hasTile&&(C=C.filter(Re=>this._source.hasTile(Re)))):C=[];const F=i.coveringZoomLevel(this._source),q=Math.max(F-Ge.maxOverzooming,this._source.minzoom),te=Math.max(F+Ge.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Re={};for(const Ue of C)if(Ue.canonical.z>this._source.minzoom){const it=Ue.scaledTo(Ue.canonical.z-1);Re[it.key]=it;const ct=Ue.scaledTo(Math.max(this._source.minzoom,Math.min(Ue.canonical.z,5)));Re[ct.key]=ct}C=C.concat(Object.values(Re))}const ue=C.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,ue&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const ve=this._updateRetainedTiles(C,F);nt(this._source.type)&&this._updateCoveredAndRetainedTiles(ve,q,te,F,C,a);for(const Re in ve)this._tiles[Re].clearFadeHold();const Ae=e.ac(this._tiles,ve);for(const Re of Ae){const Ue=this._tiles[Re];Ue.hasSymbolBuckets&&!Ue.holdingForFade()?Ue.setHoldDuration(this.map._fadeDuration):Ue.hasSymbolBuckets&&!Ue.symbolFadeFinished()||this._removeTile(Re)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const i in this._tiles)this._tiles[i].holdingForFade()&&this._removeTile(i)}_updateRetainedTiles(i,a){var C;const F={},q={},te=Math.max(a-Ge.maxOverzooming,this._source.minzoom),ue=Math.max(a+Ge.maxUnderzooming,this._source.minzoom),ve={};for(const Ae of i){const Re=this._addTile(Ae);F[Ae.key]=Ae,Re.hasData()||athis._source.maxzoom){const it=Ae.children(this._source.maxzoom)[0],ct=this.getTile(it);if(ct&&ct.hasData()){F[it.key]=it;continue}}else{const it=Ae.children(this._source.maxzoom);if(F[it[0].key]&&F[it[1].key]&&F[it[2].key]&&F[it[3].key])continue}let Ue=Re.wasRequested();for(let it=Ae.overscaledZ-1;it>=te;--it){const ct=Ae.scaledTo(it);if(q[ct.key])break;if(q[ct.key]=!0,Re=this.getTile(ct),!Re&&Ue&&(Re=this._addTile(ct)),Re){const dt=Re.hasData();if((dt||!(!((C=this.map)===null||C===void 0)&&C.cancelPendingTileRequestsWhileZooming)||Ue)&&(F[ct.key]=ct),Ue=Re.wasRequested(),dt)break}}}return F}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const i in this._tiles){const a=[];let C,F=this._tiles[i].tileID;for(;F.overscaledZ>0;){if(F.key in this._loadedParentTiles){C=this._loadedParentTiles[F.key];break}a.push(F.key);const q=F.scaledTo(F.overscaledZ-1);if(C=this._getLoadedTile(q),C)break;F=q}for(const q of a)this._loadedParentTiles[q]=C}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const i in this._tiles){const a=this._tiles[i].tileID,C=this._getLoadedTile(a);this._loadedSiblingTiles[a.key]=C}}_addTile(i){let a=this._tiles[i.key];if(a)return a;a=this._cache.getAndRemove(i),a&&(this._setTileReloadTimer(i.key,a),a.tileID=i,this._state.initializeTileState(a,this.map?this.map.painter:null),this._cacheTimers[i.key]&&(clearTimeout(this._cacheTimers[i.key]),delete this._cacheTimers[i.key],this._setTileReloadTimer(i.key,a)));const C=a;return a||(a=new _e(i,this._source.tileSize*i.overscaleFactor()),this._loadTile(a,i.key,a.state)),a.uses++,this._tiles[i.key]=a,C||this._source.fire(new e.k("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(i,a){i in this._timers&&(clearTimeout(this._timers[i]),delete this._timers[i]);const C=a.getExpiryTimeout();C&&(this._timers[i]=setTimeout(()=>{this._reloadTile(i,"expired"),delete this._timers[i]},C))}_removeTile(i){const a=this._tiles[i];a&&(a.uses--,delete this._tiles[i],this._timers[i]&&(clearTimeout(this._timers[i]),delete this._timers[i]),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(i){const a=i.sourceDataType;i.dataType==="source"&&a==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&i.dataType==="source"&&a==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const i in this._tiles)this._removeTile(i);this._cache.reset()}tilesIn(i,a,C){const F=[],q=this.transform;if(!q)return F;const te=C?q.getCameraQueryGeometry(i):i,ue=i.map(dt=>q.pointCoordinate(dt,this.terrain)),ve=te.map(dt=>q.pointCoordinate(dt,this.terrain)),Ae=this.getIds();let Re=1/0,Ue=1/0,it=-1/0,ct=-1/0;for(const dt of ve)Re=Math.min(Re,dt.x),Ue=Math.min(Ue,dt.y),it=Math.max(it,dt.x),ct=Math.max(ct,dt.y);for(let dt=0;dt=0&&It[1].y+Ut>=0){const Qt=ue.map(Yt=>Ct.getTilePoint(Yt)),tn=ve.map(Yt=>Ct.getTilePoint(Yt));F.push({tile:bt,tileID:Ct,queryGeometry:Qt,cameraQueryGeometry:tn,scale:Mt})}}return F}getVisibleCoordinates(i){const a=this.getRenderableIds(i).map(C=>this._tiles[C].tileID);for(const C of a)C.posMatrix=this.transform.calculatePosMatrix(C.toUnwrapped());return a}hasTransition(){if(this._source.hasTransition())return!0;if(nt(this._source.type)){const i=u.now();for(const a in this._tiles)if(this._tiles[a].fadeEndTime>=i)return!0}return!1}setFeatureState(i,a,C){i=i||"_geojsonTileLayer",this._state.updateState(i,a,C)}removeFeatureState(i,a,C){i=i||"_geojsonTileLayer",this._state.removeFeatureState(i,a,C)}getFeatureState(i,a){return i=i||"_geojsonTileLayer",this._state.getState(i,a)}setDependencies(i,a,C){const F=this._tiles[i];F&&F.setDependencies(a,C)}reloadTilesForDependencies(i,a){for(const C in this._tiles)this._tiles[C].hasDependency(i,a)&&this._reloadTile(C,"reloading");this._cache.filter(C=>!C.hasDependency(i,a))}}function tt(R,i){const a=Math.abs(2*R.wrap)-+(R.wrap<0),C=Math.abs(2*i.wrap)-+(i.wrap<0);return R.overscaledZ-i.overscaledZ||C-a||i.canonical.y-R.canonical.y||i.canonical.x-R.canonical.x}function nt(R){return R==="raster"||R==="image"||R==="video"}Ge.maxOverzooming=10,Ge.maxUnderzooming=3;class ft{constructor(i,a){this.reset(i,a)}reset(i,a){this.points=i||[],this._distances=[0];for(let C=1;C0?(F-te)/ue:0;return this.points[q].mult(1-ve).add(this.points[a].mult(ve))}}function At(R,i){let a=!0;return R==="always"||R!=="never"&&i!=="never"||(a=!1),a}class kt{constructor(i,a,C){const F=this.boxCells=[],q=this.circleCells=[];this.xCellCount=Math.ceil(i/C),this.yCellCount=Math.ceil(a/C);for(let te=0;tethis.width||F<0||a>this.height)return[];const ve=[];if(i<=0&&a<=0&&this.width<=C&&this.height<=F){if(q)return[{key:null,x1:i,y1:a,x2:C,y2:F}];for(let Ae=0;Ae0}hitTestCircle(i,a,C,F,q){const te=i-C,ue=i+C,ve=a-C,Ae=a+C;if(ue<0||te>this.width||Ae<0||ve>this.height)return!1;const Re=[],Ue={hitTest:!0,overlapMode:F,circle:{x:i,y:a,radius:C},seenUids:{box:{},circle:{}}};return this._forEachCell(te,ve,ue,Ae,this._queryCellCircle,Re,Ue,q),Re.length>0}_queryCell(i,a,C,F,q,te,ue,ve){const{seenUids:Ae,hitTest:Re,overlapMode:Ue}=ue,it=this.boxCells[q];if(it!==null){const dt=this.bboxes;for(const bt of it)if(!Ae.box[bt]){Ae.box[bt]=!0;const Ct=4*bt,Mt=this.boxKeys[bt];if(i<=dt[Ct+2]&&a<=dt[Ct+3]&&C>=dt[Ct+0]&&F>=dt[Ct+1]&&(!ve||ve(Mt))&&(!Re||!At(Ue,Mt.overlapMode))&&(te.push({key:Mt,x1:dt[Ct],y1:dt[Ct+1],x2:dt[Ct+2],y2:dt[Ct+3]}),Re))return!0}}const ct=this.circleCells[q];if(ct!==null){const dt=this.circles;for(const bt of ct)if(!Ae.circle[bt]){Ae.circle[bt]=!0;const Ct=3*bt,Mt=this.circleKeys[bt];if(this._circleAndRectCollide(dt[Ct],dt[Ct+1],dt[Ct+2],i,a,C,F)&&(!ve||ve(Mt))&&(!Re||!At(Ue,Mt.overlapMode))){const Ut=dt[Ct],It=dt[Ct+1],Qt=dt[Ct+2];if(te.push({key:Mt,x1:Ut-Qt,y1:It-Qt,x2:Ut+Qt,y2:It+Qt}),Re)return!0}}}return!1}_queryCellCircle(i,a,C,F,q,te,ue,ve){const{circle:Ae,seenUids:Re,overlapMode:Ue}=ue,it=this.boxCells[q];if(it!==null){const dt=this.bboxes;for(const bt of it)if(!Re.box[bt]){Re.box[bt]=!0;const Ct=4*bt,Mt=this.boxKeys[bt];if(this._circleAndRectCollide(Ae.x,Ae.y,Ae.radius,dt[Ct+0],dt[Ct+1],dt[Ct+2],dt[Ct+3])&&(!ve||ve(Mt))&&!At(Ue,Mt.overlapMode))return te.push(!0),!0}}const ct=this.circleCells[q];if(ct!==null){const dt=this.circles;for(const bt of ct)if(!Re.circle[bt]){Re.circle[bt]=!0;const Ct=3*bt,Mt=this.circleKeys[bt];if(this._circlesCollide(dt[Ct],dt[Ct+1],dt[Ct+2],Ae.x,Ae.y,Ae.radius)&&(!ve||ve(Mt))&&!At(Ue,Mt.overlapMode))return te.push(!0),!0}}}_forEachCell(i,a,C,F,q,te,ue,ve){const Ae=this._convertToXCellCoord(i),Re=this._convertToYCellCoord(a),Ue=this._convertToXCellCoord(C),it=this._convertToYCellCoord(F);for(let ct=Ae;ct<=Ue;ct++)for(let dt=Re;dt<=it;dt++){const bt=this.xCellCount*dt+ct;if(q.call(this,i,a,C,F,bt,te,ue,ve))return}}_convertToXCellCoord(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))}_convertToYCellCoord(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))}_circlesCollide(i,a,C,F,q,te){const ue=F-i,ve=q-a,Ae=C+te;return Ae*Ae>ue*ue+ve*ve}_circleAndRectCollide(i,a,C,F,q,te,ue){const ve=(te-F)/2,Ae=Math.abs(i-(F+ve));if(Ae>ve+C)return!1;const Re=(ue-q)/2,Ue=Math.abs(a-(q+Re));if(Ue>Re+C)return!1;if(Ae<=ve||Ue<=Re)return!0;const it=Ae-ve,ct=Ue-Re;return it*it+ct*ct<=C*C}}function Vt(R,i,a,C,F){const q=e.H();return i?(e.K(q,q,[1/F,1/F,1]),a||e.ae(q,q,C.angle)):e.L(q,C.labelPlaneMatrix,R),q}function Ht(R,i,a,C,F){if(i){const q=e.af(R);return e.K(q,q,[F,F,1]),a||e.ae(q,q,-C.angle),q}return C.glCoordMatrix}function Gt(R,i,a){let C;a?(C=[R.x,R.y,a(R.x,R.y),1],e.ag(C,C,i)):(C=[R.x,R.y,0,1],function(q,te,ue){const ve=te[0],Ae=te[1];q[0]=ue[0]*ve+ue[4]*Ae+ue[12],q[1]=ue[1]*ve+ue[5]*Ae+ue[13],q[3]=ue[3]*ve+ue[7]*Ae+ue[15]}(C,C,i));const F=C[3];return{point:new e.P(C[0]/F,C[1]/F),signedDistanceFromCamera:F,isOccluded:!1}}function st(R,i){return .5+R/i*.5}function Qe(R,i){return R.x>=-i[0]&&R.x<=i[0]&&R.y>=-i[1]&&R.y<=i[1]}function pt(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt){const bt=C?R.textSizeData:R.iconSizeData,Ct=e.ah(bt,a.transform.zoom),Mt=[256/a.width*2+1,256/a.height*2+1],Ut=C?R.text.dynamicLayoutVertexArray:R.icon.dynamicLayoutVertexArray;Ut.clear();const It=R.lineVertexArray,Qt=C?R.text.placedSymbolArray:R.icon.placedSymbolArray,tn=a.transform.width/a.transform.height;let Yt=!1;for(let vn=0;vnMath.abs(a.x-i.x)*C?{useVertical:!0}:(R===e.ai.vertical?i.ya.x)?{needsFlipping:!0}:null}function Pt(R,i,a,C,F,q,te,ue,ve,Ae,Re){const Ue=a/24,it=i.lineOffsetX*Ue,ct=i.lineOffsetY*Ue;let dt;if(i.numGlyphs>1){const bt=i.glyphStartIndex+i.numGlyphs,Ct=i.lineStartIndex,Mt=i.lineStartIndex+i.lineLength,Ut=yt(Ue,ue,it,ct,C,i,Re,R);if(!Ut)return{notEnoughRoom:!0};const It=Gt(Ut.first.point,te,R.getElevation).point,Qt=Gt(Ut.last.point,te,R.getElevation).point;if(F&&!C){const tn=Ot(i.writingMode,It,Qt,Ae);if(tn)return tn}dt=[Ut.first];for(let tn=i.glyphStartIndex+1;tn0?It.point:function(Yt,vn,Mn,Vn,Hn,Xn){return at(Yt,vn,Mn,Vn,Hn,Xn)}(R.tileAnchorPoint,Ut,Ct,1,q,R),tn=Ot(i.writingMode,Ct,Qt,Ae);if(tn)return tn}const bt=vt(Ue*ue.getoffsetX(i.glyphStartIndex),it,ct,C,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,R,Re);if(!bt||R.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};dt=[bt]}for(const bt of dt)e.ak(ve,bt.point,bt.angle);return{}}function at(R,i,a,C,F,q){const te=R.add(R.sub(i)._unit()),ue=F!==void 0?Gt(te,F,q.getElevation).point:Xe(te.x,te.y,q).point,ve=a.sub(ue);return a.add(ve._mult(C/ve.mag()))}function lt(R,i,a){const C=i.projectionCache;if(C.projections[R])return C.projections[R];const F=new e.P(i.lineVertexArray.getx(R),i.lineVertexArray.gety(R)),q=Xe(F.x,F.y,i);if(q.signedDistanceFromCamera>0)return C.projections[R]=q.point,C.anyProjectionOccluded=C.anyProjectionOccluded||q.isOccluded,q.point;const te=R-a.direction,ue=a.distanceFromAnchor===0?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(te),i.lineVertexArray.gety(te)),ve=a.absOffsetX-a.distanceFromAnchor+1;return function(Ae,Re,Ue,it,ct){return at(Ae,Re,Ue,it,void 0,ct)}(ue,F,a.previousVertex,ve,i)}function Xe(R,i,a){const C=R+a.translation[0],F=i+a.translation[1];let q;return!a.pitchWithMap&&a.projection.useSpecialProjectionForSymbols?(q=a.projection.projectTileCoordinates(C,F,a.unwrappedTileID,a.getElevation),q.point.x=(.5*q.point.x+.5)*a.width,q.point.y=(.5*-q.point.y+.5)*a.height):(q=Gt(new e.P(C,F),a.labelPlaneMatrix,a.getElevation),q.isOccluded=!1),q}function ut(R,i,a){return R._unit()._perp()._mult(i*a)}function wt(R,i,a,C,F,q,te,ue,ve){if(ue.projectionCache.offsets[R])return ue.projectionCache.offsets[R];const Ae=a.add(i);if(R+ve.direction=F)return ue.projectionCache.offsets[R]=Ae,Ae;const Re=lt(R+ve.direction,ue,ve),Ue=ut(Re.sub(a),te,ve.direction),it=a.add(Ue),ct=Re.add(Ue);return ue.projectionCache.offsets[R]=e.al(q,Ae,it,ct)||Ae,ue.projectionCache.offsets[R]}function vt(R,i,a,C,F,q,te,ue,ve){const Ae=C?R-i:R+i;let Re=Ae>0?1:-1,Ue=0;C&&(Re*=-1,Ue=Math.PI),Re<0&&(Ue+=Math.PI);let it,ct=Re>0?q+F:q+F+1;ue.projectionCache.cachedAnchorPoint?it=ue.projectionCache.cachedAnchorPoint:(it=Xe(ue.tileAnchorPoint.x,ue.tileAnchorPoint.y,ue).point,ue.projectionCache.cachedAnchorPoint=it);let dt,bt,Ct=it,Mt=it,Ut=0,It=0;const Qt=Math.abs(Ae),tn=[];let Yt;for(;Ut+It<=Qt;){if(ct+=Re,ct=te)return null;Ut+=It,Mt=Ct,bt=dt;const Hn={absOffsetX:Qt,direction:Re,distanceFromAnchor:Ut,previousVertex:Mt};if(Ct=lt(ct,ue,Hn),a===0)tn.push(Mt),Yt=Ct.sub(Mt);else{let Xn;const rr=Ct.sub(Mt);Xn=rr.mag()===0?ut(lt(ct+Re,ue,Hn).sub(Ct),a,Re):ut(rr,a,Re),bt||(bt=Mt.add(Xn)),dt=wt(ct,Xn,Ct,q,te,bt,a,ue,Hn),tn.push(bt),Yt=dt.sub(bt)}It=Yt.mag()}const vn=(Qt-Ut)/It,Mn=Yt._mult(vn)._add(bt||Mt),Vn=Ue+Math.atan2(Ct.y-Mt.y,Ct.x-Mt.x);return tn.push(Mn),{point:Mn,angle:ve?Vn:0,path:tn}}const Lt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function jt(R,i){for(let a=0;a=1;Nr--)Sr.push(dr.path[Nr]);for(let Nr=1;Nrsi.signedDistanceFromCamera<=0)?[]:Nr.map(si=>si.point)}let fi=[];if(Sr.length>0){const Nr=Sr[0].clone(),si=Sr[0].clone();for(let _i=1;_i=Mr.x&&si.x<=nr.x&&Nr.y>=Mr.y&&si.y<=nr.y?[Sr]:si.xnr.x||si.ynr.y?[]:e.am([Sr],Mr.x,Mr.y,nr.x,nr.y)}for(const Nr of fi){Lr.reset(Nr,.25*rr);let si=0;si=Lr.length<=.5*rr?1:Math.ceil(Lr.paddedLength/Vr)+1;for(let _i=0;_iGt(F,C,a.getElevation))}queryRenderedSymbols(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const a=[];let C=1/0,F=1/0,q=-1/0,te=-1/0;for(const Re of i){const Ue=new e.P(Re.x+rt,Re.y+rt);C=Math.min(C,Ue.x),F=Math.min(F,Ue.y),q=Math.max(q,Ue.x),te=Math.max(te,Ue.y),a.push(Ue)}const ue=this.grid.query(C,F,q,te).concat(this.ignoredGrid.query(C,F,q,te)),ve={},Ae={};for(const Re of ue){const Ue=Re.key;if(ve[Ue.bucketInstanceId]===void 0&&(ve[Ue.bucketInstanceId]={}),ve[Ue.bucketInstanceId][Ue.featureIndex])continue;const it=[new e.P(Re.x1,Re.y1),new e.P(Re.x2,Re.y1),new e.P(Re.x2,Re.y2),new e.P(Re.x1,Re.y2)];e.an(a,it)&&(ve[Ue.bucketInstanceId][Ue.featureIndex]=!0,Ae[Ue.bucketInstanceId]===void 0&&(Ae[Ue.bucketInstanceId]=[]),Ae[Ue.bucketInstanceId].push(Ue.featureIndex))}return Ae}insertCollisionBox(i,a,C,F,q,te){const ue={bucketInstanceId:F,featureIndex:q,collisionGroupID:te,overlapMode:a};(C?this.ignoredGrid:this.grid).insert(ue,i[0],i[1],i[2],i[3])}insertCollisionCircles(i,a,C,F,q,te){const ue=C?this.ignoredGrid:this.grid,ve={bucketInstanceId:F,featureIndex:q,collisionGroupID:te,overlapMode:a};for(let Ae=0;Ae=this.screenRightBoundary||Fthis.screenBottomBoundary}isInsideGrid(i,a,C,F){return C>=0&&i=0&&athis.projectAndGetPerspectiveRatio(C,Xn.x,Xn.y,F,Ae));Vn=Hn.some(Xn=>!Xn.isOccluded),Mn=Hn.map(Xn=>Xn.point)}else Vn=!0;return{box:e.ap(Mn),allPointsOccluded:!Vn}}}function Et(R,i,a){return i*(e.X/(R.tileSize*Math.pow(2,a-R.tileID.overscaledZ)))}class Bt{constructor(i,a,C,F){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?a:-a))):F&&C?1:0,this.placed=C}isHidden(){return this.opacity===0&&!this.placed}}class Ft{constructor(i,a,C,F,q){this.text=new Bt(i?i.text:null,a,C,q),this.icon=new Bt(i?i.icon:null,a,F,q)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class St{constructor(i,a,C){this.text=i,this.icon=a,this.skipFade=C}}class Jt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class qt{constructor(i,a,C,F,q){this.bucketInstanceId=i,this.featureIndex=a,this.sourceLayerIndex=C,this.bucketIndex=F,this.tileID=q}}class en{constructor(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}}get(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){const a=++this.maxGroupID;this.collisionGroups[i]={ID:a,predicate:C=>C.collisionGroupID===a}}return this.collisionGroups[i]}}function Wt(R,i,a,C,F){const{horizontalAlign:q,verticalAlign:te}=e.av(R),ue=-(q-.5)*i,ve=-(te-.5)*a;return new e.P(ue+C[0]*F,ve+C[1]*F)}class Zt{constructor(i,a,C,F,q,te){this.transform=i.clone(),this.terrain=C,this.collisionIndex=new et(this.transform,a),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=F,this.retainedQueryData={},this.collisionGroups=new en(q),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=te,te&&(te.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(i){const a=this.terrain;return a?(C,F)=>a.getElevation(i,C,F):null}getBucketParts(i,a,C,F){const q=C.getBucket(a),te=C.latestFeatureIndex;if(!q||!te||a.id!==q.layerIds[0])return;const ue=C.collisionBoxArray,ve=q.layers[0].layout,Ae=q.layers[0].paint,Re=Math.pow(2,this.transform.zoom-C.tileID.overscaledZ),Ue=C.tileSize/e.X,it=C.tileID.toUnwrapped(),ct=this.transform.calculatePosMatrix(it),dt=ve.get("text-pitch-alignment")==="map",bt=ve.get("text-rotation-alignment")==="map",Ct=Et(C,1,this.transform.zoom),Mt=this.collisionIndex.mapProjection.translatePosition(this.transform,C,Ae.get("text-translate"),Ae.get("text-translate-anchor")),Ut=this.collisionIndex.mapProjection.translatePosition(this.transform,C,Ae.get("icon-translate"),Ae.get("icon-translate-anchor")),It=Vt(ct,dt,bt,this.transform,Ct);let Qt=null;if(dt){const Yt=Ht(ct,dt,bt,this.transform,Ct);Qt=e.L([],this.transform.labelPlaneMatrix,Yt)}this.retainedQueryData[q.bucketInstanceId]=new qt(q.bucketInstanceId,te,q.sourceLayerIndex,q.index,C.tileID);const tn={bucket:q,layout:ve,translationText:Mt,translationIcon:Ut,posMatrix:ct,unwrappedTileID:it,textLabelPlaneMatrix:It,labelToScreenMatrix:Qt,scale:Re,textPixelRatio:Ue,holdingForFade:C.holdingForFade(),collisionBoxArray:ue,partiallyEvaluatedTextSize:e.ah(q.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(q.sourceID)};if(F)for(const Yt of q.sortKeyRanges){const{sortKey:vn,symbolInstanceStart:Mn,symbolInstanceEnd:Vn}=Yt;i.push({sortKey:vn,symbolInstanceStart:Mn,symbolInstanceEnd:Vn,parameters:tn})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:q.symbolInstances.length,parameters:tn})}attemptAnchorPlacement(i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt,bt,Ct,Mt,Ut,It){const Qt=e.ar[i.textAnchor],tn=[i.textOffset0,i.textOffset1],Yt=Wt(Qt,C,F,tn,q),vn=this.collisionIndex.placeCollisionBox(a,it,ve,Ae,Re,ue,te,Ct,Ue.predicate,It,Yt);if((!Ut||this.collisionIndex.placeCollisionBox(Ut,it,ve,Ae,Re,ue,te,Mt,Ue.predicate,It,Yt).placeable)&&vn.placeable){let Mn;if(this.prevPlacement&&this.prevPlacement.variableOffsets[ct.crossTileID]&&this.prevPlacement.placements[ct.crossTileID]&&this.prevPlacement.placements[ct.crossTileID].text&&(Mn=this.prevPlacement.variableOffsets[ct.crossTileID].anchor),ct.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[ct.crossTileID]={textOffset:tn,width:C,height:F,anchor:Qt,textBoxScale:q,prevAnchor:Mn},this.markUsedJustification(dt,Qt,ct,bt),dt.allowVerticalPlacement&&(this.markUsedOrientation(dt,bt,ct),this.placedOrientations[ct.crossTileID]=bt),{shift:Yt,placedGlyphBoxes:vn}}}placeLayerBucketPart(i,a,C){const{bucket:F,layout:q,translationText:te,translationIcon:ue,posMatrix:ve,unwrappedTileID:Ae,textLabelPlaneMatrix:Re,labelToScreenMatrix:Ue,textPixelRatio:it,holdingForFade:ct,collisionBoxArray:dt,partiallyEvaluatedTextSize:bt,collisionGroup:Ct}=i.parameters,Mt=q.get("text-optional"),Ut=q.get("icon-optional"),It=e.as(q,"text-overlap","text-allow-overlap"),Qt=It==="always",tn=e.as(q,"icon-overlap","icon-allow-overlap"),Yt=tn==="always",vn=q.get("text-rotation-alignment")==="map",Mn=q.get("text-pitch-alignment")==="map",Vn=q.get("icon-text-fit")!=="none",Hn=q.get("symbol-z-order")==="viewport-y",Xn=Qt&&(Yt||!F.hasIconData()||Ut),rr=Yt&&(Qt||!F.hasTextData()||Mt);!F.collisionArrays&&dt&&F.deserializeCollisionBoxes(dt);const Mr=this.retainedQueryData[F.bucketInstanceId].tileID,nr=this._getTerrainElevationFunc(Mr),Lr=(dr,Br,Sr)=>{var Vr,fi;if(a[dr.crossTileID])return;if(ct)return void(this.placements[dr.crossTileID]=new St(!1,!1,!1));let Nr=!1,si=!1,_i=!0,Gi=null,Pi={box:null,placeable:!1,offscreen:null},Ji={box:null,placeable:!1,offscreen:null},Yi=null,na=null,Ma=null,go=0,uo=0,Go=0;Br.textFeatureIndex?go=Br.textFeatureIndex:dr.useRuntimeCollisionCircles&&(go=dr.featureIndex),Br.verticalTextFeatureIndex&&(uo=Br.verticalTextFeatureIndex);const Da=Br.textBox;if(Da){const Fa=mo=>{let Hi=e.ai.horizontal;if(F.allowVerticalPlacement&&!mo&&this.prevPlacement){const fs=this.prevPlacement.placedOrientations[dr.crossTileID];fs&&(this.placedOrientations[dr.crossTileID]=fs,Hi=fs,this.markUsedOrientation(F,Hi,dr))}return Hi},qa=(mo,Hi)=>{if(F.allowVerticalPlacement&&dr.numVerticalGlyphVertices>0&&Br.verticalTextBox){for(const fs of F.writingModes)if(fs===e.ai.vertical?(Pi=Hi(),Ji=Pi):Pi=mo(),Pi&&Pi.placeable)break}else Pi=mo()},fa=dr.textAnchorOffsetStartIndex,Pl=dr.textAnchorOffsetEndIndex;if(Pl===fa){const mo=(Hi,fs)=>{const Po=this.collisionIndex.placeCollisionBox(Hi,It,it,ve,Ae,Mn,vn,te,Ct.predicate,nr);return Po&&Po.placeable&&(this.markUsedOrientation(F,fs,dr),this.placedOrientations[dr.crossTileID]=fs),Po};qa(()=>mo(Da,e.ai.horizontal),()=>{const Hi=Br.verticalTextBox;return F.allowVerticalPlacement&&dr.numVerticalGlyphVertices>0&&Hi?mo(Hi,e.ai.vertical):{box:null,offscreen:null}}),Fa(Pi&&Pi.placeable)}else{let mo=e.ar[(fi=(Vr=this.prevPlacement)===null||Vr===void 0?void 0:Vr.variableOffsets[dr.crossTileID])===null||fi===void 0?void 0:fi.anchor];const Hi=(Po,ll,ao)=>{const ul=Po.x2-Po.x1,Lo=Po.y2-Po.y1,Bc=dr.textBoxScale,ef=Vn&&tn==="never"?ll:null;let ga=null,Ch=It==="never"?1:2,Cu="never";mo&&Ch++;for(let Sc=0;ScHi(Da,Br.iconBox,e.ai.horizontal),()=>{const Po=Br.verticalTextBox,ll=Pi&&Pi.placeable;return F.allowVerticalPlacement&&!ll&&dr.numVerticalGlyphVertices>0&&Po?Hi(Po,Br.verticalIconBox,e.ai.vertical):{box:null,occluded:!0,offscreen:null}}),Pi&&(Nr=Pi.placeable,_i=Pi.offscreen);const fs=Fa(Pi&&Pi.placeable);if(!Nr&&this.prevPlacement){const Po=this.prevPlacement.variableOffsets[dr.crossTileID];Po&&(this.variableOffsets[dr.crossTileID]=Po,this.markUsedJustification(F,Po.anchor,dr,fs))}}}if(Yi=Pi,Nr=Yi&&Yi.placeable,_i=Yi&&Yi.offscreen,dr.useRuntimeCollisionCircles){const Fa=F.text.placedSymbolArray.get(dr.centerJustifiedTextSymbolIndex),qa=e.aj(F.textSizeData,bt,Fa),fa=q.get("text-padding"),Pl=dr.collisionCircleDiameter;na=this.collisionIndex.placeCollisionCircles(It,Fa,F.lineVertexArray,F.glyphOffsetArray,qa,ve,Ae,Re,Ue,C,Mn,Ct.predicate,Pl,fa,te,nr),na.circles.length&&na.collisionDetected&&!C&&e.w("Collisions detected, but collision boxes are not shown"),Nr=Qt||na.circles.length>0&&!na.collisionDetected,_i=_i&&na.offscreen}if(Br.iconFeatureIndex&&(Go=Br.iconFeatureIndex),Br.iconBox){const Fa=qa=>this.collisionIndex.placeCollisionBox(qa,tn,it,ve,Ae,Mn,vn,ue,Ct.predicate,nr,Vn&&Gi?Gi:void 0);Ji&&Ji.placeable&&Br.verticalIconBox?(Ma=Fa(Br.verticalIconBox),si=Ma.placeable):(Ma=Fa(Br.iconBox),si=Ma.placeable),_i=_i&&Ma.offscreen}const ca=Mt||dr.numHorizontalGlyphVertices===0&&dr.numVerticalGlyphVertices===0,Qa=Ut||dr.numIconVertices===0;ca||Qa?Qa?ca||(si=si&&Nr):Nr=si&&Nr:si=Nr=si&&Nr;const Ra=Nr&&Yi.placeable,wa=si&&Ma.placeable;if(Ra&&(Ji&&Ji.placeable&&uo?this.collisionIndex.insertCollisionBox(Yi.box,It,q.get("text-ignore-placement"),F.bucketInstanceId,uo,Ct.ID):this.collisionIndex.insertCollisionBox(Yi.box,It,q.get("text-ignore-placement"),F.bucketInstanceId,go,Ct.ID)),wa&&this.collisionIndex.insertCollisionBox(Ma.box,tn,q.get("icon-ignore-placement"),F.bucketInstanceId,Go,Ct.ID),na&&Nr&&this.collisionIndex.insertCollisionCircles(na.circles,It,q.get("text-ignore-placement"),F.bucketInstanceId,go,Ct.ID),C&&this.storeCollisionData(F.bucketInstanceId,Sr,Br,Yi,Ma,na),dr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(F.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[dr.crossTileID]=new St(Nr||Xn,si||rr,_i||F.justReloaded),a[dr.crossTileID]=!0};if(Hn){if(i.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const dr=F.getSortedSymbolIndexes(this.transform.angle);for(let Br=dr.length-1;Br>=0;--Br){const Sr=dr[Br];Lr(F.symbolInstances.get(Sr),F.collisionArrays[Sr],Sr)}}else for(let dr=i.symbolInstanceStart;dr=0&&(i.text.placedSymbolArray.get(ve).crossTileID=te>=0&&ve!==te?0:C.crossTileID)}markUsedOrientation(i,a,C){const F=a===e.ai.horizontal||a===e.ai.horizontalOnly?a:0,q=a===e.ai.vertical?a:0,te=[C.leftJustifiedTextSymbolIndex,C.centerJustifiedTextSymbolIndex,C.rightJustifiedTextSymbolIndex];for(const ue of te)i.text.placedSymbolArray.get(ue).placedOrientation=F;C.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(C.verticalPlacedTextSymbolIndex).placedOrientation=q)}commit(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;const a=this.prevPlacement;let C=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;const F=a?a.symbolFadeChange(i):1,q=a?a.opacities:{},te=a?a.variableOffsets:{},ue=a?a.placedOrientations:{};for(const ve in this.placements){const Ae=this.placements[ve],Re=q[ve];Re?(this.opacities[ve]=new Ft(Re,F,Ae.text,Ae.icon),C=C||Ae.text!==Re.text.placed||Ae.icon!==Re.icon.placed):(this.opacities[ve]=new Ft(null,F,Ae.text,Ae.icon,Ae.skipFade),C=C||Ae.text||Ae.icon)}for(const ve in q){const Ae=q[ve];if(!this.opacities[ve]){const Re=new Ft(Ae,F,!1,!1);Re.isHidden()||(this.opacities[ve]=Re,C=C||Ae.text.placed||Ae.icon.placed)}}for(const ve in te)this.variableOffsets[ve]||!this.opacities[ve]||this.opacities[ve].isHidden()||(this.variableOffsets[ve]=te[ve]);for(const ve in ue)this.placedOrientations[ve]||!this.opacities[ve]||this.opacities[ve].isHidden()||(this.placedOrientations[ve]=ue[ve]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");C?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:i)}updateLayerOpacities(i,a){const C={};for(const F of a){const q=F.getBucket(i);q&&F.latestFeatureIndex&&i.id===q.layerIds[0]&&this.updateBucketOpacities(q,F.tileID,C,F.collisionBoxArray)}}updateBucketOpacities(i,a,C,F){i.hasTextData()&&(i.text.opacityVertexArray.clear(),i.text.hasVisibleVertices=!1),i.hasIconData()&&(i.icon.opacityVertexArray.clear(),i.icon.hasVisibleVertices=!1),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();const q=i.layers[0],te=q.layout,ue=new Ft(null,0,!1,!1,!0),ve=te.get("text-allow-overlap"),Ae=te.get("icon-allow-overlap"),Re=q._unevaluatedLayout.hasValue("text-variable-anchor")||q._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Ue=te.get("text-rotation-alignment")==="map",it=te.get("text-pitch-alignment")==="map",ct=te.get("icon-text-fit")!=="none",dt=new Ft(null,0,ve&&(Ae||!i.hasIconData()||te.get("icon-optional")),Ae&&(ve||!i.hasTextData()||te.get("text-optional")),!0);!i.collisionArrays&&F&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(F);const bt=(Mt,Ut,It)=>{for(let Qt=0;Qt0||Qt>0,Vn=Ut.numIconVertices>0,Hn=this.placedOrientations[Ut.crossTileID],Xn=Hn===e.ai.vertical,rr=Hn===e.ai.horizontal||Hn===e.ai.horizontalOnly;if(Mn){const nr=Ln(vn.text),Lr=Xn?Tn:nr;bt(i.text,It,Lr);const dr=rr?Tn:nr;bt(i.text,Qt,dr);const Br=vn.text.isHidden();[Ut.rightJustifiedTextSymbolIndex,Ut.centerJustifiedTextSymbolIndex,Ut.leftJustifiedTextSymbolIndex].forEach(fi=>{fi>=0&&(i.text.placedSymbolArray.get(fi).hidden=Br||Xn?1:0)}),Ut.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(Ut.verticalPlacedTextSymbolIndex).hidden=Br||rr?1:0);const Sr=this.variableOffsets[Ut.crossTileID];Sr&&this.markUsedJustification(i,Sr.anchor,Ut,Hn);const Vr=this.placedOrientations[Ut.crossTileID];Vr&&(this.markUsedJustification(i,"left",Ut,Vr),this.markUsedOrientation(i,Vr,Ut))}if(Vn){const nr=Ln(vn.icon),Lr=!(ct&&Ut.verticalPlacedIconSymbolIndex&&Xn);if(Ut.placedIconSymbolIndex>=0){const dr=Lr?nr:Tn;bt(i.icon,Ut.numIconVertices,dr),i.icon.placedSymbolArray.get(Ut.placedIconSymbolIndex).hidden=vn.icon.isHidden()}if(Ut.verticalPlacedIconSymbolIndex>=0){const dr=Lr?Tn:nr;bt(i.icon,Ut.numVerticalIconVertices,dr),i.icon.placedSymbolArray.get(Ut.verticalPlacedIconSymbolIndex).hidden=vn.icon.isHidden()}}const Mr=Ct&&Ct.has(Mt)?Ct.get(Mt):{text:null,icon:null};if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){const nr=i.collisionArrays[Mt];if(nr){let Lr=new e.P(0,0);if(nr.textBox||nr.verticalTextBox){let dr=!0;if(Re){const Br=this.variableOffsets[tn];Br?(Lr=Wt(Br.anchor,Br.width,Br.height,Br.textOffset,Br.textBoxScale),Ue&&Lr._rotate(it?this.transform.angle:-this.transform.angle)):dr=!1}if(nr.textBox||nr.verticalTextBox){let Br;nr.textBox&&(Br=Xn),nr.verticalTextBox&&(Br=rr),on(i.textCollisionBox.collisionVertexArray,vn.text.placed,!dr||Br,Mr.text,Lr.x,Lr.y)}}if(nr.iconBox||nr.verticalIconBox){const dr=!!(!rr&&nr.verticalIconBox);let Br;nr.iconBox&&(Br=dr),nr.verticalIconBox&&(Br=!dr),on(i.iconCollisionBox.collisionVertexArray,vn.icon.placed,Br,Mr.icon,ct?Lr.x:0,ct?Lr.y:0)}}}}if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.text.opacityVertexArray.length!==i.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${i.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${i.text.layoutVertexArray.length}) / 4`);if(i.icon.opacityVertexArray.length!==i.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${i.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${i.icon.layoutVertexArray.length}) / 4`);if(i.bucketInstanceId in this.collisionCircleArrays){const Mt=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=Mt.invProjMatrix,i.placementViewportMatrix=Mt.viewportMatrix,i.collisionCircleArray=Mt.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}}symbolFadeChange(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(i){return Math.max(0,(this.transform.zoom-i)/1.5)}hasTransitions(i){return this.stale||i-this.lastPlacementChangeTimei}setStale(){this.stale=!0}}function on(R,i,a,C,F,q){C&&C.length!==0||(C=[0,0,0,0]);const te=C[0]-rt,ue=C[1]-rt,ve=C[2]-rt,Ae=C[3]-rt;R.emplaceBack(i?1:0,a?1:0,F||0,q||0,te,ue),R.emplaceBack(i?1:0,a?1:0,F||0,q||0,ve,ue),R.emplaceBack(i?1:0,a?1:0,F||0,q||0,ve,Ae),R.emplaceBack(i?1:0,a?1:0,F||0,q||0,te,Ae)}const un=Math.pow(2,25),Pn=Math.pow(2,24),Dn=Math.pow(2,17),In=Math.pow(2,16),mn=Math.pow(2,9),En=Math.pow(2,8),Kn=Math.pow(2,1);function Ln(R){if(R.opacity===0&&!R.placed)return 0;if(R.opacity===1&&R.placed)return 4294967295;const i=R.placed?1:0,a=Math.floor(127*R.opacity);return a*un+i*Pn+a*Dn+i*In+a*mn+i*En+a*Kn+i}const Tn=0;function Fn(){return{isOccluded(R,i,a){return!1},getPitchedTextCorrection(R,i,a){return 1},get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(R,i,a,C){throw new Error("Not implemented.")},translatePosition(R,i,a,C){return function(F,q,te,ue,ve=!1){if(!te[0]&&!te[1])return[0,0];const Ae=ve?ue==="map"?F.angle:0:ue==="viewport"?-F.angle:0;if(Ae){const Re=Math.sin(Ae),Ue=Math.cos(Ae);te=[te[0]*Ue-te[1]*Re,te[0]*Re+te[1]*Ue]}return[ve?te[0]:Et(q,te[0],F.zoom),ve?te[1]:Et(q,te[1],F.zoom)]}(R,i,a,C)},getCircleRadiusCorrection(R){return 1}}}class wn{constructor(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&!i.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(i,a,C,F,q){const te=this._bucketParts;for(;this._currentTileIndexue.sortKey-ve.sortKey));this._currentPartIndex!this._forceFullPlacement&&u.now()-F>2;for(;this._currentPlacementIndex>=0;){const te=a[i[this._currentPlacementIndex]],ue=this.placement.collisionIndex.transform.zoom;if(te.type==="symbol"&&(!te.minzoom||te.minzoom<=ue)&&(!te.maxzoom||te.maxzoom>ue)){if(this._inProgressLayer||(this._inProgressLayer=new wn(te)),this._inProgressLayer.continuePlacement(C[te.source],this.placement,this._showCollisionBoxes,te,q))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(i){return this.placement.commit(i),this.placement}}const Jn=512/e.X/2;class $n{constructor(i,a,C){this.tileID=i,this.bucketInstanceId=C,this._symbolsByKey={};const F=new Map;for(let q=0;q({x:Math.floor(ve.anchorX*Jn),y:Math.floor(ve.anchorY*Jn)})),crossTileIDs:te.map(ve=>ve.crossTileID)};if(ue.positions.length>128){const ve=new e.aw(ue.positions.length,16,Uint16Array);for(const{x:Ae,y:Re}of ue.positions)ve.add(Ae,Re);ve.finish(),delete ue.positions,ue.index=ve}this._symbolsByKey[q]=ue}}getScaledCoordinates(i,a){const{x:C,y:F,z:q}=this.tileID.canonical,{x:te,y:ue,z:ve}=a.canonical,Ae=ve-q,Re=Jn/Math.pow(2,Ae),Ue=(te*e.X+i.anchorX)*Re,it=(ue*e.X+i.anchorY)*Re,ct=C*e.X*Jn,dt=F*e.X*Jn;return{x:Math.floor(Ue-ct),y:Math.floor(it-dt)}}findMatches(i,a,C){const F=this.tileID.canonical.zi)}}class vr{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Qn{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(i){const a=Math.round((i-this.lng)/360);if(a!==0)for(const C in this.indexes){const F=this.indexes[C],q={};for(const te in F){const ue=F[te];ue.tileID=ue.tileID.unwrapTo(ue.tileID.wrap+a),q[ue.tileID.key]=ue}this.indexes[C]=q}this.lng=i}addBucket(i,a,C){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(let q=0;qi.overscaledZ)for(const ue in te){const ve=te[ue];ve.tileID.isChildOf(i)&&ve.findMatches(a.symbolInstances,i,F)}else{const ue=te[i.scaledTo(Number(q)).key];ue&&ue.findMatches(a.symbolInstances,i,F)}}for(let q=0;q{a[C]=!0});for(const C in this.layerIndexes)a[C]||delete this.layerIndexes[C]}}const hr=(R,i)=>e.t(R,i&&i.filter(a=>a.identifier!=="source.canvas")),jr=e.ax();class ni extends e.E{constructor(i,a={}){super(),this._rtlPluginLoaded=()=>{for(const C in this.sourceCaches){const F=this.sourceCaches[C].getSource().type;F!=="vector"&&F!=="geojson"||this.sourceCaches[C].reload()}},this.map=i,this.dispatcher=new le(oe(),i._getMapId()),this.dispatcher.registerMessageHandler("GG",(C,F)=>this.getGlyphs(C,F)),this.dispatcher.registerMessageHandler("GI",(C,F)=>this.getImages(C,F)),this.imageManager=new E,this.imageManager.setEventedParent(this),this.glyphManager=new V(i._requestManager,a.localIdeographFontFamily),this.lineAtlas=new K(256,512),this.crossTileSymbolIndex=new lr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.az()),Ye().on(Fe,this._rtlPluginLoaded),this.on("data",C=>{if(C.dataType!=="source"||C.sourceDataType!=="metadata")return;const F=this.sourceCaches[C.sourceId];if(!F)return;const q=F.getSource();if(q&&q.vectorLayerIds)for(const te in this._layers){const ue=this._layers[te];ue.source===q.id&&this._validateLayer(ue)}})}loadURL(i,a={},C){this.fire(new e.k("dataloading",{dataType:"style"})),a.validate=typeof a.validate!="boolean"||a.validate;const F=this.map._requestManager.transformRequest(i,"Style");this._loadStyleRequest=new AbortController;const q=this._loadStyleRequest;e.h(F,this._loadStyleRequest).then(te=>{this._loadStyleRequest=null,this._load(te.data,a,C)}).catch(te=>{this._loadStyleRequest=null,te&&!q.signal.aborted&&this.fire(new e.j(te))})}loadJSON(i,a={},C){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(i,a,C)}).catch(()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(jr,{validate:!1})}_load(i,a,C){var F;const q=a.transformStyle?a.transformStyle(C,i):i;if(!a.validate||!hr(this,e.x(q))){this._loaded=!0,this.stylesheet=q;for(const te in q.sources)this.addSource(te,q.sources[te],{validate:!1});q.sprite?this._loadSprite(q.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(q.glyphs),this._createLayers(),this.light=new H(this.stylesheet.light),this.sky=new Z(this.stylesheet.sky),this.map.setTerrain((F=this.stylesheet.terrain)!==null&&F!==void 0?F:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const i=e.aA(this.stylesheet.layers);this.dispatcher.broadcast("SL",i),this._order=i.map(a=>a.id),this._layers={},this._serializedLayers=null;for(const a of i){const C=e.aB(a);C.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=C}}_loadSprite(i,a=!1,C=void 0){let F;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,p(i,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(q=>{if(this._spriteRequest=null,q)for(const te in q){this._spritesImagesIds[te]=[];const ue=this._spritesImagesIds[te]?this._spritesImagesIds[te].filter(ve=>!(ve in q)):[];for(const ve of ue)this.imageManager.removeImage(ve),this._changedImages[ve]=!0;for(const ve in q[te]){const Ae=te==="default"?ve:`${te}:${ve}`;this._spritesImagesIds[te].push(Ae),Ae in this.imageManager.images?this.imageManager.updateImage(Ae,q[te][ve],!1):this.imageManager.addImage(Ae,q[te][ve]),a&&(this._changedImages[Ae]=!0)}}}).catch(q=>{this._spriteRequest=null,F=q,this.fire(new e.j(F))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),C&&C(F)})}_unloadSprite(){for(const i of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(i),this._changedImages[i]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(i){const a=this.sourceCaches[i.source];if(!a)return;const C=i.sourceLayer;if(!C)return;const F=a.getSource();(F.type==="geojson"||F.vectorLayerIds&&F.vectorLayerIds.indexOf(C)===-1)&&this.fire(new e.j(new Error(`Source layer "${C}" does not exist on source "${F.id}" as specified by style layer "${i.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const i in this.sourceCaches)if(!this.sourceCaches[i].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(i){const a=this._serializedAllLayers();if(!i||i.length===0)return Object.values(a);const C=[];for(const F of i)a[F]&&C.push(a[F]);return C}_serializedAllLayers(){let i=this._serializedLayers;if(i)return i;i=this._serializedLayers={};const a=Object.keys(this._layers);for(const C of a){const F=this._layers[C];F.type!=="custom"&&(i[C]=F.serialize())}return i}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const i in this.sourceCaches)if(this.sourceCaches[i].hasTransition())return!0;for(const i in this._layers)if(this._layers[i].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(i){if(!this._loaded)return;const a=this._changed;if(a){const F=Object.keys(this._updatedLayers),q=Object.keys(this._removedLayers);(F.length||q.length)&&this._updateWorkerLayers(F,q);for(const te in this._updatedSources){const ue=this._updatedSources[te];if(ue==="reload")this._reloadSource(te);else{if(ue!=="clear")throw new Error(`Invalid action ${ue}`);this._clearSource(te)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const te in this._updatedPaintProps)this._layers[te].updateTransitions(i);this.light.updateTransitions(i),this.sky.updateTransitions(i),this._resetUpdates()}const C={};for(const F in this.sourceCaches){const q=this.sourceCaches[F];C[F]=q.used,q.used=!1}for(const F of this._order){const q=this._layers[F];q.recalculate(i,this._availableImages),!q.isHidden(i.zoom)&&q.source&&(this.sourceCaches[q.source].used=!0)}for(const F in C){const q=this.sourceCaches[F];!!C[F]!=!!q.used&&q.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:F}))}this.light.recalculate(i),this.sky.recalculate(i),this.z=i.zoom,a&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const i=Object.keys(this._changedImages);if(i.length){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["icons","patterns"],i);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const i in this.sourceCaches)this.sourceCaches[i].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(i,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(i),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(i,a={}){var C;this._checkLoaded();const F=this.serialize();if(i=a.transformStyle?a.transformStyle(F,i):i,((C=a.validate)===null||C===void 0||C)&&hr(this,e.x(i)))return!1;(i=e.aC(i)).layers=e.aA(i.layers);const q=e.aD(F,i),te=this._getOperationsToPerform(q);if(te.unimplemented.length>0)throw new Error(`Unimplemented: ${te.unimplemented.join(", ")}.`);if(te.operations.length===0)return!1;for(const ue of te.operations)ue();return this.stylesheet=i,this._serializedLayers=null,!0}_getOperationsToPerform(i){const a=[],C=[];for(const F of i)switch(F.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":a.push(()=>this.addLayer.apply(this,F.args));break;case"removeLayer":a.push(()=>this.removeLayer.apply(this,F.args));break;case"setPaintProperty":a.push(()=>this.setPaintProperty.apply(this,F.args));break;case"setLayoutProperty":a.push(()=>this.setLayoutProperty.apply(this,F.args));break;case"setFilter":a.push(()=>this.setFilter.apply(this,F.args));break;case"addSource":a.push(()=>this.addSource.apply(this,F.args));break;case"removeSource":a.push(()=>this.removeSource.apply(this,F.args));break;case"setLayerZoomRange":a.push(()=>this.setLayerZoomRange.apply(this,F.args));break;case"setLight":a.push(()=>this.setLight.apply(this,F.args));break;case"setGeoJSONSourceData":a.push(()=>this.setGeoJSONSourceData.apply(this,F.args));break;case"setGlyphs":a.push(()=>this.setGlyphs.apply(this,F.args));break;case"setSprite":a.push(()=>this.setSprite.apply(this,F.args));break;case"setSky":a.push(()=>this.setSky.apply(this,F.args));break;case"setTerrain":a.push(()=>this.map.setTerrain.apply(this,F.args));break;case"setTransition":a.push(()=>{});break;default:C.push(F.command)}return{operations:a,unimplemented:C}}addImage(i,a){if(this.getImage(i))return this.fire(new e.j(new Error(`An image named "${i}" already exists.`)));this.imageManager.addImage(i,a),this._afterImageUpdated(i)}updateImage(i,a){this.imageManager.updateImage(i,a)}getImage(i){return this.imageManager.getImage(i)}removeImage(i){if(!this.getImage(i))return this.fire(new e.j(new Error(`An image named "${i}" does not exist.`)));this.imageManager.removeImage(i),this._afterImageUpdated(i)}_afterImageUpdated(i){this._availableImages=this.imageManager.listImages(),this._changedImages[i]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(i,a,C={}){if(this._checkLoaded(),this.sourceCaches[i]!==void 0)throw new Error(`Source "${i}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(a.type)>=0&&this._validate(e.x.source,`sources.${i}`,a,null,C))return;this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);const F=this.sourceCaches[i]=new Ge(i,a,this.dispatcher);F.style=this,F.setEventedParent(this,()=>({isSourceLoaded:F.loaded(),source:F.serialize(),sourceId:i})),F.onAdd(this.map),this._changed=!0}removeSource(i){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error("There is no source with this ID");for(const C in this._layers)if(this._layers[C].source===i)return this.fire(new e.j(new Error(`Source "${i}" cannot be removed while layer "${C}" is using it.`)));const a=this.sourceCaches[i];delete this.sourceCaches[i],delete this._updatedSources[i],a.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:i})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(i,a){if(this._checkLoaded(),this.sourceCaches[i]===void 0)throw new Error(`There is no source with this ID=${i}`);const C=this.sourceCaches[i].getSource();if(C.type!=="geojson")throw new Error(`geojsonSource.type is ${C.type}, which is !== 'geojson`);C.setData(a),this._changed=!0}getSource(i){return this.sourceCaches[i]&&this.sourceCaches[i].getSource()}addLayer(i,a,C={}){this._checkLoaded();const F=i.id;if(this.getLayer(F))return void this.fire(new e.j(new Error(`Layer "${F}" already exists on this map.`)));let q;if(i.type==="custom"){if(hr(this,e.aE(i)))return;q=e.aB(i)}else{if("source"in i&&typeof i.source=="object"&&(this.addSource(F,i.source),i=e.aC(i),i=e.e(i,{source:F})),this._validate(e.x.layer,`layers.${F}`,i,{arrayIndex:-1},C))return;q=e.aB(i),this._validateLayer(q),q.setEventedParent(this,{layer:{id:F}})}const te=a?this._order.indexOf(a):this._order.length;if(a&&te===-1)this.fire(new e.j(new Error(`Cannot add layer "${F}" before non-existing layer "${a}".`)));else{if(this._order.splice(te,0,F),this._layerOrderChanged=!0,this._layers[F]=q,this._removedLayers[F]&&q.source&&q.type!=="custom"){const ue=this._removedLayers[F];delete this._removedLayers[F],ue.type!==q.type?this._updatedSources[q.source]="clear":(this._updatedSources[q.source]="reload",this.sourceCaches[q.source].pause())}this._updateLayer(q),q.onAdd&&q.onAdd(this.map)}}moveLayer(i,a){if(this._checkLoaded(),this._changed=!0,!this._layers[i])return void this.fire(new e.j(new Error(`The layer '${i}' does not exist in the map's style and cannot be moved.`)));if(i===a)return;const C=this._order.indexOf(i);this._order.splice(C,1);const F=a?this._order.indexOf(a):this._order.length;a&&F===-1?this.fire(new e.j(new Error(`Cannot move layer "${i}" before non-existing layer "${a}".`))):(this._order.splice(F,0,i),this._layerOrderChanged=!0)}removeLayer(i){this._checkLoaded();const a=this._layers[i];if(!a)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${i}".`)));a.setEventedParent(null);const C=this._order.indexOf(i);this._order.splice(C,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[i]=a,delete this._layers[i],this._serializedLayers&&delete this._serializedLayers[i],delete this._updatedLayers[i],delete this._updatedPaintProps[i],a.onRemove&&a.onRemove(this.map)}getLayer(i){return this._layers[i]}getLayersOrder(){return[...this._order]}hasLayer(i){return i in this._layers}setLayerZoomRange(i,a,C){this._checkLoaded();const F=this.getLayer(i);F?F.minzoom===a&&F.maxzoom===C||(a!=null&&(F.minzoom=a),C!=null&&(F.maxzoom=C),this._updateLayer(F)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${i}".`)))}setFilter(i,a,C={}){this._checkLoaded();const F=this.getLayer(i);if(F){if(!e.aF(F.filter,a))return a==null?(F.filter=void 0,void this._updateLayer(F)):void(this._validate(e.x.filter,`layers.${F.id}.filter`,a,null,C)||(F.filter=e.aC(a),this._updateLayer(F)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${i}".`)))}getFilter(i){return e.aC(this.getLayer(i).filter)}setLayoutProperty(i,a,C,F={}){this._checkLoaded();const q=this.getLayer(i);q?e.aF(q.getLayoutProperty(a),C)||(q.setLayoutProperty(a,C,F),this._updateLayer(q)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${i}".`)))}getLayoutProperty(i,a){const C=this.getLayer(i);if(C)return C.getLayoutProperty(a);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${i}".`)))}setPaintProperty(i,a,C,F={}){this._checkLoaded();const q=this.getLayer(i);q?e.aF(q.getPaintProperty(a),C)||(q.setPaintProperty(a,C,F)&&this._updateLayer(q),this._changed=!0,this._updatedPaintProps[i]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${i}".`)))}getPaintProperty(i,a){return this.getLayer(i).getPaintProperty(a)}setFeatureState(i,a){this._checkLoaded();const C=i.source,F=i.sourceLayer,q=this.sourceCaches[C];if(q===void 0)return void this.fire(new e.j(new Error(`The source '${C}' does not exist in the map's style.`)));const te=q.getSource().type;te==="geojson"&&F?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):te!=="vector"||F?(i.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),q.setFeatureState(F,i.id,a)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(i,a){this._checkLoaded();const C=i.source,F=this.sourceCaches[C];if(F===void 0)return void this.fire(new e.j(new Error(`The source '${C}' does not exist in the map's style.`)));const q=F.getSource().type,te=q==="vector"?i.sourceLayer:void 0;q!=="vector"||te?a&&typeof i.id!="string"&&typeof i.id!="number"?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):F.removeFeatureState(te,i.id,a):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(i){this._checkLoaded();const a=i.source,C=i.sourceLayer,F=this.sourceCaches[a];if(F!==void 0)return F.getSource().type!=="vector"||C?(i.id===void 0&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),F.getFeatureState(C,i.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const i=e.aG(this.sourceCaches,q=>q.serialize()),a=this._serializeByIds(this._order),C=this.map.getTerrain()||void 0,F=this.stylesheet;return e.aH({version:F.version,name:F.name,metadata:F.metadata,light:F.light,sky:F.sky,center:F.center,zoom:F.zoom,bearing:F.bearing,pitch:F.pitch,sprite:F.sprite,glyphs:F.glyphs,transition:F.transition,sources:i,layers:a,terrain:C},q=>q!==void 0)}_updateLayer(i){this._updatedLayers[i.id]=!0,i.source&&!this._updatedSources[i.source]&&this.sourceCaches[i.source].getSource().type!=="raster"&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(i){const a=te=>this._layers[te].type==="fill-extrusion",C={},F=[];for(let te=this._order.length-1;te>=0;te--){const ue=this._order[te];if(a(ue)){C[ue]=te;for(const ve of i){const Ae=ve[ue];if(Ae)for(const Re of Ae)F.push(Re)}}}F.sort((te,ue)=>ue.intersectionZ-te.intersectionZ);const q=[];for(let te=this._order.length-1;te>=0;te--){const ue=this._order[te];if(a(ue))for(let ve=F.length-1;ve>=0;ve--){const Ae=F[ve].feature;if(C[Ae.layer.id]{const Mn=Mt.featureSortOrder;if(Mn){const Vn=Mn.indexOf(Yt.featureIndex);return Mn.indexOf(vn.featureIndex)-Vn}return vn.featureIndex-Yt.featureIndex});for(const Yt of tn)Qt.push(Yt)}}for(const Mt in dt)dt[Mt].forEach(Ut=>{const It=Ut.feature,Qt=ue[Mt],tn=Ae[Qt.source].getFeatureState(It.layer["source-layer"],It.id);It.source=It.layer.source,It.layer["source-layer"]&&(It.sourceLayer=It.layer["source-layer"]),It.state=tn});return dt}(this._layers,te,this.sourceCaches,i,a,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(q)}querySourceFeatures(i,a){a&&a.filter&&this._validate(e.x.filter,"querySourceFeatures.filter",a.filter,null,a);const C=this.sourceCaches[i];return C?function(F,q){const te=F.getRenderableIds().map(Ae=>F.getTileByID(Ae)),ue=[],ve={};for(let Ae=0;Aeit.getTileByID(ct)).sort((ct,dt)=>dt.tileID.overscaledZ-ct.tileID.overscaledZ||(ct.tileID.isLessThan(dt.tileID)?-1:1))}const Ue=this.crossTileSymbolIndex.addLayer(Re,ve[Re.source],i.center.lng);te=te||Ue}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((q=q||this._layerOrderChanged||C===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(u.now(),i.zoom))&&(this.pauseablePlacement=new zn(i,this.map.terrain,this._order,q,a,C,F,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,ve),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(u.now()),ue=!0),te&&this.pauseablePlacement.placement.setStale()),ue||te)for(const Ae of this._order){const Re=this._layers[Ae];Re.type==="symbol"&&this.placement.updateLayerOpacities(Re,ve[Re.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(u.now())}_releaseSymbolFadeTiles(){for(const i in this.sourceCaches)this.sourceCaches[i].releaseSymbolFadeTiles()}getImages(i,a){return e._(this,void 0,void 0,function*(){const C=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();const F=this.sourceCaches[a.source];return F&&F.setDependencies(a.tileID.key,a.type,a.icons),C})}getGlyphs(i,a){return e._(this,void 0,void 0,function*(){const C=yield this.glyphManager.getGlyphs(a.stacks),F=this.sourceCaches[a.source];return F&&F.setDependencies(a.tileID.key,a.type,[""]),C})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(i,a={}){this._checkLoaded(),i&&this._validate(e.x.glyphs,"glyphs",i,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=i,this.glyphManager.entries={},this.glyphManager.setURL(i))}addSprite(i,a,C={},F){this._checkLoaded();const q=[{id:i,url:a}],te=[...S(this.stylesheet.sprite),...q];this._validate(e.x.sprite,"sprite",te,null,C)||(this.stylesheet.sprite=te,this._loadSprite(q,!0,F))}removeSprite(i){this._checkLoaded();const a=S(this.stylesheet.sprite);if(a.find(C=>C.id===i)){if(this._spritesImagesIds[i])for(const C of this._spritesImagesIds[i])this.imageManager.removeImage(C),this._changedImages[C]=!0;a.splice(a.findIndex(C=>C.id===i),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[i],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${i}" doesn't exists on this map.`)))}getSprite(){return S(this.stylesheet.sprite)}setSprite(i,a={},C){this._checkLoaded(),i&&this._validate(e.x.sprite,"sprite",i,null,a)||(this.stylesheet.sprite=i,i?this._loadSprite(i,!0,C):(this._unloadSprite(),C&&C(null)))}}var Or=e.Y([{name:"a_pos",type:"Int16",components:2}]);const Ar={prelude:xr(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) @@ -4128,11 +4128,11 @@ uniform ${Re} ${Ue} u_${it}; ${Re} ${Ue} ${it} = u_${it}; #endif `}),staticAttributes:C,staticUniforms:te}}class Qr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(i,a,C,F,q,te,ue,ve,Ae){this.context=i;let Re=this.boundPaintVertexBuffers.length!==F.length;for(let Ue=0;!Re&&Ue({u_matrix:R,u_texture:0,u_ele_delta:i,u_fog_matrix:a,u_fog_color:C?C.properties.get("fog-color"):e.aN.white,u_fog_ground_blend:C?C.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:C?C.calculateFogBlendOpacity(F):0,u_horizon_color:C?C.properties.get("horizon-color"):e.aN.white,u_horizon_fog_blend:C?C.properties.get("horizon-fog-blend"):1});function Cn(R){const i=[];for(let a=0;a({u_depth:new e.aI(Yt,vn.u_depth),u_terrain:new e.aI(Yt,vn.u_terrain),u_terrain_dim:new e.aJ(Yt,vn.u_terrain_dim),u_terrain_matrix:new e.aK(Yt,vn.u_terrain_matrix),u_terrain_unpack:new e.aL(Yt,vn.u_terrain_unpack),u_terrain_exaggeration:new e.aJ(Yt,vn.u_terrain_exaggeration)}))(i,tn),this.binderUniforms=C?C.getUniforms(i,tn):[]}draw(i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt,bt,Ct,Mt,Vt){const It=i.gl;if(this.failedToCreate)return;if(i.program.set(this.program),i.setDepthMode(C),i.setStencilMode(F),i.setColorMode(q),i.setCullFace(te),ve){i.activeTexture.set(It.TEXTURE2),It.bindTexture(It.TEXTURE_2D,ve.depthTexture),i.activeTexture.set(It.TEXTURE3),It.bindTexture(It.TEXTURE_2D,ve.texture);for(const tn in this.terrainUniforms)this.terrainUniforms[tn].set(ve[tn])}for(const tn in this.fixedUniforms)this.fixedUniforms[tn].set(ue[tn]);bt&&bt.setUniforms(i,this.binderUniforms,ct,{zoom:dt});let Qt=0;switch(a){case It.LINES:Qt=2;break;case It.TRIANGLES:Qt=3;break;case It.LINE_STRIP:Qt=1}for(const tn of it.get()){const Yt=tn.vaos||(tn.vaos={});(Yt[Ae]||(Yt[Ae]=new Qr)).bind(i,this,Re,bt?bt.getPaintVertexBuffers():[],Ue,tn.vertexOffset,Ct,Mt,Vt),It.drawElements(a,tn.primitiveLength*Qt,It.UNSIGNED_SHORT,tn.primitiveOffset*Qt*2)}}}function Zn(R,i,a){const C=1/Et(a,1,i.transform.tileZoom),F=Math.pow(2,a.tileID.overscaledZ),q=a.tileSize*Math.pow(2,i.transform.tileZoom)/F,te=q*(a.tileID.canonical.x+a.tileID.wrap*F),ue=q*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[C,R.fromScale,R.toScale],u_fade:R.t,u_pixel_coord_upper:[te>>16,ue>>16],u_pixel_coord_lower:[65535&te,65535&ue]}}const cr=(R,i,a,C)=>{const F=i.style.light,q=F.properties.get("position"),te=[q.x,q.y,q.z],ue=function(){var Ae=new e.A(9);return e.A!=Float32Array&&(Ae[1]=0,Ae[2]=0,Ae[3]=0,Ae[5]=0,Ae[6]=0,Ae[7]=0),Ae[0]=1,Ae[4]=1,Ae[8]=1,Ae}();F.properties.get("anchor")==="viewport"&&function(Ae,Re){var Ue=Math.sin(Re),it=Math.cos(Re);Ae[0]=it,Ae[1]=Ue,Ae[2]=0,Ae[3]=-Ue,Ae[4]=it,Ae[5]=0,Ae[6]=0,Ae[7]=0,Ae[8]=1}(ue,-i.transform.angle),function(Ae,Re,Ue){var it=Re[0],ct=Re[1],dt=Re[2];Ae[0]=it*Ue[0]+ct*Ue[3]+dt*Ue[6],Ae[1]=it*Ue[1]+ct*Ue[4]+dt*Ue[7],Ae[2]=it*Ue[2]+ct*Ue[5]+dt*Ue[8]}(te,te,ue);const ve=F.properties.get("color");return{u_matrix:R,u_lightpos:te,u_lightintensity:F.properties.get("intensity"),u_lightcolor:[ve.r,ve.g,ve.b],u_vertical_gradient:+a,u_opacity:C}},Ir=(R,i,a,C,F,q,te)=>e.e(cr(R,i,a,C),Zn(q,i,te),{u_height_factor:-Math.pow(2,F.overscaledZ)/te.tileSize/8}),Er=R=>({u_matrix:R}),Xr=(R,i,a,C)=>e.e(Er(R),Zn(a,i,C)),ai=(R,i)=>({u_matrix:R,u_world:i}),bn=(R,i,a,C,F)=>e.e(Xr(R,i,a,C),{u_world:F}),Yn=(R,i,a,C)=>{const F=R.transform;let q,te;if(C.paint.get("circle-pitch-alignment")==="map"){const ue=Et(a,1,F.zoom);q=!0,te=[ue,ue]}else q=!1,te=F.pixelsToGLUnits;return{u_camera_to_center_distance:F.cameraToCenterDistance,u_scale_with_map:+(C.paint.get("circle-pitch-scale")==="map"),u_matrix:R.translatePosMatrix(i.posMatrix,a,C.paint.get("circle-translate"),C.paint.get("circle-translate-anchor")),u_pitch_with_map:+q,u_device_pixel_ratio:R.pixelRatio,u_extrude_scale:te}},an=(R,i)=>({u_matrix:i,u_pixel_extrude_scale:[1/R.width,1/R.height]}),_n=(R,i,a)=>({u_matrix:R,u_inv_matrix:i,u_camera_to_center_distance:a.cameraToCenterDistance,u_viewport_size:[a.width,a.height]}),gn=(R,i,a=1)=>({u_matrix:R,u_color:i,u_overlay:0,u_overlay_scale:a}),qn=R=>({u_matrix:R}),Un=(R,i,a,C)=>({u_matrix:R,u_extrude_scale:Et(i,1,a),u_intensity:C}),tr=(R,i,a,C)=>{const F=e.H();e.aQ(F,0,R.width,R.height,0,0,1);const q=R.context.gl;return{u_matrix:F,u_world:[q.drawingBufferWidth,q.drawingBufferHeight],u_image:a,u_color_ramp:C,u_opacity:i.paint.get("heatmap-opacity")}},Wn=(R,i,a,C)=>{const F=a.paint.get("hillshade-shadow-color"),q=a.paint.get("hillshade-highlight-color"),te=a.paint.get("hillshade-accent-color");let ue=a.paint.get("hillshade-illumination-direction")*(Math.PI/180);a.paint.get("hillshade-illumination-anchor")==="viewport"&&(ue-=R.transform.angle);const ve=!R.options.moving;return{u_matrix:C?C.posMatrix:R.transform.calculatePosMatrix(i.tileID.toUnwrapped(),ve),u_image:0,u_latrange:dn(0,i.tileID),u_light:[a.paint.get("hillshade-exaggeration"),ue],u_shadow:F,u_highlight:q,u_accent:te}},Bn=(R,i)=>{const a=i.stride,C=e.H();return e.aQ(C,0,e.X,-e.X,0,0,1),e.J(C,C,[0,-e.X,0]),{u_matrix:C,u_image:1,u_dimension:[a,a],u_zoom:R.overscaledZ,u_unpack:i.getUnpackVector()}};function dn(R,i){const a=Math.pow(2,i.canonical.z),C=i.canonical.y;return[new e.Z(0,C/a).toLngLat().lat,new e.Z(0,(C+1)/a).toLngLat().lat]}const ln=(R,i,a,C)=>{const F=R.transform;return{u_matrix:yr(R,i,a,C),u_ratio:1/Et(i,1,F.zoom),u_device_pixel_ratio:R.pixelRatio,u_units_to_pixels:[1/F.pixelsToGLUnits[0],1/F.pixelsToGLUnits[1]]}},An=(R,i,a,C,F)=>e.e(ln(R,i,a,F),{u_image:0,u_image_height:C}),er=(R,i,a,C,F)=>{const q=R.transform,te=Tr(i,q);return{u_matrix:yr(R,i,a,F),u_texsize:i.imageAtlasTexture.size,u_ratio:1/Et(i,1,q.zoom),u_device_pixel_ratio:R.pixelRatio,u_image:0,u_scale:[te,C.fromScale,C.toScale],u_fade:C.t,u_units_to_pixels:[1/q.pixelsToGLUnits[0],1/q.pixelsToGLUnits[1]]}},br=(R,i,a,C,F,q)=>{const te=R.transform,ue=R.lineAtlas,ve=Tr(i,te),Ae=a.layout.get("line-cap")==="round",Re=ue.getDash(C.from,Ae),Ue=ue.getDash(C.to,Ae),it=Re.width*F.fromScale,ct=Ue.width*F.toScale;return e.e(ln(R,i,a,q),{u_patternscale_a:[ve/it,-Re.height/2],u_patternscale_b:[ve/ct,-Ue.height/2],u_sdfgamma:ue.width/(256*Math.min(it,ct)*R.pixelRatio)/2,u_image:0,u_tex_y_a:Re.y,u_tex_y_b:Ue.y,u_mix:F.t})};function Tr(R,i){return 1/Et(R,1,i.tileZoom)}function yr(R,i,a,C){return R.translatePosMatrix(C?C.posMatrix:i.tileID.posMatrix,i,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}const Ur=(R,i,a,C,F)=>{return{u_matrix:R,u_tl_parent:i,u_scale_parent:a,u_buffer_scale:1,u_fade_t:C.mix,u_opacity:C.opacity*F.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:F.paint.get("raster-brightness-min"),u_brightness_high:F.paint.get("raster-brightness-max"),u_saturation_factor:(te=F.paint.get("raster-saturation"),te>0?1-1/(1.001-te):-te),u_contrast_factor:(q=F.paint.get("raster-contrast"),q>0?1/(1-q):1+q),u_spin_weights:Rr(F.paint.get("raster-hue-rotate"))};var q,te};function Rr(R){R*=Math.PI/180;const i=Math.sin(R),a=Math.cos(R);return[(2*a+1)/3,(-Math.sqrt(3)*i-a+1)/3,(Math.sqrt(3)*i-a+1)/3]}const $r=(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct)=>{const dt=te.transform;return{u_is_size_zoom_constant:+(R==="constant"||R==="source"),u_is_size_feature_constant:+(R==="constant"||R==="camera"),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:dt.cameraToCenterDistance,u_pitch:dt.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:dt.width/dt.height,u_fade_change:te.options.fadeDuration?te.symbolFadeChange:1,u_matrix:ue,u_label_plane_matrix:ve,u_coord_matrix:Ae,u_is_text:+Ue,u_pitch_with_map:+C,u_is_along_line:F,u_is_variable_anchor:q,u_texsize:it,u_texture:0,u_translation:Re,u_pitched_scale:ct}},Pr=(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt)=>{const bt=te.transform;return e.e($r(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,dt),{u_gamma_scale:C?Math.cos(bt._pitch)*bt.cameraToCenterDistance:1,u_device_pixel_ratio:te.pixelRatio,u_is_halo:+ct})},Cr=(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct)=>e.e(Pr(R,i,a,C,F,q,te,ue,ve,Ae,Re,!0,Ue,!0,ct),{u_texsize_icon:it,u_texture_icon:1}),Jr=(R,i,a)=>({u_matrix:R,u_opacity:i,u_color:a}),gi=(R,i,a,C,F,q)=>e.e(function(te,ue,ve,Ae){const Re=ve.imageManager.getPattern(te.from.toString()),Ue=ve.imageManager.getPattern(te.to.toString()),{width:it,height:ct}=ve.imageManager.getPixelSize(),dt=Math.pow(2,Ae.tileID.overscaledZ),bt=Ae.tileSize*Math.pow(2,ve.transform.tileZoom)/dt,Ct=bt*(Ae.tileID.canonical.x+Ae.tileID.wrap*dt),Mt=bt*Ae.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Re.tl,u_pattern_br_a:Re.br,u_pattern_tl_b:Ue.tl,u_pattern_br_b:Ue.br,u_texsize:[it,ct],u_mix:ue.t,u_pattern_size_a:Re.displaySize,u_pattern_size_b:Ue.displaySize,u_scale_a:ue.fromScale,u_scale_b:ue.toScale,u_tile_units_to_pixels:1/Et(Ae,1,ve.transform.tileZoom),u_pixel_coord_upper:[Ct>>16,Mt>>16],u_pixel_coord_lower:[65535&Ct,65535&Mt]}}(C,q,a,F),{u_matrix:R,u_opacity:i}),ii={fillExtrusion:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_lightpos:new e.aO(R,i.u_lightpos),u_lightintensity:new e.aJ(R,i.u_lightintensity),u_lightcolor:new e.aO(R,i.u_lightcolor),u_vertical_gradient:new e.aJ(R,i.u_vertical_gradient),u_opacity:new e.aJ(R,i.u_opacity)}),fillExtrusionPattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_lightpos:new e.aO(R,i.u_lightpos),u_lightintensity:new e.aJ(R,i.u_lightintensity),u_lightcolor:new e.aO(R,i.u_lightcolor),u_vertical_gradient:new e.aJ(R,i.u_vertical_gradient),u_height_factor:new e.aJ(R,i.u_height_factor),u_image:new e.aI(R,i.u_image),u_texsize:new e.aP(R,i.u_texsize),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade),u_opacity:new e.aJ(R,i.u_opacity)}),fill:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix)}),fillPattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_image:new e.aI(R,i.u_image),u_texsize:new e.aP(R,i.u_texsize),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade)}),fillOutline:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_world:new e.aP(R,i.u_world)}),fillOutlinePattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_world:new e.aP(R,i.u_world),u_image:new e.aI(R,i.u_image),u_texsize:new e.aP(R,i.u_texsize),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade)}),circle:(R,i)=>({u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_scale_with_map:new e.aI(R,i.u_scale_with_map),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_extrude_scale:new e.aP(R,i.u_extrude_scale),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_matrix:new e.aK(R,i.u_matrix)}),collisionBox:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_pixel_extrude_scale:new e.aP(R,i.u_pixel_extrude_scale)}),collisionCircle:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_inv_matrix:new e.aK(R,i.u_inv_matrix),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_viewport_size:new e.aP(R,i.u_viewport_size)}),debug:(R,i)=>({u_color:new e.aM(R,i.u_color),u_matrix:new e.aK(R,i.u_matrix),u_overlay:new e.aI(R,i.u_overlay),u_overlay_scale:new e.aJ(R,i.u_overlay_scale)}),clippingMask:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix)}),heatmap:(R,i)=>({u_extrude_scale:new e.aJ(R,i.u_extrude_scale),u_intensity:new e.aJ(R,i.u_intensity),u_matrix:new e.aK(R,i.u_matrix)}),heatmapTexture:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_world:new e.aP(R,i.u_world),u_image:new e.aI(R,i.u_image),u_color_ramp:new e.aI(R,i.u_color_ramp),u_opacity:new e.aJ(R,i.u_opacity)}),hillshade:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_image:new e.aI(R,i.u_image),u_latrange:new e.aP(R,i.u_latrange),u_light:new e.aP(R,i.u_light),u_shadow:new e.aM(R,i.u_shadow),u_highlight:new e.aM(R,i.u_highlight),u_accent:new e.aM(R,i.u_accent)}),hillshadePrepare:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_image:new e.aI(R,i.u_image),u_dimension:new e.aP(R,i.u_dimension),u_zoom:new e.aJ(R,i.u_zoom),u_unpack:new e.aL(R,i.u_unpack)}),line:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels)}),lineGradient:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels),u_image:new e.aI(R,i.u_image),u_image_height:new e.aJ(R,i.u_image_height)}),linePattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_texsize:new e.aP(R,i.u_texsize),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_image:new e.aI(R,i.u_image),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade)}),lineSDF:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels),u_patternscale_a:new e.aP(R,i.u_patternscale_a),u_patternscale_b:new e.aP(R,i.u_patternscale_b),u_sdfgamma:new e.aJ(R,i.u_sdfgamma),u_image:new e.aI(R,i.u_image),u_tex_y_a:new e.aJ(R,i.u_tex_y_a),u_tex_y_b:new e.aJ(R,i.u_tex_y_b),u_mix:new e.aJ(R,i.u_mix)}),raster:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_tl_parent:new e.aP(R,i.u_tl_parent),u_scale_parent:new e.aJ(R,i.u_scale_parent),u_buffer_scale:new e.aJ(R,i.u_buffer_scale),u_fade_t:new e.aJ(R,i.u_fade_t),u_opacity:new e.aJ(R,i.u_opacity),u_image0:new e.aI(R,i.u_image0),u_image1:new e.aI(R,i.u_image1),u_brightness_low:new e.aJ(R,i.u_brightness_low),u_brightness_high:new e.aJ(R,i.u_brightness_high),u_saturation_factor:new e.aJ(R,i.u_saturation_factor),u_contrast_factor:new e.aJ(R,i.u_contrast_factor),u_spin_weights:new e.aO(R,i.u_spin_weights)}),symbolIcon:(R,i)=>({u_is_size_zoom_constant:new e.aI(R,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aI(R,i.u_is_size_feature_constant),u_size_t:new e.aJ(R,i.u_size_t),u_size:new e.aJ(R,i.u_size),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_pitch:new e.aJ(R,i.u_pitch),u_rotate_symbol:new e.aI(R,i.u_rotate_symbol),u_aspect_ratio:new e.aJ(R,i.u_aspect_ratio),u_fade_change:new e.aJ(R,i.u_fade_change),u_matrix:new e.aK(R,i.u_matrix),u_label_plane_matrix:new e.aK(R,i.u_label_plane_matrix),u_coord_matrix:new e.aK(R,i.u_coord_matrix),u_is_text:new e.aI(R,i.u_is_text),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_is_along_line:new e.aI(R,i.u_is_along_line),u_is_variable_anchor:new e.aI(R,i.u_is_variable_anchor),u_texsize:new e.aP(R,i.u_texsize),u_texture:new e.aI(R,i.u_texture),u_translation:new e.aP(R,i.u_translation),u_pitched_scale:new e.aJ(R,i.u_pitched_scale)}),symbolSDF:(R,i)=>({u_is_size_zoom_constant:new e.aI(R,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aI(R,i.u_is_size_feature_constant),u_size_t:new e.aJ(R,i.u_size_t),u_size:new e.aJ(R,i.u_size),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_pitch:new e.aJ(R,i.u_pitch),u_rotate_symbol:new e.aI(R,i.u_rotate_symbol),u_aspect_ratio:new e.aJ(R,i.u_aspect_ratio),u_fade_change:new e.aJ(R,i.u_fade_change),u_matrix:new e.aK(R,i.u_matrix),u_label_plane_matrix:new e.aK(R,i.u_label_plane_matrix),u_coord_matrix:new e.aK(R,i.u_coord_matrix),u_is_text:new e.aI(R,i.u_is_text),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_is_along_line:new e.aI(R,i.u_is_along_line),u_is_variable_anchor:new e.aI(R,i.u_is_variable_anchor),u_texsize:new e.aP(R,i.u_texsize),u_texture:new e.aI(R,i.u_texture),u_gamma_scale:new e.aJ(R,i.u_gamma_scale),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_is_halo:new e.aI(R,i.u_is_halo),u_translation:new e.aP(R,i.u_translation),u_pitched_scale:new e.aJ(R,i.u_pitched_scale)}),symbolTextAndIcon:(R,i)=>({u_is_size_zoom_constant:new e.aI(R,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aI(R,i.u_is_size_feature_constant),u_size_t:new e.aJ(R,i.u_size_t),u_size:new e.aJ(R,i.u_size),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_pitch:new e.aJ(R,i.u_pitch),u_rotate_symbol:new e.aI(R,i.u_rotate_symbol),u_aspect_ratio:new e.aJ(R,i.u_aspect_ratio),u_fade_change:new e.aJ(R,i.u_fade_change),u_matrix:new e.aK(R,i.u_matrix),u_label_plane_matrix:new e.aK(R,i.u_label_plane_matrix),u_coord_matrix:new e.aK(R,i.u_coord_matrix),u_is_text:new e.aI(R,i.u_is_text),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_is_along_line:new e.aI(R,i.u_is_along_line),u_is_variable_anchor:new e.aI(R,i.u_is_variable_anchor),u_texsize:new e.aP(R,i.u_texsize),u_texsize_icon:new e.aP(R,i.u_texsize_icon),u_texture:new e.aI(R,i.u_texture),u_texture_icon:new e.aI(R,i.u_texture_icon),u_gamma_scale:new e.aJ(R,i.u_gamma_scale),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_is_halo:new e.aI(R,i.u_is_halo),u_translation:new e.aP(R,i.u_translation),u_pitched_scale:new e.aJ(R,i.u_pitched_scale)}),background:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_opacity:new e.aJ(R,i.u_opacity),u_color:new e.aM(R,i.u_color)}),backgroundPattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_opacity:new e.aJ(R,i.u_opacity),u_image:new e.aI(R,i.u_image),u_pattern_tl_a:new e.aP(R,i.u_pattern_tl_a),u_pattern_br_a:new e.aP(R,i.u_pattern_br_a),u_pattern_tl_b:new e.aP(R,i.u_pattern_tl_b),u_pattern_br_b:new e.aP(R,i.u_pattern_br_b),u_texsize:new e.aP(R,i.u_texsize),u_mix:new e.aJ(R,i.u_mix),u_pattern_size_a:new e.aP(R,i.u_pattern_size_a),u_pattern_size_b:new e.aP(R,i.u_pattern_size_b),u_scale_a:new e.aJ(R,i.u_scale_a),u_scale_b:new e.aJ(R,i.u_scale_b),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aJ(R,i.u_tile_units_to_pixels)}),terrain:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_texture:new e.aI(R,i.u_texture),u_ele_delta:new e.aJ(R,i.u_ele_delta),u_fog_matrix:new e.aK(R,i.u_fog_matrix),u_fog_color:new e.aM(R,i.u_fog_color),u_fog_ground_blend:new e.aJ(R,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aJ(R,i.u_fog_ground_blend_opacity),u_horizon_color:new e.aM(R,i.u_horizon_color),u_horizon_fog_blend:new e.aJ(R,i.u_horizon_fog_blend)}),terrainDepth:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ele_delta:new e.aJ(R,i.u_ele_delta)}),terrainCoords:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_texture:new e.aI(R,i.u_texture),u_terrain_coords_id:new e.aJ(R,i.u_terrain_coords_id),u_ele_delta:new e.aJ(R,i.u_ele_delta)}),sky:(R,i)=>({u_sky_color:new e.aM(R,i.u_sky_color),u_horizon_color:new e.aM(R,i.u_horizon_color),u_horizon:new e.aJ(R,i.u_horizon),u_sky_horizon_blend:new e.aJ(R,i.u_sky_horizon_blend)})};class Yr{constructor(i,a,C){this.context=i;const F=i.gl;this.buffer=F.createBuffer(),this.dynamicDraw=!!C,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),F.bufferData(F.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?F.DYNAMIC_DRAW:F.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){const a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){const i=this.context.gl;this.buffer&&(i.deleteBuffer(this.buffer),delete this.buffer)}}const oi={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ti{constructor(i,a,C,F){this.length=a.length,this.attributes=C,this.itemSize=a.bytesPerElement,this.dynamicDraw=F,this.context=i;const q=i.gl;this.buffer=q.createBuffer(),i.bindVertexBuffer.set(this.buffer),q.bufferData(q.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?q.DYNAMIC_DRAW:q.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){if(i.length!==this.length)throw new Error(`Length of new data is ${i.length}, which doesn't match current length of ${this.length}`);const a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,i.arrayBuffer)}enableAttributes(i,a){for(let C=0;C0){const tn=e.H();e.aR(tn,Vt.placementInvProjMatrix,R.transform.glCoordMatrix),e.aR(tn,tn,Vt.placementViewportMatrix),ve.push({circleArray:Qt,circleOffset:Re,transform:Mt.posMatrix,invTransform:tn,coord:Mt}),Ae+=Qt.length/4,Re=Ae}It&&ue.draw(q,te.LINES,oa.disabled,$a.disabled,R.colorModeForRenderPass(),Ya.disabled,an(R.transform,Mt.posMatrix),R.style.map.terrain&&R.style.map.terrain.getTerrainData(Mt),a.id,It.layoutVertexBuffer,It.indexBuffer,It.segments,null,R.transform.zoom,null,null,It.collisionVertexBuffer)}if(!F||!ve.length)return;const Ue=R.useProgram("collisionCircle"),it=new e.aS;it.resize(4*Ae),it._trim();let ct=0;for(const Ct of ve)for(let Mt=0;Mtve.style.map.terrain.getElevation(Qt,Lr,dr):null,nr=Mt.translatePosition(Ct,tn,ct,dt);Bo(Yt,Vt,It,bt,Ct,Hn,Qt.posMatrix,rr,Mn,Xn,Mt,nr,Qt.toUnwrapped(),Mr)}}}(C,R,a,i,a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),F),a.paint.get("icon-opacity").constantOr(1)!==0&&Vu(R,i,a,C,!1,a.paint.get("icon-translate"),a.paint.get("icon-translate-anchor"),a.layout.get("icon-rotation-alignment"),a.layout.get("icon-pitch-alignment"),a.layout.get("icon-keep-upright"),q,te),a.paint.get("text-opacity").constantOr(1)!==0&&Vu(R,i,a,C,!0,a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.layout.get("text-keep-upright"),q,te),i.map.showCollisionBoxes&&(qs(R,i,a,C,!0),qs(R,i,a,C,!1))}function Fs(R,i,a,C,F,q){const{horizontalAlign:te,verticalAlign:ue}=e.av(R),ve=-(te-.5)*i,Ae=-(ue-.5)*a;return new e.P((ve/F+C[0])*q,(Ae/F+C[1])*q)}function qo(R,i,a,C,F,q){const te=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let ue=C.mult(q);return a||(ue=ue.rotate(-F)),Gt(te.add(ue),i.labelPlaneMatrix,i.getElevation).point}if(a){const ue=Xe(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(R),ve=Math.atan(ue.y/ue.x)+(ue.x<0?Math.PI:0);return R.add(C.rotate(ve))}return R.add(C)}function Bo(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct){const dt=R.text.placedSymbolArray,bt=R.text.dynamicLayoutVertexArray,Ct=R.icon.dynamicLayoutVertexArray,Mt={};bt.clear();for(let Vt=0;Vt=0&&(Mt[It.associatedIconIndex]={shiftedAnchor:Sr,angle:Vr})}else Ut(It.numGlyphs,bt)}if(Ae){Ct.clear();const Vt=R.icon.placedSymbolArray;for(let It=0;ItR.style.map.terrain.getElevation(Xn,Po,ll):null,fs=a.layout.get("text-rotation-alignment")==="map";ft(Mr,Xn.posMatrix,R,F,go,Go,Mt,Ae,fs,bt,Xn.toUnwrapped(),dt.width,dt.height,Da,Hi)}const Ra=Xn.posMatrix,wa=F&&Mn||Qa,Fa=Vt||wa?ec:go,qa=uo,fa=dr&&a.paint.get(F?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Pl;Pl=dr?Mr.iconsInText?Cr(Br.kind,fi,It,Mt,Vt,wa,R,Ra,Fa,qa,Da,si,Ji,Hn):Pr(Br.kind,fi,It,Mt,Vt,wa,R,Ra,Fa,qa,Da,F,si,!0,Hn):$r(Br.kind,fi,It,Mt,Vt,wa,R,Ra,Fa,qa,Da,F,si,Hn);const mo={program:Vr,buffers:nr,uniformValues:Pl,atlasTexture:_i,atlasTextureIcon:Yi,atlasInterpolation:Gi,atlasInterpolationIcon:Pi,isSDF:dr,hasHalo:fa};if(tn&&Mr.canOverlap){Yt=!0;const Hi=nr.segments.get();for(const fs of Hi)Vn.push({segments:new e.a0([fs]),sortKey:fs.sortKey,state:mo,terrainData:Nr})}else Vn.push({segments:nr.segments,sortKey:0,state:mo,terrainData:Nr})}Yt&&Vn.sort((Xn,rr)=>Xn.sortKey-rr.sortKey);for(const Xn of Vn){const rr=Xn.state;if(it.activeTexture.set(ct.TEXTURE0),rr.atlasTexture.bind(rr.atlasInterpolation,ct.CLAMP_TO_EDGE),rr.atlasTextureIcon&&(it.activeTexture.set(ct.TEXTURE1),rr.atlasTextureIcon&&rr.atlasTextureIcon.bind(rr.atlasInterpolationIcon,ct.CLAMP_TO_EDGE)),rr.isSDF){const Mr=rr.uniformValues;rr.hasHalo&&(Mr.u_is_halo=1,Fc(rr.buffers,Xn.segments,a,R,rr.program,vn,Re,Ue,Mr,Xn.terrainData)),Mr.u_is_halo=0}Fc(rr.buffers,Xn.segments,a,R,rr.program,vn,Re,Ue,rr.uniformValues,Xn.terrainData)}}function Fc(R,i,a,C,F,q,te,ue,ve,Ae){const Re=C.context,Ue=Re.gl;F.draw(Re,Ue.TRIANGLES,q,te,ue,Ya.disabled,ve,Ae,a.id,R.layoutVertexBuffer,R.indexBuffer,i,a.paint,C.transform.zoom,R.programConfigurations.get(a.id),R.dynamicLayoutVertexBuffer,R.opacityVertexBuffer)}function Hs(R,i,a,C){if(a.paint.get("heatmap-opacity")!==0)if(R.renderPass==="offscreen"){const F=R.context,q=F.gl,te=$a.disabled,ue=new Fo([q.ONE,q.ONE],e.aN.transparent,[!0,!0,!0,!0]);(function(ve,Ae,Re){const Ue=ve.gl;ve.activeTexture.set(Ue.TEXTURE1),ve.viewport.set([0,0,Ae.width/4,Ae.height/4]);let it=Re.heatmapFbo;if(it)Ue.bindTexture(Ue.TEXTURE_2D,it.colorAttachment.get()),ve.bindFramebuffer.set(it.framebuffer);else{const ct=Ue.createTexture();Ue.bindTexture(Ue.TEXTURE_2D,ct),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_WRAP_S,Ue.CLAMP_TO_EDGE),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_WRAP_T,Ue.CLAMP_TO_EDGE),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_MIN_FILTER,Ue.LINEAR),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_MAG_FILTER,Ue.LINEAR),it=Re.heatmapFbo=ve.createFramebuffer(Ae.width/4,Ae.height/4,!1,!1),function(dt,bt,Ct,Mt){var Vt,It;const Qt=dt.gl,tn=(Vt=dt.HALF_FLOAT)!==null&&Vt!==void 0?Vt:Qt.UNSIGNED_BYTE,Yt=(It=dt.RGBA16F)!==null&&It!==void 0?It:Qt.RGBA;Qt.texImage2D(Qt.TEXTURE_2D,0,Yt,bt.width/4,bt.height/4,0,Qt.RGBA,tn,null),Mt.colorAttachment.set(Ct)}(ve,Ae,ct,it)}})(F,R,a),F.clear({color:e.aN.transparent});for(let ve=0;ve0){const ue=u.now(),ve=(ue-R.timeAdded)/te,Ae=i?(ue-i.timeAdded)/te:-1,Re=a.getSource(),Ue=F.coveringZoomLevel({tileSize:Re.tileSize,roundZoom:Re.roundZoom}),it=!i||Math.abs(i.tileID.overscaledZ-Ue)>Math.abs(R.tileID.overscaledZ-Ue),ct=it&&R.refreshedUponExpiration?1:e.ad(it?ve:1-Ae,0,1);return R.refreshedUponExpiration&&ve>=1&&(R.refreshedUponExpiration=!1),i?{opacity:1,mix:1-ct}:{opacity:ct,mix:0}}return{opacity:1,mix:0}}const Hl=new e.aN(1,0,0,1),Gs=new e.aN(0,1,0,1),pr=new e.aN(0,0,1,1),Dr=new e.aN(1,0,1,1),Zr=new e.aN(0,1,1,1);function Li(R){const i=R.transform.padding;ia(R,R.transform.height-(i.top||0),3,Hl),ia(R,i.bottom||0,3,Gs),sa(R,i.left||0,3,pr),sa(R,R.transform.width-(i.right||0),3,Dr);const a=R.transform.centerPoint;(function(C,F,q,te){po(C,F-1,q-10,2,20,te),po(C,F-10,q-1,20,2,te)})(R,a.x,R.transform.height-a.y,Zr)}function ia(R,i,a,C){po(R,0,i+a/2,R.transform.width,a,C)}function sa(R,i,a,C){po(R,i-a/2,0,a,R.transform.height,C)}function po(R,i,a,C,F,q){const te=R.context,ue=te.gl;ue.enable(ue.SCISSOR_TEST),ue.scissor(i*R.pixelRatio,a*R.pixelRatio,C*R.pixelRatio,F*R.pixelRatio),te.clear({color:q}),ue.disable(ue.SCISSOR_TEST)}function ro(R,i,a){const C=R.context,F=C.gl,q=a.posMatrix,te=R.useProgram("debug"),ue=oa.disabled,ve=$a.disabled,Ae=R.colorModeForRenderPass(),Re="$debug",Ue=R.style.map.terrain&&R.style.map.terrain.getTerrainData(a);C.activeTexture.set(F.TEXTURE0);const it=i.getTileByID(a.key).latestRawTileData,ct=it&&it.byteLength||0,dt=Math.floor(ct/1024),bt=i.getTile(a).tileSize,Ct=512/Math.min(bt,512)*(a.overscaledZ/R.transform.zoom)*.5;let Mt=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(Mt+=` => ${a.overscaledZ}`),function(Vt,It){Vt.initDebugOverlayCanvas();const Qt=Vt.debugOverlayCanvas,tn=Vt.context.gl,Yt=Vt.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,Qt.width,Qt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(It,5,5),Yt.strokeText(It,5,5),Vt.debugOverlayTexture.update(Qt),Vt.debugOverlayTexture.bind(tn.LINEAR,tn.CLAMP_TO_EDGE)}(R,`${Mt} ${dt}kB`),te.draw(C,F.TRIANGLES,ue,ve,Fo.alphaBlended,Ya.disabled,gn(q,e.aN.transparent,Ct),null,Re,R.debugBuffer,R.quadTriangleIndexBuffer,R.debugSegments),te.draw(C,F.LINE_STRIP,ue,ve,Ae,Ya.disabled,gn(q,e.aN.red),Ue,Re,R.debugBuffer,R.tileBorderIndexBuffer,R.debugSegments)}function mu(R,i,a){const C=R.context,F=C.gl,q=R.colorModeForRenderPass(),te=new oa(F.LEQUAL,oa.ReadWrite,R.depthRangeFor3D),ue=R.useProgram("terrain"),ve=i.getTerrainMesh();C.bindFramebuffer.set(null),C.viewport.set([0,0,R.width,R.height]);for(const Ae of a){const Re=R.renderToTexture.getTexture(Ae),Ue=i.getTerrainData(Ae.tileID);C.activeTexture.set(F.TEXTURE0),F.bindTexture(F.TEXTURE_2D,Re.texture);const it=R.transform.calculatePosMatrix(Ae.tileID.toUnwrapped()),ct=i.getMeshFrameDelta(R.transform.zoom),dt=R.transform.calculateFogMatrix(Ae.tileID.toUnwrapped()),bt=kn(it,ct,dt,R.style.sky,R.transform.pitch);ue.draw(C,F.TRIANGLES,te,$a.disabled,q,Ya.backCCW,bt,Ue,"terrain",ve.vertexBuffer,ve.indexBuffer,ve.segments)}}class qu{constructor(i,a,C){this.vertexBuffer=i,this.indexBuffer=a,this.segments=C}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class ls{constructor(i,a){this.context=new Qu(i),this.transform=a,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ge.maxUnderzooming+Ge.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new lr}resize(i,a,C){if(this.width=Math.floor(i*C),this.height=Math.floor(a*C),this.pixelRatio=C,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const F of this.style._order)this.style._layers[F].resize()}setup(){const i=this.context,a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(e.X,0),a.emplaceBack(0,e.X),a.emplaceBack(e.X,e.X),this.tileExtentBuffer=i.createVertexBuffer(a,Or.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const C=new e.aX;C.emplaceBack(0,0),C.emplaceBack(e.X,0),C.emplaceBack(0,e.X),C.emplaceBack(e.X,e.X),this.debugBuffer=i.createVertexBuffer(C,Or.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const F=new e.$;F.emplaceBack(0,0,0,0),F.emplaceBack(e.X,0,e.X,0),F.emplaceBack(0,e.X,0,e.X),F.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=i.createVertexBuffer(F,Ve.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const q=new e.aX;q.emplaceBack(0,0),q.emplaceBack(1,0),q.emplaceBack(0,1),q.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(q,Or.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const te=new e.aZ;te.emplaceBack(0),te.emplaceBack(1),te.emplaceBack(3),te.emplaceBack(2),te.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(te);const ue=new e.aY;ue.emplaceBack(0,1,2),ue.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(ue);const ve=this.context.gl;this.stencilClearMode=new $a({func:ve.ALWAYS,mask:0},0,255,ve.ZERO,ve.ZERO,ve.ZERO)}clearStencil(){const i=this.context,a=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const C=e.H();e.aQ(C,0,this.width,this.height,0,0,1),e.K(C,C,[a.drawingBufferWidth,a.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,a.TRIANGLES,oa.disabled,this.stencilClearMode,Fo.disabled,Ya.disabled,qn(C),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(i,a){if(this.currentStencilSource===i.source||!i.isTileClipped()||!a||!a.length)return;this.currentStencilSource=i.source;const C=this.context,F=C.gl;this.nextStencilID+a.length>256&&this.clearStencil(),C.setColorMode(Fo.disabled),C.setDepthMode(oa.disabled);const q=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const te of a){const ue=this._tileClippingMaskIDs[te.key]=this.nextStencilID++,ve=this.style.map.terrain&&this.style.map.terrain.getTerrainData(te);q.draw(C,F.TRIANGLES,oa.disabled,new $a({func:F.ALWAYS,mask:0},ue,255,F.KEEP,F.KEEP,F.REPLACE),Fo.disabled,Ya.disabled,qn(te.posMatrix),ve,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const i=this.nextStencilID++,a=this.context.gl;return new $a({func:a.NOTEQUAL,mask:255},i,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(i){const a=this.context.gl;return new $a({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,a.KEEP,a.KEEP,a.REPLACE)}stencilConfigForOverlap(i){const a=this.context.gl,C=i.sort((te,ue)=>ue.overscaledZ-te.overscaledZ),F=C[C.length-1].overscaledZ,q=C[0].overscaledZ-F+1;if(q>1){this.currentStencilSource=void 0,this.nextStencilID+q>256&&this.clearStencil();const te={};for(let ue=0;ue({u_sky_color:Vt.properties.get("sky-color"),u_horizon_color:Vt.properties.get("horizon-color"),u_horizon:(It.height/2+It.getHorizon())*Qt,u_sky_horizon_blend:Vt.properties.get("sky-horizon-blend")*It.height/2*Qt}))(Re,Ae.style.map.transform,Ae.pixelRatio),dt=new oa(it.LEQUAL,oa.ReadWrite,[0,1]),bt=$a.disabled,Ct=Ae.colorModeForRenderPass(),Mt=Ae.useProgram("sky");if(!Re.mesh){const Vt=new e.aX;Vt.emplaceBack(-1,-1),Vt.emplaceBack(1,-1),Vt.emplaceBack(1,1),Vt.emplaceBack(-1,1);const It=new e.aY;It.emplaceBack(0,1,2),It.emplaceBack(0,2,3),Re.mesh=new qu(Ue.createVertexBuffer(Vt,Or.members),Ue.createIndexBuffer(It),e.a0.simpleSegment(0,0,Vt.length,It.length))}Mt.draw(Ue,it.TRIANGLES,dt,bt,Ct,Ya.disabled,ct,void 0,"sky",Re.mesh.vertexBuffer,Re.mesh.indexBuffer,Re.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=F.length-1;this.currentLayer>=0;this.currentLayer--){const Ae=this.style._layers[F[this.currentLayer]],Re=q[Ae.source],Ue=te[Ae.source];this._renderTileClippingMasks(Ae,Ue),this.renderLayer(this,Re,Ae,Ue)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerMt.source&&!Mt.isHidden(Ue)?[Re.sourceCaches[Mt.source]]:[]),dt=ct.filter(Mt=>Mt.getSource().type==="vector"),bt=ct.filter(Mt=>Mt.getSource().type!=="vector"),Ct=Mt=>{(!it||it.getSource().maxzoomCt(Mt)),it||bt.forEach(Mt=>Ct(Mt)),it}(this.style,this.transform.zoom);Ae&&function(Re,Ue,it){for(let ct=0;ct0),F&&(e.b0(a,C),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(q,te){const ue=q.context,ve=ue.gl,Ae=Fo.unblended,Re=new oa(ve.LEQUAL,oa.ReadWrite,[0,1]),Ue=te.getTerrainMesh(),it=te.sourceCache.getRenderableTiles(),ct=q.useProgram("terrainDepth");ue.bindFramebuffer.set(te.getFramebuffer("depth").framebuffer),ue.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),ue.clear({color:e.aN.transparent,depth:1});for(const dt of it){const bt=te.getTerrainData(dt.tileID),Ct={u_matrix:q.transform.calculatePosMatrix(dt.tileID.toUnwrapped()),u_ele_delta:te.getMeshFrameDelta(q.transform.zoom)};ct.draw(ue,ve.TRIANGLES,Re,$a.disabled,Ae,Ya.backCCW,Ct,bt,"terrain",Ue.vertexBuffer,Ue.indexBuffer,Ue.segments)}ue.bindFramebuffer.set(null),ue.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain),function(q,te){const ue=q.context,ve=ue.gl,Ae=Fo.unblended,Re=new oa(ve.LEQUAL,oa.ReadWrite,[0,1]),Ue=te.getTerrainMesh(),it=te.getCoordsTexture(),ct=te.sourceCache.getRenderableTiles(),dt=q.useProgram("terrainCoords");ue.bindFramebuffer.set(te.getFramebuffer("coords").framebuffer),ue.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),ue.clear({color:e.aN.transparent,depth:1}),te.coordsIndex=[];for(const bt of ct){const Ct=te.getTerrainData(bt.tileID);ue.activeTexture.set(ve.TEXTURE0),ve.bindTexture(ve.TEXTURE_2D,it.texture);const Mt={u_matrix:q.transform.calculatePosMatrix(bt.tileID.toUnwrapped()),u_terrain_coords_id:(255-te.coordsIndex.length)/255,u_texture:0,u_ele_delta:te.getMeshFrameDelta(q.transform.zoom)};dt.draw(ue,ve.TRIANGLES,Re,$a.disabled,Ae,Ya.backCCW,Mt,Ct,"terrain",Ue.vertexBuffer,Ue.indexBuffer,Ue.segments),te.coordsIndex.push(bt.tileID.key)}ue.bindFramebuffer.set(null),ue.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain))}renderLayer(i,a,C,F){if(!C.isHidden(this.transform.zoom)&&(C.type==="background"||C.type==="custom"||(F||[]).length))switch(this.id=C.id,C.type){case"symbol":ql(i,a,C,F,this.style.placement.variableOffsets);break;case"circle":(function(q,te,ue,ve){if(q.renderPass!=="translucent")return;const Ae=ue.paint.get("circle-opacity"),Re=ue.paint.get("circle-stroke-width"),Ue=ue.paint.get("circle-stroke-opacity"),it=!ue.layout.get("circle-sort-key").isConstant();if(Ae.constantOr(1)===0&&(Re.constantOr(1)===0||Ue.constantOr(1)===0))return;const ct=q.context,dt=ct.gl,bt=q.depthModeForSublayer(0,oa.ReadOnly),Ct=$a.disabled,Mt=q.colorModeForRenderPass(),Vt=[];for(let It=0;ItIt.sortKey-Qt.sortKey);for(const It of Vt){const{programConfiguration:Qt,program:tn,layoutVertexBuffer:Yt,indexBuffer:vn,uniformValues:Mn,terrainData:Vn}=It.state,Hn=It.segments;tn.draw(ct,dt.TRIANGLES,bt,Ct,Mt,Ya.disabled,Mn,Vn,ue.id,Yt,vn,Hn,ue.paint,q.transform.zoom,Qt)}})(i,a,C,F);break;case"heatmap":Hs(i,a,C,F);break;case"line":(function(q,te,ue,ve){if(q.renderPass!=="translucent")return;const Ae=ue.paint.get("line-opacity"),Re=ue.paint.get("line-width");if(Ae.constantOr(1)===0||Re.constantOr(1)===0)return;const Ue=q.depthModeForSublayer(0,oa.ReadOnly),it=q.colorModeForRenderPass(),ct=ue.paint.get("line-dasharray"),dt=ue.paint.get("line-pattern"),bt=dt.constantOr(1),Ct=ue.paint.get("line-gradient"),Mt=ue.getCrossfadeParameters(),Vt=bt?"linePattern":ct?"lineSDF":Ct?"lineGradient":"line",It=q.context,Qt=It.gl;let tn=!0;for(const Yt of ve){const vn=te.getTile(Yt);if(bt&&!vn.patternsLoaded())continue;const Mn=vn.getBucket(ue);if(!Mn)continue;const Vn=Mn.programConfigurations.get(ue.id),Hn=q.context.program.get(),Xn=q.useProgram(Vt,Vn),rr=tn||Xn.program!==Hn,Mr=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Yt),nr=dt.constantOr(null);if(nr&&vn.imageAtlas){const Br=vn.imageAtlas,Sr=Br.patternPositions[nr.to.toString()],Vr=Br.patternPositions[nr.from.toString()];Sr&&Vr&&Vn.setConstantPatternPositions(Sr,Vr)}const Lr=Mr?Yt:null,dr=bt?er(q,vn,ue,Mt,Lr):ct?br(q,vn,ue,ct,Mt,Lr):Ct?An(q,vn,ue,Mn.lineClipsArray.length,Lr):ln(q,vn,ue,Lr);if(bt)It.activeTexture.set(Qt.TEXTURE0),vn.imageAtlasTexture.bind(Qt.LINEAR,Qt.CLAMP_TO_EDGE),Vn.updatePaintBuffers(Mt);else if(ct&&(rr||q.lineAtlas.dirty))It.activeTexture.set(Qt.TEXTURE0),q.lineAtlas.bind(It);else if(Ct){const Br=Mn.gradients[ue.id];let Sr=Br.texture;if(ue.gradientVersion!==Br.version){let Vr=256;if(ue.stepInterpolant){const fi=te.getSource().maxzoom,Nr=Yt.canonical.z===fi?Math.ceil(1<20&&Re.texParameterf(Re.TEXTURE_2D,Ae.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ae.extTextureFilterAnisotropicMax);const Xn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Vt),rr=Xn?Vt:null,Mr=rr?rr.posMatrix:q.transform.calculatePosMatrix(Vt.toUnwrapped(),Mt),nr=Ur(Mr,Vn||[0,0],Mn||1,vn,ue);Ue instanceof Pe?it.draw(Ae,Re.TRIANGLES,It,$a.disabled,ct,Ya.disabled,nr,Xn,ue.id,Ue.boundsBuffer,q.quadTriangleIndexBuffer,Ue.boundsSegments):it.draw(Ae,Re.TRIANGLES,It,dt[Vt.overscaledZ],ct,Ya.disabled,nr,Xn,ue.id,q.rasterBoundsBuffer,q.quadTriangleIndexBuffer,q.rasterBoundsSegments)}})(i,a,C,F);break;case"background":(function(q,te,ue,ve){const Ae=ue.paint.get("background-color"),Re=ue.paint.get("background-opacity");if(Re===0)return;const Ue=q.context,it=Ue.gl,ct=q.transform,dt=ct.tileSize,bt=ue.paint.get("background-pattern");if(q.isPatternMissing(bt))return;const Ct=!bt&&Ae.a===1&&Re===1&&q.opaquePassEnabledForLayer()?"opaque":"translucent";if(q.renderPass!==Ct)return;const Mt=$a.disabled,Vt=q.depthModeForSublayer(0,Ct==="opaque"?oa.ReadWrite:oa.ReadOnly),It=q.colorModeForRenderPass(),Qt=q.useProgram(bt?"backgroundPattern":"background"),tn=ve||ct.coveringTiles({tileSize:dt,terrain:q.style.map.terrain});bt&&(Ue.activeTexture.set(it.TEXTURE0),q.imageManager.bind(q.context));const Yt=ue.getCrossfadeParameters();for(const vn of tn){const Mn=ve?vn.posMatrix:q.transform.calculatePosMatrix(vn.toUnwrapped()),Vn=bt?gi(Mn,Re,q,bt,{tileID:vn,tileSize:dt},Yt):Jr(Mn,Re,Ae),Hn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(vn);Qt.draw(Ue,it.TRIANGLES,Vt,Mt,It,Ya.disabled,Vn,Hn,ue.id,q.tileExtentBuffer,q.quadTriangleIndexBuffer,q.tileExtentSegments)}})(i,0,C,F);break;case"custom":(function(q,te,ue){const ve=q.context,Ae=ue.implementation;if(q.renderPass==="offscreen"){const Re=Ae.prerender;Re&&(q.setCustomLayerDefaults(),ve.setColorMode(q.colorModeForRenderPass()),Re.call(Ae,ve.gl,q.transform.customLayerMatrix()),ve.setDirty(),q.setBaseState())}else if(q.renderPass==="translucent"){q.setCustomLayerDefaults(),ve.setColorMode(q.colorModeForRenderPass()),ve.setStencilMode($a.disabled);const Re=Ae.renderingMode==="3d"?new oa(q.context.gl.LEQUAL,oa.ReadWrite,q.depthRangeFor3D):q.depthModeForSublayer(0,oa.ReadOnly);ve.setDepthMode(Re),Ae.render(ve.gl,q.transform.customLayerMatrix(),{farZ:q.transform.farZ,nearZ:q.transform.nearZ,fov:q.transform._fov,modelViewProjectionMatrix:q.transform.modelViewProjectionMatrix,projectionMatrix:q.transform.projectionMatrix}),ve.setDirty(),q.setBaseState(),ve.bindFramebuffer.set(null)}})(i,0,C)}}translatePosMatrix(i,a,C,F,q){if(!C[0]&&!C[1])return i;const te=q?F==="map"?this.transform.angle:0:F==="viewport"?-this.transform.angle:0;if(te){const Ae=Math.sin(te),Re=Math.cos(te);C=[C[0]*Re-C[1]*Ae,C[0]*Ae+C[1]*Re]}const ue=[q?C[0]:Et(a,C[0],this.transform.zoom),q?C[1]:Et(a,C[1],this.transform.zoom),0],ve=new Float32Array(16);return e.J(ve,i,ue),ve}saveTileTexture(i){const a=this._tileTextures[i.size[0]];a?a.push(i):this._tileTextures[i.size[0]]=[i]}getTileTexture(i){const a=this._tileTextures[i];return a&&a.length>0?a.pop():null}isPatternMissing(i){if(!i)return!1;if(!i.from||!i.to)return!0;const a=this.imageManager.getPattern(i.from.toString()),C=this.imageManager.getPattern(i.to.toString());return!a||!C}useProgram(i,a){this.cache=this.cache||{};const C=i+(a?a.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[C]||(this.cache[C]=new ur(this.context,Ar[i],a,ii[i],this._showOverdrawInspector,this.style.map.terrain)),this.cache[C]}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 i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;const i=this.context.gl;this.debugOverlayTexture=new M(this.context,this.debugOverlayCanvas,i.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:i,drawingBufferHeight:a}=this.context.gl;return this.width!==i||this.height!==a}}class Ws{constructor(i,a){this.points=i,this.planes=a}static fromInvProjectionMatrix(i,a,C){const F=Math.pow(2,C),q=[[-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(ue=>{const ve=1/(ue=e.ag([],ue,i))[3]/a*F;return e.b1(ue,ue,[ve,ve,1/ue[3],ve])}),te=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(ue=>{const ve=function(it,ct){var dt=ct[0],bt=ct[1],Ct=ct[2],Mt=dt*dt+bt*bt+Ct*Ct;return Mt>0&&(Mt=1/Math.sqrt(Mt)),it[0]=ct[0]*Mt,it[1]=ct[1]*Mt,it[2]=ct[2]*Mt,it}([],function(it,ct,dt){var bt=ct[0],Ct=ct[1],Mt=ct[2],Vt=dt[0],It=dt[1],Qt=dt[2];return it[0]=Ct*Qt-Mt*It,it[1]=Mt*Vt-bt*Qt,it[2]=bt*It-Ct*Vt,it}([],A([],q[ue[0]],q[ue[1]]),A([],q[ue[2]],q[ue[1]]))),Ae=(Re=ve,Ue=q[ue[1]],-(Re[0]*Ue[0]+Re[1]*Ue[1]+Re[2]*Ue[2]));var Re,Ue;return ve.concat(Ae)});return new Ws(q,te)}}class bl{constructor(i,a){this.min=i,this.max=a,this.center=function(C,F,q){return C[0]=F[0]*q,C[1]=F[1]*q,C[2]=F[2]*q,C}([],function(C,F,q){return C[0]=F[0]+q[0],C[1]=F[1]+q[1],C[2]=F[2]+q[2],C}([],this.min,this.max),.5)}quadrant(i){const a=[i%2==0,i<2],C=g(this.min),F=g(this.max);for(let q=0;q=0&&te++;if(te===0)return 0;te!==a.length&&(C=!1)}if(C)return 2;for(let F=0;F<3;F++){let q=Number.MAX_VALUE,te=-Number.MAX_VALUE;for(let ue=0;uethis.max[F]-this.min[F])return 0}return 1}}class Zs{constructor(i=0,a=0,C=0,F=0){if(isNaN(i)||i<0||isNaN(a)||a<0||isNaN(C)||C<0||isNaN(F)||F<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=a,this.left=C,this.right=F}interpolate(i,a,C){return a.top!=null&&i.top!=null&&(this.top=e.z.number(i.top,a.top,C)),a.bottom!=null&&i.bottom!=null&&(this.bottom=e.z.number(i.bottom,a.bottom,C)),a.left!=null&&i.left!=null&&(this.left=e.z.number(i.left,a.left,C)),a.right!=null&&i.right!=null&&(this.right=e.z.number(i.right,a.right,C)),this}getCenter(i,a){const C=e.ad((this.left+i-this.right)/2,0,i),F=e.ad((this.top+a-this.bottom)/2,0,a);return new e.P(C,F)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new Zs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const vu=85.051129;class La{constructor(i,a,C,F,q){this.tileSize=512,this._renderWorldCopies=q===void 0||!!q,this._minZoom=i||0,this._maxZoom=a||22,this._minPitch=C??0,this._maxPitch=F??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Zs,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const i=new La(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.apply(this),i}apply(i){this.tileSize=i.tileSize,this.latRange=i.latRange,this.width=i.width,this.height=i.height,this._center=i._center,this._elevation=i._elevation,this.minElevationForCurrentTile=i.minElevationForCurrentTile,this.zoom=i.zoom,this.angle=i.angle,this._fov=i._fov,this._pitch=i._pitch,this._unmodified=i._unmodified,this._edgeInsets=i._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(i){const a=-e.b3(i,-180,180)*Math.PI/180;this.angle!==a&&(this._unmodified=!1,this.angle=a,this._calcMatrices(),this.rotationMatrix=function(){var C=new e.A(4);return e.A!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C}(),function(C,F,q){var te=F[0],ue=F[1],ve=F[2],Ae=F[3],Re=Math.sin(q),Ue=Math.cos(q);C[0]=te*Ue+ve*Re,C[1]=ue*Ue+Ae*Re,C[2]=te*-Re+ve*Ue,C[3]=ue*-Re+Ae*Ue}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(i){const a=e.ad(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==a&&(this._unmodified=!1,this._pitch=a,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(i){const a=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this.tileZoom=Math.max(0,Math.floor(a)),this.scale=this.zoomScale(a),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(i){i!==this._elevation&&(this._elevation=i,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,a,C){this._unmodified=!1,this._edgeInsets.interpolate(i,a,C),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){const a=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,a)}getVisibleUnwrappedCoordinates(i){const a=[new e.b4(0,i)];if(this._renderWorldCopies){const C=this.pointCoordinate(new e.P(0,0)),F=this.pointCoordinate(new e.P(this.width,0)),q=this.pointCoordinate(new e.P(this.width,this.height)),te=this.pointCoordinate(new e.P(0,this.height)),ue=Math.floor(Math.min(C.x,F.x,q.x,te.x)),ve=Math.floor(Math.max(C.x,F.x,q.x,te.x)),Ae=1;for(let Re=ue-Ae;Re<=ve+Ae;Re++)Re!==0&&a.push(new e.b4(Re,i))}return a}coveringTiles(i){var a,C;let F=this.coveringZoomLevel(i);const q=F;if(i.minzoom!==void 0&&Fi.maxzoom&&(F=i.maxzoom);const te=this.pointCoordinate(this.getCameraPoint()),ue=e.Z.fromLngLat(this.center),ve=Math.pow(2,F),Ae=[ve*te.x,ve*te.y,0],Re=[ve*ue.x,ve*ue.y,0],Ue=Ws.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,F);let it=i.minzoom||0;!i.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(it=F);const ct=i.terrain?2/Math.min(this.tileSize,i.tileSize)*this.tileSize:3,dt=It=>({aabb:new bl([It*ve,0,0],[(It+1)*ve,ve,0]),zoom:0,x:0,y:0,wrap:It,fullyVisible:!1}),bt=[],Ct=[],Mt=F,Vt=i.reparseOverscaled?q:F;if(this._renderWorldCopies)for(let It=1;It<=3;It++)bt.push(dt(-It)),bt.push(dt(It));for(bt.push(dt(0));bt.length>0;){const It=bt.pop(),Qt=It.x,tn=It.y;let Yt=It.fullyVisible;if(!Yt){const rr=It.aabb.intersects(Ue);if(rr===0)continue;Yt=rr===2}const vn=i.terrain?Ae:Re,Mn=It.aabb.distanceX(vn),Vn=It.aabb.distanceY(vn),Hn=Math.max(Math.abs(Mn),Math.abs(Vn)),Xn=ct+(1<Xn&&It.zoom>=it){const rr=Mt-It.zoom,Mr=Ae[0]-.5-(Qt<>1),Lr=It.zoom+1;let dr=It.aabb.quadrant(rr);if(i.terrain){const Br=new e.S(Lr,It.wrap,Lr,Mr,nr),Sr=i.terrain.getMinMaxElevation(Br),Vr=(a=Sr.minElevation)!==null&&a!==void 0?a:this.elevation,fi=(C=Sr.maxElevation)!==null&&C!==void 0?C:this.elevation;dr=new bl([dr.min[0],dr.min[1],Vr],[dr.max[0],dr.max[1],fi])}bt.push({aabb:dr,zoom:Lr,x:Mr,y:nr,wrap:It.wrap,fullyVisible:Yt})}}return Ct.sort((It,Qt)=>It.distanceSq-Qt.distanceSq).map(It=>It.tileID)}resize(i,a){this.width=i,this.height=a,this.pixelsToGLUnits=[2/i,-2/a],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log(i)/Math.LN2}project(i){const a=e.ad(i.lat,-85.051129,vu);return new e.P(e.O(i.lng)*this.worldSize,e.Q(a)*this.worldSize)}unproject(i){return new e.Z(i.x/this.worldSize,i.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(i){const a=this.elevation,C=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,F=this.pointLocation(this.centerPoint,i),q=i.getElevationForLngLatZoom(F,this.tileZoom);if(!(this.elevation-q))return;const te=C+a-q,ue=Math.cos(this._pitch)*this.cameraToCenterDistance/te/e.b5(1,F.lat)/this.tileSize,ve=this.scaleZoom(ue);this._elevation=q,this._center=F,this.zoom=ve}setLocationAtPoint(i,a){const C=this.pointCoordinate(a),F=this.pointCoordinate(this.centerPoint),q=this.locationCoordinate(i),te=new e.Z(q.x-(C.x-F.x),q.y-(C.y-F.y));this.center=this.coordinateLocation(te),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(i,a){return a?this.coordinatePoint(this.locationCoordinate(i),a.getElevationForLngLatZoom(i,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(i))}pointLocation(i,a){return this.coordinateLocation(this.pointCoordinate(i,a))}locationCoordinate(i){return e.Z.fromLngLat(i)}coordinateLocation(i){return i&&i.toLngLat()}pointCoordinate(i,a){if(a){const dt=a.pointCoordinate(i);if(dt!=null)return dt}const C=[i.x,i.y,0,1],F=[i.x,i.y,1,1];e.ag(C,C,this.pixelMatrixInverse),e.ag(F,F,this.pixelMatrixInverse);const q=C[3],te=F[3],ue=C[0]/q,ve=F[0]/te,Ae=C[1]/q,Re=F[1]/te,Ue=C[2]/q,it=F[2]/te,ct=Ue===it?0:(0-Ue)/(it-Ue);return new e.Z(e.z.number(ue,ve,ct)/this.worldSize,e.z.number(Ae,Re,ct)/this.worldSize)}coordinatePoint(i,a=0,C=this.pixelMatrix){const F=[i.x*this.worldSize,i.y*this.worldSize,a,1];return e.ag(F,F,C),new e.P(F[0]/F[3],F[1]/F[3])}getBounds(){const i=Math.max(0,this.height/2-this.getHorizon());return new Ee().extend(this.pointLocation(new e.P(0,i))).extend(this.pointLocation(new e.P(this.width,i))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Ee([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(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,vu])}calculateTileMatrix(i){const a=i.canonical,C=this.worldSize/this.zoomScale(a.z),F=a.x+Math.pow(2,a.z)*i.wrap,q=e.ao(new Float64Array(16));return e.J(q,q,[F*C,a.y*C,0]),e.K(q,q,[C/e.X,C/e.X,1]),q}calculatePosMatrix(i,a=!1){const C=i.key,F=a?this._alignedPosMatrixCache:this._posMatrixCache;if(F[C])return F[C];const q=this.calculateTileMatrix(i);return e.L(q,a?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,q),F[C]=new Float32Array(q),F[C]}calculateFogMatrix(i){const a=i.key,C=this._fogMatrixCache;if(C[a])return C[a];const F=this.calculateTileMatrix(i);return e.L(F,this.fogMatrix,F),C[a]=new Float32Array(F),C[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(i,a){a=e.ad(+a,this.minZoom,this.maxZoom);const C={center:new e.N(i.lng,i.lat),zoom:a};let F=this.lngRange;if(!this._renderWorldCopies&&F===null){const It=179.9999999999;F=[-It,It]}const q=this.tileSize*this.zoomScale(C.zoom);let te=0,ue=q,ve=0,Ae=q,Re=0,Ue=0;const{x:it,y:ct}=this.size;if(this.latRange){const It=this.latRange;te=e.Q(It[1])*q,ue=e.Q(It[0])*q,ue-teue&&(Mt=ue-It)}if(F){const It=(ve+Ae)/2;let Qt=dt;this._renderWorldCopies&&(Qt=e.b3(dt,It-q/2,It+q/2));const tn=it/2;Qt-tnAe&&(Ct=Ae-tn)}if(Ct!==void 0||Mt!==void 0){const It=new e.P(Ct??dt,Mt??bt);C.center=this.unproject.call({worldSize:q},It).wrap()}return C}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const i=this._unmodified,{center:a,zoom:C}=this.getConstrained(this.center,this.zoom);this.center=a,this.zoom=C,this._unmodified=i,this._constraining=!1}_calcMatrices(){if(!this.height)return;const i=this._fov/2,a=this.centerOffset,C=this.point.x,F=this.point.y;this.cameraToCenterDistance=.5/Math.tan(i)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let q=e.ao(new Float64Array(16));e.K(q,q,[this.width/2,-this.height/2,1]),e.J(q,q,[1,-1,0]),this.labelPlaneMatrix=q,q=e.ao(new Float64Array(16)),e.K(q,q,[1,-1,1]),e.J(q,q,[-1,-1,0]),e.K(q,q,[2/this.width,2/this.height,1]),this.glCoordMatrix=q;const te=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ue=Math.min(this.elevation,this.minElevationForCurrentTile),ve=te-ue*this._pixelPerMeter/Math.cos(this._pitch),Ae=ue<0?ve:te,Re=Math.PI/2+this._pitch,Ue=this._fov*(.5+a.y/this.height),it=Math.sin(Ue)*Ae/Math.sin(e.ad(Math.PI-Re-Ue,.01,Math.PI-.01)),ct=this.getHorizon(),dt=2*Math.atan(ct/this.cameraToCenterDistance)*(.5+a.y/(2*ct)),bt=Math.sin(dt)*Ae/Math.sin(e.ad(Math.PI-Re-dt,.01,Math.PI-.01)),Ct=Math.min(it,bt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ct+Ae),this.nearZ=this.height/50,q=new Float64Array(16),e.b6(q,this._fov,this.width/this.height,this.nearZ,this.farZ),q[8]=2*-a.x/this.width,q[9]=2*a.y/this.height,this.projectionMatrix=e.af(q),e.K(q,q,[1,-1,1]),e.J(q,q,[0,0,-this.cameraToCenterDistance]),e.b7(q,q,this._pitch),e.ae(q,q,this.angle),e.J(q,q,[-C,-F,0]),this.mercatorMatrix=e.K([],q,[this.worldSize,this.worldSize,this.worldSize]),e.K(q,q,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,q),e.J(q,q,[0,0,-this.elevation]),this.modelViewProjectionMatrix=q,this.invModelViewProjectionMatrix=e.at([],q),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,te,this.farZ),this.fogMatrix[8]=2*-a.x/this.width,this.fogMatrix[9]=2*a.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ae(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-C,-F,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,q);const Mt=this.width%2/2,Vt=this.height%2/2,It=Math.cos(this.angle),Qt=Math.sin(this.angle),tn=C-Math.round(C)+It*Mt+Qt*Vt,Yt=F-Math.round(F)+It*Vt+Qt*Mt,vn=new Float64Array(q);if(e.J(vn,vn,[tn>.5?tn-1:tn,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=vn,q=e.at(new Float64Array(16),this.pixelMatrix),!q)throw new Error("failed to invert matrix");this.pixelMatrixInverse=q,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const i=this.pointCoordinate(new e.P(0,0)),a=[i.x*this.worldSize,i.y*this.worldSize,0,1];return e.ag(a,a,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const i=this._pitch,a=Math.tan(i)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,a))}getCameraQueryGeometry(i){const a=this.getCameraPoint();if(i.length===1)return[i[0],a];{let C=a.x,F=a.y,q=a.x,te=a.y;for(const ue of i)C=Math.min(C,ue.x),F=Math.min(F,ue.y),q=Math.max(q,ue.x),te=Math.max(te,ue.y);return[new e.P(C,F),new e.P(q,F),new e.P(q,te),new e.P(C,te),new e.P(C,F)]}}lngLatToCameraDepth(i,a){const C=this.locationCoordinate(i),F=[C.x*this.worldSize,C.y*this.worldSize,a,1];return e.ag(F,F,this.modelViewProjectionMatrix),F[2]/F[3]}}function ba(R,i){let a,C=!1,F=null,q=null;const te=()=>{F=null,C&&(R.apply(q,a),F=setTimeout(te,i),C=!1)};return(...ue)=>(C=!0,q=this,a=ue,F||te(),F)}class Ho{constructor(i){this._getCurrentHash=()=>{const a=window.location.hash.replace("#","");if(this._hashName){let C;return a.split("&").map(F=>F.split("=")).forEach(F=>{F[0]===this._hashName&&(C=F)}),(C&&C[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{const a=this._getCurrentHash();if(a.length>=3&&!a.some(C=>isNaN(C))){const C=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:C,pitch:+(a[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const a=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{const a=this._getCurrentHash();if(a.length===0)return;const C=a.join("/");let F=C;F.split("&").length>0&&(F=F.split("&")[0]),this._hashName&&(F=`${this._hashName}=${C}`);let q=window.location.hash.replace(F,"");q.startsWith("#&")?q=q.slice(0,1)+q.slice(2):q==="#"&&(q="");let te=window.location.href.replace(/(#.+)?$/,q);te=te.replace("&&","&"),window.history.replaceState(window.history.state,null,te)},this._updateHash=ba(this._updateHashUnthrottled,300),this._hashName=i&&encodeURIComponent(i)}addTo(i){return this._map=i,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(i){const a=this._map.getCenter(),C=Math.round(100*this._map.getZoom())/100,F=Math.ceil((C*Math.LN2+Math.log(512/360/.5))/Math.LN10),q=Math.pow(10,F),te=Math.round(a.lng*q)/q,ue=Math.round(a.lat*q)/q,ve=this._map.getBearing(),Ae=this._map.getPitch();let Re="";if(Re+=i?`/${te}/${ue}/${C}`:`${C}/${ue}/${te}`,(ve||Ae)&&(Re+="/"+Math.round(10*ve)/10),Ae&&(Re+=`/${Math.round(Ae)}`),this._hashName){const Ue=this._hashName;let it=!1;const ct=window.location.hash.slice(1).split("&").map(dt=>{const bt=dt.split("=")[0];return bt===Ue?(it=!0,`${bt}=${Re}`):dt}).filter(dt=>dt);return it||ct.push(`${Ue}=${Re}`),`#${ct.join("&")}`}return`#${Re}`}}const Ts={linearity:.3,easing:e.b8(0,0,.3,1)},Aa=e.e({deceleration:2500,maxSpeed:1400},Ts),Ua=e.e({deceleration:20,maxSpeed:1400},Ts),wl=e.e({deceleration:1e3,maxSpeed:360},Ts),ic=e.e({deceleration:1e3,maxSpeed:90},Ts);class nu{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:i})}_drainInertiaBuffer(){const i=this._inertiaBuffer,a=u.now();for(;i.length>0&&a-i[0].time>160;)i.shift()}_onMoveEnd(i){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const a={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:q}of this._inertiaBuffer)a.zoom+=q.zoomDelta||0,a.bearing+=q.bearingDelta||0,a.pitch+=q.pitchDelta||0,q.panDelta&&a.pan._add(q.panDelta),q.around&&(a.around=q.around),q.pinchAround&&(a.pinchAround=q.pinchAround);const C=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,F={};if(a.pan.mag()){const q=Gl(a.pan.mag(),C,e.e({},Aa,i||{}));F.offset=a.pan.mult(q.amount/a.pan.mag()),F.center=this._map.transform.center,Bs(F,q)}if(a.zoom){const q=Gl(a.zoom,C,Ua);F.zoom=this._map.transform.zoom+q.amount,Bs(F,q)}if(a.bearing){const q=Gl(a.bearing,C,wl);F.bearing=this._map.transform.bearing+e.ad(q.amount,-179,179),Bs(F,q)}if(a.pitch){const q=Gl(a.pitch,C,ic);F.pitch=this._map.transform.pitch+q.amount,Bs(F,q)}if(F.zoom||F.bearing){const q=a.pinchAround===void 0?a.around:a.pinchAround;F.around=q?this._map.unproject(q):this._map.getCenter()}return this.clear(),e.e(F,{noMoveStart:!0})}}function Bs(R,i){(!R.duration||R.durationa.unproject(ve)),ue=q.reduce((ve,Ae,Re,Ue)=>ve.add(Ae.div(Ue.length)),new e.P(0,0));super(i,{points:q,point:ue,lngLats:te,lngLat:a.unproject(ue),originalEvent:C}),this._defaultPrevented=!1}}class Wl extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,a,C){super(i,{originalEvent:C}),this._defaultPrevented=!1}}class Eu{constructor(i,a){this._map=i,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(i){return this._firePreventable(new Wl(i.type,this._map,i))}mousedown(i,a){return this._mousedownPos=a,this._firePreventable(new us(i.type,this._map,i))}mouseup(i){this._map.fire(new us(i.type,this._map,i))}click(i,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new us(i.type,this._map,i))}dblclick(i){return this._firePreventable(new us(i.type,this._map,i))}mouseover(i){this._map.fire(new us(i.type,this._map,i))}mouseout(i){this._map.fire(new us(i.type,this._map,i))}touchstart(i){return this._firePreventable(new No(i.type,this._map,i))}touchmove(i){this._map.fire(new No(i.type,this._map,i))}touchend(i){this._map.fire(new No(i.type,this._map,i))}touchcancel(i){this._map.fire(new No(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xo{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(i){this._map.fire(new us(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new us("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._ignoreContextMenu||this._map.fire(new us(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xa{constructor(i){this._map=i}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(i){return this.transform.pointLocation(e.P.convert(i),this._map.terrain)}}class Co{constructor(i,a){this._map=i,this._tr=new Xa(i),this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=a.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(i,a){this.isEnabled()&&i.shiftKey&&i.button===0&&(r.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(i,a){if(!this._active)return;const C=a;if(this._lastPos.equals(C)||!this._box&&C.dist(this._startPos)q.fitScreenCoordinates(C,F,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",i)}keydown(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(i,a){return this._map.fire(new e.k(i,{originalEvent:a}))}}function ka(R,i){if(R.length!==i.length)throw new Error(`The number of touches and points are not equal - touches ${R.length}, points ${i.length}`);const a={};for(let C=0;Cthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),C.length===this.numTouches&&(this.centroid=function(F){const q=new e.P(0,0);for(const te of F)q._add(te);return q.div(F.length)}(a),this.touches=ka(C,a)))}touchmove(i,a,C){if(this.aborted||!this.centroid)return;const F=ka(C,a);for(const q in this.touches){const te=this.touches[q],ue=F[q];(!ue||ue.dist(te)>30)&&(this.aborted=!0)}}touchend(i,a,C){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),C.length===0){const F=!this.aborted&&this.centroid;if(this.reset(),F)return F}}}class Va{constructor(i){this.singleTap=new Ao(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(i,a,C){this.singleTap.touchstart(i,a,C)}touchmove(i,a,C){this.singleTap.touchmove(i,a,C)}touchend(i,a,C){const F=this.singleTap.touchend(i,a,C);if(F){const q=i.timeStamp-this.lastTime<500,te=!this.lastTap||this.lastTap.dist(F)<30;if(q&&te||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=F,this.count===this.numTaps)return this.reset(),F}}}class Ko{constructor(i){this._tr=new Xa(i),this._zoomIn=new Va({numTouches:1,numTaps:2}),this._zoomOut=new Va({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,a,C){this._zoomIn.touchstart(i,a,C),this._zoomOut.touchstart(i,a,C)}touchmove(i,a,C){this._zoomIn.touchmove(i,a,C),this._zoomOut.touchmove(i,a,C)}touchend(i,a,C){const F=this._zoomIn.touchend(i,a,C),q=this._zoomOut.touchend(i,a,C),te=this._tr;return F?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ue=>ue.easeTo({duration:300,zoom:te.zoom+1,around:te.unproject(F)},{originalEvent:i})}):q?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ue=>ue.easeTo({duration:300,zoom:te.zoom-1,around:te.unproject(q)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class cs{constructor(i){this._enabled=!!i.enable,this._moveStateManager=i.moveStateManager,this._clickTolerance=i.clickTolerance||1,this._moveFunction=i.move,this._activateOnStart=!!i.activateOnStart,i.assignEvents(this),this.reset()}reset(i){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(i)}_move(...i){const a=this._moveFunction(...i);if(a.bearingDelta||a.pitchDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(i,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(i)&&(this._moveStateManager.startMove(i),this._lastPoint=a.length?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(i,a){if(!this.isEnabled())return;const C=this._lastPoint;if(!C)return;if(i.preventDefault(),!this._moveStateManager.isValidMoveEvent(i))return void this.reset(i);const F=a.length?a[0]:a;return!this._moved&&F.dist(C){R.mousedown=R.dragStart,R.mousemoveWindow=R.dragMove,R.mouseup=R.dragEnd,R.contextmenu=i=>{i.preventDefault()}},yu=({enable:R,clickTolerance:i,bearingDegreesPerPixelMoved:a=.8})=>{const C=new xs({checkCorrectEvent:F=>r.mouseButton(F)===0&&F.ctrlKey||r.mouseButton(F)===2});return new cs({clickTolerance:i,move:(F,q)=>({bearingDelta:(q.x-F.x)*a}),moveStateManager:C,enable:R,assignEvents:_s})},ru=({enable:R,clickTolerance:i,pitchDegreesPerPixelMoved:a=-.5})=>{const C=new xs({checkCorrectEvent:F=>r.mouseButton(F)===0&&F.ctrlKey||r.mouseButton(F)===2});return new cs({clickTolerance:i,move:(F,q)=>({pitchDelta:(q.y-F.y)*a}),moveStateManager:C,enable:R,assignEvents:_s})};class Tl{constructor(i,a){this._clickTolerance=i.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(i){return i<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(i,a,C){return this._calculateTransform(i,a,C)}touchmove(i,a,C){if(this._active){if(!this._shouldBePrevented(C.length))return i.preventDefault(),this._calculateTransform(i,a,C);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",i)}}touchend(i,a,C){this._calculateTransform(i,a,C),this._active&&this._shouldBePrevented(C.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(i,a,C){C.length>0&&(this._active=!0);const F=ka(C,a),q=new e.P(0,0),te=new e.P(0,0);let ue=0;for(const Ae in F){const Re=F[Ae],Ue=this._touches[Ae];Ue&&(q._add(Re),te._add(Re.sub(Ue)),ue++,F[Ae]=Re)}if(this._touches=F,this._shouldBePrevented(ue)||!te.mag())return;const ve=te.div(ue);return this._sum._add(ve),this._sum.mag()Math.abs(R.x)}class il extends Sa{constructor(i){super(),this._currentTouchCount=0,this._map=i}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(i,a,C){super.touchstart(i,a,C),this._currentTouchCount=C.length}_start(i){this._lastPoints=i,Al(i[0].sub(i[1]))&&(this._valid=!1)}_move(i,a,C){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const F=i[0].sub(this._lastPoints[0]),q=i[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(F,q,C.timeStamp),this._valid?(this._lastPoints=i,this._active=!0,{pitchDelta:(F.y+q.y)/2*-.5}):void 0}gestureBeginsVertically(i,a,C){if(this._valid!==void 0)return this._valid;const F=i.mag()>=2,q=a.mag()>=2;if(!F&&!q)return;if(!F||!q)return this._firstMove===void 0&&(this._firstMove=C),C-this._firstMove<100&&void 0;const te=i.y>0==a.y>0;return Al(i)&&Al(a)&&te}}const Sl={panStep:100,bearingStep:15,pitchStep:10};class Ml{constructor(i){this._tr=new Xa(i);const a=Sl;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let a=0,C=0,F=0,q=0,te=0;switch(i.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:i.shiftKey?C=-1:(i.preventDefault(),q=-1);break;case 39:i.shiftKey?C=1:(i.preventDefault(),q=1);break;case 38:i.shiftKey?F=1:(i.preventDefault(),te=-1);break;case 40:i.shiftKey?F=-1:(i.preventDefault(),te=1);break;default:return}return this._rotationDisabled&&(C=0,F=0),{cameraAnimation:ue=>{const ve=this._tr;ue.easeTo({duration:300,easeId:"keyboardHandler",easing:li,zoom:a?Math.round(ve.zoom)+a*(i.shiftKey?2:1):ve.zoom,bearing:ve.bearing+C*this._bearingStep,pitch:ve.pitch+F*this._pitchStep,offset:[-q*this._panStep,-te*this._panStep],center:ve.center},{originalEvent:i})}}}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 li(R){return R*(2-R)}const hs=4.000244140625;class al{constructor(i,a){this._onTimeout=C=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(C)},this._map=i,this._tr=new Xa(i),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&i.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(i){return!!this._map.cooperativeGestures.isEnabled()&&!(i.ctrlKey||this._map.cooperativeGestures.isBypassed(i))}wheel(i){if(!this.isEnabled())return;if(this._shouldBePrevented(i))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",i);let a=i.deltaMode===WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY;const C=u.now(),F=C-(this._lastWheelEventTime||0);this._lastWheelEventTime=C,a!==0&&a%hs==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":F>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(F*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),i.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=i,this._delta-=a,this._active||this._start(i)),i.preventDefault()}_start(i){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 a=r.mousePos(this._map.getCanvas(),i),C=this._tr;a.y>C.transform.height/2-C.transform.getHorizon()?this._around=e.N.convert(this._aroundCenter?C.center:C.unproject(a)):this._around=e.N.convert(C.center),this._aroundPoint=C.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const i=this._tr.transform;if(this._delta!==0){const ve=this._type==="wheel"&&Math.abs(this._delta)>hs?this._wheelZoomRate:this._defaultZoomRate;let Ae=2/(1+Math.exp(-Math.abs(this._delta*ve)));this._delta<0&&Ae!==0&&(Ae=1/Ae);const Re=typeof this._targetZoom=="number"?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(Re*Ae))),this._type==="wheel"&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const a=typeof this._targetZoom=="number"?this._targetZoom:i.zoom,C=this._startZoom,F=this._easing;let q,te=!1;const ue=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&C&&F&&ue){const ve=Math.min(ue/200,1),Ae=F(ve);q=e.z.number(C,a,Ae),ve<1?this._frameId||(this._frameId=!0):te=!0}else q=a,te=!0;return this._active=!0,te&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!te,zoomDelta:q-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(i){let a=e.b9;if(this._prevEase){const C=this._prevEase,F=(u.now()-C.start)/C.duration,q=C.easing(F+.01)-C.easing(F),te=.27/Math.sqrt(q*q+1e-4)*.01,ue=Math.sqrt(.0729-te*te);a=e.b8(te,ue,.25,1)}return this._prevEase={start:u.now(),duration:i,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Na{constructor(i,a){this._clickZoom=i,this._tapZoom=a}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 Ns{constructor(i){this._tr=new Xa(i),this.reset()}reset(){this._active=!1}dblclick(i,a){return i.preventDefault(),{cameraAnimation:C=>{C.easeTo({duration:300,zoom:this._tr.zoom+(i.shiftKey?-1:1),around:this._tr.unproject(a)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class iu{constructor(){this._tap=new Va({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(i,a,C){if(!this._swipePoint)if(this._tapTime){const F=a[0],q=i.timeStamp-this._tapTime<500,te=this._tapPoint.dist(F)<30;q&&te?C.length>0&&(this._swipePoint=F,this._swipeTouch=C[0].identifier):this.reset()}else this._tap.touchstart(i,a,C)}touchmove(i,a,C){if(this._tapTime){if(this._swipePoint){if(C[0].identifier!==this._swipeTouch)return;const F=a[0],q=F.y-this._swipePoint.y;return this._swipePoint=F,i.preventDefault(),this._active=!0,{zoomDelta:q/128}}}else this._tap.touchmove(i,a,C)}touchend(i,a,C){if(this._tapTime)this._swipePoint&&C.length===0&&this.reset();else{const F=this._tap.touchend(i,a,C);F&&(this._tapTime=i.timeStamp,this._tapPoint=F)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class El{constructor(i,a,C){this._el=i,this._mousePan=a,this._touchPan=C}enable(i){this._inertiaOptions=i||{},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 ks{constructor(i,a,C){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=a,this._mousePitch=C}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 au{constructor(i,a,C,F){this._el=i,this._touchZoom=a,this._touchRotate=C,this._tapDragZoom=F,this._rotationDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),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 As{constructor(i,a){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=i,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const i=this._map.getCanvasContainer();i.classList.add("maplibregl-cooperative-gestures"),this._container=r.create("div","maplibregl-cooperative-gesture-screen",i);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const C=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),F=document.createElement("div");F.className="maplibregl-desktop-message",F.textContent=a,this._container.appendChild(F);const q=document.createElement("div");q.className="maplibregl-mobile-message",q.textContent=C,this._container.appendChild(q),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(r.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(i){return i[this._bypassKey]}notifyGestureBlocked(i,a){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:i,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Jo=R=>R.zoom||R.drag||R.pitch||R.rotate;class ol extends e.k{}function cn(R){return R.panDelta&&R.panDelta.mag()||R.zoomDelta||R.bearingDelta||R.pitchDelta}class ya{constructor(i,a){this.handleWindowEvent=F=>{this.handleEvent(F,`${F.type}Window`)},this.handleEvent=(F,q)=>{if(F.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const te=F.type==="renderFrame"?void 0:F,ue={needsRenderFrame:!1},ve={},Ae={},Re=F.touches,Ue=Re?this._getMapTouches(Re):void 0,it=Ue?r.touchPos(this._map.getCanvas(),Ue):r.mousePos(this._map.getCanvas(),F);for(const{handlerName:bt,handler:Ct,allowed:Mt}of this._handlers){if(!Ct.isEnabled())continue;let Vt;this._blockedByActive(Ae,Mt,bt)?Ct.reset():Ct[q||F.type]&&(Vt=Ct[q||F.type](F,it,Ue),this.mergeHandlerResult(ue,ve,Vt,bt,te),Vt&&Vt.needsRenderFrame&&this._triggerRenderFrame()),(Vt||Ct.isActive())&&(Ae[bt]=Ct)}const ct={};for(const bt in this._previousActiveHandlers)Ae[bt]||(ct[bt]=te);this._previousActiveHandlers=Ae,(Object.keys(ct).length||cn(ue))&&(this._changes.push([ue,ve,ct]),this._triggerRenderFrame()),(Object.keys(Ae).length||cn(ue))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:dt}=ue;dt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],dt(this._map))},this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nu(i),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);const C=this._el;this._listeners=[[C,"touchstart",{passive:!0}],[C,"touchmove",{passive:!1}],[C,"touchend",void 0],[C,"touchcancel",void 0],[C,"mousedown",void 0],[C,"mousemove",void 0],[C,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[C,"mouseover",void 0],[C,"mouseout",void 0],[C,"dblclick",void 0],[C,"click",void 0],[C,"keydown",{capture:!1}],[C,"keyup",void 0],[C,"wheel",{passive:!1}],[C,"contextmenu",void 0],[window,"blur",void 0]];for(const[F,q,te]of this._listeners)r.addEventListener(F,q,F===document?this.handleWindowEvent:this.handleEvent,te)}destroy(){for(const[i,a,C]of this._listeners)r.removeEventListener(i,a,i===document?this.handleWindowEvent:this.handleEvent,C)}_addDefaultHandlers(i){const a=this._map,C=a.getCanvasContainer();this._add("mapEvent",new Eu(a,i));const F=a.boxZoom=new Co(a,i);this._add("boxZoom",F),i.interactive&&i.boxZoom&&F.enable();const q=a.cooperativeGestures=new As(a,i.cooperativeGestures);this._add("cooperativeGestures",q),i.cooperativeGestures&&q.enable();const te=new Ko(a),ue=new Ns(a);a.doubleClickZoom=new Na(ue,te),this._add("tapZoom",te),this._add("clickZoom",ue),i.interactive&&i.doubleClickZoom&&a.doubleClickZoom.enable();const ve=new iu;this._add("tapDragZoom",ve);const Ae=a.touchPitch=new il(a);this._add("touchPitch",Ae),i.interactive&&i.touchPitch&&a.touchPitch.enable(i.touchPitch);const Re=yu(i),Ue=ru(i);a.dragRotate=new ks(i,Re,Ue),this._add("mouseRotate",Re,["mousePitch"]),this._add("mousePitch",Ue,["mouseRotate"]),i.interactive&&i.dragRotate&&a.dragRotate.enable();const it=(({enable:Vt,clickTolerance:It})=>{const Qt=new xs({checkCorrectEvent:tn=>r.mouseButton(tn)===0&&!tn.ctrlKey});return new cs({clickTolerance:It,move:(tn,Yt)=>({around:Yt,panDelta:Yt.sub(tn)}),activateOnStart:!0,moveStateManager:Qt,enable:Vt,assignEvents:_s})})(i),ct=new Tl(i,a);a.dragPan=new El(C,it,ct),this._add("mousePan",it),this._add("touchPan",ct,["touchZoom","touchRotate"]),i.interactive&&i.dragPan&&a.dragPan.enable(i.dragPan);const dt=new Ac,bt=new Mi;a.touchZoomRotate=new au(C,bt,dt,ve),this._add("touchRotate",dt,["touchPan","touchZoom"]),this._add("touchZoom",bt,["touchPan","touchRotate"]),i.interactive&&i.touchZoomRotate&&a.touchZoomRotate.enable(i.touchZoomRotate);const Ct=a.scrollZoom=new al(a,()=>this._triggerRenderFrame());this._add("scrollZoom",Ct,["mousePan"]),i.interactive&&i.scrollZoom&&a.scrollZoom.enable(i.scrollZoom);const Mt=a.keyboard=new Ml(a);this._add("keyboard",Mt),i.interactive&&i.keyboard&&a.keyboard.enable(),this._add("blockableMapEvent",new Xo(a))}_add(i,a,C){this._handlers.push({handlerName:i,handler:a,allowed:C}),this._handlersById[i]=a}stop(i){if(!this._updatingCamera){for(const{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}}isActive(){for(const{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Jo(this._eventsInProgress)||this.isZooming()}_blockedByActive(i,a,C){for(const F in i)if(F!==C&&(!a||a.indexOf(F)<0))return!0;return!1}_getMapTouches(i){const a=[];for(const C of i){const F=C.target;this._el.contains(F)&&a.push(C)}return a}mergeHandlerResult(i,a,C,F,q){if(!C)return;e.e(i,C);const te={handlerName:F,originalEvent:C.originalEvent||q};C.zoomDelta!==void 0&&(a.zoom=te),C.panDelta!==void 0&&(a.drag=te),C.pitchDelta!==void 0&&(a.pitch=te),C.bearingDelta!==void 0&&(a.rotate=te)}_applyChanges(){const i={},a={},C={};for(const[F,q,te]of this._changes)F.panDelta&&(i.panDelta=(i.panDelta||new e.P(0,0))._add(F.panDelta)),F.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+F.zoomDelta),F.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+F.bearingDelta),F.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+F.pitchDelta),F.around!==void 0&&(i.around=F.around),F.pinchAround!==void 0&&(i.pinchAround=F.pinchAround),F.noInertia&&(i.noInertia=F.noInertia),e.e(a,q),e.e(C,te);this._updateMapTransform(i,a,C),this._changes=[]}_updateMapTransform(i,a,C){const F=this._map,q=F._getTransformForUpdate(),te=F.terrain;if(!(cn(i)||te&&this._terrainMovement))return this._fireEvents(a,C,!0);let{panDelta:ue,zoomDelta:ve,bearingDelta:Ae,pitchDelta:Re,around:Ue,pinchAround:it}=i;it!==void 0&&(Ue=it),F._stop(!0),Ue=Ue||F.transform.centerPoint;const ct=q.pointLocation(ue?Ue.sub(ue):Ue);Ae&&(q.bearing+=Ae),Re&&(q.pitch+=Re),ve&&(q.zoom+=ve),te?this._terrainMovement||!a.drag&&!a.zoom?a.drag&&this._terrainMovement?q.center=q.pointLocation(q.centerPoint.sub(ue)):q.setLocationAtPoint(ct,Ue):(this._terrainMovement=!0,this._map._elevationFreeze=!0,q.setLocationAtPoint(ct,Ue)):q.setLocationAtPoint(ct,Ue),F._applyUpdatedTransform(q),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(a,C,!0)}_fireEvents(i,a,C){const F=Jo(this._eventsInProgress),q=Jo(i),te={};for(const Ue in i){const{originalEvent:it}=i[Ue];this._eventsInProgress[Ue]||(te[`${Ue}start`]=it),this._eventsInProgress[Ue]=i[Ue]}!F&&q&&this._fireEvent("movestart",q.originalEvent);for(const Ue in te)this._fireEvent(Ue,te[Ue]);q&&this._fireEvent("move",q.originalEvent);for(const Ue in i){const{originalEvent:it}=i[Ue];this._fireEvent(Ue,it)}const ue={};let ve;for(const Ue in this._eventsInProgress){const{handlerName:it,originalEvent:ct}=this._eventsInProgress[Ue];this._handlersById[it].isActive()||(delete this._eventsInProgress[Ue],ve=a[it]||ct,ue[`${Ue}end`]=ve)}for(const Ue in ue)this._fireEvent(Ue,ue[Ue]);const Ae=Jo(this._eventsInProgress),Re=(F||q)&&!Ae;if(Re&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Ue=this._map._getTransformForUpdate();Ue.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Ue)}if(C&&Re){this._updatingCamera=!0;const Ue=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),it=ct=>ct!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ol("renderFrame",{timeStamp:i})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class So extends e.E{constructor(i,a){super(),this._renderFrameCallback=()=>{const C=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(C)),C<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=a.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(i,a){return this.jumpTo({center:i},a)}panBy(i,a,C){return i=e.P.convert(i).mult(-1),this.panTo(this.transform.center,e.e({offset:i},a),C)}panTo(i,a,C){return this.easeTo(e.e({center:i},a),C)}getZoom(){return this.transform.zoom}setZoom(i,a){return this.jumpTo({zoom:i},a),this}zoomTo(i,a,C){return this.easeTo(e.e({zoom:i},a),C)}zoomIn(i,a){return this.zoomTo(this.getZoom()+1,i,a),this}zoomOut(i,a){return this.zoomTo(this.getZoom()-1,i,a),this}getBearing(){return this.transform.bearing}setBearing(i,a){return this.jumpTo({bearing:i},a),this}getPadding(){return this.transform.padding}setPadding(i,a){return this.jumpTo({padding:i},a),this}rotateTo(i,a,C){return this.easeTo(e.e({bearing:i},a),C)}resetNorth(i,a){return this.rotateTo(0,e.e({duration:1e3},i),a),this}resetNorthPitch(i,a){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},i),a),this}snapToNorth(i,a){return Math.abs(this.getBearing()){if(this._zooming&&(F.zoom=e.z.number(q,Ct,vn)),this._rotating&&(F.bearing=e.z.number(te,Ae,vn)),this._pitching&&(F.pitch=e.z.number(ue,Re,vn)),this._padding&&(F.interpolatePadding(ve,Ue,vn),ct=F.centerPoint.add(it)),this.terrain&&!i.freezeElevation&&this._updateElevation(vn),Qt)F.setLocationAtPoint(Qt,tn);else{const Mn=F.zoomScale(F.zoom-q),Vn=Ct>q?Math.min(2,It):Math.max(.5,It),Hn=Math.pow(Vn,1-vn),Xn=F.unproject(Mt.add(Vt.mult(vn*Hn)).mult(Mn));F.setLocationAtPoint(F.renderWorldCopies?Xn.wrap():Xn,ct)}this._applyUpdatedTransform(F),this._fireMoveEvents(a)},vn=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(a,vn)},i),this}_prepareEase(i,a,C={}){this._moving=!0,a||C.moving||this.fire(new e.k("movestart",i)),this._zooming&&!C.zooming&&this.fire(new e.k("zoomstart",i)),this._rotating&&!C.rotating&&this.fire(new e.k("rotatestart",i)),this._pitching&&!C.pitching&&this.fire(new e.k("pitchstart",i))}_prepareElevation(i){this._elevationCenter=i,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(i){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(i<1&&a!==this._elevationTarget){const C=this._elevationTarget-this._elevationStart,F=(a-(C*i+this._elevationStart))/(1-i);this._elevationStart+=i*(C-F),this._elevationTarget=a}this.transform.elevation=e.z.number(this._elevationStart,this._elevationTarget,i)}_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(i){const a=i.getCameraPosition(),C=this.terrain.getElevationForLngLatZoom(a.lngLat,i.zoom);if(a.altitudethis._elevateCameraIfInsideTerrain(F)),this.transformCameraUpdate&&a.push(F=>this.transformCameraUpdate(F)),!a.length)return;const C=i.clone();for(const F of a){const q=C.clone(),{center:te,zoom:ue,pitch:ve,bearing:Ae,elevation:Re}=F(q);te&&(q.center=te),ue!==void 0&&(q.zoom=ue),ve!==void 0&&(q.pitch=ve),Ae!==void 0&&(q.bearing=Ae),Re!==void 0&&(q.elevation=Re),C.apply(q)}this.transform.apply(C)}_fireMoveEvents(i){this.fire(new e.k("move",i)),this._zooming&&this.fire(new e.k("zoom",i)),this._rotating&&this.fire(new e.k("rotate",i)),this._pitching&&this.fire(new e.k("pitch",i))}_afterEase(i,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;const C=this._zooming,F=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,C&&this.fire(new e.k("zoomend",i)),F&&this.fire(new e.k("rotateend",i)),q&&this.fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}flyTo(i,a){var C;if(!i.essential&&u.prefersReducedMotion){const dr=e.M(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(dr,a)}this.stop(),i=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},i);const F=this._getTransformForUpdate(),q=F.zoom,te=F.bearing,ue=F.pitch,ve=F.padding,Ae="bearing"in i?this._normalizeBearing(i.bearing,te):te,Re="pitch"in i?+i.pitch:ue,Ue="padding"in i?i.padding:F.padding,it=e.P.convert(i.offset);let ct=F.centerPoint.add(it);const dt=F.pointLocation(ct),{center:bt,zoom:Ct}=F.getConstrained(e.N.convert(i.center||dt),(C=i.zoom)!==null&&C!==void 0?C:q);this._normalizeCenter(bt,F);const Mt=F.zoomScale(Ct-q),Vt=F.project(dt),It=F.project(bt).sub(Vt);let Qt=i.curve;const tn=Math.max(F.width,F.height),Yt=tn/Mt,vn=It.mag();if("minZoom"in i){const dr=e.ad(Math.min(i.minZoom,q,Ct),F.minZoom,F.maxZoom),Br=tn/F.zoomScale(dr-q);Qt=Math.sqrt(Br/vn*2)}const Mn=Qt*Qt;function Vn(dr){const Br=(Yt*Yt-tn*tn+(dr?-1:1)*Mn*Mn*vn*vn)/(2*(dr?Yt:tn)*Mn*vn);return Math.log(Math.sqrt(Br*Br+1)-Br)}function Hn(dr){return(Math.exp(dr)-Math.exp(-dr))/2}function Xn(dr){return(Math.exp(dr)+Math.exp(-dr))/2}const rr=Vn(!1);let Mr=function(dr){return Xn(rr)/Xn(rr+Qt*dr)},nr=function(dr){return tn*((Xn(rr)*(Hn(Br=rr+Qt*dr)/Xn(Br))-Hn(rr))/Mn)/vn;var Br},Lr=(Vn(!0)-rr)/Qt;if(Math.abs(vn)<1e-6||!isFinite(Lr)){if(Math.abs(tn-Yt)<1e-6)return this.easeTo(i,a);const dr=Yt0,Mr=Br=>Math.exp(dr*Qt*Br)}if("duration"in i)i.duration=+i.duration;else{const dr="screenSpeed"in i?+i.screenSpeed/Qt:+i.speed;i.duration=1e3*Lr/dr}return i.maxDuration&&i.duration>i.maxDuration&&(i.duration=0),this._zooming=!0,this._rotating=te!==Ae,this._pitching=Re!==ue,this._padding=!F.isPaddingEqual(Ue),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(bt),this._ease(dr=>{const Br=dr*Lr,Sr=1/Mr(Br);F.zoom=dr===1?Ct:q+F.scaleZoom(Sr),this._rotating&&(F.bearing=e.z.number(te,Ae,dr)),this._pitching&&(F.pitch=e.z.number(ue,Re,dr)),this._padding&&(F.interpolatePadding(ve,Ue,dr),ct=F.centerPoint.add(it)),this.terrain&&!i.freezeElevation&&this._updateElevation(dr);const Vr=dr===1?bt:F.unproject(Vt.add(It.mult(nr(Br))).mult(Sr));F.setLocationAtPoint(F.renderWorldCopies?Vr.wrap():Vr,ct),this._applyUpdatedTransform(F),this._fireMoveEvents(a)},()=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(a)},i),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(i,a){var C;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const F=this._onEaseEnd;delete this._onEaseEnd,F.call(this,a)}return i||(C=this.handlers)===null||C===void 0||C.stop(!1),this}_ease(i,a,C){C.animate===!1||C.duration===0?(i(1),a()):(this._easeStart=u.now(),this._easeOptions=C,this._onEaseFrame=i,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(i,a){i=e.b3(i,-180,180);const C=Math.abs(i-a);return Math.abs(i-360-a)180?-360:C<-180?360:0}queryTerrainElevation(i){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(i),this.transform.tileZoom)-this.transform.elevation:null}}const io={compact:!0,customAttribution:'
MapLibre'};class ta{constructor(i=io){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=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=i}getDefaultPosition(){return"bottom-right"}onAdd(i){return this._map=i,this._compact=this.options.compact,this._container=r.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=r.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.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(){r.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(i,a){const C=this._map._getUIString(`AttributionControl.${a}`);i.title=C,i.setAttribute("aria-label",C)}_updateAttributions(){if(!this._map.style)return;let i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(F=>typeof F!="string"?"":F)):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){const F=this._map.style.stylesheet;this.styleOwner=F.owner,this.styleId=F.id}const a=this._map.style.sourceCaches;for(const F in a){const q=a[F];if(q.used||q.usedForTerrain){const te=q.getSource();te.attribution&&i.indexOf(te.attribution)<0&&i.push(te.attribution)}}i=i.filter(F=>String(F).trim()),i.sort((F,q)=>F.length-q.length),i=i.filter((F,q)=>{for(let te=q+1;te=0)return!1;return!0});const C=i.join(" | ");C!==this._attribHTML&&(this._attribHTML=C,i.length?(this._innerContainer.innerHTML=C,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Qo{constructor(i={}){this._updateCompact=()=>{const a=this._container.children;if(a.length){const C=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&C.classList.add("maplibregl-compact"):C.classList.remove("maplibregl-compact")}},this.options=i}getDefaultPosition(){return"bottom-left"}onAdd(i){this._map=i,this._compact=this.options&&this.options.compact,this._container=r.create("div","maplibregl-ctrl");const a=r.create("a","maplibregl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://maplibre.org/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){r.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ac{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){const a=++this._id;return this._queue.push({callback:i,id:a,cancelled:!1}),a}remove(i){const a=this._currentlyRunning,C=a?this._queue.concat(a):this._queue;for(const F of C)if(F.id===i)return void(F.cancelled=!0)}run(i=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const a=this._currentlyRunning=this._queue;this._queue=[];for(const C of a)if(!C.cancelled&&(C.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var yi=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Io extends e.E{constructor(i){super(),this.sourceCache=i,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,i.usedForTerrain=!0,i.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(i,a){this.sourceCache.update(i,a),this._renderableTilesKeys=[];const C={};for(const F of i.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a}))C[F.key]=!0,this._renderableTilesKeys.push(F.key),this._tiles[F.key]||(F.posMatrix=new Float64Array(16),e.aQ(F.posMatrix,0,e.X,0,e.X,0,1),this._tiles[F.key]=new _e(F,this.tileSize));for(const F in this._tiles)C[F]||delete this._tiles[F]}freeRtt(i){for(const a in this._tiles){const C=this._tiles[a];(!i||C.tileID.equals(i)||C.tileID.isChildOf(i)||i.isChildOf(C.tileID))&&(C.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(i=>this.getTileByID(i))}getTileByID(i){return this._tiles[i]}getTerrainCoords(i){const a={};for(const C of this._renderableTilesKeys){const F=this._tiles[C].tileID;if(F.canonical.equals(i.canonical)){const q=i.clone();q.posMatrix=new Float64Array(16),e.aQ(q.posMatrix,0,e.X,0,e.X,0,1),a[C]=q}else if(F.canonical.isChildOf(i.canonical)){const q=i.clone();q.posMatrix=new Float64Array(16);const te=F.canonical.z-i.canonical.z,ue=F.canonical.x-(F.canonical.x>>te<>te<>te;e.aQ(q.posMatrix,0,Ae,0,Ae,0,1),e.J(q.posMatrix,q.posMatrix,[-ue*Ae,-ve*Ae,0]),a[C]=q}else if(i.canonical.isChildOf(F.canonical)){const q=i.clone();q.posMatrix=new Float64Array(16);const te=i.canonical.z-F.canonical.z,ue=i.canonical.x-(i.canonical.x>>te<>te<>te;e.aQ(q.posMatrix,0,e.X,0,e.X,0,1),e.J(q.posMatrix,q.posMatrix,[ue*Ae,ve*Ae,0]),e.K(q.posMatrix,q.posMatrix,[1/2**te,1/2**te,0]),a[C]=q}}return a}getSourceTile(i,a){const C=this.sourceCache._source;let F=i.overscaledZ-this.deltaZoom;if(F>C.maxzoom&&(F=C.maxzoom),F=C.minzoom&&(!q||!q.dem);)q=this.sourceCache.getTileByID(i.scaledTo(F--).key);return q}tilesAfterTime(i=Date.now()){return Object.values(this._tiles).filter(a=>a.timeAdded>=i)}}class za{constructor(i,a,C){this.painter=i,this.sourceCache=new Io(a),this.options=C,this.exaggeration=typeof C.exaggeration=="number"?C.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(i,a,C,F=e.X){var q;if(!(a>=0&&a=0&&Ci.canonical.z&&(i.canonical.z>=F?q=i.canonical.z-F:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const te=i.canonical.x-(i.canonical.x>>q<>q<>8<<4|q>>8,a[te+3]=0;const C=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),F=new M(i,C,i.gl.RGBA,{premultiply:!1});return F.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._coordsTexture=F,F}pointCoordinate(i){this.painter.maybeDrawDepthAndCoords(!0);const a=new Uint8Array(4),C=this.painter.context,F=C.gl,q=Math.round(i.x*this.painter.pixelRatio/devicePixelRatio),te=Math.round(i.y*this.painter.pixelRatio/devicePixelRatio),ue=Math.round(this.painter.height/devicePixelRatio);C.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),F.readPixels(q,ue-te-1,1,1,F.RGBA,F.UNSIGNED_BYTE,a),C.bindFramebuffer.set(null);const ve=a[0]+(a[2]>>4<<8),Ae=a[1]+((15&a[2])<<8),Re=this.coordsIndex[255-a[3]],Ue=Re&&this.sourceCache.getTileByID(Re);if(!Ue)return null;const it=this._coordsTextureSize,ct=(1<i.id!==a),this._recentlyUsed.push(i.id)}stampObject(i){i.stamp=++this._stamp}getOrCreateFreeObject(){for(const a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const i=this._createObject(this._objects.length);return this._objects.push(i),i}freeObject(i){i.inUse=!1}freeAllObjects(){for(const i of this._objects)this.freeObject(i)}isFull(){return!(this._objects.length!i.inUse)===!1}}const sl={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class $l{constructor(i,a){this.painter=i,this.terrain=a,this.pool=new xu(i.context,30,a.sourceCache.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(i){return this.pool.getObjectForId(i.rtt[this._stacks.length-1].id).texture}prepareForRender(i,a){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=i._order.filter(C=>!i._layers[C].isHidden(a)),this._coordsDescendingInv={};for(const C in i.sourceCaches){this._coordsDescendingInv[C]={};const F=i.sourceCaches[C].getVisibleCoordinates();for(const q of F){const te=this.terrain.sourceCache.getTerrainCoords(q);for(const ue in te)this._coordsDescendingInv[C][ue]||(this._coordsDescendingInv[C][ue]=[]),this._coordsDescendingInv[C][ue].push(te[ue])}}this._coordsDescendingInvStr={};for(const C of i._order){const F=i._layers[C],q=F.source;if(sl[F.type]&&!this._coordsDescendingInvStr[q]){this._coordsDescendingInvStr[q]={};for(const te in this._coordsDescendingInv[q])this._coordsDescendingInvStr[q][te]=this._coordsDescendingInv[q][te].map(ue=>ue.key).sort().join()}}for(const C of this._renderableTiles)for(const F in this._coordsDescendingInvStr){const q=this._coordsDescendingInvStr[F][C.tileID.key];q&&q!==C.rttCoords[F]&&(C.rtt=[])}}renderLayer(i){if(i.isHidden(this.painter.transform.zoom))return!1;const a=i.type,C=this.painter,F=this._renderableLayerIds[this._renderableLayerIds.length-1]===i.id;if(sl[a]&&(this._prevType&&sl[this._prevType]||this._stacks.push([]),this._prevType=a,this._stacks[this._stacks.length-1].push(i.id),!F))return!0;if(sl[this._prevType]||sl[a]&&F){this._prevType=a;const q=this._stacks.length-1,te=this._stacks[q]||[];for(const ue of this._renderableTiles){if(this.pool.isFull()&&(mu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(ue),ue.rtt[q]){const Ae=this.pool.getObjectForId(ue.rtt[q].id);if(Ae.stamp===ue.rtt[q].stamp){this.pool.useObject(Ae);continue}}const ve=this.pool.getOrCreateFreeObject();this.pool.useObject(ve),this.pool.stampObject(ve),ue.rtt[q]={id:ve.id,stamp:ve.stamp},C.context.bindFramebuffer.set(ve.fbo.framebuffer),C.context.clear({color:e.aN.transparent,stencil:0}),C.currentStencilSource=void 0;for(let Ae=0;Ae{R.touchstart=R.dragStart,R.touchmoveWindow=R.dragMove,R.touchend=R.dragEnd},Cl={showCompass:!0,showZoom:!0,visualizePitch:!1};class di{constructor(i,a,C=!1){this.mousedown=te=>{this.startMouse(e.e({},te,{ctrlKey:!0,preventDefault:()=>te.preventDefault()}),r.mousePos(this.element,te)),r.addEventListener(window,"mousemove",this.mousemove),r.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=te=>{this.moveMouse(te,r.mousePos(this.element,te))},this.mouseup=te=>{this.mouseRotate.dragEnd(te),this.mousePitch&&this.mousePitch.dragEnd(te),this.offTemp()},this.touchstart=te=>{te.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,te.targetTouches)[0],this.startTouch(te,this._startPos),r.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.addEventListener(window,"touchend",this.touchend))},this.touchmove=te=>{te.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,te.targetTouches)[0],this.moveTouch(te,this._lastPos))},this.touchend=te=>{te.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const F=i.dragRotate._mouseRotate.getClickTolerance(),q=i.dragRotate._mousePitch.getClickTolerance();this.element=a,this.mouseRotate=yu({clickTolerance:F,enable:!0}),this.touchRotate=(({enable:te,clickTolerance:ue,bearingDegreesPerPixelMoved:ve=.8})=>{const Ae=new Zl;return new cs({clickTolerance:ue,move:(Re,Ue)=>({bearingDelta:(Ue.x-Re.x)*ve}),moveStateManager:Ae,enable:te,assignEvents:eo})})({clickTolerance:F,enable:!0}),this.map=i,C&&(this.mousePitch=ru({clickTolerance:q,enable:!0}),this.touchPitch=(({enable:te,clickTolerance:ue,pitchDegreesPerPixelMoved:ve=-.5})=>{const Ae=new Zl;return new cs({clickTolerance:ue,move:(Re,Ue)=>({pitchDelta:(Ue.y-Re.y)*ve}),moveStateManager:Ae,enable:te,assignEvents:eo})})({clickTolerance:q,enable:!0})),r.addEventListener(a,"mousedown",this.mousedown),r.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(a,"touchcancel",this.reset)}startMouse(i,a){this.mouseRotate.dragStart(i,a),this.mousePitch&&this.mousePitch.dragStart(i,a),r.disableDrag()}startTouch(i,a){this.touchRotate.dragStart(i,a),this.touchPitch&&this.touchPitch.dragStart(i,a),r.disableDrag()}moveMouse(i,a){const C=this.map,{bearingDelta:F}=this.mouseRotate.dragMove(i,a)||{};if(F&&C.setBearing(C.getBearing()+F),this.mousePitch){const{pitchDelta:q}=this.mousePitch.dragMove(i,a)||{};q&&C.setPitch(C.getPitch()+q)}}moveTouch(i,a){const C=this.map,{bearingDelta:F}=this.touchRotate.dragMove(i,a)||{};if(F&&C.setBearing(C.getBearing()+F),this.touchPitch){const{pitchDelta:q}=this.touchPitch.dragMove(i,a)||{};q&&C.setPitch(C.getPitch()+q)}}off(){const i=this.element;r.removeEventListener(i,"mousedown",this.mousedown),r.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend),r.removeEventListener(i,"touchcancel",this.reset),this.offTemp()}offTemp(){r.enableDrag(),r.removeEventListener(window,"mousemove",this.mousemove),r.removeEventListener(window,"mouseup",this.mouseup),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend)}}let Fi;function Mo(R,i,a){const C=new e.N(R.lng,R.lat);if(R=new e.N(R.lng,R.lat),i){const F=new e.N(R.lng-360,R.lat),q=new e.N(R.lng+360,R.lat),te=a.locationPoint(R).distSqr(i);a.locationPoint(F).distSqr(i)180;){const F=a.locationPoint(R);if(F.x>=0&&F.y>=0&&F.x<=a.width&&F.y<=a.height)break;R.lng>a.center.lng?R.lng-=360:R.lng+=360}return R.lng!==C.lng&&a.locationPoint(R).y>a.height/2-a.getHorizon()?R:C}const Il={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 su(R,i,a){const C=R.classList;for(const F in Il)C.remove(`maplibregl-${a}-anchor-${F}`);C.add(`maplibregl-${a}-anchor-${i}`)}class ho extends e.E{constructor(i){if(super(),this._onKeyPress=a=>{const C=a.code,F=a.charCode||a.keyCode;C!=="Space"&&C!=="Enter"&&F!==32&&F!==13||this.togglePopup()},this._onMapClick=a=>{const C=a.originalEvent.target,F=this._element;this._popup&&(C===F||F.contains(C))&&this.togglePopup()},this._update=a=>{var C;if(!this._map)return;const F=this._map.loaded()&&!this._map.isMoving();((a==null?void 0:a.type)==="terrain"||(a==null?void 0:a.type)==="render"&&!F)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies?this._lngLat=Mo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(C=this._lngLat)===null||C===void 0?void 0:C.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 q="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?q=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(q=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let te="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?te="rotateX(0deg)":this._pitchAlignment==="map"&&(te=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),r.setTransform(this._element,`${Il[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${te} ${q}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(a&&a.type==="moveend")}).catch(()=>{})},this._onMove=a=>{if(!this._isDragging){const C=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=C}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.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=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._subpixelPositioning=i&&i.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&i.pitchAlignment!=="auto"?i.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(i==null?void 0:i.opacity,i==null?void 0:i.opacityWhenCovered),i&&i.element)this._element=i.element,this._offset=e.P.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");const a=r.createNS("http://www.w3.org/2000/svg","svg"),C=41,F=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${C}px`),a.setAttributeNS(null,"width",`${F}px`),a.setAttributeNS(null,"viewBox",`0 0 ${F} ${C}`);const q=r.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"stroke","none"),q.setAttributeNS(null,"stroke-width","1"),q.setAttributeNS(null,"fill","none"),q.setAttributeNS(null,"fill-rule","evenodd");const te=r.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"fill-rule","nonzero");const ue=r.createNS("http://www.w3.org/2000/svg","g");ue.setAttributeNS(null,"transform","translate(3.0, 29.0)"),ue.setAttributeNS(null,"fill","#000000");const ve=[{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 Mt of ve){const Vt=r.createNS("http://www.w3.org/2000/svg","ellipse");Vt.setAttributeNS(null,"opacity","0.04"),Vt.setAttributeNS(null,"cx","10.5"),Vt.setAttributeNS(null,"cy","5.80029008"),Vt.setAttributeNS(null,"rx",Mt.rx),Vt.setAttributeNS(null,"ry",Mt.ry),ue.appendChild(Vt)}const Ae=r.createNS("http://www.w3.org/2000/svg","g");Ae.setAttributeNS(null,"fill",this._color);const Re=r.createNS("http://www.w3.org/2000/svg","path");Re.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"),Ae.appendChild(Re);const Ue=r.createNS("http://www.w3.org/2000/svg","g");Ue.setAttributeNS(null,"opacity","0.25"),Ue.setAttributeNS(null,"fill","#000000");const it=r.createNS("http://www.w3.org/2000/svg","path");it.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"),Ue.appendChild(it);const ct=r.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ct.setAttributeNS(null,"fill","#FFFFFF");const dt=r.createNS("http://www.w3.org/2000/svg","g");dt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const bt=r.createNS("http://www.w3.org/2000/svg","circle");bt.setAttributeNS(null,"fill","#000000"),bt.setAttributeNS(null,"opacity","0.25"),bt.setAttributeNS(null,"cx","5.5"),bt.setAttributeNS(null,"cy","5.5"),bt.setAttributeNS(null,"r","5.4999962");const Ct=r.createNS("http://www.w3.org/2000/svg","circle");Ct.setAttributeNS(null,"fill","#FFFFFF"),Ct.setAttributeNS(null,"cx","5.5"),Ct.setAttributeNS(null,"cy","5.5"),Ct.setAttributeNS(null,"r","5.4999962"),dt.appendChild(bt),dt.appendChild(Ct),te.appendChild(ue),te.appendChild(Ae),te.appendChild(Ue),te.appendChild(ct),te.appendChild(dt),a.appendChild(te),a.setAttributeNS(null,"height",C*this._scale+"px"),a.setAttributeNS(null,"width",F*this._scale+"px"),this._element.appendChild(a),this._offset=e.P.convert(i&&i.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),su(this._element,this._anchor,"marker"),i&&i.className)for(const a of i.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(i){return this.remove(),this._map=i,this._element.setAttribute("aria-label",i._getUIString("Marker.Title")),i.getCanvasContainer().appendChild(this._element),i.on("move",this._update),i.on("moveend",this._update),i.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),r.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=e.N.convert(i),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(i){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),i){if(!("offset"in i.options)){const F=Math.abs(13.5)/Math.SQRT2;i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[F,-1*(24.6+F)],"bottom-right":[-F,-1*(24.6+F)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=i,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(i){return this._subpixelPositioning=i,this}getPopup(){return this._popup}togglePopup(){const i=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:i?(i.isOpen()?i.remove():(i.setLngLat(this._lngLat),i.addTo(this._map)),this):this}_updateOpacity(i=!1){var a,C;if(!(!((a=this._map)===null||a===void 0)&&a.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(i)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const F=this._map,q=F.terrain.depthAtPoint(this._pos),te=F.terrain.getElevationForLngLatZoom(this._lngLat,F.transform.tileZoom);if(F.transform.lngLatToCameraDepth(this._lngLat,te)-q<.006)return void(this._element.style.opacity=this._opacity);const ue=-this._offset.y/F.transform._pixelPerMeter,ve=Math.sin(F.getPitch()*Math.PI/180)*ue,Ae=F.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),Re=F.transform.lngLatToCameraDepth(this._lngLat,te+ve)-Ae>.006;!((C=this._popup)===null||C===void 0)&&C.isOpen()&&Re&&this._popup.remove(),this._element.style.opacity=Re?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(i){return this._offset=e.P.convert(i),this._update(),this}addClassName(i){this._element.classList.add(i)}removeClassName(i){this._element.classList.remove(i)}toggleClassName(i){return this._element.classList.toggle(i)}setDraggable(i){return this._draggable=!!i,this._map&&(i?(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(i){return this._rotation=i||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i&&i!=="auto"?i:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(i,a){return i===void 0&&a===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),i!==void 0&&(this._opacity=i),a!==void 0&&(this._opacityWhenCovered=a),this._map&&this._updateOpacity(!0),this}}const _u={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let da=0,Ys=!1;class Ai extends e.E{constructor(i){super(),this._onSuccess=a=>{if(this._map){if(this._isOutOfMapMaxBounds(a))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",a)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=a,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(a),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(a),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",a)),this._finish()}},this._updateCamera=a=>{const C=new e.N(a.coords.longitude,a.coords.latitude),F=a.coords.accuracy,q=this._map.getBearing(),te=e.e({bearing:q},this.options.fitBoundsOptions),ue=Ee.fromLngLat(C,F);this._map.fitBounds(ue,te,{geolocateSource:!0})},this._updateMarker=a=>{if(a){const C=new e.N(a.coords.longitude,a.coords.latitude);this._accuracyCircleMarker.setLngLat(C).addTo(this._map),this._userLocationDotMarker.setLngLat(C).addTo(this._map),this._accuracy=a.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=a=>{if(this._map){if(this.options.trackUserLocation)if(a.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const C=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(a.code===3&&Ys)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",a)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=a=>{if(this._map){if(a===!1){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const C=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}else{const C=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ho({element:this._dotElement}),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ho({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",C=>{const F=C.originalEvent&&C.originalEvent.type==="resize";C.geolocateSource||this._watchState!=="ACTIVE_LOCK"||F||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))})}},this.options=e.e({},_u,i)}onAdd(i){return this._map=i,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(a=!1){if(Fi!==void 0&&!a)return Fi;if(window.navigator.permissions===void 0)return Fi=!!window.navigator.geolocation,Fi;try{Fi=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Fi=!!window.navigator.geolocation}return Fi})}().then(a=>this._finishSetupUI(a)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,da=0,Ys=!1}_isOutOfMapMaxBounds(i){const a=this._map.getMaxBounds(),C=i.coords;return a&&(C.longitudea.getEast()||C.latitudea.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 i=this._map.getBounds(),a=i.getSouthEast(),C=i.getNorthEast(),F=a.distanceTo(C),q=this._map._container.clientHeight,te=Math.ceil(this._accuracy/(F/q)*2);this._circleElement.style.width=`${te}px`,this._circleElement.style.height=`${te}px`}trigger(){if(!this._setup)return e.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 e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":da--,Ys=!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 e.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 e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let i;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),da++,da>1?(i={maximumAge:6e5,timeout:0},Ys=!0):(i=this.options.positionOptions,Ys=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,i)}}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)}}const xi={maxWidth:100,unit:"metric"};function xa(R,i,a){const C=a&&a.maxWidth||100,F=R._container.clientHeight/2,q=R.unproject([0,F]),te=R.unproject([C,F]),ue=q.distanceTo(te);if(a&&a.unit==="imperial"){const ve=3.2808*ue;ve>5280?es(i,C,ve/5280,R._getUIString("ScaleControl.Miles")):es(i,C,ve,R._getUIString("ScaleControl.Feet"))}else a&&a.unit==="nautical"?es(i,C,ue/1852,R._getUIString("ScaleControl.NauticalMiles")):ue>=1e3?es(i,C,ue/1e3,R._getUIString("ScaleControl.Kilometers")):es(i,C,ue,R._getUIString("ScaleControl.Meters"))}function es(R,i,a,C){const F=function(te){const ue=Math.pow(10,`${Math.floor(te)}`.length-1);let ve=te/ue;return ve=ve>=10?10:ve>=5?5:ve>=3?3:ve>=2?2:ve>=1?1:function(Ae){const Re=Math.pow(10,Math.ceil(-Math.log(Ae)/Math.LN10));return Math.round(Ae*Re)/Re}(ve),ue*ve}(a),q=F/a;R.style.width=i*q+"px",R.innerHTML=`${F} ${C}`}class bu extends e.E{constructor(i={}){super(),this._onFullscreenChange=()=>{var a;let C=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((a=C==null?void 0:C.shadowRoot)===null||a===void 0)&&a.fullscreenElement;)C=C.shadowRoot.fullscreenElement;C===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,i&&i.container&&(i.container instanceof HTMLElement?this._container=i.container:e.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(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){r.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const i=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon",i).setAttribute("aria-hidden","true"),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i}_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 e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.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()}}const js={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},xt=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class kt extends e.E{constructor(i){super(),this.remove=()=>(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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=a=>{this._update(a.point)},this._onMouseMove=a=>{this._update(a.point)},this._onDrag=a=>{this._update(a.point)},this._update=a=>{var C;const F=this._lngLat||this._trackPointer;if(!this._map||!F||!this._content)return;if(!this._container){if(this._container=r.create("div","maplibregl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const Ae of this.options.className.split(" "))this._container.classList.add(Ae);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._map.transform.renderWorldCopies&&!this._trackPointer?this._lngLat=Mo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(C=this._lngLat)===null||C===void 0?void 0:C.wrap(),this._trackPointer&&!a)return;const q=this._flatPos=this._pos=this._trackPointer&&a?a:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&a?a:this._map.transform.locationPoint(this._lngLat));let te=this.options.anchor;const ue=Dt(this.options.offset);if(!te){const Ae=this._container.offsetWidth,Re=this._container.offsetHeight;let Ue;Ue=q.y+ue.bottom.ythis._map.transform.height-Re?["bottom"]:[],q.xthis._map.transform.width-Ae/2&&Ue.push("right"),te=Ue.length===0?"bottom":Ue.join("-")}let ve=q.add(ue[te]);this.options.subpixelPositioning||(ve=ve.round()),r.setTransform(this._container,`${Il[te]} translate(${ve.x}px,${ve.y}px)`),su(this._container,te,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(js),i)}addTo(i){return this._map&&this.remove(),this._map=i,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 e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=e.N.convert(i),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(i){return this.setDOMContent(document.createTextNode(i))}setHTML(i){const a=document.createDocumentFragment(),C=document.createElement("body");let F;for(C.innerHTML=i;F=C.firstChild,F;)a.appendChild(F);return this.setDOMContent(a)}getMaxWidth(){var i;return(i=this._container)===null||i===void 0?void 0:i.style.maxWidth}setMaxWidth(i){return this.options.maxWidth=i,this._update(),this}setDOMContent(i){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(i),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(i){return this._container&&this._container.classList.add(i),this}removeClassName(i){return this._container&&this._container.classList.remove(i),this}setOffset(i){return this.options.offset=i,this._update(),this}toggleClassName(i){if(this._container)return this._container.classList.toggle(i)}setSubpixelPositioning(i){this.options.subpixelPositioning=i}_createCloseButton(){this.options.closeButton&&(this._closeButton=r.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 i=this._container.querySelector(xt);i&&i.focus()}}function Dt(R){if(R){if(typeof R=="number"){const i=Math.round(Math.abs(R)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,R),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-R),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(R,0),right:new e.P(-R,0)}}if(R instanceof e.P||Array.isArray(R)){const i=e.P.convert(R);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(R.center||[0,0]),top:e.P.convert(R.top||[0,0]),"top-left":e.P.convert(R["top-left"]||[0,0]),"top-right":e.P.convert(R["top-right"]||[0,0]),bottom:e.P.convert(R.bottom||[0,0]),"bottom-left":e.P.convert(R["bottom-left"]||[0,0]),"bottom-right":e.P.convert(R["bottom-right"]||[0,0]),left:e.P.convert(R.left||[0,0]),right:e.P.convert(R.right||[0,0])}}return Dt(new e.P(0,0))}const X=w;d.AJAXError=e.bg,d.Evented=e.E,d.LngLat=e.N,d.MercatorCoordinate=e.Z,d.Point=e.P,d.addProtocol=e.bh,d.config=e.a,d.removeProtocol=e.bi,d.AttributionControl=ta,d.BoxZoomHandler=Co,d.CanvasSource=Me,d.CooperativeGesturesHandler=As,d.DoubleClickZoomHandler=Na,d.DragPanHandler=El,d.DragRotateHandler=ks,d.EdgeInsets=Zs,d.FullscreenControl=bu,d.GeoJSONSource=Ie,d.GeolocateControl=Ai,d.Hash=Ho,d.ImageSource=Pe,d.KeyboardHandler=Ml,d.LngLatBounds=Ee,d.LogoControl=Qo,d.Map=class extends So{constructor(R){e.be.mark(e.bf.create);const i=Object.assign(Object.assign({},ou),R);if(i.minZoom!=null&&i.maxZoom!=null&&i.minZoom>i.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(i.minPitch!=null&&i.maxPitch!=null&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(i.minPitch!=null&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(i.maxPitch!=null&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new La(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ac,this._controls=[],this._mapId=e.a4(),this._contextLost=C=>{C.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:C}))},this._contextRestored=C=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:C}))},this._onMapScroll=C=>{if(C.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=i.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=i.preserveDrawingBuffer===!0,this._antialias=i.antialias===!0,this._trackResize=i.trackResize===!0,this._bearingSnap=i.bearingSnap,this._refreshExpiredTiles=i.refreshExpiredTiles===!0,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=i.crossSourceCollisions===!0,this._collectResourceTiming=i.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},dc),i.locale),this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=i.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=x.addThrottleControl(()=>this.isMoving()),this._requestManager=new m(i.transformRequest),typeof i.container=="string"){if(this._container=document.getElementById(i.container),!this._container)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let C=!1;const F=ba(q=>{this._trackResize&&!this._removed&&this.resize(q)._update()},50);this._resizeObserver=new ResizeObserver(q=>{C?F(q):C=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ya(this,i);const a=typeof i.hash=="string"&&i.hash||void 0;this._hash=i.hash&&new Ho(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,e.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new ta(typeof i.attributionControl=="boolean"?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new Qo,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",C=>{this._update(C.dataType==="style"),this.fire(new e.k(`${C.dataType}data`,C))}),this.on("dataloading",C=>{this.fire(new e.k(`${C.dataType}dataloading`,C))}),this.on("dataabort",C=>{this.fire(new e.k("sourcedataabort",C))})}_getMapId(){return this._mapId}addControl(R,i){if(i===void 0&&(i=R.getDefaultPosition?R.getDefaultPosition():"top-right"),!R||!R.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const a=R.onAdd(this);this._controls.push(R);const C=this._controlPositions[i];return i.indexOf("bottom")!==-1?C.insertBefore(a,C.firstChild):C.appendChild(a),this}removeControl(R){if(!R||!R.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(R);return i>-1&&this._controls.splice(i,1),R.onRemove(this),this}hasControl(R){return this._controls.indexOf(R)>-1}calculateCameraOptionsFromTo(R,i,a,C){return C==null&&this.terrain&&(C=this.terrain.getElevationForLngLatZoom(a,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(R,i,a,C)}resize(R){var i;const a=this._containerDimensions(),C=a[0],F=a[1],q=this._getClampedPixelRatio(C,F);if(this._resizeCanvas(C,F,q),this.painter.resize(C,F,q),this.painter.overLimit()){const ue=this.painter.context.gl;this._maxCanvasSize=[ue.drawingBufferWidth,ue.drawingBufferHeight];const ve=this._getClampedPixelRatio(C,F);this._resizeCanvas(C,F,ve),this.painter.resize(C,F,ve)}this.transform.resize(C,F),(i=this._requestedCameraState)===null||i===void 0||i.resize(C,F);const te=!this._moving;return te&&(this.stop(),this.fire(new e.k("movestart",R)).fire(new e.k("move",R))),this.fire(new e.k("resize",R)),te&&this.fire(new e.k("moveend",R)),this}_getClampedPixelRatio(R,i){const{0:a,1:C}=this._maxCanvasSize,F=this.getPixelRatio(),q=R*F,te=i*F,ue=q>a?a/q:1,ve=te>C?C/te:1;return Math.min(ue,ve)*F}getPixelRatio(){var R;return(R=this._overridePixelRatio)!==null&&R!==void 0?R:devicePixelRatio}setPixelRatio(R){this._overridePixelRatio=R,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(R){return this.transform.setMaxBounds(Ee.convert(R)),this._update()}setMinZoom(R){if((R=R??-2)>=-2&&R<=this.transform.maxZoom)return this.transform.minZoom=R,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=R,this._update(),this.getZoom()>R&&this.setZoom(R),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(R){if((R=R??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(R>=0&&R<=this.transform.maxPitch)return this.transform.minPitch=R,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(R>=this.transform.minPitch)return this.transform.maxPitch=R,this._update(),this.getPitch()>R&&this.setPitch(R),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(R){return this.transform.renderWorldCopies=R,this._update()}project(R){return this.transform.locationPoint(e.N.convert(R),this.style&&this.terrain)}unproject(R){return this.transform.pointLocation(e.P.convert(R),this.terrain)}isMoving(){var R;return this._moving||((R=this.handlers)===null||R===void 0?void 0:R.isMoving())}isZooming(){var R;return this._zooming||((R=this.handlers)===null||R===void 0?void 0:R.isZooming())}isRotating(){var R;return this._rotating||((R=this.handlers)===null||R===void 0?void 0:R.isRotating())}_createDelegatedListener(R,i,a){if(R==="mouseenter"||R==="mouseover"){let C=!1;return{layer:i,listener:a,delegates:{mousemove:q=>{const te=this.getLayer(i)?this.queryRenderedFeatures(q.point,{layers:[i]}):[];te.length?C||(C=!0,a.call(this,new us(R,this,q.originalEvent,{features:te}))):C=!1},mouseout:()=>{C=!1}}}}if(R==="mouseleave"||R==="mouseout"){let C=!1;return{layer:i,listener:a,delegates:{mousemove:te=>{(this.getLayer(i)?this.queryRenderedFeatures(te.point,{layers:[i]}):[]).length?C=!0:C&&(C=!1,a.call(this,new us(R,this,te.originalEvent)))},mouseout:te=>{C&&(C=!1,a.call(this,new us(R,this,te.originalEvent)))}}}}{const C=F=>{const q=this.getLayer(i)?this.queryRenderedFeatures(F.point,{layers:[i]}):[];q.length&&(F.features=q,a.call(this,F),delete F.features)};return{layer:i,listener:a,delegates:{[R]:C}}}}on(R,i,a){if(a===void 0)return super.on(R,i);const C=this._createDelegatedListener(R,i,a);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[R]=this._delegatedListeners[R]||[],this._delegatedListeners[R].push(C);for(const F in C.delegates)this.on(F,C.delegates[F]);return this}once(R,i,a){if(a===void 0)return super.once(R,i);const C=this._createDelegatedListener(R,i,a);for(const F in C.delegates)this.once(F,C.delegates[F]);return this}off(R,i,a){return a===void 0?super.off(R,i):(this._delegatedListeners&&this._delegatedListeners[R]&&(C=>{const F=C[R];for(let q=0;qthis._updateStyle(R,i));const a=this.style&&i.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!R)),R?(this.style=new ni(this,i||{}),this.style.setEventedParent(this,{style:this.style}),typeof R=="string"?this.style.loadURL(R,i,a):this.style.loadJSON(R,i,a),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(R,i){if(typeof R=="string"){const a=R,C=this._requestManager.transformRequest(a,"Style");e.h(C,new AbortController).then(F=>{this._updateDiff(F.data,i)}).catch(F=>{F&&this.fire(new e.j(F))})}else typeof R=="object"&&this._updateDiff(R,i)}_updateDiff(R,i){try{this.style.setState(R,i)&&this._update(!0)}catch(a){e.w(`Unable to perform style diff: ${a.message||a.error||a}. Rebuilding the style from scratch.`),this._updateStyle(R,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(R,i){return this._lazyInitEmptyStyle(),this.style.addSource(R,i),this._update(!0)}isSourceLoaded(R){const i=this.style&&this.style.sourceCaches[R];if(i!==void 0)return i.loaded();this.fire(new e.j(new Error(`There is no source with ID '${R}'`)))}setTerrain(R){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),R){const i=this.style.sourceCaches[R.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${R.source}`);this.terrain===null&&i.reload();for(const a in this.style._layers){const C=this.style._layers[a];C.type==="hillshade"&&C.source===R.source&&e.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 za(this.painter,i,R),this.painter.renderToTexture=new $l(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=a=>{a.dataType==="style"?this.terrain.sourceCache.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==R.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(a.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 e.k("terrain",{terrain:R})),this}getTerrain(){var R,i;return(i=(R=this.terrain)===null||R===void 0?void 0:R.options)!==null&&i!==void 0?i:null}areTilesLoaded(){const R=this.style&&this.style.sourceCaches;for(const i in R){const a=R[i]._tiles;for(const C in a){const F=a[C];if(F.state!=="loaded"&&F.state!=="errored")return!1}}return!0}removeSource(R){return this.style.removeSource(R),this._update(!0)}getSource(R){return this.style.getSource(R)}addImage(R,i,a={}){const{pixelRatio:C=1,sdf:F=!1,stretchX:q,stretchY:te,content:ue,textFitWidth:ve,textFitHeight:Ae}=a;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(i.width===void 0||i.height===void 0)return this.fire(new e.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:Re,height:Ue,data:it}=i,ct=i;return this.style.addImage(R,{data:new e.R({width:Re,height:Ue},new Uint8Array(it)),pixelRatio:C,stretchX:q,stretchY:te,content:ue,textFitWidth:ve,textFitHeight:Ae,sdf:F,version:0,userImage:ct}),ct.onAdd&&ct.onAdd(this,R),this}}{const{width:Re,height:Ue,data:it}=u.getImageData(i);this.style.addImage(R,{data:new e.R({width:Re,height:Ue},it),pixelRatio:C,stretchX:q,stretchY:te,content:ue,textFitWidth:ve,textFitHeight:Ae,sdf:F,version:0})}}updateImage(R,i){const a=this.style.getImage(R);if(!a)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const C=i instanceof HTMLImageElement||e.b(i)?u.getImageData(i):i,{width:F,height:q,data:te}=C;if(F===void 0||q===void 0)return this.fire(new e.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(F!==a.data.width||q!==a.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const ue=!(i instanceof HTMLImageElement||e.b(i));return a.data.replace(te,ue),this.style.updateImage(R,a),this}getImage(R){return this.style.getImage(R)}hasImage(R){return R?!!this.style.getImage(R):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(R){this.style.removeImage(R)}loadImage(R){return x.getImage(this._requestManager.transformRequest(R,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(R,i){return this._lazyInitEmptyStyle(),this.style.addLayer(R,i),this._update(!0)}moveLayer(R,i){return this.style.moveLayer(R,i),this._update(!0)}removeLayer(R){return this.style.removeLayer(R),this._update(!0)}getLayer(R){return this.style.getLayer(R)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(R,i,a){return this.style.setLayerZoomRange(R,i,a),this._update(!0)}setFilter(R,i,a={}){return this.style.setFilter(R,i,a),this._update(!0)}getFilter(R){return this.style.getFilter(R)}setPaintProperty(R,i,a,C={}){return this.style.setPaintProperty(R,i,a,C),this._update(!0)}getPaintProperty(R,i){return this.style.getPaintProperty(R,i)}setLayoutProperty(R,i,a,C={}){return this.style.setLayoutProperty(R,i,a,C),this._update(!0)}getLayoutProperty(R,i){return this.style.getLayoutProperty(R,i)}setGlyphs(R,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(R,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(R,i,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(R,i,a,C=>{C||this._update(!0)}),this}removeSprite(R){return this._lazyInitEmptyStyle(),this.style.removeSprite(R),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(R,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(R,i,a=>{a||this._update(!0)}),this}setLight(R,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(R,i),this._update(!0)}getLight(){return this.style.getLight()}setSky(R){return this._lazyInitEmptyStyle(),this.style.setSky(R),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(R,i){return this.style.setFeatureState(R,i),this._update()}removeFeatureState(R,i){return this.style.removeFeatureState(R,i),this._update()}getFeatureState(R){return this.style.getFeatureState(R)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let R=0,i=0;return this._container&&(R=this._container.clientWidth||400,i=this._container.clientHeight||300),[R,i]}_setupContainer(){const R=this._container;R.classList.add("maplibregl-map");const i=this._canvasContainer=r.create("div","maplibregl-canvas-container",R);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas",i),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 a=this._containerDimensions(),C=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],C);const F=this._controlContainer=r.create("div","maplibregl-control-container",R),q=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(te=>{q[te]=r.create("div",`maplibregl-ctrl-${te} `,F)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(R,i,a){this._canvas.width=Math.floor(a*R),this._canvas.height=Math.floor(a*i),this._canvas.style.width=`${R}px`,this._canvas.style.height=`${i}px`}_setupPainter(){const R={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let i=null;this._canvas.addEventListener("webglcontextcreationerror",C=>{i={requestedAttributes:R},C&&(i.statusMessage=C.statusMessage,i.type=C.type)},{once:!0});const a=this._canvas.getContext("webgl2",R)||this._canvas.getContext("webgl",R);if(!a){const C="Failed to initialize WebGL";throw i?(i.message=C,new Error(JSON.stringify(i))):new Error(C)}this.painter=new ls(a,this.transform),n.testSupport(a)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(R){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||R,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(R){return this._update(),this._renderTaskQueue.add(R)}_cancelRenderFrame(R){this._renderTaskQueue.remove(R)}_render(R){const i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(R),this._removed)return;let a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const F=this.transform.zoom,q=u.now();this.style.zoomHistory.update(F,q);const te=new e.a9(F,{now:q,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),ue=te.crossFadingFactor();ue===1&&ue===this._crossFadingFactor||(a=!0,this._crossFadingFactor=ue),this.style.update(te)}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,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.be.mark(e.bf.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const C=this._sourcesDirty||this._styleDirty||this._placementDirty;return C||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||C||(this._fullyLoaded=!0,e.be.mark(e.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var R;this._hash&&this._hash.remove();for(const a of this._controls)a.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),x.removeThrottleControl(this._imageQueueHandle),(R=this._resizeObserver)===null||R===void 0||R.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");i!=null&&i.loseContext&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),r.remove(this._canvasContainer),r.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.be.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(R=>{e.be.frame(R),this._frameRequest=null,this._render(R)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(R){this._showTileBoundaries!==R&&(this._showTileBoundaries=R,this._update())}get showPadding(){return!!this._showPadding}set showPadding(R){this._showPadding!==R&&(this._showPadding=R,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(R){this._showCollisionBoxes!==R&&(this._showCollisionBoxes=R,R?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(R){this._showOverdrawInspector!==R&&(this._showOverdrawInspector=R,this._update())}get repaint(){return!!this._repaint}set repaint(R){this._repaint!==R&&(this._repaint=R,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(R){this._vertices=R,this._update()}get version(){return $s}getCameraTargetElevation(){return this.transform.elevation}},d.MapMouseEvent=us,d.MapTouchEvent=No,d.MapWheelEvent=Wl,d.Marker=ho,d.NavigationControl=class{constructor(R){this._updateZoomButtons=()=>{const i=this._map.getZoom(),a=i===this._map.getMaxZoom(),C=i===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=C,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",C.toString())},this._rotateCompassArrow=()=>{const i=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=i},this._setButtonTitle=(i,a)=>{const C=this._map._getUIString(`NavigationControl.${a}`);i.title=C,i.setAttribute("aria-label",C)},this.options=e.e({},Cl,R),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",i=>this._map.zoomIn({},{originalEvent:i})),r.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",i=>this._map.zoomOut({},{originalEvent:i})),r.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",i=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:i}):this._map.resetNorth({},{originalEvent:i})}),this._compassIcon=r.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(R){return this._map=R,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 di(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){r.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(R,i){const a=r.create("button",R,this._container);return a.type="button",a.addEventListener("click",i),a}},d.Popup=kt,d.RasterDEMTileSource=We,d.RasterTileSource=Oe,d.ScaleControl=class{constructor(R){this._onMove=()=>{xa(this._map,this._container,this.options)},this.setUnit=i=>{this.options.unit=i,xa(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},xi),R)}getDefaultPosition(){return"bottom-left"}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale",R.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},d.ScrollZoomHandler=al,d.Style=ni,d.TerrainControl=class{constructor(R){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=R}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=r.create("button","maplibregl-ctrl-terrain",this._container),r.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(){r.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},d.TwoFingersTouchPitchHandler=il,d.TwoFingersTouchRotateHandler=Ac,d.TwoFingersTouchZoomHandler=Mi,d.TwoFingersTouchZoomRotateHandler=au,d.VectorTileSource=Le,d.VideoSource=de,d.addSourceType=(R,i)=>e._(void 0,void 0,void 0,function*(){if(He(R))throw new Error(`A source type called "${R}" already exists.`);((a,C)=>{ke[a]=C})(R,i)}),d.clearPrewarmedResources=function(){const R=fe;R&&(R.isPreloaded()&&R.numActive()===1?(R.release(ae),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()"))},d.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},d.getRTLTextPluginStatus=function(){return Ye().getRTLTextPluginStatus()},d.getVersion=function(){return X},d.getWorkerCount=function(){return se.workerCount},d.getWorkerUrl=function(){return e.a.WORKER_URL},d.importScriptInWorkers=function(R){return ge().broadcast("IS",R)},d.prewarm=function(){oe().acquire(ae)},d.setMaxParallelImageRequests=function(R){e.a.MAX_PARALLEL_IMAGE_REQUESTS=R},d.setRTLTextPlugin=function(R,i){return Ye().setRTLTextPlugin(R,i)},d.setWorkerCount=function(R){se.workerCount=R},d.setWorkerUrl=function(R){e.a.WORKER_URL=R}}),L}()},88640:function(D,L,t){function b(be,Se,Ee){be.prototype=Se.prototype=Ee,Ee.constructor=be}function d(be,Se){var Ee=Object.create(be.prototype);for(var Ce in Se)Ee[Ce]=Se[Ce];return Ee}function e(){}t.d(L,{GW:function(){return me},Dj:function(){return se}});var w=.7,y=1/w,_="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",n=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\(".concat(_,",").concat(_,",").concat(_,"\\)$")),o=new RegExp("^rgb\\(".concat(r,",").concat(r,",").concat(r,"\\)$")),s=new RegExp("^rgba\\(".concat(_,",").concat(_,",").concat(_,",").concat(u,"\\)$")),c=new RegExp("^rgba\\(".concat(r,",").concat(r,",").concat(r,",").concat(u,"\\)$")),h=new RegExp("^hsl\\(".concat(u,",").concat(r,",").concat(r,"\\)$")),x=new RegExp("^hsla\\(".concat(u,",").concat(r,",").concat(r,",").concat(u,"\\)$")),m={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};function g(){return this.rgb().formatHex()}function k(){return this.rgb().formatRgb()}function A(be){var Se,Ee;return be=(be+"").trim().toLowerCase(),(Se=n.exec(be))?(Ee=Se[1].length,Se=parseInt(Se[1],16),Ee===6?v(Se):Ee===3?new p(Se>>8&15|Se>>4&240,Se>>4&15|240&Se,(15&Se)<<4|15&Se,1):Ee===8?S(Se>>24&255,Se>>16&255,Se>>8&255,(255&Se)/255):Ee===4?S(Se>>12&15|Se>>8&240,Se>>8&15|Se>>4&240,Se>>4&15|240&Se,((15&Se)<<4|15&Se)/255):null):(Se=l.exec(be))?new p(Se[1],Se[2],Se[3],1):(Se=o.exec(be))?new p(255*Se[1]/100,255*Se[2]/100,255*Se[3]/100,1):(Se=s.exec(be))?S(Se[1],Se[2],Se[3],Se[4]):(Se=c.exec(be))?S(255*Se[1]/100,255*Se[2]/100,255*Se[3]/100,Se[4]):(Se=h.exec(be))?N(Se[1],Se[2]/100,Se[3]/100,1):(Se=x.exec(be))?N(Se[1],Se[2]/100,Se[3]/100,Se[4]):m.hasOwnProperty(be)?v(m[be]):be==="transparent"?new p(NaN,NaN,NaN,0):null}function v(be){return new p(be>>16&255,be>>8&255,255&be,1)}function S(be,Se,Ee,Ce){return Ce<=0&&(be=Se=Ee=NaN),new p(be,Se,Ee,Ce)}function T(be,Se,Ee,Ce){return arguments.length===1?((Le=be)instanceof e||(Le=A(Le)),Le?new p((Le=Le.rgb()).r,Le.g,Le.b,Le.opacity):new p):new p(be,Se,Ee,Ce??1);var Le}function p(be,Se,Ee,Ce){this.r=+be,this.g=+Se,this.b=+Ee,this.opacity=+Ce}function M(){return"#".concat(B(this.r)).concat(B(this.g)).concat(B(this.b))}function f(){var be=E(this.opacity);return"".concat(be===1?"rgb(":"rgba(").concat(I(this.r),", ").concat(I(this.g),", ").concat(I(this.b)).concat(be===1?")":", ".concat(be,")"))}function E(be){return isNaN(be)?1:Math.max(0,Math.min(1,be))}function I(be){return Math.max(0,Math.min(255,Math.round(be)||0))}function B(be){return((be=I(be))<16?"0":"")+be.toString(16)}function N(be,Se,Ee,Ce){return Ce<=0?be=Se=Ee=NaN:Ee<=0||Ee>=1?be=Se=NaN:Se<=0&&(be=NaN),new j(be,Se,Ee,Ce)}function V(be){if(be instanceof j)return new j(be.h,be.s,be.l,be.opacity);if(be instanceof e||(be=A(be)),!be)return new j;if(be instanceof j)return be;var Se=(be=be.rgb()).r/255,Ee=be.g/255,Ce=be.b/255,Le=Math.min(Se,Ee,Ce),Oe=Math.max(Se,Ee,Ce),We=NaN,Ie=Oe-Le,Ve=(Oe+Le)/2;return Ie?(We=Se===Oe?(Ee-Ce)/Ie+6*(Ee0&&Ve<1?0:We,new j(We,Ie,Ve,be.opacity)}function j(be,Se,Ee,Ce){this.h=+be,this.s=+Se,this.l=+Ee,this.opacity=+Ce}function $(be){return(be=(be||0)%360)<0?be+360:be}function ee(be){return Math.max(0,Math.min(1,be||0))}function H(be,Se,Ee){return 255*(be<60?Se+(Ee-Se)*be/60:be<180?Ee:be<240?Se+(Ee-Se)*(240-be)/60:Se)}b(e,A,{copy:function(be){return Object.assign(new this.constructor,this,be)},displayable:function(){return this.rgb().displayable()},hex:g,formatHex:g,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return V(this).formatHsl()},formatRgb:k,toString:k}),b(p,T,d(e,{brighter:function(be){return be=be==null?y:Math.pow(y,be),new p(this.r*be,this.g*be,this.b*be,this.opacity)},darker:function(be){return be=be==null?w:Math.pow(w,be),new p(this.r*be,this.g*be,this.b*be,this.opacity)},rgb:function(){return this},clamp:function(){return new p(I(this.r),I(this.g),I(this.b),E(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:M,formatHex:M,formatHex8:function(){return"#".concat(B(this.r)).concat(B(this.g)).concat(B(this.b)).concat(B(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:f,toString:f})),b(j,function(be,Se,Ee,Ce){return arguments.length===1?V(be):new j(be,Se,Ee,Ce??1)},d(e,{brighter:function(be){return be=be==null?y:Math.pow(y,be),new j(this.h,this.s,this.l*be,this.opacity)},darker:function(be){return be=be==null?w:Math.pow(w,be),new j(this.h,this.s,this.l*be,this.opacity)},rgb:function(){var be=this.h%360+360*(this.h<0),Se=isNaN(be)||isNaN(this.s)?0:this.s,Ee=this.l,Ce=Ee+(Ee<.5?Ee:1-Ee)*Se,Le=2*Ee-Ce;return new p(H(be>=240?be-240:be+120,Le,Ce),H(be,Le,Ce),H(be<120?be+240:be-120,Le,Ce),this.opacity)},clamp:function(){return new j($(this.h),ee(this.s),ee(this.l),E(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var be=E(this.opacity);return"".concat(be===1?"hsl(":"hsla(").concat($(this.h),", ").concat(100*ee(this.s),"%, ").concat(100*ee(this.l),"%").concat(be===1?")":", ".concat(be,")"))}}));var J=function(be){return function(){return be}};function Q(be,Se){var Ee=Se-be;return Ee?function(Ce,Le){return function(Oe){return Ce+Oe*Le}}(be,Ee):J(isNaN(be)?Se:be)}var Z=function be(Se){var Ee=function(Le){return(Le=+Le)==1?Q:function(Oe,We){return We-Oe?function(Ie,Ve,Pe){return Ie=Math.pow(Ie,Pe),Ve=Math.pow(Ve,Pe)-Ie,Pe=1/Pe,function(de){return Math.pow(Ie+de*Ve,Pe)}}(Oe,We,Le):J(isNaN(Oe)?We:Oe)}}(Se);function Ce(Le,Oe){var We=Ee((Le=T(Le)).r,(Oe=T(Oe)).r),Ie=Ee(Le.g,Oe.g),Ve=Ee(Le.b,Oe.b),Pe=Q(Le.opacity,Oe.opacity);return function(de){return Le.r=We(de),Le.g=Ie(de),Le.b=Ve(de),Le.opacity=Pe(de),Le+""}}return Ce.gamma=be,Ce}(1);function K(be,Se){var Ee,Ce=Se?Se.length:0,Le=be?Math.min(Ce,be.length):0,Oe=new Array(Le),We=new Array(Ce);for(Ee=0;EeOe&&(Le=Se.slice(Oe,Le),Ie[We]?Ie[We]+=Le:Ie[++We]=Le),(Ee=Ee[0])===(Ce=Ce[0])?Ie[We]?Ie[We]+=Ce:Ie[++We]=Ce:(Ie[++We]=null,Ve.push({i:We,x:se(Ee,Ce)})),Oe=oe.lastIndex;return OeESRI"},"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,0.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,0.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,0.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,0.8],[20,4]]},"line-opacity":0.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,0.9],[10,0.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":[0.5,0.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,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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":[0.5,0.25],"line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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,0.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":0.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,0.6]]},"line-width":{"base":1.2,"stops":[[7,0],[8,0.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,0.5]]},"line-width":{"base":1.2,"stops":[[5,0],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":{"stops":[[4,0],[5,0.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,0.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":0.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,0.5],[20,13]]},"line-opacity":0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.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":[0.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,0.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":[0.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,0.4],[15,0.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":[0.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,0.4],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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":[0.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,0.4],[5,1],[12,3]]},"line-opacity":0.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,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,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,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":0.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":0.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":0.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":0.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,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.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,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.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,0.6],"text-size":11,"text-max-width":9},"paint":{"text-halo-blur":0.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,0.6],"text-size":12,"text-max-width":9,"icon-optional":false,"icon-ignore-placement":false,"icon-allow-overlap":false,"text-ignore-placement":false,"text-allow-overlap":false,"text-optional":true},"paint":{"text-halo-blur":0.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,0.5],[19,1]]}},"paint":{"icon-opacity":0.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,0.5],[19,1]]}},"paint":{"icon-opacity":0.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":0.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":0.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":0.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":0.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":0.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":[0.4,0],"icon-size":0.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"}`)},51962:function(D){D.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.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"}}]}`)}},ce={};function Te(D){var L=ce[D];if(L!==void 0)return L.exports;var t=ce[D]={id:D,exports:{}};return W[D].call(t.exports,t,t.exports,Te),t.exports}return Te.m=W,Te.n=function(D){var L=D&&D.__esModule?function(){return D.default}:function(){return D};return Te.d(L,{a:L}),L},Te.d=function(D,L){for(var t in L)Te.o(L,t)&&!Te.o(D,t)&&Object.defineProperty(D,t,{enumerable:!0,get:L[t]})},Te.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Te.o=function(D,L){return Object.prototype.hasOwnProperty.call(D,L)},Te.r=function(D){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})},Te.b=document.baseURI||self.location.href,Te.nc=void 0,Te(20260)}()})})(m8);var bf=m8.exports;const O9=Xx(bf),D9=Y4({__proto__:null,default:O9},[bf]);var y8={},x8={exports:{}},R9="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",F9=R9,B9=F9;function _8(){}function b8(){}b8.resetWarningCache=_8;var N9=function(){function O(ce,Te,D,L,t,b){if(b!==B9){var d=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 d.name="Invariant Violation",d}}O.isRequired=O;function z(){return O}var W={array:O,bigint:O,bool:O,func:O,number:O,object:O,string:O,symbol:O,any:O,arrayOf:z,element:O,elementType:O,instanceOf:z,node:O,objectOf:z,oneOf:z,oneOfType:z,shape:z,exact:z,checkPropTypes:b8,resetWarningCache:_8};return W.PropTypes=W,W};x8.exports=N9();var j9=x8.exports;(function(O){function z(h){"@babel/helpers - typeof";return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},z(h)}Object.defineProperty(O,"__esModule",{value:!0}),O.default=c;var W=L(mr),ce=Te(j9);function Te(h){return h&&h.__esModule?h:{default:h}}function D(h){if(typeof WeakMap!="function")return null;var x=new WeakMap,m=new WeakMap;return(D=function(k){return k?m:x})(h)}function L(h,x){if(!x&&h&&h.__esModule)return h;if(h===null||z(h)!=="object"&&typeof h!="function")return{default:h};var m=D(x);if(m&&m.has(h))return m.get(h);var g={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in h)if(A!=="default"&&Object.prototype.hasOwnProperty.call(h,A)){var v=k?Object.getOwnPropertyDescriptor(h,A):null;v&&(v.get||v.set)?Object.defineProperty(g,A,v):g[A]=h[A]}return g.default=h,m&&m.set(h,g),g}function t(h,x){if(!(h instanceof x))throw new TypeError("Cannot call a class as a function")}function b(h,x){for(var m=0;m"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function n(h){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(m){return m.__proto__||Object.getPrototypeOf(m)},n(h)}var l=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],o=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],s=typeof window<"u";function c(h){var x=function(m){e(k,m);var g=y(k);function k(A){var v;return t(this,k),v=g.call(this,A),v.p=Promise.resolve(),v.resizeHandler=null,v.handlers={},v.syncWindowResize=v.syncWindowResize.bind(u(v)),v.syncEventHandlers=v.syncEventHandlers.bind(u(v)),v.attachUpdateEvents=v.attachUpdateEvents.bind(u(v)),v.getRef=v.getRef.bind(u(v)),v.handleUpdate=v.handleUpdate.bind(u(v)),v.figureCallback=v.figureCallback.bind(u(v)),v.updatePlotly=v.updatePlotly.bind(u(v)),v}return d(k,[{key:"updatePlotly",value:function(v,S,T){var p=this;this.p=this.p.then(function(){if(!p.unmounting){if(!p.el)throw new Error("Missing element reference");return h.react(p.el,{data:p.props.data,layout:p.props.layout,config:p.props.config,frames:p.props.frames})}}).then(function(){p.unmounting||(p.syncWindowResize(v),p.syncEventHandlers(),p.figureCallback(S),T&&p.attachUpdateEvents())}).catch(function(M){p.props.onError&&p.props.onError(M)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(v){this.unmounting=!1;var S=v.frames&&v.frames.length?v.frames.length:0,T=this.props.frames&&this.props.frames.length?this.props.frames.length:0,p=!(v.layout===this.props.layout&&v.data===this.props.data&&v.config===this.props.config&&T===S),M=v.revision!==void 0,f=v.revision!==this.props.revision;!p&&(!M||M&&!f)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&s&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),h.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var v=this;!this.el||!this.el.removeListener||o.forEach(function(S){v.el.on(S,v.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var v=this;!this.el||!this.el.removeListener||o.forEach(function(S){v.el.removeListener(S,v.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(v){if(typeof v=="function"){var S=this.el,T=S.data,p=S.layout,M=this.el._transitionData?this.el._transitionData._frames:null,f={data:T,layout:p,frames:M};v(f,this.el)}}},{key:"syncWindowResize",value:function(v){var S=this;s&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return h.Plots.resize(S.el)},window.addEventListener("resize",this.resizeHandler),v&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(v){this.el=v,this.props.debug&&s&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var v=this;l.forEach(function(S){var T=v.props["on"+S],p=v.handlers[S],M=!!p;T&&!M?v.addEventHandler(S,T):!T&&M?v.removeEventHandler(S):T&&M&&T!==p&&(v.removeEventHandler(S),v.addEventHandler(S,T))})}},{key:"addEventHandler",value:function(v,S){this.handlers[v]=S,this.el.on(this.getPlotlyEventName(v),this.handlers[v])}},{key:"removeEventHandler",value:function(v){this.el.removeListener(this.getPlotlyEventName(v),this.handlers[v]),delete this.handlers[v]}},{key:"getPlotlyEventName",value:function(v){return"plotly_"+v.toLowerCase()}},{key:"render",value:function(){return W.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),k}(W.Component);return x.propTypes={data:ce.default.arrayOf(ce.default.object),config:ce.default.object,layout:ce.default.object,frames:ce.default.arrayOf(ce.default.object),revision:ce.default.number,onInitialized:ce.default.func,onPurge:ce.default.func,onError:ce.default.func,onUpdate:ce.default.func,debug:ce.default.bool,style:ce.default.object,className:ce.default.string,useResizeHandler:ce.default.bool,divId:ce.default.string},l.forEach(function(m){x.propTypes["on"+m]=ce.default.func}),x.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},x}})(y8);const U9=Xx(y8);function V9({plotData:O,popup_data:z,current_text:W}){var b;const ce=z.x;let Te=z.y;const D=z.yref,L=((b=O==null?void 0:O.layout)==null?void 0:b.annotations)||[];let t=-1;for(let d=0;dv!==void 0)),O.layout.dragmode="pan",W({...O,...c.update}),e.removeAllListeners("plotly_click")};z.text=z.text.replace(/\n/g,"
");let y,_=!1;if(z.annotation){console.log("data",z),y={x:z.annotation.x,y:z.annotation.y,yref:z.annotation.yref,yanchor:z.annotation.yn.x===z.annotation.x&&n.y===z.annotation.y&&n.yref===z.annotation.yref);console.log("ohlcAnnotationIndex",r),r===-1?b([...t,u.annotation]):(t[r]=u.annotation,b(t))}D([...d,u.annotation].filter(r=>r!==void 0)),O.layout.dragmode="pan",W({...O,...u.update}),Te({});return}e.on("plotly_clickannotation",u=>{console.log("plotly_clickannotation",u);const r=u.annotation;if(r.text===void 0){console.log("annotation.text is undefined");return}console.log("annotation.text",r.text),r.text=r.text.replace(/
/g,` +`),Ut=Ct.concat(Ar.prelude.vertexSource,a.vertexSource).join(` +`),It=ue.createShader(ue.FRAGMENT_SHADER);if(ue.isContextLost())return void(this.failedToCreate=!0);if(ue.shaderSource(It,Mt),ue.compileShader(It),!ue.getShaderParameter(It,ue.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${ue.getShaderInfoLog(It)}`);ue.attachShader(this.program,It);const Qt=ue.createShader(ue.VERTEX_SHADER);if(ue.isContextLost())return void(this.failedToCreate=!0);if(ue.shaderSource(Qt,Ut),ue.compileShader(Qt),!ue.getShaderParameter(Qt,ue.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${ue.getShaderInfoLog(Qt)}`);ue.attachShader(this.program,Qt),this.attributes={};const tn={};this.numAttributes=Re.length;for(let Yt=0;Yt({u_depth:new e.aI(Yt,vn.u_depth),u_terrain:new e.aI(Yt,vn.u_terrain),u_terrain_dim:new e.aJ(Yt,vn.u_terrain_dim),u_terrain_matrix:new e.aK(Yt,vn.u_terrain_matrix),u_terrain_unpack:new e.aL(Yt,vn.u_terrain_unpack),u_terrain_exaggeration:new e.aJ(Yt,vn.u_terrain_exaggeration)}))(i,tn),this.binderUniforms=C?C.getUniforms(i,tn):[]}draw(i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt,bt,Ct,Mt,Ut){const It=i.gl;if(this.failedToCreate)return;if(i.program.set(this.program),i.setDepthMode(C),i.setStencilMode(F),i.setColorMode(q),i.setCullFace(te),ve){i.activeTexture.set(It.TEXTURE2),It.bindTexture(It.TEXTURE_2D,ve.depthTexture),i.activeTexture.set(It.TEXTURE3),It.bindTexture(It.TEXTURE_2D,ve.texture);for(const tn in this.terrainUniforms)this.terrainUniforms[tn].set(ve[tn])}for(const tn in this.fixedUniforms)this.fixedUniforms[tn].set(ue[tn]);bt&&bt.setUniforms(i,this.binderUniforms,ct,{zoom:dt});let Qt=0;switch(a){case It.LINES:Qt=2;break;case It.TRIANGLES:Qt=3;break;case It.LINE_STRIP:Qt=1}for(const tn of it.get()){const Yt=tn.vaos||(tn.vaos={});(Yt[Ae]||(Yt[Ae]=new Qr)).bind(i,this,Re,bt?bt.getPaintVertexBuffers():[],Ue,tn.vertexOffset,Ct,Mt,Ut),It.drawElements(a,tn.primitiveLength*Qt,It.UNSIGNED_SHORT,tn.primitiveOffset*Qt*2)}}}function Zn(R,i,a){const C=1/Et(a,1,i.transform.tileZoom),F=Math.pow(2,a.tileID.overscaledZ),q=a.tileSize*Math.pow(2,i.transform.tileZoom)/F,te=q*(a.tileID.canonical.x+a.tileID.wrap*F),ue=q*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[C,R.fromScale,R.toScale],u_fade:R.t,u_pixel_coord_upper:[te>>16,ue>>16],u_pixel_coord_lower:[65535&te,65535&ue]}}const cr=(R,i,a,C)=>{const F=i.style.light,q=F.properties.get("position"),te=[q.x,q.y,q.z],ue=function(){var Ae=new e.A(9);return e.A!=Float32Array&&(Ae[1]=0,Ae[2]=0,Ae[3]=0,Ae[5]=0,Ae[6]=0,Ae[7]=0),Ae[0]=1,Ae[4]=1,Ae[8]=1,Ae}();F.properties.get("anchor")==="viewport"&&function(Ae,Re){var Ue=Math.sin(Re),it=Math.cos(Re);Ae[0]=it,Ae[1]=Ue,Ae[2]=0,Ae[3]=-Ue,Ae[4]=it,Ae[5]=0,Ae[6]=0,Ae[7]=0,Ae[8]=1}(ue,-i.transform.angle),function(Ae,Re,Ue){var it=Re[0],ct=Re[1],dt=Re[2];Ae[0]=it*Ue[0]+ct*Ue[3]+dt*Ue[6],Ae[1]=it*Ue[1]+ct*Ue[4]+dt*Ue[7],Ae[2]=it*Ue[2]+ct*Ue[5]+dt*Ue[8]}(te,te,ue);const ve=F.properties.get("color");return{u_matrix:R,u_lightpos:te,u_lightintensity:F.properties.get("intensity"),u_lightcolor:[ve.r,ve.g,ve.b],u_vertical_gradient:+a,u_opacity:C}},Ir=(R,i,a,C,F,q,te)=>e.e(cr(R,i,a,C),Zn(q,i,te),{u_height_factor:-Math.pow(2,F.overscaledZ)/te.tileSize/8}),Er=R=>({u_matrix:R}),Xr=(R,i,a,C)=>e.e(Er(R),Zn(a,i,C)),ai=(R,i)=>({u_matrix:R,u_world:i}),bn=(R,i,a,C,F)=>e.e(Xr(R,i,a,C),{u_world:F}),Yn=(R,i,a,C)=>{const F=R.transform;let q,te;if(C.paint.get("circle-pitch-alignment")==="map"){const ue=Et(a,1,F.zoom);q=!0,te=[ue,ue]}else q=!1,te=F.pixelsToGLUnits;return{u_camera_to_center_distance:F.cameraToCenterDistance,u_scale_with_map:+(C.paint.get("circle-pitch-scale")==="map"),u_matrix:R.translatePosMatrix(i.posMatrix,a,C.paint.get("circle-translate"),C.paint.get("circle-translate-anchor")),u_pitch_with_map:+q,u_device_pixel_ratio:R.pixelRatio,u_extrude_scale:te}},an=(R,i)=>({u_matrix:i,u_pixel_extrude_scale:[1/R.width,1/R.height]}),_n=(R,i,a)=>({u_matrix:R,u_inv_matrix:i,u_camera_to_center_distance:a.cameraToCenterDistance,u_viewport_size:[a.width,a.height]}),gn=(R,i,a=1)=>({u_matrix:R,u_color:i,u_overlay:0,u_overlay_scale:a}),qn=R=>({u_matrix:R}),Un=(R,i,a,C)=>({u_matrix:R,u_extrude_scale:Et(i,1,a),u_intensity:C}),tr=(R,i,a,C)=>{const F=e.H();e.aQ(F,0,R.width,R.height,0,0,1);const q=R.context.gl;return{u_matrix:F,u_world:[q.drawingBufferWidth,q.drawingBufferHeight],u_image:a,u_color_ramp:C,u_opacity:i.paint.get("heatmap-opacity")}},Wn=(R,i,a,C)=>{const F=a.paint.get("hillshade-shadow-color"),q=a.paint.get("hillshade-highlight-color"),te=a.paint.get("hillshade-accent-color");let ue=a.paint.get("hillshade-illumination-direction")*(Math.PI/180);a.paint.get("hillshade-illumination-anchor")==="viewport"&&(ue-=R.transform.angle);const ve=!R.options.moving;return{u_matrix:C?C.posMatrix:R.transform.calculatePosMatrix(i.tileID.toUnwrapped(),ve),u_image:0,u_latrange:dn(0,i.tileID),u_light:[a.paint.get("hillshade-exaggeration"),ue],u_shadow:F,u_highlight:q,u_accent:te}},Bn=(R,i)=>{const a=i.stride,C=e.H();return e.aQ(C,0,e.X,-e.X,0,0,1),e.J(C,C,[0,-e.X,0]),{u_matrix:C,u_image:1,u_dimension:[a,a],u_zoom:R.overscaledZ,u_unpack:i.getUnpackVector()}};function dn(R,i){const a=Math.pow(2,i.canonical.z),C=i.canonical.y;return[new e.Z(0,C/a).toLngLat().lat,new e.Z(0,(C+1)/a).toLngLat().lat]}const ln=(R,i,a,C)=>{const F=R.transform;return{u_matrix:yr(R,i,a,C),u_ratio:1/Et(i,1,F.zoom),u_device_pixel_ratio:R.pixelRatio,u_units_to_pixels:[1/F.pixelsToGLUnits[0],1/F.pixelsToGLUnits[1]]}},An=(R,i,a,C,F)=>e.e(ln(R,i,a,F),{u_image:0,u_image_height:C}),er=(R,i,a,C,F)=>{const q=R.transform,te=Tr(i,q);return{u_matrix:yr(R,i,a,F),u_texsize:i.imageAtlasTexture.size,u_ratio:1/Et(i,1,q.zoom),u_device_pixel_ratio:R.pixelRatio,u_image:0,u_scale:[te,C.fromScale,C.toScale],u_fade:C.t,u_units_to_pixels:[1/q.pixelsToGLUnits[0],1/q.pixelsToGLUnits[1]]}},br=(R,i,a,C,F,q)=>{const te=R.transform,ue=R.lineAtlas,ve=Tr(i,te),Ae=a.layout.get("line-cap")==="round",Re=ue.getDash(C.from,Ae),Ue=ue.getDash(C.to,Ae),it=Re.width*F.fromScale,ct=Ue.width*F.toScale;return e.e(ln(R,i,a,q),{u_patternscale_a:[ve/it,-Re.height/2],u_patternscale_b:[ve/ct,-Ue.height/2],u_sdfgamma:ue.width/(256*Math.min(it,ct)*R.pixelRatio)/2,u_image:0,u_tex_y_a:Re.y,u_tex_y_b:Ue.y,u_mix:F.t})};function Tr(R,i){return 1/Et(R,1,i.tileZoom)}function yr(R,i,a,C){return R.translatePosMatrix(C?C.posMatrix:i.tileID.posMatrix,i,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}const Ur=(R,i,a,C,F)=>{return{u_matrix:R,u_tl_parent:i,u_scale_parent:a,u_buffer_scale:1,u_fade_t:C.mix,u_opacity:C.opacity*F.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:F.paint.get("raster-brightness-min"),u_brightness_high:F.paint.get("raster-brightness-max"),u_saturation_factor:(te=F.paint.get("raster-saturation"),te>0?1-1/(1.001-te):-te),u_contrast_factor:(q=F.paint.get("raster-contrast"),q>0?1/(1-q):1+q),u_spin_weights:Rr(F.paint.get("raster-hue-rotate"))};var q,te};function Rr(R){R*=Math.PI/180;const i=Math.sin(R),a=Math.cos(R);return[(2*a+1)/3,(-Math.sqrt(3)*i-a+1)/3,(Math.sqrt(3)*i-a+1)/3]}const $r=(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct)=>{const dt=te.transform;return{u_is_size_zoom_constant:+(R==="constant"||R==="source"),u_is_size_feature_constant:+(R==="constant"||R==="camera"),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:dt.cameraToCenterDistance,u_pitch:dt.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:dt.width/dt.height,u_fade_change:te.options.fadeDuration?te.symbolFadeChange:1,u_matrix:ue,u_label_plane_matrix:ve,u_coord_matrix:Ae,u_is_text:+Ue,u_pitch_with_map:+C,u_is_along_line:F,u_is_variable_anchor:q,u_texsize:it,u_texture:0,u_translation:Re,u_pitched_scale:ct}},Pr=(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct,dt)=>{const bt=te.transform;return e.e($r(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,dt),{u_gamma_scale:C?Math.cos(bt._pitch)*bt.cameraToCenterDistance:1,u_device_pixel_ratio:te.pixelRatio,u_is_halo:+ct})},Cr=(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct)=>e.e(Pr(R,i,a,C,F,q,te,ue,ve,Ae,Re,!0,Ue,!0,ct),{u_texsize_icon:it,u_texture_icon:1}),Jr=(R,i,a)=>({u_matrix:R,u_opacity:i,u_color:a}),gi=(R,i,a,C,F,q)=>e.e(function(te,ue,ve,Ae){const Re=ve.imageManager.getPattern(te.from.toString()),Ue=ve.imageManager.getPattern(te.to.toString()),{width:it,height:ct}=ve.imageManager.getPixelSize(),dt=Math.pow(2,Ae.tileID.overscaledZ),bt=Ae.tileSize*Math.pow(2,ve.transform.tileZoom)/dt,Ct=bt*(Ae.tileID.canonical.x+Ae.tileID.wrap*dt),Mt=bt*Ae.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Re.tl,u_pattern_br_a:Re.br,u_pattern_tl_b:Ue.tl,u_pattern_br_b:Ue.br,u_texsize:[it,ct],u_mix:ue.t,u_pattern_size_a:Re.displaySize,u_pattern_size_b:Ue.displaySize,u_scale_a:ue.fromScale,u_scale_b:ue.toScale,u_tile_units_to_pixels:1/Et(Ae,1,ve.transform.tileZoom),u_pixel_coord_upper:[Ct>>16,Mt>>16],u_pixel_coord_lower:[65535&Ct,65535&Mt]}}(C,q,a,F),{u_matrix:R,u_opacity:i}),ii={fillExtrusion:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_lightpos:new e.aO(R,i.u_lightpos),u_lightintensity:new e.aJ(R,i.u_lightintensity),u_lightcolor:new e.aO(R,i.u_lightcolor),u_vertical_gradient:new e.aJ(R,i.u_vertical_gradient),u_opacity:new e.aJ(R,i.u_opacity)}),fillExtrusionPattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_lightpos:new e.aO(R,i.u_lightpos),u_lightintensity:new e.aJ(R,i.u_lightintensity),u_lightcolor:new e.aO(R,i.u_lightcolor),u_vertical_gradient:new e.aJ(R,i.u_vertical_gradient),u_height_factor:new e.aJ(R,i.u_height_factor),u_image:new e.aI(R,i.u_image),u_texsize:new e.aP(R,i.u_texsize),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade),u_opacity:new e.aJ(R,i.u_opacity)}),fill:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix)}),fillPattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_image:new e.aI(R,i.u_image),u_texsize:new e.aP(R,i.u_texsize),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade)}),fillOutline:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_world:new e.aP(R,i.u_world)}),fillOutlinePattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_world:new e.aP(R,i.u_world),u_image:new e.aI(R,i.u_image),u_texsize:new e.aP(R,i.u_texsize),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade)}),circle:(R,i)=>({u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_scale_with_map:new e.aI(R,i.u_scale_with_map),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_extrude_scale:new e.aP(R,i.u_extrude_scale),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_matrix:new e.aK(R,i.u_matrix)}),collisionBox:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_pixel_extrude_scale:new e.aP(R,i.u_pixel_extrude_scale)}),collisionCircle:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_inv_matrix:new e.aK(R,i.u_inv_matrix),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_viewport_size:new e.aP(R,i.u_viewport_size)}),debug:(R,i)=>({u_color:new e.aM(R,i.u_color),u_matrix:new e.aK(R,i.u_matrix),u_overlay:new e.aI(R,i.u_overlay),u_overlay_scale:new e.aJ(R,i.u_overlay_scale)}),clippingMask:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix)}),heatmap:(R,i)=>({u_extrude_scale:new e.aJ(R,i.u_extrude_scale),u_intensity:new e.aJ(R,i.u_intensity),u_matrix:new e.aK(R,i.u_matrix)}),heatmapTexture:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_world:new e.aP(R,i.u_world),u_image:new e.aI(R,i.u_image),u_color_ramp:new e.aI(R,i.u_color_ramp),u_opacity:new e.aJ(R,i.u_opacity)}),hillshade:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_image:new e.aI(R,i.u_image),u_latrange:new e.aP(R,i.u_latrange),u_light:new e.aP(R,i.u_light),u_shadow:new e.aM(R,i.u_shadow),u_highlight:new e.aM(R,i.u_highlight),u_accent:new e.aM(R,i.u_accent)}),hillshadePrepare:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_image:new e.aI(R,i.u_image),u_dimension:new e.aP(R,i.u_dimension),u_zoom:new e.aJ(R,i.u_zoom),u_unpack:new e.aL(R,i.u_unpack)}),line:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels)}),lineGradient:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels),u_image:new e.aI(R,i.u_image),u_image_height:new e.aJ(R,i.u_image_height)}),linePattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_texsize:new e.aP(R,i.u_texsize),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_image:new e.aI(R,i.u_image),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels),u_scale:new e.aO(R,i.u_scale),u_fade:new e.aJ(R,i.u_fade)}),lineSDF:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ratio:new e.aJ(R,i.u_ratio),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_units_to_pixels:new e.aP(R,i.u_units_to_pixels),u_patternscale_a:new e.aP(R,i.u_patternscale_a),u_patternscale_b:new e.aP(R,i.u_patternscale_b),u_sdfgamma:new e.aJ(R,i.u_sdfgamma),u_image:new e.aI(R,i.u_image),u_tex_y_a:new e.aJ(R,i.u_tex_y_a),u_tex_y_b:new e.aJ(R,i.u_tex_y_b),u_mix:new e.aJ(R,i.u_mix)}),raster:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_tl_parent:new e.aP(R,i.u_tl_parent),u_scale_parent:new e.aJ(R,i.u_scale_parent),u_buffer_scale:new e.aJ(R,i.u_buffer_scale),u_fade_t:new e.aJ(R,i.u_fade_t),u_opacity:new e.aJ(R,i.u_opacity),u_image0:new e.aI(R,i.u_image0),u_image1:new e.aI(R,i.u_image1),u_brightness_low:new e.aJ(R,i.u_brightness_low),u_brightness_high:new e.aJ(R,i.u_brightness_high),u_saturation_factor:new e.aJ(R,i.u_saturation_factor),u_contrast_factor:new e.aJ(R,i.u_contrast_factor),u_spin_weights:new e.aO(R,i.u_spin_weights)}),symbolIcon:(R,i)=>({u_is_size_zoom_constant:new e.aI(R,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aI(R,i.u_is_size_feature_constant),u_size_t:new e.aJ(R,i.u_size_t),u_size:new e.aJ(R,i.u_size),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_pitch:new e.aJ(R,i.u_pitch),u_rotate_symbol:new e.aI(R,i.u_rotate_symbol),u_aspect_ratio:new e.aJ(R,i.u_aspect_ratio),u_fade_change:new e.aJ(R,i.u_fade_change),u_matrix:new e.aK(R,i.u_matrix),u_label_plane_matrix:new e.aK(R,i.u_label_plane_matrix),u_coord_matrix:new e.aK(R,i.u_coord_matrix),u_is_text:new e.aI(R,i.u_is_text),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_is_along_line:new e.aI(R,i.u_is_along_line),u_is_variable_anchor:new e.aI(R,i.u_is_variable_anchor),u_texsize:new e.aP(R,i.u_texsize),u_texture:new e.aI(R,i.u_texture),u_translation:new e.aP(R,i.u_translation),u_pitched_scale:new e.aJ(R,i.u_pitched_scale)}),symbolSDF:(R,i)=>({u_is_size_zoom_constant:new e.aI(R,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aI(R,i.u_is_size_feature_constant),u_size_t:new e.aJ(R,i.u_size_t),u_size:new e.aJ(R,i.u_size),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_pitch:new e.aJ(R,i.u_pitch),u_rotate_symbol:new e.aI(R,i.u_rotate_symbol),u_aspect_ratio:new e.aJ(R,i.u_aspect_ratio),u_fade_change:new e.aJ(R,i.u_fade_change),u_matrix:new e.aK(R,i.u_matrix),u_label_plane_matrix:new e.aK(R,i.u_label_plane_matrix),u_coord_matrix:new e.aK(R,i.u_coord_matrix),u_is_text:new e.aI(R,i.u_is_text),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_is_along_line:new e.aI(R,i.u_is_along_line),u_is_variable_anchor:new e.aI(R,i.u_is_variable_anchor),u_texsize:new e.aP(R,i.u_texsize),u_texture:new e.aI(R,i.u_texture),u_gamma_scale:new e.aJ(R,i.u_gamma_scale),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_is_halo:new e.aI(R,i.u_is_halo),u_translation:new e.aP(R,i.u_translation),u_pitched_scale:new e.aJ(R,i.u_pitched_scale)}),symbolTextAndIcon:(R,i)=>({u_is_size_zoom_constant:new e.aI(R,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aI(R,i.u_is_size_feature_constant),u_size_t:new e.aJ(R,i.u_size_t),u_size:new e.aJ(R,i.u_size),u_camera_to_center_distance:new e.aJ(R,i.u_camera_to_center_distance),u_pitch:new e.aJ(R,i.u_pitch),u_rotate_symbol:new e.aI(R,i.u_rotate_symbol),u_aspect_ratio:new e.aJ(R,i.u_aspect_ratio),u_fade_change:new e.aJ(R,i.u_fade_change),u_matrix:new e.aK(R,i.u_matrix),u_label_plane_matrix:new e.aK(R,i.u_label_plane_matrix),u_coord_matrix:new e.aK(R,i.u_coord_matrix),u_is_text:new e.aI(R,i.u_is_text),u_pitch_with_map:new e.aI(R,i.u_pitch_with_map),u_is_along_line:new e.aI(R,i.u_is_along_line),u_is_variable_anchor:new e.aI(R,i.u_is_variable_anchor),u_texsize:new e.aP(R,i.u_texsize),u_texsize_icon:new e.aP(R,i.u_texsize_icon),u_texture:new e.aI(R,i.u_texture),u_texture_icon:new e.aI(R,i.u_texture_icon),u_gamma_scale:new e.aJ(R,i.u_gamma_scale),u_device_pixel_ratio:new e.aJ(R,i.u_device_pixel_ratio),u_is_halo:new e.aI(R,i.u_is_halo),u_translation:new e.aP(R,i.u_translation),u_pitched_scale:new e.aJ(R,i.u_pitched_scale)}),background:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_opacity:new e.aJ(R,i.u_opacity),u_color:new e.aM(R,i.u_color)}),backgroundPattern:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_opacity:new e.aJ(R,i.u_opacity),u_image:new e.aI(R,i.u_image),u_pattern_tl_a:new e.aP(R,i.u_pattern_tl_a),u_pattern_br_a:new e.aP(R,i.u_pattern_br_a),u_pattern_tl_b:new e.aP(R,i.u_pattern_tl_b),u_pattern_br_b:new e.aP(R,i.u_pattern_br_b),u_texsize:new e.aP(R,i.u_texsize),u_mix:new e.aJ(R,i.u_mix),u_pattern_size_a:new e.aP(R,i.u_pattern_size_a),u_pattern_size_b:new e.aP(R,i.u_pattern_size_b),u_scale_a:new e.aJ(R,i.u_scale_a),u_scale_b:new e.aJ(R,i.u_scale_b),u_pixel_coord_upper:new e.aP(R,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aP(R,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aJ(R,i.u_tile_units_to_pixels)}),terrain:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_texture:new e.aI(R,i.u_texture),u_ele_delta:new e.aJ(R,i.u_ele_delta),u_fog_matrix:new e.aK(R,i.u_fog_matrix),u_fog_color:new e.aM(R,i.u_fog_color),u_fog_ground_blend:new e.aJ(R,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aJ(R,i.u_fog_ground_blend_opacity),u_horizon_color:new e.aM(R,i.u_horizon_color),u_horizon_fog_blend:new e.aJ(R,i.u_horizon_fog_blend)}),terrainDepth:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_ele_delta:new e.aJ(R,i.u_ele_delta)}),terrainCoords:(R,i)=>({u_matrix:new e.aK(R,i.u_matrix),u_texture:new e.aI(R,i.u_texture),u_terrain_coords_id:new e.aJ(R,i.u_terrain_coords_id),u_ele_delta:new e.aJ(R,i.u_ele_delta)}),sky:(R,i)=>({u_sky_color:new e.aM(R,i.u_sky_color),u_horizon_color:new e.aM(R,i.u_horizon_color),u_horizon:new e.aJ(R,i.u_horizon),u_sky_horizon_blend:new e.aJ(R,i.u_sky_horizon_blend)})};class Yr{constructor(i,a,C){this.context=i;const F=i.gl;this.buffer=F.createBuffer(),this.dynamicDraw=!!C,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),F.bufferData(F.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?F.DYNAMIC_DRAW:F.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(i){const a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)}destroy(){const i=this.context.gl;this.buffer&&(i.deleteBuffer(this.buffer),delete this.buffer)}}const oi={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ti{constructor(i,a,C,F){this.length=a.length,this.attributes=C,this.itemSize=a.bytesPerElement,this.dynamicDraw=F,this.context=i;const q=i.gl;this.buffer=q.createBuffer(),i.bindVertexBuffer.set(this.buffer),q.bufferData(q.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?q.DYNAMIC_DRAW:q.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(i){if(i.length!==this.length)throw new Error(`Length of new data is ${i.length}, which doesn't match current length of ${this.length}`);const a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,i.arrayBuffer)}enableAttributes(i,a){for(let C=0;C0){const tn=e.H();e.aR(tn,Ut.placementInvProjMatrix,R.transform.glCoordMatrix),e.aR(tn,tn,Ut.placementViewportMatrix),ve.push({circleArray:Qt,circleOffset:Re,transform:Mt.posMatrix,invTransform:tn,coord:Mt}),Ae+=Qt.length/4,Re=Ae}It&&ue.draw(q,te.LINES,oa.disabled,$a.disabled,R.colorModeForRenderPass(),Ya.disabled,an(R.transform,Mt.posMatrix),R.style.map.terrain&&R.style.map.terrain.getTerrainData(Mt),a.id,It.layoutVertexBuffer,It.indexBuffer,It.segments,null,R.transform.zoom,null,null,It.collisionVertexBuffer)}if(!F||!ve.length)return;const Ue=R.useProgram("collisionCircle"),it=new e.aS;it.resize(4*Ae),it._trim();let ct=0;for(const Ct of ve)for(let Mt=0;Mtve.style.map.terrain.getElevation(Qt,Lr,dr):null,nr=Mt.translatePosition(Ct,tn,ct,dt);Bo(Yt,Ut,It,bt,Ct,Hn,Qt.posMatrix,rr,Mn,Xn,Mt,nr,Qt.toUnwrapped(),Mr)}}}(C,R,a,i,a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),F),a.paint.get("icon-opacity").constantOr(1)!==0&&Vu(R,i,a,C,!1,a.paint.get("icon-translate"),a.paint.get("icon-translate-anchor"),a.layout.get("icon-rotation-alignment"),a.layout.get("icon-pitch-alignment"),a.layout.get("icon-keep-upright"),q,te),a.paint.get("text-opacity").constantOr(1)!==0&&Vu(R,i,a,C,!0,a.paint.get("text-translate"),a.paint.get("text-translate-anchor"),a.layout.get("text-rotation-alignment"),a.layout.get("text-pitch-alignment"),a.layout.get("text-keep-upright"),q,te),i.map.showCollisionBoxes&&(qs(R,i,a,C,!0),qs(R,i,a,C,!1))}function Fs(R,i,a,C,F,q){const{horizontalAlign:te,verticalAlign:ue}=e.av(R),ve=-(te-.5)*i,Ae=-(ue-.5)*a;return new e.P((ve/F+C[0])*q,(Ae/F+C[1])*q)}function qo(R,i,a,C,F,q){const te=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let ue=C.mult(q);return a||(ue=ue.rotate(-F)),Gt(te.add(ue),i.labelPlaneMatrix,i.getElevation).point}if(a){const ue=Xe(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(R),ve=Math.atan(ue.y/ue.x)+(ue.x<0?Math.PI:0);return R.add(C.rotate(ve))}return R.add(C)}function Bo(R,i,a,C,F,q,te,ue,ve,Ae,Re,Ue,it,ct){const dt=R.text.placedSymbolArray,bt=R.text.dynamicLayoutVertexArray,Ct=R.icon.dynamicLayoutVertexArray,Mt={};bt.clear();for(let Ut=0;Ut=0&&(Mt[It.associatedIconIndex]={shiftedAnchor:Sr,angle:Vr})}else jt(It.numGlyphs,bt)}if(Ae){Ct.clear();const Ut=R.icon.placedSymbolArray;for(let It=0;ItR.style.map.terrain.getElevation(Xn,Po,ll):null,fs=a.layout.get("text-rotation-alignment")==="map";pt(Mr,Xn.posMatrix,R,F,go,Go,Mt,Ae,fs,bt,Xn.toUnwrapped(),dt.width,dt.height,Da,Hi)}const Ra=Xn.posMatrix,wa=F&&Mn||Qa,Fa=Ut||wa?ec:go,qa=uo,fa=dr&&a.paint.get(F?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Pl;Pl=dr?Mr.iconsInText?Cr(Br.kind,fi,It,Mt,Ut,wa,R,Ra,Fa,qa,Da,si,Ji,Hn):Pr(Br.kind,fi,It,Mt,Ut,wa,R,Ra,Fa,qa,Da,F,si,!0,Hn):$r(Br.kind,fi,It,Mt,Ut,wa,R,Ra,Fa,qa,Da,F,si,Hn);const mo={program:Vr,buffers:nr,uniformValues:Pl,atlasTexture:_i,atlasTextureIcon:Yi,atlasInterpolation:Gi,atlasInterpolationIcon:Pi,isSDF:dr,hasHalo:fa};if(tn&&Mr.canOverlap){Yt=!0;const Hi=nr.segments.get();for(const fs of Hi)Vn.push({segments:new e.a0([fs]),sortKey:fs.sortKey,state:mo,terrainData:Nr})}else Vn.push({segments:nr.segments,sortKey:0,state:mo,terrainData:Nr})}Yt&&Vn.sort((Xn,rr)=>Xn.sortKey-rr.sortKey);for(const Xn of Vn){const rr=Xn.state;if(it.activeTexture.set(ct.TEXTURE0),rr.atlasTexture.bind(rr.atlasInterpolation,ct.CLAMP_TO_EDGE),rr.atlasTextureIcon&&(it.activeTexture.set(ct.TEXTURE1),rr.atlasTextureIcon&&rr.atlasTextureIcon.bind(rr.atlasInterpolationIcon,ct.CLAMP_TO_EDGE)),rr.isSDF){const Mr=rr.uniformValues;rr.hasHalo&&(Mr.u_is_halo=1,Fc(rr.buffers,Xn.segments,a,R,rr.program,vn,Re,Ue,Mr,Xn.terrainData)),Mr.u_is_halo=0}Fc(rr.buffers,Xn.segments,a,R,rr.program,vn,Re,Ue,rr.uniformValues,Xn.terrainData)}}function Fc(R,i,a,C,F,q,te,ue,ve,Ae){const Re=C.context,Ue=Re.gl;F.draw(Re,Ue.TRIANGLES,q,te,ue,Ya.disabled,ve,Ae,a.id,R.layoutVertexBuffer,R.indexBuffer,i,a.paint,C.transform.zoom,R.programConfigurations.get(a.id),R.dynamicLayoutVertexBuffer,R.opacityVertexBuffer)}function Hs(R,i,a,C){if(a.paint.get("heatmap-opacity")!==0)if(R.renderPass==="offscreen"){const F=R.context,q=F.gl,te=$a.disabled,ue=new Fo([q.ONE,q.ONE],e.aN.transparent,[!0,!0,!0,!0]);(function(ve,Ae,Re){const Ue=ve.gl;ve.activeTexture.set(Ue.TEXTURE1),ve.viewport.set([0,0,Ae.width/4,Ae.height/4]);let it=Re.heatmapFbo;if(it)Ue.bindTexture(Ue.TEXTURE_2D,it.colorAttachment.get()),ve.bindFramebuffer.set(it.framebuffer);else{const ct=Ue.createTexture();Ue.bindTexture(Ue.TEXTURE_2D,ct),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_WRAP_S,Ue.CLAMP_TO_EDGE),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_WRAP_T,Ue.CLAMP_TO_EDGE),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_MIN_FILTER,Ue.LINEAR),Ue.texParameteri(Ue.TEXTURE_2D,Ue.TEXTURE_MAG_FILTER,Ue.LINEAR),it=Re.heatmapFbo=ve.createFramebuffer(Ae.width/4,Ae.height/4,!1,!1),function(dt,bt,Ct,Mt){var Ut,It;const Qt=dt.gl,tn=(Ut=dt.HALF_FLOAT)!==null&&Ut!==void 0?Ut:Qt.UNSIGNED_BYTE,Yt=(It=dt.RGBA16F)!==null&&It!==void 0?It:Qt.RGBA;Qt.texImage2D(Qt.TEXTURE_2D,0,Yt,bt.width/4,bt.height/4,0,Qt.RGBA,tn,null),Mt.colorAttachment.set(Ct)}(ve,Ae,ct,it)}})(F,R,a),F.clear({color:e.aN.transparent});for(let ve=0;ve0){const ue=u.now(),ve=(ue-R.timeAdded)/te,Ae=i?(ue-i.timeAdded)/te:-1,Re=a.getSource(),Ue=F.coveringZoomLevel({tileSize:Re.tileSize,roundZoom:Re.roundZoom}),it=!i||Math.abs(i.tileID.overscaledZ-Ue)>Math.abs(R.tileID.overscaledZ-Ue),ct=it&&R.refreshedUponExpiration?1:e.ad(it?ve:1-Ae,0,1);return R.refreshedUponExpiration&&ve>=1&&(R.refreshedUponExpiration=!1),i?{opacity:1,mix:1-ct}:{opacity:ct,mix:0}}return{opacity:1,mix:0}}const Hl=new e.aN(1,0,0,1),Gs=new e.aN(0,1,0,1),pr=new e.aN(0,0,1,1),Dr=new e.aN(1,0,1,1),Zr=new e.aN(0,1,1,1);function Li(R){const i=R.transform.padding;ia(R,R.transform.height-(i.top||0),3,Hl),ia(R,i.bottom||0,3,Gs),sa(R,i.left||0,3,pr),sa(R,R.transform.width-(i.right||0),3,Dr);const a=R.transform.centerPoint;(function(C,F,q,te){po(C,F-1,q-10,2,20,te),po(C,F-10,q-1,20,2,te)})(R,a.x,R.transform.height-a.y,Zr)}function ia(R,i,a,C){po(R,0,i+a/2,R.transform.width,a,C)}function sa(R,i,a,C){po(R,i-a/2,0,a,R.transform.height,C)}function po(R,i,a,C,F,q){const te=R.context,ue=te.gl;ue.enable(ue.SCISSOR_TEST),ue.scissor(i*R.pixelRatio,a*R.pixelRatio,C*R.pixelRatio,F*R.pixelRatio),te.clear({color:q}),ue.disable(ue.SCISSOR_TEST)}function ro(R,i,a){const C=R.context,F=C.gl,q=a.posMatrix,te=R.useProgram("debug"),ue=oa.disabled,ve=$a.disabled,Ae=R.colorModeForRenderPass(),Re="$debug",Ue=R.style.map.terrain&&R.style.map.terrain.getTerrainData(a);C.activeTexture.set(F.TEXTURE0);const it=i.getTileByID(a.key).latestRawTileData,ct=it&&it.byteLength||0,dt=Math.floor(ct/1024),bt=i.getTile(a).tileSize,Ct=512/Math.min(bt,512)*(a.overscaledZ/R.transform.zoom)*.5;let Mt=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(Mt+=` => ${a.overscaledZ}`),function(Ut,It){Ut.initDebugOverlayCanvas();const Qt=Ut.debugOverlayCanvas,tn=Ut.context.gl,Yt=Ut.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,Qt.width,Qt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(It,5,5),Yt.strokeText(It,5,5),Ut.debugOverlayTexture.update(Qt),Ut.debugOverlayTexture.bind(tn.LINEAR,tn.CLAMP_TO_EDGE)}(R,`${Mt} ${dt}kB`),te.draw(C,F.TRIANGLES,ue,ve,Fo.alphaBlended,Ya.disabled,gn(q,e.aN.transparent,Ct),null,Re,R.debugBuffer,R.quadTriangleIndexBuffer,R.debugSegments),te.draw(C,F.LINE_STRIP,ue,ve,Ae,Ya.disabled,gn(q,e.aN.red),Ue,Re,R.debugBuffer,R.tileBorderIndexBuffer,R.debugSegments)}function mu(R,i,a){const C=R.context,F=C.gl,q=R.colorModeForRenderPass(),te=new oa(F.LEQUAL,oa.ReadWrite,R.depthRangeFor3D),ue=R.useProgram("terrain"),ve=i.getTerrainMesh();C.bindFramebuffer.set(null),C.viewport.set([0,0,R.width,R.height]);for(const Ae of a){const Re=R.renderToTexture.getTexture(Ae),Ue=i.getTerrainData(Ae.tileID);C.activeTexture.set(F.TEXTURE0),F.bindTexture(F.TEXTURE_2D,Re.texture);const it=R.transform.calculatePosMatrix(Ae.tileID.toUnwrapped()),ct=i.getMeshFrameDelta(R.transform.zoom),dt=R.transform.calculateFogMatrix(Ae.tileID.toUnwrapped()),bt=kn(it,ct,dt,R.style.sky,R.transform.pitch);ue.draw(C,F.TRIANGLES,te,$a.disabled,q,Ya.backCCW,bt,Ue,"terrain",ve.vertexBuffer,ve.indexBuffer,ve.segments)}}class qu{constructor(i,a,C){this.vertexBuffer=i,this.indexBuffer=a,this.segments=C}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class ls{constructor(i,a){this.context=new Qu(i),this.transform=a,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ge.maxUnderzooming+Ge.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new lr}resize(i,a,C){if(this.width=Math.floor(i*C),this.height=Math.floor(a*C),this.pixelRatio=C,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const F of this.style._order)this.style._layers[F].resize()}setup(){const i=this.context,a=new e.aX;a.emplaceBack(0,0),a.emplaceBack(e.X,0),a.emplaceBack(0,e.X),a.emplaceBack(e.X,e.X),this.tileExtentBuffer=i.createVertexBuffer(a,Or.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const C=new e.aX;C.emplaceBack(0,0),C.emplaceBack(e.X,0),C.emplaceBack(0,e.X),C.emplaceBack(e.X,e.X),this.debugBuffer=i.createVertexBuffer(C,Or.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const F=new e.$;F.emplaceBack(0,0,0,0),F.emplaceBack(e.X,0,e.X,0),F.emplaceBack(0,e.X,0,e.X),F.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=i.createVertexBuffer(F,Ve.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const q=new e.aX;q.emplaceBack(0,0),q.emplaceBack(1,0),q.emplaceBack(0,1),q.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(q,Or.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const te=new e.aZ;te.emplaceBack(0),te.emplaceBack(1),te.emplaceBack(3),te.emplaceBack(2),te.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(te);const ue=new e.aY;ue.emplaceBack(0,1,2),ue.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(ue);const ve=this.context.gl;this.stencilClearMode=new $a({func:ve.ALWAYS,mask:0},0,255,ve.ZERO,ve.ZERO,ve.ZERO)}clearStencil(){const i=this.context,a=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const C=e.H();e.aQ(C,0,this.width,this.height,0,0,1),e.K(C,C,[a.drawingBufferWidth,a.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,a.TRIANGLES,oa.disabled,this.stencilClearMode,Fo.disabled,Ya.disabled,qn(C),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(i,a){if(this.currentStencilSource===i.source||!i.isTileClipped()||!a||!a.length)return;this.currentStencilSource=i.source;const C=this.context,F=C.gl;this.nextStencilID+a.length>256&&this.clearStencil(),C.setColorMode(Fo.disabled),C.setDepthMode(oa.disabled);const q=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const te of a){const ue=this._tileClippingMaskIDs[te.key]=this.nextStencilID++,ve=this.style.map.terrain&&this.style.map.terrain.getTerrainData(te);q.draw(C,F.TRIANGLES,oa.disabled,new $a({func:F.ALWAYS,mask:0},ue,255,F.KEEP,F.KEEP,F.REPLACE),Fo.disabled,Ya.disabled,qn(te.posMatrix),ve,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const i=this.nextStencilID++,a=this.context.gl;return new $a({func:a.NOTEQUAL,mask:255},i,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(i){const a=this.context.gl;return new $a({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,a.KEEP,a.KEEP,a.REPLACE)}stencilConfigForOverlap(i){const a=this.context.gl,C=i.sort((te,ue)=>ue.overscaledZ-te.overscaledZ),F=C[C.length-1].overscaledZ,q=C[0].overscaledZ-F+1;if(q>1){this.currentStencilSource=void 0,this.nextStencilID+q>256&&this.clearStencil();const te={};for(let ue=0;ue({u_sky_color:Ut.properties.get("sky-color"),u_horizon_color:Ut.properties.get("horizon-color"),u_horizon:(It.height/2+It.getHorizon())*Qt,u_sky_horizon_blend:Ut.properties.get("sky-horizon-blend")*It.height/2*Qt}))(Re,Ae.style.map.transform,Ae.pixelRatio),dt=new oa(it.LEQUAL,oa.ReadWrite,[0,1]),bt=$a.disabled,Ct=Ae.colorModeForRenderPass(),Mt=Ae.useProgram("sky");if(!Re.mesh){const Ut=new e.aX;Ut.emplaceBack(-1,-1),Ut.emplaceBack(1,-1),Ut.emplaceBack(1,1),Ut.emplaceBack(-1,1);const It=new e.aY;It.emplaceBack(0,1,2),It.emplaceBack(0,2,3),Re.mesh=new qu(Ue.createVertexBuffer(Ut,Or.members),Ue.createIndexBuffer(It),e.a0.simpleSegment(0,0,Ut.length,It.length))}Mt.draw(Ue,it.TRIANGLES,dt,bt,Ct,Ya.disabled,ct,void 0,"sky",Re.mesh.vertexBuffer,Re.mesh.indexBuffer,Re.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=F.length-1;this.currentLayer>=0;this.currentLayer--){const Ae=this.style._layers[F[this.currentLayer]],Re=q[Ae.source],Ue=te[Ae.source];this._renderTileClippingMasks(Ae,Ue),this.renderLayer(this,Re,Ae,Ue)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerMt.source&&!Mt.isHidden(Ue)?[Re.sourceCaches[Mt.source]]:[]),dt=ct.filter(Mt=>Mt.getSource().type==="vector"),bt=ct.filter(Mt=>Mt.getSource().type!=="vector"),Ct=Mt=>{(!it||it.getSource().maxzoomCt(Mt)),it||bt.forEach(Mt=>Ct(Mt)),it}(this.style,this.transform.zoom);Ae&&function(Re,Ue,it){for(let ct=0;ct0),F&&(e.b0(a,C),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(q,te){const ue=q.context,ve=ue.gl,Ae=Fo.unblended,Re=new oa(ve.LEQUAL,oa.ReadWrite,[0,1]),Ue=te.getTerrainMesh(),it=te.sourceCache.getRenderableTiles(),ct=q.useProgram("terrainDepth");ue.bindFramebuffer.set(te.getFramebuffer("depth").framebuffer),ue.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),ue.clear({color:e.aN.transparent,depth:1});for(const dt of it){const bt=te.getTerrainData(dt.tileID),Ct={u_matrix:q.transform.calculatePosMatrix(dt.tileID.toUnwrapped()),u_ele_delta:te.getMeshFrameDelta(q.transform.zoom)};ct.draw(ue,ve.TRIANGLES,Re,$a.disabled,Ae,Ya.backCCW,Ct,bt,"terrain",Ue.vertexBuffer,Ue.indexBuffer,Ue.segments)}ue.bindFramebuffer.set(null),ue.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain),function(q,te){const ue=q.context,ve=ue.gl,Ae=Fo.unblended,Re=new oa(ve.LEQUAL,oa.ReadWrite,[0,1]),Ue=te.getTerrainMesh(),it=te.getCoordsTexture(),ct=te.sourceCache.getRenderableTiles(),dt=q.useProgram("terrainCoords");ue.bindFramebuffer.set(te.getFramebuffer("coords").framebuffer),ue.viewport.set([0,0,q.width/devicePixelRatio,q.height/devicePixelRatio]),ue.clear({color:e.aN.transparent,depth:1}),te.coordsIndex=[];for(const bt of ct){const Ct=te.getTerrainData(bt.tileID);ue.activeTexture.set(ve.TEXTURE0),ve.bindTexture(ve.TEXTURE_2D,it.texture);const Mt={u_matrix:q.transform.calculatePosMatrix(bt.tileID.toUnwrapped()),u_terrain_coords_id:(255-te.coordsIndex.length)/255,u_texture:0,u_ele_delta:te.getMeshFrameDelta(q.transform.zoom)};dt.draw(ue,ve.TRIANGLES,Re,$a.disabled,Ae,Ya.backCCW,Mt,Ct,"terrain",Ue.vertexBuffer,Ue.indexBuffer,Ue.segments),te.coordsIndex.push(bt.tileID.key)}ue.bindFramebuffer.set(null),ue.viewport.set([0,0,q.width,q.height])}(this,this.style.map.terrain))}renderLayer(i,a,C,F){if(!C.isHidden(this.transform.zoom)&&(C.type==="background"||C.type==="custom"||(F||[]).length))switch(this.id=C.id,C.type){case"symbol":ql(i,a,C,F,this.style.placement.variableOffsets);break;case"circle":(function(q,te,ue,ve){if(q.renderPass!=="translucent")return;const Ae=ue.paint.get("circle-opacity"),Re=ue.paint.get("circle-stroke-width"),Ue=ue.paint.get("circle-stroke-opacity"),it=!ue.layout.get("circle-sort-key").isConstant();if(Ae.constantOr(1)===0&&(Re.constantOr(1)===0||Ue.constantOr(1)===0))return;const ct=q.context,dt=ct.gl,bt=q.depthModeForSublayer(0,oa.ReadOnly),Ct=$a.disabled,Mt=q.colorModeForRenderPass(),Ut=[];for(let It=0;ItIt.sortKey-Qt.sortKey);for(const It of Ut){const{programConfiguration:Qt,program:tn,layoutVertexBuffer:Yt,indexBuffer:vn,uniformValues:Mn,terrainData:Vn}=It.state,Hn=It.segments;tn.draw(ct,dt.TRIANGLES,bt,Ct,Mt,Ya.disabled,Mn,Vn,ue.id,Yt,vn,Hn,ue.paint,q.transform.zoom,Qt)}})(i,a,C,F);break;case"heatmap":Hs(i,a,C,F);break;case"line":(function(q,te,ue,ve){if(q.renderPass!=="translucent")return;const Ae=ue.paint.get("line-opacity"),Re=ue.paint.get("line-width");if(Ae.constantOr(1)===0||Re.constantOr(1)===0)return;const Ue=q.depthModeForSublayer(0,oa.ReadOnly),it=q.colorModeForRenderPass(),ct=ue.paint.get("line-dasharray"),dt=ue.paint.get("line-pattern"),bt=dt.constantOr(1),Ct=ue.paint.get("line-gradient"),Mt=ue.getCrossfadeParameters(),Ut=bt?"linePattern":ct?"lineSDF":Ct?"lineGradient":"line",It=q.context,Qt=It.gl;let tn=!0;for(const Yt of ve){const vn=te.getTile(Yt);if(bt&&!vn.patternsLoaded())continue;const Mn=vn.getBucket(ue);if(!Mn)continue;const Vn=Mn.programConfigurations.get(ue.id),Hn=q.context.program.get(),Xn=q.useProgram(Ut,Vn),rr=tn||Xn.program!==Hn,Mr=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Yt),nr=dt.constantOr(null);if(nr&&vn.imageAtlas){const Br=vn.imageAtlas,Sr=Br.patternPositions[nr.to.toString()],Vr=Br.patternPositions[nr.from.toString()];Sr&&Vr&&Vn.setConstantPatternPositions(Sr,Vr)}const Lr=Mr?Yt:null,dr=bt?er(q,vn,ue,Mt,Lr):ct?br(q,vn,ue,ct,Mt,Lr):Ct?An(q,vn,ue,Mn.lineClipsArray.length,Lr):ln(q,vn,ue,Lr);if(bt)It.activeTexture.set(Qt.TEXTURE0),vn.imageAtlasTexture.bind(Qt.LINEAR,Qt.CLAMP_TO_EDGE),Vn.updatePaintBuffers(Mt);else if(ct&&(rr||q.lineAtlas.dirty))It.activeTexture.set(Qt.TEXTURE0),q.lineAtlas.bind(It);else if(Ct){const Br=Mn.gradients[ue.id];let Sr=Br.texture;if(ue.gradientVersion!==Br.version){let Vr=256;if(ue.stepInterpolant){const fi=te.getSource().maxzoom,Nr=Yt.canonical.z===fi?Math.ceil(1<20&&Re.texParameterf(Re.TEXTURE_2D,Ae.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Ae.extTextureFilterAnisotropicMax);const Xn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(Ut),rr=Xn?Ut:null,Mr=rr?rr.posMatrix:q.transform.calculatePosMatrix(Ut.toUnwrapped(),Mt),nr=Ur(Mr,Vn||[0,0],Mn||1,vn,ue);Ue instanceof Pe?it.draw(Ae,Re.TRIANGLES,It,$a.disabled,ct,Ya.disabled,nr,Xn,ue.id,Ue.boundsBuffer,q.quadTriangleIndexBuffer,Ue.boundsSegments):it.draw(Ae,Re.TRIANGLES,It,dt[Ut.overscaledZ],ct,Ya.disabled,nr,Xn,ue.id,q.rasterBoundsBuffer,q.quadTriangleIndexBuffer,q.rasterBoundsSegments)}})(i,a,C,F);break;case"background":(function(q,te,ue,ve){const Ae=ue.paint.get("background-color"),Re=ue.paint.get("background-opacity");if(Re===0)return;const Ue=q.context,it=Ue.gl,ct=q.transform,dt=ct.tileSize,bt=ue.paint.get("background-pattern");if(q.isPatternMissing(bt))return;const Ct=!bt&&Ae.a===1&&Re===1&&q.opaquePassEnabledForLayer()?"opaque":"translucent";if(q.renderPass!==Ct)return;const Mt=$a.disabled,Ut=q.depthModeForSublayer(0,Ct==="opaque"?oa.ReadWrite:oa.ReadOnly),It=q.colorModeForRenderPass(),Qt=q.useProgram(bt?"backgroundPattern":"background"),tn=ve||ct.coveringTiles({tileSize:dt,terrain:q.style.map.terrain});bt&&(Ue.activeTexture.set(it.TEXTURE0),q.imageManager.bind(q.context));const Yt=ue.getCrossfadeParameters();for(const vn of tn){const Mn=ve?vn.posMatrix:q.transform.calculatePosMatrix(vn.toUnwrapped()),Vn=bt?gi(Mn,Re,q,bt,{tileID:vn,tileSize:dt},Yt):Jr(Mn,Re,Ae),Hn=q.style.map.terrain&&q.style.map.terrain.getTerrainData(vn);Qt.draw(Ue,it.TRIANGLES,Ut,Mt,It,Ya.disabled,Vn,Hn,ue.id,q.tileExtentBuffer,q.quadTriangleIndexBuffer,q.tileExtentSegments)}})(i,0,C,F);break;case"custom":(function(q,te,ue){const ve=q.context,Ae=ue.implementation;if(q.renderPass==="offscreen"){const Re=Ae.prerender;Re&&(q.setCustomLayerDefaults(),ve.setColorMode(q.colorModeForRenderPass()),Re.call(Ae,ve.gl,q.transform.customLayerMatrix()),ve.setDirty(),q.setBaseState())}else if(q.renderPass==="translucent"){q.setCustomLayerDefaults(),ve.setColorMode(q.colorModeForRenderPass()),ve.setStencilMode($a.disabled);const Re=Ae.renderingMode==="3d"?new oa(q.context.gl.LEQUAL,oa.ReadWrite,q.depthRangeFor3D):q.depthModeForSublayer(0,oa.ReadOnly);ve.setDepthMode(Re),Ae.render(ve.gl,q.transform.customLayerMatrix(),{farZ:q.transform.farZ,nearZ:q.transform.nearZ,fov:q.transform._fov,modelViewProjectionMatrix:q.transform.modelViewProjectionMatrix,projectionMatrix:q.transform.projectionMatrix}),ve.setDirty(),q.setBaseState(),ve.bindFramebuffer.set(null)}})(i,0,C)}}translatePosMatrix(i,a,C,F,q){if(!C[0]&&!C[1])return i;const te=q?F==="map"?this.transform.angle:0:F==="viewport"?-this.transform.angle:0;if(te){const Ae=Math.sin(te),Re=Math.cos(te);C=[C[0]*Re-C[1]*Ae,C[0]*Ae+C[1]*Re]}const ue=[q?C[0]:Et(a,C[0],this.transform.zoom),q?C[1]:Et(a,C[1],this.transform.zoom),0],ve=new Float32Array(16);return e.J(ve,i,ue),ve}saveTileTexture(i){const a=this._tileTextures[i.size[0]];a?a.push(i):this._tileTextures[i.size[0]]=[i]}getTileTexture(i){const a=this._tileTextures[i];return a&&a.length>0?a.pop():null}isPatternMissing(i){if(!i)return!1;if(!i.from||!i.to)return!0;const a=this.imageManager.getPattern(i.from.toString()),C=this.imageManager.getPattern(i.to.toString());return!a||!C}useProgram(i,a){this.cache=this.cache||{};const C=i+(a?a.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[C]||(this.cache[C]=new ur(this.context,Ar[i],a,ii[i],this._showOverdrawInspector,this.style.map.terrain)),this.cache[C]}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 i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;const i=this.context.gl;this.debugOverlayTexture=new M(this.context,this.debugOverlayCanvas,i.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:i,drawingBufferHeight:a}=this.context.gl;return this.width!==i||this.height!==a}}class Ws{constructor(i,a){this.points=i,this.planes=a}static fromInvProjectionMatrix(i,a,C){const F=Math.pow(2,C),q=[[-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(ue=>{const ve=1/(ue=e.ag([],ue,i))[3]/a*F;return e.b1(ue,ue,[ve,ve,1/ue[3],ve])}),te=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(ue=>{const ve=function(it,ct){var dt=ct[0],bt=ct[1],Ct=ct[2],Mt=dt*dt+bt*bt+Ct*Ct;return Mt>0&&(Mt=1/Math.sqrt(Mt)),it[0]=ct[0]*Mt,it[1]=ct[1]*Mt,it[2]=ct[2]*Mt,it}([],function(it,ct,dt){var bt=ct[0],Ct=ct[1],Mt=ct[2],Ut=dt[0],It=dt[1],Qt=dt[2];return it[0]=Ct*Qt-Mt*It,it[1]=Mt*Ut-bt*Qt,it[2]=bt*It-Ct*Ut,it}([],A([],q[ue[0]],q[ue[1]]),A([],q[ue[2]],q[ue[1]]))),Ae=(Re=ve,Ue=q[ue[1]],-(Re[0]*Ue[0]+Re[1]*Ue[1]+Re[2]*Ue[2]));var Re,Ue;return ve.concat(Ae)});return new Ws(q,te)}}class bl{constructor(i,a){this.min=i,this.max=a,this.center=function(C,F,q){return C[0]=F[0]*q,C[1]=F[1]*q,C[2]=F[2]*q,C}([],function(C,F,q){return C[0]=F[0]+q[0],C[1]=F[1]+q[1],C[2]=F[2]+q[2],C}([],this.min,this.max),.5)}quadrant(i){const a=[i%2==0,i<2],C=g(this.min),F=g(this.max);for(let q=0;q=0&&te++;if(te===0)return 0;te!==a.length&&(C=!1)}if(C)return 2;for(let F=0;F<3;F++){let q=Number.MAX_VALUE,te=-Number.MAX_VALUE;for(let ue=0;uethis.max[F]-this.min[F])return 0}return 1}}class Zs{constructor(i=0,a=0,C=0,F=0){if(isNaN(i)||i<0||isNaN(a)||a<0||isNaN(C)||C<0||isNaN(F)||F<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=a,this.left=C,this.right=F}interpolate(i,a,C){return a.top!=null&&i.top!=null&&(this.top=e.z.number(i.top,a.top,C)),a.bottom!=null&&i.bottom!=null&&(this.bottom=e.z.number(i.bottom,a.bottom,C)),a.left!=null&&i.left!=null&&(this.left=e.z.number(i.left,a.left,C)),a.right!=null&&i.right!=null&&(this.right=e.z.number(i.right,a.right,C)),this}getCenter(i,a){const C=e.ad((this.left+i-this.right)/2,0,i),F=e.ad((this.top+a-this.bottom)/2,0,a);return new e.P(C,F)}equals(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right}clone(){return new Zs(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const vu=85.051129;class La{constructor(i,a,C,F,q){this.tileSize=512,this._renderWorldCopies=q===void 0||!!q,this._minZoom=i||0,this._maxZoom=a||22,this._minPitch=C??0,this._maxPitch=F??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Zs,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const i=new La(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.apply(this),i}apply(i){this.tileSize=i.tileSize,this.latRange=i.latRange,this.width=i.width,this.height=i.height,this._center=i._center,this._elevation=i._elevation,this.minElevationForCurrentTile=i.minElevationForCurrentTile,this.zoom=i.zoom,this.angle=i.angle,this._fov=i._fov,this._pitch=i._pitch,this._unmodified=i._unmodified,this._edgeInsets=i._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))}get maxZoom(){return this._maxZoom}set maxZoom(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))}get minPitch(){return this._minPitch}set minPitch(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))}get maxPitch(){return this._maxPitch}set maxPitch(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(i){const a=-e.b3(i,-180,180)*Math.PI/180;this.angle!==a&&(this._unmodified=!1,this.angle=a,this._calcMatrices(),this.rotationMatrix=function(){var C=new e.A(4);return e.A!=Float32Array&&(C[1]=0,C[2]=0),C[0]=1,C[3]=1,C}(),function(C,F,q){var te=F[0],ue=F[1],ve=F[2],Ae=F[3],Re=Math.sin(q),Ue=Math.cos(q);C[0]=te*Ue+ve*Re,C[1]=ue*Ue+Ae*Re,C[2]=te*-Re+ve*Ue,C[3]=ue*-Re+Ae*Ue}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(i){const a=e.ad(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==a&&(this._unmodified=!1,this._pitch=a,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(i){const a=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this.tileZoom=Math.max(0,Math.floor(a)),this.scale=this.zoomScale(a),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(i){i!==this._elevation&&(this._elevation=i,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(i){return this._edgeInsets.equals(i)}interpolatePadding(i,a,C){this._unmodified=!1,this._edgeInsets.interpolate(i,a,C),this._constrain(),this._calcMatrices()}coveringZoomLevel(i){const a=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,a)}getVisibleUnwrappedCoordinates(i){const a=[new e.b4(0,i)];if(this._renderWorldCopies){const C=this.pointCoordinate(new e.P(0,0)),F=this.pointCoordinate(new e.P(this.width,0)),q=this.pointCoordinate(new e.P(this.width,this.height)),te=this.pointCoordinate(new e.P(0,this.height)),ue=Math.floor(Math.min(C.x,F.x,q.x,te.x)),ve=Math.floor(Math.max(C.x,F.x,q.x,te.x)),Ae=1;for(let Re=ue-Ae;Re<=ve+Ae;Re++)Re!==0&&a.push(new e.b4(Re,i))}return a}coveringTiles(i){var a,C;let F=this.coveringZoomLevel(i);const q=F;if(i.minzoom!==void 0&&Fi.maxzoom&&(F=i.maxzoom);const te=this.pointCoordinate(this.getCameraPoint()),ue=e.Z.fromLngLat(this.center),ve=Math.pow(2,F),Ae=[ve*te.x,ve*te.y,0],Re=[ve*ue.x,ve*ue.y,0],Ue=Ws.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,F);let it=i.minzoom||0;!i.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(it=F);const ct=i.terrain?2/Math.min(this.tileSize,i.tileSize)*this.tileSize:3,dt=It=>({aabb:new bl([It*ve,0,0],[(It+1)*ve,ve,0]),zoom:0,x:0,y:0,wrap:It,fullyVisible:!1}),bt=[],Ct=[],Mt=F,Ut=i.reparseOverscaled?q:F;if(this._renderWorldCopies)for(let It=1;It<=3;It++)bt.push(dt(-It)),bt.push(dt(It));for(bt.push(dt(0));bt.length>0;){const It=bt.pop(),Qt=It.x,tn=It.y;let Yt=It.fullyVisible;if(!Yt){const rr=It.aabb.intersects(Ue);if(rr===0)continue;Yt=rr===2}const vn=i.terrain?Ae:Re,Mn=It.aabb.distanceX(vn),Vn=It.aabb.distanceY(vn),Hn=Math.max(Math.abs(Mn),Math.abs(Vn)),Xn=ct+(1<Xn&&It.zoom>=it){const rr=Mt-It.zoom,Mr=Ae[0]-.5-(Qt<>1),Lr=It.zoom+1;let dr=It.aabb.quadrant(rr);if(i.terrain){const Br=new e.S(Lr,It.wrap,Lr,Mr,nr),Sr=i.terrain.getMinMaxElevation(Br),Vr=(a=Sr.minElevation)!==null&&a!==void 0?a:this.elevation,fi=(C=Sr.maxElevation)!==null&&C!==void 0?C:this.elevation;dr=new bl([dr.min[0],dr.min[1],Vr],[dr.max[0],dr.max[1],fi])}bt.push({aabb:dr,zoom:Lr,x:Mr,y:nr,wrap:It.wrap,fullyVisible:Yt})}}return Ct.sort((It,Qt)=>It.distanceSq-Qt.distanceSq).map(It=>It.tileID)}resize(i,a){this.width=i,this.height=a,this.pixelsToGLUnits=[2/i,-2/a],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(i){return Math.pow(2,i)}scaleZoom(i){return Math.log(i)/Math.LN2}project(i){const a=e.ad(i.lat,-85.051129,vu);return new e.P(e.O(i.lng)*this.worldSize,e.Q(a)*this.worldSize)}unproject(i){return new e.Z(i.x/this.worldSize,i.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(i){const a=this.elevation,C=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,F=this.pointLocation(this.centerPoint,i),q=i.getElevationForLngLatZoom(F,this.tileZoom);if(!(this.elevation-q))return;const te=C+a-q,ue=Math.cos(this._pitch)*this.cameraToCenterDistance/te/e.b5(1,F.lat)/this.tileSize,ve=this.scaleZoom(ue);this._elevation=q,this._center=F,this.zoom=ve}setLocationAtPoint(i,a){const C=this.pointCoordinate(a),F=this.pointCoordinate(this.centerPoint),q=this.locationCoordinate(i),te=new e.Z(q.x-(C.x-F.x),q.y-(C.y-F.y));this.center=this.coordinateLocation(te),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(i,a){return a?this.coordinatePoint(this.locationCoordinate(i),a.getElevationForLngLatZoom(i,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(i))}pointLocation(i,a){return this.coordinateLocation(this.pointCoordinate(i,a))}locationCoordinate(i){return e.Z.fromLngLat(i)}coordinateLocation(i){return i&&i.toLngLat()}pointCoordinate(i,a){if(a){const dt=a.pointCoordinate(i);if(dt!=null)return dt}const C=[i.x,i.y,0,1],F=[i.x,i.y,1,1];e.ag(C,C,this.pixelMatrixInverse),e.ag(F,F,this.pixelMatrixInverse);const q=C[3],te=F[3],ue=C[0]/q,ve=F[0]/te,Ae=C[1]/q,Re=F[1]/te,Ue=C[2]/q,it=F[2]/te,ct=Ue===it?0:(0-Ue)/(it-Ue);return new e.Z(e.z.number(ue,ve,ct)/this.worldSize,e.z.number(Ae,Re,ct)/this.worldSize)}coordinatePoint(i,a=0,C=this.pixelMatrix){const F=[i.x*this.worldSize,i.y*this.worldSize,a,1];return e.ag(F,F,C),new e.P(F[0]/F[3],F[1]/F[3])}getBounds(){const i=Math.max(0,this.height/2-this.getHorizon());return new Ee().extend(this.pointLocation(new e.P(0,i))).extend(this.pointLocation(new e.P(this.width,i))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Ee([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(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,vu])}calculateTileMatrix(i){const a=i.canonical,C=this.worldSize/this.zoomScale(a.z),F=a.x+Math.pow(2,a.z)*i.wrap,q=e.ao(new Float64Array(16));return e.J(q,q,[F*C,a.y*C,0]),e.K(q,q,[C/e.X,C/e.X,1]),q}calculatePosMatrix(i,a=!1){const C=i.key,F=a?this._alignedPosMatrixCache:this._posMatrixCache;if(F[C])return F[C];const q=this.calculateTileMatrix(i);return e.L(q,a?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,q),F[C]=new Float32Array(q),F[C]}calculateFogMatrix(i){const a=i.key,C=this._fogMatrixCache;if(C[a])return C[a];const F=this.calculateTileMatrix(i);return e.L(F,this.fogMatrix,F),C[a]=new Float32Array(F),C[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(i,a){a=e.ad(+a,this.minZoom,this.maxZoom);const C={center:new e.N(i.lng,i.lat),zoom:a};let F=this.lngRange;if(!this._renderWorldCopies&&F===null){const It=179.9999999999;F=[-It,It]}const q=this.tileSize*this.zoomScale(C.zoom);let te=0,ue=q,ve=0,Ae=q,Re=0,Ue=0;const{x:it,y:ct}=this.size;if(this.latRange){const It=this.latRange;te=e.Q(It[1])*q,ue=e.Q(It[0])*q,ue-teue&&(Mt=ue-It)}if(F){const It=(ve+Ae)/2;let Qt=dt;this._renderWorldCopies&&(Qt=e.b3(dt,It-q/2,It+q/2));const tn=it/2;Qt-tnAe&&(Ct=Ae-tn)}if(Ct!==void 0||Mt!==void 0){const It=new e.P(Ct??dt,Mt??bt);C.center=this.unproject.call({worldSize:q},It).wrap()}return C}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const i=this._unmodified,{center:a,zoom:C}=this.getConstrained(this.center,this.zoom);this.center=a,this.zoom=C,this._unmodified=i,this._constraining=!1}_calcMatrices(){if(!this.height)return;const i=this._fov/2,a=this.centerOffset,C=this.point.x,F=this.point.y;this.cameraToCenterDistance=.5/Math.tan(i)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let q=e.ao(new Float64Array(16));e.K(q,q,[this.width/2,-this.height/2,1]),e.J(q,q,[1,-1,0]),this.labelPlaneMatrix=q,q=e.ao(new Float64Array(16)),e.K(q,q,[1,-1,1]),e.J(q,q,[-1,-1,0]),e.K(q,q,[2/this.width,2/this.height,1]),this.glCoordMatrix=q;const te=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ue=Math.min(this.elevation,this.minElevationForCurrentTile),ve=te-ue*this._pixelPerMeter/Math.cos(this._pitch),Ae=ue<0?ve:te,Re=Math.PI/2+this._pitch,Ue=this._fov*(.5+a.y/this.height),it=Math.sin(Ue)*Ae/Math.sin(e.ad(Math.PI-Re-Ue,.01,Math.PI-.01)),ct=this.getHorizon(),dt=2*Math.atan(ct/this.cameraToCenterDistance)*(.5+a.y/(2*ct)),bt=Math.sin(dt)*Ae/Math.sin(e.ad(Math.PI-Re-dt,.01,Math.PI-.01)),Ct=Math.min(it,bt);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ct+Ae),this.nearZ=this.height/50,q=new Float64Array(16),e.b6(q,this._fov,this.width/this.height,this.nearZ,this.farZ),q[8]=2*-a.x/this.width,q[9]=2*a.y/this.height,this.projectionMatrix=e.af(q),e.K(q,q,[1,-1,1]),e.J(q,q,[0,0,-this.cameraToCenterDistance]),e.b7(q,q,this._pitch),e.ae(q,q,this.angle),e.J(q,q,[-C,-F,0]),this.mercatorMatrix=e.K([],q,[this.worldSize,this.worldSize,this.worldSize]),e.K(q,q,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,q),e.J(q,q,[0,0,-this.elevation]),this.modelViewProjectionMatrix=q,this.invModelViewProjectionMatrix=e.at([],q),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,te,this.farZ),this.fogMatrix[8]=2*-a.x/this.width,this.fogMatrix[9]=2*a.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ae(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-C,-F,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,q);const Mt=this.width%2/2,Ut=this.height%2/2,It=Math.cos(this.angle),Qt=Math.sin(this.angle),tn=C-Math.round(C)+It*Mt+Qt*Ut,Yt=F-Math.round(F)+It*Ut+Qt*Mt,vn=new Float64Array(q);if(e.J(vn,vn,[tn>.5?tn-1:tn,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=vn,q=e.at(new Float64Array(16),this.pixelMatrix),!q)throw new Error("failed to invert matrix");this.pixelMatrixInverse=q,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const i=this.pointCoordinate(new e.P(0,0)),a=[i.x*this.worldSize,i.y*this.worldSize,0,1];return e.ag(a,a,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const i=this._pitch,a=Math.tan(i)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,a))}getCameraQueryGeometry(i){const a=this.getCameraPoint();if(i.length===1)return[i[0],a];{let C=a.x,F=a.y,q=a.x,te=a.y;for(const ue of i)C=Math.min(C,ue.x),F=Math.min(F,ue.y),q=Math.max(q,ue.x),te=Math.max(te,ue.y);return[new e.P(C,F),new e.P(q,F),new e.P(q,te),new e.P(C,te),new e.P(C,F)]}}lngLatToCameraDepth(i,a){const C=this.locationCoordinate(i),F=[C.x*this.worldSize,C.y*this.worldSize,a,1];return e.ag(F,F,this.modelViewProjectionMatrix),F[2]/F[3]}}function ba(R,i){let a,C=!1,F=null,q=null;const te=()=>{F=null,C&&(R.apply(q,a),F=setTimeout(te,i),C=!1)};return(...ue)=>(C=!0,q=this,a=ue,F||te(),F)}class Ho{constructor(i){this._getCurrentHash=()=>{const a=window.location.hash.replace("#","");if(this._hashName){let C;return a.split("&").map(F=>F.split("=")).forEach(F=>{F[0]===this._hashName&&(C=F)}),(C&&C[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{const a=this._getCurrentHash();if(a.length>=3&&!a.some(C=>isNaN(C))){const C=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:C,pitch:+(a[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const a=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{const a=this._getCurrentHash();if(a.length===0)return;const C=a.join("/");let F=C;F.split("&").length>0&&(F=F.split("&")[0]),this._hashName&&(F=`${this._hashName}=${C}`);let q=window.location.hash.replace(F,"");q.startsWith("#&")?q=q.slice(0,1)+q.slice(2):q==="#"&&(q="");let te=window.location.href.replace(/(#.+)?$/,q);te=te.replace("&&","&"),window.history.replaceState(window.history.state,null,te)},this._updateHash=ba(this._updateHashUnthrottled,300),this._hashName=i&&encodeURIComponent(i)}addTo(i){return this._map=i,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(i){const a=this._map.getCenter(),C=Math.round(100*this._map.getZoom())/100,F=Math.ceil((C*Math.LN2+Math.log(512/360/.5))/Math.LN10),q=Math.pow(10,F),te=Math.round(a.lng*q)/q,ue=Math.round(a.lat*q)/q,ve=this._map.getBearing(),Ae=this._map.getPitch();let Re="";if(Re+=i?`/${te}/${ue}/${C}`:`${C}/${ue}/${te}`,(ve||Ae)&&(Re+="/"+Math.round(10*ve)/10),Ae&&(Re+=`/${Math.round(Ae)}`),this._hashName){const Ue=this._hashName;let it=!1;const ct=window.location.hash.slice(1).split("&").map(dt=>{const bt=dt.split("=")[0];return bt===Ue?(it=!0,`${bt}=${Re}`):dt}).filter(dt=>dt);return it||ct.push(`${Ue}=${Re}`),`#${ct.join("&")}`}return`#${Re}`}}const Ts={linearity:.3,easing:e.b8(0,0,.3,1)},Aa=e.e({deceleration:2500,maxSpeed:1400},Ts),Ua=e.e({deceleration:20,maxSpeed:1400},Ts),wl=e.e({deceleration:1e3,maxSpeed:360},Ts),ic=e.e({deceleration:1e3,maxSpeed:90},Ts);class nu{constructor(i){this._map=i,this.clear()}clear(){this._inertiaBuffer=[]}record(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:i})}_drainInertiaBuffer(){const i=this._inertiaBuffer,a=u.now();for(;i.length>0&&a-i[0].time>160;)i.shift()}_onMoveEnd(i){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const a={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:q}of this._inertiaBuffer)a.zoom+=q.zoomDelta||0,a.bearing+=q.bearingDelta||0,a.pitch+=q.pitchDelta||0,q.panDelta&&a.pan._add(q.panDelta),q.around&&(a.around=q.around),q.pinchAround&&(a.pinchAround=q.pinchAround);const C=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,F={};if(a.pan.mag()){const q=Gl(a.pan.mag(),C,e.e({},Aa,i||{}));F.offset=a.pan.mult(q.amount/a.pan.mag()),F.center=this._map.transform.center,Bs(F,q)}if(a.zoom){const q=Gl(a.zoom,C,Ua);F.zoom=this._map.transform.zoom+q.amount,Bs(F,q)}if(a.bearing){const q=Gl(a.bearing,C,wl);F.bearing=this._map.transform.bearing+e.ad(q.amount,-179,179),Bs(F,q)}if(a.pitch){const q=Gl(a.pitch,C,ic);F.pitch=this._map.transform.pitch+q.amount,Bs(F,q)}if(F.zoom||F.bearing){const q=a.pinchAround===void 0?a.around:a.pinchAround;F.around=q?this._map.unproject(q):this._map.getCenter()}return this.clear(),e.e(F,{noMoveStart:!0})}}function Bs(R,i){(!R.duration||R.durationa.unproject(ve)),ue=q.reduce((ve,Ae,Re,Ue)=>ve.add(Ae.div(Ue.length)),new e.P(0,0));super(i,{points:q,point:ue,lngLats:te,lngLat:a.unproject(ue),originalEvent:C}),this._defaultPrevented=!1}}class Wl extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(i,a,C){super(i,{originalEvent:C}),this._defaultPrevented=!1}}class Eu{constructor(i,a){this._map=i,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(i){return this._firePreventable(new Wl(i.type,this._map,i))}mousedown(i,a){return this._mousedownPos=a,this._firePreventable(new us(i.type,this._map,i))}mouseup(i){this._map.fire(new us(i.type,this._map,i))}click(i,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new us(i.type,this._map,i))}dblclick(i){return this._firePreventable(new us(i.type,this._map,i))}mouseover(i){this._map.fire(new us(i.type,this._map,i))}mouseout(i){this._map.fire(new us(i.type,this._map,i))}touchstart(i){return this._firePreventable(new No(i.type,this._map,i))}touchmove(i){this._map.fire(new No(i.type,this._map,i))}touchend(i){this._map.fire(new No(i.type,this._map,i))}touchcancel(i){this._map.fire(new No(i.type,this._map,i))}_firePreventable(i){if(this._map.fire(i),i.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xo{constructor(i){this._map=i}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(i){this._map.fire(new us(i.type,this._map,i))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new us("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(i){this._delayContextMenu?this._contextMenuEvent=i:this._ignoreContextMenu||this._map.fire(new us(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Xa{constructor(i){this._map=i}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(i){return this.transform.pointLocation(e.P.convert(i),this._map.terrain)}}class Co{constructor(i,a){this._map=i,this._tr=new Xa(i),this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=a.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(i,a){this.isEnabled()&&i.shiftKey&&i.button===0&&(r.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(i,a){if(!this._active)return;const C=a;if(this._lastPos.equals(C)||!this._box&&C.dist(this._startPos)q.fitScreenCoordinates(C,F,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",i)}keydown(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(i,a){return this._map.fire(new e.k(i,{originalEvent:a}))}}function ka(R,i){if(R.length!==i.length)throw new Error(`The number of touches and points are not equal - touches ${R.length}, points ${i.length}`);const a={};for(let C=0;Cthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),C.length===this.numTouches&&(this.centroid=function(F){const q=new e.P(0,0);for(const te of F)q._add(te);return q.div(F.length)}(a),this.touches=ka(C,a)))}touchmove(i,a,C){if(this.aborted||!this.centroid)return;const F=ka(C,a);for(const q in this.touches){const te=this.touches[q],ue=F[q];(!ue||ue.dist(te)>30)&&(this.aborted=!0)}}touchend(i,a,C){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),C.length===0){const F=!this.aborted&&this.centroid;if(this.reset(),F)return F}}}class Va{constructor(i){this.singleTap=new Ao(i),this.numTaps=i.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(i,a,C){this.singleTap.touchstart(i,a,C)}touchmove(i,a,C){this.singleTap.touchmove(i,a,C)}touchend(i,a,C){const F=this.singleTap.touchend(i,a,C);if(F){const q=i.timeStamp-this.lastTime<500,te=!this.lastTap||this.lastTap.dist(F)<30;if(q&&te||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=F,this.count===this.numTaps)return this.reset(),F}}}class Ko{constructor(i){this._tr=new Xa(i),this._zoomIn=new Va({numTouches:1,numTaps:2}),this._zoomOut=new Va({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(i,a,C){this._zoomIn.touchstart(i,a,C),this._zoomOut.touchstart(i,a,C)}touchmove(i,a,C){this._zoomIn.touchmove(i,a,C),this._zoomOut.touchmove(i,a,C)}touchend(i,a,C){const F=this._zoomIn.touchend(i,a,C),q=this._zoomOut.touchend(i,a,C),te=this._tr;return F?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ue=>ue.easeTo({duration:300,zoom:te.zoom+1,around:te.unproject(F)},{originalEvent:i})}):q?(this._active=!0,i.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:ue=>ue.easeTo({duration:300,zoom:te.zoom-1,around:te.unproject(q)},{originalEvent:i})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class cs{constructor(i){this._enabled=!!i.enable,this._moveStateManager=i.moveStateManager,this._clickTolerance=i.clickTolerance||1,this._moveFunction=i.move,this._activateOnStart=!!i.activateOnStart,i.assignEvents(this),this.reset()}reset(i){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(i)}_move(...i){const a=this._moveFunction(...i);if(a.bearingDelta||a.pitchDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(i,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(i)&&(this._moveStateManager.startMove(i),this._lastPoint=a.length?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(i,a){if(!this.isEnabled())return;const C=this._lastPoint;if(!C)return;if(i.preventDefault(),!this._moveStateManager.isValidMoveEvent(i))return void this.reset(i);const F=a.length?a[0]:a;return!this._moved&&F.dist(C){R.mousedown=R.dragStart,R.mousemoveWindow=R.dragMove,R.mouseup=R.dragEnd,R.contextmenu=i=>{i.preventDefault()}},yu=({enable:R,clickTolerance:i,bearingDegreesPerPixelMoved:a=.8})=>{const C=new xs({checkCorrectEvent:F=>r.mouseButton(F)===0&&F.ctrlKey||r.mouseButton(F)===2});return new cs({clickTolerance:i,move:(F,q)=>({bearingDelta:(q.x-F.x)*a}),moveStateManager:C,enable:R,assignEvents:_s})},ru=({enable:R,clickTolerance:i,pitchDegreesPerPixelMoved:a=-.5})=>{const C=new xs({checkCorrectEvent:F=>r.mouseButton(F)===0&&F.ctrlKey||r.mouseButton(F)===2});return new cs({clickTolerance:i,move:(F,q)=>({pitchDelta:(q.y-F.y)*a}),moveStateManager:C,enable:R,assignEvents:_s})};class Tl{constructor(i,a){this._clickTolerance=i.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(i){return i<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(i,a,C){return this._calculateTransform(i,a,C)}touchmove(i,a,C){if(this._active){if(!this._shouldBePrevented(C.length))return i.preventDefault(),this._calculateTransform(i,a,C);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",i)}}touchend(i,a,C){this._calculateTransform(i,a,C),this._active&&this._shouldBePrevented(C.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(i,a,C){C.length>0&&(this._active=!0);const F=ka(C,a),q=new e.P(0,0),te=new e.P(0,0);let ue=0;for(const Ae in F){const Re=F[Ae],Ue=this._touches[Ae];Ue&&(q._add(Re),te._add(Re.sub(Ue)),ue++,F[Ae]=Re)}if(this._touches=F,this._shouldBePrevented(ue)||!te.mag())return;const ve=te.div(ue);return this._sum._add(ve),this._sum.mag()Math.abs(R.x)}class il extends Sa{constructor(i){super(),this._currentTouchCount=0,this._map=i}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(i,a,C){super.touchstart(i,a,C),this._currentTouchCount=C.length}_start(i){this._lastPoints=i,Al(i[0].sub(i[1]))&&(this._valid=!1)}_move(i,a,C){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const F=i[0].sub(this._lastPoints[0]),q=i[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(F,q,C.timeStamp),this._valid?(this._lastPoints=i,this._active=!0,{pitchDelta:(F.y+q.y)/2*-.5}):void 0}gestureBeginsVertically(i,a,C){if(this._valid!==void 0)return this._valid;const F=i.mag()>=2,q=a.mag()>=2;if(!F&&!q)return;if(!F||!q)return this._firstMove===void 0&&(this._firstMove=C),C-this._firstMove<100&&void 0;const te=i.y>0==a.y>0;return Al(i)&&Al(a)&&te}}const Sl={panStep:100,bearingStep:15,pitchStep:10};class Ml{constructor(i){this._tr=new Xa(i);const a=Sl;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(i){if(i.altKey||i.ctrlKey||i.metaKey)return;let a=0,C=0,F=0,q=0,te=0;switch(i.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:i.shiftKey?C=-1:(i.preventDefault(),q=-1);break;case 39:i.shiftKey?C=1:(i.preventDefault(),q=1);break;case 38:i.shiftKey?F=1:(i.preventDefault(),te=-1);break;case 40:i.shiftKey?F=-1:(i.preventDefault(),te=1);break;default:return}return this._rotationDisabled&&(C=0,F=0),{cameraAnimation:ue=>{const ve=this._tr;ue.easeTo({duration:300,easeId:"keyboardHandler",easing:li,zoom:a?Math.round(ve.zoom)+a*(i.shiftKey?2:1):ve.zoom,bearing:ve.bearing+C*this._bearingStep,pitch:ve.pitch+F*this._pitchStep,offset:[-q*this._panStep,-te*this._panStep],center:ve.center},{originalEvent:i})}}}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 li(R){return R*(2-R)}const hs=4.000244140625;class al{constructor(i,a){this._onTimeout=C=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(C)},this._map=i,this._tr=new Xa(i),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(i){this._defaultZoomRate=i}setWheelZoomRate(i){this._wheelZoomRate=i}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!i&&i.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(i){return!!this._map.cooperativeGestures.isEnabled()&&!(i.ctrlKey||this._map.cooperativeGestures.isBypassed(i))}wheel(i){if(!this.isEnabled())return;if(this._shouldBePrevented(i))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",i);let a=i.deltaMode===WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY;const C=u.now(),F=C-(this._lastWheelEventTime||0);this._lastWheelEventTime=C,a!==0&&a%hs==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":F>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(F*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),i.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=i,this._delta-=a,this._active||this._start(i)),i.preventDefault()}_start(i){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 a=r.mousePos(this._map.getCanvas(),i),C=this._tr;a.y>C.transform.height/2-C.transform.getHorizon()?this._around=e.N.convert(this._aroundCenter?C.center:C.unproject(a)):this._around=e.N.convert(C.center),this._aroundPoint=C.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const i=this._tr.transform;if(this._delta!==0){const ve=this._type==="wheel"&&Math.abs(this._delta)>hs?this._wheelZoomRate:this._defaultZoomRate;let Ae=2/(1+Math.exp(-Math.abs(this._delta*ve)));this._delta<0&&Ae!==0&&(Ae=1/Ae);const Re=typeof this._targetZoom=="number"?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(Re*Ae))),this._type==="wheel"&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const a=typeof this._targetZoom=="number"?this._targetZoom:i.zoom,C=this._startZoom,F=this._easing;let q,te=!1;const ue=u.now()-this._lastWheelEventTime;if(this._type==="wheel"&&C&&F&&ue){const ve=Math.min(ue/200,1),Ae=F(ve);q=e.z.number(C,a,Ae),ve<1?this._frameId||(this._frameId=!0):te=!0}else q=a,te=!0;return this._active=!0,te&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!te,zoomDelta:q-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(i){let a=e.b9;if(this._prevEase){const C=this._prevEase,F=(u.now()-C.start)/C.duration,q=C.easing(F+.01)-C.easing(F),te=.27/Math.sqrt(q*q+1e-4)*.01,ue=Math.sqrt(.0729-te*te);a=e.b8(te,ue,.25,1)}return this._prevEase={start:u.now(),duration:i,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Na{constructor(i,a){this._clickZoom=i,this._tapZoom=a}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 Ns{constructor(i){this._tr=new Xa(i),this.reset()}reset(){this._active=!1}dblclick(i,a){return i.preventDefault(),{cameraAnimation:C=>{C.easeTo({duration:300,zoom:this._tr.zoom+(i.shiftKey?-1:1),around:this._tr.unproject(a)},{originalEvent:i})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class iu{constructor(){this._tap=new Va({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(i,a,C){if(!this._swipePoint)if(this._tapTime){const F=a[0],q=i.timeStamp-this._tapTime<500,te=this._tapPoint.dist(F)<30;q&&te?C.length>0&&(this._swipePoint=F,this._swipeTouch=C[0].identifier):this.reset()}else this._tap.touchstart(i,a,C)}touchmove(i,a,C){if(this._tapTime){if(this._swipePoint){if(C[0].identifier!==this._swipeTouch)return;const F=a[0],q=F.y-this._swipePoint.y;return this._swipePoint=F,i.preventDefault(),this._active=!0,{zoomDelta:q/128}}}else this._tap.touchmove(i,a,C)}touchend(i,a,C){if(this._tapTime)this._swipePoint&&C.length===0&&this.reset();else{const F=this._tap.touchend(i,a,C);F&&(this._tapTime=i.timeStamp,this._tapPoint=F)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class El{constructor(i,a,C){this._el=i,this._mousePan=a,this._touchPan=C}enable(i){this._inertiaOptions=i||{},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 ks{constructor(i,a,C){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=a,this._mousePitch=C}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 au{constructor(i,a,C,F){this._el=i,this._touchZoom=a,this._touchRotate=C,this._tapDragZoom=F,this._rotationDisabled=!1,this._enabled=!0}enable(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),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 As{constructor(i,a){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=i,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const i=this._map.getCanvasContainer();i.classList.add("maplibregl-cooperative-gestures"),this._container=r.create("div","maplibregl-cooperative-gesture-screen",i);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const C=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),F=document.createElement("div");F.className="maplibregl-desktop-message",F.textContent=a,this._container.appendChild(F);const q=document.createElement("div");q.className="maplibregl-mobile-message",q.textContent=C,this._container.appendChild(q),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(r.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(i){return i[this._bypassKey]}notifyGestureBlocked(i,a){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:i,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Jo=R=>R.zoom||R.drag||R.pitch||R.rotate;class ol extends e.k{}function cn(R){return R.panDelta&&R.panDelta.mag()||R.zoomDelta||R.bearingDelta||R.pitchDelta}class ya{constructor(i,a){this.handleWindowEvent=F=>{this.handleEvent(F,`${F.type}Window`)},this.handleEvent=(F,q)=>{if(F.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const te=F.type==="renderFrame"?void 0:F,ue={needsRenderFrame:!1},ve={},Ae={},Re=F.touches,Ue=Re?this._getMapTouches(Re):void 0,it=Ue?r.touchPos(this._map.getCanvas(),Ue):r.mousePos(this._map.getCanvas(),F);for(const{handlerName:bt,handler:Ct,allowed:Mt}of this._handlers){if(!Ct.isEnabled())continue;let Ut;this._blockedByActive(Ae,Mt,bt)?Ct.reset():Ct[q||F.type]&&(Ut=Ct[q||F.type](F,it,Ue),this.mergeHandlerResult(ue,ve,Ut,bt,te),Ut&&Ut.needsRenderFrame&&this._triggerRenderFrame()),(Ut||Ct.isActive())&&(Ae[bt]=Ct)}const ct={};for(const bt in this._previousActiveHandlers)Ae[bt]||(ct[bt]=te);this._previousActiveHandlers=Ae,(Object.keys(ct).length||cn(ue))&&(this._changes.push([ue,ve,ct]),this._triggerRenderFrame()),(Object.keys(Ae).length||cn(ue))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:dt}=ue;dt&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],dt(this._map))},this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new nu(i),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);const C=this._el;this._listeners=[[C,"touchstart",{passive:!0}],[C,"touchmove",{passive:!1}],[C,"touchend",void 0],[C,"touchcancel",void 0],[C,"mousedown",void 0],[C,"mousemove",void 0],[C,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[C,"mouseover",void 0],[C,"mouseout",void 0],[C,"dblclick",void 0],[C,"click",void 0],[C,"keydown",{capture:!1}],[C,"keyup",void 0],[C,"wheel",{passive:!1}],[C,"contextmenu",void 0],[window,"blur",void 0]];for(const[F,q,te]of this._listeners)r.addEventListener(F,q,F===document?this.handleWindowEvent:this.handleEvent,te)}destroy(){for(const[i,a,C]of this._listeners)r.removeEventListener(i,a,i===document?this.handleWindowEvent:this.handleEvent,C)}_addDefaultHandlers(i){const a=this._map,C=a.getCanvasContainer();this._add("mapEvent",new Eu(a,i));const F=a.boxZoom=new Co(a,i);this._add("boxZoom",F),i.interactive&&i.boxZoom&&F.enable();const q=a.cooperativeGestures=new As(a,i.cooperativeGestures);this._add("cooperativeGestures",q),i.cooperativeGestures&&q.enable();const te=new Ko(a),ue=new Ns(a);a.doubleClickZoom=new Na(ue,te),this._add("tapZoom",te),this._add("clickZoom",ue),i.interactive&&i.doubleClickZoom&&a.doubleClickZoom.enable();const ve=new iu;this._add("tapDragZoom",ve);const Ae=a.touchPitch=new il(a);this._add("touchPitch",Ae),i.interactive&&i.touchPitch&&a.touchPitch.enable(i.touchPitch);const Re=yu(i),Ue=ru(i);a.dragRotate=new ks(i,Re,Ue),this._add("mouseRotate",Re,["mousePitch"]),this._add("mousePitch",Ue,["mouseRotate"]),i.interactive&&i.dragRotate&&a.dragRotate.enable();const it=(({enable:Ut,clickTolerance:It})=>{const Qt=new xs({checkCorrectEvent:tn=>r.mouseButton(tn)===0&&!tn.ctrlKey});return new cs({clickTolerance:It,move:(tn,Yt)=>({around:Yt,panDelta:Yt.sub(tn)}),activateOnStart:!0,moveStateManager:Qt,enable:Ut,assignEvents:_s})})(i),ct=new Tl(i,a);a.dragPan=new El(C,it,ct),this._add("mousePan",it),this._add("touchPan",ct,["touchZoom","touchRotate"]),i.interactive&&i.dragPan&&a.dragPan.enable(i.dragPan);const dt=new Ac,bt=new Mi;a.touchZoomRotate=new au(C,bt,dt,ve),this._add("touchRotate",dt,["touchPan","touchZoom"]),this._add("touchZoom",bt,["touchPan","touchRotate"]),i.interactive&&i.touchZoomRotate&&a.touchZoomRotate.enable(i.touchZoomRotate);const Ct=a.scrollZoom=new al(a,()=>this._triggerRenderFrame());this._add("scrollZoom",Ct,["mousePan"]),i.interactive&&i.scrollZoom&&a.scrollZoom.enable(i.scrollZoom);const Mt=a.keyboard=new Ml(a);this._add("keyboard",Mt),i.interactive&&i.keyboard&&a.keyboard.enable(),this._add("blockableMapEvent",new Xo(a))}_add(i,a,C){this._handlers.push({handlerName:i,handler:a,allowed:C}),this._handlersById[i]=a}stop(i){if(!this._updatingCamera){for(const{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}}isActive(){for(const{handler:i}of this._handlers)if(i.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Jo(this._eventsInProgress)||this.isZooming()}_blockedByActive(i,a,C){for(const F in i)if(F!==C&&(!a||a.indexOf(F)<0))return!0;return!1}_getMapTouches(i){const a=[];for(const C of i){const F=C.target;this._el.contains(F)&&a.push(C)}return a}mergeHandlerResult(i,a,C,F,q){if(!C)return;e.e(i,C);const te={handlerName:F,originalEvent:C.originalEvent||q};C.zoomDelta!==void 0&&(a.zoom=te),C.panDelta!==void 0&&(a.drag=te),C.pitchDelta!==void 0&&(a.pitch=te),C.bearingDelta!==void 0&&(a.rotate=te)}_applyChanges(){const i={},a={},C={};for(const[F,q,te]of this._changes)F.panDelta&&(i.panDelta=(i.panDelta||new e.P(0,0))._add(F.panDelta)),F.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+F.zoomDelta),F.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+F.bearingDelta),F.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+F.pitchDelta),F.around!==void 0&&(i.around=F.around),F.pinchAround!==void 0&&(i.pinchAround=F.pinchAround),F.noInertia&&(i.noInertia=F.noInertia),e.e(a,q),e.e(C,te);this._updateMapTransform(i,a,C),this._changes=[]}_updateMapTransform(i,a,C){const F=this._map,q=F._getTransformForUpdate(),te=F.terrain;if(!(cn(i)||te&&this._terrainMovement))return this._fireEvents(a,C,!0);let{panDelta:ue,zoomDelta:ve,bearingDelta:Ae,pitchDelta:Re,around:Ue,pinchAround:it}=i;it!==void 0&&(Ue=it),F._stop(!0),Ue=Ue||F.transform.centerPoint;const ct=q.pointLocation(ue?Ue.sub(ue):Ue);Ae&&(q.bearing+=Ae),Re&&(q.pitch+=Re),ve&&(q.zoom+=ve),te?this._terrainMovement||!a.drag&&!a.zoom?a.drag&&this._terrainMovement?q.center=q.pointLocation(q.centerPoint.sub(ue)):q.setLocationAtPoint(ct,Ue):(this._terrainMovement=!0,this._map._elevationFreeze=!0,q.setLocationAtPoint(ct,Ue)):q.setLocationAtPoint(ct,Ue),F._applyUpdatedTransform(q),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(a,C,!0)}_fireEvents(i,a,C){const F=Jo(this._eventsInProgress),q=Jo(i),te={};for(const Ue in i){const{originalEvent:it}=i[Ue];this._eventsInProgress[Ue]||(te[`${Ue}start`]=it),this._eventsInProgress[Ue]=i[Ue]}!F&&q&&this._fireEvent("movestart",q.originalEvent);for(const Ue in te)this._fireEvent(Ue,te[Ue]);q&&this._fireEvent("move",q.originalEvent);for(const Ue in i){const{originalEvent:it}=i[Ue];this._fireEvent(Ue,it)}const ue={};let ve;for(const Ue in this._eventsInProgress){const{handlerName:it,originalEvent:ct}=this._eventsInProgress[Ue];this._handlersById[it].isActive()||(delete this._eventsInProgress[Ue],ve=a[it]||ct,ue[`${Ue}end`]=ve)}for(const Ue in ue)this._fireEvent(Ue,ue[Ue]);const Ae=Jo(this._eventsInProgress),Re=(F||q)&&!Ae;if(Re&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Ue=this._map._getTransformForUpdate();Ue.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Ue)}if(C&&Re){this._updatingCamera=!0;const Ue=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),it=ct=>ct!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new ol("renderFrame",{timeStamp:i})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class So extends e.E{constructor(i,a){super(),this._renderFrameCallback=()=>{const C=Math.min((u.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(C)),C<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=a.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(i,a){return this.jumpTo({center:i},a)}panBy(i,a,C){return i=e.P.convert(i).mult(-1),this.panTo(this.transform.center,e.e({offset:i},a),C)}panTo(i,a,C){return this.easeTo(e.e({center:i},a),C)}getZoom(){return this.transform.zoom}setZoom(i,a){return this.jumpTo({zoom:i},a),this}zoomTo(i,a,C){return this.easeTo(e.e({zoom:i},a),C)}zoomIn(i,a){return this.zoomTo(this.getZoom()+1,i,a),this}zoomOut(i,a){return this.zoomTo(this.getZoom()-1,i,a),this}getBearing(){return this.transform.bearing}setBearing(i,a){return this.jumpTo({bearing:i},a),this}getPadding(){return this.transform.padding}setPadding(i,a){return this.jumpTo({padding:i},a),this}rotateTo(i,a,C){return this.easeTo(e.e({bearing:i},a),C)}resetNorth(i,a){return this.rotateTo(0,e.e({duration:1e3},i),a),this}resetNorthPitch(i,a){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},i),a),this}snapToNorth(i,a){return Math.abs(this.getBearing()){if(this._zooming&&(F.zoom=e.z.number(q,Ct,vn)),this._rotating&&(F.bearing=e.z.number(te,Ae,vn)),this._pitching&&(F.pitch=e.z.number(ue,Re,vn)),this._padding&&(F.interpolatePadding(ve,Ue,vn),ct=F.centerPoint.add(it)),this.terrain&&!i.freezeElevation&&this._updateElevation(vn),Qt)F.setLocationAtPoint(Qt,tn);else{const Mn=F.zoomScale(F.zoom-q),Vn=Ct>q?Math.min(2,It):Math.max(.5,It),Hn=Math.pow(Vn,1-vn),Xn=F.unproject(Mt.add(Ut.mult(vn*Hn)).mult(Mn));F.setLocationAtPoint(F.renderWorldCopies?Xn.wrap():Xn,ct)}this._applyUpdatedTransform(F),this._fireMoveEvents(a)},vn=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(a,vn)},i),this}_prepareEase(i,a,C={}){this._moving=!0,a||C.moving||this.fire(new e.k("movestart",i)),this._zooming&&!C.zooming&&this.fire(new e.k("zoomstart",i)),this._rotating&&!C.rotating&&this.fire(new e.k("rotatestart",i)),this._pitching&&!C.pitching&&this.fire(new e.k("pitchstart",i))}_prepareElevation(i){this._elevationCenter=i,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(i){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(i<1&&a!==this._elevationTarget){const C=this._elevationTarget-this._elevationStart,F=(a-(C*i+this._elevationStart))/(1-i);this._elevationStart+=i*(C-F),this._elevationTarget=a}this.transform.elevation=e.z.number(this._elevationStart,this._elevationTarget,i)}_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(i){const a=i.getCameraPosition(),C=this.terrain.getElevationForLngLatZoom(a.lngLat,i.zoom);if(a.altitudethis._elevateCameraIfInsideTerrain(F)),this.transformCameraUpdate&&a.push(F=>this.transformCameraUpdate(F)),!a.length)return;const C=i.clone();for(const F of a){const q=C.clone(),{center:te,zoom:ue,pitch:ve,bearing:Ae,elevation:Re}=F(q);te&&(q.center=te),ue!==void 0&&(q.zoom=ue),ve!==void 0&&(q.pitch=ve),Ae!==void 0&&(q.bearing=Ae),Re!==void 0&&(q.elevation=Re),C.apply(q)}this.transform.apply(C)}_fireMoveEvents(i){this.fire(new e.k("move",i)),this._zooming&&this.fire(new e.k("zoom",i)),this._rotating&&this.fire(new e.k("rotate",i)),this._pitching&&this.fire(new e.k("pitch",i))}_afterEase(i,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;const C=this._zooming,F=this._rotating,q=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,C&&this.fire(new e.k("zoomend",i)),F&&this.fire(new e.k("rotateend",i)),q&&this.fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}flyTo(i,a){var C;if(!i.essential&&u.prefersReducedMotion){const dr=e.M(i,["center","zoom","bearing","pitch","around"]);return this.jumpTo(dr,a)}this.stop(),i=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},i);const F=this._getTransformForUpdate(),q=F.zoom,te=F.bearing,ue=F.pitch,ve=F.padding,Ae="bearing"in i?this._normalizeBearing(i.bearing,te):te,Re="pitch"in i?+i.pitch:ue,Ue="padding"in i?i.padding:F.padding,it=e.P.convert(i.offset);let ct=F.centerPoint.add(it);const dt=F.pointLocation(ct),{center:bt,zoom:Ct}=F.getConstrained(e.N.convert(i.center||dt),(C=i.zoom)!==null&&C!==void 0?C:q);this._normalizeCenter(bt,F);const Mt=F.zoomScale(Ct-q),Ut=F.project(dt),It=F.project(bt).sub(Ut);let Qt=i.curve;const tn=Math.max(F.width,F.height),Yt=tn/Mt,vn=It.mag();if("minZoom"in i){const dr=e.ad(Math.min(i.minZoom,q,Ct),F.minZoom,F.maxZoom),Br=tn/F.zoomScale(dr-q);Qt=Math.sqrt(Br/vn*2)}const Mn=Qt*Qt;function Vn(dr){const Br=(Yt*Yt-tn*tn+(dr?-1:1)*Mn*Mn*vn*vn)/(2*(dr?Yt:tn)*Mn*vn);return Math.log(Math.sqrt(Br*Br+1)-Br)}function Hn(dr){return(Math.exp(dr)-Math.exp(-dr))/2}function Xn(dr){return(Math.exp(dr)+Math.exp(-dr))/2}const rr=Vn(!1);let Mr=function(dr){return Xn(rr)/Xn(rr+Qt*dr)},nr=function(dr){return tn*((Xn(rr)*(Hn(Br=rr+Qt*dr)/Xn(Br))-Hn(rr))/Mn)/vn;var Br},Lr=(Vn(!0)-rr)/Qt;if(Math.abs(vn)<1e-6||!isFinite(Lr)){if(Math.abs(tn-Yt)<1e-6)return this.easeTo(i,a);const dr=Yt0,Mr=Br=>Math.exp(dr*Qt*Br)}if("duration"in i)i.duration=+i.duration;else{const dr="screenSpeed"in i?+i.screenSpeed/Qt:+i.speed;i.duration=1e3*Lr/dr}return i.maxDuration&&i.duration>i.maxDuration&&(i.duration=0),this._zooming=!0,this._rotating=te!==Ae,this._pitching=Re!==ue,this._padding=!F.isPaddingEqual(Ue),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(bt),this._ease(dr=>{const Br=dr*Lr,Sr=1/Mr(Br);F.zoom=dr===1?Ct:q+F.scaleZoom(Sr),this._rotating&&(F.bearing=e.z.number(te,Ae,dr)),this._pitching&&(F.pitch=e.z.number(ue,Re,dr)),this._padding&&(F.interpolatePadding(ve,Ue,dr),ct=F.centerPoint.add(it)),this.terrain&&!i.freezeElevation&&this._updateElevation(dr);const Vr=dr===1?bt:F.unproject(Ut.add(It.mult(nr(Br))).mult(Sr));F.setLocationAtPoint(F.renderWorldCopies?Vr.wrap():Vr,ct),this._applyUpdatedTransform(F),this._fireMoveEvents(a)},()=>{this.terrain&&i.freezeElevation&&this._finalizeElevation(),this._afterEase(a)},i),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(i,a){var C;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const F=this._onEaseEnd;delete this._onEaseEnd,F.call(this,a)}return i||(C=this.handlers)===null||C===void 0||C.stop(!1),this}_ease(i,a,C){C.animate===!1||C.duration===0?(i(1),a()):(this._easeStart=u.now(),this._easeOptions=C,this._onEaseFrame=i,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(i,a){i=e.b3(i,-180,180);const C=Math.abs(i-a);return Math.abs(i-360-a)180?-360:C<-180?360:0}queryTerrainElevation(i){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(i),this.transform.tileZoom)-this.transform.elevation:null}}const io={compact:!0,customAttribution:'MapLibre'};class ta{constructor(i=io){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=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=i}getDefaultPosition(){return"bottom-right"}onAdd(i){return this._map=i,this._compact=this.options.compact,this._container=r.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=r.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.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(){r.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(i,a){const C=this._map._getUIString(`AttributionControl.${a}`);i.title=C,i.setAttribute("aria-label",C)}_updateAttributions(){if(!this._map.style)return;let i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(F=>typeof F!="string"?"":F)):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){const F=this._map.style.stylesheet;this.styleOwner=F.owner,this.styleId=F.id}const a=this._map.style.sourceCaches;for(const F in a){const q=a[F];if(q.used||q.usedForTerrain){const te=q.getSource();te.attribution&&i.indexOf(te.attribution)<0&&i.push(te.attribution)}}i=i.filter(F=>String(F).trim()),i.sort((F,q)=>F.length-q.length),i=i.filter((F,q)=>{for(let te=q+1;te=0)return!1;return!0});const C=i.join(" | ");C!==this._attribHTML&&(this._attribHTML=C,i.length?(this._innerContainer.innerHTML=C,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Qo{constructor(i={}){this._updateCompact=()=>{const a=this._container.children;if(a.length){const C=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&C.classList.add("maplibregl-compact"):C.classList.remove("maplibregl-compact")}},this.options=i}getDefaultPosition(){return"bottom-left"}onAdd(i){this._map=i,this._compact=this.options&&this.options.compact,this._container=r.create("div","maplibregl-ctrl");const a=r.create("a","maplibregl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://maplibre.org/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){r.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ac{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(i){const a=++this._id;return this._queue.push({callback:i,id:a,cancelled:!1}),a}remove(i){const a=this._currentlyRunning,C=a?this._queue.concat(a):this._queue;for(const F of C)if(F.id===i)return void(F.cancelled=!0)}run(i=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const a=this._currentlyRunning=this._queue;this._queue=[];for(const C of a)if(!C.cancelled&&(C.callback(i),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var yi=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Io extends e.E{constructor(i){super(),this.sourceCache=i,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,i.usedForTerrain=!0,i.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(i,a){this.sourceCache.update(i,a),this._renderableTilesKeys=[];const C={};for(const F of i.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a}))C[F.key]=!0,this._renderableTilesKeys.push(F.key),this._tiles[F.key]||(F.posMatrix=new Float64Array(16),e.aQ(F.posMatrix,0,e.X,0,e.X,0,1),this._tiles[F.key]=new _e(F,this.tileSize));for(const F in this._tiles)C[F]||delete this._tiles[F]}freeRtt(i){for(const a in this._tiles){const C=this._tiles[a];(!i||C.tileID.equals(i)||C.tileID.isChildOf(i)||i.isChildOf(C.tileID))&&(C.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(i=>this.getTileByID(i))}getTileByID(i){return this._tiles[i]}getTerrainCoords(i){const a={};for(const C of this._renderableTilesKeys){const F=this._tiles[C].tileID;if(F.canonical.equals(i.canonical)){const q=i.clone();q.posMatrix=new Float64Array(16),e.aQ(q.posMatrix,0,e.X,0,e.X,0,1),a[C]=q}else if(F.canonical.isChildOf(i.canonical)){const q=i.clone();q.posMatrix=new Float64Array(16);const te=F.canonical.z-i.canonical.z,ue=F.canonical.x-(F.canonical.x>>te<>te<>te;e.aQ(q.posMatrix,0,Ae,0,Ae,0,1),e.J(q.posMatrix,q.posMatrix,[-ue*Ae,-ve*Ae,0]),a[C]=q}else if(i.canonical.isChildOf(F.canonical)){const q=i.clone();q.posMatrix=new Float64Array(16);const te=i.canonical.z-F.canonical.z,ue=i.canonical.x-(i.canonical.x>>te<>te<>te;e.aQ(q.posMatrix,0,e.X,0,e.X,0,1),e.J(q.posMatrix,q.posMatrix,[ue*Ae,ve*Ae,0]),e.K(q.posMatrix,q.posMatrix,[1/2**te,1/2**te,0]),a[C]=q}}return a}getSourceTile(i,a){const C=this.sourceCache._source;let F=i.overscaledZ-this.deltaZoom;if(F>C.maxzoom&&(F=C.maxzoom),F=C.minzoom&&(!q||!q.dem);)q=this.sourceCache.getTileByID(i.scaledTo(F--).key);return q}tilesAfterTime(i=Date.now()){return Object.values(this._tiles).filter(a=>a.timeAdded>=i)}}class za{constructor(i,a,C){this.painter=i,this.sourceCache=new Io(a),this.options=C,this.exaggeration=typeof C.exaggeration=="number"?C.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(i,a,C,F=e.X){var q;if(!(a>=0&&a=0&&Ci.canonical.z&&(i.canonical.z>=F?q=i.canonical.z-F:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const te=i.canonical.x-(i.canonical.x>>q<>q<>8<<4|q>>8,a[te+3]=0;const C=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),F=new M(i,C,i.gl.RGBA,{premultiply:!1});return F.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._coordsTexture=F,F}pointCoordinate(i){this.painter.maybeDrawDepthAndCoords(!0);const a=new Uint8Array(4),C=this.painter.context,F=C.gl,q=Math.round(i.x*this.painter.pixelRatio/devicePixelRatio),te=Math.round(i.y*this.painter.pixelRatio/devicePixelRatio),ue=Math.round(this.painter.height/devicePixelRatio);C.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),F.readPixels(q,ue-te-1,1,1,F.RGBA,F.UNSIGNED_BYTE,a),C.bindFramebuffer.set(null);const ve=a[0]+(a[2]>>4<<8),Ae=a[1]+((15&a[2])<<8),Re=this.coordsIndex[255-a[3]],Ue=Re&&this.sourceCache.getTileByID(Re);if(!Ue)return null;const it=this._coordsTextureSize,ct=(1<i.id!==a),this._recentlyUsed.push(i.id)}stampObject(i){i.stamp=++this._stamp}getOrCreateFreeObject(){for(const a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const i=this._createObject(this._objects.length);return this._objects.push(i),i}freeObject(i){i.inUse=!1}freeAllObjects(){for(const i of this._objects)this.freeObject(i)}isFull(){return!(this._objects.length!i.inUse)===!1}}const sl={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class $l{constructor(i,a){this.painter=i,this.terrain=a,this.pool=new xu(i.context,30,a.sourceCache.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(i){return this.pool.getObjectForId(i.rtt[this._stacks.length-1].id).texture}prepareForRender(i,a){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=i._order.filter(C=>!i._layers[C].isHidden(a)),this._coordsDescendingInv={};for(const C in i.sourceCaches){this._coordsDescendingInv[C]={};const F=i.sourceCaches[C].getVisibleCoordinates();for(const q of F){const te=this.terrain.sourceCache.getTerrainCoords(q);for(const ue in te)this._coordsDescendingInv[C][ue]||(this._coordsDescendingInv[C][ue]=[]),this._coordsDescendingInv[C][ue].push(te[ue])}}this._coordsDescendingInvStr={};for(const C of i._order){const F=i._layers[C],q=F.source;if(sl[F.type]&&!this._coordsDescendingInvStr[q]){this._coordsDescendingInvStr[q]={};for(const te in this._coordsDescendingInv[q])this._coordsDescendingInvStr[q][te]=this._coordsDescendingInv[q][te].map(ue=>ue.key).sort().join()}}for(const C of this._renderableTiles)for(const F in this._coordsDescendingInvStr){const q=this._coordsDescendingInvStr[F][C.tileID.key];q&&q!==C.rttCoords[F]&&(C.rtt=[])}}renderLayer(i){if(i.isHidden(this.painter.transform.zoom))return!1;const a=i.type,C=this.painter,F=this._renderableLayerIds[this._renderableLayerIds.length-1]===i.id;if(sl[a]&&(this._prevType&&sl[this._prevType]||this._stacks.push([]),this._prevType=a,this._stacks[this._stacks.length-1].push(i.id),!F))return!0;if(sl[this._prevType]||sl[a]&&F){this._prevType=a;const q=this._stacks.length-1,te=this._stacks[q]||[];for(const ue of this._renderableTiles){if(this.pool.isFull()&&(mu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(ue),ue.rtt[q]){const Ae=this.pool.getObjectForId(ue.rtt[q].id);if(Ae.stamp===ue.rtt[q].stamp){this.pool.useObject(Ae);continue}}const ve=this.pool.getOrCreateFreeObject();this.pool.useObject(ve),this.pool.stampObject(ve),ue.rtt[q]={id:ve.id,stamp:ve.stamp},C.context.bindFramebuffer.set(ve.fbo.framebuffer),C.context.clear({color:e.aN.transparent,stencil:0}),C.currentStencilSource=void 0;for(let Ae=0;Ae{R.touchstart=R.dragStart,R.touchmoveWindow=R.dragMove,R.touchend=R.dragEnd},Cl={showCompass:!0,showZoom:!0,visualizePitch:!1};class di{constructor(i,a,C=!1){this.mousedown=te=>{this.startMouse(e.e({},te,{ctrlKey:!0,preventDefault:()=>te.preventDefault()}),r.mousePos(this.element,te)),r.addEventListener(window,"mousemove",this.mousemove),r.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=te=>{this.moveMouse(te,r.mousePos(this.element,te))},this.mouseup=te=>{this.mouseRotate.dragEnd(te),this.mousePitch&&this.mousePitch.dragEnd(te),this.offTemp()},this.touchstart=te=>{te.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,te.targetTouches)[0],this.startTouch(te,this._startPos),r.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.addEventListener(window,"touchend",this.touchend))},this.touchmove=te=>{te.targetTouches.length!==1?this.reset():(this._lastPos=r.touchPos(this.element,te.targetTouches)[0],this.moveTouch(te,this._lastPos))},this.touchend=te=>{te.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const F=i.dragRotate._mouseRotate.getClickTolerance(),q=i.dragRotate._mousePitch.getClickTolerance();this.element=a,this.mouseRotate=yu({clickTolerance:F,enable:!0}),this.touchRotate=(({enable:te,clickTolerance:ue,bearingDegreesPerPixelMoved:ve=.8})=>{const Ae=new Zl;return new cs({clickTolerance:ue,move:(Re,Ue)=>({bearingDelta:(Ue.x-Re.x)*ve}),moveStateManager:Ae,enable:te,assignEvents:eo})})({clickTolerance:F,enable:!0}),this.map=i,C&&(this.mousePitch=ru({clickTolerance:q,enable:!0}),this.touchPitch=(({enable:te,clickTolerance:ue,pitchDegreesPerPixelMoved:ve=-.5})=>{const Ae=new Zl;return new cs({clickTolerance:ue,move:(Re,Ue)=>({pitchDelta:(Ue.y-Re.y)*ve}),moveStateManager:Ae,enable:te,assignEvents:eo})})({clickTolerance:q,enable:!0})),r.addEventListener(a,"mousedown",this.mousedown),r.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(a,"touchcancel",this.reset)}startMouse(i,a){this.mouseRotate.dragStart(i,a),this.mousePitch&&this.mousePitch.dragStart(i,a),r.disableDrag()}startTouch(i,a){this.touchRotate.dragStart(i,a),this.touchPitch&&this.touchPitch.dragStart(i,a),r.disableDrag()}moveMouse(i,a){const C=this.map,{bearingDelta:F}=this.mouseRotate.dragMove(i,a)||{};if(F&&C.setBearing(C.getBearing()+F),this.mousePitch){const{pitchDelta:q}=this.mousePitch.dragMove(i,a)||{};q&&C.setPitch(C.getPitch()+q)}}moveTouch(i,a){const C=this.map,{bearingDelta:F}=this.touchRotate.dragMove(i,a)||{};if(F&&C.setBearing(C.getBearing()+F),this.touchPitch){const{pitchDelta:q}=this.touchPitch.dragMove(i,a)||{};q&&C.setPitch(C.getPitch()+q)}}off(){const i=this.element;r.removeEventListener(i,"mousedown",this.mousedown),r.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend),r.removeEventListener(i,"touchcancel",this.reset),this.offTemp()}offTemp(){r.enableDrag(),r.removeEventListener(window,"mousemove",this.mousemove),r.removeEventListener(window,"mouseup",this.mouseup),r.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),r.removeEventListener(window,"touchend",this.touchend)}}let Fi;function Mo(R,i,a){const C=new e.N(R.lng,R.lat);if(R=new e.N(R.lng,R.lat),i){const F=new e.N(R.lng-360,R.lat),q=new e.N(R.lng+360,R.lat),te=a.locationPoint(R).distSqr(i);a.locationPoint(F).distSqr(i)180;){const F=a.locationPoint(R);if(F.x>=0&&F.y>=0&&F.x<=a.width&&F.y<=a.height)break;R.lng>a.center.lng?R.lng-=360:R.lng+=360}return R.lng!==C.lng&&a.locationPoint(R).y>a.height/2-a.getHorizon()?R:C}const Il={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 su(R,i,a){const C=R.classList;for(const F in Il)C.remove(`maplibregl-${a}-anchor-${F}`);C.add(`maplibregl-${a}-anchor-${i}`)}class ho extends e.E{constructor(i){if(super(),this._onKeyPress=a=>{const C=a.code,F=a.charCode||a.keyCode;C!=="Space"&&C!=="Enter"&&F!==32&&F!==13||this.togglePopup()},this._onMapClick=a=>{const C=a.originalEvent.target,F=this._element;this._popup&&(C===F||F.contains(C))&&this.togglePopup()},this._update=a=>{var C;if(!this._map)return;const F=this._map.loaded()&&!this._map.isMoving();((a==null?void 0:a.type)==="terrain"||(a==null?void 0:a.type)==="render"&&!F)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies?this._lngLat=Mo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(C=this._lngLat)===null||C===void 0?void 0:C.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 q="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?q=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(q=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let te="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?te="rotateX(0deg)":this._pitchAlignment==="map"&&(te=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),r.setTransform(this._element,`${Il[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${te} ${q}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(a&&a.type==="moveend")}).catch(()=>{})},this._onMove=a=>{if(!this._isDragging){const C=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=C}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.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=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._scale=i&&i.scale||1,this._draggable=i&&i.draggable||!1,this._clickTolerance=i&&i.clickTolerance||0,this._subpixelPositioning=i&&i.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=i&&i.rotation||0,this._rotationAlignment=i&&i.rotationAlignment||"auto",this._pitchAlignment=i&&i.pitchAlignment&&i.pitchAlignment!=="auto"?i.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(i==null?void 0:i.opacity,i==null?void 0:i.opacityWhenCovered),i&&i.element)this._element=i.element,this._offset=e.P.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");const a=r.createNS("http://www.w3.org/2000/svg","svg"),C=41,F=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${C}px`),a.setAttributeNS(null,"width",`${F}px`),a.setAttributeNS(null,"viewBox",`0 0 ${F} ${C}`);const q=r.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"stroke","none"),q.setAttributeNS(null,"stroke-width","1"),q.setAttributeNS(null,"fill","none"),q.setAttributeNS(null,"fill-rule","evenodd");const te=r.createNS("http://www.w3.org/2000/svg","g");te.setAttributeNS(null,"fill-rule","nonzero");const ue=r.createNS("http://www.w3.org/2000/svg","g");ue.setAttributeNS(null,"transform","translate(3.0, 29.0)"),ue.setAttributeNS(null,"fill","#000000");const ve=[{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 Mt of ve){const Ut=r.createNS("http://www.w3.org/2000/svg","ellipse");Ut.setAttributeNS(null,"opacity","0.04"),Ut.setAttributeNS(null,"cx","10.5"),Ut.setAttributeNS(null,"cy","5.80029008"),Ut.setAttributeNS(null,"rx",Mt.rx),Ut.setAttributeNS(null,"ry",Mt.ry),ue.appendChild(Ut)}const Ae=r.createNS("http://www.w3.org/2000/svg","g");Ae.setAttributeNS(null,"fill",this._color);const Re=r.createNS("http://www.w3.org/2000/svg","path");Re.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"),Ae.appendChild(Re);const Ue=r.createNS("http://www.w3.org/2000/svg","g");Ue.setAttributeNS(null,"opacity","0.25"),Ue.setAttributeNS(null,"fill","#000000");const it=r.createNS("http://www.w3.org/2000/svg","path");it.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"),Ue.appendChild(it);const ct=r.createNS("http://www.w3.org/2000/svg","g");ct.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ct.setAttributeNS(null,"fill","#FFFFFF");const dt=r.createNS("http://www.w3.org/2000/svg","g");dt.setAttributeNS(null,"transform","translate(8.0, 8.0)");const bt=r.createNS("http://www.w3.org/2000/svg","circle");bt.setAttributeNS(null,"fill","#000000"),bt.setAttributeNS(null,"opacity","0.25"),bt.setAttributeNS(null,"cx","5.5"),bt.setAttributeNS(null,"cy","5.5"),bt.setAttributeNS(null,"r","5.4999962");const Ct=r.createNS("http://www.w3.org/2000/svg","circle");Ct.setAttributeNS(null,"fill","#FFFFFF"),Ct.setAttributeNS(null,"cx","5.5"),Ct.setAttributeNS(null,"cy","5.5"),Ct.setAttributeNS(null,"r","5.4999962"),dt.appendChild(bt),dt.appendChild(Ct),te.appendChild(ue),te.appendChild(Ae),te.appendChild(Ue),te.appendChild(ct),te.appendChild(dt),a.appendChild(te),a.setAttributeNS(null,"height",C*this._scale+"px"),a.setAttributeNS(null,"width",F*this._scale+"px"),this._element.appendChild(a),this._offset=e.P.convert(i&&i.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),su(this._element,this._anchor,"marker"),i&&i.className)for(const a of i.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(i){return this.remove(),this._map=i,this._element.setAttribute("aria-label",i._getUIString("Marker.Title")),i.getCanvasContainer().appendChild(this._element),i.on("move",this._update),i.on("moveend",this._update),i.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),r.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=e.N.convert(i),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(i){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),i){if(!("offset"in i.options)){const F=Math.abs(13.5)/Math.SQRT2;i.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[F,-1*(24.6+F)],"bottom-right":[-F,-1*(24.6+F)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=i,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(i){return this._subpixelPositioning=i,this}getPopup(){return this._popup}togglePopup(){const i=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:i?(i.isOpen()?i.remove():(i.setLngLat(this._lngLat),i.addTo(this._map)),this):this}_updateOpacity(i=!1){var a,C;if(!(!((a=this._map)===null||a===void 0)&&a.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(i)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const F=this._map,q=F.terrain.depthAtPoint(this._pos),te=F.terrain.getElevationForLngLatZoom(this._lngLat,F.transform.tileZoom);if(F.transform.lngLatToCameraDepth(this._lngLat,te)-q<.006)return void(this._element.style.opacity=this._opacity);const ue=-this._offset.y/F.transform._pixelPerMeter,ve=Math.sin(F.getPitch()*Math.PI/180)*ue,Ae=F.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),Re=F.transform.lngLatToCameraDepth(this._lngLat,te+ve)-Ae>.006;!((C=this._popup)===null||C===void 0)&&C.isOpen()&&Re&&this._popup.remove(),this._element.style.opacity=Re?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(i){return this._offset=e.P.convert(i),this._update(),this}addClassName(i){this._element.classList.add(i)}removeClassName(i){this._element.classList.remove(i)}toggleClassName(i){return this._element.classList.toggle(i)}setDraggable(i){return this._draggable=!!i,this._map&&(i?(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(i){return this._rotation=i||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(i){return this._rotationAlignment=i||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(i){return this._pitchAlignment=i&&i!=="auto"?i:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(i,a){return i===void 0&&a===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),i!==void 0&&(this._opacity=i),a!==void 0&&(this._opacityWhenCovered=a),this._map&&this._updateOpacity(!0),this}}const _u={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let da=0,Ys=!1;class Ai extends e.E{constructor(i){super(),this._onSuccess=a=>{if(this._map){if(this._isOutOfMapMaxBounds(a))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",a)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=a,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(a),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(a),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",a)),this._finish()}},this._updateCamera=a=>{const C=new e.N(a.coords.longitude,a.coords.latitude),F=a.coords.accuracy,q=this._map.getBearing(),te=e.e({bearing:q},this.options.fitBoundsOptions),ue=Ee.fromLngLat(C,F);this._map.fitBounds(ue,te,{geolocateSource:!0})},this._updateMarker=a=>{if(a){const C=new e.N(a.coords.longitude,a.coords.latitude);this._accuracyCircleMarker.setLngLat(C).addTo(this._map),this._userLocationDotMarker.setLngLat(C).addTo(this._map),this._accuracy=a.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=a=>{if(this._map){if(this.options.trackUserLocation)if(a.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const C=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(a.code===3&&Ys)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",a)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=a=>{if(this._map){if(a===!1){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const C=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}else{const C=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=C,this._geolocateButton.setAttribute("aria-label",C)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ho({element:this._dotElement}),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ho({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",C=>{const F=C.originalEvent&&C.originalEvent.type==="resize";C.geolocateSource||this._watchState!=="ACTIVE_LOCK"||F||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))})}},this.options=e.e({},_u,i)}onAdd(i){return this._map=i,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(a=!1){if(Fi!==void 0&&!a)return Fi;if(window.navigator.permissions===void 0)return Fi=!!window.navigator.geolocation,Fi;try{Fi=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Fi=!!window.navigator.geolocation}return Fi})}().then(a=>this._finishSetupUI(a)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,da=0,Ys=!1}_isOutOfMapMaxBounds(i){const a=this._map.getMaxBounds(),C=i.coords;return a&&(C.longitudea.getEast()||C.latitudea.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 i=this._map.getBounds(),a=i.getSouthEast(),C=i.getNorthEast(),F=a.distanceTo(C),q=this._map._container.clientHeight,te=Math.ceil(this._accuracy/(F/q)*2);this._circleElement.style.width=`${te}px`,this._circleElement.style.height=`${te}px`}trigger(){if(!this._setup)return e.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 e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":da--,Ys=!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 e.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 e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let i;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),da++,da>1?(i={maximumAge:6e5,timeout:0},Ys=!0):(i=this.options.positionOptions,Ys=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,i)}}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)}}const xi={maxWidth:100,unit:"metric"};function xa(R,i,a){const C=a&&a.maxWidth||100,F=R._container.clientHeight/2,q=R.unproject([0,F]),te=R.unproject([C,F]),ue=q.distanceTo(te);if(a&&a.unit==="imperial"){const ve=3.2808*ue;ve>5280?es(i,C,ve/5280,R._getUIString("ScaleControl.Miles")):es(i,C,ve,R._getUIString("ScaleControl.Feet"))}else a&&a.unit==="nautical"?es(i,C,ue/1852,R._getUIString("ScaleControl.NauticalMiles")):ue>=1e3?es(i,C,ue/1e3,R._getUIString("ScaleControl.Kilometers")):es(i,C,ue,R._getUIString("ScaleControl.Meters"))}function es(R,i,a,C){const F=function(te){const ue=Math.pow(10,`${Math.floor(te)}`.length-1);let ve=te/ue;return ve=ve>=10?10:ve>=5?5:ve>=3?3:ve>=2?2:ve>=1?1:function(Ae){const Re=Math.pow(10,Math.ceil(-Math.log(Ae)/Math.LN10));return Math.round(Ae*Re)/Re}(ve),ue*ve}(a),q=F/a;R.style.width=i*q+"px",R.innerHTML=`${F} ${C}`}class bu extends e.E{constructor(i={}){super(),this._onFullscreenChange=()=>{var a;let C=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((a=C==null?void 0:C.shadowRoot)===null||a===void 0)&&a.fullscreenElement;)C=C.shadowRoot.fullscreenElement;C===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,i&&i.container&&(i.container instanceof HTMLElement?this._container=i.container:e.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(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){r.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const i=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon",i).setAttribute("aria-hidden","true"),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i}_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 e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.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()}}const js={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},xt=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");class Tt extends e.E{constructor(i){super(),this.remove=()=>(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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=a=>{this._update(a.point)},this._onMouseMove=a=>{this._update(a.point)},this._onDrag=a=>{this._update(a.point)},this._update=a=>{var C;const F=this._lngLat||this._trackPointer;if(!this._map||!F||!this._content)return;if(!this._container){if(this._container=r.create("div","maplibregl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const Ae of this.options.className.split(" "))this._container.classList.add(Ae);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._map.transform.renderWorldCopies&&!this._trackPointer?this._lngLat=Mo(this._lngLat,this._flatPos,this._map.transform):this._lngLat=(C=this._lngLat)===null||C===void 0?void 0:C.wrap(),this._trackPointer&&!a)return;const q=this._flatPos=this._pos=this._trackPointer&&a?a:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&a?a:this._map.transform.locationPoint(this._lngLat));let te=this.options.anchor;const ue=Dt(this.options.offset);if(!te){const Ae=this._container.offsetWidth,Re=this._container.offsetHeight;let Ue;Ue=q.y+ue.bottom.ythis._map.transform.height-Re?["bottom"]:[],q.xthis._map.transform.width-Ae/2&&Ue.push("right"),te=Ue.length===0?"bottom":Ue.join("-")}let ve=q.add(ue[te]);this.options.subpixelPositioning||(ve=ve.round()),r.setTransform(this._container,`${Il[te]} translate(${ve.x}px,${ve.y}px)`),su(this._container,te,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(js),i)}addTo(i){return this._map&&this.remove(),this._map=i,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 e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(i){return this._lngLat=e.N.convert(i),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(i){return this.setDOMContent(document.createTextNode(i))}setHTML(i){const a=document.createDocumentFragment(),C=document.createElement("body");let F;for(C.innerHTML=i;F=C.firstChild,F;)a.appendChild(F);return this.setDOMContent(a)}getMaxWidth(){var i;return(i=this._container)===null||i===void 0?void 0:i.style.maxWidth}setMaxWidth(i){return this.options.maxWidth=i,this._update(),this}setDOMContent(i){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(i),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(i){return this._container&&this._container.classList.add(i),this}removeClassName(i){return this._container&&this._container.classList.remove(i),this}setOffset(i){return this.options.offset=i,this._update(),this}toggleClassName(i){if(this._container)return this._container.classList.toggle(i)}setSubpixelPositioning(i){this.options.subpixelPositioning=i}_createCloseButton(){this.options.closeButton&&(this._closeButton=r.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 i=this._container.querySelector(xt);i&&i.focus()}}function Dt(R){if(R){if(typeof R=="number"){const i=Math.round(Math.abs(R)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,R),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-R),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(R,0),right:new e.P(-R,0)}}if(R instanceof e.P||Array.isArray(R)){const i=e.P.convert(R);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(R.center||[0,0]),top:e.P.convert(R.top||[0,0]),"top-left":e.P.convert(R["top-left"]||[0,0]),"top-right":e.P.convert(R["top-right"]||[0,0]),bottom:e.P.convert(R.bottom||[0,0]),"bottom-left":e.P.convert(R["bottom-left"]||[0,0]),"bottom-right":e.P.convert(R["bottom-right"]||[0,0]),left:e.P.convert(R.left||[0,0]),right:e.P.convert(R.right||[0,0])}}return Dt(new e.P(0,0))}const X=w;d.AJAXError=e.bg,d.Evented=e.E,d.LngLat=e.N,d.MercatorCoordinate=e.Z,d.Point=e.P,d.addProtocol=e.bh,d.config=e.a,d.removeProtocol=e.bi,d.AttributionControl=ta,d.BoxZoomHandler=Co,d.CanvasSource=Me,d.CooperativeGesturesHandler=As,d.DoubleClickZoomHandler=Na,d.DragPanHandler=El,d.DragRotateHandler=ks,d.EdgeInsets=Zs,d.FullscreenControl=bu,d.GeoJSONSource=Ie,d.GeolocateControl=Ai,d.Hash=Ho,d.ImageSource=Pe,d.KeyboardHandler=Ml,d.LngLatBounds=Ee,d.LogoControl=Qo,d.Map=class extends So{constructor(R){e.be.mark(e.bf.create);const i=Object.assign(Object.assign({},ou),R);if(i.minZoom!=null&&i.maxZoom!=null&&i.minZoom>i.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(i.minPitch!=null&&i.maxPitch!=null&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(i.minPitch!=null&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(i.maxPitch!=null&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new La(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ac,this._controls=[],this._mapId=e.a4(),this._contextLost=C=>{C.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:C}))},this._contextRestored=C=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:C}))},this._onMapScroll=C=>{if(C.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=i.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=i.preserveDrawingBuffer===!0,this._antialias=i.antialias===!0,this._trackResize=i.trackResize===!0,this._bearingSnap=i.bearingSnap,this._refreshExpiredTiles=i.refreshExpiredTiles===!0,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=i.crossSourceCollisions===!0,this._collectResourceTiming=i.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},dc),i.locale),this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=i.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=x.addThrottleControl(()=>this.isMoving()),this._requestManager=new m(i.transformRequest),typeof i.container=="string"){if(this._container=document.getElementById(i.container),!this._container)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let C=!1;const F=ba(q=>{this._trackResize&&!this._removed&&this.resize(q)._update()},50);this._resizeObserver=new ResizeObserver(q=>{C?F(q):C=!0}),this._resizeObserver.observe(this._container)}this.handlers=new ya(this,i);const a=typeof i.hash=="string"&&i.hash||void 0;this._hash=i.hash&&new Ho(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,e.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new ta(typeof i.attributionControl=="boolean"?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new Qo,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",C=>{this._update(C.dataType==="style"),this.fire(new e.k(`${C.dataType}data`,C))}),this.on("dataloading",C=>{this.fire(new e.k(`${C.dataType}dataloading`,C))}),this.on("dataabort",C=>{this.fire(new e.k("sourcedataabort",C))})}_getMapId(){return this._mapId}addControl(R,i){if(i===void 0&&(i=R.getDefaultPosition?R.getDefaultPosition():"top-right"),!R||!R.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const a=R.onAdd(this);this._controls.push(R);const C=this._controlPositions[i];return i.indexOf("bottom")!==-1?C.insertBefore(a,C.firstChild):C.appendChild(a),this}removeControl(R){if(!R||!R.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(R);return i>-1&&this._controls.splice(i,1),R.onRemove(this),this}hasControl(R){return this._controls.indexOf(R)>-1}calculateCameraOptionsFromTo(R,i,a,C){return C==null&&this.terrain&&(C=this.terrain.getElevationForLngLatZoom(a,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(R,i,a,C)}resize(R){var i;const a=this._containerDimensions(),C=a[0],F=a[1],q=this._getClampedPixelRatio(C,F);if(this._resizeCanvas(C,F,q),this.painter.resize(C,F,q),this.painter.overLimit()){const ue=this.painter.context.gl;this._maxCanvasSize=[ue.drawingBufferWidth,ue.drawingBufferHeight];const ve=this._getClampedPixelRatio(C,F);this._resizeCanvas(C,F,ve),this.painter.resize(C,F,ve)}this.transform.resize(C,F),(i=this._requestedCameraState)===null||i===void 0||i.resize(C,F);const te=!this._moving;return te&&(this.stop(),this.fire(new e.k("movestart",R)).fire(new e.k("move",R))),this.fire(new e.k("resize",R)),te&&this.fire(new e.k("moveend",R)),this}_getClampedPixelRatio(R,i){const{0:a,1:C}=this._maxCanvasSize,F=this.getPixelRatio(),q=R*F,te=i*F,ue=q>a?a/q:1,ve=te>C?C/te:1;return Math.min(ue,ve)*F}getPixelRatio(){var R;return(R=this._overridePixelRatio)!==null&&R!==void 0?R:devicePixelRatio}setPixelRatio(R){this._overridePixelRatio=R,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(R){return this.transform.setMaxBounds(Ee.convert(R)),this._update()}setMinZoom(R){if((R=R??-2)>=-2&&R<=this.transform.maxZoom)return this.transform.minZoom=R,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=R,this._update(),this.getZoom()>R&&this.setZoom(R),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(R){if((R=R??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(R>=0&&R<=this.transform.maxPitch)return this.transform.minPitch=R,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(R>=this.transform.minPitch)return this.transform.maxPitch=R,this._update(),this.getPitch()>R&&this.setPitch(R),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(R){return this.transform.renderWorldCopies=R,this._update()}project(R){return this.transform.locationPoint(e.N.convert(R),this.style&&this.terrain)}unproject(R){return this.transform.pointLocation(e.P.convert(R),this.terrain)}isMoving(){var R;return this._moving||((R=this.handlers)===null||R===void 0?void 0:R.isMoving())}isZooming(){var R;return this._zooming||((R=this.handlers)===null||R===void 0?void 0:R.isZooming())}isRotating(){var R;return this._rotating||((R=this.handlers)===null||R===void 0?void 0:R.isRotating())}_createDelegatedListener(R,i,a){if(R==="mouseenter"||R==="mouseover"){let C=!1;return{layer:i,listener:a,delegates:{mousemove:q=>{const te=this.getLayer(i)?this.queryRenderedFeatures(q.point,{layers:[i]}):[];te.length?C||(C=!0,a.call(this,new us(R,this,q.originalEvent,{features:te}))):C=!1},mouseout:()=>{C=!1}}}}if(R==="mouseleave"||R==="mouseout"){let C=!1;return{layer:i,listener:a,delegates:{mousemove:te=>{(this.getLayer(i)?this.queryRenderedFeatures(te.point,{layers:[i]}):[]).length?C=!0:C&&(C=!1,a.call(this,new us(R,this,te.originalEvent)))},mouseout:te=>{C&&(C=!1,a.call(this,new us(R,this,te.originalEvent)))}}}}{const C=F=>{const q=this.getLayer(i)?this.queryRenderedFeatures(F.point,{layers:[i]}):[];q.length&&(F.features=q,a.call(this,F),delete F.features)};return{layer:i,listener:a,delegates:{[R]:C}}}}on(R,i,a){if(a===void 0)return super.on(R,i);const C=this._createDelegatedListener(R,i,a);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[R]=this._delegatedListeners[R]||[],this._delegatedListeners[R].push(C);for(const F in C.delegates)this.on(F,C.delegates[F]);return this}once(R,i,a){if(a===void 0)return super.once(R,i);const C=this._createDelegatedListener(R,i,a);for(const F in C.delegates)this.once(F,C.delegates[F]);return this}off(R,i,a){return a===void 0?super.off(R,i):(this._delegatedListeners&&this._delegatedListeners[R]&&(C=>{const F=C[R];for(let q=0;qthis._updateStyle(R,i));const a=this.style&&i.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!R)),R?(this.style=new ni(this,i||{}),this.style.setEventedParent(this,{style:this.style}),typeof R=="string"?this.style.loadURL(R,i,a):this.style.loadJSON(R,i,a),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ni(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(R,i){if(typeof R=="string"){const a=R,C=this._requestManager.transformRequest(a,"Style");e.h(C,new AbortController).then(F=>{this._updateDiff(F.data,i)}).catch(F=>{F&&this.fire(new e.j(F))})}else typeof R=="object"&&this._updateDiff(R,i)}_updateDiff(R,i){try{this.style.setState(R,i)&&this._update(!0)}catch(a){e.w(`Unable to perform style diff: ${a.message||a.error||a}. Rebuilding the style from scratch.`),this._updateStyle(R,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(R,i){return this._lazyInitEmptyStyle(),this.style.addSource(R,i),this._update(!0)}isSourceLoaded(R){const i=this.style&&this.style.sourceCaches[R];if(i!==void 0)return i.loaded();this.fire(new e.j(new Error(`There is no source with ID '${R}'`)))}setTerrain(R){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),R){const i=this.style.sourceCaches[R.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${R.source}`);this.terrain===null&&i.reload();for(const a in this.style._layers){const C=this.style._layers[a];C.type==="hillshade"&&C.source===R.source&&e.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 za(this.painter,i,R),this.painter.renderToTexture=new $l(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=a=>{a.dataType==="style"?this.terrain.sourceCache.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==R.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(a.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 e.k("terrain",{terrain:R})),this}getTerrain(){var R,i;return(i=(R=this.terrain)===null||R===void 0?void 0:R.options)!==null&&i!==void 0?i:null}areTilesLoaded(){const R=this.style&&this.style.sourceCaches;for(const i in R){const a=R[i]._tiles;for(const C in a){const F=a[C];if(F.state!=="loaded"&&F.state!=="errored")return!1}}return!0}removeSource(R){return this.style.removeSource(R),this._update(!0)}getSource(R){return this.style.getSource(R)}addImage(R,i,a={}){const{pixelRatio:C=1,sdf:F=!1,stretchX:q,stretchY:te,content:ue,textFitWidth:ve,textFitHeight:Ae}=a;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(i.width===void 0||i.height===void 0)return this.fire(new e.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:Re,height:Ue,data:it}=i,ct=i;return this.style.addImage(R,{data:new e.R({width:Re,height:Ue},new Uint8Array(it)),pixelRatio:C,stretchX:q,stretchY:te,content:ue,textFitWidth:ve,textFitHeight:Ae,sdf:F,version:0,userImage:ct}),ct.onAdd&&ct.onAdd(this,R),this}}{const{width:Re,height:Ue,data:it}=u.getImageData(i);this.style.addImage(R,{data:new e.R({width:Re,height:Ue},it),pixelRatio:C,stretchX:q,stretchY:te,content:ue,textFitWidth:ve,textFitHeight:Ae,sdf:F,version:0})}}updateImage(R,i){const a=this.style.getImage(R);if(!a)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const C=i instanceof HTMLImageElement||e.b(i)?u.getImageData(i):i,{width:F,height:q,data:te}=C;if(F===void 0||q===void 0)return this.fire(new e.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(F!==a.data.width||q!==a.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const ue=!(i instanceof HTMLImageElement||e.b(i));return a.data.replace(te,ue),this.style.updateImage(R,a),this}getImage(R){return this.style.getImage(R)}hasImage(R){return R?!!this.style.getImage(R):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(R){this.style.removeImage(R)}loadImage(R){return x.getImage(this._requestManager.transformRequest(R,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(R,i){return this._lazyInitEmptyStyle(),this.style.addLayer(R,i),this._update(!0)}moveLayer(R,i){return this.style.moveLayer(R,i),this._update(!0)}removeLayer(R){return this.style.removeLayer(R),this._update(!0)}getLayer(R){return this.style.getLayer(R)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(R,i,a){return this.style.setLayerZoomRange(R,i,a),this._update(!0)}setFilter(R,i,a={}){return this.style.setFilter(R,i,a),this._update(!0)}getFilter(R){return this.style.getFilter(R)}setPaintProperty(R,i,a,C={}){return this.style.setPaintProperty(R,i,a,C),this._update(!0)}getPaintProperty(R,i){return this.style.getPaintProperty(R,i)}setLayoutProperty(R,i,a,C={}){return this.style.setLayoutProperty(R,i,a,C),this._update(!0)}getLayoutProperty(R,i){return this.style.getLayoutProperty(R,i)}setGlyphs(R,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(R,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(R,i,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(R,i,a,C=>{C||this._update(!0)}),this}removeSprite(R){return this._lazyInitEmptyStyle(),this.style.removeSprite(R),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(R,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(R,i,a=>{a||this._update(!0)}),this}setLight(R,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(R,i),this._update(!0)}getLight(){return this.style.getLight()}setSky(R){return this._lazyInitEmptyStyle(),this.style.setSky(R),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(R,i){return this.style.setFeatureState(R,i),this._update()}removeFeatureState(R,i){return this.style.removeFeatureState(R,i),this._update()}getFeatureState(R){return this.style.getFeatureState(R)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let R=0,i=0;return this._container&&(R=this._container.clientWidth||400,i=this._container.clientHeight||300),[R,i]}_setupContainer(){const R=this._container;R.classList.add("maplibregl-map");const i=this._canvasContainer=r.create("div","maplibregl-canvas-container",R);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas",i),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 a=this._containerDimensions(),C=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],C);const F=this._controlContainer=r.create("div","maplibregl-control-container",R),q=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(te=>{q[te]=r.create("div",`maplibregl-ctrl-${te} `,F)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(R,i,a){this._canvas.width=Math.floor(a*R),this._canvas.height=Math.floor(a*i),this._canvas.style.width=`${R}px`,this._canvas.style.height=`${i}px`}_setupPainter(){const R={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let i=null;this._canvas.addEventListener("webglcontextcreationerror",C=>{i={requestedAttributes:R},C&&(i.statusMessage=C.statusMessage,i.type=C.type)},{once:!0});const a=this._canvas.getContext("webgl2",R)||this._canvas.getContext("webgl",R);if(!a){const C="Failed to initialize WebGL";throw i?(i.message=C,new Error(JSON.stringify(i))):new Error(C)}this.painter=new ls(a,this.transform),n.testSupport(a)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(R){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||R,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(R){return this._update(),this._renderTaskQueue.add(R)}_cancelRenderFrame(R){this._renderTaskQueue.remove(R)}_render(R){const i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(R),this._removed)return;let a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const F=this.transform.zoom,q=u.now();this.style.zoomHistory.update(F,q);const te=new e.a9(F,{now:q,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),ue=te.crossFadingFactor();ue===1&&ue===this._crossFadingFactor||(a=!0,this._crossFadingFactor=ue),this.style.update(te)}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,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.be.mark(e.bf.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const C=this._sourcesDirty||this._styleDirty||this._placementDirty;return C||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||C||(this._fullyLoaded=!0,e.be.mark(e.bf.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var R;this._hash&&this._hash.remove();for(const a of this._controls)a.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),x.removeThrottleControl(this._imageQueueHandle),(R=this._resizeObserver)===null||R===void 0||R.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");i!=null&&i.loseContext&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),r.remove(this._canvasContainer),r.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.be.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(R=>{e.be.frame(R),this._frameRequest=null,this._render(R)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(R){this._showTileBoundaries!==R&&(this._showTileBoundaries=R,this._update())}get showPadding(){return!!this._showPadding}set showPadding(R){this._showPadding!==R&&(this._showPadding=R,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(R){this._showCollisionBoxes!==R&&(this._showCollisionBoxes=R,R?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(R){this._showOverdrawInspector!==R&&(this._showOverdrawInspector=R,this._update())}get repaint(){return!!this._repaint}set repaint(R){this._repaint!==R&&(this._repaint=R,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(R){this._vertices=R,this._update()}get version(){return $s}getCameraTargetElevation(){return this.transform.elevation}},d.MapMouseEvent=us,d.MapTouchEvent=No,d.MapWheelEvent=Wl,d.Marker=ho,d.NavigationControl=class{constructor(R){this._updateZoomButtons=()=>{const i=this._map.getZoom(),a=i===this._map.getMaxZoom(),C=i===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=C,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",C.toString())},this._rotateCompassArrow=()=>{const i=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=i},this._setButtonTitle=(i,a)=>{const C=this._map._getUIString(`NavigationControl.${a}`);i.title=C,i.setAttribute("aria-label",C)},this.options=e.e({},Cl,R),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",i=>i.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",i=>this._map.zoomIn({},{originalEvent:i})),r.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",i=>this._map.zoomOut({},{originalEvent:i})),r.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",i=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:i}):this._map.resetNorth({},{originalEvent:i})}),this._compassIcon=r.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(R){return this._map=R,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 di(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){r.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(R,i){const a=r.create("button",R,this._container);return a.type="button",a.addEventListener("click",i),a}},d.Popup=Tt,d.RasterDEMTileSource=We,d.RasterTileSource=Oe,d.ScaleControl=class{constructor(R){this._onMove=()=>{xa(this._map,this._container,this.options)},this.setUnit=i=>{this.options.unit=i,xa(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},xi),R)}getDefaultPosition(){return"bottom-left"}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale",R.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},d.ScrollZoomHandler=al,d.Style=ni,d.TerrainControl=class{constructor(R){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=R}onAdd(R){return this._map=R,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=r.create("button","maplibregl-ctrl-terrain",this._container),r.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(){r.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},d.TwoFingersTouchPitchHandler=il,d.TwoFingersTouchRotateHandler=Ac,d.TwoFingersTouchZoomHandler=Mi,d.TwoFingersTouchZoomRotateHandler=au,d.VectorTileSource=Le,d.VideoSource=de,d.addSourceType=(R,i)=>e._(void 0,void 0,void 0,function*(){if(He(R))throw new Error(`A source type called "${R}" already exists.`);((a,C)=>{ke[a]=C})(R,i)}),d.clearPrewarmedResources=function(){const R=fe;R&&(R.isPreloaded()&&R.numActive()===1?(R.release(ae),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()"))},d.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},d.getRTLTextPluginStatus=function(){return Ye().getRTLTextPluginStatus()},d.getVersion=function(){return X},d.getWorkerCount=function(){return se.workerCount},d.getWorkerUrl=function(){return e.a.WORKER_URL},d.importScriptInWorkers=function(R){return ge().broadcast("IS",R)},d.prewarm=function(){oe().acquire(ae)},d.setMaxParallelImageRequests=function(R){e.a.MAX_PARALLEL_IMAGE_REQUESTS=R},d.setRTLTextPlugin=function(R,i){return Ye().setRTLTextPlugin(R,i)},d.setWorkerCount=function(R){se.workerCount=R},d.setWorkerUrl=function(R){e.a.WORKER_URL=R}}),L}()},88640:function(D,L,t){function b(be,Se,Ee){be.prototype=Se.prototype=Ee,Ee.constructor=be}function d(be,Se){var Ee=Object.create(be.prototype);for(var Ce in Se)Ee[Ce]=Se[Ce];return Ee}function e(){}t.d(L,{GW:function(){return me},Dj:function(){return se}});var w=.7,y=1/w,_="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",n=/^#([0-9a-f]{3,8})$/,l=new RegExp("^rgb\\(".concat(_,",").concat(_,",").concat(_,"\\)$")),o=new RegExp("^rgb\\(".concat(r,",").concat(r,",").concat(r,"\\)$")),s=new RegExp("^rgba\\(".concat(_,",").concat(_,",").concat(_,",").concat(u,"\\)$")),c=new RegExp("^rgba\\(".concat(r,",").concat(r,",").concat(r,",").concat(u,"\\)$")),h=new RegExp("^hsl\\(".concat(u,",").concat(r,",").concat(r,"\\)$")),x=new RegExp("^hsla\\(".concat(u,",").concat(r,",").concat(r,",").concat(u,"\\)$")),m={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};function g(){return this.rgb().formatHex()}function k(){return this.rgb().formatRgb()}function A(be){var Se,Ee;return be=(be+"").trim().toLowerCase(),(Se=n.exec(be))?(Ee=Se[1].length,Se=parseInt(Se[1],16),Ee===6?v(Se):Ee===3?new p(Se>>8&15|Se>>4&240,Se>>4&15|240&Se,(15&Se)<<4|15&Se,1):Ee===8?S(Se>>24&255,Se>>16&255,Se>>8&255,(255&Se)/255):Ee===4?S(Se>>12&15|Se>>8&240,Se>>8&15|Se>>4&240,Se>>4&15|240&Se,((15&Se)<<4|15&Se)/255):null):(Se=l.exec(be))?new p(Se[1],Se[2],Se[3],1):(Se=o.exec(be))?new p(255*Se[1]/100,255*Se[2]/100,255*Se[3]/100,1):(Se=s.exec(be))?S(Se[1],Se[2],Se[3],Se[4]):(Se=c.exec(be))?S(255*Se[1]/100,255*Se[2]/100,255*Se[3]/100,Se[4]):(Se=h.exec(be))?N(Se[1],Se[2]/100,Se[3]/100,1):(Se=x.exec(be))?N(Se[1],Se[2]/100,Se[3]/100,Se[4]):m.hasOwnProperty(be)?v(m[be]):be==="transparent"?new p(NaN,NaN,NaN,0):null}function v(be){return new p(be>>16&255,be>>8&255,255&be,1)}function S(be,Se,Ee,Ce){return Ce<=0&&(be=Se=Ee=NaN),new p(be,Se,Ee,Ce)}function T(be,Se,Ee,Ce){return arguments.length===1?((Le=be)instanceof e||(Le=A(Le)),Le?new p((Le=Le.rgb()).r,Le.g,Le.b,Le.opacity):new p):new p(be,Se,Ee,Ce??1);var Le}function p(be,Se,Ee,Ce){this.r=+be,this.g=+Se,this.b=+Ee,this.opacity=+Ce}function M(){return"#".concat(B(this.r)).concat(B(this.g)).concat(B(this.b))}function f(){var be=E(this.opacity);return"".concat(be===1?"rgb(":"rgba(").concat(I(this.r),", ").concat(I(this.g),", ").concat(I(this.b)).concat(be===1?")":", ".concat(be,")"))}function E(be){return isNaN(be)?1:Math.max(0,Math.min(1,be))}function I(be){return Math.max(0,Math.min(255,Math.round(be)||0))}function B(be){return((be=I(be))<16?"0":"")+be.toString(16)}function N(be,Se,Ee,Ce){return Ce<=0?be=Se=Ee=NaN:Ee<=0||Ee>=1?be=Se=NaN:Se<=0&&(be=NaN),new j(be,Se,Ee,Ce)}function V(be){if(be instanceof j)return new j(be.h,be.s,be.l,be.opacity);if(be instanceof e||(be=A(be)),!be)return new j;if(be instanceof j)return be;var Se=(be=be.rgb()).r/255,Ee=be.g/255,Ce=be.b/255,Le=Math.min(Se,Ee,Ce),Oe=Math.max(Se,Ee,Ce),We=NaN,Ie=Oe-Le,Ve=(Oe+Le)/2;return Ie?(We=Se===Oe?(Ee-Ce)/Ie+6*(Ee0&&Ve<1?0:We,new j(We,Ie,Ve,be.opacity)}function j(be,Se,Ee,Ce){this.h=+be,this.s=+Se,this.l=+Ee,this.opacity=+Ce}function $(be){return(be=(be||0)%360)<0?be+360:be}function ee(be){return Math.max(0,Math.min(1,be||0))}function H(be,Se,Ee){return 255*(be<60?Se+(Ee-Se)*be/60:be<180?Ee:be<240?Se+(Ee-Se)*(240-be)/60:Se)}b(e,A,{copy:function(be){return Object.assign(new this.constructor,this,be)},displayable:function(){return this.rgb().displayable()},hex:g,formatHex:g,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return V(this).formatHsl()},formatRgb:k,toString:k}),b(p,T,d(e,{brighter:function(be){return be=be==null?y:Math.pow(y,be),new p(this.r*be,this.g*be,this.b*be,this.opacity)},darker:function(be){return be=be==null?w:Math.pow(w,be),new p(this.r*be,this.g*be,this.b*be,this.opacity)},rgb:function(){return this},clamp:function(){return new p(I(this.r),I(this.g),I(this.b),E(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:M,formatHex:M,formatHex8:function(){return"#".concat(B(this.r)).concat(B(this.g)).concat(B(this.b)).concat(B(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:f,toString:f})),b(j,function(be,Se,Ee,Ce){return arguments.length===1?V(be):new j(be,Se,Ee,Ce??1)},d(e,{brighter:function(be){return be=be==null?y:Math.pow(y,be),new j(this.h,this.s,this.l*be,this.opacity)},darker:function(be){return be=be==null?w:Math.pow(w,be),new j(this.h,this.s,this.l*be,this.opacity)},rgb:function(){var be=this.h%360+360*(this.h<0),Se=isNaN(be)||isNaN(this.s)?0:this.s,Ee=this.l,Ce=Ee+(Ee<.5?Ee:1-Ee)*Se,Le=2*Ee-Ce;return new p(H(be>=240?be-240:be+120,Le,Ce),H(be,Le,Ce),H(be<120?be+240:be-120,Le,Ce),this.opacity)},clamp:function(){return new j($(this.h),ee(this.s),ee(this.l),E(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var be=E(this.opacity);return"".concat(be===1?"hsl(":"hsla(").concat($(this.h),", ").concat(100*ee(this.s),"%, ").concat(100*ee(this.l),"%").concat(be===1?")":", ".concat(be,")"))}}));var J=function(be){return function(){return be}};function Q(be,Se){var Ee=Se-be;return Ee?function(Ce,Le){return function(Oe){return Ce+Oe*Le}}(be,Ee):J(isNaN(be)?Se:be)}var Z=function be(Se){var Ee=function(Le){return(Le=+Le)==1?Q:function(Oe,We){return We-Oe?function(Ie,Ve,Pe){return Ie=Math.pow(Ie,Pe),Ve=Math.pow(Ve,Pe)-Ie,Pe=1/Pe,function(de){return Math.pow(Ie+de*Ve,Pe)}}(Oe,We,Le):J(isNaN(Oe)?We:Oe)}}(Se);function Ce(Le,Oe){var We=Ee((Le=T(Le)).r,(Oe=T(Oe)).r),Ie=Ee(Le.g,Oe.g),Ve=Ee(Le.b,Oe.b),Pe=Q(Le.opacity,Oe.opacity);return function(de){return Le.r=We(de),Le.g=Ie(de),Le.b=Ve(de),Le.opacity=Pe(de),Le+""}}return Ce.gamma=be,Ce}(1);function K(be,Se){var Ee,Ce=Se?Se.length:0,Le=be?Math.min(Ce,be.length):0,Oe=new Array(Le),We=new Array(Ce);for(Ee=0;EeOe&&(Le=Se.slice(Oe,Le),Ie[We]?Ie[We]+=Le:Ie[++We]=Le),(Ee=Ee[0])===(Ce=Ce[0])?Ie[We]?Ie[We]+=Ce:Ie[++We]=Ce:(Ie[++We]=null,Ve.push({i:We,x:se(Ee,Ce)})),Oe=oe.lastIndex;return OeESRI"},"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,0.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,0.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,0.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,0.8],[20,4]]},"line-opacity":0.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,0.9],[10,0.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":[0.5,0.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,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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":[0.5,0.25],"line-width":{"base":1.2,"stops":[[5,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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,0.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":0.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,0.6]]},"line-width":{"base":1.2,"stops":[[7,0],[8,0.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,0.5]]},"line-width":{"base":1.2,"stops":[[5,0],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":{"stops":[[4,0],[5,0.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,0.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":0.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,0.5],[20,13]]},"line-opacity":0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.5],[20,18]]},"line-opacity":0.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,0.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":[0.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,0.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":[0.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,0.4],[15,0.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":[0.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,0.4],[6,0.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,0.4],[6,0.6],[7,1.5],[20,22]]},"line-opacity":0.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,0.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,0.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,0.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,0.5],[20,18]]},"line-opacity":0.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,0.4],[15,0.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":[0.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,0.4],[5,1],[12,3]]},"line-opacity":0.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,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,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,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":0.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":0.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":0.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":0.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,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.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,0.6],"text-size":12,"text-max-width":9},"paint":{"text-halo-blur":0.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,0.6],"text-size":11,"text-max-width":9},"paint":{"text-halo-blur":0.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,0.6],"text-size":12,"text-max-width":9,"icon-optional":false,"icon-ignore-placement":false,"icon-allow-overlap":false,"text-ignore-placement":false,"text-allow-overlap":false,"text-optional":true},"paint":{"text-halo-blur":0.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,0.5],[19,1]]}},"paint":{"icon-opacity":0.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,0.5],[19,1]]}},"paint":{"icon-opacity":0.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":0.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":0.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":0.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":0.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":0.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":[0.4,0],"icon-size":0.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"}`)},51962:function(D){D.exports=JSON.parse(`{"version":8,"name":"orto","metadata":{},"center":[1.537786,41.837539],"zoom":12,"bearing":0,"pitch":0,"light":{"anchor":"viewport","color":"white","intensity":0.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"}}]}`)}},ce={};function Te(D){var L=ce[D];if(L!==void 0)return L.exports;var t=ce[D]={id:D,exports:{}};return W[D].call(t.exports,t,t.exports,Te),t.exports}return Te.m=W,Te.n=function(D){var L=D&&D.__esModule?function(){return D.default}:function(){return D};return Te.d(L,{a:L}),L},Te.d=function(D,L){for(var t in L)Te.o(L,t)&&!Te.o(D,t)&&Object.defineProperty(D,t,{enumerable:!0,get:L[t]})},Te.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Te.o=function(D,L){return Object.prototype.hasOwnProperty.call(D,L)},Te.r=function(D){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})},Te.b=document.baseURI||self.location.href,Te.nc=void 0,Te(20260)}()})})(m8);var bf=m8.exports;const z9=Xx(bf),O9=Y4({__proto__:null,default:z9},[bf]);var y8={},x8={exports:{}},D9="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",R9=D9,F9=R9;function _8(){}function b8(){}b8.resetWarningCache=_8;var B9=function(){function O(ce,Te,D,L,t,b){if(b!==F9){var d=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 d.name="Invariant Violation",d}}O.isRequired=O;function z(){return O}var W={array:O,bigint:O,bool:O,func:O,number:O,object:O,string:O,symbol:O,any:O,arrayOf:z,element:O,elementType:O,instanceOf:z,node:O,objectOf:z,oneOf:z,oneOfType:z,shape:z,exact:z,checkPropTypes:b8,resetWarningCache:_8};return W.PropTypes=W,W};x8.exports=B9();var N9=x8.exports;(function(O){function z(h){"@babel/helpers - typeof";return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},z(h)}Object.defineProperty(O,"__esModule",{value:!0}),O.default=c;var W=L(mr),ce=Te(N9);function Te(h){return h&&h.__esModule?h:{default:h}}function D(h){if(typeof WeakMap!="function")return null;var x=new WeakMap,m=new WeakMap;return(D=function(k){return k?m:x})(h)}function L(h,x){if(!x&&h&&h.__esModule)return h;if(h===null||z(h)!=="object"&&typeof h!="function")return{default:h};var m=D(x);if(m&&m.has(h))return m.get(h);var g={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in h)if(A!=="default"&&Object.prototype.hasOwnProperty.call(h,A)){var v=k?Object.getOwnPropertyDescriptor(h,A):null;v&&(v.get||v.set)?Object.defineProperty(g,A,v):g[A]=h[A]}return g.default=h,m&&m.set(h,g),g}function t(h,x){if(!(h instanceof x))throw new TypeError("Cannot call a class as a function")}function b(h,x){for(var m=0;m"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function n(h){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(m){return m.__proto__||Object.getPrototypeOf(m)},n(h)}var l=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],o=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],s=typeof window<"u";function c(h){var x=function(m){e(k,m);var g=y(k);function k(A){var v;return t(this,k),v=g.call(this,A),v.p=Promise.resolve(),v.resizeHandler=null,v.handlers={},v.syncWindowResize=v.syncWindowResize.bind(u(v)),v.syncEventHandlers=v.syncEventHandlers.bind(u(v)),v.attachUpdateEvents=v.attachUpdateEvents.bind(u(v)),v.getRef=v.getRef.bind(u(v)),v.handleUpdate=v.handleUpdate.bind(u(v)),v.figureCallback=v.figureCallback.bind(u(v)),v.updatePlotly=v.updatePlotly.bind(u(v)),v}return d(k,[{key:"updatePlotly",value:function(v,S,T){var p=this;this.p=this.p.then(function(){if(!p.unmounting){if(!p.el)throw new Error("Missing element reference");return h.react(p.el,{data:p.props.data,layout:p.props.layout,config:p.props.config,frames:p.props.frames})}}).then(function(){p.unmounting||(p.syncWindowResize(v),p.syncEventHandlers(),p.figureCallback(S),T&&p.attachUpdateEvents())}).catch(function(M){p.props.onError&&p.props.onError(M)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(v){this.unmounting=!1;var S=v.frames&&v.frames.length?v.frames.length:0,T=this.props.frames&&this.props.frames.length?this.props.frames.length:0,p=!(v.layout===this.props.layout&&v.data===this.props.data&&v.config===this.props.config&&T===S),M=v.revision!==void 0,f=v.revision!==this.props.revision;!p&&(!M||M&&!f)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&s&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),h.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var v=this;!this.el||!this.el.removeListener||o.forEach(function(S){v.el.on(S,v.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var v=this;!this.el||!this.el.removeListener||o.forEach(function(S){v.el.removeListener(S,v.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(v){if(typeof v=="function"){var S=this.el,T=S.data,p=S.layout,M=this.el._transitionData?this.el._transitionData._frames:null,f={data:T,layout:p,frames:M};v(f,this.el)}}},{key:"syncWindowResize",value:function(v){var S=this;s&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return h.Plots.resize(S.el)},window.addEventListener("resize",this.resizeHandler),v&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(v){this.el=v,this.props.debug&&s&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var v=this;l.forEach(function(S){var T=v.props["on"+S],p=v.handlers[S],M=!!p;T&&!M?v.addEventHandler(S,T):!T&&M?v.removeEventHandler(S):T&&M&&T!==p&&(v.removeEventHandler(S),v.addEventHandler(S,T))})}},{key:"addEventHandler",value:function(v,S){this.handlers[v]=S,this.el.on(this.getPlotlyEventName(v),this.handlers[v])}},{key:"removeEventHandler",value:function(v){this.el.removeListener(this.getPlotlyEventName(v),this.handlers[v]),delete this.handlers[v]}},{key:"getPlotlyEventName",value:function(v){return"plotly_"+v.toLowerCase()}},{key:"render",value:function(){return W.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),k}(W.Component);return x.propTypes={data:ce.default.arrayOf(ce.default.object),config:ce.default.object,layout:ce.default.object,frames:ce.default.arrayOf(ce.default.object),revision:ce.default.number,onInitialized:ce.default.func,onPurge:ce.default.func,onError:ce.default.func,onUpdate:ce.default.func,debug:ce.default.bool,style:ce.default.object,className:ce.default.string,useResizeHandler:ce.default.bool,divId:ce.default.string},l.forEach(function(m){x.propTypes["on"+m]=ce.default.func}),x.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},x}})(y8);const j9=Xx(y8);function U9({plotData:O,popup_data:z,current_text:W}){var b;const ce=z.x;let Te=z.y;const D=z.yref,L=((b=O==null?void 0:O.layout)==null?void 0:b.annotations)||[];let t=-1;for(let d=0;dv!==void 0)),O.layout.dragmode="pan",W({...O,...c.update}),e.removeAllListeners("plotly_click")};z.text=z.text.replace(/\n/g,"
");let y,_=!1;if(z.annotation){console.log("data",z),y={x:z.annotation.x,y:z.annotation.y,yref:z.annotation.yref,yanchor:z.annotation.yn.x===z.annotation.x&&n.y===z.annotation.y&&n.yref===z.annotation.yref);console.log("ohlcAnnotationIndex",r),r===-1?b([...t,u.annotation]):(t[r]=u.annotation,b(t))}D([...d,u.annotation].filter(r=>r!==void 0)),O.layout.dragmode="pan",W({...O,...u.update}),Te({});return}e.on("plotly_clickannotation",u=>{console.log("plotly_clickannotation",u);const r=u.annotation;if(r.text===void 0){console.log("annotation.text is undefined");return}console.log("annotation.text",r.text),r.text=r.text.replace(/
/g,` `);const n={x:r.x,y:r.y,high:(r==null?void 0:r.high)??void 0,low:(r==null?void 0:r.low)??void 0,yanchor:r.y"u"?t.impl.options.imagePlaceholder=L.imagePlaceholder:t.impl.options.imagePlaceholder=m.imagePlaceholder,typeof m.cacheBust>"u"?t.impl.options.cacheBust=L.cacheBust:t.impl.options.cacheBust=m.cacheBust}function u(m,g){return b(m,g).then(W.makeImage).then(W.delay(100)).then(function(A){var v=k(m);return v.getContext("2d").drawImage(A,0,0),v});function k(A){var v=document.createElement("canvas");if(v.width=g.width||W.width(A),v.height=g.height||W.height(A),g.bgcolor){var S=v.getContext("2d");S.fillStyle=g.bgcolor,S.fillRect(0,0,v.width,v.height)}return v}}function r(m,g,k){if(!k&&g&&!g(m))return Promise.resolve();return Promise.resolve(m).then(A).then(function(T){return v(m,T,g)}).then(function(T){return S(m,T)});function A(T){return T instanceof HTMLCanvasElement?W.makeImage(T.toDataURL()):T.cloneNode(!1)}function v(T,p,M){var f=T.childNodes;if(f.length===0)return Promise.resolve(p);return E(p,W.asArray(f),M).then(function(){return p});function E(I,B,N){var V=Promise.resolve();return B.forEach(function(j){V=V.then(function(){return r(j,N)}).then(function($){$&&I.appendChild($)})}),V}}function S(T,p){if(!(p instanceof Element))return p;return Promise.resolve().then(M).then(f).then(E).then(I).then(function(){return p});function M(){B(window.getComputedStyle(T),p.style);function B(N,V){N.cssText?V.cssText=N.cssText:j(N,V);function j($,ee){W.asArray($).forEach(function(H){ee.setProperty(H,$.getPropertyValue(H),$.getPropertyPriority(H))})}}}function f(){[":before",":after"].forEach(function(N){B(N)});function B(N){var V=window.getComputedStyle(T,N),j=V.getPropertyValue("content");if(j===""||j==="none")return;var $=W.uid();p.className=p.className+" "+$;var ee=document.createElement("style");ee.appendChild(H($,N,V)),p.appendChild(ee);function H(J,Q,Z){var K="."+J+":"+Q,ae=Z.cssText?se(Z):he(Z);return document.createTextNode(K+"{"+ae+"}");function se(fe){var ie=fe.getPropertyValue("content");return fe.cssText+" content: "+ie+";"}function he(fe){return W.asArray(fe).map(ie).join("; ")+";";function ie(oe){return oe+": "+fe.getPropertyValue(oe)+(fe.getPropertyPriority(oe)?" !important":"")}}}}}function E(){T instanceof HTMLTextAreaElement&&(p.innerHTML=T.value),T instanceof HTMLInputElement&&p.setAttribute("value",T.value)}function I(){p instanceof SVGElement&&(p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p instanceof SVGRectElement&&["width","height"].forEach(function(B){var N=p.getAttribute(B);N&&p.style.setProperty(B,N)}))}}}function n(m){return Te.resolveAll().then(function(g){var k=document.createElement("style");return m.appendChild(k),k.appendChild(document.createTextNode(g)),m})}function l(m){return D.inlineAll(m).then(function(){return m})}function o(m,g,k){return Promise.resolve(m).then(function(A){return A.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(A)}).then(W.escapeXhtml).then(function(A){return''+A+""}).then(function(A){return''+A+""}).then(function(A){return"data:image/svg+xml;charset=utf-8,"+A})}function s(){return{escape:I,parseExtension:g,mimeType:k,dataAsUrl:E,isDataUrl:A,canvasToBlob:S,resolveUrl:T,getAndEncode:f,uid:p(),delay:B,asArray:N,escapeXhtml:V,makeImage:M,width:j,height:$};function m(){var H="application/font-woff",J="image/jpeg";return{woff:H,woff2:H,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:J,jpeg:J,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}function g(H){var J=/\.([^\.\/]*?)$/g.exec(H);return J?J[1]:""}function k(H){var J=g(H).toLowerCase();return m()[J]||""}function A(H){return H.search(/^(data:)/)!==-1}function v(H){return new Promise(function(J){for(var Q=window.atob(H.toDataURL().split(",")[1]),Z=Q.length,K=new Uint8Array(Z),ae=0;ae{if(O)return W9({fileHandle:O,blob:z})},W9=async({fileHandle:O,blob:z})=>{const W=await O.createWritable();await W.write(z),await W.close()},Z9=[{description:"PNG Image",accept:{"image/png":[".png"]}},{description:"JPEG Image",accept:{"image/jpeg":[".jpeg"]}},{description:"SVG Image",accept:{"image/svg+xml":[".svg"]}}],k8=({filename:O,is_image:z})=>{try{if("showSaveFilePicker"in window){const W={suggestedName:O,types:z?Z9:[{description:"CSV File",accept:{"image/csv":[".csv"]}}],excludeAcceptAllOption:!0};return showSaveFilePicker(W)}}catch(W){console.error(W)}return new Promise(W=>{W(null)})},i3=(O,z,W)=>{try{if(W===null)throw new Error("Cannot access filesystem");return G9({fileHandle:W,blob:O})}catch(ce){console.error("oops, something went wrong!",ce);const Te=URL.createObjectURL(O),D=document.createElement("a");D.setAttribute("href",Te),D.setAttribute("download",z),D.style.visibility="hidden",document.body.appendChild(D),D.click(),document.body.removeChild(D)}return new Promise(ce=>{ce(!0)})};async function A8(O,z){const W=O.data;let ce=[];const Te=[],D="title"in O.layout.xaxis&&O.layout.xaxis.title.text!==void 0?O.layout.xaxis.title.text:"x",L="title"in O.layout.yaxis&&O.layout.yaxis.title.text!==void 0?O.layout.yaxis.title.text:"y";return W.forEach(function(t){t.type==="candlestick"&&(ce.length===0&&(ce=["Date","Open","High","Low","Close"]),t.x.forEach(function(b,d){Te.push([b,t.open[d],t.high[d],t.low[d],t.close[d]])})),["scatter","bar"].includes(t.type)&&(ce.length===0&&ce.push(D),ce.push(t.name!==void 0?t.name:L),t.x.forEach(function(b,d){Te[d]===void 0&&(Te[d]=[b]),Te[d].push(t.y[d])}))}),await $9(ce,Te,z)}async function $9(O,z,W){const ce=O,Te=z.map(d=>d.map(e=>e==null?"":typeof e=="object"?JSON.stringify(e):e.toString().replace(/"/g,'""'))),L=[ce,...Te].map(d=>d.join(",")).join(` -`),t=new Blob([L],{type:"text/csv;charset=utf-8;"}),b=`${window.title}.csv`;try{const d=await k8({filename:b});await G1("Saving CSV"),x_(async function(){i3(t,b,d).then(async function(){await new Promise(e=>setTimeout(e,1500)),d||W(!0),await G1("",!0)})},2)()}catch(d){console.error(d)}}function G1(O,z){const W=window.document.getElementById("loading"),ce=window.document.getElementById("loading_text");return new Promise(Te=>{z?W.classList.remove("show"):(ce.innerHTML=O,W.classList.add("show"));const D=setInterval(function(){(z?!W.classList.contains("show"):W.classList.contains("show"))&&(clearInterval(D),Te(!0))},.01)})}const x_=(O,z)=>{let W;return function(){const ce=this,Te=arguments;clearTimeout(W),W=setTimeout(()=>O.apply(ce,Te),z)}},Y9={yref:"paper",xref:"paper",x:1,y:0,text:"OpenBB",font_size:17,font_color:"gray",opacity:.5,xanchor:"right",yanchor:"bottom",yshift:-80,xshift:40};async function M4(O,z,W=!1){const ce=document.getElementById("plotlyChart");W&&(ce.layout.annotations.push(Y9),ce.globals.cmd_idx!==void 0&&ce.globals.cmd_src!==void 0&&(ce.layout.annotations[ce.globals.cmd_idx].text=ce.globals.cmd_src),bf.relayout(ce,{"title.text":ce.globals.title,margin:ce.globals.old_margin})),W||(ce.globals.cmd_idx!==void 0&&ce.globals.cmd_src!==void 0&&(ce.layout.annotations[ce.globals.cmd_idx].text=""),ce.layout.annotations.splice(z,1),bf.relayout(ce,{"title.text":"",margin:O}))}async function S8(O,z,W){const ce=document.getElementById(O);if(["svg"].includes(W)){const Te=document.getElementById("plotlyChart"),D=Te.layout.margin,L=Te.layout.annotations.length;await M4(D,L,!0),bf.downloadImage(Te,{format:"svg",height:Te.clientHeight,width:Te.clientWidth,filename:window.title}),await M4(D,L,!1),await G1("",!0);return}x_(async function(){T8.toBlob(ce).then(function(Te){i3(Te,z,null)})},2)()}async function M8(O,z,W,ce){const Te=document.getElementById(O),D=`${window.title}.png`;try{W(!0);const L=await k8({filename:D,is_image:!0});let t="png";L!==null&&(t=L.name.split(".").pop()),await G1(`Saving ${t.toUpperCase()}`).then(setTimeout(async function(){if(["svg"].includes(t)){await S8(O,D,t),z(!1),W(!1),L||ce(!0);return}x_(async function(){T8.toBlob(Te).then(function(b){i3(b,D,L).then(async function(){await G1("",!0),z(!1),W(!1),L||ce(!0)})})},2)()},100))}catch(L){console.error(L),z(!1),W(!1)}W(!1)}const W1=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}");function E8(O,z){return Object.keys(z).forEach(W=>{typeof z[W]=="object"&&Object.assign(z[W],E8(O[W],z[W]))}),Object.assign(O||{},z),O}async function E4(O,z){try{if(O["xaxis.range[0]"]!==void 0){const W=O["xaxis.range[0]"],ce=O["xaxis.range[1]"];let Te=W,D=ce;W1.test(W.replace(" ","T").split(".")[0])&&(Te=new Date(W.replace(" ","T").split(".")[0]),D=new Date(ce.replace(" ","T").split(".")[0]));const L={},t=[];let b,d,e;const w={},y={};let _=null;const u=[...new Set(z.data.map(r=>{var n,l;if(r.y!==void 0||r.type==="candlestick")return r.yaxis===void 0&&((n=r==null?void 0:r.name)==null?void 0:n.trim())!=="Volume"&&(r.yaxis="y"),r.type==="bar"&&((l=r==null?void 0:r.name)==null?void 0:l.trim())==="Volume"&&(_=`yaxis${r.yaxis.replace("y","")}`),w[r.yaxis]=w[r.yaxis]||[],w[r.yaxis].push(r),r.yaxis}))];return z.layout.annotations.map((r,n)=>{if(r.yref!==void 0&&r.yref!=="paper"){r.index=n;const l=`yaxis${r.yref.replace("y","")}`;y[l]=y[l]||[],y[l].push(r)}}),u.map(r=>{if(typeof r!="string")return;const n=`yaxis${r.replace("y","")}`;let l=[],o=[],s=z.layout[n].type==="log";w[r].map(h=>{const x=h.x;s=z.layout[n].type==="log";let m=h.y!==void 0?h.y:[],g=h.type==="candlestick"?h.low:[],k=h.type==="candlestick"?h.high:[];s&&(m=m.map(Math.log10),h.type==="candlestick"&&(g=h.low.map(Math.log10),k=h.high.map(Math.log10)));const A=x.map((v,S)=>{let T=null;if(W1.test(v.toString())){const p=new Date(v).getTime();p>=Te.getTime()&&p<=D.getTime()&&(h.y!==void 0&&m[S]!==void 0&&(T=m[S]),h.type==="candlestick"&&(l.push(g[S]),l.push(k[S])),(!e||p=W&&v<=ce&&(h.y!==void 0&&(T=m[S]),h.type==="candlestick"&&(l.push(g[S]),l.push(k[S])),(!e||vh!=null),b=Math.min(...o),d=Math.max(...o),l.length>0&&(l=l.flat().filter(h=>h!=null),b=Math.min(...l),d=Math.max(...l));const c=d;if(b!==void 0&&d!==void 0){const h=d-b;let x=.15;if(l.length>0&&(x=.3),b-=h*x,d+=h*x,L[n]===void 0&&(L[n]={}),n===_){if(z.layout[n].tickvals!==void 0){const g=c;let k=-3,A=Math.round(g*.2,k);const v=[2,5,6,7,8,9,10],S=[1,4,5,6,7,8,9];for(let M=0;Mv[M]&&(k=-S[M],A=Math.round(g*.2,k));const T=[Math.floor(A),Math.floor(A*2),Math.floor(A*3),Math.floor(A*4)],p=[0,Math.floor(g*7)];L[n].tickvals=T,L[n].range=p,L[n].tickformat=".2s";return}b=0,d=z.layout[n].range[1]}L[n].range=[b,d],L[n].fixedrange=!0,t.push(n),y[n]!==void 0&&y[n].map(m=>{if(m.ay!==void 0){const g=m.ay,k=Math.min(Math.max(g,b+h*.2),d-h*.2);L.annotations===void 0&&(L.annotations=z.layout.annotations),L.annotations[m.index].ay=k}})}}),z.layout=E8(z.layout,L),{to_update:z.layout,yaxis_fixedrange:t}}}catch(W){console.log(`Error in AutoScaling: ${W}`)}return{to_update:{},yaxis_fixedrange:[]}}function X9({open:O,onColorChange:z}){const[W,ce]=mr.useState(!1);function Te(D){z(D)}return O&&!W&&ce(!0),!O&&W&&ce(!1),mr.useEffect(()=>{if(W){let D=function(t){let b=0,d=0,e=0,w=0;document.getElementById(t.id+"_header")?document.getElementById(t.id+"_header").onmousedown=y:t.onmousedown=y;function y(r){r=r||window.event,r.preventDefault(),e=r.clientX,w=r.clientY,document.onmouseup=u,document.onmousemove=_}function _(r){r=r||window.event,r.preventDefault(),b=e-r.clientX,d=w-r.clientY,e=r.clientX,w=r.clientY,t.style.top=t.offsetTop-d+"px",t.style.left=t.offsetLeft-b+"px"}function u(){document.onmouseup=null,document.onmousemove=null}},L=document.getElementById("changecolor");L.style.display="block",L.style.width=null,D(L)}else document.getElementById("changecolor").style.display="none"},[W]),Kr("div",{id:"changecolor",children:Kr("div",{id:"changecolor_header",children:Kr("input",{type:"color",id:"picked_color",value:"#00ACFF",onChange:D=>{let L=D.target.value;Te(L)}})})})}const nd={sunIcon:{viewBox:"0 0 16 16",width:16,height:16,path:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"},moonIcon:{viewBox:"0 0 25 25",width:25,height:25,path:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"},plotCsv:{width:900,height:900,path:"M170.666667 106.666667l0.192 736H906.666667v64H149.546667c-23.552 0-42.666667-19.093333-42.666667-42.666667L106.666667 106.666667h64z m686.506666 454.144l13.653334 16.362666a21.333333 21.333333 0 0 1-2.666667 30.058667l-171.157333 143.146667a21.333333 21.333333 0 0 1-21.546667 3.477333l-229.973333-91.285333-113.834667 94.997333a21.333333 21.333333 0 0 1-30.037333-2.709333l-13.653334-16.362667a21.333333 21.333333 0 0 1 2.688-30.058667l133.312-111.274666a21.333333 21.333333 0 0 1 21.546667-3.456l229.930667 91.264 151.68-126.826667a21.333333 21.333333 0 0 1 30.037333 2.666667z m-1.621333-417.962667l16.896 13.013333a21.333333 21.333333 0 0 1 3.925333 29.888L685.802667 433.706667a21.333333 21.333333 0 0 1-20.202667 8.085333l-226.794667-35.413333-150.186666 222.357333a21.333333 21.333333 0 0 1-27.477334 7.018667l-2.133333-1.28-17.685333-11.946667a21.333333 21.333333 0 0 1-5.738667-29.610667l165.354667-244.821333a21.333333 21.333333 0 0 1 20.992-9.130667L650.453333 374.613333l175.146667-227.882666a21.333333 21.333333 0 0 1 29.930667-3.904z"},addText:{path:"M896 928H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32z m-736-64h704v-704h-704z M704 352H320a32 32 0 0 1 0-64h384a32 32 0 0 1 0 64z M512 736a32 32 0 0 1-32-32V320a32 32 0 0 1 64 0v384a32 32 0 0 1-32 32z",width:950,height:950},changeTitle:{path:"M122.368 165.888h778.24c-9.216 0-16.384-7.168-16.384-16.384v713.728c0-9.216 7.168-16.384 16.384-16.384h-778.24c9.216 0 16.384 7.168 16.384 16.384V150.016c0 8.192-6.656 15.872-16.384 15.872z m-32.768 684.544c0 26.112 20.992 47.104 47.104 47.104h750.08c26.112 0 47.104-20.992 47.104-47.104V162.304c0-26.112-20.992-47.104-47.104-47.104H136.704c-26.112 0-47.104 20.992-47.104 47.104v688.128z M244.736 656.896h534.016v62.464H244.736z M373.76 358.4H307.2v219.136h-45.568V358.4H192v-41.472H373.76V358.4zM403.968 316.928h44.032v50.176h-44.032v-50.176z m0 67.072h44.032v194.048h-44.032V384zM576.512 541.184l8.704 31.744c-13.312 5.12-26.624 8.192-38.912 8.704-32.768 1.024-48.64-15.36-48.128-48.128V422.912h-26.624V384h26.624v-46.592l44.032-21.504V384h36.352v38.912h-36.352V532.48c-1.024 10.24 3.072 14.848 11.264 13.824 5.12 0 12.8-1.536 23.04-5.12zM619.008 316.928h44.032v260.608h-44.032V316.928zM813.056 509.952l41.472 12.8c-11.776 40.96-37.888 61.44-78.336 60.416-52.736-1.536-80.384-34.304-81.92-98.304 2.56-67.072 29.696-102.4 81.92-105.984 52.224 1.536 78.336 36.864 79.36 105.984v13.824h-117.248c3.584 30.208 15.872 45.568 37.888 46.592 19.968 0.512 32.256-11.264 36.864-35.328z m-72.704-51.712h70.656c-1.024-25.088-12.288-38.4-33.792-38.912-21.504 0.512-33.792 13.824-36.864 38.912z",width:920,height:900},changeColor:{path:"M8 3C5.79 3 4 4.79 4 7V14C4 15.1 4.9 16 6 16H9V20C9 21.1 9.9 22 11 22H13C14.1 22 15 21.1 15 20V16H18C19.1 16 20 15.1 20 14V3H8M8 5H12V7H14V5H15V9H17V5H18V10H6V7C6 5.9 6.9 5 8 5M6 14V12H18V14H6Z",width:22,height:22},uploadImage:{path:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5",width:1024,height:1024},downloadCsv:{path:`M486.2,196.121h-13.164V132.59c0-0.399-0.064-0.795-0.116-1.2c-0.021-2.52-0.824-5-2.551-6.96L364.656,3.677 +`)})}function g(){return Promise.resolve(W.asArray(document.styleSheets)).then(A).then(k).then(function(S){return S.map(v)});function k(S){return S.filter(function(T){return T.type===CSSRule.FONT_FACE_RULE}).filter(function(T){return ce.shouldProcess(T.style.getPropertyValue("src"))})}function A(S){var T=[];return S.forEach(function(p){try{W.asArray(p.cssRules||[]).forEach(T.push.bind(T))}catch(M){console.log("Error while reading CSS rules from "+p.href,M.toString())}}),T}function v(S){return{resolve:function(){var p=(S.parentStyleSheet||{}).href;return ce.inlineAll(S.cssText,p)},src:function(){return S.style.getPropertyValue("src")}}}}}function x(){return{inlineAll:g,impl:{newImage:m}};function m(k){return{inline:A};function A(v){return W.isDataUrl(k.src)?Promise.resolve():Promise.resolve(k.src).then(v||W.getAndEncode).then(function(S){return W.dataAsUrl(S,W.mimeType(k.src))}).then(function(S){return new Promise(function(T,p){k.onload=T,k.onerror=p,k.src=S})})}}function g(k){if(!(k instanceof Element))return Promise.resolve(k);return A(k).then(function(){return k instanceof HTMLImageElement?m(k).inline():Promise.all(W.asArray(k.childNodes).map(function(v){return g(v)}))});function A(v){var S=v.style.getPropertyValue("background");return S?ce.inlineAll(S).then(function(T){v.style.setProperty("background",T,v.style.getPropertyPriority("background"))}).then(function(){return v}):Promise.resolve(v)}}}})()})(w8);var q9=w8.exports;const T8=Xx(q9),H9=async({fileHandle:O,blob:z})=>{if(O)return G9({fileHandle:O,blob:z})},G9=async({fileHandle:O,blob:z})=>{const W=await O.createWritable();await W.write(z),await W.close()},W9=[{description:"PNG Image",accept:{"image/png":[".png"]}},{description:"JPEG Image",accept:{"image/jpeg":[".jpeg"]}},{description:"SVG Image",accept:{"image/svg+xml":[".svg"]}}],k8=({filename:O,is_image:z})=>{try{if("showSaveFilePicker"in window){const W={suggestedName:O,types:z?W9:[{description:"CSV File",accept:{"image/csv":[".csv"]}}],excludeAcceptAllOption:!0};return showSaveFilePicker(W)}}catch(W){console.error(W)}return new Promise(W=>{W(null)})},i3=(O,z,W)=>{try{if(W===null)throw new Error("Cannot access filesystem");return H9({fileHandle:W,blob:O})}catch(ce){console.error("oops, something went wrong!",ce);const Te=URL.createObjectURL(O),D=document.createElement("a");D.setAttribute("href",Te),D.setAttribute("download",z),D.style.visibility="hidden",document.body.appendChild(D),D.click(),document.body.removeChild(D)}return new Promise(ce=>{ce(!0)})};async function A8(O,z){const W=O.data;let ce=[];const Te=[],D="title"in O.layout.xaxis&&O.layout.xaxis.title.text!==void 0?O.layout.xaxis.title.text:"x",L="title"in O.layout.yaxis&&O.layout.yaxis.title.text!==void 0?O.layout.yaxis.title.text:"y";return W.forEach(function(t){t.type==="candlestick"&&(ce.length===0&&(ce=["Date","Open","High","Low","Close"]),t.x.forEach(function(b,d){Te.push([b,t.open[d],t.high[d],t.low[d],t.close[d]])})),["scatter","bar"].includes(t.type)&&(ce.length===0&&ce.push(D),ce.push(t.name!==void 0?t.name:L),t.x.forEach(function(b,d){Te[d]===void 0&&(Te[d]=[b]),Te[d].push(t.y[d])}))}),await Z9(ce,Te,z)}async function Z9(O,z,W){const ce=O,Te=z.map(d=>d.map(e=>e==null?"":typeof e=="object"?JSON.stringify(e):e.toString().replace(/"/g,'""'))),L=[ce,...Te].map(d=>d.join(",")).join(` +`),t=new Blob([L],{type:"text/csv;charset=utf-8;"}),b=`${window.title}.csv`;try{const d=await k8({filename:b});await G1("Saving CSV"),x_(async function(){i3(t,b,d).then(async function(){await new Promise(e=>setTimeout(e,1500)),d||W(!0),await G1("",!0)})},2)()}catch(d){console.error(d)}}function G1(O,z){const W=window.document.getElementById("loading"),ce=window.document.getElementById("loading_text");return new Promise(Te=>{z?W.classList.remove("show"):(ce.innerHTML=O,W.classList.add("show"));const D=setInterval(function(){(z?!W.classList.contains("show"):W.classList.contains("show"))&&(clearInterval(D),Te(!0))},.01)})}const x_=(O,z)=>{let W;return function(){const ce=this,Te=arguments;clearTimeout(W),W=setTimeout(()=>O.apply(ce,Te),z)}},$9={yref:"paper",xref:"paper",x:1,y:0,text:"OpenBB",font_size:17,font_color:"gray",opacity:.5,xanchor:"right",yanchor:"bottom",yshift:-80,xshift:40};async function M4(O,z,W=!1){const ce=document.getElementById("plotlyChart");W&&(ce.layout.annotations.push($9),ce.globals.cmd_idx!==void 0&&ce.globals.cmd_src!==void 0&&(ce.layout.annotations[ce.globals.cmd_idx].text=ce.globals.cmd_src),bf.relayout(ce,{"title.text":ce.globals.title,margin:ce.globals.old_margin})),W||(ce.globals.cmd_idx!==void 0&&ce.globals.cmd_src!==void 0&&(ce.layout.annotations[ce.globals.cmd_idx].text=""),ce.layout.annotations.splice(z,1),bf.relayout(ce,{"title.text":"",margin:O}))}async function S8(O,z,W){const ce=document.getElementById(O);if(["svg"].includes(W)){const Te=document.getElementById("plotlyChart"),D=Te.layout.margin,L=Te.layout.annotations.length;await M4(D,L,!0),bf.downloadImage(Te,{format:"svg",height:Te.clientHeight,width:Te.clientWidth,filename:window.title}),await M4(D,L,!1),await G1("",!0);return}x_(async function(){T8.toBlob(ce).then(function(Te){i3(Te,z,null)})},2)()}async function M8(O,z,W,ce){const Te=document.getElementById(O),D=`${window.title}.png`;try{W(!0);const L=await k8({filename:D,is_image:!0});let t="png";L!==null&&(t=L.name.split(".").pop()),await G1(`Saving ${t.toUpperCase()}`).then(setTimeout(async function(){if(["svg"].includes(t)){await S8(O,D,t),z(!1),W(!1),L||ce(!0);return}x_(async function(){T8.toBlob(Te).then(function(b){i3(b,D,L).then(async function(){await G1("",!0),z(!1),W(!1),L||ce(!0)})})},2)()},100))}catch(L){console.error(L),z(!1),W(!1)}W(!1)}const W1=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}");function E8(O,z){return Object.keys(z).forEach(W=>{typeof z[W]=="object"&&Object.assign(z[W],E8(O[W],z[W]))}),Object.assign(O||{},z),O}async function E4(O,z){try{if(O["xaxis.range[0]"]!==void 0){const W=O["xaxis.range[0]"],ce=O["xaxis.range[1]"];let Te=W,D=ce;W1.test(W.replace(" ","T").split(".")[0])&&(Te=new Date(W.replace(" ","T").split(".")[0]),D=new Date(ce.replace(" ","T").split(".")[0]));const L={},t=[];let b,d,e;const w={},y={};let _=null;const u=[...new Set(z.data.map(r=>{var n,l;if(r.y!==void 0||r.type==="candlestick")return r.yaxis===void 0&&((n=r==null?void 0:r.name)==null?void 0:n.trim())!=="Volume"&&(r.yaxis="y"),r.type==="bar"&&((l=r==null?void 0:r.name)==null?void 0:l.trim())==="Volume"&&(_=`yaxis${r.yaxis.replace("y","")}`),w[r.yaxis]=w[r.yaxis]||[],w[r.yaxis].push(r),r.yaxis}))];return z.layout.annotations.map((r,n)=>{if(r.yref!==void 0&&r.yref!=="paper"){r.index=n;const l=`yaxis${r.yref.replace("y","")}`;y[l]=y[l]||[],y[l].push(r)}}),u.map(r=>{if(typeof r!="string")return;const n=`yaxis${r.replace("y","")}`;let l=[],o=[],s=z.layout[n].type==="log";w[r].map(h=>{const x=h.x;s=z.layout[n].type==="log";let m=h.y!==void 0?h.y:[],g=h.type==="candlestick"?h.low:[],k=h.type==="candlestick"?h.high:[];s&&(m=m.map(Math.log10),h.type==="candlestick"&&(g=h.low.map(Math.log10),k=h.high.map(Math.log10)));const A=x.map((v,S)=>{let T=null;if(W1.test(v.toString())){const p=new Date(v).getTime();p>=Te.getTime()&&p<=D.getTime()&&(h.y!==void 0&&m[S]!==void 0&&(T=m[S]),h.type==="candlestick"&&(l.push(g[S]),l.push(k[S])),(!e||p=W&&v<=ce&&(h.y!==void 0&&(T=m[S]),h.type==="candlestick"&&(l.push(g[S]),l.push(k[S])),(!e||vh!=null),b=Math.min(...o),d=Math.max(...o),l.length>0&&(l=l.flat().filter(h=>h!=null),b=Math.min(...l),d=Math.max(...l));const c=d;if(b!==void 0&&d!==void 0){const h=d-b;let x=.15;if(l.length>0&&(x=.3),b-=h*x,d+=h*x,L[n]===void 0&&(L[n]={}),n===_){if(z.layout[n].tickvals!==void 0){const g=c;let k=-3,A=Math.round(g*.2,k);const v=[2,5,6,7,8,9,10],S=[1,4,5,6,7,8,9];for(let M=0;Mv[M]&&(k=-S[M],A=Math.round(g*.2,k));const T=[Math.floor(A),Math.floor(A*2),Math.floor(A*3),Math.floor(A*4)],p=[0,Math.floor(g*7)];L[n].tickvals=T,L[n].range=p,L[n].tickformat=".2s";return}b=0,d=z.layout[n].range[1]}L[n].range=[b,d],L[n].fixedrange=!0,t.push(n),y[n]!==void 0&&y[n].map(m=>{if(m.ay!==void 0){const g=m.ay,k=Math.min(Math.max(g,b+h*.2),d-h*.2);L.annotations===void 0&&(L.annotations=z.layout.annotations),L.annotations[m.index].ay=k}})}}),z.layout=E8(z.layout,L),{to_update:z.layout,yaxis_fixedrange:t}}}catch(W){console.log(`Error in AutoScaling: ${W}`)}return{to_update:{},yaxis_fixedrange:[]}}function Y9({open:O,onColorChange:z}){const[W,ce]=mr.useState(!1);function Te(D){z(D)}return O&&!W&&ce(!0),!O&&W&&ce(!1),mr.useEffect(()=>{if(W){let D=function(t){let b=0,d=0,e=0,w=0;document.getElementById(t.id+"_header")?document.getElementById(t.id+"_header").onmousedown=y:t.onmousedown=y;function y(r){r=r||window.event,r.preventDefault(),e=r.clientX,w=r.clientY,document.onmouseup=u,document.onmousemove=_}function _(r){r=r||window.event,r.preventDefault(),b=e-r.clientX,d=w-r.clientY,e=r.clientX,w=r.clientY,t.style.top=t.offsetTop-d+"px",t.style.left=t.offsetLeft-b+"px"}function u(){document.onmouseup=null,document.onmousemove=null}},L=document.getElementById("changecolor");L.style.display="block",L.style.width=null,D(L)}else document.getElementById("changecolor").style.display="none"},[W]),Kr("div",{id:"changecolor",children:Kr("div",{id:"changecolor_header",children:Kr("input",{type:"color",id:"picked_color",value:"#00ACFF",onChange:D=>{let L=D.target.value;Te(L)}})})})}const nd={sunIcon:{viewBox:"0 0 16 16",width:16,height:16,path:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"},moonIcon:{viewBox:"0 0 25 25",width:25,height:25,path:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"},plotCsv:{width:900,height:900,path:"M170.666667 106.666667l0.192 736H906.666667v64H149.546667c-23.552 0-42.666667-19.093333-42.666667-42.666667L106.666667 106.666667h64z m686.506666 454.144l13.653334 16.362666a21.333333 21.333333 0 0 1-2.666667 30.058667l-171.157333 143.146667a21.333333 21.333333 0 0 1-21.546667 3.477333l-229.973333-91.285333-113.834667 94.997333a21.333333 21.333333 0 0 1-30.037333-2.709333l-13.653334-16.362667a21.333333 21.333333 0 0 1 2.688-30.058667l133.312-111.274666a21.333333 21.333333 0 0 1 21.546667-3.456l229.930667 91.264 151.68-126.826667a21.333333 21.333333 0 0 1 30.037333 2.666667z m-1.621333-417.962667l16.896 13.013333a21.333333 21.333333 0 0 1 3.925333 29.888L685.802667 433.706667a21.333333 21.333333 0 0 1-20.202667 8.085333l-226.794667-35.413333-150.186666 222.357333a21.333333 21.333333 0 0 1-27.477334 7.018667l-2.133333-1.28-17.685333-11.946667a21.333333 21.333333 0 0 1-5.738667-29.610667l165.354667-244.821333a21.333333 21.333333 0 0 1 20.992-9.130667L650.453333 374.613333l175.146667-227.882666a21.333333 21.333333 0 0 1 29.930667-3.904z"},addText:{path:"M896 928H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32z m-736-64h704v-704h-704z M704 352H320a32 32 0 0 1 0-64h384a32 32 0 0 1 0 64z M512 736a32 32 0 0 1-32-32V320a32 32 0 0 1 64 0v384a32 32 0 0 1-32 32z",width:950,height:950},changeTitle:{path:"M122.368 165.888h778.24c-9.216 0-16.384-7.168-16.384-16.384v713.728c0-9.216 7.168-16.384 16.384-16.384h-778.24c9.216 0 16.384 7.168 16.384 16.384V150.016c0 8.192-6.656 15.872-16.384 15.872z m-32.768 684.544c0 26.112 20.992 47.104 47.104 47.104h750.08c26.112 0 47.104-20.992 47.104-47.104V162.304c0-26.112-20.992-47.104-47.104-47.104H136.704c-26.112 0-47.104 20.992-47.104 47.104v688.128z M244.736 656.896h534.016v62.464H244.736z M373.76 358.4H307.2v219.136h-45.568V358.4H192v-41.472H373.76V358.4zM403.968 316.928h44.032v50.176h-44.032v-50.176z m0 67.072h44.032v194.048h-44.032V384zM576.512 541.184l8.704 31.744c-13.312 5.12-26.624 8.192-38.912 8.704-32.768 1.024-48.64-15.36-48.128-48.128V422.912h-26.624V384h26.624v-46.592l44.032-21.504V384h36.352v38.912h-36.352V532.48c-1.024 10.24 3.072 14.848 11.264 13.824 5.12 0 12.8-1.536 23.04-5.12zM619.008 316.928h44.032v260.608h-44.032V316.928zM813.056 509.952l41.472 12.8c-11.776 40.96-37.888 61.44-78.336 60.416-52.736-1.536-80.384-34.304-81.92-98.304 2.56-67.072 29.696-102.4 81.92-105.984 52.224 1.536 78.336 36.864 79.36 105.984v13.824h-117.248c3.584 30.208 15.872 45.568 37.888 46.592 19.968 0.512 32.256-11.264 36.864-35.328z m-72.704-51.712h70.656c-1.024-25.088-12.288-38.4-33.792-38.912-21.504 0.512-33.792 13.824-36.864 38.912z",width:920,height:900},changeColor:{path:"M8 3C5.79 3 4 4.79 4 7V14C4 15.1 4.9 16 6 16H9V20C9 21.1 9.9 22 11 22H13C14.1 22 15 21.1 15 20V16H18C19.1 16 20 15.1 20 14V3H8M8 5H12V7H14V5H15V9H17V5H18V10H6V7C6 5.9 6.9 5 8 5M6 14V12H18V14H6Z",width:22,height:22},uploadImage:{path:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5",width:1024,height:1024},downloadCsv:{path:`M486.2,196.121h-13.164V132.59c0-0.399-0.064-0.795-0.116-1.2c-0.021-2.52-0.824-5-2.551-6.96L364.656,3.677 c-0.031-0.034-0.064-0.044-0.085-0.075c-0.629-0.707-1.364-1.292-2.141-1.796c-0.231-0.157-0.462-0.286-0.704-0.419 c-0.672-0.365-1.386-0.672-2.121-0.893c-0.199-0.052-0.377-0.134-0.576-0.188C358.229,0.118,357.4,0,356.562,0H96.757 C84.893,0,75.256,9.649,75.256,21.502v174.613H62.093c-16.972,0-30.733,13.756-30.733,30.73v159.81 @@ -4148,8 +4148,8 @@ uniform ${Re} ${Ue} u_${it}; c0,32.158,19.051,52.4,51.456,52.4c10.947,0,23.097-2.378,30.241-5.238l5.483,28.346c-6.672,3.34-21.674,6.919-41.208,6.919 C98.06,382.976,69.474,348.424,69.474,302.692z M451.534,520.962H96.757v-103.57h354.777V520.962z M427.518,380.583h-42.399 l-51.45-160.536h39.787l19.526,67.894c5.479,19.046,10.479,37.386,14.299,57.397h0.709c4.048-19.298,9.045-38.352,14.526-56.693 - l20.487-68.598h38.599L427.518,380.583z`,width:550,height:550,transform:"translate(4, 0)"},downloadImage:{path:"M22.71,6.29a1,1,0,0,0-1.42,0L20,7.59V2a1,1,0,0,0-2,0V7.59l-1.29-1.3a1,1,0,0,0-1.42,1.42l3,3a1,1,0,0,0,.33.21.94.94,0,0,0,.76,0,1,1,0,0,0,.33-.21l3-3A1,1,0,0,0,22.71,6.29ZM19,13a1,1,0,0,0-1,1v.38L16.52,12.9a2.79,2.79,0,0,0-3.93,0l-.7.7L9.41,11.12a2.85,2.85,0,0,0-3.93,0L4,12.6V7A1,1,0,0,1,5,6h8a1,1,0,0,0,0-2H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H17a3,3,0,0,0,3-3V14A1,1,0,0,0,19,13ZM5,20a1,1,0,0,1-1-1V15.43l2.9-2.9a.79.79,0,0,1,1.09,0l3.17,3.17,0,0L15.46,20Zm13-1a.89.89,0,0,1-.18.53L13.31,15l.7-.7a.77.77,0,0,1,1.1,0L18,17.21Z",width:21,height:21,transform:"translate(-2, -2)"}},K9={line:{up_color:"#0074D9",down_color:"#FF4136",color:"#111111",width:1.5},data:{candlestick:[{decreasing:{fillcolor:"#e4003a",line:{color:"#e4003a"}},increasing:{fillcolor:"#00ACFF",line:{color:"#00ACFF"}},type:"candlestick"}]},layout:{annotationdefaults:{showarrow:!1},autotypenumbers:"strict",colorway:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#bcbd22","#17becf","#aec7e8","#ffbb78","#ff9896","#c5b0d5","#f7b6d2","#dbdb8d","#9edae5"],dragmode:"pan",font:{family:"Fira Code",size:18},hoverlabel:{align:"left"},mapbox:{style:"dark"},hovermode:"x",legend:{bgcolor:"rgba(0, 0, 0, 0)",x:1,xanchor:"right",y:.99,yanchor:"bottom",font:{size:15}},paper_bgcolor:"#000000",plot_bgcolor:"#000000",xaxis:{automargin:!0,autorange:!0,rangeslider:{visible:!1},showgrid:!0,showline:!0,tickfont:{size:14},zeroline:!1,tick0:1,title:{standoff:20,text:""},gridcolor:"#283442",linecolor:"#F5EFF3",mirror:!0,ticks:"outside"},yaxis:{anchor:"x",automargin:!0,fixedrange:!1,zeroline:!1,showgrid:!0,showline:!0,side:"right",tick0:.5,tickfont:{size:14},title:{standoff:20,text:""},gridcolor:"#283442",linecolor:"#F5EFF3",mirror:!0,ticks:"outside"}}},J9={line:{up_color:"#0074D9",down_color:"#FF4136",color:"#111111",width:1.5},data:{barpolar:[{marker:{line:{color:"white",width:.5},pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"barpolar"}],bar:[{error_x:{color:"#2a3f5f"},error_y:{color:"#2a3f5f"},marker:{line:{color:"white",width:.5},pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"bar"}],carpet:[{aaxis:{endlinecolor:"#2a3f5f",gridcolor:"#C8D4E3",linecolor:"#C8D4E3",minorgridcolor:"#C8D4E3",startlinecolor:"#2a3f5f"},baxis:{endlinecolor:"#2a3f5f",gridcolor:"#C8D4E3",linecolor:"#C8D4E3",minorgridcolor:"#C8D4E3",startlinecolor:"#2a3f5f"},type:"carpet"}],choropleth:[{colorbar:{outlinewidth:0,ticks:""},type:"choropleth"}],contourcarpet:[{colorbar:{outlinewidth:0,ticks:""},type:"contourcarpet"}],contour:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"contour"}],heatmapgl:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"heatmapgl"}],heatmap:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"heatmap"}],histogram2dcontour:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"histogram2dcontour"}],histogram2d:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"histogram2d"}],histogram:[{marker:{pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"histogram"}],mesh3d:[{colorbar:{outlinewidth:0,ticks:""},type:"mesh3d"}],parcoords:[{line:{colorbar:{outlinewidth:0,ticks:""}},type:"parcoords"}],pie:[{automargin:!0,type:"pie"}],scatter3d:[{line:{colorbar:{outlinewidth:0,ticks:""}},marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatter3d"}],scattercarpet:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattercarpet"}],scattergeo:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattergeo"}],scattergl:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattergl"}],scattermapbox:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattermapbox"}],scatterpolargl:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterpolargl"}],scatterpolar:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterpolar"}],scatter:[{fillpattern:{fillmode:"overlay",size:10,solidity:.2},type:"scatter"}],scatterternary:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterternary"}],surface:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"surface"}],table:[{cells:{fill:{color:"#EBF0F8"},line:{color:"white"}},header:{fill:{color:"#C8D4E3"},line:{color:"white"}},type:"table"}],candlestick:[{decreasing:{fillcolor:"#e4003a",line:{color:"#e4003a"}},increasing:{fillcolor:"#00ACFF",line:{color:"#00ACFF"}},type:"candlestick"}]},layout:{annotationdefaults:{arrowcolor:"#2a3f5f",arrowhead:0,arrowwidth:1,showarrow:!1},autotypenumbers:"strict",coloraxis:{colorbar:{outlinewidth:0,ticks:""}},colorscale:{diverging:[[0,"#8e0152"],[.1,"#c51b7d"],[.2,"#de77ae"],[.3,"#f1b6da"],[.4,"#fde0ef"],[.5,"#f7f7f7"],[.6,"#e6f5d0"],[.7,"#b8e186"],[.8,"#7fbc41"],[.9,"#4d9221"],[1,"#276419"]],sequential:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],sequentialminus:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]]},colorway:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#bcbd22","#17becf","#aec7e8","#ffbb78","#ff9896","#c5b0d5","#f7b6d2","#dbdb8d","#9edae5"],font:{color:"#2a3f5f"},geo:{bgcolor:"white",lakecolor:"white",landcolor:"white",showlakes:!0,showland:!0,subunitcolor:"#C8D4E3"},hoverlabel:{align:"left"},hovermode:"x",mapbox:{style:"light"},paper_bgcolor:"#FFFFFF",plot_bgcolor:"#FFFFFF",polar:{angularaxis:{gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:""},bgcolor:"white",radialaxis:{gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:""}},scene:{xaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"},yaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"},zaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"}},shapedefaults:{line:{color:"#2a3f5f"}},ternary:{aaxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""},baxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""},bgcolor:"white",caxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""}},title:{x:.05},xaxis:{automargin:!0,autorange:!0,rangeslider:{visible:!1},showgrid:!0,showline:!0,tickfont:{size:14},zeroline:!1,tick0:1,title:{standoff:20,font:{size:16}},gridcolor:"#283442",linecolor:"#A9A9A9",mirror:!0,ticks:"outside"},yaxis:{anchor:"x",automargin:!0,fixedrange:!1,zeroline:!1,showgrid:!0,showline:!0,side:"right",tick0:.5,tickfont:{size:14},title:{standoff:20,font:{size:16}},gridcolor:"rgba(128, 128, 128, 0.33)",linecolor:"#A9A9A9",mirror:!0,ticks:"outside"},dragmode:"pan",legend:{bgcolor:"rgba(255, 255, 255, 0)",x:1,xanchor:"right",y:1.02,yanchor:"bottom",font:{size:12}}}};function y0(O,z,{checkForDefaultPrevented:W=!0}={}){return function(Te){if(O==null||O(Te),W===!1||!Te.defaultPrevented)return z==null?void 0:z(Te)}}function C4(O,z){if(typeof O=="function")return O(z);O!=null&&(O.current=z)}function C8(...O){return z=>{let W=!1;const ce=O.map(Te=>{const D=C4(Te,z);return!W&&typeof D=="function"&&(W=!0),D});if(W)return()=>{for(let Te=0;Te{const{children:L,...t}=D,b=mr.useMemo(()=>t,Object.values(t));return Kr(W.Provider,{value:b,children:L})};ce.displayName=O+"Provider";function Te(D){const L=mr.useContext(W);if(L)return L;if(z!==void 0)return z;throw new Error(`\`${D}\` must be used within \`${O}\``)}return[ce,Te]}function eE(O,z=[]){let W=[];function ce(D,L){const t=mr.createContext(L),b=W.length;W=[...W,L];const d=w=>{var l;const{scope:y,children:_,...u}=w,r=((l=y==null?void 0:y[O])==null?void 0:l[b])||t,n=mr.useMemo(()=>u,Object.values(u));return Kr(r.Provider,{value:n,children:_})};d.displayName=D+"Provider";function e(w,y){var r;const _=((r=y==null?void 0:y[O])==null?void 0:r[b])||t,u=mr.useContext(_);if(u)return u;if(L!==void 0)return L;throw new Error(`\`${w}\` must be used within \`${D}\``)}return[d,e]}const Te=()=>{const D=W.map(L=>mr.createContext(L));return function(t){const b=(t==null?void 0:t[O])||D;return mr.useMemo(()=>({[`__scope${O}`]:{...t,[O]:b}}),[t,b])}};return Te.scopeName=O,[ce,tE(Te,...z)]}function tE(...O){const z=O[0];if(O.length===1)return z;const W=()=>{const ce=O.map(Te=>({useScope:Te(),scopeName:Te.scopeName}));return function(D){const L=ce.reduce((t,{useScope:b,scopeName:d})=>{const w=b(D)[`__scope${d}`];return{...t,...w}},{});return mr.useMemo(()=>({[`__scope${z.scopeName}`]:L}),[L])}};return W.scopeName=z.scopeName,W}var $b=globalThis!=null&&globalThis.document?mr.useLayoutEffect:()=>{},nE=CA["useId".toString()]||(()=>{}),rE=0;function g2(O){const[z,W]=mr.useState(nE());return $b(()=>{O||W(ce=>ce??String(rE++))},[O]),O||(z?`radix-${z}`:"")}function Fg(O){const z=mr.useRef(O);return mr.useEffect(()=>{z.current=O}),mr.useMemo(()=>(...W)=>{var ce;return(ce=z.current)==null?void 0:ce.call(z,...W)},[])}function iE({prop:O,defaultProp:z,onChange:W=()=>{}}){const[ce,Te]=aE({defaultProp:z,onChange:W}),D=O!==void 0,L=D?O:ce,t=Fg(W),b=mr.useCallback(d=>{if(D){const w=typeof d=="function"?d(O):d;w!==O&&t(w)}else Te(d)},[D,O,Te,t]);return[L,b]}function aE({defaultProp:O,onChange:z}){const W=mr.useState(O),[ce]=W,Te=mr.useRef(ce),D=Fg(z);return mr.useEffect(()=>{Te.current!==ce&&(D(ce),Te.current=ce)},[ce,Te,D]),W}var a3=mr.forwardRef((O,z)=>{const{children:W,...ce}=O,Te=mr.Children.toArray(W),D=Te.find(sE);if(D){const L=D.props.children,t=Te.map(b=>b===D?mr.Children.count(L)>1?mr.Children.only(null):mr.isValidElement(L)?L.props.children:null:b);return Kr(Yb,{...ce,ref:z,children:mr.isValidElement(L)?mr.cloneElement(L,void 0,t):null})}return Kr(Yb,{...ce,ref:z,children:W})});a3.displayName="Slot";var Yb=mr.forwardRef((O,z)=>{const{children:W,...ce}=O;if(mr.isValidElement(W)){const Te=uE(W);return mr.cloneElement(W,{...lE(ce,W.props),ref:z?C8(z,Te):Te})}return mr.Children.count(W)>1?mr.Children.only(null):null});Yb.displayName="SlotClone";var oE=({children:O})=>Kr(Wm,{children:O});function sE(O){return mr.isValidElement(O)&&O.type===oE}function lE(O,z){const W={...z};for(const ce in z){const Te=O[ce],D=z[ce];/^on[A-Z]/.test(ce)?Te&&D?W[ce]=(...t)=>{D(...t),Te(...t)}:Te&&(W[ce]=Te):ce==="style"?W[ce]={...Te,...D}:ce==="className"&&(W[ce]=[Te,D].filter(Boolean).join(" "))}return{...O,...W}}function uE(O){var ce,Te;let z=(ce=Object.getOwnPropertyDescriptor(O.props,"ref"))==null?void 0:ce.get,W=z&&"isReactWarning"in z&&z.isReactWarning;return W?O.ref:(z=(Te=Object.getOwnPropertyDescriptor(O,"ref"))==null?void 0:Te.get,W=z&&"isReactWarning"in z&&z.isReactWarning,W?O.props.ref:O.props.ref||O.ref)}var cE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],S0=cE.reduce((O,z)=>{const W=mr.forwardRef((ce,Te)=>{const{asChild:D,...L}=ce,t=D?a3:z;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Kr(t,{...L,ref:Te})});return W.displayName=`Primitive.${z}`,{...O,[z]:W}},{});function hE(O,z){O&&lk.flushSync(()=>O.dispatchEvent(z))}function fE(O,z=globalThis==null?void 0:globalThis.document){const W=Fg(O);mr.useEffect(()=>{const ce=Te=>{Te.key==="Escape"&&W(Te)};return z.addEventListener("keydown",ce,{capture:!0}),()=>z.removeEventListener("keydown",ce,{capture:!0})},[W,z])}var pE="DismissableLayer",Xb="dismissableLayer.update",dE="dismissableLayer.pointerDownOutside",gE="dismissableLayer.focusOutside",I4,I8=mr.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),P8=mr.forwardRef((O,z)=>{const{disableOutsidePointerEvents:W=!1,onEscapeKeyDown:ce,onPointerDownOutside:Te,onFocusOutside:D,onInteractOutside:L,onDismiss:t,...b}=O,d=mr.useContext(I8),[e,w]=mr.useState(null),y=(e==null?void 0:e.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=mr.useState({}),u=Ug(z,m=>w(m)),r=Array.from(d.layers),[n]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),l=r.indexOf(n),o=e?r.indexOf(e):-1,s=d.layersWithOutsidePointerEventsDisabled.size>0,c=o>=l,h=yE(m=>{const g=m.target,k=[...d.branches].some(A=>A.contains(g));!c||k||(Te==null||Te(m),L==null||L(m),m.defaultPrevented||t==null||t())},y),x=xE(m=>{const g=m.target;[...d.branches].some(A=>A.contains(g))||(D==null||D(m),L==null||L(m),m.defaultPrevented||t==null||t())},y);return fE(m=>{o===d.layers.size-1&&(ce==null||ce(m),!m.defaultPrevented&&t&&(m.preventDefault(),t()))},y),mr.useEffect(()=>{if(e)return W&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(I4=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(e)),d.layers.add(e),P4(),()=>{W&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=I4)}},[e,y,W,d]),mr.useEffect(()=>()=>{e&&(d.layers.delete(e),d.layersWithOutsidePointerEventsDisabled.delete(e),P4())},[e,d]),mr.useEffect(()=>{const m=()=>_({});return document.addEventListener(Xb,m),()=>document.removeEventListener(Xb,m)},[]),Kr(S0.div,{...b,ref:u,style:{pointerEvents:s?c?"auto":"none":void 0,...O.style},onFocusCapture:y0(O.onFocusCapture,x.onFocusCapture),onBlurCapture:y0(O.onBlurCapture,x.onBlurCapture),onPointerDownCapture:y0(O.onPointerDownCapture,h.onPointerDownCapture)})});P8.displayName=pE;var mE="DismissableLayerBranch",vE=mr.forwardRef((O,z)=>{const W=mr.useContext(I8),ce=mr.useRef(null),Te=Ug(z,ce);return mr.useEffect(()=>{const D=ce.current;if(D)return W.branches.add(D),()=>{W.branches.delete(D)}},[W.branches]),Kr(S0.div,{...O,ref:Te})});vE.displayName=mE;function yE(O,z=globalThis==null?void 0:globalThis.document){const W=Fg(O),ce=mr.useRef(!1),Te=mr.useRef(()=>{});return mr.useEffect(()=>{const D=t=>{if(t.target&&!ce.current){let b=function(){L8(dE,W,d,{discrete:!0})};const d={originalEvent:t};t.pointerType==="touch"?(z.removeEventListener("click",Te.current),Te.current=b,z.addEventListener("click",Te.current,{once:!0})):b()}else z.removeEventListener("click",Te.current);ce.current=!1},L=window.setTimeout(()=>{z.addEventListener("pointerdown",D)},0);return()=>{window.clearTimeout(L),z.removeEventListener("pointerdown",D),z.removeEventListener("click",Te.current)}},[z,W]),{onPointerDownCapture:()=>ce.current=!0}}function xE(O,z=globalThis==null?void 0:globalThis.document){const W=Fg(O),ce=mr.useRef(!1);return mr.useEffect(()=>{const Te=D=>{D.target&&!ce.current&&L8(gE,W,{originalEvent:D},{discrete:!1})};return z.addEventListener("focusin",Te),()=>z.removeEventListener("focusin",Te)},[z,W]),{onFocusCapture:()=>ce.current=!0,onBlurCapture:()=>ce.current=!1}}function P4(){const O=new CustomEvent(Xb);document.dispatchEvent(O)}function L8(O,z,W,{discrete:ce}){const Te=W.originalEvent.target,D=new CustomEvent(O,{bubbles:!1,cancelable:!0,detail:W});z&&Te.addEventListener(O,z,{once:!0}),ce?hE(Te,D):Te.dispatchEvent(D)}var m2="focusScope.autoFocusOnMount",v2="focusScope.autoFocusOnUnmount",L4={bubbles:!1,cancelable:!0},_E="FocusScope",z8=mr.forwardRef((O,z)=>{const{loop:W=!1,trapped:ce=!1,onMountAutoFocus:Te,onUnmountAutoFocus:D,...L}=O,[t,b]=mr.useState(null),d=Fg(Te),e=Fg(D),w=mr.useRef(null),y=Ug(z,r=>b(r)),_=mr.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;mr.useEffect(()=>{if(ce){let r=function(s){if(_.paused||!t)return;const c=s.target;t.contains(c)?w.current=c:Xd(w.current,{select:!0})},n=function(s){if(_.paused||!t)return;const c=s.relatedTarget;c!==null&&(t.contains(c)||Xd(w.current,{select:!0}))},l=function(s){if(document.activeElement===document.body)for(const h of s)h.removedNodes.length>0&&Xd(t)};document.addEventListener("focusin",r),document.addEventListener("focusout",n);const o=new MutationObserver(l);return t&&o.observe(t,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",r),document.removeEventListener("focusout",n),o.disconnect()}}},[ce,t,_.paused]),mr.useEffect(()=>{if(t){O4.add(_);const r=document.activeElement;if(!t.contains(r)){const l=new CustomEvent(m2,L4);t.addEventListener(m2,d),t.dispatchEvent(l),l.defaultPrevented||(bE(SE(O8(t)),{select:!0}),document.activeElement===r&&Xd(t))}return()=>{t.removeEventListener(m2,d),setTimeout(()=>{const l=new CustomEvent(v2,L4);t.addEventListener(v2,e),t.dispatchEvent(l),l.defaultPrevented||Xd(r??document.body,{select:!0}),t.removeEventListener(v2,e),O4.remove(_)},0)}}},[t,d,e,_]);const u=mr.useCallback(r=>{if(!W&&!ce||_.paused)return;const n=r.key==="Tab"&&!r.altKey&&!r.ctrlKey&&!r.metaKey,l=document.activeElement;if(n&&l){const o=r.currentTarget,[s,c]=wE(o);s&&c?!r.shiftKey&&l===c?(r.preventDefault(),W&&Xd(s,{select:!0})):r.shiftKey&&l===s&&(r.preventDefault(),W&&Xd(c,{select:!0})):l===o&&r.preventDefault()}},[W,ce,_.paused]);return Kr(S0.div,{tabIndex:-1,...L,ref:y,onKeyDown:u})});z8.displayName=_E;function bE(O,{select:z=!1}={}){const W=document.activeElement;for(const ce of O)if(Xd(ce,{select:z}),document.activeElement!==W)return}function wE(O){const z=O8(O),W=z4(z,O),ce=z4(z.reverse(),O);return[W,ce]}function O8(O){const z=[],W=document.createTreeWalker(O,NodeFilter.SHOW_ELEMENT,{acceptNode:ce=>{const Te=ce.tagName==="INPUT"&&ce.type==="hidden";return ce.disabled||ce.hidden||Te?NodeFilter.FILTER_SKIP:ce.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;W.nextNode();)z.push(W.currentNode);return z}function z4(O,z){for(const W of O)if(!TE(W,{upTo:z}))return W}function TE(O,{upTo:z}){if(getComputedStyle(O).visibility==="hidden")return!0;for(;O;){if(z!==void 0&&O===z)return!1;if(getComputedStyle(O).display==="none")return!0;O=O.parentElement}return!1}function kE(O){return O instanceof HTMLInputElement&&"select"in O}function Xd(O,{select:z=!1}={}){if(O&&O.focus){const W=document.activeElement;O.focus({preventScroll:!0}),O!==W&&kE(O)&&z&&O.select()}}var O4=AE();function AE(){let O=[];return{add(z){const W=O[0];z!==W&&(W==null||W.pause()),O=D4(O,z),O.unshift(z)},remove(z){var W;O=D4(O,z),(W=O[0])==null||W.resume()}}}function D4(O,z){const W=[...O],ce=W.indexOf(z);return ce!==-1&&W.splice(ce,1),W}function SE(O){return O.filter(z=>z.tagName!=="A")}function ME(O,z){return mr.useReducer((W,ce)=>z[W][ce]??W,O)}var o3=O=>{const{present:z,children:W}=O,ce=EE(z),Te=typeof W=="function"?W({present:ce.isPresent}):mr.Children.only(W),D=Ug(ce.ref,CE(Te));return typeof W=="function"||ce.isPresent?mr.cloneElement(Te,{ref:D}):null};o3.displayName="Presence";function EE(O){const[z,W]=mr.useState(),ce=mr.useRef({}),Te=mr.useRef(O),D=mr.useRef("none"),L=O?"mounted":"unmounted",[t,b]=ME(L,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return mr.useEffect(()=>{const d=jy(ce.current);D.current=t==="mounted"?d:"none"},[t]),$b(()=>{const d=ce.current,e=Te.current;if(e!==O){const y=D.current,_=jy(d);O?b("MOUNT"):_==="none"||(d==null?void 0:d.display)==="none"?b("UNMOUNT"):b(e&&y!==_?"ANIMATION_OUT":"UNMOUNT"),Te.current=O}},[O,b]),$b(()=>{if(z){let d;const e=z.ownerDocument.defaultView??window,w=_=>{const r=jy(ce.current).includes(_.animationName);if(_.target===z&&r&&(b("ANIMATION_END"),!Te.current)){const n=z.style.animationFillMode;z.style.animationFillMode="forwards",d=e.setTimeout(()=>{z.style.animationFillMode==="forwards"&&(z.style.animationFillMode=n)})}},y=_=>{_.target===z&&(D.current=jy(ce.current))};return z.addEventListener("animationstart",y),z.addEventListener("animationcancel",w),z.addEventListener("animationend",w),()=>{e.clearTimeout(d),z.removeEventListener("animationstart",y),z.removeEventListener("animationcancel",w),z.removeEventListener("animationend",w)}}else b("ANIMATION_END")},[z,b]),{isPresent:["mounted","unmountSuspended"].includes(t),ref:mr.useCallback(d=>{d&&(ce.current=getComputedStyle(d)),W(d)},[])}}function jy(O){return(O==null?void 0:O.animationName)||"none"}function CE(O){var ce,Te;let z=(ce=Object.getOwnPropertyDescriptor(O.props,"ref"))==null?void 0:ce.get,W=z&&"isReactWarning"in z&&z.isReactWarning;return W?O.ref:(z=(Te=Object.getOwnPropertyDescriptor(O,"ref"))==null?void 0:Te.get,W=z&&"isReactWarning"in z&&z.isReactWarning,W?O.props.ref:O.props.ref||O.ref)}var y2=0;function IE(){mr.useEffect(()=>{const O=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",O[0]??R4()),document.body.insertAdjacentElement("beforeend",O[1]??R4()),y2++,()=>{y2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(z=>z.remove()),y2--}},[])}function R4(){const O=document.createElement("span");return O.setAttribute("data-radix-focus-guard",""),O.tabIndex=0,O.style.outline="none",O.style.opacity="0",O.style.position="fixed",O.style.pointerEvents="none",O}var xp=function(){return xp=Object.assign||function(z){for(var W,ce=1,Te=arguments.length;ce"u")return ZE;var z=$E(O),W=document.documentElement.clientWidth,ce=window.innerWidth;return{left:z[0],top:z[1],right:z[2],gap:Math.max(0,ce-W+z[2]-z[0])}},XE=B8(),nv="data-scroll-locked",KE=function(O,z,W,ce){var Te=O.left,D=O.top,L=O.right,t=O.gap;return W===void 0&&(W="margin"),` - .`.concat(LE,` { + l20.487-68.598h38.599L427.518,380.583z`,width:550,height:550,transform:"translate(4, 0)"},downloadImage:{path:"M22.71,6.29a1,1,0,0,0-1.42,0L20,7.59V2a1,1,0,0,0-2,0V7.59l-1.29-1.3a1,1,0,0,0-1.42,1.42l3,3a1,1,0,0,0,.33.21.94.94,0,0,0,.76,0,1,1,0,0,0,.33-.21l3-3A1,1,0,0,0,22.71,6.29ZM19,13a1,1,0,0,0-1,1v.38L16.52,12.9a2.79,2.79,0,0,0-3.93,0l-.7.7L9.41,11.12a2.85,2.85,0,0,0-3.93,0L4,12.6V7A1,1,0,0,1,5,6h8a1,1,0,0,0,0-2H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H17a3,3,0,0,0,3-3V14A1,1,0,0,0,19,13ZM5,20a1,1,0,0,1-1-1V15.43l2.9-2.9a.79.79,0,0,1,1.09,0l3.17,3.17,0,0L15.46,20Zm13-1a.89.89,0,0,1-.18.53L13.31,15l.7-.7a.77.77,0,0,1,1.1,0L18,17.21Z",width:21,height:21,transform:"translate(-2, -2)"}},X9={line:{up_color:"#0074D9",down_color:"#FF4136",color:"#111111",width:1.5},data:{candlestick:[{decreasing:{fillcolor:"#e4003a",line:{color:"#e4003a"}},increasing:{fillcolor:"#00ACFF",line:{color:"#00ACFF"}},type:"candlestick"}]},layout:{annotationdefaults:{showarrow:!1},autotypenumbers:"strict",colorway:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#bcbd22","#17becf","#aec7e8","#ffbb78","#ff9896","#c5b0d5","#f7b6d2","#dbdb8d","#9edae5"],dragmode:"pan",font:{family:"Fira Code",size:18},hoverlabel:{align:"left"},mapbox:{style:"dark"},hovermode:"x",legend:{bgcolor:"rgba(0, 0, 0, 0)",x:1,xanchor:"right",y:.99,yanchor:"bottom",font:{size:15}},paper_bgcolor:"#000000",plot_bgcolor:"#000000",xaxis:{automargin:!0,autorange:!0,rangeslider:{visible:!1},showgrid:!0,showline:!0,tickfont:{size:14},zeroline:!1,tick0:1,title:{standoff:20,text:""},gridcolor:"#283442",linecolor:"#F5EFF3",mirror:!0,ticks:"outside"},yaxis:{anchor:"x",automargin:!0,fixedrange:!1,zeroline:!1,showgrid:!0,showline:!0,side:"right",tick0:.5,tickfont:{size:14},title:{standoff:20,text:""},gridcolor:"#283442",linecolor:"#F5EFF3",mirror:!0,ticks:"outside"}}},K9={line:{up_color:"#0074D9",down_color:"#FF4136",color:"#111111",width:1.5},data:{barpolar:[{marker:{line:{color:"white",width:.5},pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"barpolar"}],bar:[{error_x:{color:"#2a3f5f"},error_y:{color:"#2a3f5f"},marker:{line:{color:"white",width:.5},pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"bar"}],carpet:[{aaxis:{endlinecolor:"#2a3f5f",gridcolor:"#C8D4E3",linecolor:"#C8D4E3",minorgridcolor:"#C8D4E3",startlinecolor:"#2a3f5f"},baxis:{endlinecolor:"#2a3f5f",gridcolor:"#C8D4E3",linecolor:"#C8D4E3",minorgridcolor:"#C8D4E3",startlinecolor:"#2a3f5f"},type:"carpet"}],choropleth:[{colorbar:{outlinewidth:0,ticks:""},type:"choropleth"}],contourcarpet:[{colorbar:{outlinewidth:0,ticks:""},type:"contourcarpet"}],contour:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"contour"}],heatmapgl:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"heatmapgl"}],heatmap:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"heatmap"}],histogram2dcontour:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"histogram2dcontour"}],histogram2d:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"histogram2d"}],histogram:[{marker:{pattern:{fillmode:"overlay",size:10,solidity:.2}},type:"histogram"}],mesh3d:[{colorbar:{outlinewidth:0,ticks:""},type:"mesh3d"}],parcoords:[{line:{colorbar:{outlinewidth:0,ticks:""}},type:"parcoords"}],pie:[{automargin:!0,type:"pie"}],scatter3d:[{line:{colorbar:{outlinewidth:0,ticks:""}},marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatter3d"}],scattercarpet:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattercarpet"}],scattergeo:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattergeo"}],scattergl:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattergl"}],scattermapbox:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scattermapbox"}],scatterpolargl:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterpolargl"}],scatterpolar:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterpolar"}],scatter:[{fillpattern:{fillmode:"overlay",size:10,solidity:.2},type:"scatter"}],scatterternary:[{marker:{colorbar:{outlinewidth:0,ticks:""}},type:"scatterternary"}],surface:[{colorbar:{outlinewidth:0,ticks:""},colorscale:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],type:"surface"}],table:[{cells:{fill:{color:"#EBF0F8"},line:{color:"white"}},header:{fill:{color:"#C8D4E3"},line:{color:"white"}},type:"table"}],candlestick:[{decreasing:{fillcolor:"#e4003a",line:{color:"#e4003a"}},increasing:{fillcolor:"#00ACFF",line:{color:"#00ACFF"}},type:"candlestick"}]},layout:{annotationdefaults:{arrowcolor:"#2a3f5f",arrowhead:0,arrowwidth:1,showarrow:!1},autotypenumbers:"strict",coloraxis:{colorbar:{outlinewidth:0,ticks:""}},colorscale:{diverging:[[0,"#8e0152"],[.1,"#c51b7d"],[.2,"#de77ae"],[.3,"#f1b6da"],[.4,"#fde0ef"],[.5,"#f7f7f7"],[.6,"#e6f5d0"],[.7,"#b8e186"],[.8,"#7fbc41"],[.9,"#4d9221"],[1,"#276419"]],sequential:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]],sequentialminus:[[0,"#0d0887"],[.1111111111111111,"#46039f"],[.2222222222222222,"#7201a8"],[.3333333333333333,"#9c179e"],[.4444444444444444,"#bd3786"],[.5555555555555556,"#d8576b"],[.6666666666666666,"#ed7953"],[.7777777777777778,"#fb9f3a"],[.8888888888888888,"#fdca26"],[1,"#f0f921"]]},colorway:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#bcbd22","#17becf","#aec7e8","#ffbb78","#ff9896","#c5b0d5","#f7b6d2","#dbdb8d","#9edae5"],font:{color:"#2a3f5f"},geo:{bgcolor:"white",lakecolor:"white",landcolor:"white",showlakes:!0,showland:!0,subunitcolor:"#C8D4E3"},hoverlabel:{align:"left"},hovermode:"x",mapbox:{style:"light"},paper_bgcolor:"#FFFFFF",plot_bgcolor:"#FFFFFF",polar:{angularaxis:{gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:""},bgcolor:"white",radialaxis:{gridcolor:"#EBF0F8",linecolor:"#EBF0F8",ticks:""}},scene:{xaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"},yaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"},zaxis:{backgroundcolor:"white",gridcolor:"#DFE8F3",gridwidth:2,linecolor:"#EBF0F8",showbackground:!0,ticks:"",zerolinecolor:"#EBF0F8"}},shapedefaults:{line:{color:"#2a3f5f"}},ternary:{aaxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""},baxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""},bgcolor:"white",caxis:{gridcolor:"#DFE8F3",linecolor:"#A2B1C6",ticks:""}},title:{x:.05},xaxis:{automargin:!0,autorange:!0,rangeslider:{visible:!1},showgrid:!0,showline:!0,tickfont:{size:14},zeroline:!1,tick0:1,title:{standoff:20,font:{size:16}},gridcolor:"#283442",linecolor:"#A9A9A9",mirror:!0,ticks:"outside"},yaxis:{anchor:"x",automargin:!0,fixedrange:!1,zeroline:!1,showgrid:!0,showline:!0,side:"right",tick0:.5,tickfont:{size:14},title:{standoff:20,font:{size:16}},gridcolor:"rgba(128, 128, 128, 0.33)",linecolor:"#A9A9A9",mirror:!0,ticks:"outside"},dragmode:"pan",legend:{bgcolor:"rgba(255, 255, 255, 0)",x:1,xanchor:"right",y:1.02,yanchor:"bottom",font:{size:12}}}};function y0(O,z,{checkForDefaultPrevented:W=!0}={}){return function(Te){if(O==null||O(Te),W===!1||!Te.defaultPrevented)return z==null?void 0:z(Te)}}function C4(O,z){if(typeof O=="function")return O(z);O!=null&&(O.current=z)}function C8(...O){return z=>{let W=!1;const ce=O.map(Te=>{const D=C4(Te,z);return!W&&typeof D=="function"&&(W=!0),D});if(W)return()=>{for(let Te=0;Te{const{children:L,...t}=D,b=mr.useMemo(()=>t,Object.values(t));return Kr(W.Provider,{value:b,children:L})};ce.displayName=O+"Provider";function Te(D){const L=mr.useContext(W);if(L)return L;if(z!==void 0)return z;throw new Error(`\`${D}\` must be used within \`${O}\``)}return[ce,Te]}function Q9(O,z=[]){let W=[];function ce(D,L){const t=mr.createContext(L),b=W.length;W=[...W,L];const d=w=>{var l;const{scope:y,children:_,...u}=w,r=((l=y==null?void 0:y[O])==null?void 0:l[b])||t,n=mr.useMemo(()=>u,Object.values(u));return Kr(r.Provider,{value:n,children:_})};d.displayName=D+"Provider";function e(w,y){var r;const _=((r=y==null?void 0:y[O])==null?void 0:r[b])||t,u=mr.useContext(_);if(u)return u;if(L!==void 0)return L;throw new Error(`\`${w}\` must be used within \`${D}\``)}return[d,e]}const Te=()=>{const D=W.map(L=>mr.createContext(L));return function(t){const b=(t==null?void 0:t[O])||D;return mr.useMemo(()=>({[`__scope${O}`]:{...t,[O]:b}}),[t,b])}};return Te.scopeName=O,[ce,eE(Te,...z)]}function eE(...O){const z=O[0];if(O.length===1)return z;const W=()=>{const ce=O.map(Te=>({useScope:Te(),scopeName:Te.scopeName}));return function(D){const L=ce.reduce((t,{useScope:b,scopeName:d})=>{const w=b(D)[`__scope${d}`];return{...t,...w}},{});return mr.useMemo(()=>({[`__scope${z.scopeName}`]:L}),[L])}};return W.scopeName=z.scopeName,W}var $b=globalThis!=null&&globalThis.document?mr.useLayoutEffect:()=>{},tE=EA["useId".toString()]||(()=>{}),nE=0;function g2(O){const[z,W]=mr.useState(tE());return $b(()=>{O||W(ce=>ce??String(nE++))},[O]),O||(z?`radix-${z}`:"")}function Fg(O){const z=mr.useRef(O);return mr.useEffect(()=>{z.current=O}),mr.useMemo(()=>(...W)=>{var ce;return(ce=z.current)==null?void 0:ce.call(z,...W)},[])}function rE({prop:O,defaultProp:z,onChange:W=()=>{}}){const[ce,Te]=iE({defaultProp:z,onChange:W}),D=O!==void 0,L=D?O:ce,t=Fg(W),b=mr.useCallback(d=>{if(D){const w=typeof d=="function"?d(O):d;w!==O&&t(w)}else Te(d)},[D,O,Te,t]);return[L,b]}function iE({defaultProp:O,onChange:z}){const W=mr.useState(O),[ce]=W,Te=mr.useRef(ce),D=Fg(z);return mr.useEffect(()=>{Te.current!==ce&&(D(ce),Te.current=ce)},[ce,Te,D]),W}var a3=mr.forwardRef((O,z)=>{const{children:W,...ce}=O,Te=mr.Children.toArray(W),D=Te.find(oE);if(D){const L=D.props.children,t=Te.map(b=>b===D?mr.Children.count(L)>1?mr.Children.only(null):mr.isValidElement(L)?L.props.children:null:b);return Kr(Yb,{...ce,ref:z,children:mr.isValidElement(L)?mr.cloneElement(L,void 0,t):null})}return Kr(Yb,{...ce,ref:z,children:W})});a3.displayName="Slot";var Yb=mr.forwardRef((O,z)=>{const{children:W,...ce}=O;if(mr.isValidElement(W)){const Te=lE(W);return mr.cloneElement(W,{...sE(ce,W.props),ref:z?C8(z,Te):Te})}return mr.Children.count(W)>1?mr.Children.only(null):null});Yb.displayName="SlotClone";var aE=({children:O})=>Kr(Wm,{children:O});function oE(O){return mr.isValidElement(O)&&O.type===aE}function sE(O,z){const W={...z};for(const ce in z){const Te=O[ce],D=z[ce];/^on[A-Z]/.test(ce)?Te&&D?W[ce]=(...t)=>{D(...t),Te(...t)}:Te&&(W[ce]=Te):ce==="style"?W[ce]={...Te,...D}:ce==="className"&&(W[ce]=[Te,D].filter(Boolean).join(" "))}return{...O,...W}}function lE(O){var ce,Te;let z=(ce=Object.getOwnPropertyDescriptor(O.props,"ref"))==null?void 0:ce.get,W=z&&"isReactWarning"in z&&z.isReactWarning;return W?O.ref:(z=(Te=Object.getOwnPropertyDescriptor(O,"ref"))==null?void 0:Te.get,W=z&&"isReactWarning"in z&&z.isReactWarning,W?O.props.ref:O.props.ref||O.ref)}var uE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],S0=uE.reduce((O,z)=>{const W=mr.forwardRef((ce,Te)=>{const{asChild:D,...L}=ce,t=D?a3:z;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Kr(t,{...L,ref:Te})});return W.displayName=`Primitive.${z}`,{...O,[z]:W}},{});function cE(O,z){O&&lk.flushSync(()=>O.dispatchEvent(z))}function hE(O,z=globalThis==null?void 0:globalThis.document){const W=Fg(O);mr.useEffect(()=>{const ce=Te=>{Te.key==="Escape"&&W(Te)};return z.addEventListener("keydown",ce,{capture:!0}),()=>z.removeEventListener("keydown",ce,{capture:!0})},[W,z])}var fE="DismissableLayer",Xb="dismissableLayer.update",pE="dismissableLayer.pointerDownOutside",dE="dismissableLayer.focusOutside",I4,I8=mr.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),P8=mr.forwardRef((O,z)=>{const{disableOutsidePointerEvents:W=!1,onEscapeKeyDown:ce,onPointerDownOutside:Te,onFocusOutside:D,onInteractOutside:L,onDismiss:t,...b}=O,d=mr.useContext(I8),[e,w]=mr.useState(null),y=(e==null?void 0:e.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=mr.useState({}),u=Ug(z,m=>w(m)),r=Array.from(d.layers),[n]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),l=r.indexOf(n),o=e?r.indexOf(e):-1,s=d.layersWithOutsidePointerEventsDisabled.size>0,c=o>=l,h=vE(m=>{const g=m.target,k=[...d.branches].some(A=>A.contains(g));!c||k||(Te==null||Te(m),L==null||L(m),m.defaultPrevented||t==null||t())},y),x=yE(m=>{const g=m.target;[...d.branches].some(A=>A.contains(g))||(D==null||D(m),L==null||L(m),m.defaultPrevented||t==null||t())},y);return hE(m=>{o===d.layers.size-1&&(ce==null||ce(m),!m.defaultPrevented&&t&&(m.preventDefault(),t()))},y),mr.useEffect(()=>{if(e)return W&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(I4=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(e)),d.layers.add(e),P4(),()=>{W&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=I4)}},[e,y,W,d]),mr.useEffect(()=>()=>{e&&(d.layers.delete(e),d.layersWithOutsidePointerEventsDisabled.delete(e),P4())},[e,d]),mr.useEffect(()=>{const m=()=>_({});return document.addEventListener(Xb,m),()=>document.removeEventListener(Xb,m)},[]),Kr(S0.div,{...b,ref:u,style:{pointerEvents:s?c?"auto":"none":void 0,...O.style},onFocusCapture:y0(O.onFocusCapture,x.onFocusCapture),onBlurCapture:y0(O.onBlurCapture,x.onBlurCapture),onPointerDownCapture:y0(O.onPointerDownCapture,h.onPointerDownCapture)})});P8.displayName=fE;var gE="DismissableLayerBranch",mE=mr.forwardRef((O,z)=>{const W=mr.useContext(I8),ce=mr.useRef(null),Te=Ug(z,ce);return mr.useEffect(()=>{const D=ce.current;if(D)return W.branches.add(D),()=>{W.branches.delete(D)}},[W.branches]),Kr(S0.div,{...O,ref:Te})});mE.displayName=gE;function vE(O,z=globalThis==null?void 0:globalThis.document){const W=Fg(O),ce=mr.useRef(!1),Te=mr.useRef(()=>{});return mr.useEffect(()=>{const D=t=>{if(t.target&&!ce.current){let b=function(){L8(pE,W,d,{discrete:!0})};const d={originalEvent:t};t.pointerType==="touch"?(z.removeEventListener("click",Te.current),Te.current=b,z.addEventListener("click",Te.current,{once:!0})):b()}else z.removeEventListener("click",Te.current);ce.current=!1},L=window.setTimeout(()=>{z.addEventListener("pointerdown",D)},0);return()=>{window.clearTimeout(L),z.removeEventListener("pointerdown",D),z.removeEventListener("click",Te.current)}},[z,W]),{onPointerDownCapture:()=>ce.current=!0}}function yE(O,z=globalThis==null?void 0:globalThis.document){const W=Fg(O),ce=mr.useRef(!1);return mr.useEffect(()=>{const Te=D=>{D.target&&!ce.current&&L8(dE,W,{originalEvent:D},{discrete:!1})};return z.addEventListener("focusin",Te),()=>z.removeEventListener("focusin",Te)},[z,W]),{onFocusCapture:()=>ce.current=!0,onBlurCapture:()=>ce.current=!1}}function P4(){const O=new CustomEvent(Xb);document.dispatchEvent(O)}function L8(O,z,W,{discrete:ce}){const Te=W.originalEvent.target,D=new CustomEvent(O,{bubbles:!1,cancelable:!0,detail:W});z&&Te.addEventListener(O,z,{once:!0}),ce?cE(Te,D):Te.dispatchEvent(D)}var m2="focusScope.autoFocusOnMount",v2="focusScope.autoFocusOnUnmount",L4={bubbles:!1,cancelable:!0},xE="FocusScope",z8=mr.forwardRef((O,z)=>{const{loop:W=!1,trapped:ce=!1,onMountAutoFocus:Te,onUnmountAutoFocus:D,...L}=O,[t,b]=mr.useState(null),d=Fg(Te),e=Fg(D),w=mr.useRef(null),y=Ug(z,r=>b(r)),_=mr.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;mr.useEffect(()=>{if(ce){let r=function(s){if(_.paused||!t)return;const c=s.target;t.contains(c)?w.current=c:Xd(w.current,{select:!0})},n=function(s){if(_.paused||!t)return;const c=s.relatedTarget;c!==null&&(t.contains(c)||Xd(w.current,{select:!0}))},l=function(s){if(document.activeElement===document.body)for(const h of s)h.removedNodes.length>0&&Xd(t)};document.addEventListener("focusin",r),document.addEventListener("focusout",n);const o=new MutationObserver(l);return t&&o.observe(t,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",r),document.removeEventListener("focusout",n),o.disconnect()}}},[ce,t,_.paused]),mr.useEffect(()=>{if(t){O4.add(_);const r=document.activeElement;if(!t.contains(r)){const l=new CustomEvent(m2,L4);t.addEventListener(m2,d),t.dispatchEvent(l),l.defaultPrevented||(_E(AE(O8(t)),{select:!0}),document.activeElement===r&&Xd(t))}return()=>{t.removeEventListener(m2,d),setTimeout(()=>{const l=new CustomEvent(v2,L4);t.addEventListener(v2,e),t.dispatchEvent(l),l.defaultPrevented||Xd(r??document.body,{select:!0}),t.removeEventListener(v2,e),O4.remove(_)},0)}}},[t,d,e,_]);const u=mr.useCallback(r=>{if(!W&&!ce||_.paused)return;const n=r.key==="Tab"&&!r.altKey&&!r.ctrlKey&&!r.metaKey,l=document.activeElement;if(n&&l){const o=r.currentTarget,[s,c]=bE(o);s&&c?!r.shiftKey&&l===c?(r.preventDefault(),W&&Xd(s,{select:!0})):r.shiftKey&&l===s&&(r.preventDefault(),W&&Xd(c,{select:!0})):l===o&&r.preventDefault()}},[W,ce,_.paused]);return Kr(S0.div,{tabIndex:-1,...L,ref:y,onKeyDown:u})});z8.displayName=xE;function _E(O,{select:z=!1}={}){const W=document.activeElement;for(const ce of O)if(Xd(ce,{select:z}),document.activeElement!==W)return}function bE(O){const z=O8(O),W=z4(z,O),ce=z4(z.reverse(),O);return[W,ce]}function O8(O){const z=[],W=document.createTreeWalker(O,NodeFilter.SHOW_ELEMENT,{acceptNode:ce=>{const Te=ce.tagName==="INPUT"&&ce.type==="hidden";return ce.disabled||ce.hidden||Te?NodeFilter.FILTER_SKIP:ce.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;W.nextNode();)z.push(W.currentNode);return z}function z4(O,z){for(const W of O)if(!wE(W,{upTo:z}))return W}function wE(O,{upTo:z}){if(getComputedStyle(O).visibility==="hidden")return!0;for(;O;){if(z!==void 0&&O===z)return!1;if(getComputedStyle(O).display==="none")return!0;O=O.parentElement}return!1}function TE(O){return O instanceof HTMLInputElement&&"select"in O}function Xd(O,{select:z=!1}={}){if(O&&O.focus){const W=document.activeElement;O.focus({preventScroll:!0}),O!==W&&TE(O)&&z&&O.select()}}var O4=kE();function kE(){let O=[];return{add(z){const W=O[0];z!==W&&(W==null||W.pause()),O=D4(O,z),O.unshift(z)},remove(z){var W;O=D4(O,z),(W=O[0])==null||W.resume()}}}function D4(O,z){const W=[...O],ce=W.indexOf(z);return ce!==-1&&W.splice(ce,1),W}function AE(O){return O.filter(z=>z.tagName!=="A")}function SE(O,z){return mr.useReducer((W,ce)=>z[W][ce]??W,O)}var o3=O=>{const{present:z,children:W}=O,ce=ME(z),Te=typeof W=="function"?W({present:ce.isPresent}):mr.Children.only(W),D=Ug(ce.ref,EE(Te));return typeof W=="function"||ce.isPresent?mr.cloneElement(Te,{ref:D}):null};o3.displayName="Presence";function ME(O){const[z,W]=mr.useState(),ce=mr.useRef({}),Te=mr.useRef(O),D=mr.useRef("none"),L=O?"mounted":"unmounted",[t,b]=SE(L,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return mr.useEffect(()=>{const d=jy(ce.current);D.current=t==="mounted"?d:"none"},[t]),$b(()=>{const d=ce.current,e=Te.current;if(e!==O){const y=D.current,_=jy(d);O?b("MOUNT"):_==="none"||(d==null?void 0:d.display)==="none"?b("UNMOUNT"):b(e&&y!==_?"ANIMATION_OUT":"UNMOUNT"),Te.current=O}},[O,b]),$b(()=>{if(z){let d;const e=z.ownerDocument.defaultView??window,w=_=>{const r=jy(ce.current).includes(_.animationName);if(_.target===z&&r&&(b("ANIMATION_END"),!Te.current)){const n=z.style.animationFillMode;z.style.animationFillMode="forwards",d=e.setTimeout(()=>{z.style.animationFillMode==="forwards"&&(z.style.animationFillMode=n)})}},y=_=>{_.target===z&&(D.current=jy(ce.current))};return z.addEventListener("animationstart",y),z.addEventListener("animationcancel",w),z.addEventListener("animationend",w),()=>{e.clearTimeout(d),z.removeEventListener("animationstart",y),z.removeEventListener("animationcancel",w),z.removeEventListener("animationend",w)}}else b("ANIMATION_END")},[z,b]),{isPresent:["mounted","unmountSuspended"].includes(t),ref:mr.useCallback(d=>{d&&(ce.current=getComputedStyle(d)),W(d)},[])}}function jy(O){return(O==null?void 0:O.animationName)||"none"}function EE(O){var ce,Te;let z=(ce=Object.getOwnPropertyDescriptor(O.props,"ref"))==null?void 0:ce.get,W=z&&"isReactWarning"in z&&z.isReactWarning;return W?O.ref:(z=(Te=Object.getOwnPropertyDescriptor(O,"ref"))==null?void 0:Te.get,W=z&&"isReactWarning"in z&&z.isReactWarning,W?O.props.ref:O.props.ref||O.ref)}var y2=0;function CE(){mr.useEffect(()=>{const O=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",O[0]??R4()),document.body.insertAdjacentElement("beforeend",O[1]??R4()),y2++,()=>{y2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(z=>z.remove()),y2--}},[])}function R4(){const O=document.createElement("span");return O.setAttribute("data-radix-focus-guard",""),O.tabIndex=0,O.style.outline="none",O.style.opacity="0",O.style.position="fixed",O.style.pointerEvents="none",O}var xp=function(){return xp=Object.assign||function(z){for(var W,ce=1,Te=arguments.length;ce"u")return WE;var z=ZE(O),W=document.documentElement.clientWidth,ce=window.innerWidth;return{left:z[0],top:z[1],right:z[2],gap:Math.max(0,ce-W+z[2]-z[0])}},YE=B8(),nv="data-scroll-locked",XE=function(O,z,W,ce){var Te=O.left,D=O.top,L=O.right,t=O.gap;return W===void 0&&(W="margin"),` + .`.concat(PE,` { overflow: hidden `).concat(ce,`; padding-right: `).concat(t,"px ").concat(ce,`; } @@ -4183,18 +4183,17 @@ uniform ${Re} ${Ue} u_${it}; } body[`).concat(nv,`] { - `).concat(zE,": ").concat(t,`px; + `).concat(LE,": ").concat(t,`px; } -`)},N4=function(){var O=parseInt(document.body.getAttribute(nv)||"0",10);return isFinite(O)?O:0},JE=function(){mr.useEffect(function(){return document.body.setAttribute(nv,(N4()+1).toString()),function(){var O=N4()-1;O<=0?document.body.removeAttribute(nv):document.body.setAttribute(nv,O.toString())}},[])},QE=function(O){var z=O.noRelative,W=O.noImportant,ce=O.gapMode,Te=ce===void 0?"margin":ce;JE();var D=mr.useMemo(function(){return YE(Te)},[Te]);return mr.createElement(XE,{styles:KE(D,!z,Te,W?"":"!important")})},Kb=!1;if(typeof window<"u")try{var Uy=Object.defineProperty({},"passive",{get:function(){return Kb=!0,!0}});window.addEventListener("test",Uy,Uy),window.removeEventListener("test",Uy,Uy)}catch{Kb=!1}var Em=Kb?{passive:!1}:!1,eC=function(O){return O.tagName==="TEXTAREA"},N8=function(O,z){if(!(O instanceof Element))return!1;var W=window.getComputedStyle(O);return W[z]!=="hidden"&&!(W.overflowY===W.overflowX&&!eC(O)&&W[z]==="visible")},tC=function(O){return N8(O,"overflowY")},nC=function(O){return N8(O,"overflowX")},j4=function(O,z){var W=z.ownerDocument,ce=z;do{typeof ShadowRoot<"u"&&ce instanceof ShadowRoot&&(ce=ce.host);var Te=j8(O,ce);if(Te){var D=U8(O,ce),L=D[1],t=D[2];if(L>t)return!0}ce=ce.parentNode}while(ce&&ce!==W.body);return!1},rC=function(O){var z=O.scrollTop,W=O.scrollHeight,ce=O.clientHeight;return[z,W,ce]},iC=function(O){var z=O.scrollLeft,W=O.scrollWidth,ce=O.clientWidth;return[z,W,ce]},j8=function(O,z){return O==="v"?tC(z):nC(z)},U8=function(O,z){return O==="v"?rC(z):iC(z)},aC=function(O,z){return O==="h"&&z==="rtl"?-1:1},oC=function(O,z,W,ce,Te){var D=aC(O,window.getComputedStyle(z).direction),L=D*ce,t=W.target,b=z.contains(t),d=!1,e=L>0,w=0,y=0;do{var _=U8(O,t),u=_[0],r=_[1],n=_[2],l=r-n-D*u;(u||l)&&j8(O,t)&&(w+=l,y+=u),t instanceof ShadowRoot?t=t.host:t=t.parentNode}while(!b&&t!==document.body||b&&(z.contains(t)||z===t));return(e&&(Te&&Math.abs(w)<1||!Te&&L>w)||!e&&(Te&&Math.abs(y)<1||!Te&&-L>y))&&(d=!0),d},Vy=function(O){return"changedTouches"in O?[O.changedTouches[0].clientX,O.changedTouches[0].clientY]:[0,0]},U4=function(O){return[O.deltaX,O.deltaY]},V4=function(O){return O&&"current"in O?O.current:O},sC=function(O,z){return O[0]===z[0]&&O[1]===z[1]},lC=function(O){return` +`)},N4=function(){var O=parseInt(document.body.getAttribute(nv)||"0",10);return isFinite(O)?O:0},KE=function(){mr.useEffect(function(){return document.body.setAttribute(nv,(N4()+1).toString()),function(){var O=N4()-1;O<=0?document.body.removeAttribute(nv):document.body.setAttribute(nv,O.toString())}},[])},JE=function(O){var z=O.noRelative,W=O.noImportant,ce=O.gapMode,Te=ce===void 0?"margin":ce;KE();var D=mr.useMemo(function(){return $E(Te)},[Te]);return mr.createElement(YE,{styles:XE(D,!z,Te,W?"":"!important")})},Kb=!1;if(typeof window<"u")try{var Uy=Object.defineProperty({},"passive",{get:function(){return Kb=!0,!0}});window.addEventListener("test",Uy,Uy),window.removeEventListener("test",Uy,Uy)}catch{Kb=!1}var Em=Kb?{passive:!1}:!1,QE=function(O){return O.tagName==="TEXTAREA"},N8=function(O,z){if(!(O instanceof Element))return!1;var W=window.getComputedStyle(O);return W[z]!=="hidden"&&!(W.overflowY===W.overflowX&&!QE(O)&&W[z]==="visible")},eC=function(O){return N8(O,"overflowY")},tC=function(O){return N8(O,"overflowX")},j4=function(O,z){var W=z.ownerDocument,ce=z;do{typeof ShadowRoot<"u"&&ce instanceof ShadowRoot&&(ce=ce.host);var Te=j8(O,ce);if(Te){var D=U8(O,ce),L=D[1],t=D[2];if(L>t)return!0}ce=ce.parentNode}while(ce&&ce!==W.body);return!1},nC=function(O){var z=O.scrollTop,W=O.scrollHeight,ce=O.clientHeight;return[z,W,ce]},rC=function(O){var z=O.scrollLeft,W=O.scrollWidth,ce=O.clientWidth;return[z,W,ce]},j8=function(O,z){return O==="v"?eC(z):tC(z)},U8=function(O,z){return O==="v"?nC(z):rC(z)},iC=function(O,z){return O==="h"&&z==="rtl"?-1:1},aC=function(O,z,W,ce,Te){var D=iC(O,window.getComputedStyle(z).direction),L=D*ce,t=W.target,b=z.contains(t),d=!1,e=L>0,w=0,y=0;do{var _=U8(O,t),u=_[0],r=_[1],n=_[2],l=r-n-D*u;(u||l)&&j8(O,t)&&(w+=l,y+=u),t instanceof ShadowRoot?t=t.host:t=t.parentNode}while(!b&&t!==document.body||b&&(z.contains(t)||z===t));return(e&&(Te&&Math.abs(w)<1||!Te&&L>w)||!e&&(Te&&Math.abs(y)<1||!Te&&-L>y))&&(d=!0),d},Vy=function(O){return"changedTouches"in O?[O.changedTouches[0].clientX,O.changedTouches[0].clientY]:[0,0]},U4=function(O){return[O.deltaX,O.deltaY]},V4=function(O){return O&&"current"in O?O.current:O},oC=function(O,z){return O[0]===z[0]&&O[1]===z[1]},sC=function(O){return` .block-interactivity-`.concat(O,` {pointer-events: none;} .allow-interactivity-`).concat(O,` {pointer-events: all;} -`)},uC=0,Cm=[];function cC(O){var z=mr.useRef([]),W=mr.useRef([0,0]),ce=mr.useRef(),Te=mr.useState(uC++)[0],D=mr.useState(B8)[0],L=mr.useRef(O);mr.useEffect(function(){L.current=O},[O]),mr.useEffect(function(){if(O.inert){document.body.classList.add("block-interactivity-".concat(Te));var r=PE([O.lockRef.current],(O.shards||[]).map(V4),!0).filter(Boolean);return r.forEach(function(n){return n.classList.add("allow-interactivity-".concat(Te))}),function(){document.body.classList.remove("block-interactivity-".concat(Te)),r.forEach(function(n){return n.classList.remove("allow-interactivity-".concat(Te))})}}},[O.inert,O.lockRef.current,O.shards]);var t=mr.useCallback(function(r,n){if("touches"in r&&r.touches.length===2||r.type==="wheel"&&r.ctrlKey)return!L.current.allowPinchZoom;var l=Vy(r),o=W.current,s="deltaX"in r?r.deltaX:o[0]-l[0],c="deltaY"in r?r.deltaY:o[1]-l[1],h,x=r.target,m=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in r&&m==="h"&&x.type==="range")return!1;var g=j4(m,x);if(!g)return!0;if(g?h=m:(h=m==="v"?"h":"v",g=j4(m,x)),!g)return!1;if(!ce.current&&"changedTouches"in r&&(s||c)&&(ce.current=h),!h)return!0;var k=ce.current||h;return oC(k,n,r,k==="h"?s:c,!0)},[]),b=mr.useCallback(function(r){var n=r;if(!(!Cm.length||Cm[Cm.length-1]!==D)){var l="deltaY"in n?U4(n):Vy(n),o=z.current.filter(function(h){return h.name===n.type&&(h.target===n.target||n.target===h.shadowParent)&&sC(h.delta,l)})[0];if(o&&o.should){n.cancelable&&n.preventDefault();return}if(!o){var s=(L.current.shards||[]).map(V4).filter(Boolean).filter(function(h){return h.contains(n.target)}),c=s.length>0?t(n,s[0]):!L.current.noIsolation;c&&n.cancelable&&n.preventDefault()}}},[]),d=mr.useCallback(function(r,n,l,o){var s={name:r,delta:n,target:l,should:o,shadowParent:hC(l)};z.current.push(s),setTimeout(function(){z.current=z.current.filter(function(c){return c!==s})},1)},[]),e=mr.useCallback(function(r){W.current=Vy(r),ce.current=void 0},[]),w=mr.useCallback(function(r){d(r.type,U4(r),r.target,t(r,O.lockRef.current))},[]),y=mr.useCallback(function(r){d(r.type,Vy(r),r.target,t(r,O.lockRef.current))},[]);mr.useEffect(function(){return Cm.push(D),O.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:y}),document.addEventListener("wheel",b,Em),document.addEventListener("touchmove",b,Em),document.addEventListener("touchstart",e,Em),function(){Cm=Cm.filter(function(r){return r!==D}),document.removeEventListener("wheel",b,Em),document.removeEventListener("touchmove",b,Em),document.removeEventListener("touchstart",e,Em)}},[]);var _=O.removeScrollBar,u=O.inert;return mr.createElement(mr.Fragment,null,u?mr.createElement(D,{styles:lC(Te)}):null,_?mr.createElement(QE,{gapMode:O.gapMode}):null)}function hC(O){for(var z=null;O!==null;)O instanceof ShadowRoot&&(z=O.host,O=O.host),O=O.parentNode;return z}const fC=jE(F8,cC);var V8=mr.forwardRef(function(O,z){return mr.createElement(__,xp({},O,{ref:z,sideCar:fC}))});V8.classNames=__.classNames;const pC=V8;var dC=function(O){if(typeof document>"u")return null;var z=Array.isArray(O)?O[0]:O;return z.ownerDocument.body},Im=new WeakMap,qy=new WeakMap,Hy={},w2=0,q8=function(O){return O&&(O.host||q8(O.parentNode))},gC=function(O,z){return z.map(function(W){if(O.contains(W))return W;var ce=q8(W);return ce&&O.contains(ce)?ce:(console.error("aria-hidden",W,"in not contained inside",O,". Doing nothing"),null)}).filter(function(W){return!!W})},mC=function(O,z,W,ce){var Te=gC(z,Array.isArray(O)?O:[O]);Hy[W]||(Hy[W]=new WeakMap);var D=Hy[W],L=[],t=new Set,b=new Set(Te),d=function(w){!w||t.has(w)||(t.add(w),d(w.parentNode))};Te.forEach(d);var e=function(w){!w||b.has(w)||Array.prototype.forEach.call(w.children,function(y){if(t.has(y))e(y);else try{var _=y.getAttribute(ce),u=_!==null&&_!=="false",r=(Im.get(y)||0)+1,n=(D.get(y)||0)+1;Im.set(y,r),D.set(y,n),L.push(y),r===1&&u&&qy.set(y,!0),n===1&&y.setAttribute(W,"true"),u||y.setAttribute(ce,"true")}catch(l){console.error("aria-hidden: cannot operate on ",y,l)}})};return e(z),t.clear(),w2++,function(){L.forEach(function(w){var y=Im.get(w)-1,_=D.get(w)-1;Im.set(w,y),D.set(w,_),y||(qy.has(w)||w.removeAttribute(ce),qy.delete(w)),_||w.removeAttribute(W)}),w2--,w2||(Im=new WeakMap,Im=new WeakMap,qy=new WeakMap,Hy={})}},vC=function(O,z,W){W===void 0&&(W="data-aria-hidden");var ce=Array.from(Array.isArray(O)?O:[O]),Te=z||dC(O);return Te?(ce.push.apply(ce,Array.from(Te.querySelectorAll("[aria-live]"))),mC(ce,Te,W,"aria-hidden")):function(){return null}},s3="Dialog",[H8,hI]=eE(s3),[yC,kp]=H8(s3),G8=O=>{const{__scopeDialog:z,children:W,open:ce,defaultOpen:Te,onOpenChange:D,modal:L=!0}=O,t=mr.useRef(null),b=mr.useRef(null),[d=!1,e]=iE({prop:ce,defaultProp:Te,onChange:D});return Kr(yC,{scope:z,triggerRef:t,contentRef:b,contentId:g2(),titleId:g2(),descriptionId:g2(),open:d,onOpenChange:e,onOpenToggle:mr.useCallback(()=>e(w=>!w),[e]),modal:L,children:W})};G8.displayName=s3;var W8="DialogTrigger",xC=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(W8,W),D=Ug(z,Te.triggerRef);return Kr(S0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":Te.open,"aria-controls":Te.contentId,"data-state":u3(Te.open),...ce,ref:D,onClick:y0(O.onClick,Te.onOpenToggle)})});xC.displayName=W8;var _C="DialogPortal",[fI,Z8]=H8(_C,{forceMount:void 0}),Yx="DialogOverlay",$8=mr.forwardRef((O,z)=>{const W=Z8(Yx,O.__scopeDialog),{forceMount:ce=W.forceMount,...Te}=O,D=kp(Yx,O.__scopeDialog);return D.modal?Kr(o3,{present:ce||D.open,children:Kr(bC,{...Te,ref:z})}):null});$8.displayName=Yx;var bC=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(Yx,W);return Kr(pC,{as:a3,allowPinchZoom:!0,shards:[Te.contentRef],children:Kr(S0.div,{"data-state":u3(Te.open),...ce,ref:z,style:{pointerEvents:"auto",...ce.style}})})}),Bg="DialogContent",Y8=mr.forwardRef((O,z)=>{const W=Z8(Bg,O.__scopeDialog),{forceMount:ce=W.forceMount,...Te}=O,D=kp(Bg,O.__scopeDialog);return Kr(o3,{present:ce||D.open,children:D.modal?Kr(wC,{...Te,ref:z}):Kr(TC,{...Te,ref:z})})});Y8.displayName=Bg;var wC=mr.forwardRef((O,z)=>{const W=kp(Bg,O.__scopeDialog),ce=mr.useRef(null),Te=Ug(z,W.contentRef,ce);return mr.useEffect(()=>{const D=ce.current;if(D)return vC(D)},[]),Kr(X8,{...O,ref:Te,trapFocus:W.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:y0(O.onCloseAutoFocus,D=>{var L;D.preventDefault(),(L=W.triggerRef.current)==null||L.focus()}),onPointerDownOutside:y0(O.onPointerDownOutside,D=>{const L=D.detail.originalEvent,t=L.button===0&&L.ctrlKey===!0;(L.button===2||t)&&D.preventDefault()}),onFocusOutside:y0(O.onFocusOutside,D=>D.preventDefault())})}),TC=mr.forwardRef((O,z)=>{const W=kp(Bg,O.__scopeDialog),ce=mr.useRef(!1),Te=mr.useRef(!1);return Kr(X8,{...O,ref:z,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:D=>{var L,t;(L=O.onCloseAutoFocus)==null||L.call(O,D),D.defaultPrevented||(ce.current||(t=W.triggerRef.current)==null||t.focus(),D.preventDefault()),ce.current=!1,Te.current=!1},onInteractOutside:D=>{var b,d;(b=O.onInteractOutside)==null||b.call(O,D),D.defaultPrevented||(ce.current=!0,D.detail.originalEvent.type==="pointerdown"&&(Te.current=!0));const L=D.target;((d=W.triggerRef.current)==null?void 0:d.contains(L))&&D.preventDefault(),D.detail.originalEvent.type==="focusin"&&Te.current&&D.preventDefault()}})}),X8=mr.forwardRef((O,z)=>{const{__scopeDialog:W,trapFocus:ce,onOpenAutoFocus:Te,onCloseAutoFocus:D,...L}=O,t=kp(Bg,W),b=mr.useRef(null),d=Ug(z,b);return IE(),ja(Wm,{children:[Kr(z8,{asChild:!0,loop:!0,trapped:ce,onMountAutoFocus:Te,onUnmountAutoFocus:D,children:Kr(P8,{role:"dialog",id:t.contentId,"aria-describedby":t.descriptionId,"aria-labelledby":t.titleId,"data-state":u3(t.open),...L,ref:d,onDismiss:()=>t.onOpenChange(!1)})}),ja(Wm,{children:[Kr(kC,{titleId:t.titleId}),Kr(SC,{contentRef:b,descriptionId:t.descriptionId})]})]})}),l3="DialogTitle",K8=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(l3,W);return Kr(S0.h2,{id:Te.titleId,...ce,ref:z})});K8.displayName=l3;var J8="DialogDescription",Q8=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(J8,W);return Kr(S0.p,{id:Te.descriptionId,...ce,ref:z})});Q8.displayName=J8;var eA="DialogClose",tA=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(eA,W);return Kr(S0.button,{type:"button",...ce,ref:z,onClick:y0(O.onClick,()=>Te.onOpenChange(!1))})});tA.displayName=eA;function u3(O){return O?"open":"closed"}var nA="DialogTitleWarning",[pI,rA]=Q9(nA,{contentName:Bg,titleName:l3,docsSlug:"dialog"}),kC=({titleId:O})=>{const z=rA(nA),W=`\`${z.contentName}\` requires a \`${z.titleName}\` for the component to be accessible for screen reader users. +`)},lC=0,Cm=[];function uC(O){var z=mr.useRef([]),W=mr.useRef([0,0]),ce=mr.useRef(),Te=mr.useState(lC++)[0],D=mr.useState(B8)[0],L=mr.useRef(O);mr.useEffect(function(){L.current=O},[O]),mr.useEffect(function(){if(O.inert){document.body.classList.add("block-interactivity-".concat(Te));var r=IE([O.lockRef.current],(O.shards||[]).map(V4),!0).filter(Boolean);return r.forEach(function(n){return n.classList.add("allow-interactivity-".concat(Te))}),function(){document.body.classList.remove("block-interactivity-".concat(Te)),r.forEach(function(n){return n.classList.remove("allow-interactivity-".concat(Te))})}}},[O.inert,O.lockRef.current,O.shards]);var t=mr.useCallback(function(r,n){if("touches"in r&&r.touches.length===2||r.type==="wheel"&&r.ctrlKey)return!L.current.allowPinchZoom;var l=Vy(r),o=W.current,s="deltaX"in r?r.deltaX:o[0]-l[0],c="deltaY"in r?r.deltaY:o[1]-l[1],h,x=r.target,m=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in r&&m==="h"&&x.type==="range")return!1;var g=j4(m,x);if(!g)return!0;if(g?h=m:(h=m==="v"?"h":"v",g=j4(m,x)),!g)return!1;if(!ce.current&&"changedTouches"in r&&(s||c)&&(ce.current=h),!h)return!0;var k=ce.current||h;return aC(k,n,r,k==="h"?s:c,!0)},[]),b=mr.useCallback(function(r){var n=r;if(!(!Cm.length||Cm[Cm.length-1]!==D)){var l="deltaY"in n?U4(n):Vy(n),o=z.current.filter(function(h){return h.name===n.type&&(h.target===n.target||n.target===h.shadowParent)&&oC(h.delta,l)})[0];if(o&&o.should){n.cancelable&&n.preventDefault();return}if(!o){var s=(L.current.shards||[]).map(V4).filter(Boolean).filter(function(h){return h.contains(n.target)}),c=s.length>0?t(n,s[0]):!L.current.noIsolation;c&&n.cancelable&&n.preventDefault()}}},[]),d=mr.useCallback(function(r,n,l,o){var s={name:r,delta:n,target:l,should:o,shadowParent:cC(l)};z.current.push(s),setTimeout(function(){z.current=z.current.filter(function(c){return c!==s})},1)},[]),e=mr.useCallback(function(r){W.current=Vy(r),ce.current=void 0},[]),w=mr.useCallback(function(r){d(r.type,U4(r),r.target,t(r,O.lockRef.current))},[]),y=mr.useCallback(function(r){d(r.type,Vy(r),r.target,t(r,O.lockRef.current))},[]);mr.useEffect(function(){return Cm.push(D),O.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:y}),document.addEventListener("wheel",b,Em),document.addEventListener("touchmove",b,Em),document.addEventListener("touchstart",e,Em),function(){Cm=Cm.filter(function(r){return r!==D}),document.removeEventListener("wheel",b,Em),document.removeEventListener("touchmove",b,Em),document.removeEventListener("touchstart",e,Em)}},[]);var _=O.removeScrollBar,u=O.inert;return mr.createElement(mr.Fragment,null,u?mr.createElement(D,{styles:sC(Te)}):null,_?mr.createElement(JE,{gapMode:O.gapMode}):null)}function cC(O){for(var z=null;O!==null;)O instanceof ShadowRoot&&(z=O.host,O=O.host),O=O.parentNode;return z}const hC=NE(F8,uC);var V8=mr.forwardRef(function(O,z){return mr.createElement(__,xp({},O,{ref:z,sideCar:hC}))});V8.classNames=__.classNames;const fC=V8;var pC=function(O){if(typeof document>"u")return null;var z=Array.isArray(O)?O[0]:O;return z.ownerDocument.body},Im=new WeakMap,qy=new WeakMap,Hy={},w2=0,q8=function(O){return O&&(O.host||q8(O.parentNode))},dC=function(O,z){return z.map(function(W){if(O.contains(W))return W;var ce=q8(W);return ce&&O.contains(ce)?ce:(console.error("aria-hidden",W,"in not contained inside",O,". Doing nothing"),null)}).filter(function(W){return!!W})},gC=function(O,z,W,ce){var Te=dC(z,Array.isArray(O)?O:[O]);Hy[W]||(Hy[W]=new WeakMap);var D=Hy[W],L=[],t=new Set,b=new Set(Te),d=function(w){!w||t.has(w)||(t.add(w),d(w.parentNode))};Te.forEach(d);var e=function(w){!w||b.has(w)||Array.prototype.forEach.call(w.children,function(y){if(t.has(y))e(y);else try{var _=y.getAttribute(ce),u=_!==null&&_!=="false",r=(Im.get(y)||0)+1,n=(D.get(y)||0)+1;Im.set(y,r),D.set(y,n),L.push(y),r===1&&u&&qy.set(y,!0),n===1&&y.setAttribute(W,"true"),u||y.setAttribute(ce,"true")}catch(l){console.error("aria-hidden: cannot operate on ",y,l)}})};return e(z),t.clear(),w2++,function(){L.forEach(function(w){var y=Im.get(w)-1,_=D.get(w)-1;Im.set(w,y),D.set(w,_),y||(qy.has(w)||w.removeAttribute(ce),qy.delete(w)),_||w.removeAttribute(W)}),w2--,w2||(Im=new WeakMap,Im=new WeakMap,qy=new WeakMap,Hy={})}},mC=function(O,z,W){W===void 0&&(W="data-aria-hidden");var ce=Array.from(Array.isArray(O)?O:[O]),Te=z||pC(O);return Te?(ce.push.apply(ce,Array.from(Te.querySelectorAll("[aria-live]"))),gC(ce,Te,W,"aria-hidden")):function(){return null}},s3="Dialog",[H8,hI]=Q9(s3),[vC,kp]=H8(s3),G8=O=>{const{__scopeDialog:z,children:W,open:ce,defaultOpen:Te,onOpenChange:D,modal:L=!0}=O,t=mr.useRef(null),b=mr.useRef(null),[d=!1,e]=rE({prop:ce,defaultProp:Te,onChange:D});return Kr(vC,{scope:z,triggerRef:t,contentRef:b,contentId:g2(),titleId:g2(),descriptionId:g2(),open:d,onOpenChange:e,onOpenToggle:mr.useCallback(()=>e(w=>!w),[e]),modal:L,children:W})};G8.displayName=s3;var W8="DialogTrigger",yC=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(W8,W),D=Ug(z,Te.triggerRef);return Kr(S0.button,{type:"button","aria-haspopup":"dialog","aria-expanded":Te.open,"aria-controls":Te.contentId,"data-state":u3(Te.open),...ce,ref:D,onClick:y0(O.onClick,Te.onOpenToggle)})});yC.displayName=W8;var xC="DialogPortal",[fI,Z8]=H8(xC,{forceMount:void 0}),Yx="DialogOverlay",$8=mr.forwardRef((O,z)=>{const W=Z8(Yx,O.__scopeDialog),{forceMount:ce=W.forceMount,...Te}=O,D=kp(Yx,O.__scopeDialog);return D.modal?Kr(o3,{present:ce||D.open,children:Kr(_C,{...Te,ref:z})}):null});$8.displayName=Yx;var _C=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(Yx,W);return Kr(fC,{as:a3,allowPinchZoom:!0,shards:[Te.contentRef],children:Kr(S0.div,{"data-state":u3(Te.open),...ce,ref:z,style:{pointerEvents:"auto",...ce.style}})})}),Bg="DialogContent",Y8=mr.forwardRef((O,z)=>{const W=Z8(Bg,O.__scopeDialog),{forceMount:ce=W.forceMount,...Te}=O,D=kp(Bg,O.__scopeDialog);return Kr(o3,{present:ce||D.open,children:D.modal?Kr(bC,{...Te,ref:z}):Kr(wC,{...Te,ref:z})})});Y8.displayName=Bg;var bC=mr.forwardRef((O,z)=>{const W=kp(Bg,O.__scopeDialog),ce=mr.useRef(null),Te=Ug(z,W.contentRef,ce);return mr.useEffect(()=>{const D=ce.current;if(D)return mC(D)},[]),Kr(X8,{...O,ref:Te,trapFocus:W.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:y0(O.onCloseAutoFocus,D=>{var L;D.preventDefault(),(L=W.triggerRef.current)==null||L.focus()}),onPointerDownOutside:y0(O.onPointerDownOutside,D=>{const L=D.detail.originalEvent,t=L.button===0&&L.ctrlKey===!0;(L.button===2||t)&&D.preventDefault()}),onFocusOutside:y0(O.onFocusOutside,D=>D.preventDefault())})}),wC=mr.forwardRef((O,z)=>{const W=kp(Bg,O.__scopeDialog),ce=mr.useRef(!1),Te=mr.useRef(!1);return Kr(X8,{...O,ref:z,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:D=>{var L,t;(L=O.onCloseAutoFocus)==null||L.call(O,D),D.defaultPrevented||(ce.current||(t=W.triggerRef.current)==null||t.focus(),D.preventDefault()),ce.current=!1,Te.current=!1},onInteractOutside:D=>{var b,d;(b=O.onInteractOutside)==null||b.call(O,D),D.defaultPrevented||(ce.current=!0,D.detail.originalEvent.type==="pointerdown"&&(Te.current=!0));const L=D.target;((d=W.triggerRef.current)==null?void 0:d.contains(L))&&D.preventDefault(),D.detail.originalEvent.type==="focusin"&&Te.current&&D.preventDefault()}})}),X8=mr.forwardRef((O,z)=>{const{__scopeDialog:W,trapFocus:ce,onOpenAutoFocus:Te,onCloseAutoFocus:D,...L}=O,t=kp(Bg,W),b=mr.useRef(null),d=Ug(z,b);return CE(),ja(Wm,{children:[Kr(z8,{asChild:!0,loop:!0,trapped:ce,onMountAutoFocus:Te,onUnmountAutoFocus:D,children:Kr(P8,{role:"dialog",id:t.contentId,"aria-describedby":t.descriptionId,"aria-labelledby":t.titleId,"data-state":u3(t.open),...L,ref:d,onDismiss:()=>t.onOpenChange(!1)})}),ja(Wm,{children:[Kr(TC,{titleId:t.titleId}),Kr(AC,{contentRef:b,descriptionId:t.descriptionId})]})]})}),l3="DialogTitle",K8=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(l3,W);return Kr(S0.h2,{id:Te.titleId,...ce,ref:z})});K8.displayName=l3;var J8="DialogDescription",Q8=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(J8,W);return Kr(S0.p,{id:Te.descriptionId,...ce,ref:z})});Q8.displayName=J8;var eA="DialogClose",tA=mr.forwardRef((O,z)=>{const{__scopeDialog:W,...ce}=O,Te=kp(eA,W);return Kr(S0.button,{type:"button",...ce,ref:z,onClick:y0(O.onClick,()=>Te.onOpenChange(!1))})});tA.displayName=eA;function u3(O){return O?"open":"closed"}var nA="DialogTitleWarning",[pI,rA]=J9(nA,{contentName:Bg,titleName:l3,docsSlug:"dialog"}),TC=({titleId:O})=>{const z=rA(nA),W=`\`${z.contentName}\` requires a \`${z.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${z.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${z.docsSlug}`;return mr.useEffect(()=>{O&&(document.getElementById(O)||console.error(W))},[W,O]),null},AC="DialogDescriptionWarning",SC=({contentRef:O,descriptionId:z})=>{const ce=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rA(AC).contentName}}.`;return mr.useEffect(()=>{var D;const Te=(D=O.current)==null?void 0:D.getAttribute("aria-describedby");z&&Te&&(document.getElementById(z)||console.warn(ce))},[ce,O,z]),null},MC=G8,EC=$8,CC=Y8,IC=K8,PC=Q8,q4=tA;const H4=({title:O,titleId:z,...W})=>Kr("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...W,children:Kr("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),iA={margin:"2px 0px 2px 10px",padding:"5px 2px 2px 5px"};function J1({open:O,close:z,title:W,description:ce,children:Te}){return ja(MC,{open:O,onOpenChange:z,children:[Kr(EC,{onClick:z,className:"_modal-overlay"}),ja(CC,{className:"_modal",children:[Kr(IC,{className:"_modal-title",children:W}),Kr(PC,{className:"_modal_description",children:ce}),Kr(q4,{children:Kr(H4,{})}),Te,Kr(q4,{className:"_modal-close",onClick:z,children:Kr(H4,{className:"w-6 h-6"})})]})]})}function LC({title:O,content:z,open:W,close:ce}){return Kr(J1,{title:O,description:"",open:W,close:ce,children:ja("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[Kr("div",{style:{display:"flex",flexDirection:"column",gap:0},children:Kr("div",{children:Kr("label",{htmlFor:"title_text",children:z})})}),Kr("div",{style:{float:"right",marginTop:20},children:Kr("button",{type:"button",className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:ce,children:"Close"})})]})})}function zC({open:O,close:z}){const W=window.download_path||"~/OpenBBUserData/exports";return Kr(J1,{title:"Success",description:"",open:O,close:z,children:ja("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[Kr("div",{style:{display:"flex",flexDirection:"column",gap:0},children:Kr("div",{children:ja("label",{htmlFor:"title_text",children:[Kr("b",{children:window.title})," has been downloaded to",Kr("br",{}),Kr("br",{}),Kr("a",{style:{color:"#FFDD00",marginTop:15},href:`${W}`,onClick:ce=>{ce.preventDefault(),window.pywry.open_file(W)},children:W})]})})}),Kr("div",{style:{float:"right",marginTop:20},children:Kr("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:z,children:"Close"})})]})})}const G4=new FileReader,OC={overlaying:"y",side:"left",tickfont:{size:12},tickpadding:5,showgrid:!1,showline:!1,showticklabels:!0,showlegend:!0,zeroline:!1,anchor:"x",type:"linear",autorange:!0};function DC({open:O,close:z,setLoading:W,addOverlay:ce,plotlyData:Te}){const[D,L]=mr.useState("scatter"),[t,b]=mr.useState("#FFDD00"),[d,e]=mr.useState("#00ACFF"),[w,y]=mr.useState("#FF0000"),[_,u]=mr.useState(""),[r,n]=mr.useState([]),[l,o]=mr.useState([]),[s,c]=mr.useState({}),h=["x","open","high","low","close"],x={scatter:"Scatter (Line)",candlestick:"Candlestick",bar:"Bar"},[m,g]=mr.useState({});function k(){z(),L("scatter"),u(""),n([]),o([]),g({})}function A(){var S,T;if(r.length===0){(S=document.getElementById("csv_file"))==null||S.focus(),(T=document.getElementById("csv_file"))==null||T.style.setProperty("border","1px solid red"),document.getElementById("csv_file_warning").style.display="block";return}const v=RC({csvData:r,plotlyData:Te,yaxisOptions:s,traceType:D,traceColor:t,traceName:_,options:m,increasingColor:d,decreasingColor:w});ce(v),k()}return Kr(J1,{title:"Overlay Chart",description:"Upload a CSV file to overlay a chart on the main chart.",open:O,close:z,children:ja("div",{id:"popup_csv",className:"popup_content",children:[ja("div",{children:[ja("label",{htmlFor:"csv_file",children:[Kr("b",{children:"CSV file:"}),Kr("div",{id:"csv_file_warning",className:"popup_warning",style:{marginLeft:"80px",marginBottom:"10px"},children:"CSV file is required."})]}),Kr("input",{onChange:v=>{var S,T;if(v.target.files){if(v.target.files[0].type!=="text/csv"){(S=document.getElementById("csv_file"))==null||S.focus(),(T=document.getElementById("csv_file"))==null||T.style.setProperty("border","1px solid red"),document.getElementById("csv_file_warning").style.display="block";return}}else return;l.length>0&&(o([]),g({}),L("scatter")),G4.onload=p=>{var $;if(!(($=p.target)!=null&&$.result)||typeof p.target.result!="string")return;const M=p.target.result.split(` -`).map(ee=>ee.replace(/\r/g,"")),f=M[0].split(","),E=f.map(ee=>ee.trim().toLowerCase()),I={};f.length>1&&(I.x=f[0],I.y=f[1]);for(let ee=0;eeE.includes(ee))?L("candlestick"):E.length>=5&&B.forEach(ee=>{I[ee]=f[B.indexOf(ee)+1]}),E.includes("close")&&(g({...m,y:f[E.indexOf("close")]}),I.y=f[E.indexOf("close")]);const V=[];for(let ee=1;ee2&&(H.test(ee[0])?ee.splice(0,2):H.test(ee[ee.length-2])&&ee.splice(ee.length-2,2),j=ee.join("_").replace(/openbb_/g,""))}}catch(ee){console.log(ee)}u(j),g(I),o(f),n(V)},G4.readAsText(v.target.files[0])},type:"file",id:"csv_file",accept:".csv",style:{marginLeft:10}})]}),ja("div",{style:{marginTop:15},children:[Kr("label",{htmlFor:"csv_trace_type",children:Kr("b",{children:"Display data type:"})}),ja("select",{onChange:v=>{L(v.target.value)},id:"csv_trace_type",style:iA,defaultValue:x[D],children:[D&&Kr("option",{value:D,children:x[D]},D),Object.keys(x).map(v=>D!==v&&Kr("option",{value:v,children:x[v]},v))]})]}),ja("div",{style:{marginTop:12},children:[Kr("label",{htmlFor:"csv_name",children:Kr("b",{children:"Trace Name:"})}),Kr("textarea",{id:"csv_name",value:_,onChange:v=>{u(v.target.value)},style:{padding:"5px 2px 2px 5px",width:"100%",maxWidth:"100%",maxHeight:200,marginTop:2},rows:2,cols:20,placeholder:"Enter a name to give this trace"})]}),l.length>0&&ja(Wm,{children:[["scatter","bar"].includes(D)&&Kr("div",{style:{marginTop:15,marginBottom:10},id:"csv_columns",className:"csv_column_container",children:["x","y"].map(v=>ja("div",{style:{marginTop:10,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[ja("label",{htmlFor:`csv_${v}`,style:{width:"100px"},children:[v.toUpperCase()," Axis"]}),Kr("select",{onChange:S=>{g({...m,[v]:S.target.value})},id:`csv_${v}`,style:{width:"100%"},defaultValue:m[v],children:l.map(S=>Kr("option",{value:S,children:S},S))})]},v))}),D==="candlestick"&&Kr("div",{id:"csv_columns",className:"csv_column_container",style:{marginTop:15},children:["x","open","high","low","close"].map(v=>ja("div",{style:{marginTop:10,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Kr("label",{htmlFor:`csv_${v}`,style:{width:"100px"},children:v.charAt(0).toUpperCase()+v.slice(1)}),Kr("select",{onChange:S=>{g({...m,[v]:S.target.value})},id:`csv_${v}`,style:{width:"100%"},defaultValue:m[v],children:l.map(S=>Kr("option",{value:S,children:S},S))})]},v))}),ja("div",{style:{marginTop:20},id:"csv_colors",children:[["scatter","bar"].includes(D)&&ja("div",{children:[Kr("label",{htmlFor:"csv_color",children:`${D.charAt(0).toUpperCase()}${D.slice(1)} color`}),Kr("input",{type:"color",id:"csv_color",defaultValue:"#FFDD00",style:{margin:"2px 2px 2px 10px"},onChange:v=>{console.log(v.target.value),b(v.target.value)}})]}),D==="candlestick"&&ja(Wm,{children:[Kr("label",{htmlFor:"csv_increasing",children:"Increasing color"}),Kr("input",{type:"color",id:"csv_increasing",defaultValue:"#00ACFF",style:{margin:"2px 0px 2px 10px"},onChange:v=>{e(v.target.value)}}),Kr("label",{htmlFor:"csv_decreasing",style:{marginLeft:15},children:"Decreasing color"}),Kr("input",{style:{margin:"2px 0px 2px 10px"},type:"color",id:"csv_decreasing",defaultValue:"#FF0000",onChange:v=>{y(v.target.value)}})]})]}),ja("div",{style:{marginTop:20},id:"csv_plot_yaxis_options",children:[D!=="candlestick"&&ja(Wm,{children:[Kr("input",{type:"checkbox",id:"csv_percent_change",name:"csv_plot_yaxis_check",style:{marginBottom:2},onChange:v=>{c({...s,percentChange:v.target.checked,sameYaxis:!1})},checked:!s.sameYaxis&&s.percentChange}),Kr("label",{htmlFor:"csv_percent_change",style:{marginLeft:5},children:"Plot as percent change from first value"}),Kr("br",{})]}),Kr("input",{style:{marginTop:2},type:"checkbox",id:"csv_same_yaxis",name:"csv_plot_yaxis_check",onChange:v=>{c({...s,sameYaxis:v.target.checked,percentChange:!1})},checked:!s.percentChange&&s.sameYaxis}),Kr("label",{htmlFor:"csv_same_yaxis",style:{marginLeft:5},children:"Share Y-axis"}),D==="bar"&&ja("div",{style:{marginTop:2},id:"csv_bar_orientation",children:[Kr("input",{type:"checkbox",id:"csv_bar_horizontal",onChange:v=>{g({...m,orientation:v.target.checked?"h":"v"})}}),Kr("label",{htmlFor:"csv_bar_horizontal",style:{marginLeft:5},children:"Plot horizontally"})]})]})]}),Kr("br",{}),ja("div",{style:{float:"right",marginTop:20},children:[Kr("button",{className:"_btn-tertiary",id:"csv_cancel",onClick:k,children:"Cancel"}),Kr("button",{className:"_btn",id:"csv_submit",onClick:A,children:"Submit"})]})]})})}function RC({csvData:O,plotlyData:z,yaxisOptions:W,traceType:ce,traceColor:Te,traceName:D,options:L,increasingColor:t,decreasingColor:b}){console.log("options",L);const d=z.data[0]||{};d.xaxis===void 0&&(d.xaxis="x"),d.yaxis===void 0&&(d.yaxis="y");let e=d.yaxis,w;const _=Object.keys(z.layout).filter(n=>n.startsWith("yaxis")).map(n=>z.layout[n]).filter(n=>n.side==="left"&&(n.overlaying==="y"||n.fixedrange!==void 0&&n.fixedrange===!0)).length>0?" ":"";if(W.sameYaxis!==!0){const n=Object.keys(z.layout).filter(l=>l.startsWith("yaxis")).map(l=>z.layout[l]);w=`y${n.length+1}`,e=`yaxis${n.length+1}`,z.layout[e]={...OC,title:{text:D,font:{size:14},standoff:0},ticksuffix:_,layer:"below traces"}}else w=d.yaxis.replace("yaxis","y");const u={type:ce,name:D,showlegend:!0,yaxis:w};let r={};if(["scatter","bar"].includes(ce)){if(!O||O.length===0)return z;const n=O.findIndex(o=>o[L.y]!==null&&o[L.y]!==0);if(n===-1)return z;const l={x:[],y:[],customdata:[]};O.forEach(o=>{let s=o[L.y];l.customdata.push(s),W.percentChange&&(ce==="scatter"||ce==="line")&&(s=(o[L.y]-O[n][L.y])/O[n][L.y]),l.x.push(o[L.x]),l.y.push(s)}),r={...u,x:l.x,y:l.y,customdata:l.customdata,hovertemplate:"%{customdata:.2f}",connectgaps:!0,marker:{color:Te}},ce==="bar"&&(r.orientation=L.orientation,r.marker.opacity=.7,r.connectgaps=void 0,r.hovertemplate=void 0,r.customdata=void 0)}else if(ce==="candlestick"){const n={x:[],open:[],high:[],low:[],close:[]};O.forEach(l=>{n.x.push(l[L.x]),n.open.push(l[L.open]),n.high.push(l[L.high]),n.low.push(l[L.low]),n.close.push(l[L.close])}),r={...u,x:n.x,open:n.open,high:n.high,low:n.low,close:n.close,increasing:{line:{color:t,width:.8},fillcolor:t},decreasing:{line:{color:b,width:.8},fillcolor:b}}}return{...z,data:[...z.data,r]}}const W4={padding:"5px 2px 2px 5px",margin:"2px 0"};function FC({open:O,close:z,addAnnotation:W,deleteAnnotation:ce,popupData:Te}){var u,r,n,l,o;const D={text:"",color:"#0088CC",size:18,bordercolor:"#822661",yanchor:"above"},[L,t]=mr.useState(D),[b,d]=mr.useState(D);Te&&Te!==L&&Te.annotation&&(Te.annotation=(Te==null?void 0:Te.annotation)||{},t(Te),d(Te));function e(){console.log("closing"),t(D),d(D),z()}function w(s){console.log(s.target.id.replace("addtext_",""),s.target.value);const c=s.target.id.replace("addtext_",""),h=s.target.value;d({...b,[c]:h})}function y(){console.log("submitting",b),b.text!==""?(L!=null&&L.annotation&&d({...b,annotation:L.annotation}),W(b),z()):(document.getElementById("popup_textarea_warning").style.display="block",document.getElementById("addtext_text").style.border="1px solid red")}function _(){ce(L),e()}return Kr(J1,{title:"Add Text to Chart",description:"Change the titles on the chart.",open:O,close:e,children:ja("div",{id:"popup_title",className:"popup_content",children:[ja("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[ja("div",{style:{marginBottom:20},children:[ja("label",{htmlFor:"popup_text",children:[Kr("b",{children:"Text:"}),Kr("div",{id:"popup_textarea_warning",className:"popup_warning",children:"Text is required"})]}),Kr("textarea",{id:"addtext_text",style:{...W4,width:"100%",maxWidth:"100%",maxHeight:"200px",marginTop:"8px"},rows:4,cols:50,placeholder:"Enter text here",onChange:w,defaultValue:((u=L==null?void 0:L.annotation)==null?void 0:u.text)||(b==null?void 0:b.text)})]}),ja("div",{style:{display:"flex",gap:15,alignItems:"center",flexWrap:"wrap",columnCount:2,justifyContent:"space-between",marginBottom:20},children:[Kr("label",{htmlFor:"addtext_color",children:Kr("b",{children:"Font color"})}),Kr("input",{type:"color",id:"addtext_color",style:{margin:"2px 2px 2px 15px"},defaultValue:((r=L==null?void 0:L.annotation)==null?void 0:r.color)||(b==null?void 0:b.color),onChange:w}),Kr("label",{htmlFor:"addtext_bordercolor",style:{marginLeft:20},children:Kr("b",{children:"Border color"})}),Kr("input",{type:"color",id:"addtext_bordercolor",style:{margin:"2px 2px 10px 15px"},defaultValue:((n=L==null?void 0:L.annotation)==null?void 0:n.bordercolor)||(b==null?void 0:b.bordercolor),onChange:w}),Kr("label",{htmlFor:"addtext_size",children:Kr("b",{children:"Font size"})}),Kr("input",{style:{...W4,width:"52px",margin:"0px 0px 0px 2px"},type:"number",id:"addtext_size",onChange:w,defaultValue:((l=L==null?void 0:L.annotation)==null?void 0:l.size)||(b==null?void 0:b.size)}),ja("div",{children:[Kr("label",{htmlFor:"addtext_yanchor",style:{marginRight:31},children:Kr("b",{children:"Position"})}),ja("select",{id:"addtext_yanchor",name:"yanchor",style:{width:"100px"},defaultValue:((o=L==null?void 0:L.annotation)==null?void 0:o.yanchor)||(b==null?void 0:b.yanchor),onChange:w,children:[Kr("option",{value:"above",children:"Above"}),Kr("option",{value:"below",children:"Below"})]})]})]})]}),ja("div",{style:{float:"right",marginTop:20},children:[Kr("button",{className:"_btn-tertiary ph-capture",id:"title_cancel",onClick:e,children:"Cancel"}),Kr("button",{className:"_btn ph-capture",id:"title_delete",onClick:_,children:"Delete"}),Kr("button",{className:"_btn ph-capture",id:"title_submit",onClick:y,children:"Submit"})]})]})})}function BC({plotlyData:O,open:z,close:W,defaultTitle:ce,updateTitle:Te,updateAxesTitles:D}){const[L,t]=mr.useState(ce),b=Object.keys(O.layout||{}).filter(y=>y.startsWith("yaxis")&&O.layout[y].range!=null),d=Object.keys(O.layout||{}).filter(y=>{var _;return y.startsWith("xaxis")&&O.layout[y].showticklabels!=null&&((_=O.layout[y])==null?void 0:_.anchor)}),[e,w]=mr.useState({});return Kr(J1,{title:"Chart Titles",description:"Change the titles on the chart.",open:z,close:W,children:ja("div",{id:"popup_title",className:"popup_content",children:[ja("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[ja("div",{children:[Kr("label",{htmlFor:"title_text",children:Kr("b",{children:"Title:"})}),Kr("textarea",{id:"title_text",style:{...iA,width:"100%",maxWidth:"100%",maxHeight:"200px",marginTop:"8px",marginLeft:"0px"},rows:2,cols:20,value:L,onChange:y=>t(y.target.value)})]}),Kr("div",{id:"xaxis_div",className:"csv_column_container",style:{marginTop:5,marginBottom:-5},children:d.map((y,_)=>{var u,r;return ja("div",{style:{marginTop:5,marginBottom:5},children:[Kr("label",{htmlFor:`title_${y}`,children:_===0?Kr("b",{children:"X axis:"}):ja("b",{children:["X axis ",_+1,":"]})}),Kr("input",{id:`title_${y}`,style:{marginLeft:"0px",padding:"5px 2px 2px 5px"},type:"text",defaultValue:((r=(u=O==null?void 0:O.layout[y])==null?void 0:u.title)==null?void 0:r.text)||"",onChange:n=>{w({...e,[y]:n.target.value})}})]},y)})}),Kr("div",{id:"yaxis_div",className:"csv_column_container",style:{marginTop:5,marginBottom:5},children:b.map((y,_)=>{var u,r;return ja("div",{style:{marginTop:10},children:[Kr("label",{htmlFor:`title_${y}`,children:_===0?Kr("b",{children:"Y axis:"}):ja("b",{children:["Y axis ",_+1,":"]})}),Kr("input",{id:`title_${y}`,style:{marginLeft:"0px",padding:"5px 2px 2px 5px"},type:"text",defaultValue:((r=(u=O==null?void 0:O.layout[y])==null?void 0:u.title)==null?void 0:r.text)||"",onChange:n=>{w({...e,[y]:n.target.value})}})]},y)})})]}),ja("div",{style:{float:"right",marginTop:20},children:[Kr("button",{className:"_btn-tertiary ph-capture",id:"title_cancel",onClick:W,children:"Cancel"}),Kr("button",{className:"_btn ph-capture",id:"title_submit",onClick:()=>{Te(L),D(e),W()},children:"Submit"})]})]})})}function Jb(){return Jb=Object.assign?Object.assign.bind():function(O){for(var z=1;z'),!0):z?O.some(function(W){return z.includes(W)})||O.includes("*"):!0}var ZC=function(z,W,ce){ce===void 0&&(ce=!1);var Te=W.alt,D=W.meta,L=W.mod,t=W.shift,b=W.ctrl,d=W.keys,e=z.key,w=z.code,y=z.ctrlKey,_=z.metaKey,u=z.shiftKey,r=z.altKey,n=o0(w),l=e.toLowerCase();if(!(d!=null&&d.includes(n))&&!(d!=null&&d.includes(l))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(n))return!1;if(!ce){if(Te===!r&&l!=="alt"||t===!u&&l!=="shift")return!1;if(L){if(!_&&!y)return!1}else if(D===!_&&l!=="meta"&&l!=="os"||b===!y&&l!=="ctrl"&&l!=="control")return!1}return d&&d.length===1&&(d.includes(l)||d.includes(n))?!0:d?UC(d):!d},$C=mr.createContext(void 0),YC=function(){return mr.useContext($C)};function uA(O,z){return O&&z&&typeof O=="object"&&typeof z=="object"?Object.keys(O).length===Object.keys(z).length&&Object.keys(O).reduce(function(W,ce){return W&&uA(O[ce],z[ce])},!0):O===z}var XC=mr.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),KC=function(){return mr.useContext(XC)};function JC(O){var z=mr.useRef(void 0);return uA(z.current,O)||(z.current=O),z.current}var Z4=function(z){z.stopPropagation(),z.preventDefault(),z.stopImmediatePropagation()},QC=typeof window<"u"?mr.useLayoutEffect:mr.useEffect;function Yd(O,z,W,ce){var Te=mr.useState(null),D=Te[0],L=Te[1],t=mr.useRef(!1),b=W instanceof Array?ce instanceof Array?void 0:ce:W,d=c3(O)?O.join(b==null?void 0:b.splitKey):O,e=W instanceof Array?W:ce instanceof Array?ce:void 0,w=mr.useCallback(z,e??[]),y=mr.useRef(w);e?y.current=w:y.current=z;var _=JC(b),u=KC(),r=u.enabledScopes,n=YC();return QC(function(){if(!((_==null?void 0:_.enabled)===!1||!WC(r,_==null?void 0:_.scopes))){var l=function(x,m){var g;if(m===void 0&&(m=!1),!(HC(x)&&!lA(x,_==null?void 0:_.enableOnFormTags))){if(D!==null){var k=D.getRootNode();if((k instanceof Document||k instanceof ShadowRoot)&&k.activeElement!==D&&!D.contains(k.activeElement)){Z4(x);return}}(g=x.target)!=null&&g.isContentEditable&&!(_!=null&&_.enableOnContentEditable)||T2(d,_==null?void 0:_.splitKey).forEach(function(A){var v,S=k2(A,_==null?void 0:_.combinationKey);if(ZC(x,S,_==null?void 0:_.ignoreModifiers)||(v=S.keys)!=null&&v.includes("*")){if(_!=null&&_.ignoreEventWhen!=null&&_.ignoreEventWhen(x)||m&&t.current)return;if(VC(x,S,_==null?void 0:_.preventDefault),!qC(x,S,_==null?void 0:_.enabled)){Z4(x);return}y.current(x,S),m||(t.current=!0)}})}},o=function(x){x.key!==void 0&&(oA(o0(x.code)),((_==null?void 0:_.keydown)===void 0&&(_==null?void 0:_.keyup)!==!0||_!=null&&_.keydown)&&l(x))},s=function(x){x.key!==void 0&&(sA(o0(x.code)),t.current=!1,_!=null&&_.keyup&&l(x,!0))},c=D||(b==null?void 0:b.document)||document;return c.addEventListener("keyup",s),c.addEventListener("keydown",o),n&&T2(d,_==null?void 0:_.splitKey).forEach(function(h){return n.addHotkey(k2(h,_==null?void 0:_.combinationKey,_==null?void 0:_.description))}),function(){c.removeEventListener("keyup",s),c.removeEventListener("keydown",o),n&&T2(d,_==null?void 0:_.splitKey).forEach(function(h){return n.removeHotkey(k2(h,_==null?void 0:_.combinationKey,_==null?void 0:_.description))})}}},[D,d,_,r]),L}function x0(O){return new Promise(z=>{window.MODEBAR||(window.MODEBAR=window.document.getElementsByClassName("modebar-container")[0],window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:flex;`),window.MODEBAR&&(O?window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:none;`:window.MODEBAR.style.cssText.includes("none")?window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:flex;`:window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:none;`,z(!0))})}function eI({setModal:O,changeTheme:z,autoScaling:W,Loading:ce,changeColor:Te,downloadFinished:D}){return{plotGlPixelRatio:1,scrollZoom:!0,responsive:!0,displaylogo:!1,displayModeBar:!0,edits:{legendPosition:!0,legendText:!0,annotationPosition:!0,annotationTail:!0,annotationText:!0,colorbarPosition:!0,shapePosition:!0},showAxisDragHandles:!0,showTips:!1,setBackground:"transparent",modeBarButtonsToRemove:["lasso2d","select2d","downloadImage"],modeBarButtons:[[{name:"Download CSV (Ctrl+Shift+S)",icon:nd.downloadCsv,click:async function(t){await A8(t,D)}},{name:"Download Chart as Image (Ctrl+S)",icon:nd.downloadImage,click:async function(){x0(!0),await M8("MainChart",x0,ce,D)}}],[{name:"Edit Color (Ctrl+E)",icon:nd.changeColor,click:function(){Te(!0)}},"drawline","drawopenpath","drawcircle","drawrect","eraseshape"],[{name:"Overlay chart from CSV (Ctrl+O)",icon:nd.plotCsv,click:function(){O({name:"overlayChart"})}},{name:"Add Text (Ctrl+T)",icon:nd.addText,click:function(){O({name:"textDialog",data:{text:""}})}},{name:"Change Titles (Ctrl+Shift+T)",icon:nd.changeTitle,click:function(){O({name:"titleDialog"})}},{name:"Change Theme",icon:nd.sunIcon,click:function(){z(!0)}}],["hoverClosestCartesian","hoverCompareCartesian","toggleSpikelines"],[{name:"Auto Scale (Ctrl+Shift+A)",icon:bf.Icons.autoscale,click:function(){W(!0)}},"zoomIn2d","zoomOut2d","autoScale2d","zoom2d","pan2d"]]}}function tI({setModal:O,Loading:z,changeColor:W,downloadFinished:ce}){Yd("ctrl+shift+t",()=>{O({name:"titleDialog"})},{preventDefault:!0}),Yd("ctrl+t",()=>{O({name:"textDialog"})},{preventDefault:!0}),Yd("ctrl+o",()=>{O({name:"overlayChart"})},{preventDefault:!0}),Yd(["ctrl+shift+h","ctrl+h"],()=>{x0()},{preventDefault:!0}),Yd("ctrl+e",()=>{W(!0)},{preventDefault:!0}),Yd("ctrl+shift+s",async()=>{O({name:"downloadCsv"}),await A8(document.getElementById("plotlyChart"),ce)},{preventDefault:!0}),Yd("ctrl+s",async()=>{x0(),M8("MainChart",x0,z,ce)},{preventDefault:!0}),Yd("ctrl+w",()=>{window.close()},{preventDefault:!0})}async function nI({plotData:O,volumeBars:z,setMaximizePlot:W}){const ce=Object.keys(O.layout).filter(e=>e.startsWith("xaxis")).filter(e=>O.layout[e].showticklabels||O.layout[e].matches===void 0),Te=O.data.filter(e=>{var w;return((w=e==null?void 0:e.name)==null?void 0:w.trim())==="Volume"}),D={},L=z||{old_nticks:{}},t=window.innerWidth,b=window.innerHeight,d=b>420&&t<920?8:b>420&&t<500?9:7;return t<850?(Te.forEach(e=>{e.type==="bar"&&(e.opacity=1,e.marker.line.width=.09,z.yaxis===void 0&&(L.yaxis=`yaxis${e.yaxis.replace("y","")}`,D[`${L.yaxis}.tickfont.size`]=d,L.tickfont=O.layout[L.yaxis].tickfont||{},O.layout.margin.l-=40))}),ce.forEach(e=>{var w;((w=z.old_nticks)==null?void 0:w[e])===void 0&&(D[`${e}.nticks`]=6,L.old_nticks[e]=O.layout[e].nticks||10)}),W(!0),await x0(!0)):t>850&&window.MODEBAR.style.cssText.includes("display: none")&&(await x0(!1),W(!1),z.old_nticks!==void 0&&ce.forEach(e=>{z.old_nticks[e]!==void 0&&(D[`${e}.nticks`]=L.old_nticks[e],L.old_nticks[e]=void 0)}),z.yaxis!==void 0&&Te.forEach(e=>{e.type==="bar"&&(e.opacity=.5,e.marker.line.width=.2,D[`${L.yaxis}.tickfont.size`]=L.tickfont.size+3,O.layout.margin.l+=40,L.yaxis=void 0)})),{volume_update:L,layout_update:D,plotData:O}}const rI=U9(D9);class iI extends Jx.Component{constructor(z){super(z),this.state={data:z.data,layout:z.layout,frames:z.frames,config:z.config,useResizeHandler:z.useResizeHandler,style:z.style,className:z.className,divId:z.divId,revision:z.revision,graphDiv:z.graphDiv,debug:z.debug,onInitialized:z.onInitialized}}render(){return Kr(rI,{data:this.state.data,layout:this.state.layout,frames:this.state.frames,config:this.state.config,useResizeHandler:this.state.useResizeHandler,style:this.state.style,className:this.state.className,divId:this.state.divId,revision:this.state.revision,graphDiv:this.state.graphDiv,debug:this.state.debug,onInitialized:this.state.onInitialized,onUpdate:z=>this.setState(z),onRelayout:z=>this.setState(z),onPurge:z=>this.setState(z)})}}const aI=(O,z)=>{if(W1.test(O.replace(" ","T").split(".")[0])){const W=new Date(O.replace(" ","T").split(".")[0]),ce=new Date(z.replace(" ","T").split(".")[0]);W.setSeconds(0),ce.setSeconds(0),W.setMilliseconds(0),ce.setMilliseconds(0);const Te=[5,0,1].includes(W.getDay())||[4,5,6].includes(ce.getDay())?2:0,D=new Date(W.getTime()-864e5*Te),L=new Date(ce.getTime()+864e5*Te),t=[D.toISOString(),L.toISOString()];return{x0_min:D,x1_max:L,xrange:t}}return{x0_min:O,x1_max:z,xrange:[O,z]}};function cA(O,z){var b,d;const W={...O},ce=W.data;z||(z=[(b=ce[0])==null?void 0:b.x[ce[0].x.length-2e3],(d=ce[0])==null?void 0:d.x[ce[0].x.length-1]]);const{x0_min:Te,x1_max:D,range:L}=aI(z[0],z[1]);z=L;const t=[];return ce.forEach(e=>{const w={...e},y=["x","y","low","high","open","close","text","customdata"],_=e.x?e.x:[],u=[];for(let n=0;n<_.length;n++){const l=_[n];if(W1.test(l)){const o=new Date(l).getTime();o>=Te.getTime()&&o<=D.getTime()&&u.push(n)}else l>=z[0]&&l<=z[1]&&u.push(n)}y.forEach(n=>{e[n]!==void 0&&Array.isArray(e[n])&&(w[n]=e[n].filter((l,o)=>u.includes(o)))}),["marker","line"].forEach(n=>{var l;(l=e[n])!=null&&l.color&&Array.isArray(e[n].color)&&(w[n]={...e[n]},w[n].color=e[n].color.filter((o,s)=>u.includes(s)))}),u.length>0&&t.push(w)}),t.length===0?{...O,layout:{...O.layout,xaxis:{...O.layout.xaxis,range:z}}}:(W.layout.xaxis.range=z,W.data=t,W)}async function oI({event:O,figure:z}){var W,ce;try{const Te=z.data.filter(L=>L.x!==void 0&&L.x.length>0&&L.x[0]!==void 0);if(Te.length===0)return z;const D=O?[O["xaxis.range[0]"],O["xaxis.range[1]"]]:[(W=Te[0])==null?void 0:W.x[Te[0].x.length-1e3],(ce=Te[0])==null?void 0:ce.x[Te[0].x.length-1]];return z=cA(z,D),z}catch(Te){console.log("error",Te)}}function $4(O){const z=new Date(O),W=`${z.getMonth()+1}`.padStart(2,"0"),ce=`${z.getDate()}`.padStart(2,"0"),Te=z.getFullYear(),D=`${z.getHours()}`.padStart(2,"0"),L=`${z.getMinutes()}`.padStart(2,"0"),t=`${z.getSeconds()}`.padStart(2,"0");return`${Te}-${W}-${ce} ${D}:${L}:${t}`}function sI({json:O,date:z,cmd:W,title:ce,globals:Te,theme:D,info:L}){var qe,$e;const t=L9();mr.useEffect(()=>{t&&t.capture("chart",L)},[]),O.layout.width=void 0,O.layout.height=void 0,($e=(qe=O.layout)==null?void 0:qe.title)!=null&&$e.text&&(O.layout.title.text="");const[b,d]=mr.useState(O),[e,w]=mr.useState({}),[y,_]=mr.useState(!1),[u,r]=mr.useState(ce),[n,l]=mr.useState({}),[o,s]=mr.useState(!1),[c,h]=mr.useState({name:""}),[x,m]=mr.useState(!1),[g,k]=mr.useState(null),[A,v]=mr.useState({old_nticks:{}}),[S,T]=mr.useState(!1),[p,M]=mr.useState(!1),[f,E]=mr.useState(!1),[I,B]=mr.useState(b),[N,V]=mr.useState([]),[j,$]=mr.useState(!1),[ee,H]=mr.useState(!0),[J,Q]=mr.useState(!1),[Z,K]=mr.useState(!1),[ae,se]=mr.useState(!1),[he,fe]=mr.useState({}),[ie,oe]=mr.useState([]),[le,ge]=mr.useState([]);function ye(Ye){Ye.layout.datarevision=Ye.layout.datarevision?Ye.layout.datarevision+1:1,B(Ye),g&&I&&bf.react(g,Ye.data,Ye.layout)}const me=()=>h({name:""}),be=mr.useCallback(Ye=>{var De,Be,Ge,tt,nt;console.log("onDeleteAnnotation",Ye);const _e=(Be=(De=I==null?void 0:I.layout)==null?void 0:De.annotations)==null?void 0:Be.findIndex(pt=>pt.text===Ye.text);console.log("index",_e),_e>-1&&((tt=(Ge=I==null?void 0:I.layout)==null?void 0:Ge.annotations)==null||tt.splice(_e,1),ye({...I}),V((nt=I==null?void 0:I.layout)==null?void 0:nt.annotations))},[I]),Se=mr.useCallback(Ye=>{q9({plotData:I,popupData:Ye,setPlotData:ye,setModal:h,setOnAnnotationClick:fe,setAnnotations:V,onAnnotationClick:he,ohlcAnnotation:ie,setOhlcAnnotation:oe,annotations:N,plotDiv:g})},[I,he,ie,N,g]);mr.useEffect(()=>{p&&(h({name:"downloadFinished"}),M(!1))},[p]),mr.useEffect(()=>{n&&Object.keys(n).length>0&&(Object.keys(n).forEach(Ye=>{I.layout[Ye].title={...I.layout[Ye].title||{},text:n[Ye]},I.layout[Ye].showticklabels=!0}),l({}))},[n]);function Ee(Ye){const _e=g.layout.shapes;if(!_e||_e.length===0)return;const De=_e[_e.length-1];De.line.color=Ye,bf.update(g,{},{shapes:_e})}function Ce(Ye,_e=!1){const De=e[Ye]||document.querySelector(`[data-title="${Ye}"]`);_e?(De.style.border="transparent",De.style.boxShadow="none"):(De.style.border="1px solid rgba(0, 151, 222, 1.0)",De.style.borderRadius="5px",De.style.borderpadding="5px",De.style.boxShadow="0 0 5px rgba(0, 151, 222, 1.0)"),w({...e,[Ye]:De})}const Le=async(Ye,_e)=>{if(f){const De={..._e};oI({event:Ye,figure:De}).then(async Be=>{E4(Ye,Be).then(Ge=>{Ge.to_update&&(ge(Ge.yaxis_fixedrange),ye({...Be,layout:Ge.to_update}))})})}else{const De=await E4(Ye,_e);if(!De.to_update)return;ge(De.yaxis_fixedrange),ye({..._e,layout:De.to_update})}},Oe=mr.useCallback(()=>{const Ye="Auto Scale (Ctrl+Shift+A)",_e=e[Ye]||document.querySelector(`[data-title="${Ye}"]`);let De=!0;_e.style.border==="transparent"?(g.removeAllListeners("plotly_relayout"),De=!1,g.on("plotly_relayout",async Be=>{if(Be["xaxis.range[0]"]===void 0)return;const Ge=Be.relayout?0:300;if(!Be.relayout&&W1.test(Be["xaxis.range[0]"].toString().replace(" ","T"))){const tt=new Date(Be["xaxis.range[0]"].replace(" ","T")),nt=new Date(Be["xaxis.range[1]"].replace(" ","T"));if(nt.getTime()-tt.getTime()<36e5*2){const pt=new Date(tt.getTime()-72e5),At=new Date(nt.getTime()+36e5*2);return Be["xaxis.range[0]"]=$4(pt),Be["xaxis.range[1]"]=$4(At),Be.relayout=!0,bf.relayout(g,Be)}}A4.debounce(async()=>{Le(Be,b)},Ge)()})):(g.removeAllListeners("plotly_relayout"),le.forEach(Be=>{g.layout[Be].fixedrange=!1}),ge([]),f&&g.on("plotly_relayout",A4.debounce(async Be=>{Be["xaxis.range[0]"]!==void 0&&Le(Be,b)},300))),Ce(Ye,De)},[e,f,Le,b,g,le]);function We(){const Ye="Edit Color (Ctrl+E)",_e=e[Ye]||document.querySelector(`[data-title="${Ye}"]`);let De=!0;_e.style.border==="transparent"&&(De=!1),se(!De),Ce(Ye,De)}mr.useEffect(()=>{J&&(console.log("activateAutoScale",!J),Oe(),Q(!1))},[J]),mr.useEffect(()=>{Z&&(We(),K(!1))},[Z]),mr.useEffect(()=>{if(j)try{console.log("changeTheme",j);const Ye=b==null?void 0:b.data.filter(nt=>{var pt;return((pt=nt==null?void 0:nt.name)==null?void 0:pt.trim())==="Volume"}),_e=!ee;window.document.body.style.backgroundColor=_e?"#000":"#fff",b.layout.font={...b.layout.font||{},color:_e?"#fff":"#000"};const De=_e?nd.sunIcon:nd.moonIcon;document.querySelector('[data-title="Change Theme"]').getElementsByTagName("path")[0].setAttribute("d",De.path),document.querySelector('[data-title="Change Theme"]').getElementsByTagName("svg")[0].setAttribute("viewBox",De.viewBox);const tt=_e?{"#00ACFF0":"#00ACFF","#e4003a":"#e4003a"}:{"#e4003a":"#e4003a","#00ACFF":"#00ACFF"};Ye.forEach(nt=>{nt.type==="bar"&&Array.isArray(nt.marker.color)&&(nt.marker.color=nt.marker.color.map(pt=>tt[pt]||pt))}),b.layout.template=_e?K9:J9,ye({...b}),H(_e),$(!1)}catch(Ye){console.log("error",Ye)}},[j]),mr.useEffect(()=>{var Ye,_e,De,Be;if(o){H(!0),Q(!1);const Ge=["Download CSV","Download Chart as Image","Overlay chart from CSV","Add Text","Change Titles","Auto Scale (Ctrl+Shift+A)","Reset Axes"],tt=document.querySelector('[data-title="Autoscale"]');tt&&(tt.getElementsByTagName("path")[0].setAttribute("d",bf.Icons.home.path),tt.setAttribute("data-title","Reset Axes")),window.MODEBAR=document.getElementsByClassName("modebar-container")[0];const nt=window.MODEBAR.getElementsByClassName("modebar-btn");if(window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:flex;`,nt){const wt={};for(let Nt=0;Nt0&&(ye(Ht),v(Gt),bf.update(g,{},Nt))}),D!=="dark"&&$(!0);const pt=b.data.map(wt=>wt.type==="candlestick");if(((De=b.data[0])==null?void 0:De.x)!==void 0&&((Be=b.data[0])==null?void 0:Be.x.length)<=1e3||!pt.includes(!0))return;h({name:"alertDialog",data:{title:"Warning",content:`Data has been truncated to 1000 points for performance reasons. - Please use the zoom tool to see more data.`}});const At=cA(b);ye(At),E(!0),Q(!0)}},[o]);const Ie=mr.useMemo(()=>Kr(iI,{onInitialized:(Ye,_e)=>{g||_e&&(_e.globals=Te,k(_e)),o||s(!0)},className:"w-full h-full",divId:"plotlyChart",data:I.data,layout:I.layout,config:eI({setModal:h,changeTheme:$,autoScaling:Q,Loading:m,changeColor:K,downloadFinished:M})}),[g,b,o,I,Te,k,s,h,$,Q,m,Ee,M]),Ve=mr.useMemo(()=>{var Ye,_e;return Kr(LC,{title:(Ye=c==null?void 0:c.data)==null?void 0:Ye.title,content:(_e=c==null?void 0:c.data)==null?void 0:_e.content,open:(c==null?void 0:c.name)==="alertDialog",close:me})},[c,me]),Pe=mr.useMemo(()=>Kr(DC,{addOverlay:Ye=>{console.log(Ye),Ye.layout.showlegend=!0,d(Ye),ye(Ye)},plotlyData:b,setLoading:m,open:(c==null?void 0:c.name)==="overlayChart",close:me}),[c,I,me,ye,m]),de=mr.useMemo(()=>Kr(BC,{updateTitle:Ye=>r(Ye),updateAxesTitles:Ye=>l(Ye),defaultTitle:u,plotlyData:I,open:(c==null?void 0:c.name)==="titleDialog",close:me}),[c,I,u,me]),Me=mr.useMemo(()=>Kr(FC,{popupData:(c==null?void 0:c.name)==="textDialog"?c==null?void 0:c.data:null,open:(c==null?void 0:c.name)==="textDialog",close:me,addAnnotation:Ye=>Se(Ye),deleteAnnotation:Ye=>be(Ye)}),[c,Se,be,me,I,ye]),ke=mr.useMemo(()=>Kr(X9,{open:ae,onColorChange:Ee}),[ae,Ee]),He=mr.useMemo(()=>Kr(zC,{open:(c==null?void 0:c.name)==="downloadFinished",close:me}),[c,me]),Fe=mr.useMemo(()=>Kr(tI,{setModal:h,Loading:m,changeColor:K,downloadFinished:M}),[h,m,K,M]);return ja("div",{className:"relative h-full",children:[x&&Kr("div",{className:"absolute inset-0 flex items-center justify-center z-[100]",children:ja("svg",{className:"animate-spin h-20 w-20 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Kr("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Kr("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]})}),ja("div",{id:"loading",className:"saving",children:[Kr("div",{id:"loading_text",className:"loading_text"}),Kr("div",{id:"loader",className:"loader"})]}),Ve,Pe,de,Me,ke,He,Fe,ja("div",{className:"relative h-full",id:"MainChart",children:[ja("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",children:[Kr("div",{className:"w-1/3",children:Kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:Kr("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),Kr("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:u}),ja("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(z).replace(/:\d\d /," "),Kr("br",{}),Kr("span",{className:"text-grey-400",children:W})]})]}),Kr("div",{className:z9("w-full sm:pb-12",{"h-[calc(100%-10px)]":S,"h-[calc(100%-50px)]":!S}),children:Ie})]})]})}const lI=Jx.memo(sI);function uI(){const[O,z]=mr.useState(null),[W,ce]=mr.useState({});mr.useEffect(()=>{{const L=setInterval(()=>{if(window.json_data){const t=window.json_data;console.log(t),z(t),clearInterval(L)}},100);return()=>clearInterval(L)}},[]);const D=(L=>{var y,_,u,r;if(!L)return null;const t={added_traces:[],csv_yaxis_id:null,cmd_src_idx:null,cmd_idx:null,cmd_src:"",old_margin:null,title:""},b=(_=(y=L.layout)==null?void 0:y.title)==null?void 0:_.text.replace(/ -/g,"").replace(/-/g,"").replace(/|<\/b>/g,"").replace(/ /g,"_"),d=new Date().toISOString().slice(0,10).replace(/-/g,""),e=new Date().toISOString().slice(11,19).replace(/:/g,"");window.title=`openbb_${b}_${d}_${e}`.replace(/_{2,}/g,"_"),L.layout.annotations!==void 0&&L.layout.annotations.forEach(function(n){if(n.text!==void 0&&n.text[0]==="/"){t.cmd_src=n.text,t.cmd_idx=L.layout.annotations.indexOf(n),n.text="";const l=L.layout.margin;t.old_margin={...l},l.t!==void 0&&l.t>40&&(l.t=40),L.cmd==="/equity/price/historical"&&(l.r-=50)}}),L.data.forEach(function(n){n.name!==void 0&&(n.hoverlabel={namelength:-1})});const w=((r=(u=L.layout)==null?void 0:u.title)==null?void 0:r.text)||"OpenBB Platform";return t.title=w,{data:L,date:new Date,globals:t,cmd:L.command_location,posthog:L.posthog,python_version:L.python_version,pywry_version:L.pywry_version,terminal_version:L.terminal_version,theme:L.theme,title:w}})(O);if(D){D.posthog.collect_logs&&!W&&ce({api_host:"https://app.posthog.com",autocapture:{css_selector_allowlist:[".ph-capture"]},capture_pageview:!1,loaded:function(d){const e=(D==null?void 0:D.log_id)||"";e!==""&&e!=="REPLACE_ME"&&d.identify(e),d.onFeatureFlags(function(){d.isFeatureEnabled("record-pywry",{send_event:!1})||d.stopSessionRecording(),d.isFeatureEnabled("collect-logs-pywry",{send_event:!1})?d.has_opted_out_capturing()&&d.opt_in_capturing():d.opt_out_capturing()})}});const L={INFO:{command:D.cmd,title:D.title,date:D.date,python_version:D.python_version,pywry_version:D.pywry_version,terminal_version:D.terminal_version}},t=Kr(lI,{json:D.data,date:D.date,cmd:D.cmd,title:D.title,globals:D.globals,theme:D.theme,info:L});return D.posthog.collect_logs&&W?Kr(P9,{apiKey:"phc_vhssDAMod5qIplznQ75Kdgz4aB1qPFmeVmfEOZ4hkRw",options:W,children:t}):t}else return Kr("div",{className:"absolute inset-0 flex items-center justify-center z-[100]",children:ja("svg",{className:"animate-spin h-20 w-20 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Kr("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Kr("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]})})}const cI=document.getElementById("root");uk(cI).render(Kr(uI,{})); +For more information, see https://radix-ui.com/primitives/docs/components/${z.docsSlug}`;return mr.useEffect(()=>{O&&(document.getElementById(O)||console.error(W))},[W,O]),null},kC="DialogDescriptionWarning",AC=({contentRef:O,descriptionId:z})=>{const ce=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rA(kC).contentName}}.`;return mr.useEffect(()=>{var D;const Te=(D=O.current)==null?void 0:D.getAttribute("aria-describedby");z&&Te&&(document.getElementById(z)||console.warn(ce))},[ce,O,z]),null},SC=G8,MC=$8,EC=Y8,CC=K8,IC=Q8,q4=tA;const H4=({title:O,titleId:z,...W})=>Kr("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...W,children:Kr("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),iA={margin:"2px 0px 2px 10px",padding:"5px 2px 2px 5px"};function J1({open:O,close:z,title:W,description:ce,children:Te}){return ja(SC,{open:O,onOpenChange:z,children:[Kr(MC,{onClick:z,className:"_modal-overlay"}),ja(EC,{className:"_modal",children:[Kr(CC,{className:"_modal-title",children:W}),Kr(IC,{className:"_modal_description",children:ce}),Kr(q4,{children:Kr(H4,{})}),Te,Kr(q4,{className:"_modal-close",onClick:z,children:Kr(H4,{className:"w-6 h-6"})})]})]})}function PC({title:O,content:z,open:W,close:ce}){return Kr(J1,{title:O,description:"",open:W,close:ce,children:ja("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[Kr("div",{style:{display:"flex",flexDirection:"column",gap:0},children:Kr("div",{children:Kr("label",{htmlFor:"title_text",children:z})})}),Kr("div",{style:{float:"right",marginTop:20},children:Kr("button",{type:"button",className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:ce,children:"Close"})})]})})}function LC({open:O,close:z}){const W=window.download_path||"~/OpenBBUserData/exports";return Kr(J1,{title:"Success",description:"",open:O,close:z,children:ja("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[Kr("div",{style:{display:"flex",flexDirection:"column",gap:0},children:Kr("div",{children:ja("label",{htmlFor:"title_text",children:[Kr("b",{children:window.title})," has been downloaded to",Kr("br",{}),Kr("br",{}),Kr("a",{style:{color:"#FFDD00",marginTop:15},href:`${W}`,onClick:ce=>{ce.preventDefault(),window.pywry.open_file(W)},children:W})]})})}),Kr("div",{style:{float:"right",marginTop:20},children:Kr("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:z,children:"Close"})})]})})}const G4=new FileReader,zC={overlaying:"y",side:"left",tickfont:{size:12},tickpadding:5,showgrid:!1,showline:!1,showticklabels:!0,showlegend:!0,zeroline:!1,anchor:"x",type:"linear",autorange:!0};function OC({open:O,close:z,setLoading:W,addOverlay:ce,plotlyData:Te}){const[D,L]=mr.useState("scatter"),[t,b]=mr.useState("#FFDD00"),[d,e]=mr.useState("#00ACFF"),[w,y]=mr.useState("#FF0000"),[_,u]=mr.useState(""),[r,n]=mr.useState([]),[l,o]=mr.useState([]),[s,c]=mr.useState({}),h=["x","open","high","low","close"],x={scatter:"Scatter (Line)",candlestick:"Candlestick",bar:"Bar"},[m,g]=mr.useState({});function k(){z(),L("scatter"),u(""),n([]),o([]),g({})}function A(){var S,T;if(r.length===0){(S=document.getElementById("csv_file"))==null||S.focus(),(T=document.getElementById("csv_file"))==null||T.style.setProperty("border","1px solid red"),document.getElementById("csv_file_warning").style.display="block";return}const v=DC({csvData:r,plotlyData:Te,yaxisOptions:s,traceType:D,traceColor:t,traceName:_,options:m,increasingColor:d,decreasingColor:w});ce(v),k()}return Kr(J1,{title:"Overlay Chart",description:"Upload a CSV file to overlay a chart on the main chart.",open:O,close:z,children:ja("div",{id:"popup_csv",className:"popup_content",children:[ja("div",{children:[ja("label",{htmlFor:"csv_file",children:[Kr("b",{children:"CSV file:"}),Kr("div",{id:"csv_file_warning",className:"popup_warning",style:{marginLeft:"80px",marginBottom:"10px"},children:"CSV file is required."})]}),Kr("input",{onChange:v=>{var S,T;if(v.target.files){if(v.target.files[0].type!=="text/csv"){(S=document.getElementById("csv_file"))==null||S.focus(),(T=document.getElementById("csv_file"))==null||T.style.setProperty("border","1px solid red"),document.getElementById("csv_file_warning").style.display="block";return}}else return;l.length>0&&(o([]),g({}),L("scatter")),G4.onload=p=>{var $;if(!(($=p.target)!=null&&$.result)||typeof p.target.result!="string")return;const M=p.target.result.split(` +`).map(ee=>ee.replace(/\r/g,"")),f=M[0].split(","),E=f.map(ee=>ee.trim().toLowerCase()),I={};f.length>1&&(I.x=f[0],I.y=f[1]);for(let ee=0;eeE.includes(ee))?L("candlestick"):E.length>=5&&B.forEach(ee=>{I[ee]=f[B.indexOf(ee)+1]}),E.includes("close")&&(g({...m,y:f[E.indexOf("close")]}),I.y=f[E.indexOf("close")]);const V=[];for(let ee=1;ee2&&(H.test(ee[0])?ee.splice(0,2):H.test(ee[ee.length-2])&&ee.splice(ee.length-2,2),j=ee.join("_").replace(/openbb_/g,""))}}catch(ee){console.log(ee)}u(j),g(I),o(f),n(V)},G4.readAsText(v.target.files[0])},type:"file",id:"csv_file",accept:".csv",style:{marginLeft:10}})]}),ja("div",{style:{marginTop:15},children:[Kr("label",{htmlFor:"csv_trace_type",children:Kr("b",{children:"Display data type:"})}),ja("select",{onChange:v=>{L(v.target.value)},id:"csv_trace_type",style:iA,defaultValue:x[D],children:[D&&Kr("option",{value:D,children:x[D]},D),Object.keys(x).map(v=>D!==v&&Kr("option",{value:v,children:x[v]},v))]})]}),ja("div",{style:{marginTop:12},children:[Kr("label",{htmlFor:"csv_name",children:Kr("b",{children:"Trace Name:"})}),Kr("textarea",{id:"csv_name",value:_,onChange:v=>{u(v.target.value)},style:{padding:"5px 2px 2px 5px",width:"100%",maxWidth:"100%",maxHeight:200,marginTop:2},rows:2,cols:20,placeholder:"Enter a name to give this trace"})]}),l.length>0&&ja(Wm,{children:[["scatter","bar"].includes(D)&&Kr("div",{style:{marginTop:15,marginBottom:10},id:"csv_columns",className:"csv_column_container",children:["x","y"].map(v=>ja("div",{style:{marginTop:10,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[ja("label",{htmlFor:`csv_${v}`,style:{width:"100px"},children:[v.toUpperCase()," Axis"]}),Kr("select",{onChange:S=>{g({...m,[v]:S.target.value})},id:`csv_${v}`,style:{width:"100%"},defaultValue:m[v],children:l.map(S=>Kr("option",{value:S,children:S},S))})]},v))}),D==="candlestick"&&Kr("div",{id:"csv_columns",className:"csv_column_container",style:{marginTop:15},children:["x","open","high","low","close"].map(v=>ja("div",{style:{marginTop:10,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Kr("label",{htmlFor:`csv_${v}`,style:{width:"100px"},children:v.charAt(0).toUpperCase()+v.slice(1)}),Kr("select",{onChange:S=>{g({...m,[v]:S.target.value})},id:`csv_${v}`,style:{width:"100%"},defaultValue:m[v],children:l.map(S=>Kr("option",{value:S,children:S},S))})]},v))}),ja("div",{style:{marginTop:20},id:"csv_colors",children:[["scatter","bar"].includes(D)&&ja("div",{children:[Kr("label",{htmlFor:"csv_color",children:`${D.charAt(0).toUpperCase()}${D.slice(1)} color`}),Kr("input",{type:"color",id:"csv_color",defaultValue:"#FFDD00",style:{margin:"2px 2px 2px 10px"},onChange:v=>{console.log(v.target.value),b(v.target.value)}})]}),D==="candlestick"&&ja(Wm,{children:[Kr("label",{htmlFor:"csv_increasing",children:"Increasing color"}),Kr("input",{type:"color",id:"csv_increasing",defaultValue:"#00ACFF",style:{margin:"2px 0px 2px 10px"},onChange:v=>{e(v.target.value)}}),Kr("label",{htmlFor:"csv_decreasing",style:{marginLeft:15},children:"Decreasing color"}),Kr("input",{style:{margin:"2px 0px 2px 10px"},type:"color",id:"csv_decreasing",defaultValue:"#FF0000",onChange:v=>{y(v.target.value)}})]})]}),ja("div",{style:{marginTop:20},id:"csv_plot_yaxis_options",children:[D!=="candlestick"&&ja(Wm,{children:[Kr("input",{type:"checkbox",id:"csv_percent_change",name:"csv_plot_yaxis_check",style:{marginBottom:2},onChange:v=>{c({...s,percentChange:v.target.checked,sameYaxis:!1})},checked:!s.sameYaxis&&s.percentChange}),Kr("label",{htmlFor:"csv_percent_change",style:{marginLeft:5},children:"Plot as percent change from first value"}),Kr("br",{})]}),Kr("input",{style:{marginTop:2},type:"checkbox",id:"csv_same_yaxis",name:"csv_plot_yaxis_check",onChange:v=>{c({...s,sameYaxis:v.target.checked,percentChange:!1})},checked:!s.percentChange&&s.sameYaxis}),Kr("label",{htmlFor:"csv_same_yaxis",style:{marginLeft:5},children:"Share Y-axis"}),D==="bar"&&ja("div",{style:{marginTop:2},id:"csv_bar_orientation",children:[Kr("input",{type:"checkbox",id:"csv_bar_horizontal",onChange:v=>{g({...m,orientation:v.target.checked?"h":"v"})}}),Kr("label",{htmlFor:"csv_bar_horizontal",style:{marginLeft:5},children:"Plot horizontally"})]})]})]}),Kr("br",{}),ja("div",{style:{float:"right",marginTop:20},children:[Kr("button",{className:"_btn-tertiary",id:"csv_cancel",onClick:k,children:"Cancel"}),Kr("button",{className:"_btn",id:"csv_submit",onClick:A,children:"Submit"})]})]})})}function DC({csvData:O,plotlyData:z,yaxisOptions:W,traceType:ce,traceColor:Te,traceName:D,options:L,increasingColor:t,decreasingColor:b}){console.log("options",L);const d=z.data[0]||{};d.xaxis===void 0&&(d.xaxis="x"),d.yaxis===void 0&&(d.yaxis="y");let e=d.yaxis,w;const _=Object.keys(z.layout).filter(n=>n.startsWith("yaxis")).map(n=>z.layout[n]).filter(n=>n.side==="left"&&(n.overlaying==="y"||n.fixedrange!==void 0&&n.fixedrange===!0)).length>0?" ":"";if(W.sameYaxis!==!0){const n=Object.keys(z.layout).filter(l=>l.startsWith("yaxis")).map(l=>z.layout[l]);w=`y${n.length+1}`,e=`yaxis${n.length+1}`,z.layout[e]={...zC,title:{text:D,font:{size:14},standoff:0},ticksuffix:_,layer:"below traces"}}else w=d.yaxis.replace("yaxis","y");const u={type:ce,name:D,showlegend:!0,yaxis:w};let r={};if(["scatter","bar"].includes(ce)){if(!O||O.length===0)return z;const n=O.findIndex(o=>o[L.y]!==null&&o[L.y]!==0);if(n===-1)return z;const l={x:[],y:[],customdata:[]};O.forEach(o=>{let s=o[L.y];l.customdata.push(s),W.percentChange&&(ce==="scatter"||ce==="line")&&(s=(o[L.y]-O[n][L.y])/O[n][L.y]),l.x.push(o[L.x]),l.y.push(s)}),r={...u,x:l.x,y:l.y,customdata:l.customdata,hovertemplate:"%{customdata:.2f}",connectgaps:!0,marker:{color:Te}},ce==="bar"&&(r.orientation=L.orientation,r.marker.opacity=.7,r.connectgaps=void 0,r.hovertemplate=void 0,r.customdata=void 0)}else if(ce==="candlestick"){const n={x:[],open:[],high:[],low:[],close:[]};O.forEach(l=>{n.x.push(l[L.x]),n.open.push(l[L.open]),n.high.push(l[L.high]),n.low.push(l[L.low]),n.close.push(l[L.close])}),r={...u,x:n.x,open:n.open,high:n.high,low:n.low,close:n.close,increasing:{line:{color:t,width:.8},fillcolor:t},decreasing:{line:{color:b,width:.8},fillcolor:b}}}return{...z,data:[...z.data,r]}}const W4={padding:"5px 2px 2px 5px",margin:"2px 0"};function RC({open:O,close:z,addAnnotation:W,deleteAnnotation:ce,popupData:Te}){var u,r,n,l,o;const D={text:"",color:"#0088CC",size:18,bordercolor:"#822661",yanchor:"above"},[L,t]=mr.useState(D),[b,d]=mr.useState(D);Te&&Te!==L&&Te.annotation&&(Te.annotation=(Te==null?void 0:Te.annotation)||{},t(Te),d(Te));function e(){console.log("closing"),t(D),d(D),z()}function w(s){console.log(s.target.id.replace("addtext_",""),s.target.value);const c=s.target.id.replace("addtext_",""),h=s.target.value;d({...b,[c]:h})}function y(){console.log("submitting",b),b.text!==""?(L!=null&&L.annotation&&d({...b,annotation:L.annotation}),W(b),z()):(document.getElementById("popup_textarea_warning").style.display="block",document.getElementById("addtext_text").style.border="1px solid red")}function _(){ce(L),e()}return Kr(J1,{title:"Add Text to Chart",description:"Change the titles on the chart.",open:O,close:e,children:ja("div",{id:"popup_title",className:"popup_content",children:[ja("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[ja("div",{style:{marginBottom:20},children:[ja("label",{htmlFor:"popup_text",children:[Kr("b",{children:"Text:"}),Kr("div",{id:"popup_textarea_warning",className:"popup_warning",children:"Text is required"})]}),Kr("textarea",{id:"addtext_text",style:{...W4,width:"100%",maxWidth:"100%",maxHeight:"200px",marginTop:"8px"},rows:4,cols:50,placeholder:"Enter text here",onChange:w,defaultValue:((u=L==null?void 0:L.annotation)==null?void 0:u.text)||(b==null?void 0:b.text)})]}),ja("div",{style:{display:"flex",gap:15,alignItems:"center",flexWrap:"wrap",columnCount:2,justifyContent:"space-between",marginBottom:20},children:[Kr("label",{htmlFor:"addtext_color",children:Kr("b",{children:"Font color"})}),Kr("input",{type:"color",id:"addtext_color",style:{margin:"2px 2px 2px 15px"},defaultValue:((r=L==null?void 0:L.annotation)==null?void 0:r.color)||(b==null?void 0:b.color),onChange:w}),Kr("label",{htmlFor:"addtext_bordercolor",style:{marginLeft:20},children:Kr("b",{children:"Border color"})}),Kr("input",{type:"color",id:"addtext_bordercolor",style:{margin:"2px 2px 10px 15px"},defaultValue:((n=L==null?void 0:L.annotation)==null?void 0:n.bordercolor)||(b==null?void 0:b.bordercolor),onChange:w}),Kr("label",{htmlFor:"addtext_size",children:Kr("b",{children:"Font size"})}),Kr("input",{style:{...W4,width:"52px",margin:"0px 0px 0px 2px"},type:"number",id:"addtext_size",onChange:w,defaultValue:((l=L==null?void 0:L.annotation)==null?void 0:l.size)||(b==null?void 0:b.size)}),ja("div",{children:[Kr("label",{htmlFor:"addtext_yanchor",style:{marginRight:31},children:Kr("b",{children:"Position"})}),ja("select",{id:"addtext_yanchor",name:"yanchor",style:{width:"100px"},defaultValue:((o=L==null?void 0:L.annotation)==null?void 0:o.yanchor)||(b==null?void 0:b.yanchor),onChange:w,children:[Kr("option",{value:"above",children:"Above"}),Kr("option",{value:"below",children:"Below"})]})]})]})]}),ja("div",{style:{float:"right",marginTop:20},children:[Kr("button",{className:"_btn-tertiary ph-capture",id:"title_cancel",onClick:e,children:"Cancel"}),Kr("button",{className:"_btn ph-capture",id:"title_delete",onClick:_,children:"Delete"}),Kr("button",{className:"_btn ph-capture",id:"title_submit",onClick:y,children:"Submit"})]})]})})}function FC({plotlyData:O,open:z,close:W,defaultTitle:ce,updateTitle:Te,updateAxesTitles:D}){const[L,t]=mr.useState(ce),b=Object.keys(O.layout||{}).filter(y=>y.startsWith("yaxis")&&O.layout[y].range!=null),d=Object.keys(O.layout||{}).filter(y=>{var _;return y.startsWith("xaxis")&&O.layout[y].showticklabels!=null&&((_=O.layout[y])==null?void 0:_.anchor)}),[e,w]=mr.useState({});return Kr(J1,{title:"Chart Titles",description:"Change the titles on the chart.",open:z,close:W,children:ja("div",{id:"popup_title",className:"popup_content",children:[ja("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[ja("div",{children:[Kr("label",{htmlFor:"title_text",children:Kr("b",{children:"Title:"})}),Kr("textarea",{id:"title_text",style:{...iA,width:"100%",maxWidth:"100%",maxHeight:"200px",marginTop:"8px",marginLeft:"0px"},rows:2,cols:20,value:L,onChange:y=>t(y.target.value)})]}),Kr("div",{id:"xaxis_div",className:"csv_column_container",style:{marginTop:5,marginBottom:-5},children:d.map((y,_)=>{var u,r;return ja("div",{style:{marginTop:5,marginBottom:5},children:[Kr("label",{htmlFor:`title_${y}`,children:_===0?Kr("b",{children:"X axis:"}):ja("b",{children:["X axis ",_+1,":"]})}),Kr("input",{id:`title_${y}`,style:{marginLeft:"0px",padding:"5px 2px 2px 5px"},type:"text",defaultValue:((r=(u=O==null?void 0:O.layout[y])==null?void 0:u.title)==null?void 0:r.text)||"",onChange:n=>{w({...e,[y]:n.target.value})}})]},y)})}),Kr("div",{id:"yaxis_div",className:"csv_column_container",style:{marginTop:5,marginBottom:5},children:b.map((y,_)=>{var u,r;return ja("div",{style:{marginTop:10},children:[Kr("label",{htmlFor:`title_${y}`,children:_===0?Kr("b",{children:"Y axis:"}):ja("b",{children:["Y axis ",_+1,":"]})}),Kr("input",{id:`title_${y}`,style:{marginLeft:"0px",padding:"5px 2px 2px 5px"},type:"text",defaultValue:((r=(u=O==null?void 0:O.layout[y])==null?void 0:u.title)==null?void 0:r.text)||"",onChange:n=>{w({...e,[y]:n.target.value})}})]},y)})})]}),ja("div",{style:{float:"right",marginTop:20},children:[Kr("button",{className:"_btn-tertiary ph-capture",id:"title_cancel",onClick:W,children:"Cancel"}),Kr("button",{className:"_btn ph-capture",id:"title_submit",onClick:()=>{Te(L),D(e),W()},children:"Submit"})]})]})})}function Jb(){return Jb=Object.assign?Object.assign.bind():function(O){for(var z=1;z'),!0):z?O.some(function(W){return z.includes(W)})||O.includes("*"):!0}var WC=function(z,W,ce){ce===void 0&&(ce=!1);var Te=W.alt,D=W.meta,L=W.mod,t=W.shift,b=W.ctrl,d=W.keys,e=z.key,w=z.code,y=z.ctrlKey,_=z.metaKey,u=z.shiftKey,r=z.altKey,n=o0(w),l=e.toLowerCase();if(!(d!=null&&d.includes(n))&&!(d!=null&&d.includes(l))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(n))return!1;if(!ce){if(Te===!r&&l!=="alt"||t===!u&&l!=="shift")return!1;if(L){if(!_&&!y)return!1}else if(D===!_&&l!=="meta"&&l!=="os"||b===!y&&l!=="ctrl"&&l!=="control")return!1}return d&&d.length===1&&(d.includes(l)||d.includes(n))?!0:d?jC(d):!d},ZC=mr.createContext(void 0),$C=function(){return mr.useContext(ZC)};function uA(O,z){return O&&z&&typeof O=="object"&&typeof z=="object"?Object.keys(O).length===Object.keys(z).length&&Object.keys(O).reduce(function(W,ce){return W&&uA(O[ce],z[ce])},!0):O===z}var YC=mr.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),XC=function(){return mr.useContext(YC)};function KC(O){var z=mr.useRef(void 0);return uA(z.current,O)||(z.current=O),z.current}var Z4=function(z){z.stopPropagation(),z.preventDefault(),z.stopImmediatePropagation()},JC=typeof window<"u"?mr.useLayoutEffect:mr.useEffect;function Yd(O,z,W,ce){var Te=mr.useState(null),D=Te[0],L=Te[1],t=mr.useRef(!1),b=W instanceof Array?ce instanceof Array?void 0:ce:W,d=c3(O)?O.join(b==null?void 0:b.splitKey):O,e=W instanceof Array?W:ce instanceof Array?ce:void 0,w=mr.useCallback(z,e??[]),y=mr.useRef(w);e?y.current=w:y.current=z;var _=KC(b),u=XC(),r=u.enabledScopes,n=$C();return JC(function(){if(!((_==null?void 0:_.enabled)===!1||!GC(r,_==null?void 0:_.scopes))){var l=function(x,m){var g;if(m===void 0&&(m=!1),!(qC(x)&&!lA(x,_==null?void 0:_.enableOnFormTags))){if(D!==null){var k=D.getRootNode();if((k instanceof Document||k instanceof ShadowRoot)&&k.activeElement!==D&&!D.contains(k.activeElement)){Z4(x);return}}(g=x.target)!=null&&g.isContentEditable&&!(_!=null&&_.enableOnContentEditable)||T2(d,_==null?void 0:_.splitKey).forEach(function(A){var v,S=k2(A,_==null?void 0:_.combinationKey);if(WC(x,S,_==null?void 0:_.ignoreModifiers)||(v=S.keys)!=null&&v.includes("*")){if(_!=null&&_.ignoreEventWhen!=null&&_.ignoreEventWhen(x)||m&&t.current)return;if(UC(x,S,_==null?void 0:_.preventDefault),!VC(x,S,_==null?void 0:_.enabled)){Z4(x);return}y.current(x,S),m||(t.current=!0)}})}},o=function(x){x.key!==void 0&&(oA(o0(x.code)),((_==null?void 0:_.keydown)===void 0&&(_==null?void 0:_.keyup)!==!0||_!=null&&_.keydown)&&l(x))},s=function(x){x.key!==void 0&&(sA(o0(x.code)),t.current=!1,_!=null&&_.keyup&&l(x,!0))},c=D||(b==null?void 0:b.document)||document;return c.addEventListener("keyup",s),c.addEventListener("keydown",o),n&&T2(d,_==null?void 0:_.splitKey).forEach(function(h){return n.addHotkey(k2(h,_==null?void 0:_.combinationKey,_==null?void 0:_.description))}),function(){c.removeEventListener("keyup",s),c.removeEventListener("keydown",o),n&&T2(d,_==null?void 0:_.splitKey).forEach(function(h){return n.removeHotkey(k2(h,_==null?void 0:_.combinationKey,_==null?void 0:_.description))})}}},[D,d,_,r]),L}function x0(O){return new Promise(z=>{window.MODEBAR||(window.MODEBAR=window.document.getElementsByClassName("modebar-container")[0],window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:flex;`),window.MODEBAR&&(O?window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:none;`:window.MODEBAR.style.cssText.includes("none")?window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:flex;`:window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:none;`,z(!0))})}function QC({setModal:O,changeTheme:z,autoScaling:W,Loading:ce,changeColor:Te,downloadFinished:D}){return{plotGlPixelRatio:1,scrollZoom:!0,responsive:!0,displaylogo:!1,displayModeBar:!0,edits:{legendPosition:!0,legendText:!0,annotationPosition:!0,annotationTail:!0,annotationText:!0,colorbarPosition:!0,shapePosition:!0},showAxisDragHandles:!0,showTips:!1,setBackground:"transparent",modeBarButtonsToRemove:["lasso2d","select2d","downloadImage"],modeBarButtons:[[{name:"Download CSV (Ctrl+Shift+S)",icon:nd.downloadCsv,click:async function(t){await A8(t,D)}},{name:"Download Chart as Image (Ctrl+S)",icon:nd.downloadImage,click:async function(){x0(!0),await M8("MainChart",x0,ce,D)}}],[{name:"Edit Color (Ctrl+E)",icon:nd.changeColor,click:function(){Te(!0)}},"drawline","drawopenpath","drawcircle","drawrect","eraseshape"],[{name:"Overlay chart from CSV (Ctrl+O)",icon:nd.plotCsv,click:function(){O({name:"overlayChart"})}},{name:"Add Text (Ctrl+T)",icon:nd.addText,click:function(){O({name:"textDialog",data:{text:""}})}},{name:"Change Titles (Ctrl+Shift+T)",icon:nd.changeTitle,click:function(){O({name:"titleDialog"})}},{name:"Change Theme",icon:nd.sunIcon,click:function(){z(!0)}}],["hoverClosestCartesian","hoverCompareCartesian","toggleSpikelines"],[{name:"Auto Scale (Ctrl+Shift+A)",icon:bf.Icons.autoscale,click:function(){W(!0)}},"zoomIn2d","zoomOut2d","autoScale2d","zoom2d","pan2d"]]}}function eI({setModal:O,Loading:z,changeColor:W,downloadFinished:ce}){Yd("ctrl+shift+t",()=>{O({name:"titleDialog"})},{preventDefault:!0}),Yd("ctrl+t",()=>{O({name:"textDialog"})},{preventDefault:!0}),Yd("ctrl+o",()=>{O({name:"overlayChart"})},{preventDefault:!0}),Yd(["ctrl+shift+h","ctrl+h"],()=>{x0()},{preventDefault:!0}),Yd("ctrl+e",()=>{W(!0)},{preventDefault:!0}),Yd("ctrl+shift+s",async()=>{O({name:"downloadCsv"}),await A8(document.getElementById("plotlyChart"),ce)},{preventDefault:!0}),Yd("ctrl+s",async()=>{x0(),M8("MainChart",x0,z,ce)},{preventDefault:!0}),Yd("ctrl+w",()=>{window.close()},{preventDefault:!0})}async function tI({plotData:O,volumeBars:z,setMaximizePlot:W}){const ce=Object.keys(O.layout).filter(e=>e.startsWith("xaxis")).filter(e=>O.layout[e].showticklabels||O.layout[e].matches===void 0),Te=O.data.filter(e=>{var w;return((w=e==null?void 0:e.name)==null?void 0:w.trim())==="Volume"}),D={},L=z||{old_nticks:{}},t=window.innerWidth,b=window.innerHeight,d=b>420&&t<920?8:b>420&&t<500?9:7;return t<850?(Te.forEach(e=>{e.type==="bar"&&(e.opacity=1,e.marker.line.width=.09,z.yaxis===void 0&&(L.yaxis=`yaxis${e.yaxis.replace("y","")}`,D[`${L.yaxis}.tickfont.size`]=d,L.tickfont=O.layout[L.yaxis].tickfont||{},O.layout.margin.l-=40))}),ce.forEach(e=>{var w;((w=z.old_nticks)==null?void 0:w[e])===void 0&&(D[`${e}.nticks`]=6,L.old_nticks[e]=O.layout[e].nticks||10)}),W(!0),await x0(!0)):t>850&&window.MODEBAR.style.cssText.includes("display: none")&&(await x0(!1),W(!1),z.old_nticks!==void 0&&ce.forEach(e=>{z.old_nticks[e]!==void 0&&(D[`${e}.nticks`]=L.old_nticks[e],L.old_nticks[e]=void 0)}),z.yaxis!==void 0&&Te.forEach(e=>{e.type==="bar"&&(e.opacity=.5,e.marker.line.width=.2,D[`${L.yaxis}.tickfont.size`]=L.tickfont.size+3,O.layout.margin.l+=40,L.yaxis=void 0)})),{volume_update:L,layout_update:D,plotData:O}}const nI=j9(O9);class rI extends Jx.Component{constructor(z){super(z),this.state={data:z.data,layout:z.layout,frames:z.frames,config:z.config,useResizeHandler:z.useResizeHandler,style:z.style,className:z.className,divId:z.divId,revision:z.revision,graphDiv:z.graphDiv,debug:z.debug,onInitialized:z.onInitialized}}render(){return Kr(nI,{data:this.state.data,layout:this.state.layout,frames:this.state.frames,config:this.state.config,useResizeHandler:this.state.useResizeHandler,style:this.state.style,className:this.state.className,divId:this.state.divId,revision:this.state.revision,graphDiv:this.state.graphDiv,debug:this.state.debug,onInitialized:this.state.onInitialized,onUpdate:z=>this.setState(z),onRelayout:z=>this.setState(z),onPurge:z=>this.setState(z)})}}const iI=(O,z)=>{if(W1.test(O.replace(" ","T").split(".")[0])){const W=new Date(O.replace(" ","T").split(".")[0]),ce=new Date(z.replace(" ","T").split(".")[0]);W.setSeconds(0),ce.setSeconds(0),W.setMilliseconds(0),ce.setMilliseconds(0);const Te=[5,0,1].includes(W.getDay())||[4,5,6].includes(ce.getDay())?2:0,D=new Date(W.getTime()-864e5*Te),L=new Date(ce.getTime()+864e5*Te),t=[D.toISOString(),L.toISOString()];return{x0_min:D,x1_max:L,xrange:t}}return{x0_min:O,x1_max:z,xrange:[O,z]}};function aI(O,z){var b,d;const W={...O},ce=W.data;z||(z=[(b=ce[0])==null?void 0:b.x[ce[0].x.length-2e3],(d=ce[0])==null?void 0:d.x[ce[0].x.length-1]]);const{x0_min:Te,x1_max:D,range:L}=iI(z[0],z[1]);z=L;const t=[];return ce.forEach(e=>{const w={...e},y=["x","y","low","high","open","close","text","customdata"],_=e.x?e.x:[],u=[];for(let n=0;n<_.length;n++){const l=_[n];if(W1.test(l)){const o=new Date(l).getTime();o>=Te.getTime()&&o<=D.getTime()&&u.push(n)}else l>=z[0]&&l<=z[1]&&u.push(n)}y.forEach(n=>{e[n]!==void 0&&Array.isArray(e[n])&&(w[n]=e[n].filter((l,o)=>u.includes(o)))}),["marker","line"].forEach(n=>{var l;(l=e[n])!=null&&l.color&&Array.isArray(e[n].color)&&(w[n]={...e[n]},w[n].color=e[n].color.filter((o,s)=>u.includes(s)))}),u.length>0&&t.push(w)}),t.length===0?{...O,layout:{...O.layout,xaxis:{...O.layout.xaxis,range:z}}}:(W.layout.xaxis.range=z,W.data=t,W)}async function oI({event:O,figure:z}){var W,ce;try{const Te=z.data.filter(L=>L.x!==void 0&&L.x.length>0&&L.x[0]!==void 0);if(Te.length===0)return z;const D=O?[O["xaxis.range[0]"],O["xaxis.range[1]"]]:[(W=Te[0])==null?void 0:W.x[Te[0].x.length-1e3],(ce=Te[0])==null?void 0:ce.x[Te[0].x.length-1]];return z=aI(z,D),z}catch(Te){console.log("error",Te)}}function $4(O){const z=new Date(O),W=`${z.getMonth()+1}`.padStart(2,"0"),ce=`${z.getDate()}`.padStart(2,"0"),Te=z.getFullYear(),D=`${z.getHours()}`.padStart(2,"0"),L=`${z.getMinutes()}`.padStart(2,"0"),t=`${z.getSeconds()}`.padStart(2,"0");return`${Te}-${W}-${ce} ${D}:${L}:${t}`}function sI({json:O,date:z,cmd:W,title:ce,globals:Te,theme:D,info:L}){var qe,$e;const t=P9();mr.useEffect(()=>{t&&t.capture("chart",L)},[]),O.layout.width=void 0,O.layout.height=void 0,($e=(qe=O.layout)==null?void 0:qe.title)!=null&&$e.text&&(O.layout.title.text="");const[b,d]=mr.useState(O),[e,w]=mr.useState({}),[y,_]=mr.useState(!1),[u,r]=mr.useState(ce),[n,l]=mr.useState({}),[o,s]=mr.useState(!1),[c,h]=mr.useState({name:""}),[x,m]=mr.useState(!1),[g,k]=mr.useState(null),[A,v]=mr.useState({old_nticks:{}}),[S,T]=mr.useState(!1),[p,M]=mr.useState(!1),[f,E]=mr.useState(!1),[I,B]=mr.useState(b),[N,V]=mr.useState([]),[j,$]=mr.useState(!1),[ee,H]=mr.useState(!0),[J,Q]=mr.useState(!1),[Z,K]=mr.useState(!1),[ae,se]=mr.useState(!1),[he,fe]=mr.useState({}),[ie,oe]=mr.useState([]),[le,ge]=mr.useState([]);function ye(Ye){Ye.layout.datarevision=Ye.layout.datarevision?Ye.layout.datarevision+1:1,B(Ye),g&&I&&bf.react(g,Ye.data,Ye.layout)}const me=()=>h({name:""}),be=mr.useCallback(Ye=>{var De,Be,Ge,tt,nt;console.log("onDeleteAnnotation",Ye);const _e=(Be=(De=I==null?void 0:I.layout)==null?void 0:De.annotations)==null?void 0:Be.findIndex(ft=>ft.text===Ye.text);console.log("index",_e),_e>-1&&((tt=(Ge=I==null?void 0:I.layout)==null?void 0:Ge.annotations)==null||tt.splice(_e,1),ye({...I}),V((nt=I==null?void 0:I.layout)==null?void 0:nt.annotations))},[I]),Se=mr.useCallback(Ye=>{V9({plotData:I,popupData:Ye,setPlotData:ye,setModal:h,setOnAnnotationClick:fe,setAnnotations:V,onAnnotationClick:he,ohlcAnnotation:ie,setOhlcAnnotation:oe,annotations:N,plotDiv:g})},[I,he,ie,N,g]);mr.useEffect(()=>{p&&(h({name:"downloadFinished"}),M(!1))},[p]),mr.useEffect(()=>{n&&Object.keys(n).length>0&&(Object.keys(n).forEach(Ye=>{I.layout[Ye].title={...I.layout[Ye].title||{},text:n[Ye]},I.layout[Ye].showticklabels=!0}),l({}))},[n]);function Ee(Ye){const _e=g.layout.shapes;if(!_e||_e.length===0)return;const De=_e[_e.length-1];De.line.color=Ye,bf.update(g,{},{shapes:_e})}function Ce(Ye,_e=!1){const De=e[Ye]||document.querySelector(`[data-title="${Ye}"]`);_e?(De.style.border="transparent",De.style.boxShadow="none"):(De.style.border="1px solid rgba(0, 151, 222, 1.0)",De.style.borderRadius="5px",De.style.borderpadding="5px",De.style.boxShadow="0 0 5px rgba(0, 151, 222, 1.0)"),w({...e,[Ye]:De})}const Le=async(Ye,_e)=>{if(f){const De={..._e};oI({event:Ye,figure:De}).then(async Be=>{E4(Ye,Be).then(Ge=>{Ge.to_update&&(ge(Ge.yaxis_fixedrange),ye({...Be,layout:Ge.to_update}))})})}else{const De=await E4(Ye,_e);if(!De.to_update)return;ge(De.yaxis_fixedrange),ye({..._e,layout:De.to_update})}},Oe=mr.useCallback(()=>{const Ye="Auto Scale (Ctrl+Shift+A)",_e=e[Ye]||document.querySelector(`[data-title="${Ye}"]`);let De=!0;_e.style.border==="transparent"?(g.removeAllListeners("plotly_relayout"),De=!1,g.on("plotly_relayout",async Be=>{if(Be["xaxis.range[0]"]===void 0)return;const Ge=Be.relayout?0:300;if(!Be.relayout&&W1.test(Be["xaxis.range[0]"].toString().replace(" ","T"))){const tt=new Date(Be["xaxis.range[0]"].replace(" ","T")),nt=new Date(Be["xaxis.range[1]"].replace(" ","T"));if(nt.getTime()-tt.getTime()<36e5*2){const ft=new Date(tt.getTime()-72e5),At=new Date(nt.getTime()+36e5*2);return Be["xaxis.range[0]"]=$4(ft),Be["xaxis.range[1]"]=$4(At),Be.relayout=!0,bf.relayout(g,Be)}}A4.debounce(async()=>{Le(Be,b)},Ge)()})):(g.removeAllListeners("plotly_relayout"),le.forEach(Be=>{g.layout[Be].fixedrange=!1}),ge([]),f&&g.on("plotly_relayout",A4.debounce(async Be=>{Be["xaxis.range[0]"]!==void 0&&Le(Be,b)},300))),Ce(Ye,De)},[e,f,Le,b,g,le]);function We(){const Ye="Edit Color (Ctrl+E)",_e=e[Ye]||document.querySelector(`[data-title="${Ye}"]`);let De=!0;_e.style.border==="transparent"&&(De=!1),se(!De),Ce(Ye,De)}mr.useEffect(()=>{J&&(console.log("activateAutoScale",!J),Oe(),Q(!1))},[J]),mr.useEffect(()=>{Z&&(We(),K(!1))},[Z]),mr.useEffect(()=>{if(j)try{console.log("changeTheme",j);const Ye=b==null?void 0:b.data.filter(nt=>{var ft;return((ft=nt==null?void 0:nt.name)==null?void 0:ft.trim())==="Volume"}),_e=!ee;window.document.body.style.backgroundColor=_e?"#000":"#fff",b.layout.font={...b.layout.font||{},color:_e?"#fff":"#000"};const De=_e?nd.sunIcon:nd.moonIcon;document.querySelector('[data-title="Change Theme"]').getElementsByTagName("path")[0].setAttribute("d",De.path),document.querySelector('[data-title="Change Theme"]').getElementsByTagName("svg")[0].setAttribute("viewBox",De.viewBox);const tt=_e?{"#00ACFF0":"#00ACFF","#e4003a":"#e4003a"}:{"#e4003a":"#e4003a","#00ACFF":"#00ACFF"};Ye.forEach(nt=>{nt.type==="bar"&&Array.isArray(nt.marker.color)&&(nt.marker.color=nt.marker.color.map(ft=>tt[ft]||ft))}),b.layout.template=_e?X9:K9,ye({...b}),H(_e),$(!1)}catch(Ye){console.log("error",Ye)}},[j]),mr.useEffect(()=>{var Ye,_e;if(o){H(!0),Q(!1);const De=["Download CSV","Download Chart as Image","Overlay chart from CSV","Add Text","Change Titles","Auto Scale (Ctrl+Shift+A)","Reset Axes"],Be=document.querySelector('[data-title="Autoscale"]');Be&&(Be.getElementsByTagName("path")[0].setAttribute("d",bf.Icons.home.path),Be.setAttribute("data-title","Reset Axes")),window.MODEBAR=document.getElementsByClassName("modebar-container")[0];const Ge=window.MODEBAR.getElementsByClassName("modebar-btn");if(window.MODEBAR.style.cssText=`${window.MODEBAR.style.cssText}; display:flex;`,Ge){const tt={};for(let nt=0;nt0&&(ye(ft),v(At),bf.update(g,{},nt))}),D!=="dark"&&$(!0)}},[o]);const Ie=mr.useMemo(()=>Kr(rI,{onInitialized:(Ye,_e)=>{g||_e&&(_e.globals=Te,k(_e)),o||s(!0)},className:"w-full h-full",divId:"plotlyChart",data:I.data,layout:I.layout,config:QC({setModal:h,changeTheme:$,autoScaling:Q,Loading:m,changeColor:K,downloadFinished:M})}),[g,b,o,I,Te,k,s,h,$,Q,m,Ee,M]),Ve=mr.useMemo(()=>{var Ye,_e;return Kr(PC,{title:(Ye=c==null?void 0:c.data)==null?void 0:Ye.title,content:(_e=c==null?void 0:c.data)==null?void 0:_e.content,open:(c==null?void 0:c.name)==="alertDialog",close:me})},[c,me]),Pe=mr.useMemo(()=>Kr(OC,{addOverlay:Ye=>{console.log(Ye),Ye.layout.showlegend=!0,d(Ye),ye(Ye)},plotlyData:b,setLoading:m,open:(c==null?void 0:c.name)==="overlayChart",close:me}),[c,I,me,ye,m]),de=mr.useMemo(()=>Kr(FC,{updateTitle:Ye=>r(Ye),updateAxesTitles:Ye=>l(Ye),defaultTitle:u,plotlyData:I,open:(c==null?void 0:c.name)==="titleDialog",close:me}),[c,I,u,me]),Me=mr.useMemo(()=>Kr(RC,{popupData:(c==null?void 0:c.name)==="textDialog"?c==null?void 0:c.data:null,open:(c==null?void 0:c.name)==="textDialog",close:me,addAnnotation:Ye=>Se(Ye),deleteAnnotation:Ye=>be(Ye)}),[c,Se,be,me,I,ye]),ke=mr.useMemo(()=>Kr(Y9,{open:ae,onColorChange:Ee}),[ae,Ee]),He=mr.useMemo(()=>Kr(LC,{open:(c==null?void 0:c.name)==="downloadFinished",close:me}),[c,me]),Fe=mr.useMemo(()=>Kr(eI,{setModal:h,Loading:m,changeColor:K,downloadFinished:M}),[h,m,K,M]);return ja("div",{className:"relative h-full",children:[x&&Kr("div",{className:"absolute inset-0 flex items-center justify-center z-[100]",children:ja("svg",{className:"animate-spin h-20 w-20 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Kr("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Kr("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]})}),ja("div",{id:"loading",className:"saving",children:[Kr("div",{id:"loading_text",className:"loading_text"}),Kr("div",{id:"loader",className:"loader"})]}),Ve,Pe,de,Me,ke,He,Fe,ja("div",{className:"relative h-full",id:"MainChart",children:[ja("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",children:[Kr("div",{className:"w-1/3",children:Kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:Kr("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),Kr("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:u}),ja("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(z).replace(/:\d\d /," "),Kr("br",{}),Kr("span",{className:"text-grey-400",children:W})]})]}),Kr("div",{className:L9("w-full sm:pb-12",{"h-[calc(100%-10px)]":S,"h-[calc(100%-50px)]":!S}),children:Ie})]})]})}const lI=Jx.memo(sI);function uI(){const[O,z]=mr.useState(null),[W,ce]=mr.useState({});mr.useEffect(()=>{{const L=setInterval(()=>{if(window.json_data){const t=window.json_data;console.log(t),z(t),clearInterval(L)}},100);return()=>clearInterval(L)}},[]);const D=(L=>{var y,_,u,r;if(!L)return null;const t={added_traces:[],csv_yaxis_id:null,cmd_src_idx:null,cmd_idx:null,cmd_src:"",old_margin:null,title:""},b=(_=(y=L.layout)==null?void 0:y.title)==null?void 0:_.text.replace(/ -/g,"").replace(/-/g,"").replace(/|<\/b>/g,"").replace(/ /g,"_"),d=new Date().toISOString().slice(0,10).replace(/-/g,""),e=new Date().toISOString().slice(11,19).replace(/:/g,"");window.title=`openbb_${b}_${d}_${e}`.replace(/_{2,}/g,"_"),L.layout.annotations!==void 0&&L.layout.annotations.forEach(function(n){if(n.text!==void 0&&n.text[0]==="/"){t.cmd_src=n.text,t.cmd_idx=L.layout.annotations.indexOf(n),n.text="";const l=L.layout.margin;t.old_margin={...l},l.t!==void 0&&l.t>40&&(l.t=40),L.cmd==="/equity/price/historical"&&(l.r-=50)}}),L.data.forEach(function(n){n.name!==void 0&&(n.hoverlabel={namelength:-1})});const w=((r=(u=L.layout)==null?void 0:u.title)==null?void 0:r.text)||"OpenBB Platform";return t.title=w,{data:L,date:new Date,globals:t,cmd:L.command_location,posthog:L.posthog,python_version:L.python_version,pywry_version:L.pywry_version,terminal_version:L.terminal_version,theme:L.theme,title:w}})(O);if(D){D.posthog.collect_logs&&!W&&ce({api_host:"https://app.posthog.com",autocapture:{css_selector_allowlist:[".ph-capture"]},capture_pageview:!1,loaded:function(d){const e=(D==null?void 0:D.log_id)||"";e!==""&&e!=="REPLACE_ME"&&d.identify(e),d.onFeatureFlags(function(){d.isFeatureEnabled("record-pywry",{send_event:!1})||d.stopSessionRecording(),d.isFeatureEnabled("collect-logs-pywry",{send_event:!1})?d.has_opted_out_capturing()&&d.opt_in_capturing():d.opt_out_capturing()})}});const L={INFO:{command:D.cmd,title:D.title,date:D.date,python_version:D.python_version,pywry_version:D.pywry_version,terminal_version:D.terminal_version}},t=Kr(lI,{json:D.data,date:D.date,cmd:D.cmd,title:D.title,globals:D.globals,theme:D.theme,info:L});return D.posthog.collect_logs&&W?Kr(I9,{apiKey:"phc_vhssDAMod5qIplznQ75Kdgz4aB1qPFmeVmfEOZ4hkRw",options:W,children:t}):t}else return Kr("div",{className:"absolute inset-0 flex items-center justify-center z-[100]",children:ja("svg",{className:"animate-spin h-20 w-20 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Kr("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),Kr("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8z"})]})})}const cI=document.getElementById("root");uk(cI).render(Kr(uI,{}));